game-min2.js 658 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663466446654666466746684669467046714672467346744675467646774678467946804681468246834684468546864687468846894690469146924693469446954696469746984699470047014702470347044705470647074708470947104711471247134714471547164717471847194720472147224723472447254726472747284729473047314732473347344735473647374738473947404741474247434744474547464747474847494750475147524753475447554756475747584759476047614762476347644765476647674768476947704771477247734774477547764777477847794780478147824783478447854786478747884789479047914792479347944795479647974798479948004801480248034804480548064807480848094810481148124813481448154816481748184819482048214822482348244825482648274828482948304831483248334834483548364837483848394840484148424843484448454846484748484849485048514852485348544855485648574858485948604861486248634864486548664867486848694870487148724873487448754876487748784879488048814882488348844885488648874888488948904891489248934894489548964897489848994900490149024903490449054906490749084909491049114912491349144915491649174918491949204921492249234924492549264927492849294930493149324933493449354936493749384939494049414942494349444945494649474948494949504951495249534954495549564957495849594960496149624963496449654966496749684969497049714972497349744975497649774978497949804981498249834984498549864987498849894990499149924993499449954996499749984999500050015002500350045005500650075008500950105011501250135014501550165017501850195020502150225023502450255026502750285029503050315032503350345035503650375038503950405041504250435044504550465047504850495050505150525053505450555056505750585059506050615062506350645065506650675068506950705071507250735074507550765077507850795080508150825083508450855086508750885089509050915092509350945095509650975098509951005101510251035104510551065107510851095110511151125113511451155116511751185119512051215122512351245125512651275128512951305131513251335134513551365137513851395140514151425143514451455146514751485149515051515152515351545155515651575158515951605161516251635164516551665167516851695170517151725173517451755176517751785179518051815182518351845185518651875188518951905191519251935194519551965197519851995200520152025203520452055206520752085209521052115212521352145215521652175218521952205221522252235224522552265227522852295230523152325233523452355236523752385239524052415242524352445245524652475248524952505251525252535254525552565257525852595260526152625263526452655266526752685269527052715272527352745275527652775278527952805281528252835284528552865287528852895290529152925293529452955296529752985299530053015302530353045305530653075308530953105311531253135314531553165317531853195320532153225323532453255326532753285329533053315332533353345335533653375338533953405341534253435344534553465347534853495350535153525353535453555356535753585359536053615362536353645365536653675368536953705371537253735374537553765377537853795380538153825383538453855386538753885389539053915392539353945395539653975398539954005401540254035404540554065407540854095410541154125413541454155416541754185419542054215422542354245425542654275428542954305431543254335434543554365437543854395440544154425443544454455446544754485449545054515452545354545455545654575458545954605461546254635464546554665467546854695470547154725473547454755476547754785479548054815482548354845485548654875488548954905491549254935494549554965497549854995500550155025503550455055506550755085509551055115512551355145515551655175518551955205521552255235524552555265527552855295530553155325533553455355536553755385539554055415542554355445545554655475548554955505551555255535554555555565557555855595560556155625563556455655566556755685569557055715572557355745575557655775578557955805581558255835584558555865587558855895590559155925593559455955596559755985599560056015602560356045605560656075608560956105611561256135614561556165617561856195620562156225623562456255626562756285629563056315632563356345635563656375638563956405641564256435644564556465647564856495650565156525653565456555656565756585659566056615662566356645665566656675668566956705671567256735674567556765677567856795680568156825683568456855686568756885689569056915692569356945695569656975698569957005701570257035704570557065707570857095710571157125713571457155716571757185719572057215722572357245725572657275728572957305731573257335734573557365737573857395740574157425743574457455746574757485749575057515752575357545755575657575758575957605761576257635764576557665767576857695770577157725773577457755776577757785779578057815782578357845785578657875788578957905791579257935794579557965797579857995800580158025803580458055806580758085809581058115812581358145815581658175818581958205821582258235824582558265827582858295830583158325833583458355836583758385839584058415842584358445845584658475848584958505851585258535854585558565857585858595860586158625863586458655866586758685869587058715872587358745875587658775878587958805881588258835884588558865887588858895890589158925893589458955896589758985899590059015902590359045905590659075908590959105911591259135914591559165917591859195920592159225923592459255926592759285929593059315932593359345935593659375938593959405941594259435944594559465947594859495950595159525953595459555956595759585959596059615962596359645965596659675968596959705971597259735974597559765977597859795980598159825983598459855986598759885989599059915992599359945995599659975998599960006001600260036004600560066007600860096010601160126013601460156016601760186019602060216022602360246025602660276028602960306031603260336034603560366037603860396040604160426043604460456046604760486049605060516052605360546055605660576058605960606061606260636064606560666067606860696070607160726073607460756076607760786079608060816082608360846085608660876088608960906091609260936094609560966097609860996100610161026103610461056106610761086109611061116112611361146115611661176118611961206121612261236124612561266127612861296130613161326133613461356136613761386139614061416142614361446145614661476148614961506151615261536154615561566157615861596160616161626163616461656166616761686169617061716172617361746175617661776178617961806181618261836184618561866187618861896190619161926193619461956196619761986199620062016202620362046205620662076208620962106211621262136214621562166217621862196220622162226223622462256226622762286229623062316232623362346235623662376238623962406241624262436244624562466247624862496250625162526253625462556256625762586259626062616262626362646265626662676268626962706271627262736274627562766277627862796280628162826283628462856286628762886289629062916292629362946295629662976298629963006301630263036304630563066307630863096310631163126313631463156316631763186319632063216322632363246325632663276328632963306331633263336334633563366337633863396340634163426343634463456346634763486349635063516352635363546355635663576358635963606361636263636364636563666367636863696370637163726373637463756376637763786379638063816382638363846385638663876388638963906391639263936394639563966397639863996400640164026403640464056406640764086409641064116412641364146415641664176418641964206421642264236424642564266427642864296430643164326433643464356436643764386439644064416442644364446445644664476448644964506451645264536454645564566457645864596460646164626463646464656466646764686469647064716472647364746475647664776478647964806481648264836484648564866487648864896490649164926493649464956496649764986499650065016502650365046505650665076508650965106511651265136514651565166517651865196520652165226523652465256526652765286529653065316532653365346535653665376538653965406541654265436544654565466547654865496550655165526553655465556556655765586559656065616562656365646565656665676568656965706571657265736574657565766577657865796580658165826583658465856586658765886589659065916592659365946595659665976598659966006601660266036604660566066607660866096610661166126613661466156616661766186619662066216622662366246625662666276628662966306631663266336634663566366637663866396640664166426643664466456646664766486649665066516652665366546655665666576658665966606661666266636664666566666667666866696670667166726673667466756676667766786679668066816682668366846685668666876688668966906691669266936694669566966697669866996700670167026703670467056706670767086709671067116712671367146715671667176718671967206721672267236724672567266727672867296730673167326733673467356736673767386739674067416742674367446745674667476748674967506751675267536754675567566757675867596760676167626763676467656766676767686769677067716772677367746775677667776778677967806781678267836784678567866787678867896790679167926793679467956796679767986799680068016802680368046805680668076808680968106811681268136814681568166817681868196820682168226823682468256826682768286829683068316832683368346835683668376838683968406841684268436844684568466847684868496850685168526853685468556856685768586859686068616862686368646865686668676868686968706871687268736874687568766877687868796880688168826883688468856886688768886889689068916892689368946895689668976898689969006901690269036904690569066907690869096910691169126913691469156916691769186919692069216922692369246925692669276928692969306931693269336934693569366937693869396940694169426943694469456946694769486949695069516952695369546955695669576958695969606961696269636964696569666967696869696970697169726973697469756976697769786979698069816982698369846985698669876988698969906991699269936994699569966997699869997000700170027003700470057006700770087009701070117012701370147015701670177018701970207021702270237024702570267027702870297030703170327033703470357036703770387039704070417042704370447045704670477048704970507051705270537054705570567057705870597060706170627063706470657066706770687069707070717072707370747075707670777078707970807081708270837084708570867087708870897090709170927093709470957096709770987099710071017102710371047105710671077108710971107111711271137114711571167117711871197120712171227123712471257126712771287129713071317132713371347135713671377138713971407141714271437144714571467147714871497150715171527153715471557156715771587159716071617162716371647165716671677168716971707171717271737174717571767177717871797180718171827183718471857186718771887189719071917192719371947195719671977198719972007201720272037204720572067207720872097210721172127213721472157216721772187219722072217222722372247225722672277228722972307231723272337234723572367237723872397240724172427243724472457246724772487249725072517252725372547255725672577258725972607261726272637264726572667267726872697270727172727273727472757276727772787279728072817282728372847285728672877288728972907291729272937294729572967297729872997300730173027303730473057306730773087309731073117312731373147315731673177318731973207321732273237324732573267327732873297330733173327333733473357336733773387339734073417342734373447345734673477348734973507351735273537354735573567357735873597360736173627363736473657366736773687369737073717372737373747375737673777378737973807381738273837384738573867387738873897390739173927393739473957396739773987399740074017402740374047405740674077408740974107411741274137414741574167417741874197420742174227423742474257426742774287429743074317432743374347435743674377438743974407441744274437444744574467447744874497450745174527453745474557456745774587459746074617462746374647465746674677468746974707471747274737474747574767477747874797480748174827483748474857486748774887489749074917492749374947495749674977498749975007501750275037504750575067507750875097510751175127513751475157516751775187519752075217522752375247525752675277528752975307531753275337534753575367537753875397540754175427543754475457546754775487549755075517552755375547555755675577558755975607561756275637564756575667567756875697570757175727573757475757576757775787579758075817582758375847585758675877588758975907591759275937594759575967597759875997600760176027603760476057606760776087609761076117612761376147615761676177618761976207621762276237624762576267627762876297630763176327633763476357636763776387639764076417642764376447645764676477648764976507651765276537654765576567657765876597660766176627663766476657666766776687669767076717672767376747675767676777678767976807681768276837684768576867687768876897690769176927693769476957696769776987699770077017702770377047705770677077708770977107711771277137714771577167717771877197720772177227723772477257726772777287729773077317732773377347735773677377738773977407741774277437744774577467747774877497750775177527753775477557756775777587759776077617762776377647765776677677768776977707771777277737774777577767777777877797780778177827783778477857786778777887789779077917792779377947795779677977798779978007801780278037804780578067807780878097810781178127813781478157816781778187819782078217822782378247825782678277828782978307831783278337834783578367837783878397840784178427843784478457846784778487849785078517852785378547855785678577858785978607861786278637864786578667867786878697870787178727873787478757876787778787879788078817882788378847885788678877888788978907891789278937894789578967897789878997900790179027903790479057906790779087909791079117912791379147915791679177918791979207921792279237924792579267927792879297930793179327933793479357936793779387939794079417942794379447945794679477948794979507951795279537954795579567957795879597960796179627963796479657966796779687969797079717972797379747975797679777978797979807981798279837984798579867987798879897990799179927993799479957996799779987999800080018002800380048005800680078008800980108011801280138014801580168017801880198020802180228023802480258026802780288029803080318032803380348035803680378038803980408041804280438044804580468047804880498050805180528053805480558056805780588059806080618062806380648065806680678068806980708071807280738074807580768077807880798080808180828083808480858086808780888089809080918092809380948095809680978098809981008101810281038104810581068107810881098110811181128113811481158116811781188119812081218122812381248125812681278128812981308131813281338134813581368137813881398140814181428143814481458146814781488149815081518152815381548155815681578158815981608161816281638164816581668167816881698170817181728173817481758176817781788179818081818182818381848185818681878188818981908191819281938194819581968197819881998200820182028203820482058206820782088209821082118212821382148215821682178218821982208221822282238224822582268227822882298230823182328233823482358236823782388239824082418242824382448245824682478248824982508251825282538254825582568257825882598260826182628263826482658266826782688269827082718272827382748275827682778278827982808281828282838284828582868287828882898290829182928293829482958296829782988299830083018302830383048305830683078308830983108311831283138314831583168317831883198320832183228323832483258326832783288329833083318332833383348335833683378338833983408341834283438344834583468347834883498350835183528353835483558356835783588359836083618362836383648365836683678368836983708371837283738374837583768377837883798380838183828383838483858386838783888389839083918392839383948395839683978398839984008401840284038404840584068407840884098410841184128413841484158416841784188419842084218422842384248425842684278428842984308431843284338434843584368437843884398440844184428443844484458446844784488449845084518452845384548455845684578458845984608461846284638464846584668467846884698470847184728473847484758476847784788479848084818482848384848485848684878488848984908491849284938494849584968497849884998500850185028503850485058506850785088509851085118512851385148515851685178518851985208521852285238524852585268527852885298530853185328533853485358536853785388539854085418542854385448545854685478548854985508551855285538554855585568557855885598560856185628563856485658566856785688569857085718572857385748575857685778578857985808581858285838584858585868587858885898590859185928593859485958596859785988599860086018602860386048605860686078608860986108611861286138614861586168617861886198620862186228623862486258626862786288629863086318632863386348635863686378638863986408641864286438644864586468647864886498650865186528653865486558656865786588659866086618662866386648665866686678668866986708671867286738674867586768677867886798680868186828683868486858686868786888689869086918692869386948695869686978698869987008701870287038704870587068707870887098710871187128713871487158716871787188719872087218722872387248725872687278728872987308731873287338734873587368737873887398740874187428743874487458746874787488749875087518752875387548755875687578758875987608761876287638764876587668767876887698770877187728773877487758776877787788779878087818782878387848785878687878788878987908791879287938794879587968797879887998800880188028803880488058806880788088809881088118812881388148815881688178818881988208821882288238824882588268827882888298830883188328833883488358836883788388839884088418842884388448845884688478848884988508851885288538854885588568857885888598860886188628863886488658866886788688869887088718872887388748875887688778878887988808881888288838884888588868887888888898890889188928893889488958896889788988899890089018902890389048905890689078908890989108911891289138914891589168917891889198920892189228923892489258926892789288929893089318932893389348935893689378938893989408941894289438944894589468947894889498950895189528953895489558956895789588959896089618962896389648965896689678968896989708971897289738974897589768977897889798980898189828983898489858986898789888989899089918992899389948995899689978998899990009001900290039004900590069007900890099010901190129013901490159016901790189019902090219022902390249025902690279028902990309031903290339034903590369037903890399040904190429043904490459046904790489049905090519052905390549055905690579058905990609061906290639064906590669067906890699070907190729073907490759076907790789079908090819082908390849085908690879088908990909091909290939094909590969097909890999100910191029103910491059106910791089109911091119112911391149115911691179118911991209121912291239124912591269127912891299130913191329133913491359136913791389139914091419142914391449145914691479148914991509151915291539154915591569157915891599160916191629163916491659166916791689169917091719172917391749175917691779178917991809181918291839184918591869187918891899190919191929193919491959196919791989199920092019202920392049205920692079208920992109211921292139214921592169217921892199220922192229223922492259226922792289229923092319232923392349235923692379238923992409241924292439244924592469247924892499250925192529253925492559256925792589259926092619262926392649265926692679268926992709271927292739274927592769277927892799280928192829283928492859286928792889289929092919292929392949295929692979298929993009301930293039304930593069307930893099310931193129313931493159316931793189319932093219322932393249325932693279328932993309331933293339334933593369337933893399340934193429343934493459346934793489349935093519352935393549355935693579358935993609361936293639364936593669367936893699370937193729373937493759376937793789379938093819382938393849385938693879388938993909391939293939394939593969397939893999400940194029403940494059406940794089409941094119412941394149415941694179418941994209421942294239424942594269427942894299430943194329433943494359436943794389439944094419442944394449445944694479448944994509451945294539454945594569457945894599460946194629463946494659466946794689469947094719472947394749475947694779478947994809481948294839484948594869487948894899490949194929493949494959496949794989499950095019502950395049505950695079508950995109511951295139514951595169517951895199520952195229523952495259526952795289529953095319532953395349535953695379538953995409541954295439544954595469547954895499550955195529553955495559556955795589559956095619562956395649565956695679568956995709571957295739574957595769577957895799580958195829583958495859586958795889589959095919592959395949595959695979598959996009601960296039604960596069607960896099610961196129613961496159616961796189619962096219622962396249625962696279628962996309631963296339634963596369637963896399640964196429643964496459646964796489649965096519652965396549655965696579658965996609661966296639664966596669667966896699670967196729673967496759676967796789679968096819682968396849685968696879688968996909691969296939694969596969697969896999700970197029703970497059706970797089709971097119712971397149715971697179718971997209721972297239724972597269727972897299730973197329733973497359736973797389739974097419742974397449745974697479748974997509751975297539754975597569757975897599760976197629763976497659766976797689769977097719772977397749775977697779778977997809781978297839784978597869787978897899790979197929793979497959796979797989799980098019802980398049805980698079808980998109811981298139814981598169817981898199820982198229823982498259826982798289829983098319832983398349835983698379838983998409841984298439844984598469847984898499850985198529853985498559856985798589859986098619862986398649865986698679868986998709871987298739874987598769877987898799880988198829883988498859886988798889889989098919892989398949895989698979898989999009901990299039904990599069907990899099910991199129913991499159916991799189919992099219922992399249925992699279928992999309931993299339934993599369937993899399940994199429943994499459946994799489949995099519952995399549955995699579958995999609961996299639964996599669967996899699970997199729973997499759976997799789979998099819982998399849985998699879988998999909991999299939994999599969997999899991000010001100021000310004100051000610007100081000910010100111001210013100141001510016100171001810019100201002110022100231002410025100261002710028100291003010031100321003310034100351003610037100381003910040100411004210043100441004510046100471004810049100501005110052100531005410055100561005710058100591006010061100621006310064100651006610067100681006910070100711007210073100741007510076100771007810079100801008110082100831008410085100861008710088100891009010091100921009310094100951009610097100981009910100101011010210103101041010510106101071010810109101101011110112101131011410115101161011710118101191012010121101221012310124101251012610127101281012910130101311013210133101341013510136101371013810139101401014110142101431014410145101461014710148101491015010151101521015310154101551015610157101581015910160101611016210163101641016510166101671016810169101701017110172101731017410175101761017710178101791018010181101821018310184101851018610187101881018910190101911019210193101941019510196101971019810199102001020110202102031020410205102061020710208102091021010211102121021310214102151021610217102181021910220102211022210223102241022510226102271022810229102301023110232102331023410235102361023710238102391024010241102421024310244102451024610247102481024910250102511025210253102541025510256102571025810259102601026110262102631026410265102661026710268102691027010271102721027310274102751027610277102781027910280102811028210283102841028510286102871028810289102901029110292102931029410295102961029710298102991030010301103021030310304103051030610307103081030910310103111031210313103141031510316103171031810319103201032110322103231032410325103261032710328103291033010331103321033310334103351033610337103381033910340103411034210343103441034510346103471034810349103501035110352103531035410355103561035710358103591036010361103621036310364103651036610367103681036910370103711037210373103741037510376103771037810379103801038110382103831038410385103861038710388103891039010391103921039310394103951039610397103981039910400104011040210403104041040510406104071040810409104101041110412104131041410415104161041710418104191042010421104221042310424104251042610427104281042910430104311043210433104341043510436104371043810439104401044110442104431044410445104461044710448104491045010451104521045310454104551045610457104581045910460104611046210463104641046510466104671046810469104701047110472104731047410475104761047710478104791048010481104821048310484104851048610487104881048910490104911049210493104941049510496104971049810499105001050110502105031050410505105061050710508105091051010511105121051310514105151051610517105181051910520105211052210523105241052510526105271052810529105301053110532105331053410535105361053710538105391054010541105421054310544105451054610547105481054910550105511055210553105541055510556105571055810559105601056110562105631056410565105661056710568105691057010571105721057310574105751057610577105781057910580105811058210583105841058510586105871058810589105901059110592105931059410595105961059710598105991060010601106021060310604106051060610607106081060910610106111061210613106141061510616106171061810619106201062110622106231062410625106261062710628106291063010631106321063310634106351063610637106381063910640106411064210643106441064510646106471064810649106501065110652106531065410655106561065710658106591066010661106621066310664106651066610667106681066910670106711067210673106741067510676106771067810679106801068110682106831068410685106861068710688106891069010691106921069310694106951069610697106981069910700107011070210703107041070510706107071070810709107101071110712107131071410715107161071710718107191072010721107221072310724107251072610727107281072910730107311073210733107341073510736107371073810739107401074110742107431074410745107461074710748107491075010751107521075310754107551075610757107581075910760107611076210763107641076510766107671076810769107701077110772107731077410775107761077710778107791078010781107821078310784107851078610787107881078910790107911079210793107941079510796107971079810799108001080110802108031080410805108061080710808108091081010811108121081310814108151081610817108181081910820108211082210823108241082510826108271082810829108301083110832108331083410835108361083710838108391084010841108421084310844108451084610847108481084910850108511085210853108541085510856108571085810859108601086110862108631086410865108661086710868108691087010871108721087310874108751087610877108781087910880108811088210883108841088510886108871088810889108901089110892108931089410895108961089710898108991090010901109021090310904109051090610907109081090910910109111091210913109141091510916109171091810919109201092110922109231092410925109261092710928109291093010931109321093310934109351093610937109381093910940109411094210943109441094510946109471094810949109501095110952109531095410955109561095710958109591096010961109621096310964109651096610967109681096910970109711097210973109741097510976109771097810979109801098110982109831098410985109861098710988109891099010991109921099310994109951099610997109981099911000110011100211003110041100511006110071100811009110101101111012110131101411015110161101711018110191102011021110221102311024110251102611027110281102911030110311103211033110341103511036110371103811039110401104111042110431104411045110461104711048110491105011051110521105311054110551105611057110581105911060110611106211063110641106511066110671106811069110701107111072110731107411075110761107711078110791108011081110821108311084110851108611087110881108911090110911109211093110941109511096110971109811099111001110111102111031110411105111061110711108111091111011111111121111311114111151111611117111181111911120111211112211123111241112511126111271112811129111301113111132111331113411135111361113711138111391114011141111421114311144111451114611147111481114911150111511115211153111541115511156111571115811159111601116111162111631116411165111661116711168111691117011171111721117311174111751117611177111781117911180111811118211183111841118511186111871118811189111901119111192111931119411195111961119711198111991120011201112021120311204112051120611207112081120911210112111121211213112141121511216112171121811219112201122111222112231122411225112261122711228112291123011231112321123311234112351123611237112381123911240112411124211243112441124511246112471124811249112501125111252112531125411255112561125711258112591126011261112621126311264112651126611267112681126911270112711127211273112741127511276112771127811279112801128111282112831128411285112861128711288112891129011291112921129311294112951129611297112981129911300113011130211303113041130511306113071130811309113101131111312113131131411315113161131711318113191132011321113221132311324113251132611327113281132911330113311133211333113341133511336113371133811339113401134111342113431134411345113461134711348113491135011351113521135311354113551135611357113581135911360113611136211363113641136511366113671136811369113701137111372113731137411375113761137711378113791138011381113821138311384113851138611387113881138911390113911139211393113941139511396113971139811399114001140111402114031140411405114061140711408114091141011411114121141311414114151141611417114181141911420114211142211423114241142511426114271142811429114301143111432114331143411435114361143711438114391144011441114421144311444114451144611447114481144911450114511145211453114541145511456114571145811459114601146111462114631146411465114661146711468114691147011471114721147311474114751147611477114781147911480114811148211483114841148511486114871148811489114901149111492114931149411495114961149711498114991150011501115021150311504115051150611507115081150911510115111151211513115141151511516115171151811519115201152111522115231152411525115261152711528115291153011531115321153311534115351153611537115381153911540115411154211543115441154511546115471154811549115501155111552115531155411555115561155711558115591156011561115621156311564115651156611567115681156911570115711157211573115741157511576115771157811579115801158111582115831158411585115861158711588115891159011591115921159311594115951159611597115981159911600116011160211603116041160511606116071160811609116101161111612116131161411615116161161711618116191162011621116221162311624116251162611627116281162911630116311163211633116341163511636116371163811639116401164111642116431164411645116461164711648116491165011651116521165311654116551165611657116581165911660116611166211663116641166511666116671166811669116701167111672116731167411675116761167711678116791168011681116821168311684116851168611687116881168911690116911169211693116941169511696116971169811699117001170111702117031170411705117061170711708117091171011711117121171311714117151171611717117181171911720117211172211723117241172511726117271172811729117301173111732117331173411735117361173711738117391174011741117421174311744117451174611747117481174911750117511175211753117541175511756117571175811759117601176111762117631176411765117661176711768117691177011771117721177311774117751177611777117781177911780117811178211783117841178511786117871178811789117901179111792117931179411795117961179711798117991180011801118021180311804118051180611807118081180911810118111181211813118141181511816118171181811819118201182111822118231182411825118261182711828118291183011831118321183311834118351183611837118381183911840118411184211843118441184511846118471184811849118501185111852118531185411855118561185711858118591186011861118621186311864118651186611867118681186911870118711187211873118741187511876118771187811879118801188111882118831188411885118861188711888118891189011891118921189311894118951189611897118981189911900119011190211903119041190511906119071190811909119101191111912119131191411915119161191711918119191192011921119221192311924119251192611927119281192911930119311193211933119341193511936119371193811939119401194111942119431194411945119461194711948119491195011951119521195311954119551195611957119581195911960119611196211963119641196511966119671196811969119701197111972119731197411975119761197711978119791198011981119821198311984119851198611987119881198911990119911199211993119941199511996119971199811999120001200112002120031200412005120061200712008120091201012011120121201312014120151201612017120181201912020120211202212023120241202512026120271202812029120301203112032120331203412035120361203712038120391204012041120421204312044120451204612047120481204912050120511205212053120541205512056120571205812059120601206112062120631206412065120661206712068120691207012071120721207312074120751207612077120781207912080120811208212083120841208512086120871208812089120901209112092120931209412095120961209712098120991210012101121021210312104121051210612107121081210912110121111211212113121141211512116121171211812119121201212112122121231212412125121261212712128121291213012131121321213312134121351213612137121381213912140121411214212143121441214512146121471214812149121501215112152121531215412155121561215712158121591216012161121621216312164121651216612167121681216912170121711217212173121741217512176121771217812179121801218112182121831218412185121861218712188121891219012191121921219312194121951219612197121981219912200122011220212203122041220512206122071220812209122101221112212122131221412215122161221712218122191222012221122221222312224122251222612227122281222912230122311223212233122341223512236122371223812239122401224112242122431224412245122461224712248122491225012251122521225312254122551225612257122581225912260122611226212263122641226512266122671226812269122701227112272122731227412275122761227712278122791228012281122821228312284122851228612287122881228912290122911229212293122941229512296122971229812299123001230112302123031230412305123061230712308123091231012311123121231312314123151231612317123181231912320123211232212323123241232512326123271232812329123301233112332123331233412335123361233712338123391234012341123421234312344123451234612347123481234912350123511235212353123541235512356123571235812359123601236112362123631236412365123661236712368123691237012371123721237312374123751237612377123781237912380123811238212383123841238512386123871238812389123901239112392123931239412395123961239712398123991240012401124021240312404124051240612407124081240912410124111241212413124141241512416124171241812419124201242112422124231242412425124261242712428124291243012431124321243312434124351243612437124381243912440124411244212443124441244512446124471244812449124501245112452124531245412455124561245712458124591246012461124621246312464124651246612467124681246912470124711247212473124741247512476124771247812479124801248112482124831248412485124861248712488124891249012491124921249312494124951249612497124981249912500125011250212503125041250512506125071250812509125101251112512125131251412515125161251712518125191252012521125221252312524125251252612527125281252912530125311253212533125341253512536125371253812539125401254112542125431254412545125461254712548125491255012551125521255312554125551255612557125581255912560125611256212563125641256512566125671256812569125701257112572125731257412575125761257712578125791258012581125821258312584125851258612587125881258912590125911259212593125941259512596125971259812599126001260112602126031260412605126061260712608126091261012611126121261312614126151261612617126181261912620126211262212623126241262512626126271262812629126301263112632126331263412635126361263712638126391264012641126421264312644126451264612647126481264912650126511265212653126541265512656126571265812659126601266112662126631266412665126661266712668126691267012671126721267312674126751267612677126781267912680126811268212683126841268512686126871268812689126901269112692126931269412695126961269712698126991270012701127021270312704127051270612707127081270912710127111271212713127141271512716127171271812719127201272112722127231272412725127261272712728127291273012731127321273312734127351273612737127381273912740127411274212743127441274512746127471274812749127501275112752127531275412755127561275712758127591276012761127621276312764127651276612767127681276912770127711277212773127741277512776127771277812779127801278112782127831278412785127861278712788127891279012791127921279312794127951279612797127981279912800128011280212803128041280512806128071280812809128101281112812128131281412815128161281712818128191282012821128221282312824128251282612827128281282912830128311283212833128341283512836128371283812839128401284112842128431284412845128461284712848128491285012851128521285312854128551285612857128581285912860128611286212863128641286512866128671286812869128701287112872128731287412875128761287712878128791288012881128821288312884128851288612887128881288912890128911289212893128941289512896128971289812899129001290112902129031290412905129061290712908129091291012911129121291312914129151291612917129181291912920129211292212923129241292512926129271292812929129301293112932129331293412935129361293712938129391294012941129421294312944129451294612947129481294912950129511295212953129541295512956129571295812959129601296112962129631296412965129661296712968129691297012971129721297312974129751297612977129781297912980129811298212983129841298512986129871298812989129901299112992129931299412995129961299712998129991300013001130021300313004130051300613007130081300913010130111301213013130141301513016130171301813019130201302113022130231302413025130261302713028130291303013031130321303313034130351303613037130381303913040130411304213043130441304513046130471304813049130501305113052130531305413055130561305713058130591306013061130621306313064130651306613067130681306913070130711307213073130741307513076130771307813079130801308113082130831308413085130861308713088130891309013091130921309313094130951309613097130981309913100131011310213103131041310513106131071310813109131101311113112131131311413115131161311713118131191312013121131221312313124131251312613127131281312913130131311313213133131341313513136131371313813139131401314113142131431314413145131461314713148131491315013151131521315313154131551315613157131581315913160131611316213163131641316513166131671316813169131701317113172131731317413175131761317713178131791318013181131821318313184131851318613187131881318913190131911319213193131941319513196131971319813199132001320113202132031320413205132061320713208132091321013211132121321313214132151321613217132181321913220132211322213223132241322513226132271322813229132301323113232132331323413235132361323713238132391324013241132421324313244132451324613247132481324913250132511325213253132541325513256132571325813259132601326113262132631326413265132661326713268132691327013271132721327313274132751327613277132781327913280132811328213283132841328513286132871328813289132901329113292132931329413295132961329713298132991330013301133021330313304133051330613307133081330913310133111331213313133141331513316133171331813319133201332113322133231332413325133261332713328133291333013331133321333313334133351333613337133381333913340133411334213343133441334513346133471334813349133501335113352133531335413355133561335713358133591336013361133621336313364133651336613367133681336913370133711337213373133741337513376133771337813379133801338113382133831338413385133861338713388133891339013391133921339313394133951339613397133981339913400134011340213403134041340513406134071340813409134101341113412134131341413415134161341713418134191342013421134221342313424134251342613427134281342913430134311343213433134341343513436134371343813439134401344113442134431344413445134461344713448134491345013451134521345313454134551345613457134581345913460134611346213463134641346513466134671346813469134701347113472134731347413475134761347713478134791348013481134821348313484134851348613487134881348913490134911349213493134941349513496134971349813499135001350113502135031350413505135061350713508135091351013511135121351313514135151351613517135181351913520135211352213523135241352513526135271352813529135301353113532135331353413535135361353713538135391354013541135421354313544135451354613547135481354913550135511355213553135541355513556135571355813559135601356113562135631356413565135661356713568135691357013571135721357313574135751357613577135781357913580135811358213583135841358513586135871358813589135901359113592135931359413595135961359713598135991360013601136021360313604136051360613607136081360913610136111361213613136141361513616136171361813619136201362113622136231362413625136261362713628136291363013631136321363313634136351363613637136381363913640136411364213643136441364513646136471364813649136501365113652136531365413655136561365713658136591366013661136621366313664136651366613667136681366913670136711367213673136741367513676136771367813679136801368113682136831368413685136861368713688136891369013691136921369313694136951369613697136981369913700137011370213703137041370513706137071370813709137101371113712137131371413715137161371713718137191372013721137221372313724137251372613727137281372913730137311373213733137341373513736137371373813739137401374113742137431374413745137461374713748137491375013751137521375313754137551375613757137581375913760137611376213763137641376513766137671376813769137701377113772137731377413775137761377713778137791378013781137821378313784137851378613787137881378913790137911379213793137941379513796137971379813799138001380113802138031380413805138061380713808138091381013811138121381313814138151381613817138181381913820138211382213823138241382513826138271382813829138301383113832138331383413835138361383713838138391384013841138421384313844138451384613847138481384913850138511385213853138541385513856138571385813859138601386113862138631386413865138661386713868138691387013871138721387313874138751387613877138781387913880138811388213883138841388513886138871388813889138901389113892138931389413895138961389713898138991390013901139021390313904139051390613907139081390913910139111391213913139141391513916139171391813919139201392113922139231392413925139261392713928139291393013931139321393313934139351393613937139381393913940139411394213943139441394513946139471394813949139501395113952139531395413955139561395713958139591396013961139621396313964139651396613967139681396913970139711397213973139741397513976139771397813979139801398113982139831398413985139861398713988139891399013991139921399313994139951399613997139981399914000140011400214003140041400514006140071400814009140101401114012140131401414015140161401714018140191402014021140221402314024140251402614027140281402914030140311403214033140341403514036140371403814039140401404114042140431404414045140461404714048140491405014051140521405314054140551405614057140581405914060140611406214063140641406514066140671406814069140701407114072140731407414075140761407714078140791408014081140821408314084140851408614087140881408914090140911409214093140941409514096140971409814099141001410114102141031410414105141061410714108141091411014111141121411314114141151411614117141181411914120141211412214123141241412514126141271412814129141301413114132141331413414135141361413714138141391414014141141421414314144141451414614147141481414914150141511415214153141541415514156141571415814159141601416114162141631416414165141661416714168141691417014171141721417314174141751417614177141781417914180141811418214183141841418514186141871418814189141901419114192141931419414195141961419714198141991420014201142021420314204142051420614207142081420914210142111421214213142141421514216142171421814219142201422114222142231422414225142261422714228142291423014231142321423314234142351423614237142381423914240142411424214243142441424514246142471424814249142501425114252142531425414255142561425714258142591426014261142621426314264142651426614267142681426914270142711427214273142741427514276142771427814279142801428114282142831428414285142861428714288142891429014291142921429314294142951429614297142981429914300143011430214303143041430514306143071430814309143101431114312143131431414315143161431714318143191432014321143221432314324143251432614327143281432914330143311433214333143341433514336143371433814339143401434114342143431434414345143461434714348143491435014351143521435314354143551435614357143581435914360143611436214363143641436514366143671436814369143701437114372143731437414375143761437714378143791438014381143821438314384143851438614387143881438914390143911439214393143941439514396143971439814399144001440114402144031440414405144061440714408144091441014411144121441314414144151441614417144181441914420144211442214423144241442514426144271442814429144301443114432144331443414435144361443714438144391444014441144421444314444144451444614447144481444914450144511445214453144541445514456144571445814459144601446114462144631446414465144661446714468144691447014471144721447314474144751447614477144781447914480144811448214483144841448514486144871448814489144901449114492144931449414495144961449714498144991450014501145021450314504145051450614507145081450914510145111451214513145141451514516145171451814519145201452114522145231452414525145261452714528145291453014531145321453314534145351453614537145381453914540145411454214543145441454514546145471454814549145501455114552145531455414555145561455714558145591456014561145621456314564145651456614567145681456914570145711457214573145741457514576145771457814579145801458114582145831458414585145861458714588145891459014591145921459314594145951459614597145981459914600146011460214603146041460514606146071460814609146101461114612146131461414615146161461714618146191462014621146221462314624146251462614627146281462914630146311463214633146341463514636146371463814639146401464114642146431464414645146461464714648146491465014651146521465314654146551465614657146581465914660146611466214663146641466514666146671466814669146701467114672146731467414675146761467714678146791468014681146821468314684146851468614687146881468914690146911469214693146941469514696146971469814699147001470114702147031470414705147061470714708147091471014711147121471314714147151471614717147181471914720147211472214723147241472514726147271472814729147301473114732147331473414735147361473714738147391474014741147421474314744147451474614747147481474914750147511475214753147541475514756147571475814759147601476114762147631476414765147661476714768147691477014771147721477314774147751477614777147781477914780147811478214783147841478514786147871478814789147901479114792147931479414795147961479714798147991480014801148021480314804148051480614807148081480914810148111481214813148141481514816148171481814819148201482114822148231482414825148261482714828148291483014831148321483314834148351483614837148381483914840148411484214843148441484514846148471484814849148501485114852148531485414855148561485714858148591486014861148621486314864148651486614867148681486914870148711487214873148741487514876148771487814879148801488114882148831488414885148861488714888148891489014891148921489314894148951489614897148981489914900149011490214903149041490514906149071490814909149101491114912149131491414915149161491714918149191492014921149221492314924149251492614927149281492914930149311493214933149341493514936149371493814939149401494114942149431494414945149461494714948149491495014951149521495314954149551495614957149581495914960149611496214963149641496514966149671496814969149701497114972149731497414975149761497714978149791498014981149821498314984149851498614987149881498914990149911499214993149941499514996149971499814999150001500115002150031500415005150061500715008150091501015011150121501315014150151501615017150181501915020150211502215023150241502515026150271502815029150301503115032150331503415035150361503715038150391504015041150421504315044150451504615047150481504915050150511505215053150541505515056150571505815059150601506115062150631506415065150661506715068150691507015071150721507315074150751507615077150781507915080150811508215083150841508515086150871508815089150901509115092150931509415095150961509715098150991510015101151021510315104151051510615107151081510915110151111511215113151141511515116151171511815119151201512115122151231512415125151261512715128151291513015131151321513315134151351513615137151381513915140151411514215143151441514515146151471514815149151501515115152151531515415155151561515715158151591516015161151621516315164151651516615167151681516915170151711517215173151741517515176151771517815179151801518115182151831518415185151861518715188151891519015191151921519315194151951519615197151981519915200152011520215203152041520515206152071520815209152101521115212152131521415215152161521715218152191522015221152221522315224152251522615227152281522915230152311523215233152341523515236152371523815239152401524115242152431524415245152461524715248152491525015251152521525315254152551525615257152581525915260152611526215263152641526515266152671526815269152701527115272152731527415275152761527715278152791528015281152821528315284152851528615287152881528915290152911529215293152941529515296152971529815299153001530115302153031530415305153061530715308153091531015311153121531315314153151531615317153181531915320153211532215323153241532515326153271532815329153301533115332153331533415335153361533715338153391534015341153421534315344153451534615347153481534915350153511535215353153541535515356153571535815359153601536115362153631536415365153661536715368153691537015371153721537315374153751537615377153781537915380153811538215383153841538515386153871538815389153901539115392153931539415395153961539715398153991540015401154021540315404154051540615407154081540915410154111541215413154141541515416154171541815419154201542115422154231542415425154261542715428154291543015431154321543315434154351543615437154381543915440154411544215443154441544515446154471544815449154501545115452154531545415455154561545715458154591546015461154621546315464154651546615467154681546915470154711547215473154741547515476154771547815479154801548115482154831548415485154861548715488154891549015491154921549315494154951549615497154981549915500155011550215503155041550515506155071550815509155101551115512155131551415515155161551715518155191552015521155221552315524155251552615527155281552915530155311553215533155341553515536155371553815539155401554115542155431554415545155461554715548155491555015551155521555315554155551555615557155581555915560155611556215563155641556515566155671556815569155701557115572155731557415575155761557715578155791558015581155821558315584155851558615587155881558915590155911559215593155941559515596155971559815599156001560115602156031560415605156061560715608156091561015611156121561315614156151561615617156181561915620156211562215623156241562515626156271562815629156301563115632156331563415635156361563715638156391564015641156421564315644156451564615647156481564915650156511565215653156541565515656156571565815659156601566115662156631566415665156661566715668156691567015671156721567315674156751567615677156781567915680156811568215683156841568515686156871568815689156901569115692156931569415695156961569715698156991570015701157021570315704157051570615707157081570915710157111571215713157141571515716157171571815719157201572115722157231572415725157261572715728157291573015731157321573315734157351573615737157381573915740157411574215743157441574515746157471574815749157501575115752157531575415755157561575715758157591576015761157621576315764157651576615767157681576915770157711577215773157741577515776157771577815779157801578115782157831578415785157861578715788157891579015791157921579315794157951579615797157981579915800158011580215803158041580515806158071580815809158101581115812158131581415815158161581715818158191582015821158221582315824158251582615827158281582915830158311583215833158341583515836158371583815839158401584115842158431584415845158461584715848158491585015851158521585315854158551585615857158581585915860158611586215863158641586515866158671586815869158701587115872158731587415875158761587715878158791588015881158821588315884158851588615887158881588915890158911589215893158941589515896158971589815899159001590115902159031590415905159061590715908159091591015911159121591315914159151591615917159181591915920159211592215923159241592515926159271592815929159301593115932159331593415935159361593715938159391594015941159421594315944159451594615947159481594915950159511595215953159541595515956159571595815959159601596115962159631596415965159661596715968159691597015971159721597315974159751597615977159781597915980159811598215983159841598515986159871598815989159901599115992159931599415995159961599715998159991600016001160021600316004160051600616007160081600916010160111601216013160141601516016160171601816019160201602116022160231602416025160261602716028160291603016031160321603316034160351603616037160381603916040160411604216043160441604516046160471604816049160501605116052160531605416055160561605716058160591606016061160621606316064160651606616067160681606916070160711607216073160741607516076160771607816079160801608116082160831608416085160861608716088160891609016091160921609316094160951609616097160981609916100161011610216103161041610516106161071610816109161101611116112161131611416115161161611716118161191612016121161221612316124161251612616127161281612916130161311613216133161341613516136161371613816139161401614116142161431614416145161461614716148161491615016151161521615316154161551615616157161581615916160161611616216163161641616516166161671616816169161701617116172161731617416175161761617716178161791618016181161821618316184161851618616187161881618916190161911619216193161941619516196161971619816199162001620116202162031620416205162061620716208162091621016211162121621316214162151621616217162181621916220162211622216223162241622516226162271622816229162301623116232162331623416235162361623716238162391624016241162421624316244162451624616247162481624916250162511625216253162541625516256162571625816259162601626116262162631626416265162661626716268162691627016271162721627316274162751627616277162781627916280162811628216283162841628516286162871628816289162901629116292162931629416295162961629716298162991630016301163021630316304163051630616307163081630916310163111631216313163141631516316163171631816319163201632116322163231632416325163261632716328163291633016331163321633316334163351633616337163381633916340163411634216343163441634516346163471634816349163501635116352163531635416355163561635716358163591636016361163621636316364163651636616367163681636916370163711637216373163741637516376163771637816379163801638116382163831638416385163861638716388163891639016391163921639316394163951639616397163981639916400164011640216403164041640516406164071640816409164101641116412164131641416415164161641716418164191642016421164221642316424164251642616427164281642916430164311643216433164341643516436164371643816439164401644116442164431644416445164461644716448164491645016451164521645316454164551645616457164581645916460164611646216463164641646516466164671646816469164701647116472164731647416475164761647716478164791648016481164821648316484164851648616487164881648916490164911649216493164941649516496164971649816499165001650116502165031650416505165061650716508165091651016511165121651316514165151651616517165181651916520165211652216523165241652516526165271652816529165301653116532165331653416535165361653716538165391654016541165421654316544165451654616547165481654916550165511655216553165541655516556165571655816559165601656116562165631656416565165661656716568165691657016571165721657316574165751657616577165781657916580165811658216583165841658516586165871658816589165901659116592165931659416595165961659716598165991660016601166021660316604166051660616607166081660916610166111661216613166141661516616166171661816619166201662116622166231662416625166261662716628166291663016631166321663316634166351663616637166381663916640166411664216643166441664516646166471664816649166501665116652166531665416655166561665716658166591666016661166621666316664166651666616667166681666916670166711667216673166741667516676166771667816679166801668116682166831668416685166861668716688166891669016691166921669316694166951669616697166981669916700167011670216703167041670516706167071670816709167101671116712167131671416715167161671716718167191672016721167221672316724167251672616727167281672916730167311673216733167341673516736167371673816739167401674116742167431674416745167461674716748167491675016751167521675316754167551675616757167581675916760167611676216763167641676516766167671676816769167701677116772167731677416775167761677716778167791678016781167821678316784167851678616787167881678916790167911679216793167941679516796167971679816799168001680116802168031680416805168061680716808168091681016811168121681316814168151681616817168181681916820168211682216823168241682516826168271682816829168301683116832168331683416835168361683716838168391684016841168421684316844168451684616847168481684916850168511685216853168541685516856168571685816859168601686116862168631686416865168661686716868168691687016871168721687316874168751687616877168781687916880168811688216883168841688516886168871688816889168901689116892168931689416895168961689716898168991690016901169021690316904169051690616907169081690916910169111691216913169141691516916169171691816919169201692116922169231692416925169261692716928169291693016931169321693316934169351693616937169381693916940169411694216943169441694516946169471694816949169501695116952169531695416955169561695716958169591696016961169621696316964169651696616967169681696916970169711697216973169741697516976169771697816979169801698116982169831698416985169861698716988169891699016991169921699316994169951699616997169981699917000170011700217003170041700517006170071700817009170101701117012170131701417015170161701717018170191702017021170221702317024170251702617027170281702917030170311703217033170341703517036170371703817039170401704117042170431704417045170461704717048170491705017051170521705317054170551705617057170581705917060170611706217063170641706517066170671706817069170701707117072170731707417075170761707717078170791708017081170821708317084170851708617087170881708917090170911709217093170941709517096170971709817099171001710117102171031710417105171061710717108171091711017111171121711317114171151711617117171181711917120171211712217123171241712517126171271712817129171301713117132171331713417135171361713717138171391714017141171421714317144171451714617147171481714917150171511715217153171541715517156171571715817159171601716117162171631716417165171661716717168171691717017171171721717317174171751717617177171781717917180171811718217183171841718517186171871718817189171901719117192171931719417195171961719717198171991720017201172021720317204172051720617207172081720917210172111721217213172141721517216172171721817219172201722117222172231722417225172261722717228172291723017231172321723317234172351723617237172381723917240172411724217243172441724517246172471724817249172501725117252172531725417255172561725717258172591726017261172621726317264172651726617267172681726917270172711727217273172741727517276172771727817279172801728117282172831728417285172861728717288172891729017291172921729317294172951729617297172981729917300173011730217303173041730517306173071730817309173101731117312173131731417315173161731717318173191732017321173221732317324173251732617327173281732917330173311733217333173341733517336173371733817339173401734117342173431734417345173461734717348173491735017351173521735317354173551735617357173581735917360173611736217363173641736517366173671736817369173701737117372173731737417375173761737717378173791738017381173821738317384173851738617387173881738917390173911739217393173941739517396173971739817399174001740117402174031740417405174061740717408174091741017411174121741317414174151741617417174181741917420174211742217423174241742517426174271742817429174301743117432174331743417435174361743717438174391744017441174421744317444174451744617447174481744917450174511745217453174541745517456174571745817459174601746117462174631746417465174661746717468174691747017471174721747317474174751747617477174781747917480174811748217483174841748517486174871748817489174901749117492174931749417495174961749717498174991750017501175021750317504175051750617507175081750917510175111751217513175141751517516175171751817519175201752117522175231752417525175261752717528175291753017531175321753317534175351753617537175381753917540175411754217543175441754517546175471754817549175501755117552175531755417555175561755717558175591756017561175621756317564175651756617567175681756917570175711757217573175741757517576175771757817579175801758117582175831758417585175861758717588175891759017591175921759317594175951759617597175981759917600176011760217603176041760517606176071760817609176101761117612176131761417615176161761717618176191762017621176221762317624176251762617627176281762917630176311763217633176341763517636176371763817639176401764117642176431764417645176461764717648176491765017651176521765317654176551765617657176581765917660176611766217663176641766517666176671766817669176701767117672176731767417675176761767717678176791768017681176821768317684176851768617687176881768917690176911769217693176941769517696176971769817699177001770117702177031770417705177061770717708177091771017711177121771317714177151771617717177181771917720177211772217723177241772517726177271772817729177301773117732177331773417735177361773717738177391774017741177421774317744177451774617747177481774917750177511775217753177541775517756177571775817759177601776117762177631776417765177661776717768177691777017771177721777317774177751777617777177781777917780177811778217783177841778517786177871778817789177901779117792177931779417795177961779717798177991780017801178021780317804178051780617807178081780917810178111781217813178141781517816178171781817819178201782117822178231782417825178261782717828178291783017831178321783317834178351783617837178381783917840178411784217843178441784517846178471784817849178501785117852178531785417855178561785717858178591786017861178621786317864178651786617867178681786917870178711787217873178741787517876178771787817879178801788117882178831788417885178861788717888178891789017891178921789317894178951789617897178981789917900179011790217903179041790517906179071790817909179101791117912179131791417915179161791717918179191792017921179221792317924179251792617927179281792917930179311793217933179341793517936179371793817939179401794117942179431794417945179461794717948179491795017951179521795317954179551795617957179581795917960179611796217963179641796517966179671796817969179701797117972179731797417975179761797717978179791798017981179821798317984179851798617987179881798917990179911799217993179941799517996179971799817999180001800118002180031800418005180061800718008180091801018011180121801318014180151801618017180181801918020180211802218023180241802518026180271802818029180301803118032180331803418035180361803718038180391804018041180421804318044180451804618047180481804918050180511805218053180541805518056180571805818059180601806118062180631806418065180661806718068180691807018071180721807318074180751807618077180781807918080180811808218083180841808518086180871808818089180901809118092180931809418095180961809718098180991810018101181021810318104181051810618107181081810918110181111811218113181141811518116181171811818119181201812118122181231812418125181261812718128181291813018131181321813318134181351813618137181381813918140181411814218143181441814518146181471814818149181501815118152181531815418155181561815718158181591816018161181621816318164181651816618167181681816918170181711817218173181741817518176181771817818179181801818118182181831818418185181861818718188181891819018191181921819318194181951819618197181981819918200182011820218203182041820518206182071820818209182101821118212182131821418215182161821718218182191822018221182221822318224182251822618227182281822918230182311823218233182341823518236182371823818239182401824118242182431824418245182461824718248182491825018251182521825318254182551825618257182581825918260182611826218263182641826518266182671826818269182701827118272182731827418275182761827718278182791828018281182821828318284182851828618287182881828918290182911829218293182941829518296182971829818299183001830118302183031830418305183061830718308183091831018311183121831318314183151831618317183181831918320183211832218323183241832518326183271832818329183301833118332183331833418335183361833718338183391834018341183421834318344183451834618347183481834918350183511835218353183541835518356183571835818359183601836118362183631836418365183661836718368183691837018371183721837318374183751837618377183781837918380183811838218383183841838518386183871838818389183901839118392183931839418395183961839718398183991840018401184021840318404184051840618407184081840918410184111841218413184141841518416184171841818419184201842118422184231842418425184261842718428184291843018431184321843318434184351843618437184381843918440184411844218443184441844518446184471844818449184501845118452184531845418455184561845718458184591846018461184621846318464184651846618467184681846918470184711847218473184741847518476184771847818479184801848118482184831848418485184861848718488184891849018491184921849318494184951849618497184981849918500185011850218503185041850518506185071850818509185101851118512185131851418515185161851718518185191852018521185221852318524185251852618527185281852918530185311853218533185341853518536185371853818539185401854118542185431854418545185461854718548185491855018551185521855318554185551855618557185581855918560185611856218563185641856518566185671856818569185701857118572185731857418575185761857718578185791858018581185821858318584185851858618587185881858918590185911859218593185941859518596185971859818599186001860118602186031860418605186061860718608186091861018611186121861318614186151861618617186181861918620186211862218623186241862518626186271862818629186301863118632186331863418635186361863718638186391864018641186421864318644186451864618647186481864918650186511865218653186541865518656186571865818659186601866118662186631866418665186661866718668186691867018671186721867318674186751867618677186781867918680186811868218683186841868518686186871868818689186901869118692186931869418695186961869718698186991870018701187021870318704187051870618707187081870918710187111871218713187141871518716187171871818719187201872118722187231872418725187261872718728187291873018731187321873318734187351873618737187381873918740187411874218743187441874518746187471874818749187501875118752187531875418755187561875718758187591876018761187621876318764187651876618767187681876918770187711877218773187741877518776187771877818779187801878118782187831878418785187861878718788187891879018791187921879318794187951879618797187981879918800188011880218803188041880518806188071880818809188101881118812188131881418815188161881718818188191882018821188221882318824188251882618827188281882918830188311883218833188341883518836188371883818839188401884118842188431884418845188461884718848188491885018851188521885318854188551885618857188581885918860188611886218863188641886518866188671886818869188701887118872188731887418875188761887718878188791888018881188821888318884188851888618887188881888918890188911889218893188941889518896188971889818899189001890118902189031890418905189061890718908189091891018911189121891318914189151891618917189181891918920189211892218923189241892518926189271892818929189301893118932189331893418935189361893718938189391894018941189421894318944189451894618947189481894918950189511895218953189541895518956189571895818959189601896118962189631896418965189661896718968189691897018971189721897318974189751897618977189781897918980189811898218983189841898518986189871898818989189901899118992189931899418995189961899718998189991900019001190021900319004190051900619007190081900919010190111901219013190141901519016190171901819019190201902119022190231902419025190261902719028190291903019031190321903319034190351903619037190381903919040190411904219043190441904519046190471904819049190501905119052190531905419055190561905719058190591906019061190621906319064190651906619067190681906919070190711907219073190741907519076190771907819079190801908119082190831908419085190861908719088190891909019091190921909319094190951909619097190981909919100191011910219103191041910519106191071910819109191101911119112191131911419115191161911719118191191912019121191221912319124191251912619127191281912919130191311913219133191341913519136191371913819139191401914119142191431914419145191461914719148191491915019151191521915319154191551915619157191581915919160191611916219163191641916519166191671916819169191701917119172191731917419175191761917719178191791918019181191821918319184191851918619187191881918919190
  1. /*
  2. zlib.js 2012 - imaya [ https://github.com/imaya/zlib.js ] The MIT License */
  3. var egret; (function(c) {
  4. var e = function() {
  5. function c() {
  6. this._hashCode = c.hashCount++
  7. }
  8. Object.defineProperty(c.prototype, "hashCode", {
  9. get: function() {
  10. return this._hashCode
  11. },
  12. enumerable: !0,
  13. configurable: !0
  14. });
  15. c.hashCount = 1;
  16. return c
  17. } ();
  18. c.HashObject = e;
  19. e.prototype.__class__ = "egret.HashObject"
  20. })(egret || (egret = {}));
  21. var __extends = this.__extends ||
  22. function(c, e) {
  23. function d() {
  24. this.constructor = c
  25. }
  26. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  27. d.prototype = e.prototype;
  28. c.prototype = new d
  29. }; (function(c) {
  30. var e = function(c) {
  31. function a(b) {
  32. "undefined" === typeof b && (b = 300);
  33. c.call(this);
  34. this.objectPool = [];
  35. this._length = 0;
  36. 1 > b && (b = 1);
  37. this.autoDisposeTime = b;
  38. this.frameCount = 0
  39. }
  40. __extends(a, c);
  41. a.prototype._checkFrame = function() {
  42. this.frameCount--;
  43. 0 >= this.frameCount && this.dispose()
  44. };
  45. Object.defineProperty(a.prototype, "length", {
  46. get: function() {
  47. return this._length
  48. },
  49. enumerable: !0,
  50. configurable: !0
  51. });
  52. a.prototype.push = function(b) {
  53. var k = this.objectPool; - 1 == k.indexOf(b) && (k.push(b), this._length++, 0 == this.frameCount && (this.frameCount = this.autoDisposeTime, a._callBackList.push(this)))
  54. };
  55. a.prototype.pop = function() {
  56. if (0 == this._length) return null;
  57. this._length--;
  58. return this.objectPool.pop()
  59. };
  60. a.prototype.dispose = function() {
  61. 0 < this._length && (this.objectPool = [], this._length = 0);
  62. this.frameCount = 0;
  63. var b = a._callBackList,
  64. k = b.indexOf(this); - 1 != k && b.splice(k, 1)
  65. };
  66. a._callBackList = [];
  67. return a
  68. } (c.HashObject);
  69. c.Recycler = e;
  70. e.prototype.__class__ = "egret.Recycler"
  71. })(egret || (egret = {})); (function(c) {
  72. c.__START_TIME;
  73. c.getTimer = function() {
  74. return Date.now() - c.__START_TIME
  75. }
  76. })(egret || (egret = {})); (function(c) {
  77. c.__callLaterFunctionList = [];
  78. c.__callLaterThisList = [];
  79. c.__callLaterArgsList = [];
  80. c.callLater = function(e, d) {
  81. for (var a = [], b = 0; b < arguments.length - 2; b++) a[b] = arguments[b + 2];
  82. c.__callLaterFunctionList.push(e);
  83. c.__callLaterThisList.push(d);
  84. c.__callLaterArgsList.push(a)
  85. }
  86. })(egret || (egret = {}));
  87. __extends = this.__extends ||
  88. function(c, e) {
  89. function d() {
  90. this.constructor = c
  91. }
  92. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  93. d.prototype = e.prototype;
  94. c.prototype = new d
  95. }; (function(c) {
  96. var e = function(d) {
  97. function a(b, a, c) {
  98. "undefined" === typeof a && (a = !1);
  99. "undefined" === typeof c && (c = !1);
  100. d.call(this);
  101. this._eventPhase = 2;
  102. this._isPropagationImmediateStopped = this._isPropagationStopped = this._isDefaultPrevented = !1;
  103. this.isNew = !0;
  104. this._type = b;
  105. this._bubbles = a;
  106. this._cancelable = c
  107. }
  108. __extends(a, d);
  109. Object.defineProperty(a.prototype, "type", {
  110. get: function() {
  111. return this._type
  112. },
  113. enumerable: !0,
  114. configurable: !0
  115. });
  116. Object.defineProperty(a.prototype, "bubbles", {
  117. get: function() {
  118. return this._bubbles
  119. },
  120. enumerable: !0,
  121. configurable: !0
  122. });
  123. Object.defineProperty(a.prototype, "cancelable", {
  124. get: function() {
  125. return this._cancelable
  126. },
  127. enumerable: !0,
  128. configurable: !0
  129. });
  130. Object.defineProperty(a.prototype, "eventPhase", {
  131. get: function() {
  132. return this._eventPhase
  133. },
  134. enumerable: !0,
  135. configurable: !0
  136. });
  137. Object.defineProperty(a.prototype, "currentTarget", {
  138. get: function() {
  139. return this._currentTarget
  140. },
  141. enumerable: !0,
  142. configurable: !0
  143. });
  144. a.prototype._setCurrentTarget = function(b) {
  145. this._currentTarget = b
  146. };
  147. Object.defineProperty(a.prototype, "target", {
  148. get: function() {
  149. return this._target
  150. },
  151. enumerable: !0,
  152. configurable: !0
  153. });
  154. a.prototype.isDefaultPrevented = function() {
  155. return this._isDefaultPrevented
  156. };
  157. a.prototype.preventDefault = function() {
  158. this._cancelable && (this._isDefaultPrevented = !0)
  159. };
  160. a.prototype.stopPropagation = function() {
  161. this._bubbles && (this._isPropagationStopped = !0)
  162. };
  163. a.prototype.stopImmediatePropagation = function() {
  164. this._bubbles && (this._isPropagationImmediateStopped = !0)
  165. };
  166. a.prototype._reset = function() {
  167. this.isNew ? this.isNew = !1 : (this._isPropagationImmediateStopped = this._isPropagationStopped = this._isDefaultPrevented = !1, this._currentTarget = this._target = null, this._eventPhase = 2)
  168. };
  169. a._dispatchByTarget = function(b, a, f, d, e, h) {
  170. "undefined" === typeof e && (e = !1);
  171. "undefined" === typeof h && (h = !1);
  172. var l = b.eventRecycler;
  173. l || (l = b.eventRecycler = new c.Recycler);
  174. var n = l.pop();
  175. n ? n._type = f: n = new b(f);
  176. n._bubbles = e;
  177. n._cancelable = h;
  178. if (d) for (var p in d) n[p] = d[p],
  179. null !== n[p] && (d[p] = null);
  180. b = a.dispatchEvent(n);
  181. l.push(n);
  182. return b
  183. };
  184. a._getPropertyData = function(b) {
  185. var a = b._props;
  186. a || (a = b._props = {});
  187. return a
  188. };
  189. a.dispatchEvent = function(b, k, c, d) {
  190. "undefined" === typeof c && (c = !1);
  191. var e = a._getPropertyData(a);
  192. d && (e.data = d);
  193. a._dispatchByTarget(a, b, k, e, c)
  194. };
  195. a.ADDED_TO_STAGE = "addedToStage";
  196. a.REMOVED_FROM_STAGE = "removedFromStage";
  197. a.ADDED = "added";
  198. a.REMOVED = "removed";
  199. a.COMPLETE = "complete";
  200. a.ENTER_FRAME = "enterFrame";
  201. a.RENDER = "render";
  202. a.FINISH_RENDER = "finishRender";
  203. a.FINISH_UPDATE_TRANSFORM = "finishUpdateTransform";
  204. a.LEAVE_STAGE = "leaveStage";
  205. a.RESIZE = "resize";
  206. a.CHANGE = "change";
  207. return a
  208. } (c.HashObject);
  209. c.Event = e;
  210. e.prototype.__class__ = "egret.Event"
  211. })(egret || (egret = {}));
  212. __extends = this.__extends ||
  213. function(c, e) {
  214. function d() {
  215. this.constructor = c
  216. }
  217. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  218. d.prototype = e.prototype;
  219. c.prototype = new d
  220. }; (function(c) {
  221. var e = function(d) {
  222. function a(b, a, c) {
  223. "undefined" === typeof a && (a = !1);
  224. "undefined" === typeof c && (c = !1);
  225. d.call(this, b, a, c)
  226. }
  227. __extends(a, d);
  228. a.dispatchIOErrorEvent = function(b) {
  229. c.Event._dispatchByTarget(a, b, a.IO_ERROR)
  230. };
  231. a.IO_ERROR = "ioError";
  232. return a
  233. } (c.Event);
  234. c.IOErrorEvent = e;
  235. e.prototype.__class__ = "egret.IOErrorEvent"
  236. })(egret || (egret = {}));
  237. __extends = this.__extends ||
  238. function(c, e) {
  239. function d() {
  240. this.constructor = c
  241. }
  242. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  243. d.prototype = e.prototype;
  244. c.prototype = new d
  245. }; (function(c) {
  246. var e = function(d) {
  247. function a(b, a, c, e, g, h, l, n, p, q) {
  248. "undefined" === typeof a && (a = !0);
  249. "undefined" === typeof c && (c = !0);
  250. "undefined" === typeof e && (e = 0);
  251. "undefined" === typeof g && (g = 0);
  252. "undefined" === typeof h && (h = 0);
  253. "undefined" === typeof l && (l = !1);
  254. "undefined" === typeof n && (n = !1);
  255. "undefined" === typeof q && (q = !1);
  256. d.call(this, b, a, c);
  257. this._localY = this._localX = this._stageY = this._stageX = 0;
  258. this.touchPointID = e;
  259. this._stageX = g;
  260. this._stageY = h;
  261. this.ctrlKey = l;
  262. this.altKey = n;
  263. this.touchDown = q
  264. }
  265. __extends(a, d);
  266. Object.defineProperty(a.prototype, "stageX", {
  267. get: function() {
  268. return this._stageX
  269. },
  270. enumerable: !0,
  271. configurable: !0
  272. });
  273. Object.defineProperty(a.prototype, "stageY", {
  274. get: function() {
  275. return this._stageY
  276. },
  277. enumerable: !0,
  278. configurable: !0
  279. });
  280. Object.defineProperty(a.prototype, "localX", {
  281. get: function() {
  282. return this._localX
  283. },
  284. enumerable: !0,
  285. configurable: !0
  286. });
  287. Object.defineProperty(a.prototype, "localY", {
  288. get: function() {
  289. return this._localY
  290. },
  291. enumerable: !0,
  292. configurable: !0
  293. });
  294. a.prototype._setCurrentTarget = function(b) {
  295. d.prototype._setCurrentTarget.call(this, b);
  296. b instanceof c.DisplayObject && (b = b.globalToLocal(this._stageX, this._stageY, c.Point.identity), this._localX = b.x, this._localY = b.y)
  297. };
  298. a.dispatchTouchEvent = function(b, k, f, d, e, h, l, n, p) {
  299. "undefined" === typeof f && (f = 0);
  300. "undefined" === typeof d && (d = 0);
  301. "undefined" === typeof e && (e = 0);
  302. "undefined" === typeof h && (h = !1);
  303. "undefined" === typeof l && (l = !1);
  304. "undefined" === typeof n && (n = !1);
  305. "undefined" === typeof p && (p = !1);
  306. var q = c.Event._getPropertyData(a);
  307. q.touchPointID = f;
  308. q._stageX = d;
  309. q._stageY = e;
  310. q.ctrlKey = h;
  311. q.altKey = l;
  312. q.shiftKey = n;
  313. q.touchDown = p;
  314. c.Event._dispatchByTarget(a, b, k, q, !0, !0)
  315. };
  316. a.TOUCH_TAP = "touchTap";
  317. a.TOUCH_MOVE = "touchMove";
  318. a.TOUCH_BEGIN = "touchBegin";
  319. a.TOUCH_END = "touchEnd";
  320. a.TOUCH_RELEASE_OUTSIDE = "touchReleaseOutside";
  321. a.TOUCH_ROLL_OUT = "touchRollOut";
  322. a.TOUCH_ROLL_OVER = "touchRollOver";
  323. a.TOUCH_OUT = "touchOut";
  324. a.TOUCH_OVER = "touchOver";
  325. return a
  326. } (c.Event);
  327. c.TouchEvent = e;
  328. e.prototype.__class__ = "egret.TouchEvent"
  329. })(egret || (egret = {}));
  330. __extends = this.__extends ||
  331. function(c, e) {
  332. function d() {
  333. this.constructor = c
  334. }
  335. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  336. d.prototype = e.prototype;
  337. c.prototype = new d
  338. }; (function(c) {
  339. var e = function(d) {
  340. function a(b, a, c) {
  341. "undefined" === typeof a && (a = !1);
  342. "undefined" === typeof c && (c = !1);
  343. d.call(this, b, a, c)
  344. }
  345. __extends(a, d);
  346. a.dispatchTimerEvent = function(b, k) {
  347. c.Event._dispatchByTarget(a, b, k)
  348. };
  349. a.TIMER = "timer";
  350. a.TIMER_COMPLETE = "timerComplete";
  351. return a
  352. } (c.Event);
  353. c.TimerEvent = e;
  354. e.prototype.__class__ = "egret.TimerEvent"
  355. })(egret || (egret = {})); (function(c) {
  356. var e = function() {
  357. function c() {}
  358. c.CAPTURING_PHASE = 1;
  359. c.AT_TARGET = 2;
  360. c.BUBBLING_PHASE = 3;
  361. return c
  362. } ();
  363. c.EventPhase = e;
  364. e.prototype.__class__ = "egret.EventPhase"
  365. })(egret || (egret = {}));
  366. __extends = this.__extends ||
  367. function(c, e) {
  368. function d() {
  369. this.constructor = c
  370. }
  371. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  372. d.prototype = e.prototype;
  373. c.prototype = new d
  374. }; (function(c) {
  375. var e = function(d) {
  376. function a(b) {
  377. "undefined" === typeof b && (b = null);
  378. d.call(this);
  379. this._eventTarget = b ? b: this
  380. }
  381. __extends(a, d);
  382. a.prototype.addEventListener = function(b, a, f, d, e) {
  383. "undefined" === typeof d && (d = !1);
  384. "undefined" === typeof e && (e = 0);
  385. "undefined" === typeof d && (d = !1);
  386. "undefined" === typeof e && (e = 0);
  387. a || c.Logger.fatal("addEventListener\u4fa6\u542c\u51fd\u6570\u4e0d\u80fd\u4e3a\u7a7a");
  388. d ? (this._captureEventsMap || (this._captureEventsMap = {}), d = this._captureEventsMap) : (this._eventsMap || (this._eventsMap = {}), d = this._eventsMap);
  389. var h = d[b];
  390. h || (h = d[b] = []);
  391. this._insertEventBin(h, a, f, e)
  392. };
  393. a.prototype._insertEventBin = function(b, a, c, d) {
  394. for (var e = -1,
  395. h = b.length,
  396. l = 0; l < h; l++) {
  397. var n = b[l];
  398. if (n.listener === a && n.thisObject === c) return ! 1; - 1 == e && n.priority < d && (e = l)
  399. }
  400. a = {
  401. listener: a,
  402. thisObject: c,
  403. priority: d
  404. }; - 1 != e ? b.splice(e, 0, a) : b.push(a);
  405. return ! 0
  406. };
  407. a.prototype.removeEventListener = function(b, a, c, d) {
  408. "undefined" === typeof d && (d = !1);
  409. if (d = d ? this._captureEventsMap: this._eventsMap) {
  410. var e = d[b];
  411. e && (this._removeEventBin(e, a, c), 0 == e.length && delete d[b])
  412. }
  413. };
  414. a.prototype._removeEventBin = function(b, a, c) {
  415. for (var d = b.length,
  416. e = 0; e < d; e++) {
  417. var h = b[e];
  418. if (h.listener === a && h.thisObject === c) return b.splice(e, 1),
  419. !0
  420. }
  421. return ! 1
  422. };
  423. a.prototype.hasEventListener = function(b) {
  424. return this._eventsMap && this._eventsMap[b] || this._captureEventsMap && this._captureEventsMap[b]
  425. };
  426. a.prototype.willTrigger = function(b) {
  427. return this.hasEventListener(b)
  428. };
  429. a.prototype.dispatchEvent = function(b) {
  430. b._reset();
  431. b._target = this._eventTarget;
  432. b._setCurrentTarget(this._eventTarget);
  433. return this._notifyListener(b)
  434. };
  435. a.prototype._notifyListener = function(b) {
  436. var a = 1 == b._eventPhase ? this._captureEventsMap: this._eventsMap;
  437. if (!a) return ! 0;
  438. a = a[b.type];
  439. if (!a) return ! 0;
  440. for (var a = a.concat(), c = a.length, d = 0; d < c; d++) {
  441. var e = a[d];
  442. e.listener.call(e.thisObject, b);
  443. if (b._isPropagationImmediateStopped) break
  444. }
  445. return ! b.isDefaultPrevented()
  446. };
  447. a.prototype.dispatchEventWith = function(b, a, f) {
  448. "undefined" === typeof a && (a = !1);
  449. c.Event.dispatchEvent(this, b, a, f)
  450. };
  451. return a
  452. } (c.HashObject);
  453. c.EventDispatcher = e;
  454. e.prototype.__class__ = "egret.EventDispatcher"
  455. })(egret || (egret = {}));
  456. __extends = this.__extends ||
  457. function(c, e) {
  458. function d() {
  459. this.constructor = c
  460. }
  461. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  462. d.prototype = e.prototype;
  463. c.prototype = new d
  464. }; (function(c) {
  465. var e = function(d) {
  466. function a() {
  467. d.call(this);
  468. this.reuseEvent = new c.Event("")
  469. }
  470. __extends(a, d);
  471. a.prototype.run = function() {
  472. c.Ticker.getInstance().run();
  473. c.Ticker.getInstance().register(this.renderLoop, this, Number.NEGATIVE_INFINITY);
  474. c.Ticker.getInstance().register(this.broadcastEnterFrame, this, Number.POSITIVE_INFINITY);
  475. this.touchContext.run()
  476. };
  477. a.prototype.renderLoop = function(b) {
  478. b = this.rendererContext;
  479. b.clearScreen();
  480. if (0 < c.__callLaterFunctionList.length) {
  481. var a = c.__callLaterFunctionList;
  482. c.__callLaterFunctionList = [];
  483. var f = c.__callLaterThisList;
  484. c.__callLaterThisList = [];
  485. var d = c.__callLaterArgsList;
  486. c.__callLaterArgsList = []
  487. }
  488. this.dispatchEventWith(c.Event.RENDER);
  489. c.Stage._invalidateRenderFlag && (this.broadcastRender(), c.Stage._invalidateRenderFlag = !1);
  490. a && this.doCallLaterList(a, f, d);
  491. this.stage._updateTransform();
  492. this.dispatchEventWith(c.Event.FINISH_UPDATE_TRANSFORM);
  493. this.stage._draw(b);
  494. this.dispatchEventWith(c.Event.FINISH_RENDER)
  495. };
  496. a.prototype.broadcastEnterFrame = function(b) {
  497. b = this.reuseEvent;
  498. b._type = c.Event.ENTER_FRAME;
  499. this.dispatchEvent(b);
  500. for (var a = c.DisplayObject._enterFrameCallBackList.concat(), f = a.length, d = 0; d < f; d++) {
  501. var e = a[d];
  502. b._target = e.display;
  503. b._setCurrentTarget(e.display);
  504. e.listener.call(e.thisObject, b)
  505. }
  506. a = c.Recycler._callBackList;
  507. for (d = a.length - 1; 0 <= d; d--) a[d]._checkFrame()
  508. };
  509. a.prototype.broadcastRender = function() {
  510. var b = this.reuseEvent;
  511. b._type = c.Event.RENDER;
  512. for (var a = c.DisplayObject._renderCallBackList.concat(), f = a.length, d = 0; d < f; d++) {
  513. var e = a[d];
  514. b._target = e.display;
  515. b._setCurrentTarget(e.display);
  516. e.listener.call(e.thisObject, b)
  517. }
  518. };
  519. a.prototype.doCallLaterList = function(b, a, c) {
  520. for (var d = b.length,
  521. e = 0; e < d; e++) {
  522. var h = b[e];
  523. null != h && h.apply(a[e], c[e])
  524. }
  525. };
  526. a.DEVICE_PC = "web";
  527. a.DEVICE_MOBILE = "native";
  528. return a
  529. } (c.EventDispatcher);
  530. c.MainContext = e;
  531. e.prototype.__class__ = "egret.MainContext"
  532. })(egret || (egret = {}));
  533. var testDeviceType = function() {
  534. if (!this.hasOwnProperty("navigator")) return ! 0;
  535. var c = navigator.userAgent.toLowerCase();
  536. return - 1 != c.indexOf("mobile") || -1 != c.indexOf("android")
  537. };
  538. egret.MainContext.instance = new egret.MainContext;
  539. egret.MainContext.deviceType = testDeviceType() ? egret.MainContext.DEVICE_MOBILE: egret.MainContext.DEVICE_PC; (function(c) {
  540. var e = function() {
  541. function d() {
  542. this._tick = this._preDrawCount = this._updateTransformPerformanceCost = this._renderPerformanceCost = this._logicPerformanceCost = this._lastTime = 0;
  543. this._maxDeltaTime = 500;
  544. this._totalDeltaTime = 0
  545. }
  546. d.getInstance = function() {
  547. null == d.instance && (d.instance = new d);
  548. return d.instance
  549. };
  550. d.prototype.run = function() {
  551. c.Ticker.getInstance().register(this.update, this);
  552. null == this._txt && (this._txt = new c.TextField, this._txt.size = 28, c.MainContext.instance.stage.addChild(this._txt));
  553. var a = c.MainContext.instance;
  554. a.addEventListener(c.Event.ENTER_FRAME, this.onEnterFrame, this);
  555. a.addEventListener(c.Event.RENDER, this.onStartRender, this);
  556. a.addEventListener(c.Event.FINISH_RENDER, this.onFinishRender, this);
  557. a.addEventListener(c.Event.FINISH_UPDATE_TRANSFORM, this.onFinishUpdateTransform, this)
  558. };
  559. d.prototype.onEnterFrame = function(a) {
  560. this._lastTime = c.getTimer()
  561. };
  562. d.prototype.onStartRender = function(a) {
  563. a = c.getTimer();
  564. this._logicPerformanceCost = a - this._lastTime;
  565. this._lastTime = a
  566. };
  567. d.prototype.onFinishUpdateTransform = function(a) {
  568. a = c.getTimer();
  569. this._updateTransformPerformanceCost = a - this._lastTime;
  570. this._lastTime = a
  571. };
  572. d.prototype.onFinishRender = function(a) {
  573. a = c.getTimer();
  574. this._renderPerformanceCost = a - this._lastTime;
  575. this._lastTime = a
  576. };
  577. d.prototype.update = function(a) {
  578. this._tick++;
  579. this._totalDeltaTime += a;
  580. if (this._totalDeltaTime >= this._maxDeltaTime) {
  581. a = (this._preDrawCount - 1).toString();
  582. var b = Math.ceil(this._logicPerformanceCost).toString() + "," + Math.ceil(this._updateTransformPerformanceCost).toString() + "," + Math.ceil(this._renderPerformanceCost).toString() + "," + Math.ceil(c.MainContext.instance.rendererContext.renderCost).toString();
  583. this._txt.text = "draw:" + a + "\ncost:" + b + "\nFPS:" + Math.floor(1E3 * this._tick / this._totalDeltaTime).toString();
  584. this._tick = this._totalDeltaTime = 0
  585. }
  586. this._preDrawCount = 0
  587. };
  588. d.prototype.onDrawImage = function() {
  589. this._preDrawCount++
  590. };
  591. return d
  592. } ();
  593. c.Profiler = e;
  594. e.prototype.__class__ = "egret.Profiler"
  595. })(egret || (egret = {}));
  596. __extends = this.__extends ||
  597. function(c, e) {
  598. function d() {
  599. this.constructor = c
  600. }
  601. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  602. d.prototype = e.prototype;
  603. c.prototype = new d
  604. }; (function(c) {
  605. var e = function(d) {
  606. function a() {
  607. d.apply(this, arguments);
  608. this._timeScale = 1;
  609. this._paused = !1;
  610. this.callBackList = []
  611. }
  612. __extends(a, d);
  613. a.prototype.run = function() {
  614. c.__START_TIME = (new Date).getTime();
  615. c.MainContext.instance.deviceContext.executeMainLoop(this.update, this)
  616. };
  617. a.prototype.update = function(b) {
  618. var a = this.callBackList.concat(),
  619. c = a.length;
  620. b *= this._timeScale;
  621. b *= this._timeScale;
  622. for (var d = 0; d < c; d++) {
  623. var e = a[d];
  624. e.listener.call(e.thisObject, b)
  625. }
  626. };
  627. a.prototype.register = function(b, a, c) {
  628. "undefined" === typeof c && (c = 0);
  629. this._insertEventBin(this.callBackList, b, a, c)
  630. };
  631. a.prototype.unregister = function(b, a) {
  632. this._removeEventBin(this.callBackList, b, a)
  633. };
  634. a.prototype.setTimeout = function(b, a, f) {
  635. for (var d = [], e = 0; e < arguments.length - 3; e++) d[e] = arguments[e + 3];
  636. c.Logger.warning("Ticker#setTimeout\u65b9\u6cd5\u5373\u5c06\u5e9f\u5f03,\u8bf7\u4f7f\u7528egret.setTimeout");
  637. c.setTimeout.apply(null, [b, a, f].concat(d))
  638. };
  639. a.prototype.setTimeScale = function(b) {
  640. this._timeScale = b
  641. };
  642. a.prototype.getTimeScale = function() {
  643. return this._timeScale
  644. };
  645. a.prototype.pause = function() {
  646. this._paused = !0
  647. };
  648. a.prototype.resume = function() {
  649. this._paused = !1
  650. };
  651. a.getInstance = function() {
  652. null == a.instance && (a.instance = new a);
  653. return a.instance
  654. };
  655. return a
  656. } (c.EventDispatcher);
  657. c.Ticker = e;
  658. e.prototype.__class__ = "egret.Ticker"
  659. })(egret || (egret = {})); (function(c) {
  660. var e = function() {
  661. function c() {}
  662. c.LEFT = "left";
  663. c.RIGHT = "right";
  664. c.CENTER = "center";
  665. c.JUSTIFY = "justify";
  666. c.CONTENT_JUSTIFY = "contentJustify";
  667. return c
  668. } ();
  669. c.HorizontalAlign = e;
  670. e.prototype.__class__ = "egret.HorizontalAlign"
  671. })(egret || (egret = {})); (function(c) {
  672. var e = function() {
  673. function c() {}
  674. c.TOP = "top";
  675. c.BOTTOM = "bottom";
  676. c.MIDDLE = "middle";
  677. c.JUSTIFY = "justify";
  678. c.CONTENT_JUSTIFY = "contentJustify";
  679. return c
  680. } ();
  681. c.VerticalAlign = e;
  682. e.prototype.__class__ = "egret.VerticalAlign"
  683. })(egret || (egret = {}));
  684. __extends = this.__extends ||
  685. function(c, e) {
  686. function d() {
  687. this.constructor = c
  688. }
  689. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  690. d.prototype = e.prototype;
  691. c.prototype = new d
  692. }; (function(c) {
  693. var e = function(d) {
  694. function a(b, a) {
  695. "undefined" === typeof a && (a = 0);
  696. d.call(this);
  697. this._currentCount = 0;
  698. this.delay = b;
  699. this.repeatCount = a
  700. }
  701. __extends(a, d);
  702. a.prototype.currentCount = function() {
  703. return this._currentCount
  704. };
  705. Object.defineProperty(a.prototype, "running", {
  706. get: function() {
  707. return this._running
  708. },
  709. enumerable: !0,
  710. configurable: !0
  711. });
  712. a.prototype.reset = function() {
  713. this.stop();
  714. this._currentCount = 0
  715. };
  716. a.prototype.start = function() {
  717. this._running || (this.lastTime = c.getTimer(), 0 != this._currentCount && (this._currentCount = 0), c.Ticker.getInstance().register(this.onEnterFrame, this), this._running = !0)
  718. };
  719. a.prototype.stop = function() {
  720. this._running && (c.Ticker.getInstance().unregister(this.onEnterFrame, this), this._running = !1)
  721. };
  722. a.prototype.onEnterFrame = function(b) {
  723. b = c.getTimer();
  724. b - this.lastTime > this.delay && (this.lastTime = b, this._currentCount++, c.TimerEvent.dispatchTimerEvent(this, c.TimerEvent.TIMER), 0 < this.repeatCount && this._currentCount >= this.repeatCount && (this.stop(), c.TimerEvent.dispatchTimerEvent(this, c.TimerEvent.TIMER_COMPLETE)))
  725. };
  726. return a
  727. } (c.EventDispatcher);
  728. c.Timer = e;
  729. e.prototype.__class__ = "egret.Timer"
  730. })(egret || (egret = {})); (function(c) {
  731. c.getQualifiedClassName = function(c) {
  732. c = c.prototype ? c.prototype: c.__proto__;
  733. if (c.hasOwnProperty("__class__")) return c.__class__;
  734. var d = c.constructor.toString(),
  735. a = d.indexOf("("),
  736. d = d.substring(9, a);
  737. return c.__class__ = d
  738. }
  739. })(egret || (egret = {})); (function(c) {
  740. var e = {};
  741. c.getDefinitionByName = function(c) {
  742. if (!c) return null;
  743. var a = e[c];
  744. if (a) return a;
  745. for (var b = c.split("."), k = b.length, a = __global, f = 0; f < k; f++) if (a = a[b[f]], !a) return null;
  746. return e[c] = a
  747. }
  748. })(egret || (egret = {}));
  749. var __global = __global || this; (function(c) {
  750. function e(b) {
  751. for (var a in d) {
  752. var c = d[a];
  753. c.delay -= b;
  754. 0 >= c.delay && (c.listener.apply(c.thisObject, c.params), delete d[a])
  755. }
  756. }
  757. var d = {},
  758. a = 0;
  759. c.setTimeout = function(b, k, f) {
  760. for (var m = [], g = 0; g < arguments.length - 3; g++) m[g] = arguments[g + 3];
  761. m = {
  762. listener: b,
  763. thisObject: k,
  764. delay: f,
  765. params: m
  766. };
  767. 0 == a && c.Ticker.getInstance().register(e, null);
  768. a++;
  769. d[a] = m;
  770. return a
  771. };
  772. c.clearTimeout = function(b) {
  773. delete d[b]
  774. }
  775. })(egret || (egret = {})); (function(c) {
  776. c.hasDefinition = function(e) {
  777. return c.getDefinitionByName(e) ? !0 : !1
  778. }
  779. })(egret || (egret = {})); (function(c) {
  780. c.toColorString = function(c) {
  781. if (isNaN(c) || 0 > c) c = 0;
  782. 16777215 < c && (c = 16777215);
  783. for (c = c.toString(16).toUpperCase(); 6 > c.length;) c = "0" + c;
  784. return "#" + c
  785. }
  786. })(egret || (egret = {}));
  787. __extends = this.__extends ||
  788. function(c, e) {
  789. function d() {
  790. this.constructor = c
  791. }
  792. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  793. d.prototype = e.prototype;
  794. c.prototype = new d
  795. }; (function(c) {
  796. var e = function(d) {
  797. function a(b, a, c, e, g, h) {
  798. "undefined" === typeof b && (b = 1);
  799. "undefined" === typeof a && (a = 0);
  800. "undefined" === typeof c && (c = 0);
  801. "undefined" === typeof e && (e = 1);
  802. "undefined" === typeof g && (g = 0);
  803. "undefined" === typeof h && (h = 0);
  804. d.call(this);
  805. this.a = b;
  806. this.b = a;
  807. this.c = c;
  808. this.d = e;
  809. this.tx = g;
  810. this.ty = h
  811. }
  812. __extends(a, d);
  813. a.prototype.prepend = function(b, a, c, d, e, h) {
  814. var l = this.tx;
  815. if (1 != b || 0 != a || 0 != c || 1 != d) {
  816. var n = this.a,
  817. p = this.c;
  818. this.a = n * b + this.b * c;
  819. this.b = n * a + this.b * d;
  820. this.c = p * b + this.d * c;
  821. this.d = p * a + this.d * d
  822. }
  823. this.tx = l * b + this.ty * c + e;
  824. this.ty = l * a + this.ty * d + h;
  825. return this
  826. };
  827. a.prototype.append = function(b, a, c, d, e, h) {
  828. var l = this.a,
  829. n = this.b,
  830. p = this.c,
  831. q = this.d;
  832. this.a = b * l + a * p;
  833. this.b = b * n + a * q;
  834. this.c = c * l + d * p;
  835. this.d = c * n + d * q;
  836. this.tx = e * l + h * p + this.tx;
  837. this.ty = e * n + h * q + this.ty;
  838. return this
  839. };
  840. a.prototype.prependMatrix = function(b) {
  841. this.prepend(b.a, b.b, b.c, b.d, b.tx, b.ty);
  842. return this
  843. };
  844. a.prototype.appendMatrix = function(b) {
  845. this.append(b.a, b.b, b.c, b.d, b.tx, b.ty);
  846. return this
  847. };
  848. a.prototype.prependTransform = function(b, k, c, d, e, h, l, n, p) {
  849. if (e % 360) {
  850. var q = e * a.DEG_TO_RAD;
  851. e = Math.cos(q);
  852. q = Math.sin(q)
  853. } else e = 1,
  854. q = 0;
  855. if (n || p) this.tx -= n,
  856. this.ty -= p;
  857. h || l ? (h *= a.DEG_TO_RAD, l *= a.DEG_TO_RAD, this.prepend(e * c, q * c, -q * d, e * d, 0, 0), this.prepend(Math.cos(l), Math.sin(l), -Math.sin(h), Math.cos(h), b, k)) : this.prepend(e * c, q * c, -q * d, e * d, b, k);
  858. return this
  859. };
  860. a.prototype.appendTransform = function(b, k, c, d, e, h, l, n, p) {
  861. if (e % 360) {
  862. var q = e * a.DEG_TO_RAD;
  863. e = Math.cos(q);
  864. q = Math.sin(q)
  865. } else e = 1,
  866. q = 0;
  867. h || l ? (h *= a.DEG_TO_RAD, l *= a.DEG_TO_RAD, this.append(Math.cos(l), Math.sin(l), -Math.sin(h), Math.cos(h), b, k), this.append(e * c, q * c, -q * d, e * d, 0, 0)) : this.append(e * c, q * c, -q * d, e * d, b, k);
  868. if (n || p) this.tx -= n * this.a + p * this.c,
  869. this.ty -= n * this.b + p * this.d;
  870. return this
  871. };
  872. a.prototype.rotate = function(b) {
  873. var a = Math.cos(b);
  874. b = Math.sin(b);
  875. var c = this.a,
  876. d = this.c,
  877. e = this.tx;
  878. this.a = c * a - this.b * b;
  879. this.b = c * b + this.b * a;
  880. this.c = d * a - this.d * b;
  881. this.d = d * b + this.d * a;
  882. this.tx = e * a - this.ty * b;
  883. this.ty = e * b + this.ty * a;
  884. return this
  885. };
  886. a.prototype.skew = function(b, k) {
  887. b *= a.DEG_TO_RAD;
  888. k *= a.DEG_TO_RAD;
  889. this.append(Math.cos(k), Math.sin(k), -Math.sin(b), Math.cos(b), 0, 0);
  890. return this
  891. };
  892. a.prototype.scale = function(b, a) {
  893. this.a *= b;
  894. this.d *= a;
  895. this.c *= b;
  896. this.b *= a;
  897. this.tx *= b;
  898. this.ty *= a;
  899. return this
  900. };
  901. a.prototype.translate = function(b, a) {
  902. this.tx += b;
  903. this.ty += a;
  904. return this
  905. };
  906. a.prototype.identity = function() {
  907. this.a = this.d = 1;
  908. this.b = this.c = this.tx = this.ty = 0;
  909. return this
  910. };
  911. a.prototype.invert = function() {
  912. var b = this.a,
  913. a = this.b,
  914. c = this.c,
  915. d = this.d,
  916. e = this.tx,
  917. h = b * d - a * c;
  918. this.a = d / h;
  919. this.b = -a / h;
  920. this.c = -c / h;
  921. this.d = b / h;
  922. this.tx = (c * this.ty - d * e) / h;
  923. this.ty = -(b * this.ty - a * e) / h;
  924. return this
  925. };
  926. a.transformCoords = function(b, a, f) {
  927. var d = c.Point.identity;
  928. d.x = b.a * a + b.c * f + b.tx;
  929. d.y = b.d * f + b.b * a + b.ty;
  930. return d
  931. };
  932. a.prototype.toArray = function(b) {
  933. this.array || (this.array = new Float32Array(9));
  934. b ? (this.array[0] = this.a, this.array[1] = this.b, this.array[2] = 0, this.array[3] = this.c, this.array[4] = this.d, this.array[5] = 0, this.array[6] = this.tx, this.array[7] = this.ty) : (this.array[0] = this.a, this.array[1] = this.b, this.array[2] = this.tx, this.array[3] = this.c, this.array[4] = this.d, this.array[5] = this.ty, this.array[6] = 0, this.array[7] = 0);
  935. this.array[8] = 1;
  936. return this.array
  937. };
  938. a.identity = new a;
  939. a.DEG_TO_RAD = Math.PI / 180;
  940. return a
  941. } (c.HashObject);
  942. c.Matrix = e;
  943. e.prototype.__class__ = "egret.Matrix"
  944. })(egret || (egret = {}));
  945. __extends = this.__extends ||
  946. function(c, e) {
  947. function d() {
  948. this.constructor = c
  949. }
  950. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  951. d.prototype = e.prototype;
  952. c.prototype = new d
  953. }; (function(c) {
  954. var e = function(c) {
  955. function a(b, a) {
  956. "undefined" === typeof b && (b = 0);
  957. "undefined" === typeof a && (a = 0);
  958. c.call(this);
  959. this.x = b;
  960. this.y = a
  961. }
  962. __extends(a, c);
  963. a.prototype.clone = function() {
  964. return new a(this.x, this.y)
  965. };
  966. a.prototype.equals = function(b) {
  967. return this.x == b.x && this.y == b.y
  968. };
  969. a.distance = function(b, a) {
  970. return Math.sqrt((b.x - a.x) * (b.x - a.x) + (b.y - a.y) * (b.y - a.y))
  971. };
  972. a.identity = new a(0, 0);
  973. return a
  974. } (c.HashObject);
  975. c.Point = e;
  976. e.prototype.__class__ = "egret.Point"
  977. })(egret || (egret = {}));
  978. __extends = this.__extends ||
  979. function(c, e) {
  980. function d() {
  981. this.constructor = c
  982. }
  983. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  984. d.prototype = e.prototype;
  985. c.prototype = new d
  986. }; (function(c) {
  987. var e = function(c) {
  988. function a(b, a, f, e) {
  989. "undefined" === typeof b && (b = 0);
  990. "undefined" === typeof a && (a = 0);
  991. "undefined" === typeof f && (f = 0);
  992. "undefined" === typeof e && (e = 0);
  993. c.call(this);
  994. this.x = b;
  995. this.y = a;
  996. this.width = f;
  997. this.height = e
  998. }
  999. __extends(a, c);
  1000. Object.defineProperty(a.prototype, "right", {
  1001. get: function() {
  1002. return this.x + this.width
  1003. },
  1004. set: function(b) {
  1005. this.width = b - this.x
  1006. },
  1007. enumerable: !0,
  1008. configurable: !0
  1009. });
  1010. Object.defineProperty(a.prototype, "bottom", {
  1011. get: function() {
  1012. return this.y + this.height
  1013. },
  1014. set: function(b) {
  1015. this.height = b - this.y
  1016. },
  1017. enumerable: !0,
  1018. configurable: !0
  1019. });
  1020. a.prototype.initialize = function(b, a, c, d) {
  1021. this.x = b;
  1022. this.y = a;
  1023. this.width = c;
  1024. this.height = d;
  1025. return this
  1026. };
  1027. a.prototype.contains = function(b, a) {
  1028. return this.x <= b && this.x + this.width >= b && this.y <= a && this.y + this.height >= a
  1029. };
  1030. a.prototype.intersects = function(b) {
  1031. return this.contains(b.x, b.y) || this.contains(b.x, b.bottom) || this.contains(b.right, b.y) || this.contains(b.right, b.bottom) ? !0 : !1
  1032. };
  1033. a.prototype.clone = function() {
  1034. return new a(this.x, this.y, this.width, this.height)
  1035. };
  1036. a.prototype.containsPoint = function(b) {
  1037. return this.x < b.x && this.x + this.width > b.x && this.y < b.y && this.y + this.height > b.y ? !0 : !1
  1038. };
  1039. a.identity = new a(0, 0, 0, 0);
  1040. return a
  1041. } (c.HashObject);
  1042. c.Rectangle = e;
  1043. e.prototype.__class__ = "egret.Rectangle"
  1044. })(egret || (egret = {})); (function(c) {
  1045. var e = function() {
  1046. function d() {}
  1047. d.fatal = function(a, b) {
  1048. "undefined" === typeof b && (b = null);
  1049. c.Logger.traceToConsole("Fatal", a, b);
  1050. throw Error(c.Logger.getTraceCode("Fatal", a, b));
  1051. };
  1052. d.info = function(a, b) {
  1053. "undefined" === typeof b && (b = null);
  1054. c.Logger.traceToConsole("Info", a, b)
  1055. };
  1056. d.warning = function(a, b) {
  1057. "undefined" === typeof b && (b = null);
  1058. c.Logger.traceToConsole("Warning", a, b)
  1059. };
  1060. d.traceToConsole = function(a, b, k) {
  1061. console.log(c.Logger.getTraceCode(a, b, k))
  1062. };
  1063. d.getTraceCode = function(a, b, k) {
  1064. return "[" + a + "]" + b + ":" + (null == k ? "": k)
  1065. };
  1066. return d
  1067. } ();
  1068. c.Logger = e;
  1069. e.prototype.__class__ = "egret.Logger"
  1070. })(egret || (egret = {}));
  1071. __extends = this.__extends ||
  1072. function(c, e) {
  1073. function d() {
  1074. this.constructor = c
  1075. }
  1076. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  1077. d.prototype = e.prototype;
  1078. c.prototype = new d
  1079. }; (function(c) {
  1080. var e = function(b) {
  1081. function k() {
  1082. b.call(this);
  1083. this._designHeight = this._designWidth = 0;
  1084. this._scaleY = this._scaleX = 1;
  1085. var a = document.getElementById(k.canvas_name),
  1086. c = a.height;
  1087. this._designWidth = a.width;
  1088. this._designHeight = c
  1089. }
  1090. __extends(k, b);
  1091. k.getInstance = function() {
  1092. null == k.instance && (a.initialize(), k.instance = new k);
  1093. return k.instance
  1094. };
  1095. k.prototype.setDesignSize = function(b, a, k) {
  1096. this.setResolutionPolicy(k);
  1097. this._designWidth = b;
  1098. this._designHeight = a;
  1099. this._resolutionPolicy._apply(this, this._designWidth, this._designHeight)
  1100. };
  1101. k.prototype.setResolutionPolicy = function(b) {
  1102. this._resolutionPolicy = b;
  1103. b.init(this)
  1104. };
  1105. k.prototype.getScaleX = function() {
  1106. return this._scaleX
  1107. };
  1108. k.prototype.getScaleY = function() {
  1109. return this._scaleY
  1110. };
  1111. k.canvas_name = "gameCanvas";
  1112. k.canvas_div_name = "gameDiv";
  1113. return k
  1114. } (c.HashObject);
  1115. c.StageDelegate = e;
  1116. e.prototype.__class__ = "egret.StageDelegate";
  1117. var d = function() {
  1118. function b(a, k) {
  1119. this.setContainerStrategy(a);
  1120. this.setContentStrategy(k)
  1121. }
  1122. b.prototype.init = function(b) {
  1123. this._containerStrategy.init(b);
  1124. this._contentStrategy.init(b)
  1125. };
  1126. b.prototype._apply = function(b, a, k) {
  1127. this._containerStrategy._apply(b, a, k);
  1128. this._contentStrategy._apply(b, a, k)
  1129. };
  1130. b.prototype.setContainerStrategy = function(b) {
  1131. b instanceof a && (this._containerStrategy = b)
  1132. };
  1133. b.prototype.setContentStrategy = function(b) {
  1134. b instanceof k && (this._contentStrategy = b)
  1135. };
  1136. return b
  1137. } ();
  1138. c.ResolutionPolicy = d;
  1139. d.prototype.__class__ = "egret.ResolutionPolicy";
  1140. var a = function() {
  1141. function a() {}
  1142. a.initialize = function() {
  1143. a.EQUAL_TO_FRAME = new b
  1144. };
  1145. a.prototype.init = function(b) {};
  1146. a.prototype._apply = function(b, a, k) {};
  1147. a.prototype._setupContainer = function() {
  1148. var b = document.body,
  1149. a;
  1150. b && (a = b.style) && (a.paddingTop = a.paddingTop || "0px", a.paddingRight = a.paddingRight || "0px", a.paddingBottom = a.paddingBottom || "0px", a.paddingLeft = a.paddingLeft || "0px", a.borderTop = a.borderTop || "0px", a.borderRight = a.borderRight || "0px", a.borderBottom = a.borderBottom || "0px", a.borderLeft = a.borderLeft || "0px", a.marginTop = a.marginTop || "0px", a.marginRight = a.marginRight || "0px", a.marginBottom = a.marginBottom || "0px", a.marginLeft = a.marginLeft || "0px")
  1151. };
  1152. return a
  1153. } ();
  1154. c.ContainerStrategy = a;
  1155. a.prototype.__class__ = "egret.ContainerStrategy";
  1156. var b = function(b) {
  1157. function a() {
  1158. b.apply(this, arguments)
  1159. }
  1160. __extends(a, b);
  1161. a.prototype._apply = function(b) {
  1162. this._setupContainer()
  1163. };
  1164. return a
  1165. } (a);
  1166. c.EqualToFrame = b;
  1167. b.prototype.__class__ = "egret.EqualToFrame";
  1168. var k = function() {
  1169. function b() {}
  1170. b.prototype.init = function(b) {};
  1171. b.prototype._apply = function(b, a, k) {};
  1172. return b
  1173. } ();
  1174. c.ContentStrategy = k;
  1175. k.prototype.__class__ = "egret.ContentStrategy";
  1176. d = function(b) {
  1177. function a() {
  1178. b.apply(this, arguments)
  1179. }
  1180. __extends(a, b);
  1181. a.prototype._apply = function(b, a, k) {
  1182. var c = document.getElementById(e.canvas_name),
  1183. f = document.getElementById(e.canvas_div_name),
  1184. d = c.height / k,
  1185. m = window.innerHeight,
  1186. d = m / k,
  1187. s = a * d;
  1188. c.width = a;
  1189. c.height = k;
  1190. c.style.width = s + "px";
  1191. c.style.height = m + "px";
  1192. f.style.width = s + "px";
  1193. f.style.height = m + "px";
  1194. b._scaleX = d;
  1195. b._scaleY = d
  1196. };
  1197. return a
  1198. } (k);
  1199. c.FixedHeight = d;
  1200. d.prototype.__class__ = "egret.FixedHeight";
  1201. d = function(b) {
  1202. function a() {
  1203. b.apply(this, arguments)
  1204. }
  1205. __extends(a, b);
  1206. a.prototype._apply = function(b, a, k) {
  1207. k = document.getElementById(e.canvas_name);
  1208. var c = document.getElementById(e.canvas_div_name),
  1209. f = document.documentElement.clientWidth,
  1210. d = document.documentElement.clientHeight,
  1211. m = f / a;
  1212. k.width = a;
  1213. k.height = d / m;
  1214. k.style.width = f + "px";
  1215. k.style.height = d + "px";
  1216. c.style.width = f + "px";
  1217. c.style.height = d + "px";
  1218. b._scaleX = m;
  1219. b._scaleY = m
  1220. };
  1221. return a
  1222. } (k);
  1223. c.FixedWidth = d;
  1224. d.prototype.__class__ = "egret.FixedWidth";
  1225. d = function(b) {
  1226. function a(k, c) {
  1227. b.call(this);
  1228. this.width = k;
  1229. this.height = c
  1230. }
  1231. __extends(a, b);
  1232. a.prototype._apply = function(b, a, k) {
  1233. k = document.getElementById(e.canvas_name);
  1234. var c = document.getElementById(e.canvas_div_name),
  1235. f = this.width,
  1236. d = this.height,
  1237. m = f / a;
  1238. k.width = a;
  1239. k.height = d / m;
  1240. k.style.width = f + "px";
  1241. k.style.height = d + "px";
  1242. c.style.width = f + "px";
  1243. c.style.height = d + "px";
  1244. b._scaleX = m;
  1245. b._scaleY = m
  1246. };
  1247. return a
  1248. } (k);
  1249. c.FixedSize = d;
  1250. d.prototype.__class__ = "egret.FixedSize";
  1251. d = function(b) {
  1252. function a(k, c) {
  1253. b.call(this);
  1254. this.width = k;
  1255. this.height = c
  1256. }
  1257. __extends(a, b);
  1258. a.prototype._apply = function(b, a, k) {
  1259. a = document.getElementById(e.canvas_name);
  1260. a.style.width = a.width + "px";
  1261. a.style.height = a.height + "px";
  1262. b._scaleX = 1;
  1263. b._scaleY = 1
  1264. };
  1265. return a
  1266. } (k);
  1267. c.NoScale = d;
  1268. d.prototype.__class__ = "egret.NoScale"
  1269. })(egret || (egret = {}));
  1270. __extends = this.__extends ||
  1271. function(c, e) {
  1272. function d() {
  1273. this.constructor = c
  1274. }
  1275. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  1276. d.prototype = e.prototype;
  1277. c.prototype = new d
  1278. }; (function(c) {
  1279. var e = function(d) {
  1280. function a() {
  1281. d.call(this);
  1282. this._originalData = {};
  1283. this._drawAreaList = []
  1284. }
  1285. __extends(a, d);
  1286. a.getInstance = function() {
  1287. null == a.instance && (a.instance = new a);
  1288. return a.instance
  1289. };
  1290. a.prototype.addDrawArea = function(b) {
  1291. this._drawAreaList.push(b)
  1292. };
  1293. a.prototype.clearDrawArea = function() {
  1294. this._drawAreaList = []
  1295. };
  1296. a.prototype.drawImage = function(b, a, f, d, e, h, l, n, p, q) {
  1297. l = l || 0;
  1298. n = n || 0;
  1299. var r = a._texture_to_render;
  1300. if (null != r && 0 != h && 0 != e && 0 != p && 0 != q) if (a._worldBounds) {
  1301. var s = this._originalData;
  1302. s.sourceX = f;
  1303. s.sourceY = d;
  1304. s.sourceWidth = e;
  1305. s.sourceHeight = h;
  1306. s.destX = l;
  1307. s.destY = n;
  1308. s.destWidth = p;
  1309. s.destHeight = q;
  1310. for (var t = this.getDrawAreaList(), A = 0; A < t.length; A++) {
  1311. var w = t[A];
  1312. if (!this.ignoreRender(a, w, s.destX, s.destY)) {
  1313. if (0 != this._drawAreaList.length) if (0 != a._worldTransform.b || 0 != a._worldTransform.c) {
  1314. if (a._worldBounds.x + s.destX < w.x || a._worldBounds.y + s.destY < w.y || a._worldBounds.x + a._worldBounds.width + s.destX > w.x + w.width || a._worldBounds.y + a._worldBounds.height + s.destY > w.y + w.height) {
  1315. c.Logger.fatal("\u8bf7\u4e0d\u8981\u8ba9\u5e26\u6709\u65cb\u8f6c\u548c\u659c\u5207\u7684\u663e\u793a\u5bf9\u8c61\u8de8\u8fc7\u91cd\u7ed8\u533a\u57df");
  1316. break
  1317. }
  1318. } else {
  1319. var B = a._worldTransform.a,
  1320. C = a._worldTransform.d,
  1321. u;
  1322. a._worldBounds.x + s.destX < w.x && (u = (w.x - a._worldBounds.x) / B - s.destX, f += u / (p / e), e -= u / (p / e), p -= u, l += u);
  1323. a._worldBounds.y + s.destY < w.y && (u = (w.y - a._worldBounds.y) / C - s.destY, d += u / (q / h), h -= u / (q / h), q -= u, n += u);
  1324. a._worldBounds.x + a._worldBounds.width + s.destX > w.x + w.width && (u = (a._worldBounds.x + a._worldBounds.width - w.x - w.width) / B + s.destX, e -= u / (p / e), p -= u);
  1325. a._worldBounds.y + a._worldBounds.height + s.destY > w.y + w.height && (u = (a._worldBounds.y + a._worldBounds.height - w.y - w.height) / C + s.destY, h -= u / (q / h), q -= u)
  1326. }
  1327. b.drawImage(r, f, d, e, h, l, n, p, q)
  1328. }
  1329. }
  1330. } else b.drawImage(r, f, d, e, h, l, n, p, q)
  1331. };
  1332. a.prototype.ignoreRender = function(b, a, c, d) {
  1333. var e = b._worldBounds;
  1334. c *= b._worldTransform.a;
  1335. d *= b._worldTransform.d;
  1336. return e.x + e.width + c <= a.x || e.x + c >= a.x + a.width || e.y + e.height + d <= a.y || e.y + d >= a.y + a.height ? !0 : !1
  1337. };
  1338. a.prototype.getDrawAreaList = function() {
  1339. var b;
  1340. 0 == this._drawAreaList.length ? (this._defaultDrawAreaList || (this._defaultDrawAreaList = [new c.Rectangle(0, 0, c.MainContext.instance.stage.stageWidth, c.MainContext.instance.stage.stageHeight)]), b = this._defaultDrawAreaList) : b = this._drawAreaList;
  1341. return b
  1342. };
  1343. return a
  1344. } (c.HashObject);
  1345. c.RenderFilter = e;
  1346. e.prototype.__class__ = "egret.RenderFilter"
  1347. })(egret || (egret = {})); (function(c) {
  1348. var e = function() {
  1349. function d() {}
  1350. d.mapClass = function(a, b, k) {
  1351. "undefined" === typeof k && (k = "");
  1352. a = this.getKey(a) + "#" + k;
  1353. this.mapClassDic[a] = b
  1354. };
  1355. d.getKey = function(a) {
  1356. return "string" == typeof a ? a: c.getQualifiedClassName(a)
  1357. };
  1358. d.mapValue = function(a, b, k) {
  1359. "undefined" === typeof k && (k = "");
  1360. a = this.getKey(a) + "#" + k;
  1361. this.mapValueDic[a] = b
  1362. };
  1363. d.hasMapRule = function(a, b) {
  1364. "undefined" === typeof b && (b = "");
  1365. var k = this.getKey(a) + "#" + b;
  1366. return this.mapValueDic[k] || this.mapClassDic[k] ? !0 : !1
  1367. };
  1368. d.getInstance = function(a, b) {
  1369. "undefined" === typeof b && (b = "");
  1370. var k = this.getKey(a) + "#" + b;
  1371. if (this.mapValueDic[k]) return this.mapValueDic[k];
  1372. var c = this.mapClassDic[k];
  1373. if (c) return c = new c,
  1374. this.mapValueDic[k] = c,
  1375. delete this.mapClassDic[k],
  1376. c;
  1377. throw Error("\u8c03\u7528\u4e86\u672a\u914d\u7f6e\u7684\u6ce8\u5165\u89c4\u5219:" + k + "\u3002 \u8bf7\u5148\u5728\u9879\u76ee\u521d\u59cb\u5316\u91cc\u914d\u7f6e\u6307\u5b9a\u7684\u6ce8\u5165\u89c4\u5219\uff0c\u518d\u8c03\u7528\u5bf9\u5e94\u5355\u4f8b\u3002");
  1378. };
  1379. d.mapClassDic = {};
  1380. d.mapValueDic = {};
  1381. return d
  1382. } ();
  1383. c.Injector = e;
  1384. e.prototype.__class__ = "egret.Injector"
  1385. })(egret || (egret = {})); (function(c) {
  1386. var e = function() {
  1387. function c() {}
  1388. c.NORMAL = "normal";
  1389. c.ADD = "add";
  1390. c.LAYER = "layer";
  1391. return c
  1392. } ();
  1393. c.BlendMode = e;
  1394. e.prototype.__class__ = "egret.BlendMode"
  1395. })(egret || (egret = {}));
  1396. __extends = this.__extends ||
  1397. function(c, e) {
  1398. function d() {
  1399. this.constructor = c
  1400. }
  1401. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  1402. d.prototype = e.prototype;
  1403. c.prototype = new d
  1404. }; (function(c) {
  1405. var e = function(d) {
  1406. function a() {
  1407. d.call(this);
  1408. this._sizeDirty = this._normalDirty = !0;
  1409. this._parent = null;
  1410. this._cacheAsBitmap = !1;
  1411. this._y = this._x = 0;
  1412. this._scaleY = this._scaleX = 1;
  1413. this._anchorY = this._anchorX = this._anchorOffsetY = this._anchorOffsetX = 0;
  1414. this._visible = !0;
  1415. this._rotation = 0;
  1416. this._alpha = 1;
  1417. this._skewY = this._skewX = 0;
  1418. this._hasHeightSet = this._hasWidthSet = !1;
  1419. this.worldAlpha = 1;
  1420. this._rectH = this._rectW = 0;
  1421. this._worldTransform = new c.Matrix;
  1422. this._cacheBounds = new c.Rectangle(0, 0, 0, 0)
  1423. }
  1424. __extends(a, d);
  1425. a.prototype._setDirty = function() {
  1426. this._normalDirty = !0
  1427. };
  1428. a.prototype.getDirty = function() {
  1429. return this._normalDirty || this._sizeDirty
  1430. };
  1431. a.prototype._setParentSizeDirty = function() { ! this.parent || this.parent._hasWidthSet || this.parent._hasHeightSet || this.parent._setSizeDirty()
  1432. };
  1433. a.prototype._setSizeDirty = function() {
  1434. this._sizeDirty || (this._sizeDirty = !0, this._setDirty(), this._setParentSizeDirty())
  1435. };
  1436. a.prototype._clearDirty = function() {
  1437. this._normalDirty = !1
  1438. };
  1439. a.prototype._clearSizeDirty = function() {
  1440. this._sizeDirty = !1
  1441. };
  1442. Object.defineProperty(a.prototype, "parent", {
  1443. get: function() {
  1444. return this._parent
  1445. },
  1446. enumerable: !0,
  1447. configurable: !0
  1448. });
  1449. a.prototype._parentChanged = function(b) {
  1450. this._parent = b
  1451. };
  1452. Object.defineProperty(a.prototype, "x", {
  1453. get: function() {
  1454. return this._x
  1455. },
  1456. set: function(b) {
  1457. c.NumberUtils.isNumber(b) && (this._x = b, this._setDirty(), this._setParentSizeDirty())
  1458. },
  1459. enumerable: !0,
  1460. configurable: !0
  1461. });
  1462. Object.defineProperty(a.prototype, "y", {
  1463. get: function() {
  1464. return this._y
  1465. },
  1466. set: function(b) {
  1467. c.NumberUtils.isNumber(b) && (this._y = b, this._setDirty(), this._setParentSizeDirty())
  1468. },
  1469. enumerable: !0,
  1470. configurable: !0
  1471. });
  1472. Object.defineProperty(a.prototype, "scaleX", {
  1473. get: function() {
  1474. return this._scaleX
  1475. },
  1476. set: function(b) {
  1477. c.NumberUtils.isNumber(b) && (this._scaleX = b, this._setDirty(), this._setParentSizeDirty())
  1478. },
  1479. enumerable: !0,
  1480. configurable: !0
  1481. });
  1482. Object.defineProperty(a.prototype, "scaleY", {
  1483. get: function() {
  1484. return this._scaleY
  1485. },
  1486. set: function(b) {
  1487. c.NumberUtils.isNumber(b) && (this._scaleY = b, this._setDirty(), this._setParentSizeDirty())
  1488. },
  1489. enumerable: !0,
  1490. configurable: !0
  1491. });
  1492. Object.defineProperty(a.prototype, "anchorOffsetX", {
  1493. get: function() {
  1494. return this._anchorOffsetX
  1495. },
  1496. set: function(b) {
  1497. c.NumberUtils.isNumber(b) && (this._anchorOffsetX = b, this._setDirty(), this._setParentSizeDirty())
  1498. },
  1499. enumerable: !0,
  1500. configurable: !0
  1501. });
  1502. Object.defineProperty(a.prototype, "anchorOffsetY", {
  1503. get: function() {
  1504. return this._anchorOffsetY
  1505. },
  1506. set: function(b) {
  1507. c.NumberUtils.isNumber(b) && (this._anchorOffsetY = b, this._setDirty(), this._setParentSizeDirty())
  1508. },
  1509. enumerable: !0,
  1510. configurable: !0
  1511. });
  1512. Object.defineProperty(a.prototype, "anchorX", {
  1513. get: function() {
  1514. return this._anchorX
  1515. },
  1516. set: function(b) {
  1517. c.NumberUtils.isNumber(b) && (this._anchorX = b, this._setDirty(), this._setParentSizeDirty())
  1518. },
  1519. enumerable: !0,
  1520. configurable: !0
  1521. });
  1522. Object.defineProperty(a.prototype, "anchorY", {
  1523. get: function() {
  1524. return this._anchorY
  1525. },
  1526. set: function(b) {
  1527. c.NumberUtils.isNumber(b) && (this._anchorY = b, this._setDirty(), this._setParentSizeDirty())
  1528. },
  1529. enumerable: !0,
  1530. configurable: !0
  1531. });
  1532. Object.defineProperty(a.prototype, "visible", {
  1533. get: function() {
  1534. return this._visible
  1535. },
  1536. set: function(b) {
  1537. this._visible = b;
  1538. this._setDirty()
  1539. },
  1540. enumerable: !0,
  1541. configurable: !0
  1542. });
  1543. Object.defineProperty(a.prototype, "rotation", {
  1544. get: function() {
  1545. return this._rotation
  1546. },
  1547. set: function(b) {
  1548. c.NumberUtils.isNumber(b) && (this._rotation = b, this._setSizeDirty())
  1549. },
  1550. enumerable: !0,
  1551. configurable: !0
  1552. });
  1553. Object.defineProperty(a.prototype, "alpha", {
  1554. get: function() {
  1555. return this._alpha
  1556. },
  1557. set: function(b) {
  1558. c.NumberUtils.isNumber(b) && (this._alpha = b, this._setDirty())
  1559. },
  1560. enumerable: !0,
  1561. configurable: !0
  1562. });
  1563. Object.defineProperty(a.prototype, "skewX", {
  1564. get: function() {
  1565. return this._skewX
  1566. },
  1567. set: function(b) {
  1568. c.NumberUtils.isNumber(b) && (this._skewX = b, this._setSizeDirty())
  1569. },
  1570. enumerable: !0,
  1571. configurable: !0
  1572. });
  1573. Object.defineProperty(a.prototype, "skewY", {
  1574. get: function() {
  1575. return this._skewY
  1576. },
  1577. set: function(b) {
  1578. c.NumberUtils.isNumber(b) && (this._skewY = b, this._setSizeDirty())
  1579. },
  1580. enumerable: !0,
  1581. configurable: !0
  1582. });
  1583. Object.defineProperty(a.prototype, "touchEnabled", {
  1584. get: function() {
  1585. return this._touchEnabled
  1586. },
  1587. set: function(b) {
  1588. this._touchEnabled = b
  1589. },
  1590. enumerable: !0,
  1591. configurable: !0
  1592. });
  1593. Object.defineProperty(a.prototype, "scrollRect", {
  1594. get: function() {
  1595. return this._scrollRect
  1596. },
  1597. set: function(b) {
  1598. this._scrollRect = b;
  1599. this._setSizeDirty()
  1600. },
  1601. enumerable: !0,
  1602. configurable: !0
  1603. });
  1604. Object.defineProperty(a.prototype, "measuredWidth", {
  1605. get: function() {
  1606. return this._measureBounds().width
  1607. },
  1608. enumerable: !0,
  1609. configurable: !0
  1610. });
  1611. Object.defineProperty(a.prototype, "measuredHeight", {
  1612. get: function() {
  1613. return this._measureBounds().height
  1614. },
  1615. enumerable: !0,
  1616. configurable: !0
  1617. });
  1618. Object.defineProperty(a.prototype, "explicitWidth", {
  1619. get: function() {
  1620. return this._explicitWidth
  1621. },
  1622. enumerable: !0,
  1623. configurable: !0
  1624. });
  1625. Object.defineProperty(a.prototype, "explicitHeight", {
  1626. get: function() {
  1627. return this._explicitHeight
  1628. },
  1629. enumerable: !0,
  1630. configurable: !0
  1631. });
  1632. Object.defineProperty(a.prototype, "width", {
  1633. get: function() {
  1634. return this._getSize(c.Rectangle.identity).width
  1635. },
  1636. set: function(b) {
  1637. this._setSizeDirty();
  1638. this._setWidth(b)
  1639. },
  1640. enumerable: !0,
  1641. configurable: !0
  1642. });
  1643. Object.defineProperty(a.prototype, "height", {
  1644. get: function() {
  1645. return this._getSize(c.Rectangle.identity).height
  1646. },
  1647. set: function(b) {
  1648. this._setSizeDirty();
  1649. this._setHeight(b)
  1650. },
  1651. enumerable: !0,
  1652. configurable: !0
  1653. });
  1654. a.prototype._setWidth = function(b) {
  1655. this._explicitWidth = b;
  1656. this._hasWidthSet = c.NumberUtils.isNumber(b)
  1657. };
  1658. a.prototype._setHeight = function(b) {
  1659. this._explicitHeight = b;
  1660. this._hasHeightSet = c.NumberUtils.isNumber(b)
  1661. };
  1662. a.prototype._draw = function(b) {
  1663. if (this.visible && !this.drawCacheTexture(b)) {
  1664. b.setAlpha(this.worldAlpha, this.blendMode);
  1665. b.setTransform(this._worldTransform);
  1666. var a = this.mask || this._scrollRect;
  1667. a && b.pushMask(a);
  1668. this._render(b);
  1669. a && b.popMask()
  1670. }
  1671. this.destroyCacheBounds()
  1672. };
  1673. a.prototype.drawCacheTexture = function(b) {
  1674. if (this._cacheAsBitmap) {
  1675. var a = this._texture_to_render,
  1676. f = a._offsetX,
  1677. d = a._offsetY,
  1678. e = a._textureWidth,
  1679. a = a._textureHeight;
  1680. this._updateTransform();
  1681. b.setAlpha(this.worldAlpha, this.blendMode);
  1682. b.setTransform(this._worldTransform);
  1683. var h = c.MainContext.instance.rendererContext.texture_scale_factor;
  1684. c.RenderFilter.getInstance().drawImage(b, this, 0, 0, e * h, a * h, f, d, e, a);
  1685. return ! 0
  1686. }
  1687. return ! 1
  1688. };
  1689. a.prototype._updateTransform = function() {
  1690. this._worldTransform.identity().appendMatrix(this._parent._worldTransform);
  1691. var b = this._getOffsetPoint();
  1692. this._worldTransform.appendTransform(this._x, this._y, this._scaleX, this._scaleY, this._rotation, this._skewX, this._skewY, b.x, b.y);
  1693. this._scrollRect && this._worldTransform.append(1, 0, 0, 1, -this._scrollRect.x, -this._scrollRect.y);
  1694. this.worldAlpha = this._parent.worldAlpha * this._alpha
  1695. };
  1696. a.prototype._render = function(b) {};
  1697. a.prototype.getBounds = function(b) {
  1698. var a = this._measureBounds(),
  1699. f = this._hasWidthSet ? this._explicitWidth: a.width,
  1700. d = this._hasHeightSet ? this._explicitHeight: a.height,
  1701. e = a.x,
  1702. a = a.y,
  1703. h,
  1704. l;
  1705. 0 != this._anchorX || 0 != this._anchorY ? (h = f * this._anchorX, l = d * this._anchorY) : (h = this._anchorOffsetX, l = this._anchorOffsetY);
  1706. this._cacheBounds.initialize(e - h, a - l, f, d);
  1707. f = this._cacheBounds;
  1708. b || (b = new c.Rectangle);
  1709. return b.initialize(f.x, f.y, f.width, f.height)
  1710. };
  1711. a.prototype.destroyCacheBounds = function() {
  1712. this._cacheBounds.x = 0;
  1713. this._cacheBounds.y = 0;
  1714. this._cacheBounds.width = 0;
  1715. this._cacheBounds.height = 0
  1716. };
  1717. a.prototype._getConcatenatedMatrix = function() {
  1718. for (var b = a.identityMatrixForGetConcatenated.identity(), k = this; null != k;) {
  1719. if (0 != k._anchorX || 0 != k._anchorY) {
  1720. var f = k._getSize(c.Rectangle.identity);
  1721. b.prependTransform(k._x, k._y, k._scaleX, k._scaleY, k._rotation, k._skewX, k._skewY, f.width * k._anchorX, f.height * k._anchorY)
  1722. } else b.prependTransform(k._x, k._y, k._scaleX, k._scaleY, k._rotation, k._skewX, k._skewY, k._anchorOffsetX, k._anchorOffsetY);
  1723. k = k._parent
  1724. }
  1725. return b
  1726. };
  1727. a.prototype.localToGlobal = function(b, a, f) {
  1728. "undefined" === typeof b && (b = 0);
  1729. "undefined" === typeof a && (a = 0);
  1730. var d = this._getConcatenatedMatrix();
  1731. d.append(1, 0, 0, 1, b, a);
  1732. f || (f = new c.Point);
  1733. f.x = d.tx;
  1734. f.y = d.ty;
  1735. return f
  1736. };
  1737. a.prototype.globalToLocal = function(b, a, f) {
  1738. "undefined" === typeof b && (b = 0);
  1739. "undefined" === typeof a && (a = 0);
  1740. var d = this._getConcatenatedMatrix();
  1741. d.invert();
  1742. d.append(1, 0, 0, 1, b, a);
  1743. f || (f = new c.Point);
  1744. f.x = d.tx;
  1745. f.y = d.ty;
  1746. return f
  1747. };
  1748. a.prototype.hitTest = function(b, a, f) {
  1749. "undefined" === typeof f && (f = !1);
  1750. if (!this.visible || !f && !this._touchEnabled) return null;
  1751. f = this._getSize(c.Rectangle.identity);
  1752. return 0 <= b && b < f.width && 0 <= a && a < f.height ? this.mask || this._scrollRect ? this._scrollRect && b < this._scrollRect.width && a < this._scrollRect.height || this.mask && this.mask.x <= b && b < this.mask.x + this.mask.width && this.mask.y <= a && a < this.mask.y + this.mask.height ? this: null: this: null
  1753. };
  1754. a.prototype.hitTestPoint = function(b, a, f) {
  1755. b = this.globalToLocal(b, a);
  1756. return f ? (this._hitTestPointTexture || (this._hitTestPointTexture = new c.RenderTexture), f = this._hitTestPointTexture, f.drawToTexture(this), 0 != f.getPixel32(b.x - this._hitTestPointTexture._offsetX, b.y - this._hitTestPointTexture._offsetY)[3] ? !0 : !1) : !!this.hitTest(b.x, b.y, !0)
  1757. };
  1758. a.prototype._getMatrix = function() {
  1759. var b = c.Matrix.identity.identity(),
  1760. a = this._getOffsetPoint();
  1761. b.appendTransform(this._x, this._y, this._scaleX, this._scaleY, this._rotation, this._skewX, this._skewY, a.x, a.y);
  1762. return b
  1763. };
  1764. a.prototype._getSize = function(b) {
  1765. return this._hasHeightSet && this._hasWidthSet ? b.initialize(NaN, NaN, this._explicitWidth, this._explicitHeight) : this._measureSize(c.Rectangle.identity)
  1766. };
  1767. a.prototype._measureSize = function(b) {
  1768. this._sizeDirty ? (b = this._measureBounds(), this._rectW = b.width, this._rectH = b.height, this._clearSizeDirty()) : (b.width = this._rectW, b.height = this._rectH);
  1769. return b
  1770. };
  1771. a.prototype._measureBounds = function() {
  1772. return c.Rectangle.identity.initialize(0, 0, 0, 0)
  1773. };
  1774. a.prototype._getOffsetPoint = function() {
  1775. var b = this._anchorOffsetX,
  1776. a = this._anchorOffsetY;
  1777. if (0 != this._anchorX || 0 != this._anchorY) a = this._getSize(c.Rectangle.identity),
  1778. b = this._anchorX * a.width,
  1779. a = this._anchorY * a.height;
  1780. var f = c.Point.identity;
  1781. f.x = b;
  1782. f.y = a;
  1783. return f
  1784. };
  1785. a.prototype._onAddToStage = function() {
  1786. this._stage = c.MainContext.instance.stage;
  1787. c.DisplayObjectContainer.__EVENT__ADD_TO_STAGE_LIST.push(this)
  1788. };
  1789. a.prototype._onRemoveFromStage = function() {
  1790. this._stage = null;
  1791. c.DisplayObjectContainer.__EVENT__REMOVE_FROM_STAGE_LIST.push(this)
  1792. };
  1793. Object.defineProperty(a.prototype, "stage", {
  1794. get: function() {
  1795. return this._stage
  1796. },
  1797. enumerable: !0,
  1798. configurable: !0
  1799. });
  1800. a.prototype.addEventListener = function(b, k, f, e, g) {
  1801. "undefined" === typeof e && (e = !1);
  1802. "undefined" === typeof g && (g = 0);
  1803. d.prototype.addEventListener.call(this, b, k, f, e, g); ((e = b == c.Event.ENTER_FRAME) || b == c.Event.RENDER) && this._insertEventBin(e ? a._enterFrameCallBackList: a._renderCallBackList, k, f, g)
  1804. };
  1805. a.prototype.removeEventListener = function(b, k, f, e) {
  1806. "undefined" === typeof e && (e = !1);
  1807. d.prototype.removeEventListener.call(this, b, k, f, e); ((e = b == c.Event.ENTER_FRAME) || b == c.Event.RENDER) && this._removeEventBin(e ? a._enterFrameCallBackList: a._renderCallBackList, k, f)
  1808. };
  1809. a.prototype.dispatchEvent = function(b) {
  1810. if (!b._bubbles) return d.prototype.dispatchEvent.call(this, b);
  1811. for (var a = [], c = this; c;) a.unshift(c),
  1812. c = c.parent;
  1813. for (var e = a.length,
  1814. c = e - 1,
  1815. e = e - 2; 0 <= e; e--) a.push(a[e]);
  1816. b._reset();
  1817. this._dispatchPropagationEvent(b, a, c);
  1818. return ! b.isDefaultPrevented()
  1819. };
  1820. a.prototype._dispatchPropagationEvent = function(b, a, c) {
  1821. for (var d = a.length,
  1822. e = 0; e < d; e++) {
  1823. var h = a[e];
  1824. b._setCurrentTarget(h);
  1825. b._target = this;
  1826. b._eventPhase = e < c ? 1 : e == c ? 2 : 3;
  1827. h._notifyListener(b);
  1828. if (b._isPropagationStopped || b._isPropagationImmediateStopped) break
  1829. }
  1830. };
  1831. a.prototype.willTrigger = function(b) {
  1832. for (var a = this; a;) {
  1833. if (a.hasEventListener(b)) return ! 0;
  1834. a = a._parent
  1835. }
  1836. return ! 1
  1837. };
  1838. Object.defineProperty(a.prototype, "cacheAsBitmap", {
  1839. get: function() {
  1840. return this._cacheAsBitmap
  1841. },
  1842. set: function(b) { (this._cacheAsBitmap = b) ? (this.renderTexture || (this.renderTexture = new c.RenderTexture), this.renderTexture.drawToTexture(this), this._texture_to_render = this.renderTexture) : this._texture_to_render = null
  1843. },
  1844. enumerable: !0,
  1845. configurable: !0
  1846. });
  1847. a.getTransformBounds = function(b, a) {
  1848. var c, d, e = b.width,
  1849. h = b.height,
  1850. l = e * a.a,
  1851. e = e * a.b,
  1852. n = h * a.c,
  1853. h = h * a.d,
  1854. p = a.tx,
  1855. q = a.ty,
  1856. r = p,
  1857. s = p,
  1858. t = q,
  1859. A = q; (c = l + p) < r ? r = c: c > s && (s = c); (c = l + n + p) < r ? r = c: c > s && (s = c); (c = n + p) < r ? r = c: c > s && (s = c); (d = e + q) < t ? t = d: d > A && (A = d); (d = e + h + q) < t ? t = d: d > A && (A = d); (d = h + q) < t ? t = d: d > A && (A = d);
  1860. return b.initialize(r, t, s - r, A - t)
  1861. };
  1862. a.identityMatrixForGetConcatenated = new c.Matrix;
  1863. a._enterFrameCallBackList = [];
  1864. a._renderCallBackList = [];
  1865. return a
  1866. } (c.EventDispatcher);
  1867. c.DisplayObject = e;
  1868. e.prototype.__class__ = "egret.DisplayObject"
  1869. })(egret || (egret = {}));
  1870. __extends = this.__extends ||
  1871. function(c, e) {
  1872. function d() {
  1873. this.constructor = c
  1874. }
  1875. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  1876. d.prototype = e.prototype;
  1877. c.prototype = new d
  1878. }; (function(c) {
  1879. var e = function(d) {
  1880. function a() {
  1881. d.call(this);
  1882. this._touchChildren = !0;
  1883. this._children = []
  1884. }
  1885. __extends(a, d);
  1886. Object.defineProperty(a.prototype, "touchChildren", {
  1887. get: function() {
  1888. return this._touchChildren
  1889. },
  1890. set: function(b) {
  1891. this._touchChildren = b
  1892. },
  1893. enumerable: !0,
  1894. configurable: !0
  1895. });
  1896. Object.defineProperty(a.prototype, "numChildren", {
  1897. get: function() {
  1898. return this._children.length
  1899. },
  1900. enumerable: !0,
  1901. configurable: !0
  1902. });
  1903. a.prototype.setChildIndex = function(b, a) {
  1904. this.doSetChildIndex(b, a)
  1905. };
  1906. a.prototype.doSetChildIndex = function(b, a) {
  1907. var f = this._children.indexOf(b);
  1908. 0 > f && c.Logger.fatal("child\u4e0d\u5728\u5f53\u524d\u5bb9\u5668\u5185");
  1909. this._children.splice(f, 1);
  1910. 0 > a || this._children.length <= a ? this._children.push(b) : this._children.splice(a, 0, b)
  1911. };
  1912. a.prototype.addChild = function(b) {
  1913. var a = this.numChildren;
  1914. b._parent == this && a--;
  1915. return this._doAddChild(b, a)
  1916. };
  1917. a.prototype.addChildAt = function(b, a) {
  1918. return this._doAddChild(b, a)
  1919. };
  1920. a.prototype._doAddChild = function(b, k, f) {
  1921. "undefined" === typeof f && (f = !0);
  1922. if (b == this) return b;
  1923. if (0 > k || k > this._children.length) return c.Logger.fatal("\u63d0\u4f9b\u7684\u7d22\u5f15\u8d85\u51fa\u8303\u56f4"),
  1924. b;
  1925. var d = b.parent;
  1926. if (d == this) return this.doSetChildIndex(b, k),
  1927. b;
  1928. d && d.removeChild(b);
  1929. this._children.splice(k, 0, b);
  1930. b._parentChanged(this);
  1931. f && b.dispatchEventWith(c.Event.ADDED, !0);
  1932. if (this._stage) for (b._onAddToStage(), k = a.__EVENT__ADD_TO_STAGE_LIST; 0 < k.length;) k.shift().dispatchEventWith(c.Event.ADDED_TO_STAGE);
  1933. b._setDirty();
  1934. this._setSizeDirty();
  1935. return b
  1936. };
  1937. a.prototype.removeChild = function(b) {
  1938. b = this._children.indexOf(b);
  1939. if (0 <= b) return this._doRemoveChild(b);
  1940. c.Logger.fatal("child\u672a\u88abaddChild\u5230\u8be5parent");
  1941. return null
  1942. };
  1943. a.prototype.removeChildAt = function(b) {
  1944. if (0 <= b && b < this._children.length) return this._doRemoveChild(b);
  1945. c.Logger.fatal("\u63d0\u4f9b\u7684\u7d22\u5f15\u8d85\u51fa\u8303\u56f4");
  1946. return null
  1947. };
  1948. a.prototype._doRemoveChild = function(b, k) {
  1949. "undefined" === typeof k && (k = !0);
  1950. var f = this._children,
  1951. d = f[b];
  1952. k && d.dispatchEventWith(c.Event.REMOVED, !0);
  1953. if (this._stage) {
  1954. d._onRemoveFromStage();
  1955. for (var e = a.__EVENT__REMOVE_FROM_STAGE_LIST; 0 < e.length;) e.shift().dispatchEventWith(c.Event.REMOVED_FROM_STAGE)
  1956. }
  1957. d._parentChanged(null);
  1958. f.splice(b, 1);
  1959. this._setSizeDirty();
  1960. return d
  1961. };
  1962. a.prototype.getChildAt = function(b) {
  1963. if (0 <= b && b < this._children.length) return this._children[b];
  1964. c.Logger.fatal("\u63d0\u4f9b\u7684\u7d22\u5f15\u8d85\u51fa\u8303\u56f4");
  1965. return null
  1966. };
  1967. a.prototype.contains = function(b) {
  1968. for (; b;) {
  1969. if (b == this) return ! 0;
  1970. b = b._parent
  1971. }
  1972. return ! 1
  1973. };
  1974. a.prototype.swapChildrenAt = function(b, a) {
  1975. 0 <= b && b < this._children.length && 0 <= a && a < this._children.length ? this._swapChildrenAt(b, a) : c.Logger.fatal("\u63d0\u4f9b\u7684\u7d22\u5f15\u8d85\u51fa\u8303\u56f4")
  1976. };
  1977. a.prototype.swapChildren = function(b, a) {
  1978. var f = this._children.indexOf(b),
  1979. d = this._children.indexOf(a); - 1 == f || -1 == d ? c.Logger.fatal("child\u672a\u88abaddChild\u5230\u8be5parent") : this._swapChildrenAt(f, d)
  1980. };
  1981. a.prototype._swapChildrenAt = function(b, a) {
  1982. if (b != a) {
  1983. var c = this._children,
  1984. d = c[b];
  1985. c[b] = c[a];
  1986. c[a] = d
  1987. }
  1988. };
  1989. a.prototype.getChildIndex = function(b) {
  1990. return this._children.indexOf(b)
  1991. };
  1992. a.prototype.removeChildren = function() {
  1993. for (var b = this._children.length - 1; 0 <= b; b--) this._doRemoveChild(b)
  1994. };
  1995. a.prototype._updateTransform = function() {
  1996. if (this.visible) {
  1997. d.prototype._updateTransform.call(this);
  1998. for (var b = 0,
  1999. a = this._children.length; b < a; b++) this._children[b]._updateTransform()
  2000. }
  2001. };
  2002. a.prototype._render = function(b) {
  2003. for (var a = 0,
  2004. c = this._children.length; a < c; a++) this._children[a]._draw(b)
  2005. };
  2006. a.prototype._measureBounds = function() {
  2007. for (var b = 0,
  2008. a = 0,
  2009. f = 0,
  2010. d = 0,
  2011. e = this._children.length,
  2012. h = 0; h < e; h++) {
  2013. var l = this._children[h],
  2014. n;
  2015. if (l.visible && (n = c.DisplayObject.getTransformBounds(l._getSize(c.Rectangle.identity), l._getMatrix()))) {
  2016. var l = n.x,
  2017. p = n.y,
  2018. q = n.width + n.x,
  2019. r = n.height + n.y;
  2020. if (l < b || 0 == h) b = l;
  2021. if (q > a || 0 == h) a = q;
  2022. if (p < f || 0 == h) f = p;
  2023. if (r > d || 0 == h) d = r
  2024. }
  2025. }
  2026. return c.Rectangle.identity.initialize(b, f, a - b, d - f)
  2027. };
  2028. a.prototype.hitTest = function(b, a, f) {
  2029. "undefined" === typeof f && (f = !1);
  2030. var e;
  2031. if (!this.visible) return null;
  2032. if (this._scrollRect) {
  2033. if (b > this._scrollRect.width || a > this._scrollRect.height) return null
  2034. } else if (this.mask && (this.mask.x > b || b > this.mask.x + this.mask.width || this.mask.y > a || a > this.mask.y + this.mask.height)) return null;
  2035. for (var g = this._children,
  2036. h = this._touchChildren,
  2037. l = g.length - 1; 0 <= l; l--) {
  2038. var n = g[l],
  2039. p = n,
  2040. q = p._getOffsetPoint(),
  2041. r = p._x,
  2042. s = p._y;
  2043. this._scrollRect && (r -= this._scrollRect.x, s -= this._scrollRect.y);
  2044. p = c.Matrix.identity.identity().prependTransform(r, s, p._scaleX, p._scaleY, p._rotation, 0, 0, q.x, q.y);
  2045. p.invert();
  2046. p = c.Matrix.transformCoords(p, b, a);
  2047. if (n = n.hitTest(p.x, p.y, !0)) {
  2048. if (n._touchEnabled && h) return n;
  2049. if (this._touchEnabled) return this;
  2050. null == e && (e = n)
  2051. }
  2052. }
  2053. return e ? e: d.prototype.hitTest.call(this, b, a, f)
  2054. };
  2055. a.prototype._onAddToStage = function() {
  2056. d.prototype._onAddToStage.call(this);
  2057. for (var b = this.numChildren,
  2058. a = 0; a < b; a++) this._children[a]._onAddToStage()
  2059. };
  2060. a.prototype._onRemoveFromStage = function() {
  2061. d.prototype._onRemoveFromStage.call(this);
  2062. for (var b = this.numChildren,
  2063. a = 0; a < b; a++) this._children[a]._onRemoveFromStage()
  2064. };
  2065. a.prototype.getChildByName = function(b) {
  2066. for (var a = this._children,
  2067. c = this.numChildren,
  2068. d, e = 0; e < c; e++) if (d = a[e], d.name == b) return d;
  2069. return null
  2070. };
  2071. a.__EVENT__ADD_TO_STAGE_LIST = [];
  2072. a.__EVENT__REMOVE_FROM_STAGE_LIST = [];
  2073. return a
  2074. } (c.DisplayObject);
  2075. c.DisplayObjectContainer = e;
  2076. e.prototype.__class__ = "egret.DisplayObjectContainer"
  2077. })(egret || (egret = {}));
  2078. __extends = this.__extends ||
  2079. function(c, e) {
  2080. function d() {
  2081. this.constructor = c
  2082. }
  2083. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  2084. d.prototype = e.prototype;
  2085. c.prototype = new d
  2086. }; (function(c) {
  2087. var e = function(d) {
  2088. function a(b, a) {
  2089. d.call(this);
  2090. this.touchEnabled = !0;
  2091. this._stage = this;
  2092. this._stageWidth = b;
  2093. this._stageHeight = a
  2094. }
  2095. __extends(a, d);
  2096. a.prototype.invalidate = function() {
  2097. a._invalidateRenderFlag = !0
  2098. };
  2099. a.prototype._setStageSize = function(b, a) {
  2100. if (this._stageWidth != b || this._stageHeight != a) this._stageWidth = b,
  2101. this._stageHeight = a,
  2102. this.dispatchEventWith(c.Event.RESIZE)
  2103. };
  2104. Object.defineProperty(a.prototype, "stageWidth", {
  2105. get: function() {
  2106. return this._stageWidth
  2107. },
  2108. enumerable: !0,
  2109. configurable: !0
  2110. });
  2111. Object.defineProperty(a.prototype, "stageHeight", {
  2112. get: function() {
  2113. return this._stageHeight
  2114. },
  2115. enumerable: !0,
  2116. configurable: !0
  2117. });
  2118. a.prototype.hitTest = function(b, a) {
  2119. if (!this.touchEnabled) return null;
  2120. var f;
  2121. if (!this.visible) return this;
  2122. for (var d = this._children,
  2123. e = d.length - 1; 0 <= e; e--) {
  2124. var h = f = d[e],
  2125. l = h._getOffsetPoint(),
  2126. h = c.Matrix.identity.identity().prependTransform(h.x, h.y, h.scaleX, h.scaleY, h.rotation, 0, 0, l.x, l.y);
  2127. h.invert();
  2128. h = c.Matrix.transformCoords(h, b, a);
  2129. if ((f = f.hitTest(h.x, h.y, !0)) && f.touchEnabled) return f
  2130. }
  2131. return this
  2132. };
  2133. a.prototype.getBounds = function(b) {
  2134. b || (b = new c.Rectangle);
  2135. return b.initialize(0, 0, this._stageWidth, this._stageHeight)
  2136. };
  2137. a.prototype._updateTransform = function() {
  2138. for (var b = 0,
  2139. a = this._children.length; b < a; b++) this._children[b]._updateTransform()
  2140. };
  2141. a._invalidateRenderFlag = !1;
  2142. return a
  2143. } (c.DisplayObjectContainer);
  2144. c.Stage = e;
  2145. e.prototype.__class__ = "egret.Stage"
  2146. })(egret || (egret = {})); (function(c) {
  2147. var e = function() {
  2148. function c() {}
  2149. c.REPEAT = "repeat";
  2150. c.SCALE = "scale";
  2151. return c
  2152. } ();
  2153. c.BitmapFillMode = e;
  2154. e.prototype.__class__ = "egret.BitmapFillMode"
  2155. })(egret || (egret = {}));
  2156. __extends = this.__extends ||
  2157. function(c, e) {
  2158. function d() {
  2159. this.constructor = c
  2160. }
  2161. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  2162. d.prototype = e.prototype;
  2163. c.prototype = new d
  2164. }; (function(c) {
  2165. var e = function(d) {
  2166. function a(b) {
  2167. d.call(this);
  2168. this.debug = !1;
  2169. this.debugColor = 16711680;
  2170. this.fillMode = "scale";
  2171. b && (this.texture = b)
  2172. }
  2173. __extends(a, d);
  2174. a.prototype._render = function(b) {
  2175. var k = this.texture;
  2176. k ? (this._texture_to_render = k, a._drawBitmap(b, this._hasWidthSet ? this._explicitWidth: k._textureWidth, this._hasHeightSet ? this._explicitHeight: k._textureHeight, this)) : this._texture_to_render = null
  2177. };
  2178. a._drawBitmap = function(b, k, f, d) {
  2179. var e = d._texture_to_render;
  2180. if (e) {
  2181. var h = e._textureWidth,
  2182. l = e._textureHeight;
  2183. if ("scale" == d.fillMode) {
  2184. var n = d.scale9Grid || e.scale9Grid;
  2185. if (n && h - n.width < k && l - n.height < f) a.drawScale9GridImage(b, d, n, k, f);
  2186. else {
  2187. var n = e._offsetX,
  2188. p = e._offsetY,
  2189. q = e._bitmapWidth || h,
  2190. r = e._bitmapHeight || l;
  2191. d._hasWidthSet ? (k /= h, n = Math.round(n * k), k = Math.round(q * k)) : k = q;
  2192. d._hasHeightSet ? (f /= l, p = Math.round(p * f), f = Math.round(r * f)) : f = r;
  2193. c.RenderFilter.getInstance().drawImage(b, d, e._bitmapX, e._bitmapY, q, r, n, p, k, f)
  2194. }
  2195. } else a.drawRepeatImage(b, d, k, f)
  2196. }
  2197. };
  2198. a.drawRepeatImage = function(b, a, f, d) {
  2199. var e = a._texture_to_render;
  2200. if (e) for (var h = e._textureWidth,
  2201. l = e._textureHeight,
  2202. n = e._bitmapX,
  2203. p = e._bitmapY,
  2204. q = e._bitmapWidth || h,
  2205. r = e._bitmapHeight || l,
  2206. s = e._offsetX,
  2207. e = e._offsetY,
  2208. t = c.RenderFilter.getInstance(); s < f; s += h) for (var A = e; A < d; A += l) {
  2209. var w = Math.min(q, f - s),
  2210. B = Math.min(r, d - A);
  2211. t.drawImage(b, a, n, p, q, r, s, A, w, B)
  2212. }
  2213. };
  2214. a.drawScale9GridImage = function(b, a, f, d, e) {
  2215. var h = a._texture_to_render;
  2216. if (h && f) {
  2217. var l = c.RenderFilter.getInstance(),
  2218. n = h._textureWidth,
  2219. p = h._textureHeight,
  2220. q = h._bitmapX,
  2221. r = h._bitmapY,
  2222. s = h._bitmapWidth || n,
  2223. t = h._bitmapHeight || p,
  2224. A = h._offsetX,
  2225. h = h._offsetY;
  2226. f = c.Rectangle.identity.initialize(f.x - Math.round(A), f.y - Math.round(A), f.width, f.height);
  2227. A = Math.round(A);
  2228. h = Math.round(h);
  2229. d -= n - s;
  2230. e -= p - t;
  2231. f.y == f.bottom && (f.bottom < t ? f.bottom++:f.y--);
  2232. f.x == f.right && (f.right < s ? f.right++:f.x--);
  2233. var n = q + f.x,
  2234. p = q + f.right,
  2235. w = s - f.right,
  2236. B = r + f.y,
  2237. C = r + f.bottom,
  2238. u = t - f.bottom,
  2239. v = A + f.x,
  2240. D = h + f.y,
  2241. t = e - (t - f.bottom),
  2242. s = d - (s - f.right);
  2243. l.drawImage(b, a, q, r, f.x, f.y, A, h, f.x, f.y);
  2244. l.drawImage(b, a, n, r, f.width, f.y, v, h, s - f.x, f.y);
  2245. l.drawImage(b, a, p, r, w, f.y, A + s, h, d - s, f.y);
  2246. l.drawImage(b, a, q, B, f.x, f.height, A, D, f.x, t - f.y);
  2247. l.drawImage(b, a, n, B, f.width, f.height, v, D, s - f.x, t - f.y);
  2248. l.drawImage(b, a, p, B, w, f.height, A + s, D, d - s, t - f.y);
  2249. l.drawImage(b, a, q, C, f.x, u, A, h + t, f.x, e - t);
  2250. l.drawImage(b, a, n, C, f.width, u, v, h + t, s - f.x, e - t);
  2251. l.drawImage(b, a, p, C, w, u, A + s, h + t, d - s, e - t)
  2252. }
  2253. };
  2254. a.prototype._measureBounds = function() {
  2255. var b = this.texture;
  2256. return b ? c.Rectangle.identity.initialize(b._offsetX, b._offsetY, b._textureWidth, b._textureHeight) : d.prototype._measureBounds.call(this)
  2257. };
  2258. a.debug = !1;
  2259. return a
  2260. } (c.DisplayObject);
  2261. c.Bitmap = e;
  2262. e.prototype.__class__ = "egret.Bitmap"
  2263. })(egret || (egret = {}));
  2264. __extends = this.__extends ||
  2265. function(c, e) {
  2266. function d() {
  2267. this.constructor = c
  2268. }
  2269. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  2270. d.prototype = e.prototype;
  2271. c.prototype = new d
  2272. }; (function(c) {
  2273. var e = function(d) {
  2274. function a() {
  2275. d.call(this);
  2276. this._text = "";
  2277. this._textChanged = !1;
  2278. this._bitmapPool = []
  2279. }
  2280. __extends(a, d);
  2281. Object.defineProperty(a.prototype, "text", {
  2282. get: function() {
  2283. return this._text
  2284. },
  2285. set: function(b) {
  2286. this._textChanged = !0;
  2287. this._text = b
  2288. },
  2289. enumerable: !0,
  2290. configurable: !0
  2291. });
  2292. a.prototype._updateTransform = function() {
  2293. this.visible && (this._textChanged && this._renderText(), d.prototype._updateTransform.call(this))
  2294. };
  2295. a.prototype._renderText = function(b) {
  2296. var a = b = 0;
  2297. this._textChanged && this.removeChildren();
  2298. for (var f = 0,
  2299. d = this.text.length; f < d; f++) {
  2300. var e = this.text.charAt(f),
  2301. h = this.spriteSheet.getTexture(e);
  2302. if (null == h) console.log("\u5f53\u524d\u6ca1\u6709\u4f4d\u56fe\u6587\u5b57\uff1a" + e);
  2303. else {
  2304. var e = h._offsetX,
  2305. l = h._offsetY,
  2306. n = h._textureWidth;
  2307. if (this._textChanged) {
  2308. var p = this._bitmapPool[f];
  2309. p || (p = new c.Bitmap, this._bitmapPool.push(p));
  2310. p.texture = h;
  2311. this.addChild(p);
  2312. p.x = b
  2313. }
  2314. b += n + e;
  2315. l + h._textureHeight > a && (a = l + h._textureHeight)
  2316. }
  2317. }
  2318. this._textChanged = !1;
  2319. return c.Rectangle.identity.initialize(0, 0, b, a)
  2320. };
  2321. a.prototype._measureBounds = function() {
  2322. return this._renderText(!0)
  2323. };
  2324. return a
  2325. } (c.DisplayObjectContainer);
  2326. c.BitmapText = e;
  2327. e.prototype.__class__ = "egret.BitmapText"
  2328. })(egret || (egret = {})); (function(c) {
  2329. var e = function() {
  2330. function c() {
  2331. this.commandQueue = []
  2332. }
  2333. c.prototype.beginFill = function(a, b) {};
  2334. c.prototype._setStyle = function(a) {};
  2335. c.prototype.drawRect = function(a, b, k, c) {};
  2336. c.prototype.drawCircle = function(a, b, k) {};
  2337. c.prototype.lineStyle = function(a, b, k, c, d, e, h, l) {};
  2338. c.prototype.lineTo = function(a, b) {};
  2339. c.prototype.curveTo = function(a, b, k, c) {};
  2340. c.prototype.moveTo = function(a, b) {};
  2341. c.prototype.clear = function() {};
  2342. c.prototype.endFill = function() {};
  2343. c.prototype._draw = function(a) {};
  2344. return c
  2345. } ();
  2346. c.Graphics = e;
  2347. e.prototype.__class__ = "egret.Graphics"; (function() {
  2348. return function(c, a, b) {
  2349. this.method = c;
  2350. this.thisObject = a;
  2351. this.args = b
  2352. }
  2353. })().prototype.__class__ = "Command"
  2354. })(egret || (egret = {}));
  2355. __extends = this.__extends ||
  2356. function(c, e) {
  2357. function d() {
  2358. this.constructor = c
  2359. }
  2360. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  2361. d.prototype = e.prototype;
  2362. c.prototype = new d
  2363. }; (function(c) {
  2364. var e = function(d) {
  2365. function a() {
  2366. d.call(this)
  2367. }
  2368. __extends(a, d);
  2369. Object.defineProperty(a.prototype, "graphics", {
  2370. get: function() {
  2371. this._graphics || (this._graphics = new c.Graphics);
  2372. return this._graphics
  2373. },
  2374. enumerable: !0,
  2375. configurable: !0
  2376. });
  2377. a.prototype._render = function(b) {
  2378. this._graphics && this._graphics._draw(b)
  2379. };
  2380. return a
  2381. } (c.DisplayObject);
  2382. c.Shape = e;
  2383. e.prototype.__class__ = "egret.Shape"
  2384. })(egret || (egret = {}));
  2385. __extends = this.__extends ||
  2386. function(c, e) {
  2387. function d() {
  2388. this.constructor = c
  2389. }
  2390. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  2391. d.prototype = e.prototype;
  2392. c.prototype = new d
  2393. }; (function(c) {
  2394. var e = function(d) {
  2395. function a() {
  2396. d.call(this)
  2397. }
  2398. __extends(a, d);
  2399. Object.defineProperty(a.prototype, "graphics", {
  2400. get: function() {
  2401. this._graphics || (this._graphics = new c.Graphics);
  2402. return this._graphics
  2403. },
  2404. enumerable: !0,
  2405. configurable: !0
  2406. });
  2407. a.prototype._render = function(b) {
  2408. this._graphics && this._graphics._draw(b);
  2409. d.prototype._render.call(this, b)
  2410. };
  2411. return a
  2412. } (c.DisplayObjectContainer);
  2413. c.Sprite = e;
  2414. e.prototype.__class__ = "egret.Sprite"
  2415. })(egret || (egret = {}));
  2416. __extends = this.__extends ||
  2417. function(c, e) {
  2418. function d() {
  2419. this.constructor = c
  2420. }
  2421. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  2422. d.prototype = e.prototype;
  2423. c.prototype = new d
  2424. }; (function(c) {
  2425. var e = function(d) {
  2426. function a() {
  2427. d.call(this);
  2428. this._fontFamily = "Arial";
  2429. this._size = 30;
  2430. this._textColorString = "#FFFFFF";
  2431. this._textColor = 16777215;
  2432. this._strokeColorString = "#000000";
  2433. this._stroke = this._strokeColor = 0;
  2434. this._textAlign = "left";
  2435. this._verticalAlign = "top";
  2436. this._numLines = this._lineSpacing = 0;
  2437. this.measuredWidths = []
  2438. }
  2439. __extends(a, d);
  2440. Object.defineProperty(a.prototype, "text", {
  2441. get: function() {
  2442. return this._text
  2443. },
  2444. set: function(b) {
  2445. this._text != b && (this._setTextDirty(), this._text = b)
  2446. },
  2447. enumerable: !0,
  2448. configurable: !0
  2449. });
  2450. a.prototype._setTextDirty = function() {
  2451. this._setSizeDirty()
  2452. };
  2453. Object.defineProperty(a.prototype, "fontFamily", {
  2454. get: function() {
  2455. return this._fontFamily
  2456. },
  2457. set: function(b) {
  2458. this._fontFamily != b && (this._setTextDirty(), this._fontFamily = b)
  2459. },
  2460. enumerable: !0,
  2461. configurable: !0
  2462. });
  2463. Object.defineProperty(a.prototype, "size", {
  2464. get: function() {
  2465. return this._size
  2466. },
  2467. set: function(b) {
  2468. this._size != b && (this._setTextDirty(), this._size = b)
  2469. },
  2470. enumerable: !0,
  2471. configurable: !0
  2472. });
  2473. Object.defineProperty(a.prototype, "italic", {
  2474. get: function() {
  2475. return this._italic
  2476. },
  2477. set: function(b) {
  2478. this._italic != b && (this._setTextDirty(), this._italic = b)
  2479. },
  2480. enumerable: !0,
  2481. configurable: !0
  2482. });
  2483. Object.defineProperty(a.prototype, "bold", {
  2484. get: function() {
  2485. return this._bold
  2486. },
  2487. set: function(b) {
  2488. this._bold != b && (this._setTextDirty(), this._bold = b)
  2489. },
  2490. enumerable: !0,
  2491. configurable: !0
  2492. });
  2493. Object.defineProperty(a.prototype, "textColor", {
  2494. get: function() {
  2495. return this._textColor
  2496. },
  2497. set: function(b) {
  2498. this._textColor != b && (this._setTextDirty(), this._textColor = b, this._textColorString = c.toColorString(b))
  2499. },
  2500. enumerable: !0,
  2501. configurable: !0
  2502. });
  2503. Object.defineProperty(a.prototype, "strokeColor", {
  2504. get: function() {
  2505. return this._strokeColor
  2506. },
  2507. set: function(b) {
  2508. this._strokeColor != b && (this._setTextDirty(), this._strokeColor = b, this._strokeColorString = c.toColorString(b))
  2509. },
  2510. enumerable: !0,
  2511. configurable: !0
  2512. });
  2513. Object.defineProperty(a.prototype, "stroke", {
  2514. get: function() {
  2515. return this._stroke
  2516. },
  2517. set: function(b) {
  2518. this._stroke != b && (this._setTextDirty(), this._stroke = b)
  2519. },
  2520. enumerable: !0,
  2521. configurable: !0
  2522. });
  2523. Object.defineProperty(a.prototype, "textAlign", {
  2524. get: function() {
  2525. return this._textAlign
  2526. },
  2527. set: function(b) {
  2528. this._textAlign != b && (this._setTextDirty(), this._textAlign = b)
  2529. },
  2530. enumerable: !0,
  2531. configurable: !0
  2532. });
  2533. Object.defineProperty(a.prototype, "verticalAlign", {
  2534. get: function() {
  2535. return this._verticalAlign
  2536. },
  2537. set: function(b) {
  2538. this._verticalAlign != b && (this._setTextDirty(), this._verticalAlign = b)
  2539. },
  2540. enumerable: !0,
  2541. configurable: !0
  2542. });
  2543. Object.defineProperty(a.prototype, "lineSpacing", {
  2544. get: function() {
  2545. return this._lineSpacing
  2546. },
  2547. set: function(b) {
  2548. this._lineSpacing != b && (this._setTextDirty(), this._lineSpacing = b)
  2549. },
  2550. enumerable: !0,
  2551. configurable: !0
  2552. });
  2553. Object.defineProperty(a.prototype, "numLines", {
  2554. get: function() {
  2555. return this._numLines
  2556. },
  2557. enumerable: !0,
  2558. configurable: !0
  2559. });
  2560. a.prototype._render = function(b) {
  2561. this.drawText(b, !1);
  2562. this._clearDirty()
  2563. };
  2564. a.prototype._measureBounds = function() {
  2565. return this.drawText(c.MainContext.instance.rendererContext, !0)
  2566. };
  2567. a.prototype.drawText = function(b, a) {
  2568. var f = this.getTextLines(b);
  2569. if (!f) return c.Rectangle.identity.initialize(0, 0, 0, 0);
  2570. var d = f.length,
  2571. e = 0.5 * this._size,
  2572. h = this._size + this._lineSpacing,
  2573. l = d * h - this._lineSpacing;
  2574. this._textHeight = l;
  2575. var n = this._explicitHeight;
  2576. if (this._hasHeightSet && l < n) {
  2577. var p = 0;
  2578. this._verticalAlign == c.VerticalAlign.MIDDLE ? p = 0.5 : this._verticalAlign == c.VerticalAlign.BOTTOM && (p = 1);
  2579. e += p * (n - l)
  2580. } else n = Number.POSITIVE_INFINITY;
  2581. var p = e = Math.round(e),
  2582. q = 0;
  2583. this._textAlign == c.HorizontalAlign.CENTER ? q = 0.5 : this._textAlign == c.HorizontalAlign.RIGHT && (q = 1);
  2584. var r = this.measuredWidths,
  2585. s;
  2586. s = this._hasWidthSet ? this._explicitWidth: this._textWidth;
  2587. for (var t = Number.POSITIVE_INFINITY,
  2588. A = 0; A < d; A++) {
  2589. var w = f[A],
  2590. B = Math.round((s - r[A]) * q);
  2591. B < t && (t = B); ! a && e < n && b.drawText(this, w, B, e, s);
  2592. e += h
  2593. }
  2594. return c.Rectangle.identity.initialize(t, p, s, l)
  2595. };
  2596. a.prototype.getTextLines = function(b) {
  2597. var a = this.text ? this.text.toString() : "";
  2598. if (!a) return null;
  2599. var c = this.measuredWidths;
  2600. c.length = 0;
  2601. b.setupFont(this);
  2602. var a = a.split(/(?:\r\n|\r|\n)/),
  2603. d = a.length,
  2604. e = 0;
  2605. if (this._hasWidthSet) for (var h = this._explicitWidth,
  2606. l = 0; l < d; l++) {
  2607. var n = a[l],
  2608. p = b.measureText(n);
  2609. if (p > h) {
  2610. for (var q = "",
  2611. r = 0,
  2612. s = n.length,
  2613. t = 0; t < s; t++) {
  2614. var A = n.charAt(t),
  2615. p = b.measureText(A);
  2616. r + p > h && (0 == r ? (a.splice(l, 0, A), c[l] = p, e < p && (e = p), p = 0, A = "") : (a.splice(l, 0, q), c[l] = r, e < r && (e = r), q = "", r = 0), l++, d++);
  2617. r += p;
  2618. q += A
  2619. }
  2620. a[l] = q;
  2621. c[l] = r
  2622. } else c[l] = p,
  2623. e < p && (e = p)
  2624. } else for (l = 0; l < d; l++) n = a[l],
  2625. p = b.measureText(n),
  2626. c[l] = p,
  2627. e < p && (e = p);
  2628. this._textWidth = e;
  2629. return a
  2630. };
  2631. return a
  2632. } (c.DisplayObject);
  2633. c.TextField = e;
  2634. e.prototype.__class__ = "egret.TextField"
  2635. })(egret || (egret = {})); (function(c) {
  2636. var e = function() {
  2637. function c() {}
  2638. c.DYNAMIC = "dynamic";
  2639. c.INPUT = "input";
  2640. return c
  2641. } ();
  2642. c.TextFieldType = e;
  2643. e.prototype.__class__ = "egret.TextFieldType"
  2644. })(egret || (egret = {}));
  2645. __extends = this.__extends ||
  2646. function(c, e) {
  2647. function d() {
  2648. this.constructor = c
  2649. }
  2650. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  2651. d.prototype = e.prototype;
  2652. c.prototype = new d
  2653. }; (function(c) {
  2654. var e = function(d) {
  2655. function a(b) {
  2656. d.call(this);
  2657. var a = b.bitmapData;
  2658. this.bitmapData = a;
  2659. this._textureMap = {};
  2660. this._sourceWidth = a.width;
  2661. this._sourceHeight = a.height;
  2662. this._bitmapX = b._bitmapX - b._offsetX;
  2663. this._bitmapY = b._bitmapY - b._offsetY
  2664. }
  2665. __extends(a, d);
  2666. a.prototype.getTexture = function(b) {
  2667. return this._textureMap[b]
  2668. };
  2669. a.prototype.createTexture = function(b, a, f, d, e, h, l, n, p) {
  2670. "undefined" === typeof h && (h = 0);
  2671. "undefined" === typeof l && (l = 0);
  2672. "undefined" === typeof n && (n = h + d);
  2673. "undefined" === typeof p && (p = l + e);
  2674. var q = new c.Texture;
  2675. q._bitmapData = this.bitmapData;
  2676. q._bitmapX = this._bitmapX + a;
  2677. q._bitmapY = this._bitmapY + f;
  2678. q._bitmapWidth = d;
  2679. q._bitmapHeight = e;
  2680. q._offsetX = h;
  2681. q._offsetY = l;
  2682. q._textureWidth = n;
  2683. q._textureHeight = p;
  2684. q._sourceWidth = this._sourceWidth;
  2685. q._sourceHeight = this._sourceHeight;
  2686. return this._textureMap[b] = q
  2687. };
  2688. return a
  2689. } (c.HashObject);
  2690. c.SpriteSheet = e;
  2691. e.prototype.__class__ = "egret.SpriteSheet"
  2692. })(egret || (egret = {}));
  2693. __extends = this.__extends ||
  2694. function(c, e) {
  2695. function d() {
  2696. this.constructor = c
  2697. }
  2698. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  2699. d.prototype = e.prototype;
  2700. c.prototype = new d
  2701. }; (function(c) {
  2702. var e = function(d) {
  2703. function a() {
  2704. d.apply(this, arguments);
  2705. this._placeholderText = "";
  2706. this._edFontSize = 14;
  2707. this._textColor = 16711680;
  2708. this._placeholderFontSize = 14;
  2709. this._placeholderColor = 16776960;
  2710. this._preY = this._preX = 0
  2711. }
  2712. __extends(a, d);
  2713. a.prototype._onAddToStage = function() {
  2714. d.prototype._onAddToStage.call(this);
  2715. var b = this.localToGlobal(),
  2716. a = new c.StageText;
  2717. a._open(b.x, b.y, this._explicitWidth, this._explicitHeight);
  2718. this.addEventListener(c.TouchEvent.TOUCH_BEGIN, this.onMouseDownHandler, this);
  2719. this.stageText = a
  2720. };
  2721. a.prototype.setText = function(b) {
  2722. this.stageText._setText(b)
  2723. };
  2724. a.prototype.getText = function() {
  2725. return this.stageText._getText()
  2726. };
  2727. a.prototype.setTextType = function(b) {
  2728. this.stageText._setTextType(b)
  2729. };
  2730. a.prototype.getTextType = function() {
  2731. return this.stageText._getTextType()
  2732. };
  2733. a.prototype.onMouseDownHandler = function(b) {};
  2734. a.prototype._onRemoveFromStage = function() {
  2735. this.stageText._remove()
  2736. };
  2737. a.prototype._measureBounds = function() {
  2738. return c.Rectangle.identity
  2739. };
  2740. a.prototype.hitTest = function(b, a, c) {
  2741. return null
  2742. };
  2743. return a
  2744. } (c.DisplayObject);
  2745. c.TextInput = e;
  2746. e.prototype.__class__ = "egret.TextInput";
  2747. e = function() {
  2748. function c() {}
  2749. c.prototype.editBoxEditingDidBegin = function(a) {};
  2750. c.prototype.editBoxEditingDidEnd = function(a) {};
  2751. c.prototype.editBoxTextChanged = function(a, b) {};
  2752. c.prototype.editBoxReturn = function(a) {};
  2753. return c
  2754. } ();
  2755. c.TextInputDegelete = e;
  2756. e.prototype.__class__ = "egret.TextInputDegelete"
  2757. })(egret || (egret = {}));
  2758. __extends = this.__extends ||
  2759. function(c, e) {
  2760. function d() {
  2761. this.constructor = c
  2762. }
  2763. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  2764. d.prototype = e.prototype;
  2765. c.prototype = new d
  2766. }; (function(c) {
  2767. var e = function(c) {
  2768. function a(b, a) {
  2769. c.call(this, b);
  2770. this.charList = this.parseConfig(a)
  2771. }
  2772. __extends(a, c);
  2773. a.prototype.getTexture = function(b) {
  2774. var a = this._textureMap[b];
  2775. if (!a) {
  2776. a = this.charList[b];
  2777. if (!a) return null;
  2778. a = this.createTexture(b, a.x, a.y, a.width, a.height, a.offsetX, a.offsetY);
  2779. this._textureMap[b] = a
  2780. }
  2781. return a
  2782. };
  2783. a.prototype.parseConfig = function(b) {
  2784. b = b.split("\r\n").join("\n");
  2785. b = b.split("\n");
  2786. for (var a = this.getConfigByKey(b[3], "count"), c = {},
  2787. d = 4; d < 4 + a; d++) {
  2788. var e = b[d],
  2789. h = String.fromCharCode(this.getConfigByKey(e, "id")),
  2790. l = {};
  2791. c[h] = l;
  2792. l.x = this.getConfigByKey(e, "x");
  2793. l.y = this.getConfigByKey(e, "y");
  2794. l.width = this.getConfigByKey(e, "width");
  2795. l.height = this.getConfigByKey(e, "height");
  2796. l.offsetX = this.getConfigByKey(e, "xoffset");
  2797. l.offsetY = this.getConfigByKey(e, "yoffset")
  2798. }
  2799. return c
  2800. };
  2801. a.prototype.getConfigByKey = function(b, a) {
  2802. for (var c = b.split(" "), d = 0, e = c.length; d < e; d++) {
  2803. var h = c[d];
  2804. if (a == h.substring(0, a.length)) return c = h.substring(a.length + 1),
  2805. parseInt(c)
  2806. }
  2807. return 0
  2808. };
  2809. return a
  2810. } (c.SpriteSheet);
  2811. c.BitmapTextSpriteSheet = e;
  2812. e.prototype.__class__ = "egret.BitmapTextSpriteSheet"
  2813. })(egret || (egret = {}));
  2814. __extends = this.__extends ||
  2815. function(c, e) {
  2816. function d() {
  2817. this.constructor = c
  2818. }
  2819. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  2820. d.prototype = e.prototype;
  2821. c.prototype = new d
  2822. }; (function(c) {
  2823. var e = function(a) {
  2824. function b(b, f) {
  2825. a.call(this);
  2826. this.frameRate = 60;
  2827. null != f && f instanceof c.Texture ? (c.Logger.warning("MovieClip#constructor\u63a5\u53e3\u53c2\u6570\u5df2\u7ecf\u53d8\u66f4\uff0c\u8bf7\u5c3d\u5feb\u8c03\u6574\u7528\u6cd5\u4e3a new MovieClip(new DefaultMovieClipDelegate(data,texture))"), this.delegate = new d(b, f)) : this.delegate = b;
  2828. this.delegate.setMovieClip(this)
  2829. }
  2830. __extends(b, a);
  2831. b.prototype.gotoAndPlay = function(b) {
  2832. this.delegate.gotoAndPlay(b)
  2833. };
  2834. b.prototype.gotoAndStop = function(b) {
  2835. this.delegate.gotoAndStop(b)
  2836. };
  2837. b.prototype.stop = function() {
  2838. this.delegate.stop()
  2839. };
  2840. b.prototype.dispose = function() {
  2841. this.delegate.dispose()
  2842. };
  2843. b.prototype.release = function() {
  2844. c.Logger.warning("MovieClip#release\u65b9\u6cd5\u5373\u5c06\u5e9f\u5f03");
  2845. this.dispose()
  2846. };
  2847. b.prototype.getCurrentFrameIndex = function() {
  2848. c.Logger.warning("MovieClip#getCurrentFrameIndex\u65b9\u6cd5\u5373\u5c06\u5e9f\u5f03");
  2849. return this.delegate._currentFrameIndex
  2850. };
  2851. b.prototype.getTotalFrame = function() {
  2852. c.Logger.warning("MovieClip#getTotalFrame\u65b9\u6cd5\u5373\u5c06\u5e9f\u5f03");
  2853. return this.delegate._totalFrame
  2854. };
  2855. b.prototype.setInterval = function(b) {
  2856. c.Logger.warning("MovieClip#setInterval\u65b9\u6cd5\u5373\u5c06\u5e9f\u5f03,\u8bf7\u4f7f\u7528MovieClip#frameRate\u4ee3\u66ff");
  2857. this.frameRate = 60 / b
  2858. };
  2859. b.prototype.getIsPlaying = function() {
  2860. c.Logger.warning("MovieClip#getIsPlaying\u65b9\u6cd5\u5373\u5c06\u5e9f\u5f03");
  2861. return this.delegate.isPlaying
  2862. };
  2863. return b
  2864. } (c.DisplayObjectContainer);
  2865. c.MovieClip = e;
  2866. e.prototype.__class__ = "egret.MovieClip";
  2867. var d = function() {
  2868. function a(b, a) {
  2869. this.data = b;
  2870. this._currentFrameIndex = this._passTime = this._totalFrame = 0;
  2871. this._isPlaying = !1;
  2872. this._frameData = b;
  2873. this._spriteSheet = new c.SpriteSheet(a)
  2874. }
  2875. a.prototype.setMovieClip = function(b) {
  2876. this.movieClip = b;
  2877. this.bitmap = new c.Bitmap;
  2878. this.movieClip.addChild(this.bitmap)
  2879. };
  2880. a.prototype.gotoAndPlay = function(b) {
  2881. this.checkHasFrame(b);
  2882. this._isPlaying = !0;
  2883. this._currentFrameIndex = 0;
  2884. this._currentFrameName = b;
  2885. this._totalFrame = this._frameData.frames[b].totalFrame;
  2886. this.playNextFrame();
  2887. this._passTime = 0;
  2888. c.Ticker.getInstance().register(this.update, this)
  2889. };
  2890. a.prototype.gotoAndStop = function(b) {
  2891. this.checkHasFrame(b);
  2892. this.stop();
  2893. this._currentFrameIndex = this._passTime = 0;
  2894. this._currentFrameName = b;
  2895. this._totalFrame = this._frameData.frames[b].totalFrame;
  2896. this.playNextFrame()
  2897. };
  2898. a.prototype.stop = function() {
  2899. this._isPlaying = !1;
  2900. c.Ticker.getInstance().unregister(this.update, this)
  2901. };
  2902. a.prototype.dispose = function() {};
  2903. a.prototype.checkHasFrame = function(b) {
  2904. void 0 == this._frameData.frames[b] && c.Logger.fatal("MovieClip\u6ca1\u6709\u5bf9\u5e94\u7684frame\uff1a", b)
  2905. };
  2906. a.prototype.update = function(b) {
  2907. for (var a = 1E3 / this.movieClip.frameRate,
  2908. a = Math.floor((this._passTime % a + b) / a); 1 <= a;) 1 == a ? this.playNextFrame() : this.playNextFrame(!1),
  2909. a--;
  2910. this._passTime += b
  2911. };
  2912. a.prototype.playNextFrame = function(b) {
  2913. "undefined" === typeof b && (b = !0);
  2914. var a = this._frameData.frames[this._currentFrameName].childrenFrame[this._currentFrameIndex];
  2915. if (b) {
  2916. b = this.getTexture(a.res);
  2917. var c = this.bitmap;
  2918. c.x = a.x;
  2919. c.y = a.y;
  2920. c.texture = b
  2921. }
  2922. null != a.action && this.movieClip.dispatchEventWith(a.action);
  2923. this._currentFrameIndex++;
  2924. this._currentFrameIndex == this._totalFrame && (this._currentFrameIndex = 0)
  2925. };
  2926. a.prototype.getTexture = function(b) {
  2927. var a = this._frameData.res[b],
  2928. c = this._spriteSheet.getTexture(b);
  2929. c || (c = this._spriteSheet.createTexture(b, a.x, a.y, a.w, a.h));
  2930. return c
  2931. };
  2932. return a
  2933. } ();
  2934. c.DefaultMovieClipDelegate = d;
  2935. d.prototype.__class__ = "egret.DefaultMovieClipDelegate"
  2936. })(egret || (egret = {}));
  2937. __extends = this.__extends ||
  2938. function(c, e) {
  2939. function d() {
  2940. this.constructor = c
  2941. }
  2942. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  2943. d.prototype = e.prototype;
  2944. c.prototype = new d
  2945. }; (function(c) {
  2946. var e = function(d) {
  2947. function a() {
  2948. d.call(this)
  2949. }
  2950. __extends(a, d);
  2951. a.prototype._getText = function() {
  2952. return this.inputElement.value
  2953. };
  2954. a.prototype._setText = function(b) {
  2955. this.inputElement.value = b
  2956. };
  2957. a.prototype._setTextType = function(b) {
  2958. this.inputElement.type = b
  2959. };
  2960. a.prototype._getTextType = function() {
  2961. return this.inputElement.type
  2962. };
  2963. a.prototype._open = function(b, a, f, d) {
  2964. "undefined" === typeof f && (f = 160);
  2965. "undefined" === typeof d && (d = 21);
  2966. var e = c.StageDelegate.getInstance().getScaleX(),
  2967. h = c.StageDelegate.getInstance().getScaleY(),
  2968. l = document.createElement("input");
  2969. l.type = "text";
  2970. l.style.fontSize = "20px";
  2971. l.style.color = "#FFFFFF";
  2972. l.style.borderStyle = "none";
  2973. l.style.background = "none";
  2974. l.style.width = f * e + "px";
  2975. l.style.height = d * h + "px";
  2976. l.style.outline = "medium";
  2977. var n = c.Browser.getInstance().$new("div");
  2978. n.style.position = "absolute";
  2979. n.position.x = b * e;
  2980. n.style.width = f * e + "px";
  2981. n.style.height = d * h + "px";
  2982. n.position.y = a * h;
  2983. n.transforms();
  2984. n.appendChild(l);
  2985. b = c.Browser.getInstance().$("#StageDelegateDiv");
  2986. b || (f = document.getElementById(c.StageDelegate.canvas_div_name), d = f.clientHeight, f = f.clientWidth, b = c.Browser.getInstance().$new("div"), b.id = "StageDelegateDiv", b.style.position = "absolute", b.style.width = f + "px", b.style.maxHeight = d + "px", b.style.margin = "0px", document.getElementById(c.StageDelegate.canvas_div_name).appendChild(b), b.position.y = -d, b.transforms());
  2987. b.appendChild(n);
  2988. this.div = n;
  2989. this.inputElement = l
  2990. };
  2991. a.prototype._remove = function() {
  2992. var b = this.div;
  2993. b && b.parentNode && b.parentNode.removeChild(b)
  2994. };
  2995. return a
  2996. } (c.HashObject);
  2997. c.StageText = e;
  2998. e.prototype.__class__ = "egret.StageText"
  2999. })(egret || (egret = {})); (function(c) {
  3000. var e = function() {
  3001. function c() {}
  3002. c.GET = "GET";
  3003. c.POST = "POST";
  3004. return c
  3005. } ();
  3006. c.URLRequestMethod = e;
  3007. e.prototype.__class__ = "egret.URLRequestMethod"
  3008. })(egret || (egret = {})); (function(c) {
  3009. var e = function() {
  3010. function c() {}
  3011. c.BINARY = "binary";
  3012. c.TEXT = "text";
  3013. c.VARIABLES = "variables";
  3014. c.TEXTURE = "texture";
  3015. c.SOUND = "sound";
  3016. return c
  3017. } ();
  3018. c.URLLoaderDataFormat = e;
  3019. e.prototype.__class__ = "egret.URLLoaderDataFormat"
  3020. })(egret || (egret = {}));
  3021. __extends = this.__extends ||
  3022. function(c, e) {
  3023. function d() {
  3024. this.constructor = c
  3025. }
  3026. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  3027. d.prototype = e.prototype;
  3028. c.prototype = new d
  3029. }; (function(c) {
  3030. var e = function(c) {
  3031. function a(b) {
  3032. "undefined" === typeof b && (b = null);
  3033. c.call(this);
  3034. null !== b && this.decode(b)
  3035. }
  3036. __extends(a, c);
  3037. a.prototype.decode = function(b) {
  3038. this.variables || (this.variables = {});
  3039. b = b.split("+").join(" ");
  3040. for (var a, c = /[?&]?([^=]+)=([^&]*)/g; a = c.exec(b);) this.variables[decodeURIComponent(a[1])] = decodeURIComponent(a[2])
  3041. };
  3042. a.prototype.toString = function() {
  3043. if (!this.variables) return "";
  3044. var b = this.variables,
  3045. a = "",
  3046. c = !0,
  3047. d;
  3048. for (d in b) c ? c = !1 : a += "&",
  3049. a += d + "=" + b[d];
  3050. return a
  3051. };
  3052. return a
  3053. } (c.HashObject);
  3054. c.URLVariables = e;
  3055. e.prototype.__class__ = "egret.URLVariables"
  3056. })(egret || (egret = {}));
  3057. __extends = this.__extends ||
  3058. function(c, e) {
  3059. function d() {
  3060. this.constructor = c
  3061. }
  3062. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  3063. d.prototype = e.prototype;
  3064. c.prototype = new d
  3065. }; (function(c) {
  3066. var e = function(d) {
  3067. function a(b) {
  3068. "undefined" === typeof b && (b = null);
  3069. d.call(this);
  3070. this.method = c.URLRequestMethod.GET;
  3071. this.url = b
  3072. }
  3073. __extends(a, d);
  3074. return a
  3075. } (c.HashObject);
  3076. c.URLRequest = e;
  3077. e.prototype.__class__ = "egret.URLRequest"
  3078. })(egret || (egret = {}));
  3079. __extends = this.__extends ||
  3080. function(c, e) {
  3081. function d() {
  3082. this.constructor = c
  3083. }
  3084. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  3085. d.prototype = e.prototype;
  3086. c.prototype = new d
  3087. }; (function(c) {
  3088. var e = function(d) {
  3089. function a(b) {
  3090. "undefined" === typeof b && (b = null);
  3091. d.call(this);
  3092. this.dataFormat = c.URLLoaderDataFormat.TEXT;
  3093. b && this.load(b)
  3094. }
  3095. __extends(a, d);
  3096. a.prototype.load = function(b) {
  3097. this._request = b;
  3098. this.data = null;
  3099. c.MainContext.instance.netContext.proceed(this)
  3100. };
  3101. return a
  3102. } (c.EventDispatcher);
  3103. c.URLLoader = e;
  3104. e.prototype.__class__ = "egret.URLLoader"
  3105. })(egret || (egret = {}));
  3106. __extends = this.__extends ||
  3107. function(c, e) {
  3108. function d() {
  3109. this.constructor = c
  3110. }
  3111. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  3112. d.prototype = e.prototype;
  3113. c.prototype = new d
  3114. }; (function(c) {
  3115. var e = function(d) {
  3116. function a() {
  3117. d.call(this);
  3118. this._textureHeight = this._textureWidth = this._offsetY = this._offsetX = this._bitmapHeight = this._bitmapWidth = this._bitmapY = this._bitmapX = 0
  3119. }
  3120. __extends(a, d);
  3121. Object.defineProperty(a.prototype, "textureWidth", {
  3122. get: function() {
  3123. return this._textureWidth
  3124. },
  3125. enumerable: !0,
  3126. configurable: !0
  3127. });
  3128. Object.defineProperty(a.prototype, "textureHeight", {
  3129. get: function() {
  3130. return this._textureHeight
  3131. },
  3132. enumerable: !0,
  3133. configurable: !0
  3134. });
  3135. Object.defineProperty(a.prototype, "bitmapData", {
  3136. get: function() {
  3137. return this._bitmapData
  3138. },
  3139. enumerable: !0,
  3140. configurable: !0
  3141. });
  3142. a.prototype._setBitmapData = function(b) {
  3143. var a = c.MainContext.instance.rendererContext.texture_scale_factor;
  3144. this._bitmapData = b;
  3145. this._sourceWidth = b.width;
  3146. this._sourceHeight = b.height;
  3147. this._textureWidth = this._sourceWidth * a;
  3148. this._textureHeight = this._sourceHeight * a;
  3149. this._bitmapWidth = this._textureWidth;
  3150. this._bitmapHeight = this._textureHeight;
  3151. this._offsetX = this._offsetY = this._bitmapX = this._bitmapY = 0
  3152. };
  3153. a.prototype.getPixel32 = function(b, a) {
  3154. return this._bitmapData.getContext("2d").getImageData(b, a, 1, 1).data
  3155. };
  3156. return a
  3157. } (c.HashObject);
  3158. c.Texture = e;
  3159. e.prototype.__class__ = "egret.Texture"
  3160. })(egret || (egret = {}));
  3161. __extends = this.__extends ||
  3162. function(c, e) {
  3163. function d() {
  3164. this.constructor = c
  3165. }
  3166. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  3167. d.prototype = e.prototype;
  3168. c.prototype = new d
  3169. }; (function(c) {
  3170. var e = function(d) {
  3171. function a() {
  3172. d.call(this);
  3173. this._bitmapData = document.createElement("canvas");
  3174. this.renderContext = c.RendererContext.createRendererContext(this._bitmapData)
  3175. }
  3176. __extends(a, d);
  3177. a.prototype.drawToTexture = function(b) {
  3178. var a = this._bitmapData,
  3179. f = b.getBounds(c.Rectangle.identity);
  3180. a.width = f.width;
  3181. a.height = f.height;
  3182. b._worldTransform.identity();
  3183. b.worldAlpha = 1;
  3184. if (b instanceof c.DisplayObjectContainer) {
  3185. this._offsetX = f.x;
  3186. this._offsetY = f.y;
  3187. b._worldTransform.append(1, 0, 0, 1, -f.x, -f.y);
  3188. for (var a = b._children,
  3189. f = 0,
  3190. d = a.length; f < d; f++) a[f]._updateTransform()
  3191. }
  3192. a = c.RenderFilter.getInstance();
  3193. f = a._drawAreaList.concat();
  3194. a._drawAreaList.length = 0;
  3195. this.renderContext.clearScreen();
  3196. this.webGLTexture = null; (d = b.mask || b._scrollRect) && this.renderContext.pushMask(d);
  3197. b._render(this.renderContext);
  3198. d && this.renderContext.popMask();
  3199. a._drawAreaList = f;
  3200. this._textureWidth = this._bitmapData.width;
  3201. this._textureHeight = this._bitmapData.height;
  3202. this._sourceWidth = this._textureWidth;
  3203. this._sourceHeight = this._textureHeight
  3204. };
  3205. return a
  3206. } (c.Texture);
  3207. c.RenderTexture = e;
  3208. e.prototype.__class__ = "egret.RenderTexture"
  3209. })(egret || (egret = {}));
  3210. __extends = this.__extends ||
  3211. function(c, e) {
  3212. function d() {
  3213. this.constructor = c
  3214. }
  3215. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  3216. d.prototype = e.prototype;
  3217. c.prototype = new d
  3218. }; (function(c) {
  3219. var e = function(d) {
  3220. function a() {
  3221. d.call(this);
  3222. this.renderCost = 0;
  3223. this.texture_scale_factor = 1
  3224. }
  3225. __extends(a, d);
  3226. a.prototype.clearScreen = function() {};
  3227. a.prototype.clearRect = function(b, a, c, d) {};
  3228. a.prototype.drawImage = function(b, a, f, d, e, h, l, n, p) {
  3229. c.Profiler.getInstance().onDrawImage()
  3230. };
  3231. a.prototype.setTransform = function(b) {};
  3232. a.prototype.setAlpha = function(b, a) {};
  3233. a.prototype.setupFont = function(b) {};
  3234. a.prototype.measureText = function(b) {
  3235. return 0
  3236. };
  3237. a.prototype.drawText = function(b, a, f, d, e) {
  3238. c.Profiler.getInstance().onDrawImage()
  3239. };
  3240. a.prototype.strokeRect = function(b, a, c, d, e) {};
  3241. a.prototype.pushMask = function(b) {};
  3242. a.prototype.popMask = function() {};
  3243. a.createRendererContext = function(b) {
  3244. return null
  3245. };
  3246. return a
  3247. } (c.HashObject);
  3248. c.RendererContext = e;
  3249. e.prototype.__class__ = "egret.RendererContext"
  3250. })(egret || (egret = {})); (function(c) {
  3251. var e = function() {
  3252. function c() {}
  3253. c.MOUSE = "mouse";
  3254. c.TOUCH = "touch";
  3255. c.mode = "touch";
  3256. return c
  3257. } ();
  3258. c.InteractionMode = e;
  3259. e.prototype.__class__ = "egret.InteractionMode"
  3260. })(egret || (egret = {}));
  3261. __extends = this.__extends ||
  3262. function(c, e) {
  3263. function d() {
  3264. this.constructor = c
  3265. }
  3266. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  3267. d.prototype = e.prototype;
  3268. c.prototype = new d
  3269. }; (function(c) {
  3270. var e = function(d) {
  3271. function a() {
  3272. d.call(this);
  3273. this._currentTouchTarget = {};
  3274. this.maxTouches = 2;
  3275. this.touchDownTarget = {};
  3276. this.lastTouchY = this.lastTouchX = -1
  3277. }
  3278. __extends(a, d);
  3279. a.prototype.run = function() {};
  3280. a.prototype.getTouchData = function(b, a, c) {
  3281. var d = this._currentTouchTarget[b];
  3282. null == d && (d = {},
  3283. this._currentTouchTarget[b] = d);
  3284. d.stageX = a;
  3285. d.stageY = c;
  3286. d.identifier = b;
  3287. return d
  3288. };
  3289. a.prototype.dispatchEvent = function(b, a) {
  3290. c.TouchEvent.dispatchTouchEvent(a.target, b, a.identifier, a.stageX, a.stageY, !1, !1, !1, !0 == this.touchDownTarget[a.identifier])
  3291. };
  3292. a.prototype.onTouchBegan = function(b, a, f) {
  3293. var d = c.MainContext.instance.stage.hitTest(b, a);
  3294. d && (b = this.getTouchData(f, b, a), this.touchDownTarget[f] = !0, b.target = d, b.beginTarget = d, this.dispatchEvent(c.TouchEvent.TOUCH_BEGIN, b))
  3295. };
  3296. a.prototype.onTouchMove = function(b, a, f) {
  3297. if (b != this.lastTouchX || a != this.lastTouchY) {
  3298. this.lastTouchX = b;
  3299. this.lastTouchY = a;
  3300. var d = c.MainContext.instance.stage.hitTest(b, a);
  3301. d && (b = this.getTouchData(f, b, a), b.target = d, this.dispatchEvent(c.TouchEvent.TOUCH_MOVE, b))
  3302. }
  3303. };
  3304. a.prototype.onTouchEnd = function(b, a, f) {
  3305. var d = c.MainContext.instance.stage.hitTest(b, a);
  3306. d && (b = this.getTouchData(f, b, a), delete this.touchDownTarget[f], f = b.beginTarget, b.target = d, this.dispatchEvent(c.TouchEvent.TOUCH_END, b), f == d ? this.dispatchEvent(c.TouchEvent.TOUCH_TAP, b) : b.beginTarget && (b.target = b.beginTarget, this.dispatchEvent(c.TouchEvent.TOUCH_RELEASE_OUTSIDE, b)), delete this._currentTouchTarget[b.identifier])
  3307. };
  3308. return a
  3309. } (c.HashObject);
  3310. c.TouchContext = e;
  3311. e.prototype.__class__ = "egret.TouchContext"
  3312. })(egret || (egret = {}));
  3313. __extends = this.__extends ||
  3314. function(c, e) {
  3315. function d() {
  3316. this.constructor = c
  3317. }
  3318. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  3319. d.prototype = e.prototype;
  3320. c.prototype = new d
  3321. }; (function(c) {
  3322. var e = function(c) {
  3323. function a() {
  3324. c.call(this)
  3325. }
  3326. __extends(a, c);
  3327. a.prototype.proceed = function(b) {};
  3328. return a
  3329. } (c.HashObject);
  3330. c.NetContext = e;
  3331. e.prototype.__class__ = "egret.NetContext"
  3332. })(egret || (egret = {}));
  3333. __extends = this.__extends ||
  3334. function(c, e) {
  3335. function d() {
  3336. this.constructor = c
  3337. }
  3338. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  3339. d.prototype = e.prototype;
  3340. c.prototype = new d
  3341. }; (function(c) {
  3342. var e = function(c) {
  3343. function a() {
  3344. c.call(this);
  3345. this.frameRate = 60
  3346. }
  3347. __extends(a, c);
  3348. a.prototype.executeMainLoop = function(b, a) {};
  3349. return a
  3350. } (c.HashObject);
  3351. c.DeviceContext = e;
  3352. e.prototype.__class__ = "egret.DeviceContext"
  3353. })(egret || (egret = {}));
  3354. __extends = this.__extends ||
  3355. function(c, e) {
  3356. function d() {
  3357. this.constructor = c
  3358. }
  3359. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  3360. d.prototype = e.prototype;
  3361. c.prototype = new d
  3362. }; (function(c) {
  3363. var e = function(d) {
  3364. function a() {
  3365. d.call(this);
  3366. this.translate = this.isHD ?
  3367. function(b) {
  3368. return "translate3d(" + b.x + "px, " + (b.y - c.MainContext.instance.stage.stageHeight) + "px, 0) "
  3369. }: function(b) {
  3370. return "translate(" + b.x + "px, " + b.y + "px) "
  3371. };
  3372. this.rotate = this.isHD ?
  3373. function(b) {
  3374. return "rotateZ(" + b + "deg) "
  3375. }: function(b) {
  3376. return "rotate(" + b + "deg) "
  3377. };
  3378. this.ua = navigator.userAgent.toLowerCase();
  3379. var b = this.ua.match(/micromessenger|qqbrowser|mqqbrowser|ucbrowser|360browser|baidubrowser|maxthon|ie|opera|firefox/) || this.ua.match(/chrome|safari/);
  3380. b && 0 < b.length && (b = b[0], "micromessenger" == b && (this.type = "wechat"), this.type = b);
  3381. this.type = "unknow";
  3382. switch (this.type) {
  3383. case "firefox":
  3384. this.pfx = "Moz";
  3385. this.isHD = !0;
  3386. break;
  3387. case "chrome":
  3388. case "safari":
  3389. this.pfx = "webkit";
  3390. this.isHD = !0;
  3391. break;
  3392. case "opera":
  3393. this.pfx = "O";
  3394. this.isHD = !1;
  3395. break;
  3396. case "ie":
  3397. this.pfx = "ms";
  3398. this.isHD = !1;
  3399. break;
  3400. default:
  3401. this.pfx = "webkit",
  3402. this.isHD = !0
  3403. }
  3404. this.trans = this.pfx + "Transform"
  3405. }
  3406. __extends(a, d);
  3407. a.getInstance = function() {
  3408. null == a.instance && (a.instance = new a);
  3409. return a.instance
  3410. };
  3411. Object.defineProperty(a.prototype, "isMobile", {
  3412. get: function() {
  3413. c.Logger.warning("Browser.isMobile\u63a5\u53e3\u53c2\u6570\u5df2\u7ecf\u53d8\u66f4\uff0c\u8bf7\u5c3d\u5feb\u8c03\u6574\u7528\u6cd5\u4e3a egret.MainContext.deviceType == egret.MainContext.DEVICE_MOBILE ");
  3414. return c.MainContext.deviceType == c.MainContext.DEVICE_MOBILE
  3415. },
  3416. enumerable: !0,
  3417. configurable: !0
  3418. });
  3419. a.prototype.$new = function(b) {
  3420. return this.$(document.createElement(b))
  3421. };
  3422. a.prototype.$ = function(b) {
  3423. var k = document;
  3424. if (b = b instanceof HTMLElement ? b: k.querySelector(b)) b.find = b.find || this.$,
  3425. b.hasClass = b.hasClass ||
  3426. function(b) {
  3427. return this.className.match(new RegExp("(\\s|^)" + b + "(\\s|$)"))
  3428. },
  3429. b.addClass = b.addClass ||
  3430. function(b) {
  3431. this.hasClass(b) || (this.className && (this.className += " "), this.className += b);
  3432. return this
  3433. },
  3434. b.removeClass = b.removeClass ||
  3435. function(b) {
  3436. this.hasClass(b) && (this.className = this.className.replace(b, ""));
  3437. return this
  3438. },
  3439. b.remove = b.remove ||
  3440. function() {},
  3441. b.appendTo = b.appendTo ||
  3442. function(b) {
  3443. b.appendChild(this);
  3444. return this
  3445. },
  3446. b.prependTo = b.prependTo ||
  3447. function(b) {
  3448. b.childNodes[0] ? b.insertBefore(this, b.childNodes[0]) : b.appendChild(this);
  3449. return this
  3450. },
  3451. b.transforms = b.transforms ||
  3452. function() {
  3453. this.style[a.getInstance().trans] = a.getInstance().translate(this.position) + a.getInstance().rotate(this.rotation) + a.getInstance().scale(this.scale) + a.getInstance().skew(this.skew);
  3454. return this
  3455. },
  3456. b.position = b.position || {
  3457. x: 0,
  3458. y: 0
  3459. },
  3460. b.rotation = b.rotation || 0,
  3461. b.scale = b.scale || {
  3462. x: 1,
  3463. y: 1
  3464. },
  3465. b.skew = b.skew || {
  3466. x: 0,
  3467. y: 0
  3468. },
  3469. b.translates = function(b, a) {
  3470. this.position.x = b;
  3471. this.position.y = a - c.MainContext.instance.stage.stageHeight;
  3472. this.transforms();
  3473. return this
  3474. },
  3475. b.rotate = function(b) {
  3476. this.rotation = b;
  3477. this.transforms();
  3478. return this
  3479. },
  3480. b.resize = function(b, a) {
  3481. this.scale.x = b;
  3482. this.scale.y = a;
  3483. this.transforms();
  3484. return this
  3485. },
  3486. b.setSkew = function(b, a) {
  3487. this.skew.x = b;
  3488. this.skew.y = a;
  3489. this.transforms();
  3490. return this
  3491. };
  3492. return b
  3493. };
  3494. a.prototype.scale = function(b) {
  3495. return "scale(" + b.x + ", " + b.y + ") "
  3496. };
  3497. a.prototype.skew = function(b) {
  3498. return "skewX(" + -b.x + "deg) skewY(" + b.y + "deg)"
  3499. };
  3500. return a
  3501. } (c.HashObject);
  3502. c.Browser = e;
  3503. e.prototype.__class__ = "egret.Browser"
  3504. })(egret || (egret = {}));
  3505. egret.Codec = {
  3506. name: "Jacob__Codec"
  3507. };
  3508. egret.Utils = {};
  3509. egret.Utils.unzip = function() {
  3510. return egret.Codec.GZip.gunzip.apply(egret.Codec.GZip, arguments)
  3511. };
  3512. egret.Utils.unzipBase64 = function() {
  3513. var c = egret.Codec.Base64.decode.apply(egret.Codec.Base64, arguments);
  3514. return egret.Codec.GZip.gunzip.apply(egret.Codec.GZip, [c])
  3515. };
  3516. egret.Utils.unzipBase64AsArray = function(c, e) {
  3517. e = e || 1;
  3518. var d = this.unzipBase64(c),
  3519. a = [],
  3520. b,
  3521. k,
  3522. f;
  3523. b = 0;
  3524. for (f = d.length / e; b < f; b++) for (a[b] = 0, k = e - 1; 0 <= k; --k) a[b] += d.charCodeAt(b * e + k) << 8 * k;
  3525. return a
  3526. };
  3527. egret.Utils.unzipAsArray = function(c, e) {
  3528. e = e || 1;
  3529. var d = this.unzip(c),
  3530. a = [],
  3531. b,
  3532. k,
  3533. f;
  3534. b = 0;
  3535. for (f = d.length / e; b < f; b++) for (a[b] = 0, k = e - 1; 0 <= k; --k) a[b] += d.charCodeAt(b * e + k) << 8 * k;
  3536. return a
  3537. };
  3538. egret.Utils.StringToArray = function(c) {
  3539. c = c.split(",");
  3540. var e = [],
  3541. d;
  3542. for (d = 0; d < c.length; d++) e.push(parseInt(c[d]));
  3543. return e
  3544. };
  3545. egret.Codec.Base64 = {
  3546. name: "Jacob__Codec__Base64"
  3547. };
  3548. egret.Codec.Base64._keyStr = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";
  3549. egret.Codec.Base64.decode = function(c) {
  3550. var e = [],
  3551. d,
  3552. a,
  3553. b,
  3554. k,
  3555. f,
  3556. m = 0;
  3557. for (c = c.replace(/[^A-Za-z0-9\+\/\=]/g, ""); m < c.length;) d = this._keyStr.indexOf(c.charAt(m++)),
  3558. a = this._keyStr.indexOf(c.charAt(m++)),
  3559. k = this._keyStr.indexOf(c.charAt(m++)),
  3560. f = this._keyStr.indexOf(c.charAt(m++)),
  3561. d = d << 2 | a >> 4,
  3562. a = (a & 15) << 4 | k >> 2,
  3563. b = (k & 3) << 6 | f,
  3564. e.push(String.fromCharCode(d)),
  3565. 64 != k && e.push(String.fromCharCode(a)),
  3566. 64 != f && e.push(String.fromCharCode(b));
  3567. return e = e.join("")
  3568. };
  3569. egret.Codec.Base64.decodeAsArray = function(c, e) {
  3570. var d = this.decode(c),
  3571. a = [],
  3572. b,
  3573. k,
  3574. f;
  3575. b = 0;
  3576. for (f = d.length / e; b < f; b++) for (a[b] = 0, k = e - 1; 0 <= k; --k) a[b] += d.charCodeAt(b * e + k) << 8 * k;
  3577. return a
  3578. };
  3579. egret.Utils.uint8ArrayToUint32Array = function(c) {
  3580. if (0 != c.length % 4) return null;
  3581. for (var e = c.length / 4,
  3582. d = window.Uint32Array ? new Uint32Array(e) : [], a = 0; a < e; a++) {
  3583. var b = 4 * a;
  3584. d[a] = c[b] + 256 * c[b + 1] + 65536 * c[b + 2] + 16777216 * c[b + 3]
  3585. }
  3586. return d
  3587. };
  3588. egret.Codec.GZip = function(c) {
  3589. this.data = c;
  3590. this.debug = !1;
  3591. this.gpflags = void 0;
  3592. this.files = 0;
  3593. this.unzipped = [];
  3594. this.buf32k = Array(32768);
  3595. this.bIdx = 0;
  3596. this.modeZIP = !1;
  3597. this.bytepos = 0;
  3598. this.bb = 1;
  3599. this.bits = 0;
  3600. this.nameBuf = [];
  3601. this.fileout = void 0;
  3602. this.literalTree = Array(egret.Codec.GZip.LITERALS);
  3603. this.distanceTree = Array(32);
  3604. this.treepos = 0;
  3605. this.Places = null;
  3606. this.len = 0;
  3607. this.fpos = Array(17);
  3608. this.fpos[0] = 0;
  3609. this.fmax = this.flens = void 0
  3610. };
  3611. egret.Codec.GZip.gunzip = function(c) {
  3612. return (new egret.Codec.GZip(c)).gunzip()[0][0]
  3613. };
  3614. egret.Codec.GZip.HufNode = function() {
  3615. this.b1 = this.b0 = 0;
  3616. this.jump = null;
  3617. this.jumppos = -1
  3618. };
  3619. egret.Codec.GZip.LITERALS = 288;
  3620. egret.Codec.GZip.NAMEMAX = 256;
  3621. 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, 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];
  3622. 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];
  3623. 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];
  3624. 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];
  3625. 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];
  3626. egret.Codec.GZip.border = [16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15];
  3627. egret.Codec.GZip.prototype.gunzip = function() {
  3628. this.outputArr = [];
  3629. this.nextFile();
  3630. return this.unzipped
  3631. };
  3632. egret.Codec.GZip.prototype.readByte = function() {
  3633. this.bits += 8;
  3634. return this.bytepos < this.data.length ? this.data.charCodeAt(this.bytepos++) : -1
  3635. };
  3636. egret.Codec.GZip.prototype.byteAlign = function() {
  3637. this.bb = 1
  3638. };
  3639. egret.Codec.GZip.prototype.readBit = function() {
  3640. var c;
  3641. this.bits++;
  3642. c = this.bb & 1;
  3643. this.bb >>= 1;
  3644. 0 == this.bb && (this.bb = this.readByte(), c = this.bb & 1, this.bb = this.bb >> 1 | 128);
  3645. return c
  3646. };
  3647. egret.Codec.GZip.prototype.readBits = function(c) {
  3648. for (var e = 0,
  3649. d = c; d--;) e = e << 1 | this.readBit();
  3650. c && (e = egret.Codec.GZip.bitReverse[e] >> 8 - c);
  3651. return e
  3652. };
  3653. egret.Codec.GZip.prototype.flushBuffer = function() {
  3654. this.bIdx = 0
  3655. };
  3656. egret.Codec.GZip.prototype.addBuffer = function(c) {
  3657. this.buf32k[this.bIdx++] = c;
  3658. this.outputArr.push(String.fromCharCode(c));
  3659. 32768 == this.bIdx && (this.bIdx = 0)
  3660. };
  3661. egret.Codec.GZip.prototype.IsPat = function() {
  3662. for (;;) {
  3663. if (this.fpos[this.len] >= this.fmax) return - 1;
  3664. if (this.flens[this.fpos[this.len]] == this.len) return this.fpos[this.len]++;
  3665. this.fpos[this.len]++
  3666. }
  3667. };
  3668. egret.Codec.GZip.prototype.Rec = function() {
  3669. var c = this.Places[this.treepos],
  3670. e;
  3671. if (17 == this.len) return - 1;
  3672. this.treepos++;
  3673. this.len++;
  3674. e = this.IsPat();
  3675. if (0 <= e) c.b0 = e;
  3676. else if (c.b0 = 32768, this.Rec()) return - 1;
  3677. e = this.IsPat();
  3678. if (0 <= e) c.b1 = e,
  3679. c.jump = null;
  3680. else if (c.b1 = 32768, c.jump = this.Places[this.treepos], c.jumppos = this.treepos, this.Rec()) return - 1;
  3681. this.len--;
  3682. return 0
  3683. };
  3684. egret.Codec.GZip.prototype.CreateTree = function(c, e, d, a) {
  3685. this.Places = c;
  3686. this.treepos = 0;
  3687. this.flens = d;
  3688. this.fmax = e;
  3689. for (c = 0; 17 > c; c++) this.fpos[c] = 0;
  3690. this.len = 0;
  3691. return this.Rec() ? -1 : 0
  3692. };
  3693. egret.Codec.GZip.prototype.DecodeValue = function(c) {
  3694. for (var e, d, a = 0,
  3695. b = c[a];;) if (e = this.readBit()) {
  3696. if (! (b.b1 & 32768)) return b.b1;
  3697. b = b.jump;
  3698. e = c.length;
  3699. for (d = 0; d < e; d++) if (c[d] === b) {
  3700. a = d;
  3701. break
  3702. }
  3703. } else {
  3704. if (! (b.b0 & 32768)) return b.b0;
  3705. a++;
  3706. b = c[a]
  3707. }
  3708. return - 1
  3709. };
  3710. egret.Codec.GZip.prototype.DeflateLoop = function() {
  3711. var c, e, d, a, b;
  3712. do
  3713. if (c = this.readBit(), d = this.readBits(2), 0 == d) for (this.byteAlign(), d = this.readByte(), d |= this.readByte() << 8, e = this.readByte(), e |= this.readByte() << 8, (d ^ ~e) & 65535 && document.write("BlockLen checksum mismatch\n"); d--;) e = this.readByte(),
  3714. this.addBuffer(e);
  3715. else if (1 == d) for (;;) if (d = egret.Codec.GZip.bitReverse[this.readBits(7)] >> 1, 23 < d ? (d = d << 1 | this.readBit(), 199 < d ? (d -= 128, d = d << 1 | this.readBit()) : (d -= 48, 143 < d && (d += 136))) : d += 256, 256 > d) this.addBuffer(d);
  3716. else if (256 == d) break;
  3717. else {
  3718. var k;
  3719. d -= 257;
  3720. b = this.readBits(egret.Codec.GZip.cplext[d]) + egret.Codec.GZip.cplens[d];
  3721. d = egret.Codec.GZip.bitReverse[this.readBits(5)] >> 3;
  3722. 8 < egret.Codec.GZip.cpdext[d] ? (k = this.readBits(8), k |= this.readBits(egret.Codec.GZip.cpdext[d] - 8) << 8) : k = this.readBits(egret.Codec.GZip.cpdext[d]);
  3723. k += egret.Codec.GZip.cpdist[d];
  3724. for (d = 0; d < b; d++) e = this.buf32k[this.bIdx - k & 32767],
  3725. this.addBuffer(e)
  3726. } else if (2 == d) {
  3727. var f = Array(320);
  3728. e = 257 + this.readBits(5);
  3729. k = 1 + this.readBits(5);
  3730. a = 4 + this.readBits(4);
  3731. for (d = 0; 19 > d; d++) f[d] = 0;
  3732. for (d = 0; d < a; d++) f[egret.Codec.GZip.border[d]] = this.readBits(3);
  3733. b = this.distanceTree.length;
  3734. for (a = 0; a < b; a++) this.distanceTree[a] = new egret.Codec.GZip.HufNode;
  3735. if (this.CreateTree(this.distanceTree, 19, f, 0)) return this.flushBuffer(),
  3736. 1;
  3737. b = e + k;
  3738. a = 0;
  3739. for (var m = -1; a < b;) if (m++, d = this.DecodeValue(this.distanceTree), 16 > d) f[a++] = d;
  3740. else if (16 == d) {
  3741. var g;
  3742. d = 3 + this.readBits(2);
  3743. if (a + d > b) return this.flushBuffer(),
  3744. 1;
  3745. for (g = a ? f[a - 1] : 0; d--;) f[a++] = g
  3746. } else {
  3747. d = 17 == d ? 3 + this.readBits(3) : 11 + this.readBits(7);
  3748. if (a + d > b) return this.flushBuffer(),
  3749. 1;
  3750. for (; d--;) f[a++] = 0
  3751. }
  3752. b = this.literalTree.length;
  3753. for (a = 0; a < b; a++) this.literalTree[a] = new egret.Codec.GZip.HufNode;
  3754. if (this.CreateTree(this.literalTree, e, f, 0)) return this.flushBuffer(),
  3755. 1;
  3756. b = this.literalTree.length;
  3757. for (a = 0; a < b; a++) this.distanceTree[a] = new egret.Codec.GZip.HufNode;
  3758. d = [];
  3759. for (a = e; a < f.length; a++) d[a - e] = f[a];
  3760. if (this.CreateTree(this.distanceTree, k, d, 0)) return this.flushBuffer(),
  3761. 1;
  3762. for (;;) if (d = this.DecodeValue(this.literalTree), 256 <= d) {
  3763. d -= 256;
  3764. if (0 == d) break;
  3765. d--;
  3766. b = this.readBits(egret.Codec.GZip.cplext[d]) + egret.Codec.GZip.cplens[d];
  3767. d = this.DecodeValue(this.distanceTree);
  3768. 8 < egret.Codec.GZip.cpdext[d] ? (k = this.readBits(8), k |= this.readBits(egret.Codec.GZip.cpdext[d] - 8) << 8) : k = this.readBits(egret.Codec.GZip.cpdext[d]);
  3769. for (k += egret.Codec.GZip.cpdist[d]; b--;) e = this.buf32k[this.bIdx - k & 32767],
  3770. this.addBuffer(e)
  3771. } else this.addBuffer(d)
  3772. }
  3773. while (!c);
  3774. this.flushBuffer();
  3775. this.byteAlign();
  3776. return 0
  3777. };
  3778. egret.Codec.GZip.prototype.unzipFile = function(c) {
  3779. var e;
  3780. this.gunzip();
  3781. for (e = 0; e < this.unzipped.length; e++) if (this.unzipped[e][1] == c) return this.unzipped[e][0]
  3782. };
  3783. egret.Codec.GZip.prototype.nextFile = function() {
  3784. this.outputArr = [];
  3785. this.modeZIP = !1;
  3786. var c = [];
  3787. c[0] = this.readByte();
  3788. c[1] = this.readByte();
  3789. 120 == c[0] && 218 == c[1] && (this.DeflateLoop(), this.unzipped[this.files] = [this.outputArr.join(""), "geonext.gxt"], this.files++);
  3790. 31 == c[0] && 139 == c[1] && (this.skipdir(), this.unzipped[this.files] = [this.outputArr.join(""), "file"], this.files++);
  3791. if (80 == c[0] && 75 == c[1] && (this.modeZIP = !0, c[2] = this.readByte(), c[3] = this.readByte(), 3 == c[2] && 4 == c[3])) {
  3792. c[0] = this.readByte();
  3793. c[1] = this.readByte();
  3794. this.gpflags = this.readByte();
  3795. this.gpflags |= this.readByte() << 8;
  3796. c = this.readByte();
  3797. c |= this.readByte() << 8;
  3798. this.readByte();
  3799. this.readByte();
  3800. this.readByte();
  3801. this.readByte();
  3802. this.readByte();
  3803. this.readByte();
  3804. this.readByte();
  3805. this.readByte();
  3806. this.readByte();
  3807. this.readByte();
  3808. this.readByte();
  3809. this.readByte();
  3810. var e = this.readByte(),
  3811. e = e | this.readByte() << 8,
  3812. d = this.readByte(),
  3813. d = d | this.readByte() << 8,
  3814. a = 0;
  3815. for (this.nameBuf = []; e--;) {
  3816. var b = this.readByte();
  3817. "/" == b | ":" == b ? a = 0 : a < egret.Codec.GZip.NAMEMAX - 1 && (this.nameBuf[a++] = String.fromCharCode(b))
  3818. }
  3819. this.fileout || (this.fileout = this.nameBuf);
  3820. for (var a = 0; a < d;) this.readByte(),
  3821. a++;
  3822. 8 == c && (this.DeflateLoop(), this.unzipped[this.files] = [this.outputArr.join(""), this.nameBuf.join("")], this.files++);
  3823. this.skipdir()
  3824. }
  3825. };
  3826. egret.Codec.GZip.prototype.skipdir = function() {
  3827. var c = [],
  3828. e;
  3829. this.gpflags & 8 && (c[0] = this.readByte(), c[1] = this.readByte(), c[2] = this.readByte(), c[3] = this.readByte(), this.readByte(), this.readByte(), this.readByte(), this.readByte(), this.readByte(), this.readByte(), this.readByte(), this.readByte());
  3830. this.modeZIP && this.nextFile();
  3831. c[0] = this.readByte();
  3832. if (8 != c[0]) return 0;
  3833. this.gpflags = this.readByte();
  3834. this.readByte();
  3835. this.readByte();
  3836. this.readByte();
  3837. this.readByte();
  3838. this.readByte();
  3839. this.readByte();
  3840. if (this.gpflags & 4) for (c[0] = this.readByte(), c[2] = this.readByte(), this.len = c[0] + 256 * c[1], c = 0; c < this.len; c++) this.readByte();
  3841. if (this.gpflags & 8) for (c = 0, this.nameBuf = []; e = this.readByte();) {
  3842. if ("7" == e || ":" == e) c = 0;
  3843. c < egret.Codec.GZip.NAMEMAX - 1 && (this.nameBuf[c++] = e)
  3844. }
  3845. if (this.gpflags & 16) for (; this.readByte(););
  3846. this.gpflags & 2 && (this.readByte(), this.readByte());
  3847. this.DeflateLoop();
  3848. this.readByte();
  3849. this.readByte();
  3850. this.readByte();
  3851. this.readByte();
  3852. this.modeZIP && this.nextFile()
  3853. }; (function() {
  3854. function c(b) {
  3855. throw b;
  3856. }
  3857. function e(b, a) {
  3858. var c = b.split("."),
  3859. k = C;
  3860. c[0] in k || !k.execScript || k.execScript("var " + c[0]);
  3861. for (var d; c.length && (d = c.shift());) c.length || a === w ? k = k[d] ? k[d] : k[d] = {}: k[d] = a
  3862. }
  3863. function d(b) {
  3864. if ("string" === typeof b) {
  3865. b = b.split("");
  3866. var a, c;
  3867. a = 0;
  3868. for (c = b.length; a < c; a++) b[a] = (b[a].charCodeAt(0) & 255) >>> 0
  3869. }
  3870. a = 1;
  3871. c = 0;
  3872. for (var k = b.length,
  3873. d, f = 0; 0 < k;) {
  3874. d = 1024 < k ? 1024 : k;
  3875. k -= d;
  3876. do a += b[f++],
  3877. c += a;
  3878. while (--d);
  3879. a %= 65521;
  3880. c %= 65521
  3881. }
  3882. return (c << 16 | a) >>> 0
  3883. }
  3884. function a(b, a) {
  3885. this.index = "number" === typeof a ? a: 0;
  3886. this.i = 0;
  3887. this.buffer = b instanceof(u ? Uint8Array: Array) ? b: new(u ? Uint8Array: Array)(32768);
  3888. 2 * this.buffer.length <= this.index && c(Error("invalid index"));
  3889. this.buffer.length <= this.index && this.f()
  3890. }
  3891. function b(b) {
  3892. this.buffer = new(u ? Uint16Array: Array)(2 * b);
  3893. this.length = 0
  3894. }
  3895. function k(b) {
  3896. var a = b.length,
  3897. c = 0,
  3898. k = Number.POSITIVE_INFINITY,
  3899. d, f, e, m, g, h, l, p, r;
  3900. for (p = 0; p < a; ++p) b[p] > c && (c = b[p]),
  3901. b[p] < k && (k = b[p]);
  3902. d = 1 << c;
  3903. f = new(u ? Uint32Array: Array)(d);
  3904. e = 1;
  3905. m = 0;
  3906. for (g = 2; e <= c;) {
  3907. for (p = 0; p < a; ++p) if (b[p] === e) {
  3908. h = 0;
  3909. l = m;
  3910. for (r = 0; r < e; ++r) h = h << 1 | l & 1,
  3911. l >>= 1;
  3912. for (r = h; r < d; r += g) f[r] = e << 16 | p; ++m
  3913. }++e;
  3914. m <<= 1;
  3915. g <<= 1
  3916. }
  3917. return [f, c, k]
  3918. }
  3919. function f(b, a) {
  3920. this.h = H;
  3921. this.w = 0;
  3922. this.input = b;
  3923. this.b = 0;
  3924. a && (a.lazy && (this.w = a.lazy), "number" === typeof a.compressionType && (this.h = a.compressionType), a.outputBuffer && (this.a = u && a.outputBuffer instanceof Array ? new Uint8Array(a.outputBuffer) : a.outputBuffer), "number" === typeof a.outputIndex && (this.b = a.outputIndex));
  3925. this.a || (this.a = new(u ? Uint8Array: Array)(32768))
  3926. }
  3927. function m(b, a) {
  3928. this.length = b;
  3929. this.G = a
  3930. }
  3931. function g() {
  3932. var b = G;
  3933. switch (B) {
  3934. case 3 === b: return [257, b - 3, 0];
  3935. case 4 === b: return [258, b - 4, 0];
  3936. case 5 === b: return [259, b - 5, 0];
  3937. case 6 === b: return [260, b - 6, 0];
  3938. case 7 === b: return [261, b - 7, 0];
  3939. case 8 === b: return [262, b - 8, 0];
  3940. case 9 === b: return [263, b - 9, 0];
  3941. case 10 === b: return [264, b - 10, 0];
  3942. case 12 >= b: return [265, b - 11, 1];
  3943. case 14 >= b: return [266, b - 13, 1];
  3944. case 16 >= b: return [267, b - 15, 1];
  3945. case 18 >= b: return [268, b - 17, 1];
  3946. case 22 >= b: return [269, b - 19, 2];
  3947. case 26 >= b: return [270, b - 23, 2];
  3948. case 30 >= b: return [271, b - 27, 2];
  3949. case 34 >= b: return [272, b - 31, 2];
  3950. case 42 >= b: return [273, b - 35, 3];
  3951. case 50 >= b: return [274, b - 43, 3];
  3952. case 58 >= b: return [275, b - 51, 3];
  3953. case 66 >= b: return [276, b - 59, 3];
  3954. case 82 >= b: return [277, b - 67, 4];
  3955. case 98 >= b: return [278, b - 83, 4];
  3956. case 114 >= b: return [279, b - 99, 4];
  3957. case 130 >= b: return [280, b - 115, 4];
  3958. case 162 >= b: return [281, b - 131, 5];
  3959. case 194 >= b: return [282, b - 163, 5];
  3960. case 226 >= b: return [283, b - 195, 5];
  3961. case 257 >= b: return [284, b - 227, 5];
  3962. case 258 === b: return [285, b - 258, 0];
  3963. default:
  3964. c("invalid length: " + b)
  3965. }
  3966. }
  3967. function h(b, a) {
  3968. function k(b, a) {
  3969. var d = b.G,
  3970. f = [],
  3971. e = 0,
  3972. m;
  3973. m = M[b.length];
  3974. f[e++] = m & 65535;
  3975. f[e++] = m >> 16 & 255;
  3976. f[e++] = m >> 24;
  3977. var g;
  3978. switch (B) {
  3979. case 1 === d: g = [0, d - 1, 0];
  3980. break;
  3981. case 2 === d: g = [1, d - 2, 0];
  3982. break;
  3983. case 3 === d: g = [2, d - 3, 0];
  3984. break;
  3985. case 4 === d: g = [3, d - 4, 0];
  3986. break;
  3987. case 6 >= d: g = [4, d - 5, 1];
  3988. break;
  3989. case 8 >= d: g = [5, d - 7, 1];
  3990. break;
  3991. case 12 >= d: g = [6, d - 9, 2];
  3992. break;
  3993. case 16 >= d: g = [7, d - 13, 2];
  3994. break;
  3995. case 24 >= d: g = [8, d - 17, 3];
  3996. break;
  3997. case 32 >= d: g = [9, d - 25, 3];
  3998. break;
  3999. case 48 >= d: g = [10, d - 33, 4];
  4000. break;
  4001. case 64 >= d: g = [11, d - 49, 4];
  4002. break;
  4003. case 96 >= d: g = [12, d - 65, 5];
  4004. break;
  4005. case 128 >= d: g = [13, d - 97, 5];
  4006. break;
  4007. case 192 >= d: g = [14, d - 129, 6];
  4008. break;
  4009. case 256 >= d: g = [15, d - 193, 6];
  4010. break;
  4011. case 384 >= d: g = [16, d - 257, 7];
  4012. break;
  4013. case 512 >= d: g = [17, d - 385, 7];
  4014. break;
  4015. case 768 >= d: g = [18, d - 513, 8];
  4016. break;
  4017. case 1024 >= d: g = [19, d - 769, 8];
  4018. break;
  4019. case 1536 >= d: g = [20, d - 1025, 9];
  4020. break;
  4021. case 2048 >= d: g = [21, d - 1537, 9];
  4022. break;
  4023. case 3072 >= d: g = [22, d - 2049, 10];
  4024. break;
  4025. case 4096 >= d: g = [23, d - 3073, 10];
  4026. break;
  4027. case 6144 >= d: g = [24, d - 4097, 11];
  4028. break;
  4029. case 8192 >= d: g = [25, d - 6145, 11];
  4030. break;
  4031. case 12288 >= d: g = [26, d - 8193, 12];
  4032. break;
  4033. case 16384 >= d: g = [27, d - 12289, 12];
  4034. break;
  4035. case 24576 >= d: g = [28, d - 16385, 13];
  4036. break;
  4037. case 32768 >= d: g = [29, d - 24577, 13];
  4038. break;
  4039. default:
  4040. c("invalid distance")
  4041. }
  4042. m = g;
  4043. f[e++] = m[0];
  4044. f[e++] = m[1];
  4045. f[e++] = m[2];
  4046. d = 0;
  4047. for (e = f.length; d < e; ++d) r[q++] = f[d];
  4048. n[f[0]]++;
  4049. t[f[3]]++;
  4050. s = b.length + a - 1;
  4051. p = null
  4052. }
  4053. var d, f, e, g, h, l = {},
  4054. p, r = u ? new Uint16Array(2 * a.length) : [],
  4055. q = 0,
  4056. s = 0,
  4057. n = new(u ? Uint32Array: Array)(286),
  4058. t = new(u ? Uint32Array: Array)(30),
  4059. z = b.w,
  4060. A;
  4061. if (!u) {
  4062. for (e = 0; 285 >= e;) n[e++] = 0;
  4063. for (e = 0; 29 >= e;) t[e++] = 0
  4064. }
  4065. n[256] = 1;
  4066. d = 0;
  4067. for (f = a.length; d < f; ++d) {
  4068. e = h = 0;
  4069. for (g = 3; e < g && d + e !== f; ++e) h = h << 8 | a[d + e];
  4070. l[h] === w && (l[h] = []);
  4071. e = l[h];
  4072. if (! (0 < s--)) {
  4073. for (; 0 < e.length && 32768 < d - e[0];) e.shift();
  4074. if (d + 3 >= f) {
  4075. p && k(p, -1);
  4076. e = 0;
  4077. for (g = f - d; e < g; ++e) A = a[d + e],
  4078. r[q++] = A,
  4079. ++n[A];
  4080. break
  4081. }
  4082. if (0 < e.length) {
  4083. h = g = w;
  4084. var D = 0,
  4085. E = w,
  4086. x = w,
  4087. y = E = w,
  4088. v = a.length,
  4089. x = 0,
  4090. y = e.length;
  4091. a: for (; x < y; x++) {
  4092. g = e[y - x - 1];
  4093. E = 3;
  4094. if (3 < D) {
  4095. for (E = D; 3 < E; E--) if (a[g + E - 1] !== a[d + E - 1]) continue a;
  4096. E = D
  4097. }
  4098. for (; 258 > E && d + E < v && a[g + E] === a[d + E];)++E;
  4099. E > D && (h = g, D = E);
  4100. if (258 === E) break
  4101. }
  4102. g = new m(D, d - h);
  4103. p ? p.length < g.length ? (A = a[d - 1], r[q++] = A, ++n[A], k(g, 0)) : k(p, -1) : g.length < z ? p = g: k(g, 0)
  4104. } else p ? k(p, -1) : (A = a[d], r[q++] = A, ++n[A])
  4105. }
  4106. e.push(d)
  4107. }
  4108. r[q++] = 256;
  4109. n[256]++;
  4110. b.L = n;
  4111. b.K = t;
  4112. return u ? r.subarray(0, q) : r
  4113. }
  4114. function l(a, c) {
  4115. function k(b) {
  4116. var a = r[b][q[b]];
  4117. a === l ? (k(b + 1), k(b + 1)) : --p[a]; ++q[b]
  4118. }
  4119. var d = a.length,
  4120. f = new b(572),
  4121. e = new(u ? Uint8Array: Array)(d),
  4122. m,
  4123. g,
  4124. h;
  4125. if (!u) for (g = 0; g < d; g++) e[g] = 0;
  4126. for (g = 0; g < d; ++g) 0 < a[g] && f.push(g, a[g]);
  4127. d = Array(f.length / 2);
  4128. m = new(u ? Uint32Array: Array)(f.length / 2);
  4129. if (1 === d.length) return e[f.pop().index] = 1,
  4130. e;
  4131. g = 0;
  4132. for (h = f.length / 2; g < h; ++g) d[g] = f.pop(),
  4133. m[g] = d[g].value;
  4134. var l = m.length;
  4135. g = new(u ? Uint16Array: Array)(c);
  4136. var f = new(u ? Uint8Array: Array)(c),
  4137. p = new(u ? Uint8Array: Array)(l);
  4138. h = Array(c);
  4139. var r = Array(c),
  4140. q = Array(c),
  4141. s = (1 << c) - l,
  4142. n = 1 << c - 1,
  4143. t,
  4144. z,
  4145. w;
  4146. g[c - 1] = l;
  4147. for (t = 0; t < c; ++t) s < n ? f[t] = 0 : (f[t] = 1, s -= n),
  4148. s <<= 1,
  4149. g[c - 2 - t] = (g[c - 1 - t] / 2 | 0) + l;
  4150. g[0] = f[0];
  4151. h[0] = Array(g[0]);
  4152. r[0] = Array(g[0]);
  4153. for (t = 1; t < c; ++t) g[t] > 2 * g[t - 1] + f[t] && (g[t] = 2 * g[t - 1] + f[t]),
  4154. h[t] = Array(g[t]),
  4155. r[t] = Array(g[t]);
  4156. for (s = 0; s < l; ++s) p[s] = c;
  4157. for (n = 0; n < g[c - 1]; ++n) h[c - 1][n] = m[n],
  4158. r[c - 1][n] = n;
  4159. for (s = 0; s < c; ++s) q[s] = 0;
  4160. 1 === f[c - 1] && (--p[0], ++q[c - 1]);
  4161. for (t = c - 2; 0 <= t; --t) {
  4162. z = s = 0;
  4163. w = q[t + 1];
  4164. for (n = 0; n < g[t]; n++) z = h[t + 1][w] + h[t + 1][w + 1],
  4165. z > m[s] ? (h[t][n] = z, r[t][n] = l, w += 2) : (h[t][n] = m[s], r[t][n] = s, ++s);
  4166. q[t] = 0;
  4167. 1 === f[t] && k(t)
  4168. }
  4169. m = p;
  4170. g = 0;
  4171. for (h = d.length; g < h; ++g) e[d[g].index] = m[g];
  4172. return e
  4173. }
  4174. function n(b) {
  4175. var a = new(u ? Uint16Array: Array)(b.length),
  4176. k = [],
  4177. d = [],
  4178. f = 0,
  4179. e,
  4180. m,
  4181. g;
  4182. e = 0;
  4183. for (m = b.length; e < m; e++) k[b[e]] = (k[b[e]] | 0) + 1;
  4184. e = 1;
  4185. for (m = 16; e <= m; e++) d[e] = f,
  4186. f += k[e] | 0,
  4187. f > 1 << e && c("overcommitted"),
  4188. f <<= 1;
  4189. 65536 > f && c("undercommitted");
  4190. e = 0;
  4191. for (m = b.length; e < m; e++) for (f = d[b[e]], d[b[e]] += 1, k = a[e] = 0, g = b[e]; k < g; k++) a[e] = a[e] << 1 | f & 1,
  4192. f >>>= 1;
  4193. return a
  4194. }
  4195. function p(b, a) {
  4196. this.input = b;
  4197. this.a = new(u ? Uint8Array: Array)(32768);
  4198. this.h = J.j;
  4199. var c = {},
  4200. k; ! a && (a = {}) || "number" !== typeof a.compressionType || (this.h = a.compressionType);
  4201. for (k in a) c[k] = a[k];
  4202. c.outputBuffer = this.a;
  4203. this.z = new f(this.input, c)
  4204. }
  4205. function q(b, a) {
  4206. this.k = [];
  4207. this.l = 32768;
  4208. this.e = this.g = this.c = this.q = 0;
  4209. this.input = u ? new Uint8Array(b) : b;
  4210. this.s = !1;
  4211. this.m = F;
  4212. this.B = !1;
  4213. if (a || !(a = {})) a.index && (this.c = a.index),
  4214. a.bufferSize && (this.l = a.bufferSize),
  4215. a.bufferType && (this.m = a.bufferType),
  4216. a.resize && (this.B = a.resize);
  4217. switch (this.m) {
  4218. case N:
  4219. this.b = 32768;
  4220. this.a = new(u ? Uint8Array: Array)(32768 + this.l + 258);
  4221. break;
  4222. case F:
  4223. this.b = 0;
  4224. this.a = new(u ? Uint8Array: Array)(this.l);
  4225. this.f = this.J;
  4226. this.t = this.H;
  4227. this.o = this.I;
  4228. break;
  4229. default:
  4230. c(Error("invalid inflate mode"))
  4231. }
  4232. }
  4233. function r(b, a) {
  4234. for (var k = b.g,
  4235. d = b.e,
  4236. f = b.input,
  4237. e = b.c,
  4238. m; d < a;) m = f[e++],
  4239. m === w && c(Error("input buffer is broken")),
  4240. k |= m << d,
  4241. d += 8;
  4242. b.g = k >>> a;
  4243. b.e = d - a;
  4244. b.c = e;
  4245. return k & (1 << a) - 1
  4246. }
  4247. function s(b, a) {
  4248. for (var k = b.g,
  4249. d = b.e,
  4250. f = b.input,
  4251. e = b.c,
  4252. m = a[0], g = a[1], h; d < g;) h = f[e++],
  4253. h === w && c(Error("input buffer is broken")),
  4254. k |= h << d,
  4255. d += 8;
  4256. f = m[k & (1 << g) - 1];
  4257. m = f >>> 16;
  4258. b.g = k >> m;
  4259. b.e = d - m;
  4260. b.c = e;
  4261. return f & 65535
  4262. }
  4263. function t(b) {
  4264. function a(b, c, k) {
  4265. var d, f, e, m;
  4266. for (m = 0; m < b;) switch (d = s(this, c), d) {
  4267. case 16:
  4268. for (e = 3 + r(this, 2); e--;) k[m++] = f;
  4269. break;
  4270. case 17:
  4271. for (e = 3 + r(this, 3); e--;) k[m++] = 0;
  4272. f = 0;
  4273. break;
  4274. case 18:
  4275. for (e = 11 + r(this, 7); e--;) k[m++] = 0;
  4276. f = 0;
  4277. break;
  4278. default:
  4279. f = k[m++] = d
  4280. }
  4281. return k
  4282. }
  4283. var c = r(b, 5) + 257,
  4284. d = r(b, 5) + 1,
  4285. f = r(b, 4) + 4,
  4286. e = new(u ? Uint8Array: Array)(K.length),
  4287. m;
  4288. for (m = 0; m < f; ++m) e[K[m]] = r(b, 3);
  4289. f = k(e);
  4290. e = new(u ? Uint8Array: Array)(c);
  4291. m = new(u ? Uint8Array: Array)(d);
  4292. b.o(k(a.call(b, c, f, e)), k(a.call(b, d, f, m)))
  4293. }
  4294. function A(b, a) {
  4295. var k, d;
  4296. this.input = b;
  4297. this.c = 0;
  4298. if (a || !(a = {})) a.index && (this.c = a.index),
  4299. a.verify && (this.M = a.verify);
  4300. k = b[this.c++];
  4301. d = b[this.c++];
  4302. switch (k & 15) {
  4303. case O:
  4304. this.method = O;
  4305. break;
  4306. default:
  4307. c(Error("unsupported compression method"))
  4308. }
  4309. 0 !== ((k << 8) + d) % 31 && c(Error("invalid fcheck flag:" + ((k << 8) + d) % 31));
  4310. d & 32 && c(Error("fdict flag is not supported"));
  4311. this.A = new q(b, {
  4312. index: this.c,
  4313. bufferSize: a.bufferSize,
  4314. bufferType: a.bufferType,
  4315. resize: a.resize
  4316. })
  4317. }
  4318. var w = void 0,
  4319. B = !0,
  4320. C = this,
  4321. u = "undefined" !== typeof Uint8Array && "undefined" !== typeof Uint16Array && "undefined" !== typeof Uint32Array;
  4322. a.prototype.f = function() {
  4323. var b = this.buffer,
  4324. a, c = b.length,
  4325. k = new(u ? Uint8Array: Array)(c << 1);
  4326. if (u) k.set(b);
  4327. else for (a = 0; a < c; ++a) k[a] = b[a];
  4328. return this.buffer = k
  4329. };
  4330. a.prototype.d = function(b, a, c) {
  4331. var k = this.buffer,
  4332. d = this.index,
  4333. f = this.i,
  4334. e = k[d];
  4335. c && 1 < a && (b = 8 < a ? (y[b & 255] << 24 | y[b >>> 8 & 255] << 16 | y[b >>> 16 & 255] << 8 | y[b >>> 24 & 255]) >> 32 - a: y[b] >> 8 - a);
  4336. if (8 > a + f) e = e << a | b,
  4337. f += a;
  4338. else for (c = 0; c < a; ++c) e = e << 1 | b >> a - c - 1 & 1,
  4339. 8 === ++f && (f = 0, k[d++] = y[e], e = 0, d === k.length && (k = this.f()));
  4340. k[d] = e;
  4341. this.buffer = k;
  4342. this.i = f;
  4343. this.index = d
  4344. };
  4345. a.prototype.finish = function() {
  4346. var b = this.buffer,
  4347. a = this.index,
  4348. c;
  4349. 0 < this.i && (b[a] <<= 8 - this.i, b[a] = y[b[a]], a++);
  4350. u ? c = b.subarray(0, a) : (b.length = a, c = b);
  4351. return c
  4352. };
  4353. var v = new(u ? Uint8Array: Array)(256),
  4354. D;
  4355. for (D = 0; 256 > D; ++D) {
  4356. for (var z = D,
  4357. E = z,
  4358. x = 7,
  4359. z = z >>> 1; z; z >>>= 1) E <<= 1,
  4360. E |= z & 1,
  4361. --x;
  4362. v[D] = (E << x & 255) >>> 0
  4363. }
  4364. var y = v,
  4365. v = [0, 1996959894, 3993919788, 2567524794, 124634137, 1886057615, 3915621685, 2657392035, 249268274, 2044508324, 3772115230, 2547177864, 162941995, 2125561021, 3887607047, 2428444049, 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, 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, 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, 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, 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, 711928724, 3020668471, 3272380065, 1510334235, 755167117];
  4366. u && new Uint32Array(v);
  4367. b.prototype.getParent = function(b) {
  4368. return 2 * ((b - 2) / 4 | 0)
  4369. };
  4370. b.prototype.push = function(b, a) {
  4371. var c, k, d = this.buffer,
  4372. f;
  4373. c = this.length;
  4374. d[this.length++] = a;
  4375. for (d[this.length++] = b; 0 < c;) if (k = this.getParent(c), d[c] > d[k]) f = d[c],
  4376. d[c] = d[k],
  4377. d[k] = f,
  4378. f = d[c + 1],
  4379. d[c + 1] = d[k + 1],
  4380. d[k + 1] = f,
  4381. c = k;
  4382. else break;
  4383. return this.length
  4384. };
  4385. b.prototype.pop = function() {
  4386. var b, a, c = this.buffer,
  4387. k, d, f;
  4388. a = c[0];
  4389. b = c[1];
  4390. this.length -= 2;
  4391. c[0] = c[this.length];
  4392. c[1] = c[this.length + 1];
  4393. for (f = 0;;) {
  4394. d = 2 * f + 2;
  4395. if (d >= this.length) break;
  4396. d + 2 < this.length && c[d + 2] > c[d] && (d += 2);
  4397. if (c[d] > c[f]) k = c[f],
  4398. c[f] = c[d],
  4399. c[d] = k,
  4400. k = c[f + 1],
  4401. c[f + 1] = c[d + 1],
  4402. c[d + 1] = k;
  4403. else break;
  4404. f = d
  4405. }
  4406. return {
  4407. index: b,
  4408. value: a,
  4409. length: this.length
  4410. }
  4411. };
  4412. var H = 2,
  4413. v = {
  4414. NONE: 0,
  4415. r: 1,
  4416. j: H,
  4417. N: 3
  4418. },
  4419. L = [];
  4420. for (D = 0; 288 > D; D++) switch (B) {
  4421. case 143 >= D: L.push([D + 48, 8]);
  4422. break;
  4423. case 255 >= D: L.push([D - 144 + 400, 9]);
  4424. break;
  4425. case 279 >= D: L.push([D - 256 + 0, 7]);
  4426. break;
  4427. case 287 >= D: L.push([D - 280 + 192, 8]);
  4428. break;
  4429. default:
  4430. c("invalid literal: " + D)
  4431. }
  4432. f.prototype.n = function() {
  4433. var b, k, d, f, e = this.input;
  4434. switch (this.h) {
  4435. case 0:
  4436. d = 0;
  4437. for (f = e.length; d < f;) {
  4438. k = u ? e.subarray(d, d + 65535) : e.slice(d, d + 65535);
  4439. d += k.length;
  4440. var m = d === f,
  4441. g = w,
  4442. p = g = w,
  4443. p = g = w,
  4444. r = this.a,
  4445. q = this.b;
  4446. if (u) {
  4447. for (r = new Uint8Array(this.a.buffer); r.length <= q + k.length + 5;) r = new Uint8Array(r.length << 1);
  4448. r.set(this.a)
  4449. }
  4450. g = m ? 1 : 0;
  4451. r[q++] = g | 0;
  4452. g = k.length;
  4453. p = ~g + 65536 & 65535;
  4454. r[q++] = g & 255;
  4455. r[q++] = g >>> 8 & 255;
  4456. r[q++] = p & 255;
  4457. r[q++] = p >>> 8 & 255;
  4458. if (u) r.set(k, q),
  4459. q += k.length,
  4460. r = r.subarray(0, q);
  4461. else {
  4462. g = 0;
  4463. for (p = k.length; g < p; ++g) r[q++] = k[g];
  4464. r.length = q
  4465. }
  4466. this.b = q;
  4467. this.a = r
  4468. }
  4469. break;
  4470. case 1:
  4471. d = new a(new Uint8Array(this.a.buffer), this.b);
  4472. d.d(1, 1, B);
  4473. d.d(1, 2, B);
  4474. e = h(this, e);
  4475. k = 0;
  4476. for (m = e.length; k < m; k++) if (f = e[k], a.prototype.d.apply(d, L[f]), 256 < f) d.d(e[++k], e[++k], B),
  4477. d.d(e[++k], 5),
  4478. d.d(e[++k], e[++k], B);
  4479. else if (256 === f) break;
  4480. this.a = d.finish();
  4481. this.b = this.a.length;
  4482. break;
  4483. case H:
  4484. f = new a(new Uint8Array(this.a), this.b);
  4485. var s, t, z, A = [16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15],
  4486. D,
  4487. E,
  4488. g = Array(19),
  4489. x,
  4490. r = H;
  4491. f.d(1, 1, B);
  4492. f.d(r, 2, B);
  4493. e = h(this, e);
  4494. p = l(this.L, 15);
  4495. D = n(p);
  4496. r = l(this.K, 7);
  4497. q = n(r);
  4498. for (s = 286; 257 < s && 0 === p[s - 1]; s--);
  4499. for (t = 30; 1 < t && 0 === r[t - 1]; t--);
  4500. var y = s,
  4501. v = t;
  4502. b = new(u ? Uint32Array: Array)(y + v);
  4503. var C = new(u ? Uint32Array: Array)(316),
  4504. G,
  4505. F;
  4506. E = new(u ? Uint8Array: Array)(19);
  4507. for (x = z = 0; x < y; x++) b[z++] = p[x];
  4508. for (x = 0; x < v; x++) b[z++] = r[x];
  4509. if (!u) for (x = 0, v = E.length; x < v; ++x) E[x] = 0;
  4510. x = G = 0;
  4511. for (v = b.length; x < v; x += z) {
  4512. for (z = 1; x + z < v && b[x + z] === b[x]; ++z);
  4513. y = z;
  4514. if (0 === b[x]) if (3 > y) for (; 0 < y--;) C[G++] = 0,
  4515. E[0]++;
  4516. else for (; 0 < y;) F = 138 > y ? y: 138,
  4517. F > y - 3 && F < y && (F = y - 3),
  4518. 10 >= F ? (C[G++] = 17, C[G++] = F - 3, E[17]++) : (C[G++] = 18, C[G++] = F - 11, E[18]++),
  4519. y -= F;
  4520. else if (C[G++] = b[x], E[b[x]]++, y--, 3 > y) for (; 0 < y--;) C[G++] = b[x],
  4521. E[b[x]]++;
  4522. else for (; 0 < y;) F = 6 > y ? y: 6,
  4523. F > y - 3 && F < y && (F = y - 3),
  4524. C[G++] = 16,
  4525. C[G++] = F - 3,
  4526. E[16]++,
  4527. y -= F
  4528. }
  4529. b = u ? C.subarray(0, G) : C.slice(0, G);
  4530. E = l(E, 7);
  4531. for (x = 0; 19 > x; x++) g[x] = E[A[x]];
  4532. for (z = 19; 4 < z && 0 === g[z - 1]; z--);
  4533. A = n(E);
  4534. f.d(s - 257, 5, B);
  4535. f.d(t - 1, 5, B);
  4536. f.d(z - 4, 4, B);
  4537. for (x = 0; x < z; x++) f.d(g[x], 3, B);
  4538. x = 0;
  4539. for (g = b.length; x < g; x++) if (k = b[x], f.d(A[k], E[k], B), 16 <= k) {
  4540. x++;
  4541. switch (k) {
  4542. case 16:
  4543. m = 2;
  4544. break;
  4545. case 17:
  4546. m = 3;
  4547. break;
  4548. case 18:
  4549. m = 7;
  4550. break;
  4551. default:
  4552. c("invalid code: " + k)
  4553. }
  4554. f.d(b[x], m, B)
  4555. }
  4556. m = [D, p];
  4557. q = [q, r];
  4558. k = m[0];
  4559. m = m[1];
  4560. r = q[0];
  4561. D = q[1];
  4562. q = 0;
  4563. for (g = e.length; q < g; ++q) if (d = e[q], f.d(k[d], m[d], B), 256 < d) f.d(e[++q], e[++q], B),
  4564. p = e[++q],
  4565. f.d(r[p], D[p], B),
  4566. f.d(e[++q], e[++q], B);
  4567. else if (256 === d) break;
  4568. this.a = f.finish();
  4569. this.b = this.a.length;
  4570. break;
  4571. default:
  4572. c("invalid compression type")
  4573. }
  4574. return this.a
  4575. };
  4576. D = [];
  4577. var G;
  4578. for (G = 3; 258 >= G; G++) z = g(),
  4579. D[G] = z[2] << 24 | z[1] << 16 | z[0];
  4580. var M = u ? new Uint32Array(D) : D,
  4581. J = v;
  4582. p.prototype.n = function() {
  4583. var b, a, k, f, e = 0;
  4584. f = this.a;
  4585. b = O;
  4586. switch (b) {
  4587. case O:
  4588. a = Math.LOG2E * Math.log(32768) - 8;
  4589. break;
  4590. default:
  4591. c(Error("invalid compression method"))
  4592. }
  4593. a = a << 4 | b;
  4594. f[e++] = a;
  4595. switch (b) {
  4596. case O:
  4597. switch (this.h) {
  4598. case J.NONE:
  4599. k = 0;
  4600. break;
  4601. case J.r:
  4602. k = 1;
  4603. break;
  4604. case J.j:
  4605. k = 2;
  4606. break;
  4607. default:
  4608. c(Error("unsupported compression type"))
  4609. }
  4610. break;
  4611. default:
  4612. c(Error("invalid compression method"))
  4613. }
  4614. b = k << 6 | 0;
  4615. f[e++] = b | 31 - (256 * a + b) % 31;
  4616. b = d(this.input);
  4617. this.z.b = e;
  4618. f = this.z.n();
  4619. e = f.length;
  4620. u && (f = new Uint8Array(f.buffer), f.length <= e + 4 && (this.a = new Uint8Array(f.length + 4), this.a.set(f), f = this.a), f = f.subarray(0, e + 4));
  4621. f[e++] = b >> 24 & 255;
  4622. f[e++] = b >> 16 & 255;
  4623. f[e++] = b >> 8 & 255;
  4624. f[e++] = b & 255;
  4625. return f
  4626. };
  4627. e("Zlib.Deflate", p);
  4628. e("Zlib.Deflate.compress",
  4629. function(b, a) {
  4630. return (new p(b, a)).n()
  4631. });
  4632. e("Zlib.Deflate.CompressionType", J);
  4633. e("Zlib.Deflate.CompressionType.NONE", J.NONE);
  4634. e("Zlib.Deflate.CompressionType.FIXED", J.r);
  4635. e("Zlib.Deflate.CompressionType.DYNAMIC", J.j);
  4636. var N = 0,
  4637. F = 1,
  4638. v = {
  4639. D: N,
  4640. C: F
  4641. };
  4642. q.prototype.p = function() {
  4643. for (; ! this.s;) {
  4644. var b = r(this, 3);
  4645. b & 1 && (this.s = B);
  4646. b >>>= 1;
  4647. switch (b) {
  4648. case 0:
  4649. var b = this.input,
  4650. a = this.c,
  4651. k = this.a,
  4652. d = this.b,
  4653. f = w,
  4654. e = w,
  4655. m = w,
  4656. g = k.length,
  4657. f = w;
  4658. this.e = this.g = 0;
  4659. f = b[a++];
  4660. f === w && c(Error("invalid uncompressed block header: LEN (first byte)"));
  4661. e = f;
  4662. f = b[a++];
  4663. f === w && c(Error("invalid uncompressed block header: LEN (second byte)"));
  4664. e |= f << 8;
  4665. f = b[a++];
  4666. f === w && c(Error("invalid uncompressed block header: NLEN (first byte)"));
  4667. m = f;
  4668. f = b[a++];
  4669. f === w && c(Error("invalid uncompressed block header: NLEN (second byte)"));
  4670. m |= f << 8;
  4671. e === ~m && c(Error("invalid uncompressed block header: length verify"));
  4672. a + e > b.length && c(Error("input buffer is broken"));
  4673. switch (this.m) {
  4674. case N:
  4675. for (; d + e > k.length;) {
  4676. f = g - d;
  4677. e -= f;
  4678. if (u) k.set(b.subarray(a, a + f), d),
  4679. d += f,
  4680. a += f;
  4681. else for (; f--;) k[d++] = b[a++];
  4682. this.b = d;
  4683. k = this.f();
  4684. d = this.b
  4685. }
  4686. break;
  4687. case F:
  4688. for (; d + e > k.length;) k = this.f({
  4689. v: 2
  4690. });
  4691. break;
  4692. default:
  4693. c(Error("invalid inflate mode"))
  4694. }
  4695. if (u) k.set(b.subarray(a, a + e), d),
  4696. d += e,
  4697. a += e;
  4698. else for (; e--;) k[d++] = b[a++];
  4699. this.c = a;
  4700. this.b = d;
  4701. this.a = k;
  4702. break;
  4703. case 1:
  4704. this.o(S, T);
  4705. break;
  4706. case 2:
  4707. t(this);
  4708. break;
  4709. default:
  4710. c(Error("unknown BTYPE: " + b))
  4711. }
  4712. }
  4713. return this.t()
  4714. };
  4715. D = [16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15];
  4716. var K = u ? new Uint16Array(D) : D;
  4717. D = [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];
  4718. var I = u ? new Uint16Array(D) : D;
  4719. D = [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];
  4720. var P = u ? new Uint8Array(D) : D;
  4721. D = [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];
  4722. var R = u ? new Uint16Array(D) : D;
  4723. D = [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];
  4724. var Q = u ? new Uint8Array(D) : D;
  4725. D = new(u ? Uint8Array: Array)(288);
  4726. z = 0;
  4727. for (E = D.length; z < E; ++z) D[z] = 143 >= z ? 8 : 255 >= z ? 9 : 279 >= z ? 7 : 8;
  4728. var S = k(D);
  4729. D = new(u ? Uint8Array: Array)(30);
  4730. z = 0;
  4731. for (E = D.length; z < E; ++z) D[z] = 5;
  4732. var T = k(D);
  4733. q.prototype.o = function(b, a) {
  4734. var c = this.a,
  4735. k = this.b;
  4736. this.u = b;
  4737. for (var d = c.length - 258,
  4738. f, e, m; 256 !== (f = s(this, b));) if (256 > f) k >= d && (this.b = k, c = this.f(), k = this.b),
  4739. c[k++] = f;
  4740. else for (f -= 257, m = I[f], 0 < P[f] && (m += r(this, P[f])), f = s(this, a), e = R[f], 0 < Q[f] && (e += r(this, Q[f])), k >= d && (this.b = k, c = this.f(), k = this.b); m--;) c[k] = c[k++-e];
  4741. for (; 8 <= this.e;) this.e -= 8,
  4742. this.c--;
  4743. this.b = k
  4744. };
  4745. q.prototype.I = function(b, a) {
  4746. var c = this.a,
  4747. k = this.b;
  4748. this.u = b;
  4749. for (var d = c.length,
  4750. f, e, m; 256 !== (f = s(this, b));) if (256 > f) k >= d && (c = this.f(), d = c.length),
  4751. c[k++] = f;
  4752. else for (f -= 257, m = I[f], 0 < P[f] && (m += r(this, P[f])), f = s(this, a), e = R[f], 0 < Q[f] && (e += r(this, Q[f])), k + m > d && (c = this.f(), d = c.length); m--;) c[k] = c[k++-e];
  4753. for (; 8 <= this.e;) this.e -= 8,
  4754. this.c--;
  4755. this.b = k
  4756. };
  4757. q.prototype.f = function() {
  4758. var b = new(u ? Uint8Array: Array)(this.b - 32768),
  4759. a = this.b - 32768,
  4760. c,
  4761. k,
  4762. d = this.a;
  4763. if (u) b.set(d.subarray(32768, b.length));
  4764. else for (c = 0, k = b.length; c < k; ++c) b[c] = d[c + 32768];
  4765. this.k.push(b);
  4766. this.q += b.length;
  4767. if (u) d.set(d.subarray(a, a + 32768));
  4768. else for (c = 0; 32768 > c; ++c) d[c] = d[a + c];
  4769. this.b = 32768;
  4770. return d
  4771. };
  4772. q.prototype.J = function(b) {
  4773. var a, c = this.input.length / this.c + 1 | 0,
  4774. k, d, f, e = this.input,
  4775. m = this.a;
  4776. b && ("number" === typeof b.v && (c = b.v), "number" === typeof b.F && (c += b.F));
  4777. 2 > c ? (k = (e.length - this.c) / this.u[2], f = k / 2 * 258 | 0, d = f < m.length ? m.length + f: m.length << 1) : d = m.length * c;
  4778. u ? (a = new Uint8Array(d), a.set(m)) : a = m;
  4779. return this.a = a
  4780. };
  4781. q.prototype.t = function() {
  4782. var b = 0,
  4783. a = this.a,
  4784. c = this.k,
  4785. k, d = new(u ? Uint8Array: Array)(this.q + (this.b - 32768)),
  4786. f,
  4787. e,
  4788. m,
  4789. g;
  4790. if (0 === c.length) return u ? this.a.subarray(32768, this.b) : this.a.slice(32768, this.b);
  4791. f = 0;
  4792. for (e = c.length; f < e; ++f) for (k = c[f], m = 0, g = k.length; m < g; ++m) d[b++] = k[m];
  4793. f = 32768;
  4794. for (e = this.b; f < e; ++f) d[b++] = a[f];
  4795. this.k = [];
  4796. return this.buffer = d
  4797. };
  4798. q.prototype.H = function() {
  4799. var b, a = this.b;
  4800. u ? this.B ? (b = new Uint8Array(a), b.set(this.a.subarray(0, a))) : b = this.a.subarray(0, a) : (this.a.length > a && (this.a.length = a), b = this.a);
  4801. return this.buffer = b
  4802. };
  4803. A.prototype.p = function() {
  4804. var b = this.input,
  4805. a, k;
  4806. a = this.A.p();
  4807. this.c = this.A.c;
  4808. this.M && (k = (b[this.c++] << 24 | b[this.c++] << 16 | b[this.c++] << 8 | b[this.c++]) >>> 0, k !== d(a) && c(Error("invalid adler-32 checksum")));
  4809. return a
  4810. };
  4811. e("Zlib.Inflate", A);
  4812. e("Zlib.Inflate.BufferType", v);
  4813. v.ADAPTIVE = v.C;
  4814. v.BLOCK = v.D;
  4815. e("Zlib.Inflate.prototype.decompress", A.prototype.p);
  4816. v = [16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15];
  4817. u && new Uint16Array(v);
  4818. v = [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];
  4819. u && new Uint16Array(v);
  4820. v = [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];
  4821. u && new Uint8Array(v);
  4822. v = [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];
  4823. u && new Uint16Array(v);
  4824. v = [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];
  4825. u && new Uint8Array(v);
  4826. v = new(u ? Uint8Array: Array)(288);
  4827. D = 0;
  4828. for (z = v.length; D < z; ++D) v[D] = 143 >= D ? 8 : 255 >= D ? 9 : 279 >= D ? 7 : 8;
  4829. k(v);
  4830. v = new(u ? Uint8Array: Array)(30);
  4831. D = 0;
  4832. for (z = v.length; D < z; ++D) v[D] = 5;
  4833. k(v);
  4834. var O = 8
  4835. }).call(this); (function(c) {
  4836. var e = function() {
  4837. function d() {}
  4838. d.parse = function(a) {
  4839. a = c.SAXParser.getInstance().parserXML(a);
  4840. if (!a || !a.childNodes) return null;
  4841. for (var b = a.childNodes.length,
  4842. k = !1,
  4843. f = 0; f < b; f++) {
  4844. var e = a.childNodes[f];
  4845. if (1 == e.nodeType) {
  4846. k = !0;
  4847. break
  4848. }
  4849. }
  4850. return k ? d.parseNode(e) : null
  4851. };
  4852. d.parseNode = function(a) {
  4853. if (!a || 1 != a.nodeType) return null;
  4854. var b = {};
  4855. b.localName = a.localName;
  4856. b.name = a.nodeName;
  4857. a.namespaceURI && (b.namespace = a.namespaceURI);
  4858. a.prefix && (b.prefix = a.prefix);
  4859. for (var c = a.attributes,
  4860. f = c.length,
  4861. e = 0; e < f; e++) {
  4862. var g = c[e],
  4863. h = g.name;
  4864. 0 != h.indexOf("xmlns:") && (b["$" + h] = g.value)
  4865. }
  4866. c = a.childNodes;
  4867. f = c.length;
  4868. for (e = 0; e < f; e++) if (g = d.parseNode(c[e])) b.children || (b.children = []),
  4869. g.parent = b,
  4870. b.children.push(g); ! b.children && (a = a.textContent.trim()) && (b.text = a);
  4871. return b
  4872. };
  4873. d.findChildren = function(a, b, c) {
  4874. c ? c.length = 0 : c = [];
  4875. d.findByPath(a, b, c);
  4876. return c
  4877. };
  4878. d.findByPath = function(a, b, c) {
  4879. var f = b.indexOf("."),
  4880. e; - 1 == f ? (e = b, f = !0) : (e = b.substring(0, f), b = b.substring(f + 1), f = !1);
  4881. if (a = a.children) for (var g = a.length,
  4882. h = 0; h < g; h++) {
  4883. var l = a[h];
  4884. l.localName == e && (f ? c.push(l) : d.findByPath(l, b, c))
  4885. }
  4886. };
  4887. d.getAttributes = function(a, b) {
  4888. b ? b.length = 0 : b = [];
  4889. for (var c in a)"$" == c.charAt(0) && b.push(c.substring(1));
  4890. return b
  4891. };
  4892. return d
  4893. } ();
  4894. c.XML = e;
  4895. e.prototype.__class__ = "egret.XML"
  4896. })(egret || (egret = {}));
  4897. __extends = this.__extends ||
  4898. function(c, e) {
  4899. function d() {
  4900. this.constructor = c
  4901. }
  4902. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  4903. d.prototype = e.prototype;
  4904. c.prototype = new d
  4905. }; (function(c) {
  4906. var e = function(d) {
  4907. function a(b, a, c) {
  4908. d.call(this);
  4909. this._target = null;
  4910. this.loop = this.ignoreGlobalPause = this._useTicks = !1;
  4911. this._actions = this._steps = this.pluginData = null;
  4912. this.paused = !1;
  4913. this.duration = 0;
  4914. this._prevPos = -1;
  4915. this.position = null;
  4916. this._stepPosition = this._prevPosition = 0;
  4917. this.passive = !1;
  4918. this.initialize(b, a, c)
  4919. }
  4920. __extends(a, d);
  4921. a.get = function(b, c, d, e) {
  4922. "undefined" === typeof c && (c = null);
  4923. "undefined" === typeof d && (d = null);
  4924. "undefined" === typeof e && (e = !1);
  4925. e && a.removeTweens(b);
  4926. return new a(b, c, d)
  4927. };
  4928. a.removeTweens = function(b) {
  4929. if (b.tween_count) {
  4930. for (var c = a._tweens,
  4931. d = c.length - 1; 0 <= d; d--) c[d]._target == b && (c[d].paused = !0, c.splice(d, 1));
  4932. b.tween_count = 0
  4933. }
  4934. };
  4935. a.tick = function(b, c) {
  4936. "undefined" === typeof c && (c = !1);
  4937. for (var d = a._tweens.concat(), e = d.length - 1; 0 <= e; e--) {
  4938. var g = d[e];
  4939. c && !g.ignoreGlobalPause || g.paused || g.tick(g._useTicks ? 1 : b)
  4940. }
  4941. };
  4942. a._register = function(b, k) {
  4943. var d = b._target,
  4944. e = a._tweens;
  4945. if (k) d && (d.tween_count = d.tween_count ? d.tween_count + 1 : 1),
  4946. e.push(b),
  4947. a._inited || (c.Ticker.getInstance().register(a.tick, null), a._inited = !0);
  4948. else for (d && d.tween_count--, d = e.length; d--;) if (e[d] == b) {
  4949. e.splice(d, 1);
  4950. break
  4951. }
  4952. };
  4953. a.removeAllTweens = function() {
  4954. for (var b = a._tweens,
  4955. c = 0,
  4956. d = b.length; c < d; c++) {
  4957. var e = b[c];
  4958. e.paused = !0;
  4959. e._target.tweenjs_count = 0
  4960. }
  4961. b.length = 0
  4962. };
  4963. a.prototype.initialize = function(b, c, d) {
  4964. this._target = b;
  4965. c && (this._useTicks = c.useTicks, this.ignoreGlobalPause = c.ignoreGlobalPause, this.loop = c.loop, c.onChange && this.addEventListener("change", c.onChange, c.onChangeObj), c.override && a.removeTweens(b));
  4966. this.pluginData = d || {};
  4967. this._curQueueProps = {};
  4968. this._initQueueProps = {};
  4969. this._steps = [];
  4970. this._actions = [];
  4971. c && c.paused ? this.paused = !0 : a._register(this, !0);
  4972. c && null != c.position && this.setPosition(c.position, a.NONE)
  4973. };
  4974. a.prototype.setPosition = function(b, a) {
  4975. "undefined" === typeof a && (a = 1);
  4976. 0 > b && (b = 0);
  4977. var c = b,
  4978. d = !1;
  4979. c >= this.duration && (this.loop ? c %= this.duration: (c = this.duration, d = !0));
  4980. if (c == this._prevPos) return d;
  4981. var e = this._prevPos;
  4982. this.position = this._prevPos = c;
  4983. this._prevPosition = b;
  4984. if (this._target) if (d) this._updateTargetProps(null, 1);
  4985. else if (0 < this._steps.length) {
  4986. for (var h = 0,
  4987. l = this._steps.length; h < l && !(this._steps[h].t > c); h++);
  4988. h = this._steps[h - 1];
  4989. this._updateTargetProps(h, (this._stepPosition = c - h.t) / h.d)
  4990. }
  4991. 0 != a && 0 < this._actions.length && (this._useTicks ? this._runActions(c, c) : 1 == a && c < e ? (e != this.duration && this._runActions(e, this.duration), this._runActions(0, c, !0)) : this._runActions(e, c));
  4992. d && this.setPaused(!0);
  4993. this.dispatchEventWith("change");
  4994. return d
  4995. };
  4996. a.prototype._runActions = function(b, a, c) {
  4997. "undefined" === typeof c && (c = !1);
  4998. var d = b,
  4999. e = a,
  5000. h = -1,
  5001. l = this._actions.length,
  5002. n = 1;
  5003. b > a && (d = a, e = b, h = l, l = n = -1);
  5004. for (; (h += n) != l;) {
  5005. a = this._actions[h];
  5006. var p = a.t; (p == e || p > d && p < e || c && p == b) && a.f.apply(a.o, a.p)
  5007. }
  5008. };
  5009. a.prototype._updateTargetProps = function(b, c) {
  5010. var d, e, g, h;
  5011. if (b || 1 != c) {
  5012. if (this.passive = !!b.v) return;
  5013. b.e && (c = b.e(c, 0, 1, 1));
  5014. d = b.p0;
  5015. e = b.p1
  5016. } else this.passive = !1,
  5017. d = e = this._curQueueProps;
  5018. for (var l in this._initQueueProps) {
  5019. null == (g = d[l]) && (d[l] = g = this._initQueueProps[l]);
  5020. null == (h = e[l]) && (e[l] = h = g);
  5021. g = g == h || 0 == c || 1 == c || "number" != typeof g ? 1 == c ? h: g: g + (h - g) * c;
  5022. var n = !1;
  5023. if (h = a._plugins[l]) for (var p = 0,
  5024. q = h.length; p < q; p++) {
  5025. var r = h[p].tween(this, l, g, d, e, c, !!b && d == e, !b);
  5026. r == a.IGNORE ? n = !0 : g = r
  5027. }
  5028. n || (this._target[l] = g)
  5029. }
  5030. };
  5031. a.prototype.setPaused = function(b) {
  5032. this.paused = b;
  5033. a._register(this, !b);
  5034. return this
  5035. };
  5036. a.prototype._cloneProps = function(b) {
  5037. var a = {},
  5038. c;
  5039. for (c in b) a[c] = b[c];
  5040. return a
  5041. };
  5042. a.prototype._addStep = function(b) {
  5043. 0 < b.d && (this._steps.push(b), b.t = this.duration, this.duration += b.d);
  5044. return this
  5045. };
  5046. a.prototype._appendQueueProps = function(b) {
  5047. var c, d, e, g, h, l;
  5048. for (l in b) if (void 0 === this._initQueueProps[l]) {
  5049. d = this._target[l];
  5050. if (c = a._plugins[l]) for (e = 0, g = c.length; e < g; e++) d = c[e].init(this, l, d);
  5051. this._initQueueProps[l] = this._curQueueProps[l] = void 0 === d ? null: d
  5052. }
  5053. for (l in b) {
  5054. d = this._curQueueProps[l];
  5055. if (c = a._plugins[l]) for (h = h || {},
  5056. e = 0, g = c.length; e < g; e++) c[e].step && c[e].step(this, l, d, b[l], h);
  5057. this._curQueueProps[l] = b[l]
  5058. }
  5059. h && this._appendQueueProps(h);
  5060. return this._curQueueProps
  5061. };
  5062. a.prototype._addAction = function(b) {
  5063. b.t = this.duration;
  5064. this._actions.push(b);
  5065. return this
  5066. };
  5067. a.prototype._set = function(b, a) {
  5068. for (var c in b) a[c] = b[c]
  5069. };
  5070. a.prototype.wait = function(b, a) {
  5071. if (null == b || 0 >= b) return this;
  5072. var c = this._cloneProps(this._curQueueProps);
  5073. return this._addStep({
  5074. d: b,
  5075. p0: c,
  5076. p1: c,
  5077. v: a
  5078. })
  5079. };
  5080. a.prototype.to = function(b, a, c) {
  5081. "undefined" === typeof c && (c = void 0);
  5082. if (isNaN(a) || 0 > a) a = 0;
  5083. return this._addStep({
  5084. d: a || 0,
  5085. p0: this._cloneProps(this._curQueueProps),
  5086. e: c,
  5087. p1: this._cloneProps(this._appendQueueProps(b))
  5088. })
  5089. };
  5090. a.prototype.call = function(b, a, c) {
  5091. "undefined" === typeof a && (a = void 0);
  5092. "undefined" === typeof c && (c = void 0);
  5093. return this._addAction({
  5094. f: b,
  5095. p: c ? c: [this],
  5096. o: a ? a: this._target
  5097. })
  5098. };
  5099. a.prototype.set = function(b, a) {
  5100. "undefined" === typeof a && (a = null);
  5101. return this._addAction({
  5102. f: this._set,
  5103. o: this,
  5104. p: [b, a ? a: this._target]
  5105. })
  5106. };
  5107. a.prototype.play = function(b) {
  5108. b || (b = this);
  5109. return this.call(b.setPaused, [!1], b)
  5110. };
  5111. a.prototype.pause = function(b) {
  5112. b || (b = this);
  5113. return this.call(b.setPaused, [!0], b)
  5114. };
  5115. a.prototype.tick = function(b) {
  5116. this.paused || this.setPosition(this._prevPosition + b)
  5117. };
  5118. a.NONE = 0;
  5119. a.LOOP = 1;
  5120. a.REVERSE = 2;
  5121. a._tweens = [];
  5122. a.IGNORE = {};
  5123. a._plugins = {};
  5124. a._inited = !1;
  5125. return a
  5126. } (c.EventDispatcher);
  5127. c.Tween = e;
  5128. e.prototype.__class__ = "egret.Tween"
  5129. })(egret || (egret = {})); (function(c) {
  5130. var e = function() {
  5131. function d() {
  5132. c.Logger.fatal("Ease\u4e0d\u80fd\u88ab\u5b9e\u4f8b\u5316")
  5133. }
  5134. d.get = function(a) { - 1 > a && (a = -1);
  5135. 1 < a && (a = 1);
  5136. return function(b) {
  5137. return 0 == a ? b: 0 > a ? b * (b * -a + 1 + a) : b * ((2 - b) * a + (1 - a))
  5138. }
  5139. };
  5140. d.getPowIn = function(a) {
  5141. return function(b) {
  5142. return Math.pow(b, a)
  5143. }
  5144. };
  5145. d.getPowOut = function(a) {
  5146. return function(b) {
  5147. return 1 - Math.pow(1 - b, a)
  5148. }
  5149. };
  5150. d.getPowInOut = function(a) {
  5151. return function(b) {
  5152. return 1 > (b *= 2) ? 0.5 * Math.pow(b, a) : 1 - 0.5 * Math.abs(Math.pow(2 - b, a))
  5153. }
  5154. };
  5155. d.sineIn = function(a) {
  5156. return 1 - Math.cos(a * Math.PI / 2)
  5157. };
  5158. d.sineOut = function(a) {
  5159. return Math.sin(a * Math.PI / 2)
  5160. };
  5161. d.sineInOut = function(a) {
  5162. return - 0.5 * (Math.cos(Math.PI * a) - 1)
  5163. };
  5164. d.getBackIn = function(a) {
  5165. return function(b) {
  5166. return b * b * ((a + 1) * b - a)
  5167. }
  5168. };
  5169. d.getBackOut = function(a) {
  5170. return function(b) {
  5171. b -= 1;
  5172. return b * b * ((a + 1) * b + a) + 1
  5173. }
  5174. };
  5175. d.getBackInOut = function(a) {
  5176. a *= 1.525;
  5177. return function(b) {
  5178. return 1 > (b *= 2) ? 0.5 * b * b * ((a + 1) * b - a) : 0.5 * ((b -= 2) * b * ((a + 1) * b + a) + 2)
  5179. }
  5180. };
  5181. d.circIn = function(a) {
  5182. return - (Math.sqrt(1 - a * a) - 1)
  5183. };
  5184. d.circOut = function(a) {
  5185. return Math.sqrt(1 - a * a)
  5186. };
  5187. d.circInOut = function(a) {
  5188. return 1 > (a *= 2) ? -0.5 * (Math.sqrt(1 - a * a) - 1) : 0.5 * (Math.sqrt(1 - (a -= 2) * a) + 1)
  5189. };
  5190. d.bounceIn = function(a) {
  5191. return 1 - d.bounceOut(1 - a)
  5192. };
  5193. d.bounceOut = function(a) {
  5194. 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
  5195. };
  5196. d.bounceInOut = function(a) {
  5197. return 0.5 > a ? 0.5 * d.bounceIn(2 * a) : 0.5 * d.bounceOut(2 * a - 1) + 0.5
  5198. };
  5199. d.getElasticIn = function(a, b) {
  5200. var c = 2 * Math.PI;
  5201. return function(d) {
  5202. if (0 == d || 1 == d) return d;
  5203. var e = b / c * Math.asin(1 / a);
  5204. return - (a * Math.pow(2, 10 * (d -= 1)) * Math.sin((d - e) * c / b))
  5205. }
  5206. };
  5207. d.getElasticOut = function(a, b) {
  5208. var c = 2 * Math.PI;
  5209. return function(d) {
  5210. if (0 == d || 1 == d) return d;
  5211. var e = b / c * Math.asin(1 / a);
  5212. return a * Math.pow(2, -10 * d) * Math.sin((d - e) * c / b) + 1
  5213. }
  5214. };
  5215. d.getElasticInOut = function(a, b) {
  5216. var c = 2 * Math.PI;
  5217. return function(d) {
  5218. var e = b / c * Math.asin(1 / a);
  5219. return 1 > (d *= 2) ? -0.5 * a * Math.pow(2, 10 * (d -= 1)) * Math.sin((d - e) * c / b) : a * Math.pow(2, -10 * (d -= 1)) * Math.sin((d - e) * c / b) * 0.5 + 1
  5220. }
  5221. };
  5222. d.quadIn = d.getPowIn(2);
  5223. d.quadOut = d.getPowOut(2);
  5224. d.quadInOut = d.getPowInOut(2);
  5225. d.cubicIn = d.getPowIn(3);
  5226. d.cubicOut = d.getPowOut(3);
  5227. d.cubicInOut = d.getPowInOut(3);
  5228. d.quartIn = d.getPowIn(4);
  5229. d.quartOut = d.getPowOut(4);
  5230. d.quartInOut = d.getPowInOut(4);
  5231. d.quintIn = d.getPowIn(5);
  5232. d.quintOut = d.getPowOut(5);
  5233. d.quintInOut = d.getPowInOut(5);
  5234. d.backIn = d.getBackIn(1.7);
  5235. d.backOut = d.getBackOut(1.7);
  5236. d.backInOut = d.getBackInOut(1.7);
  5237. d.elasticIn = d.getElasticIn(1, 0.3);
  5238. d.elasticOut = d.getElasticOut(1, 0.3);
  5239. d.elasticInOut = d.getElasticInOut(1, 0.3 * 1.5);
  5240. return d
  5241. } ();
  5242. c.Ease = e;
  5243. e.prototype.__class__ = "egret.Ease"
  5244. })(egret || (egret = {})); (function(c) {
  5245. var e = function() {
  5246. function c() {}
  5247. c.prototype.play = function(a) {
  5248. "undefined" === typeof a && (a = !1);
  5249. var b = this.audio;
  5250. b && (isNaN(b.duration) || (b.currentTime = 0), b.loop = a, b.play())
  5251. };
  5252. c.prototype.pause = function() {
  5253. var a = this.audio;
  5254. a && a.pause()
  5255. };
  5256. c.prototype.load = function() {
  5257. var a = this.audio;
  5258. a && a.load()
  5259. };
  5260. c.prototype.addEventListener = function(a, b) {
  5261. this.audio && this.audio.addEventListener(a, b, !1)
  5262. };
  5263. c.prototype.removeEventListener = function(a, b) {
  5264. this.audio && this.audio.removeEventListener(a, b, !1)
  5265. };
  5266. c.prototype.setVolume = function(a) {
  5267. var b = this.audio;
  5268. b && (b.volume = a)
  5269. };
  5270. c.prototype.getVolume = function() {
  5271. return this.audio ? this.audio.volume: 0
  5272. };
  5273. return c
  5274. } ();
  5275. c.Sound = e;
  5276. e.prototype.__class__ = "egret.Sound"
  5277. })(egret || (egret = {}));
  5278. __extends = this.__extends ||
  5279. function(c, e) {
  5280. function d() {
  5281. this.constructor = c
  5282. }
  5283. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  5284. d.prototype = e.prototype;
  5285. c.prototype = new d
  5286. }; (function(c) {
  5287. var e = function(d) {
  5288. function a(b) {
  5289. "undefined" === typeof b && (b = null);
  5290. d.call(this);
  5291. this._source = b ? b: []
  5292. }
  5293. __extends(a, d);
  5294. Object.defineProperty(a.prototype, "source", {
  5295. get: function() {
  5296. return this._source
  5297. },
  5298. set: function(b) {
  5299. b || (b = []);
  5300. this._source = b;
  5301. this.dispatchCoEvent(c.CollectionEventKind.RESET)
  5302. },
  5303. enumerable: !0,
  5304. configurable: !0
  5305. });
  5306. a.prototype.refresh = function() {
  5307. this.dispatchCoEvent(c.CollectionEventKind.REFRESH)
  5308. };
  5309. a.prototype.contains = function(b) {
  5310. return - 1 != this.getItemIndex(b)
  5311. };
  5312. a.prototype.checkIndex = function(b) {
  5313. if (0 > b || b >= this._source.length) throw new RangeError('\u7d22\u5f15:"' + b + '"\u8d85\u51fa\u96c6\u5408\u5143\u7d20\u7d22\u5f15\u8303\u56f4');
  5314. };
  5315. Object.defineProperty(a.prototype, "length", {
  5316. get: function() {
  5317. return this._source.length
  5318. },
  5319. enumerable: !0,
  5320. configurable: !0
  5321. });
  5322. a.prototype.addItem = function(b) {
  5323. this._source.push(b);
  5324. this.dispatchCoEvent(c.CollectionEventKind.ADD, this._source.length - 1, -1, [b])
  5325. };
  5326. a.prototype.addItemAt = function(b, a) {
  5327. if (0 > a || a > this._source.length) throw new RangeError('\u7d22\u5f15:"' + a + '"\u8d85\u51fa\u96c6\u5408\u5143\u7d20\u7d22\u5f15\u8303\u56f4');
  5328. this._source.splice(a, 0, b);
  5329. this.dispatchCoEvent(c.CollectionEventKind.ADD, a, -1, [b])
  5330. };
  5331. a.prototype.getItemAt = function(b) {
  5332. return this._source[b]
  5333. };
  5334. a.prototype.getItemIndex = function(b) {
  5335. for (var a = this._source.length,
  5336. c = 0; c < a; c++) if (this._source[c] === b) return c;
  5337. return - 1
  5338. };
  5339. a.prototype.itemUpdated = function(b) {
  5340. var a = this.getItemIndex(b); - 1 != a && this.dispatchCoEvent(c.CollectionEventKind.UPDATE, a, -1, [b])
  5341. };
  5342. a.prototype.removeAll = function() {
  5343. var b = this._source.concat();
  5344. this._source.length = 0;
  5345. this.dispatchCoEvent(c.CollectionEventKind.REMOVE, 0, -1, b)
  5346. };
  5347. a.prototype.removeItemAt = function(b) {
  5348. this.checkIndex(b);
  5349. var a = this._source.splice(b, 1)[0];
  5350. this.dispatchCoEvent(c.CollectionEventKind.REMOVE, b, -1, [a]);
  5351. return a
  5352. };
  5353. a.prototype.replaceItemAt = function(b, a) {
  5354. this.checkIndex(a);
  5355. var d = this._source.splice(a, 1, b)[0];
  5356. this.dispatchCoEvent(c.CollectionEventKind.REPLACE, a, -1, [b], [d]);
  5357. return d
  5358. };
  5359. a.prototype.replaceAll = function(b) {
  5360. b || (b = []);
  5361. for (var a = b.length,
  5362. c = this._source.length,
  5363. d = a; d < c; d++) this.removeItemAt(a);
  5364. for (d = 0; d < a; d++) d >= c ? this.addItemAt(b[d], d) : this.replaceItemAt(b[d], d);
  5365. this._source = b
  5366. };
  5367. a.prototype.moveItemAt = function(b, a) {
  5368. this.checkIndex(b);
  5369. this.checkIndex(a);
  5370. var d = this._source.splice(b, 1)[0];
  5371. this._source.splice(a, 0, d);
  5372. this.dispatchCoEvent(c.CollectionEventKind.MOVE, a, b, [d]);
  5373. return d
  5374. };
  5375. a.prototype.dispatchCoEvent = function(b, a, d, e, g) {
  5376. "undefined" === typeof b && (b = null);
  5377. "undefined" === typeof a && (a = -1);
  5378. "undefined" === typeof d && (d = -1);
  5379. "undefined" === typeof e && (e = null);
  5380. "undefined" === typeof g && (g = null);
  5381. c.CollectionEvent.dispatchCollectionEvent(this, c.CollectionEvent.COLLECTION_CHANGE, b, a, d, e, g)
  5382. };
  5383. return a
  5384. } (c.EventDispatcher);
  5385. c.ArrayCollection = e;
  5386. e.prototype.__class__ = "egret.ArrayCollection"
  5387. })(egret || (egret = {}));
  5388. __extends = this.__extends ||
  5389. function(c, e) {
  5390. function d() {
  5391. this.constructor = c
  5392. }
  5393. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  5394. d.prototype = e.prototype;
  5395. c.prototype = new d
  5396. }; (function(c) {
  5397. var e = function(d) {
  5398. function a(b, a) {
  5399. "undefined" === typeof b && (b = "children");
  5400. "undefined" === typeof a && (a = "parent");
  5401. d.call(this);
  5402. this.nodeList = [];
  5403. this._openNodes = [];
  5404. this._showRoot = !1;
  5405. this.childrenKey = b;
  5406. this.parentKey = a
  5407. }
  5408. __extends(a, d);
  5409. Object.defineProperty(a.prototype, "source", {
  5410. get: function() {
  5411. return this._source
  5412. },
  5413. set: function(b) {
  5414. this._source = b;
  5415. this._openNodes = [];
  5416. this.nodeList = [];
  5417. this._source && (this._showRoot ? this.nodeList.push(this._source) : (this._openNodes = [this._source], this.addChildren(this._source, this.nodeList)));
  5418. this.dispatchCoEvent(c.CollectionEventKind.RESET)
  5419. },
  5420. enumerable: !0,
  5421. configurable: !0
  5422. });
  5423. Object.defineProperty(a.prototype, "openNodes", {
  5424. get: function() {
  5425. return this._openNodes.concat()
  5426. },
  5427. set: function(b) {
  5428. this._openNodes = b ? b.concat() : [];
  5429. this.refresh()
  5430. },
  5431. enumerable: !0,
  5432. configurable: !0
  5433. });
  5434. Object.defineProperty(a.prototype, "length", {
  5435. get: function() {
  5436. return this.nodeList.length
  5437. },
  5438. enumerable: !0,
  5439. configurable: !0
  5440. });
  5441. a.prototype.getItemAt = function(b) {
  5442. return this.nodeList[b]
  5443. };
  5444. a.prototype.getItemIndex = function(b) {
  5445. for (var a = this.nodeList.length,
  5446. c = 0; c < a; c++) if (this.nodeList[c] === b) return c;
  5447. return - 1
  5448. };
  5449. a.prototype.itemUpdated = function(b) {
  5450. var a = this.getItemIndex(b); - 1 != a && this.dispatchCoEvent(c.CollectionEventKind.UPDATE, a, -1, [b])
  5451. };
  5452. a.prototype.removeItem = function(b) {
  5453. this.isItemOpen(b) && this.closeNode(b);
  5454. if (b) {
  5455. var a = b[this.parentKey];
  5456. if (a && (a = a[this.childrenKey])) {
  5457. var d = a.indexOf(b); - 1 != d && a.splice(d, 1);
  5458. b[this.parentKey] = null;
  5459. d = this.nodeList.indexOf(b); - 1 != d && (this.nodeList.splice(d, 1), this.dispatchCoEvent(c.CollectionEventKind.REMOVE, d, -1, [b]))
  5460. }
  5461. }
  5462. };
  5463. Object.defineProperty(a.prototype, "showRoot", {
  5464. get: function() {
  5465. return this._showRoot
  5466. },
  5467. set: function(b) {
  5468. this._showRoot != b && (this._showRoot = b, this._source && (this._showRoot ? this.nodeList.splice(0, 0, this._source) : (this.nodeList.shift(), -1 == this.openNodes.indexOf(this._source) && this.openNodes.push(this._source)), this.refresh()))
  5469. },
  5470. enumerable: !0,
  5471. configurable: !0
  5472. });
  5473. a.prototype.addChildren = function(b, a) {
  5474. if (b.hasOwnProperty(this.childrenKey) && -1 != this._openNodes.indexOf(b)) for (var c = b[this.childrenKey], d = c.length, e = 0; e < d; e++) {
  5475. var h = c[e];
  5476. a.push(h);
  5477. this.addChildren(h, a)
  5478. }
  5479. };
  5480. a.prototype.hasChildren = function(b) {
  5481. return b.hasOwnProperty(this.childrenKey) ? 0 < b[this.childrenKey].length: !1
  5482. };
  5483. a.prototype.isItemOpen = function(b) {
  5484. return - 1 != this._openNodes.indexOf(b)
  5485. };
  5486. a.prototype.expandItem = function(b, a) {
  5487. "undefined" === typeof a && (a = !0);
  5488. a ? this.openNode(b) : this.closeNode(b)
  5489. };
  5490. a.prototype.openNode = function(b) {
  5491. if ( - 1 == this._openNodes.indexOf(b)) {
  5492. this._openNodes.push(b);
  5493. var a = this.nodeList.indexOf(b);
  5494. if ( - 1 != a) {
  5495. var d = [];
  5496. this.addChildren(b, d);
  5497. for (var e = a; d.length;) {
  5498. e++;
  5499. var g = d.shift();
  5500. this.nodeList.splice(e, 0, g);
  5501. this.dispatchCoEvent(c.CollectionEventKind.ADD, e, -1, [g])
  5502. }
  5503. this.dispatchCoEvent("open", a, a, [b])
  5504. }
  5505. }
  5506. };
  5507. a.prototype.closeNode = function(b) {
  5508. var a = this._openNodes.indexOf(b);
  5509. if ( - 1 != a) {
  5510. var d = [];
  5511. this.addChildren(b, d);
  5512. this._openNodes.splice(a, 1);
  5513. a = this.nodeList.indexOf(b);
  5514. if ( - 1 != a) {
  5515. for (a++; d.length;) {
  5516. var e = this.nodeList.splice(a, 1)[0];
  5517. this.dispatchCoEvent(c.CollectionEventKind.REMOVE, a, -1, [e]);
  5518. d.shift()
  5519. }
  5520. a--;
  5521. this.dispatchCoEvent(c.CollectionEventKind.CLOSE, a, a, [b])
  5522. }
  5523. }
  5524. };
  5525. a.prototype.getDepth = function(b) {
  5526. var a = 0;
  5527. for (b = b[this.parentKey]; b;) a++,
  5528. b = b[this.parentKey];
  5529. 0 < a && !this._showRoot && a--;
  5530. return a
  5531. };
  5532. a.prototype.refresh = function() {
  5533. this.nodeList = [];
  5534. this._source && (this._showRoot && this.nodeList.push(this._source), this.addChildren(this._source, this.nodeList));
  5535. this.dispatchCoEvent(c.CollectionEventKind.REFRESH)
  5536. };
  5537. a.prototype.dispatchCoEvent = function(b, a, d, e, g) {
  5538. "undefined" === typeof b && (b = null);
  5539. "undefined" === typeof a && (a = -1);
  5540. "undefined" === typeof d && (d = -1);
  5541. "undefined" === typeof e && (e = null);
  5542. "undefined" === typeof g && (g = null);
  5543. c.CollectionEvent.dispatchCollectionEvent(this, c.CollectionEvent.COLLECTION_CHANGE, b, a, d, e, g)
  5544. };
  5545. a.assignParent = function(b, c, d) {
  5546. "undefined" === typeof c && (c = "children");
  5547. "undefined" === typeof d && (d = "parent");
  5548. if (b.hasOwnProperty(c)) for (var e = b[c], g = e.length, h = 0; h < g; h++) {
  5549. var l = e[h];
  5550. try {
  5551. l[d] = b
  5552. } catch(n) {}
  5553. a.assignParent(l, c, d)
  5554. }
  5555. };
  5556. return a
  5557. } (c.EventDispatcher);
  5558. c.ObjectCollection = e;
  5559. e.prototype.__class__ = "egret.ObjectCollection"
  5560. })(egret || (egret = {}));
  5561. __extends = this.__extends ||
  5562. function(c, e) {
  5563. function d() {
  5564. this.constructor = c
  5565. }
  5566. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  5567. d.prototype = e.prototype;
  5568. c.prototype = new d
  5569. }; (function(c) {
  5570. var e = function(d) {
  5571. function a() {
  5572. d.call(this);
  5573. this.targetLevel = Number.MAX_VALUE;
  5574. this.updateCompleteQueue = new c.DepthQueue;
  5575. this.invalidateClientPropertiesFlag = this.invalidatePropertiesFlag = !1;
  5576. this.invalidatePropertiesQueue = new c.DepthQueue;
  5577. this.invalidateClientSizeFlag = this.invalidateSizeFlag = !1;
  5578. this.invalidateSizeQueue = new c.DepthQueue;
  5579. this.invalidateDisplayListFlag = !1;
  5580. this.invalidateDisplayListQueue = new c.DepthQueue;
  5581. this.listenersAttached = !1
  5582. }
  5583. __extends(a, d);
  5584. a.prototype.invalidateProperties = function(b) {
  5585. this.invalidatePropertiesFlag || (this.invalidatePropertiesFlag = !0, this.listenersAttached || this.attachListeners());
  5586. this.targetLevel <= b.nestLevel && (this.invalidateClientPropertiesFlag = !0);
  5587. this.invalidatePropertiesQueue.insert(b)
  5588. };
  5589. a.prototype.validateProperties = function() {
  5590. for (var b = this.invalidatePropertiesQueue.shift(); b;) b.parent && (b.validateProperties(), b.updateCompletePendingFlag || (this.updateCompleteQueue.insert(b), b.updateCompletePendingFlag = !0)),
  5591. b = this.invalidatePropertiesQueue.shift();
  5592. this.invalidatePropertiesQueue.isEmpty() && (this.invalidatePropertiesFlag = !1)
  5593. };
  5594. a.prototype.invalidateSize = function(b) {
  5595. this.invalidateSizeFlag || (this.invalidateSizeFlag = !0, this.listenersAttached || this.attachListeners());
  5596. this.targetLevel <= b.nestLevel && (this.invalidateClientSizeFlag = !0);
  5597. this.invalidateSizeQueue.insert(b)
  5598. };
  5599. a.prototype.validateSize = function() {
  5600. for (var b = this.invalidateSizeQueue.pop(); b;) b.parent && (b.validateSize(), b.updateCompletePendingFlag || (this.updateCompleteQueue.insert(b), b.updateCompletePendingFlag = !0)),
  5601. b = this.invalidateSizeQueue.pop();
  5602. this.invalidateSizeQueue.isEmpty() && (this.invalidateSizeFlag = !1)
  5603. };
  5604. a.prototype.invalidateDisplayList = function(b) {
  5605. this.invalidateDisplayListFlag || (this.invalidateDisplayListFlag = !0, this.listenersAttached || this.attachListeners());
  5606. this.invalidateDisplayListQueue.insert(b)
  5607. };
  5608. a.prototype.validateDisplayList = function() {
  5609. for (var b = this.invalidateDisplayListQueue.shift(); b;) b.parent && (b.validateDisplayList(), b.updateCompletePendingFlag || (this.updateCompleteQueue.insert(b), b.updateCompletePendingFlag = !0)),
  5610. b = this.invalidateDisplayListQueue.shift();
  5611. this.invalidateDisplayListQueue.isEmpty() && (this.invalidateDisplayListFlag = !1)
  5612. };
  5613. a.prototype.attachListeners = function() {
  5614. c.UIGlobals.stage.addEventListener(c.Event.ENTER_FRAME, this.doPhasedInstantiationCallBack, this);
  5615. c.UIGlobals.stage.addEventListener(c.Event.RENDER, this.doPhasedInstantiationCallBack, this);
  5616. c.UIGlobals.stage.invalidate();
  5617. this.listenersAttached = !0
  5618. };
  5619. a.prototype.doPhasedInstantiationCallBack = function(b) {
  5620. c.UIGlobals.stage.removeEventListener(c.Event.ENTER_FRAME, this.doPhasedInstantiationCallBack, this);
  5621. c.UIGlobals.stage.removeEventListener(c.Event.RENDER, this.doPhasedInstantiationCallBack, this);
  5622. this.doPhasedInstantiation()
  5623. };
  5624. a.prototype.doPhasedInstantiation = function() {
  5625. this.invalidatePropertiesFlag && this.validateProperties();
  5626. this.invalidateSizeFlag && this.validateSize();
  5627. this.invalidateDisplayListFlag && this.validateDisplayList();
  5628. if (this.invalidatePropertiesFlag || this.invalidateSizeFlag || this.invalidateDisplayListFlag) this.attachListeners();
  5629. else {
  5630. this.listenersAttached = !1;
  5631. for (var b = this.updateCompleteQueue.pop(); b;) b.initialized || (b.initialized = !0),
  5632. b.hasEventListener(c.UIEvent.UPDATE_COMPLETE) && c.UIEvent.dispatchUIEvent(b, c.UIEvent.UPDATE_COMPLETE),
  5633. b.updateCompletePendingFlag = !1,
  5634. b = this.updateCompleteQueue.pop();
  5635. c.UIEvent.dispatchUIEvent(this, c.UIEvent.UPDATE_COMPLETE)
  5636. }
  5637. };
  5638. a.prototype.validateNow = function() {
  5639. for (var b = 0; this.listenersAttached && 100 > b++;) this.doPhasedInstantiationCallBack()
  5640. };
  5641. a.prototype.validateClient = function(b, a) {
  5642. "undefined" === typeof a && (a = !1);
  5643. var d, e = !1,
  5644. g = this.targetLevel;
  5645. this.targetLevel == Number.MAX_VALUE && (this.targetLevel = b.nestLevel);
  5646. for (; ! e;) {
  5647. e = !0;
  5648. for (d = this.invalidatePropertiesQueue.removeSmallestChild(b); d;) d.parent && (d.validateProperties(), d.updateCompletePendingFlag || (this.updateCompleteQueue.insert(d), d.updateCompletePendingFlag = !0)),
  5649. d = this.invalidatePropertiesQueue.removeSmallestChild(b);
  5650. this.invalidatePropertiesQueue.isEmpty() && (this.invalidatePropertiesFlag = !1);
  5651. this.invalidateClientPropertiesFlag = !1;
  5652. for (d = this.invalidateSizeQueue.removeLargestChild(b); d;) {
  5653. d.parent && (d.validateSize(), d.updateCompletePendingFlag || (this.updateCompleteQueue.insert(d), d.updateCompletePendingFlag = !0));
  5654. if (this.invalidateClientPropertiesFlag && (d = this.invalidatePropertiesQueue.removeSmallestChild(b))) {
  5655. this.invalidatePropertiesQueue.insert(d);
  5656. e = !1;
  5657. break
  5658. }
  5659. d = this.invalidateSizeQueue.removeLargestChild(b)
  5660. }
  5661. this.invalidateSizeQueue.isEmpty() && (this.invalidateSizeFlag = !1);
  5662. this.invalidateClientSizeFlag = this.invalidateClientPropertiesFlag = !1;
  5663. if (!a) {
  5664. for (d = this.invalidateDisplayListQueue.removeSmallestChild(b); d;) {
  5665. d.parent && (d.validateDisplayList(), d.updateCompletePendingFlag || (this.updateCompleteQueue.insert(d), d.updateCompletePendingFlag = !0));
  5666. if (this.invalidateClientPropertiesFlag && (d = this.invalidatePropertiesQueue.removeSmallestChild(b))) {
  5667. this.invalidatePropertiesQueue.insert(d);
  5668. e = !1;
  5669. break
  5670. }
  5671. if (this.invalidateClientSizeFlag && (d = this.invalidateSizeQueue.removeLargestChild(b))) {
  5672. this.invalidateSizeQueue.insert(d);
  5673. e = !1;
  5674. break
  5675. }
  5676. d = this.invalidateDisplayListQueue.removeSmallestChild(b)
  5677. }
  5678. this.invalidateDisplayListQueue.isEmpty() && (this.invalidateDisplayListFlag = !1)
  5679. }
  5680. }
  5681. if (g == Number.MAX_VALUE && (this.targetLevel = Number.MAX_VALUE, !a)) for (d = this.updateCompleteQueue.removeLargestChild(b); d;) d.initialized || (d.initialized = !0),
  5682. d.hasEventListener(c.UIEvent.UPDATE_COMPLETE) && c.UIEvent.dispatchUIEvent(d, c.UIEvent.UPDATE_COMPLETE),
  5683. d.updateCompletePendingFlag = !1,
  5684. d = this.updateCompleteQueue.removeLargestChild(b)
  5685. };
  5686. return a
  5687. } (c.EventDispatcher);
  5688. c.LayoutManager = e;
  5689. e.prototype.__class__ = "egret.LayoutManager"
  5690. })(egret || (egret = {})); (function(c) {
  5691. var e = function() {
  5692. function a() {
  5693. this.depthBins = [];
  5694. this.minDepth = 0;
  5695. this.maxDepth = -1
  5696. }
  5697. a.prototype.insert = function(b) {
  5698. var a = b.nestLevel,
  5699. c = b.hashCode;
  5700. this.maxDepth < this.minDepth ? this.minDepth = this.maxDepth = a: (a < this.minDepth && (this.minDepth = a), a > this.maxDepth && (this.maxDepth = a));
  5701. var e = this.depthBins[a];
  5702. e ? null == e.items[c] && (e.items[c] = b, e.length++) : (e = new d, this.depthBins[a] = e, e.items[c] = b, e.length++)
  5703. };
  5704. a.prototype.pop = function() {
  5705. var b = null;
  5706. if (this.minDepth <= this.maxDepth) {
  5707. for (var a = this.depthBins[this.maxDepth]; ! a || 0 == a.length;) {
  5708. this.maxDepth--;
  5709. if (this.maxDepth < this.minDepth) return null;
  5710. a = this.depthBins[this.maxDepth]
  5711. }
  5712. var c = a.items,
  5713. d;
  5714. for (d in c) {
  5715. b = c[d];
  5716. this.remove(b, this.maxDepth);
  5717. break
  5718. }
  5719. for (; ! a || 0 == a.length;) {
  5720. this.maxDepth--;
  5721. if (this.maxDepth < this.minDepth) break;
  5722. a = this.depthBins[this.maxDepth]
  5723. }
  5724. }
  5725. return b
  5726. };
  5727. a.prototype.shift = function() {
  5728. var b = null;
  5729. if (this.minDepth <= this.maxDepth) {
  5730. for (var a = this.depthBins[this.minDepth]; ! a || 0 == a.length;) {
  5731. this.minDepth++;
  5732. if (this.minDepth > this.maxDepth) return null;
  5733. a = this.depthBins[this.minDepth]
  5734. }
  5735. var c = a.items,
  5736. d;
  5737. for (d in c) {
  5738. b = c[d];
  5739. this.remove(b, this.minDepth);
  5740. break
  5741. }
  5742. for (; ! a || 0 == a.length;) {
  5743. this.minDepth++;
  5744. if (this.minDepth > this.maxDepth) break;
  5745. a = this.depthBins[this.minDepth]
  5746. }
  5747. }
  5748. return b
  5749. };
  5750. a.prototype.removeLargestChild = function(b) {
  5751. for (var a = this.maxDepth,
  5752. d = b.nestLevel,
  5753. e = b.hashCode; d <= a;) {
  5754. var g = this.depthBins[a];
  5755. if (g && 0 < g.length) {
  5756. if (a == b.nestLevel) {
  5757. if (g.items[e]) return this.remove(b, a),
  5758. b
  5759. } else {
  5760. var g = g.items,
  5761. h;
  5762. for (h in g) {
  5763. var l = g[h];
  5764. if (l instanceof c.DisplayObject && b instanceof c.DisplayObjectContainer && b.contains(l)) return this.remove(l, a),
  5765. l
  5766. }
  5767. }
  5768. a--
  5769. } else if (a == this.maxDepth && this.maxDepth--, a--, a < d) break
  5770. }
  5771. return null
  5772. };
  5773. a.prototype.removeSmallestChild = function(b) {
  5774. for (var a = b.nestLevel,
  5775. d = b.hashCode; a <= this.maxDepth;) {
  5776. var e = this.depthBins[a];
  5777. if (e && 0 < e.length) {
  5778. if (a == b.nestLevel) {
  5779. if (e.items[d]) return this.remove(b, a),
  5780. b
  5781. } else {
  5782. var e = e.items,
  5783. g;
  5784. for (g in e) {
  5785. var h = e[g];
  5786. if (h instanceof c.DisplayObject && b instanceof c.DisplayObjectContainer && b.contains(h)) return this.remove(h, a),
  5787. h
  5788. }
  5789. }
  5790. a++
  5791. } else if (a == this.minDepth && this.minDepth++, a++, a > this.maxDepth) break
  5792. }
  5793. return null
  5794. };
  5795. a.prototype.remove = function(b, a) {
  5796. "undefined" === typeof a && (a = -1);
  5797. var c = b.hashCode,
  5798. d = this.depthBins[0 <= a ? a: b.nestLevel];
  5799. return d && null != d.items[c] ? (delete d.items[c], d.length--, b) : null
  5800. };
  5801. a.prototype.removeAll = function() {
  5802. this.minDepth = this.depthBins.length = 0;
  5803. this.maxDepth = -1
  5804. };
  5805. a.prototype.isEmpty = function() {
  5806. return this.minDepth > this.maxDepth
  5807. };
  5808. return a
  5809. } ();
  5810. c.DepthQueue = e;
  5811. e.prototype.__class__ = "egret.DepthQueue";
  5812. var d = function() {
  5813. return function() {
  5814. this.length = 0;
  5815. this.items = []
  5816. }
  5817. } ();
  5818. c.DepthBin = d;
  5819. d.prototype.__class__ = "egret.DepthBin"
  5820. })(egret || (egret = {})); (function(c) {
  5821. var e = function() {
  5822. function d() {}
  5823. Object.defineProperty(d, "stage", {
  5824. get: function() {
  5825. return d._stage
  5826. },
  5827. enumerable: !0,
  5828. configurable: !0
  5829. });
  5830. d._initlize = function(a) {
  5831. d.initlized || (d._stage = a, d._layoutManager = new c.LayoutManager, d.initlized = !0)
  5832. };
  5833. Object.defineProperty(d, "uiStage", {
  5834. get: function() {
  5835. return d._uiStage
  5836. },
  5837. enumerable: !0,
  5838. configurable: !0
  5839. });
  5840. d.initlized = !1;
  5841. return d
  5842. } ();
  5843. c.UIGlobals = e;
  5844. e.prototype.__class__ = "egret.UIGlobals"
  5845. })(egret || (egret = {}));
  5846. __extends = this.__extends ||
  5847. function(c, e) {
  5848. function d() {
  5849. this.constructor = c
  5850. }
  5851. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  5852. d.prototype = e.prototype;
  5853. c.prototype = new d
  5854. }; (function(c) {
  5855. var e = function(d) {
  5856. function a() {
  5857. d.call(this);
  5858. this.initializeCalled = this._initialized = this._updateCompletePendingFlag = !1;
  5859. this._nestLevel = 0;
  5860. this._enabled = !0;
  5861. this._minWidth = this._height = this._width = 0;
  5862. this._maxWidth = 1E4;
  5863. this._minHeight = 0;
  5864. this._maxHeight = 1E4;
  5865. this._measuredHeight = this._measuredWidth = 0;
  5866. this._validateNowFlag = this._invalidateDisplayListFlag = this._invalidateSizeFlag = this._invalidatePropertiesFlag = !1;
  5867. this._includeInLayout = !0;
  5868. this._layoutHeightExplicitlySet = this._layoutWidthExplicitlySet = !1;
  5869. this.touchEnabled = !0;
  5870. this.addEventListener(c.Event.ADDED_TO_STAGE, this.onAddedToStage, this);
  5871. this.addEventListener(c.Event.ADDED_TO_STAGE, this.checkInvalidateFlag, this)
  5872. }
  5873. __extends(a, d);
  5874. a.prototype.onAddedToStage = function(b) {
  5875. this.removeEventListener(c.Event.ADDED_TO_STAGE, this.onAddedToStage, this);
  5876. this._initialize();
  5877. c.UIGlobals._initlize(this.stage);
  5878. 0 < this._nestLevel && this.checkInvalidateFlag()
  5879. };
  5880. Object.defineProperty(a.prototype, "id", {
  5881. get: function() {
  5882. return this._id
  5883. },
  5884. set: function(b) {
  5885. this._id = b
  5886. },
  5887. enumerable: !0,
  5888. configurable: !0
  5889. });
  5890. Object.defineProperty(a.prototype, "isPopUp", {
  5891. get: function() {
  5892. return this._isPopUp
  5893. },
  5894. set: function(b) {
  5895. this._isPopUp = b
  5896. },
  5897. enumerable: !0,
  5898. configurable: !0
  5899. });
  5900. Object.defineProperty(a.prototype, "owner", {
  5901. get: function() {
  5902. return this._owner ? this._owner: this.parent
  5903. },
  5904. enumerable: !0,
  5905. configurable: !0
  5906. });
  5907. a.prototype.ownerChanged = function(b) {
  5908. this._owner = b
  5909. };
  5910. Object.defineProperty(a.prototype, "updateCompletePendingFlag", {
  5911. get: function() {
  5912. return this._updateCompletePendingFlag
  5913. },
  5914. set: function(b) {
  5915. this._updateCompletePendingFlag = b
  5916. },
  5917. enumerable: !0,
  5918. configurable: !0
  5919. });
  5920. Object.defineProperty(a.prototype, "initialized", {
  5921. get: function() {
  5922. return this._initialized
  5923. },
  5924. set: function(b) {
  5925. this._initialized != b && (this._initialized = b) && c.UIEvent.dispatchUIEvent(this, c.UIEvent.CREATION_COMPLETE)
  5926. },
  5927. enumerable: !0,
  5928. configurable: !0
  5929. });
  5930. a.prototype._initialize = function() {
  5931. this.initializeCalled || (c.UIGlobals.stage && this.removeEventListener(c.Event.ADDED_TO_STAGE, this.onAddedToStage, this), this.initializeCalled = !0, c.UIEvent.dispatchUIEvent(this, c.UIEvent.INITIALIZE), this.createChildren(), this.childrenCreated())
  5932. };
  5933. a.prototype.createChildren = function() {};
  5934. a.prototype.childrenCreated = function() {
  5935. this.invalidateProperties();
  5936. this.invalidateSize();
  5937. this.invalidateDisplayList()
  5938. };
  5939. Object.defineProperty(a.prototype, "nestLevel", {
  5940. get: function() {
  5941. return this._nestLevel
  5942. },
  5943. set: function(b) {
  5944. if (this._nestLevel != b) for (this._nestLevel = b, 0 == this._nestLevel ? this.addEventListener(c.Event.ADDED_TO_STAGE, this.checkInvalidateFlag, this) : this.removeEventListener(c.Event.ADDED_TO_STAGE, this.checkInvalidateFlag, this), b = this.numChildren - 1; 0 <= b; b--) {
  5945. var a = this.getChildAt(b);
  5946. null != a && (a.nestLevel = this._nestLevel + 1)
  5947. }
  5948. },
  5949. enumerable: !0,
  5950. configurable: !0
  5951. });
  5952. a.prototype._addToDisplayList = function(b, a) {
  5953. "undefined" === typeof a && (a = !0);
  5954. var c = this.numChildren;
  5955. b.parent == this && c--;
  5956. this._addingChild(b);
  5957. this._doAddChild(b, c, a);
  5958. this._childAdded(b);
  5959. return b
  5960. };
  5961. a.prototype._addToDisplayListAt = function(b, a, c) {
  5962. "undefined" === typeof c && (c = !0);
  5963. this._addingChild(b);
  5964. this._doAddChild(b, a, c);
  5965. this._childAdded(b);
  5966. return b
  5967. };
  5968. a.prototype._removeFromDisplayList = function(b, a) {
  5969. "undefined" === typeof a && (a = !0);
  5970. var d = this._children.indexOf(b);
  5971. if (0 <= d) return this._doRemoveChild(d, a),
  5972. this._childRemoved(b),
  5973. b;
  5974. c.Logger.fatal("child\u672a\u88abaddChild\u5230\u8be5parent");
  5975. return null
  5976. };
  5977. a.prototype._removeFromDisplayListAt = function(b, a) {
  5978. "undefined" === typeof a && (a = !0);
  5979. if (0 <= b && b < this._children.length) {
  5980. var d = this._doRemoveChild(b, a);
  5981. this._childRemoved(d);
  5982. return d
  5983. }
  5984. c.Logger.fatal("\u63d0\u4f9b\u7684\u7d22\u5f15\u8d85\u51fa\u8303\u56f4");
  5985. return null
  5986. };
  5987. a.prototype.addChild = function(b) {
  5988. this._addingChild(b);
  5989. d.prototype.addChild.call(this, b);
  5990. this._childAdded(b);
  5991. return b
  5992. };
  5993. a.prototype.addChildAt = function(b, a) {
  5994. this._addingChild(b);
  5995. d.prototype.addChildAt.call(this, b, a);
  5996. this._childAdded(b);
  5997. return b
  5998. };
  5999. a.prototype._addingChild = function(b) {
  6000. b && "nestLevel" in b && (b.nestLevel = this._nestLevel + 1)
  6001. };
  6002. a.prototype._childAdded = function(b) {
  6003. b instanceof a && (b._initialize(), b.checkInvalidateFlag())
  6004. };
  6005. a.prototype.removeChild = function(b) {
  6006. d.prototype.removeChild.call(this, b);
  6007. this._childRemoved(b);
  6008. return b
  6009. };
  6010. a.prototype.removeChildAt = function(b) {
  6011. b = d.prototype.removeChildAt.call(this, b);
  6012. this._childRemoved(b);
  6013. return b
  6014. };
  6015. a.prototype._childRemoved = function(b) {
  6016. b && "nestLevel" in b && (b.nestLevel = 0)
  6017. };
  6018. a.prototype.checkInvalidateFlag = function(b) {
  6019. c.UIGlobals._layoutManager && (this._invalidatePropertiesFlag && c.UIGlobals._layoutManager.invalidateProperties(this), this._invalidateSizeFlag && c.UIGlobals._layoutManager.invalidateSize(this), this._invalidateDisplayListFlag && c.UIGlobals._layoutManager.invalidateDisplayList(this), this._validateNowFlag && (c.UIGlobals._layoutManager.validateClient(this), this._validateNowFlag = !1))
  6020. };
  6021. Object.defineProperty(a.prototype, "enabled", {
  6022. get: function() {
  6023. return this._enabled
  6024. },
  6025. set: function(b) {
  6026. this._enabled = b
  6027. },
  6028. enumerable: !0,
  6029. configurable: !0
  6030. });
  6031. a.prototype._setWidth = function(b) {
  6032. if (this._width != b || this._explicitWidth != b) d.prototype._setWidth.call(this, b),
  6033. isNaN(b) ? this.invalidateSize() : this._width = b,
  6034. this.invalidateProperties(),
  6035. this.invalidateDisplayList(),
  6036. this.invalidateParentSizeAndDisplayList()
  6037. };
  6038. Object.defineProperty(a.prototype, "width", {
  6039. get: function() {
  6040. return this._width
  6041. },
  6042. set: function(b) {
  6043. this._setWidth(b)
  6044. },
  6045. enumerable: !0,
  6046. configurable: !0
  6047. });
  6048. a.prototype._setHeight = function(b) {
  6049. if (this._height != b || this._explicitHeight != b) d.prototype._setHeight.call(this, b),
  6050. isNaN(b) ? this.invalidateSize() : this._height = b,
  6051. this.invalidateProperties(),
  6052. this.invalidateDisplayList(),
  6053. this.invalidateParentSizeAndDisplayList()
  6054. };
  6055. Object.defineProperty(a.prototype, "height", {
  6056. get: function() {
  6057. return this._height
  6058. },
  6059. set: function(b) {
  6060. this._setHeight(b)
  6061. },
  6062. enumerable: !0,
  6063. configurable: !0
  6064. });
  6065. Object.defineProperty(a.prototype, "scaleX", {
  6066. get: function() {
  6067. return this._scaleX
  6068. },
  6069. set: function(b) {
  6070. this._setScaleX(b)
  6071. },
  6072. enumerable: !0,
  6073. configurable: !0
  6074. });
  6075. a.prototype._setScaleX = function(b) {
  6076. this._scaleX != b && (this._scaleX = b, this.invalidateParentSizeAndDisplayList())
  6077. };
  6078. Object.defineProperty(a.prototype, "scaleY", {
  6079. get: function() {
  6080. return this._scaleY
  6081. },
  6082. set: function(b) {
  6083. this._setScaleY(b)
  6084. },
  6085. enumerable: !0,
  6086. configurable: !0
  6087. });
  6088. a.prototype._setScaleY = function(b) {
  6089. this._scaleY != b && (this._scaleY = b, this.invalidateParentSizeAndDisplayList())
  6090. };
  6091. Object.defineProperty(a.prototype, "minWidth", {
  6092. get: function() {
  6093. return this._minWidth
  6094. },
  6095. set: function(b) {
  6096. this._minWidth != b && (this._minWidth = b, this.invalidateSize())
  6097. },
  6098. enumerable: !0,
  6099. configurable: !0
  6100. });
  6101. Object.defineProperty(a.prototype, "maxWidth", {
  6102. get: function() {
  6103. return this._maxWidth
  6104. },
  6105. set: function(b) {
  6106. this._maxWidth != b && (this._maxWidth = b, this.invalidateSize())
  6107. },
  6108. enumerable: !0,
  6109. configurable: !0
  6110. });
  6111. Object.defineProperty(a.prototype, "minHeight", {
  6112. get: function() {
  6113. return this._minHeight
  6114. },
  6115. set: function(b) {
  6116. this._minHeight != b && (this._minHeight = b, this.invalidateSize())
  6117. },
  6118. enumerable: !0,
  6119. configurable: !0
  6120. });
  6121. Object.defineProperty(a.prototype, "maxHeight", {
  6122. get: function() {
  6123. return this._maxHeight
  6124. },
  6125. set: function(b) {
  6126. this._maxHeight != b && (this._maxHeight = b, this.invalidateSize())
  6127. },
  6128. enumerable: !0,
  6129. configurable: !0
  6130. });
  6131. Object.defineProperty(a.prototype, "measuredWidth", {
  6132. get: function() {
  6133. return this._measuredWidth
  6134. },
  6135. set: function(b) {
  6136. this._measuredWidth = b
  6137. },
  6138. enumerable: !0,
  6139. configurable: !0
  6140. });
  6141. Object.defineProperty(a.prototype, "measuredHeight", {
  6142. get: function() {
  6143. return this._measuredHeight
  6144. },
  6145. set: function(b) {
  6146. this._measuredHeight = b
  6147. },
  6148. enumerable: !0,
  6149. configurable: !0
  6150. });
  6151. a.prototype.setActualSize = function(b, a) {
  6152. var c = !1;
  6153. this._width != b && (this._width = b, c = !0);
  6154. this._height != a && (this._height = a, c = !0);
  6155. c && (this.invalidateDisplayList(), this.dispatchResizeEvent())
  6156. };
  6157. Object.defineProperty(a.prototype, "x", {
  6158. get: function() {
  6159. return this._x
  6160. },
  6161. set: function(b) {
  6162. this._x != b && (this._x = b, this.invalidateProperties(), this._includeInLayout && this.parent && this.parent instanceof a && this.parent._childXYChanged())
  6163. },
  6164. enumerable: !0,
  6165. configurable: !0
  6166. });
  6167. Object.defineProperty(a.prototype, "y", {
  6168. get: function() {
  6169. return this._y
  6170. },
  6171. set: function(b) {
  6172. this._y != b && (this._y = b, this.invalidateProperties(), this._includeInLayout && this.parent && this.parent instanceof a && this.parent._childXYChanged())
  6173. },
  6174. enumerable: !0,
  6175. configurable: !0
  6176. });
  6177. a.prototype.invalidateProperties = function() {
  6178. this._invalidatePropertiesFlag || (this._invalidatePropertiesFlag = !0, this.parent && c.UIGlobals._layoutManager && c.UIGlobals._layoutManager.invalidateProperties(this))
  6179. };
  6180. a.prototype.validateProperties = function() {
  6181. this._invalidatePropertiesFlag && (this.commitProperties(), this._invalidatePropertiesFlag = !1)
  6182. };
  6183. a.prototype.invalidateSize = function() {
  6184. this._invalidateSizeFlag || (this._invalidateSizeFlag = !0, this.parent && c.UIGlobals._layoutManager && c.UIGlobals._layoutManager.invalidateSize(this))
  6185. };
  6186. a.prototype.validateSize = function(b) {
  6187. "undefined" === typeof b && (b = !1);
  6188. if (b) for (b = 0; b < this.numChildren; b++) {
  6189. var a = this.getChildAt(b);
  6190. "validateSize" in a && a.validateSize(!0)
  6191. }
  6192. this._invalidateSizeFlag && (this.measureSizes() && (this.invalidateDisplayList(), this.invalidateParentSizeAndDisplayList()), this._invalidateSizeFlag = !1)
  6193. };
  6194. a.prototype.measureSizes = function() {
  6195. var b = !1;
  6196. if (!this._invalidateSizeFlag) return b;
  6197. this.canSkipMeasurement() || (this.measure(), this.measuredWidth < this.minWidth && (this.measuredWidth = this.minWidth), this.measuredWidth > this.maxWidth && (this.measuredWidth = this.maxWidth), this.measuredHeight < this.minHeight && (this.measuredHeight = this.minHeight), this.measuredHeight > this.maxHeight && (this.measuredHeight = this.maxHeight));
  6198. if (isNaN(this._oldPreferWidth)) this._oldPreferWidth = this.preferredWidth,
  6199. this._oldPreferHeight = this.preferredHeight,
  6200. b = !0;
  6201. else {
  6202. if (this.preferredWidth != this._oldPreferWidth || this.preferredHeight != this._oldPreferHeight) b = !0;
  6203. this._oldPreferWidth = this.preferredWidth;
  6204. this._oldPreferHeight = this.preferredHeight
  6205. }
  6206. return b
  6207. };
  6208. a.prototype.invalidateDisplayList = function() {
  6209. this._invalidateDisplayListFlag || (this._invalidateDisplayListFlag = !0, this.parent && c.UIGlobals._layoutManager && c.UIGlobals._layoutManager.invalidateDisplayList(this))
  6210. };
  6211. a.prototype.validateDisplayList = function() {
  6212. if (this._invalidateDisplayListFlag) {
  6213. var b = 0,
  6214. a = 0,
  6215. b = this._layoutWidthExplicitlySet ? this._width: isNaN(this.explicitWidth) ? this.measuredWidth: this._explicitWidth,
  6216. a = this._layoutHeightExplicitlySet ? this._height: isNaN(this.explicitHeight) ? this.measuredHeight: this._explicitHeight;
  6217. isNaN(b) && (b = 0);
  6218. isNaN(a) && (a = 0);
  6219. this.setActualSize(b, a);
  6220. this.updateDisplayList(b, a);
  6221. this._invalidateDisplayListFlag = !1
  6222. }
  6223. };
  6224. a.prototype.validateNow = function(b) {
  6225. "undefined" === typeof b && (b = !1);
  6226. this._validateNowFlag || null == c.UIGlobals._layoutManager ? this._validateNowFlag = !0 : c.UIGlobals._layoutManager.validateClient(this, b)
  6227. };
  6228. a.prototype.invalidateParentSizeAndDisplayList = function() {
  6229. if (this.parent && this._includeInLayout && "invalidateSize" in this.parent) {
  6230. var b = this.parent;
  6231. b.invalidateSize();
  6232. b.invalidateDisplayList()
  6233. }
  6234. };
  6235. a.prototype.updateDisplayList = function(b, a) {};
  6236. a.prototype.canSkipMeasurement = function() {
  6237. return ! isNaN(this._explicitWidth) && !isNaN(this._explicitHeight)
  6238. };
  6239. a.prototype.commitProperties = function() {
  6240. this.oldWidth == this._width && this.oldHeight == this._height || this.dispatchResizeEvent();
  6241. this.oldX == this.x && this.oldY == this.y || this.dispatchMoveEvent()
  6242. };
  6243. a.prototype.measure = function() {
  6244. this._measuredWidth = this._measuredHeight = 0
  6245. };
  6246. a.prototype.dispatchMoveEvent = function() {
  6247. this.hasEventListener(c.MoveEvent.MOVE) && c.MoveEvent.dispatchMoveEvent(this, this.oldX, this.oldY);
  6248. this.oldX = this.x;
  6249. this.oldY = this.y
  6250. };
  6251. a.prototype._childXYChanged = function() {};
  6252. a.prototype.dispatchResizeEvent = function() {
  6253. this.hasEventListener(c.ResizeEvent.RESIZE) && c.ResizeEvent.dispatchResizeEvent(this, this.oldWidth, this.oldHeight);
  6254. this.oldWidth = this._width;
  6255. this.oldHeight = this._height
  6256. };
  6257. Object.defineProperty(a.prototype, "includeInLayout", {
  6258. get: function() {
  6259. return this._includeInLayout
  6260. },
  6261. set: function(b) {
  6262. this._includeInLayout != b && (this._includeInLayout = !0, this.invalidateParentSizeAndDisplayList(), this._includeInLayout = b)
  6263. },
  6264. enumerable: !0,
  6265. configurable: !0
  6266. });
  6267. Object.defineProperty(a.prototype, "left", {
  6268. get: function() {
  6269. return this._left
  6270. },
  6271. set: function(b) {
  6272. this._left != b && (this._left = b, this.invalidateParentSizeAndDisplayList())
  6273. },
  6274. enumerable: !0,
  6275. configurable: !0
  6276. });
  6277. Object.defineProperty(a.prototype, "right", {
  6278. get: function() {
  6279. return this._right
  6280. },
  6281. set: function(b) {
  6282. this._right != b && (this._right = b, this.invalidateParentSizeAndDisplayList())
  6283. },
  6284. enumerable: !0,
  6285. configurable: !0
  6286. });
  6287. Object.defineProperty(a.prototype, "top", {
  6288. get: function() {
  6289. return this._top
  6290. },
  6291. set: function(b) {
  6292. this._top != b && (this._top = b, this.invalidateParentSizeAndDisplayList())
  6293. },
  6294. enumerable: !0,
  6295. configurable: !0
  6296. });
  6297. Object.defineProperty(a.prototype, "bottom", {
  6298. get: function() {
  6299. return this._bottom
  6300. },
  6301. set: function(b) {
  6302. this._bottom != b && (this._bottom = b, this.invalidateParentSizeAndDisplayList())
  6303. },
  6304. enumerable: !0,
  6305. configurable: !0
  6306. });
  6307. Object.defineProperty(a.prototype, "horizontalCenter", {
  6308. get: function() {
  6309. return this._horizontalCenter
  6310. },
  6311. set: function(b) {
  6312. this._horizontalCenter != b && (this._horizontalCenter = b, this.invalidateParentSizeAndDisplayList())
  6313. },
  6314. enumerable: !0,
  6315. configurable: !0
  6316. });
  6317. Object.defineProperty(a.prototype, "verticalCenter", {
  6318. get: function() {
  6319. return this._verticalCenter
  6320. },
  6321. set: function(b) {
  6322. this._verticalCenter != b && (this._verticalCenter = b, this.invalidateParentSizeAndDisplayList())
  6323. },
  6324. enumerable: !0,
  6325. configurable: !0
  6326. });
  6327. Object.defineProperty(a.prototype, "percentWidth", {
  6328. get: function() {
  6329. return this._percentWidth
  6330. },
  6331. set: function(b) {
  6332. this._percentWidth != b && (this._percentWidth = b, this.invalidateParentSizeAndDisplayList())
  6333. },
  6334. enumerable: !0,
  6335. configurable: !0
  6336. });
  6337. Object.defineProperty(a.prototype, "percentHeight", {
  6338. get: function() {
  6339. return this._percentHeight
  6340. },
  6341. set: function(b) {
  6342. this._percentHeight != b && (this._percentHeight = b, this.invalidateParentSizeAndDisplayList())
  6343. },
  6344. enumerable: !0,
  6345. configurable: !0
  6346. });
  6347. a.prototype.setLayoutBoundsSize = function(b, a) {
  6348. isNaN(b) ? (this._layoutWidthExplicitlySet = !1, b = this.preferredWidth) : this._layoutWidthExplicitlySet = !0;
  6349. isNaN(a) ? (this._layoutHeightExplicitlySet = !1, a = this.preferredHeight) : this._layoutHeightExplicitlySet = !0;
  6350. this.setActualSize(b / this._scaleX, a / this._scaleY)
  6351. };
  6352. a.prototype.setLayoutBoundsPosition = function(b, a) {
  6353. 0 > this._scaleX && (b += this.layoutBoundsWidth);
  6354. 0 > this._scaleY && (a += this.layoutBoundsHeight);
  6355. var c = !1;
  6356. this._x != b && (this._x = b, c = !0);
  6357. this._y != a && (this._y = a, c = !0);
  6358. c && this.dispatchMoveEvent()
  6359. };
  6360. Object.defineProperty(a.prototype, "preferredWidth", {
  6361. get: function() {
  6362. var b = this._hasWidthSet ? this._explicitWidth: this._measuredWidth,
  6363. a = this._scaleX;
  6364. 0 > a && (a = -a);
  6365. return b * a
  6366. },
  6367. enumerable: !0,
  6368. configurable: !0
  6369. });
  6370. Object.defineProperty(a.prototype, "preferredHeight", {
  6371. get: function() {
  6372. var b = this._hasHeightSet ? this._explicitHeight: this._measuredHeight,
  6373. a = this._scaleY;
  6374. 0 > a && (a = -a);
  6375. return b * a
  6376. },
  6377. enumerable: !0,
  6378. configurable: !0
  6379. });
  6380. Object.defineProperty(a.prototype, "preferredX", {
  6381. get: function() {
  6382. return 0 <= this._scaleX ? this._x: this._x - this.preferredWidth
  6383. },
  6384. enumerable: !0,
  6385. configurable: !0
  6386. });
  6387. Object.defineProperty(a.prototype, "preferredY", {
  6388. get: function() {
  6389. return 0 <= this._scaleY ? this._y: this._y - this.preferredHeight
  6390. },
  6391. enumerable: !0,
  6392. configurable: !0
  6393. });
  6394. Object.defineProperty(a.prototype, "layoutBoundsX", {
  6395. get: function() {
  6396. return 0 <= this._scaleX ? this._x: this._x - this.layoutBoundsWidth
  6397. },
  6398. enumerable: !0,
  6399. configurable: !0
  6400. });
  6401. Object.defineProperty(a.prototype, "layoutBoundsY", {
  6402. get: function() {
  6403. return 0 <= this._scaleY ? this._y: this._y - this.layoutBoundsHeight
  6404. },
  6405. enumerable: !0,
  6406. configurable: !0
  6407. });
  6408. Object.defineProperty(a.prototype, "layoutBoundsWidth", {
  6409. get: function() {
  6410. var b = 0,
  6411. b = this._layoutWidthExplicitlySet ? this._width: this._hasWidthSet ? this._explicitWidth: this._measuredWidth,
  6412. a = this._scaleX;
  6413. 0 > a && (a = -a);
  6414. return b * a
  6415. },
  6416. enumerable: !0,
  6417. configurable: !0
  6418. });
  6419. Object.defineProperty(a.prototype, "layoutBoundsHeight", {
  6420. get: function() {
  6421. var b = 0,
  6422. b = this._layoutHeightExplicitlySet ? this._height: this._hasHeightSet ? this._explicitHeight: this._measuredHeight,
  6423. a = this.scaleY;
  6424. 0 > a && (a = -a);
  6425. return b * a
  6426. },
  6427. enumerable: !0,
  6428. configurable: !0
  6429. });
  6430. return a
  6431. } (c.DisplayObjectContainer);
  6432. c.UIComponent = e;
  6433. e.prototype.__class__ = "egret.UIComponent"
  6434. })(egret || (egret = {})); (function(c) {
  6435. var e = function() {
  6436. function c() {}
  6437. c.ABOVE = "above";
  6438. c.BELOW = "below";
  6439. c.CENTER = "center";
  6440. c.TOP_LEFT = "topLeft";
  6441. c.LEFT = "left";
  6442. c.RIGHT = "right";
  6443. return c
  6444. } ();
  6445. c.PopUpPosition = e;
  6446. e.prototype.__class__ = "egret.PopUpPosition"
  6447. })(egret || (egret = {})); (function(c) {
  6448. var e = function() {
  6449. function c() {}
  6450. c.AUTO = "auto";
  6451. c.OFF = "off";
  6452. c.ON = "on";
  6453. return c
  6454. } ();
  6455. c.ScrollPolicy = e;
  6456. e.prototype.__class__ = "egret.ScrollPolicy"
  6457. })(egret || (egret = {}));
  6458. __extends = this.__extends ||
  6459. function(c, e) {
  6460. function d() {
  6461. this.constructor = c
  6462. }
  6463. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  6464. d.prototype = e.prototype;
  6465. c.prototype = new d
  6466. }; (function(c) {
  6467. var e = function(c) {
  6468. function a(b) {
  6469. "undefined" === typeof b && (b = null);
  6470. c.call(this);
  6471. this.generator = b
  6472. }
  6473. __extends(a, c);
  6474. a.prototype.newInstance = function() {
  6475. return new this.generator
  6476. };
  6477. return a
  6478. } (c.HashObject);
  6479. c.ClassFactory = e;
  6480. e.prototype.__class__ = "egret.ClassFactory"
  6481. })(egret || (egret = {}));
  6482. __extends = this.__extends ||
  6483. function(c, e) {
  6484. function d() {
  6485. this.constructor = c
  6486. }
  6487. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  6488. d.prototype = e.prototype;
  6489. c.prototype = new d
  6490. }; (function(c) {
  6491. var e = function(c) {
  6492. function a() {
  6493. c.call(this)
  6494. }
  6495. __extends(a, c);
  6496. a.prototype.initialize = function(b) {};
  6497. a.prototype.apply = function(b) {};
  6498. a.prototype.remove = function(b) {};
  6499. a.prototype.initializeFromObject = function(b) {
  6500. for (var a in b) this[a] = b[a];
  6501. return this
  6502. };
  6503. return a
  6504. } (c.HashObject);
  6505. c.OverrideBase = e;
  6506. e.prototype.__class__ = "egret.OverrideBase"
  6507. })(egret || (egret = {}));
  6508. __extends = this.__extends ||
  6509. function(c, e) {
  6510. function d() {
  6511. this.constructor = c
  6512. }
  6513. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  6514. d.prototype = e.prototype;
  6515. c.prototype = new d
  6516. }; (function(c) {
  6517. var e = function(d) {
  6518. function a(b, c, e, m) {
  6519. d.call(this);
  6520. this.propertyName = "";
  6521. this.position = a.LAST;
  6522. this.target = b;
  6523. this.propertyName = c;
  6524. this.position = e;
  6525. this.relativeTo = m
  6526. }
  6527. __extends(a, d);
  6528. a.prototype.initialize = function(b) {
  6529. if ((b = b[this.target]) && !(b instanceof c.SkinnableComponent) && "_initialize" in b) try {
  6530. b._initialize()
  6531. } catch(a) {}
  6532. };
  6533. a.prototype.apply = function(b) {
  6534. var c, d;
  6535. try {
  6536. d = b[this.relativeTo]
  6537. } catch(e) {}
  6538. var g = b[this.target];
  6539. b = this.propertyName ? b[this.propertyName] : b;
  6540. if (g && b) {
  6541. switch (this.position) {
  6542. case a.FIRST:
  6543. c = 0;
  6544. break;
  6545. case a.LAST:
  6546. c = -1;
  6547. break;
  6548. case a.BEFORE:
  6549. c = b.getElementIndex(d);
  6550. break;
  6551. case a.AFTER:
  6552. c = b.getElementIndex(d) + 1
  6553. } - 1 == c && (c = b.numElements);
  6554. b.addElementAt(g, c)
  6555. }
  6556. };
  6557. a.prototype.remove = function(b) {
  6558. var a = null == this.propertyName || "" == this.propertyName ? b: b[this.propertyName]; (b = b[this.target]) && a && -1 != a.getElementIndex(b) && a.removeElement(b)
  6559. };
  6560. a.FIRST = "first";
  6561. a.LAST = "last";
  6562. a.BEFORE = "before";
  6563. a.AFTER = "after";
  6564. return a
  6565. } (c.OverrideBase);
  6566. c.AddItems = e;
  6567. e.prototype.__class__ = "egret.AddItems"
  6568. })(egret || (egret = {}));
  6569. __extends = this.__extends ||
  6570. function(c, e) {
  6571. function d() {
  6572. this.constructor = c
  6573. }
  6574. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  6575. d.prototype = e.prototype;
  6576. c.prototype = new d
  6577. }; (function(c) {
  6578. var e = function(c) {
  6579. function a(b, a, e) {
  6580. c.call(this);
  6581. this.target = b;
  6582. this.name = a;
  6583. this.value = e
  6584. }
  6585. __extends(a, c);
  6586. a.prototype.apply = function(b) {
  6587. b = null == this.target || "" == this.target ? b: b[this.target];
  6588. null != b && (this.oldValue = b[this.name], this.setPropertyValue(b, this.name, this.value, this.oldValue))
  6589. };
  6590. a.prototype.remove = function(b) {
  6591. b = null == this.target || "" == this.target ? b: b[this.target];
  6592. null != b && (this.setPropertyValue(b, this.name, this.oldValue, this.oldValue), this.oldValue = null)
  6593. };
  6594. a.prototype.setPropertyValue = function(b, a, c, d) {
  6595. b[a] = void 0 === c || null === c ? c: "boolean" == typeof d ? this.toBoolean(c) : c
  6596. };
  6597. a.prototype.toBoolean = function(b) {
  6598. return "string" == typeof b ? "true" == b.toLowerCase() : !1 != b
  6599. };
  6600. return a
  6601. } (c.OverrideBase);
  6602. c.SetProperty = e;
  6603. e.prototype.__class__ = "egret.SetProperty"
  6604. })(egret || (egret = {}));
  6605. __extends = this.__extends ||
  6606. function(c, e) {
  6607. function d() {
  6608. this.constructor = c
  6609. }
  6610. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  6611. d.prototype = e.prototype;
  6612. c.prototype = new d
  6613. }; (function(c) {
  6614. var e = function(c) {
  6615. function a(b, a) {
  6616. c.call(this);
  6617. this.initialized = !1;
  6618. this.name = b;
  6619. this.overrides = a
  6620. }
  6621. __extends(a, c);
  6622. a.prototype.initialize = function(b) {
  6623. if (!this.initialized) {
  6624. this.initialized = !0;
  6625. for (var a = 0; a < this.overrides.length; a++) this.overrides[a].initialize(b)
  6626. }
  6627. };
  6628. return a
  6629. } (c.HashObject);
  6630. c.State = e;
  6631. e.prototype.__class__ = "egret.State"
  6632. })(egret || (egret = {})); (function(c) {
  6633. var e = function() {
  6634. function c() {}
  6635. c.adjustRelativeByXY = function(a, b) {
  6636. "undefined" === typeof b && (b = null);
  6637. if (a && (b || (b = a.parent), b)) {
  6638. var c = a.x,
  6639. d = a.y,
  6640. e = a.layoutBoundsHeight,
  6641. g = a.layoutBoundsWidth,
  6642. h = b.width,
  6643. l = b.height;
  6644. isNaN(a.left) || (a.left = c);
  6645. isNaN(a.right) || (a.right = h - c - g);
  6646. isNaN(a.horizontalCenter) || (a.horizontalCenter = c + 0.5 * g - 0.5 * h);
  6647. isNaN(a.top) || (a.top = d);
  6648. isNaN(a.bottom) || (a.bottom = l - d - e);
  6649. isNaN(a.verticalCenter) || (a.verticalCenter = 0.5 * e - 0.5 * l + d)
  6650. }
  6651. };
  6652. return c
  6653. } ();
  6654. c.LayoutUtil = e;
  6655. e.prototype.__class__ = "egret.LayoutUtil"
  6656. })(egret || (egret = {})); (function(c) {
  6657. var e = {};
  6658. c.getScale9Grid = function(d) {
  6659. if (e[d]) return e[d];
  6660. if (!d) return null;
  6661. var a = d.split(","),
  6662. a = new c.Rectangle(parseInt(a[0]), parseInt(a[1]), parseInt(a[2]), parseInt(a[3]));
  6663. return e[d] = a
  6664. }
  6665. })(egret || (egret = {}));
  6666. __extends = this.__extends ||
  6667. function(c, e) {
  6668. function d() {
  6669. this.constructor = c
  6670. }
  6671. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  6672. d.prototype = e.prototype;
  6673. c.prototype = new d
  6674. }; (function(c) {
  6675. var e = function(d) {
  6676. function a(b, a) {
  6677. "undefined" === typeof a && (a = !0);
  6678. d.call(this);
  6679. this.fillMode = "scale";
  6680. this.contentReused = this.createChildrenCalled = this.sourceChanged = !1;
  6681. this.autoScale = !0;
  6682. this.touchChildren = !1;
  6683. b && (this.source = b);
  6684. this.autoScale = a
  6685. }
  6686. __extends(a, d);
  6687. Object.defineProperty(a.prototype, "source", {
  6688. get: function() {
  6689. return this._source
  6690. },
  6691. set: function(b) {
  6692. this._source != b && (this._source = b, this.createChildrenCalled ? this.parseSource() : this.sourceChanged = !0)
  6693. },
  6694. enumerable: !0,
  6695. configurable: !0
  6696. });
  6697. Object.defineProperty(a.prototype, "content", {
  6698. get: function() {
  6699. return this._content
  6700. },
  6701. enumerable: !0,
  6702. configurable: !0
  6703. });
  6704. a.prototype.createChildren = function() {
  6705. d.prototype.createChildren.call(this);
  6706. this.sourceChanged && this.parseSource();
  6707. this.createChildrenCalled = !0
  6708. };
  6709. a.prototype.parseSource = function() {
  6710. this.sourceChanged = !1;
  6711. var b = a.assetAdapter;
  6712. b || (b = this.getAdapter());
  6713. if (this._source) {
  6714. var c = this.contentReused ? null: this._content;
  6715. this.contentReused = !0;
  6716. b.getAsset(this._source, this.contentChanged, this, c)
  6717. } else this.contentChanged(null, null)
  6718. };
  6719. a.prototype.getAdapter = function() {
  6720. var b;
  6721. try {
  6722. b = c.Injector.getInstance("egret.IAssetAdapter")
  6723. } catch(k) {
  6724. b = new c.DefaultAssetAdapter
  6725. }
  6726. return a.assetAdapter = b
  6727. };
  6728. a.prototype.contentChanged = function(b, a) {
  6729. if (a === this._source) {
  6730. var d = this._content;
  6731. this._content = b;
  6732. d !== b && (d instanceof c.DisplayObject && this._removeFromDisplayList(d), b instanceof c.DisplayObject && this._addToDisplayListAt(b, 0));
  6733. this.invalidateSize();
  6734. this.invalidateDisplayList();
  6735. this.contentReused = !1;
  6736. this.hasEventListener(c.UIEvent.CONTENT_CHANGED) && c.UIEvent.dispatchUIEvent(this, c.UIEvent.CONTENT_CHANGED)
  6737. }
  6738. };
  6739. a.prototype.measure = function() {
  6740. d.prototype.measure.call(this);
  6741. var b = this._content;
  6742. b instanceof c.DisplayObject ? "preferredWidth" in b ? (this.measuredWidth = b.preferredWidth, this.measuredHeight = b.preferredHeight) : (this.measuredWidth = b.width * b.scaleX, this.measuredHeight = b.height * b.scaleY) : b instanceof c.Texture && (this.measuredWidth = b._textureWidth, this.measuredHeight = b._textureHeight)
  6743. };
  6744. a.prototype.updateDisplayList = function(b, a) {
  6745. d.prototype.updateDisplayList.call(this, b, a);
  6746. var e = this._content;
  6747. this.autoScale && e instanceof c.DisplayObject && ("setLayoutBoundsSize" in e ? e.setLayoutBoundsSize(b, a) : (e.width = b / e.scaleX, e.height = a / e.scaleY))
  6748. };
  6749. a.prototype._render = function(b) {
  6750. if (this._content instanceof c.Texture) {
  6751. var a = this._content;
  6752. this._texture_to_render = a;
  6753. var e;
  6754. this.autoScale ? (e = this._width, a = this._height) : (e = a.textureWidth, a = a.textureHeight);
  6755. c.Bitmap._drawBitmap(b, e, a, this)
  6756. } else this._texture_to_render = null;
  6757. d.prototype._render.call(this, b)
  6758. };
  6759. a.prototype._measureBounds = function() {
  6760. var b = d.prototype._measureBounds.call(this);
  6761. if (this._content instanceof c.Texture) {
  6762. var a = this._content,
  6763. e = this.width,
  6764. m = this.height,
  6765. g = Math.floor(a._offsetX * e / a._textureWidth),
  6766. a = Math.floor(a._offsetY * m / a._textureHeight);
  6767. g < b.x && (b.x = g);
  6768. a < b.y && (b.y = a);
  6769. g + e > b.right && (b.right = g + e);
  6770. a + m > b.bottom && (b.bottom = a + m)
  6771. }
  6772. return b
  6773. };
  6774. a.prototype.addChild = function(b) {
  6775. throw Error("addChild()" + a.errorStr + "addElement()\u4ee3\u66ff");
  6776. };
  6777. a.prototype.addChildAt = function(b, c) {
  6778. throw Error("addChildAt()" + a.errorStr + "addElementAt()\u4ee3\u66ff");
  6779. };
  6780. a.prototype.removeChild = function(b) {
  6781. throw Error("removeChild()" + a.errorStr + "removeElement()\u4ee3\u66ff");
  6782. };
  6783. a.prototype.removeChildAt = function(b) {
  6784. throw Error("removeChildAt()" + a.errorStr + "removeElementAt()\u4ee3\u66ff");
  6785. };
  6786. a.prototype.setChildIndex = function(b, c) {
  6787. throw Error("setChildIndex()" + a.errorStr + "setElementIndex()\u4ee3\u66ff");
  6788. };
  6789. a.prototype.swapChildren = function(b, c) {
  6790. throw Error("swapChildren()" + a.errorStr + "swapElements()\u4ee3\u66ff");
  6791. };
  6792. a.prototype.swapChildrenAt = function(b, c) {
  6793. throw Error("swapChildrenAt()" + a.errorStr + "swapElementsAt()\u4ee3\u66ff");
  6794. };
  6795. a.errorStr = "\u5728\u6b64\u7ec4\u4ef6\u4e2d\u4e0d\u53ef\u7528\uff0c\u82e5\u6b64\u7ec4\u4ef6\u4e3a\u5bb9\u5668\u7c7b\uff0c\u8bf7\u4f7f\u7528";
  6796. return a
  6797. } (c.UIComponent);
  6798. c.UIAsset = e;
  6799. e.prototype.__class__ = "egret.UIAsset"
  6800. })(egret || (egret = {}));
  6801. __extends = this.__extends ||
  6802. function(c, e) {
  6803. function d() {
  6804. this.constructor = c
  6805. }
  6806. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  6807. d.prototype = e.prototype;
  6808. c.prototype = new d
  6809. }; (function(c) {
  6810. var e = function(d) {
  6811. function a() {
  6812. d.call(this);
  6813. this.hostComponentKey = "egret.SkinnableComponent";
  6814. this.stateIsDirty = this.createChildrenCalled = this._skinNameExplicitlySet = !1;
  6815. this.explicitMouseEnabled = this.explicitMouseChildren = this._autoMouseEnabled = !0
  6816. }
  6817. __extends(a, d);
  6818. Object.defineProperty(a.prototype, "skinName", {
  6819. get: function() {
  6820. return this._skinName
  6821. },
  6822. set: function(b) {
  6823. this._skinName != b && (this._skinName = b, this._skinNameExplicitlySet = !0, this.createChildrenCalled && this.parseSkinName())
  6824. },
  6825. enumerable: !0,
  6826. configurable: !0
  6827. });
  6828. Object.defineProperty(a.prototype, "skin", {
  6829. get: function() {
  6830. return this._skin
  6831. },
  6832. enumerable: !0,
  6833. configurable: !0
  6834. });
  6835. a.prototype.createChildren = function() {
  6836. d.prototype.createChildren.call(this);
  6837. this.parseSkinName();
  6838. this.createChildrenCalled = !0
  6839. };
  6840. a.prototype.parseSkinName = function() {
  6841. var b = a.skinAdapter;
  6842. b || (b = this.getSkinAdapter());
  6843. var b = b.getSkin(this._skinName, this.hostComponentKey),
  6844. k = this._skin;
  6845. this.detachSkin(k);
  6846. k instanceof c.DisplayObject && this._removeFromDisplayList(k);
  6847. this._skin = b;
  6848. b instanceof c.DisplayObject && this._addToDisplayListAt(this._skin, 0);
  6849. this.attachSkin(b);
  6850. this.invalidateSkinState();
  6851. this.invalidateSize();
  6852. this.invalidateDisplayList();
  6853. this.hasEventListener(c.UIEvent.SKIN_CHANGED) && c.UIEvent.dispatchUIEvent(this, c.UIEvent.SKIN_CHANGED)
  6854. };
  6855. a.prototype.getSkinAdapter = function() {
  6856. var b;
  6857. try {
  6858. b = c.Injector.getInstance("egret.ISkinAdapter")
  6859. } catch(k) {
  6860. b = new c.DefaultSkinAdapter
  6861. }
  6862. return a.skinAdapter = b
  6863. };
  6864. a.prototype.attachSkin = function(b) {
  6865. b && "hostComponent" in b && (b.hostComponent = this, this.findSkinParts());
  6866. b && "hostComponent" in b && b instanceof c.DisplayObject ? this._setSkinLayoutEnabled(!1) : this._setSkinLayoutEnabled(!0)
  6867. };
  6868. a.prototype.findSkinParts = function() {
  6869. var b = this._skin;
  6870. if (b && "skinParts" in b) for (var a = b.skinParts,
  6871. c = a.length,
  6872. d = 0; d < c; d++) {
  6873. var e = a[d];
  6874. if (e in b) try {
  6875. this[e] = b[e],
  6876. this.partAdded(e, b[e])
  6877. } catch(h) {}
  6878. }
  6879. };
  6880. a.prototype.detachSkin = function(b) {
  6881. if (b && "skinParts" in b) {
  6882. for (var a = b.skinParts,
  6883. c = a.length,
  6884. d = 0; d < c; d++) {
  6885. var e = a[d];
  6886. e in this && (null != this[e] && this.partRemoved(e, this[e]), this[e] = null)
  6887. }
  6888. b.hostComponent = null
  6889. }
  6890. };
  6891. a.prototype.partAdded = function(b, a) {
  6892. c.SkinPartEvent.dispatchSkinPartEvent(this, c.SkinPartEvent.PART_ADDED, b, a)
  6893. };
  6894. a.prototype.partRemoved = function(b, a) {
  6895. c.SkinPartEvent.dispatchSkinPartEvent(this, c.SkinPartEvent.PART_REMOVED, b, a)
  6896. };
  6897. a.prototype.invalidateSkinState = function() {
  6898. this.stateIsDirty || (this.stateIsDirty = !0, this.invalidateProperties())
  6899. };
  6900. a.prototype.validateSkinState = function() {
  6901. var b = this.getCurrentSkinState(),
  6902. a = this._skin;
  6903. a && "currentState" in a && (a.currentState = b);
  6904. this.hasEventListener("stateChanged") && this.dispatchEventWith("stateChanged")
  6905. };
  6906. Object.defineProperty(a.prototype, "autoTouchEnabled", {
  6907. get: function() {
  6908. return this._autoMouseEnabled
  6909. },
  6910. set: function(b) {
  6911. this._autoMouseEnabled != b && ((this._autoMouseEnabled = b) ? (this._touchChildren = this.enabled ? this.explicitMouseChildren: !1, this._touchEnabled = this.enabled ? this.explicitMouseEnabled: !1) : (this._touchChildren = this.explicitMouseChildren, this._touchEnabled = this.explicitMouseEnabled))
  6912. },
  6913. enumerable: !0,
  6914. configurable: !0
  6915. });
  6916. Object.defineProperty(a.prototype, "touchChildren", {
  6917. get: function() {
  6918. return this._touchChildren
  6919. },
  6920. set: function(b) {
  6921. this.enabled && (this._touchChildren = b);
  6922. this.explicitMouseChildren = b
  6923. },
  6924. enumerable: !0,
  6925. configurable: !0
  6926. });
  6927. Object.defineProperty(a.prototype, "touchEnabled", {
  6928. get: function() {
  6929. return this._touchEnabled
  6930. },
  6931. set: function(b) {
  6932. this.enabled && (this._touchEnabled = b);
  6933. this.explicitMouseEnabled = b
  6934. },
  6935. enumerable: !0,
  6936. configurable: !0
  6937. });
  6938. Object.defineProperty(a.prototype, "enabled", {
  6939. get: function() {
  6940. return this._enabled
  6941. },
  6942. set: function(b) {
  6943. this._setEnabled(b)
  6944. },
  6945. enumerable: !0,
  6946. configurable: !0
  6947. });
  6948. a.prototype._setEnabled = function(b) {
  6949. this._enabled != b && (this._enabled = b, this._autoMouseEnabled && (this._touchChildren = b ? this.explicitMouseChildren: !1, this._touchEnabled = b ? this.explicitMouseEnabled: !1), this.invalidateSkinState())
  6950. };
  6951. a.prototype.getCurrentSkinState = function() {
  6952. return this.enabled ? "normal": "disabled"
  6953. };
  6954. a.prototype.commitProperties = function() {
  6955. d.prototype.commitProperties.call(this);
  6956. this.stateIsDirty && (this.stateIsDirty = !1, this.validateSkinState())
  6957. };
  6958. a.prototype._setSkinLayoutEnabled = function(b) {
  6959. null != this.skinLayout != b && (b ? (this.skinLayout = new c.SkinBasicLayout, this.skinLayout.target = this) : this.skinLayout = this.skinLayout.target = null, this.invalidateSize(), this.invalidateDisplayList())
  6960. };
  6961. a.prototype._childXYChanged = function() {
  6962. this.skinLayout && (this.invalidateSize(), this.invalidateDisplayList())
  6963. };
  6964. a.prototype.measure = function() {
  6965. d.prototype.measure.call(this);
  6966. var b = this._skin;
  6967. if (b) {
  6968. var a = b instanceof c.DisplayObject;
  6969. a && (b && "preferredWidth" in b ? (this.measuredWidth = b.preferredWidth, this.measuredHeight = b.preferredHeight) : (this.measuredWidth = b.width, this.measuredHeight = b.height));
  6970. this.skinLayout && this.skinLayout.measure();
  6971. if (!a) {
  6972. var a = this.measuredWidth,
  6973. e = this.measuredHeight;
  6974. try {
  6975. isNaN(b.width) || (a = Math.ceil(b.width)),
  6976. isNaN(b.height) || (e = Math.ceil(b.height)),
  6977. b.hasOwnProperty("minWidth") && a < b.minWidth && (a = b.minWidth),
  6978. b.hasOwnProperty("maxWidth") && a > b.maxWidth && (a = b.maxWidth),
  6979. b.hasOwnProperty("minHeight") && e < b.minHeight && (e = b.minHeight),
  6980. b.hasOwnProperty("maxHeight") && e > b.maxHeight && (e = b.maxHeight),
  6981. this.measuredWidth = a,
  6982. this.measuredHeight = e
  6983. } catch(m) {}
  6984. }
  6985. }
  6986. };
  6987. a.prototype.updateDisplayList = function(b, a) {
  6988. d.prototype.updateDisplayList.call(this, b, a);
  6989. var e = this._skin;
  6990. e && ("setLayoutBoundsSize" in e ? e.setLayoutBoundsSize(b, a) : e instanceof c.DisplayObject && (e.scaleX = 0 == e.width ? 1 : b / e.width, e.scaleY = 0 == e.height ? 1 : a / e.height));
  6991. this.skinLayout && this.skinLayout.updateDisplayList(b, a)
  6992. };
  6993. a.prototype.addChild = function(b) {
  6994. throw Error("addChild()" + a.errorStr + "addElement()\u4ee3\u66ff");
  6995. };
  6996. a.prototype.addChildAt = function(b, c) {
  6997. throw Error("addChildAt()" + a.errorStr + "addElementAt()\u4ee3\u66ff");
  6998. };
  6999. a.prototype.removeChild = function(b) {
  7000. throw Error("removeChild()" + a.errorStr + "removeElement()\u4ee3\u66ff");
  7001. };
  7002. a.prototype.removeChildAt = function(b) {
  7003. throw Error("removeChildAt()" + a.errorStr + "removeElementAt()\u4ee3\u66ff");
  7004. };
  7005. a.prototype.setChildIndex = function(b, c) {
  7006. throw Error("setChildIndex()" + a.errorStr + "setElementIndex()\u4ee3\u66ff");
  7007. };
  7008. a.prototype.swapChildren = function(b, c) {
  7009. throw Error("swapChildren()" + a.errorStr + "swapElements()\u4ee3\u66ff");
  7010. };
  7011. a.prototype.swapChildrenAt = function(b, c) {
  7012. throw Error("swapChildrenAt()" + a.errorStr + "swapElementsAt()\u4ee3\u66ff");
  7013. };
  7014. a.errorStr = "\u5728\u6b64\u7ec4\u4ef6\u4e2d\u4e0d\u53ef\u7528\uff0c\u82e5\u6b64\u7ec4\u4ef6\u4e3a\u5bb9\u5668\u7c7b\uff0c\u8bf7\u4f7f\u7528";
  7015. return a
  7016. } (c.UIComponent);
  7017. c.SkinnableComponent = e;
  7018. e.prototype.__class__ = "egret.SkinnableComponent"
  7019. })(egret || (egret = {})); (function(c) {
  7020. var e = function() {
  7021. function d() {}
  7022. d.prototype.getSkin = function(a, b) {
  7023. if (!a) return null;
  7024. if (a.prototype) return new a;
  7025. if ("string" == typeof a) {
  7026. var k = c.getDefinitionByName(a);
  7027. return k ? new k: null
  7028. }
  7029. return a
  7030. };
  7031. return d
  7032. } ();
  7033. c.DefaultSkinAdapter = e;
  7034. e.prototype.__class__ = "egret.DefaultSkinAdapter"
  7035. })(egret || (egret = {})); (function(c) {
  7036. var e = function() {
  7037. function d() {}
  7038. d.prototype.getAsset = function(a, b, k, d) {
  7039. var e = a;
  7040. a.prototype && (e = new a);
  7041. if (e instanceof c.DisplayObject || e instanceof c.Texture) b.call(k, e, a);
  7042. else if ("string" == typeof a) {
  7043. var g = new c.URLLoader;
  7044. g.dataFormat = c.URLLoaderDataFormat.TEXTURE;
  7045. g.addEventListener(c.Event.COMPLETE,
  7046. function(c) {
  7047. e = g.data;
  7048. b.call(k, e, a)
  7049. },
  7050. this);
  7051. g.load(new c.URLRequest(a))
  7052. } else b.call(k, e, a)
  7053. };
  7054. return d
  7055. } ();
  7056. c.DefaultAssetAdapter = e;
  7057. e.prototype.__class__ = "egret.DefaultAssetAdapter"
  7058. })(egret || (egret = {}));
  7059. __extends = this.__extends ||
  7060. function(c, e) {
  7061. function d() {
  7062. this.constructor = c
  7063. }
  7064. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  7065. d.prototype = e.prototype;
  7066. c.prototype = new d
  7067. }; (function(c) {
  7068. var e = function(c) {
  7069. function a() {
  7070. c.call(this)
  7071. }
  7072. __extends(a, c);
  7073. Object.defineProperty(a.prototype, "target", {
  7074. get: function() {
  7075. return this._target
  7076. },
  7077. set: function(b) {
  7078. this._target = b
  7079. },
  7080. enumerable: !0,
  7081. configurable: !0
  7082. });
  7083. a.prototype.measure = function() {
  7084. if (null != this.target) {
  7085. for (var b = 0,
  7086. a = 0,
  7087. c = this._target.skin,
  7088. d = this.target.numChildren,
  7089. e = 0; e < d; e++) {
  7090. var h = this.target.getChildAt(e);
  7091. if (h && h != c && h.includeInLayout) {
  7092. var l = h.horizontalCenter,
  7093. n = h.verticalCenter,
  7094. p = h.left,
  7095. q = h.right,
  7096. r = h.top,
  7097. s = h.bottom;
  7098. isNaN(p) || isNaN(q) ? isNaN(l) ? isNaN(p) && isNaN(q) ? l = h.preferredX: (l = isNaN(p) ? 0 : p, l += isNaN(q) ? 0 : q) : l = 2 * Math.abs(l) : l = p + q;
  7099. isNaN(r) || isNaN(s) ? isNaN(n) ? isNaN(r) && isNaN(s) ? n = h.preferredY: (n = isNaN(r) ? 0 : r, n += isNaN(s) ? 0 : s) : n = 2 * Math.abs(n) : n = r + s;
  7100. s = h.preferredHeight;
  7101. b = Math.ceil(Math.max(b, l + h.preferredWidth));
  7102. a = Math.ceil(Math.max(a, n + s))
  7103. }
  7104. }
  7105. this.target.measuredWidth = Math.max(b, this.target.measuredWidth);
  7106. this.target.measuredHeight = Math.max(a, this.target.measuredHeight)
  7107. }
  7108. };
  7109. a.prototype.updateDisplayList = function(b, a) {
  7110. if (null != this.target) for (var c = this.target.numChildren,
  7111. d = this._target.skin,
  7112. e = 0; e < c; e++) {
  7113. var h = this.target.getChildAt(e);
  7114. if (null != h && h != d && h.includeInLayout) {
  7115. var l = h.horizontalCenter,
  7116. n = h.verticalCenter,
  7117. p = h.left,
  7118. q = h.right,
  7119. r = h.top,
  7120. s = h.bottom,
  7121. t = h.percentWidth,
  7122. A = h.percentHeight,
  7123. w = NaN,
  7124. B = NaN;
  7125. isNaN(p) || isNaN(q) ? isNaN(t) || (w = Math.round(b * Math.min(0.01 * t, 1))) : w = b - q - p;
  7126. isNaN(r) || isNaN(s) ? isNaN(A) || (B = Math.round(a * Math.min(0.01 * A, 1))) : B = a - s - r;
  7127. h.setLayoutBoundsSize(w, B);
  7128. t = h.layoutBoundsWidth;
  7129. A = h.layoutBoundsHeight;
  7130. B = w = NaN;
  7131. w = isNaN(l) ? isNaN(p) ? isNaN(q) ? h.layoutBoundsX: b - t - q: p: Math.round((b - t) / 2 + l);
  7132. B = isNaN(n) ? isNaN(r) ? isNaN(s) ? h.layoutBoundsY: a - A - s: r: Math.round((a - A) / 2 + n);
  7133. h.setLayoutBoundsPosition(w, B)
  7134. }
  7135. }
  7136. };
  7137. return a
  7138. } (c.HashObject);
  7139. c.SkinBasicLayout = e;
  7140. e.prototype.__class__ = "egret.SkinBasicLayout"
  7141. })(egret || (egret = {}));
  7142. __extends = this.__extends ||
  7143. function(c, e) {
  7144. function d() {
  7145. this.constructor = c
  7146. }
  7147. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  7148. d.prototype = e.prototype;
  7149. c.prototype = new d
  7150. }; (function(c) {
  7151. var e = function(d) {
  7152. function a() {
  7153. d.call(this);
  7154. this._autoRepeat = this._downEventFired = !1;
  7155. this._repeatInterval = this._repeatDelay = 35;
  7156. this._keepDown = this._hovered = !1;
  7157. this._label = "";
  7158. this.touchChildren = this._stickyHighlighting = this._mouseCaptured = !1;
  7159. this.addHandlers()
  7160. }
  7161. __extends(a, d);
  7162. Object.defineProperty(a.prototype, "autoRepeat", {
  7163. get: function() {
  7164. return this._autoRepeat
  7165. },
  7166. set: function(b) {
  7167. b != this._autoRepeat && (this._autoRepeat = b, this.checkAutoRepeatTimerConditions(this.isDown()))
  7168. },
  7169. enumerable: !0,
  7170. configurable: !0
  7171. });
  7172. Object.defineProperty(a.prototype, "repeatDelay", {
  7173. get: function() {
  7174. return this._repeatDelay
  7175. },
  7176. set: function(b) {
  7177. this._repeatDelay = b
  7178. },
  7179. enumerable: !0,
  7180. configurable: !0
  7181. });
  7182. Object.defineProperty(a.prototype, "repeatInterval", {
  7183. get: function() {
  7184. return this._repeatInterval
  7185. },
  7186. set: function(b) {
  7187. this._repeatInterval = b
  7188. },
  7189. enumerable: !0,
  7190. configurable: !0
  7191. });
  7192. Object.defineProperty(a.prototype, "hovered", {
  7193. get: function() {
  7194. return this._hovered
  7195. },
  7196. set: function(b) {
  7197. b != this._hovered && (this._hovered = b, this.invalidateSkinState(), this.checkButtonDownConditions())
  7198. },
  7199. enumerable: !0,
  7200. configurable: !0
  7201. });
  7202. a.prototype._setKeepDown = function(b) {
  7203. this._keepDown != b && (this._keepDown = b, this.invalidateSkinState())
  7204. };
  7205. Object.defineProperty(a.prototype, "label", {
  7206. get: function() {
  7207. return this._getLabel()
  7208. },
  7209. set: function(b) {
  7210. this._setLabel(b)
  7211. },
  7212. enumerable: !0,
  7213. configurable: !0
  7214. });
  7215. a.prototype._getLabel = function() {
  7216. return this.labelDisplay ? this.labelDisplay.text: this._label
  7217. };
  7218. a.prototype._setLabel = function(b) {
  7219. this._label = b;
  7220. this.labelDisplay && (this.labelDisplay.text = b)
  7221. };
  7222. Object.defineProperty(a.prototype, "mouseCaptured", {
  7223. get: function() {
  7224. return this._mouseCaptured
  7225. },
  7226. set: function(b) {
  7227. b != this._mouseCaptured && (this._mouseCaptured = b, this.invalidateSkinState(), b || this.removeStageMouseHandlers(), this.checkButtonDownConditions())
  7228. },
  7229. enumerable: !0,
  7230. configurable: !0
  7231. });
  7232. Object.defineProperty(a.prototype, "stickyHighlighting", {
  7233. get: function() {
  7234. return this._stickyHighlighting
  7235. },
  7236. set: function(b) {
  7237. b != this._stickyHighlighting && (this._stickyHighlighting = b, this.invalidateSkinState(), this.checkButtonDownConditions())
  7238. },
  7239. enumerable: !0,
  7240. configurable: !0
  7241. });
  7242. a.prototype.checkButtonDownConditions = function() {
  7243. var b = this.isDown();
  7244. this._downEventFired != b && (b && c.UIEvent.dispatchUIEvent(this, c.UIEvent.BUTTON_DOWN), this._downEventFired = b, this.checkAutoRepeatTimerConditions(b))
  7245. };
  7246. a.prototype.addHandlers = function() {
  7247. this.addEventListener(c.TouchEvent.TOUCH_ROLL_OVER, this.mouseEventHandler, this);
  7248. this.addEventListener(c.TouchEvent.TOUCH_ROLL_OUT, this.mouseEventHandler, this);
  7249. this.addEventListener(c.TouchEvent.TOUCH_BEGIN, this.mouseEventHandler, this);
  7250. this.addEventListener(c.TouchEvent.TOUCH_END, this.mouseEventHandler, this);
  7251. this.addEventListener(c.TouchEvent.TOUCH_TAP, this.mouseEventHandler, this)
  7252. };
  7253. a.prototype.addStageMouseHandlers = function() {
  7254. c.UIGlobals.stage.addEventListener(c.TouchEvent.TOUCH_END, this.stage_mouseUpHandler, this);
  7255. c.UIGlobals.stage.addEventListener(c.Event.LEAVE_STAGE, this.stage_mouseUpHandler, this)
  7256. };
  7257. a.prototype.removeStageMouseHandlers = function() {
  7258. c.UIGlobals.stage.removeEventListener(c.TouchEvent.TOUCH_END, this.stage_mouseUpHandler, this);
  7259. c.UIGlobals.stage.removeEventListener(c.Event.LEAVE_STAGE, this.stage_mouseUpHandler, this)
  7260. };
  7261. a.prototype.isDown = function() {
  7262. return this.enabled ? this.mouseCaptured && (this.hovered || this.stickyHighlighting) ? !0 : !1 : !1
  7263. };
  7264. a.prototype.checkAutoRepeatTimerConditions = function(b) {
  7265. b = this.autoRepeat && b;
  7266. b != (null != this.autoRepeatTimer) && (b ? this.startTimer() : this.stopTimer())
  7267. };
  7268. a.prototype.startTimer = function() {
  7269. this.autoRepeatTimer = new c.Timer(1);
  7270. this.autoRepeatTimer.delay = this._repeatDelay;
  7271. this.autoRepeatTimer.addEventListener(c.TimerEvent.TIMER, this.autoRepeat_timerDelayHandler, this);
  7272. this.autoRepeatTimer.start()
  7273. };
  7274. a.prototype.stopTimer = function() {
  7275. this.autoRepeatTimer.stop();
  7276. this.autoRepeatTimer = null
  7277. };
  7278. a.prototype.mouseEventHandler = function(b) {
  7279. switch (b.type) {
  7280. case c.TouchEvent.TOUCH_ROLL_OVER:
  7281. if (b.touchDown && !this.mouseCaptured) break;
  7282. this.hovered = !0;
  7283. break;
  7284. case c.TouchEvent.TOUCH_ROLL_OUT:
  7285. this.hovered = !1;
  7286. break;
  7287. case c.TouchEvent.TOUCH_BEGIN:
  7288. this.addStageMouseHandlers();
  7289. c.InteractionMode.mode == c.InteractionMode.TOUCH && (this.hovered = !0);
  7290. this.mouseCaptured = !0;
  7291. break;
  7292. case c.TouchEvent.TOUCH_END:
  7293. b.target == this && (this.hovered = !0, this.mouseCaptured && (this.buttonReleased(), this.mouseCaptured = !1));
  7294. break;
  7295. case c.TouchEvent.TOUCH_TAP:
  7296. this.enabled ? this.clickHandler(b) : b.stopImmediatePropagation()
  7297. }
  7298. };
  7299. a.prototype.buttonReleased = function() {};
  7300. a.prototype.clickHandler = function(b) {};
  7301. a.prototype.stage_mouseUpHandler = function(b) {
  7302. b.target != this && (this.mouseCaptured = !1)
  7303. };
  7304. a.prototype.autoRepeat_timerDelayHandler = function(b) {
  7305. this.autoRepeatTimer.reset();
  7306. this.autoRepeatTimer.removeEventListener(c.TimerEvent.TIMER, this.autoRepeat_timerDelayHandler, this);
  7307. this.autoRepeatTimer.delay = this._repeatInterval;
  7308. this.autoRepeatTimer.addEventListener(c.TimerEvent.TIMER, this.autoRepeat_timerHandler, this);
  7309. this.autoRepeatTimer.start()
  7310. };
  7311. a.prototype.autoRepeat_timerHandler = function(b) {
  7312. c.UIEvent.dispatchUIEvent(this, c.UIEvent.BUTTON_DOWN)
  7313. };
  7314. a.prototype.getCurrentSkinState = function() {
  7315. return this.enabled ? this.isDown() || this._keepDown ? "down": c.InteractionMode.mode == c.InteractionMode.MOUSE && (this.hovered || this.mouseCaptured) ? "over": "up": d.prototype.getCurrentSkinState.call(this)
  7316. };
  7317. a.prototype.partAdded = function(b, a) {
  7318. d.prototype.partAdded.call(this, b, a);
  7319. a == this.labelDisplay && (this.labelDisplay.text = this._label)
  7320. };
  7321. return a
  7322. } (c.SkinnableComponent);
  7323. c.ButtonBase = e;
  7324. e.prototype.__class__ = "egret.ButtonBase"
  7325. })(egret || (egret = {}));
  7326. __extends = this.__extends ||
  7327. function(c, e) {
  7328. function d() {
  7329. this.constructor = c
  7330. }
  7331. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  7332. d.prototype = e.prototype;
  7333. c.prototype = new d
  7334. }; (function(c) {
  7335. var e = function(d) {
  7336. function a() {
  7337. d.call(this);
  7338. this._autoSelected = !0
  7339. }
  7340. __extends(a, d);
  7341. Object.defineProperty(a.prototype, "selected", {
  7342. get: function() {
  7343. return this._selected
  7344. },
  7345. set: function(b) {
  7346. this._setSelected(b)
  7347. },
  7348. enumerable: !0,
  7349. configurable: !0
  7350. });
  7351. a.prototype._setSelected = function(b) {
  7352. b != this._selected && (this._selected = b, c.UIEvent.dispatchUIEvent(this, c.UIEvent.VALUE_COMMIT), this.invalidateSkinState())
  7353. };
  7354. a.prototype.getCurrentSkinState = function() {
  7355. return this.selected ? d.prototype.getCurrentSkinState.call(this) + "AndSelected": d.prototype.getCurrentSkinState.call(this)
  7356. };
  7357. a.prototype.buttonReleased = function() {
  7358. d.prototype.buttonReleased.call(this);
  7359. this._autoSelected && this.enabled && (this.selected = !this.selected, this.dispatchEventWith(c.Event.CHANGE))
  7360. };
  7361. return a
  7362. } (c.ButtonBase);
  7363. c.ToggleButtonBase = e;
  7364. e.prototype.__class__ = "egret.ToggleButtonBase"
  7365. })(egret || (egret = {}));
  7366. __extends = this.__extends ||
  7367. function(c, e) {
  7368. function d() {
  7369. this.constructor = c
  7370. }
  7371. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  7372. d.prototype = e.prototype;
  7373. c.prototype = new d
  7374. }; (function(c) {
  7375. var e = function(d) {
  7376. function a() {
  7377. d.call(this);
  7378. this._fontFamily = "SimSun";
  7379. this._size = 30;
  7380. this._textAlign = c.HorizontalAlign.LEFT;
  7381. this._verticalAlign = c.VerticalAlign.TOP;
  7382. this._lineSpacing = 0;
  7383. this._textColor = 16777215;
  7384. this._text = ""
  7385. }
  7386. __extends(a, d);
  7387. Object.defineProperty(a.prototype, "fontFamily", {
  7388. get: function() {
  7389. return this._fontFamily
  7390. },
  7391. set: function(b) {
  7392. this._fontFamily != b && (this._fontFamily = b, this.fontFamilyChanged = !0, this.invalidateProperties(), this.invalidateSize(), this.invalidateDisplayList())
  7393. },
  7394. enumerable: !0,
  7395. configurable: !0
  7396. });
  7397. Object.defineProperty(a.prototype, "size", {
  7398. get: function() {
  7399. return this._size
  7400. },
  7401. set: function(b) {
  7402. this._size != b && (this._size = b, this.sizeChanged = !0, this.invalidateProperties(), this.invalidateSize(), this.invalidateDisplayList())
  7403. },
  7404. enumerable: !0,
  7405. configurable: !0
  7406. });
  7407. Object.defineProperty(a.prototype, "bold", {
  7408. get: function() {
  7409. return this._bold
  7410. },
  7411. set: function(b) {
  7412. this._bold != b && (this._bold = b, this.boldChanged = !0, this.invalidateProperties(), this.invalidateSize(), this.invalidateDisplayList())
  7413. },
  7414. enumerable: !0,
  7415. configurable: !0
  7416. });
  7417. Object.defineProperty(a.prototype, "italic", {
  7418. get: function() {
  7419. return this._italic
  7420. },
  7421. set: function(b) {
  7422. this._italic != b && (this._italic = b, this.italicChanged = !0, this.invalidateProperties(), this.invalidateSize(), this.invalidateDisplayList())
  7423. },
  7424. enumerable: !0,
  7425. configurable: !0
  7426. });
  7427. Object.defineProperty(a.prototype, "textAlign", {
  7428. get: function() {
  7429. return this._textAlign
  7430. },
  7431. set: function(b) {
  7432. this._textAlign != b && (this._textAlign = b, this.textAlignChanged = !0, this.invalidateProperties(), this.invalidateSize(), this.invalidateDisplayList())
  7433. },
  7434. enumerable: !0,
  7435. configurable: !0
  7436. });
  7437. Object.defineProperty(a.prototype, "verticalAlign", {
  7438. get: function() {
  7439. return this._verticalAlign
  7440. },
  7441. set: function(b) {
  7442. this._verticalAlign != b && (this._verticalAlign = b, this.verticalAlignChanged = !0, this.invalidateProperties(), this.invalidateSize(), this.invalidateDisplayList())
  7443. },
  7444. enumerable: !0,
  7445. configurable: !0
  7446. });
  7447. Object.defineProperty(a.prototype, "lineSpacing", {
  7448. get: function() {
  7449. return this._lineSpacing
  7450. },
  7451. set: function(b) {
  7452. this._lineSpacing != b && (this._lineSpacing = b, this.lineSpacingChanged = !0, this.invalidateProperties(), this.invalidateSize(), this.invalidateDisplayList())
  7453. },
  7454. enumerable: !0,
  7455. configurable: !0
  7456. });
  7457. Object.defineProperty(a.prototype, "textColor", {
  7458. get: function() {
  7459. return this._textColor
  7460. },
  7461. set: function(b) {
  7462. this._textColor != b && (this._textColor = b, this.textColorChanged = !0, this.invalidateProperties())
  7463. },
  7464. enumerable: !0,
  7465. configurable: !0
  7466. });
  7467. Object.defineProperty(a.prototype, "text", {
  7468. get: function() {
  7469. return this._text
  7470. },
  7471. set: function(b) {
  7472. b != this._text && (this._text = b, this._textChanged = !0, this.invalidateProperties(), this.invalidateSize(), this.invalidateDisplayList())
  7473. },
  7474. enumerable: !0,
  7475. configurable: !0
  7476. });
  7477. a.prototype.createChildren = function() {
  7478. d.prototype.createChildren.call(this);
  7479. this._textField || this.checkTextField()
  7480. };
  7481. a.prototype.commitProperties = function() {
  7482. d.prototype.commitProperties.call(this);
  7483. this._textField || this.checkTextField();
  7484. this.fontFamilyChanged && (this._textField.fontFamily = this._fontFamily, this.fontFamilyChanged = !1);
  7485. this.sizeChanged && (this._textField.size = this._size, this.sizeChanged = !1);
  7486. this.boldChanged && (this._textField.bold = this._bold, this.boldChanged = !1);
  7487. this.italic && (this._textField.italic = this._italic, this.italicChanged = !1);
  7488. this.textAlignChanged && (this._textField.textAlign = this._textAlign, this.textAlignChanged = !1);
  7489. this.verticalAlignChanged && (this._textField.verticalAlign = this._verticalAlign, this.verticalAlignChanged = !1);
  7490. this.lineSpacingChanged && (this._textField.lineSpacing = this._lineSpacing, this.lineSpacingChanged = !1);
  7491. this.textColorChanged && (this._textField.textColor = this._textColor, this.textColorChanged = !1);
  7492. this._textChanged && (this._textField.text = this._text, this._textChanged = !1)
  7493. };
  7494. a.prototype.checkTextField = function() {
  7495. this._textField || (this.createTextField(), this._textField.text = this._text, this._textChanged = !0, this.invalidateProperties())
  7496. };
  7497. a.prototype.createTextField = function() {
  7498. this._textField = new c.TextField;
  7499. this._textField.fontFamily = this._fontFamily;
  7500. this._textField.size = this._size;
  7501. this._textField.textAlign = this._textAlign;
  7502. this._textField.verticalAlign = this._verticalAlign;
  7503. this._textField.lineSpacing = this._lineSpacing;
  7504. this._textField.textColor = this._textColor;
  7505. this._addToDisplayList(this._textField)
  7506. };
  7507. a.prototype.measure = function() {
  7508. d.prototype.measure.call(this);
  7509. this.measuredWidth = a.DEFAULT_MEASURED_WIDTH;
  7510. this.measuredHeight = a.DEFAULT_MEASURED_HEIGHT
  7511. };
  7512. a.prototype.$updateDisplayList = function(b, a) {
  7513. d.prototype.updateDisplayList.call(this, b, a)
  7514. };
  7515. a.prototype.updateDisplayList = function(b, a) {
  7516. d.prototype.updateDisplayList.call(this, b, a);
  7517. this._textField.width = b;
  7518. this._textField.height = a
  7519. };
  7520. a.DEFAULT_MEASURED_WIDTH = 160;
  7521. a.DEFAULT_MEASURED_HEIGHT = 22;
  7522. return a
  7523. } (c.UIComponent);
  7524. c.TextBase = e;
  7525. e.prototype.__class__ = "egret.TextBase"
  7526. })(egret || (egret = {}));
  7527. __extends = this.__extends ||
  7528. function(c, e) {
  7529. function d() {
  7530. this.constructor = c
  7531. }
  7532. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  7533. d.prototype = e.prototype;
  7534. c.prototype = new d
  7535. }; (function(c) {
  7536. var e = function(d) {
  7537. function a() {
  7538. d.call(this);
  7539. this._contentHeight = this._contentWidth = 0;
  7540. this._clipAndEnableScrolling = !1;
  7541. this._verticalScrollPosition = this._horizontalScrollPosition = 0;
  7542. this.touchEnabled = this._layoutInvalidateSizeFlag = this._layoutInvalidateDisplayListFlag = !1
  7543. }
  7544. __extends(a, d);
  7545. a.prototype.createChildren = function() {
  7546. d.prototype.createChildren.call(this);
  7547. this._layout || (this.layout = new c.BasicLayout)
  7548. };
  7549. Object.defineProperty(a.prototype, "contentWidth", {
  7550. get: function() {
  7551. return this._contentWidth
  7552. },
  7553. enumerable: !0,
  7554. configurable: !0
  7555. });
  7556. a.prototype.setContentWidth = function(b) {
  7557. if (b != this._contentWidth) {
  7558. var a = this._contentWidth;
  7559. this._contentWidth = b;
  7560. this.hasEventListener("propertyChange") && c.PropertyChangeEvent.dispatchPropertyChangeEvent(this, c.PropertyChangeEventKind.UPDATE, "contentWidth", a, b, this)
  7561. }
  7562. };
  7563. Object.defineProperty(a.prototype, "contentHeight", {
  7564. get: function() {
  7565. return this._contentHeight
  7566. },
  7567. enumerable: !0,
  7568. configurable: !0
  7569. });
  7570. a.prototype.setContentHeight = function(b) {
  7571. if (b != this._contentHeight) {
  7572. var a = this._contentHeight;
  7573. this._contentHeight = b;
  7574. this.hasEventListener("propertyChange") && c.PropertyChangeEvent.dispatchPropertyChangeEvent(this, c.PropertyChangeEventKind.UPDATE, "contentHeight", a, b, this)
  7575. }
  7576. };
  7577. a.prototype.setContentSize = function(b, a) {
  7578. if (b != this._contentWidth || a != this._contentHeight) this.setContentWidth(b),
  7579. this.setContentHeight(a)
  7580. };
  7581. Object.defineProperty(a.prototype, "layout", {
  7582. get: function() {
  7583. return this._layout
  7584. },
  7585. set: function(b) {
  7586. this._setLayout(b)
  7587. },
  7588. enumerable: !0,
  7589. configurable: !0
  7590. });
  7591. a.prototype._setLayout = function(b) {
  7592. if (this._layout != b) {
  7593. this._layout && (this._layout.target = null);
  7594. if (this._layout = b) this._layout.target = this;
  7595. this.invalidateSize();
  7596. this.invalidateDisplayList();
  7597. this.dispatchEventWith("layoutChanged")
  7598. }
  7599. };
  7600. Object.defineProperty(a.prototype, "clipAndEnableScrolling", {
  7601. get: function() {
  7602. return this._clipAndEnableScrolling
  7603. },
  7604. set: function(b) {
  7605. b != this._clipAndEnableScrolling && (this.scrollRect = (this._clipAndEnableScrolling = b) ? new c.Rectangle(this._horizontalScrollPosition, this._verticalScrollPosition, this.width, this.height) : null)
  7606. },
  7607. enumerable: !0,
  7608. configurable: !0
  7609. });
  7610. Object.defineProperty(a.prototype, "horizontalScrollPosition", {
  7611. get: function() {
  7612. return this._horizontalScrollPosition
  7613. },
  7614. set: function(b) {
  7615. if (b != this._horizontalScrollPosition) {
  7616. var a = this._horizontalScrollPosition;
  7617. this._horizontalScrollPosition = b;
  7618. this.scrollPositionChanged();
  7619. c.PropertyChangeEvent.dispatchPropertyChangeEvent(this, c.PropertyChangeEventKind.UPDATE, "horizontalScrollPosition", a, b, this)
  7620. }
  7621. },
  7622. enumerable: !0,
  7623. configurable: !0
  7624. });
  7625. Object.defineProperty(a.prototype, "verticalScrollPosition", {
  7626. get: function() {
  7627. return this._verticalScrollPosition
  7628. },
  7629. set: function(b) {
  7630. if (b != this._verticalScrollPosition) {
  7631. var a = this._verticalScrollPosition;
  7632. this._verticalScrollPosition = b;
  7633. this.scrollPositionChanged();
  7634. c.PropertyChangeEvent.dispatchPropertyChangeEvent(this, c.PropertyChangeEventKind.UPDATE, "verticalScrollPosition", a, b, this)
  7635. }
  7636. },
  7637. enumerable: !0,
  7638. configurable: !0
  7639. });
  7640. a.prototype.scrollPositionChanged = function() {
  7641. this._clipAndEnableScrolling && (this.updateScrollRect(this.width, this.height), this._invalidateDisplayListExceptLayout(), this._layout && this._layout.scrollPositionChanged())
  7642. };
  7643. a.prototype.updateScrollRect = function(b, a) {
  7644. var d = this._scrollRect;
  7645. this._clipAndEnableScrolling ? d ? (d.x = this._horizontalScrollPosition, d.y = this._verticalScrollPosition, d.width = b, d.height = a) : this._scrollRect = new c.Rectangle(this._horizontalScrollPosition, this._verticalScrollPosition, b, a) : d && (this._scrollRect = null)
  7646. };
  7647. a.prototype.measure = function() {
  7648. this._layout && this._layoutInvalidateSizeFlag && (d.prototype.measure.call(this), this._layout.measure())
  7649. };
  7650. a.prototype._invalidateDisplayListExceptLayout = function() {
  7651. d.prototype.invalidateDisplayList.call(this)
  7652. };
  7653. a.prototype.invalidateDisplayList = function() {
  7654. d.prototype.invalidateDisplayList.call(this);
  7655. this._layoutInvalidateDisplayListFlag = !0
  7656. };
  7657. a.prototype._childXYChanged = function() {
  7658. this.invalidateSize();
  7659. this.invalidateDisplayList()
  7660. };
  7661. a.prototype._invalidateSizeExceptLayout = function() {
  7662. d.prototype.invalidateSize.call(this)
  7663. };
  7664. a.prototype.invalidateSize = function() {
  7665. d.prototype.invalidateSize.call(this);
  7666. this._layoutInvalidateSizeFlag = !0
  7667. };
  7668. a.prototype.updateDisplayList = function(b, a) {
  7669. d.prototype.updateDisplayList.call(this, b, a);
  7670. this._layoutInvalidateDisplayListFlag && this._layout && (this._layoutInvalidateDisplayListFlag = !1, this._layout.updateDisplayList(b, a), this.updateScrollRect(b, a))
  7671. };
  7672. Object.defineProperty(a.prototype, "numElements", {
  7673. get: function() {
  7674. return - 1
  7675. },
  7676. enumerable: !0,
  7677. configurable: !0
  7678. });
  7679. a.prototype.getElementAt = function(b) {
  7680. return null
  7681. };
  7682. a.prototype.getElementIndex = function(b) {
  7683. return - 1
  7684. };
  7685. a.prototype.getElementIndicesInView = function() {
  7686. var b = [],
  7687. a;
  7688. if (this.scrollRect) for (a = 0; a < this.numChildren; a++) {
  7689. var d = this.getChildAt(a);
  7690. if (d) {
  7691. var e = new c.Rectangle;
  7692. e.x = d.layoutBoundsX;
  7693. e.y = d.layoutBoundsY;
  7694. e.width = d.layoutBoundsWidth;
  7695. e.height = d.layoutBoundsHeight;
  7696. this.scrollRect.intersects(e) && b.push(a)
  7697. }
  7698. } else for (a = 0; a < this.numChildren; a++) b.push(a);
  7699. return b
  7700. };
  7701. a.prototype.setVirtualElementIndicesInView = function(b, a) {};
  7702. a.prototype.getVirtualElementAt = function(b) {
  7703. return this.getElementAt(b)
  7704. };
  7705. return a
  7706. } (c.UIComponent);
  7707. c.GroupBase = e;
  7708. e.prototype.__class__ = "egret.GroupBase"
  7709. })(egret || (egret = {}));
  7710. __extends = this.__extends ||
  7711. function(c, e) {
  7712. function d() {
  7713. this.constructor = c
  7714. }
  7715. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  7716. d.prototype = e.prototype;
  7717. c.prototype = new d
  7718. }; (function(c) {
  7719. var e = function(c) {
  7720. function a() {
  7721. c.call(this);
  7722. this._selected = this.dataChangedFlag = !1;
  7723. this._itemIndex = -1;
  7724. this.touchChildren = !0
  7725. }
  7726. __extends(a, c);
  7727. Object.defineProperty(a.prototype, "data", {
  7728. get: function() {
  7729. return this._data
  7730. },
  7731. set: function(b) {
  7732. this._data = b;
  7733. this.initialized || this.parent ? (this.dataChangedFlag = !1, this.dataChanged()) : (this.dataChangedFlag = !0, this.invalidateProperties())
  7734. },
  7735. enumerable: !0,
  7736. configurable: !0
  7737. });
  7738. a.prototype.dataChanged = function() {};
  7739. Object.defineProperty(a.prototype, "selected", {
  7740. get: function() {
  7741. return this._selected
  7742. },
  7743. set: function(b) {
  7744. this._selected != b && (this._selected = b, this.invalidateSkinState())
  7745. },
  7746. enumerable: !0,
  7747. configurable: !0
  7748. });
  7749. Object.defineProperty(a.prototype, "itemIndex", {
  7750. get: function() {
  7751. return this._itemIndex
  7752. },
  7753. set: function(b) {
  7754. this._itemIndex = b
  7755. },
  7756. enumerable: !0,
  7757. configurable: !0
  7758. });
  7759. a.prototype.commitProperties = function() {
  7760. c.prototype.commitProperties.call(this);
  7761. this.dataChangedFlag && (this.dataChangedFlag = !1, this.dataChanged())
  7762. };
  7763. a.prototype.getCurrentSkinState = function() {
  7764. return this._selected ? "down": c.prototype.getCurrentSkinState.call(this)
  7765. };
  7766. return a
  7767. } (c.ButtonBase);
  7768. c.ItemRenderer = e;
  7769. e.prototype.__class__ = "egret.ItemRenderer"
  7770. })(egret || (egret = {}));
  7771. __extends = this.__extends ||
  7772. function(c, e) {
  7773. function d() {
  7774. this.constructor = c
  7775. }
  7776. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  7777. d.prototype = e.prototype;
  7778. c.prototype = new d
  7779. }; (function(c) {
  7780. var e = function(d) {
  7781. function a() {
  7782. d.call(this);
  7783. this._indentation = 17;
  7784. this._depth = 0;
  7785. this._isOpen = this._hasChildren = !1;
  7786. this.addEventListener(c.TouchEvent.TOUCH_BEGIN, this.onItemMouseDown, this, !1, 1E3)
  7787. }
  7788. __extends(a, d);
  7789. a.prototype.onItemMouseDown = function(b) {
  7790. b.target == this.disclosureButton && b.stopImmediatePropagation()
  7791. };
  7792. Object.defineProperty(a.prototype, "indentation", {
  7793. get: function() {
  7794. return this._indentation
  7795. },
  7796. set: function(b) {
  7797. this._indentation = b
  7798. },
  7799. enumerable: !0,
  7800. configurable: !0
  7801. });
  7802. Object.defineProperty(a.prototype, "iconSkinName", {
  7803. get: function() {
  7804. return this._iconSkinName
  7805. },
  7806. set: function(b) {
  7807. this._iconSkinName != b && (this._iconSkinName = b, this.iconDisplay && (this.iconDisplay.source = this._iconSkinName))
  7808. },
  7809. enumerable: !0,
  7810. configurable: !0
  7811. });
  7812. Object.defineProperty(a.prototype, "depth", {
  7813. get: function() {
  7814. return this._depth
  7815. },
  7816. set: function(b) {
  7817. b != this._depth && (this._depth = b, this.contentGroup && (this.contentGroup.x = this._depth * this._indentation))
  7818. },
  7819. enumerable: !0,
  7820. configurable: !0
  7821. });
  7822. Object.defineProperty(a.prototype, "hasChildren", {
  7823. get: function() {
  7824. return this._hasChildren
  7825. },
  7826. set: function(b) {
  7827. this._hasChildren != b && (this._hasChildren = b, this.disclosureButton && (this.disclosureButton.visible = this._hasChildren))
  7828. },
  7829. enumerable: !0,
  7830. configurable: !0
  7831. });
  7832. Object.defineProperty(a.prototype, "opened", {
  7833. get: function() {
  7834. return this._isOpen
  7835. },
  7836. set: function(b) {
  7837. this._isOpen != b && (this._isOpen = b, this.disclosureButton && (this.disclosureButton.selected = this._isOpen))
  7838. },
  7839. enumerable: !0,
  7840. configurable: !0
  7841. });
  7842. a.prototype.partAdded = function(b, a) {
  7843. d.prototype.partAdded.call(this, b, a);
  7844. a == this.iconDisplay ? this.iconDisplay.source = this._iconSkinName: a == this.disclosureButton ? (this.disclosureButton.visible = this._hasChildren, this.disclosureButton.selected = this._isOpen, this.disclosureButton._autoSelected = !1, this.disclosureButton.addEventListener(c.TouchEvent.TOUCH_BEGIN, this.disclosureButton_mouseDownHandler, this)) : a == this.contentGroup && (this.contentGroup.x = this._depth * this._indentation)
  7845. };
  7846. a.prototype.partRemoved = function(b, a) {
  7847. d.prototype.partRemoved.call(this, b, a);
  7848. a == this.iconDisplay ? this.iconDisplay.source = null: a == this.disclosureButton && (this.disclosureButton.removeEventListener(c.TouchEvent.TOUCH_BEGIN, this.disclosureButton_mouseDownHandler, this), this.disclosureButton._autoSelected = !0, this.disclosureButton.visible = !0)
  7849. };
  7850. a.prototype.disclosureButton_mouseDownHandler = function(b) {
  7851. c.TreeEvent.dispatchTreeEvent(this, c.TreeEvent.ITEM_OPENING, this.itemIndex, this.data, this, !this._isOpen)
  7852. };
  7853. return a
  7854. } (c.ItemRenderer);
  7855. c.TreeItemRenderer = e;
  7856. e.prototype.__class__ = "egret.TreeItemRenderer"
  7857. })(egret || (egret = {})); (function(c) {
  7858. var e = function() {
  7859. function d(a, b) {
  7860. this.easerFunction = c.Ease.sineInOut;
  7861. this._duration = 500;
  7862. this._startDelay = 0;
  7863. this._repeatCount = 1;
  7864. this._repeatDelay = 0;
  7865. this.motionPaths = [];
  7866. this._currentValue = {};
  7867. this.pauseTime = 0;
  7868. this._isPaused = !1;
  7869. this.startTime = 0;
  7870. this._started = !1;
  7871. this.playedTimes = 0;
  7872. this.updateFunction = a;
  7873. this.thisObject = b
  7874. }
  7875. Object.defineProperty(d.prototype, "isPlaying", {
  7876. get: function() {
  7877. return this._isPlaying
  7878. },
  7879. enumerable: !0,
  7880. configurable: !0
  7881. });
  7882. Object.defineProperty(d.prototype, "duration", {
  7883. get: function() {
  7884. return this._duration
  7885. },
  7886. set: function(a) {
  7887. this._duration = a
  7888. },
  7889. enumerable: !0,
  7890. configurable: !0
  7891. });
  7892. Object.defineProperty(d.prototype, "startDelay", {
  7893. get: function() {
  7894. return this._startDelay
  7895. },
  7896. set: function(a) {
  7897. this._startDelay = a
  7898. },
  7899. enumerable: !0,
  7900. configurable: !0
  7901. });
  7902. Object.defineProperty(d.prototype, "repeatCount", {
  7903. get: function() {
  7904. return this._repeatCount
  7905. },
  7906. set: function(a) {
  7907. this._repeatCount = a
  7908. },
  7909. enumerable: !0,
  7910. configurable: !0
  7911. });
  7912. Object.defineProperty(d.prototype, "repeatDelay", {
  7913. get: function() {
  7914. return this._repeatDelay
  7915. },
  7916. set: function(a) {
  7917. this._repeatDelay = a
  7918. },
  7919. enumerable: !0,
  7920. configurable: !0
  7921. });
  7922. Object.defineProperty(d.prototype, "currentValue", {
  7923. get: function() {
  7924. return this._currentValue
  7925. },
  7926. enumerable: !0,
  7927. configurable: !0
  7928. });
  7929. d.prototype.play = function() {
  7930. this.stopAnimation();
  7931. this.start()
  7932. };
  7933. d.prototype.seek = function(a) {
  7934. a = Math.min(a, this.duration);
  7935. this.caculateCurrentValue(a / this.duration);
  7936. this.startTime = c.getTimer() - a - this._startDelay;
  7937. null != this.updateFunction && this.updateFunction.call(this.thisObject, this)
  7938. };
  7939. d.prototype.start = function() {
  7940. this.playedTimes = 0;
  7941. this._started = !0;
  7942. this._isPlaying = !1;
  7943. this._currentValue = {};
  7944. this.caculateCurrentValue(0);
  7945. this.startTime = c.getTimer();
  7946. d.currentTime = this.startTime;
  7947. this.doInterval();
  7948. d.addAnimation(this)
  7949. };
  7950. d.prototype.end = function() {
  7951. this._started || (this.caculateCurrentValue(0), null != this.startFunction && this.startFunction.call(this.thisObject, this), null != this.updateFunction && this.updateFunction.call(this.thisObject, this));
  7952. this.caculateCurrentValue(1);
  7953. null != this.updateFunction && this.updateFunction.call(this.thisObject, this);
  7954. this.stopAnimation();
  7955. null != this.endFunction && this.endFunction.call(this.thisObject, this)
  7956. };
  7957. d.prototype.stop = function() {
  7958. this.stopAnimation();
  7959. null != this.stopFunction && this.stopFunction.call(this.thisObject, this)
  7960. };
  7961. d.prototype.stopAnimation = function() {
  7962. this.playedTimes = 0;
  7963. this._isPlaying = !1;
  7964. this.startTime = 0;
  7965. this._started = !1;
  7966. d.removeAnimation(this)
  7967. };
  7968. Object.defineProperty(d.prototype, "isPaused", {
  7969. get: function() {
  7970. return this._isPaused
  7971. },
  7972. enumerable: !0,
  7973. configurable: !0
  7974. });
  7975. d.prototype.pause = function() {
  7976. this._started && (this._isPaused = !0, this.pauseTime = c.getTimer(), this._isPlaying = !1, d.removeAnimation(this))
  7977. };
  7978. d.prototype.resume = function() {
  7979. this._started && this._isPaused && (this._isPaused = !1, this.startTime += c.getTimer() - this.pauseTime, this.pauseTime = -1, d.addAnimation(this))
  7980. };
  7981. Object.defineProperty(d.prototype, "started", {
  7982. get: function() {
  7983. return this._started
  7984. },
  7985. enumerable: !0,
  7986. configurable: !0
  7987. });
  7988. d.prototype.doInterval = function() {
  7989. var a = d.currentTime - this.startTime - (0 < this.playedTimes ? this._repeatDelay: this._startDelay);
  7990. if (0 > a) return ! 1;
  7991. this._isPlaying || (this._isPlaying = !0, 0 == this.playedTimes && null != this.startFunction && this.startFunction.call(this.thisObject, this));
  7992. var b = 0 == this._duration ? 1 : Math.min(a, this._duration) / this._duration;
  7993. this.caculateCurrentValue(b);
  7994. null != this.updateFunction && this.updateFunction.call(this.thisObject, this);
  7995. if (a = a >= this._duration) this.playedTimes++,
  7996. this._isPlaying = !1,
  7997. this.startTime = d.currentTime,
  7998. 0 == this._repeatCount || this.playedTimes < this._repeatCount ? a = !1 : (d.removeAnimation(this), this._started = !1, this.playedTimes = 0);
  7999. a && null != this.endFunction && this.endFunction.call(this.thisObject, this);
  8000. return a
  8001. };
  8002. d.prototype.caculateCurrentValue = function(a) {
  8003. this.easerFunction && (a = this.easerFunction(a));
  8004. for (var b = this.motionPaths,
  8005. c = b.length,
  8006. d = 0; d < c; d++) {
  8007. var e = b[d];
  8008. this.currentValue[e.prop] = e.from + (e.to - e.from) * a
  8009. }
  8010. };
  8011. d.addAnimation = function(a) { - 1 == d.activeAnimations.indexOf(a) && (d.activeAnimations.push(a), d.registered || (d.registered = !0, c.Ticker.getInstance().register(d.onEnterFrame, null)))
  8012. };
  8013. d.removeAnimation = function(a) {
  8014. a = d.activeAnimations.indexOf(a); - 1 != a && (d.activeAnimations.splice(a, 1), a <= d.currentIntervalIndex && d.currentIntervalIndex--);
  8015. 0 == d.activeAnimations.length && d.registered && (d.registered = !1, c.Ticker.getInstance().unregister(d.onEnterFrame, null))
  8016. };
  8017. d.onEnterFrame = function(a, b) {
  8018. d.currentTime = c.getTimer();
  8019. for (d.currentIntervalIndex = 0; d.currentIntervalIndex < d.activeAnimations.length;) d.activeAnimations[d.currentIntervalIndex].doInterval(),
  8020. d.currentIntervalIndex++;
  8021. d.currentIntervalIndex = -1;
  8022. 0 == d.activeAnimations.length && d.registered && (d.registered = !1, c.Ticker.getInstance().unregister(d.onEnterFrame, null))
  8023. };
  8024. d.currentTime = 0;
  8025. d.TIMER_RESOLUTION = 1E3 / 60;
  8026. d.activeAnimations = [];
  8027. d.currentIntervalIndex = -1;
  8028. return d
  8029. } ();
  8030. c.Animation = e;
  8031. e.prototype.__class__ = "egret.Animation"
  8032. })(egret || (egret = {}));
  8033. __extends = this.__extends ||
  8034. function(c, e) {
  8035. function d() {
  8036. this.constructor = c
  8037. }
  8038. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  8039. d.prototype = e.prototype;
  8040. c.prototype = new d
  8041. }; (function(c) {
  8042. var e = function(c) {
  8043. function a() {
  8044. c.call(this);
  8045. this._maximum = 100;
  8046. this.maxChanged = !1;
  8047. this._minimum = 0;
  8048. this.minChanged = !1;
  8049. this._stepSize = 1;
  8050. this.stepSizeChanged = !1;
  8051. this._changedValue = this._value = 0;
  8052. this.valueChanged = !1;
  8053. this._snapInterval = 1;
  8054. this._explicitSnapInterval = this.snapIntervalChanged = !1
  8055. }
  8056. __extends(a, c);
  8057. Object.defineProperty(a.prototype, "maximum", {
  8058. get: function() {
  8059. return this._maximum
  8060. },
  8061. set: function(b) {
  8062. this._setMaximun(b)
  8063. },
  8064. enumerable: !0,
  8065. configurable: !0
  8066. });
  8067. a.prototype._setMaximun = function(b) {
  8068. b != this._maximum && (this._maximum = b, this.maxChanged = !0, this.invalidateProperties())
  8069. };
  8070. Object.defineProperty(a.prototype, "minimum", {
  8071. get: function() {
  8072. return this._minimum
  8073. },
  8074. set: function(b) {
  8075. this._setMinimun(b)
  8076. },
  8077. enumerable: !0,
  8078. configurable: !0
  8079. });
  8080. a.prototype._setMinimun = function(b) {
  8081. b != this._minimum && (this._minimum = b, this.minChanged = !0, this.invalidateProperties())
  8082. };
  8083. Object.defineProperty(a.prototype, "stepSize", {
  8084. get: function() {
  8085. return this._stepSize
  8086. },
  8087. set: function(b) {
  8088. b != this._stepSize && (this._stepSize = b, this.stepSizeChanged = !0, this.invalidateProperties())
  8089. },
  8090. enumerable: !0,
  8091. configurable: !0
  8092. });
  8093. Object.defineProperty(a.prototype, "value", {
  8094. get: function() {
  8095. return this._getValue()
  8096. },
  8097. set: function(b) {
  8098. this._setValue(b)
  8099. },
  8100. enumerable: !0,
  8101. configurable: !0
  8102. });
  8103. a.prototype._setValue = function(b) {
  8104. b != this.value && (this._changedValue = b, this.valueChanged = !0, this.invalidateProperties())
  8105. };
  8106. a.prototype._getValue = function() {
  8107. return this.valueChanged ? this._changedValue: this._value
  8108. };
  8109. Object.defineProperty(a.prototype, "snapInterval", {
  8110. get: function() {
  8111. return this._snapInterval
  8112. },
  8113. set: function(b) {
  8114. this._explicitSnapInterval = !0;
  8115. b != this._snapInterval && (isNaN(b) ? (this._snapInterval = 1, this._explicitSnapInterval = !1) : this._snapInterval = b, this.stepSizeChanged = this.snapIntervalChanged = !0, this.invalidateProperties())
  8116. },
  8117. enumerable: !0,
  8118. configurable: !0
  8119. });
  8120. a.prototype.commitProperties = function() {
  8121. c.prototype.commitProperties.call(this);
  8122. this.minimum > this.maximum && (this.maxChanged ? this._maximum = this._minimum: this._minimum = this._maximum);
  8123. if (this.valueChanged || this.maxChanged || this.minChanged || this.snapIntervalChanged) {
  8124. var b = this.valueChanged ? this._changedValue: this._value;
  8125. this.snapIntervalChanged = this.minChanged = this.maxChanged = this.valueChanged = !1;
  8126. this.setValue(this.nearestValidValue(b, this.snapInterval))
  8127. }
  8128. this.stepSizeChanged && (this._explicitSnapInterval ? this._stepSize = this.nearestValidSize(this._stepSize) : (this._snapInterval = this._stepSize, this.setValue(this.nearestValidValue(this._value, this.snapInterval))), this.stepSizeChanged = !1)
  8129. };
  8130. a.prototype.nearestValidSize = function(b) {
  8131. var a = this.snapInterval;
  8132. if (0 == a) return b;
  8133. b = Math.round(b / a) * a;
  8134. return Math.abs(b) < a ? a: b
  8135. };
  8136. a.prototype.nearestValidValue = function(b, a) {
  8137. if (0 == a) return Math.max(this.minimum, Math.min(this.maximum, b));
  8138. var c = this.maximum - this.minimum,
  8139. d = 1;
  8140. b -= this.minimum;
  8141. a != Math.round(a) && (d = (1 + a).toString().split("."), d = Math.pow(10, d[1].length), c *= d, b = Math.round(b * d), a = Math.round(a * d));
  8142. var e = Math.max(0, Math.floor(b / a) * a),
  8143. c = Math.min(c, Math.floor((b + a) / a) * a);
  8144. return (b - e >= (c - e) / 2 ? c: e) / d + this.minimum
  8145. };
  8146. a.prototype.setValue = function(b) {
  8147. this._value != b && (isNaN(b) && (b = 0), !isNaN(this.maximum) && !isNaN(this.minimum) && this.maximum > this.minimum ? this._value = Math.min(this.maximum, Math.max(this.minimum, b)) : this._value = b, this.valueChanged = !1)
  8148. };
  8149. a.prototype.changeValueByStep = function(b) {
  8150. "undefined" === typeof b && (b = !0);
  8151. 0 != this.stepSize && this.setValue(this.nearestValidValue(b ? this.value + this.stepSize: this.value - this.stepSize, this.snapInterval))
  8152. };
  8153. return a
  8154. } (c.SkinnableComponent);
  8155. c.Range = e;
  8156. e.prototype.__class__ = "egret.Range"
  8157. })(egret || (egret = {}));
  8158. __extends = this.__extends ||
  8159. function(c, e) {
  8160. function d() {
  8161. this.constructor = c
  8162. }
  8163. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  8164. d.prototype = e.prototype;
  8165. c.prototype = new d
  8166. }; (function(c) {
  8167. var e = function(d) {
  8168. function a() {
  8169. d.call(this);
  8170. this._slideDuration = 300;
  8171. this.needUpdateValue = !1;
  8172. this.addEventListener(c.Event.ADDED_TO_STAGE, this.addedToStageHandler, this);
  8173. this.addEventListener(c.TouchEvent.TOUCH_BEGIN, this.mouseDownHandler, this)
  8174. }
  8175. __extends(a, d);
  8176. Object.defineProperty(a.prototype, "slideDuration", {
  8177. get: function() {
  8178. return this._slideDuration
  8179. },
  8180. set: function(b) {
  8181. this._slideDuration = b
  8182. },
  8183. enumerable: !0,
  8184. configurable: !0
  8185. });
  8186. Object.defineProperty(a.prototype, "maximum", {
  8187. get: function() {
  8188. return this._maximum
  8189. },
  8190. set: function(b) {
  8191. b != this._maximum && (this._setMaximun(b), this.invalidateDisplayList())
  8192. },
  8193. enumerable: !0,
  8194. configurable: !0
  8195. });
  8196. Object.defineProperty(a.prototype, "minimum", {
  8197. get: function() {
  8198. return this._minimum
  8199. },
  8200. set: function(b) {
  8201. b != this._minimum && (this._setMinimun(b), this.invalidateDisplayList())
  8202. },
  8203. enumerable: !0,
  8204. configurable: !0
  8205. });
  8206. Object.defineProperty(a.prototype, "value", {
  8207. get: function() {
  8208. return this._getValue()
  8209. },
  8210. set: function(b) {
  8211. b != this._getValue() && (this._setValue(b), this.invalidateDisplayList())
  8212. },
  8213. enumerable: !0,
  8214. configurable: !0
  8215. });
  8216. a.prototype.setValue = function(b) {
  8217. d.prototype.setValue.call(this, b);
  8218. this.invalidateDisplayList()
  8219. };
  8220. a.prototype.pointToValue = function(b, a) {
  8221. return this.minimum
  8222. };
  8223. a.prototype.changeValueByStep = function(b) {
  8224. "undefined" === typeof b && (b = !0);
  8225. var a = this.value;
  8226. d.prototype.changeValueByStep.call(this, b);
  8227. this.value != a && this.dispatchEventWith(c.Event.CHANGE)
  8228. };
  8229. a.prototype.partAdded = function(b, a) {
  8230. d.prototype.partAdded.call(this, b, a);
  8231. a == this.thumb ? (this.thumb.addEventListener(c.TouchEvent.TOUCH_BEGIN, this.thumb_mouseDownHandler, this), this.thumb.addEventListener(c.ResizeEvent.RESIZE, this.thumb_resizeHandler, this), this.thumb.addEventListener(c.UIEvent.UPDATE_COMPLETE, this.thumb_updateCompleteHandler, this), this.thumb.stickyHighlighting = !0) : a == this.track && (this.track.addEventListener(c.TouchEvent.TOUCH_BEGIN, this.track_mouseDownHandler, this), this.track.addEventListener(c.ResizeEvent.RESIZE, this.track_resizeHandler, this))
  8232. };
  8233. a.prototype.partRemoved = function(b, a) {
  8234. d.prototype.partRemoved.call(this, b, a);
  8235. a == this.thumb ? (this.thumb.removeEventListener(c.TouchEvent.TOUCH_BEGIN, this.thumb_mouseDownHandler, this), this.thumb.removeEventListener(c.ResizeEvent.RESIZE, this.thumb_resizeHandler, this), this.thumb.removeEventListener(c.UIEvent.UPDATE_COMPLETE, this.thumb_updateCompleteHandler, this)) : a == this.track && (this.track.removeEventListener(c.TouchEvent.TOUCH_BEGIN, this.track_mouseDownHandler, this), this.track.removeEventListener(c.ResizeEvent.RESIZE, this.track_resizeHandler, this))
  8236. };
  8237. a.prototype.updateDisplayList = function(b, a) {
  8238. d.prototype.updateDisplayList.call(this, b, a);
  8239. this.updateSkinDisplayList()
  8240. };
  8241. a.prototype.updateSkinDisplayList = function() {};
  8242. a.prototype.addedToStageHandler = function(b) {
  8243. this.updateSkinDisplayList()
  8244. };
  8245. a.prototype.track_resizeHandler = function(b) {
  8246. this.updateSkinDisplayList()
  8247. };
  8248. a.prototype.thumb_resizeHandler = function(b) {
  8249. this.updateSkinDisplayList()
  8250. };
  8251. a.prototype.thumb_updateCompleteHandler = function(b) {
  8252. this.updateSkinDisplayList();
  8253. this.thumb.removeEventListener(c.UIEvent.UPDATE_COMPLETE, this.thumb_updateCompleteHandler, this)
  8254. };
  8255. a.prototype.thumb_mouseDownHandler = function(b) {
  8256. c.UIGlobals.stage.addEventListener(c.TouchEvent.TOUCH_MOVE, this.stage_mouseMoveHandler, this);
  8257. c.UIGlobals.stage.addEventListener(c.TouchEvent.TOUCH_END, this.stage_mouseUpHandler, this);
  8258. c.UIGlobals.stage.addEventListener(c.Event.LEAVE_STAGE, this.stage_mouseUpHandler, this);
  8259. this.addEventListener(c.Event.ENTER_FRAME, this.onEnterFrame, this);
  8260. b = this.thumb.globalToLocal(b.stageX, b.stageY, c.Point.identity);
  8261. this._clickOffsetX = b.x;
  8262. this._clickOffsetY = b.y;
  8263. c.TrackBaseEvent.dispatchTrackBaseEvent(this, c.TrackBaseEvent.THUMB_PRESS);
  8264. c.UIEvent.dispatchUIEvent(this, c.UIEvent.CHANGE_START)
  8265. };
  8266. a.prototype.onEnterFrame = function(b) {
  8267. this.needUpdateValue && this.track && (this.updateWhenMouseMove(), this.needUpdateValue = !1)
  8268. };
  8269. a.prototype.updateWhenMouseMove = function() {
  8270. if (this.track) {
  8271. var b = this.track.globalToLocal(this._moveStageX, this._moveStageY, c.Point.identity),
  8272. b = this.pointToValue(b.x - this._clickOffsetX, b.y - this._clickOffsetY),
  8273. b = this.nearestValidValue(b, this.snapInterval);
  8274. b != this.value && (this.setValue(b), this.validateDisplayList(), c.TrackBaseEvent.dispatchTrackBaseEvent(this, c.TrackBaseEvent.THUMB_DRAG), this.dispatchEventWith(c.Event.CHANGE))
  8275. }
  8276. };
  8277. a.prototype.stage_mouseMoveHandler = function(b) {
  8278. this._moveStageX = b.stageX;
  8279. this._moveStageY = b.stageY;
  8280. this.needUpdateValue || (this.needUpdateValue = !0)
  8281. };
  8282. a.prototype.stage_mouseUpHandler = function(b) {
  8283. c.UIGlobals.stage.removeEventListener(c.TouchEvent.TOUCH_MOVE, this.stage_mouseMoveHandler, this);
  8284. c.UIGlobals.stage.removeEventListener(c.TouchEvent.TOUCH_END, this.stage_mouseUpHandler, this);
  8285. c.UIGlobals.stage.removeEventListener(c.Event.LEAVE_STAGE, this.stage_mouseUpHandler, this);
  8286. this.removeEventListener(c.Event.ENTER_FRAME, this.updateWhenMouseMove, this);
  8287. this.needUpdateValue && (this.updateWhenMouseMove(), this.needUpdateValue = !1);
  8288. c.TrackBaseEvent.dispatchTrackBaseEvent(this, c.TrackBaseEvent.THUMB_RELEASE);
  8289. c.UIEvent.dispatchUIEvent(this, c.UIEvent.CHANGE_END)
  8290. };
  8291. a.prototype.track_mouseDownHandler = function(b) {};
  8292. a.prototype.mouseDownHandler = function(b) {
  8293. c.UIGlobals.stage.addEventListener(c.TouchEvent.TOUCH_END, this.stage_mouseUpSomewhereHandler, this);
  8294. c.UIGlobals.stage.addEventListener(c.Event.LEAVE_STAGE, this.stage_mouseUpSomewhereHandler, this);
  8295. this.mouseDownTarget = b.target
  8296. };
  8297. a.prototype.stage_mouseUpSomewhereHandler = function(b) {
  8298. c.UIGlobals.stage.removeEventListener(c.TouchEvent.TOUCH_END, this.stage_mouseUpSomewhereHandler, this);
  8299. c.UIGlobals.stage.removeEventListener(c.Event.LEAVE_STAGE, this.stage_mouseUpSomewhereHandler, this);
  8300. if (this.mouseDownTarget != b.target && b instanceof c.TouchEvent && this.contains(b.target)) {
  8301. var a = b.target.localToGlobal(b.localX, b.localY);
  8302. c.TouchEvent.dispatchTouchEvent(this, c.TouchEvent.TOUCH_TAP, b.touchPointID, a.x, a.y, b.ctrlKey, b.altKey, b.shiftKey, b.touchDown)
  8303. }
  8304. this.mouseDownTarget = null
  8305. };
  8306. return a
  8307. } (c.Range);
  8308. c.TrackBase = e;
  8309. e.prototype.__class__ = "egret.TrackBase"
  8310. })(egret || (egret = {}));
  8311. __extends = this.__extends ||
  8312. function(c, e) {
  8313. function d() {
  8314. this.constructor = c
  8315. }
  8316. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  8317. d.prototype = e.prototype;
  8318. c.prototype = new d
  8319. }; (function(c) {
  8320. var e = function(d) {
  8321. function a() {
  8322. d.call(this);
  8323. this._showTrackHighlight = !0;
  8324. this._pendingValue = 0;
  8325. this._liveDragging = !0;
  8326. this.maximum = 10
  8327. }
  8328. __extends(a, d);
  8329. Object.defineProperty(a.prototype, "showTrackHighlight", {
  8330. get: function() {
  8331. return this._showTrackHighlight
  8332. },
  8333. set: function(b) {
  8334. this._showTrackHighlight != b && (this._showTrackHighlight = b, this.trackHighlight && (this.trackHighlight.visible = b), this.invalidateDisplayList())
  8335. },
  8336. enumerable: !0,
  8337. configurable: !0
  8338. });
  8339. Object.defineProperty(a.prototype, "pendingValue", {
  8340. get: function() {
  8341. return this._pendingValue
  8342. },
  8343. set: function(b) {
  8344. b != this._pendingValue && (this._pendingValue = b, this.invalidateDisplayList())
  8345. },
  8346. enumerable: !0,
  8347. configurable: !0
  8348. });
  8349. a.prototype.setValue = function(b) {
  8350. this._pendingValue = b;
  8351. d.prototype.setValue.call(this, b)
  8352. };
  8353. a.prototype.animationUpdateHandler = function(b) {
  8354. this.pendingValue = b.currentValue.value
  8355. };
  8356. a.prototype.animationEndHandler = function(b) {
  8357. this.setValue(this.slideToValue);
  8358. this.dispatchEventWith(c.Event.CHANGE);
  8359. c.UIEvent.dispatchUIEvent(this, c.UIEvent.CHANGE_END)
  8360. };
  8361. a.prototype.stopAnimation = function() {
  8362. this.animator.stop();
  8363. this.setValue(this.nearestValidValue(this.pendingValue, this.snapInterval));
  8364. this.dispatchEventWith(c.Event.CHANGE);
  8365. c.UIEvent.dispatchUIEvent(this, c.UIEvent.CHANGE_END)
  8366. };
  8367. a.prototype.thumb_mouseDownHandler = function(b) {
  8368. this.animator && this.animator.isPlaying && this.stopAnimation();
  8369. d.prototype.thumb_mouseDownHandler.call(this, b)
  8370. };
  8371. Object.defineProperty(a.prototype, "liveDragging", {
  8372. get: function() {
  8373. return this._liveDragging
  8374. },
  8375. set: function(b) {
  8376. this._liveDragging = b
  8377. },
  8378. enumerable: !0,
  8379. configurable: !0
  8380. });
  8381. a.prototype.updateWhenMouseMove = function() {
  8382. if (this.track) {
  8383. var b = this.track.globalToLocal(this._moveStageX, this._moveStageY, c.Point.identity),
  8384. b = this.pointToValue(b.x - this._clickOffsetX, b.y - this._clickOffsetY),
  8385. b = this.nearestValidValue(b, this.snapInterval);
  8386. b != this.pendingValue && (c.TrackBaseEvent.dispatchTrackBaseEvent(this, c.TrackBaseEvent.THUMB_DRAG), !0 == this.liveDragging ? (this.setValue(b), this.dispatchEventWith(c.Event.CHANGE)) : this.pendingValue = b)
  8387. }
  8388. };
  8389. a.prototype.stage_mouseUpHandler = function(b) {
  8390. d.prototype.stage_mouseUpHandler.call(this, b); ! 1 == this.liveDragging && this.value != this.pendingValue && (this.setValue(this.pendingValue), this.dispatchEventWith(c.Event.CHANGE))
  8391. };
  8392. a.prototype.track_mouseDownHandler = function(b) {
  8393. this.enabled && (b = this.track.globalToLocal(b.stageX - (this.thumb ? this.thumb.width: 0) / 2, b.stageY - (this.thumb ? this.thumb.height: 0) / 2, c.Point.identity), b = this.pointToValue(b.x, b.y), b = this.nearestValidValue(b, this.snapInterval), b != this.pendingValue && (0 != this.slideDuration ? (this.animator || (this.animator = new c.Animation(this.animationUpdateHandler, this), this.animator.endFunction = this.animationEndHandler), this.animator.isPlaying && this.stopAnimation(), this.slideToValue = b, this.animator.duration = this.slideDuration * (Math.abs(this.pendingValue - this.slideToValue) / (this.maximum - this.minimum)), this.animator.motionPaths = [{
  8394. prop: "value",
  8395. from: this.pendingValue,
  8396. to: this.slideToValue
  8397. }], c.UIEvent.dispatchUIEvent(this, c.UIEvent.CHANGE_START), this.animator.play()) : (this.setValue(b), this.dispatchEventWith(c.Event.CHANGE))))
  8398. };
  8399. a.prototype.partAdded = function(b, a) {
  8400. d.prototype.partAdded.call(this, b, a);
  8401. a == this.trackHighlight && (this.trackHighlight.touchEnabled = !1, this.trackHighlight instanceof c.DisplayObjectContainer && (this.trackHighlight.touchChildren = !1), this.trackHighlight.visible = this._showTrackHighlight)
  8402. };
  8403. return a
  8404. } (c.TrackBase);
  8405. c.SliderBase = e;
  8406. e.prototype.__class__ = "egret.SliderBase"
  8407. })(egret || (egret = {}));
  8408. __extends = this.__extends ||
  8409. function(c, e) {
  8410. function d() {
  8411. this.constructor = c
  8412. }
  8413. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  8414. d.prototype = e.prototype;
  8415. c.prototype = new d
  8416. }; (function(c) {
  8417. var e = function(d) {
  8418. function a() {
  8419. d.call(this);
  8420. this._maxDisplayedLines = 0;
  8421. this.lastUnscaledWidth = NaN;
  8422. this._padding = 0;
  8423. this._paddingBottom = this._paddingTop = this._paddingRight = this._paddingLeft = NaN;
  8424. this.addEventListener(c.UIEvent.UPDATE_COMPLETE, this.updateCompleteHandler, this)
  8425. }
  8426. __extends(a, d);
  8427. a.prototype.updateCompleteHandler = function(b) {
  8428. this.lastUnscaledWidth = NaN
  8429. };
  8430. Object.defineProperty(a.prototype, "maxDisplayedLines", {
  8431. get: function() {
  8432. return this._maxDisplayedLines
  8433. },
  8434. set: function(b) {
  8435. this._maxDisplayedLines != b && (this._maxDisplayedLines = b, this.invalidateSize(), this.invalidateDisplayList())
  8436. },
  8437. enumerable: !0,
  8438. configurable: !0
  8439. });
  8440. Object.defineProperty(a.prototype, "padding", {
  8441. get: function() {
  8442. return this._padding
  8443. },
  8444. set: function(b) {
  8445. this._padding != b && (this._padding = b, this.invalidateSize(), this.invalidateDisplayList())
  8446. },
  8447. enumerable: !0,
  8448. configurable: !0
  8449. });
  8450. Object.defineProperty(a.prototype, "paddingLeft", {
  8451. get: function() {
  8452. return this._paddingLeft
  8453. },
  8454. set: function(b) {
  8455. this._paddingLeft != b && (this._paddingLeft = b, this.invalidateSize(), this.invalidateDisplayList())
  8456. },
  8457. enumerable: !0,
  8458. configurable: !0
  8459. });
  8460. Object.defineProperty(a.prototype, "paddingRight", {
  8461. get: function() {
  8462. return this._paddingRight
  8463. },
  8464. set: function(b) {
  8465. this._paddingRight != b && (this._paddingRight = b, this.invalidateSize(), this.invalidateDisplayList())
  8466. },
  8467. enumerable: !0,
  8468. configurable: !0
  8469. });
  8470. Object.defineProperty(a.prototype, "paddingTop", {
  8471. get: function() {
  8472. return this._paddingTop
  8473. },
  8474. set: function(b) {
  8475. this._paddingTop != b && (this._paddingTop = b, this.invalidateSize(), this.invalidateDisplayList())
  8476. },
  8477. enumerable: !0,
  8478. configurable: !0
  8479. });
  8480. Object.defineProperty(a.prototype, "paddingBottom", {
  8481. get: function() {
  8482. return this._paddingBottom
  8483. },
  8484. set: function(b) {
  8485. this._paddingBottom != b && (this._paddingBottom = b, this.invalidateSize(), this.invalidateDisplayList())
  8486. },
  8487. enumerable: !0,
  8488. configurable: !0
  8489. });
  8490. a.prototype.measure = function() {
  8491. this._invalidatePropertiesFlag && this.validateProperties();
  8492. if (this.isSpecialCase()) if (isNaN(this.lastUnscaledWidth)) this._oldPreferHeight = this._oldPreferWidth = NaN;
  8493. else {
  8494. this.measureUsingWidth(this.lastUnscaledWidth);
  8495. return
  8496. }
  8497. var b;
  8498. isNaN(this.explicitWidth) ? 1E4 != this.maxWidth && (b = this.maxWidth) : b = this.explicitWidth;
  8499. this.measureUsingWidth(b)
  8500. };
  8501. a.prototype.isSpecialCase = function() {
  8502. return 1 != this._maxDisplayedLines && (!isNaN(this.percentWidth) || !isNaN(this.left) && !isNaN(this.right)) && isNaN(this.explicitHeight) && isNaN(this.percentHeight)
  8503. };
  8504. a.prototype.measureUsingWidth = function(b) {
  8505. var a = this._textField.text;
  8506. this._textChanged && (this._textField.text = this._text);
  8507. var c = isNaN(this._padding) ? 0 : this._padding,
  8508. d = isNaN(this._paddingLeft) ? c: this._paddingLeft,
  8509. e = isNaN(this._paddingRight) ? c: this._paddingRight,
  8510. h = isNaN(this._paddingTop) ? c: this._paddingTop,
  8511. c = isNaN(this._paddingBottom) ? c: this._paddingBottom;
  8512. this._textField.width = NaN;
  8513. this._textField.height = NaN;
  8514. isNaN(b) || (this._textField.width = b - d - e);
  8515. this.measuredWidth = Math.ceil(this._textField.measuredWidth);
  8516. this.measuredHeight = Math.ceil(this._textField.measuredHeight);
  8517. 0 < this._maxDisplayedLines && this._textField.numLines > this._maxDisplayedLines && (b = this._textField.lineSpacing, this.measuredHeight = (this._textField.size + b) * this._maxDisplayedLines - b);
  8518. this.measuredWidth += d + e;
  8519. this.measuredHeight += h + c;
  8520. this._textField.text = a
  8521. };
  8522. a.prototype.updateDisplayList = function(b, a) {
  8523. this.$updateDisplayList(b, a);
  8524. var c = isNaN(this._padding) ? 0 : this._padding,
  8525. d = isNaN(this._paddingLeft) ? c: this._paddingLeft,
  8526. e = isNaN(this._paddingRight) ? c: this._paddingRight,
  8527. h = isNaN(this._paddingTop) ? c: this._paddingTop,
  8528. c = isNaN(this._paddingBottom) ? c: this._paddingBottom;
  8529. this._textField.x = d;
  8530. this._textField.y = h;
  8531. if (this.isSpecialCase()) {
  8532. var l = isNaN(this.lastUnscaledWidth) || this.lastUnscaledWidth != b;
  8533. this.lastUnscaledWidth = b;
  8534. if (l) {
  8535. this._oldPreferHeight = this._oldPreferWidth = NaN;
  8536. this.invalidateSize();
  8537. return
  8538. }
  8539. }
  8540. this._invalidateSizeFlag && this.validateSize();
  8541. this._textField.visible || (this._textField.visible = !0);
  8542. this._textField.width = b - d - e;
  8543. d = a - h - c;
  8544. this._textField.height = d;
  8545. 0 < this._maxDisplayedLines && this._textField.numLines > this._maxDisplayedLines && (e = this._textField.lineSpacing, this._textField.height = Math.min(d, (this._textField.size + e) * this._maxDisplayedLines - e))
  8546. };
  8547. return a
  8548. } (c.TextBase);
  8549. c.Label = e;
  8550. e.prototype.__class__ = "egret.Label"
  8551. })(egret || (egret = {}));
  8552. __extends = this.__extends ||
  8553. function(c, e) {
  8554. function d() {
  8555. this.constructor = c
  8556. }
  8557. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  8558. d.prototype = e.prototype;
  8559. c.prototype = new d
  8560. }; (function(c) {
  8561. var e = function(d) {
  8562. function a() {
  8563. d.call(this);
  8564. this._fillColor = 16777215;
  8565. this._fillAlpha = 1;
  8566. this._strokeColor = 4473924;
  8567. this._strokeAlpha = 0;
  8568. this._strokeWeight = 1;
  8569. this.touchChildren = !1
  8570. }
  8571. __extends(a, d);
  8572. Object.defineProperty(a.prototype, "graphics", {
  8573. get: function() {
  8574. this._graphics || (this._graphics = new c.Graphics);
  8575. return this._graphics
  8576. },
  8577. enumerable: !0,
  8578. configurable: !0
  8579. });
  8580. a.prototype._render = function(b) {
  8581. this._graphics && this._graphics._draw(b);
  8582. d.prototype._render.call(this, b)
  8583. };
  8584. Object.defineProperty(a.prototype, "fillColor", {
  8585. get: function() {
  8586. return this._fillColor
  8587. },
  8588. set: function(b) {
  8589. this._fillColor != b && (this._fillColor = b, this.invalidateDisplayList())
  8590. },
  8591. enumerable: !0,
  8592. configurable: !0
  8593. });
  8594. Object.defineProperty(a.prototype, "fillAlpha", {
  8595. get: function() {
  8596. return this._fillAlpha
  8597. },
  8598. set: function(b) {
  8599. this._fillAlpha != b && (this._fillAlpha = b, this.invalidateDisplayList())
  8600. },
  8601. enumerable: !0,
  8602. configurable: !0
  8603. });
  8604. Object.defineProperty(a.prototype, "strokeColor", {
  8605. get: function() {
  8606. return this._strokeColor
  8607. },
  8608. set: function(b) {
  8609. this._strokeColor != b && (this._strokeColor = b, this.invalidateDisplayList())
  8610. },
  8611. enumerable: !0,
  8612. configurable: !0
  8613. });
  8614. Object.defineProperty(a.prototype, "strokeAlpha", {
  8615. get: function() {
  8616. return this._strokeAlpha
  8617. },
  8618. set: function(b) {
  8619. this._strokeAlpha != b && (this._strokeAlpha = b, this.invalidateDisplayList())
  8620. },
  8621. enumerable: !0,
  8622. configurable: !0
  8623. });
  8624. Object.defineProperty(a.prototype, "strokeWeight", {
  8625. get: function() {
  8626. return this._strokeWeight
  8627. },
  8628. set: function(b) {
  8629. this._strokeWeight != b && (this._strokeWeight = b, this.invalidateDisplayList())
  8630. },
  8631. enumerable: !0,
  8632. configurable: !0
  8633. });
  8634. a.prototype._measureBounds = function() {
  8635. var b = d.prototype._measureBounds.call(this),
  8636. a = this.width,
  8637. c = this.height;
  8638. 0 < b.x && (b.x = 0);
  8639. 0 < b.y && (b.y = 0);
  8640. 0 + a > b.right && (b.right = 0 + a);
  8641. 0 + c > b.bottom && (b.bottom = 0 + c);
  8642. return b
  8643. };
  8644. a.prototype.updateDisplayList = function(b, a) {
  8645. d.prototype.updateDisplayList.call(this, b, b);
  8646. var c = this.graphics;
  8647. c.clear();
  8648. c.beginFill(this._fillColor, this._fillAlpha);
  8649. 0 < this._strokeAlpha && c.lineStyle(this._strokeWeight, this._strokeColor, this._strokeAlpha, !0, "normal", "square", "miter");
  8650. c.drawRect(0, 0, b, a);
  8651. c.endFill()
  8652. };
  8653. return a
  8654. } (c.UIComponent);
  8655. c.Rect = e;
  8656. e.prototype.__class__ = "egret.Rect"
  8657. })(egret || (egret = {}));
  8658. __extends = this.__extends ||
  8659. function(c, e) {
  8660. function d() {
  8661. this.constructor = c
  8662. }
  8663. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  8664. d.prototype = e.prototype;
  8665. c.prototype = new d
  8666. }; (function(c) {
  8667. var e = function(c) {
  8668. function a() {
  8669. c.call(this);
  8670. this.hostComponentKey = "egret.Button"
  8671. }
  8672. __extends(a, c);
  8673. return a
  8674. } (c.ButtonBase);
  8675. c.Button = e;
  8676. e.prototype.__class__ = "egret.Button"
  8677. })(egret || (egret = {}));
  8678. __extends = this.__extends ||
  8679. function(c, e) {
  8680. function d() {
  8681. this.constructor = c
  8682. }
  8683. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  8684. d.prototype = e.prototype;
  8685. c.prototype = new d
  8686. }; (function(c) {
  8687. var e = function(c) {
  8688. function a() {
  8689. c.call(this);
  8690. this.hostComponentKey = "egret.ToggleButton"
  8691. }
  8692. __extends(a, c);
  8693. return a
  8694. } (c.ToggleButtonBase);
  8695. c.ToggleButton = e;
  8696. e.prototype.__class__ = "egret.ToggleButton"
  8697. })(egret || (egret = {}));
  8698. __extends = this.__extends ||
  8699. function(c, e) {
  8700. function d() {
  8701. this.constructor = c
  8702. }
  8703. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  8704. d.prototype = e.prototype;
  8705. c.prototype = new d
  8706. }; (function(c) {
  8707. var e = function(c) {
  8708. function a() {
  8709. c.call(this);
  8710. this.hostComponentKey = "egret.CheckBox"
  8711. }
  8712. __extends(a, c);
  8713. return a
  8714. } (c.ToggleButtonBase);
  8715. c.CheckBox = e;
  8716. e.prototype.__class__ = "egret.CheckBox"
  8717. })(egret || (egret = {}));
  8718. __extends = this.__extends ||
  8719. function(c, e) {
  8720. function d() {
  8721. this.constructor = c
  8722. }
  8723. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  8724. d.prototype = e.prototype;
  8725. c.prototype = new d
  8726. }; (function(c) {
  8727. var e = function(d) {
  8728. function a() {
  8729. d.call(this);
  8730. this.radioButtons = [];
  8731. this._enabled = !0;
  8732. this._name = "_radioButtonGroup" + a.groupCount;
  8733. a.groupCount++
  8734. }
  8735. __extends(a, d);
  8736. Object.defineProperty(a.prototype, "enabled", {
  8737. get: function() {
  8738. return this._enabled
  8739. },
  8740. set: function(b) {
  8741. if (this._enabled != b) for (this._enabled = b, b = 0; b < this.numRadioButtons; b++) this.getRadioButtonAt(b).invalidateSkinState()
  8742. },
  8743. enumerable: !0,
  8744. configurable: !0
  8745. });
  8746. Object.defineProperty(a.prototype, "numRadioButtons", {
  8747. get: function() {
  8748. return this.radioButtons.length
  8749. },
  8750. enumerable: !0,
  8751. configurable: !0
  8752. });
  8753. Object.defineProperty(a.prototype, "selectedValue", {
  8754. get: function() {
  8755. return this.selection ? null != this.selection.value ? this.selection.value: this.selection.label: null
  8756. },
  8757. set: function(b) {
  8758. this._selectedValue = b;
  8759. if (null == b) this._setSelection(null, !1);
  8760. else for (var a = this.numRadioButtons,
  8761. d = 0; d < a; d++) {
  8762. var e = this.getRadioButtonAt(d);
  8763. if (e.value == b || e.label == b) {
  8764. this.changeSelection(d, !1);
  8765. this._selectedValue = null;
  8766. c.UIEvent.dispatchUIEvent(this, c.UIEvent.VALUE_COMMIT);
  8767. break
  8768. }
  8769. }
  8770. },
  8771. enumerable: !0,
  8772. configurable: !0
  8773. });
  8774. Object.defineProperty(a.prototype, "selection", {
  8775. get: function() {
  8776. return this._selection
  8777. },
  8778. set: function(b) {
  8779. this._selection != b && this._setSelection(b, !1)
  8780. },
  8781. enumerable: !0,
  8782. configurable: !0
  8783. });
  8784. a.prototype.getRadioButtonAt = function(b) {
  8785. return 0 <= b && b < this.numRadioButtons ? this.radioButtons[b] : null
  8786. };
  8787. a.prototype._addInstance = function(b) {
  8788. function a(b, d) {
  8789. var e = b.parent,
  8790. f = d.parent;
  8791. if (!e || !f) return 0;
  8792. var n = b instanceof c.UIComponent ? b.nestLevel: -1,
  8793. p = d instanceof c.UIComponent ? d.nestLevel: -1,
  8794. q = 0,
  8795. r = 0;
  8796. e == f && (q = "getElementIndex" in e && "ownerChanged" in b ? e.getElementIndex(b) : e.getChildIndex(b), r = "getElementIndex" in f && "ownerChanged" in d ? f.getElementIndex(d) : f.getChildIndex(d));
  8797. return n > p || q > r ? 1 : n < p || r > q ? -1 : b == d ? 0 : a(e, f)
  8798. }
  8799. b.addEventListener(c.Event.REMOVED, this.radioButton_removedHandler, this);
  8800. this.radioButtons.push(b);
  8801. this.radioButtons.sort(a);
  8802. for (var d = 0; d < this.radioButtons.length; d++) this.radioButtons[d]._indexNumber = d;
  8803. this._selectedValue && (this.selectedValue = this._selectedValue); ! 0 == b.selected && (this.selection = b);
  8804. b._radioButtonGroup = this;
  8805. b.invalidateSkinState();
  8806. this.dispatchEventWith("numRadioButtonsChanged")
  8807. };
  8808. a.prototype._removeInstance = function(b) {
  8809. this.doRemoveInstance(b, !1)
  8810. };
  8811. a.prototype.doRemoveInstance = function(b, a) {
  8812. "undefined" === typeof a && (a = !0);
  8813. if (b) {
  8814. for (var d = !1,
  8815. e = 0; e < this.numRadioButtons; e++) {
  8816. var g = this.getRadioButtonAt(e);
  8817. d ? g._indexNumber -= 1 : g == b && (a && b.addEventListener(c.Event.ADDED, this.radioButton_addedHandler, this), b == this._selection && (this._selection = null), b._radioButtonGroup = null, b.invalidateSkinState(), this.radioButtons.splice(e, 1), d = !0, e--)
  8818. }
  8819. d && this.dispatchEventWith("numRadioButtonsChanged")
  8820. }
  8821. };
  8822. a.prototype._setSelection = function(b, a) {
  8823. "undefined" === typeof a && (a = !0);
  8824. if (this._selection != b) {
  8825. if (b) for (var d = this.numRadioButtons,
  8826. e = 0; e < d; e++) {
  8827. if (b == this.getRadioButtonAt(e)) {
  8828. this.changeSelection(e, a);
  8829. break
  8830. }
  8831. } else this.selection && (this._selection.selected = !1, this._selection = null, a && this.dispatchEventWith(c.Event.CHANGE));
  8832. c.UIEvent.dispatchUIEvent(this, c.UIEvent.VALUE_COMMIT)
  8833. }
  8834. };
  8835. a.prototype.changeSelection = function(b, a) {
  8836. "undefined" === typeof a && (a = !0);
  8837. var d = this.getRadioButtonAt(b);
  8838. d && d != this._selection && (this._selection && (this._selection.selected = !1), this._selection = d, this._selection.selected = !0, a && this.dispatchEventWith(c.Event.CHANGE))
  8839. };
  8840. a.prototype.radioButton_addedHandler = function(b) {
  8841. if (b = b.target) b.removeEventListener(c.Event.ADDED, this.radioButton_addedHandler, this),
  8842. this._addInstance(b)
  8843. };
  8844. a.prototype.radioButton_removedHandler = function(b) {
  8845. if (b = b.target) b.removeEventListener(c.Event.REMOVED, this.radioButton_removedHandler, this),
  8846. this.doRemoveInstance(b)
  8847. };
  8848. a.groupCount = 0;
  8849. return a
  8850. } (c.EventDispatcher);
  8851. c.RadioButtonGroup = e;
  8852. e.prototype.__class__ = "egret.RadioButtonGroup"
  8853. })(egret || (egret = {}));
  8854. __extends = this.__extends ||
  8855. function(c, e) {
  8856. function d() {
  8857. this.constructor = c
  8858. }
  8859. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  8860. d.prototype = e.prototype;
  8861. c.prototype = new d
  8862. }; (function(c) {
  8863. var e = function(d) {
  8864. function a() {
  8865. d.call(this);
  8866. this._indexNumber = 0;
  8867. this._radioButtonGroup = null;
  8868. this.groupChanged = !1;
  8869. this._groupName = "radioGroup";
  8870. this.hostComponentKey = "egret.RadioButton";
  8871. this.groupName = "radioGroup"
  8872. }
  8873. __extends(a, d);
  8874. Object.defineProperty(a.prototype, "enabled", {
  8875. get: function() {
  8876. return this._enabled ? !this._radioButtonGroup || this._radioButtonGroup.enabled: !1
  8877. },
  8878. set: function(b) {
  8879. this._setEnabled(b)
  8880. },
  8881. enumerable: !0,
  8882. configurable: !0
  8883. });
  8884. Object.defineProperty(a.prototype, "group", {
  8885. get: function() {
  8886. if (!this._group && this._groupName) {
  8887. a.automaticRadioButtonGroups || (a.automaticRadioButtonGroups = {});
  8888. var b = a.automaticRadioButtonGroups[this._groupName];
  8889. b || (b = new c.RadioButtonGroup, b._name = this._groupName, a.automaticRadioButtonGroups[this._groupName] = b);
  8890. this._group = b
  8891. }
  8892. return this._group
  8893. },
  8894. set: function(b) {
  8895. this._group != b && (this._radioButtonGroup && this._radioButtonGroup._removeInstance(this), this._groupName = (this._group = b) ? this.group._name: "radioGroup", this.groupChanged = !0, this.invalidateProperties(), this.invalidateDisplayList())
  8896. },
  8897. enumerable: !0,
  8898. configurable: !0
  8899. });
  8900. Object.defineProperty(a.prototype, "groupName", {
  8901. get: function() {
  8902. return this._groupName
  8903. },
  8904. set: function(b) {
  8905. b && "" != b && (this._groupName = b, this._radioButtonGroup && this._radioButtonGroup._removeInstance(this), this._group = null, this.groupChanged = !0, this.invalidateProperties(), this.invalidateDisplayList())
  8906. },
  8907. enumerable: !0,
  8908. configurable: !0
  8909. });
  8910. a.prototype._setSelected = function(b) {
  8911. d.prototype._setSelected.call(this, b);
  8912. this.invalidateDisplayList()
  8913. };
  8914. Object.defineProperty(a.prototype, "value", {
  8915. get: function() {
  8916. return this._value
  8917. },
  8918. set: function(b) {
  8919. this._value != b && (this._value = b, this.selected && this.group && c.UIEvent.dispatchUIEvent(this.group, c.UIEvent.VALUE_COMMIT))
  8920. },
  8921. enumerable: !0,
  8922. configurable: !0
  8923. });
  8924. a.prototype.commitProperties = function() {
  8925. this.groupChanged && (this.addToGroup(), this.groupChanged = !1);
  8926. d.prototype.commitProperties.call(this)
  8927. };
  8928. a.prototype.updateDisplayList = function(b, a) {
  8929. d.prototype.updateDisplayList.call(this, b, a);
  8930. this.group && (this.selected ? this._group.selection = this: this.group.selection == this && (this._group.selection = null))
  8931. };
  8932. a.prototype.buttonReleased = function() {
  8933. this.enabled && !this.selected && (this._radioButtonGroup || this.addToGroup(), d.prototype.buttonReleased.call(this), this.group._setSelection(this))
  8934. };
  8935. a.prototype.addToGroup = function() {
  8936. var b = this.group;
  8937. b && b._addInstance(this);
  8938. return b
  8939. };
  8940. return a
  8941. } (c.ToggleButtonBase);
  8942. c.RadioButton = e;
  8943. e.prototype.__class__ = "egret.RadioButton"
  8944. })(egret || (egret = {}));
  8945. __extends = this.__extends ||
  8946. function(c, e) {
  8947. function d() {
  8948. this.constructor = c
  8949. }
  8950. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  8951. d.prototype = e.prototype;
  8952. c.prototype = new d
  8953. }; (function(c) {
  8954. var e = function(d) {
  8955. function a() {
  8956. d.call(this);
  8957. this.elementsContentChanged = this.createChildrenCalled = !1;
  8958. this._elementsContent = []
  8959. }
  8960. __extends(a, d);
  8961. a.prototype.createChildren = function() {
  8962. d.prototype.createChildren.call(this);
  8963. this.createChildrenCalled = !0;
  8964. this.elementsContentChanged && (this.elementsContentChanged = !1, this.setElementsContent(this._elementsContent))
  8965. };
  8966. a.prototype._getElementsContent = function() {
  8967. return this._elementsContent
  8968. };
  8969. Object.defineProperty(a.prototype, "elementsContent", {
  8970. set: function(b) {
  8971. null == b && (b = []);
  8972. if (b != this._elementsContent) if (this.createChildrenCalled) this.setElementsContent(b);
  8973. else {
  8974. this.elementsContentChanged = !0;
  8975. for (var a = this._elementsContent.length - 1; 0 <= a; a--) this._elementRemoved(this._elementsContent[a], a);
  8976. this._elementsContent = b
  8977. }
  8978. },
  8979. enumerable: !0,
  8980. configurable: !0
  8981. });
  8982. a.prototype.setElementsContent = function(b) {
  8983. var a;
  8984. for (a = this._elementsContent.length - 1; 0 <= a; a--) this._elementRemoved(this._elementsContent[a], a);
  8985. this._elementsContent = b.concat();
  8986. b = this._elementsContent.length;
  8987. for (a = 0; a < b; a++) {
  8988. var c = this._elementsContent[a];
  8989. c.parent && "removeElement" in c.parent ? c.parent.removeElement(c) : c.owner && "removeElement" in c.owner && c.owner.removeElement(c);
  8990. this._elementAdded(c, a)
  8991. }
  8992. };
  8993. Object.defineProperty(a.prototype, "numElements", {
  8994. get: function() {
  8995. return this._elementsContent.length
  8996. },
  8997. enumerable: !0,
  8998. configurable: !0
  8999. });
  9000. a.prototype.getElementAt = function(b) {
  9001. this.checkForRangeError(b);
  9002. return this._elementsContent[b]
  9003. };
  9004. a.prototype.checkForRangeError = function(b, a) {
  9005. "undefined" === typeof a && (a = !1);
  9006. var c = this._elementsContent.length - 1;
  9007. a && c++;
  9008. if (0 > b || b > c) throw new RangeError('\u7d22\u5f15:"' + b + '"\u8d85\u51fa\u53ef\u89c6\u5143\u7d20\u7d22\u5f15\u8303\u56f4');
  9009. };
  9010. a.prototype.addElement = function(b) {
  9011. var a = this.numElements;
  9012. b.parent == this && (a = this.numElements - 1);
  9013. return this.addElementAt(b, a)
  9014. };
  9015. a.prototype.addElementAt = function(b, a) {
  9016. if (b == this) return b;
  9017. this.checkForRangeError(a, !0);
  9018. var c = b.owner;
  9019. if (c == this || b.parent == this) return this.setElementIndex(b, a),
  9020. b;
  9021. c && "removeElement" in c && b.owner.removeElement(b);
  9022. this._elementsContent.splice(a, 0, b);
  9023. this.elementsContentChanged || this._elementAdded(b, a);
  9024. return b
  9025. };
  9026. a.prototype.removeElement = function(b) {
  9027. return this.removeElementAt(this.getElementIndex(b))
  9028. };
  9029. a.prototype.removeElementAt = function(b) {
  9030. this.checkForRangeError(b);
  9031. var a = this._elementsContent[b];
  9032. this.elementsContentChanged || this._elementRemoved(a, b);
  9033. this._elementsContent.splice(b, 1);
  9034. return a
  9035. };
  9036. a.prototype.removeAllElements = function() {
  9037. for (var b = this.numElements - 1; 0 <= b; b--) this.removeElementAt(b)
  9038. };
  9039. a.prototype.getElementIndex = function(b) {
  9040. return this._elementsContent.indexOf(b)
  9041. };
  9042. a.prototype.setElementIndex = function(b, a) {
  9043. this.checkForRangeError(a);
  9044. var c = this.getElementIndex(b); - 1 != c && c != a && (this.elementsContentChanged || this._elementRemoved(b, c, !1), this._elementsContent.splice(c, 1), this._elementsContent.splice(a, 0, b), this.elementsContentChanged || this._elementAdded(b, a, !1))
  9045. };
  9046. a.prototype.swapElements = function(b, a) {
  9047. this.swapElementsAt(this.getElementIndex(b), this.getElementIndex(a))
  9048. };
  9049. a.prototype.swapElementsAt = function(b, a) {
  9050. this.checkForRangeError(b);
  9051. this.checkForRangeError(a);
  9052. if (b > a) {
  9053. var c = a;
  9054. a = b;
  9055. b = c
  9056. } else if (b == a) return;
  9057. var c = this._elementsContent,
  9058. d = c[b],
  9059. e = c[a];
  9060. this.elementsContentChanged || (this._elementRemoved(d, b, !1), this._elementRemoved(e, a, !1));
  9061. c[b] = e;
  9062. c[a] = d;
  9063. this.elementsContentChanged || (this._elementAdded(e, b, !1), this._elementAdded(d, a, !1))
  9064. };
  9065. a.prototype._elementAdded = function(b, a, d) {
  9066. "undefined" === typeof d && (d = !0);
  9067. b instanceof c.DisplayObject && this._addToDisplayListAt(b, a, d);
  9068. d && this.hasEventListener(c.ElementExistenceEvent.ELEMENT_ADD) && c.ElementExistenceEvent.dispatchElementExistenceEvent(this, c.ElementExistenceEvent.ELEMENT_ADD, b, a);
  9069. this.invalidateSize();
  9070. this.invalidateDisplayList()
  9071. };
  9072. a.prototype._elementRemoved = function(b, a, d) {
  9073. "undefined" === typeof d && (d = !0);
  9074. d && this.hasEventListener(c.ElementExistenceEvent.ELEMENT_REMOVE) && c.ElementExistenceEvent.dispatchElementExistenceEvent(this, c.ElementExistenceEvent.ELEMENT_REMOVE, b, a);
  9075. b instanceof c.DisplayObject && b.parent == this && this._removeFromDisplayList(b, d);
  9076. this.invalidateSize();
  9077. this.invalidateDisplayList()
  9078. };
  9079. a.prototype.addChild = function(b) {
  9080. throw Error("addChild()" + a.errorStr + "addElement()\u4ee3\u66ff");
  9081. };
  9082. a.prototype.addChildAt = function(b, c) {
  9083. throw Error("addChildAt()" + a.errorStr + "addElementAt()\u4ee3\u66ff");
  9084. };
  9085. a.prototype.removeChild = function(b) {
  9086. throw Error("removeChild()" + a.errorStr + "removeElement()\u4ee3\u66ff");
  9087. };
  9088. a.prototype.removeChildAt = function(b) {
  9089. throw Error("removeChildAt()" + a.errorStr + "removeElementAt()\u4ee3\u66ff");
  9090. };
  9091. a.prototype.setChildIndex = function(b, c) {
  9092. throw Error("setChildIndex()" + a.errorStr + "setElementIndex()\u4ee3\u66ff");
  9093. };
  9094. a.prototype.swapChildren = function(b, c) {
  9095. throw Error("swapChildren()" + a.errorStr + "swapElements()\u4ee3\u66ff");
  9096. };
  9097. a.prototype.swapChildrenAt = function(b, c) {
  9098. throw Error("swapChildrenAt()" + a.errorStr + "swapElementsAt()\u4ee3\u66ff");
  9099. };
  9100. a.errorStr = "\u5728\u6b64\u7ec4\u4ef6\u4e2d\u4e0d\u53ef\u7528\uff0c\u82e5\u6b64\u7ec4\u4ef6\u4e3a\u5bb9\u5668\u7c7b\uff0c\u8bf7\u4f7f\u7528";
  9101. return a
  9102. } (c.GroupBase);
  9103. c.Group = e;
  9104. e.prototype.__class__ = "egret.Group"
  9105. })(egret || (egret = {}));
  9106. __extends = this.__extends ||
  9107. function(c, e) {
  9108. function d() {
  9109. this.constructor = c
  9110. }
  9111. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  9112. d.prototype = e.prototype;
  9113. c.prototype = new d
  9114. }; (function(c) {
  9115. var e = function(d) {
  9116. function a() {
  9117. d.call(this);
  9118. this._createAllChildren = !1;
  9119. this.proposedSelectedIndex = a.NO_PROPOSED_SELECTION;
  9120. this._selectedIndex = -1;
  9121. this.childOrderingChanged = this.notifyTabBar = !1;
  9122. this._setLayout(new c.BasicLayout)
  9123. }
  9124. __extends(a, d);
  9125. Object.defineProperty(a.prototype, "layout", {
  9126. get: function() {
  9127. return this._layout
  9128. },
  9129. set: function(b) {},
  9130. enumerable: !0,
  9131. configurable: !0
  9132. });
  9133. Object.defineProperty(a.prototype, "createAllChildren", {
  9134. get: function() {
  9135. return this._createAllChildren
  9136. },
  9137. set: function(b) {
  9138. if (this._createAllChildren != b && (this._createAllChildren = b)) {
  9139. b = this._getElementsContent();
  9140. for (var a = b.length,
  9141. d = 0; d < a; d++) {
  9142. var e = b[d];
  9143. e instanceof c.DisplayObject && e.parent != this && (this.childOrderingChanged = !0, this._addToDisplayList(e))
  9144. }
  9145. this.childOrderingChanged && this.invalidateProperties()
  9146. }
  9147. },
  9148. enumerable: !0,
  9149. configurable: !0
  9150. });
  9151. Object.defineProperty(a.prototype, "selectedChild", {
  9152. get: function() {
  9153. var b = this.selectedIndex;
  9154. return 0 <= b && b < this.numElements ? this.getElementAt(b) : null
  9155. },
  9156. set: function(b) {
  9157. b = this.getElementIndex(b);
  9158. 0 <= b && b < this.numElements && this._setSelectedIndex(b)
  9159. },
  9160. enumerable: !0,
  9161. configurable: !0
  9162. });
  9163. Object.defineProperty(a.prototype, "selectedIndex", {
  9164. get: function() {
  9165. return this.proposedSelectedIndex != a.NO_PROPOSED_SELECTION ? this.proposedSelectedIndex: this._selectedIndex
  9166. },
  9167. set: function(b) {
  9168. this._setSelectedIndex(b)
  9169. },
  9170. enumerable: !0,
  9171. configurable: !0
  9172. });
  9173. a.prototype._setSelectedIndex = function(b, a) {
  9174. "undefined" === typeof a && (a = !0);
  9175. b != this.selectedIndex && (this.proposedSelectedIndex = b, this.invalidateProperties(), c.UIEvent.dispatchUIEvent(this, c.UIEvent.VALUE_COMMIT), this.notifyTabBar = this.notifyTabBar || a)
  9176. };
  9177. a.prototype._elementAdded = function(b, a, d) {
  9178. "undefined" === typeof d && (d = !0);
  9179. this._createAllChildren && b instanceof c.DisplayObject && this._addToDisplayListAt(b, a, d);
  9180. d && this.hasEventListener(c.ElementExistenceEvent.ELEMENT_ADD) && c.ElementExistenceEvent.dispatchElementExistenceEvent(this, c.ElementExistenceEvent.ELEMENT_ADD, b, a);
  9181. b.visible = !1;
  9182. b.includeInLayout = !1; - 1 == this.selectedIndex ? this._setSelectedIndex(a, !1) : a <= this.selectedIndex && this.initialized && this._setSelectedIndex(this.selectedIndex + 1);
  9183. this.dispatchCoEvent(c.CollectionEventKind.ADD, a, -1, [b.name])
  9184. };
  9185. a.prototype._elementRemoved = function(b, a, e) {
  9186. "undefined" === typeof e && (e = !0);
  9187. d.prototype._elementRemoved.call(this, b, a, e);
  9188. b.visible = !0;
  9189. b.includeInLayout = !0;
  9190. a == this.selectedIndex ? 0 < this.numElements ? 0 == a ? (this.proposedSelectedIndex = 0, this.invalidateProperties()) : this._setSelectedIndex(0, !1) : this._setSelectedIndex( - 1) : a < this.selectedIndex && this._setSelectedIndex(this.selectedIndex - 1);
  9191. this.dispatchCoEvent(c.CollectionEventKind.REMOVE, a, -1, [b.name])
  9192. };
  9193. a.prototype.commitProperties = function() {
  9194. d.prototype.commitProperties.call(this);
  9195. this.proposedSelectedIndex != a.NO_PROPOSED_SELECTION && (this.commitSelection(this.proposedSelectedIndex), this.proposedSelectedIndex = a.NO_PROPOSED_SELECTION);
  9196. if (this.childOrderingChanged) {
  9197. this.childOrderingChanged = !1;
  9198. for (var b = this._getElementsContent(), k = b.length, e = 0; e < k; e++) {
  9199. var m = b[e];
  9200. m instanceof c.DisplayObject && m.parent == this && this._addToDisplayList(m)
  9201. }
  9202. }
  9203. this.notifyTabBar && (this.notifyTabBar = !0, this.dispatchEventWith("IndexChanged"))
  9204. };
  9205. a.prototype.commitSelection = function(b) {
  9206. 0 <= b && b < this.numElements ? (this._selectedIndex = b, this._selectedChild && this._selectedChild.parent == this && (this._selectedChild.visible = !1, this._selectedChild.includeInLayout = !1), this._selectedChild = this.getElementAt(this._selectedIndex), this._selectedChild.visible = !0, this._selectedChild.includeInLayout = !0, this._selectedChild.parent != this && this._selectedChild instanceof c.DisplayObject && (this._addToDisplayList(this._selectedChild), this.childOrderingChanged || (this.childOrderingChanged = !0))) : (this._selectedChild = null, this._selectedIndex = -1);
  9207. this.invalidateSize();
  9208. this.invalidateDisplayList()
  9209. };
  9210. Object.defineProperty(a.prototype, "length", {
  9211. get: function() {
  9212. return this.numElements
  9213. },
  9214. enumerable: !0,
  9215. configurable: !0
  9216. });
  9217. a.prototype.getItemAt = function(b) {
  9218. return (b = this.getElementAt(b)) ? b.name: ""
  9219. };
  9220. a.prototype.getItemIndex = function(b) {
  9221. for (var a = this._getElementsContent(), c = a.length, d = 0; d < c; d++) if (a[d].name === b) return d;
  9222. return - 1
  9223. };
  9224. a.prototype.dispatchCoEvent = function(b, a, d, e, g) {
  9225. "undefined" === typeof b && (b = null);
  9226. "undefined" === typeof a && (a = -1);
  9227. "undefined" === typeof d && (d = -1);
  9228. "undefined" === typeof e && (e = null);
  9229. "undefined" === typeof g && (g = null);
  9230. c.CollectionEvent.dispatchCollectionEvent(this, c.CollectionEvent.COLLECTION_CHANGE, b, a, d, e, g)
  9231. };
  9232. a.NO_PROPOSED_SELECTION = -2;
  9233. return a
  9234. } (c.Group);
  9235. c.ViewStack = e;
  9236. e.prototype.__class__ = "egret.ViewStack"
  9237. })(egret || (egret = {}));
  9238. __extends = this.__extends ||
  9239. function(c, e) {
  9240. function d() {
  9241. this.constructor = c
  9242. }
  9243. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  9244. d.prototype = e.prototype;
  9245. c.prototype = new d
  9246. }; (function(c) {
  9247. var e = function(d) {
  9248. function a() {
  9249. d.call(this);
  9250. this.maxWidth = 1E4;
  9251. this.minWidth = 0;
  9252. this.maxHeight = 1E4;
  9253. this.minHeight = 0;
  9254. this.height = this.width = NaN;
  9255. this._initialized = !1;
  9256. this._elementsContent = [];
  9257. this._states = [];
  9258. this.initialized = !1
  9259. }
  9260. __extends(a, d);
  9261. a.prototype.createChildren = function() {};
  9262. Object.defineProperty(a.prototype, "hostComponent", {
  9263. get: function() {
  9264. return this._hostComponent
  9265. },
  9266. set: function(b) {
  9267. this._setHostComponent(b)
  9268. },
  9269. enumerable: !0,
  9270. configurable: !0
  9271. });
  9272. a.prototype._setHostComponent = function(b) {
  9273. if (this._hostComponent != b) {
  9274. var a;
  9275. if (this._hostComponent) for (a = this._elementsContent.length - 1; 0 <= a; a--) this._elementRemoved(this._elementsContent[a], a);
  9276. this._hostComponent = b;
  9277. this._initialized || (this._initialized = !0, this.createChildren());
  9278. if (this._hostComponent) {
  9279. b = this._elementsContent.length;
  9280. for (a = 0; a < b; a++) this._elementAdded(this._elementsContent[a], a);
  9281. this.initializeStates();
  9282. this.currentStateChanged && this.commitCurrentState()
  9283. }
  9284. }
  9285. };
  9286. a.prototype._getElementsContent = function() {
  9287. return this._elementsContent
  9288. };
  9289. Object.defineProperty(a.prototype, "elementsContent", {
  9290. set: function(b) {
  9291. null == b && (b = []);
  9292. if (b != this._elementsContent) if (this._hostComponent) {
  9293. var a;
  9294. for (a = this._elementsContent.length - 1; 0 <= a; a--) this._elementRemoved(this._elementsContent[a], a);
  9295. this._elementsContent = b.concat();
  9296. b = this._elementsContent.length;
  9297. for (a = 0; a < b; a++) {
  9298. var c = this._elementsContent[a];
  9299. c.parent && "removeElement" in c.parent ? c.parent.removeElement(c) : c.owner && "removeElement" in c.owner && c.owner.removeElement(c);
  9300. this._elementAdded(c, a)
  9301. }
  9302. } else this._elementsContent = b.concat()
  9303. },
  9304. enumerable: !0,
  9305. configurable: !0
  9306. });
  9307. Object.defineProperty(a.prototype, "numElements", {
  9308. get: function() {
  9309. return this._elementsContent.length
  9310. },
  9311. enumerable: !0,
  9312. configurable: !0
  9313. });
  9314. a.prototype.getElementAt = function(b) {
  9315. this.checkForRangeError(b);
  9316. return this._elementsContent[b]
  9317. };
  9318. a.prototype.checkForRangeError = function(b, a) {
  9319. "undefined" === typeof a && (a = !1);
  9320. var c = this._elementsContent.length - 1;
  9321. a && c++;
  9322. if (0 > b || b > c) throw new RangeError('\u7d22\u5f15:"' + b + '"\u8d85\u51fa\u53ef\u89c6\u5143\u7d20\u7d22\u5f15\u8303\u56f4');
  9323. };
  9324. a.prototype.addElement = function(b) {
  9325. var a = this.numElements;
  9326. b.owner == this && (a = this.numElements - 1);
  9327. return this.addElementAt(b, a)
  9328. };
  9329. a.prototype.addElementAt = function(b, a) {
  9330. this.checkForRangeError(a, !0);
  9331. var c = b.owner;
  9332. if (c == this) return this.setElementIndex(b, a),
  9333. b;
  9334. c && "removeElement" in c && c.removeElement(b);
  9335. this._elementsContent.splice(a, 0, b);
  9336. this._hostComponent ? this._elementAdded(b, a) : b.ownerChanged(this);
  9337. return b
  9338. };
  9339. a.prototype.removeElement = function(b) {
  9340. return this.removeElementAt(this.getElementIndex(b))
  9341. };
  9342. a.prototype.removeElementAt = function(b) {
  9343. this.checkForRangeError(b);
  9344. var a = this._elementsContent[b];
  9345. this._hostComponent ? this._elementRemoved(a, b) : a.ownerChanged(null);
  9346. this._elementsContent.splice(b, 1);
  9347. return a
  9348. };
  9349. a.prototype.getElementIndex = function(b) {
  9350. return this._elementsContent.indexOf(b)
  9351. };
  9352. a.prototype.setElementIndex = function(b, a) {
  9353. this.checkForRangeError(a);
  9354. var c = this.getElementIndex(b); - 1 != c && c != a && (this._hostComponent && this._elementRemoved(b, c, !1), this._elementsContent.splice(c, 1), this._elementsContent.splice(a, 0, b), this._hostComponent && this._elementAdded(b, a, !1))
  9355. };
  9356. a.prototype._elementAdded = function(b, a, d) {
  9357. "undefined" === typeof d && (d = !0);
  9358. b.ownerChanged(this);
  9359. b instanceof c.DisplayObject && this._hostComponent._addToDisplayListAt(b, a, d);
  9360. d && this.hasEventListener(c.ElementExistenceEvent.ELEMENT_ADD) && c.ElementExistenceEvent.dispatchElementExistenceEvent(this, c.ElementExistenceEvent.ELEMENT_ADD, b, a);
  9361. this._hostComponent.invalidateSize();
  9362. this._hostComponent.invalidateDisplayList()
  9363. };
  9364. a.prototype._elementRemoved = function(b, a, d) {
  9365. "undefined" === typeof d && (d = !0);
  9366. d && this.hasEventListener(c.ElementExistenceEvent.ELEMENT_REMOVE) && c.ElementExistenceEvent.dispatchElementExistenceEvent(this, c.ElementExistenceEvent.ELEMENT_REMOVE, b, a);
  9367. b instanceof c.DisplayObject && b.parent == this._hostComponent && this._hostComponent._removeFromDisplayList(b, d);
  9368. b.ownerChanged(null);
  9369. this._hostComponent.invalidateSize();
  9370. this._hostComponent.invalidateDisplayList()
  9371. };
  9372. Object.defineProperty(a.prototype, "states", {
  9373. get: function() {
  9374. return this._states
  9375. },
  9376. set: function(b) {
  9377. this._setStates(b)
  9378. },
  9379. enumerable: !0,
  9380. configurable: !0
  9381. });
  9382. a.prototype._setStates = function(b) {
  9383. b || (b = []);
  9384. if ("string" == typeof b[0]) for (var a = b.length,
  9385. d = 0; d < a; d++) {
  9386. var e = new c.State(b[d], []);
  9387. b[d] = e
  9388. }
  9389. this._states = b;
  9390. this.currentStateChanged = !0;
  9391. this.requestedCurrentState = this._currentState;
  9392. this.hasState(this.requestedCurrentState) || (this.requestedCurrentState = this.getDefaultState())
  9393. };
  9394. Object.defineProperty(a.prototype, "currentState", {
  9395. get: function() {
  9396. return this.currentStateChanged ? this.requestedCurrentState: this._currentState ? this._currentState: this.getDefaultState()
  9397. },
  9398. set: function(b) {
  9399. b || (b = this.getDefaultState());
  9400. b != this.currentState && b && this.currentState && (this.requestedCurrentState = b, this.currentStateChanged = !0, this._hostComponent && this.commitCurrentState())
  9401. },
  9402. enumerable: !0,
  9403. configurable: !0
  9404. });
  9405. a.prototype.hasState = function(b) {
  9406. return null != this.getState(b)
  9407. };
  9408. a.prototype.getDefaultState = function() {
  9409. return 0 < this._states.length ? this._states[0].name: null
  9410. };
  9411. a.prototype.commitCurrentState = function() {
  9412. if (this.currentStateChanged) {
  9413. this.currentStateChanged = !1;
  9414. this.getState(this.requestedCurrentState) || (this.requestedCurrentState = this.getDefaultState());
  9415. var b = this._currentState ? this._currentState: "";
  9416. this.hasEventListener(c.StateChangeEvent.CURRENT_STATE_CHANGING) && c.StateChangeEvent.dispatchStateChangeEvent(this, c.StateChangeEvent.CURRENT_STATE_CHANGING, b, this.requestedCurrentState ? this.requestedCurrentState: "");
  9417. this.removeState(this._currentState); (this._currentState = this.requestedCurrentState) && this.applyState(this._currentState);
  9418. this.hasEventListener(c.StateChangeEvent.CURRENT_STATE_CHANGE) && c.StateChangeEvent.dispatchStateChangeEvent(this, c.StateChangeEvent.CURRENT_STATE_CHANGE, b, this._currentState ? this._currentState: "")
  9419. }
  9420. };
  9421. a.prototype.getState = function(b) {
  9422. if (!b) return null;
  9423. for (var a = this._states,
  9424. c = a.length,
  9425. d = 0; d < c; d++) {
  9426. var e = a[d];
  9427. if (e.name == b) return e
  9428. }
  9429. return null
  9430. };
  9431. a.prototype.removeState = function(b) {
  9432. if (b = this.getState(b)) {
  9433. b = b.overrides;
  9434. for (var a = b.length - 1; 0 <= a; a--) b[a].remove(this)
  9435. }
  9436. };
  9437. a.prototype.applyState = function(b) {
  9438. if (b = this.getState(b)) {
  9439. b = b.overrides;
  9440. for (var a = b.length,
  9441. c = 0; c < a; c++) b[c].apply(this)
  9442. }
  9443. };
  9444. a.prototype.initializeStates = function() {
  9445. if (!this.initialized) {
  9446. this.initialized = !0;
  9447. for (var b = this._states,
  9448. a = b.length,
  9449. c = 0; c < a; c++) b[c].initialize(this)
  9450. }
  9451. };
  9452. return a
  9453. } (c.EventDispatcher);
  9454. c.Skin = e;
  9455. e.prototype.__class__ = "egret.Skin"
  9456. })(egret || (egret = {}));
  9457. __extends = this.__extends ||
  9458. function(c, e) {
  9459. function d() {
  9460. this.constructor = c
  9461. }
  9462. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  9463. d.prototype = e.prototype;
  9464. c.prototype = new d
  9465. }; (function(c) {
  9466. var e = function(d) {
  9467. function a() {
  9468. d.call(this);
  9469. this.useVirtualLayoutChanged = !1;
  9470. this.rendererToClassMap = [];
  9471. this.freeRenderers = [];
  9472. this.dataProviderChanged = this.createNewRendererFlag = !1;
  9473. this.recyclerDic = [];
  9474. this.typicalItemChanged = this.virtualLayoutUnderway = this.itemRendererSkinNameChange = !1;
  9475. this.indexToRenderer = [];
  9476. this.renderersBeingUpdated = this.cleanFreeRenderer = !1
  9477. }
  9478. __extends(a, d);
  9479. Object.defineProperty(a.prototype, "layout", {
  9480. get: function() {
  9481. return this._layout
  9482. },
  9483. set: function(b) {
  9484. b != this.layout && (this.layout && (this.layout.typicalLayoutRect = null, this.layout.removeEventListener("useVirtualLayoutChanged", this.layout_useVirtualLayoutChangedHandler, this)), this.layout && b && this.layout.useVirtualLayout != b.useVirtualLayout && this.changeUseVirtualLayout(), this._setLayout(b), b && (b.typicalLayoutRect = this.typicalLayoutRect, b.addEventListener("useVirtualLayoutChanged", this.layout_useVirtualLayoutChangedHandler, this)))
  9485. },
  9486. enumerable: !0,
  9487. configurable: !0
  9488. });
  9489. a.prototype.layout_useVirtualLayoutChangedHandler = function(b) {
  9490. this.changeUseVirtualLayout()
  9491. };
  9492. a.prototype.setVirtualElementIndicesInView = function(b, a) {
  9493. if (this.layout && this.layout.useVirtualLayout) {
  9494. this.virtualRendererIndices = [];
  9495. for (var c = b; c <= a; c++) this.virtualRendererIndices.push(c);
  9496. for (var d in this.indexToRenderer) d = parseInt(d),
  9497. -1 == this.virtualRendererIndices.indexOf(d) && this.freeRendererByIndex(d)
  9498. }
  9499. };
  9500. a.prototype.getVirtualElementAt = function(b) {
  9501. if (0 > b || b >= this.dataProvider.length) return null;
  9502. var a = this.indexToRenderer[b];
  9503. if (!a) {
  9504. var a = this.dataProvider.getItemAt(b),
  9505. d = this.createVirtualRenderer(b);
  9506. this.indexToRenderer[b] = d;
  9507. this.updateRenderer(d, b, a);
  9508. this.createNewRendererFlag && ("validateNow" in d && d.validateNow(), this.createNewRendererFlag = !1, c.RendererExistenceEvent.dispatchRendererExistenceEvent(this, c.RendererExistenceEvent.RENDERER_ADD, d, b, a));
  9509. a = d
  9510. }
  9511. return a
  9512. };
  9513. a.prototype.freeRendererByIndex = function(b) {
  9514. if (this.indexToRenderer[b]) {
  9515. var a = this.indexToRenderer[b];
  9516. delete this.indexToRenderer[b];
  9517. a && a instanceof c.DisplayObject && this.doFreeRenderer(a)
  9518. }
  9519. };
  9520. a.prototype.doFreeRenderer = function(b) {
  9521. var a = this.rendererToClassMap[b.hashCode].hashCode;
  9522. this.freeRenderers[a] || (this.freeRenderers[a] = []);
  9523. this.freeRenderers[a].push(b);
  9524. b.visible = !1
  9525. };
  9526. a.prototype.invalidateSize = function() {
  9527. this.createNewRendererFlag || d.prototype.invalidateSize.call(this)
  9528. };
  9529. a.prototype.createVirtualRenderer = function(b) {
  9530. b = this.dataProvider.getItemAt(b);
  9531. b = this.itemToRendererClass(b);
  9532. var a = b.hashCode,
  9533. c = this.freeRenderers;
  9534. if (c[a] && 0 < c[a].length) return b = c[a].pop(),
  9535. b.visible = !0,
  9536. b;
  9537. this.createNewRendererFlag = !0;
  9538. return this.createOneRenderer(b)
  9539. };
  9540. a.prototype.createOneRenderer = function(b) {
  9541. var a, d = b.hashCode,
  9542. e = this.recyclerDic[d];
  9543. e && (a = e.pop(), 0 == e.length && delete this.recyclerDic[d]);
  9544. a || (a = b.newInstance(), this.rendererToClassMap[a.hashCode] = b);
  9545. if (! (a && a instanceof c.DisplayObject)) return null;
  9546. this._itemRendererSkinName && this.setItemRenderSkinName(a);
  9547. this._addToDisplayList(a);
  9548. a.setLayoutBoundsSize(NaN, NaN);
  9549. return a
  9550. };
  9551. a.prototype.setItemRenderSkinName = function(b) {
  9552. b && (b ? b._skinNameExplicitlySet || (b.skinName = this._itemRendererSkinName) : b && !b.skinName && (b.skinName = this._itemRendererSkinName))
  9553. };
  9554. a.prototype.finishVirtualLayout = function() {
  9555. if (this.virtualLayoutUnderway) {
  9556. var b = this.virtualLayoutUnderway = !1,
  9557. a;
  9558. for (a in this.freeRenderers) if (0 < this.freeRenderers[a].length) {
  9559. b = !0;
  9560. break
  9561. }
  9562. b && (this.cleanTimer || (this.cleanTimer = new c.Timer(3E3, 1), this.cleanTimer.addEventListener(c.TimerEvent.TIMER, this.cleanAllFreeRenderer, this)), this.cleanTimer.reset(), this.cleanTimer.start())
  9563. }
  9564. };
  9565. a.prototype.cleanAllFreeRenderer = function(b) {
  9566. var a = this.freeRenderers,
  9567. c;
  9568. for (c in a) for (var d = a[c], e = d.length, h = 0; h < e; h++) b = d[h],
  9569. b.visible = !0,
  9570. this.recycle(b);
  9571. this.freeRenderers = [];
  9572. this.cleanFreeRenderer = !1
  9573. };
  9574. a.prototype.getElementIndicesInView = function() {
  9575. return this.layout && this.layout.useVirtualLayout ? this.virtualRendererIndices ? this.virtualRendererIndices: [] : d.prototype.getElementIndicesInView.call(this)
  9576. };
  9577. a.prototype.changeUseVirtualLayout = function() {
  9578. this.cleanFreeRenderer = this.useVirtualLayoutChanged = !0;
  9579. this.removeDataProviderListener();
  9580. this.invalidateProperties()
  9581. };
  9582. Object.defineProperty(a.prototype, "dataProvider", {
  9583. get: function() {
  9584. return this._dataProvider
  9585. },
  9586. set: function(b) {
  9587. this._dataProvider != b && (this.removeDataProviderListener(), this._dataProvider = b, this.cleanFreeRenderer = this.dataProviderChanged = !0, this.invalidateProperties(), this.invalidateSize(), this.invalidateDisplayList())
  9588. },
  9589. enumerable: !0,
  9590. configurable: !0
  9591. });
  9592. a.prototype.removeDataProviderListener = function() {
  9593. this._dataProvider && this._dataProvider.removeEventListener(c.CollectionEvent.COLLECTION_CHANGE, this.onCollectionChange, this)
  9594. };
  9595. a.prototype.onCollectionChange = function(b) {
  9596. switch (b.kind) {
  9597. case c.CollectionEventKind.ADD:
  9598. this.itemAddedHandler(b.items, b.location);
  9599. break;
  9600. case c.CollectionEventKind.MOVE:
  9601. this.itemMovedHandler(b.items[0], b.location, b.oldLocation);
  9602. break;
  9603. case c.CollectionEventKind.REMOVE:
  9604. this.itemRemovedHandler(b.items, b.location);
  9605. break;
  9606. case c.CollectionEventKind.UPDATE:
  9607. this.itemUpdatedHandler(b.items[0], b.location);
  9608. break;
  9609. case c.CollectionEventKind.REPLACE:
  9610. this.itemRemoved(b.oldItems[0], b.location);
  9611. this.itemAdded(b.items[0], b.location);
  9612. break;
  9613. case c.CollectionEventKind.RESET:
  9614. case c.CollectionEventKind.REFRESH:
  9615. if (this.layout && this.layout.useVirtualLayout) for (var a in this.indexToRenderer) a = parseInt(a),
  9616. this.freeRendererByIndex(a);
  9617. this.dataProviderChanged = !0;
  9618. this.invalidateProperties()
  9619. }
  9620. this.invalidateSize();
  9621. this.invalidateDisplayList()
  9622. };
  9623. a.prototype.itemAddedHandler = function(b, a) {
  9624. for (var c = b.length,
  9625. d = 0; d < c; d++) this.itemAdded(b[d], a + d);
  9626. this.resetRenderersIndices()
  9627. };
  9628. a.prototype.itemMovedHandler = function(b, a, c) {
  9629. this.itemRemoved(b, c);
  9630. this.itemAdded(b, a);
  9631. this.resetRenderersIndices()
  9632. };
  9633. a.prototype.itemRemovedHandler = function(b, a) {
  9634. for (var c = b.length - 1; 0 <= c; c--) this.itemRemoved(b[c], a + c);
  9635. this.resetRenderersIndices()
  9636. };
  9637. a.prototype.itemAdded = function(b, a) {
  9638. this.layout && this.layout.elementAdded(a);
  9639. if (this.layout && this.layout.useVirtualLayout) {
  9640. var d = this.virtualRendererIndices;
  9641. if (d) {
  9642. for (var e = d.length,
  9643. g = 0; g < e; g++) {
  9644. var h = d[g];
  9645. h >= a && (d[g] = h + 1)
  9646. }
  9647. this.indexToRenderer.splice(a, 0, null)
  9648. }
  9649. } else d = this.itemToRendererClass(b),
  9650. d = this.createOneRenderer(d),
  9651. this.indexToRenderer.splice(a, 0, d),
  9652. d && (this.updateRenderer(d, a, b), c.RendererExistenceEvent.dispatchRendererExistenceEvent(this, c.RendererExistenceEvent.RENDERER_ADD, d, a, b))
  9653. };
  9654. a.prototype.itemRemoved = function(b, a) {
  9655. this.layout && this.layout.elementRemoved(a);
  9656. var d = this.virtualRendererIndices;
  9657. if (d && 0 < d.length) {
  9658. for (var e = -1,
  9659. g = d.length,
  9660. h = 0; h < g; h++) {
  9661. var l = d[h];
  9662. l == a ? e = h: l > a && (d[h] = l - 1)
  9663. } - 1 != e && d.splice(e, 1)
  9664. }
  9665. d = this.indexToRenderer[a];
  9666. this.indexToRenderer.length > a && this.indexToRenderer.splice(a, 1);
  9667. c.RendererExistenceEvent.dispatchRendererExistenceEvent(this, c.RendererExistenceEvent.RENDERER_REMOVE, d, a, b);
  9668. d && d instanceof c.DisplayObject && this.recycle(d)
  9669. };
  9670. a.prototype.recycle = function(b) {
  9671. this._removeFromDisplayList(b);
  9672. "ownerChanged" in b && b.ownerChanged(null);
  9673. var a = this.rendererToClassMap[b.hashCode].hashCode;
  9674. this.recyclerDic[a] || (this.recyclerDic[a] = new c.Recycler);
  9675. this.recyclerDic[a].push(b)
  9676. };
  9677. a.prototype.resetRenderersIndices = function() {
  9678. if (0 != this.indexToRenderer.length) if (this.layout && this.layout.useVirtualLayout) for (var b = this.virtualRendererIndices,
  9679. a = b.length,
  9680. c = 0; c < a; c++) {
  9681. var d = b[c];
  9682. this.resetRendererItemIndex(d)
  9683. } else for (b = this.indexToRenderer.length, d = 0; d < b; d++) this.resetRendererItemIndex(d)
  9684. };
  9685. a.prototype.itemUpdatedHandler = function(b, a) {
  9686. if (!this.renderersBeingUpdated) {
  9687. var c = this.indexToRenderer[a];
  9688. c && this.updateRenderer(c, a, b)
  9689. }
  9690. };
  9691. a.prototype.resetRendererItemIndex = function(b) {
  9692. var a = this.indexToRenderer[b];
  9693. a && (a.itemIndex = b)
  9694. };
  9695. Object.defineProperty(a.prototype, "itemRenderer", {
  9696. get: function() {
  9697. return this._itemRenderer
  9698. },
  9699. set: function(b) {
  9700. this._itemRenderer !== b && (this._itemRenderer = b, this.cleanFreeRenderer = this.typicalItemChanged = this.itemRendererChanged = !0, this.removeDataProviderListener(), this.invalidateProperties())
  9701. },
  9702. enumerable: !0,
  9703. configurable: !0
  9704. });
  9705. Object.defineProperty(a.prototype, "itemRendererSkinName", {
  9706. get: function() {
  9707. return this._itemRendererSkinName
  9708. },
  9709. set: function(b) {
  9710. this._itemRendererSkinName != b && (this._itemRendererSkinName = b) && this.initialized && (this.itemRendererSkinNameChange = !0, this.invalidateProperties())
  9711. },
  9712. enumerable: !0,
  9713. configurable: !0
  9714. });
  9715. Object.defineProperty(a.prototype, "itemRendererFunction", {
  9716. get: function() {
  9717. return this._itemRendererFunction
  9718. },
  9719. set: function(b) {
  9720. this._itemRendererFunction != b && (this._itemRendererFunction = b, this.typicalItemChanged = this.itemRendererChanged = !0, this.removeDataProviderListener(), this.invalidateProperties())
  9721. },
  9722. enumerable: !0,
  9723. configurable: !0
  9724. });
  9725. a.prototype.itemToRendererClass = function(b) {
  9726. null != this._itemRendererFunction ? (b = this._itemRendererFunction(b), b || (b = this._itemRenderer)) : b = this._itemRenderer;
  9727. return b ? b: a.defaultRendererFactory
  9728. };
  9729. a.prototype.createChildren = function() {
  9730. if (!this.layout) {
  9731. var b = new c.VerticalLayout;
  9732. b.gap = 0;
  9733. b.horizontalAlign = c.HorizontalAlign.CONTENT_JUSTIFY;
  9734. this.layout = b
  9735. }
  9736. d.prototype.createChildren.call(this)
  9737. };
  9738. a.prototype.commitProperties = function() {
  9739. if (this.itemRendererChanged || this.dataProviderChanged || this.useVirtualLayoutChanged) this.removeAllRenderers(),
  9740. this.layout && this.layout.clearVirtualLayoutCache(),
  9741. this.setTypicalLayoutRect(null),
  9742. this.itemRendererChanged = this.useVirtualLayoutChanged = !1,
  9743. this._dataProvider && this._dataProvider.addEventListener(c.CollectionEvent.COLLECTION_CHANGE, this.onCollectionChange, this),
  9744. this.layout && this.layout.useVirtualLayout ? (this.invalidateSize(), this.invalidateDisplayList()) : this.createRenderers(),
  9745. this.dataProviderChanged && (this.dataProviderChanged = !1, this.verticalScrollPosition = this.horizontalScrollPosition = 0);
  9746. d.prototype.commitProperties.call(this);
  9747. this.typicalItemChanged && (this.typicalItemChanged = !1, this._dataProvider && 0 < this._dataProvider.length && (this.typicalItem = this._dataProvider.getItemAt(0), this.measureRendererSize()));
  9748. if (this.itemRendererSkinNameChange) {
  9749. this.itemRendererSkinNameChange = !1;
  9750. for (var b = this.indexToRenderer.length,
  9751. a = 0; a < b; a++) this.setItemRenderSkinName(this.indexToRenderer[a]);
  9752. var e = this.freeRenderers,
  9753. m;
  9754. for (m in e) {
  9755. var g = e[m];
  9756. if (g) for (b = g.length, a = 0; a < b; a++) this.setItemRenderSkinName(g[a])
  9757. }
  9758. }
  9759. };
  9760. a.prototype.measure = function() {
  9761. this.layout && this.layout.useVirtualLayout && this.ensureTypicalLayoutElement();
  9762. d.prototype.measure.call(this)
  9763. };
  9764. a.prototype.updateDisplayList = function(b, a) {
  9765. this._layoutInvalidateDisplayListFlag && this.layout && this.layout.useVirtualLayout && (this.virtualLayoutUnderway = !0, this.ensureTypicalLayoutElement());
  9766. d.prototype.updateDisplayList.call(this, b, a);
  9767. this.virtualLayoutUnderway && this.finishVirtualLayout()
  9768. };
  9769. a.prototype.ensureTypicalLayoutElement = function() { ! this.layout.typicalLayoutRect && this._dataProvider && 0 < this._dataProvider.length && (this.typicalItem = this._dataProvider.getItemAt(0), this.measureRendererSize())
  9770. };
  9771. a.prototype.measureRendererSize = function() {
  9772. if (this.typicalItem) {
  9773. var b = this.itemToRendererClass(this.typicalItem);
  9774. if (b = this.createOneRenderer(b)) {
  9775. this.createNewRendererFlag = !0;
  9776. this.updateRenderer(b, 0, this.typicalItem);
  9777. "validateNow" in b && b.validateNow();
  9778. var a = new c.Rectangle(0, 0, b.preferredWidth, b.preferredHeight);
  9779. this.recycle(b);
  9780. this.setTypicalLayoutRect(a);
  9781. this.createNewRendererFlag = !1
  9782. } else this.setTypicalLayoutRect(null)
  9783. } else this.setTypicalLayoutRect(null)
  9784. };
  9785. a.prototype.setTypicalLayoutRect = function(b) {
  9786. this.typicalLayoutRect = b;
  9787. this.layout && (this.layout.typicalLayoutRect = b)
  9788. };
  9789. a.prototype.removeAllRenderers = function() {
  9790. for (var b = this.indexToRenderer.length,
  9791. a, d = 0; d < b; d++) if (a = this.indexToRenderer[d]) this.recycle(a),
  9792. c.RendererExistenceEvent.dispatchRendererExistenceEvent(this, c.RendererExistenceEvent.RENDERER_REMOVE, a, a.itemIndex, a.data);
  9793. this.indexToRenderer = [];
  9794. this.virtualRendererIndices = null;
  9795. this.cleanFreeRenderer && this.cleanAllFreeRenderer()
  9796. };
  9797. a.prototype.createRenderers = function() {
  9798. if (this._dataProvider) for (var b = 0,
  9799. a = this._dataProvider.length,
  9800. d = 0; d < a; d++) {
  9801. var e = this._dataProvider.getItemAt(d),
  9802. g = this.itemToRendererClass(e);
  9803. if (g = this.createOneRenderer(g)) this.indexToRenderer[b] = g,
  9804. this.updateRenderer(g, b, e),
  9805. c.RendererExistenceEvent.dispatchRendererExistenceEvent(this, c.RendererExistenceEvent.RENDERER_ADD, g, b, e),
  9806. b++
  9807. }
  9808. };
  9809. a.prototype.updateRenderer = function(b, a, c) {
  9810. this.renderersBeingUpdated = !0;
  9811. this._rendererOwner ? b = this._rendererOwner.updateRenderer(b, a, c) : ("ownerChanged" in b && b.ownerChanged(this), b.itemIndex = a, b.label = this.itemToLabel(c), b.data = c);
  9812. this.renderersBeingUpdated = !1;
  9813. return b
  9814. };
  9815. a.prototype.itemToLabel = function(b) {
  9816. return b ? b.toString() : " "
  9817. };
  9818. a.prototype.getElementAt = function(b) {
  9819. return this.indexToRenderer[b]
  9820. };
  9821. a.prototype.getElementIndex = function(b) {
  9822. return b ? this.indexToRenderer.indexOf(b) : -1
  9823. };
  9824. Object.defineProperty(a.prototype, "numElements", {
  9825. get: function() {
  9826. return this._dataProvider ? this._dataProvider.length: 0
  9827. },
  9828. enumerable: !0,
  9829. configurable: !0
  9830. });
  9831. a.prototype.addChild = function(b) {
  9832. throw Error("addChild()" + a.errorStr + "addElement()\u4ee3\u66ff");
  9833. };
  9834. a.prototype.addChildAt = function(b, c) {
  9835. throw Error("addChildAt()" + a.errorStr + "addElementAt()\u4ee3\u66ff");
  9836. };
  9837. a.prototype.removeChild = function(b) {
  9838. throw Error("removeChild()" + a.errorStr + "removeElement()\u4ee3\u66ff");
  9839. };
  9840. a.prototype.removeChildAt = function(b) {
  9841. throw Error("removeChildAt()" + a.errorStr + "removeElementAt()\u4ee3\u66ff");
  9842. };
  9843. a.prototype.setChildIndex = function(b, c) {
  9844. throw Error("setChildIndex()" + a.errorStr + "setElementIndex()\u4ee3\u66ff");
  9845. };
  9846. a.prototype.swapChildren = function(b, c) {
  9847. throw Error("swapChildren()" + a.errorStr + "swapElements()\u4ee3\u66ff");
  9848. };
  9849. a.prototype.swapChildrenAt = function(b, c) {
  9850. throw Error("swapChildrenAt()" + a.errorStr + "swapElementsAt()\u4ee3\u66ff");
  9851. };
  9852. a.defaultRendererFactory = new c.ClassFactory(c.ItemRenderer);
  9853. a.errorStr = "\u5728\u6b64\u7ec4\u4ef6\u4e2d\u4e0d\u53ef\u7528\uff0c\u82e5\u6b64\u7ec4\u4ef6\u4e3a\u5bb9\u5668\u7c7b\uff0c\u8bf7\u4f7f\u7528";
  9854. return a
  9855. } (c.GroupBase);
  9856. c.DataGroup = e;
  9857. e.prototype.__class__ = "egret.DataGroup"
  9858. })(egret || (egret = {}));
  9859. __extends = this.__extends ||
  9860. function(c, e) {
  9861. function d() {
  9862. this.constructor = c
  9863. }
  9864. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  9865. d.prototype = e.prototype;
  9866. c.prototype = new d
  9867. }; (function(c) {
  9868. var e = function(d) {
  9869. function a() {
  9870. d.call(this);
  9871. this.contentGroupProperties = {};
  9872. this.hostComponentKey = "egret.SkinnableContainer"
  9873. }
  9874. __extends(a, d);
  9875. a.prototype._getCurrentContentGroup = function() {
  9876. return null == this.contentGroup ? (null == this._placeHolderGroup && (this._placeHolderGroup = new c.Group, this._placeHolderGroup.visible = !1, this._addToDisplayList(this._placeHolderGroup)), this._placeHolderGroup.addEventListener(c.ElementExistenceEvent.ELEMENT_ADD, this._contentGroup_elementAddedHandler, this), this._placeHolderGroup.addEventListener(c.ElementExistenceEvent.ELEMENT_REMOVE, this._contentGroup_elementRemovedHandler, this), this._placeHolderGroup) : this.contentGroup
  9877. };
  9878. Object.defineProperty(a.prototype, "elementsContent", {
  9879. set: function(b) {
  9880. this._getCurrentContentGroup().elementsContent = b
  9881. },
  9882. enumerable: !0,
  9883. configurable: !0
  9884. });
  9885. Object.defineProperty(a.prototype, "numElements", {
  9886. get: function() {
  9887. return this._getCurrentContentGroup().numElements
  9888. },
  9889. enumerable: !0,
  9890. configurable: !0
  9891. });
  9892. a.prototype.getElementAt = function(b) {
  9893. return this._getCurrentContentGroup().getElementAt(b)
  9894. };
  9895. a.prototype.addElement = function(b) {
  9896. return this._getCurrentContentGroup().addElement(b)
  9897. };
  9898. a.prototype.addElementAt = function(b, a) {
  9899. return this._getCurrentContentGroup().addElementAt(b, a)
  9900. };
  9901. a.prototype.removeElement = function(b) {
  9902. return this._getCurrentContentGroup().removeElement(b)
  9903. };
  9904. a.prototype.removeElementAt = function(b) {
  9905. return this._getCurrentContentGroup().removeElementAt(b)
  9906. };
  9907. a.prototype.removeAllElements = function() {
  9908. this._getCurrentContentGroup().removeAllElements()
  9909. };
  9910. a.prototype.getElementIndex = function(b) {
  9911. return this._getCurrentContentGroup().getElementIndex(b)
  9912. };
  9913. a.prototype.setElementIndex = function(b, a) {
  9914. this._getCurrentContentGroup().setElementIndex(b, a)
  9915. };
  9916. a.prototype.swapElements = function(b, a) {
  9917. this._getCurrentContentGroup().swapElements(b, a)
  9918. };
  9919. a.prototype.swapElementsAt = function(b, a) {
  9920. this._getCurrentContentGroup().swapElementsAt(b, a)
  9921. };
  9922. Object.defineProperty(a.prototype, "layout", {
  9923. get: function() {
  9924. return null != this.contentGroup ? this.contentGroup.layout: this.contentGroupProperties.layout
  9925. },
  9926. set: function(b) {
  9927. null != this.contentGroup ? this.contentGroup.layout = b: this.contentGroupProperties.layout = b
  9928. },
  9929. enumerable: !0,
  9930. configurable: !0
  9931. });
  9932. a.prototype.partAdded = function(b, a) {
  9933. d.prototype.partAdded.call(this, b, a);
  9934. if (a == this.contentGroup) {
  9935. void 0 !== this.contentGroupProperties.layout && (this.contentGroup.layout = this.contentGroupProperties.layout, this.contentGroupProperties = {});
  9936. if (this._placeHolderGroup) {
  9937. this._placeHolderGroup.removeEventListener(c.ElementExistenceEvent.ELEMENT_ADD, this._contentGroup_elementAddedHandler, this);
  9938. this._placeHolderGroup.removeEventListener(c.ElementExistenceEvent.ELEMENT_REMOVE, this._contentGroup_elementRemovedHandler, this);
  9939. for (var e = this._placeHolderGroup._getElementsContent().concat(), m = this._placeHolderGroup.numElements; 0 < m; m--) {
  9940. var g = this._placeHolderGroup.removeElementAt(0);
  9941. g.ownerChanged(null)
  9942. }
  9943. this._removeFromDisplayList(this._placeHolderGroup);
  9944. this.contentGroup.elementsContent = e;
  9945. for (m = e.length - 1; 0 <= m; m--) g = e[m],
  9946. g.ownerChanged(this);
  9947. this._placeHolderGroup = null
  9948. }
  9949. this.contentGroup.addEventListener(c.ElementExistenceEvent.ELEMENT_ADD, this._contentGroup_elementAddedHandler, this);
  9950. this.contentGroup.addEventListener(c.ElementExistenceEvent.ELEMENT_REMOVE, this._contentGroup_elementRemovedHandler, this)
  9951. }
  9952. };
  9953. a.prototype.partRemoved = function(b, a) {
  9954. d.prototype.partRemoved.call(this, b, a);
  9955. if (a == this.contentGroup && (this.contentGroup.removeEventListener(c.ElementExistenceEvent.ELEMENT_ADD, this._contentGroup_elementAddedHandler, this), this.contentGroup.removeEventListener(c.ElementExistenceEvent.ELEMENT_REMOVE, this._contentGroup_elementRemovedHandler, this), this.contentGroupProperties.layout = this.contentGroup.layout, this.contentGroup.layout = null, 0 < this.contentGroup.numElements)) {
  9956. for (this._placeHolderGroup = new c.Group; 0 < this.contentGroup.numElements;) this._placeHolderGroup.addElement(this.contentGroup.getElementAt(0));
  9957. this._placeHolderGroup.addEventListener(c.ElementExistenceEvent.ELEMENT_ADD, this._contentGroup_elementAddedHandler, this);
  9958. this._placeHolderGroup.addEventListener(c.ElementExistenceEvent.ELEMENT_REMOVE, this._contentGroup_elementRemovedHandler, this)
  9959. }
  9960. };
  9961. a.prototype._contentGroup_elementAddedHandler = function(b) {
  9962. b.element.ownerChanged(this);
  9963. this.dispatchEvent(b)
  9964. };
  9965. a.prototype._contentGroup_elementRemovedHandler = function(b) {
  9966. b.element.ownerChanged(null);
  9967. this.dispatchEvent(b)
  9968. };
  9969. return a
  9970. } (c.SkinnableComponent);
  9971. c.SkinnableContainer = e;
  9972. e.prototype.__class__ = "egret.SkinnableContainer"
  9973. })(egret || (egret = {}));
  9974. __extends = this.__extends ||
  9975. function(c, e) {
  9976. function d() {
  9977. this.constructor = c
  9978. }
  9979. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  9980. d.prototype = e.prototype;
  9981. c.prototype = new d
  9982. }; (function(c) {
  9983. var e = function(d) {
  9984. function a() {
  9985. d.call(this);
  9986. this._dataGroupProperties = {};
  9987. this.hostComponentKey = "egret.SkinnableDataContainer"
  9988. }
  9989. __extends(a, d);
  9990. a.prototype.updateRenderer = function(b, a, c) {
  9991. "ownerChanged" in b && b.ownerChanged(this);
  9992. b.itemIndex = a;
  9993. b.label = this.itemToLabel(c);
  9994. b.data = c;
  9995. return b
  9996. };
  9997. a.prototype.itemToLabel = function(b) {
  9998. return null !== b ? b.toString() : " "
  9999. };
  10000. Object.defineProperty(a.prototype, "dataProvider", {
  10001. get: function() {
  10002. return this._getDataProvider()
  10003. },
  10004. set: function(b) {
  10005. this._setDataProvider(b)
  10006. },
  10007. enumerable: !0,
  10008. configurable: !0
  10009. });
  10010. a.prototype._getDataProvider = function() {
  10011. return null != this.dataGroup ? this.dataGroup.dataProvider: this._dataGroupProperties.dataProvider
  10012. };
  10013. a.prototype._setDataProvider = function(b) {
  10014. null == this.dataGroup ? this._dataGroupProperties.dataProvider = b: (this.dataGroup.dataProvider = b, this._dataGroupProperties.dataProvider = !0)
  10015. };
  10016. Object.defineProperty(a.prototype, "itemRenderer", {
  10017. get: function() {
  10018. return this.dataGroup ? this.dataGroup.itemRenderer: this._dataGroupProperties.itemRenderer
  10019. },
  10020. set: function(b) {
  10021. null == this.dataGroup ? this._dataGroupProperties.itemRenderer = b: (this.dataGroup.itemRenderer = b, this._dataGroupProperties.itemRenderer = !0)
  10022. },
  10023. enumerable: !0,
  10024. configurable: !0
  10025. });
  10026. Object.defineProperty(a.prototype, "itemRendererSkinName", {
  10027. get: function() {
  10028. return this.dataGroup ? this.dataGroup.itemRendererSkinName: this._dataGroupProperties.itemRendererSkinName
  10029. },
  10030. set: function(b) {
  10031. null == this.dataGroup ? this._dataGroupProperties.itemRendererSkinName = b: (this.dataGroup.itemRendererSkinName = b, this._dataGroupProperties.itemRendererSkinName = !0)
  10032. },
  10033. enumerable: !0,
  10034. configurable: !0
  10035. });
  10036. Object.defineProperty(a.prototype, "itemRendererFunction", {
  10037. get: function() {
  10038. return this.dataGroup ? this.dataGroup.itemRendererFunction: this._dataGroupProperties.itemRendererFunction
  10039. },
  10040. set: function(b) {
  10041. null == this.dataGroup ? this._dataGroupProperties.itemRendererFunction = b: (this.dataGroup.itemRendererFunction = b, this._dataGroupProperties.itemRendererFunction = !0)
  10042. },
  10043. enumerable: !0,
  10044. configurable: !0
  10045. });
  10046. Object.defineProperty(a.prototype, "layout", {
  10047. get: function() {
  10048. return this.dataGroup ? this.dataGroup.layout: this._dataGroupProperties.layout
  10049. },
  10050. set: function(b) {
  10051. this._setLayout(b)
  10052. },
  10053. enumerable: !0,
  10054. configurable: !0
  10055. });
  10056. a.prototype._setLayout = function(b) {
  10057. null == this.dataGroup ? this._dataGroupProperties.layout = b: (this.dataGroup.layout = b, this._dataGroupProperties.layout = !0)
  10058. };
  10059. a.prototype.partAdded = function(b, a) {
  10060. d.prototype.partAdded.call(this, b, a);
  10061. if (a == this.dataGroup) {
  10062. var e = {};
  10063. void 0 !== this._dataGroupProperties.layout && (this.dataGroup.layout = this._dataGroupProperties.layout, e.layout = !0);
  10064. void 0 !== this._dataGroupProperties.dataProvider && (this.dataGroup.dataProvider = this._dataGroupProperties.dataProvider, e.dataProvider = !0);
  10065. void 0 !== this._dataGroupProperties.itemRenderer && (this.dataGroup.itemRenderer = this._dataGroupProperties.itemRenderer, e.itemRenderer = !0);
  10066. void 0 !== this._dataGroupProperties.itemRendererSkinName && (this.dataGroup.itemRendererSkinName = this._dataGroupProperties.itemRendererSkinName, e.itemRendererSkinName = !0);
  10067. void 0 !== this._dataGroupProperties.itemRendererFunction && (this.dataGroup.itemRendererFunction = this._dataGroupProperties.itemRendererFunction, e.itemRendererFunction = !0);
  10068. this.dataGroup._rendererOwner = this;
  10069. this._dataGroupProperties = e;
  10070. this.hasEventListener(c.RendererExistenceEvent.RENDERER_ADD) && this.dataGroup.addEventListener(c.RendererExistenceEvent.RENDERER_ADD, this.dispatchEvent, this);
  10071. this.hasEventListener(c.RendererExistenceEvent.RENDERER_REMOVE) && this.dataGroup.addEventListener(c.RendererExistenceEvent.RENDERER_REMOVE, this.dispatchEvent, this)
  10072. }
  10073. };
  10074. a.prototype.partRemoved = function(b, a) {
  10075. d.prototype.partRemoved.call(this, b, a);
  10076. if (a == this.dataGroup) {
  10077. this.dataGroup.removeEventListener(c.RendererExistenceEvent.RENDERER_ADD, this.dispatchEvent, this);
  10078. this.dataGroup.removeEventListener(c.RendererExistenceEvent.RENDERER_REMOVE, this.dispatchEvent, this);
  10079. var e = {};
  10080. this._dataGroupProperties.layout && (e.layout = this.dataGroup.layout);
  10081. this._dataGroupProperties.dataProvider && (e.dataProvider = this.dataGroup.dataProvider);
  10082. this._dataGroupProperties.itemRenderer && (e.itemRenderer = this.dataGroup.itemRenderer);
  10083. this._dataGroupProperties.itemRendererSkinName && (e.itemRendererSkinName = this.dataGroup.itemRendererSkinName);
  10084. this._dataGroupProperties.itemRendererFunction && (e.itemRendererFunction = this.dataGroup.itemRendererFunction);
  10085. this._dataGroupProperties = e;
  10086. this.dataGroup._rendererOwner = null;
  10087. this.dataGroup.dataProvider = null;
  10088. this.dataGroup.layout = null
  10089. }
  10090. };
  10091. a.prototype.addEventListener = function(b, a, e, m, g) {
  10092. "undefined" === typeof m && (m = !1);
  10093. "undefined" === typeof g && (g = 0);
  10094. d.prototype.addEventListener.call(this, b, a, e, m, g);
  10095. b == c.RendererExistenceEvent.RENDERER_ADD && this.dataGroup && this.dataGroup.addEventListener(c.RendererExistenceEvent.RENDERER_ADD, this.dispatchEvent, this);
  10096. b == c.RendererExistenceEvent.RENDERER_REMOVE && this.dataGroup && this.dataGroup.addEventListener(c.RendererExistenceEvent.RENDERER_REMOVE, this.dispatchEvent, this)
  10097. };
  10098. a.prototype.removeEventListener = function(b, a, e, m) {
  10099. "undefined" === typeof m && (m = !1);
  10100. d.prototype.removeEventListener.call(this, b, a, e, m);
  10101. b == c.RendererExistenceEvent.RENDERER_ADD && this.dataGroup && (this.hasEventListener(c.RendererExistenceEvent.RENDERER_ADD) || this.dataGroup.removeEventListener(c.RendererExistenceEvent.RENDERER_ADD, this.dispatchEvent, this));
  10102. b == c.RendererExistenceEvent.RENDERER_REMOVE && this.dataGroup && (this.hasEventListener(c.RendererExistenceEvent.RENDERER_REMOVE) || this.dataGroup.removeEventListener(c.RendererExistenceEvent.RENDERER_REMOVE, this.dispatchEvent, this))
  10103. };
  10104. return a
  10105. } (c.SkinnableComponent);
  10106. c.SkinnableDataContainer = e;
  10107. e.prototype.__class__ = "egret.SkinnableDataContainer"
  10108. })(egret || (egret = {}));
  10109. __extends = this.__extends ||
  10110. function(c, e) {
  10111. function d() {
  10112. this.constructor = c
  10113. }
  10114. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  10115. d.prototype = e.prototype;
  10116. c.prototype = new d
  10117. }; (function(c) {
  10118. var e = function(d) {
  10119. function a() {
  10120. d.call(this);
  10121. this._doingWholesaleChanges = !1;
  10122. this._labelField = "label";
  10123. this.requireSelectionChanged = this._requireSelection = !1;
  10124. this._proposedSelectedIndex = a.NO_PROPOSED_SELECTION;
  10125. this._selectedIndex = a.NO_SELECTION;
  10126. this.selectedIndexAdjusted = this._useVirtualLayout = this._dispatchChangeAfterSelection = this._allowCustomSelectedItem = !1
  10127. }
  10128. __extends(a, d);
  10129. a.prototype._setDataProvider = function(b) {
  10130. this.dataProvider && this.dataProvider.removeEventListener(c.CollectionEvent.COLLECTION_CHANGE, this.dataProvider_collectionChangeHandler, this);
  10131. this._doingWholesaleChanges = this.dataProviderChanged = !0;
  10132. b && b.addEventListener(c.CollectionEvent.COLLECTION_CHANGE, this.dataProvider_collectionChangeHandler, this);
  10133. d.prototype._setDataProvider.call(this, b);
  10134. this.invalidateProperties()
  10135. };
  10136. Object.defineProperty(a.prototype, "layout", {
  10137. get: function() {
  10138. return this.dataGroup ? this.dataGroup.layout: this._dataGroupProperties.layout
  10139. },
  10140. set: function(b) {
  10141. b && this.useVirtualLayout && (b.useVirtualLayout = !0);
  10142. this._setLayout(b)
  10143. },
  10144. enumerable: !0,
  10145. configurable: !0
  10146. });
  10147. Object.defineProperty(a.prototype, "labelField", {
  10148. get: function() {
  10149. return this._labelField
  10150. },
  10151. set: function(b) {
  10152. this._setLabelField(b)
  10153. },
  10154. enumerable: !0,
  10155. configurable: !0
  10156. });
  10157. a.prototype._setLabelField = function(b) {
  10158. b != this._labelField && (this._labelField = b, this.labelFieldOrFunctionChanged = !0, this.invalidateProperties())
  10159. };
  10160. Object.defineProperty(a.prototype, "labelFunction", {
  10161. get: function() {
  10162. return this._labelFunction
  10163. },
  10164. set: function(b) {
  10165. this._setLabelFunction(b)
  10166. },
  10167. enumerable: !0,
  10168. configurable: !0
  10169. });
  10170. a.prototype._setLabelFunction = function(b) {
  10171. b != this._labelFunction && (this._labelFunction = b, this.labelFieldOrFunctionChanged = !0, this.invalidateProperties())
  10172. };
  10173. Object.defineProperty(a.prototype, "requireSelection", {
  10174. get: function() {
  10175. return this._requireSelection
  10176. },
  10177. set: function(b) {
  10178. this._setRequireSelection(b)
  10179. },
  10180. enumerable: !0,
  10181. configurable: !0
  10182. });
  10183. a.prototype._setRequireSelection = function(b) {
  10184. b != this._requireSelection && (this._requireSelection = b) && (this.requireSelectionChanged = !0, this.invalidateProperties())
  10185. };
  10186. Object.defineProperty(a.prototype, "selectedIndex", {
  10187. get: function() {
  10188. return this._getSelectedIndex()
  10189. },
  10190. set: function(b) {
  10191. this._setSelectedIndex(b, !1)
  10192. },
  10193. enumerable: !0,
  10194. configurable: !0
  10195. });
  10196. a.prototype._getSelectedIndex = function() {
  10197. return this._proposedSelectedIndex != a.NO_PROPOSED_SELECTION ? this._proposedSelectedIndex: this._selectedIndex
  10198. };
  10199. a.prototype._setSelectedIndex = function(b, a) {
  10200. "undefined" === typeof a && (a = !1);
  10201. b != this.selectedIndex && (a && (this._dispatchChangeAfterSelection = this._dispatchChangeAfterSelection || a), this._proposedSelectedIndex = b, this.invalidateProperties())
  10202. };
  10203. Object.defineProperty(a.prototype, "selectedItem", {
  10204. get: function() {
  10205. return void 0 !== this._pendingSelectedItem ? this._pendingSelectedItem: this._allowCustomSelectedItem && this.selectedIndex == a.CUSTOM_SELECTED_ITEM ? this._selectedItem: this.selectedIndex == a.NO_SELECTION || null == this.dataProvider ? void 0 : this.dataProvider.length > this.selectedIndex ? this.dataProvider.getItemAt(this.selectedIndex) : void 0
  10206. },
  10207. set: function(b) {
  10208. this._setSelectedItem(b, !1)
  10209. },
  10210. enumerable: !0,
  10211. configurable: !0
  10212. });
  10213. a.prototype._setSelectedItem = function(b, a) {
  10214. "undefined" === typeof a && (a = !1);
  10215. this.selectedItem !== b && (a && (this._dispatchChangeAfterSelection = this._dispatchChangeAfterSelection || a), this._pendingSelectedItem = b, this.invalidateProperties())
  10216. };
  10217. Object.defineProperty(a.prototype, "useVirtualLayout", {
  10218. get: function() {
  10219. return this._getUseVirtualLayout()
  10220. },
  10221. set: function(b) {
  10222. this._setUseVirtualLayout(b)
  10223. },
  10224. enumerable: !0,
  10225. configurable: !0
  10226. });
  10227. a.prototype._getUseVirtualLayout = function() {
  10228. return this.layout ? this.layout.useVirtualLayout: this._useVirtualLayout
  10229. };
  10230. a.prototype._setUseVirtualLayout = function(b) {
  10231. b != this.useVirtualLayout && (this._useVirtualLayout = b, this.layout && (this.layout.useVirtualLayout = b))
  10232. };
  10233. a.prototype.commitProperties = function() {
  10234. d.prototype.commitProperties.call(this);
  10235. this.dataProviderChanged && (this._doingWholesaleChanges = this.dataProviderChanged = !1, 0 <= this.selectedIndex && this.dataProvider && this.selectedIndex < this.dataProvider.length ? this.itemSelected(this.selectedIndex, !0) : this.requireSelection ? this._proposedSelectedIndex = 0 : this._setSelectedIndex( - 1, !1));
  10236. this.requireSelectionChanged && (this.requireSelectionChanged = !1, this.requireSelection && this.selectedIndex == a.NO_SELECTION && this.dataProvider && 0 < this.dataProvider.length && (this._proposedSelectedIndex = 0));
  10237. void 0 !== this._pendingSelectedItem && (this._proposedSelectedIndex = this.dataProvider ? this.dataProvider.getItemIndex(this._pendingSelectedItem) : a.NO_SELECTION, this._allowCustomSelectedItem && -1 == this._proposedSelectedIndex && (this._proposedSelectedIndex = a.CUSTOM_SELECTED_ITEM, this._selectedItem = this._pendingSelectedItem), this._pendingSelectedItem = void 0);
  10238. var b = !1;
  10239. this._proposedSelectedIndex != a.NO_PROPOSED_SELECTION && (b = this.commitSelection());
  10240. this.selectedIndexAdjusted && (this.selectedIndexAdjusted = !1, b || c.UIEvent.dispatchUIEvent(this, c.UIEvent.VALUE_COMMIT));
  10241. if (this.labelFieldOrFunctionChanged) {
  10242. if (null != this.dataGroup) if (this.layout && this.layout.useVirtualLayout) for (var e = this.dataGroup.getElementIndicesInView(), f = e.length, m = 0; m < f; m++) b = e[m],
  10243. this.updateRendererLabelProperty(b);
  10244. else for (e = this.dataGroup.numElements, b = 0; b < e; b++) this.updateRendererLabelProperty(b);
  10245. this.labelFieldOrFunctionChanged = !1
  10246. }
  10247. };
  10248. a.prototype.updateRendererLabelProperty = function(b) {
  10249. if (b = this.dataGroup.getElementAt(b)) b.label = this.itemToLabel(b.data)
  10250. };
  10251. a.prototype.partAdded = function(b, a) {
  10252. d.prototype.partAdded.call(this, b, a);
  10253. a == this.dataGroup && (this._useVirtualLayout && this.dataGroup.layout && (this.dataGroup.layout.useVirtualLayout = !0), this.dataGroup.addEventListener(c.RendererExistenceEvent.RENDERER_ADD, this.dataGroup_rendererAddHandler, this), this.dataGroup.addEventListener(c.RendererExistenceEvent.RENDERER_REMOVE, this.dataGroup_rendererRemoveHandler, this))
  10254. };
  10255. a.prototype.partRemoved = function(b, a) {
  10256. d.prototype.partRemoved.call(this, b, a);
  10257. a == this.dataGroup && (this.dataGroup.removeEventListener(c.RendererExistenceEvent.RENDERER_ADD, this.dataGroup_rendererAddHandler, this), this.dataGroup.removeEventListener(c.RendererExistenceEvent.RENDERER_REMOVE, this.dataGroup_rendererRemoveHandler, this))
  10258. };
  10259. a.prototype.updateRenderer = function(b, a, c) {
  10260. this.itemSelected(a, this._isItemIndexSelected(a));
  10261. return d.prototype.updateRenderer.call(this, b, a, c)
  10262. };
  10263. a.prototype.itemToLabel = function(b) {
  10264. if (null != this._labelFunction) return this._labelFunction(b);
  10265. if ("string" == typeof b) return b;
  10266. if (b instanceof c.XML) try {
  10267. 0 != b[this.labelField].length() && (b = b[this.labelField])
  10268. } catch(a) {} else if (b instanceof Object) try {
  10269. null != b[this.labelField] && (b = b[this.labelField])
  10270. } catch(d) {}
  10271. if ("string" == typeof b) return b;
  10272. try {
  10273. if (null !== b) return b.toString()
  10274. } catch(e) {}
  10275. return " "
  10276. };
  10277. a.prototype.itemSelected = function(b, a) {
  10278. if (this.dataGroup) {
  10279. var c = this.dataGroup.getElementAt(b);
  10280. null != c && (c.selected = a)
  10281. }
  10282. };
  10283. a.prototype._isItemIndexSelected = function(b) {
  10284. return b == this.selectedIndex
  10285. };
  10286. a.prototype.commitSelection = function(b) {
  10287. "undefined" === typeof b && (b = !0);
  10288. var d = this.dataProvider ? this.dataProvider.length - 1 : -1,
  10289. e = this._selectedIndex;
  10290. if (!this._allowCustomSelectedItem || this._proposedSelectedIndex != a.CUSTOM_SELECTED_ITEM) if (this._proposedSelectedIndex < a.NO_SELECTION && (this._proposedSelectedIndex = a.NO_SELECTION), this._proposedSelectedIndex > d && (this._proposedSelectedIndex = d), this.requireSelection && this._proposedSelectedIndex == a.NO_SELECTION && this.dataProvider && 0 < this.dataProvider.length) return this._proposedSelectedIndex = a.NO_PROPOSED_SELECTION,
  10291. this._dispatchChangeAfterSelection = !1;
  10292. d = this._proposedSelectedIndex;
  10293. if (this._dispatchChangeAfterSelection && !c.IndexChangeEvent.dispatchIndexChangeEvent(this, c.IndexChangeEvent.CHANGING, this._selectedIndex, this._proposedSelectedIndex, !0)) return this.itemSelected(this._proposedSelectedIndex, !1),
  10294. this._proposedSelectedIndex = a.NO_PROPOSED_SELECTION,
  10295. this._dispatchChangeAfterSelection = !1;
  10296. this._selectedIndex = d;
  10297. this._proposedSelectedIndex = a.NO_PROPOSED_SELECTION;
  10298. e != a.NO_SELECTION && this.itemSelected(e, !1);
  10299. this._selectedIndex != a.NO_SELECTION && this.itemSelected(this._selectedIndex, !0);
  10300. b && (this._dispatchChangeAfterSelection && (c.IndexChangeEvent.dispatchIndexChangeEvent(this, c.IndexChangeEvent.CHANGE, e, this._selectedIndex), this._dispatchChangeAfterSelection = !1), c.UIEvent.dispatchUIEvent(this, c.UIEvent.VALUE_COMMIT));
  10301. return ! 0
  10302. };
  10303. a.prototype.adjustSelection = function(b, c) {
  10304. this._proposedSelectedIndex != a.NO_PROPOSED_SELECTION ? this._proposedSelectedIndex = b: this._selectedIndex = b;
  10305. this.selectedIndexAdjusted = !0;
  10306. this.invalidateProperties()
  10307. };
  10308. a.prototype.itemAdded = function(b) {
  10309. this._doingWholesaleChanges || (this.selectedIndex == a.NO_SELECTION ? this.requireSelection && this.adjustSelection(b, !0) : b <= this.selectedIndex && this.adjustSelection(this.selectedIndex + 1, !0))
  10310. };
  10311. a.prototype.itemRemoved = function(b) {
  10312. this.selectedIndex == a.NO_SELECTION || this._doingWholesaleChanges || (b == this.selectedIndex ? this.requireSelection && this.dataProvider && 0 < this.dataProvider.length ? 0 == b ? (this._proposedSelectedIndex = 0, this.invalidateProperties()) : this._setSelectedIndex(0, !1) : this.adjustSelection( - 1, !1) : b < this.selectedIndex && this.adjustSelection(this.selectedIndex - 1, !1))
  10313. };
  10314. a.prototype.dataGroup_rendererAddHandler = function(b) {
  10315. b = b.renderer;
  10316. null != b && (b.addEventListener(c.TouchEvent.TOUCH_ROLL_OVER, this.item_mouseEventHandler, this), b.addEventListener(c.TouchEvent.TOUCH_ROLL_OUT, this.item_mouseEventHandler, this))
  10317. };
  10318. a.prototype.dataGroup_rendererRemoveHandler = function(b) {
  10319. b = b.renderer;
  10320. null != b && (b.removeEventListener(c.TouchEvent.TOUCH_ROLL_OVER, this.item_mouseEventHandler, this), b.removeEventListener(c.TouchEvent.TOUCH_ROLL_OUT, this.item_mouseEventHandler, this))
  10321. };
  10322. a.prototype.item_mouseEventHandler = function(b) {
  10323. var c = b.type,
  10324. c = a.TYPE_MAP[c];
  10325. this.hasEventListener(c) && this._dispatchListEvent(b, c, b.currentTarget)
  10326. };
  10327. a.prototype._dispatchListEvent = function(b, a, d) {
  10328. var e = -1,
  10329. e = d ? d.itemIndex: this.dataGroup.getElementIndex(b.currentTarget),
  10330. g = this.dataProvider.getItemAt(e);
  10331. c.ListEvent.dispatchListEvent(this, a, b, e, g, d)
  10332. };
  10333. a.prototype.dataProvider_collectionChangeHandler = function(b) {
  10334. var d = b.items;
  10335. if (b.kind == c.CollectionEventKind.ADD) for (var d = d.length,
  10336. e = 0; e < d; e++) this.itemAdded(b.location + e);
  10337. else if (b.kind == c.CollectionEventKind.REMOVE) for (d = d.length, e = d - 1; 0 <= e; e--) this.itemRemoved(b.location + e);
  10338. else b.kind == c.CollectionEventKind.MOVE ? (this.itemRemoved(b.oldLocation), this.itemAdded(b.location)) : b.kind == c.CollectionEventKind.RESET ? 0 == this.dataProvider.length ? this._setSelectedIndex(a.NO_SELECTION, !1) : (this.dataProviderChanged = !0, this.invalidateProperties()) : b.kind == c.CollectionEventKind.REFRESH && this._setSelectedIndex(a.NO_SELECTION, !1)
  10339. };
  10340. a.NO_SELECTION = -1;
  10341. a.NO_PROPOSED_SELECTION = -2;
  10342. a.CUSTOM_SELECTED_ITEM = -3;
  10343. a.TYPE_MAP = {
  10344. rollOver: "itemRollOver",
  10345. rollOut: "itemRollOut"
  10346. };
  10347. return a
  10348. } (c.SkinnableDataContainer);
  10349. c.ListBase = e;
  10350. e.prototype.__class__ = "egret.ListBase"
  10351. })(egret || (egret = {}));
  10352. __extends = this.__extends ||
  10353. function(c, e) {
  10354. function d() {
  10355. this.constructor = c
  10356. }
  10357. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  10358. d.prototype = e.prototype;
  10359. c.prototype = new d
  10360. }; (function(c) {
  10361. var e = function(c) {
  10362. function a() {
  10363. c.call(this);
  10364. this._title = "";
  10365. this.hostComponentKey = "egret.Panel";
  10366. this.touchEnabled = !1
  10367. }
  10368. __extends(a, c);
  10369. Object.defineProperty(a.prototype, "title", {
  10370. get: function() {
  10371. return this._title
  10372. },
  10373. set: function(b) {
  10374. this._title = b;
  10375. this.titleDisplay && (this.titleDisplay.text = this.title)
  10376. },
  10377. enumerable: !0,
  10378. configurable: !0
  10379. });
  10380. a.prototype.partAdded = function(b, a) {
  10381. c.prototype.partAdded.call(this, b, a);
  10382. a == this.titleDisplay && (this.titleDisplay.text = this.title)
  10383. };
  10384. return a
  10385. } (c.SkinnableContainer);
  10386. c.Panel = e;
  10387. e.prototype.__class__ = "egret.Panel"
  10388. })(egret || (egret = {}));
  10389. __extends = this.__extends ||
  10390. function(c, e) {
  10391. function d() {
  10392. this.constructor = c
  10393. }
  10394. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  10395. d.prototype = e.prototype;
  10396. c.prototype = new d
  10397. }; (function(c) {
  10398. var e = function(d) {
  10399. function a() {
  10400. d.call(this);
  10401. this._autoBackToStage = this._showCloseButton = !0;
  10402. this.hostComponentKey = "egret.TitleWindow";
  10403. this.addEventListener(c.TouchEvent.TOUCH_BEGIN, this.onWindowMouseDown, this, !0, 100)
  10404. }
  10405. __extends(a, d);
  10406. a.prototype.onWindowMouseDown = function(b) {
  10407. this.enabled && this.isPopUp && b.target != this.closeButton && c.PopUpManager.bringToFront(this)
  10408. };
  10409. Object.defineProperty(a.prototype, "showCloseButton", {
  10410. get: function() {
  10411. return this._showCloseButton
  10412. },
  10413. set: function(b) {
  10414. this._showCloseButton != b && (this._showCloseButton = b, this.closeButton && (this.closeButton.visible = this._showCloseButton))
  10415. },
  10416. enumerable: !0,
  10417. configurable: !0
  10418. });
  10419. Object.defineProperty(a.prototype, "autoBackToStage", {
  10420. get: function() {
  10421. return this._autoBackToStage
  10422. },
  10423. set: function(b) {
  10424. this._autoBackToStage = b
  10425. },
  10426. enumerable: !0,
  10427. configurable: !0
  10428. });
  10429. a.prototype.partAdded = function(b, a) {
  10430. d.prototype.partAdded.call(this, b, a);
  10431. a == this.moveArea ? this.moveArea.addEventListener(c.TouchEvent.TOUCH_BEGIN, this.moveArea_mouseDownHandler, this) : a == this.closeButton && (this.closeButton.addEventListener(c.TouchEvent.TOUCH_TAP, this.closeButton_clickHandler, this), this.closeButton.visible = this._showCloseButton)
  10432. };
  10433. a.prototype.partRemoved = function(b, a) {
  10434. d.prototype.partRemoved.call(this, b, a);
  10435. a == this.moveArea ? this.moveArea.removeEventListener(c.TouchEvent.TOUCH_BEGIN, this.moveArea_mouseDownHandler, this) : a == this.closeButton && this.closeButton.removeEventListener(c.TouchEvent.TOUCH_TAP, this.closeButton_clickHandler, this)
  10436. };
  10437. a.prototype.closeButton_clickHandler = function(b) {
  10438. c.CloseEvent.dispatchCloseEvent(this, c.CloseEvent.CLOSE)
  10439. };
  10440. a.prototype.moveArea_mouseDownHandler = function(b) {
  10441. this.enabled && this.isPopUp && (b = this.globalToLocal(b.stageX, b.stageY, c.Point.identity), this._offsetPointX = b.x, this._offsetPointY = b.y, this._includeInLayout = !1, c.UIGlobals.stage.addEventListener(c.TouchEvent.TOUCH_MOVE, this.moveArea_mouseMoveHandler, this), c.UIGlobals.stage.addEventListener(c.TouchEvent.TOUCH_END, this.moveArea_mouseUpHandler, this), c.UIGlobals.stage.addEventListener(c.Event.LEAVE_STAGE, this.moveArea_mouseUpHandler, this))
  10442. };
  10443. a.prototype.moveArea_mouseMoveHandler = function(b) {
  10444. b = this.globalToLocal(b.stageX, b.stageY, c.Point.identity);
  10445. this.x += b.x - this._offsetPointX;
  10446. this.y += b.y - this._offsetPointY
  10447. };
  10448. a.prototype.moveArea_mouseUpHandler = function(b) {
  10449. c.UIGlobals.stage.removeEventListener(c.TouchEvent.TOUCH_MOVE, this.moveArea_mouseMoveHandler, this);
  10450. c.UIGlobals.stage.removeEventListener(c.TouchEvent.TOUCH_END, this.moveArea_mouseUpHandler, this);
  10451. c.UIGlobals.stage.removeEventListener(c.Event.LEAVE_STAGE, this.moveArea_mouseUpHandler, this);
  10452. this._autoBackToStage && this.adjustPosForStage();
  10453. c.LayoutUtil.adjustRelativeByXY(this);
  10454. this.includeInLayout = !0
  10455. };
  10456. a.prototype.adjustPosForStage = function() {
  10457. if (this.moveArea && this.stage) {
  10458. var b = this.moveArea.localToGlobal(0, 0),
  10459. a = b.x,
  10460. c = b.y;
  10461. 35 > b.x + this.moveArea.width && (a = 35 - this.moveArea.width);
  10462. b.x > this.stage.stageWidth - 20 && (a = this.stage.stageWidth - 20);
  10463. 20 > b.y + this.moveArea.height && (c = 20 - this.moveArea.height);
  10464. b.y > this.stage.stageHeight - 20 && (c = this.stage.stageHeight - 20);
  10465. this.x += a - b.x;
  10466. this.y += c - b.y
  10467. }
  10468. };
  10469. return a
  10470. } (c.Panel);
  10471. c.TitleWindow = e;
  10472. e.prototype.__class__ = "egret.TitleWindow"
  10473. })(egret || (egret = {}));
  10474. __extends = this.__extends ||
  10475. function(c, e) {
  10476. function d() {
  10477. this.constructor = c
  10478. }
  10479. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  10480. d.prototype = e.prototype;
  10481. c.prototype = new d
  10482. }; (function(c) {
  10483. var e = function(d) {
  10484. function a() {
  10485. d.call(this);
  10486. this._contentText = this._secondButtonLabel = this._firstButtonLabel = "";
  10487. this.hostComponentKey = "egret.Alert"
  10488. }
  10489. __extends(a, d);
  10490. a.show = function(b, d, e, m, g, h, l) {
  10491. "undefined" === typeof b && (b = "");
  10492. "undefined" === typeof d && (d = "");
  10493. "undefined" === typeof e && (e = null);
  10494. "undefined" === typeof m && (m = "\u786e\u5b9a");
  10495. "undefined" === typeof g && (g = "");
  10496. "undefined" === typeof h && (h = !0);
  10497. "undefined" === typeof l && (l = !0);
  10498. var n = new a;
  10499. n.contentText = b;
  10500. n.title = d;
  10501. n._firstButtonLabel = m;
  10502. n._secondButtonLabel = g;
  10503. n.closeHandler = e;
  10504. c.PopUpManager.addPopUp(n, h, l);
  10505. return n
  10506. };
  10507. Object.defineProperty(a.prototype, "firstButtonLabel", {
  10508. get: function() {
  10509. return this._firstButtonLabel
  10510. },
  10511. set: function(b) {
  10512. this._firstButtonLabel != b && (this._firstButtonLabel = b, this.firstButton && (this.firstButton.label = b))
  10513. },
  10514. enumerable: !0,
  10515. configurable: !0
  10516. });
  10517. Object.defineProperty(a.prototype, "secondButtonLabel", {
  10518. get: function() {
  10519. return this._secondButtonLabel
  10520. },
  10521. set: function(b) {
  10522. this._secondButtonLabel != b && (this._secondButtonLabel = b, !this.secondButton || null != b && "" != b || (this.secondButton.includeInLayout = this.secondButton.visible = "" != this._secondButtonLabel && null != this._secondButtonLabel))
  10523. },
  10524. enumerable: !0,
  10525. configurable: !0
  10526. });
  10527. Object.defineProperty(a.prototype, "contentText", {
  10528. get: function() {
  10529. return this._contentText
  10530. },
  10531. set: function(b) {
  10532. this._contentText != b && (this._contentText = b, this.contentDisplay && (this.contentDisplay.text = b))
  10533. },
  10534. enumerable: !0,
  10535. configurable: !0
  10536. });
  10537. a.prototype.onClose = function(b) {
  10538. c.PopUpManager.removePopUp(this);
  10539. if (null != this.closeHandler) {
  10540. var d = new c.CloseEvent(c.CloseEvent.CLOSE);
  10541. switch (b.currentTarget) {
  10542. case this.firstButton:
  10543. d.detail = a.FIRST_BUTTON;
  10544. break;
  10545. case this.secondButton:
  10546. d.detail = a.SECOND_BUTTON
  10547. }
  10548. this.closeHandler(d)
  10549. }
  10550. };
  10551. a.prototype.closeButton_clickHandler = function(b) {
  10552. d.prototype.closeButton_clickHandler.call(this, b);
  10553. c.PopUpManager.removePopUp(this);
  10554. b = new c.CloseEvent(c.CloseEvent.CLOSE, !1, !1, a.CLOSE_BUTTON);
  10555. null != this.closeHandler && this.closeHandler(b)
  10556. };
  10557. a.prototype.partAdded = function(b, a) {
  10558. d.prototype.partAdded.call(this, b, a);
  10559. a == this.contentDisplay ? this.contentDisplay.text = this._contentText: a == this.firstButton ? (this.firstButton.label = this._firstButtonLabel, this.firstButton.addEventListener(c.TouchEvent.TOUCH_TAP, this.onClose, this)) : a == this.secondButton && (this.secondButton.label = this._secondButtonLabel, this.secondButton.includeInLayout = this.secondButton.visible = "" != this._secondButtonLabel && null != this._secondButtonLabel, this.secondButton.addEventListener(c.TouchEvent.TOUCH_TAP, this.onClose, this))
  10560. };
  10561. a.prototype.partRemoved = function(b, a) {
  10562. d.prototype.partRemoved.call(this, b, a);
  10563. a == this.firstButton ? this.firstButton.removeEventListener(c.TouchEvent.TOUCH_TAP, this.onClose, this) : a == this.secondButton && this.secondButton.removeEventListener(c.TouchEvent.TOUCH_TAP, this.onClose, this)
  10564. };
  10565. a.FIRST_BUTTON = "firstButton";
  10566. a.SECOND_BUTTON = "secondButton";
  10567. a.CLOSE_BUTTON = "closeButton";
  10568. return a
  10569. } (c.TitleWindow);
  10570. c.Alert = e;
  10571. e.prototype.__class__ = "egret.Alert"
  10572. })(egret || (egret = {}));
  10573. __extends = this.__extends ||
  10574. function(c, e) {
  10575. function d() {
  10576. this.constructor = c
  10577. }
  10578. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  10579. d.prototype = e.prototype;
  10580. c.prototype = new d
  10581. }; (function(c) {
  10582. var e = function(d) {
  10583. function a() {
  10584. d.call(this);
  10585. this._slideDuration = 500;
  10586. this._direction = c.ProgressBarDirection.LEFT_TO_RIGHT;
  10587. this.animationValue = 0;
  10588. this.trackResizedOrMoved = !1;
  10589. this.hostComponentKey = "egret.ProgressBar"
  10590. }
  10591. __extends(a, d);
  10592. Object.defineProperty(a.prototype, "labelFunction", {
  10593. get: function() {
  10594. return this._labelFunction
  10595. },
  10596. set: function(b) {
  10597. this._labelFunction != b && (this._labelFunction = b, this.invalidateDisplayList())
  10598. },
  10599. enumerable: !0,
  10600. configurable: !0
  10601. });
  10602. a.prototype.valueToLabel = function(b, a) {
  10603. return null != this.labelFunction ? this._labelFunction(b, a) : b + " / " + a
  10604. };
  10605. Object.defineProperty(a.prototype, "slideDuration", {
  10606. get: function() {
  10607. return this._slideDuration
  10608. },
  10609. set: function(b) {
  10610. this._slideDuration != b && (this._slideDuration = b, this.animator && this.animator.isPlaying && (this.animator.stop(), this._setValue(this.slideToValue)))
  10611. },
  10612. enumerable: !0,
  10613. configurable: !0
  10614. });
  10615. Object.defineProperty(a.prototype, "direction", {
  10616. get: function() {
  10617. return this._direction
  10618. },
  10619. set: function(b) {
  10620. this._direction != b && (this._direction = b, this.invalidateDisplayList())
  10621. },
  10622. enumerable: !0,
  10623. configurable: !0
  10624. });
  10625. Object.defineProperty(a.prototype, "value", {
  10626. get: function() {
  10627. return this._getValue()
  10628. },
  10629. set: function(b) {
  10630. this._getValue() != b && (this._setValue(b), 0 < this._slideDuration && this.stage ? (this.validateProperties(), this.animator || (this.animator = new c.Animation(this.animationUpdateHandler, this)), this.animator.isPlaying && (this.animationValue = this.slideToValue, this.invalidateDisplayList(), this.animator.stop()), this.slideToValue = this.nearestValidValue(b, this.snapInterval), this.slideToValue != this.animationValue && (b = this._slideDuration * (Math.abs(this.animationValue - this.slideToValue) / (this.maximum - this.minimum)), this.animator.duration = Infinity === b ? 0 : b, this.animator.motionPaths = [{
  10631. prop: "value",
  10632. from: this.animationValue,
  10633. to: this.slideToValue
  10634. }], this.animator.play())) : this.animationValue = this._getValue())
  10635. },
  10636. enumerable: !0,
  10637. configurable: !0
  10638. });
  10639. a.prototype.animationUpdateHandler = function(b) {
  10640. b = this.nearestValidValue(b.currentValue.value, this.snapInterval);
  10641. this.animationValue = Math.min(this.maximum, Math.max(this.minimum, b));
  10642. this.invalidateDisplayList()
  10643. };
  10644. a.prototype.setValue = function(b) {
  10645. d.prototype.setValue.call(this, b);
  10646. this.invalidateDisplayList()
  10647. };
  10648. a.prototype.updateDisplayList = function(b, a) {
  10649. d.prototype.updateDisplayList.call(this, b, a);
  10650. this.updateSkinDisplayList()
  10651. };
  10652. a.prototype.partAdded = function(b, a) {
  10653. a == this.track && this.track instanceof c.UIComponent && (this.track.addEventListener(c.ResizeEvent.RESIZE, this.onTrackResizeOrMove, this), this.track.addEventListener(c.MoveEvent.MOVE, this.onTrackResizeOrMove, this))
  10654. };
  10655. a.prototype.partRemoved = function(b, a) {
  10656. a == this.track && this.track instanceof c.UIComponent && (this.track.removeEventListener(c.ResizeEvent.RESIZE, this.onTrackResizeOrMove, this), this.track.removeEventListener(c.MoveEvent.MOVE, this.onTrackResizeOrMove, this))
  10657. };
  10658. a.prototype.onTrackResizeOrMove = function(b) {
  10659. this.trackResizedOrMoved = !0;
  10660. this.invalidateProperties()
  10661. };
  10662. a.prototype.commitProperties = function() {
  10663. d.prototype.commitProperties.call(this);
  10664. this.trackResizedOrMoved && (this.trackResizedOrMoved = !1, this.updateSkinDisplayList())
  10665. };
  10666. a.prototype.updateSkinDisplayList = function() {
  10667. this.trackResizedOrMoved = !1;
  10668. var b = this.value;
  10669. this.animator && this.animator.isPlaying ? b = this.animationValue: (b = this.value, isNaN(b) && (b = 0));
  10670. var a = isNaN(this.maximum) ? 0 : this.maximum;
  10671. if (this.thumb && this.track) {
  10672. var d = isNaN(this.track.width) ? 0 : this.track.width,
  10673. d = d * this.track.scaleX,
  10674. e = isNaN(this.track.height) ? 0 : this.track.height,
  10675. e = e * this.track.scaleY,
  10676. g = Math.round(b / a * d);
  10677. if (isNaN(g) || 0 > g || Infinity === g) g = 0;
  10678. var h = Math.round(b / a * e);
  10679. if (isNaN(h) || 0 > h || Infinity === h) h = 0;
  10680. var l = this.track.localToGlobal(0, 0),
  10681. n = this.globalToLocal(l.x, l.y, c.Point.identity),
  10682. l = n.x,
  10683. n = n.y;
  10684. switch (this._direction) {
  10685. case c.ProgressBarDirection.LEFT_TO_RIGHT:
  10686. this.thumb.width = g;
  10687. this.thumb.height = e;
  10688. this.thumb.x = l;
  10689. break;
  10690. case c.ProgressBarDirection.RIGHT_TO_LEFT:
  10691. this.thumb.width = g;
  10692. this.thumb.height = e;
  10693. this.thumb.x = l + d - g;
  10694. break;
  10695. case c.ProgressBarDirection.TOP_TO_BOTTOM:
  10696. this.thumb.width = d;
  10697. this.thumb.height = h;
  10698. this.thumb.y = n;
  10699. break;
  10700. case c.ProgressBarDirection.BOTTOM_TO_TOP:
  10701. this.thumb.width = d,
  10702. this.thumb.height = h,
  10703. this.thumb.y = n + e - h
  10704. }
  10705. }
  10706. this.labelDisplay && (this.labelDisplay.text = this.valueToLabel(b, a))
  10707. };
  10708. return a
  10709. } (c.Range);
  10710. c.ProgressBar = e;
  10711. e.prototype.__class__ = "egret.ProgressBar"
  10712. })(egret || (egret = {})); (function(c) {
  10713. var e = function() {
  10714. function c() {}
  10715. c.LEFT_TO_RIGHT = "leftToRight";
  10716. c.RIGHT_TO_LEFT = "rightToLeft";
  10717. c.TOP_TO_BOTTOM = "topToBottom";
  10718. c.BOTTOM_TO_TOP = "bottomToTop";
  10719. return c
  10720. } ();
  10721. c.ProgressBarDirection = e;
  10722. e.prototype.__class__ = "egret.ProgressBarDirection"
  10723. })(egret || (egret = {}));
  10724. __extends = this.__extends ||
  10725. function(c, e) {
  10726. function d() {
  10727. this.constructor = c
  10728. }
  10729. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  10730. d.prototype = e.prototype;
  10731. c.prototype = new d
  10732. }; (function(c) {
  10733. var e = function(d) {
  10734. function a() {
  10735. d.call(this);
  10736. this.hostComponentKey = "egret.HSlider"
  10737. }
  10738. __extends(a, d);
  10739. a.prototype.pointToValue = function(b, a) {
  10740. if (!this.thumb || !this.track) return 0;
  10741. var c = this.maximum - this.minimum,
  10742. d = this.track.layoutBoundsWidth - this.thumb.layoutBoundsWidth;
  10743. return this.minimum + (0 != d ? b / d * c: 0)
  10744. };
  10745. a.prototype.updateSkinDisplayList = function() {
  10746. if (this.thumb && this.track) {
  10747. var b = this.track.layoutBoundsWidth - this.thumb.layoutBoundsWidth,
  10748. a = this.maximum - this.minimum,
  10749. b = 0 < a ? (this.pendingValue - this.minimum) / a * b: 0,
  10750. d = this.track.localToGlobal(b, 0),
  10751. a = d.x,
  10752. d = d.y,
  10753. e = this.thumb.parent.globalToLocal(a, d, c.Point.identity).x;
  10754. this.thumb.setLayoutBoundsPosition(Math.round(e), this.thumb.layoutBoundsY);
  10755. this.showTrackHighlight && this.trackHighlight && this.trackHighlight.parent && (a = this.trackHighlight.parent.globalToLocal(a, d, c.Point.identity).x - b, this.trackHighlight.x = Math.round(a), this.trackHighlight.width = Math.round(b))
  10756. }
  10757. };
  10758. return a
  10759. } (c.SliderBase);
  10760. c.HSlider = e;
  10761. e.prototype.__class__ = "egret.HSlider"
  10762. })(egret || (egret = {}));
  10763. __extends = this.__extends ||
  10764. function(c, e) {
  10765. function d() {
  10766. this.constructor = c
  10767. }
  10768. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  10769. d.prototype = e.prototype;
  10770. c.prototype = new d
  10771. }; (function(c) {
  10772. var e = function(d) {
  10773. function a() {
  10774. d.call(this);
  10775. this.hostComponentKey = "egret.VSlider"
  10776. }
  10777. __extends(a, d);
  10778. a.prototype.pointToValue = function(b, a) {
  10779. if (!this.thumb || !this.track) return 0;
  10780. var c = this.maximum - this.minimum,
  10781. d = this.track.layoutBoundsHeight - this.thumb.layoutBoundsHeight;
  10782. return this.minimum + (0 != d ? (d - a) / d * c: 0)
  10783. };
  10784. a.prototype.updateSkinDisplayList = function() {
  10785. if (this.thumb && this.track) {
  10786. var b = this.thumb.layoutBoundsHeight,
  10787. a = this.track.layoutBoundsHeight - b,
  10788. d = this.maximum - this.minimum,
  10789. e = this.track.localToGlobal(0, 0 < d ? a - (this.pendingValue - this.minimum) / d * a: 0),
  10790. d = e.x,
  10791. e = e.y,
  10792. g = this.thumb.parent.globalToLocal(d, e, c.Point.identity).y;
  10793. this.thumb.setLayoutBoundsPosition(this.thumb.layoutBoundsX, Math.round(g));
  10794. this.showTrackHighlight && this.trackHighlight && this.trackHighlight._parent && (d = this.trackHighlight._parent.globalToLocal(d, e, c.Point.identity).y, this.trackHighlight.y = Math.round(d + b), this.trackHighlight.height = Math.round(a - d))
  10795. }
  10796. };
  10797. return a
  10798. } (c.SliderBase);
  10799. c.VSlider = e;
  10800. e.prototype.__class__ = "egret.VSlider"
  10801. })(egret || (egret = {}));
  10802. __extends = this.__extends ||
  10803. function(c, e) {
  10804. function d() {
  10805. this.constructor = c
  10806. }
  10807. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  10808. d.prototype = e.prototype;
  10809. c.prototype = new d
  10810. }; (function(c) {
  10811. var e = function(d) {
  10812. function a() {
  10813. d.call(this);
  10814. this._allowMultipleSelection = !1;
  10815. this._selectedIndices = [];
  10816. this._captureItemRenderer = !0;
  10817. this.hostComponentKey = "egret.List";
  10818. this.useVirtualLayout = !0
  10819. }
  10820. __extends(a, d);
  10821. a.prototype.createChildren = function() {
  10822. this.itemRenderer || (this.itemRenderer = c.DataGroup.defaultRendererFactory);
  10823. d.prototype.createChildren.call(this)
  10824. };
  10825. Object.defineProperty(a.prototype, "useVirtualLayout", {
  10826. get: function() {
  10827. return this._getUseVirtualLayout()
  10828. },
  10829. set: function(b) {
  10830. this._setUseVirtualLayout(b)
  10831. },
  10832. enumerable: !0,
  10833. configurable: !0
  10834. });
  10835. Object.defineProperty(a.prototype, "allowMultipleSelection", {
  10836. get: function() {
  10837. return this._allowMultipleSelection
  10838. },
  10839. set: function(b) {
  10840. this._allowMultipleSelection = b
  10841. },
  10842. enumerable: !0,
  10843. configurable: !0
  10844. });
  10845. Object.defineProperty(a.prototype, "selectedIndices", {
  10846. get: function() {
  10847. return this._proposedSelectedIndices ? this._proposedSelectedIndices: this._selectedIndices
  10848. },
  10849. set: function(b) {
  10850. this._setSelectedIndices(b, !1)
  10851. },
  10852. enumerable: !0,
  10853. configurable: !0
  10854. });
  10855. Object.defineProperty(a.prototype, "selectedIndex", {
  10856. get: function() {
  10857. return this._proposedSelectedIndices ? 0 < this._proposedSelectedIndices.length ? this._proposedSelectedIndices[0] : -1 : this._getSelectedIndex()
  10858. },
  10859. set: function(b) {
  10860. this._setSelectedIndex(b)
  10861. },
  10862. enumerable: !0,
  10863. configurable: !0
  10864. });
  10865. Object.defineProperty(a.prototype, "selectedItems", {
  10866. get: function() {
  10867. var b = [],
  10868. a = this.selectedIndices;
  10869. if (a) for (var c = a.length,
  10870. d = 0; d < c; d++) b[d] = this.dataProvider.getItemAt(a[d]);
  10871. return b
  10872. },
  10873. set: function(b) {
  10874. var a = [];
  10875. if (b) for (var c = b.length,
  10876. d = 0; d < c; d++) {
  10877. var e = this.dataProvider.getItemIndex(b[d]); - 1 != e && a.splice(0, 0, e);
  10878. if ( - 1 == e) {
  10879. a = [];
  10880. break
  10881. }
  10882. }
  10883. this._setSelectedIndices(a, !1)
  10884. },
  10885. enumerable: !0,
  10886. configurable: !0
  10887. });
  10888. a.prototype._setSelectedIndices = function(b, a) {
  10889. "undefined" === typeof a && (a = !1);
  10890. a && (this._dispatchChangeAfterSelection = this._dispatchChangeAfterSelection || a);
  10891. this._proposedSelectedIndices = b ? b: [];
  10892. this.invalidateProperties()
  10893. };
  10894. a.prototype.commitProperties = function() {
  10895. d.prototype.commitProperties.call(this);
  10896. this._proposedSelectedIndices && this.commitSelection()
  10897. };
  10898. a.prototype.commitSelection = function(b) {
  10899. "undefined" === typeof b && (b = !0);
  10900. var a = this._selectedIndex;
  10901. if (this._proposedSelectedIndices) {
  10902. this._proposedSelectedIndices = this._proposedSelectedIndices.filter(this.isValidIndex);
  10903. if (!this.allowMultipleSelection && 0 < this._proposedSelectedIndices.length) {
  10904. var e = [];
  10905. e.push(this._proposedSelectedIndices[0]);
  10906. this._proposedSelectedIndices = e
  10907. }
  10908. this._proposedSelectedIndex = 0 < this._proposedSelectedIndices.length ? this._proposedSelectedIndices[0] : -1
  10909. }
  10910. e = d.prototype.commitSelection.call(this, !1);
  10911. if (!e) return this._proposedSelectedIndices = null,
  10912. !1;
  10913. this.selectedIndex > c.ListBase.NO_SELECTION && (this._proposedSelectedIndices ? -1 == this._proposedSelectedIndices.indexOf(this.selectedIndex) && this._proposedSelectedIndices.push(this.selectedIndex) : this._proposedSelectedIndices = [this.selectedIndex]);
  10914. this._proposedSelectedIndices && ( - 1 != this._proposedSelectedIndices.indexOf(a) && this.itemSelected(a, !0), this.commitMultipleSelection());
  10915. b && e && (this._dispatchChangeAfterSelection && (c.IndexChangeEvent.dispatchIndexChangeEvent(this, c.IndexChangeEvent.CHANGE, a, this._selectedIndex), this._dispatchChangeAfterSelection = !1), c.UIEvent.dispatchUIEvent(this, c.UIEvent.VALUE_COMMIT));
  10916. return e
  10917. };
  10918. a.prototype.isValidIndex = function(b, a, c) {
  10919. return this.dataProvider && 0 <= b && b < this.dataProvider.length
  10920. };
  10921. a.prototype.commitMultipleSelection = function() {
  10922. var b = [],
  10923. a = [],
  10924. c,
  10925. d;
  10926. if (0 < this._selectedIndices.length && 0 < this._proposedSelectedIndices.length) {
  10927. d = this._proposedSelectedIndices.length;
  10928. for (c = 0; c < d; c++) - 1 == this._selectedIndices.indexOf(this._proposedSelectedIndices[c]) && a.push(this._proposedSelectedIndices[c]);
  10929. d = this._selectedIndices.length;
  10930. for (c = 0; c < d; c++) - 1 == this._proposedSelectedIndices.indexOf(this._selectedIndices[c]) && b.push(this._selectedIndices[c])
  10931. } else 0 < this._selectedIndices.length ? b = this._selectedIndices: 0 < this._proposedSelectedIndices.length && (a = this._proposedSelectedIndices);
  10932. this._selectedIndices = this._proposedSelectedIndices;
  10933. if (0 < b.length) for (d = b.length, c = 0; c < d; c++) this.itemSelected(b[c], !1);
  10934. if (0 < a.length) for (d = a.length, c = 0; c < d; c++) this.itemSelected(a[c], !0);
  10935. this._proposedSelectedIndices = null
  10936. };
  10937. a.prototype._isItemIndexSelected = function(b) {
  10938. return this._allowMultipleSelection ? -1 != this._selectedIndices.indexOf(b) : d.prototype._isItemIndexSelected.call(this, b)
  10939. };
  10940. a.prototype.dataGroup_rendererAddHandler = function(b) {
  10941. d.prototype.dataGroup_rendererAddHandler.call(this, b);
  10942. b = b.renderer;
  10943. null != b && (b.addEventListener(c.TouchEvent.TOUCH_BEGIN, this.item_mouseDownHandler, this), b.addEventListener(c.TouchEvent.TOUCH_END, this.item_mouseUpHandler, this))
  10944. };
  10945. a.prototype.dataGroup_rendererRemoveHandler = function(b) {
  10946. d.prototype.dataGroup_rendererRemoveHandler.call(this, b);
  10947. b = b.renderer;
  10948. null != b && (b.removeEventListener(c.TouchEvent.TOUCH_BEGIN, this.item_mouseDownHandler, this), b.removeEventListener(c.TouchEvent.TOUCH_END, this.item_mouseUpHandler, this))
  10949. };
  10950. a.prototype.item_mouseDownHandler = function(b) {
  10951. if (!b.isDefaultPrevented()) {
  10952. var a = b.currentTarget,
  10953. d;
  10954. d = a ? a.itemIndex: this.dataGroup.getElementIndex(b.currentTarget);
  10955. this._allowMultipleSelection ? this._setSelectedIndices(this.calculateSelectedIndices(d, b.shiftKey, b.ctrlKey), !0) : this._setSelectedIndex(d, !0);
  10956. this._captureItemRenderer && (this.mouseDownItemRenderer = a, c.UIGlobals.stage.addEventListener(c.TouchEvent.TOUCH_END, this.stage_mouseUpHandler, this), c.UIGlobals.stage.addEventListener(c.Event.LEAVE_STAGE, this.stage_mouseUpHandler, this))
  10957. }
  10958. };
  10959. a.prototype.calculateSelectedIndices = function(b, a, c) {
  10960. var d = [];
  10961. if (a) if (a = 0 < this._selectedIndices.length ? this._selectedIndices[this._selectedIndices.length - 1] : 0, a < b) for (; a <= b; a++) d.splice(0, 0, a);
  10962. else for (; a >= b; a--) d.splice(0, 0, a);
  10963. else if (c) if (0 < this._selectedIndices.length) if (1 == this._selectedIndices.length && this._selectedIndices[0] == b) {
  10964. if (!this.requireSelection) return d;
  10965. d.splice(0, 0, this._selectedIndices[0])
  10966. } else {
  10967. c = !1;
  10968. for (a = 0; a < this._selectedIndices.length; a++) this._selectedIndices[a] == b ? c = !0 : this._selectedIndices[a] != b && d.splice(0, 0, this._selectedIndices[a]);
  10969. c || d.splice(0, 0, b)
  10970. } else d.splice(0, 0, b);
  10971. else d.splice(0, 0, b);
  10972. return d
  10973. };
  10974. a.prototype.item_mouseUpHandler = function(b) {
  10975. var a = b.currentTarget;
  10976. a == this.mouseDownItemRenderer && this._dispatchListEvent(b, c.ListEvent.ITEM_CLICK, a)
  10977. };
  10978. a.prototype.stage_mouseUpHandler = function(b) {
  10979. c.UIGlobals.stage.removeEventListener(c.TouchEvent.TOUCH_END, this.stage_mouseUpHandler, this);
  10980. c.UIGlobals.stage.removeEventListener(c.Event.LEAVE_STAGE, this.stage_mouseUpHandler, this);
  10981. this.mouseDownItemRenderer = null
  10982. };
  10983. return a
  10984. } (c.ListBase);
  10985. c.List = e;
  10986. e.prototype.__class__ = "egret.List"
  10987. })(egret || (egret = {}));
  10988. __extends = this.__extends ||
  10989. function(c, e) {
  10990. function d() {
  10991. this.constructor = c
  10992. }
  10993. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  10994. d.prototype = e.prototype;
  10995. c.prototype = new d
  10996. }; (function(c) {
  10997. var e = function(d) {
  10998. function a() {
  10999. d.call(this);
  11000. this._displayPopUp = this._popUpWidthMatchesAnchorWidth = this._popUpHeightMatchesAnchorHeight = this.addedToStage = this.popUpIsDisplayed = !1;
  11001. this._popUpPosition = c.PopUpPosition.TOP_LEFT;
  11002. this.inAnimation = !1;
  11003. this.animator = null;
  11004. this._openDuration = 250;
  11005. this._closeDuration = 150;
  11006. this.valueRange = 1;
  11007. this.addEventListener(c.Event.ADDED_TO_STAGE, this.addedToStageHandler, this);
  11008. this.addEventListener(c.Event.REMOVED_FROM_STAGE, this.removedFromStageHandler, this)
  11009. }
  11010. __extends(a, d);
  11011. Object.defineProperty(a.prototype, "popUpHeightMatchesAnchorHeight", {
  11012. get: function() {
  11013. return this._popUpHeightMatchesAnchorHeight
  11014. },
  11015. set: function(b) {
  11016. this._popUpHeightMatchesAnchorHeight != b && (this._popUpHeightMatchesAnchorHeight = b, this.invalidateDisplayList())
  11017. },
  11018. enumerable: !0,
  11019. configurable: !0
  11020. });
  11021. Object.defineProperty(a.prototype, "popUpWidthMatchesAnchorWidth", {
  11022. get: function() {
  11023. return this._popUpWidthMatchesAnchorWidth
  11024. },
  11025. set: function(b) {
  11026. this._popUpWidthMatchesAnchorWidth != b && (this._popUpWidthMatchesAnchorWidth = b, this.invalidateDisplayList())
  11027. },
  11028. enumerable: !0,
  11029. configurable: !0
  11030. });
  11031. Object.defineProperty(a.prototype, "displayPopUp", {
  11032. get: function() {
  11033. return this._displayPopUp
  11034. },
  11035. set: function(b) {
  11036. this._displayPopUp != b && (this._displayPopUp = b, this.addOrRemovePopUp())
  11037. },
  11038. enumerable: !0,
  11039. configurable: !0
  11040. });
  11041. Object.defineProperty(a.prototype, "popUp", {
  11042. get: function() {
  11043. return this._popUp
  11044. },
  11045. set: function(b) {
  11046. this._popUp != b && (this._popUp = b, this.dispatchEventWith("popUpChanged"))
  11047. },
  11048. enumerable: !0,
  11049. configurable: !0
  11050. });
  11051. Object.defineProperty(a.prototype, "popUpPosition", {
  11052. get: function() {
  11053. return this._popUpPosition
  11054. },
  11055. set: function(b) {
  11056. this._popUpPosition != b && (this._popUpPosition = b, this.invalidateDisplayList())
  11057. },
  11058. enumerable: !0,
  11059. configurable: !0
  11060. });
  11061. a.prototype.updateDisplayList = function(b, a) {
  11062. d.prototype.updateDisplayList.call(this, b, a);
  11063. this.applyPopUpTransform(b, a)
  11064. };
  11065. a.prototype.updatePopUpTransform = function() {
  11066. this.applyPopUpTransform(this.width, this.height)
  11067. };
  11068. a.prototype.calculatePopUpPosition = function() {
  11069. var b = c.Point.identity;
  11070. switch (this._popUpPosition) {
  11071. case c.PopUpPosition.BELOW:
  11072. b.x = 0;
  11073. b.y = this.height;
  11074. break;
  11075. case c.PopUpPosition.ABOVE:
  11076. b.x = 0;
  11077. b.y = -this.popUp.layoutBoundsHeight;
  11078. break;
  11079. case c.PopUpPosition.LEFT:
  11080. b.x = -this.popUp.layoutBoundsWidth;
  11081. b.y = 0;
  11082. break;
  11083. case c.PopUpPosition.RIGHT:
  11084. b.x = this.width;
  11085. b.y = 0;
  11086. break;
  11087. case c.PopUpPosition.CENTER:
  11088. b.x = 0.5 * (this.width - this.popUp.layoutBoundsWidth),
  11089. b.y = 0.5 * (this.height - this.popUp.layoutBoundsHeight)
  11090. }
  11091. b = this.localToGlobal(b.x, b.y, b);
  11092. return b = this.popUp.parent.globalToLocal(b.x, b.y, b)
  11093. };
  11094. Object.defineProperty(a.prototype, "openDuration", {
  11095. get: function() {
  11096. return this._openDuration
  11097. },
  11098. set: function(b) {
  11099. this._openDuration = b
  11100. },
  11101. enumerable: !0,
  11102. configurable: !0
  11103. });
  11104. Object.defineProperty(a.prototype, "closeDuration", {
  11105. get: function() {
  11106. return this._closeDuration
  11107. },
  11108. set: function(b) {
  11109. this._closeDuration = b
  11110. },
  11111. enumerable: !0,
  11112. configurable: !0
  11113. });
  11114. a.prototype.animationStartHandler = function(b) {
  11115. this.inAnimation = !0;
  11116. this.popUp && "enabled" in this.popUp && (this.popUp.enabled = !1)
  11117. };
  11118. a.prototype.animationUpdateHandler = function(b) {
  11119. var a = this.popUp._scrollRect,
  11120. d = Math.round(b.currentValue.x);
  11121. b = Math.round(b.currentValue.y);
  11122. a ? (a.x = d, a.y = b, a.width = this.popUp.width, a.height = this.popUp.height) : this.popUp._scrollRect = new c.Rectangle(d, b, this.popUp.width, this.popUp.height)
  11123. };
  11124. a.prototype.animationEndHandler = function(b) {
  11125. this.inAnimation = !1;
  11126. this.popUp && "enabled" in this.popUp && (this.popUp.enabled = !0);
  11127. this.popUp.scrollRect = null;
  11128. this.popUpIsDisplayed || (c.PopUpManager.removePopUp(this.popUp), this.popUp.ownerChanged(null))
  11129. };
  11130. a.prototype.addOrRemovePopUp = function() {
  11131. this.addedToStage && this.popUp && (null == this.popUp.parent && this.displayPopUp ? (c.PopUpManager.addPopUp(this.popUp, !1, !1), this.popUp.ownerChanged(this), this.popUpIsDisplayed = !0, this.inAnimation && this.animator.end(), this.initialized ? (this.applyPopUpTransform(this.width, this.height), 0 < this._openDuration && this.startAnimation()) : c.callLater(function() {
  11132. 0 < this.openDuration && this.startAnimation()
  11133. },
  11134. this)) : null == this.popUp.parent || this.displayPopUp || this.removeAndResetPopUp())
  11135. };
  11136. a.prototype.removeAndResetPopUp = function() {
  11137. this.inAnimation && this.animator.end();
  11138. this.popUpIsDisplayed = !1;
  11139. 0 < this._closeDuration ? this.startAnimation() : (c.PopUpManager.removePopUp(this.popUp), this.popUp.ownerChanged(null))
  11140. };
  11141. a.prototype.applyPopUpTransform = function(b, a) {
  11142. if (this.popUpIsDisplayed) {
  11143. this.popUpWidthMatchesAnchorWidth && (this.popUp.width = b);
  11144. this.popUpHeightMatchesAnchorHeight && (this.popUp.height = a);
  11145. "validateNow" in this.popUp && this.popUp.validateNow();
  11146. var c = this.calculatePopUpPosition();
  11147. this.popUp.x = c.x;
  11148. this.popUp.y = c.y
  11149. }
  11150. };
  11151. a.prototype.startAnimation = function() {
  11152. this.animator || (this.animator = new c.Animation(this.animationUpdateHandler, this), this.animator.endFunction = this.animationEndHandler, this.animator.startFunction = this.animationStartHandler);
  11153. this.animator.motionPaths = this.createMotionPath();
  11154. this.animator.duration = this.popUpIsDisplayed ? this._openDuration: this._closeDuration;
  11155. this.animator.play()
  11156. };
  11157. a.prototype.createMotionPath = function() {
  11158. var b = {
  11159. prop: "x"
  11160. },
  11161. a = {
  11162. prop: "y"
  11163. },
  11164. d = [b, a];
  11165. switch (this._popUpPosition) {
  11166. case c.PopUpPosition.TOP_LEFT:
  11167. case c.PopUpPosition.CENTER:
  11168. case c.PopUpPosition.BELOW:
  11169. b.from = b.to = 0;
  11170. a.from = this.popUp.height;
  11171. a.to = 0;
  11172. this.valueRange = this.popUp.height;
  11173. break;
  11174. case c.PopUpPosition.ABOVE:
  11175. b.from = b.to = 0;
  11176. a.from = -this.popUp.height;
  11177. a.to = 0;
  11178. this.valueRange = this.popUp.height;
  11179. break;
  11180. case c.PopUpPosition.LEFT:
  11181. a.from = a.to = 0;
  11182. b.from = -this.popUp.width;
  11183. b.to = 0;
  11184. this.valueRange = this.popUp.width;
  11185. break;
  11186. case c.PopUpPosition.RIGHT:
  11187. a.from = a.to = 0;
  11188. b.from = this.popUp.width;
  11189. b.to = 0;
  11190. this.valueRange = this.popUp.width;
  11191. break;
  11192. default:
  11193. this.valueRange = 1
  11194. }
  11195. this.valueRange = Math.abs(this.valueRange);
  11196. if (!this.popUpIsDisplayed) {
  11197. var e = b.from;
  11198. b.from = b.to;
  11199. b.to = e;
  11200. e = a.from;
  11201. a.from = a.to;
  11202. a.to = e
  11203. }
  11204. return d
  11205. };
  11206. a.prototype.addedToStageHandler = function(b) {
  11207. this.addedToStage = !0;
  11208. c.callLater(this.checkPopUpState, this)
  11209. };
  11210. a.prototype.checkPopUpState = function() {
  11211. this.addedToStage ? this.addOrRemovePopUp() : null != this.popUp && null != this.popUp.parent && this.removeAndResetPopUp()
  11212. };
  11213. a.prototype.removedFromStageHandler = function(b) {
  11214. this.addedToStage = !1;
  11215. c.callLater(this.checkPopUpState, this)
  11216. };
  11217. return a
  11218. } (c.UIComponent);
  11219. c.PopUpAnchor = e;
  11220. e.prototype.__class__ = "egret.PopUpAnchor"
  11221. })(egret || (egret = {}));
  11222. __extends = this.__extends ||
  11223. function(c, e) {
  11224. function d() {
  11225. this.constructor = c
  11226. }
  11227. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  11228. d.prototype = e.prototype;
  11229. c.prototype = new d
  11230. }; (function(c) {
  11231. var e = function(d) {
  11232. function a() {
  11233. d.call(this);
  11234. this._isOpen = !1;
  11235. this._closeOnResize = !0;
  11236. this._rollOverOpenDelay = NaN
  11237. }
  11238. __extends(a, d);
  11239. Object.defineProperty(a.prototype, "openButton", {
  11240. get: function() {
  11241. return this._openButton
  11242. },
  11243. set: function(b) {
  11244. this._openButton !== b && (this.removeOpenTriggers(), this._openButton = b, this.addOpenTriggers())
  11245. },
  11246. enumerable: !0,
  11247. configurable: !0
  11248. });
  11249. Object.defineProperty(a.prototype, "dropDown", {
  11250. get: function() {
  11251. return this._dropDown
  11252. },
  11253. set: function(b) {
  11254. this._dropDown !== b && (this._dropDown = b)
  11255. },
  11256. enumerable: !0,
  11257. configurable: !0
  11258. });
  11259. Object.defineProperty(a.prototype, "isOpen", {
  11260. get: function() {
  11261. return this._isOpen
  11262. },
  11263. enumerable: !0,
  11264. configurable: !0
  11265. });
  11266. Object.defineProperty(a.prototype, "closeOnResize", {
  11267. get: function() {
  11268. return this._closeOnResize
  11269. },
  11270. set: function(b) {
  11271. this._closeOnResize != b && (this.isOpen && this.removeCloseOnResizeTrigger(), this._closeOnResize = b, this.addCloseOnResizeTrigger())
  11272. },
  11273. enumerable: !0,
  11274. configurable: !0
  11275. });
  11276. Object.defineProperty(a.prototype, "rollOverOpenDelay", {
  11277. get: function() {
  11278. return this._rollOverOpenDelay
  11279. },
  11280. set: function(b) {
  11281. this._rollOverOpenDelay != b && (this.removeOpenTriggers(), this._rollOverOpenDelay = b, this.addOpenTriggers())
  11282. },
  11283. enumerable: !0,
  11284. configurable: !0
  11285. });
  11286. a.prototype.addOpenTriggers = function() {
  11287. this.openButton && (isNaN(this.rollOverOpenDelay) ? this.openButton.addEventListener(c.UIEvent.BUTTON_DOWN, this._openButton_buttonDownHandler, this) : this.openButton.addEventListener(c.TouchEvent.TOUCH_ROLL_OVER, this._openButton_rollOverHandler, this))
  11288. };
  11289. a.prototype.removeOpenTriggers = function() {
  11290. this.openButton && (isNaN(this.rollOverOpenDelay) ? this.openButton.removeEventListener(c.UIEvent.BUTTON_DOWN, this._openButton_buttonDownHandler, this) : this.openButton.removeEventListener(c.TouchEvent.TOUCH_ROLL_OVER, this._openButton_rollOverHandler, this))
  11291. };
  11292. a.prototype.addCloseTriggers = function() {
  11293. c.UIGlobals.stage && (isNaN(this.rollOverOpenDelay) ? (c.UIGlobals.stage.addEventListener(c.TouchEvent.TOUCH_BEGIN, this.stage_mouseDownHandler, this), c.UIGlobals.stage.addEventListener(c.TouchEvent.TOUCH_END, this.stage_mouseUpHandler_noRollOverOpenDelay, this)) : c.UIGlobals.stage.addEventListener(c.TouchEvent.TOUCH_MOVE, this.stage_mouseMoveHandler, this), this.addCloseOnResizeTrigger())
  11294. };
  11295. a.prototype.removeCloseTriggers = function() {
  11296. c.UIGlobals.stage && (isNaN(this.rollOverOpenDelay) ? (c.UIGlobals.stage.removeEventListener(c.TouchEvent.TOUCH_BEGIN, this.stage_mouseDownHandler, this), c.UIGlobals.stage.removeEventListener(c.TouchEvent.TOUCH_END, this.stage_mouseUpHandler_noRollOverOpenDelay, this)) : (c.UIGlobals.stage.removeEventListener(c.TouchEvent.TOUCH_MOVE, this.stage_mouseMoveHandler, this), c.UIGlobals.stage.removeEventListener(c.TouchEvent.TOUCH_END, this.stage_mouseUpHandler, this), c.UIGlobals.stage.removeEventListener(c.Event.LEAVE_STAGE, this.stage_mouseUpHandler, this)), this.removeCloseOnResizeTrigger())
  11297. };
  11298. a.prototype.addCloseOnResizeTrigger = function() {
  11299. this.closeOnResize && c.UIGlobals.stage.addEventListener(c.Event.RESIZE, this.stage_resizeHandler, this)
  11300. };
  11301. a.prototype.removeCloseOnResizeTrigger = function() {
  11302. this.closeOnResize && c.UIGlobals.stage.removeEventListener(c.Event.RESIZE, this.stage_resizeHandler, this)
  11303. };
  11304. a.prototype.isTargetOverDropDownOrOpenButton = function(b) {
  11305. if (b) {
  11306. if (this.openButton && this.openButton.contains(b)) return ! 0;
  11307. if (null != this.hitAreaAdditions) for (var a = 0; a < this.hitAreaAdditions.length; a++) if (this.hitAreaAdditions[a] == b || this.hitAreaAdditions[a] instanceof c.DisplayObjectContainer && this.hitAreaAdditions[a].contains(b)) return ! 0;
  11308. if (this.dropDown instanceof c.DisplayObjectContainer) {
  11309. if (this.dropDown.contains(b)) return ! 0
  11310. } else if (b == this.dropDown) return ! 0
  11311. }
  11312. return ! 1
  11313. };
  11314. a.prototype.openDropDown = function() {
  11315. this.openDropDownHelper()
  11316. };
  11317. a.prototype.openDropDownHelper = function() {
  11318. this.isOpen || (this.addCloseTriggers(), this._isOpen = !0, this.openButton && this.openButton._setKeepDown(!0), c.UIEvent.dispatchUIEvent(this, c.UIEvent.OPEN))
  11319. };
  11320. a.prototype.closeDropDown = function(b) {
  11321. if (this.isOpen) {
  11322. this._isOpen = !1;
  11323. this.openButton && this.openButton._setKeepDown(!1);
  11324. var a = new c.UIEvent(c.UIEvent.CLOSE, !1, !0);
  11325. b || a.preventDefault();
  11326. this.dispatchEvent(a);
  11327. this.removeCloseTriggers()
  11328. }
  11329. };
  11330. a.prototype._openButton_buttonDownHandler = function(b) {
  11331. this.isOpen ? this.closeDropDown(!0) : (this.mouseIsDown = !0, this.openDropDownHelper())
  11332. };
  11333. a.prototype._openButton_rollOverHandler = function(b) {
  11334. 0 == this.rollOverOpenDelay ? this.openDropDownHelper() : (this.openButton.addEventListener(c.TouchEvent.TOUCH_ROLL_OUT, this.openButton_rollOutHandler, this), this.rollOverOpenDelayTimer = new c.Timer(this.rollOverOpenDelay, 1), this.rollOverOpenDelayTimer.addEventListener(c.TimerEvent.TIMER_COMPLETE, this.rollOverDelay_timerCompleteHandler, this), this.rollOverOpenDelayTimer.start())
  11335. };
  11336. a.prototype.openButton_rollOutHandler = function(b) {
  11337. this.rollOverOpenDelayTimer && this.rollOverOpenDelayTimer.running && (this.rollOverOpenDelayTimer.stop(), this.rollOverOpenDelayTimer = null);
  11338. this.openButton.removeEventListener(c.TouchEvent.TOUCH_ROLL_OUT, this.openButton_rollOutHandler, this)
  11339. };
  11340. a.prototype.rollOverDelay_timerCompleteHandler = function(b) {
  11341. this.openButton.removeEventListener(c.TouchEvent.TOUCH_ROLL_OUT, this.openButton_rollOutHandler, this);
  11342. this.rollOverOpenDelayTimer = null;
  11343. this.openDropDownHelper()
  11344. };
  11345. a.prototype.stage_mouseDownHandler = function(b) {
  11346. if (this.mouseIsDown) this.mouseIsDown = !1;
  11347. else if (!this.dropDown || this.dropDown && (b.target == this.dropDown || this.dropDown instanceof c.DisplayObjectContainer && !this.dropDown.contains(b.target))) {
  11348. var a = b.target;
  11349. if (! (this.openButton && a && this.openButton.contains(a))) {
  11350. if (null != this.hitAreaAdditions) for (a = 0; a < this.hitAreaAdditions.length; a++) if (this.hitAreaAdditions[a] == b.target || this.hitAreaAdditions[a] instanceof c.DisplayObjectContainer && this.hitAreaAdditions[a].contains(b.target)) return;
  11351. this.closeDropDown(!0)
  11352. }
  11353. }
  11354. };
  11355. a.prototype.stage_mouseMoveHandler = function(b) {
  11356. this.isTargetOverDropDownOrOpenButton(b.target) || (b instanceof c.TouchEvent && b.touchDown ? (c.UIGlobals.stage.addEventListener(c.TouchEvent.TOUCH_END, this.stage_mouseUpHandler, this), c.UIGlobals.stage.addEventListener(c.Event.LEAVE_STAGE, this.stage_mouseUpHandler, this)) : this.closeDropDown(!0))
  11357. };
  11358. a.prototype.stage_mouseUpHandler_noRollOverOpenDelay = function(b) {
  11359. this.mouseIsDown && (this.mouseIsDown = !1)
  11360. };
  11361. a.prototype.stage_mouseUpHandler = function(b) {
  11362. this.isTargetOverDropDownOrOpenButton(b.target) ? (c.UIGlobals.stage.removeEventListener(c.TouchEvent.TOUCH_END, this.stage_mouseUpHandler, this), c.UIGlobals.stage.removeEventListener(c.Event.LEAVE_STAGE, this.stage_mouseUpHandler, this)) : this.closeDropDown(!0)
  11363. };
  11364. a.prototype.stage_resizeHandler = function(b) {
  11365. this.closeDropDown(!0)
  11366. };
  11367. a.prototype.stage_mouseWheelHandler = function(b) { ! this.dropDown || this.dropDown.contains(b.target) && b.isDefaultPrevented() || this.closeDropDown(!1)
  11368. };
  11369. return a
  11370. } (c.EventDispatcher);
  11371. c.DropDownController = e;
  11372. e.prototype.__class__ = "egret.DropDownController"
  11373. })(egret || (egret = {}));
  11374. __extends = this.__extends ||
  11375. function(c, e) {
  11376. function d() {
  11377. this.constructor = c
  11378. }
  11379. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  11380. d.prototype = e.prototype;
  11381. c.prototype = new d
  11382. }; (function(c) {
  11383. var e = function(d) {
  11384. function a() {
  11385. d.call(this);
  11386. this._labelChanged = !1;
  11387. this._userProposedSelectedIndex = c.ListBase.NO_SELECTION;
  11388. this._captureItemRenderer = !1;
  11389. this.dropDownController = new c.DropDownController
  11390. }
  11391. __extends(a, d);
  11392. a.prototype._setDataProvider = function(b) {
  11393. this.dataProvider !== b && (d.prototype._setDataProvider.call(this, b), this._labelChanged = !0, this.invalidateProperties())
  11394. };
  11395. a.prototype._setLabelField = function(b) {
  11396. this.labelField != b && (d.prototype._setLabelField.call(this, b), this._labelChanged = !0, this.invalidateProperties())
  11397. };
  11398. a.prototype._setLabelFunction = function(b) {
  11399. this.labelFunction != b && (d.prototype._setLabelFunction.call(this, b), this._labelChanged = !0, this.invalidateProperties())
  11400. };
  11401. Object.defineProperty(a.prototype, "dropDownController", {
  11402. get: function() {
  11403. return this._dropDownController
  11404. },
  11405. set: function(b) {
  11406. this._dropDownController != b && (this._dropDownController = b, this._dropDownController.addEventListener(c.UIEvent.OPEN, this._dropDownController_openHandler, this), this._dropDownController.addEventListener(c.UIEvent.CLOSE, this.dropDownController_closeHandler, this), this.openButton && (this._dropDownController.openButton = this.openButton), this.dropDown && (this._dropDownController.dropDown = this.dropDown))
  11407. },
  11408. enumerable: !0,
  11409. configurable: !0
  11410. });
  11411. Object.defineProperty(a.prototype, "isDropDownOpen", {
  11412. get: function() {
  11413. return this.dropDownController ? this.dropDownController.isOpen: !1
  11414. },
  11415. enumerable: !0,
  11416. configurable: !0
  11417. });
  11418. a.prototype.commitProperties = function() {
  11419. d.prototype.commitProperties.call(this);
  11420. this._labelChanged && (this._labelChanged = !1, this.updateLabelDisplay())
  11421. };
  11422. a.prototype.partAdded = function(b, a) {
  11423. d.prototype.partAdded.call(this, b, a);
  11424. a == this.openButton ? this.dropDownController && (this.dropDownController.openButton = this.openButton) : a == this.dropDown && this.dropDownController && (this.dropDownController.dropDown = this.dropDown)
  11425. };
  11426. a.prototype.partRemoved = function(b, a) {
  11427. this.dropDownController && (a == this.openButton && (this.dropDownController.openButton = null), a == this.dropDown && (this.dropDownController.dropDown = null));
  11428. d.prototype.partRemoved.call(this, b, a)
  11429. };
  11430. a.prototype.getCurrentSkinState = function() {
  11431. return this.enabled ? this.isDropDownOpen ? "open": "normal": "disabled"
  11432. };
  11433. a.prototype.commitSelection = function(b) {
  11434. "undefined" === typeof b && (b = !0);
  11435. b = d.prototype.commitSelection.call(this, b);
  11436. this.updateLabelDisplay();
  11437. return b
  11438. };
  11439. a.prototype._isItemIndexSelected = function(b) {
  11440. return this._userProposedSelectedIndex == b
  11441. };
  11442. a.prototype.openDropDown = function() {
  11443. this.dropDownController.openDropDown()
  11444. };
  11445. a.prototype.closeDropDown = function(b) {
  11446. this.dropDownController.closeDropDown(b)
  11447. };
  11448. a.prototype.updateLabelDisplay = function(b) {};
  11449. a.prototype._changeHighlightedSelection = function(b, a) {
  11450. this.itemSelected(this._userProposedSelectedIndex, !1);
  11451. this._userProposedSelectedIndex = b;
  11452. this.itemSelected(this._userProposedSelectedIndex, !0)
  11453. };
  11454. a.prototype.dataProvider_collectionChangeHandler = function(b) {
  11455. d.prototype.dataProvider_collectionChangeHandler.call(this, b);
  11456. this._labelChanged = !0;
  11457. this.invalidateProperties()
  11458. };
  11459. a.prototype.item_mouseDownHandler = function(b) {
  11460. d.prototype.item_mouseDownHandler.call(this, b);
  11461. this._dispatchListEvent(b, c.ListEvent.ITEM_CLICK, b.currentTarget);
  11462. this._userProposedSelectedIndex = this.selectedIndex;
  11463. this.closeDropDown(!0)
  11464. };
  11465. a.prototype._dropDownController_openHandler = function(b) {
  11466. this.addEventListener(c.UIEvent.UPDATE_COMPLETE, this._open_updateCompleteHandler, this);
  11467. this._userProposedSelectedIndex = this.selectedIndex;
  11468. this.invalidateSkinState()
  11469. };
  11470. a.prototype._open_updateCompleteHandler = function(b) {
  11471. this.removeEventListener(c.UIEvent.UPDATE_COMPLETE, this._open_updateCompleteHandler, this);
  11472. c.UIEvent.dispatchUIEvent(this, c.UIEvent.OPEN)
  11473. };
  11474. a.prototype.dropDownController_closeHandler = function(b) {
  11475. this.addEventListener(c.UIEvent.UPDATE_COMPLETE, this.close_updateCompleteHandler, this);
  11476. this.invalidateSkinState();
  11477. b.isDefaultPrevented() ? this._changeHighlightedSelection(this.selectedIndex) : this._setSelectedIndex(this._userProposedSelectedIndex, !0)
  11478. };
  11479. a.prototype.close_updateCompleteHandler = function(b) {
  11480. this.removeEventListener(c.UIEvent.UPDATE_COMPLETE, this.close_updateCompleteHandler, this);
  11481. c.UIEvent.dispatchUIEvent(this, c.UIEvent.CLOSE)
  11482. };
  11483. a.PAGE_SIZE = 5;
  11484. return a
  11485. } (c.List);
  11486. c.DropDownListBase = e;
  11487. e.prototype.__class__ = "egret.DropDownListBase"
  11488. })(egret || (egret = {}));
  11489. __extends = this.__extends ||
  11490. function(c, e) {
  11491. function d() {
  11492. this.constructor = c
  11493. }
  11494. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  11495. d.prototype = e.prototype;
  11496. c.prototype = new d
  11497. }; (function(c) {
  11498. var e = function(d) {
  11499. function a() {
  11500. d.call(this);
  11501. this.iconFieldOrFunctionChanged = !1;
  11502. this.hostComponentKey = "egret.Tree"
  11503. }
  11504. __extends(a, d);
  11505. a.prototype.createChildren = function() {
  11506. this.itemRenderer || (this.itemRenderer = a.defaultTreeRendererFactory);
  11507. d.prototype.createChildren.call(this)
  11508. };
  11509. a.prototype.updateRenderer = function(b, a, c) {
  11510. if ("hasChildren" in b && "hasChildren" in this.dataProvider) {
  11511. var e = this.dataProvider;
  11512. b.hasChildren = e.hasChildren(c);
  11513. b.opened = e.isItemOpen(c);
  11514. b.depth = e.getDepth(c);
  11515. b.iconSkinName = this.itemToIcon(c)
  11516. }
  11517. return d.prototype.updateRenderer.call(this, b, a, c)
  11518. };
  11519. a.prototype.itemToIcon = function(b) {
  11520. if (!b) return null;
  11521. if (null != this._iconFunction) return this._iconFunction(b);
  11522. var a;
  11523. if (b instanceof Object) try {
  11524. b[this.iconField] && (a = b[this.iconField])
  11525. } catch(c) {}
  11526. return a
  11527. };
  11528. a.prototype.dataGroup_rendererAddHandler = function(b) {
  11529. d.prototype.dataGroup_rendererAddHandler.call(this, b);
  11530. b.renderer && "hasChildren" in b.renderer && b.renderer.addEventListener(c.TreeEvent.ITEM_OPENING, this.onItemOpening, this)
  11531. };
  11532. a.prototype.onItemOpening = function(b) {
  11533. var a = b.itemRenderer,
  11534. d = b.item,
  11535. e = this._getDataProvider();
  11536. a && e && "hasChildren" in e && this.dispatchEvent(b) && (b = !a.opened, e.expandItem(d, b), c.TreeEvent.dispatchTreeEvent(this, b ? c.TreeEvent.ITEM_OPEN: c.TreeEvent.ITEM_CLOSE, a.itemIndex, d, a))
  11537. };
  11538. a.prototype.dataGroup_rendererRemoveHandler = function(b) {
  11539. d.prototype.dataGroup_rendererRemoveHandler.call(this, b);
  11540. b.renderer && "hasChildren" in b.renderer && b.renderer.removeEventListener(c.TreeEvent.ITEM_OPENING, this.onItemOpening, this)
  11541. };
  11542. Object.defineProperty(a.prototype, "iconField", {
  11543. get: function() {
  11544. return this._iconField
  11545. },
  11546. set: function(b) {
  11547. this._iconField != b && (this._iconField = b, this.iconFieldOrFunctionChanged = !0, this.invalidateProperties())
  11548. },
  11549. enumerable: !0,
  11550. configurable: !0
  11551. });
  11552. Object.defineProperty(a.prototype, "iconFunction", {
  11553. get: function() {
  11554. return this._iconFunction
  11555. },
  11556. set: function(b) {
  11557. this._iconFunction != b && (this._iconFunction = b, this.iconFieldOrFunctionChanged = !0, this.invalidateProperties())
  11558. },
  11559. enumerable: !0,
  11560. configurable: !0
  11561. });
  11562. a.prototype.expandItem = function(b, a) {
  11563. "undefined" === typeof a && (a = !0);
  11564. var c = this._getDataProvider();
  11565. c && "hasChildren" in c && c.expandItem(b, a)
  11566. };
  11567. a.prototype.isItemOpen = function(b) {
  11568. var a = this._getDataProvider();
  11569. return a && "hasChildren" in a ? a.isItemOpen(b) : !1
  11570. };
  11571. a.prototype.dataProvider_collectionChangeHandler = function(b) {
  11572. d.prototype.dataProvider_collectionChangeHandler.call(this, b);
  11573. if (b.kind == c.CollectionEventKind.OPEN || b.kind == c.CollectionEventKind.CLOSE) {
  11574. var a = this.dataGroup ? this.dataGroup.getElementAt(b.location) : null;
  11575. a && (this.updateRenderer(a, b.location, b.items[0]), b.kind == c.CollectionEventKind.CLOSE && this.layout && this.layout.useVirtualLayout && (this.layout.clearVirtualLayoutCache(), this.invalidateSize()))
  11576. }
  11577. };
  11578. a.prototype.commitProperties = function() {
  11579. d.prototype.commitProperties.call(this);
  11580. if (this.iconFieldOrFunctionChanged) {
  11581. if (null != this.dataGroup) {
  11582. var b;
  11583. if (this.layout && this.layout.useVirtualLayout) for (var a = this.dataGroup.getElementIndicesInView(), c = a.length, e = 0; e < c; e++) b = a[e],
  11584. this.updateRendererIconProperty(b);
  11585. else for (a = this.dataGroup.numElements, b = 0; b < a; b++) this.updateRendererIconProperty(b)
  11586. }
  11587. this.iconFieldOrFunctionChanged = !1
  11588. }
  11589. };
  11590. a.prototype.updateRendererIconProperty = function(b) {
  11591. if (b = this.dataGroup.getElementAt(b)) b.iconSkinName = this.itemToIcon(b.data)
  11592. };
  11593. a.defaultTreeRendererFactory = new c.ClassFactory(c.TreeItemRenderer);
  11594. return a
  11595. } (c.List);
  11596. c.Tree = e;
  11597. e.prototype.__class__ = "egret.Tree"
  11598. })(egret || (egret = {}));
  11599. __extends = this.__extends ||
  11600. function(c, e) {
  11601. function d() {
  11602. this.constructor = c
  11603. }
  11604. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  11605. d.prototype = e.prototype;
  11606. c.prototype = new d
  11607. }; (function(c) {
  11608. var e = function(c) {
  11609. function a() {
  11610. c.call(this);
  11611. this._prompt = "";
  11612. this.hostComponentKey = "egret.DropDownList"
  11613. }
  11614. __extends(a, c);
  11615. Object.defineProperty(a.prototype, "prompt", {
  11616. get: function() {
  11617. return this._prompt
  11618. },
  11619. set: function(b) {
  11620. this._prompt != b && (this._prompt = b, this._labelChanged = !0, this.invalidateProperties())
  11621. },
  11622. enumerable: !0,
  11623. configurable: !0
  11624. });
  11625. a.prototype.partAdded = function(b, a) {
  11626. c.prototype.partAdded.call(this, b, a);
  11627. a == this.labelDisplay && (this._labelChanged = !0, this.invalidateProperties())
  11628. };
  11629. a.prototype.updateLabelDisplay = function(b) {
  11630. "undefined" === typeof b && (b = void 0);
  11631. this.labelDisplay && (void 0 == b && (b = this.selectedItem), this.labelDisplay.text = null != b && void 0 != b ? this.itemToLabel(b) : this._prompt)
  11632. };
  11633. return a
  11634. } (c.DropDownListBase);
  11635. c.DropDownList = e;
  11636. e.prototype.__class__ = "egret.DropDownList"
  11637. })(egret || (egret = {}));
  11638. __extends = this.__extends ||
  11639. function(c, e) {
  11640. function d() {
  11641. this.constructor = c
  11642. }
  11643. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  11644. d.prototype = e.prototype;
  11645. c.prototype = new d
  11646. }; (function(c) {
  11647. var e = function(c) {
  11648. function a() {
  11649. c.call(this);
  11650. this._allowDeselection = !0;
  11651. this.hostComponentKey = "egret.TabBarButton"
  11652. }
  11653. __extends(a, c);
  11654. Object.defineProperty(a.prototype, "allowDeselection", {
  11655. get: function() {
  11656. return this._allowDeselection
  11657. },
  11658. set: function(b) {
  11659. this._allowDeselection = b
  11660. },
  11661. enumerable: !0,
  11662. configurable: !0
  11663. });
  11664. Object.defineProperty(a.prototype, "data", {
  11665. get: function() {
  11666. return this._data
  11667. },
  11668. set: function(b) {
  11669. this._data = b;
  11670. this.dispatchEventWith("dataChange")
  11671. },
  11672. enumerable: !0,
  11673. configurable: !0
  11674. });
  11675. Object.defineProperty(a.prototype, "itemIndex", {
  11676. get: function() {
  11677. return this._itemIndex
  11678. },
  11679. set: function(b) {
  11680. this._itemIndex = b
  11681. },
  11682. enumerable: !0,
  11683. configurable: !0
  11684. });
  11685. a.prototype._setLabel = function(b) {
  11686. b != this._getLabel() && (c.prototype._setLabel.call(this, b), this.labelDisplay && (this.labelDisplay.text = this._getLabel()))
  11687. };
  11688. a.prototype.buttonReleased = function() {
  11689. this.selected && !this.allowDeselection || c.prototype.buttonReleased.call(this)
  11690. };
  11691. return a
  11692. } (c.ToggleButtonBase);
  11693. c.TabBarButton = e;
  11694. e.prototype.__class__ = "egret.TabBarButton"
  11695. })(egret || (egret = {}));
  11696. __extends = this.__extends ||
  11697. function(c, e) {
  11698. function d() {
  11699. this.constructor = c
  11700. }
  11701. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  11702. d.prototype = e.prototype;
  11703. c.prototype = new d
  11704. }; (function(c) {
  11705. var e = function(d) {
  11706. function a() {
  11707. d.call(this);
  11708. this.hostComponentKey = "egret.TabBar";
  11709. this.requireSelection = !0
  11710. }
  11711. __extends(a, d);
  11712. a.prototype.c = function(b) {
  11713. b != this._requireSelection && (d.prototype._setRequireSelection.call(this, b), this.requireSelectionChanged_tabBar = !0, this.invalidateProperties())
  11714. };
  11715. a.prototype._setDataProvider = function(b) {
  11716. this.dataProvider instanceof c.ViewStack && (this.dataProvider.removeEventListener("IndexChanged", this.onViewStackIndexChange, this), this.removeEventListener(c.IndexChangeEvent.CHANGE, this.onIndexChanged, this));
  11717. b instanceof c.ViewStack && (b.addEventListener("IndexChanged", this.onViewStackIndexChange, this), this.addEventListener(c.IndexChangeEvent.CHANGE, this.onIndexChanged, this));
  11718. d.prototype._setDataProvider.call(this, b)
  11719. };
  11720. a.prototype.onIndexChanged = function(b) {
  11721. this.dataProvider._setSelectedIndex(b.newIndex, !1)
  11722. };
  11723. a.prototype.onViewStackIndexChange = function(b) {
  11724. this._setSelectedIndex(this.dataProvider.selectedIndex, !1)
  11725. };
  11726. a.prototype.commitProperties = function() {
  11727. d.prototype.commitProperties.call(this);
  11728. if (this.requireSelectionChanged_tabBar && this.dataGroup) {
  11729. this.requireSelectionChanged_tabBar = !1;
  11730. for (var b = this.dataGroup.numElements,
  11731. a = 0; a < b; a++) {
  11732. var c = this.dataGroup.getElementAt(a);
  11733. c && (c.allowDeselection = !this.requireSelection)
  11734. }
  11735. }
  11736. };
  11737. a.prototype.dataGroup_rendererAddHandler = function(b) {
  11738. d.prototype.dataGroup_rendererAddHandler.call(this, b);
  11739. if (b = b.renderer) b.addEventListener(c.TouchEvent.TOUCH_TAP, this.item_clickHandler, this),
  11740. b instanceof c.TabBarButton && (b.allowDeselection = !this.requireSelection)
  11741. };
  11742. a.prototype.dataGroup_rendererRemoveHandler = function(b) {
  11743. d.prototype.dataGroup_rendererRemoveHandler.call(this, b); (b = b.renderer) && b.removeEventListener(c.TouchEvent.TOUCH_TAP, this.item_clickHandler, this)
  11744. };
  11745. a.prototype.item_clickHandler = function(b) {
  11746. var a = b.currentTarget,
  11747. d;
  11748. d = a ? a.itemIndex: this.dataGroup.getElementIndex(b.currentTarget);
  11749. d == this.selectedIndex ? this.requireSelection || this._setSelectedIndex(c.ListBase.NO_SELECTION, !0) : this._setSelectedIndex(d, !0);
  11750. this._dispatchListEvent(b, c.ListEvent.ITEM_CLICK, a)
  11751. };
  11752. return a
  11753. } (c.ListBase);
  11754. c.TabBar = e;
  11755. e.prototype.__class__ = "egret.TabBar"
  11756. })(egret || (egret = {}));
  11757. __extends = this.__extends ||
  11758. function(c, e) {
  11759. function d() {
  11760. this.constructor = c
  11761. }
  11762. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  11763. d.prototype = e.prototype;
  11764. c.prototype = new d
  11765. }; (function(c) {
  11766. var e = function(d) {
  11767. function a() {
  11768. d.call(this);
  11769. this._horizontalScrollPolicy = this._verticalScrollPolicy = "auto";
  11770. this.ignoreTouchBegin = !1;
  11771. this._velocityY = this._velocityX = 0;
  11772. this._previousVelocityX = [];
  11773. this._previousVelocityY = []
  11774. }
  11775. __extends(a, d);
  11776. a.prototype.measure = function() {
  11777. this._viewport && (this.measuredWidth = this._viewport.preferredWidth, this.measuredHeight = this._viewport.preferredHeight)
  11778. };
  11779. a.prototype.updateDisplayList = function(b, a) {
  11780. this._viewport.setLayoutBoundsSize(b, a)
  11781. };
  11782. Object.defineProperty(a.prototype, "verticalScrollPolicy", {
  11783. get: function() {
  11784. return this._verticalScrollPolicy
  11785. },
  11786. set: function(b) {
  11787. this._verticalScrollPolicy = b
  11788. },
  11789. enumerable: !0,
  11790. configurable: !0
  11791. });
  11792. Object.defineProperty(a.prototype, "horizontalScrollPolicy", {
  11793. get: function() {
  11794. return this._horizontalScrollPolicy
  11795. },
  11796. set: function(b) {
  11797. this._horizontalScrollPolicy = b
  11798. },
  11799. enumerable: !0,
  11800. configurable: !0
  11801. });
  11802. Object.defineProperty(a.prototype, "viewport", {
  11803. get: function() {
  11804. return this._viewport
  11805. },
  11806. set: function(b) {
  11807. b != this._viewport && (this.uninstallViewport(), this._viewport = b, this.installViewport(), this.dispatchEventWith("viewportChanged"))
  11808. },
  11809. enumerable: !0,
  11810. configurable: !0
  11811. });
  11812. a.prototype.installViewport = function() {
  11813. this.viewport && (this.viewport.clipAndEnableScrolling = !0, this.viewport.addEventListener(c.TouchEvent.TOUCH_BEGIN, this.onTouchBegin, this), this.viewport.addEventListener(c.TouchEvent.TOUCH_BEGIN, this.onTouchBeginCapture, this, !0), this.viewport.addEventListener(c.TouchEvent.TOUCH_END, this.onTouchEndCapture, this, !0), this._addToDisplayListAt(this.viewport, 0))
  11814. };
  11815. a.prototype.uninstallViewport = function() {
  11816. this.viewport && (this.viewport.clipAndEnableScrolling = !1, this.viewport.removeEventListener(c.TouchEvent.TOUCH_BEGIN, this.onTouchBegin, this), this.viewport.removeEventListener(c.TouchEvent.TOUCH_BEGIN, this.onTouchBeginCapture, this, !0), this.viewport.removeEventListener(c.TouchEvent.TOUCH_END, this.onTouchEndCapture, this, !0), this._removeFromDisplayList(this.viewport))
  11817. };
  11818. a.prototype.onTouchEndCapture = function(b) {
  11819. this.delayTouchBeginEvent && (b.stopPropagation(), this.delayTouchEndEvent = this.cloneTouchEvent(b), this.onTouchBeginTimer(), this.touchEndTimer || (this.touchEndTimer = new c.Timer(100, 1), this.touchEndTimer.addEventListener(c.TimerEvent.TIMER_COMPLETE, this.onTouchEndTimer, this)), this.touchEndTimer.start())
  11820. };
  11821. a.prototype.onTouchEndTimer = function(b) {
  11822. this.touchEndTimer.stop();
  11823. b = this.delayTouchEndEvent;
  11824. this.delayTouchEndEvent = null;
  11825. this.dispatchPropagationEvent(b)
  11826. };
  11827. a.prototype.dispatchPropagationEvent = function(b) {
  11828. for (var a = [], c = b._target; c;) a.push(c),
  11829. c = c.parent;
  11830. for (var d = this._viewport,
  11831. e = 1;; e += 2) {
  11832. c = a[e];
  11833. if (!c || c === d) break;
  11834. a.unshift(c)
  11835. }
  11836. c = a.indexOf(b._target);
  11837. this._dispatchPropagationEvent(b, a, c)
  11838. };
  11839. a.prototype.onTouchBeginCapture = function(b) {
  11840. var d = this.checkScrollPolicy();
  11841. if (d) {
  11842. for (var e = b.target; e != this;) {
  11843. if (e instanceof a && (d = e.checkScrollPolicy())) return;
  11844. e = e.parent
  11845. }
  11846. this.delayTouchEndEvent && (this.delayTouchEndEvent = null, this.touchEndTimer.stop());
  11847. b.stopPropagation();
  11848. this.delayTouchBeginEvent = this.cloneTouchEvent(b);
  11849. this.touchBeginTimer || (this.touchBeginTimer = new c.Timer(100, 1), this.touchBeginTimer.addEventListener(c.TimerEvent.TIMER_COMPLETE, this.onTouchBeginTimer, this));
  11850. this.touchBeginTimer.start();
  11851. this.onTouchBegin(b)
  11852. }
  11853. };
  11854. a.prototype.cloneTouchEvent = function(b) {
  11855. var a = new c.TouchEvent(b._type, b._bubbles, b.cancelable);
  11856. a.touchPointID = b.touchPointID;
  11857. a._stageX = b._stageX;
  11858. a._stageY = b._stageY;
  11859. a.ctrlKey = b.ctrlKey;
  11860. a.altKey = b.altKey;
  11861. a.shiftKey = b.shiftKey;
  11862. a.touchDown = b.touchDown;
  11863. a._isDefaultPrevented = !1;
  11864. a._target = b._target;
  11865. return a
  11866. };
  11867. a.prototype.onTouchBeginTimer = function(b) {
  11868. this.touchBeginTimer.stop();
  11869. b = this.delayTouchBeginEvent;
  11870. this.delayTouchBeginEvent = null;
  11871. this.dispatchPropagationEvent(b)
  11872. };
  11873. a.prototype.checkScrollPolicy = function() {
  11874. var b = this._viewport,
  11875. a;
  11876. switch (this._horizontalScrollPolicy) {
  11877. case "auto":
  11878. a = b.contentWidth > b.width ? !0 : !1;
  11879. break;
  11880. case "on":
  11881. a = !0;
  11882. break;
  11883. case "off":
  11884. a = !1
  11885. }
  11886. this._horizontalCanScroll = a;
  11887. var c;
  11888. switch (this._verticalScrollPolicy) {
  11889. case "auto":
  11890. c = b.contentHeight > b.height ? !0 : !1;
  11891. break;
  11892. case "on":
  11893. c = !0;
  11894. break;
  11895. case "off":
  11896. c = !1
  11897. }
  11898. this._verticalCanScroll = c;
  11899. return a || c
  11900. };
  11901. a.prototype.onTouchBegin = function(b) {
  11902. if (!b.isDefaultPrevented() && this.checkScrollPolicy()) {
  11903. this.verticalAnimator && this.verticalAnimator.isPlaying && this.verticalAnimator.stop();
  11904. this.horizontalAnimator && this.horizontalAnimator.isPlaying && this.horizontalAnimator.stop();
  11905. var a = this._viewport,
  11906. d = a.horizontalScrollPosition,
  11907. a = a.verticalScrollPosition;
  11908. this._offsetPointX = d + b.stageX;
  11909. this._offsetPointY = a + b.stageY;
  11910. this._velocityY = this._velocityX = 0;
  11911. this._previousVelocityX.length = 0;
  11912. this._previousVelocityY.length = 0;
  11913. this._previousTouchTime = c.getTimer();
  11914. this._previousTouchX = this._startTouchX = this._currentTouchX = b.stageX;
  11915. this._previousTouchY = this._startTouchY = this._currentTouchY = b.stageY;
  11916. this._startHorizontalScrollPosition = d;
  11917. this._startVerticalScrollPosition = a;
  11918. c.UIGlobals.stage.addEventListener(c.TouchEvent.TOUCH_MOVE, this.onTouchMove, this);
  11919. c.UIGlobals.stage.addEventListener(c.TouchEvent.TOUCH_END, this.onTouchEnd, this);
  11920. c.UIGlobals.stage.addEventListener(c.Event.LEAVE_STAGE, this.onTouchEnd, this);
  11921. this.addEventListener(c.Event.ENTER_FRAME, this.enterFrameHandler, this);
  11922. b.preventDefault()
  11923. }
  11924. };
  11925. a.prototype.onTouchMove = function(b) {
  11926. this._currentTouchX = b.stageX;
  11927. this._currentTouchY = b.stageY;
  11928. this.delayTouchBeginEvent && (this.delayTouchBeginEvent = null, this.touchBeginTimer.stop());
  11929. var a = this._viewport;
  11930. if (this._horizontalCanScroll) {
  11931. var c = this._offsetPointX - b.stageX;
  11932. 0 > c && (c *= 0.5);
  11933. c > a.contentWidth - a.width && (c = 0.5 * (c + a.contentWidth - a.width));
  11934. a.horizontalScrollPosition = c
  11935. }
  11936. this._verticalCanScroll && (b = this._offsetPointY - b.stageY, 0 > b && (b *= 0.5), b > a.contentHeight - a.height && (b = 0.5 * (b + a.contentHeight - a.height)), a.verticalScrollPosition = b)
  11937. };
  11938. a.prototype.onTouchEnd = function(b) {
  11939. c.UIGlobals.stage.removeEventListener(c.TouchEvent.TOUCH_MOVE, this.onTouchMove, this);
  11940. c.UIGlobals.stage.removeEventListener(c.TouchEvent.TOUCH_END, this.onTouchEnd, this);
  11941. c.UIGlobals.stage.removeEventListener(c.Event.LEAVE_STAGE, this.onTouchEnd, this);
  11942. this.removeEventListener(c.Event.ENTER_FRAME, this.enterFrameHandler, this);
  11943. this._horizontalCanScroll && this.checkHorizontalScrollPosition();
  11944. this._verticalCanScroll && this.checkVerticalScrollPosition()
  11945. };
  11946. a.easeOut = function(b) {
  11947. b -= 1;
  11948. return b * b * b + 1
  11949. };
  11950. a.prototype.enterFrameHandler = function(b) {
  11951. b = c.getTimer();
  11952. var a = b - this._previousTouchTime;
  11953. 0 < a && (this._previousVelocityX[this._previousVelocityX.length] = this._velocityX, 4 < this._previousVelocityX.length && this._previousVelocityX.shift(), this._previousVelocityY[this._previousVelocityY.length] = this._velocityY, 4 < this._previousVelocityY.length && this._previousVelocityY.shift(), this._velocityX = (this._currentTouchX - this._previousTouchX) / a, this._velocityY = (this._currentTouchY - this._previousTouchY) / a, this._previousTouchTime = b, this._previousTouchX = this._currentTouchX, this._previousTouchY = this._currentTouchY);
  11954. b = Math.abs(this._currentTouchX - this._startTouchX);
  11955. a = Math.abs(this._currentTouchY - this._startTouchY);
  11956. this._horizontalCanScroll && 0.04 <= b && (this._startTouchX = this._currentTouchX, this._startHorizontalScrollPosition = this._viewport.horizontalScrollPosition);
  11957. this._verticalCanScroll && 0.04 <= a && (this._startTouchY = this._currentTouchY, this._startVerticalScrollPosition = this._viewport.verticalScrollPosition)
  11958. };
  11959. a.prototype.checkHorizontalScrollPosition = function() {
  11960. for (var b = this._viewport,
  11961. c = b.horizontalScrollPosition,
  11962. b = b.contentWidth - b.width,
  11963. b = Math.max(0, b), d = 2.33 * this._velocityX, e = this._previousVelocityX.length, g = 2.33, h = 0; h < e; h++) var l = a.VELOCITY_WEIGHTS[h],
  11964. d = d + this._previousVelocityX.shift() * l,
  11965. g = g + l;
  11966. d /= g;
  11967. 0.02 >= Math.abs(d) ? this.finishScrollingHorizontally() : (c = this.getAnimationDatas(d, c, b), this.throwHorizontally(c[0], c[1]))
  11968. };
  11969. a.prototype.checkVerticalScrollPosition = function() {
  11970. for (var b = this._viewport,
  11971. c = b.verticalScrollPosition,
  11972. b = b.contentHeight - b.height,
  11973. d = 2.33 * this._velocityY,
  11974. e = this._previousVelocityY.length,
  11975. g = 2.33,
  11976. h = 0; h < e; h++) var l = a.VELOCITY_WEIGHTS[h],
  11977. d = d + this._previousVelocityY.shift() * l,
  11978. g = g + l;
  11979. d /= g;
  11980. 0.02 >= Math.abs(d) ? this.finishScrollingVertically() : (c = this.getAnimationDatas(d, c, b), this.throwVertically(c[0], c[1]))
  11981. };
  11982. a.prototype.getAnimationDatas = function(b, c, d) {
  11983. var e = Math.abs(b),
  11984. g = 0,
  11985. h = c + (b - 0.02) / Math.log(0.998);
  11986. if (0 > h || h > d) for (h = c; 0.02 < Math.abs(b);) h -= b,
  11987. b = 0 > h || h > d ? 0.998 * b * 0.95 : 0.998 * b,
  11988. g++;
  11989. else g = Math.log(0.02 / e) / Math.log(0.998);
  11990. a.animationData || (a.animationData = [0, 0]);
  11991. b = a.animationData;
  11992. b[0] = h;
  11993. b[1] = g;
  11994. return b
  11995. };
  11996. a.prototype.finishScrollingHorizontally = function(b) {
  11997. var a = this._viewport;
  11998. b = a.horizontalScrollPosition;
  11999. var a = a.contentWidth - a.width,
  12000. c = b;
  12001. 0 > b && (c = 0);
  12002. b > a && (c = a);
  12003. this.throwHorizontally(c, 300)
  12004. };
  12005. a.prototype.throwHorizontally = function(b, d) {
  12006. "undefined" === typeof d && (d = 500);
  12007. var e = this._viewport.horizontalScrollPosition;
  12008. e != b && (this.horizontalAnimator || (this.horizontalAnimator = new c.Animation(this.horizontalUpdateHandler, this), this.horizontalAnimator.endFunction = this.finishScrollingHorizontally, this.horizontalAnimator.easerFunction = a.easeOut), this.horizontalAnimator.isPlaying && this.horizontalAnimator.stop(), this.horizontalAnimator.duration = d, this.horizontalAnimator.motionPaths = [{
  12009. prop: "hsp",
  12010. from: e,
  12011. to: b
  12012. }], this.horizontalAnimator.play())
  12013. };
  12014. a.prototype.horizontalUpdateHandler = function(b) {
  12015. this._viewport.horizontalScrollPosition = b.currentValue.hsp
  12016. };
  12017. a.prototype.finishScrollingVertically = function(b) {
  12018. var a = this._viewport;
  12019. b = a.verticalScrollPosition;
  12020. var a = a.contentHeight - a.height,
  12021. a = Math.max(0, a),
  12022. c = b;
  12023. 0 > b && (c = 0);
  12024. b > a && (c = a);
  12025. this.throwVertically(c, 300)
  12026. };
  12027. a.prototype.throwVertically = function(b, d) {
  12028. "undefined" === typeof d && (d = 500);
  12029. var e = this._viewport.verticalScrollPosition;
  12030. e != b && (this.verticalAnimator || (this.verticalAnimator = new c.Animation(this.verticalUpdateHandler, this), this.verticalAnimator.endFunction = this.finishScrollingVertically, this.verticalAnimator.easerFunction = a.easeOut), this.verticalAnimator.isPlaying && this.verticalAnimator.stop(), this.verticalAnimator.duration = d, this.verticalAnimator.motionPaths = [{
  12031. prop: "vsp",
  12032. from: e,
  12033. to: b
  12034. }], this.verticalAnimator.play())
  12035. };
  12036. a.prototype.verticalUpdateHandler = function(b) {
  12037. this._viewport.verticalScrollPosition = b.currentValue.vsp
  12038. };
  12039. Object.defineProperty(a.prototype, "numElements", {
  12040. get: function() {
  12041. return this.viewport ? 1 : 0
  12042. },
  12043. enumerable: !0,
  12044. configurable: !0
  12045. });
  12046. a.prototype.throwRangeError = function(b) {
  12047. throw new RangeError('\u7d22\u5f15:"' + b + '"\u8d85\u51fa\u53ef\u89c6\u5143\u7d20\u7d22\u5f15\u8303\u56f4');
  12048. };
  12049. a.prototype.getElementAt = function(b) {
  12050. if (this.viewport && 0 == b) return this.viewport;
  12051. this.throwRangeError(b);
  12052. return null
  12053. };
  12054. a.prototype.getElementIndex = function(b) {
  12055. return null != b && b == this.viewport ? 0 : -1
  12056. };
  12057. a.prototype.containsElement = function(b) {
  12058. return null != b && b == this.viewport ? !0 : !1
  12059. };
  12060. a.prototype.throwNotSupportedError = function() {
  12061. throw Error("\u6b64\u65b9\u6cd5\u5728Scroller\u7ec4\u4ef6\u5185\u4e0d\u53ef\u7528!");
  12062. };
  12063. a.prototype.addElement = function(b) {
  12064. this.throwNotSupportedError();
  12065. return null
  12066. };
  12067. a.prototype.addElementAt = function(b, a) {
  12068. this.throwNotSupportedError();
  12069. return null
  12070. };
  12071. a.prototype.removeElement = function(b) {
  12072. this.throwNotSupportedError();
  12073. return null
  12074. };
  12075. a.prototype.removeElementAt = function(b) {
  12076. this.throwNotSupportedError();
  12077. return null
  12078. };
  12079. a.prototype.removeAllElements = function() {
  12080. this.throwNotSupportedError()
  12081. };
  12082. a.prototype.setElementIndex = function(b, a) {
  12083. this.throwNotSupportedError()
  12084. };
  12085. a.prototype.swapElements = function(b, a) {
  12086. this.throwNotSupportedError()
  12087. };
  12088. a.prototype.swapElementsAt = function(b, a) {
  12089. this.throwNotSupportedError()
  12090. };
  12091. a.prototype.addChild = function(b) {
  12092. this.throwNotSupportedError();
  12093. return null
  12094. };
  12095. a.prototype.addChildAt = function(b, a) {
  12096. this.throwNotSupportedError();
  12097. return null
  12098. };
  12099. a.prototype.removeChild = function(b) {
  12100. this.throwNotSupportedError();
  12101. return null
  12102. };
  12103. a.prototype.removeChildAt = function(b) {
  12104. this.throwNotSupportedError();
  12105. return null
  12106. };
  12107. a.prototype.setChildIndex = function(b, a) {
  12108. this.throwNotSupportedError()
  12109. };
  12110. a.prototype.swapChildren = function(b, a) {
  12111. this.throwNotSupportedError()
  12112. };
  12113. a.prototype.swapChildrenAt = function(b, a) {
  12114. this.throwNotSupportedError()
  12115. };
  12116. a.VELOCITY_WEIGHTS = [1, 1.33, 1.66, 2];
  12117. return a
  12118. } (c.UIComponent);
  12119. c.Scroller = e;
  12120. e.prototype.__class__ = "egret.Scroller"
  12121. })(egret || (egret = {}));
  12122. __extends = this.__extends ||
  12123. function(c, e) {
  12124. function d() {
  12125. this.constructor = c
  12126. }
  12127. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  12128. d.prototype = e.prototype;
  12129. c.prototype = new d
  12130. }; (function(c) {
  12131. var e = function(d) {
  12132. function a(b, a, c) {
  12133. "undefined" === typeof a && (a = !1);
  12134. "undefined" === typeof c && (c = !1);
  12135. d.call(this, b, a, c)
  12136. }
  12137. __extends(a, d);
  12138. a.dispatchUIEvent = function(b, d) {
  12139. c.Event._dispatchByTarget(a, b, d)
  12140. };
  12141. a.INITIALIZE = "initialize";
  12142. a.CREATION_COMPLETE = "creationComplete";
  12143. a.UPDATE_COMPLETE = "updateComplete";
  12144. a.BUTTON_DOWN = "buttonDown";
  12145. a.CHANGE_END = "changeEnd";
  12146. a.CHANGE_START = "changeStart";
  12147. a.CHANGING = "changing";
  12148. a.VALUE_COMMIT = "valueCommit";
  12149. a.SKIN_CHANGED = "skinChanged";
  12150. a.CONTENT_CHANGED = "contentChanged";
  12151. a.OPEN = "open";
  12152. a.CLOSE = "close";
  12153. a.PLAY_COMPLETE = "playComplete";
  12154. return a
  12155. } (c.Event);
  12156. c.UIEvent = e;
  12157. e.prototype.__class__ = "egret.UIEvent"
  12158. })(egret || (egret = {}));
  12159. __extends = this.__extends ||
  12160. function(c, e) {
  12161. function d() {
  12162. this.constructor = c
  12163. }
  12164. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  12165. d.prototype = e.prototype;
  12166. c.prototype = new d
  12167. }; (function(c) {
  12168. var e = function(d) {
  12169. function a(b, a, c, e, g, h, l, n) {
  12170. "undefined" === typeof a && (a = !1);
  12171. "undefined" === typeof c && (c = !1);
  12172. "undefined" === typeof e && (e = null);
  12173. "undefined" === typeof g && (g = null);
  12174. "undefined" === typeof h && (h = null);
  12175. "undefined" === typeof l && (l = null);
  12176. "undefined" === typeof n && (n = null);
  12177. d.call(this, b, a, c);
  12178. this.kind = e;
  12179. this.property = g;
  12180. this.oldValue = h;
  12181. this.newValue = l;
  12182. this.source = n
  12183. }
  12184. __extends(a, d);
  12185. a.dispatchPropertyChangeEvent = function(b, d, e, m, g, h) {
  12186. "undefined" === typeof d && (d = null);
  12187. "undefined" === typeof e && (e = null);
  12188. "undefined" === typeof m && (m = null);
  12189. "undefined" === typeof g && (g = null);
  12190. "undefined" === typeof h && (h = null);
  12191. var l = c.Event._getPropertyData(a);
  12192. l.kind = d;
  12193. l.property = e;
  12194. l.oldValue = m;
  12195. l.newValue = g;
  12196. l.source = h;
  12197. c.Event._dispatchByTarget(a, b, a.PROPERTY_CHANGE, l)
  12198. };
  12199. a.PROPERTY_CHANGE = "propertyChange";
  12200. return a
  12201. } (c.Event);
  12202. c.PropertyChangeEvent = e;
  12203. e.prototype.__class__ = "egret.PropertyChangeEvent"
  12204. })(egret || (egret = {})); (function(c) {
  12205. var e = function() {
  12206. function c() {}
  12207. c.UPDATE = "update";
  12208. c.DELETE = "delete";
  12209. return c
  12210. } ();
  12211. c.PropertyChangeEventKind = e;
  12212. e.prototype.__class__ = "egret.PropertyChangeEventKind"
  12213. })(egret || (egret = {}));
  12214. __extends = this.__extends ||
  12215. function(c, e) {
  12216. function d() {
  12217. this.constructor = c
  12218. }
  12219. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  12220. d.prototype = e.prototype;
  12221. c.prototype = new d
  12222. }; (function(c) {
  12223. var e = function(d) {
  12224. function a(b, a, c, e, g) {
  12225. "undefined" === typeof a && (a = NaN);
  12226. "undefined" === typeof c && (c = NaN);
  12227. "undefined" === typeof e && (e = !1);
  12228. "undefined" === typeof g && (g = !1);
  12229. d.call(this, b, e, g);
  12230. this.oldX = a;
  12231. this.oldY = c
  12232. }
  12233. __extends(a, d);
  12234. a.dispatchMoveEvent = function(b, d, e) {
  12235. "undefined" === typeof d && (d = NaN);
  12236. "undefined" === typeof e && (e = NaN);
  12237. var m = c.Event._getPropertyData(a);
  12238. m.oldX = d;
  12239. m.oldY = e;
  12240. c.Event._dispatchByTarget(a, b, a.MOVE, m)
  12241. };
  12242. a.MOVE = "move";
  12243. return a
  12244. } (c.Event);
  12245. c.MoveEvent = e;
  12246. e.prototype.__class__ = "egret.MoveEvent"
  12247. })(egret || (egret = {}));
  12248. __extends = this.__extends ||
  12249. function(c, e) {
  12250. function d() {
  12251. this.constructor = c
  12252. }
  12253. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  12254. d.prototype = e.prototype;
  12255. c.prototype = new d
  12256. }; (function(c) {
  12257. var e = function(d) {
  12258. function a(a, c, e, m, g) {
  12259. "undefined" === typeof c && (c = NaN);
  12260. "undefined" === typeof e && (e = NaN);
  12261. "undefined" === typeof m && (m = !1);
  12262. "undefined" === typeof g && (g = !1);
  12263. d.call(this, a, m, g);
  12264. this.oldWidth = c;
  12265. this.oldHeight = e
  12266. }
  12267. __extends(a, d);
  12268. a.dispatchResizeEvent = function(b, d, e) {
  12269. "undefined" === typeof d && (d = NaN);
  12270. "undefined" === typeof e && (e = NaN);
  12271. var m = c.Event._getPropertyData(a);
  12272. m.oldWidth = d;
  12273. m.oldHeight = e;
  12274. c.Event._dispatchByTarget(a, b, a.RESIZE, m)
  12275. };
  12276. a.RESIZE = "resize";
  12277. return a
  12278. } (c.Event);
  12279. c.ResizeEvent = e;
  12280. e.prototype.__class__ = "egret.ResizeEvent"
  12281. })(egret || (egret = {}));
  12282. __extends = this.__extends ||
  12283. function(c, e) {
  12284. function d() {
  12285. this.constructor = c
  12286. }
  12287. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  12288. d.prototype = e.prototype;
  12289. c.prototype = new d
  12290. }; (function(c) {
  12291. var e = function(d) {
  12292. function a(a, c, e, m, g) {
  12293. "undefined" === typeof c && (c = !1);
  12294. "undefined" === typeof e && (e = !1);
  12295. "undefined" === typeof m && (m = null);
  12296. "undefined" === typeof g && (g = null);
  12297. d.call(this, a, c, e);
  12298. this.partName = m;
  12299. this.instance = g
  12300. }
  12301. __extends(a, d);
  12302. a.dispatchSkinPartEvent = function(b, d, e, m) {
  12303. "undefined" === typeof e && (e = null);
  12304. "undefined" === typeof m && (m = null);
  12305. var g = c.Event._getPropertyData(a);
  12306. g.partName = e;
  12307. g.instance = m;
  12308. c.Event._dispatchByTarget(a, b, d, g)
  12309. };
  12310. a.PART_ADDED = "partAdded";
  12311. a.PART_REMOVED = "partRemoved";
  12312. return a
  12313. } (c.Event);
  12314. c.SkinPartEvent = e;
  12315. e.prototype.__class__ = "egret.SkinPartEvent"
  12316. })(egret || (egret = {}));
  12317. __extends = this.__extends ||
  12318. function(c, e) {
  12319. function d() {
  12320. this.constructor = c
  12321. }
  12322. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  12323. d.prototype = e.prototype;
  12324. c.prototype = new d
  12325. }; (function(c) {
  12326. var e = function(d) {
  12327. function a(a, c, e, m) {
  12328. "undefined" === typeof c && (c = !1);
  12329. "undefined" === typeof e && (e = !1);
  12330. "undefined" === typeof m && (m = -1);
  12331. d.call(this, a, c, e);
  12332. this.detail = m
  12333. }
  12334. __extends(a, d);
  12335. a.dispatchCloseEvent = function(b, d, e) {
  12336. "undefined" === typeof e && (e = -1);
  12337. var m = c.Event._getPropertyData(a);
  12338. m.detail = e;
  12339. c.Event._dispatchByTarget(a, b, d, m)
  12340. };
  12341. a.CLOSE = "close";
  12342. return a
  12343. } (c.Event);
  12344. c.CloseEvent = e;
  12345. e.prototype.__class__ = "egret.CloseEvent"
  12346. })(egret || (egret = {}));
  12347. __extends = this.__extends ||
  12348. function(c, e) {
  12349. function d() {
  12350. this.constructor = c
  12351. }
  12352. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  12353. d.prototype = e.prototype;
  12354. c.prototype = new d
  12355. }; (function(c) {
  12356. var e = function(d) {
  12357. function a(a, c, e, m, g, h, l, n) {
  12358. "undefined" === typeof c && (c = !1);
  12359. "undefined" === typeof e && (e = !1);
  12360. "undefined" === typeof m && (m = null);
  12361. "undefined" === typeof g && (g = -1);
  12362. "undefined" === typeof h && (h = -1);
  12363. "undefined" === typeof l && (l = null);
  12364. "undefined" === typeof n && (n = null);
  12365. d.call(this, a, c, e);
  12366. this.kind = m;
  12367. this.location = g;
  12368. this.oldLocation = h;
  12369. this.items = l ? l: [];
  12370. this.oldItems = n ? n: []
  12371. }
  12372. __extends(a, d);
  12373. a.dispatchCollectionEvent = function(b, d, e, m, g, h, l) {
  12374. "undefined" === typeof e && (e = null);
  12375. "undefined" === typeof m && (m = -1);
  12376. "undefined" === typeof g && (g = -1);
  12377. "undefined" === typeof h && (h = null);
  12378. "undefined" === typeof l && (l = null);
  12379. var n = c.Event._getPropertyData(a);
  12380. n.kind = e;
  12381. n.location = m;
  12382. n.oldLocation = g;
  12383. n.items = h;
  12384. n.oldItems = l;
  12385. c.Event._dispatchByTarget(a, b, d, n)
  12386. };
  12387. a.COLLECTION_CHANGE = "collectionChange";
  12388. return a
  12389. } (c.Event);
  12390. c.CollectionEvent = e;
  12391. e.prototype.__class__ = "egret.CollectionEvent"
  12392. })(egret || (egret = {})); (function(c) {
  12393. var e = function() {
  12394. function c() {}
  12395. c.ADD = "add";
  12396. c.MOVE = "move";
  12397. c.REFRESH = "refresh";
  12398. c.REMOVE = "remove";
  12399. c.REPLACE = "replace";
  12400. c.RESET = "reset";
  12401. c.UPDATE = "update";
  12402. c.OPEN = "open";
  12403. c.CLOSE = "close";
  12404. return c
  12405. } ();
  12406. c.CollectionEventKind = e;
  12407. e.prototype.__class__ = "egret.CollectionEventKind"
  12408. })(egret || (egret = {}));
  12409. __extends = this.__extends ||
  12410. function(c, e) {
  12411. function d() {
  12412. this.constructor = c
  12413. }
  12414. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  12415. d.prototype = e.prototype;
  12416. c.prototype = new d
  12417. }; (function(c) {
  12418. var e = function(d) {
  12419. function a(a, c, e, m, g) {
  12420. "undefined" === typeof c && (c = !1);
  12421. "undefined" === typeof e && (e = !1);
  12422. "undefined" === typeof m && (m = null);
  12423. "undefined" === typeof g && (g = -1);
  12424. d.call(this, a, c, e);
  12425. this.element = m;
  12426. this.index = g
  12427. }
  12428. __extends(a, d);
  12429. a.dispatchElementExistenceEvent = function(b, d, e, m) {
  12430. "undefined" === typeof e && (e = null);
  12431. "undefined" === typeof m && (m = -1);
  12432. var g = c.Event._getPropertyData(a);
  12433. g.element = e;
  12434. g.index = m;
  12435. c.Event._dispatchByTarget(a, b, d, g)
  12436. };
  12437. a.ELEMENT_ADD = "elementAdd";
  12438. a.ELEMENT_REMOVE = "elementRemove";
  12439. return a
  12440. } (c.Event);
  12441. c.ElementExistenceEvent = e;
  12442. e.prototype.__class__ = "egret.ElementExistenceEvent"
  12443. })(egret || (egret = {}));
  12444. __extends = this.__extends ||
  12445. function(c, e) {
  12446. function d() {
  12447. this.constructor = c
  12448. }
  12449. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  12450. d.prototype = e.prototype;
  12451. c.prototype = new d
  12452. }; (function(c) {
  12453. var e = function(d) {
  12454. function a(a, c, e, m, g) {
  12455. "undefined" === typeof c && (c = !1);
  12456. "undefined" === typeof e && (e = !1);
  12457. "undefined" === typeof m && (m = -1);
  12458. "undefined" === typeof g && (g = -1);
  12459. d.call(this, a, c, e);
  12460. this.oldIndex = m;
  12461. this.newIndex = g
  12462. }
  12463. __extends(a, d);
  12464. a.dispatchIndexChangeEvent = function(b, d, e, m, g) {
  12465. "undefined" === typeof e && (e = -1);
  12466. "undefined" === typeof m && (m = -1);
  12467. "undefined" === typeof g && (g = !1);
  12468. var h = c.Event._getPropertyData(a);
  12469. h.oldIndex = e;
  12470. h.newIndex = m;
  12471. return c.Event._dispatchByTarget(a, b, d, h, !1, g)
  12472. };
  12473. a.CHANGE = "change";
  12474. a.CHANGING = "changing";
  12475. return a
  12476. } (c.Event);
  12477. c.IndexChangeEvent = e;
  12478. e.prototype.__class__ = "egret.IndexChangeEvent"
  12479. })(egret || (egret = {}));
  12480. __extends = this.__extends ||
  12481. function(c, e) {
  12482. function d() {
  12483. this.constructor = c
  12484. }
  12485. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  12486. d.prototype = e.prototype;
  12487. c.prototype = new d
  12488. }; (function(c) {
  12489. var e = function(d) {
  12490. function a(a, c, e, m, g, h, l, n, p, q, r, s, t) {
  12491. "undefined" === typeof c && (c = !0);
  12492. "undefined" === typeof e && (e = !0);
  12493. "undefined" === typeof m && (m = 0);
  12494. "undefined" === typeof g && (g = 0);
  12495. "undefined" === typeof h && (h = 0);
  12496. "undefined" === typeof l && (l = !1);
  12497. "undefined" === typeof n && (n = !1);
  12498. "undefined" === typeof p && (p = !1);
  12499. "undefined" === typeof q && (q = !1);
  12500. "undefined" === typeof r && (r = -1);
  12501. "undefined" === typeof s && (s = null);
  12502. "undefined" === typeof t && (t = null);
  12503. d.call(this, a, c, e, m, g, h, l, n, p, q);
  12504. this.itemIndex = r;
  12505. this.item = s;
  12506. this.itemRenderer = t
  12507. }
  12508. __extends(a, d);
  12509. a.dispatchListEvent = function(b, d, e, m, g, h) {
  12510. "undefined" === typeof e && (e = null);
  12511. "undefined" === typeof m && (m = -1);
  12512. "undefined" === typeof g && (g = null);
  12513. "undefined" === typeof h && (h = null);
  12514. var l = c.Event._getPropertyData(a);
  12515. l.touchPointID = e.touchPointID;
  12516. l._stageX = e.stageX;
  12517. l._stageY = e.stageY;
  12518. l.ctrlKey = e.ctrlKey;
  12519. l.altKey = e.altKey;
  12520. l.shiftKey = e.shiftKey;
  12521. l.touchDown = e.touchDown;
  12522. l.itemIndex = m;
  12523. l.item = g;
  12524. l.itemRenderer = h;
  12525. c.Event._dispatchByTarget(a, b, d, l)
  12526. };
  12527. a.ITEM_ROLL_OUT = "itemRollOut";
  12528. a.ITEM_ROLL_OVER = "itemRollOver";
  12529. a.ITEM_CLICK = "itemClick";
  12530. return a
  12531. } (c.TouchEvent);
  12532. c.ListEvent = e;
  12533. e.prototype.__class__ = "egret.ListEvent"
  12534. })(egret || (egret = {}));
  12535. __extends = this.__extends ||
  12536. function(c, e) {
  12537. function d() {
  12538. this.constructor = c
  12539. }
  12540. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  12541. d.prototype = e.prototype;
  12542. c.prototype = new d
  12543. }; (function(c) {
  12544. var e = function(d) {
  12545. function a(a, c, e, m, g) {
  12546. "undefined" === typeof c && (c = !1);
  12547. "undefined" === typeof e && (e = !1);
  12548. "undefined" === typeof m && (m = null);
  12549. "undefined" === typeof g && (g = !1);
  12550. d.call(this, a, c, e);
  12551. this.popUp = m;
  12552. this.modal = g
  12553. }
  12554. __extends(a, d);
  12555. a.dispatchPopUpEvent = function(b, d, e, m) {
  12556. "undefined" === typeof e && (e = null);
  12557. "undefined" === typeof m && (m = !1);
  12558. var g = c.Event._getPropertyData(a);
  12559. g.popUp = e;
  12560. g.modal = m;
  12561. c.Event._dispatchByTarget(a, b, d, g)
  12562. };
  12563. a.ADD_POPUP = "addPopUp";
  12564. a.REMOVE_POPUP = "removePopUp";
  12565. a.BRING_TO_FRONT = "bringToFront";
  12566. return a
  12567. } (c.Event);
  12568. c.PopUpEvent = e;
  12569. e.prototype.__class__ = "egret.PopUpEvent"
  12570. })(egret || (egret = {}));
  12571. __extends = this.__extends ||
  12572. function(c, e) {
  12573. function d() {
  12574. this.constructor = c
  12575. }
  12576. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  12577. d.prototype = e.prototype;
  12578. c.prototype = new d
  12579. }; (function(c) {
  12580. var e = function(d) {
  12581. function a(a, c, e, m, g, h) {
  12582. "undefined" === typeof c && (c = !1);
  12583. "undefined" === typeof e && (e = !1);
  12584. "undefined" === typeof m && (m = null);
  12585. "undefined" === typeof g && (g = -1);
  12586. "undefined" === typeof h && (h = null);
  12587. d.call(this, a, c, e);
  12588. this.renderer = m;
  12589. this.index = g;
  12590. this.data = h
  12591. }
  12592. __extends(a, d);
  12593. a.dispatchRendererExistenceEvent = function(b, d, e, m, g) {
  12594. "undefined" === typeof e && (e = null);
  12595. "undefined" === typeof m && (m = -1);
  12596. "undefined" === typeof g && (g = null);
  12597. var h = c.Event._getPropertyData(a);
  12598. h.renderer = e;
  12599. h.index = m;
  12600. h.data = g;
  12601. c.Event._dispatchByTarget(a, b, d, h)
  12602. };
  12603. a.RENDERER_ADD = "rendererAdd";
  12604. a.RENDERER_REMOVE = "rendererRemove";
  12605. return a
  12606. } (c.Event);
  12607. c.RendererExistenceEvent = e;
  12608. e.prototype.__class__ = "egret.RendererExistenceEvent"
  12609. })(egret || (egret = {}));
  12610. __extends = this.__extends ||
  12611. function(c, e) {
  12612. function d() {
  12613. this.constructor = c
  12614. }
  12615. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  12616. d.prototype = e.prototype;
  12617. c.prototype = new d
  12618. }; (function(c) {
  12619. var e = function(d) {
  12620. function a(a, c, e, m, g) {
  12621. "undefined" === typeof c && (c = !1);
  12622. "undefined" === typeof e && (e = !1);
  12623. "undefined" === typeof m && (m = null);
  12624. "undefined" === typeof g && (g = null);
  12625. d.call(this, a, c, e);
  12626. this.oldState = m;
  12627. this.newState = g
  12628. }
  12629. __extends(a, d);
  12630. a.dispatchStateChangeEvent = function(b, d, e, m) {
  12631. "undefined" === typeof e && (e = null);
  12632. "undefined" === typeof m && (m = null);
  12633. var g = c.Event._getPropertyData(a);
  12634. g.oldState = e;
  12635. g.newState = m;
  12636. c.Event._dispatchByTarget(a, b, d, g)
  12637. };
  12638. a.CURRENT_STATE_CHANGE = "currentStateChange";
  12639. a.CURRENT_STATE_CHANGING = "currentStateChanging";
  12640. return a
  12641. } (c.Event);
  12642. c.StateChangeEvent = e;
  12643. e.prototype.__class__ = "egret.StateChangeEvent"
  12644. })(egret || (egret = {}));
  12645. __extends = this.__extends ||
  12646. function(c, e) {
  12647. function d() {
  12648. this.constructor = c
  12649. }
  12650. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  12651. d.prototype = e.prototype;
  12652. c.prototype = new d
  12653. }; (function(c) {
  12654. var e = function(d) {
  12655. function a(a, c, e) {
  12656. "undefined" === typeof c && (c = !1);
  12657. "undefined" === typeof e && (e = !1);
  12658. d.call(this, a, c, e)
  12659. }
  12660. __extends(a, d);
  12661. a.dispatchTrackBaseEvent = function(b, d) {
  12662. c.Event._dispatchByTarget(a, b, d)
  12663. };
  12664. a.THUMB_DRAG = "thumbDrag";
  12665. a.THUMB_PRESS = "thumbPress";
  12666. a.THUMB_RELEASE = "thumbRelease";
  12667. return a
  12668. } (c.Event);
  12669. c.TrackBaseEvent = e;
  12670. e.prototype.__class__ = "egret.TrackBaseEvent"
  12671. })(egret || (egret = {}));
  12672. __extends = this.__extends ||
  12673. function(c, e) {
  12674. function d() {
  12675. this.constructor = c
  12676. }
  12677. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  12678. d.prototype = e.prototype;
  12679. c.prototype = new d
  12680. }; (function(c) {
  12681. var e = function(d) {
  12682. function a(a, c, e, m, g, h) {
  12683. "undefined" === typeof c && (c = !1);
  12684. "undefined" === typeof e && (e = !0);
  12685. "undefined" === typeof m && (m = -1);
  12686. "undefined" === typeof g && (g = null);
  12687. "undefined" === typeof h && (h = null);
  12688. d.call(this, a, c, e);
  12689. this.item = g;
  12690. this.itemRenderer = h;
  12691. this.itemIndex = m
  12692. }
  12693. __extends(a, d);
  12694. a.dispatchTreeEvent = function(b, d, e, m, g, h) {
  12695. "undefined" === typeof e && (e = -1);
  12696. "undefined" === typeof m && (m = null);
  12697. "undefined" === typeof g && (g = null);
  12698. "undefined" === typeof h && (h = !1);
  12699. var l = c.Event._getPropertyData(a);
  12700. l.itemIndex = e;
  12701. l.item = m;
  12702. l.itemRenderer = g;
  12703. l.opening = h;
  12704. c.Event._dispatchByTarget(a, b, d, l)
  12705. };
  12706. a.ITEM_CLOSE = "itemClose";
  12707. a.ITEM_OPEN = "itemOpen";
  12708. a.ITEM_OPENING = "itemOpening";
  12709. return a
  12710. } (c.Event);
  12711. c.TreeEvent = e;
  12712. e.prototype.__class__ = "egret.TreeEvent"
  12713. })(egret || (egret = {}));
  12714. __extends = this.__extends ||
  12715. function(c, e) {
  12716. function d() {
  12717. this.constructor = c
  12718. }
  12719. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  12720. d.prototype = e.prototype;
  12721. c.prototype = new d
  12722. }; (function(c) {
  12723. var e = function(c) {
  12724. function a() {
  12725. c.call(this);
  12726. this._useVirtualLayout = !1
  12727. }
  12728. __extends(a, c);
  12729. Object.defineProperty(a.prototype, "target", {
  12730. get: function() {
  12731. return this._target
  12732. },
  12733. set: function(a) {
  12734. this._target != a && (this._target = a, this.clearVirtualLayoutCache())
  12735. },
  12736. enumerable: !0,
  12737. configurable: !0
  12738. });
  12739. Object.defineProperty(a.prototype, "useVirtualLayout", {
  12740. get: function() {
  12741. return this._useVirtualLayout
  12742. },
  12743. set: function(a) {
  12744. this._useVirtualLayout != a && (this._useVirtualLayout = a, this.dispatchEventWith("useVirtualLayoutChanged"), this._useVirtualLayout && !a && this.clearVirtualLayoutCache(), this.target && this.target.invalidateDisplayList())
  12745. },
  12746. enumerable: !0,
  12747. configurable: !0
  12748. });
  12749. Object.defineProperty(a.prototype, "typicalLayoutRect", {
  12750. get: function() {
  12751. return this._typicalLayoutRect
  12752. },
  12753. set: function(a) {
  12754. this._typicalLayoutRect != a && (this._typicalLayoutRect = a, this.target && this.target.invalidateSize())
  12755. },
  12756. enumerable: !0,
  12757. configurable: !0
  12758. });
  12759. a.prototype.scrollPositionChanged = function() {};
  12760. a.prototype.clearVirtualLayoutCache = function() {};
  12761. a.prototype.elementAdded = function(a) {};
  12762. a.prototype.elementRemoved = function(a) {};
  12763. a.prototype.measure = function() {};
  12764. a.prototype.updateDisplayList = function(a, c) {};
  12765. return a
  12766. } (c.EventDispatcher);
  12767. c.LayoutBase = e;
  12768. e.prototype.__class__ = "egret.LayoutBase"
  12769. })(egret || (egret = {}));
  12770. __extends = this.__extends ||
  12771. function(c, e) {
  12772. function d() {
  12773. this.constructor = c
  12774. }
  12775. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  12776. d.prototype = e.prototype;
  12777. c.prototype = new d
  12778. }; (function(c) {
  12779. var e = function(d) {
  12780. function a() {
  12781. d.call(this);
  12782. this._mouseWheelSpeed = 20
  12783. }
  12784. __extends(a, d);
  12785. Object.defineProperty(a.prototype, "useVirtualLayout", {
  12786. set: function(a) {},
  12787. enumerable: !0,
  12788. configurable: !0
  12789. });
  12790. Object.defineProperty(a.prototype, "mouseWheelSpeed", {
  12791. get: function() {
  12792. return this._mouseWheelSpeed
  12793. },
  12794. set: function(a) {
  12795. 0 == a && (a = 1);
  12796. this._mouseWheelSpeed = a
  12797. },
  12798. enumerable: !0,
  12799. configurable: !0
  12800. });
  12801. a.prototype.getElementBoundsLeftOfScrollRect = function(a) {
  12802. var d = new c.Rectangle;
  12803. d.x = a.x - this._mouseWheelSpeed;
  12804. d.right = a.x;
  12805. return d
  12806. };
  12807. a.prototype.getElementBoundsRightOfScrollRect = function(a) {
  12808. var d = new c.Rectangle;
  12809. d.x = a.right;
  12810. d.right = a.right + this._mouseWheelSpeed;
  12811. return d
  12812. };
  12813. a.prototype.getElementBoundsAboveScrollRect = function(a) {
  12814. var d = new c.Rectangle;
  12815. d.y = a.y - this._mouseWheelSpeed;
  12816. d.bottom = a.y;
  12817. return d
  12818. };
  12819. a.prototype.getElementBoundsBelowScrollRect = function(a) {
  12820. var d = new c.Rectangle;
  12821. d.y = a.bottom;
  12822. d.bottom = a.bottom + this._mouseWheelSpeed;
  12823. return d
  12824. };
  12825. a.prototype.measure = function() {
  12826. d.prototype.measure.call(this);
  12827. if (null != this.target) {
  12828. for (var a = 0,
  12829. c = 0,
  12830. e = this.target.numElements,
  12831. m = 0; m < e; m++) {
  12832. var g = this.target.getElementAt(m);
  12833. if (g && g.includeInLayout) {
  12834. var h = g.horizontalCenter,
  12835. l = g.verticalCenter,
  12836. n = g.left,
  12837. p = g.right,
  12838. q = g.top,
  12839. r = g.bottom;
  12840. isNaN(n) || isNaN(p) ? isNaN(h) ? isNaN(n) && isNaN(p) ? h = g.preferredX: (h = isNaN(n) ? 0 : n, h += isNaN(p) ? 0 : p) : h = 2 * Math.abs(h) : h = n + p;
  12841. isNaN(q) || isNaN(r) ? isNaN(l) ? isNaN(q) && isNaN(r) ? l = g.preferredY: (l = isNaN(q) ? 0 : q, l += isNaN(r) ? 0 : r) : l = 2 * Math.abs(l) : l = q + r;
  12842. r = g.preferredHeight;
  12843. a = Math.ceil(Math.max(a, h + g.preferredWidth));
  12844. c = Math.ceil(Math.max(c, l + r))
  12845. }
  12846. }
  12847. this.target.measuredWidth = a;
  12848. this.target.measuredHeight = c
  12849. }
  12850. };
  12851. a.prototype.updateDisplayList = function(a, c) {
  12852. d.prototype.updateDisplayList.call(this, a, c);
  12853. if (null != this.target) {
  12854. for (var e = this.target.numElements,
  12855. m = 0,
  12856. g = 0,
  12857. h = 0; h < e; h++) {
  12858. var l = this.target.getElementAt(h);
  12859. if (null != l && l.includeInLayout) {
  12860. var n = l.horizontalCenter,
  12861. p = l.verticalCenter,
  12862. q = l.left,
  12863. r = l.right,
  12864. s = l.top,
  12865. t = l.bottom,
  12866. A = l.percentWidth,
  12867. w = l.percentHeight,
  12868. B = NaN,
  12869. C = NaN;
  12870. isNaN(q) || isNaN(r) ? isNaN(A) || (B = Math.round(a * Math.min(0.01 * A, 1))) : B = a - r - q;
  12871. isNaN(s) || isNaN(t) ? isNaN(w) || (C = Math.round(c * Math.min(0.01 * w, 1))) : C = c - t - s;
  12872. l.setLayoutBoundsSize(B, C);
  12873. A = l.layoutBoundsWidth;
  12874. w = l.layoutBoundsHeight;
  12875. C = B = NaN;
  12876. B = isNaN(n) ? isNaN(q) ? isNaN(r) ? l.layoutBoundsX: a - A - r: q: Math.round((a - A) / 2 + n);
  12877. C = isNaN(p) ? isNaN(s) ? isNaN(t) ? l.layoutBoundsY: c - w - t: s: Math.round((c - w) / 2 + p);
  12878. l.setLayoutBoundsPosition(B, C);
  12879. m = Math.max(m, B + A);
  12880. g = Math.max(g, C + w)
  12881. }
  12882. }
  12883. this.target.setContentSize(m, g)
  12884. }
  12885. };
  12886. return a
  12887. } (c.LayoutBase);
  12888. c.BasicLayout = e;
  12889. e.prototype.__class__ = "egret.BasicLayout"
  12890. })(egret || (egret = {})); (function(c) {
  12891. var e = function() {
  12892. function c() {}
  12893. c.LEFT = "left";
  12894. c.JUSTIFY_USING_GAP = "justifyUsingGap";
  12895. c.JUSTIFY_USING_WIDTH = "justifyUsingWidth";
  12896. return c
  12897. } ();
  12898. c.ColumnAlign = e;
  12899. e.prototype.__class__ = "egret.ColumnAlign"
  12900. })(egret || (egret = {})); (function(c) {
  12901. var e = function() {
  12902. function c() {}
  12903. c.TOP = "top";
  12904. c.JUSTIFY_USING_GAP = "justifyUsingGap";
  12905. c.JUSTIFY_USING_HEIGHT = "justifyUsingHeight";
  12906. return c
  12907. } ();
  12908. c.RowAlign = e;
  12909. e.prototype.__class__ = "egret.RowAlign"
  12910. })(egret || (egret = {})); (function(c) {
  12911. var e = function() {
  12912. function c() {}
  12913. c.ROWS = "rows";
  12914. c.COLUMNS = "columns";
  12915. return c
  12916. } ();
  12917. c.TileOrientation = e;
  12918. e.prototype.__class__ = "egret.TileOrientation"
  12919. })(egret || (egret = {}));
  12920. __extends = this.__extends ||
  12921. function(c, e) {
  12922. function d() {
  12923. this.constructor = c
  12924. }
  12925. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  12926. d.prototype = e.prototype;
  12927. c.prototype = new d
  12928. }; (function(c) {
  12929. var e = function(a) {
  12930. function b() {
  12931. a.call(this);
  12932. this._horizontalAlign = c.HorizontalAlign.LEFT;
  12933. this._verticalAlign = c.VerticalAlign.TOP;
  12934. this._gap = 6;
  12935. this._padding = 0;
  12936. this._paddingBottom = this._paddingTop = this._paddingRight = this._paddingLeft = NaN;
  12937. this.elementSizeTable = [];
  12938. this.endIndex = this.startIndex = -1;
  12939. this.indexInViewCalculated = !1;
  12940. this.maxElementWidth = 0
  12941. }
  12942. __extends(b, a);
  12943. Object.defineProperty(b.prototype, "horizontalAlign", {
  12944. get: function() {
  12945. return this._horizontalAlign
  12946. },
  12947. set: function(a) {
  12948. this._horizontalAlign != a && (this._horizontalAlign = a, this.target && this.target.invalidateDisplayList())
  12949. },
  12950. enumerable: !0,
  12951. configurable: !0
  12952. });
  12953. Object.defineProperty(b.prototype, "verticalAlign", {
  12954. get: function() {
  12955. return this._verticalAlign
  12956. },
  12957. set: function(a) {
  12958. this._verticalAlign != a && (this._verticalAlign = a, this.target && this.target.invalidateDisplayList())
  12959. },
  12960. enumerable: !0,
  12961. configurable: !0
  12962. });
  12963. Object.defineProperty(b.prototype, "gap", {
  12964. get: function() {
  12965. return this._gap
  12966. },
  12967. set: function(a) {
  12968. this._gap != a && (this._gap = a, this.invalidateTargetSizeAndDisplayList(), this.hasEventListener("gapChanged") && this.dispatchEventWith("gapChanged"))
  12969. },
  12970. enumerable: !0,
  12971. configurable: !0
  12972. });
  12973. Object.defineProperty(b.prototype, "padding", {
  12974. get: function() {
  12975. return this._padding
  12976. },
  12977. set: function(a) {
  12978. this._padding != a && (this._padding = a, this.invalidateTargetSizeAndDisplayList())
  12979. },
  12980. enumerable: !0,
  12981. configurable: !0
  12982. });
  12983. Object.defineProperty(b.prototype, "paddingLeft", {
  12984. get: function() {
  12985. return this._paddingLeft
  12986. },
  12987. set: function(a) {
  12988. this._paddingLeft != a && (this._paddingLeft = a, this.invalidateTargetSizeAndDisplayList())
  12989. },
  12990. enumerable: !0,
  12991. configurable: !0
  12992. });
  12993. Object.defineProperty(b.prototype, "paddingRight", {
  12994. get: function() {
  12995. return this._paddingRight
  12996. },
  12997. set: function(a) {
  12998. this._paddingRight != a && (this._paddingRight = a, this.invalidateTargetSizeAndDisplayList())
  12999. },
  13000. enumerable: !0,
  13001. configurable: !0
  13002. });
  13003. Object.defineProperty(b.prototype, "paddingTop", {
  13004. get: function() {
  13005. return this._paddingTop
  13006. },
  13007. set: function(a) {
  13008. this._paddingTop != a && (this._paddingTop = a, this.invalidateTargetSizeAndDisplayList())
  13009. },
  13010. enumerable: !0,
  13011. configurable: !0
  13012. });
  13013. Object.defineProperty(b.prototype, "paddingBottom", {
  13014. get: function() {
  13015. return this._paddingBottom
  13016. },
  13017. set: function(a) {
  13018. this._paddingBottom != a && (this._paddingBottom = a, this.invalidateTargetSizeAndDisplayList())
  13019. },
  13020. enumerable: !0,
  13021. configurable: !0
  13022. });
  13023. b.prototype.invalidateTargetSizeAndDisplayList = function() {
  13024. this.target && (this.target.invalidateSize(), this.target.invalidateDisplayList())
  13025. };
  13026. b.prototype.measure = function() {
  13027. a.prototype.measure.call(this);
  13028. this.target && (this.useVirtualLayout ? this.measureVirtual() : this.measureReal())
  13029. };
  13030. b.prototype.measureVirtual = function() {
  13031. for (var a = this.typicalLayoutRect ? this.typicalLayoutRect.height: 22, b = Math.max(this.maxElementWidth, this.typicalLayoutRect ? this.typicalLayoutRect.width: 71), c = this.getElementTotalSize(), d = this.target.getElementIndicesInView(), e = d.length, l = 0; l < e; l++) {
  13032. var n = d[l],
  13033. p = this.target.getElementAt(n);
  13034. if (null != p && p.includeInLayout) var q = p.preferredWidth,
  13035. c = c + p.preferredHeight,
  13036. c = c - (isNaN(this.elementSizeTable[n]) ? a: this.elementSizeTable[n]),
  13037. b = Math.max(b, q)
  13038. }
  13039. l = isNaN(this._padding) ? 0 : this._padding;
  13040. a = isNaN(this._paddingLeft) ? l: this._paddingLeft;
  13041. d = isNaN(this._paddingRight) ? l: this._paddingRight;
  13042. e = isNaN(this._paddingTop) ? l: this._paddingTop;
  13043. l = isNaN(this._paddingBottom) ? l: this._paddingBottom;
  13044. e += l;
  13045. this.target.measuredWidth = Math.ceil(b + (a + d));
  13046. this.target.measuredHeight = Math.ceil(c + e)
  13047. };
  13048. b.prototype.measureReal = function() {
  13049. for (var a = this.target.numElements,
  13050. b = a,
  13051. c = 0,
  13052. d = 0,
  13053. e = 0; e < a; e++) {
  13054. var l = this.target.getElementAt(e);
  13055. if (l && l.includeInLayout) var n = l.preferredWidth,
  13056. d = d + l.preferredHeight,
  13057. c = Math.max(c, n);
  13058. else b--
  13059. }
  13060. a = isNaN(this._gap) ? 0 : this._gap;
  13061. d += (b - 1) * a;
  13062. l = isNaN(this._padding) ? 0 : this._padding;
  13063. b = isNaN(this._paddingLeft) ? l: this._paddingLeft;
  13064. a = isNaN(this._paddingRight) ? l: this._paddingRight;
  13065. e = isNaN(this._paddingTop) ? l: this._paddingTop;
  13066. l = isNaN(this._paddingBottom) ? l: this._paddingBottom;
  13067. e += l;
  13068. this.target.measuredWidth = Math.ceil(c + (b + a));
  13069. this.target.measuredHeight = Math.ceil(d + e)
  13070. };
  13071. b.prototype.updateDisplayList = function(b, c) {
  13072. a.prototype.updateDisplayList.call(this, b, c);
  13073. this.target && (this.useVirtualLayout ? this.updateDisplayListVirtual(b, c) : this.updateDisplayListReal(b, c))
  13074. };
  13075. b.prototype.getStartPosition = function(a) {
  13076. var b = isNaN(this._padding) ? 0 : this._padding,
  13077. c = isNaN(this._paddingTop) ? b: this._paddingTop,
  13078. b = isNaN(this._gap) ? 0 : this._gap;
  13079. if (!this.useVirtualLayout) {
  13080. var d;
  13081. this.target && (d = this.target.getElementAt(a));
  13082. return d ? d.y: c
  13083. }
  13084. d = this.typicalLayoutRect ? this.typicalLayoutRect.height: 22;
  13085. for (var e = 0; e < a; e++) {
  13086. var l = this.elementSizeTable[e];
  13087. isNaN(l) && (l = d);
  13088. c += l + b
  13089. }
  13090. return c
  13091. };
  13092. b.prototype.getElementSize = function(a) {
  13093. return this.useVirtualLayout ? (a = this.elementSizeTable[a], isNaN(a) && (a = this.typicalLayoutRect ? this.typicalLayoutRect.height: 22), a) : this.target ? this.target.getElementAt(a).height: 0
  13094. };
  13095. b.prototype.getElementTotalSize = function() {
  13096. for (var a = isNaN(this._gap) ? 0 : this._gap, b = this.typicalLayoutRect ? this.typicalLayoutRect.height: 22, c = 0, d = this.target.numElements, e = 0; e < d; e++) {
  13097. var l = this.elementSizeTable[e];
  13098. isNaN(l) && (l = b);
  13099. c += l + a
  13100. }
  13101. return c - a
  13102. };
  13103. b.prototype.elementAdded = function(b) {
  13104. a.prototype.elementAdded.call(this, b);
  13105. this.elementSizeTable.splice(b, 0, this.typicalLayoutRect ? this.typicalLayoutRect.height: 22)
  13106. };
  13107. b.prototype.elementRemoved = function(b) {
  13108. a.prototype.elementRemoved.call(this, b);
  13109. this.elementSizeTable.splice(b, 1)
  13110. };
  13111. b.prototype.clearVirtualLayoutCache = function() {
  13112. a.prototype.clearVirtualLayoutCache.call(this);
  13113. this.elementSizeTable = [];
  13114. this.maxElementWidth = 0
  13115. };
  13116. b.prototype.findIndexAt = function(a, b, c) {
  13117. var d = Math.floor(0.5 * (b + c)),
  13118. e = this.getStartPosition(d),
  13119. l = this.getElementSize(d),
  13120. n = isNaN(this._gap) ? 0 : this._gap;
  13121. return a >= e && a < e + l + n ? d: b == c ? -1 : a < e ? this.findIndexAt(a, b, Math.max(b, d - 1)) : this.findIndexAt(a, Math.min(d + 1, c), c)
  13122. };
  13123. b.prototype.scrollPositionChanged = function() {
  13124. a.prototype.scrollPositionChanged.call(this);
  13125. this.useVirtualLayout && this.getIndexInView() && (this.indexInViewCalculated = !0, this.target.invalidateDisplayList())
  13126. };
  13127. b.prototype.getIndexInView = function() {
  13128. if (!this.target || 0 == this.target.numElements || isNaN(this.target.width) || 0 == this.target.width || isNaN(this.target.height) || 0 == this.target.height) return this.startIndex = this.endIndex = -1,
  13129. !1;
  13130. var a = isNaN(this._padding) ? 0 : this._padding,
  13131. b = isNaN(this._paddingTop) ? a: this._paddingTop,
  13132. c = isNaN(this._paddingBottom) ? a: this._paddingBottom,
  13133. a = this.target.numElements,
  13134. d = this.getStartPosition(a - 1) + this.elementSizeTable[a - 1] + c,
  13135. e = this.target.verticalScrollPosition;
  13136. if (e > d - c) return this.endIndex = this.startIndex = -1,
  13137. !1;
  13138. c = this.target.verticalScrollPosition + this.target.height;
  13139. if (c < b) return this.endIndex = this.startIndex = -1,
  13140. !1;
  13141. b = this.startIndex;
  13142. d = this.endIndex;
  13143. this.startIndex = this.findIndexAt(e, 0, a - 1); - 1 == this.startIndex && (this.startIndex = 0);
  13144. this.endIndex = this.findIndexAt(c, 0, a - 1); - 1 == this.endIndex && (this.endIndex = a - 1);
  13145. return b != this.startIndex || d != this.endIndex
  13146. };
  13147. b.prototype.updateDisplayListVirtual = function(a, b) {
  13148. this.indexInViewCalculated ? this.indexInViewCalculated = !1 : this.getIndexInView();
  13149. var d = isNaN(this._padding) ? 0 : this._padding,
  13150. e = isNaN(this._paddingLeft) ? d: this._paddingLeft,
  13151. h = isNaN(this._paddingRight) ? d: this._paddingRight,
  13152. l = isNaN(this._paddingBottom) ? d: this._paddingBottom,
  13153. n = isNaN(this._gap) ? 0 : this._gap,
  13154. p = this.target.numElements;
  13155. if ( - 1 == this.startIndex || -1 == this.endIndex) e = this.getStartPosition(p) - n + l,
  13156. this.target.setContentSize(this.target.contentWidth, Math.ceil(e));
  13157. else {
  13158. this.target.setVirtualElementIndicesInView(this.startIndex, this.endIndex);
  13159. var q = this._horizontalAlign == c.HorizontalAlign.JUSTIFY || this._horizontalAlign == c.HorizontalAlign.CONTENT_JUSTIFY,
  13160. r = this._horizontalAlign == c.HorizontalAlign.CONTENT_JUSTIFY,
  13161. s = 0;
  13162. q || (this._horizontalAlign == c.HorizontalAlign.CENTER ? s = 0.5 : this._horizontalAlign == c.HorizontalAlign.RIGHT && (s = 1));
  13163. var t = Math.max(0, a - e - h),
  13164. A = Math.ceil(t),
  13165. w,
  13166. B = this.typicalLayoutRect ? this.typicalLayoutRect.height: 22,
  13167. d = Math.max(this.typicalLayoutRect ? this.typicalLayoutRect.width: 71, this.maxElementWidth);
  13168. if (r) {
  13169. for (var C = this.startIndex; C <= this.endIndex; C++)(w = this.target.getVirtualElementAt(C)) && w.includeInLayout && (this.maxElementWidth = Math.max(this.maxElementWidth, w.preferredWidth));
  13170. A = Math.ceil(Math.max(t, this.maxElementWidth))
  13171. }
  13172. for (var u = 0,
  13173. v = 0,
  13174. C = 0,
  13175. D = !1,
  13176. z = this.startIndex; z <= this.endIndex; z++) if (u = 0, w = this.target.getVirtualElementAt(z)) w.includeInLayout ? (q ? (u = e, w.setLayoutBoundsSize(A, NaN)) : (u = (t - w.layoutBoundsWidth) * s, u = 0 < u ? u: 0, u = e + u), r || (this.maxElementWidth = Math.max(this.maxElementWidth, w.preferredWidth)), C = Math.max(C, w.layoutBoundsWidth), D || (v = isNaN(this.elementSizeTable[z]) ? B: this.elementSizeTable[z], v != w.layoutBoundsHeight && (D = !0)), 0 == z && 0 < this.elementSizeTable.length && this.elementSizeTable[z] != w.layoutBoundsHeight && (this.typicalLayoutRect = null), this.elementSizeTable[z] = w.layoutBoundsHeight, v = this.getStartPosition(z), w.setLayoutBoundsPosition(Math.round(u), Math.round(v))) : this.elementSizeTable[z] = 0;
  13177. C += e + h;
  13178. e = this.getStartPosition(p) - n + l;
  13179. this.target.setContentSize(Math.ceil(C), Math.ceil(e)); (D || d < this.maxElementWidth) && this.target.invalidateSize()
  13180. }
  13181. };
  13182. b.prototype.updateDisplayListReal = function(a, e) {
  13183. var m = isNaN(this._padding) ? 0 : this._padding,
  13184. g = isNaN(this._paddingLeft) ? m: this._paddingLeft,
  13185. h = isNaN(this._paddingRight) ? m: this._paddingRight,
  13186. l = isNaN(this._paddingTop) ? m: this._paddingTop,
  13187. m = isNaN(this._paddingBottom) ? m: this._paddingBottom,
  13188. n = isNaN(this._gap) ? 0 : this._gap,
  13189. p = Math.max(0, a - g - h),
  13190. q = Math.max(0, e - l - m),
  13191. r = this._verticalAlign == c.VerticalAlign.JUSTIFY,
  13192. s = this._horizontalAlign == c.HorizontalAlign.JUSTIFY || this._horizontalAlign == c.HorizontalAlign.CONTENT_JUSTIFY,
  13193. t = 0;
  13194. s || (this._horizontalAlign == c.HorizontalAlign.CENTER ? t = 0.5 : this._horizontalAlign == c.HorizontalAlign.RIGHT && (t = 1));
  13195. var A = this.target.numElements,
  13196. w = A,
  13197. B = g,
  13198. C = l,
  13199. u, v, D = 0,
  13200. B = 0,
  13201. z = [],
  13202. E,
  13203. x = q;
  13204. for (u = 0; u < A; u++)(v = this.target.getElementAt(u)) && v.includeInLayout ? (this.maxElementWidth = Math.max(this.maxElementWidth, v.preferredWidth), r ? D += v.preferredHeight: isNaN(v.percentHeight) ? x -= v.preferredHeight: (B += v.percentHeight, E = new d, E.layoutElement = v, E.percent = v.percentHeight, E.min = v.minHeight, E.max = v.maxHeight, z.push(E))) : w--;
  13205. var x = x - (w - 1) * n,
  13206. x = 0 < x ? x: 0,
  13207. y = q - D - n * (w - 1),
  13208. H,
  13209. L = w,
  13210. G = [];
  13211. if (r) {
  13212. if (0 > y) {
  13213. H = x / w;
  13214. for (u = 0; u < A; u++)(v = this.target.getElementAt(u)) && v.includeInLayout && (v = v.preferredHeight, v <= H && (x -= v, L--));
  13215. x = 0 < x ? x: 0
  13216. }
  13217. } else if (0 < B) {
  13218. b.flexChildrenProportionally(q, x, B, z);
  13219. q = 0;
  13220. v = z.length;
  13221. for (u = 0; u < v; u++) E = z[u],
  13222. B = Math.round(E.size + q),
  13223. q += E.size - B,
  13224. G[E.layoutElement.hashCode] = B,
  13225. x -= B;
  13226. x = 0 < x ? x: 0
  13227. }
  13228. this._verticalAlign == c.VerticalAlign.MIDDLE ? C = l + 0.5 * x: this._verticalAlign == c.VerticalAlign.BOTTOM && (C = l + x);
  13229. z = g;
  13230. v = w = 0;
  13231. E = Math.ceil(p);
  13232. this._horizontalAlign == c.HorizontalAlign.CONTENT_JUSTIFY && (E = Math.ceil(Math.max(p, this.maxElementWidth)));
  13233. q = 0;
  13234. w = NaN;
  13235. for (u = 0; u < A; u++) B = 0,
  13236. (v = this.target.getElementAt(u)) && v.includeInLayout && (w = NaN, r ? (B = NaN, 0 < y ? B = x * v.preferredHeight / D: 0 > y && v.preferredHeight > H && (B = x / L), isNaN(B) || (w = Math.round(B + q), q += B - w)) : w = G[v.hashCode], s ? (B = g, v.setLayoutBoundsSize(E, w)) : (B = NaN, isNaN(v.percentWidth) || (B = Math.min(100, v.percentWidth), B = Math.round(p * B * 0.01)), v.setLayoutBoundsSize(B, w), B = (p - v.layoutBoundsWidth) * t, B = 0 < B ? B: 0, B = g + B), v.setLayoutBoundsPosition(Math.round(B), Math.round(C)), w = Math.ceil(v.layoutBoundsWidth), v = Math.ceil(v.layoutBoundsHeight), z = Math.max(z, B + w), l = Math.max(l, C + v), C += v + n);
  13237. this.target.setContentSize(Math.ceil(z + h), Math.ceil(l + m))
  13238. };
  13239. b.flexChildrenProportionally = function(a, b, c, d) {
  13240. var e = d.length,
  13241. l;
  13242. do {
  13243. l = !0;
  13244. var n = b - a * c / 100;
  13245. 0 < n ? b -= n: n = 0;
  13246. for (var p = b / c,
  13247. q = 0; q < e; q++) {
  13248. var r = d[q],
  13249. s = r.percent * p;
  13250. if (s < r.min) {
  13251. l = r.min;
  13252. r.size = l;
  13253. d[q] = d[--e];
  13254. d[e] = r;
  13255. c -= r.percent;
  13256. n >= l || (b -= l - n);
  13257. l = !1;
  13258. break
  13259. } else if (s > r.max) {
  13260. l = r.max;
  13261. r.size = l;
  13262. d[q] = d[--e];
  13263. d[e] = r;
  13264. c -= r.percent;
  13265. n >= l || (b -= l - n);
  13266. l = !1;
  13267. break
  13268. } else r.size = s
  13269. }
  13270. } while (! l )
  13271. };
  13272. return b
  13273. } (c.LayoutBase);
  13274. c.VerticalLayout = e;
  13275. e.prototype.__class__ = "egret.VerticalLayout";
  13276. var d = function() {
  13277. return function() {
  13278. this.size = 0
  13279. }
  13280. } ();
  13281. d.prototype.__class__ = "ChildInfo"
  13282. })(egret || (egret = {}));
  13283. __extends = this.__extends ||
  13284. function(c, e) {
  13285. function d() {
  13286. this.constructor = c
  13287. }
  13288. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  13289. d.prototype = e.prototype;
  13290. c.prototype = new d
  13291. }; (function(c) {
  13292. var e = function(a) {
  13293. function b() {
  13294. a.call(this);
  13295. this._horizontalAlign = c.HorizontalAlign.LEFT;
  13296. this._verticalAlign = c.VerticalAlign.TOP;
  13297. this._gap = 6;
  13298. this._padding = 0;
  13299. this._paddingBottom = this._paddingTop = this._paddingRight = this._paddingLeft = NaN;
  13300. this.elementSizeTable = [];
  13301. this.endIndex = this.startIndex = -1;
  13302. this.indexInViewCalculated = !1;
  13303. this.maxElementHeight = 0
  13304. }
  13305. __extends(b, a);
  13306. Object.defineProperty(b.prototype, "horizontalAlign", {
  13307. get: function() {
  13308. return this._horizontalAlign
  13309. },
  13310. set: function(a) {
  13311. this._horizontalAlign != a && (this._horizontalAlign = a, this.target && this.target.invalidateDisplayList())
  13312. },
  13313. enumerable: !0,
  13314. configurable: !0
  13315. });
  13316. Object.defineProperty(b.prototype, "verticalAlign", {
  13317. get: function() {
  13318. return this._verticalAlign
  13319. },
  13320. set: function(a) {
  13321. this._verticalAlign != a && (this._verticalAlign = a, this.target && this.target.invalidateDisplayList())
  13322. },
  13323. enumerable: !0,
  13324. configurable: !0
  13325. });
  13326. Object.defineProperty(b.prototype, "gap", {
  13327. get: function() {
  13328. return this._gap
  13329. },
  13330. set: function(a) {
  13331. this._gap != a && (this._gap = a, this.invalidateTargetSizeAndDisplayList(), this.hasEventListener("gapChanged") && this.dispatchEventWith("gapChanged"))
  13332. },
  13333. enumerable: !0,
  13334. configurable: !0
  13335. });
  13336. Object.defineProperty(b.prototype, "padding", {
  13337. get: function() {
  13338. return this._padding
  13339. },
  13340. set: function(a) {
  13341. this._padding != a && (this._padding = a, this.invalidateTargetSizeAndDisplayList())
  13342. },
  13343. enumerable: !0,
  13344. configurable: !0
  13345. });
  13346. Object.defineProperty(b.prototype, "paddingLeft", {
  13347. get: function() {
  13348. return this._paddingLeft
  13349. },
  13350. set: function(a) {
  13351. this._paddingLeft != a && (this._paddingLeft = a, this.invalidateTargetSizeAndDisplayList())
  13352. },
  13353. enumerable: !0,
  13354. configurable: !0
  13355. });
  13356. Object.defineProperty(b.prototype, "paddingRight", {
  13357. get: function() {
  13358. return this._paddingRight
  13359. },
  13360. set: function(a) {
  13361. this._paddingRight != a && (this._paddingRight = a, this.invalidateTargetSizeAndDisplayList())
  13362. },
  13363. enumerable: !0,
  13364. configurable: !0
  13365. });
  13366. Object.defineProperty(b.prototype, "paddingTop", {
  13367. get: function() {
  13368. return this._paddingTop
  13369. },
  13370. set: function(a) {
  13371. this._paddingTop != a && (this._paddingTop = a, this.invalidateTargetSizeAndDisplayList())
  13372. },
  13373. enumerable: !0,
  13374. configurable: !0
  13375. });
  13376. Object.defineProperty(b.prototype, "paddingBottom", {
  13377. get: function() {
  13378. return this._paddingBottom
  13379. },
  13380. set: function(a) {
  13381. this._paddingBottom != a && (this._paddingBottom = a, this.invalidateTargetSizeAndDisplayList())
  13382. },
  13383. enumerable: !0,
  13384. configurable: !0
  13385. });
  13386. b.prototype.invalidateTargetSizeAndDisplayList = function() {
  13387. this.target && (this.target.invalidateSize(), this.target.invalidateDisplayList())
  13388. };
  13389. b.prototype.measure = function() {
  13390. a.prototype.measure.call(this);
  13391. this.target && (this.useVirtualLayout ? this.measureVirtual() : this.measureReal())
  13392. };
  13393. b.prototype.measureVirtual = function() {
  13394. for (var a = this.typicalLayoutRect ? this.typicalLayoutRect.height: 22, b = this.typicalLayoutRect ? this.typicalLayoutRect.width: 71, c = this.getElementTotalSize(), a = Math.max(this.maxElementHeight, a), d = this.target.getElementIndicesInView(), e = d.length, l = 0; l < e; l++) {
  13395. var n = d[l],
  13396. p = this.target.getElementAt(n);
  13397. if (null != p && p.includeInLayout) var q = p.preferredHeight,
  13398. c = c + p.preferredWidth,
  13399. c = c - (isNaN(this.elementSizeTable[n]) ? b: this.elementSizeTable[n]),
  13400. a = Math.max(a, q)
  13401. }
  13402. l = isNaN(this._padding) ? 0 : this._padding;
  13403. b = isNaN(this._paddingLeft) ? l: this._paddingLeft;
  13404. d = isNaN(this._paddingRight) ? l: this._paddingRight;
  13405. e = isNaN(this._paddingTop) ? l: this._paddingTop;
  13406. l = isNaN(this._paddingBottom) ? l: this._paddingBottom;
  13407. e += l;
  13408. this.target.measuredWidth = Math.ceil(c + (b + d));
  13409. this.target.measuredHeight = Math.ceil(a + e)
  13410. };
  13411. b.prototype.measureReal = function() {
  13412. for (var a = this.target.numElements,
  13413. b = a,
  13414. c = 0,
  13415. d = 0,
  13416. e = 0; e < a; e++) {
  13417. var l = this.target.getElementAt(e);
  13418. if (l && l.includeInLayout) var n = l.preferredHeight,
  13419. c = c + l.preferredWidth,
  13420. d = Math.max(d, n);
  13421. else b--
  13422. }
  13423. a = isNaN(this._gap) ? 0 : this._gap;
  13424. c += (b - 1) * a;
  13425. l = isNaN(this._padding) ? 0 : this._padding;
  13426. b = isNaN(this._paddingLeft) ? l: this._paddingLeft;
  13427. a = isNaN(this._paddingRight) ? l: this._paddingRight;
  13428. e = isNaN(this._paddingTop) ? l: this._paddingTop;
  13429. l = isNaN(this._paddingBottom) ? l: this._paddingBottom;
  13430. e += l;
  13431. this.target.measuredWidth = Math.ceil(c + (b + a));
  13432. this.target.measuredHeight = Math.ceil(d + e)
  13433. };
  13434. b.prototype.updateDisplayList = function(b, c) {
  13435. a.prototype.updateDisplayList.call(this, b, c);
  13436. this.target && (this.useVirtualLayout ? this.updateDisplayListVirtual(b, c) : this.updateDisplayListReal(b, c))
  13437. };
  13438. b.prototype.getStartPosition = function(a) {
  13439. var b = isNaN(this._padding) ? 0 : this._padding,
  13440. c = isNaN(this._paddingLeft) ? b: this._paddingLeft,
  13441. b = isNaN(this._gap) ? 0 : this._gap;
  13442. if (!this.useVirtualLayout) {
  13443. var d;
  13444. this.target && (d = this.target.getElementAt(a));
  13445. return d ? d.x: c
  13446. }
  13447. d = this.typicalLayoutRect ? this.typicalLayoutRect.width: 71;
  13448. for (var e = 0; e < a; e++) {
  13449. var l = this.elementSizeTable[e];
  13450. isNaN(l) && (l = d);
  13451. c += l + b
  13452. }
  13453. return c
  13454. };
  13455. b.prototype.getElementSize = function(a) {
  13456. return this.useVirtualLayout ? (a = this.elementSizeTable[a], isNaN(a) && (a = this.typicalLayoutRect ? this.typicalLayoutRect.width: 71), a) : this.target ? this.target.getElementAt(a).width: 0
  13457. };
  13458. b.prototype.getElementTotalSize = function() {
  13459. for (var a = this.typicalLayoutRect ? this.typicalLayoutRect.width: 71, b = isNaN(this._gap) ? 0 : this._gap, c = 0, d = this.target.numElements, e = 0; e < d; e++) {
  13460. var l = this.elementSizeTable[e];
  13461. isNaN(l) && (l = a);
  13462. c += l + b
  13463. }
  13464. return c - b
  13465. };
  13466. b.prototype.elementAdded = function(b) {
  13467. this.useVirtualLayout && (a.prototype.elementAdded.call(this, b), this.elementSizeTable.splice(b, 0, this.typicalLayoutRect ? this.typicalLayoutRect.width: 71))
  13468. };
  13469. b.prototype.elementRemoved = function(b) {
  13470. this.useVirtualLayout && (a.prototype.elementRemoved.call(this, b), this.elementSizeTable.splice(b, 1))
  13471. };
  13472. b.prototype.clearVirtualLayoutCache = function() {
  13473. this.useVirtualLayout && (a.prototype.clearVirtualLayoutCache.call(this), this.elementSizeTable = [], this.maxElementHeight = 0)
  13474. };
  13475. b.prototype.findIndexAt = function(a, b, c) {
  13476. var d = Math.floor(0.5 * (b + c)),
  13477. e = this.getStartPosition(d),
  13478. l = this.getElementSize(d),
  13479. n = isNaN(this._gap) ? 0 : this._gap;
  13480. return a >= e && a < e + l + n ? d: b == c ? -1 : a < e ? this.findIndexAt(a, b, Math.max(b, d - 1)) : this.findIndexAt(a, Math.min(d + 1, c), c)
  13481. };
  13482. b.prototype.scrollPositionChanged = function() {
  13483. a.prototype.scrollPositionChanged.call(this);
  13484. this.useVirtualLayout && this.getIndexInView() && (this.indexInViewCalculated = !0, this.target.invalidateDisplayList())
  13485. };
  13486. b.prototype.getIndexInView = function() {
  13487. if (!this.target || 0 == this.target.numElements || isNaN(this.target.width) || 0 == this.target.width || isNaN(this.target.height) || 0 == this.target.height) return this.startIndex = this.endIndex = -1,
  13488. !1;
  13489. var a = isNaN(this._padding) ? 0 : this._padding,
  13490. b = isNaN(this._paddingLeft) ? a: this._paddingLeft,
  13491. c = isNaN(this._paddingRight) ? a: this._paddingRight;
  13492. isNaN(this._paddingTop);
  13493. isNaN(this._paddingBottom);
  13494. var a = this.target.numElements,
  13495. d = this.getStartPosition(a - 1) + this.elementSizeTable[a - 1] + c,
  13496. e = this.target.horizontalScrollPosition;
  13497. if (e > d - c) return this.endIndex = this.startIndex = -1,
  13498. !1;
  13499. c = this.target.horizontalScrollPosition + this.target.width;
  13500. if (c < b) return this.endIndex = this.startIndex = -1,
  13501. !1;
  13502. b = this.startIndex;
  13503. d = this.endIndex;
  13504. this.startIndex = this.findIndexAt(e, 0, a - 1); - 1 == this.startIndex && (this.startIndex = 0);
  13505. this.endIndex = this.findIndexAt(c, 0, a - 1); - 1 == this.endIndex && (this.endIndex = a - 1);
  13506. return b != this.startIndex || d != this.endIndex
  13507. };
  13508. b.prototype.updateDisplayListVirtual = function(a, b) {
  13509. this.indexInViewCalculated ? this.indexInViewCalculated = !1 : this.getIndexInView();
  13510. var d = isNaN(this._padding) ? 0 : this._padding,
  13511. e = isNaN(this._paddingRight) ? d: this._paddingRight,
  13512. h = isNaN(this._paddingTop) ? d: this._paddingTop,
  13513. l = isNaN(this._paddingBottom) ? d: this._paddingBottom,
  13514. n = isNaN(this._gap) ? 0 : this._gap,
  13515. p = this.target.numElements;
  13516. if ( - 1 == this.startIndex || -1 == this.endIndex) e = this.getStartPosition(p) - n + e,
  13517. this.target.setContentSize(Math.ceil(e), this.target.contentHeight);
  13518. else {
  13519. this.target.setVirtualElementIndicesInView(this.startIndex, this.endIndex);
  13520. var q = this._verticalAlign == c.VerticalAlign.JUSTIFY || this._verticalAlign == c.VerticalAlign.CONTENT_JUSTIFY,
  13521. r = this._verticalAlign == c.VerticalAlign.CONTENT_JUSTIFY,
  13522. s = 0;
  13523. q || (this._verticalAlign == c.VerticalAlign.MIDDLE ? s = 0.5 : this._verticalAlign == c.VerticalAlign.BOTTOM && (s = 1));
  13524. var t = Math.max(0, b - h - l),
  13525. A = Math.ceil(t),
  13526. w,
  13527. B = this.typicalLayoutRect ? this.typicalLayoutRect.width: 71,
  13528. d = Math.max(this.typicalLayoutRect ? this.typicalLayoutRect.height: 22, this.maxElementHeight);
  13529. if (r) {
  13530. for (var C = this.startIndex; C <= this.endIndex; C++)(w = this.target.getVirtualElementAt(C)) && w.includeInLayout && (this.maxElementHeight = Math.max(this.maxElementHeight, w.preferredHeight));
  13531. A = Math.ceil(Math.max(t, this.maxElementHeight))
  13532. }
  13533. for (var u = 0,
  13534. v = 0,
  13535. C = 0,
  13536. D = !1,
  13537. z = this.startIndex; z <= this.endIndex; z++) if (v = 0, w = this.target.getVirtualElementAt(z)) w.includeInLayout ? (q ? (v = h, w.setLayoutBoundsSize(NaN, A)) : (v = (t - w.layoutBoundsHeight) * s, v = 0 < v ? v: 0, v = h + v), r || (this.maxElementHeight = Math.max(this.maxElementHeight, w.preferredHeight)), C = Math.max(C, w.layoutBoundsHeight), D || (u = isNaN(this.elementSizeTable[z]) ? B: this.elementSizeTable[z], u != w.layoutBoundsWidth && (D = !0)), 0 == z && 0 < this.elementSizeTable.length && this.elementSizeTable[z] != w.layoutBoundsWidth && (this.typicalLayoutRect = null), this.elementSizeTable[z] = w.layoutBoundsWidth, u = this.getStartPosition(z), w.setLayoutBoundsPosition(Math.round(u), Math.round(v))) : this.elementSizeTable[z] = 0;
  13538. C += h + l;
  13539. e = this.getStartPosition(p) - n + e;
  13540. this.target.setContentSize(Math.ceil(e), Math.ceil(C)); (D || d < this.maxElementHeight) && this.target.invalidateSize()
  13541. }
  13542. };
  13543. b.prototype.updateDisplayListReal = function(a, e) {
  13544. var m = isNaN(this._padding) ? 0 : this._padding,
  13545. g = isNaN(this._paddingLeft) ? m: this._paddingLeft,
  13546. h = isNaN(this._paddingRight) ? m: this._paddingRight,
  13547. l = isNaN(this._paddingTop) ? m: this._paddingTop,
  13548. m = isNaN(this._paddingBottom) ? m: this._paddingBottom,
  13549. n = isNaN(this._gap) ? 0 : this._gap,
  13550. p = Math.max(0, a - g - h),
  13551. q = Math.max(0, e - l - m),
  13552. r = this._horizontalAlign == c.HorizontalAlign.JUSTIFY,
  13553. s = this._verticalAlign == c.VerticalAlign.JUSTIFY || this._verticalAlign == c.VerticalAlign.CONTENT_JUSTIFY,
  13554. t = 0;
  13555. s || (this._verticalAlign == c.VerticalAlign.MIDDLE ? t = 0.5 : this._verticalAlign == c.VerticalAlign.BOTTOM && (t = 1));
  13556. var A = this.target.numElements,
  13557. w = A,
  13558. B = g,
  13559. C = l,
  13560. u, v, D = 0,
  13561. C = 0,
  13562. z = [],
  13563. E,
  13564. x = p;
  13565. for (u = 0; u < A; u++)(v = this.target.getElementAt(u)) && v.includeInLayout ? (this.maxElementHeight = Math.max(this.maxElementHeight, v.preferredHeight), r ? D += v.preferredWidth: isNaN(v.percentWidth) ? x -= v.preferredWidth: (C += v.percentWidth, E = new d, E.layoutElement = v, E.percent = v.percentWidth, E.min = v.minWidth, E.max = v.maxWidth, z.push(E))) : w--;
  13566. var x = x - n * (w - 1),
  13567. x = 0 < x ? x: 0,
  13568. y = p - D - n * (w - 1),
  13569. H,
  13570. L = w,
  13571. G = [];
  13572. if (r) {
  13573. if (0 > y) {
  13574. H = x / w;
  13575. for (u = 0; u < A; u++)(v = this.target.getElementAt(u)) && v.includeInLayout && (v = v.preferredWidth, v <= H && (x -= v, L--));
  13576. x = 0 < x ? x: 0
  13577. }
  13578. } else if (0 < C) {
  13579. b.flexChildrenProportionally(p, x, C, z);
  13580. p = 0;
  13581. v = z.length;
  13582. for (u = 0; u < v; u++) E = z[u],
  13583. C = Math.round(E.size + p),
  13584. p += E.size - C,
  13585. G[E.layoutElement.hashCode] = C,
  13586. x -= C;
  13587. x = 0 < x ? x: 0
  13588. }
  13589. this._horizontalAlign == c.HorizontalAlign.CENTER ? B = g + 0.5 * x: this._horizontalAlign == c.HorizontalAlign.RIGHT && (B = g + x);
  13590. z = l;
  13591. v = w = 0;
  13592. E = Math.ceil(q);
  13593. this._verticalAlign == c.VerticalAlign.CONTENT_JUSTIFY && (E = Math.ceil(Math.max(q, this.maxElementHeight)));
  13594. for (u = p = 0; u < A; u++) C = 0,
  13595. (v = this.target.getElementAt(u)) && v.includeInLayout && (w = NaN, r ? (C = NaN, 0 < y ? C = x * v.preferredWidth / D: 0 > y && v.preferredWidth > H && (C = x / L), isNaN(C) || (w = Math.round(C + p), p += C - w)) : w = G[v.hashCode], s ? (C = l, v.setLayoutBoundsSize(w, E)) : (C = NaN, isNaN(v.percentHeight) || (C = Math.min(100, v.percentHeight), C = Math.round(q * C * 0.01)), v.setLayoutBoundsSize(w, C), C = (q - v.layoutBoundsHeight) * t, C = 0 < C ? C: 0, C = l + C), v.setLayoutBoundsPosition(Math.round(B), Math.round(C)), w = Math.ceil(v.layoutBoundsWidth), v = Math.ceil(v.layoutBoundsHeight), g = Math.max(g, B + w), z = Math.max(z, C + v), B += w + n);
  13596. this.target.setContentSize(Math.ceil(g + h), Math.ceil(z + m))
  13597. };
  13598. b.flexChildrenProportionally = function(a, b, c, d) {
  13599. var e = d.length,
  13600. l;
  13601. do {
  13602. l = !0;
  13603. var n = b - a * c / 100;
  13604. 0 < n ? b -= n: n = 0;
  13605. for (var p = b / c,
  13606. q = 0; q < e; q++) {
  13607. var r = d[q],
  13608. s = r.percent * p;
  13609. if (s < r.min) {
  13610. l = r.min;
  13611. r.size = l;
  13612. d[q] = d[--e];
  13613. d[e] = r;
  13614. c -= r.percent;
  13615. n >= l || (b -= l - n);
  13616. l = !1;
  13617. break
  13618. } else if (s > r.max) {
  13619. l = r.max;
  13620. r.size = l;
  13621. d[q] = d[--e];
  13622. d[e] = r;
  13623. c -= r.percent;
  13624. n >= l || (b -= l - n);
  13625. l = !1;
  13626. break
  13627. } else r.size = s
  13628. }
  13629. } while (! l )
  13630. };
  13631. return b
  13632. } (c.LayoutBase);
  13633. c.HorizontalLayout = e;
  13634. e.prototype.__class__ = "egret.HorizontalLayout";
  13635. var d = function() {
  13636. return function() {
  13637. this.size = 0
  13638. }
  13639. } ();
  13640. d.prototype.__class__ = "ChildInfo"
  13641. })(egret || (egret = {}));
  13642. __extends = this.__extends ||
  13643. function(c, e) {
  13644. function d() {
  13645. this.constructor = c
  13646. }
  13647. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  13648. d.prototype = e.prototype;
  13649. c.prototype = new d
  13650. }; (function(c) {
  13651. var e = function(d) {
  13652. function a() {
  13653. d.call(this);
  13654. this.explicitHorizontalGap = NaN;
  13655. this._horizontalGap = 6;
  13656. this.explicitVerticalGap = NaN;
  13657. this._verticalGap = 6;
  13658. this._columnCount = -1;
  13659. this._requestedColumnCount = 0;
  13660. this._rowCount = -1;
  13661. this._requestedRowCount = 0;
  13662. this._rowHeight = this.explicitRowHeight = this._columnWidth = this.explicitColumnWidth = NaN;
  13663. this._padding = 0;
  13664. this._paddingBottom = this._paddingTop = this._paddingRight = this._paddingLeft = NaN;
  13665. this._horizontalAlign = c.HorizontalAlign.JUSTIFY;
  13666. this._verticalAlign = c.VerticalAlign.JUSTIFY;
  13667. this._columnAlign = c.ColumnAlign.LEFT;
  13668. this._rowAlign = c.RowAlign.TOP;
  13669. this._orientation = c.TileOrientation.ROWS;
  13670. this.maxElementHeight = this.maxElementWidth = 0;
  13671. this.endIndex = this.startIndex = -1;
  13672. this.indexInViewCalculated = !1
  13673. }
  13674. __extends(a, d);
  13675. Object.defineProperty(a.prototype, "horizontalGap", {
  13676. get: function() {
  13677. return this._horizontalGap
  13678. },
  13679. set: function(a) {
  13680. a != this._horizontalGap && (this._horizontalGap = this.explicitHorizontalGap = a, this.invalidateTargetSizeAndDisplayList(), this.hasEventListener("gapChanged") && this.dispatchEventWith("gapChanged"))
  13681. },
  13682. enumerable: !0,
  13683. configurable: !0
  13684. });
  13685. Object.defineProperty(a.prototype, "verticalGap", {
  13686. get: function() {
  13687. return this._verticalGap
  13688. },
  13689. set: function(a) {
  13690. a != this._verticalGap && (this._verticalGap = this.explicitVerticalGap = a, this.invalidateTargetSizeAndDisplayList(), this.hasEventListener("gapChanged") && this.dispatchEventWith("gapChanged"))
  13691. },
  13692. enumerable: !0,
  13693. configurable: !0
  13694. });
  13695. Object.defineProperty(a.prototype, "columnCount", {
  13696. get: function() {
  13697. return this._columnCount
  13698. },
  13699. enumerable: !0,
  13700. configurable: !0
  13701. });
  13702. Object.defineProperty(a.prototype, "requestedColumnCount", {
  13703. get: function() {
  13704. return this._requestedColumnCount
  13705. },
  13706. set: function(a) {
  13707. this._requestedColumnCount != a && (this._columnCount = this._requestedColumnCount = a, this.invalidateTargetSizeAndDisplayList())
  13708. },
  13709. enumerable: !0,
  13710. configurable: !0
  13711. });
  13712. Object.defineProperty(a.prototype, "rowCount", {
  13713. get: function() {
  13714. return this._rowCount
  13715. },
  13716. enumerable: !0,
  13717. configurable: !0
  13718. });
  13719. Object.defineProperty(a.prototype, "requestedRowCount", {
  13720. get: function() {
  13721. return this._requestedRowCount
  13722. },
  13723. set: function(a) {
  13724. this._requestedRowCount != a && (this._rowCount = this._requestedRowCount = a, this.invalidateTargetSizeAndDisplayList())
  13725. },
  13726. enumerable: !0,
  13727. configurable: !0
  13728. });
  13729. Object.defineProperty(a.prototype, "columnWidth", {
  13730. get: function() {
  13731. return this._columnWidth
  13732. },
  13733. set: function(a) {
  13734. a != this._columnWidth && (this._columnWidth = this.explicitColumnWidth = a, this.invalidateTargetSizeAndDisplayList())
  13735. },
  13736. enumerable: !0,
  13737. configurable: !0
  13738. });
  13739. Object.defineProperty(a.prototype, "rowHeight", {
  13740. get: function() {
  13741. return this._rowHeight
  13742. },
  13743. set: function(a) {
  13744. a != this._rowHeight && (this._rowHeight = this.explicitRowHeight = a, this.invalidateTargetSizeAndDisplayList())
  13745. },
  13746. enumerable: !0,
  13747. configurable: !0
  13748. });
  13749. Object.defineProperty(a.prototype, "padding", {
  13750. get: function() {
  13751. return this._padding
  13752. },
  13753. set: function(a) {
  13754. this._padding != a && (this._padding = a, this.invalidateTargetSizeAndDisplayList())
  13755. },
  13756. enumerable: !0,
  13757. configurable: !0
  13758. });
  13759. Object.defineProperty(a.prototype, "paddingLeft", {
  13760. get: function() {
  13761. return this._paddingLeft
  13762. },
  13763. set: function(a) {
  13764. this._paddingLeft != a && (this._paddingLeft = a, this.invalidateTargetSizeAndDisplayList())
  13765. },
  13766. enumerable: !0,
  13767. configurable: !0
  13768. });
  13769. Object.defineProperty(a.prototype, "paddingRight", {
  13770. get: function() {
  13771. return this._paddingRight
  13772. },
  13773. set: function(a) {
  13774. this._paddingRight != a && (this._paddingRight = a, this.invalidateTargetSizeAndDisplayList())
  13775. },
  13776. enumerable: !0,
  13777. configurable: !0
  13778. });
  13779. Object.defineProperty(a.prototype, "paddingTop", {
  13780. get: function() {
  13781. return this._paddingTop
  13782. },
  13783. set: function(a) {
  13784. this._paddingTop != a && (this._paddingTop = a, this.invalidateTargetSizeAndDisplayList())
  13785. },
  13786. enumerable: !0,
  13787. configurable: !0
  13788. });
  13789. Object.defineProperty(a.prototype, "paddingBottom", {
  13790. get: function() {
  13791. return this._paddingBottom
  13792. },
  13793. set: function(a) {
  13794. this._paddingBottom != a && (this._paddingBottom = a, this.invalidateTargetSizeAndDisplayList())
  13795. },
  13796. enumerable: !0,
  13797. configurable: !0
  13798. });
  13799. Object.defineProperty(a.prototype, "horizontalAlign", {
  13800. get: function() {
  13801. return this._horizontalAlign
  13802. },
  13803. set: function(a) {
  13804. this._horizontalAlign != a && (this._horizontalAlign = a, this.invalidateTargetSizeAndDisplayList())
  13805. },
  13806. enumerable: !0,
  13807. configurable: !0
  13808. });
  13809. Object.defineProperty(a.prototype, "verticalAlign", {
  13810. get: function() {
  13811. return this._verticalAlign
  13812. },
  13813. set: function(a) {
  13814. this._verticalAlign != a && (this._verticalAlign = a, this.invalidateTargetSizeAndDisplayList())
  13815. },
  13816. enumerable: !0,
  13817. configurable: !0
  13818. });
  13819. Object.defineProperty(a.prototype, "columnAlign", {
  13820. get: function() {
  13821. return this._columnAlign
  13822. },
  13823. set: function(a) {
  13824. this._columnAlign != a && (this._columnAlign = a, this.invalidateTargetSizeAndDisplayList())
  13825. },
  13826. enumerable: !0,
  13827. configurable: !0
  13828. });
  13829. Object.defineProperty(a.prototype, "rowAlign", {
  13830. get: function() {
  13831. return this._rowAlign
  13832. },
  13833. set: function(a) {
  13834. this._rowAlign != a && (this._rowAlign = a, this.invalidateTargetSizeAndDisplayList())
  13835. },
  13836. enumerable: !0,
  13837. configurable: !0
  13838. });
  13839. Object.defineProperty(a.prototype, "orientation", {
  13840. get: function() {
  13841. return this._orientation
  13842. },
  13843. set: function(a) {
  13844. this._orientation != a && (this._orientation = a, this.invalidateTargetSizeAndDisplayList(), this.hasEventListener("orientationChanged") && this.dispatchEventWith("orientationChanged"))
  13845. },
  13846. enumerable: !0,
  13847. configurable: !0
  13848. });
  13849. a.prototype.invalidateTargetSizeAndDisplayList = function() {
  13850. this.target && (this.target.invalidateSize(), this.target.invalidateDisplayList())
  13851. };
  13852. a.prototype.measure = function() {
  13853. if (this.target) {
  13854. var a = this._columnCount,
  13855. c = this._rowCount,
  13856. d = this._columnWidth,
  13857. e = this._rowHeight,
  13858. g = 0,
  13859. h = 0;
  13860. this.calculateRowAndColumn(this.target.explicitWidth, this.target.explicitHeight);
  13861. var l = 0 < this._requestedColumnCount ? this._requestedColumnCount: this._columnCount,
  13862. n = 0 < this._requestedRowCount ? this._requestedRowCount: this._rowCount,
  13863. p = isNaN(this._horizontalGap) ? 0 : this._horizontalGap,
  13864. q = isNaN(this._verticalGap) ? 0 : this._verticalGap;
  13865. 0 < l && (g = l * (this._columnWidth + p) - p);
  13866. 0 < n && (h = n * (this._rowHeight + q) - q);
  13867. q = isNaN(this._padding) ? 0 : this._padding;
  13868. l = isNaN(this._paddingLeft) ? q: this._paddingLeft;
  13869. n = isNaN(this._paddingRight) ? q: this._paddingRight;
  13870. p = isNaN(this._paddingTop) ? q: this._paddingTop;
  13871. q = isNaN(this._paddingBottom) ? q: this._paddingBottom;
  13872. p += q;
  13873. this.target.measuredWidth = Math.ceil(g + (l + n));
  13874. this.target.measuredHeight = Math.ceil(h + p);
  13875. this._columnCount = a;
  13876. this._rowCount = c;
  13877. this._columnWidth = d;
  13878. this._rowHeight = e
  13879. }
  13880. };
  13881. a.prototype.calculateRowAndColumn = function(a, d) {
  13882. var e = isNaN(this._horizontalGap) ? 0 : this._horizontalGap,
  13883. m = isNaN(this._verticalGap) ? 0 : this._verticalGap;
  13884. this._rowCount = this._columnCount = -1;
  13885. for (var g = this.target.numElements,
  13886. h = g,
  13887. l = 0; l < h; l++) {
  13888. var n = this.target.getElementAt(l);
  13889. n && !n.includeInLayout && g--
  13890. }
  13891. if (0 == g) this._rowCount = this._columnCount = 0;
  13892. else { (isNaN(this.explicitColumnWidth) || isNaN(this.explicitRowHeight)) && this.updateMaxElementSize();
  13893. isNaN(this.explicitColumnWidth) ? this._columnWidth = this.maxElementWidth: this._columnWidth = this.explicitColumnWidth;
  13894. isNaN(this.explicitRowHeight) ? this._rowHeight = this.maxElementHeight: this._rowHeight = this.explicitRowHeight;
  13895. h = this._columnWidth + e;
  13896. 0 >= h && (h = 1);
  13897. l = this._rowHeight + m;
  13898. 0 >= l && (l = 1);
  13899. var n = this.orientation == c.TileOrientation.COLUMNS,
  13900. p = !isNaN(a),
  13901. q = !isNaN(d),
  13902. r = isNaN(this._padding) ? 0 : this._padding,
  13903. s = isNaN(this._paddingLeft) ? r: this._paddingLeft,
  13904. t = isNaN(this._paddingRight) ? r: this._paddingRight,
  13905. A = isNaN(this._paddingTop) ? r: this._paddingTop,
  13906. r = isNaN(this._paddingBottom) ? r: this._paddingBottom;
  13907. 0 < this._requestedColumnCount || 0 < this._requestedRowCount ? (0 < this._requestedRowCount && (this._rowCount = Math.min(this._requestedRowCount, g)), 0 < this._requestedColumnCount && (this._columnCount = Math.min(this._requestedColumnCount, g))) : p || q ? !p || q && n ? (e = Math.max(0, d - A - r), this._rowCount = Math.floor((e + m) / l), this._rowCount = Math.max(1, Math.min(this._rowCount, g))) : (m = Math.max(0, a - s - t), this._columnCount = Math.floor((m + e) / h), this._columnCount = Math.max(1, Math.min(this._columnCount, g))) : (e = Math.sqrt(g * h * l), n ? this._rowCount = Math.max(1, Math.round(e / l)) : this._columnCount = Math.max(1, Math.round(e / h))); - 1 == this._rowCount && (this._rowCount = Math.max(1, Math.ceil(g / this._columnCount))); - 1 == this._columnCount && (this._columnCount = Math.max(1, Math.ceil(g / this._rowCount)));
  13908. 0 < this._requestedColumnCount && 0 < this._requestedRowCount && (this.orientation == c.TileOrientation.ROWS ? this._rowCount = Math.max(1, Math.ceil(g / this._requestedColumnCount)) : this._columnCount = Math.max(1, Math.ceil(g / this._requestedRowCount)))
  13909. }
  13910. };
  13911. a.prototype.updateMaxElementSize = function() {
  13912. this.target && (this.useVirtualLayout ? this.updateMaxElementSizeVirtual() : this.updateMaxElementSizeReal())
  13913. };
  13914. a.prototype.updateMaxElementSizeVirtual = function() {
  13915. var a = this.typicalLayoutRect ? this.typicalLayoutRect.height: 22;
  13916. this.maxElementWidth = Math.max(this.maxElementWidth, this.typicalLayoutRect ? this.typicalLayoutRect.width: 22);
  13917. this.maxElementHeight = Math.max(this.maxElementHeight, a);
  13918. if ( - 1 != this.startIndex && -1 != this.endIndex) for (a = this.startIndex; a <= this.endIndex; a++) {
  13919. var c = this.target.getVirtualElementAt(a);
  13920. c && c.includeInLayout && (this.maxElementWidth = Math.max(this.maxElementWidth, c.preferredWidth), this.maxElementHeight = Math.max(this.maxElementHeight, c.preferredHeight))
  13921. }
  13922. };
  13923. a.prototype.updateMaxElementSizeReal = function() {
  13924. for (var a = this.target.numElements,
  13925. c = 0; c < a; c++) {
  13926. var d = this.target.getElementAt(c);
  13927. d && d.includeInLayout && (this.maxElementWidth = Math.max(this.maxElementWidth, d.preferredWidth), this.maxElementHeight = Math.max(this.maxElementHeight, d.preferredHeight))
  13928. }
  13929. };
  13930. a.prototype.clearVirtualLayoutCache = function() {
  13931. d.prototype.clearVirtualLayoutCache.call(this);
  13932. this.maxElementHeight = this.maxElementWidth = 0
  13933. };
  13934. a.prototype.scrollPositionChanged = function() {
  13935. d.prototype.scrollPositionChanged.call(this);
  13936. this.useVirtualLayout && this.getIndexInView() && (this.indexInViewCalculated = !0, this.target.invalidateDisplayList())
  13937. };
  13938. a.prototype.getIndexInView = function() {
  13939. if (!this.target || 0 == this.target.numElements) return this.startIndex = this.endIndex = -1,
  13940. !1;
  13941. var a = this.target.numElements;
  13942. if (!this.useVirtualLayout) return this.startIndex = 0,
  13943. this.endIndex = a - 1,
  13944. !1;
  13945. if (isNaN(this.target.width) || 0 == this.target.width || isNaN(this.target.height) || 0 == this.target.height) return this.startIndex = this.endIndex = -1,
  13946. !1;
  13947. var d = this.startIndex,
  13948. e = this.endIndex,
  13949. m = isNaN(this._padding) ? 0 : this._padding,
  13950. g = isNaN(this._paddingLeft) ? m: this._paddingLeft,
  13951. m = isNaN(this._paddingTop) ? m: this._paddingTop,
  13952. h = isNaN(this._horizontalGap) ? 0 : this._horizontalGap,
  13953. l = isNaN(this._verticalGap) ? 0 : this._verticalGap;
  13954. if (this.orientation == c.TileOrientation.COLUMNS) {
  13955. h = this._columnWidth + h;
  13956. if (0 >= h) return this.startIndex = 0,
  13957. this.endIndex = a - 1,
  13958. !1;
  13959. l = this.target.horizontalScrollPosition + this.target.width;
  13960. m = Math.floor((this.target.horizontalScrollPosition - g) / h);
  13961. 0 > m && (m = 0);
  13962. g = Math.ceil((l - g) / h);
  13963. 0 > g && (g = 0);
  13964. this.startIndex = Math.min(a - 1, Math.max(0, m * this._rowCount));
  13965. this.endIndex = Math.min(a - 1, Math.max(0, g * this._rowCount - 1))
  13966. } else {
  13967. h = this._rowHeight + l;
  13968. if (0 >= h) return this.startIndex = 0,
  13969. this.endIndex = a - 1,
  13970. !1;
  13971. l = this.target.verticalScrollPosition + this.target.height;
  13972. g = Math.floor((this.target.verticalScrollPosition - m) / h);
  13973. 0 > g && (g = 0);
  13974. m = Math.ceil((l - m) / h);
  13975. 0 > m && (m = 0);
  13976. this.startIndex = Math.min(a - 1, Math.max(0, g * this._columnCount));
  13977. this.endIndex = Math.min(a - 1, Math.max(0, m * this._columnCount - 1))
  13978. }
  13979. return this.startIndex != d || this.endIndex != e
  13980. };
  13981. a.prototype.updateDisplayList = function(a, e) {
  13982. d.prototype.updateDisplayList.call(this, a, e);
  13983. if (this.target) {
  13984. var f = isNaN(this._padding) ? 0 : this._padding,
  13985. m = isNaN(this._paddingLeft) ? f: this._paddingLeft,
  13986. g = isNaN(this._paddingRight) ? f: this._paddingRight,
  13987. h = isNaN(this._paddingTop) ? f: this._paddingTop,
  13988. l = isNaN(this._paddingBottom) ? f: this._paddingBottom,
  13989. f = isNaN(this._horizontalGap) ? 0 : this._horizontalGap,
  13990. n = isNaN(this._verticalGap) ? 0 : this._verticalGap;
  13991. if (this.indexInViewCalculated) this.indexInViewCalculated = !1;
  13992. else {
  13993. this.calculateRowAndColumn(a, e);
  13994. if (0 == this._rowCount || 0 == this._columnCount) {
  13995. this.target.setContentSize(m + g, h + l);
  13996. return
  13997. }
  13998. this.adjustForJustify(a, e);
  13999. this.getIndexInView()
  14000. }
  14001. this.useVirtualLayout && (this.calculateRowAndColumn(a, e), this.adjustForJustify(a, e));
  14002. if ( - 1 == this.startIndex || -1 == this.endIndex) this.target.setContentSize(0, 0);
  14003. else {
  14004. this.target.setVirtualElementIndicesInView(this.startIndex, this.endIndex);
  14005. for (var p, q, r, s = this.orientation == c.TileOrientation.COLUMNS,
  14006. t = this.startIndex,
  14007. A = this.startIndex; A <= this.endIndex; A++) p = this.useVirtualLayout ? this.target.getVirtualElementAt(A) : this.target.getElementAt(A),
  14008. null != p && p.includeInLayout && (s ? (q = Math.ceil((t + 1) / this._rowCount) - 1, r = Math.ceil((t + 1) % this._rowCount) - 1, -1 == r && (r = this._rowCount - 1)) : (q = Math.ceil((t + 1) % this._columnCount) - 1, -1 == q && (q = this._columnCount - 1), r = Math.ceil((t + 1) / this._columnCount) - 1), q = q * (this._columnWidth + f) + m, r = r * (this._rowHeight + n) + h, this.sizeAndPositionElement(p, q, r, this._columnWidth, this.rowHeight), t++);
  14009. h += l;
  14010. n = (this._rowHeight + n) * this._rowCount - n;
  14011. this.target.setContentSize(Math.ceil((this._columnWidth + f) * this._columnCount - f + (m + g)), Math.ceil(n + h))
  14012. }
  14013. }
  14014. };
  14015. a.prototype.sizeAndPositionElement = function(a, d, e, m, g) {
  14016. var h = NaN,
  14017. l = NaN;
  14018. this.horizontalAlign == c.HorizontalAlign.JUSTIFY ? h = m: isNaN(a.percentWidth) || (h = m * a.percentWidth * 0.01);
  14019. this.verticalAlign == c.VerticalAlign.JUSTIFY ? l = g: isNaN(a.percentHeight) || (l = g * a.percentHeight * 0.01);
  14020. a.setLayoutBoundsSize(Math.round(h), Math.round(l));
  14021. h = d;
  14022. switch (this.horizontalAlign) {
  14023. case c.HorizontalAlign.RIGHT:
  14024. h += m - a.layoutBoundsWidth;
  14025. break;
  14026. case c.HorizontalAlign.CENTER:
  14027. h = d + (m - a.layoutBoundsWidth) / 2
  14028. }
  14029. d = e;
  14030. switch (this.verticalAlign) {
  14031. case c.VerticalAlign.BOTTOM:
  14032. d += g - a.layoutBoundsHeight;
  14033. break;
  14034. case c.VerticalAlign.MIDDLE:
  14035. d += (g - a.layoutBoundsHeight) / 2
  14036. }
  14037. a.setLayoutBoundsPosition(Math.round(h), Math.round(d))
  14038. };
  14039. a.prototype.adjustForJustify = function(a, d) {
  14040. var e = isNaN(this._padding) ? 0 : this._padding,
  14041. m = isNaN(this._paddingLeft) ? e: this._paddingLeft,
  14042. g = isNaN(this._paddingRight) ? e: this._paddingRight,
  14043. h = isNaN(this._paddingTop) ? e: this._paddingTop,
  14044. e = isNaN(this._paddingBottom) ? e: this._paddingBottom,
  14045. m = Math.max(0, a - m - g),
  14046. h = Math.max(0, d - h - e);
  14047. isNaN(this.explicitVerticalGap) || (this._verticalGap = this.explicitVerticalGap);
  14048. isNaN(this.explicitHorizontalGap) || (this._horizontalGap = this.explicitHorizontalGap);
  14049. this._verticalGap = isNaN(this._verticalGap) ? 0 : this._verticalGap;
  14050. this._horizontalGap = isNaN(this._horizontalGap) ? 0 : this._horizontalGap;
  14051. h -= this._rowHeight * this._rowCount;
  14052. m -= this._columnWidth * this._columnCount;
  14053. 0 < h && (this.rowAlign == c.RowAlign.JUSTIFY_USING_GAP ? (g = Math.max(1, this._rowCount - 1), this._verticalGap = h / g) : this.rowAlign == c.RowAlign.JUSTIFY_USING_HEIGHT && 0 < this._rowCount && (this._rowHeight += (h - (this._rowCount - 1) * this._verticalGap) / this._rowCount));
  14054. 0 < m && (this.columnAlign == c.ColumnAlign.JUSTIFY_USING_GAP ? (g = Math.max(1, this._columnCount - 1), this._horizontalGap = m / g) : this.columnAlign == c.ColumnAlign.JUSTIFY_USING_WIDTH && 0 < this._columnCount && (this._columnWidth += (m - (this._columnCount - 1) * this._horizontalGap) / this._columnCount))
  14055. };
  14056. return a
  14057. } (c.LayoutBase);
  14058. c.TileLayout = e;
  14059. e.prototype.__class__ = "egret.TileLayout"
  14060. })(egret || (egret = {})); (function(c) {
  14061. var e = function() {
  14062. function c(a, b, d) {
  14063. this.raw_getElementAt = "raw_getElementAt";
  14064. this.raw_addElementAt = "raw_addElementAt";
  14065. this.raw_getElementIndex = "raw_getElementIndex";
  14066. this.raw_removeElement = "raw_removeElement";
  14067. this.raw_removeElementAt = "raw_removeElementAt";
  14068. this.raw_setElementIndex = "raw_setElementIndex";
  14069. this.owner = a;
  14070. this.lowerBoundReference = b;
  14071. this.upperBoundReference = d
  14072. }
  14073. Object.defineProperty(c.prototype, "numElements", {
  14074. get: function() {
  14075. return this.owner[this.upperBoundReference] - this.owner[this.lowerBoundReference]
  14076. },
  14077. enumerable: !0,
  14078. configurable: !0
  14079. });
  14080. c.prototype.getElementAt = function(a) {
  14081. return this.owner[this.raw_getElementAt](this.owner[this.lowerBoundReference] + a)
  14082. };
  14083. c.prototype.addElement = function(a) {
  14084. var b = this.owner[this.upperBoundReference];
  14085. a.parent === this.owner && b--;
  14086. this.owner[this.upperBoundReference]++;
  14087. this.owner[this.raw_addElementAt](a, b);
  14088. a.ownerChanged(this);
  14089. return a
  14090. };
  14091. c.prototype.addElementAt = function(a, b) {
  14092. this.owner[this.upperBoundReference]++;
  14093. this.owner[this.raw_addElementAt](a, this.owner[this.lowerBoundReference] + b);
  14094. a.ownerChanged(this);
  14095. return a
  14096. };
  14097. c.prototype.removeElement = function(a) {
  14098. var b = this.owner[this.raw_getElementIndex](a);
  14099. this.owner[this.lowerBoundReference] <= b && b < this.owner[this.upperBoundReference] && (this.owner[this.raw_removeElement](a), this.owner[this.upperBoundReference]--);
  14100. a.ownerChanged(null);
  14101. return a
  14102. };
  14103. c.prototype.removeElementAt = function(a) {
  14104. a += this.owner[this.lowerBoundReference];
  14105. var b;
  14106. this.owner[this.lowerBoundReference] <= a && a < this.owner[this.upperBoundReference] && (b = this.owner[this.raw_removeElementAt](a), this.owner[this.upperBoundReference]--);
  14107. b.ownerChanged(null);
  14108. return b
  14109. };
  14110. c.prototype.getElementIndex = function(a) {
  14111. a = this.owner[this.raw_getElementIndex](a);
  14112. return a -= this.owner[this.lowerBoundReference]
  14113. };
  14114. c.prototype.setElementIndex = function(a, b) {
  14115. this.owner[this.raw_setElementIndex](a, this.owner[this.lowerBoundReference] + b)
  14116. };
  14117. return c
  14118. } ();
  14119. c.UILayer = e;
  14120. e.prototype.__class__ = "egret.UILayer"
  14121. })(egret || (egret = {}));
  14122. __extends = this.__extends ||
  14123. function(c, e) {
  14124. function d() {
  14125. this.constructor = c
  14126. }
  14127. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  14128. d.prototype = e.prototype;
  14129. c.prototype = new d
  14130. }; (function(c) {
  14131. var e = function(d) {
  14132. function a() {
  14133. d.call(this);
  14134. this._autoResize = !0;
  14135. this._cursorIndex = this._toolTipIndex = this._topMostIndex = this._noTopMostIndex = 0;
  14136. this.addEventListener(c.Event.ADDED_TO_STAGE, this.onAddToStage, this);
  14137. this.addEventListener(c.Event.REMOVED_FROM_STAGE, this.onRemoveFromStage, this)
  14138. }
  14139. __extends(a, d);
  14140. a.prototype.onAddToStage = function(a) {
  14141. if (c.UIGlobals._uiStage) throw Error("UIStage\u662fGUI\u6839\u5bb9\u5668\uff0c\u53ea\u80fd\u6709\u4e00\u4e2a\u6b64\u5b9e\u4f8b\u5728\u663e\u793a\u5217\u8868\u4e2d\uff01");
  14142. c.UIGlobals._uiStage = this;
  14143. this._autoResize && (this.stage.addEventListener(c.Event.RESIZE, this.onResize, this), this.onResize())
  14144. };
  14145. a.prototype.onRemoveFromStage = function(a) {
  14146. c.UIGlobals._uiStage = null;
  14147. this._autoResize && this.stage.removeEventListener(c.Event.RESIZE, this.onResize, this)
  14148. };
  14149. a.prototype.onResize = function(a) {
  14150. this._setWidth(this.stage.stageWidth);
  14151. this._setHeight(this.stage.stageHeight)
  14152. };
  14153. Object.defineProperty(a.prototype, "autoResize", {
  14154. get: function() {
  14155. return this._autoResize
  14156. },
  14157. set: function(a) {
  14158. this._autoResize != a && (this._autoResize = a, this.stage && (this._autoResize ? (this.stage.addEventListener(c.Event.RESIZE, this.onResize, this), this.onResize()) : this.stage.removeEventListener(c.Event.RESIZE, this.onResize, this)))
  14159. },
  14160. enumerable: !0,
  14161. configurable: !0
  14162. });
  14163. Object.defineProperty(a.prototype, "x", {
  14164. get: function() {
  14165. return this._x
  14166. },
  14167. set: function(a) {
  14168. this._autoResize || (this._x = a)
  14169. },
  14170. enumerable: !0,
  14171. configurable: !0
  14172. });
  14173. Object.defineProperty(a.prototype, "y", {
  14174. get: function() {
  14175. return this._y
  14176. },
  14177. set: function(a) {
  14178. this._autoResize || (this._y = a)
  14179. },
  14180. enumerable: !0,
  14181. configurable: !0
  14182. });
  14183. Object.defineProperty(a.prototype, "width", {
  14184. get: function() {
  14185. return this._width
  14186. },
  14187. set: function(a) {
  14188. this._autoResize || this._setWidth(a)
  14189. },
  14190. enumerable: !0,
  14191. configurable: !0
  14192. });
  14193. Object.defineProperty(a.prototype, "height", {
  14194. get: function() {
  14195. return this._height
  14196. },
  14197. set: function(a) {
  14198. this._autoResize || this._setHeight(a)
  14199. },
  14200. enumerable: !0,
  14201. configurable: !0
  14202. });
  14203. Object.defineProperty(a.prototype, "scaleX", {
  14204. get: function() {
  14205. return this._scaleX
  14206. },
  14207. set: function(a) {
  14208. this._autoResize || this._setScaleX(a)
  14209. },
  14210. enumerable: !0,
  14211. configurable: !0
  14212. });
  14213. Object.defineProperty(a.prototype, "scaleY", {
  14214. get: function() {
  14215. return this._scaleY
  14216. },
  14217. set: function(a) {
  14218. this._autoResize || this._setScaleY(a)
  14219. },
  14220. enumerable: !0,
  14221. configurable: !0
  14222. });
  14223. a.prototype.setActualSize = function(a, c) {
  14224. this._autoResize || d.prototype.setActualSize.call(this, a, c)
  14225. };
  14226. a.prototype.setLayoutBoundsPosition = function(a, c) {
  14227. this._autoResize || d.prototype.setLayoutBoundsPosition.call(this, a, c)
  14228. };
  14229. a.prototype.setLayoutBoundsSize = function(a, c) {
  14230. this._autoResize || d.prototype.setLayoutBoundsSize.call(this, a, c)
  14231. };
  14232. Object.defineProperty(a.prototype, "layout", {
  14233. get: function() {
  14234. return this._layout
  14235. },
  14236. set: function(a) {
  14237. a instanceof c.BasicLayout && this._setLayout(a)
  14238. },
  14239. enumerable: !0,
  14240. configurable: !0
  14241. });
  14242. Object.defineProperty(a.prototype, "popUpContainer", {
  14243. get: function() {
  14244. this._popUpContainer || (this._popUpContainer = new c.UILayer(this, "noTopMostIndex", "topMostIndex"));
  14245. return this._popUpContainer
  14246. },
  14247. enumerable: !0,
  14248. configurable: !0
  14249. });
  14250. Object.defineProperty(a.prototype, "toolTipContainer", {
  14251. get: function() {
  14252. this._toolTipContainer || (this._toolTipContainer = new c.UILayer(this, "topMostIndex", "toolTipIndex"));
  14253. return this._toolTipContainer
  14254. },
  14255. enumerable: !0,
  14256. configurable: !0
  14257. });
  14258. Object.defineProperty(a.prototype, "cursorContainer", {
  14259. get: function() {
  14260. this._cursorContainer || (this._cursorContainer = new c.UILayer(this, "toolTipIndex", "cursorIndex"));
  14261. return this._cursorContainer
  14262. },
  14263. enumerable: !0,
  14264. configurable: !0
  14265. });
  14266. Object.defineProperty(a.prototype, "noTopMostIndex", {
  14267. get: function() {
  14268. return this._noTopMostIndex
  14269. },
  14270. set: function(a) {
  14271. var c = a - this._noTopMostIndex;
  14272. this._noTopMostIndex = a;
  14273. this.topMostIndex += c
  14274. },
  14275. enumerable: !0,
  14276. configurable: !0
  14277. });
  14278. Object.defineProperty(a.prototype, "topMostIndex", {
  14279. get: function() {
  14280. return this._topMostIndex
  14281. },
  14282. set: function(a) {
  14283. var c = a - this._topMostIndex;
  14284. this._topMostIndex = a;
  14285. this.toolTipIndex += c
  14286. },
  14287. enumerable: !0,
  14288. configurable: !0
  14289. });
  14290. Object.defineProperty(a.prototype, "toolTipIndex", {
  14291. get: function() {
  14292. return this._toolTipIndex
  14293. },
  14294. set: function(a) {
  14295. var c = a - this._toolTipIndex;
  14296. this._toolTipIndex = a;
  14297. this.cursorIndex += c
  14298. },
  14299. enumerable: !0,
  14300. configurable: !0
  14301. });
  14302. Object.defineProperty(a.prototype, "cursorIndex", {
  14303. get: function() {
  14304. return this._cursorIndex
  14305. },
  14306. set: function(a) {
  14307. this._cursorIndex = a
  14308. },
  14309. enumerable: !0,
  14310. configurable: !0
  14311. });
  14312. a.prototype.addElement = function(a) {
  14313. var c = this._noTopMostIndex;
  14314. a.parent == this && c--;
  14315. return this.addElementAt(a, c)
  14316. };
  14317. a.prototype.addElementAt = function(a, c) {
  14318. if (a.parent == this) {
  14319. var e = this.getElementIndex(a);
  14320. e < this._noTopMostIndex ? this.noTopMostIndex--:e >= this._noTopMostIndex && e < this._topMostIndex ? this.topMostIndex--:e >= this._topMostIndex && e < this._toolTipIndex ? this.toolTipIndex--:this.cursorIndex--
  14321. }
  14322. c <= this._noTopMostIndex ? this.noTopMostIndex++:c > this._noTopMostIndex && c <= this._topMostIndex ? this.topMostIndex++:c > this._topMostIndex && c <= this._toolTipIndex ? this.toolTipIndex++:this.cursorIndex++;
  14323. return d.prototype.addElementAt.call(this, a, c)
  14324. };
  14325. a.prototype.removeElement = function(a) {
  14326. return this.removeElementAt(d.prototype.getElementIndex.call(this, a))
  14327. };
  14328. a.prototype.removeElementAt = function(a) {
  14329. var c = d.prototype.removeElementAt.call(this, a);
  14330. a < this._noTopMostIndex ? this.noTopMostIndex--:a >= this._noTopMostIndex && a < this._topMostIndex ? this.topMostIndex--:a >= this._topMostIndex && a < this._toolTipIndex ? this.toolTipIndex--:this.cursorIndex--;
  14331. return c
  14332. };
  14333. a.prototype.removeAllElements = function() {
  14334. for (; 0 < this._noTopMostIndex;) d.prototype.removeElementAt.call(this, 0),
  14335. this.noTopMostIndex--
  14336. };
  14337. a.prototype._elementRemoved = function(a, e, f) {
  14338. "undefined" === typeof f && (f = !0);
  14339. f && c.Event.dispatchEvent(a, "removeFromUIStage");
  14340. d.prototype._elementRemoved.call(this, a, e, f)
  14341. };
  14342. a.prototype.raw_getElementAt = function(a) {
  14343. return d.prototype.getElementAt.call(this, a)
  14344. };
  14345. a.prototype.raw_addElement = function(a) {
  14346. var c = this.numElements;
  14347. a.parent == this && c--;
  14348. return this.raw_addElementAt(a, c)
  14349. };
  14350. a.prototype.raw_addElementAt = function(a, c) {
  14351. if (a.parent == this) {
  14352. var e = this.getElementIndex(a);
  14353. e < this._noTopMostIndex ? this.noTopMostIndex--:e >= this._noTopMostIndex && e < this._topMostIndex ? this.topMostIndex--:e >= this._topMostIndex && e < this._toolTipIndex ? this.toolTipIndex--:this.cursorIndex--
  14354. }
  14355. return d.prototype.addElementAt.call(this, a, c)
  14356. };
  14357. a.prototype.raw_removeElement = function(a) {
  14358. return d.prototype.removeElementAt.call(this, d.prototype.getElementIndex.call(this, a))
  14359. };
  14360. a.prototype.raw_removeElementAt = function(a) {
  14361. return d.prototype.removeElementAt.call(this, a)
  14362. };
  14363. a.prototype.raw_removeAllElements = function() {
  14364. for (; 0 < this.numElements;) d.prototype.removeElementAt.call(this, 0)
  14365. };
  14366. a.prototype.raw_getElementIndex = function(a) {
  14367. return d.prototype.getElementIndex.call(this, a)
  14368. };
  14369. a.prototype.raw_setElementIndex = function(a, c) {
  14370. d.prototype.setElementIndex.call(this, a, c)
  14371. };
  14372. a.prototype.raw_swapElements = function(a, c) {
  14373. d.prototype.swapElementsAt.call(this, d.prototype.getElementIndex.call(this, a), d.prototype.getElementIndex.call(this, c))
  14374. };
  14375. a.prototype.raw_swapElementsAt = function(a, c) {
  14376. d.prototype.swapElementsAt.call(this, a, c)
  14377. };
  14378. return a
  14379. } (c.Group);
  14380. c.UIStage = e;
  14381. e.prototype.__class__ = "egret.UIStage"
  14382. })(egret || (egret = {}));
  14383. __extends = this.__extends ||
  14384. function(c, e) {
  14385. function d() {
  14386. this.constructor = c
  14387. }
  14388. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  14389. d.prototype = e.prototype;
  14390. c.prototype = new d
  14391. }; (function(c) {
  14392. var e = function(a) {
  14393. function b() {
  14394. a.call(this);
  14395. this._popUpList = [];
  14396. this.popUpDataList = [];
  14397. this._modalColor = 0;
  14398. this._modalAlpha = 0.5;
  14399. this.invalidateModalFlag = !1
  14400. }
  14401. __extends(b, a);
  14402. Object.defineProperty(b.prototype, "popUpList", {
  14403. get: function() {
  14404. return this._popUpList.concat()
  14405. },
  14406. enumerable: !0,
  14407. configurable: !0
  14408. });
  14409. b.prototype.findPopUpData = function(a) {
  14410. for (var b = this.popUpDataList,
  14411. c = b.length,
  14412. d = 0; d < c; d++) {
  14413. var e = b[d];
  14414. if (e.popUp == a) return e
  14415. }
  14416. return null
  14417. };
  14418. b.prototype.addPopUp = function(a, e, m) {
  14419. "undefined" === typeof e && (e = !1);
  14420. "undefined" === typeof m && (m = !0);
  14421. var g = c.UIGlobals.uiStage,
  14422. h = this.findPopUpData(a);
  14423. h ? (h.modal = e, a.removeEventListener(b.REMOVE_FROM_UISTAGE, this.onRemoved, this)) : (h = new d(a, e), this.popUpDataList.push(h), this._popUpList.push(a));
  14424. g.popUpContainer.addElement(a);
  14425. m && this.centerPopUp(a);
  14426. "isPopUp" in a && (a.isPopUp = !0);
  14427. e && this.invalidateModal();
  14428. a.addEventListener(b.REMOVE_FROM_UISTAGE, this.onRemoved, this)
  14429. };
  14430. b.prototype.onRemoved = function(a) {
  14431. for (var c = 0,
  14432. d = this.popUpDataList,
  14433. e = d.length,
  14434. h = 0; h < e; h++) {
  14435. var l = d[h];
  14436. if (l.popUp == a.target) {
  14437. "isPopUp" in l.popUp && (l.popUp.isPopUp = !1);
  14438. l.popUp.removeEventListener(b.REMOVE_FROM_UISTAGE, this.onRemoved, this);
  14439. this.popUpDataList.splice(c, 1);
  14440. this._popUpList.splice(c, 1);
  14441. this.invalidateModal();
  14442. break
  14443. }
  14444. c++
  14445. }
  14446. };
  14447. Object.defineProperty(b.prototype, "modalColor", {
  14448. get: function() {
  14449. return this._modalColor
  14450. },
  14451. set: function(a) {
  14452. this._modalColor != a && (this._modalColor = a, this.invalidateModal())
  14453. },
  14454. enumerable: !0,
  14455. configurable: !0
  14456. });
  14457. Object.defineProperty(b.prototype, "modalAlpha", {
  14458. get: function() {
  14459. return this._modalAlpha
  14460. },
  14461. set: function(a) {
  14462. this._modalAlpha != a && (this._modalAlpha = a, this.invalidateModal())
  14463. },
  14464. enumerable: !0,
  14465. configurable: !0
  14466. });
  14467. b.prototype.invalidateModal = function() {
  14468. this.invalidateModalFlag || (this.invalidateModalFlag = !0, c.UIGlobals.stage.addEventListener(c.Event.ENTER_FRAME, this.validateModal, this), c.UIGlobals.stage.addEventListener(c.Event.RENDER, this.validateModal, this), c.UIGlobals.stage.invalidate())
  14469. };
  14470. b.prototype.validateModal = function(a) {
  14471. this.invalidateModalFlag = !1;
  14472. c.UIGlobals.stage.removeEventListener(c.Event.ENTER_FRAME, this.validateModal, this);
  14473. c.UIGlobals.stage.removeEventListener(c.Event.RENDER, this.validateModal, this);
  14474. this.updateModal(c.UIGlobals.uiStage)
  14475. };
  14476. b.prototype.updateModal = function(a) {
  14477. for (var b = a.popUpContainer,
  14478. d = !1,
  14479. e = b.numElements - 1; 0 <= e; e--) {
  14480. var h = b.getElementAt(e);
  14481. if ((h = this.findPopUpData(h)) && h.modal) {
  14482. d = !0;
  14483. break
  14484. }
  14485. }
  14486. d ? (this.modalMask || (this.modalMask = new c.Rect, this.modalMask.touchEnabled = !0, this.modalMask.top = this.modalMask.left = this.modalMask.right = this.modalMask.bottom = 0), this.modalMask.fillColor = this._modalColor, this.modalMask.alpha = this._modalAlpha, this.modalMask.parent == a ? (b.getElementIndex(this.modalMask) < e && e--, b.setElementIndex(this.modalMask, e)) : b.addElementAt(this.modalMask, e)) : this.modalMask && this.modalMask.parent == a && b.removeElement(this.modalMask)
  14487. };
  14488. b.prototype.removePopUp = function(a) {
  14489. a && a.parent && this.findPopUpData(a) && ("removeElement" in a.parent ? a.parent.removeElement(a) : a.parent instanceof c.UIComponent ? a.parent._removeFromDisplayList(a) : a instanceof c.DisplayObject && a.parent.removeChild(a))
  14490. };
  14491. b.prototype.centerPopUp = function(a) {
  14492. a.top = a.bottom = a.left = a.right = NaN;
  14493. a.verticalCenter = a.horizontalCenter = 0;
  14494. var b = a.parent;
  14495. b && ("validateNow" in a && a.validateNow(), a.x = 0.5 * (b.width - a.layoutBoundsWidth), a.y = 0.5 * (b.height - a.layoutBoundsHeight))
  14496. };
  14497. b.prototype.bringToFront = function(a) {
  14498. if (this.findPopUpData(a) && a.parent && "popUpContainer" in a.parent) {
  14499. var b = a.parent;
  14500. b.popUpContainer.setElementIndex(a, b.popUpContainer.numElements - 1);
  14501. this.invalidateModal()
  14502. }
  14503. };
  14504. b.REMOVE_FROM_UISTAGE = "removeFromUIStage";
  14505. return b
  14506. } (c.EventDispatcher);
  14507. c.PopUpManagerImpl = e;
  14508. e.prototype.__class__ = "egret.PopUpManagerImpl";
  14509. var d = function() {
  14510. return function(a, b) {
  14511. this.popUp = a;
  14512. this.modal = b
  14513. }
  14514. } ();
  14515. d.prototype.__class__ = "PopUpData"
  14516. })(egret || (egret = {})); (function(c) {
  14517. var e = function() {
  14518. function d() {}
  14519. d.getImpl = function() {
  14520. if (!d._impl) try {
  14521. d._impl = c.Injector.getInstance("egret.IPopUpManager")
  14522. } catch(a) {
  14523. d._impl = new c.PopUpManagerImpl
  14524. }
  14525. return d._impl
  14526. };
  14527. Object.defineProperty(d.prototype, "modalColor", {
  14528. get: function() {
  14529. return d.getImpl().modalColor
  14530. },
  14531. set: function(a) {
  14532. d.getImpl().modalColor = a
  14533. },
  14534. enumerable: !0,
  14535. configurable: !0
  14536. });
  14537. Object.defineProperty(d.prototype, "modalAlpha", {
  14538. get: function() {
  14539. return d.getImpl().modalAlpha
  14540. },
  14541. set: function(a) {
  14542. d.getImpl().modalAlpha = a
  14543. },
  14544. enumerable: !0,
  14545. configurable: !0
  14546. });
  14547. d.addPopUp = function(a, b, e) {
  14548. "undefined" === typeof b && (b = !1);
  14549. "undefined" === typeof e && (e = !0);
  14550. d.getImpl().addPopUp(a, b, e);
  14551. c.PopUpEvent.dispatchPopUpEvent(d.getImpl(), c.PopUpEvent.ADD_POPUP, a, b)
  14552. };
  14553. d.removePopUp = function(a) {
  14554. d.getImpl().removePopUp(a);
  14555. c.PopUpEvent.dispatchPopUpEvent(d.getImpl(), c.PopUpEvent.REMOVE_POPUP, a)
  14556. };
  14557. d.centerPopUp = function(a) {
  14558. d.getImpl().centerPopUp(a)
  14559. };
  14560. d.bringToFront = function(a) {
  14561. d.getImpl().bringToFront(a);
  14562. c.PopUpEvent.dispatchPopUpEvent(d.getImpl(), c.PopUpEvent.BRING_TO_FRONT, a)
  14563. };
  14564. Object.defineProperty(d, "popUpList", {
  14565. get: function() {
  14566. return d.getImpl().popUpList
  14567. },
  14568. enumerable: !0,
  14569. configurable: !0
  14570. });
  14571. d.addEventListener = function(a, b, c, e, m) {
  14572. "undefined" === typeof e && (e = !1);
  14573. "undefined" === typeof m && (m = 0);
  14574. d.getImpl().addEventListener(a, b, this, e, m)
  14575. };
  14576. d.removeEventListener = function(a, b, c, e) {
  14577. "undefined" === typeof e && (e = !1);
  14578. d.getImpl().removeEventListener(a, b, c, e)
  14579. };
  14580. return d
  14581. } ();
  14582. c.PopUpManager = e;
  14583. e.prototype.__class__ = "egret.PopUpManager"
  14584. })(egret || (egret = {}));
  14585. var __extends = this.__extends ||
  14586. function(c, e) {
  14587. function d() {
  14588. this.constructor = c
  14589. }
  14590. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  14591. d.prototype = e.prototype;
  14592. c.prototype = new d
  14593. },
  14594. dragonBones; (function(c) { (function(a) {
  14595. var b = function() {
  14596. function a(b, c) {
  14597. "undefined" === typeof b && (b = 0);
  14598. "undefined" === typeof c && (c = 0);
  14599. this.x = b;
  14600. this.y = c
  14601. }
  14602. a.prototype.toString = function() {
  14603. return "[Point (x=" + this.x + " y=" + this.y + ")]"
  14604. };
  14605. return a
  14606. } ();
  14607. a.Point = b;
  14608. b.prototype.__class__ = "dragonBones.geom.Point";
  14609. b = function() {
  14610. return function(a, b, c, d) {
  14611. "undefined" === typeof a && (a = 0);
  14612. "undefined" === typeof b && (b = 0);
  14613. "undefined" === typeof c && (c = 0);
  14614. "undefined" === typeof d && (d = 0);
  14615. this.x = a;
  14616. this.y = b;
  14617. this.width = c;
  14618. this.height = d
  14619. }
  14620. } ();
  14621. a.Rectangle = b;
  14622. b.prototype.__class__ = "dragonBones.geom.Rectangle";
  14623. b = function() {
  14624. function a() {
  14625. this.a = 1;
  14626. this.c = this.b = 0;
  14627. this.d = 1;
  14628. this.ty = this.tx = 0
  14629. }
  14630. a.prototype.invert = function() {
  14631. var a = this.a,
  14632. b = this.b,
  14633. c = this.c,
  14634. d = this.d,
  14635. e = this.tx,
  14636. k = a * d - b * c;
  14637. this.a = d / k;
  14638. this.b = -b / k;
  14639. this.c = -c / k;
  14640. this.d = a / k;
  14641. this.tx = (c * this.ty - d * e) / k;
  14642. this.ty = -(a * this.ty - b * e) / k
  14643. };
  14644. return a
  14645. } ();
  14646. a.Matrix = b;
  14647. b.prototype.__class__ = "dragonBones.geom.Matrix";
  14648. b = function() {
  14649. return function() {
  14650. this.redOffset = this.redMultiplier = this.greenOffset = this.greenMultiplier = this.blueOffset = this.blueMultiplier = this.alphaOffset = this.alphaMultiplier = 0
  14651. }
  14652. } ();
  14653. a.ColorTransform = b;
  14654. b.prototype.__class__ = "dragonBones.geom.ColorTransform"
  14655. })(c.geom || (c.geom = {}));
  14656. var e = c.geom; (function(a) {
  14657. var b = function() {
  14658. return function(a) {
  14659. this.type = a
  14660. }
  14661. } ();
  14662. a.Event = b;
  14663. b.prototype.__class__ = "dragonBones.events.Event";
  14664. var c = function(a) {
  14665. function b(c) {
  14666. a.call(this, c)
  14667. }
  14668. __extends(b, a);
  14669. b.FADE_IN = "fadeIn";
  14670. b.FADE_OUT = "fadeOut";
  14671. b.START = "start";
  14672. b.COMPLETE = "complete";
  14673. b.LOOP_COMPLETE = "loopComplete";
  14674. b.FADE_IN_COMPLETE = "fadeInComplete";
  14675. b.FADE_OUT_COMPLETE = "fadeOutComplete";
  14676. return b
  14677. } (b);
  14678. a.AnimationEvent = c;
  14679. c.prototype.__class__ = "dragonBones.events.AnimationEvent";
  14680. c = function(a) {
  14681. function b(c) {
  14682. a.call(this, c)
  14683. }
  14684. __extends(b, a);
  14685. b.Z_ORDER_UPDATED = "zOrderUpdated";
  14686. return b
  14687. } (b);
  14688. a.ArmatureEvent = c;
  14689. c.prototype.__class__ = "dragonBones.events.ArmatureEvent";
  14690. c = function(a) {
  14691. function b(c) {
  14692. a.call(this, c)
  14693. }
  14694. __extends(b, a);
  14695. b.ANIMATION_FRAME_EVENT = "animationFrameEvent";
  14696. b.BONE_FRAME_EVENT = "boneFrameEvent";
  14697. return b
  14698. } (b);
  14699. a.FrameEvent = c;
  14700. c.prototype.__class__ = "dragonBones.events.FrameEvent";
  14701. b = function(a) {
  14702. function b(c) {
  14703. a.call(this, c)
  14704. }
  14705. __extends(b, a);
  14706. b.SOUND = "sound";
  14707. b.BONE_FRAME_EVENT = "boneFrameEvent";
  14708. return b
  14709. } (b);
  14710. a.SoundEvent = b;
  14711. b.prototype.__class__ = "dragonBones.events.SoundEvent";
  14712. b = function() {
  14713. function a() {}
  14714. a.prototype.hasEventListener = function(a) {
  14715. return this._listenersMap && this._listenersMap[a] ? !0 : !1
  14716. };
  14717. a.prototype.addEventListener = function(a, b) {
  14718. if (a && b) {
  14719. this._listenersMap || (this._listenersMap = {});
  14720. var c = this._listenersMap[a];
  14721. c && this.removeEventListener(a, b);
  14722. c ? c.push(b) : this._listenersMap[a] = [b]
  14723. }
  14724. };
  14725. a.prototype.removeEventListener = function(a, b) {
  14726. if (this._listenersMap && a && b) {
  14727. var c = this._listenersMap[a];
  14728. if (c) for (var d = c.length,
  14729. e = 0; e < d; e++) c[e] == b && (1 == d ? (c.length = 0, delete this._listenersMap[a]) : c.splice(e, 1))
  14730. }
  14731. };
  14732. a.prototype.removeAllEventListeners = function(a) {
  14733. a ? delete this._listenersMap[a] : this._listenersMap = null
  14734. };
  14735. a.prototype.dispatchEvent = function(a) {
  14736. if (a) {
  14737. var b = this._listenersMap[a.type];
  14738. if (b) {
  14739. a.target = this;
  14740. for (var c = b.concat(), b = b.length, d = 0; d < b; d++) c[d](a)
  14741. }
  14742. }
  14743. };
  14744. return a
  14745. } ();
  14746. a.EventDispatcher = b;
  14747. b.prototype.__class__ = "dragonBones.events.EventDispatcher";
  14748. b = function(a) {
  14749. function b() {
  14750. a.call(this);
  14751. if (b._instance) throw Error("Singleton already constructed!");
  14752. }
  14753. __extends(b, a);
  14754. b.getInstance = function() {
  14755. b._instance || (b._instance = new b);
  14756. return b._instance
  14757. };
  14758. return b
  14759. } (b);
  14760. a.SoundEventManager = b;
  14761. b.prototype.__class__ = "dragonBones.events.SoundEventManager"
  14762. })(c.events || (c.events = {}));
  14763. var d = c.events; (function(a) {
  14764. var c = function() {
  14765. function a() {
  14766. this.timeScale = 1;
  14767. this.time = 0.001 * (new Date).getTime();
  14768. this._animatableList = []
  14769. }
  14770. a.prototype.contains = function(a) {
  14771. return 0 <= this._animatableList.indexOf(a)
  14772. };
  14773. a.prototype.add = function(a) {
  14774. a && -1 == this._animatableList.indexOf(a) && this._animatableList.push(a)
  14775. };
  14776. a.prototype.remove = function(a) {
  14777. a = this._animatableList.indexOf(a);
  14778. 0 <= a && (this._animatableList[a] = null)
  14779. };
  14780. a.prototype.clear = function() {
  14781. this._animatableList.length = 0
  14782. };
  14783. a.prototype.advanceTime = function(a) {
  14784. if (0 > a) {
  14785. var b = 0.001 * (new Date).getTime();
  14786. a = b - this.time;
  14787. this.time = b
  14788. }
  14789. a *= this.timeScale;
  14790. b = this._animatableList.length;
  14791. if (0 != b) {
  14792. for (var c = 0,
  14793. d = 0; d < b; d++) {
  14794. var e = this._animatableList[d];
  14795. e && (c != d && (this._animatableList[c] = e, this._animatableList[d] = null), e.advanceTime(a), c++)
  14796. }
  14797. if (c != d) {
  14798. for (b = this._animatableList.length; d < b;) this._animatableList[c++] = this._animatableList[d++];
  14799. this._animatableList.length = c
  14800. }
  14801. }
  14802. };
  14803. a.clock = new a;
  14804. return a
  14805. } ();
  14806. a.WorldClock = c;
  14807. c.prototype.__class__ = "dragonBones.animation.WorldClock";
  14808. var f = function() {
  14809. function a() {
  14810. this.transform = new b.DBTransform;
  14811. this.pivot = new e.Point;
  14812. this._durationTransform = new b.DBTransform;
  14813. this._durationPivot = new e.Point;
  14814. this._durationColor = new e.ColorTransform
  14815. }
  14816. a._borrowObject = function() {
  14817. return 0 == a._pool.length ? new a: a._pool.pop()
  14818. };
  14819. a._returnObject = function(b) {
  14820. 0 > a._pool.indexOf(b) && (a._pool[a._pool.length] = b);
  14821. b.clear()
  14822. };
  14823. a._clear = function() {
  14824. for (var b = a._pool.length; b--;) a._pool[b].clear();
  14825. a._pool.length = 0
  14826. };
  14827. a.getEaseValue = function(b, c) {
  14828. if (1 < c) {
  14829. var d = 0.5 * (1 - Math.cos(b * Math.PI)) - b;
  14830. c -= 1
  14831. } else 0 < c ? d = Math.sin(b * a.HALF_PI) - b: 0 > c && (d = 1 - Math.cos(b * a.HALF_PI) - b, c *= -1);
  14832. return d * c + b
  14833. };
  14834. a.prototype.fadeIn = function(a, b, c) {
  14835. this._bone = a;
  14836. this._animationState = b;
  14837. this._timeline = c;
  14838. this._originTransform = this._timeline.originTransform;
  14839. this._originPivot = this._timeline.originPivot;
  14840. this._tweenColor = this._tweenTransform = !1;
  14841. this._totalTime = this._animationState.totalTime;
  14842. this.transform.x = 0;
  14843. this.transform.y = 0;
  14844. this.transform.scaleX = 0;
  14845. this.transform.scaleY = 0;
  14846. this.transform.skewX = 0;
  14847. this.transform.skewY = 0;
  14848. this.pivot.x = 0;
  14849. this.pivot.y = 0;
  14850. this._durationTransform.x = 0;
  14851. this._durationTransform.y = 0;
  14852. this._durationTransform.scaleX = 0;
  14853. this._durationTransform.scaleY = 0;
  14854. this._durationTransform.skewX = 0;
  14855. this._durationTransform.skewY = 0;
  14856. this._durationPivot.x = 0;
  14857. this._durationPivot.y = 0;
  14858. this._currentFrame = null;
  14859. switch (this._timeline.getFrameList().length) {
  14860. case 0:
  14861. this._bone._arriveAtFrame(null, this, this._animationState, !1);
  14862. this._updateState = 0;
  14863. break;
  14864. case 1:
  14865. this._updateState = -1;
  14866. break;
  14867. default:
  14868. this._updateState = 1
  14869. }
  14870. };
  14871. a.prototype.fadeOut = function() {
  14872. this.transform.skewX = k.TransformUtil.formatRadian(this.transform.skewX);
  14873. this.transform.skewY = k.TransformUtil.formatRadian(this.transform.skewY)
  14874. };
  14875. a.prototype.update = function(b) {
  14876. if (this._updateState) if (0 < this._updateState) {
  14877. b = 0 == this._timeline.scale ? 1 : b / this._timeline.scale;
  14878. 1 == b && (b = 0.99999999);
  14879. b += this._timeline.offset;
  14880. var c = Math.floor(b);
  14881. b -= c;
  14882. for (var d = this._totalTime * b,
  14883. e = !1,
  14884. f; ! this._currentFrame || d > this._currentFramePosition + this._currentFrameDuration || d < this._currentFramePosition;) e && this._bone._arriveAtFrame(this._currentFrame, this, this._animationState, !0),
  14885. e = !0,
  14886. this._currentFrame ? (f = this._timeline.getFrameList().indexOf(this._currentFrame) + 1, f >= this._timeline.getFrameList().length && (f = 0), this._currentFrame = this._timeline.getFrameList()[f]) : (f = 0, this._currentFrame = this._timeline.getFrameList()[0]),
  14887. this._currentFrameDuration = this._currentFrame.duration,
  14888. this._currentFramePosition = this._currentFrame.position;
  14889. e && (this.tweenActive = 0 <= this._currentFrame.displayIndex, f++, f >= this._timeline.getFrameList().length && (f = 0), e = this._timeline.getFrameList()[f], 0 == f && this._animationState.loop && this._animationState.loopCount >= Math.abs(this._animationState.loop) - 1 && 0.99999999 < ((this._currentFramePosition + this._currentFrameDuration) / this._totalTime + c - this._timeline.offset) * 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 - 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 == f && (this._durationTransform.skewX = k.TransformUtil.formatRadian(this._durationTransform.skewX), this._durationTransform.skewY = k.TransformUtil.formatRadian(this._durationTransform.skewY)), 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, 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 - 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, 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 = 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 = 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, 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, 0, 0, 0, 1, 1, 1, 1, !1)), this._bone._arriveAtFrame(this._currentFrame, this, this._animationState, !1));
  14890. if (this._tweenTransform || this._tweenColor) b = (d - this._currentFramePosition) / this._currentFrameDuration,
  14891. this._tweenEasing && (b = a.getEaseValue(b, this._tweenEasing));
  14892. 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 * 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 = 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));
  14893. this._tweenColor && (this._currentFrame.color ? this._bone._updateColor(this._currentFrame.color.alphaOffset + 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 + 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))
  14894. } else this._updateState = 0,
  14895. this._animationState.blend ? (this.transform.copy(this._originTransform), this.pivot.x = this._originPivot.x, this.pivot.y = 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),
  14896. this._currentFrame = this._timeline.getFrameList()[0],
  14897. this.tweenActive = 0 <= this._currentFrame.displayIndex,
  14898. 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._updateColor(0, 0, 0, 0, 1, 1, 1, 1, !1),
  14899. this._bone._arriveAtFrame(this._currentFrame, this, this._animationState, !1)
  14900. };
  14901. a.prototype.clear = function() {
  14902. this._updateState = 0;
  14903. this._originPivot = this._originTransform = this._currentFrame = this._timeline = this._animationState = this._bone = null
  14904. };
  14905. a.HALF_PI = 0.5 * Math.PI;
  14906. a._pool = [];
  14907. return a
  14908. } ();
  14909. a.TimelineState = f;
  14910. f.prototype.__class__ = "dragonBones.animation.TimelineState";
  14911. var g = function() {
  14912. function a() {
  14913. this.layer = this.loop = 0;
  14914. this._timelineStates = {}
  14915. }
  14916. a._borrowObject = function() {
  14917. return 0 == a._pool.length ? new a: a._pool.pop()
  14918. };
  14919. a._returnObject = function(b) {
  14920. 0 > a._pool.indexOf(b) && (a._pool[a._pool.length] = b);
  14921. b.clear()
  14922. };
  14923. a._clear = function() {
  14924. for (var b = a._pool.length; b--;) a._pool[b].clear();
  14925. a._pool.length = 0
  14926. };
  14927. a.prototype.fadeIn = function(a, b, c, d, e, k, f, g) {
  14928. this.layer = k;
  14929. this.clip = b;
  14930. this.name = this.clip.name;
  14931. this.totalTime = this.clip.duration;
  14932. this._armature = a;
  14933. 2 > Math.round(this.clip.duration * this.clip.frameRate) || Infinity == d ? (this.timeScale = 1, this.currentTime = this.totalTime, this.loop = 0 <= this.loop ? 1 : -1) : (this.timeScale = d, this.currentTime = 0, this.loop = e);
  14934. this._pauseBeforeFadeInComplete = g;
  14935. this._fadeInTime = c * this.timeScale;
  14936. this._fadeState = 1;
  14937. this._fadeOutBeginTime = 0;
  14938. this._fadeOutWeight = -1;
  14939. this._fadeWeight = 0;
  14940. this._fadeIn = !0;
  14941. this._fadeOut = !1;
  14942. this.loopCount = -1;
  14943. this.displayControl = f;
  14944. this.isPlaying = !0;
  14945. this.isComplete = !1;
  14946. this.weight = 1;
  14947. this.tweenEnabled = this.enabled = this.blend = !0;
  14948. this.updateTimelineStates()
  14949. };
  14950. a.prototype.fadeOut = function(a, b) {
  14951. "undefined" === typeof b && (b = !1);
  14952. if (this._armature && !(0 <= this._fadeOutWeight)) {
  14953. this._fadeState = -1;
  14954. this._fadeOutWeight = this._fadeWeight;
  14955. this._fadeOutTime = a * this.timeScale;
  14956. this._fadeOutBeginTime = this.currentTime;
  14957. this._fadeOut = !0;
  14958. this.isPlaying = !b;
  14959. this.displayControl = !1;
  14960. for (var c in this._timelineStates) this._timelineStates[c].fadeOut();
  14961. this.enabled = !0
  14962. }
  14963. };
  14964. a.prototype.play = function() {
  14965. this.isPlaying = !0
  14966. };
  14967. a.prototype.stop = function() {
  14968. this.isPlaying = !1
  14969. };
  14970. a.prototype.getMixingTransform = function(a) {
  14971. return this._mixingTransforms ? Number(this._mixingTransforms[a]) : -1
  14972. };
  14973. a.prototype.addMixingTransform = function(a, b, c) {
  14974. "undefined" === typeof b && (b = 2);
  14975. "undefined" === typeof c && (c = !0);
  14976. if (this.clip && this.clip.getTimeline(a)) {
  14977. this._mixingTransforms || (this._mixingTransforms = {});
  14978. if (c) {
  14979. c = this._armature._boneList.length;
  14980. for (var d, e; c--;) d = this._armature._boneList[c],
  14981. d.name == a && (e = d),
  14982. e && (e == d || e.contains(d)) && (this._mixingTransforms[d.name] = b)
  14983. } else this._mixingTransforms[a] = b;
  14984. this.updateTimelineStates()
  14985. } else throw Error();
  14986. };
  14987. a.prototype.removeMixingTransform = function(a, b) {
  14988. "undefined" === typeof a && (a = null);
  14989. "undefined" === typeof b && (b = !0);
  14990. if (a) {
  14991. if (b) for (var c = this._armature._boneList.length,
  14992. d, e; c--;) d = this._armature._boneList[c],
  14993. d.name == a && (e = d),
  14994. e && (e == d || e.contains(d)) && delete this._mixingTransforms[d.name];
  14995. else delete this._mixingTransforms[a];
  14996. for (var k in this._mixingTransforms) {
  14997. var f = !0;
  14998. break
  14999. }
  15000. f || (this._mixingTransforms = null)
  15001. } else this._mixingTransforms = null;
  15002. this.updateTimelineStates()
  15003. };
  15004. a.prototype.advanceTime = function(a) {
  15005. if (!this.enabled) return ! 1;
  15006. var b, c;
  15007. this._fadeIn && (this._fadeIn = !1, this._armature.hasEventListener(d.AnimationEvent.FADE_IN) && (b = new d.AnimationEvent(d.AnimationEvent.FADE_IN), b.animationState = this, this._armature._eventList.push(b)));
  15008. this._fadeOut && (this._fadeOut = !1, this._armature.hasEventListener(d.AnimationEvent.FADE_OUT) && (b = new d.AnimationEvent(d.AnimationEvent.FADE_OUT), b.animationState = this, this._armature._eventList.push(b)));
  15009. this.currentTime += a * this.timeScale;
  15010. if (this.isPlaying && !this.isComplete) {
  15011. var e;
  15012. if (this._pauseBeforeFadeInComplete) this.isPlaying = this._pauseBeforeFadeInComplete = !1,
  15013. a = 0,
  15014. e = Math.floor(a);
  15015. else if (a = this.currentTime / this.totalTime, e = Math.floor(a), e != this.loopCount && ( - 1 == this.loopCount && this._armature.hasEventListener(d.AnimationEvent.START) && (b = new d.AnimationEvent(d.AnimationEvent.START), b.animationState = this, this._armature._eventList.push(b)), this.loopCount = e)) this.loop && this.loopCount * this.loopCount >= this.loop * this.loop - 1 ? (c = !0, a = 1, e = 0, this._armature.hasEventListener(d.AnimationEvent.COMPLETE) && (b = new d.AnimationEvent(d.AnimationEvent.COMPLETE), b.animationState = this, this._armature._eventList.push(b))) : this._armature.hasEventListener(d.AnimationEvent.LOOP_COMPLETE) && (b = new d.AnimationEvent(d.AnimationEvent.LOOP_COMPLETE), b.animationState = this, this._armature._eventList.push(b));
  15016. for (var k in this._timelineStates) this._timelineStates[k].update(a);
  15017. b = this.clip.getFrameList();
  15018. if (0 < b.length) {
  15019. a = this.totalTime * (a - e);
  15020. for (e = !1; ! this._currentFrame || a > this._currentFrame.position + this._currentFrame.duration || a < this._currentFrame.position;) e && this._armature._arriveAtFrame(this._currentFrame, null, this, !0),
  15021. e = !0,
  15022. this._currentFrame ? (k = b.indexOf(this._currentFrame), k++, k >= b.length && (k = 0), this._currentFrame = b[k]) : this._currentFrame = b[0];
  15023. e && this._armature._arriveAtFrame(this._currentFrame, null, this, !1)
  15024. }
  15025. }
  15026. if (0 < this._fadeState) 0 == this._fadeInTime ? (this._fadeWeight = 1, this._fadeState = 0, this.isPlaying = !0, this._armature.hasEventListener(d.AnimationEvent.FADE_IN_COMPLETE) && (b = new d.AnimationEvent(d.AnimationEvent.FADE_IN_COMPLETE), b.animationState = this, this._armature._eventList.push(b))) : (this._fadeWeight = 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(d.AnimationEvent.FADE_IN_COMPLETE) && (b = new d.AnimationEvent(d.AnimationEvent.FADE_IN_COMPLETE), b.animationState = this, this._armature._eventList.push(b))));
  15027. else if (0 > this._fadeState) {
  15028. if (0 == this._fadeOutTime) return this._fadeState = this._fadeWeight = 0,
  15029. this._armature.hasEventListener(d.AnimationEvent.FADE_OUT_COMPLETE) && (b = new d.AnimationEvent(d.AnimationEvent.FADE_OUT_COMPLETE), b.animationState = this, this._armature._eventList.push(b)),
  15030. !0;
  15031. this._fadeWeight = (1 - (this.currentTime - this._fadeOutBeginTime) / this._fadeOutTime) * this._fadeOutWeight;
  15032. if (0 >= this._fadeWeight) return this._fadeState = this._fadeWeight = 0,
  15033. this._armature.hasEventListener(d.AnimationEvent.FADE_OUT_COMPLETE) && (b = new d.AnimationEvent(d.AnimationEvent.FADE_OUT_COMPLETE), b.animationState = this, this._armature._eventList.push(b)),
  15034. !0
  15035. }
  15036. c && (this.isComplete = !0, 0 > this.loop && this.fadeOut((this._fadeOutWeight || this._fadeInTime) / this.timeScale, !0));
  15037. return ! 1
  15038. };
  15039. a.prototype.updateTimelineStates = function() {
  15040. if (this._mixingTransforms) {
  15041. for (var a in this._timelineStates) null == this._mixingTransforms[a] && this.removeTimelineState(a);
  15042. for (a in this._mixingTransforms) this._timelineStates[a] || this.addTimelineState(a)
  15043. } else for (a in this.clip.getTimelines()) this._timelineStates[a] || this.addTimelineState(a)
  15044. };
  15045. a.prototype.addTimelineState = function(a) {
  15046. var b = this._armature.getBone(a);
  15047. if (b) {
  15048. var c = f._borrowObject(),
  15049. d = this.clip.getTimeline(a);
  15050. c.fadeIn(b, this, d);
  15051. this._timelineStates[a] = c
  15052. }
  15053. };
  15054. a.prototype.removeTimelineState = function(a) {
  15055. f._returnObject(this._timelineStates[a]);
  15056. delete this._timelineStates[a]
  15057. };
  15058. a.prototype.clear = function() {
  15059. this.clip = null;
  15060. this.enabled = !1;
  15061. this._mixingTransforms = this._currentFrame = this._armature = null;
  15062. for (var a in this._timelineStates) this.removeTimelineState(a)
  15063. };
  15064. a._pool = [];
  15065. return a
  15066. } ();
  15067. a.AnimationState = g;
  15068. g.prototype.__class__ = "dragonBones.animation.AnimationState";
  15069. c = function() {
  15070. function a(b) {
  15071. this._armature = b;
  15072. this._animationLayer = [];
  15073. this._isPlaying = !1;
  15074. this.animationNameList = [];
  15075. this.tweenEnabled = !0;
  15076. this.timeScale = 1
  15077. }
  15078. a.prototype.getLastAnimationName = function() {
  15079. return this._lastAnimationState ? this._lastAnimationState.name: null
  15080. };
  15081. a.prototype.getLastAnimationState = function() {
  15082. return this._lastAnimationState
  15083. };
  15084. a.prototype.getAnimationDataList = function() {
  15085. return this._animationDataList
  15086. };
  15087. a.prototype.setAnimationDataList = function(a) {
  15088. this._animationDataList = a;
  15089. this.animationNameList.length = 0;
  15090. for (var b in this._animationDataList) this.animationNameList[this.animationNameList.length] = this._animationDataList[b].name
  15091. };
  15092. a.prototype.getIsPlaying = function() {
  15093. return this._isPlaying && !this.getIsComplete()
  15094. };
  15095. a.prototype.getIsComplete = function() {
  15096. if (this._lastAnimationState) {
  15097. if (!this._lastAnimationState.isComplete) return ! 1;
  15098. for (var a = this._animationLayer.length; a--;) for (var b = this._animationLayer[a], c = b.length; c--;) if (!b[c].isComplete) return ! 1;
  15099. return ! 0
  15100. }
  15101. return ! 1
  15102. };
  15103. a.prototype.dispose = function() {
  15104. if (this._armature) {
  15105. this.stop();
  15106. for (var a = this._animationLayer.length; a--;) {
  15107. for (var b = this._animationLayer[a], c = b.length; c--;) g._returnObject(b[c]);
  15108. b.length = 0
  15109. }
  15110. this._animationLayer.length = 0;
  15111. this.animationNameList.length = 0;
  15112. this.animationNameList = this._animationDataList = this._animationLayer = this._armature = null
  15113. }
  15114. };
  15115. a.prototype.gotoAndPlay = function(b, c, d, e, k, f, m, l, h, p) {
  15116. "undefined" === typeof c && (c = -1);
  15117. "undefined" === typeof d && (d = -1);
  15118. "undefined" === typeof e && (e = NaN);
  15119. "undefined" === typeof k && (k = 0);
  15120. "undefined" === typeof f && (f = null);
  15121. "undefined" === typeof m && (m = a.SAME_LAYER_AND_GROUP);
  15122. "undefined" === typeof l && (l = !0);
  15123. "undefined" === typeof h && (h = !0);
  15124. "undefined" === typeof p && (p = !0);
  15125. if (!this._animationDataList) return null;
  15126. for (var n = this._animationDataList.length,
  15127. x; n--;) if (this._animationDataList[n].name == b) {
  15128. x = this._animationDataList[n];
  15129. break
  15130. }
  15131. if (!x) return null;
  15132. this._isPlaying = !0;
  15133. c = 0 > c ? 0 > x.fadeInTime ? 0.3 : x.fadeInTime: c;
  15134. d = 0 > d ? 0 > x.scale ? 1 : x.scale: d / x.duration;
  15135. e = isNaN(e) ? x.loop: e;
  15136. k = this.addLayer(k);
  15137. var y;
  15138. switch (m) {
  15139. case a.NONE:
  15140. break;
  15141. case a.SAME_LAYER:
  15142. y = this._animationLayer[k];
  15143. for (n = y.length; n--;) m = y[n],
  15144. m.fadeOut(c, h);
  15145. break;
  15146. case a.SAME_GROUP:
  15147. for (H = this._animationLayer.length; H--;) for (y = this._animationLayer[H], n = y.length; n--;) m = y[n],
  15148. m.group == f && m.fadeOut(c, h);
  15149. break;
  15150. case a.ALL:
  15151. for (var H = this._animationLayer.length; H--;) for (y = this._animationLayer[H], n = y.length; n--;) m = y[n],
  15152. m.fadeOut(c, h);
  15153. break;
  15154. default:
  15155. for (y = this._animationLayer[k], n = y.length; n--;) m = y[n],
  15156. m.group == f && m.fadeOut(c, h)
  15157. }
  15158. this._lastAnimationState = g._borrowObject();
  15159. this._lastAnimationState.group = f;
  15160. this._lastAnimationState.tweenEnabled = this.tweenEnabled;
  15161. this._lastAnimationState.fadeIn(this._armature, x, c, 1 / d, e, k, l, p);
  15162. this.addState(this._lastAnimationState);
  15163. e = this._armature._slotList;
  15164. for (n = e.length; n--;) k = e[n],
  15165. (k = k.getChildArmature()) && k.animation.gotoAndPlay(b, c);
  15166. return this._lastAnimationState
  15167. };
  15168. a.prototype.play = function() {
  15169. this._animationDataList && 0 != this._animationDataList.length && (this._lastAnimationState ? this._isPlaying ? this.gotoAndPlay(this._lastAnimationState.name) : this._isPlaying = !0 : this.gotoAndPlay(this._animationDataList[0].name))
  15170. };
  15171. a.prototype.stop = function() {
  15172. this._isPlaying = !1
  15173. };
  15174. a.prototype.getState = function(a, b) {
  15175. "undefined" === typeof b && (b = 0);
  15176. var c = this._animationLayer.length;
  15177. if (0 == c) return null;
  15178. b >= c && (b = c - 1);
  15179. c = this._animationLayer[b];
  15180. if (!c) return null;
  15181. for (var d = c.length; d--;) if (c[d].name == a) return c[d];
  15182. return null
  15183. };
  15184. a.prototype.hasAnimation = function(a) {
  15185. for (var b = this._animationDataList.length; b--;) if (this._animationDataList[b].name == a) return ! 0;
  15186. return ! 1
  15187. };
  15188. a.prototype.advanceTime = function(a) {
  15189. if (this._isPlaying) {
  15190. a *= this.timeScale;
  15191. var b = this._armature._boneList.length,
  15192. c, d, e = b,
  15193. k, f, g, m, h, l, p, q, n, r, G, M, J, N, F, K, I;
  15194. for (b--; e--;) {
  15195. f = this._armature._boneList[e];
  15196. g = f.name;
  15197. m = 1;
  15198. M = G = r = n = q = p = l = h = 0;
  15199. for (c = this._animationLayer.length; c--;) {
  15200. J = 0;
  15201. N = this._animationLayer[c];
  15202. k = N.length;
  15203. for (d = 0; d < k; d++) F = N[d],
  15204. e == b && F.advanceTime(a) ? (this.removeState(F), d--, k--) : (K = F._timelineStates[g]) && K.tweenActive && (F = F._fadeWeight * F.weight * m, I = K.transform, K = K.pivot, h += I.x * F, l += I.y * F, p += I.skewX * F, q += I.skewY * F, n += I.scaleX * F, r += I.scaleY * F, G += K.x * F, M += K.y * F, J += F);
  15205. if (J >= m) break;
  15206. else m -= J
  15207. }
  15208. I = f.tween;
  15209. K = f._tweenPivot;
  15210. I.x = h;
  15211. I.y = l;
  15212. I.skewX = p;
  15213. I.skewY = q;
  15214. I.scaleX = n;
  15215. I.scaleY = r;
  15216. K.x = G;
  15217. K.y = M
  15218. }
  15219. }
  15220. };
  15221. a.prototype.addLayer = function(a) {
  15222. a >= this._animationLayer.length && (a = this._animationLayer.length, this._animationLayer[a] = []);
  15223. return a
  15224. };
  15225. a.prototype.addState = function(a) {
  15226. this._animationLayer[a.layer].push(a)
  15227. };
  15228. a.prototype.removeState = function(a) {
  15229. var b = a.layer,
  15230. c = this._animationLayer[b];
  15231. c.splice(c.indexOf(a), 1);
  15232. g._returnObject(a);
  15233. 0 == c.length && b == this._animationLayer.length - 1 && this._animationLayer.length--
  15234. };
  15235. a.NONE = "none";
  15236. a.SAME_LAYER = "sameLayer";
  15237. a.SAME_GROUP = "sameGroup";
  15238. a.SAME_LAYER_AND_GROUP = "sameLayerAndGroup";
  15239. a.ALL = "all";
  15240. return a
  15241. } ();
  15242. a.Animation = c;
  15243. c.prototype.__class__ = "dragonBones.animation.Animation"
  15244. })(c.animation || (c.animation = {}));
  15245. var a = c.animation; (function(a) {
  15246. var b = function() {
  15247. function a() {
  15248. this.skewY = this.skewX = this.y = this.x = 0;
  15249. this.scaleY = this.scaleX = 1
  15250. }
  15251. a.prototype.getRotation = function() {
  15252. return this.skewX
  15253. };
  15254. a.prototype.setRotation = function(a) {
  15255. this.skewX = this.skewY = a
  15256. };
  15257. a.prototype.copy = function(a) {
  15258. this.x = a.x;
  15259. this.y = a.y;
  15260. this.skewX = a.skewX;
  15261. this.skewY = a.skewY;
  15262. this.scaleX = a.scaleX;
  15263. this.scaleY = a.scaleY
  15264. };
  15265. a.prototype.toString = function() {
  15266. return "[DBTransform (x=" + this.x + " y=" + this.y + " skewX=" + this.skewX + " skewY=" + this.skewY + " scaleX=" + this.scaleX + " scaleY=" + this.scaleY + ")]"
  15267. };
  15268. return a
  15269. } ();
  15270. a.DBTransform = b;
  15271. b.prototype.__class__ = "dragonBones.objects.DBTransform";
  15272. var c = function() {
  15273. function a() {
  15274. this.duration = this.position = 0
  15275. }
  15276. a.prototype.dispose = function() {};
  15277. return a
  15278. } ();
  15279. a.Frame = c;
  15280. c.prototype.__class__ = "dragonBones.objects.Frame";
  15281. var d = function(a) {
  15282. function c() {
  15283. a.call(this);
  15284. this.displayIndex = this.tweenRotate = this.tweenEasing = 0;
  15285. this.zOrder = NaN;
  15286. this.visible = !0;
  15287. this.global = new b;
  15288. this.transform = new b;
  15289. this.pivot = new e.Point
  15290. }
  15291. __extends(c, a);
  15292. c.prototype.dispose = function() {
  15293. a.prototype.dispose.call(this);
  15294. this.color = this.pivot = this.transform = this.global = null
  15295. };
  15296. return c
  15297. } (c);
  15298. a.TransformFrame = d;
  15299. d.prototype.__class__ = "dragonBones.objects.TransformFrame";
  15300. var f = function() {
  15301. function a() {
  15302. this._frameList = [];
  15303. this.duration = 0;
  15304. this.scale = 1
  15305. }
  15306. a.prototype.getFrameList = function() {
  15307. return this._frameList
  15308. };
  15309. a.prototype.dispose = function() {
  15310. for (var a = this._frameList.length; a--;) this._frameList[a].dispose();
  15311. this._frameList.length = 0;
  15312. this._frameList = null
  15313. };
  15314. a.prototype.addFrame = function(a) {
  15315. if (!a) throw Error();
  15316. if (0 > this._frameList.indexOf(a)) this._frameList[this._frameList.length] = a;
  15317. else throw Error();
  15318. };
  15319. return a
  15320. } ();
  15321. a.Timeline = f;
  15322. f.prototype.__class__ = "dragonBones.objects.Timeline";
  15323. var g = function(a) {
  15324. function c() {
  15325. a.call(this);
  15326. this.originTransform = new b;
  15327. this.originPivot = new e.Point;
  15328. this.offset = 0;
  15329. this.transformed = !1
  15330. }
  15331. __extends(c, a);
  15332. c.prototype.dispose = function() {
  15333. this != c.HIDE_TIMELINE && (a.prototype.dispose.call(this), this.originPivot = this.originTransform = null)
  15334. };
  15335. c.HIDE_TIMELINE = new c;
  15336. return c
  15337. } (f);
  15338. a.TransformTimeline = g;
  15339. g.prototype.__class__ = "dragonBones.objects.TransformTimeline";
  15340. var m = function(a) {
  15341. function b() {
  15342. a.call(this);
  15343. this.loop = this.frameRate = 0;
  15344. this.tweenEasing = NaN;
  15345. this.fadeInTime = 0;
  15346. this._timelines = {}
  15347. }
  15348. __extends(b, a);
  15349. b.prototype.getTimelines = function() {
  15350. return this._timelines
  15351. };
  15352. b.prototype.dispose = function() {
  15353. a.prototype.dispose.call(this);
  15354. for (var b in this._timelines) this._timelines[b].dispose();
  15355. this._timelines = null
  15356. };
  15357. b.prototype.getTimeline = function(a) {
  15358. return this._timelines[a]
  15359. };
  15360. b.prototype.addTimeline = function(a, b) {
  15361. if (!a) throw Error();
  15362. this._timelines[b] = a
  15363. };
  15364. return b
  15365. } (f);
  15366. a.AnimationData = m;
  15367. m.prototype.__class__ = "dragonBones.objects.AnimationData";
  15368. var h = function() {
  15369. function a() {
  15370. this.transform = new b
  15371. }
  15372. a.prototype.dispose = function() {
  15373. this.pivot = this.transform = null
  15374. };
  15375. a.ARMATURE = "armature";
  15376. a.IMAGE = "image";
  15377. return a
  15378. } ();
  15379. a.DisplayData = h;
  15380. h.prototype.__class__ = "dragonBones.objects.DisplayData";
  15381. var w = function() {
  15382. function a() {
  15383. this._displayDataList = [];
  15384. this.zOrder = 0;
  15385. this.blendMode = "normal"
  15386. }
  15387. a.prototype.getDisplayDataList = function() {
  15388. return this._displayDataList
  15389. };
  15390. a.prototype.dispose = function() {
  15391. for (var a = this._displayDataList.length; a--;) this._displayDataList[a].dispose();
  15392. this._displayDataList.length = 0;
  15393. this._displayDataList = null
  15394. };
  15395. a.prototype.addDisplayData = function(a) {
  15396. if (!a) throw Error();
  15397. if (0 > this._displayDataList.indexOf(a)) this._displayDataList[this._displayDataList.length] = a;
  15398. else throw Error();
  15399. };
  15400. a.prototype.getDisplayData = function(a) {
  15401. for (var b = this._displayDataList.length; b--;) if (this._displayDataList[b].name == a) return this._displayDataList[b];
  15402. return null
  15403. };
  15404. return a
  15405. } ();
  15406. a.SlotData = w;
  15407. w.prototype.__class__ = "dragonBones.objects.SlotData";
  15408. var B = function() {
  15409. function a() {
  15410. this.length = 0;
  15411. this.global = new b;
  15412. this.transform = new b;
  15413. this.scaleMode = 1;
  15414. this.fixedRotation = !1
  15415. }
  15416. a.prototype.dispose = function() {
  15417. this.transform = this.global = null
  15418. };
  15419. return a
  15420. } ();
  15421. a.BoneData = B;
  15422. B.prototype.__class__ = "dragonBones.objects.BoneData";
  15423. var C = function() {
  15424. function a() {
  15425. this._slotDataList = []
  15426. }
  15427. a.prototype.getSlotDataList = function() {
  15428. return this._slotDataList
  15429. };
  15430. a.prototype.dispose = function() {
  15431. for (var a = this._slotDataList.length; a--;) this._slotDataList[a].dispose();
  15432. this._slotDataList.length = 0;
  15433. this._slotDataList = null
  15434. };
  15435. a.prototype.getSlotData = function(a) {
  15436. for (var b = this._slotDataList.length; b--;) if (this._slotDataList[b].name == a) return this._slotDataList[b];
  15437. return null
  15438. };
  15439. a.prototype.addSlotData = function(a) {
  15440. if (!a) throw Error();
  15441. if (0 > this._slotDataList.indexOf(a)) this._slotDataList[this._slotDataList.length] = a;
  15442. else throw Error();
  15443. };
  15444. return a
  15445. } ();
  15446. a.SkinData = C;
  15447. C.prototype.__class__ = "dragonBones.objects.SkinData";
  15448. var u = function() {
  15449. function a() {
  15450. this._boneDataList = [];
  15451. this._skinDataList = [];
  15452. this._animationDataList = []
  15453. }
  15454. a.prototype.getBoneDataList = function() {
  15455. return this._boneDataList
  15456. };
  15457. a.prototype.getSkinDataList = function() {
  15458. return this._skinDataList
  15459. };
  15460. a.prototype.getAnimationDataList = function() {
  15461. return this._animationDataList
  15462. };
  15463. a.prototype.dispose = function() {
  15464. for (var a = this._boneDataList.length; a--;) this._boneDataList[a].dispose();
  15465. for (a = this._skinDataList.length; a--;) this._skinDataList[a].dispose();
  15466. for (a = this._animationDataList.length; a--;) this._animationDataList[a].dispose();
  15467. this._boneDataList.length = 0;
  15468. this._skinDataList.length = 0;
  15469. this._animationDataList.length = 0;
  15470. this._animationDataList = this._skinDataList = this._boneDataList = null
  15471. };
  15472. a.prototype.getBoneData = function(a) {
  15473. for (var b = this._boneDataList.length; b--;) if (this._boneDataList[b].name == a) return this._boneDataList[b];
  15474. return null
  15475. };
  15476. a.prototype.getSkinData = function(a) {
  15477. if (!a) return this._skinDataList[0];
  15478. for (var b = this._skinDataList.length; b--;) if (this._skinDataList[b].name == a) return this._skinDataList[b];
  15479. return null
  15480. };
  15481. a.prototype.getAnimationData = function(a) {
  15482. for (var b = this._animationDataList.length; b--;) if (this._animationDataList[b].name == a) return this._animationDataList[b];
  15483. return null
  15484. };
  15485. a.prototype.addBoneData = function(a) {
  15486. if (!a) throw Error();
  15487. if (0 > this._boneDataList.indexOf(a)) this._boneDataList[this._boneDataList.length] = a;
  15488. else throw Error();
  15489. };
  15490. a.prototype.addSkinData = function(a) {
  15491. if (!a) throw Error();
  15492. if (0 > this._skinDataList.indexOf(a)) this._skinDataList[this._skinDataList.length] = a;
  15493. else throw Error();
  15494. };
  15495. a.prototype.addAnimationData = function(a) {
  15496. if (!a) throw Error();
  15497. 0 > this._animationDataList.indexOf(a) && (this._animationDataList[this._animationDataList.length] = a)
  15498. };
  15499. a.prototype.sortBoneDataList = function() {
  15500. var a = this._boneDataList.length;
  15501. if (0 != a) {
  15502. for (var b = []; a--;) {
  15503. for (var c = this._boneDataList[a], d = 0, e = c; e && e.parent;) d++,
  15504. e = this.getBoneData(e.parent);
  15505. b[a] = {
  15506. level: d,
  15507. boneData: c
  15508. }
  15509. }
  15510. b.sort(this.sortBoneData);
  15511. for (a = b.length; a--;) this._boneDataList[a] = b[a].boneData
  15512. }
  15513. };
  15514. a.prototype.sortBoneData = function(a, b) {
  15515. return a.level > b.level ? 1 : -1
  15516. };
  15517. return a
  15518. } ();
  15519. a.ArmatureData = u;
  15520. u.prototype.__class__ = "dragonBones.objects.ArmatureData";
  15521. var v = function() {
  15522. function a() {
  15523. this._armatureDataList = [];
  15524. this._subTexturePivots = {}
  15525. }
  15526. a.prototype.getArmatureNames = function() {
  15527. var a = [],
  15528. b;
  15529. for (b in this._armatureDataList) a[a.length] = this._armatureDataList[b].name;
  15530. return a
  15531. };
  15532. a.prototype.getArmatureDataList = function() {
  15533. return this._armatureDataList
  15534. };
  15535. a.prototype.dispose = function() {
  15536. for (var a in this._armatureDataList) this._armatureDataList[a].dispose();
  15537. this._armatureDataList.length = 0;
  15538. this._subTexturePivots = this._armatureDataList = null
  15539. };
  15540. a.prototype.getArmatureData = function(a) {
  15541. for (var b = this._armatureDataList.length; b--;) if (this._armatureDataList[b].name == a) return this._armatureDataList[b];
  15542. return null
  15543. };
  15544. a.prototype.addArmatureData = function(a) {
  15545. if (!a) throw Error();
  15546. if (0 > this._armatureDataList.indexOf(a)) this._armatureDataList[this._armatureDataList.length] = a;
  15547. else throw Error();
  15548. };
  15549. a.prototype.removeArmatureData = function(a) {
  15550. a = this._armatureDataList.indexOf(a);
  15551. 0 <= a && this._armatureDataList.splice(a, 1)
  15552. };
  15553. a.prototype.removeArmatureDataByName = function(a) {
  15554. for (var b = this._armatureDataList.length; b--;) this._armatureDataList[b].name == a && this._armatureDataList.splice(b, 1)
  15555. };
  15556. a.prototype.getSubTexturePivot = function(a) {
  15557. return this._subTexturePivots[a]
  15558. };
  15559. a.prototype.addSubTexturePivot = function(a, b, c) {
  15560. var d = this._subTexturePivots[c];
  15561. d ? (d.x = a, d.y = b) : this._subTexturePivots[c] = d = new e.Point(a, b);
  15562. return d
  15563. };
  15564. a.prototype.removeSubTexturePivot = function(a) {
  15565. if (a) delete this._subTexturePivots[a];
  15566. else for (a in this._subTexturePivots) delete this._subTexturePivots[a]
  15567. };
  15568. return a
  15569. } ();
  15570. a.SkeletonData = v;
  15571. v.prototype.__class__ = "dragonBones.objects.SkeletonData";
  15572. f = function() {
  15573. function a() {}
  15574. a.parseTextureAtlasData = function(a, b) {
  15575. "undefined" === typeof b && (b = 1);
  15576. if (!a) throw Error();
  15577. var c = {};
  15578. c.__name = a[k.ConstValues.A_NAME];
  15579. var d = a[k.ConstValues.SUB_TEXTURE],
  15580. f;
  15581. for (f in d) {
  15582. var g = d[f],
  15583. m = g[k.ConstValues.A_NAME],
  15584. g = new e.Rectangle(Number(g[k.ConstValues.A_X]) / b, Number(g[k.ConstValues.A_Y]) / b, Number(g[k.ConstValues.A_WIDTH]) / b, Number(g[k.ConstValues.A_HEIGHT]) / b);
  15585. c[m] = g
  15586. }
  15587. return c
  15588. };
  15589. a.parseSkeletonData = function(b) {
  15590. if (!b) throw Error();
  15591. var c = Number(b[k.ConstValues.A_FRAME_RATE]),
  15592. d = new v;
  15593. d.name = b[k.ConstValues.A_NAME];
  15594. b = b[k.ConstValues.ARMATURE];
  15595. for (var e in b) d.addArmatureData(a.parseArmatureData(b[e], d, c));
  15596. return d
  15597. };
  15598. a.parseArmatureData = function(b, c, d) {
  15599. var e = new u;
  15600. e.name = b[k.ConstValues.A_NAME];
  15601. var f = b[k.ConstValues.BONE],
  15602. g;
  15603. for (g in f) e.addBoneData(a.parseBoneData(f[g]));
  15604. f = b[k.ConstValues.SKIN];
  15605. for (g in f) e.addSkinData(a.parseSkinData(f[g], c));
  15606. k.DBDataUtil.transformArmatureData(e);
  15607. e.sortBoneDataList();
  15608. b = b[k.ConstValues.ANIMATION];
  15609. for (g in b) e.addAnimationData(a.parseAnimationData(b[g], e, d));
  15610. return e
  15611. };
  15612. a.parseBoneData = function(b) {
  15613. var c = new B;
  15614. c.name = b[k.ConstValues.A_NAME];
  15615. c.parent = b[k.ConstValues.A_PARENT];
  15616. c.length = Number(b[k.ConstValues.A_LENGTH]) || 0;
  15617. var d = Number(b[k.ConstValues.A_SCALE_MODE]); ! isNaN(d) && d && (c.scaleMode = d);
  15618. if (d = b[k.ConstValues.A_FIXED_ROTATION]) c.fixedRotation = d;
  15619. a.parseTransform(b[k.ConstValues.TRANSFORM], c.global);
  15620. c.transform.copy(c.global);
  15621. return c
  15622. };
  15623. a.parseSkinData = function(b, c) {
  15624. var d = new C;
  15625. d.name = b[k.ConstValues.A_NAME];
  15626. var e = b[k.ConstValues.SLOT],
  15627. f;
  15628. for (f in e) d.addSlotData(a.parseSlotData(e[f], c));
  15629. return d
  15630. };
  15631. a.parseSlotData = function(b, c) {
  15632. var d = new w;
  15633. d.name = b[k.ConstValues.A_NAME];
  15634. d.parent = b[k.ConstValues.A_PARENT];
  15635. d.zOrder = Number(b[k.ConstValues.A_Z_ORDER]);
  15636. d.blendMode = b[k.ConstValues.A_BLENDMODE];
  15637. d.blendMode || (d.blendMode = "normal");
  15638. var e = b[k.ConstValues.DISPLAY],
  15639. f;
  15640. for (f in e) d.addDisplayData(a.parseDisplayData(e[f], c));
  15641. return d
  15642. };
  15643. a.parseDisplayData = function(b, c) {
  15644. var d = new h;
  15645. d.name = b[k.ConstValues.A_NAME];
  15646. d.type = b[k.ConstValues.A_TYPE];
  15647. d.pivot = c.addSubTexturePivot(0, 0, d.name);
  15648. a.parseTransform(b[k.ConstValues.TRANSFORM], d.transform, d.pivot);
  15649. return d
  15650. };
  15651. a.parseAnimationData = function(b, c, d) {
  15652. var e = new m;
  15653. e.name = b[k.ConstValues.A_NAME];
  15654. e.frameRate = d;
  15655. e.loop = Number(b[k.ConstValues.A_LOOP]) || 0;
  15656. e.fadeInTime = Number(b[k.ConstValues.A_FADE_IN_TIME]);
  15657. e.duration = Number(b[k.ConstValues.A_DURATION]) / d;
  15658. e.scale = Number(b[k.ConstValues.A_SCALE]);
  15659. if (b.hasOwnProperty(k.ConstValues.A_TWEEN_EASING)) {
  15660. var f = b[k.ConstValues.A_TWEEN_EASING];
  15661. e.tweenEasing = void 0 == f || null == f ? NaN: Number(f)
  15662. } else e.tweenEasing = NaN;
  15663. a.parseTimeline(b, e, a.parseMainFrame, d);
  15664. var g, f = b[k.ConstValues.TIMELINE],
  15665. h;
  15666. for (h in f) g = f[h],
  15667. b = a.parseTransformTimeline(g, e.duration, d),
  15668. g = g[k.ConstValues.A_NAME],
  15669. e.addTimeline(b, g);
  15670. k.DBDataUtil.addHideTimeline(e, c);
  15671. k.DBDataUtil.transformAnimationData(e, c);
  15672. return e
  15673. };
  15674. a.parseTimeline = function(a, b, c, d) {
  15675. var e = 0,
  15676. f;
  15677. a = a[k.ConstValues.FRAME];
  15678. for (var g in a) f = c(a[g], d),
  15679. f.position = e,
  15680. b.addFrame(f),
  15681. e += f.duration;
  15682. f && (f.duration = b.duration - f.position)
  15683. };
  15684. a.parseTransformTimeline = function(b, c, d) {
  15685. var e = new g;
  15686. e.duration = c;
  15687. a.parseTimeline(b, e, a.parseTransformFrame, d);
  15688. e.scale = Number(b[k.ConstValues.A_SCALE]);
  15689. e.offset = Number(b[k.ConstValues.A_OFFSET]);
  15690. return e
  15691. };
  15692. a.parseFrame = function(a, b, c) {
  15693. b.duration = Number(a[k.ConstValues.A_DURATION]) / c;
  15694. b.action = a[k.ConstValues.A_ACTION];
  15695. b.event = a[k.ConstValues.A_EVENT];
  15696. b.sound = a[k.ConstValues.A_SOUND]
  15697. };
  15698. a.parseMainFrame = function(b, d) {
  15699. var e = new c;
  15700. a.parseFrame(b, e, d);
  15701. return e
  15702. };
  15703. a.parseTransformFrame = function(b, c) {
  15704. var f = new d;
  15705. a.parseFrame(b, f, c);
  15706. f.visible = 1 != Number(b[k.ConstValues.A_HIDE]);
  15707. if (b.hasOwnProperty(k.ConstValues.A_TWEEN_EASING)) {
  15708. var g = b[k.ConstValues.A_TWEEN_EASING];
  15709. f.tweenEasing = void 0 == g || null == g ? NaN: Number(g)
  15710. } else f.tweenEasing = 0;
  15711. f.tweenRotate = Number(b[k.ConstValues.A_TWEEN_ROTATE]) || 0;
  15712. f.displayIndex = Number(b[k.ConstValues.A_DISPLAY_INDEX]) || 0;
  15713. f.zOrder = Number(b[k.ConstValues.A_Z_ORDER]) || 0;
  15714. a.parseTransform(b[k.ConstValues.TRANSFORM], f.global, f.pivot);
  15715. f.transform.copy(f.global);
  15716. if (g = b[k.ConstValues.COLOR_TRANSFORM]) f.color = new e.ColorTransform,
  15717. f.color.alphaOffset = Number(g[k.ConstValues.A_ALPHA_OFFSET]),
  15718. f.color.redOffset = Number(g[k.ConstValues.A_RED_OFFSET]),
  15719. f.color.greenOffset = Number(g[k.ConstValues.A_GREEN_OFFSET]),
  15720. f.color.blueOffset = Number(g[k.ConstValues.A_BLUE_OFFSET]),
  15721. f.color.alphaMultiplier = 0.01 * Number(g[k.ConstValues.A_ALPHA_MULTIPLIER]),
  15722. f.color.redMultiplier = 0.01 * Number(g[k.ConstValues.A_RED_MULTIPLIER]),
  15723. f.color.greenMultiplier = 0.01 * Number(g[k.ConstValues.A_GREEN_MULTIPLIER]),
  15724. f.color.blueMultiplier = 0.01 * Number(g[k.ConstValues.A_BLUE_MULTIPLIER]);
  15725. return f
  15726. };
  15727. a.parseTransform = function(a, b, c) {
  15728. "undefined" === typeof c && (c = null);
  15729. a && (b && (b.x = Number(a[k.ConstValues.A_X]), b.y = Number(a[k.ConstValues.A_Y]), b.skewX = Number(a[k.ConstValues.A_SKEW_X]) * k.ConstValues.ANGLE_TO_RADIAN, b.skewY = Number(a[k.ConstValues.A_SKEW_Y]) * k.ConstValues.ANGLE_TO_RADIAN, b.scaleX = Number(a[k.ConstValues.A_SCALE_X]), b.scaleY = Number(a[k.ConstValues.A_SCALE_Y])), c && (c.x = Number(a[k.ConstValues.A_PIVOT_X]), c.y = Number(a[k.ConstValues.A_PIVOT_Y])))
  15730. };
  15731. return a
  15732. } ();
  15733. a.DataParser = f;
  15734. f.prototype.__class__ = "dragonBones.objects.DataParser"
  15735. })(c.objects || (c.objects = {}));
  15736. var b = c.objects; (function(a) {
  15737. var c = function(a) {
  15738. function c() {
  15739. a.call(this);
  15740. this._dataDic = {};
  15741. this._textureAtlasDic = {};
  15742. this._textureAtlasLoadingDic = {}
  15743. }
  15744. __extends(c, a);
  15745. c.prototype.getSkeletonData = function(a) {
  15746. return this._dataDic[a]
  15747. };
  15748. c.prototype.addSkeletonData = function(a, b) {
  15749. "undefined" === typeof b && (b = null);
  15750. if (!a) throw Error();
  15751. b = b || a.name;
  15752. if (!b) throw Error("Unnamed data!");
  15753. this._dataDic[b] = a
  15754. };
  15755. c.prototype.removeSkeletonData = function(a) {
  15756. delete this._dataDic[a]
  15757. };
  15758. c.prototype.getTextureAtlas = function(a) {
  15759. return this._textureAtlasDic[a]
  15760. };
  15761. c.prototype.addTextureAtlas = function(a, b) {
  15762. "undefined" === typeof b && (b = null);
  15763. if (!a) throw Error();
  15764. b = b || a.name;
  15765. if (!b) throw Error("Unnamed data!");
  15766. this._textureAtlasDic[b] = a
  15767. };
  15768. c.prototype.removeTextureAtlas = function(a) {
  15769. delete this._textureAtlasDic[a]
  15770. };
  15771. c.prototype.dispose = function(a) {
  15772. "undefined" === typeof a && (a = !0);
  15773. if (a) {
  15774. for (var b in this._dataDic) this._dataDic[b].dispose();
  15775. for (b in this._textureAtlasDic) this._textureAtlasDic[b].dispose()
  15776. }
  15777. this._currentTextureAtlasName = this._currentDataName = this._textureAtlasLoadingDic = this._textureAtlasDic = this._dataDic = null
  15778. };
  15779. c.prototype.buildArmature = function(a, c, d, e, k) {
  15780. if (d) {
  15781. var f = this._dataDic[d];
  15782. if (f) var m = f.getArmatureData(a)
  15783. } else for (d in this._dataDic) if (f = this._dataDic[d], m = f.getArmatureData(a)) break;
  15784. if (!m) return null;
  15785. this._currentDataName = d;
  15786. this._currentTextureAtlasName = e || d;
  15787. e = this._generateArmature();
  15788. e.name = a;
  15789. var h, l, p = m.getBoneDataList(),
  15790. q;
  15791. for (q in p) l = p[q],
  15792. h = new g,
  15793. h.name = l.name,
  15794. h.fixedRotation = l.fixedRotation,
  15795. h.scaleMode = l.scaleMode,
  15796. h.origin.copy(l.transform),
  15797. m.getBoneData(l.parent) ? e.addChild(h, l.parent) : e.addChild(h, null);
  15798. if (c && c != a) {
  15799. var n = f.getArmatureData(c);
  15800. if (!n) for (d in this._dataDic) if (f = this._dataDic[d], n = f.getArmatureData(c)) break
  15801. }
  15802. n ? e.animation.setAnimationDataList(n.getAnimationDataList()) : e.animation.setAnimationDataList(m.getAnimationDataList());
  15803. h = m.getSkinData(k);
  15804. if (!h) throw Error();
  15805. a = [];
  15806. d = h.getSlotDataList();
  15807. for (q in d) if (f = d[q], h = e.getBone(f.parent)) {
  15808. k = f.getDisplayDataList();
  15809. c = this._generateSlot();
  15810. c.name = f.name;
  15811. c._blendMode = f.blendMode;
  15812. c._originZOrder = f.zOrder;
  15813. c._dislayDataList = k;
  15814. a.length = 0;
  15815. for (f = k.length; f--;) switch (m = k[f], m.type) {
  15816. case b.DisplayData.ARMATURE:
  15817. (m = this.buildArmature(m.name, null, this._currentDataName, this._currentTextureAtlasName, null)) && (a[f] = m);
  15818. break;
  15819. default:
  15820. a[f] = this._generateDisplay(this._textureAtlasDic[this._currentTextureAtlasName], m.name, m.pivot.x, m.pivot.y)
  15821. }
  15822. c.setDisplayList(a);
  15823. c._changeDisplay(0);
  15824. h.addChild(c)
  15825. }
  15826. e._slotsZOrderChanged = !0;
  15827. e.advanceTime(0);
  15828. return e
  15829. };
  15830. c.prototype.getTextureDisplay = function(a, b, c, d) {
  15831. if (b) var e = this._textureAtlasDic[b];
  15832. if (!e && !b) for (b in this._textureAtlasDic) {
  15833. e = this._textureAtlasDic[b];
  15834. if (e.getRegion(a)) break;
  15835. e = null
  15836. }
  15837. if (e) {
  15838. if (isNaN(c) || isNaN(d)) if (b = this._dataDic[b]) if (b = b.getSubTexturePivot(a)) c = b.x,
  15839. d = b.y;
  15840. return this._generateDisplay(e, a, c, d)
  15841. }
  15842. return null
  15843. };
  15844. c.prototype._generateArmature = function() {
  15845. return null
  15846. };
  15847. c.prototype._generateSlot = function() {
  15848. return null
  15849. };
  15850. c.prototype._generateDisplay = function(a, b, c, d) {
  15851. return null
  15852. };
  15853. return c
  15854. } (d.EventDispatcher);
  15855. a.BaseFactory = c;
  15856. c.prototype.__class__ = "dragonBones.factorys.BaseFactory"
  15857. })(c.factorys || (c.factorys = {})); (function(c) {
  15858. var d = function() {
  15859. function a() {}
  15860. a.ANGLE_TO_RADIAN = Math.PI / 180;
  15861. a.DRAGON_BONES = "dragonBones";
  15862. a.ARMATURE = "armature";
  15863. a.SKIN = "skin";
  15864. a.BONE = "bone";
  15865. a.SLOT = "slot";
  15866. a.DISPLAY = "display";
  15867. a.ANIMATION = "animation";
  15868. a.TIMELINE = "timeline";
  15869. a.FRAME = "frame";
  15870. a.TRANSFORM = "transform";
  15871. a.COLOR_TRANSFORM = "colorTransform";
  15872. a.TEXTURE_ATLAS = "TextureAtlas";
  15873. a.SUB_TEXTURE = "SubTexture";
  15874. a.A_VERSION = "version";
  15875. a.A_IMAGE_PATH = "imagePath";
  15876. a.A_FRAME_RATE = "frameRate";
  15877. a.A_NAME = "name";
  15878. a.A_PARENT = "parent";
  15879. a.A_LENGTH = "length";
  15880. a.A_TYPE = "type";
  15881. a.A_FADE_IN_TIME = "fadeInTime";
  15882. a.A_DURATION = "duration";
  15883. a.A_SCALE = "scale";
  15884. a.A_OFFSET = "offset";
  15885. a.A_LOOP = "loop";
  15886. a.A_EVENT = "event";
  15887. a.A_SOUND = "sound";
  15888. a.A_ACTION = "action";
  15889. a.A_HIDE = "hide";
  15890. a.A_TWEEN_EASING = "tweenEasing";
  15891. a.A_TWEEN_ROTATE = "tweenRotate";
  15892. a.A_DISPLAY_INDEX = "displayIndex";
  15893. a.A_Z_ORDER = "z";
  15894. a.A_BLENDMODE = "blendMode";
  15895. a.A_WIDTH = "width";
  15896. a.A_HEIGHT = "height";
  15897. a.A_SCALE_MODE = "scaleMode";
  15898. a.A_FIXED_ROTATION = "fixedRotation";
  15899. a.A_X = "x";
  15900. a.A_Y = "y";
  15901. a.A_SKEW_X = "skX";
  15902. a.A_SKEW_Y = "skY";
  15903. a.A_SCALE_X = "scX";
  15904. a.A_SCALE_Y = "scY";
  15905. a.A_PIVOT_X = "pX";
  15906. a.A_PIVOT_Y = "pY";
  15907. a.A_ALPHA_OFFSET = "aO";
  15908. a.A_RED_OFFSET = "rO";
  15909. a.A_GREEN_OFFSET = "gO";
  15910. a.A_BLUE_OFFSET = "bO";
  15911. a.A_ALPHA_MULTIPLIER = "aM";
  15912. a.A_RED_MULTIPLIER = "rM";
  15913. a.A_GREEN_MULTIPLIER = "gM";
  15914. a.A_BLUE_MULTIPLIER = "bM";
  15915. return a
  15916. } ();
  15917. c.ConstValues = d;
  15918. d.prototype.__class__ = "dragonBones.utils.ConstValues";
  15919. var k = function() {
  15920. function a() {}
  15921. a.transformPointWithParent = function(b, c) {
  15922. var d = a._helpMatrix;
  15923. a.transformToMatrix(c, d);
  15924. d.invert();
  15925. var e = b.x,
  15926. k = b.y;
  15927. b.x = d.a * e + d.c * k + d.tx;
  15928. b.y = d.d * k + d.b * e + d.ty;
  15929. b.skewX = a.formatRadian(b.skewX - c.skewX);
  15930. b.skewY = a.formatRadian(b.skewY - c.skewY)
  15931. };
  15932. a.transformToMatrix = function(a, b) {
  15933. b.a = a.scaleX * Math.cos(a.skewY);
  15934. b.b = a.scaleX * Math.sin(a.skewY);
  15935. b.c = -a.scaleY * Math.sin(a.skewX);
  15936. b.d = a.scaleY * Math.cos(a.skewX);
  15937. b.tx = a.x;
  15938. b.ty = a.y
  15939. };
  15940. a.formatRadian = function(b) {
  15941. b %= a.DOUBLE_PI;
  15942. b > Math.PI && (b -= a.DOUBLE_PI);
  15943. b < -Math.PI && (b += a.DOUBLE_PI);
  15944. return b
  15945. };
  15946. a.DOUBLE_PI = 2 * Math.PI;
  15947. a._helpMatrix = new e.Matrix;
  15948. return a
  15949. } ();
  15950. c.TransformUtil = k;
  15951. k.prototype.__class__ = "dragonBones.utils.TransformUtil";
  15952. d = function() {
  15953. function c() {}
  15954. c.transformArmatureData = function(a) {
  15955. 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),
  15956. k.transformPointWithParent(d.transform, e.global)
  15957. };
  15958. c.transformArmatureDataAnimations = function(a) {
  15959. for (var b = a.getAnimationDataList(), d = b.length; d--;) c.transformAnimationData(b[d], a)
  15960. };
  15961. c.transformAnimationData = function(a, b) {
  15962. for (var d = b.getSkinData(null), e = b.getBoneDataList(), d = d.getSlotDataList(), f = e.length, g, m, h, l, n, z, E, x, y, H; f--;) if (g = e[f], m = a.getTimeline(g.name)) {
  15963. h = null;
  15964. for (var L in d) if (h = d[L], h.parent == g.name) break;
  15965. l = g.parent ? a.getTimeline(g.parent) : null;
  15966. n = m.getFrameList();
  15967. x = E = z = null;
  15968. H = n.length;
  15969. for (var G = 0; G < H; G++) {
  15970. y = n[G];
  15971. l ? (c._helpTransform1.copy(y.global), c.getTimelineTransform(l, y.position, c._helpTransform2), k.transformPointWithParent(c._helpTransform1, c._helpTransform2), y.transform.copy(c._helpTransform1)) : y.transform.copy(y.global);
  15972. y.transform.x -= g.transform.x;
  15973. y.transform.y -= g.transform.y;
  15974. y.transform.skewX -= g.transform.skewX;
  15975. y.transform.skewY -= g.transform.skewY;
  15976. y.transform.scaleX -= g.transform.scaleX;
  15977. y.transform.scaleY -= g.transform.scaleY; ! m.transformed && h && (y.zOrder -= h.zOrder);
  15978. z || (z = m.originTransform, z.copy(y.transform), z.skewX = k.formatRadian(z.skewX), z.skewY = k.formatRadian(z.skewY), E = m.originPivot, E.x = y.pivot.x, E.y = y.pivot.y);
  15979. y.transform.x -= z.x;
  15980. y.transform.y -= z.y;
  15981. y.transform.skewX = k.formatRadian(y.transform.skewX - z.skewX);
  15982. y.transform.skewY = k.formatRadian(y.transform.skewY - z.skewY);
  15983. y.transform.scaleX -= z.scaleX;
  15984. y.transform.scaleY -= z.scaleY;
  15985. m.transformed || (y.pivot.x -= E.x, y.pivot.y -= E.y);
  15986. if (x) {
  15987. var M = y.transform.skewX - x.transform.skewX;
  15988. x.tweenRotate ? 0 < x.tweenRotate ? (0 > M && (y.transform.skewX += 2 * Math.PI, y.transform.skewY += 2 * Math.PI), 1 < x.tweenRotate && (y.transform.skewX += 2 * Math.PI * (x.tweenRotate - 1), y.transform.skewY += 2 * Math.PI * (x.tweenRotate - 1))) : (0 < M && (y.transform.skewX -= 2 * Math.PI, y.transform.skewY -= 2 * Math.PI), 1 > x.tweenRotate && (y.transform.skewX += 2 * Math.PI * (x.tweenRotate + 1), y.transform.skewY += 2 * Math.PI * (x.tweenRotate + 1))) : (y.transform.skewX = x.transform.skewX + k.formatRadian(y.transform.skewX - x.transform.skewX), y.transform.skewY = x.transform.skewY + k.formatRadian(y.transform.skewY - x.transform.skewY))
  15989. }
  15990. x = y
  15991. }
  15992. m.transformed = !0
  15993. }
  15994. };
  15995. c.getTimelineTransform = function(b, c, d) {
  15996. for (var e = b.getFrameList(), f = e.length, g; f--;) if (b = e[f], b.position <= c && b.position + b.duration > c) {
  15997. g = b.tweenEasing;
  15998. f == e.length - 1 || isNaN(g) || c == b.position ? d.copy(b.global) : (c = (c - b.position) / b.duration, g && (c = a.TimelineState.getEaseValue(c, g)), e = e[f + 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 = k.formatRadian(b.global.skewX + (e.global.skewX - b.global.skewX) * c), d.skewY = k.formatRadian(b.global.skewY + (e.global.skewY - b.global.skewY) * c), d.scaleX = b.global.scaleX + (e.global.scaleX - b.global.scaleX) * c, d.scaleY = b.global.scaleY + (e.global.scaleY - b.global.scaleY) * c);
  15999. break
  16000. }
  16001. };
  16002. c.addHideTimeline = function(a, c) {
  16003. for (var d = c.getBoneDataList(), e = d.length, k; e--;) k = d[e],
  16004. k = k.name,
  16005. a.getTimeline(k) || a.addTimeline(b.TransformTimeline.HIDE_TIMELINE, k)
  16006. };
  16007. c._helpTransform1 = new b.DBTransform;
  16008. c._helpTransform2 = new b.DBTransform;
  16009. return c
  16010. } ();
  16011. c.DBDataUtil = d;
  16012. d.prototype.__class__ = "dragonBones.utils.DBDataUtil"
  16013. })(c.utils || (c.utils = {}));
  16014. var k = c.utils,
  16015. f = function() {
  16016. function a() {
  16017. this.global = new b.DBTransform;
  16018. this.origin = new b.DBTransform;
  16019. this.offset = new b.DBTransform;
  16020. this.tween = new b.DBTransform;
  16021. this.tween.scaleX = this.tween.scaleY = 0;
  16022. this._globalTransformMatrix = new e.Matrix;
  16023. this._visible = !0;
  16024. this._isDisplayOnStage = this._isColorChanged = !1;
  16025. this._scaleType = 0;
  16026. this.fixedRotation = !1
  16027. }
  16028. a.prototype.getVisible = function() {
  16029. return this._visible
  16030. };
  16031. a.prototype.setVisible = function(a) {
  16032. this._visible = a
  16033. };
  16034. a.prototype._setParent = function(a) {
  16035. this.parent = a
  16036. };
  16037. a.prototype._setArmature = function(a) {
  16038. this.armature && this.armature._removeDBObject(this); (this.armature = a) && this.armature._addDBObject(this)
  16039. };
  16040. a.prototype.dispose = function() {
  16041. this._globalTransformMatrix = this.tween = this.offset = this.origin = this.global = this.armature = this.parent = null
  16042. };
  16043. a.prototype._update = function() {
  16044. this.global.scaleX = (this.origin.scaleX + this.tween.scaleX) * this.offset.scaleX;
  16045. this.global.scaleY = (this.origin.scaleY + this.tween.scaleY) * this.offset.scaleY;
  16046. if (this.parent) {
  16047. var a = this.origin.x + this.offset.x + this.tween.x,
  16048. b = this.origin.y + this.offset.y + this.tween.y,
  16049. c = this.parent._globalTransformMatrix;
  16050. this._globalTransformMatrix.tx = this.global.x = c.a * a + c.c * b + c.tx;
  16051. this._globalTransformMatrix.ty = this.global.y = c.d * b + c.b * a + c.ty;
  16052. 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);
  16053. this.parent.scaleMode >= this._scaleType && (this.global.scaleX *= this.parent.global.scaleX, this.global.scaleY *= this.parent.global.scaleY)
  16054. } else this._globalTransformMatrix.tx = this.global.x = this.origin.x + this.offset.x + this.tween.x,
  16055. this._globalTransformMatrix.ty = this.global.y = this.origin.y + this.offset.y + this.tween.y,
  16056. this.global.skewX = this.origin.skewX + this.offset.skewX + this.tween.skewX,
  16057. this.global.skewY = this.origin.skewY + this.offset.skewY + this.tween.skewY;
  16058. this._globalTransformMatrix.a = this.global.scaleX * Math.cos(this.global.skewY);
  16059. this._globalTransformMatrix.b = this.global.scaleX * Math.sin(this.global.skewY);
  16060. this._globalTransformMatrix.c = -this.global.scaleY * Math.sin(this.global.skewX);
  16061. this._globalTransformMatrix.d = this.global.scaleY * Math.cos(this.global.skewX)
  16062. };
  16063. return a
  16064. } ();
  16065. c.DBObject = f;
  16066. f.prototype.__class__ = "dragonBones.DBObject";
  16067. var m = function(a) {
  16068. function b(c) {
  16069. a.call(this);
  16070. this._displayBridge = c;
  16071. this._displayList = [];
  16072. this._displayIndex = -1;
  16073. this._scaleType = 1;
  16074. this._offsetZOrder = this._tweenZorder = this._originZOrder = 0;
  16075. this._isHideDisplay = this._isDisplayOnStage = !1;
  16076. this._blendMode = "normal";
  16077. this._displayBridge.updateBlendMode(this._blendMode)
  16078. }
  16079. __extends(b, a);
  16080. b.prototype.getZOrder = function() {
  16081. return this._originZOrder + this._tweenZorder + this._offsetZOrder
  16082. };
  16083. b.prototype.setZOrder = function(a) {
  16084. this.getZOrder() != a && (this._offsetZOrder = a - this._originZOrder - this._tweenZorder, this.armature && (this.armature._slotsZOrderChanged = !0))
  16085. };
  16086. b.prototype.getDisplay = function() {
  16087. var a = this._displayList[this._displayIndex];
  16088. return a instanceof h ? a.getDisplay() : a
  16089. };
  16090. b.prototype.setDisplay = function(a) {
  16091. this._displayList[this._displayIndex] = a;
  16092. this._setDisplay(a)
  16093. };
  16094. b.prototype.getBlendMode = function() {
  16095. return this._blendMode
  16096. };
  16097. b.prototype.setBlendMode = function(a) {
  16098. this._blendMode != a && (this._blendMode = a, this._displayBridge.getDisplay() && this._displayBridge.updateBlendMode(this._blendMode))
  16099. };
  16100. b.prototype.getChildArmature = function() {
  16101. var a = this._displayList[this._displayIndex];
  16102. return a instanceof h ? a: null
  16103. };
  16104. b.prototype.setChildArmature = function(a) { (this._displayList[this._displayIndex] = a) && this._setDisplay(a.getDisplay())
  16105. };
  16106. b.prototype.getDisplayList = function() {
  16107. return this._displayList
  16108. };
  16109. b.prototype.setDisplayList = function(a) {
  16110. if (!a) throw Error();
  16111. for (var b = this._displayList.length = a.length; b--;) this._displayList[b] = a[b];
  16112. 0 <= this._displayIndex && (a = this._displayIndex, this._displayIndex = -1, this._changeDisplay(a))
  16113. };
  16114. b.prototype._setDisplay = function(a) {
  16115. this._displayBridge.getDisplay() ? this._displayBridge.setDisplay(a) : (this._displayBridge.setDisplay(a), this.armature && (this._displayBridge.addDisplay(this.armature.getDisplay(), -1), this.armature._slotsZOrderChanged = !0));
  16116. this.updateChildArmatureAnimation();
  16117. a && this._displayBridge.updateBlendMode(this._blendMode); ! this._isHideDisplay && this._displayBridge.getDisplay() ? this._isDisplayOnStage = !0 : this._isDisplayOnStage = !1
  16118. };
  16119. b.prototype._changeDisplay = function(a) {
  16120. if (0 > a) this._isHideDisplay || (this._isHideDisplay = !0, this._displayBridge.removeDisplay(), this.updateChildArmatureAnimation());
  16121. else {
  16122. if (this._isHideDisplay) {
  16123. this._isHideDisplay = !1;
  16124. var b = !0;
  16125. this.armature && (this._displayBridge.addDisplay(this.armature.getDisplay(), -1), this.armature._slotsZOrderChanged = !0)
  16126. }
  16127. var c = this._displayList.length;
  16128. a >= c && 0 < c && (a = c - 1);
  16129. this._displayIndex != a ? (this._displayIndex = a, a = this._displayList[this._displayIndex], a instanceof h ? 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()
  16130. } ! this._isHideDisplay && this._displayBridge.getDisplay() ? this._isDisplayOnStage = !0 : this._isDisplayOnStage = !1
  16131. };
  16132. b.prototype.setVisible = function(a) {
  16133. a != this._visible && (this._visible = a, this._updateVisible(this._visible))
  16134. };
  16135. b.prototype._setArmature = function(b) {
  16136. a.prototype._setArmature.call(this, b);
  16137. this.armature ? (this.armature._slotsZOrderChanged = !0, this._displayBridge.addDisplay(this.armature.getDisplay(), -1)) : this._displayBridge.removeDisplay()
  16138. };
  16139. b.prototype.dispose = function() {
  16140. this._displayBridge && (a.prototype.dispose.call(this), this._displayBridge.dispose(), this._displayList.length = 0, this._dislayDataList = this._displayList = this._displayBridge = null)
  16141. };
  16142. b.prototype._update = function() {
  16143. a.prototype._update.call(this);
  16144. if (this._isDisplayOnStage) {
  16145. var b = this.parent._tweenPivot.x,
  16146. c = this.parent._tweenPivot.y;
  16147. if (b || c) {
  16148. var d = this.parent._globalTransformMatrix;
  16149. this._globalTransformMatrix.tx += d.a * b + d.c * c;
  16150. this._globalTransformMatrix.ty += d.b * b + d.d * c
  16151. }
  16152. this._displayBridge.updateTransform(this._globalTransformMatrix, this.global)
  16153. }
  16154. };
  16155. b.prototype._updateVisible = function(a) {
  16156. this._displayBridge.setVisible(this.parent.getVisible() && this._visible && a)
  16157. };
  16158. b.prototype.updateChildArmatureAnimation = function() {
  16159. var a = this.getChildArmature();
  16160. if (a) if (this._isHideDisplay) a.animation.stop(),
  16161. a.animation._lastAnimationState = null;
  16162. else {
  16163. var b = this.armature ? this.armature.animation.getLastAnimationName() : null;
  16164. b && a.animation.hasAnimation(b) ? a.animation.gotoAndPlay(b) : a.animation.play()
  16165. }
  16166. };
  16167. return b
  16168. } (f);
  16169. c.Slot = m;
  16170. m.prototype.__class__ = "dragonBones.Slot";
  16171. var g = function(a) {
  16172. function b() {
  16173. a.call(this);
  16174. this._children = [];
  16175. this._scaleType = 2;
  16176. this._tweenPivot = new e.Point;
  16177. this.scaleMode = 1
  16178. }
  16179. __extends(b, a);
  16180. b.prototype.setVisible = function(a) {
  16181. if (this._visible != a) for (this._visible = a, a = this._children.length; a--;) {
  16182. var b = this._children[a];
  16183. b instanceof m && b._updateVisible(this._visible)
  16184. }
  16185. };
  16186. b.prototype._setArmature = function(b) {
  16187. a.prototype._setArmature.call(this, b);
  16188. for (b = this._children.length; b--;) this._children[b]._setArmature(this.armature)
  16189. };
  16190. b.prototype.dispose = function() {
  16191. if (this._children) {
  16192. a.prototype.dispose.call(this);
  16193. for (var b = this._children.length; b--;) this._children[b].dispose();
  16194. this._children.length = 0;
  16195. this.slot = this._tweenPivot = this._children = null
  16196. }
  16197. };
  16198. b.prototype.contains = function(a) {
  16199. if (!a) throw Error();
  16200. if (a == this) return ! 1;
  16201. for (; a != this && null != a;) a = a.parent;
  16202. return a == this
  16203. };
  16204. b.prototype.addChild = function(a) {
  16205. if (!a) throw Error();
  16206. if (a == this || a instanceof b && 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.)");
  16207. a.parent && a.parent.removeChild(a);
  16208. this._children[this._children.length] = a;
  16209. a._setParent(this);
  16210. a._setArmature(this.armature); ! this.slot && a instanceof m && (this.slot = a)
  16211. };
  16212. b.prototype.removeChild = function(a) {
  16213. if (!a) throw Error();
  16214. var b = this._children.indexOf(a);
  16215. if (0 <= b) this._children.splice(b, 1),
  16216. a._setParent(null),
  16217. a._setArmature(null),
  16218. a == this.slot && (this.slot = null);
  16219. else throw Error();
  16220. };
  16221. b.prototype.getSlots = function() {
  16222. for (var a = [], b = this._children.length; b--;) this._children[b] instanceof m && a.unshift(this._children[b]);
  16223. return a
  16224. };
  16225. b.prototype._arriveAtFrame = function(a, c, e, k) {
  16226. if (a) {
  16227. if (c = e.getMixingTransform(this.name), !e.displayControl || 2 != c && -1 != c || this.displayController && this.displayController != e.name || !this.slot || (c = a.displayIndex, 0 <= c && !isNaN(a.zOrder) && a.zOrder != this.slot._tweenZorder && (this.slot._tweenZorder = a.zOrder, this.armature._slotsZOrderChanged = !0), this.slot._changeDisplay(c), this.slot._updateVisible(a.visible)), a.event && this.armature.hasEventListener(d.FrameEvent.BONE_FRAME_EVENT) && (c = new d.FrameEvent(d.FrameEvent.BONE_FRAME_EVENT), c.bone = this, c.animationState = e, c.frameLabel = a.event, this.armature._eventList.push(c)), a.sound && b._soundManager.hasEventListener(d.SoundEvent.SOUND) && (c = new d.SoundEvent(d.SoundEvent.SOUND), c.armature = this.armature, c.animationState = e, c.sound = a.sound, b._soundManager.dispatchEvent(c)), a.action) for (var f in this._children) this._children[f] instanceof m && (e = this._children[f].getChildArmature()) && e.animation.gotoAndPlay(a.action)
  16228. } else this.slot && this.slot._changeDisplay( - 1)
  16229. };
  16230. b.prototype._updateColor = function(a, b, c, d, e, k, f, g, m) { (m || this._isColorChanged) && this.slot._displayBridge.updateColor(a, b, c, d, e, k, f, g);
  16231. this._isColorChanged = m
  16232. };
  16233. b._soundManager = d.SoundEventManager.getInstance();
  16234. return b
  16235. } (f);
  16236. c.Bone = g;
  16237. g.prototype.__class__ = "dragonBones.Bone";
  16238. var h = function(b) {
  16239. function c(d) {
  16240. b.call(this);
  16241. this.animation = new a.Animation(this);
  16242. this._display = d;
  16243. this._slotsZOrderChanged = !1;
  16244. this._slotList = [];
  16245. this._boneList = [];
  16246. this._eventList = []
  16247. }
  16248. __extends(c, b);
  16249. c.prototype.getDisplay = function() {
  16250. return this._display
  16251. };
  16252. c.prototype.dispose = function() {
  16253. if (this.animation) {
  16254. this.animation.dispose();
  16255. for (var a = this._slotList.length; a--;) this._slotList[a].dispose();
  16256. for (a = this._boneList.length; a--;) this._boneList[a].dispose();
  16257. this._slotList.length = 0;
  16258. this._boneList.length = 0;
  16259. this._eventList.length = 0;
  16260. this.animation = this._display = this._eventList = this._boneList = this._slotList = null
  16261. }
  16262. };
  16263. c.prototype.advanceTime = function(a) {
  16264. this.animation.advanceTime(a);
  16265. a *= this.animation.timeScale;
  16266. for (var b = this._boneList.length; b--;) this._boneList[b]._update();
  16267. for (var b = this._slotList.length,
  16268. c; b--;) c = this._slotList[b],
  16269. c._update(),
  16270. c._isDisplayOnStage && (c = c.getChildArmature()) && c.advanceTime(a);
  16271. this._slotsZOrderChanged && (this.updateSlotsZOrder(), this.hasEventListener(d.ArmatureEvent.Z_ORDER_UPDATED) && this.dispatchEvent(new d.ArmatureEvent(d.ArmatureEvent.Z_ORDER_UPDATED)));
  16272. if (this._eventList.length) {
  16273. a = this._eventList.length;
  16274. for (b = 0; b < a; b++) this.dispatchEvent(this._eventList[b]);
  16275. this._eventList.length = 0
  16276. }
  16277. };
  16278. c.prototype.getSlots = function(a) {
  16279. "undefined" === typeof a && (a = !0);
  16280. return a ? this._slotList.concat() : this._slotList
  16281. };
  16282. c.prototype.getBones = function(a) {
  16283. "undefined" === typeof a && (a = !0);
  16284. return a ? this._boneList.concat() : this._boneList
  16285. };
  16286. c.prototype.getSlot = function(a) {
  16287. for (var b = this._slotList.length; b--;) if (this._slotList[b].name == a) return this._slotList[b];
  16288. return null
  16289. };
  16290. c.prototype.getSlotByDisplay = function(a) {
  16291. if (a) for (var b = this._slotList.length; b--;) if (this._slotList[b].getDisplay() == a) return this._slotList[b];
  16292. return null
  16293. };
  16294. c.prototype.removeSlot = function(a) {
  16295. if (!a) throw Error();
  16296. if (0 <= this._slotList.indexOf(a)) a.parent.removeChild(a);
  16297. else throw Error();
  16298. };
  16299. c.prototype.removeSlotByName = function(a) {
  16300. a && (a = this.getSlot(a)) && this.removeSlot(a)
  16301. };
  16302. c.prototype.getBone = function(a) {
  16303. for (var b = this._boneList.length; b--;) if (this._boneList[b].name == a) return this._boneList[b];
  16304. return null
  16305. };
  16306. c.prototype.getBoneByDisplay = function(a) {
  16307. return (a = this.getSlotByDisplay(a)) ? a.parent: null
  16308. };
  16309. c.prototype.removeBone = function(a) {
  16310. if (!a) throw Error();
  16311. if (0 <= this._boneList.indexOf(a)) a.parent ? a.parent.removeChild(a) : a._setArmature(null);
  16312. else throw Error();
  16313. };
  16314. c.prototype.removeBoneByName = function(a) {
  16315. a && (a = this.getBone(a)) && this.removeBone(a)
  16316. };
  16317. c.prototype.addChild = function(a, b) {
  16318. if (!a) throw Error();
  16319. if (b) {
  16320. var c = this.getBone(b);
  16321. if (c) c.addChild(a);
  16322. else throw Error();
  16323. } else a.parent && a.parent.removeChild(a),
  16324. a._setArmature(this)
  16325. };
  16326. c.prototype.updateSlotsZOrder = function() {
  16327. this._slotList.sort(this.sortSlot);
  16328. for (var a = this._slotList.length,
  16329. b; a--;) b = this._slotList[a],
  16330. b._isDisplayOnStage && b._displayBridge.addDisplay(this._display, -1);
  16331. this._slotsZOrderChanged = !1
  16332. };
  16333. c.prototype._addDBObject = function(a) {
  16334. a instanceof m ? 0 > this._slotList.indexOf(a) && (this._slotList[this._slotList.length] = a) : a instanceof g && 0 > this._boneList.indexOf(a) && (this._boneList[this._boneList.length] = a, this._sortBoneList())
  16335. };
  16336. c.prototype._removeDBObject = function(a) {
  16337. a instanceof m ? (a = this._slotList.indexOf(a), 0 <= a && this._slotList.splice(a, 1)) : a instanceof g && (a = this._boneList.indexOf(a), 0 <= a && this._boneList.splice(a, 1))
  16338. };
  16339. c.prototype._sortBoneList = function() {
  16340. var a = this._boneList.length;
  16341. if (0 != a) {
  16342. for (var b = [], c, d, e; a--;) {
  16343. c = 0;
  16344. for (e = d = this._boneList[a]; e;) c++,
  16345. e = e.parent;
  16346. b[a] = {
  16347. level: c,
  16348. bone: d
  16349. }
  16350. }
  16351. b.sort(this.sortBone);
  16352. for (a = b.length; a--;) this._boneList[a] = b[a].bone
  16353. }
  16354. };
  16355. c.prototype._arriveAtFrame = function(a, b, e, k) {
  16356. a.event && this.hasEventListener(d.FrameEvent.ANIMATION_FRAME_EVENT) && (b = new d.FrameEvent(d.FrameEvent.ANIMATION_FRAME_EVENT), b.animationState = e, b.frameLabel = a.event, this._eventList.push(b));
  16357. a.sound && c._soundManager.hasEventListener(d.SoundEvent.SOUND) && (b = new d.SoundEvent(d.SoundEvent.SOUND), b.armature = this, b.animationState = e, b.sound = a.sound, c._soundManager.dispatchEvent(b));
  16358. a.action && e.isPlaying && this.animation.gotoAndPlay(a.action)
  16359. };
  16360. c.prototype.sortSlot = function(a, b) {
  16361. return a.getZOrder() < b.getZOrder() ? 1 : -1
  16362. };
  16363. c.prototype.sortBone = function(a, b) {
  16364. return a.level < b.level ? 1 : -1
  16365. };
  16366. c._soundManager = d.SoundEventManager.getInstance();
  16367. return c
  16368. } (d.EventDispatcher);
  16369. c.Armature = h;
  16370. h.prototype.__class__ = "dragonBones.Armature"
  16371. })(dragonBones || (dragonBones = {}));
  16372. __extends = this.__extends ||
  16373. function(c, e) {
  16374. function d() {
  16375. this.constructor = c
  16376. }
  16377. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  16378. d.prototype = e.prototype;
  16379. c.prototype = new d
  16380. }; (function(c) { (function(c) {
  16381. var a = function() {
  16382. function a() {}
  16383. a.prototype.getVisible = function() {
  16384. return this._display ? this._display.visible: !1
  16385. };
  16386. a.prototype.setVisible = function(a) {
  16387. this._display && (this._display.visible = a)
  16388. };
  16389. a.prototype.getDisplay = function() {
  16390. return this._display
  16391. };
  16392. a.prototype.setDisplay = function(a) {
  16393. if (this._display != a) {
  16394. if (this._display) {
  16395. var b = this._display.parent;
  16396. if (b) var c = b.getChildIndex(this._display);
  16397. this.removeDisplay()
  16398. }
  16399. this._display = a;
  16400. this.addDisplay(b, c)
  16401. }
  16402. };
  16403. a.prototype.dispose = function() {
  16404. this._display = null
  16405. };
  16406. a.prototype.updateTransform = function(c, d) {
  16407. this._display._x = c.tx;
  16408. this._display._y = c.ty;
  16409. this._display._skewX = d.skewX * a.RADIAN_TO_ANGLE;
  16410. this._display._skewY = d.skewY * a.RADIAN_TO_ANGLE;
  16411. this._display._scaleX = d.scaleX;
  16412. this._display._scaleY = d.scaleY;
  16413. this._display._setSizeDirty()
  16414. };
  16415. a.prototype.updateColor = function(a, b, c, d, e, l, n, p) {
  16416. this._display && (this._display._alpha = e)
  16417. };
  16418. a.prototype.updateBlendMode = function(a) {
  16419. this._display && a && (this._display.blendMode = a)
  16420. };
  16421. a.prototype.addDisplay = function(a, b) {
  16422. a && this._display && (this._display._parent && this._display._parent.removeChild(this._display), 0 > b ? a.addChild(this._display) : a.addChildAt(this._display, Math.min(b, a.numChildren)))
  16423. };
  16424. a.prototype.removeDisplay = function() {
  16425. this._display && this._display._parent && this._display._parent.removeChild(this._display)
  16426. };
  16427. a.RADIAN_TO_ANGLE = 180 / Math.PI;
  16428. return a
  16429. } ();
  16430. c.DragonBonesEgretBridge = a;
  16431. a.prototype.__class__ = "dragonBones.display.DragonBonesEgretBridge"
  16432. })(c.display || (c.display = {}));
  16433. var e = c.display; (function(d) {
  16434. var a = function() {
  16435. function a(b, d, e) {
  16436. "undefined" === typeof e && (e = 1);
  16437. this.texture = b;
  16438. this.textureAtlasRawData = d;
  16439. this._textureData = {};
  16440. this.scale = e;
  16441. this.name = d[c.utils.ConstValues.A_NAME];
  16442. this.parseData(d);
  16443. this.spriteSheet = new egret.SpriteSheet(b)
  16444. }
  16445. a.prototype.getTexture = function(a) {
  16446. var b = this.spriteSheet.getTexture(a);
  16447. b || (b = this._textureData[a], b = this.spriteSheet.createTexture(a, b.x, b.y, b.width, b.height));
  16448. return b
  16449. };
  16450. a.prototype.dispose = function() {
  16451. this.texture = null
  16452. };
  16453. a.prototype.getRegion = function(a) {
  16454. throw Error("error");
  16455. };
  16456. a.prototype.parseData = function(a) {
  16457. for (var b = a.SubTexture.length,
  16458. c = 0; c < b; c++) {
  16459. var d = a.SubTexture[c];
  16460. this._textureData[d.name] = d
  16461. }
  16462. };
  16463. return a
  16464. } ();
  16465. d.EgretTextureAtlas = a;
  16466. a.prototype.__class__ = "dragonBones.textures.EgretTextureAtlas"
  16467. })(c.textures || (c.textures = {})); (function(d) {
  16468. var a = function(a) {
  16469. function d() {
  16470. a.call(this)
  16471. }
  16472. __extends(d, a);
  16473. d.prototype._generateArmature = function() {
  16474. return new c.Armature(new egret.DisplayObjectContainer)
  16475. };
  16476. d.prototype._generateSlot = function() {
  16477. return new c.Slot(new e.DragonBonesEgretBridge)
  16478. };
  16479. d.prototype._generateDisplay = function(a, b, c, d) {
  16480. var e = new egret.Bitmap;
  16481. e.texture = a.getTexture(b);
  16482. e.anchorOffsetX = c;
  16483. e.anchorOffsetY = d;
  16484. return e
  16485. };
  16486. return d
  16487. } (d.BaseFactory);
  16488. d.EgretFactory = a;
  16489. a.prototype.__class__ = "dragonBones.factorys.EgretFactory"
  16490. })(c.factorys || (c.factorys = {}))
  16491. })(dragonBones || (dragonBones = {})); (function(c) {
  16492. var e = function() {
  16493. function d() {}
  16494. d.TRACE_RENDER_LOOP = function(a) {
  16495. "undefined" === typeof a && (a = 0);
  16496. var b = c.Ticker.getInstance(),
  16497. d = c.MainContext.instance;
  16498. switch (a) {
  16499. case 0:
  16500. b.unregister(d.renderLoop, d);
  16501. break;
  16502. case 1:
  16503. d.renderLoop();
  16504. break;
  16505. case 2:
  16506. b.register(d.renderLoop, d)
  16507. }
  16508. };
  16509. d.DRAW_IMAGE = !0;
  16510. d.ADD_EVENT_LISTENER = !0;
  16511. d.SCALE_BITMAP_SET_SCALE_GRID = !0;
  16512. return d
  16513. } ();
  16514. c.DEBUG = e
  16515. })(egret || (egret = {})); (function(c) {
  16516. var e = function() {
  16517. function c() {}
  16518. c.isNumber = function(a) {
  16519. return "number" === typeof a && !isNaN(a)
  16520. };
  16521. return c
  16522. } ();
  16523. c.NumberUtils = e;
  16524. e.prototype.__class__ = "egret.NumberUtils"
  16525. })(egret || (egret = {}));
  16526. var __extends = this.__extends ||
  16527. function(c, e) {
  16528. function d() {
  16529. this.constructor = c
  16530. }
  16531. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  16532. d.prototype = e.prototype;
  16533. c.prototype = new d
  16534. },
  16535. RES; (function(c) {
  16536. var e = function(c) {
  16537. function a(a, e, f) {
  16538. "undefined" === typeof e && (e = !1);
  16539. "undefined" === typeof f && (f = !1);
  16540. c.call(this, a, e, f);
  16541. this.itemsTotal = this.itemsLoaded = 0
  16542. }
  16543. __extends(a, c);
  16544. a.dispatchResourceEvent = function(b, c, d, e, g, h) {
  16545. "undefined" === typeof d && (d = "");
  16546. "undefined" === typeof e && (e = null);
  16547. "undefined" === typeof g && (g = 0);
  16548. "undefined" === typeof h && (h = 0);
  16549. var l = egret.Event._getPropertyData(a);
  16550. l.groupName = d;
  16551. l.resItem = e;
  16552. l.itemsLoaded = g;
  16553. l.itemsTotal = h;
  16554. egret.Event._dispatchByTarget(a, b, c, l)
  16555. };
  16556. a.ITEM_LOAD_ERROR = "itemLoadError";
  16557. a.CONFIG_COMPLETE = "configComplete";
  16558. a.GROUP_PROGRESS = "groupProgress";
  16559. a.GROUP_COMPLETE = "groupComplete";
  16560. return a
  16561. } (egret.Event);
  16562. c.ResourceEvent = e;
  16563. e.prototype.__class__ = "RES.ResourceEvent"
  16564. })(RES || (RES = {})); (function(c) {
  16565. var e = function() {
  16566. function c(a, b, d) {
  16567. this._loaded = !1;
  16568. this.name = a;
  16569. this.url = b;
  16570. this.type = d
  16571. }
  16572. Object.defineProperty(c.prototype, "loaded", {
  16573. get: function() {
  16574. return this.data ? this.data.loaded: this._loaded
  16575. },
  16576. set: function(a) {
  16577. this.data && (this.data.loaded = a);
  16578. this._loaded = a
  16579. },
  16580. enumerable: !0,
  16581. configurable: !0
  16582. });
  16583. c.prototype.toString = function() {
  16584. return '[ResourceItem name="' + this.name + '" url="' + this.url + '" type="' + this.type + '"]'
  16585. };
  16586. c.TYPE_XML = "xml";
  16587. c.TYPE_IMAGE = "image";
  16588. c.TYPE_BIN = "bin";
  16589. c.TYPE_TEXT = "text";
  16590. c.TYPE_JSON = "json";
  16591. c.TYPE_SHEET = "sheet";
  16592. c.TYPE_FONT = "font";
  16593. c.TYPE_SOUND = "sound";
  16594. return c
  16595. } ();
  16596. c.ResourceItem = e;
  16597. e.prototype.__class__ = "RES.ResourceItem"
  16598. })(RES || (RES = {})); (function(c) {
  16599. var e = function() {
  16600. function d() {
  16601. this.keyMap = {};
  16602. this.groupDic = {}
  16603. }
  16604. d.prototype.getGroupByName = function(a) {
  16605. var b = [];
  16606. if (!this.groupDic[a]) return b;
  16607. a = this.groupDic[a];
  16608. for (var c = a.length,
  16609. d = 0; d < c; d++) b.push(this.parseResourceItem(a[d]));
  16610. return b
  16611. };
  16612. d.prototype.getRawGroupByName = function(a) {
  16613. return this.groupDic[a] ? this.groupDic[a] : []
  16614. };
  16615. d.prototype.createGroup = function(a, b, c) {
  16616. "undefined" === typeof c && (c = !1);
  16617. if (!c && this.groupDic[a] || !b || 0 == b.length) return ! 1;
  16618. c = this.groupDic;
  16619. for (var d = [], e = b.length, g = 0; g < e; g++) {
  16620. var h = b[g],
  16621. l = c[h];
  16622. if (l) for (var h = l.length,
  16623. n = 0; n < h; n++) {
  16624. var p = l[n]; - 1 == d.indexOf(p) && d.push(p)
  16625. } else(p = this.keyMap[h]) && -1 == d.indexOf(p) && d.push(p)
  16626. }
  16627. if (0 == d.length) return ! 1;
  16628. this.groupDic[a] = d;
  16629. return ! 0
  16630. };
  16631. d.prototype.parseConfig = function(a, b) {
  16632. if (a) {
  16633. var c = a.resources;
  16634. if (c) for (var d = c.length,
  16635. e = 0; e < d; e++) {
  16636. var g = c[e];
  16637. g.url = b + g.url;
  16638. this.keyMap[g.name] || (this.keyMap[g.name] = g)
  16639. }
  16640. if (c = a.groups) for (d = c.length, e = 0; e < d; e++) {
  16641. for (var h = c[e], l = [], n = h.keys.split(","), p = n.length, q = 0; q < p; q++) g = n[q].trim(),
  16642. (g = this.keyMap[g]) && -1 == l.indexOf(g) && l.push(g);
  16643. this.groupDic[h.name] = l
  16644. }
  16645. }
  16646. };
  16647. d.prototype.getType = function(a) {
  16648. return (a = this.keyMap[a]) ? a.type: ""
  16649. };
  16650. d.prototype.getRawResourceItem = function(a) {
  16651. return this.keyMap[a]
  16652. };
  16653. d.prototype.getResourceItem = function(a) {
  16654. return (a = this.keyMap[a]) ? this.parseResourceItem(a) : null
  16655. };
  16656. d.prototype.parseResourceItem = function(a) {
  16657. var b = new c.ResourceItem(a.name, a.url, a.type);
  16658. b.data = a;
  16659. return b
  16660. };
  16661. return d
  16662. } ();
  16663. c.ResourceConfig = e;
  16664. e.prototype.__class__ = "RES.ResourceConfig"
  16665. })(RES || (RES = {}));
  16666. __extends = this.__extends ||
  16667. function(c, e) {
  16668. function d() {
  16669. this.constructor = c
  16670. }
  16671. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  16672. d.prototype = e.prototype;
  16673. c.prototype = new d
  16674. }; (function(c) {
  16675. var e = function(d) {
  16676. function a() {
  16677. d.call(this);
  16678. this.groupTotalDic = {};
  16679. this.numLoadedDic = {};
  16680. this.itemListDic = {};
  16681. this.priorityQueue = {};
  16682. this.lazyLoadList = [];
  16683. this.analyzerDic = {};
  16684. this.queueIndex = 0
  16685. }
  16686. __extends(a, d);
  16687. a.prototype.isGroupInLoading = function(a) {
  16688. return void 0 !== this.itemListDic[a]
  16689. };
  16690. a.prototype.loadGroup = function(a, d, e) {
  16691. "undefined" === typeof e && (e = 0);
  16692. if (!this.itemListDic[d] && d) if (a && 0 != a.length) {
  16693. this.priorityQueue[e] ? this.priorityQueue[e].push(d) : this.priorityQueue[e] = [d];
  16694. this.itemListDic[d] = a;
  16695. e = a.length;
  16696. for (var m = 0; m < e; m++) a[m].groupName = d;
  16697. this.groupTotalDic[d] = a.length;
  16698. this.numLoadedDic[d] = 0;
  16699. this.next()
  16700. } else a = new c.ResourceEvent(c.ResourceEvent.GROUP_COMPLETE),
  16701. a.groupName = d,
  16702. this.dispatchEvent(a)
  16703. };
  16704. a.prototype.loadItem = function(a) {
  16705. this.lazyLoadList.push(a);
  16706. a.groupName = "";
  16707. this.next()
  16708. };
  16709. a.prototype.next = function() {
  16710. var a = this.getOneResourceItem();
  16711. if (a) if (a.loaded) this.onItemComplete(a);
  16712. else {
  16713. var d = this.analyzerDic[a.type];
  16714. d || (d = this.analyzerDic[a.type] = egret.Injector.getInstance(c.AnalyzerBase, a.type));
  16715. d.loadFile(a, this.onItemComplete, this)
  16716. }
  16717. };
  16718. a.prototype.getOneResourceItem = function() {
  16719. var a = Number.NEGATIVE_INFINITY,
  16720. c;
  16721. for (c in this.priorityQueue) a = Math.max(a, c);
  16722. a = this.priorityQueue[a];
  16723. if (!a || 0 == a.length) return 0 == this.lazyLoadList.length ? null: this.lazyLoadList.pop();
  16724. c = a.length;
  16725. for (var d, e = 0; e < c; e++) {
  16726. this.queueIndex >= c && (this.queueIndex = 0);
  16727. d = this.itemListDic[a[this.queueIndex]];
  16728. if (0 < d.length) break;
  16729. this.queueIndex++
  16730. }
  16731. return 0 == d.length ? null: d.shift()
  16732. };
  16733. a.prototype.onItemComplete = function(a) {
  16734. var d = a.groupName;
  16735. a.loaded || c.ResourceEvent.dispatchResourceEvent(this.resInstance, c.ResourceEvent.ITEM_LOAD_ERROR, d, a);
  16736. if (d) {
  16737. this.numLoadedDic[d]++;
  16738. var e = this.numLoadedDic[d],
  16739. m = this.groupTotalDic[d];
  16740. c.ResourceEvent.dispatchResourceEvent(this.resInstance, c.ResourceEvent.GROUP_PROGRESS, d, a, e, m);
  16741. e == m && (this.removeGroupName(d), delete this.groupTotalDic[d], delete this.numLoadedDic[d], delete this.itemListDic[d], c.ResourceEvent.dispatchResourceEvent(this, c.ResourceEvent.GROUP_COMPLETE, d))
  16742. } else this.callBack.call(this.resInstance, a);
  16743. this.next()
  16744. };
  16745. a.prototype.removeGroupName = function(a) {
  16746. for (var c in this.priorityQueue) {
  16747. for (var d = this.priorityQueue[c], e = d.length, g = 0, h = !1, e = d.length, l = 0; l < e; l++) {
  16748. if (d[l] == a) {
  16749. d.splice(g, 1);
  16750. h = !0;
  16751. break
  16752. }
  16753. g++
  16754. }
  16755. if (h) {
  16756. 0 == d.length && delete this.priorityQueue[c];
  16757. break
  16758. }
  16759. }
  16760. };
  16761. return a
  16762. } (egret.EventDispatcher);
  16763. c.ResourceLoader = e;
  16764. e.prototype.__class__ = "RES.ResourceLoader"
  16765. })(RES || (RES = {}));
  16766. __extends = this.__extends ||
  16767. function(c, e) {
  16768. function d() {
  16769. this.constructor = c
  16770. }
  16771. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  16772. d.prototype = e.prototype;
  16773. c.prototype = new d
  16774. }; (function(c) {
  16775. var e = function(c) {
  16776. function a() {
  16777. c.call(this)
  16778. }
  16779. __extends(a, c);
  16780. a.prototype.loadFile = function(a, c, d) {};
  16781. a.prototype.getRes = function(a) {};
  16782. a.prototype.destroyRes = function(a) {
  16783. return ! 1
  16784. };
  16785. a.getStringPrefix = function(a) {
  16786. if (!a) return "";
  16787. var c = a.indexOf(".");
  16788. return - 1 != c ? a.substring(0, c) : ""
  16789. };
  16790. a.getStringTail = function(a) {
  16791. if (!a) return "";
  16792. var c = a.indexOf(".");
  16793. return - 1 != c ? a.substring(c + 1) : ""
  16794. };
  16795. return a
  16796. } (egret.HashObject);
  16797. c.AnalyzerBase = e;
  16798. e.prototype.__class__ = "RES.AnalyzerBase"
  16799. })(RES || (RES = {}));
  16800. __extends = this.__extends ||
  16801. function(c, e) {
  16802. function d() {
  16803. this.constructor = c
  16804. }
  16805. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  16806. d.prototype = e.prototype;
  16807. c.prototype = new d
  16808. }; (function(c) {
  16809. var e = function(c) {
  16810. function a() {
  16811. c.call(this);
  16812. this.fileDic = {};
  16813. this.resItemDic = [];
  16814. this._dataFormat = egret.URLLoaderDataFormat.BINARY;
  16815. this.recycler = new egret.Recycler
  16816. }
  16817. __extends(a, c);
  16818. a.prototype.loadFile = function(a, c, d) {
  16819. if (this.fileDic[a.name]) c.call(d, a);
  16820. else {
  16821. var e = this.getLoader();
  16822. this.resItemDic[e.hashCode] = {
  16823. item: a,
  16824. func: c,
  16825. thisObject: d
  16826. };
  16827. e.load(new egret.URLRequest(a.url))
  16828. }
  16829. };
  16830. a.prototype.getLoader = function() {
  16831. var a = this.recycler.pop();
  16832. a || (a = new egret.URLLoader, a.addEventListener(egret.Event.COMPLETE, this.onLoadFinish, this), a.addEventListener(egret.IOErrorEvent.IO_ERROR, this.onLoadFinish, this));
  16833. a.dataFormat = this._dataFormat;
  16834. return a
  16835. };
  16836. a.prototype.onLoadFinish = function(a) {
  16837. var c = a.target,
  16838. d = this.resItemDic[c.hashCode];
  16839. delete this.resItemDic[c.hashCode];
  16840. this.recycler.push(c);
  16841. var e = d.item,
  16842. g = d.func;
  16843. e.loaded = a.type == egret.Event.COMPLETE;
  16844. e.loaded && this.analyzeData(e, c.data);
  16845. g.call(d.thisObject, e)
  16846. };
  16847. a.prototype.analyzeData = function(a, c) {
  16848. var d = a.name; ! this.fileDic[d] && c && (this.fileDic[d] = c)
  16849. };
  16850. a.prototype.getRes = function(a) {
  16851. return this.fileDic[a]
  16852. };
  16853. a.prototype.hasRes = function(a) {
  16854. return null != this.getRes(a)
  16855. };
  16856. a.prototype.destroyRes = function(a) {
  16857. return this.fileDic[a] ? (delete this.fileDic[a], !0) : !1
  16858. };
  16859. return a
  16860. } (c.AnalyzerBase);
  16861. c.BinAnalyzer = e;
  16862. e.prototype.__class__ = "RES.BinAnalyzer"
  16863. })(RES || (RES = {}));
  16864. __extends = this.__extends ||
  16865. function(c, e) {
  16866. function d() {
  16867. this.constructor = c
  16868. }
  16869. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  16870. d.prototype = e.prototype;
  16871. c.prototype = new d
  16872. }; (function(c) {
  16873. var e = function(c) {
  16874. function a() {
  16875. c.call(this);
  16876. this._dataFormat = egret.URLLoaderDataFormat.TEXTURE
  16877. }
  16878. __extends(a, c);
  16879. a.prototype.analyzeData = function(a, c) {
  16880. var d = a.name; ! this.fileDic[d] && c && (this.fileDic[d] = c, (d = a.data) && d.scale9grid && (d = d.scale9grid.split(","), c.scale9Grid = new egret.Rectangle(parseInt(d[0]), parseInt(d[1]), parseInt(d[2]), parseInt(d[3]))))
  16881. };
  16882. return a
  16883. } (c.BinAnalyzer);
  16884. c.ImageAnalyzer = e;
  16885. e.prototype.__class__ = "RES.ImageAnalyzer"
  16886. })(RES || (RES = {}));
  16887. __extends = this.__extends ||
  16888. function(c, e) {
  16889. function d() {
  16890. this.constructor = c
  16891. }
  16892. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  16893. d.prototype = e.prototype;
  16894. c.prototype = new d
  16895. }; (function(c) {
  16896. var e = function(c) {
  16897. function a() {
  16898. c.call(this);
  16899. this._dataFormat = egret.URLLoaderDataFormat.TEXT
  16900. }
  16901. __extends(a, c);
  16902. a.prototype.analyzeData = function(a, c) {
  16903. var d = a.name;
  16904. if (!this.fileDic[d] && c) try {
  16905. this.fileDic[d] = JSON.parse(c)
  16906. } catch(e) {}
  16907. };
  16908. return a
  16909. } (c.BinAnalyzer);
  16910. c.JsonAnalyzer = e;
  16911. e.prototype.__class__ = "RES.JsonAnalyzer"
  16912. })(RES || (RES = {}));
  16913. __extends = this.__extends ||
  16914. function(c, e) {
  16915. function d() {
  16916. this.constructor = c
  16917. }
  16918. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  16919. d.prototype = e.prototype;
  16920. c.prototype = new d
  16921. }; (function(c) {
  16922. var e = function(c) {
  16923. function a() {
  16924. c.call(this);
  16925. this._dataFormat = egret.URLLoaderDataFormat.TEXT
  16926. }
  16927. __extends(a, c);
  16928. return a
  16929. } (c.BinAnalyzer);
  16930. c.TextAnalyzer = e;
  16931. e.prototype.__class__ = "RES.TextAnalyzer"
  16932. })(RES || (RES = {}));
  16933. __extends = this.__extends ||
  16934. function(c, e) {
  16935. function d() {
  16936. this.constructor = c
  16937. }
  16938. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  16939. d.prototype = e.prototype;
  16940. c.prototype = new d
  16941. }; (function(c) {
  16942. var e = function(d) {
  16943. function a() {
  16944. d.call(this);
  16945. this.sheetMap = {};
  16946. this._dataFormat = egret.URLLoaderDataFormat.TEXT
  16947. }
  16948. __extends(a, d);
  16949. a.prototype.getRes = function(a) {
  16950. var d = this.fileDic[a]; ! d && (d = c.AnalyzerBase.getStringPrefix(a), d = this.fileDic[d]) && (a = c.AnalyzerBase.getStringTail(a), d = d.getTexture(a));
  16951. return d
  16952. };
  16953. a.prototype.onLoadFinish = function(a) {
  16954. var c = a.target,
  16955. d = this.resItemDic[c.hashCode];
  16956. delete this.resItemDic[c.hashCode];
  16957. this.recycler.push(c);
  16958. var e = d.item,
  16959. g = d.func;
  16960. e.loaded = a.type == egret.Event.COMPLETE;
  16961. e.loaded && this.analyzeData(e, c.data);
  16962. "string" == typeof c.data ? (this._dataFormat = egret.URLLoaderDataFormat.TEXTURE, this.loadFile(e, g, d.thisObject), this._dataFormat = egret.URLLoaderDataFormat.TEXT) : g.call(d.thisObject, e)
  16963. };
  16964. a.prototype.analyzeData = function(a, c) {
  16965. var d = a.name;
  16966. if (!this.fileDic[d] && c) {
  16967. var e;
  16968. if ("string" == typeof c) {
  16969. try {
  16970. e = JSON.parse(c)
  16971. } catch(g) {}
  16972. e && (this.sheetMap[d] = e, a.loaded = !1, a.url = this.getRelativePath(a.url, e.file))
  16973. } else e = this.sheetMap[d],
  16974. delete this.sheetMap[d],
  16975. c && (e = this.parseSpriteSheet(c, e), this.fileDic[d] = e)
  16976. }
  16977. };
  16978. a.prototype.getRelativePath = function(a, c) {
  16979. a = a.split("\\").join("/");
  16980. var d = a.lastIndexOf("/");
  16981. return a = -1 != d ? a.substring(0, d + 1) + c: c
  16982. };
  16983. a.prototype.parseSpriteSheet = function(a, c) {
  16984. var d = c.frames;
  16985. if (!d) return null;
  16986. var e = new egret.SpriteSheet(a),
  16987. g;
  16988. for (g in d) {
  16989. var h = d[g];
  16990. e.createTexture(g, h.x, h.y, h.w, h.h, h.offX, h.offY, h.sourceW, h.sourceH)
  16991. }
  16992. return e
  16993. };
  16994. return a
  16995. } (c.BinAnalyzer);
  16996. c.SheetAnalyzer = e;
  16997. e.prototype.__class__ = "RES.SheetAnalyzer"
  16998. })(RES || (RES = {}));
  16999. __extends = this.__extends ||
  17000. function(c, e) {
  17001. function d() {
  17002. this.constructor = c
  17003. }
  17004. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  17005. d.prototype = e.prototype;
  17006. c.prototype = new d
  17007. }; (function(c) {
  17008. var e = function(c) {
  17009. function a() {
  17010. c.call(this)
  17011. }
  17012. __extends(a, c);
  17013. a.prototype.analyzeData = function(a, c) {
  17014. var d = a.name;
  17015. if (!this.fileDic[d] && c) {
  17016. var e;
  17017. "string" == typeof c ? (e = c, this.sheetMap[d] = e, a.loaded = !1, a.url = this.getTexturePath(a.url, e)) : (e = this.sheetMap[d], delete this.sheetMap[d], c && (e = new egret.BitmapTextSpriteSheet(c, e), this.fileDic[d] = e))
  17018. }
  17019. };
  17020. a.prototype.getTexturePath = function(a, c) {
  17021. var d = "",
  17022. e = c.split("\n")[2],
  17023. g = e.indexOf('file="'); - 1 != g && (e = e.substring(g + 6), g = e.indexOf('"'), d = e.substring(0, g));
  17024. a = a.split("\\").join("/");
  17025. g = a.lastIndexOf("/");
  17026. return a = -1 != g ? a.substring(0, g + 1) + d: d
  17027. };
  17028. return a
  17029. } (c.SheetAnalyzer);
  17030. c.FontAnalyzer = e;
  17031. e.prototype.__class__ = "RES.FontAnalyzer"
  17032. })(RES || (RES = {}));
  17033. __extends = this.__extends ||
  17034. function(c, e) {
  17035. function d() {
  17036. this.constructor = c
  17037. }
  17038. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  17039. d.prototype = e.prototype;
  17040. c.prototype = new d
  17041. }; (function(c) {
  17042. var e = function(c) {
  17043. function a() {
  17044. c.call(this);
  17045. this._dataFormat = egret.URLLoaderDataFormat.SOUND
  17046. }
  17047. __extends(a, c);
  17048. return a
  17049. } (c.BinAnalyzer);
  17050. c.SoundAnalyzer = e;
  17051. e.prototype.__class__ = "RES.SoundAnalyzer"
  17052. })(RES || (RES = {}));
  17053. __extends = this.__extends ||
  17054. function(c, e) {
  17055. function d() {
  17056. this.constructor = c
  17057. }
  17058. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  17059. d.prototype = e.prototype;
  17060. c.prototype = new d
  17061. }; (function(c) {
  17062. var e = function(c) {
  17063. function a() {
  17064. c.call(this);
  17065. this._dataFormat = egret.URLLoaderDataFormat.TEXT
  17066. }
  17067. __extends(a, c);
  17068. a.prototype.analyzeData = function(a, c) {
  17069. var d = a.name;
  17070. if (!this.fileDic[d] && c) try {
  17071. var e = egret.XML.parse(c);
  17072. this.fileDic[d] = e
  17073. } catch(g) {}
  17074. };
  17075. return a
  17076. } (c.BinAnalyzer);
  17077. c.XMLAnalyzer = e;
  17078. e.prototype.__class__ = "RES.XMLAnalyzer"
  17079. })(RES || (RES = {}));
  17080. __extends = this.__extends ||
  17081. function(c, e) {
  17082. function d() {
  17083. this.constructor = c
  17084. }
  17085. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  17086. d.prototype = e.prototype;
  17087. c.prototype = new d
  17088. }; (function(c) {
  17089. c.loadConfig = function(a, b) {
  17090. "undefined" === typeof b && (b = "");
  17091. d.loadConfig(a, b)
  17092. };
  17093. c.loadGroup = function(a, b) {
  17094. "undefined" === typeof b && (b = 0);
  17095. d.loadGroup(a, b)
  17096. };
  17097. c.isGroupLoaded = function(a) {
  17098. return d.isGroupLoaded(a)
  17099. };
  17100. c.getGroupByName = function(a) {
  17101. return d.getGroupByName(a)
  17102. };
  17103. c.createGroup = function(a, b, c) {
  17104. "undefined" === typeof c && (c = !1);
  17105. return d.createGroup(a, b, c)
  17106. };
  17107. c.hasRes = function(a) {
  17108. return d.hasRes(a)
  17109. };
  17110. c.getRes = function(a) {
  17111. return d.getRes(a)
  17112. };
  17113. c.getResAsync = function(a, b, c) {
  17114. d.getResAsync(a, b, c)
  17115. };
  17116. c.getResByUrl = function(a, b, c, e) {
  17117. "undefined" === typeof e && (e = "");
  17118. d.getResByUrl(a, b, c, e)
  17119. };
  17120. c.destroyRes = function(a) {
  17121. return d.destroyRes(a)
  17122. };
  17123. c.addEventListener = function(a, b, c, e, m) {
  17124. "undefined" === typeof e && (e = !1);
  17125. "undefined" === typeof m && (m = 0);
  17126. d.addEventListener(a, b, c, e, m)
  17127. };
  17128. c.removeEventListener = function(a, b, c, e) {
  17129. "undefined" === typeof e && (e = !1);
  17130. d.removeEventListener(a, b, c, e)
  17131. };
  17132. var e = function(a) {
  17133. function b() {
  17134. a.call(this);
  17135. this.analyzerDic = {};
  17136. this.configComplete = !1;
  17137. this.loadedGroups = [];
  17138. this.groupNameList = [];
  17139. this.asyncDic = {};
  17140. this.init()
  17141. }
  17142. __extends(b, a);
  17143. b.prototype.getAnalyzerByType = function(a) {
  17144. var b = this.analyzerDic[a];
  17145. b || (b = this.analyzerDic[a] = egret.Injector.getInstance(c.AnalyzerBase, a));
  17146. return b
  17147. };
  17148. b.prototype.init = function() {
  17149. egret.Injector.hasMapRule(c.AnalyzerBase, c.ResourceItem.TYPE_BIN) || egret.Injector.mapClass(c.AnalyzerBase, c.BinAnalyzer, c.ResourceItem.TYPE_BIN);
  17150. egret.Injector.hasMapRule(c.AnalyzerBase, c.ResourceItem.TYPE_IMAGE) || egret.Injector.mapClass(c.AnalyzerBase, c.ImageAnalyzer, c.ResourceItem.TYPE_IMAGE);
  17151. egret.Injector.hasMapRule(c.AnalyzerBase, c.ResourceItem.TYPE_TEXT) || egret.Injector.mapClass(c.AnalyzerBase, c.TextAnalyzer, c.ResourceItem.TYPE_TEXT);
  17152. egret.Injector.hasMapRule(c.AnalyzerBase, c.ResourceItem.TYPE_JSON) || egret.Injector.mapClass(c.AnalyzerBase, c.JsonAnalyzer, c.ResourceItem.TYPE_JSON);
  17153. egret.Injector.hasMapRule(c.AnalyzerBase, c.ResourceItem.TYPE_SHEET) || egret.Injector.mapClass(c.AnalyzerBase, c.SheetAnalyzer, c.ResourceItem.TYPE_SHEET);
  17154. egret.Injector.hasMapRule(c.AnalyzerBase, c.ResourceItem.TYPE_FONT) || egret.Injector.mapClass(c.AnalyzerBase, c.FontAnalyzer, c.ResourceItem.TYPE_FONT);
  17155. egret.Injector.hasMapRule(c.AnalyzerBase, c.ResourceItem.TYPE_SOUND) || egret.Injector.mapClass(c.AnalyzerBase, c.SoundAnalyzer, c.ResourceItem.TYPE_SOUND);
  17156. egret.Injector.hasMapRule(c.AnalyzerBase, c.ResourceItem.TYPE_XML) || egret.Injector.mapClass(c.AnalyzerBase, c.XMLAnalyzer, c.ResourceItem.TYPE_XML);
  17157. this.resConfig = new c.ResourceConfig;
  17158. this.resLoader = new c.ResourceLoader;
  17159. this.resLoader.callBack = this.onResourceItemComp;
  17160. this.resLoader.resInstance = this;
  17161. this.resLoader.addEventListener(c.ResourceEvent.GROUP_COMPLETE, this.onGroupComp, this)
  17162. };
  17163. b.prototype.loadConfig = function(a, d) {
  17164. this.configURL = a;
  17165. this.resourceRoot = d;
  17166. var e = [new c.ResourceItem(a, a, c.ResourceItem.TYPE_JSON)];
  17167. this.resLoader.loadGroup(e, b.GROUP_CONFIG, Number.MAX_VALUE)
  17168. };
  17169. b.prototype.isGroupLoaded = function(a) {
  17170. return - 1 != this.loadedGroups.indexOf(a)
  17171. };
  17172. b.prototype.getGroupByName = function(a) {
  17173. return this.resConfig.getGroupByName(a)
  17174. };
  17175. b.prototype.loadGroup = function(a, b) {
  17176. "undefined" === typeof b && (b = 0);
  17177. if ( - 1 == this.loadedGroups.indexOf(a) && !this.resLoader.isGroupInLoading(a)) if (this.configComplete) {
  17178. var c = this.resConfig.getGroupByName(a);
  17179. this.resLoader.loadGroup(c, a, b)
  17180. } else this.groupNameList.push({
  17181. name: a,
  17182. priority: b
  17183. })
  17184. };
  17185. b.prototype.createGroup = function(a, b, c) {
  17186. "undefined" === typeof c && (c = !1);
  17187. return this.resConfig.createGroup(a, b, c)
  17188. };
  17189. b.prototype.onGroupComp = function(a) {
  17190. if (a.groupName == b.GROUP_CONFIG) {
  17191. a = this.getAnalyzerByType(c.ResourceItem.TYPE_JSON);
  17192. var d = a.getRes(this.configURL);
  17193. a.destroyRes(this.configURL);
  17194. this.resConfig.parseConfig(d, this.resourceRoot);
  17195. this.configComplete = !0;
  17196. c.ResourceEvent.dispatchResourceEvent(this, c.ResourceEvent.CONFIG_COMPLETE);
  17197. a = this.groupNameList;
  17198. for (var d = a.length,
  17199. e = 0; e < d; e++) {
  17200. var g = a[e];
  17201. this.loadGroup(g.name, g.priority)
  17202. }
  17203. this.groupNameList = []
  17204. } else this.loadedGroups.push(a.groupName),
  17205. this.dispatchEvent(a)
  17206. };
  17207. b.prototype.hasRes = function(a) {
  17208. var b = this.resConfig.getType(a);
  17209. return "" == b && (a = c.AnalyzerBase.getStringPrefix(a), b = this.resConfig.getType(a), "" == b) ? !1 : !0
  17210. };
  17211. b.prototype.getRes = function(a) {
  17212. var b = this.resConfig.getType(a);
  17213. return "" == b && (b = c.AnalyzerBase.getStringPrefix(a), b = this.resConfig.getType(b), "" == b) ? null: this.getAnalyzerByType(b).getRes(a)
  17214. };
  17215. b.prototype.getResAsync = function(a, b, d) {
  17216. var e = this.resConfig.getType(a),
  17217. h = a;
  17218. if ("" == e && (h = c.AnalyzerBase.getStringPrefix(a), e = this.resConfig.getType(h), "" == e)) {
  17219. b.call(d, null);
  17220. return
  17221. } (e = this.getAnalyzerByType(e).getRes(a)) ? b.call(d, e) : (a = {
  17222. name: a,
  17223. compFunc: b,
  17224. thisObject: d
  17225. },
  17226. this.asyncDic[h] ? this.asyncDic[h].push(a) : (this.asyncDic[h] = [a], h = this.resConfig.getResourceItem(h), this.resLoader.loadItem(h)))
  17227. };
  17228. b.prototype.getResByUrl = function(a, b, d, e) {
  17229. "undefined" === typeof e && (e = "");
  17230. if (a) {
  17231. e || (e = this.getTypeByUrl(a));
  17232. var h = this.getAnalyzerByType(e).getRes(a);
  17233. h ? b.call(d, h) : (b = {
  17234. name: a,
  17235. compFunc: b,
  17236. thisObject: d
  17237. },
  17238. this.asyncDic[a] ? this.asyncDic[a].push(b) : (this.asyncDic[a] = [b], a = new c.ResourceItem(a, a, e), this.resLoader.loadItem(a)))
  17239. } else b.call(d, null)
  17240. };
  17241. b.prototype.getTypeByUrl = function(a) {
  17242. a = a.substr(a.lastIndexOf(".") + 1);
  17243. switch (a) {
  17244. case c.ResourceItem.TYPE_XML:
  17245. case c.ResourceItem.TYPE_JSON:
  17246. case c.ResourceItem.TYPE_SHEET:
  17247. break;
  17248. case "png":
  17249. case "jpg":
  17250. case "gif":
  17251. a = c.ResourceItem.TYPE_IMAGE;
  17252. break;
  17253. case "fnt":
  17254. a = c.ResourceItem.TYPE_FONT;
  17255. break;
  17256. case "txt":
  17257. a = c.ResourceItem.TYPE_TEXT;
  17258. break;
  17259. default:
  17260. a = c.ResourceItem.TYPE_BIN
  17261. }
  17262. return a
  17263. };
  17264. b.prototype.onResourceItemComp = function(a) {
  17265. var b = this.asyncDic[a.name];
  17266. delete this.asyncDic[a.name];
  17267. a = this.getAnalyzerByType(a.type);
  17268. for (var c = b.length,
  17269. d = 0; d < c; d++) {
  17270. var e = b[d],
  17271. l = a.getRes(e.name);
  17272. e.compFunc.call(e.thisObject, l)
  17273. }
  17274. };
  17275. b.prototype.destroyRes = function(a) {
  17276. var b = this.resConfig.getRawGroupByName(a);
  17277. if (b) {
  17278. var c = this.loadedGroups.indexOf(a); - 1 != c && this.loadedGroups.splice(c, 1);
  17279. a = b.length;
  17280. for (var d = 0; d < a; d++) {
  17281. c = b[d];
  17282. c.loaded = !1;
  17283. var e = this.getAnalyzerByType(c.type);
  17284. e.destroyRes(c.name)
  17285. }
  17286. return ! 0
  17287. }
  17288. b = this.resConfig.getType(a);
  17289. if ("" == b) return ! 1;
  17290. c = this.resConfig.getRawResourceItem(a);
  17291. c.loaded = !1;
  17292. e = this.getAnalyzerByType(b);
  17293. return e.destroyRes(a)
  17294. };
  17295. b.GROUP_CONFIG = "RES__CONFIG";
  17296. return b
  17297. } (egret.EventDispatcher);
  17298. e.prototype.__class__ = "Resource";
  17299. var d = new e
  17300. })(RES || (RES = {}));
  17301. __extends = this.__extends ||
  17302. function(c, e) {
  17303. function d() {
  17304. this.constructor = c
  17305. }
  17306. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  17307. d.prototype = e.prototype;
  17308. c.prototype = new d
  17309. }; (function(c) {
  17310. var e = function(d) {
  17311. function a(b) {
  17312. "undefined" === typeof b && (b = 60);
  17313. d.call(this);
  17314. this.frameRate = b;
  17315. this._time = 0;
  17316. 60 == b && (a.requestAnimationFrame = window.requestAnimationFrame || window.webkitRequestAnimationFrame || window.mozRequestAnimationFrame || window.oRequestAnimationFrame || window.msRequestAnimationFrame, a.cancelAnimationFrame = window.cancelAnimationFrame || window.msCancelAnimationFrame || window.mozCancelAnimationFrame || window.webkitCancelAnimationFrame || window.oCancelAnimationFrame || window.cancelRequestAnimationFrame || window.msCancelRequestAnimationFrame || window.mozCancelRequestAnimationFrame || window.oCancelRequestAnimationFrame || window.webkitCancelRequestAnimationFrame);
  17317. a.requestAnimationFrame || (a.requestAnimationFrame = function(a) {
  17318. return window.setTimeout(a, 1E3 / b)
  17319. });
  17320. a.cancelAnimationFrame || (a.cancelAnimationFrame = function(a) {
  17321. return window.clearTimeout(a)
  17322. });
  17323. a.instance = this;
  17324. this.registerListener()
  17325. }
  17326. __extends(a, d);
  17327. a.prototype.enterFrame = function() {
  17328. var b = a.instance,
  17329. d = a._thisObject,
  17330. e = a._callback,
  17331. m = c.getTimer();
  17332. e.call(d, m - b._time);
  17333. b._time = m;
  17334. b._requestAnimationId = a.requestAnimationFrame.call(window, a.prototype.enterFrame)
  17335. };
  17336. a.prototype.executeMainLoop = function(b, c) {
  17337. a._callback = b;
  17338. a._thisObject = c;
  17339. this.enterFrame()
  17340. };
  17341. a.prototype.reset = function() {
  17342. var b = a.instance;
  17343. b._requestAnimationId && (b._time = c.getTimer(), a.cancelAnimationFrame.call(window, b._requestAnimationId), b.enterFrame())
  17344. };
  17345. a.prototype.registerListener = function() {
  17346. var b = function() {
  17347. a.instance.reset()
  17348. },
  17349. c = function() {
  17350. document[d] || b()
  17351. };
  17352. window.onfocus = b;
  17353. window.onblur = function() {};
  17354. var d, e;
  17355. "undefined" !== typeof document.hidden ? (d = "hidden", e = "visibilitychange") : "undefined" !== typeof document.mozHidden ? (d = "mozHidden", e = "mozvisibilitychange") : "undefined" !== typeof document.msHidden ? (d = "msHidden", e = "msvisibilitychange") : "undefined" !== typeof document.webkitHidden && (d = "webkitHidden", e = "webkitvisibilitychange");
  17356. "onpageshow" in window && "onpagehide" in window && window.addEventListener("pageshow", b, !1);
  17357. d && e && document.addEventListener(e, c, !1)
  17358. };
  17359. return a
  17360. } (c.DeviceContext);
  17361. c.HTML5DeviceContext = e;
  17362. e.prototype.__class__ = "egret.HTML5DeviceContext"
  17363. })(egret || (egret = {}));
  17364. __extends = this.__extends ||
  17365. function(c, e) {
  17366. function d() {
  17367. this.constructor = c
  17368. }
  17369. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  17370. d.prototype = e.prototype;
  17371. c.prototype = new d
  17372. }; (function(c) {
  17373. var e = function(d) {
  17374. function a(a) {
  17375. this.canvas = a;
  17376. this.canvasContext = a.getContext("2d");
  17377. var c = this.canvasContext.setTransform,
  17378. e = this;
  17379. this.canvasContext.setTransform = function(a, b, d, l, n, p) {
  17380. e._matrixA = a;
  17381. e._matrixB = b;
  17382. e._matrixC = d;
  17383. e._matrixD = l;
  17384. e._matrixTx = n;
  17385. e._matrixTy = p;
  17386. c.call(e.canvasContext, a, b, d, l, n, p)
  17387. };
  17388. this._matrixA = 1;
  17389. this._matrixC = this._matrixB = 0;
  17390. this._matrixD = 1;
  17391. this._transformTy = this._transformTx = this._matrixTy = this._matrixTx = 0;
  17392. d.call(this)
  17393. }
  17394. __extends(a, d);
  17395. a.prototype.clearScreen = function() {
  17396. this.setTransform(c.Matrix.identity.identity());
  17397. for (var a = c.RenderFilter.getInstance().getDrawAreaList(), d = 0, e = a.length; d < e; d++) {
  17398. var m = a[d];
  17399. this.clearRect(m.x + this._transformTx, m.y + this._transformTy, m.width, m.height)
  17400. }
  17401. this.renderCost = 0
  17402. };
  17403. a.prototype.clearRect = function(a, c, d, e) {
  17404. this.canvasContext.clearRect(a, c, d, e)
  17405. };
  17406. a.prototype.drawImage = function(a, e, f, m, g, h, l, n, p) {
  17407. e /= c.MainContext.instance.rendererContext.texture_scale_factor;
  17408. f /= c.MainContext.instance.rendererContext.texture_scale_factor;
  17409. m /= c.MainContext.instance.rendererContext.texture_scale_factor;
  17410. g /= c.MainContext.instance.rendererContext.texture_scale_factor;
  17411. a = a._bitmapData;
  17412. h += this._transformTx;
  17413. l += this._transformTy;
  17414. var q = c.getTimer();
  17415. this.canvasContext.drawImage(a, e, f, m, g, h, l, n, p);
  17416. d.prototype.drawImage.call(this, a, e, f, m, g, h, l, n, p);
  17417. this.renderCost += c.getTimer() - q
  17418. };
  17419. a.prototype.setTransform = function(a) {
  17420. 1 == a.a && 0 == a.b && 0 == a.c && 1 == a.d && 1 == this._matrixA && 0 == this._matrixB && 0 == this._matrixC && 1 == this._matrixD ? (this._transformTx = a.tx - this._matrixTx, this._transformTy = a.ty - this._matrixTy) : (this._transformTx = this._transformTy = 0, this._matrixA == a.a && this._matrixB == a.b && this._matrixC == a.c && this._matrixD == a.d && this._matrixTx == a.tx && this._matrixTy == a.ty || this.canvasContext.setTransform(a.a, a.b, a.c, a.d, a.tx, a.ty))
  17421. };
  17422. a.prototype.setAlpha = function(a, d) {
  17423. a != this.canvasContext.globalAlpha && (this.canvasContext.globalAlpha = a);
  17424. d ? (this.blendValue = d, this.canvasContext.globalCompositeOperation = d) : this.blendValue != c.BlendMode.NORMAL && (this.blendValue = c.BlendMode.NORMAL, this.canvasContext.globalCompositeOperation = c.BlendMode.NORMAL)
  17425. };
  17426. a.prototype.setupFont = function(a) {
  17427. var c = this.canvasContext,
  17428. d = a.italic ? "italic ": "normal ",
  17429. d = d + (a.bold ? "bold ": "normal "),
  17430. d = d + (a.size + "px " + a.fontFamily);
  17431. c.font = d;
  17432. c.textAlign = "left";
  17433. c.textBaseline = "middle"
  17434. };
  17435. a.prototype.measureText = function(a) {
  17436. return this.canvasContext.measureText(a).width
  17437. };
  17438. a.prototype.drawText = function(a, c, e, m, g) {
  17439. var h = a._strokeColorString,
  17440. l = a.stroke,
  17441. n = this.canvasContext;
  17442. n.fillStyle = a._textColorString;
  17443. n.strokeStyle = h;
  17444. l && (n.lineWidth = 2 * l, n.strokeText(c, e + this._transformTx, m + this._transformTy, g || 65535));
  17445. n.fillText(c, e + this._transformTx, m + this._transformTy, g || 65535);
  17446. d.prototype.drawText.call(this, a, c, e, m, g)
  17447. };
  17448. a.prototype.strokeRect = function(a, c, d, e, g) {
  17449. this.canvasContext.strokeStyle = g;
  17450. this.canvasContext.strokeRect(a, c, d, e)
  17451. };
  17452. a.prototype.pushMask = function(a) {
  17453. this.canvasContext.save();
  17454. this.canvasContext.beginPath();
  17455. this.canvasContext.rect(a.x + this._transformTx, a.y + this._transformTy, a.width, a.height);
  17456. this.canvasContext.clip();
  17457. this.canvasContext.closePath()
  17458. };
  17459. a.prototype.popMask = function() {
  17460. this.canvasContext.restore();
  17461. this.canvasContext.setTransform(1, 0, 0, 1, 0, 0)
  17462. };
  17463. return a
  17464. } (c.RendererContext);
  17465. c.HTML5CanvasRenderer = e;
  17466. e.prototype.__class__ = "egret.HTML5CanvasRenderer"
  17467. })(egret || (egret = {}));
  17468. var egret_h5_graphics; (function(c) {
  17469. c.beginFill = function(c, a) {
  17470. "undefined" === typeof a && (a = 1);
  17471. var b = "rgba(" + (c >> 16) + "," + ((c & 65280) >> 8) + "," + (c & 255) + "," + a + ")";
  17472. this.fillStyleColor = b;
  17473. this.commandQueue.push(new e(this._setStyle, this, [b]))
  17474. };
  17475. c.drawRect = function(c, a, b, k) {
  17476. this.commandQueue.push(new e(function(a, b, c, d) {
  17477. var e = this.renderContext;
  17478. this.canvasContext.beginPath();
  17479. this.canvasContext.rect(e._transformTx + a, e._transformTy + b, c, d);
  17480. this.canvasContext.closePath()
  17481. },
  17482. this, [c, a, b, k]));
  17483. this._fill()
  17484. };
  17485. c.drawCircle = function(c, a, b) {
  17486. this.commandQueue.push(new e(function(a, b, c) {
  17487. var d = this.renderContext;
  17488. this.canvasContext.beginPath();
  17489. this.canvasContext.arc(d._transformTx + a, d._transformTy + b, c, 0, 2 * Math.PI);
  17490. this.canvasContext.closePath()
  17491. },
  17492. this, [c, a, b]));
  17493. this._fill()
  17494. };
  17495. c.lineStyle = function(c, a, b, k, f, m, g, h) {
  17496. "undefined" === typeof c && (c = NaN);
  17497. "undefined" === typeof a && (a = 0);
  17498. "undefined" === typeof b && (b = 1);
  17499. "undefined" === typeof k && (k = !1);
  17500. "undefined" === typeof f && (f = "normal");
  17501. "undefined" === typeof m && (m = null);
  17502. "undefined" === typeof g && (g = null);
  17503. "undefined" === typeof h && (h = 3);
  17504. this.strokeStyleColor && (this.createEndLineCommand(), this.commandQueue.push(this.endLineCommand));
  17505. this.strokeStyleColor = a = "rgba(" + (a >> 16) + "," + ((a & 65280) >> 8) + "," + (a & 255) + "," + b + ")";
  17506. this.commandQueue.push(new e(function(a, b) {
  17507. this.canvasContext.lineWidth = a;
  17508. this.canvasContext.strokeStyle = b;
  17509. this.canvasContext.beginPath()
  17510. },
  17511. this, [c, a]));
  17512. "undefined" === typeof this.lineX && (this.lineY = this.lineX = 0);
  17513. this.moveTo(this.lineX, this.lineY)
  17514. };
  17515. c.lineTo = function(c, a) {
  17516. this.commandQueue.push(new e(function(a, c) {
  17517. var d = this.renderContext;
  17518. this.canvasContext.lineTo(d._transformTx + a, d._transformTy + c)
  17519. },
  17520. this, [c, a]));
  17521. this.lineX = c;
  17522. this.lineY = a
  17523. };
  17524. c.curveTo = function(c, a, b, k) {
  17525. this.commandQueue.push(new e(function(a, b, c, d) {
  17526. var e = this.renderContext;
  17527. this.canvasContext.quadraticCurveTo(e._transformTx + a, e._transformTy + b, c, d)
  17528. },
  17529. this, [c, a, b, k]));
  17530. this.lineX = b;
  17531. this.lineY = k
  17532. };
  17533. c.moveTo = function(c, a) {
  17534. this.commandQueue.push(new e(function(a, c) {
  17535. var d = this.renderContext;
  17536. this.canvasContext.moveTo(d._transformTx + a, d._transformTy + c)
  17537. },
  17538. this, [c, a]))
  17539. };
  17540. c.clear = function() {
  17541. this.lineY = this.lineX = this.commandQueue.length = 0;
  17542. this.fillStyleColor = this.strokeStyleColor = null
  17543. };
  17544. c.createEndFillCommand = function() {
  17545. this.endFillCommand || (this.endFillCommand = new e(function() {
  17546. this.canvasContext.fill();
  17547. this.canvasContext.closePath()
  17548. },
  17549. this, null))
  17550. };
  17551. c.endFill = function() {
  17552. null != this.fillStyleColor && this._fill();
  17553. this.fillStyleColor = null
  17554. };
  17555. c._fill = function() {
  17556. this.fillStyleColor && (this.createEndFillCommand(), this.commandQueue.push(this.endFillCommand))
  17557. };
  17558. c.createEndLineCommand = function() {
  17559. this.endLineCommand || (this.endLineCommand = new e(function() {
  17560. this.canvasContext.stroke();
  17561. this.canvasContext.closePath()
  17562. },
  17563. this, null))
  17564. };
  17565. c._draw = function(c) {
  17566. this.renderContext = c;
  17567. c = this.canvasContext = this.renderContext.canvasContext;
  17568. c.save();
  17569. var a = this.commandQueue.length;
  17570. this.strokeStyleColor && 0 < a && this.commandQueue[a - 1] != this.endLineCommand && (this.createEndLineCommand(), this.commandQueue.push(this.endLineCommand));
  17571. for (var b = 0; b < a; b++) {
  17572. var e = this.commandQueue[b];
  17573. e.method.apply(e.thisObject, e.args)
  17574. }
  17575. c.restore()
  17576. };
  17577. var e = function() {
  17578. return function(c, a, b) {
  17579. this.method = c;
  17580. this.thisObject = a;
  17581. this.args = b
  17582. }
  17583. } ();
  17584. e.prototype.__class__ = "Command";
  17585. c._setStyle = function(c) {
  17586. this.canvasContext.fillStyle = c;
  17587. this.canvasContext.beginPath()
  17588. };
  17589. c.init = function() {
  17590. for (var d in c) egret.Graphics.prototype[d] = c[d];
  17591. egret.RendererContext.createRendererContext = function(a) {
  17592. return new egret.HTML5CanvasRenderer(a)
  17593. }
  17594. }
  17595. })(egret_h5_graphics || (egret_h5_graphics = {}));
  17596. egret_h5_graphics.init();
  17597. __extends = this.__extends ||
  17598. function(c, e) {
  17599. function d() {
  17600. this.constructor = c
  17601. }
  17602. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  17603. d.prototype = e.prototype;
  17604. c.prototype = new d
  17605. }; (function(c) {
  17606. var e = function(d) {
  17607. function a(a) {
  17608. d.call(this);
  17609. this.size = 2E3;
  17610. this.vertSize = 6;
  17611. this.contextLost = !1;
  17612. this.glContextId = 0;
  17613. this.currentBlendMode = "";
  17614. this.currentBaseTexture = null;
  17615. this.currentBatchSize = 0;
  17616. this.maskList = [];
  17617. this.maskDataFreeList = [];
  17618. this.canvasContext = document.createElement("canvas").getContext("2d");
  17619. console.log("\u4f7f\u7528WebGL\u6a21\u5f0f");
  17620. this.canvas = a;
  17621. a.addEventListener("webglcontextlost", this.handleContextLost.bind(this), !1);
  17622. a.addEventListener("webglcontextrestored", this.handleContextRestored.bind(this), !1);
  17623. this.projectionX = a.width / 2;
  17624. this.projectionY = -a.height / 2;
  17625. a = 6 * this.size;
  17626. this.vertices = new Float32Array(4 * this.size * this.vertSize);
  17627. this.indices = new Uint16Array(a);
  17628. for (var e = 0,
  17629. f = 0; e < a; e += 6, f += 4) this.indices[e + 0] = f + 0,
  17630. this.indices[e + 1] = f + 1,
  17631. this.indices[e + 2] = f + 2,
  17632. this.indices[e + 3] = f + 0,
  17633. this.indices[e + 4] = f + 2,
  17634. this.indices[e + 5] = f + 3;
  17635. this.initWebGL();
  17636. this.shaderManager = new c.WebGLShaderManager(this.gl);
  17637. this.worldTransform = new c.Matrix;
  17638. this.initBlendMode();
  17639. c.MainContext.instance.addEventListener(c.Event.FINISH_RENDER, this._draw, this);
  17640. c.TextField.prototype._draw = function(a) {
  17641. this.getDirty() && (this.cacheAsBitmap = !0);
  17642. c.DisplayObject.prototype._draw.call(this, a)
  17643. }
  17644. }
  17645. __extends(a, d);
  17646. a.prototype.handleContextLost = function() {
  17647. this.contextLost = !0
  17648. };
  17649. a.prototype.handleContextRestored = function() {
  17650. this.initWebGL();
  17651. this.shaderManager.setContext(this.gl);
  17652. this.contextLost = !1
  17653. };
  17654. a.prototype.initWebGL = function() {
  17655. for (var a = {
  17656. stencil: !0
  17657. },
  17658. c, d = ["experimental-webgl", "webgl"], e = 0; e < d.length; e++) {
  17659. try {
  17660. c = this.canvas.getContext(d[e], a)
  17661. } catch(g) {}
  17662. if (c) break
  17663. }
  17664. if (!c) throw Error("\u5f53\u524d\u6d4f\u89c8\u5668\u4e0d\u652f\u6301webgl");
  17665. this.setContext(c)
  17666. };
  17667. a.prototype.setContext = function(a) {
  17668. this.gl = a;
  17669. a.id = this.glContextId++;
  17670. this.vertexBuffer = a.createBuffer();
  17671. this.indexBuffer = a.createBuffer();
  17672. a.bindBuffer(a.ELEMENT_ARRAY_BUFFER, this.indexBuffer);
  17673. a.bufferData(a.ELEMENT_ARRAY_BUFFER, this.indices, a.STATIC_DRAW);
  17674. a.bindBuffer(a.ARRAY_BUFFER, this.vertexBuffer);
  17675. a.bufferData(a.ARRAY_BUFFER, this.vertices, a.DYNAMIC_DRAW);
  17676. a.disable(a.DEPTH_TEST);
  17677. a.disable(a.CULL_FACE);
  17678. a.enable(a.BLEND);
  17679. a.colorMask(!0, !0, !0, !0)
  17680. };
  17681. a.prototype.initBlendMode = function() {
  17682. a.blendModesWebGL[c.BlendMode.NORMAL] = [this.gl.ONE, this.gl.ONE_MINUS_SRC_ALPHA];
  17683. a.blendModesWebGL[c.BlendMode.ADD] = [this.gl.SRC_ALPHA, this.gl.DST_ALPHA]
  17684. };
  17685. a.prototype.start = function() {
  17686. if (!this.contextLost) {
  17687. var a = this.gl;
  17688. a.activeTexture(a.TEXTURE0);
  17689. a.bindBuffer(a.ARRAY_BUFFER, this.vertexBuffer);
  17690. a.bindBuffer(a.ELEMENT_ARRAY_BUFFER, this.indexBuffer);
  17691. var d = this.shaderManager.defaultShader;
  17692. a.uniform2f(d.projectionVector, this.projectionX, this.projectionY);
  17693. var e = 4 * this.vertSize;
  17694. a.vertexAttribPointer(d.aVertexPosition, 2, a.FLOAT, !1, e, 0);
  17695. a.vertexAttribPointer(d.aTextureCoord, 2, a.FLOAT, !1, e, 8);
  17696. a.vertexAttribPointer(d.colorAttribute, 2, a.FLOAT, !1, e, 16);
  17697. this.setBlendMode(c.BlendMode.NORMAL)
  17698. }
  17699. };
  17700. a.prototype.clearScreen = function() {
  17701. var a = this.gl;
  17702. a.colorMask(!0, !0, !0, !0);
  17703. for (var d = c.RenderFilter.getInstance().getDrawAreaList(), e = 0, m = d.length; e < m; e++) {
  17704. var g = d[e];
  17705. a.viewport(g.x, g.y, g.width, g.height);
  17706. a.bindFramebuffer(a.FRAMEBUFFER, null);
  17707. a.clearColor(0, 0, 0, 0);
  17708. a.clear(a.COLOR_BUFFER_BIT)
  17709. }
  17710. this.renderCost = 0
  17711. };
  17712. a.prototype.setBlendMode = function(b) {
  17713. this.currentBlendMode != b && (this.currentBlendMode = b, b = a.blendModesWebGL[this.currentBlendMode], this.gl.blendFunc(b[0], b[1]))
  17714. };
  17715. a.prototype.drawImage = function(a, d, e, m, g, h, l, n, p) {
  17716. if (!this.contextLost) {
  17717. var q = c.MainContext.instance.rendererContext.texture_scale_factor;
  17718. d /= q;
  17719. e /= q;
  17720. m /= q;
  17721. g /= q;
  17722. this.createWebGLTexture(a);
  17723. if (a.webGLTexture !== this.currentBaseTexture || this.currentBatchSize >= this.size) this._draw(),
  17724. this.currentBaseTexture = a.webGLTexture;
  17725. var r = this.worldTransform,
  17726. s = r.a,
  17727. t = r.b,
  17728. A = r.c,
  17729. w = r.d,
  17730. B = r.tx,
  17731. C = r.ty;
  17732. 0 == h && 0 == l || r.append(1, 0, 0, 1, h, l);
  17733. 1 == m / n && 1 == g / p || r.append(n / m, 0, 0, p / g, 0, 0);
  17734. h = r.a;
  17735. l = r.b;
  17736. n = r.c;
  17737. p = r.d;
  17738. var q = r.tx,
  17739. u = r.ty;
  17740. r.a = s;
  17741. r.b = t;
  17742. r.c = A;
  17743. r.d = w;
  17744. r.tx = B;
  17745. r.ty = C;
  17746. s = a._sourceWidth;
  17747. t = a._sourceHeight;
  17748. a = m;
  17749. r = g;
  17750. d /= s;
  17751. e /= t;
  17752. m /= s;
  17753. g /= t;
  17754. s = this.vertices;
  17755. t = 4 * this.currentBatchSize * this.vertSize;
  17756. A = this.worldAlpha;
  17757. s[t++] = q;
  17758. s[t++] = u;
  17759. s[t++] = d;
  17760. s[t++] = e;
  17761. s[t++] = A;
  17762. s[t++] = 16777215;
  17763. s[t++] = h * a + q;
  17764. s[t++] = l * a + u;
  17765. s[t++] = m + d;
  17766. s[t++] = e;
  17767. s[t++] = A;
  17768. s[t++] = 16777215;
  17769. s[t++] = h * a + n * r + q;
  17770. s[t++] = p * r + l * a + u;
  17771. s[t++] = m + d;
  17772. s[t++] = g + e;
  17773. s[t++] = A;
  17774. s[t++] = 16777215;
  17775. s[t++] = n * r + q;
  17776. s[t++] = p * r + u;
  17777. s[t++] = d;
  17778. s[t++] = g + e;
  17779. s[t++] = A;
  17780. s[t++] = 16777215;
  17781. this.currentBatchSize++
  17782. }
  17783. };
  17784. a.prototype._draw = function() {
  17785. if (0 != this.currentBatchSize && !this.contextLost) {
  17786. var a = c.getTimer();
  17787. this.start();
  17788. var d = this.gl;
  17789. d.bindTexture(d.TEXTURE_2D, this.currentBaseTexture);
  17790. var e = this.vertices.subarray(0, 4 * this.currentBatchSize * this.vertSize);
  17791. d.bufferSubData(d.ARRAY_BUFFER, 0, e);
  17792. d.drawElements(d.TRIANGLES, 6 * this.currentBatchSize, d.UNSIGNED_SHORT, 0);
  17793. this.currentBatchSize = 0;
  17794. this.renderCost += c.getTimer() - a;
  17795. c.Profiler.getInstance().onDrawImage()
  17796. }
  17797. };
  17798. a.prototype.setTransform = function(a) {
  17799. var c = this.worldTransform;
  17800. c.a = a.a;
  17801. c.b = a.b;
  17802. c.c = a.c;
  17803. c.d = a.d;
  17804. c.tx = a.tx;
  17805. c.ty = a.ty
  17806. };
  17807. a.prototype.setAlpha = function(a, c) {
  17808. this.worldAlpha = a;
  17809. c && this.setBlendMode(c)
  17810. };
  17811. a.prototype.createWebGLTexture = function(a) {
  17812. if (!a.webGLTexture) {
  17813. var c = this.gl;
  17814. a.webGLTexture = c.createTexture();
  17815. c.bindTexture(c.TEXTURE_2D, a.webGLTexture);
  17816. c.pixelStorei(c.UNPACK_PREMULTIPLY_ALPHA_WEBGL, !0);
  17817. c.texImage2D(c.TEXTURE_2D, 0, c.RGBA, c.RGBA, c.UNSIGNED_BYTE, a._bitmapData);
  17818. c.texParameteri(c.TEXTURE_2D, c.TEXTURE_MAG_FILTER, c.LINEAR);
  17819. c.texParameteri(c.TEXTURE_2D, c.TEXTURE_MIN_FILTER, c.LINEAR);
  17820. c.texParameteri(c.TEXTURE_2D, c.TEXTURE_WRAP_S, c.CLAMP_TO_EDGE);
  17821. c.texParameteri(c.TEXTURE_2D, c.TEXTURE_WRAP_T, c.CLAMP_TO_EDGE);
  17822. c.bindTexture(c.TEXTURE_2D, null)
  17823. }
  17824. };
  17825. a.prototype.pushMask = function(a) {
  17826. this._draw();
  17827. var c = this.gl;
  17828. 0 == this.maskList.length && (c.enable(c.STENCIL_TEST), c.stencilFunc(c.ALWAYS, 1, 1));
  17829. var d = this.maskDataFreeList.pop();
  17830. d ? (d.x = a.x, d.y = a.y, d.w = a.width, d.h = a.height) : d = {
  17831. x: a.x,
  17832. y: a.y,
  17833. w: a.width,
  17834. h: a.height
  17835. };
  17836. this.maskList.push(d);
  17837. c.colorMask(!1, !1, !1, !1);
  17838. c.stencilOp(c.KEEP, c.KEEP, c.INCR);
  17839. this.renderGraphics(d);
  17840. c.colorMask(!0, !0, !0, !0);
  17841. c.stencilFunc(c.NOTEQUAL, 0, this.maskList.length);
  17842. c.stencilOp(c.KEEP, c.KEEP, c.KEEP)
  17843. };
  17844. a.prototype.popMask = function() {
  17845. this._draw();
  17846. var a = this.gl,
  17847. c = this.maskList.pop();
  17848. c && (a.colorMask(!1, !1, !1, !1), a.stencilOp(a.KEEP, a.KEEP, a.DECR), this.renderGraphics(c), a.colorMask(!0, !0, !0, !0), a.stencilFunc(a.NOTEQUAL, 0, this.maskList.length), a.stencilOp(a.KEEP, a.KEEP, a.KEEP), this.maskDataFreeList.push(c));
  17849. 0 == this.maskList.length && a.disable(a.STENCIL_TEST)
  17850. };
  17851. a.prototype.setupFont = function(a) {
  17852. var c = this.canvasContext,
  17853. d = a.italic ? "italic ": "normal ",
  17854. d = d + (a.bold ? "bold ": "normal "),
  17855. d = d + (a.size + "px " + a.fontFamily);
  17856. c.font = d;
  17857. c.textAlign = "left";
  17858. c.textBaseline = "middle"
  17859. };
  17860. a.prototype.measureText = function(a) {
  17861. return this.canvasContext.measureText(a).width
  17862. };
  17863. a.prototype.renderGraphics = function(a) {
  17864. var c = this.gl,
  17865. d = this.shaderManager.primitiveShader;
  17866. this.graphicsPoints ? (this.graphicsPoints.length = 0, this.graphicsIndices.length = 0) : (this.graphicsPoints = [], this.graphicsIndices = [], this.graphicsBuffer = c.createBuffer(), this.graphicsIndexBuffer = c.createBuffer());
  17867. this.updateGraphics(a);
  17868. this.shaderManager.activateShader(d);
  17869. c.blendFunc(c.ONE, c.ONE_MINUS_SRC_ALPHA);
  17870. c.uniformMatrix3fv(d.translationMatrix, !1, this.worldTransform.toArray(!0));
  17871. c.uniform2f(d.projectionVector, this.projectionX, -this.projectionY);
  17872. c.uniform2f(d.offsetVector, 0, 0);
  17873. c.uniform3fv(d.tintColor, [1, 1, 1]);
  17874. c.uniform1f(d.alpha, this.worldAlpha);
  17875. c.bindBuffer(c.ARRAY_BUFFER, this.graphicsBuffer);
  17876. c.vertexAttribPointer(d.aVertexPosition, 2, c.FLOAT, !1, 24, 0);
  17877. c.vertexAttribPointer(d.colorAttribute, 4, c.FLOAT, !1, 24, 8);
  17878. c.bindBuffer(c.ELEMENT_ARRAY_BUFFER, this.graphicsIndexBuffer);
  17879. c.drawElements(c.TRIANGLE_STRIP, this.graphicsIndices.length, c.UNSIGNED_SHORT, 0);
  17880. this.shaderManager.activateShader(this.shaderManager.defaultShader)
  17881. };
  17882. a.prototype.updateGraphics = function(a) {
  17883. var c = this.gl;
  17884. this.buildRectangle(a);
  17885. c.bindBuffer(c.ARRAY_BUFFER, this.graphicsBuffer);
  17886. c.bufferData(c.ARRAY_BUFFER, new Float32Array(this.graphicsPoints), c.STATIC_DRAW);
  17887. c.bindBuffer(c.ELEMENT_ARRAY_BUFFER, this.graphicsIndexBuffer);
  17888. c.bufferData(c.ELEMENT_ARRAY_BUFFER, new Uint16Array(this.graphicsIndices), c.STATIC_DRAW)
  17889. };
  17890. a.prototype.buildRectangle = function(a) {
  17891. var c = a.x,
  17892. d = a.y,
  17893. e = a.w;
  17894. a = a.h;
  17895. var g = this.graphicsPoints,
  17896. h = this.graphicsIndices,
  17897. l = g.length / 6;
  17898. g.push(c, d);
  17899. g.push(0, 0, 0, 1);
  17900. g.push(c + e, d);
  17901. g.push(0, 0, 0, 1);
  17902. g.push(c, d + a);
  17903. g.push(0, 0, 0, 1);
  17904. g.push(c + e, d + a);
  17905. g.push(0, 0, 0, 1);
  17906. h.push(l, l, l + 1, l + 2, l + 3, l + 3)
  17907. };
  17908. a.blendModesWebGL = {};
  17909. return a
  17910. } (c.RendererContext);
  17911. c.WebGLRenderer = e;
  17912. e.prototype.__class__ = "egret.WebGLRenderer"
  17913. })(egret || (egret = {})); (function(c) {
  17914. var e = function() {
  17915. function c() {}
  17916. c.compileProgram = function(a, b, e) {
  17917. e = c.compileFragmentShader(a, e);
  17918. b = c.compileVertexShader(a, b);
  17919. var f = a.createProgram();
  17920. a.attachShader(f, b);
  17921. a.attachShader(f, e);
  17922. a.linkProgram(f);
  17923. a.getProgramParameter(f, a.LINK_STATUS) || console.log("\u65e0\u6cd5\u521d\u59cb\u5316\u7740\u8272\u5668");
  17924. return f
  17925. };
  17926. c.compileFragmentShader = function(a, b) {
  17927. return c._compileShader(a, b, a.FRAGMENT_SHADER)
  17928. };
  17929. c.compileVertexShader = function(a, b) {
  17930. return c._compileShader(a, b, a.VERTEX_SHADER)
  17931. };
  17932. c._compileShader = function(a, b, c) {
  17933. c = a.createShader(c);
  17934. a.shaderSource(c, b);
  17935. a.compileShader(c);
  17936. return a.getShaderParameter(c, a.COMPILE_STATUS) ? c: (console.log(a.getShaderInfoLog(c)), null)
  17937. };
  17938. c.checkCanUseWebGL = function() {
  17939. if (void 0 == c.canUseWebGL) try {
  17940. var a = document.createElement("canvas");
  17941. c.canUseWebGL = !!window.WebGLRenderingContext && !(!a.getContext("webgl") && !a.getContext("experimental-webgl"))
  17942. } catch(b) {
  17943. c.canUseWebGL = !1
  17944. }
  17945. return c.canUseWebGL
  17946. };
  17947. return c
  17948. } ();
  17949. c.WebGLUtils = e;
  17950. e.prototype.__class__ = "egret.WebGLUtils"
  17951. })(egret || (egret = {})); (function(c) {
  17952. var e = function() {
  17953. function b(a) {
  17954. this.maxAttibs = 10;
  17955. this.attribState = [];
  17956. this.tempAttribState = [];
  17957. for (var b = 0; b < this.maxAttibs; b++) this.attribState[b] = !1;
  17958. this.setContext(a)
  17959. }
  17960. b.prototype.setContext = function(b) {
  17961. this.gl = b;
  17962. this.primitiveShader = new a(b);
  17963. this.defaultShader = new d(b);
  17964. this.activateShader(this.defaultShader)
  17965. };
  17966. b.prototype.activateShader = function(a) {
  17967. this.gl.useProgram(a.program);
  17968. this.setAttribs(a.attributes)
  17969. };
  17970. b.prototype.setAttribs = function(a) {
  17971. var b, c;
  17972. c = this.tempAttribState.length;
  17973. for (b = 0; b < c; b++) this.tempAttribState[b] = !1;
  17974. c = a.length;
  17975. for (b = 0; b < c; b++) this.tempAttribState[a[b]] = !0;
  17976. a = this.gl;
  17977. c = this.attribState.length;
  17978. for (b = 0; b < c; b++) this.attribState[b] !== this.tempAttribState[b] && (this.attribState[b] = this.tempAttribState[b], this.tempAttribState[b] ? a.enableVertexAttribArray(b) : a.disableVertexAttribArray(b))
  17979. };
  17980. return b
  17981. } ();
  17982. c.WebGLShaderManager = e;
  17983. e.prototype.__class__ = "egret.WebGLShaderManager";
  17984. var d = function() {
  17985. function a(b) {
  17986. this.defaultVertexSrc = "attribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\nattribute vec2 aColor;\nuniform vec2 projectionVector;\nuniform vec2 offsetVector;\nvarying vec2 vTextureCoord;\nvarying vec4 vColor;\nconst vec2 center = vec2(-1.0, 1.0);\nvoid main(void) {\n gl_Position = vec4( ((aVertexPosition + offsetVector) / projectionVector) + center , 0.0, 1.0);\n vTextureCoord = aTextureCoord;\n vec3 color = mod(vec3(aColor.y/65536.0, aColor.y/256.0, aColor.y), 256.0) / 256.0;\n vColor = vec4(color * aColor.x, aColor.x);\n}";
  17987. this.program = null;
  17988. this.fragmentSrc = "precision lowp float;\nvarying vec2 vTextureCoord;\nvarying vec4 vColor;\nuniform sampler2D uSampler;\nvoid main(void) {\n gl_FragColor = texture2D(uSampler, vTextureCoord) * vColor ;\n}";
  17989. this.gl = b;
  17990. this.init()
  17991. }
  17992. a.prototype.init = function() {
  17993. var a = this.gl,
  17994. b = c.WebGLUtils.compileProgram(a, this.defaultVertexSrc, this.fragmentSrc);
  17995. a.useProgram(b);
  17996. this.uSampler = a.getUniformLocation(b, "uSampler");
  17997. this.projectionVector = a.getUniformLocation(b, "projectionVector");
  17998. this.offsetVector = a.getUniformLocation(b, "offsetVector");
  17999. this.dimensions = a.getUniformLocation(b, "dimensions");
  18000. this.aVertexPosition = a.getAttribLocation(b, "aVertexPosition");
  18001. this.aTextureCoord = a.getAttribLocation(b, "aTextureCoord");
  18002. this.colorAttribute = a.getAttribLocation(b, "aColor"); - 1 === this.colorAttribute && (this.colorAttribute = 2);
  18003. this.attributes = [this.aVertexPosition, this.aTextureCoord, this.colorAttribute];
  18004. this.program = b
  18005. };
  18006. return a
  18007. } ();
  18008. c.EgretShader = d;
  18009. d.prototype.__class__ = "egret.EgretShader";
  18010. var a = function() {
  18011. function a(b) {
  18012. this.alpha = this.translationMatrix = this.attributes = this.colorAttribute = this.aVertexPosition = this.tintColor = this.offsetVector = this.projectionVector = this.program = null;
  18013. this.fragmentSrc = "precision mediump float;\nvarying vec4 vColor;\nvoid main(void) {\n gl_FragColor = vColor;\n}";
  18014. this.vertexSrc = "attribute vec2 aVertexPosition;\nattribute vec4 aColor;\nuniform mat3 translationMatrix;\nuniform vec2 projectionVector;\nuniform vec2 offsetVector;\nuniform float alpha;\nuniform vec3 tint;\nvarying vec4 vColor;\nvoid main(void) {\n vec3 v = translationMatrix * vec3(aVertexPosition , 1.0);\n v -= offsetVector.xyx;\n gl_Position = vec4( v.x / projectionVector.x -1.0, v.y / -projectionVector.y + 1.0 , 0.0, 1.0);\n vColor = aColor * vec4(tint * alpha, alpha);\n}";
  18015. this.gl = b;
  18016. this.init()
  18017. }
  18018. a.prototype.init = function() {
  18019. var a = this.gl,
  18020. b = c.WebGLUtils.compileProgram(a, this.vertexSrc, this.fragmentSrc);
  18021. a.useProgram(b);
  18022. this.projectionVector = a.getUniformLocation(b, "projectionVector");
  18023. this.offsetVector = a.getUniformLocation(b, "offsetVector");
  18024. this.tintColor = a.getUniformLocation(b, "tint");
  18025. this.aVertexPosition = a.getAttribLocation(b, "aVertexPosition");
  18026. this.colorAttribute = a.getAttribLocation(b, "aColor");
  18027. this.attributes = [this.aVertexPosition, this.colorAttribute];
  18028. this.translationMatrix = a.getUniformLocation(b, "translationMatrix");
  18029. this.alpha = a.getUniformLocation(b, "alpha");
  18030. this.program = b
  18031. };
  18032. return a
  18033. } ();
  18034. c.PrimitiveShader = a;
  18035. a.prototype.__class__ = "egret.PrimitiveShader"
  18036. })(egret || (egret = {}));
  18037. __extends = this.__extends ||
  18038. function(c, e) {
  18039. function d() {
  18040. this.constructor = c
  18041. }
  18042. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  18043. d.prototype = e.prototype;
  18044. c.prototype = new d
  18045. }; (function(c) {
  18046. var e = function(d) {
  18047. function a() {
  18048. d.call(this)
  18049. }
  18050. __extends(a, d);
  18051. a.prototype.proceed = function(a) {
  18052. function d(e) {
  18053. c.IOErrorEvent.dispatchIOErrorEvent(a)
  18054. }
  18055. function e(d) {
  18056. switch (a.dataFormat) {
  18057. case c.URLLoaderDataFormat.TEXT:
  18058. a.data = g.responseText;
  18059. break;
  18060. case c.URLLoaderDataFormat.VARIABLES:
  18061. a.data = new c.URLVariables(g.responseText);
  18062. break;
  18063. case c.URLLoaderDataFormat.BINARY:
  18064. a.data = g.response;
  18065. break;
  18066. default:
  18067. a.data = g.responseText
  18068. }
  18069. c.callLater(c.Event.dispatchEvent, c.Event, a, c.Event.COMPLETE)
  18070. }
  18071. if (a.dataFormat == c.URLLoaderDataFormat.TEXTURE) this.loadTexture(a);
  18072. else if (a.dataFormat == c.URLLoaderDataFormat.SOUND) this.loadSound(a);
  18073. else {
  18074. var m = a._request,
  18075. g = this.getXHR();
  18076. g.onerror = d;
  18077. g.onload = e;
  18078. g.open(m.method, m.url, !0);
  18079. this.setResponseType(g, a.dataFormat);
  18080. m.method != c.URLRequestMethod.GET && m.data ? m.data instanceof c.URLVariables ? (g.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"), g.send(m.data.toString())) : (g.setRequestHeader("Content-Type", "multipart/form-data"), g.send(m.data)) : g.send()
  18081. }
  18082. };
  18083. a.prototype.loadSound = function(a) {
  18084. function d(g) {
  18085. m.removeEventListener("canplaythrough", d, !1);
  18086. m.removeEventListener("error", e, !1);
  18087. g = new c.Sound;
  18088. g.audio = m;
  18089. a.data = g;
  18090. c.callLater(c.Event.dispatchEvent, c.Event, a, c.Event.COMPLETE)
  18091. }
  18092. function e(g) {
  18093. m.removeEventListener("canplaythrough", d, !1);
  18094. m.removeEventListener("error", e, !1);
  18095. c.IOErrorEvent.dispatchIOErrorEvent(a)
  18096. }
  18097. var m = new Audio(a._request.url);
  18098. m.addEventListener("canplaythrough", d, !1);
  18099. m.addEventListener("error", e, !1);
  18100. m.load()
  18101. };
  18102. a.prototype.getXHR = function() {
  18103. return window.XMLHttpRequest ? new window.XMLHttpRequest: new ActiveXObject("MSXML2.XMLHTTP")
  18104. };
  18105. a.prototype.setResponseType = function(a, d) {
  18106. switch (d) {
  18107. case c.URLLoaderDataFormat.TEXT:
  18108. case c.URLLoaderDataFormat.VARIABLES:
  18109. a.responseType = c.URLLoaderDataFormat.TEXT;
  18110. break;
  18111. case c.URLLoaderDataFormat.BINARY:
  18112. a.responseType = "arraybuffer";
  18113. break;
  18114. default:
  18115. a.responseType = d
  18116. }
  18117. };
  18118. a.prototype.loadTexture = function(a) {
  18119. var d = a._request,
  18120. e = new Image;
  18121. e.crossOrigin = "Anonymous";
  18122. e.onload = function(d) {
  18123. e.onerror = null;
  18124. e.onload = null;
  18125. d = new c.Texture;
  18126. d._setBitmapData(e);
  18127. a.data = d;
  18128. c.callLater(c.Event.dispatchEvent, c.Event, a, c.Event.COMPLETE)
  18129. };
  18130. e.onerror = function(d) {
  18131. e.onerror = null;
  18132. e.onload = null;
  18133. c.IOErrorEvent.dispatchIOErrorEvent(a)
  18134. };
  18135. e.src = d.url
  18136. };
  18137. return a
  18138. } (c.NetContext);
  18139. c.HTML5NetContext = e;
  18140. e.prototype.__class__ = "egret.HTML5NetContext"
  18141. })(egret || (egret = {}));
  18142. __extends = this.__extends ||
  18143. function(c, e) {
  18144. function d() {
  18145. this.constructor = c
  18146. }
  18147. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  18148. d.prototype = e.prototype;
  18149. c.prototype = new d
  18150. }; (function(c) {
  18151. var e = function(d) {
  18152. function a(a) {
  18153. d.call(this);
  18154. this.canvas = a;
  18155. this._isTouchDown = !1
  18156. }
  18157. __extends(a, d);
  18158. a.prototype.run = function() {
  18159. var a = this;
  18160. window.navigator.msPointerEnabled ? (this.canvas.addEventListener("MSPointerDown",
  18161. function(c) {
  18162. a._onTouchBegin(c);
  18163. c.stopPropagation();
  18164. c.preventDefault()
  18165. },
  18166. !1), this.canvas.addEventListener("MSPointerMove",
  18167. function(c) {
  18168. a._onTouchMove(c);
  18169. c.stopPropagation();
  18170. c.preventDefault()
  18171. },
  18172. !1), this.canvas.addEventListener("MSPointerUp",
  18173. function(c) {
  18174. a._onTouchEnd(c);
  18175. c.stopPropagation();
  18176. c.preventDefault()
  18177. },
  18178. !1)) : c.MainContext.deviceType == c.MainContext.DEVICE_MOBILE ? this.addTouchListener() : c.MainContext.deviceType == c.MainContext.DEVICE_PC && (this.addTouchListener(), this.addMouseListener());
  18179. window.addEventListener("mousedown",
  18180. function(c) {
  18181. a.inOutOfCanvas(c) ? a.dispatchLeaveStageEvent() : a._isTouchDown = !0
  18182. });
  18183. window.addEventListener("mouseup",
  18184. function(c) {
  18185. a._isTouchDown && a.inOutOfCanvas(c) && a.dispatchLeaveStageEvent();
  18186. a._isTouchDown = !1
  18187. })
  18188. };
  18189. a.prototype.addMouseListener = function() {
  18190. var a = this;
  18191. this.canvas.addEventListener("mousedown",
  18192. function(c) {
  18193. a._onTouchBegin(c)
  18194. });
  18195. this.canvas.addEventListener("mousemove",
  18196. function(c) {
  18197. a._onTouchMove(c)
  18198. });
  18199. this.canvas.addEventListener("mouseup",
  18200. function(c) {
  18201. a._onTouchEnd(c)
  18202. })
  18203. };
  18204. a.prototype.addTouchListener = function() {
  18205. var a = this;
  18206. this.canvas.addEventListener("touchstart",
  18207. function(c) {
  18208. for (var d = c.changedTouches.length,
  18209. e = 0; e < d && e < a.maxTouches; e++) a._onTouchBegin(c.changedTouches[e]);
  18210. c.stopPropagation();
  18211. c.preventDefault()
  18212. },
  18213. !1);
  18214. this.canvas.addEventListener("touchmove",
  18215. function(c) {
  18216. for (var d = c.changedTouches.length,
  18217. e = 0; e < d && e < a.maxTouches; e++) a._onTouchMove(c.changedTouches[e]);
  18218. c.stopPropagation();
  18219. c.preventDefault()
  18220. },
  18221. !1);
  18222. this.canvas.addEventListener("touchend",
  18223. function(c) {
  18224. for (var d = c.changedTouches.length,
  18225. e = 0; e < d && e < a.maxTouches; e++) a._onTouchEnd(c.changedTouches[e]);
  18226. c.stopPropagation();
  18227. c.preventDefault()
  18228. },
  18229. !1);
  18230. this.canvas.addEventListener("touchcancel",
  18231. function(c) {
  18232. for (var d = c.changedTouches.length,
  18233. e = 0; e < d && e < a.maxTouches; e++) a._onTouchEnd(c.changedTouches[e]);
  18234. c.stopPropagation();
  18235. c.preventDefault()
  18236. },
  18237. !1)
  18238. };
  18239. a.prototype.inOutOfCanvas = function(a) {
  18240. a = this.getLocation(this.canvas, a);
  18241. return 0 > a.x || 0 > a.y || a.x > this.canvas.width || a.y > this.canvas.height ? !0 : !1
  18242. };
  18243. a.prototype.dispatchLeaveStageEvent = function() {
  18244. c.MainContext.instance.stage.dispatchEventWith(c.Event.LEAVE_STAGE)
  18245. };
  18246. a.prototype._onTouchBegin = function(a) {
  18247. var c = this.getLocation(this.canvas, a),
  18248. d = -1;
  18249. a.hasOwnProperty("identifier") && (d = a.identifier);
  18250. this.onTouchBegan(c.x, c.y, d)
  18251. };
  18252. a.prototype._onTouchMove = function(a) {
  18253. var c = this.getLocation(this.canvas, a),
  18254. d = -1;
  18255. a.hasOwnProperty("identifier") && (d = a.identifier);
  18256. this.onTouchMove(c.x, c.y, d)
  18257. };
  18258. a.prototype._onTouchEnd = function(a) {
  18259. var c = this.getLocation(this.canvas, a),
  18260. d = -1;
  18261. a.hasOwnProperty("identifier") && (d = a.identifier);
  18262. this.onTouchEnd(c.x, c.y, d)
  18263. };
  18264. a.prototype.getLocation = function(a, d) {
  18265. var e = document.documentElement,
  18266. m = window,
  18267. g, h;
  18268. "function" === typeof a.getBoundingClientRect ? (h = a.getBoundingClientRect(), g = h.left, h = h.top) : h = g = 0;
  18269. g += m.pageXOffset - e.clientLeft;
  18270. h += m.pageYOffset - e.clientTop;
  18271. null != d.pageX ? (e = d.pageX, m = d.pageY) : (g -= document.body.scrollLeft, h -= document.body.scrollTop, e = d.clientX, m = d.clientY);
  18272. var l = c.Point.identity;
  18273. l.x = (e - g) / c.StageDelegate.getInstance().getScaleX();
  18274. l.y = (m - h) / c.StageDelegate.getInstance().getScaleY();
  18275. return l
  18276. };
  18277. return a
  18278. } (c.TouchContext);
  18279. c.HTML5TouchContext = e;
  18280. e.prototype.__class__ = "egret.HTML5TouchContext"
  18281. })(egret || (egret = {}));
  18282. __extends = this.__extends ||
  18283. function(c, e) {
  18284. function d() {
  18285. this.constructor = c
  18286. }
  18287. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  18288. d.prototype = e.prototype;
  18289. c.prototype = new d
  18290. }; (function(c) {
  18291. var e = function(d) {
  18292. function a() {
  18293. d.call(this);
  18294. this._isSupportDOMParser = this._xmlDict = this._parser = null;
  18295. this._xmlDict = {};
  18296. window.DOMParser ? (this._isSupportDOMParser = !0, this._parser = new DOMParser) : this._isSupportDOMParser = !1
  18297. }
  18298. __extends(a, d);
  18299. a.getInstance = function() {
  18300. a._instance || (a._instance = new a);
  18301. return a._instance
  18302. };
  18303. a.prototype.parserXML = function(a) {
  18304. for (var d = 0;
  18305. "\n" == a.charAt(d) || "\t" == a.charAt(d) || "\r" == a.charAt(d) || " " == a.charAt(d);) d++;
  18306. 0 != d && (a = a.substring(d, a.length));
  18307. this._isSupportDOMParser ? d = this._parser.parseFromString(a, "text/xml") : (d = new ActiveXObject("Microsoft.XMLDOM"), d.async = "false", d.loadXML(a));
  18308. null == d && c.Logger.info("xml not found!");
  18309. return d
  18310. };
  18311. a._instance = null;
  18312. return a
  18313. } (c.HashObject);
  18314. c.SAXParser = e;
  18315. e.prototype.__class__ = "egret.SAXParser"
  18316. })(egret || (egret = {}));
  18317. var __extends = this.__extends ||
  18318. function(c, e) {
  18319. function d() {
  18320. this.constructor = c
  18321. }
  18322. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  18323. d.prototype = e.prototype;
  18324. c.prototype = new d
  18325. },
  18326. catgame; (function(c) {
  18327. var e = function(c) {
  18328. function a() {
  18329. c.call(this);
  18330. this.speedy = this.speedx = 0;
  18331. var a = RES.getRes("stand_json"),
  18332. e = RES.getRes("stand_png");
  18333. this.standmc = new egret.MovieClip(a, e);
  18334. this.standmc.setInterval(3);
  18335. this.standmc.gotoAndPlay("stay");
  18336. a = RES.getRes("ready_json");
  18337. e = RES.getRes("ready_png");
  18338. this.readymc = new egret.MovieClip(a, e);
  18339. this.readymc.setInterval(3);
  18340. this.readymc.x = 10;
  18341. this.readymc.y = 20;
  18342. a = RES.getRes("jump_json");
  18343. e = RES.getRes("jump_png");
  18344. this.jumpmc = new egret.MovieClip(a, e);
  18345. this.jumpmc.setInterval(3);
  18346. this.jumpmc.x = 15;
  18347. this.jumpmc.y = 20;
  18348. a = RES.getRes("pose_json");
  18349. e = RES.getRes("pose_png");
  18350. this.posemc = new egret.MovieClip(a, e);
  18351. this.posemc.setInterval(3);
  18352. this.posemc.gotoAndPlay("nohit");
  18353. this.posemc.x = 15;
  18354. a = RES.getRes("fly_json");
  18355. e = RES.getRes("fly_png");
  18356. this.flymc = new egret.MovieClip(a, e);
  18357. this.flymc.setInterval(3);
  18358. this.flymc.gotoAndPlay("flying");
  18359. this.flymc.x = 110;
  18360. this.flymc.y = 40;
  18361. a = RES.getRes("stop_json");
  18362. e = RES.getRes("stop_png");
  18363. this.stopmc = new egret.MovieClip(a, e);
  18364. this.stopmc.setInterval(3);
  18365. this.stopmc.gotoAndPlay("stop");
  18366. this.stopmc.x = 130;
  18367. this.stopmc.y = 70;
  18368. this.anchorX = 0.5;
  18369. this.anchorY = 1;
  18370. this.stand()
  18371. }
  18372. __extends(a, c);
  18373. a.prototype.stand = function() {
  18374. this.numChildren && this.removeChildAt(0);
  18375. this.addChild(this.standmc)
  18376. };
  18377. a.prototype.ready = function(a, c) {
  18378. this.numChildren && this.removeChildAt(0);
  18379. this.readymc.gotoAndPlay("readyjump");
  18380. this.addChild(this.readymc);
  18381. this.readymc.addEventListener("finish",
  18382. function() {
  18383. a.call(c);
  18384. this.readymc.stop()
  18385. },
  18386. this)
  18387. };
  18388. a.prototype.jump = function() {
  18389. this.numChildren && this.removeChildAt(0);
  18390. this.jumpmc.gotoAndPlay("fall");
  18391. this.addChild(this.jumpmc)
  18392. };
  18393. a.prototype.pose = function() {
  18394. this.numChildren && this.removeChildAt(0);
  18395. this.addChild(this.posemc)
  18396. };
  18397. a.prototype.fly = function() {
  18398. this.numChildren && this.removeChildAt(0);
  18399. this.addChild(this.flymc)
  18400. };
  18401. a.prototype.roll = function() {
  18402. this.numChildren && this.removeChildAt(0);
  18403. this.addChild(this.stopmc)
  18404. };
  18405. return a
  18406. } (egret.DisplayObjectContainer);
  18407. c.Cat = e;
  18408. e.prototype.__class__ = "catgame.Cat"
  18409. })(catgame || (catgame = {}));
  18410. __extends = this.__extends ||
  18411. function(c, e) {
  18412. function d() {
  18413. this.constructor = c
  18414. }
  18415. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  18416. d.prototype = e.prototype;
  18417. c.prototype = new d
  18418. }; (function(c) {
  18419. var e = function(c) {
  18420. function a() {
  18421. c.call(this);
  18422. var a = RES.getRes("friend_json"),
  18423. e = RES.getRes("friend_png");
  18424. this.friendmc = new egret.MovieClip(a, e);
  18425. this.friendmc.setInterval(1);
  18426. this.addChild(this.friendmc);
  18427. this.stand()
  18428. }
  18429. __extends(a, c);
  18430. a.prototype.stand = function() {
  18431. this.friendmc.y = 0;
  18432. this.friendmc.gotoAndPlay("stand")
  18433. };
  18434. a.prototype.hit = function(a, c) {
  18435. this.friendmc.y = 0;
  18436. this.friendmc.gotoAndPlay("hit");
  18437. this.friendmc.addEventListener("hiton", a, c);
  18438. this.friendmc.addEventListener("finish",
  18439. function() {
  18440. this.ready()
  18441. },
  18442. this)
  18443. };
  18444. a.prototype.ready = function() {
  18445. this.friendmc.y = 110;
  18446. this.friendmc.gotoAndPlay("ready")
  18447. };
  18448. return a
  18449. } (egret.DisplayObjectContainer);
  18450. c.Friend = e;
  18451. e.prototype.__class__ = "catgame.Friend"
  18452. })(catgame || (catgame = {}));
  18453. __extends = this.__extends ||
  18454. function(c, e) {
  18455. function d() {
  18456. this.constructor = c
  18457. }
  18458. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  18459. d.prototype = e.prototype;
  18460. c.prototype = new d
  18461. }; (function(c) {
  18462. var e = function(c) {
  18463. function a(a) {
  18464. c.call(this);
  18465. var e = this.createBitmapByName("board");
  18466. this.addChild(e);
  18467. e = new egret.TextField;
  18468. e.y = 30;
  18469. e.x = 2;
  18470. e.width = 95;
  18471. e.height = 50;
  18472. e.size = 20;
  18473. e.textColor = 16777215;
  18474. e.textAlign = "center";
  18475. e.strokeColor = 0;
  18476. e.stroke = 2;
  18477. e.text = a + "M";
  18478. this.addChild(e)
  18479. }
  18480. __extends(a, c);
  18481. a.prototype.createBitmapByName = function(a) {
  18482. var c = new egret.Bitmap;
  18483. a = RES.getRes(a);
  18484. c.texture = a;
  18485. return c
  18486. };
  18487. return a
  18488. } (egret.DisplayObjectContainer);
  18489. c.Sign = e;
  18490. e.prototype.__class__ = "catgame.Sign"
  18491. })(catgame || (catgame = {}));
  18492. var data; (function(c) {
  18493. var e = function() {
  18494. function c() {
  18495. this.myuid = this.mylast = 0;
  18496. this.uname = "";
  18497. this.myrank = 0;
  18498. this.friendsList = [];//friendlist();
  18499. //this.friendsList.sort(this.sortByScore);
  18500. var a = {};//getMyInfo();
  18501. this.uname = a.nick;
  18502. this.mylast = a.score;
  18503. this.setMyUid(a.id);
  18504. this.getMyRank()
  18505. }
  18506. c.getInstance = function() {
  18507. null == c.instance && (c.instance = new c);
  18508. return c.instance
  18509. };
  18510. c.prototype.onKeyDown = function(a) {};
  18511. c.prototype.setMyUid = function(a) {
  18512. this.myuid = a
  18513. };
  18514. c.prototype.getName = function() {
  18515. return this.uname
  18516. };
  18517. c.prototype.test = function() {
  18518. console.log("this is a test")
  18519. };
  18520. c.prototype.getResult = function(a) {
  18521. var b = "",
  18522. c = [],
  18523. b = this.mylast,
  18524. d = 0,
  18525. e = "",
  18526. g = "",
  18527. c = this.friendsList.length;
  18528. if (a > this.mylast) {
  18529. this.postScore(a);
  18530. this.mylast = a;
  18531. for (g = 0; g < c; g++) this.friendsList[g].uid == this.myuid && (this.friendsList[g].time = getTime(), this.friendsList[g].score = a),
  18532. this.friendsList[g].score >= b && this.friendsList[g].score < a && (d++, 3 > d && (e += this.friendsList[g].nick + ","));
  18533. this.friendsList.sort(this.sortByScore);
  18534. this.getMyRank();
  18535. b = "\u5728\u597d\u53cb\u4e2d\u6392\u884c\u7b2c" + this.myrank + "\n" + (1 < d ? "\u8d85\u8fc7\u4e86" + e + "\u7b49" + d + "\u4eba": "\u5237\u65b0\u4e86\u6700\u597d\u6210\u7ee9!") + "\u679c\u65ad\u901a\u77e5\u597d\u53cb\uff01";
  18536. g = "\u5728\u597d\u53cb\u4e2d\u6392\u884c\u7b2c" + this.myrank + ",\u9080\u8bf7\u5927\u5bb6\u56f4\u89c2\uff01"
  18537. } else b = "\u6ca1\u6709\u8d85\u8fc7\u81ea\u5df1\u6700\u597d\u6210\u7ee9\n \u6ca1\u6709\u8bb0\u5f55\u4e0b\u8f7d\uff0c\u53ef\u4ee5\u518d\u8bd5\u8bd5\uff01",
  18538. g = "TA\u7684\u6700\u597d\u6210\u7ee9" + this.mylast + "\uff0c\u5982\u540c\u795e\u8bdd\uff0c\u81f3\u4eca\u96be\u4ee5\u8d85\u8d8a\u554a\uff01";
  18539. c = 3 >= c ? this.friendsList: 1 == this.myrank ? [this.friendsList[0], this.friendsList[1], this.friendsList[2]] : [this.friendsList[this.myrank - 2], this.friendsList[this.myrank - 1], this.friendsList[this.myrank]];
  18540. return [b, c, g]
  18541. };
  18542. c.prototype.getMyRank = function() {
  18543. for (var a = this.friendsList.length,
  18544. b = 0; b < a; b++) this.friendsList[b].idx = b + 1,
  18545. this.friendsList[b].uid == this.myuid && (this.myrank = b + 1)
  18546. };
  18547. c.prototype.sortByScore = function(a, b) {
  18548. return b.score - a.score
  18549. };
  18550. c.prototype.postScore = function(a) {
  18551. var b = new egret.URLLoader,
  18552. c = new egret.URLRequest;
  18553. c.url = "http://wx.nibaguai.com/index.php/FlyCat/sendScore";
  18554. c.method = egret.URLRequestMethod.POST;
  18555. c.data = new egret.URLVariables("uid=" + this.myuid + "&score=" + a);
  18556. b.load(c)
  18557. };
  18558. c.prototype.showTop20 = function() {
  18559. this.friendsList.sort(this.sortByScore);
  18560. showTop(this.friendsList)
  18561. };
  18562. return c
  18563. } ();
  18564. c.GameData = e;
  18565. e.prototype.__class__ = "data.GameData"
  18566. })(data || (data = {}));
  18567. var __extends = this.__extends ||
  18568. function(c, e) {
  18569. function d() {
  18570. this.constructor = c
  18571. }
  18572. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  18573. d.prototype = e.prototype;
  18574. c.prototype = new d
  18575. },
  18576. ui; (function(c) {
  18577. var e = function(c) {
  18578. function a(a) {
  18579. c.call(this);
  18580. return;
  18581. this.rtxt = new egret.TextField;
  18582. this.rtxt.width = 60;
  18583. this.rtxt.textColor = 16777215;
  18584. this.rtxt.strokeColor = 0;
  18585. this.rtxt.stroke = 2;
  18586. this.rtxt.textAlign = egret.HorizontalAlign.RIGHT;
  18587. this.rtxt.text = a.idx;
  18588. this.rtxt.size = 40;
  18589. this.rtxt.x = 0;
  18590. this.rtxt.y = 5;
  18591. var e = this.createBitmapByName("avatar");
  18592. e.width = 50;
  18593. e.height = 50;
  18594. e.x = 80;
  18595. this.addChild(e);
  18596. this.ntxt = new egret.TextField;
  18597. this.ntxt.width = 300;
  18598. this.ntxt.textColor = 0;
  18599. this.ntxt.textAlign = egret.HorizontalAlign.LEFT;
  18600. this.ntxt.text = a.nick;
  18601. this.ntxt.size = 24;
  18602. this.ntxt.x = 140;
  18603. this.ntxt.y = 5;
  18604. this.stxt = new egret.TextField;
  18605. this.stxt.width = 100;
  18606. this.stxt.textColor = 0;
  18607. this.stxt.textAlign = egret.HorizontalAlign.LEFT;
  18608. this.stxt.text = a.score + "\u7c73";
  18609. this.stxt.size = 24;
  18610. this.stxt.x = 140;
  18611. this.stxt.y = 30;
  18612. this.ttxt = new egret.TextField;
  18613. this.ttxt.width = 150;
  18614. this.ttxt.textColor = 0;
  18615. this.ttxt.textAlign = egret.HorizontalAlign.LEFT;
  18616. this.ttxt.text = a.time;
  18617. this.ttxt.size = 18;
  18618. this.ttxt.x = 250;
  18619. this.ttxt.y = 32;
  18620. a.isme && (a = this.createBitmapByName("myrank"), this.addChild(a));
  18621. this.addChild(this.rtxt);
  18622. this.addChild(this.ntxt);
  18623. this.addChild(this.stxt);
  18624. this.addChild(this.ttxt)
  18625. }
  18626. __extends(a, c);
  18627. a.prototype.onAvatarLoaded = function(a) {
  18628. a = new egret.Bitmap;
  18629. a.texture = this.urlloader.data;
  18630. a.width = 50;
  18631. a.height = 50;
  18632. a.x = 80;
  18633. this.addChild(a)
  18634. };
  18635. a.prototype.createBitmapByName = function(a) {
  18636. var c = new egret.Bitmap;
  18637. a = RES.getRes(a);
  18638. c.texture = a;
  18639. return c
  18640. };
  18641. return a
  18642. } (egret.DisplayObjectContainer);
  18643. c.RankItem = e;
  18644. e.prototype.__class__ = "ui.RankItem"
  18645. })(ui || (ui = {}));
  18646. __extends = this.__extends ||
  18647. function(c, e) {
  18648. function d() {
  18649. this.constructor = c
  18650. }
  18651. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  18652. d.prototype = e.prototype;
  18653. c.prototype = new d
  18654. }; (function(c) {
  18655. var e = function(c) {
  18656. function a() {
  18657. c.call(this);
  18658. var a = this.createBitmapByName("failedBg");
  18659. a.x = 20;
  18660. this.share_btn = this.createBitmapByName("share_btn");
  18661. this.share_btn.x = 10;
  18662. this.share_btn.y = a.height - 5;
  18663. this.share_btn.touchEnabled = !0;
  18664. this.share_btn.addEventListener(egret.TouchEvent.TOUCH_TAP, this.doShare, this);
  18665. this.replay_btn = this.createBitmapByName("replay_btn");
  18666. this.replay_btn.x = 220;
  18667. this.replay_btn.y = a.height - 5;
  18668. this.replay_btn.touchEnabled = !0;
  18669. this.replay_btn.addEventListener(egret.TouchEvent.TOUCH_TAP, this.doRepaly, this);
  18670. this.addChild(this.share_btn);
  18671. this.addChild(this.replay_btn);
  18672. this.addChild(a)
  18673. }
  18674. __extends(a, c);
  18675. a.prototype.createBitmapByName = function(a) {
  18676. var c = new egret.Bitmap;
  18677. a = RES.getRes(a);
  18678. c.texture = a;
  18679. return c
  18680. };
  18681. a.prototype.doShare = function(a) {
  18682. share("\u6253\u98de\u795e\u7ecf\u732b\uff0c\u73b0\u5728\u6709\u597d\u53cb\u6392\u884c\u699c\uff0c\u6211\u9065\u9065\u9886\u5148\u54e6\uff01\u4f60\u80fd\u6392\u7b2c\u51e0\uff1f")
  18683. };
  18684. a.prototype.doRepaly = function(a) {
  18685. this.dispatchEventWith("replayEvent")
  18686. };
  18687. return a
  18688. } (egret.Sprite);
  18689. c.FailPanel = e;
  18690. e.prototype.__class__ = "catgame.FailPanel"
  18691. })(catgame || (catgame = {}));
  18692. __extends = this.__extends ||
  18693. function(c, e) {
  18694. function d() {
  18695. this.constructor = c
  18696. }
  18697. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  18698. d.prototype = e.prototype;
  18699. c.prototype = new d
  18700. }; (function(c) {
  18701. var e = function(d) {
  18702. function a() {
  18703. d.call(this);
  18704. this.offsetX = -255;
  18705. this.offsetY = 280;
  18706. this.cacheItem = [];
  18707. this.cacheNum = 0;
  18708. this.isHit = !1;
  18709. this.gameStatus = 0;
  18710. this.camera = new egret.Point;
  18711. this.createRoad()
  18712. }
  18713. __extends(a, d);
  18714. a.prototype.createRoad = function() {
  18715. this.cloudLayer = new egret.Sprite;
  18716. var a = this.createBitmapByName("cloud1");
  18717. a.x = 100;
  18718. a.y = 100;
  18719. this.cloudLayer.addChild(a);
  18720. a = this.createBitmapByName("cloud2");
  18721. a.x = 300;
  18722. a.y = 120;
  18723. this.cloudLayer.addChild(a);
  18724. this.addChild(this.cloudLayer);
  18725. this.farhill = this.createBitmapByName("farHill");
  18726. this.farhill.x = this.offsetX;
  18727. this.farhill.y = this.offsetY;
  18728. this.addChild(this.farhill);
  18729. this.hill = this.createBitmapByName("hill");
  18730. this.hill.y = 178 + this.offsetY;
  18731. this.hill.x = 150 + this.offsetX;
  18732. this.addChild(this.hill);
  18733. this.frontLayer = new egret.Sprite;
  18734. this.addChild(this.frontLayer);
  18735. a = this.createBitmapByName("tower");
  18736. a.x = 240;
  18737. a.y = 162;
  18738. this.cacheItem.push(a);
  18739. var d = this.createBitmapByName("startboard");
  18740. d.x = 70;
  18741. d.y = 462;
  18742. this.cacheItem.push(d);
  18743. var e;
  18744. for (e = 3; 20 > e; e++) {
  18745. var m = this.createBitmapByName("tree");
  18746. m.x = 1250 * -e;
  18747. m.y = 429;
  18748. this.cacheItem.push(m)
  18749. }
  18750. for (e = 2; 40 > e; e++) m = this.createBitmapByName("grass"),
  18751. m.x = 750 * -e,
  18752. m.y = 500,
  18753. this.cacheItem.push(m);
  18754. for (e = 1; 101 > e; e++) m = new c.Sign(100 * e),
  18755. m.x = 500 * -e,
  18756. m.y = 482,
  18757. this.cacheItem.push(m);
  18758. this.frontLayer.addChild(a);
  18759. this.frontLayer.addChild(d);
  18760. this.catLayer = new egret.Sprite;
  18761. this.addChild(this.catLayer);
  18762. this.cat = new c.Cat;
  18763. this.cat.x = 362;
  18764. this.cat.y = 265;
  18765. this.catLayer.addChild(this.cat);
  18766. this.friend = new c.Friend;
  18767. this.friend.x = 380;
  18768. this.friend.y = 430;
  18769. this.catLayer.addChild(this.friend);
  18770. this.cacheItem.push(this.friend);
  18771. this.cacheNum = this.cacheItem.length;
  18772. this.init()
  18773. };
  18774. a.prototype.init = function() {
  18775. this.cat.x = 362;
  18776. this.cat.y = 265;
  18777. this.cat.speedx = 0;
  18778. this.cat.speedy = 0;
  18779. this.cat.stand();
  18780. this.friend.x = 380;
  18781. this.friend.y = 430;
  18782. this.friend.stand();
  18783. this.catLayer.addChild(this.friend);
  18784. this.camera.x = 0;
  18785. this.gameStatus = this.camera.y = 0;
  18786. this.isHit = !1;
  18787. this.farhill.x = this.offsetX;
  18788. this.farhill.y = this.offsetY;
  18789. this.addChildAt(this.farhill, 0);
  18790. this.hill.y = 178 + this.offsetY;
  18791. this.hill.x = 150 + this.offsetX;
  18792. this.addChildAt(this.hill, 1);
  18793. this.catLayer.x = 0;
  18794. this.frontLayer.x = 0;
  18795. this.CameraAt(this.camera)
  18796. };
  18797. a.prototype.nextStatus = function() {
  18798. switch (this.gameStatus) {
  18799. case 0:
  18800. this.gameStatus = 1;
  18801. this.cat.ready(this.catJump, this);
  18802. this.friend.ready();
  18803. break;
  18804. case 1:
  18805. this.hit();
  18806. break;
  18807. case 2:
  18808. this.hit()
  18809. }
  18810. };
  18811. a.prototype.catJump = function() {
  18812. this.gameStatus = 2;
  18813. this.cat.jump()
  18814. };
  18815. a.prototype.hit = function() {
  18816. this.isHit || (this.friend.hit(this.doHit, this), this.isHit = !0)
  18817. };
  18818. a.prototype.doHit = function() {
  18819. var a = this.cat.y;
  18820. this.gameStatus = 3;
  18821. var c, d = 60;
  18822. c = 200 + 300 * Math.random();
  18823. d = 10 * Math.random();
  18824. switch (a) {
  18825. case 518:
  18826. d = (60 + d) * Math.PI / 180;
  18827. this.cat.speedx = c * Math.cos(d);
  18828. this.cat.speedy = -c * Math.sin(d) * 0.2;
  18829. break;
  18830. case 541:
  18831. d = (55 + d) * Math.PI / 180;
  18832. this.cat.speedx = c * Math.cos(d);
  18833. this.cat.speedy = -c * Math.sin(d) * 0.2;
  18834. break;
  18835. case 565:
  18836. d = (50 + d) * Math.PI / 180;
  18837. this.cat.speedx = c * Math.cos(d);
  18838. this.cat.speedy = -c * Math.sin(d) * 0.2;
  18839. break;
  18840. case 590:
  18841. d = (45 + d) * Math.PI / 180;
  18842. this.cat.speedx = c * Math.cos(d);
  18843. this.cat.speedy = -c * Math.sin(d) * 0.2;
  18844. break;
  18845. case 616:
  18846. d = (40 + d) * Math.PI / 180;
  18847. this.cat.speedx = c * Math.cos(d);
  18848. this.cat.speedy = -c * Math.sin(d) * 0.2;
  18849. break;
  18850. case 643:
  18851. d = (35 + d) * Math.PI / 180;
  18852. this.cat.speedx = c * Math.cos(d);
  18853. this.cat.speedy = -c * Math.sin(d) * 0.2;
  18854. break;
  18855. case 671:
  18856. d = (30 + d) * Math.PI / 180;
  18857. this.cat.speedx = c * Math.cos(d);
  18858. this.cat.speedy = -c * Math.sin(d) * 0.2;
  18859. break;
  18860. default:
  18861. this.gameStatus = 2
  18862. }
  18863. 3 == this.gameStatus && this.cat.fly()
  18864. };
  18865. a.prototype.update = function() {
  18866. 4 != this.gameStatus && (2 == this.gameStatus && this.upFall(), 3 == this.gameStatus && this.upFly())
  18867. };
  18868. a.prototype.upFall = function() {
  18869. this.cat.speedy += 1;
  18870. this.cat.y += this.cat.speedy;
  18871. 680 <= this.cat.y && (this.cat.y = 680, this.gameStatus = 4, this.cat.pose(), console.log("\u6e38\u620f\u7ed3\u675f"), this.dispatchEventWith("gameFail"))
  18872. };
  18873. a.prototype.upFly = function() {
  18874. 0 == this.cat.speedy && 650 == this.cat.y ? (this.cat.speedx *= 0.6, this.cat.roll()) : (this.cat.speedy += 2, this.cat.speedx *= 0.99);
  18875. 630 <= this.cat.y && (this.cat.speedy = 0.5 * -this.cat.speedy, this.cat.y = 630, 5 > Math.abs(this.cat.speedy) && (this.cat.y = 630, this.cat.speedy = 0));
  18876. this.cat.x -= this.cat.speedx;
  18877. this.cat.y += this.cat.speedy;
  18878. this.camera.x = -this.cat.x + 220;
  18879. this.camera.y = this.cat.y;
  18880. var a = 180 * Math.atan2(this.cat.speedy, this.cat.speedx) / 3.14;
  18881. 20 < a ? a = 20 : -20 > a && (a = -20);
  18882. this.cat.rotation = -a;
  18883. this.CameraAt(this.camera);
  18884. 5 > this.cat.speedx && (this.gameStatus = 4, this.cat.roll(), this.dispatchEventWith("gameEnd"))
  18885. };
  18886. a.prototype.getDistance = function() {
  18887. var a = Math.floor( - this.cat.x / 5);
  18888. 0 > a && (a = 0);
  18889. return a
  18890. };
  18891. a.prototype.CameraAt = function(a) {
  18892. this.farhill.parent && (this.farhill.x = this.offsetX + 0.2 * a.x, 700 < this.farhill.x && this.farhill.parent.removeChild(this.farhill));
  18893. this.hill.parent && (this.hill.x = 150 + this.offsetX + 0.5 * a.x, 500 < this.hill.x && this.hill.parent.removeChild(this.hill));
  18894. this.frontLayer.x = a.x;
  18895. this.catLayer.x = a.x;
  18896. for (var c = 0; c < this.cacheNum; c++) {
  18897. var d = this.cacheItem[c];
  18898. d.parent ? 700 < Math.abs(d.x + a.x) && d.parent.removeChild(d) : 700 >= Math.abs(d.x + a.x) && this.frontLayer.addChild(d)
  18899. }
  18900. };
  18901. a.prototype.createBitmapByName = function(a) {
  18902. var c = new egret.Bitmap;
  18903. a = RES.getRes(a);
  18904. c.texture = a;
  18905. return c
  18906. };
  18907. return a
  18908. } (egret.DisplayObjectContainer);
  18909. c.Road = e;
  18910. e.prototype.__class__ = "catgame.Road"
  18911. })(catgame || (catgame = {}));
  18912. __extends = this.__extends ||
  18913. function(c, e) {
  18914. function d() {
  18915. this.constructor = c
  18916. }
  18917. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  18918. d.prototype = e.prototype;
  18919. c.prototype = new d
  18920. }; (function(c) {
  18921. var e = function(c) {
  18922. function a() {
  18923. c.call(this);
  18924. this.share_str = "";
  18925. var a = this.createBitmapByName("resultBg");
  18926. this.tap_textfeild = new egret.TextField;
  18927. this.tap_textfeild.width = 400;
  18928. this.tap_textfeild.textColor = 16777215;
  18929. this.tap_textfeild.textAlign = egret.HorizontalAlign.CENTER;
  18930. this.tap_textfeild.text = "\u51fb\u6253\u8ddd\u79bb 6542\u7c73";
  18931. this.tap_textfeild.size = 40;
  18932. this.tap_textfeild.strokeColor = 0;
  18933. this.tap_textfeild.stroke = 3;
  18934. this.tap_textfeild.x = 20;
  18935. this.tap_textfeild.y = 330;
  18936. this.rank_textfeild = new egret.TextField;
  18937. this.rank_textfeild.width = 400;
  18938. this.rank_textfeild.textColor = 3342387;
  18939. this.rank_textfeild.textAlign = egret.HorizontalAlign.CENTER;
  18940. this.rank_textfeild.text = "";
  18941. this.rank_textfeild.size = 24;
  18942. this.rank_textfeild.x = 20;
  18943. this.rank_textfeild.y = 380;
  18944. this.rank_sp = new egret.Sprite;
  18945. this.share_btn = this.createBitmapByName("share_btn");
  18946. this.share_btn.x = 10;
  18947. this.share_btn.y = a.height - 5;
  18948. this.share_btn.touchEnabled = !0;
  18949. this.share_btn.addEventListener(egret.TouchEvent.TOUCH_TAP, this.doShare, this);
  18950. this.replay_btn = this.createBitmapByName("replay_btn");
  18951. this.replay_btn.x = 220;
  18952. this.replay_btn.y = a.height - 5;
  18953. this.replay_btn.touchEnabled = !0;
  18954. this.replay_btn.addEventListener(egret.TouchEvent.TOUCH_TAP, this.doRepaly, this);
  18955. this.allrank_btn = this.createBitmapByName("rankall");
  18956. this.allrank_btn.x = 300;
  18957. this.allrank_btn.y = a.height - 370;
  18958. this.allrank_btn.touchEnabled = !0;
  18959. this.allrank_btn.addEventListener(egret.TouchEvent.TOUCH_TAP, this.showRank, this);
  18960. this.addChild(a);
  18961. this.addChild(this.tap_textfeild);
  18962. this.addChild(this.rank_textfeild);
  18963. this.addChild(this.share_btn);
  18964. this.addChild(this.replay_btn);
  18965. this.addChild(this.rank_sp);
  18966. this.addChild(this.allrank_btn)
  18967. }
  18968. __extends(a, c);
  18969. a.prototype.score = function(a) {
  18970. dp_submitScore(parseInt(a));
  18971. this.tap_textfeild.text = "\u51fb\u6253\u8ddd\u79bb " + a + "\u7c73";
  18972. return ;
  18973. for (this.share_str = data.GameData.getInstance().getName() + "\u628a\u795e\u7ecf\u732b\u51fb\u6253\u8ddd\u79bb " + a + "\u7c73,"; this.rank_sp.numChildren;) this.rank_sp.removeChildAt(0);
  18974. a = data.GameData.getInstance().getResult(a);
  18975. this.rank_textfeild.text = a[0];
  18976. this.share_str += a[2];
  18977. a = a[1];
  18978. for (var c, d = 0; d < a.length; d++) c = new ui.RankItem(a[d]),
  18979. c.x = 17,
  18980. c.y = 140 + 60 * d,
  18981. this.rank_sp.addChild(c)
  18982. };
  18983. a.prototype.doShare = function(a) {
  18984. dp_share();
  18985. //share(this.share_str)
  18986. };
  18987. a.prototype.doRepaly = function(a) {
  18988. this.dispatchEventWith("replayEvent")
  18989. };
  18990. a.prototype.showRank = function(a) {
  18991. dp_Ranking();
  18992. //data.GameData.getInstance().showTop20();
  18993. };
  18994. a.prototype.createBitmapByName = function(a) {
  18995. var c = new egret.Bitmap;
  18996. a = RES.getRes(a);
  18997. c.texture = a;
  18998. return c
  18999. };
  19000. return a
  19001. } (egret.Sprite);
  19002. c.SuccessPanel = e;
  19003. e.prototype.__class__ = "catgame.SuccessPanel"
  19004. })(catgame || (catgame = {}));
  19005. var __extends = this.__extends ||
  19006. function(c, e) {
  19007. function d() {
  19008. this.constructor = c
  19009. }
  19010. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  19011. d.prototype = e.prototype;
  19012. c.prototype = new d
  19013. },
  19014. LoadingUI = function(c) {
  19015. function e() {
  19016. c.call(this);
  19017. this.createView()
  19018. }
  19019. __extends(e, c);
  19020. e.prototype.createView = function() {
  19021. this.textField = new egret.TextField;
  19022. this.addChild(this.textField);
  19023. this.textField.y = 300;
  19024. this.textField.width = 480;
  19025. this.textField.height = 100;
  19026. this.textField.textAlign = "center"
  19027. };
  19028. e.prototype.setProgress = function(c, a) {
  19029. this.textField.text = "\u6e38\u620f\u52a0\u8f7d\u4e2d..." + c + "/" + a
  19030. };
  19031. return e
  19032. } (egret.Sprite);
  19033. LoadingUI.prototype.__class__ = "LoadingUI";
  19034. __extends = this.__extends ||
  19035. function(c, e) {
  19036. function d() {
  19037. this.constructor = c
  19038. }
  19039. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  19040. d.prototype = e.prototype;
  19041. c.prototype = new d
  19042. }; (function(c) {
  19043. var e = function(d) {
  19044. function a() {
  19045. d.call(this);
  19046. this.draging = !1;
  19047. this.offsetX = this.startX = 0;
  19048. this.camera = new egret.Point;
  19049. this.tt = 0;
  19050. this.direct = 1;
  19051. this.speed = 200;
  19052. this.addEventListener(egret.Event.ADDED_TO_STAGE, this.onAddToStage, this)
  19053. }
  19054. __extends(a, d);
  19055. a.prototype.onAddToStage = function(a) {
  19056. this.removeEventListener(egret.Event.ADDED_TO_STAGE, this.onAddToStage, this);
  19057. this.createGameScene()
  19058. };
  19059. a.prototype.createGameScene = function() {
  19060. var a = this.createBitmapByName("bgImage");
  19061. a.touchEnabled = !0;
  19062. a.addEventListener(egret.TouchEvent.TOUCH_TAP, this.onTap, this);
  19063. this.addChild(a);
  19064. this.stageW = this.stage.stageWidth;
  19065. this.stageH = this.stage.stageHeight;
  19066. this.road = new c.Road;
  19067. this.addChild(this.road);
  19068. this.scoreT = new egret.TextField;
  19069. this.scoreT.textColor = 16777215;
  19070. this.scoreT.textAlign = egret.HorizontalAlign.LEFT;
  19071. this.scoreT.text = "999999\u7c73";
  19072. this.scoreT.size = 48;
  19073. this.scoreT.width = this.stageW;
  19074. this.scoreT.strokeColor = 0;
  19075. this.scoreT.stroke = 3;
  19076. this.scoreT.x = 0;
  19077. this.scoreT.y = 10;
  19078. this.addChild(this.scoreT);
  19079. this.camera.x = 0;
  19080. this.camera.y = 0;
  19081. this.addEventListener(egret.Event.ENTER_FRAME, this.onEnterFrame, this);
  19082. this.road.addEventListener("gameFail", this.onFail, this);
  19083. this.road.addEventListener("gameEnd", this.onEnd, this);
  19084. this.successPanel = new c.SuccessPanel;
  19085. this.successPanel.addEventListener("shareEvent", this.doShare, this);
  19086. this.successPanel.addEventListener("replayEvent", this.doRestart, this);
  19087. this.failPanel = new c.FailPanel;
  19088. this.failPanel.addEventListener("shareEvent", this.doShare, this);
  19089. this.failPanel.addEventListener("replayEvent", this.doRestart, this);
  19090. this.morebtn = this.createBitmapByName("more_btn");
  19091. this.morebtn.x = (this.stageW - this.morebtn.width) / 2;
  19092. this.morebtn.y = this.stageH - this.morebtn.height;
  19093. this.morebtn.touchEnabled = !0;
  19094. this.morebtn.addEventListener(egret.TouchEvent.TOUCH_TAP, this.doMore, this)
  19095. };
  19096. a.prototype.onTap = function(a) {
  19097. 500 > (new Date).getTime() - this.tt || (this.tt = (new Date).getTime(), this.road.nextStatus())
  19098. };
  19099. a.prototype.onFail = function(a) {
  19100. this.failPanel.x = (this.stageW - this.failPanel.width) / 2;
  19101. this.failPanel.y = 50;
  19102. this.addChild(this.failPanel);
  19103. this.addChild(this.morebtn)
  19104. };
  19105. a.prototype.onEnd = function(a) {
  19106. this.successPanel.x = (this.stageW - this.successPanel.width) / 2;
  19107. this.successPanel.y = 0;
  19108. this.successPanel.score(this.road.getDistance());
  19109. this.addChild(this.successPanel);
  19110. this.addChild(this.morebtn)
  19111. };
  19112. a.prototype.doShare = function(a) {};
  19113. a.prototype.doRestart = function(a) {
  19114. this.gameStart()
  19115. };
  19116. a.prototype.gameStart = function() {
  19117. this.successPanel.parent && this.removeChild(this.successPanel);
  19118. this.failPanel.parent && this.removeChild(this.failPanel);
  19119. this.morebtn.parent && this.removeChild(this.morebtn);
  19120. this.road.init()
  19121. };
  19122. a.prototype.onEnterFrame = function(a) {
  19123. this.road.update();
  19124. this.scoreT.text = this.road.getDistance() + "\u7c73"
  19125. };
  19126. a.prototype.doMore = function(a) {
  19127. clickMore();
  19128. };
  19129. a.prototype.createBitmapByName = function(a) {
  19130. var c = new egret.Bitmap;
  19131. a = RES.getRes(a);
  19132. c.texture = a;
  19133. return c
  19134. };
  19135. return a
  19136. } (egret.DisplayObjectContainer);
  19137. c.GameContainer = e;
  19138. e.prototype.__class__ = "catgame.GameContainer"
  19139. })(catgame || (catgame = {}));
  19140. var __extends = this.__extends ||
  19141. function(c, e) {
  19142. function d() {
  19143. this.constructor = c
  19144. }
  19145. for (var a in e) e.hasOwnProperty(a) && (c[a] = e[a]);
  19146. d.prototype = e.prototype;
  19147. c.prototype = new d
  19148. },
  19149. GameApp = function(c) {
  19150. function e() {
  19151. c.call(this);
  19152. this.addEventListener(egret.Event.ADDED_TO_STAGE, this.onAddToStage, this)
  19153. }
  19154. __extends(e, c);
  19155. e.prototype.onAddToStage = function(c) {
  19156. this.loadingView = new LoadingUI;
  19157. this.stage.addChild(this.loadingView);
  19158. RES.addEventListener(RES.ResourceEvent.CONFIG_COMPLETE, this.onConfigComplete, this);
  19159. RES.loadConfig("resource/resource.json", "resource/")
  19160. };
  19161. e.prototype.onConfigComplete = function(c) {
  19162. RES.removeEventListener(RES.ResourceEvent.CONFIG_COMPLETE, this.onConfigComplete, this);
  19163. RES.addEventListener(RES.ResourceEvent.GROUP_COMPLETE, this.onResourceLoadComplete, this);
  19164. RES.addEventListener(RES.ResourceEvent.GROUP_PROGRESS, this.onResourceProgress, this);
  19165. RES.loadGroup("preload")
  19166. };
  19167. e.prototype.onResourceLoadComplete = function(c) {
  19168. "preload" == c.groupName && (this.stage.removeChild(this.loadingView), RES.removeEventListener(RES.ResourceEvent.GROUP_COMPLETE, this.onResourceLoadComplete, this), RES.removeEventListener(RES.ResourceEvent.GROUP_PROGRESS, this.onResourceProgress, this), this.createGameScene())
  19169. };
  19170. e.prototype.onResourceProgress = function(c) {
  19171. "preload" == c.groupName && this.loadingView.setProgress(c.itemsLoaded, c.itemsTotal)
  19172. };
  19173. e.prototype.createGameScene = function() {
  19174. var c = new catgame.GameContainer;
  19175. this.addChild(c)
  19176. };
  19177. e.prototype.createBitmapByName = function(c) {
  19178. var a = new egret.Bitmap;
  19179. c = RES.getRes(c);
  19180. a.texture = c;
  19181. return a
  19182. };
  19183. return e
  19184. } (egret.DisplayObjectContainer);
  19185. GameApp.prototype.__class__ = "GameApp";