1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663466446654666466746684669467046714672467346744675467646774678467946804681468246834684468546864687468846894690469146924693469446954696469746984699470047014702470347044705470647074708470947104711471247134714471547164717471847194720472147224723472447254726472747284729473047314732473347344735473647374738473947404741474247434744474547464747474847494750475147524753475447554756475747584759476047614762476347644765476647674768476947704771477247734774477547764777477847794780478147824783478447854786478747884789479047914792479347944795479647974798479948004801480248034804480548064807480848094810481148124813481448154816481748184819482048214822482348244825482648274828482948304831483248334834483548364837483848394840484148424843484448454846484748484849485048514852485348544855485648574858485948604861486248634864486548664867486848694870487148724873487448754876487748784879488048814882488348844885488648874888488948904891489248934894489548964897489848994900490149024903490449054906490749084909491049114912491349144915491649174918491949204921492249234924492549264927492849294930493149324933493449354936493749384939494049414942494349444945494649474948494949504951495249534954495549564957495849594960496149624963496449654966496749684969497049714972497349744975497649774978497949804981498249834984498549864987498849894990499149924993499449954996499749984999500050015002500350045005500650075008500950105011501250135014501550165017501850195020502150225023502450255026502750285029503050315032503350345035503650375038503950405041504250435044504550465047504850495050505150525053505450555056505750585059506050615062506350645065506650675068506950705071507250735074507550765077507850795080508150825083508450855086508750885089509050915092509350945095509650975098509951005101510251035104510551065107510851095110511151125113511451155116511751185119512051215122512351245125512651275128512951305131513251335134513551365137513851395140514151425143514451455146514751485149515051515152515351545155515651575158515951605161516251635164516551665167516851695170517151725173517451755176517751785179518051815182518351845185518651875188518951905191519251935194519551965197519851995200520152025203520452055206520752085209521052115212521352145215521652175218521952205221522252235224522552265227522852295230523152325233523452355236523752385239524052415242524352445245524652475248524952505251525252535254525552565257525852595260526152625263526452655266526752685269527052715272527352745275527652775278527952805281528252835284528552865287528852895290529152925293529452955296529752985299530053015302530353045305530653075308530953105311531253135314531553165317531853195320532153225323532453255326532753285329533053315332533353345335533653375338533953405341534253435344534553465347534853495350535153525353535453555356535753585359536053615362536353645365536653675368536953705371537253735374537553765377537853795380538153825383538453855386538753885389539053915392539353945395539653975398539954005401540254035404540554065407540854095410541154125413541454155416541754185419542054215422542354245425542654275428542954305431543254335434543554365437543854395440544154425443544454455446544754485449545054515452545354545455545654575458545954605461546254635464546554665467546854695470547154725473547454755476547754785479548054815482548354845485548654875488548954905491549254935494549554965497549854995500550155025503550455055506550755085509551055115512551355145515551655175518551955205521552255235524552555265527552855295530553155325533553455355536553755385539554055415542554355445545554655475548554955505551555255535554555555565557555855595560556155625563556455655566556755685569557055715572557355745575557655775578557955805581558255835584558555865587558855895590559155925593559455955596559755985599560056015602560356045605560656075608560956105611561256135614561556165617561856195620562156225623562456255626562756285629563056315632563356345635563656375638563956405641564256435644564556465647564856495650565156525653565456555656565756585659566056615662566356645665566656675668566956705671567256735674567556765677567856795680568156825683568456855686568756885689569056915692569356945695569656975698569957005701570257035704570557065707570857095710571157125713571457155716571757185719572057215722572357245725572657275728572957305731573257335734573557365737573857395740574157425743574457455746574757485749575057515752575357545755575657575758575957605761576257635764576557665767576857695770577157725773577457755776577757785779578057815782578357845785578657875788578957905791579257935794579557965797579857995800580158025803580458055806580758085809581058115812581358145815581658175818581958205821582258235824582558265827582858295830583158325833583458355836583758385839584058415842584358445845584658475848584958505851585258535854585558565857585858595860586158625863586458655866586758685869587058715872587358745875587658775878587958805881588258835884588558865887588858895890589158925893589458955896589758985899590059015902590359045905590659075908590959105911591259135914591559165917591859195920592159225923592459255926592759285929593059315932593359345935593659375938593959405941594259435944594559465947594859495950595159525953595459555956595759585959596059615962596359645965596659675968596959705971597259735974597559765977597859795980598159825983598459855986598759885989599059915992599359945995599659975998599960006001600260036004600560066007600860096010601160126013601460156016601760186019602060216022602360246025602660276028602960306031603260336034603560366037603860396040604160426043604460456046604760486049605060516052605360546055605660576058605960606061606260636064606560666067606860696070607160726073607460756076607760786079608060816082608360846085608660876088608960906091609260936094609560966097609860996100610161026103610461056106610761086109611061116112611361146115611661176118611961206121612261236124612561266127612861296130613161326133613461356136613761386139614061416142614361446145614661476148614961506151615261536154615561566157615861596160616161626163616461656166616761686169617061716172617361746175617661776178617961806181618261836184618561866187618861896190619161926193619461956196619761986199620062016202620362046205620662076208620962106211621262136214621562166217621862196220622162226223622462256226622762286229623062316232623362346235623662376238623962406241624262436244624562466247624862496250625162526253625462556256625762586259626062616262626362646265626662676268626962706271627262736274627562766277627862796280628162826283628462856286628762886289629062916292629362946295629662976298629963006301630263036304630563066307630863096310631163126313631463156316631763186319632063216322632363246325632663276328632963306331633263336334633563366337633863396340634163426343634463456346634763486349635063516352635363546355635663576358635963606361636263636364636563666367636863696370637163726373637463756376637763786379638063816382638363846385638663876388638963906391639263936394639563966397639863996400640164026403640464056406640764086409641064116412641364146415641664176418641964206421642264236424642564266427642864296430643164326433643464356436643764386439644064416442644364446445644664476448644964506451645264536454645564566457645864596460646164626463646464656466646764686469647064716472647364746475647664776478647964806481648264836484648564866487648864896490649164926493649464956496649764986499650065016502650365046505650665076508650965106511651265136514651565166517651865196520652165226523652465256526652765286529653065316532653365346535653665376538653965406541654265436544654565466547654865496550655165526553655465556556655765586559656065616562656365646565656665676568656965706571657265736574657565766577657865796580658165826583658465856586658765886589659065916592659365946595659665976598659966006601660266036604660566066607660866096610661166126613661466156616661766186619662066216622662366246625662666276628662966306631663266336634663566366637663866396640664166426643664466456646664766486649665066516652665366546655665666576658665966606661666266636664666566666667666866696670667166726673667466756676667766786679668066816682668366846685668666876688668966906691669266936694669566966697669866996700670167026703670467056706670767086709671067116712671367146715671667176718671967206721672267236724672567266727672867296730673167326733673467356736673767386739674067416742674367446745674667476748674967506751675267536754675567566757675867596760676167626763676467656766676767686769677067716772677367746775677667776778677967806781678267836784678567866787678867896790679167926793679467956796679767986799680068016802680368046805680668076808680968106811681268136814681568166817681868196820682168226823682468256826682768286829683068316832683368346835683668376838683968406841684268436844684568466847684868496850685168526853685468556856685768586859686068616862686368646865686668676868686968706871687268736874687568766877687868796880688168826883688468856886688768886889689068916892689368946895689668976898689969006901690269036904690569066907690869096910691169126913691469156916691769186919692069216922692369246925692669276928692969306931693269336934693569366937693869396940694169426943694469456946694769486949695069516952695369546955695669576958695969606961696269636964696569666967696869696970697169726973697469756976697769786979698069816982698369846985698669876988698969906991699269936994699569966997699869997000700170027003700470057006700770087009701070117012701370147015701670177018701970207021702270237024702570267027702870297030703170327033703470357036703770387039704070417042704370447045704670477048704970507051705270537054705570567057705870597060706170627063706470657066706770687069707070717072707370747075707670777078707970807081708270837084708570867087708870897090709170927093709470957096709770987099710071017102710371047105710671077108710971107111711271137114711571167117711871197120712171227123712471257126712771287129713071317132713371347135713671377138713971407141714271437144714571467147714871497150715171527153715471557156715771587159716071617162716371647165716671677168716971707171717271737174717571767177717871797180718171827183718471857186718771887189719071917192719371947195719671977198719972007201720272037204720572067207720872097210721172127213721472157216721772187219722072217222722372247225722672277228722972307231723272337234723572367237723872397240724172427243724472457246724772487249725072517252725372547255725672577258725972607261726272637264726572667267726872697270727172727273727472757276727772787279728072817282728372847285728672877288728972907291729272937294729572967297729872997300730173027303730473057306730773087309731073117312731373147315731673177318731973207321732273237324732573267327732873297330733173327333733473357336733773387339734073417342734373447345734673477348734973507351735273537354735573567357735873597360736173627363736473657366736773687369737073717372737373747375737673777378737973807381738273837384738573867387738873897390739173927393739473957396739773987399740074017402740374047405740674077408740974107411741274137414741574167417741874197420742174227423742474257426742774287429743074317432743374347435743674377438743974407441744274437444744574467447744874497450745174527453745474557456745774587459746074617462746374647465746674677468746974707471747274737474747574767477747874797480748174827483748474857486748774887489749074917492749374947495749674977498749975007501750275037504750575067507750875097510751175127513751475157516751775187519752075217522752375247525752675277528752975307531753275337534753575367537753875397540754175427543754475457546754775487549755075517552755375547555755675577558755975607561756275637564756575667567756875697570757175727573757475757576757775787579758075817582758375847585758675877588758975907591759275937594759575967597759875997600760176027603760476057606760776087609761076117612761376147615761676177618761976207621762276237624762576267627762876297630763176327633763476357636763776387639764076417642764376447645764676477648764976507651765276537654765576567657765876597660766176627663766476657666766776687669767076717672767376747675767676777678767976807681768276837684768576867687768876897690769176927693769476957696769776987699770077017702770377047705770677077708770977107711771277137714771577167717771877197720772177227723772477257726772777287729773077317732773377347735773677377738773977407741774277437744774577467747774877497750775177527753775477557756775777587759776077617762776377647765776677677768776977707771777277737774777577767777777877797780778177827783778477857786778777887789779077917792779377947795779677977798779978007801780278037804780578067807780878097810781178127813781478157816781778187819782078217822782378247825782678277828782978307831783278337834783578367837783878397840784178427843784478457846784778487849785078517852785378547855785678577858785978607861786278637864786578667867786878697870787178727873787478757876787778787879788078817882788378847885788678877888788978907891789278937894789578967897789878997900790179027903790479057906790779087909791079117912791379147915791679177918791979207921792279237924792579267927792879297930793179327933793479357936793779387939794079417942794379447945794679477948794979507951795279537954795579567957795879597960796179627963796479657966796779687969797079717972797379747975797679777978797979807981798279837984798579867987798879897990799179927993799479957996799779987999800080018002800380048005800680078008800980108011801280138014801580168017801880198020802180228023802480258026802780288029803080318032803380348035803680378038803980408041804280438044804580468047804880498050805180528053805480558056805780588059806080618062806380648065806680678068806980708071807280738074807580768077807880798080808180828083808480858086808780888089809080918092809380948095809680978098809981008101810281038104810581068107810881098110811181128113811481158116811781188119812081218122812381248125812681278128812981308131813281338134813581368137813881398140814181428143814481458146814781488149815081518152815381548155815681578158815981608161816281638164816581668167816881698170817181728173817481758176817781788179818081818182818381848185818681878188818981908191819281938194819581968197819881998200820182028203820482058206820782088209821082118212821382148215821682178218821982208221822282238224822582268227822882298230823182328233823482358236823782388239824082418242824382448245824682478248824982508251825282538254825582568257825882598260826182628263826482658266826782688269827082718272827382748275827682778278827982808281828282838284828582868287828882898290829182928293829482958296829782988299830083018302830383048305830683078308830983108311831283138314831583168317831883198320832183228323832483258326832783288329833083318332833383348335833683378338833983408341834283438344834583468347834883498350835183528353835483558356835783588359836083618362836383648365836683678368836983708371837283738374837583768377837883798380838183828383838483858386838783888389839083918392839383948395839683978398839984008401840284038404840584068407840884098410841184128413841484158416841784188419842084218422842384248425842684278428842984308431843284338434843584368437843884398440844184428443844484458446844784488449845084518452845384548455845684578458845984608461846284638464846584668467846884698470847184728473847484758476847784788479848084818482848384848485848684878488848984908491849284938494849584968497849884998500850185028503850485058506850785088509851085118512851385148515851685178518851985208521852285238524852585268527852885298530853185328533853485358536853785388539854085418542854385448545854685478548854985508551855285538554855585568557855885598560856185628563856485658566856785688569857085718572857385748575857685778578857985808581858285838584858585868587858885898590859185928593859485958596859785988599860086018602860386048605860686078608860986108611861286138614861586168617861886198620862186228623862486258626862786288629863086318632863386348635863686378638863986408641864286438644864586468647864886498650865186528653865486558656865786588659866086618662866386648665866686678668866986708671867286738674867586768677867886798680868186828683868486858686868786888689869086918692869386948695869686978698869987008701870287038704870587068707870887098710871187128713871487158716871787188719872087218722872387248725872687278728872987308731873287338734873587368737873887398740874187428743874487458746874787488749875087518752875387548755875687578758875987608761876287638764876587668767876887698770877187728773877487758776877787788779878087818782878387848785878687878788878987908791879287938794879587968797879887998800880188028803880488058806880788088809881088118812881388148815881688178818881988208821882288238824882588268827882888298830883188328833883488358836883788388839884088418842884388448845884688478848884988508851885288538854885588568857885888598860886188628863886488658866886788688869887088718872887388748875887688778878887988808881888288838884888588868887888888898890889188928893889488958896889788988899890089018902890389048905890689078908890989108911891289138914891589168917891889198920892189228923892489258926892789288929893089318932893389348935893689378938893989408941894289438944894589468947894889498950895189528953895489558956895789588959896089618962896389648965896689678968896989708971897289738974897589768977897889798980898189828983898489858986898789888989899089918992899389948995899689978998899990009001900290039004900590069007900890099010901190129013901490159016901790189019902090219022902390249025902690279028902990309031903290339034903590369037903890399040904190429043904490459046904790489049905090519052905390549055905690579058905990609061906290639064906590669067906890699070907190729073907490759076907790789079908090819082908390849085908690879088908990909091909290939094909590969097909890999100910191029103910491059106910791089109911091119112911391149115911691179118911991209121912291239124912591269127912891299130913191329133913491359136913791389139914091419142914391449145914691479148914991509151915291539154915591569157915891599160916191629163916491659166916791689169917091719172917391749175917691779178917991809181918291839184918591869187918891899190919191929193919491959196919791989199920092019202920392049205920692079208920992109211921292139214921592169217921892199220922192229223922492259226922792289229923092319232923392349235923692379238923992409241924292439244924592469247924892499250925192529253925492559256925792589259926092619262926392649265926692679268926992709271927292739274927592769277927892799280928192829283928492859286928792889289929092919292929392949295929692979298929993009301930293039304930593069307930893099310931193129313931493159316931793189319932093219322932393249325932693279328932993309331933293339334933593369337933893399340934193429343934493459346934793489349935093519352935393549355935693579358935993609361936293639364936593669367936893699370937193729373937493759376937793789379938093819382938393849385938693879388938993909391939293939394939593969397939893999400940194029403940494059406940794089409941094119412941394149415941694179418941994209421942294239424942594269427942894299430943194329433943494359436943794389439944094419442944394449445944694479448944994509451945294539454945594569457945894599460946194629463946494659466946794689469947094719472947394749475947694779478947994809481948294839484948594869487948894899490949194929493949494959496949794989499950095019502950395049505950695079508950995109511951295139514951595169517951895199520952195229523952495259526952795289529953095319532953395349535953695379538953995409541954295439544954595469547954895499550955195529553955495559556955795589559956095619562956395649565956695679568956995709571957295739574957595769577957895799580958195829583958495859586958795889589959095919592959395949595959695979598959996009601960296039604960596069607960896099610961196129613961496159616961796189619962096219622962396249625962696279628962996309631963296339634963596369637963896399640964196429643964496459646964796489649965096519652965396549655965696579658965996609661966296639664966596669667966896699670967196729673967496759676967796789679968096819682968396849685968696879688968996909691969296939694969596969697969896999700970197029703970497059706970797089709971097119712971397149715971697179718971997209721972297239724972597269727972897299730973197329733973497359736973797389739974097419742974397449745974697479748974997509751975297539754975597569757975897599760976197629763976497659766976797689769977097719772977397749775977697779778977997809781978297839784978597869787978897899790979197929793979497959796979797989799980098019802980398049805980698079808980998109811981298139814981598169817981898199820982198229823982498259826982798289829983098319832983398349835983698379838983998409841984298439844984598469847984898499850985198529853985498559856985798589859986098619862986398649865986698679868986998709871987298739874987598769877987898799880988198829883988498859886988798889889989098919892989398949895989698979898989999009901990299039904990599069907990899099910991199129913991499159916991799189919992099219922992399249925992699279928992999309931993299339934993599369937993899399940994199429943994499459946994799489949995099519952995399549955995699579958995999609961996299639964996599669967996899699970997199729973997499759976997799789979998099819982998399849985998699879988998999909991999299939994999599969997999899991000010001100021000310004100051000610007100081000910010100111001210013100141001510016100171001810019100201002110022100231002410025100261002710028100291003010031100321003310034100351003610037100381003910040100411004210043100441004510046100471004810049100501005110052100531005410055100561005710058100591006010061100621006310064100651006610067100681006910070100711007210073100741007510076100771007810079100801008110082100831008410085100861008710088100891009010091100921009310094100951009610097100981009910100101011010210103101041010510106101071010810109101101011110112101131011410115101161011710118101191012010121101221012310124101251012610127101281012910130101311013210133101341013510136101371013810139101401014110142101431014410145101461014710148101491015010151101521015310154101551015610157101581015910160101611016210163101641016510166101671016810169101701017110172101731017410175101761017710178101791018010181101821018310184101851018610187101881018910190101911019210193101941019510196101971019810199102001020110202102031020410205102061020710208102091021010211102121021310214102151021610217102181021910220102211022210223102241022510226102271022810229102301023110232102331023410235102361023710238102391024010241102421024310244102451024610247102481024910250102511025210253102541025510256102571025810259102601026110262102631026410265102661026710268102691027010271102721027310274102751027610277102781027910280102811028210283102841028510286102871028810289102901029110292102931029410295102961029710298102991030010301103021030310304103051030610307103081030910310103111031210313103141031510316103171031810319103201032110322103231032410325103261032710328103291033010331103321033310334103351033610337103381033910340103411034210343103441034510346103471034810349103501035110352103531035410355103561035710358103591036010361103621036310364103651036610367103681036910370103711037210373103741037510376103771037810379103801038110382103831038410385103861038710388103891039010391103921039310394103951039610397103981039910400104011040210403104041040510406104071040810409104101041110412104131041410415104161041710418104191042010421104221042310424104251042610427104281042910430104311043210433104341043510436104371043810439104401044110442104431044410445104461044710448104491045010451104521045310454104551045610457104581045910460104611046210463104641046510466104671046810469104701047110472104731047410475104761047710478104791048010481104821048310484104851048610487104881048910490104911049210493104941049510496104971049810499105001050110502105031050410505105061050710508105091051010511105121051310514105151051610517105181051910520105211052210523105241052510526105271052810529105301053110532105331053410535105361053710538105391054010541105421054310544105451054610547105481054910550105511055210553105541055510556105571055810559105601056110562105631056410565105661056710568105691057010571105721057310574105751057610577105781057910580105811058210583105841058510586105871058810589105901059110592105931059410595105961059710598105991060010601106021060310604106051060610607106081060910610106111061210613106141061510616106171061810619106201062110622106231062410625106261062710628106291063010631106321063310634106351063610637106381063910640106411064210643106441064510646106471064810649106501065110652106531065410655106561065710658106591066010661106621066310664106651066610667106681066910670106711067210673106741067510676106771067810679106801068110682106831068410685106861068710688106891069010691106921069310694106951069610697106981069910700107011070210703107041070510706107071070810709107101071110712107131071410715107161071710718107191072010721107221072310724107251072610727107281072910730107311073210733107341073510736107371073810739107401074110742107431074410745107461074710748107491075010751107521075310754107551075610757107581075910760107611076210763107641076510766107671076810769107701077110772107731077410775107761077710778107791078010781107821078310784107851078610787107881078910790107911079210793107941079510796107971079810799108001080110802108031080410805108061080710808108091081010811108121081310814108151081610817108181081910820108211082210823108241082510826108271082810829108301083110832108331083410835108361083710838108391084010841108421084310844108451084610847108481084910850108511085210853108541085510856108571085810859108601086110862108631086410865108661086710868108691087010871108721087310874108751087610877108781087910880108811088210883 |
- var requirejs, require, define; (function(global) {
- function isFunction(e) {
- return ostring.call(e) === "[object Function]"
- }
- function isArray(e) {
- return ostring.call(e) === "[object Array]"
- }
- function each(e, t) {
- if (e) {
- var n;
- for (n = 0; n < e.length; n += 1) if (e[n] && t(e[n], n, e)) break
- }
- }
- function eachReverse(e, t) {
- if (e) {
- var n;
- for (n = e.length - 1; n > -1; n -= 1) if (e[n] && t(e[n], n, e)) break
- }
- }
- function hasProp(e, t) {
- return hasOwn.call(e, t)
- }
- function getOwn(e, t) {
- return hasProp(e, t) && e[t]
- }
- function eachProp(e, t) {
- var n;
- for (n in e) if (hasProp(e, n) && t(e[n], n)) break
- }
- function mixin(e, t, n, r) {
- return t && eachProp(t,
- function(t, i) {
- if (n || !hasProp(e, i)) r && typeof t == "object" && t && !isArray(t) && !isFunction(t) && !(t instanceof RegExp) ? (e[i] || (e[i] = {}), mixin(e[i], t, n, r)) : e[i] = t
- }),
- e
- }
- function bind(e, t) {
- return function() {
- return t.apply(e, arguments)
- }
- }
- function scripts() {
- return document.getElementsByTagName("script")
- }
- function defaultOnError(e) {
- throw e
- }
- function getGlobal(e) {
- if (!e) return e;
- var t = global;
- return each(e.split("."),
- function(e) {
- t = t[e]
- }),
- t
- }
- function makeError(e, t, n, r) {
- var i = new Error(t + "\nhttp://requirejs.org/docs/errors.html#" + e);
- return i.requireType = e,
- i.requireModules = r,
- n && (i.originalError = n),
- i
- }
- function newContext(e) {
- function m(e) {
- var t, n, r = e.length;
- for (t = 0; t < r; t++) {
- n = e[t];
- if (n === ".") e.splice(t, 1),
- t -= 1;
- else if (n === "..") {
- if (t === 1 && (e[2] === ".." || e[0] === "..")) break;
- t > 0 && (e.splice(t - 1, 2), t -= 2)
- }
- }
- }
- function g(e, t, n) {
- var r, i, s, u, a, f, l, c, h, p, d, v = t && t.split("/"),
- g = v,
- y = o.map,
- b = y && y["*"];
- e && e.charAt(0) === "." && (t ? (g = v.slice(0, v.length - 1), e = e.split("/"), l = e.length - 1, o.nodeIdCompat && jsSuffixRegExp.test(e[l]) && (e[l] = e[l].replace(jsSuffixRegExp, "")), e = g.concat(e), m(e), e = e.join("/")) : e.indexOf("./") === 0 && (e = e.substring(2)));
- if (n && y && (v || b)) {
- s = e.split("/");
- e: for (u = s.length; u > 0; u -= 1) {
- f = s.slice(0, u).join("/");
- if (v) for (a = v.length; a > 0; a -= 1) {
- i = getOwn(y, v.slice(0, a).join("/"));
- if (i) {
- i = getOwn(i, f);
- if (i) {
- c = i,
- h = u;
- break e
- }
- }
- } ! p && b && getOwn(b, f) && (p = getOwn(b, f), d = u)
- } ! c && p && (c = p, h = d),
- c && (s.splice(0, h, c), e = s.join("/"))
- }
- return r = getOwn(o.pkgs, e),
- r ? r: e
- }
- function y(e) {
- isBrowser && each(scripts(),
- function(t) {
- if (t.getAttribute("data-requiremodule") === e && t.getAttribute("data-requirecontext") === r.contextName) return t.parentNode.removeChild(t),
- !0
- })
- }
- function b(e) {
- var t = getOwn(o.paths, e);
- if (t && isArray(t) && t.length > 1) return t.shift(),
- r.require.undef(e),
- r.require([e]),
- !0
- }
- function w(e) {
- var t, n = e ? e.indexOf("!") : -1;
- return n > -1 && (t = e.substring(0, n), e = e.substring(n + 1, e.length)),
- [t, e]
- }
- function E(e, t, n, i) {
- var s, o, u, a, f = null,
- l = t ? t.name: null,
- h = e,
- p = !0,
- m = "";
- return e || (p = !1, e = "_@r" + (d += 1)),
- a = w(e),
- f = a[0],
- e = a[1],
- f && (f = g(f, l, i), o = getOwn(c, f)),
- e && (f ? o && o.normalize ? m = o.normalize(e,
- function(e) {
- return g(e, l, i)
- }) : m = g(e, l, i) : (m = g(e, l, i), a = w(m), f = a[0], m = a[1], n = !0, s = r.nameToUrl(m))),
- u = f && !o && !n ? "_unnormalized" + (v += 1) : "",
- {
- prefix: f,
- name: m,
- parentMap: t,
- unnormalized: !!u,
- url: s,
- originalName: h,
- isDefine: p,
- id: (f ? f + "!" + m: m) + u
- }
- }
- function S(e) {
- var t = e.id,
- n = getOwn(u, t);
- return n || (n = u[t] = new r.Module(e)),
- n
- }
- function x(e, t, n) {
- var r = e.id,
- i = getOwn(u, r);
- hasProp(c, r) && (!i || i.defineEmitComplete) ? t === "defined" && n(c[r]) : (i = S(e), i.error && t === "error" ? n(i.error) : i.on(t, n))
- }
- function T(e, t) {
- var n = e.requireModules,
- r = !1;
- t ? t(e) : (each(n,
- function(t) {
- var n = getOwn(u, t);
- n && (n.error = e, n.events.error && (r = !0, n.emit("error", e)))
- }), r || req.onError(e))
- }
- function N() {
- globalDefQueue.length && (apsp.apply(l, [l.length, 0].concat(globalDefQueue)), globalDefQueue = [])
- }
- function C(e) {
- delete u[e],
- delete a[e]
- }
- function k(e, t, n) {
- var r = e.map.id;
- e.error ? e.emit("error", e.error) : (t[r] = !0, each(e.depMaps,
- function(r, i) {
- var s = r.id,
- o = getOwn(u, s);
- o && !e.depMatched[i] && !n[s] && (getOwn(t, s) ? (e.defineDep(i, c[s]), e.check()) : k(o, t, n))
- }), n[r] = !0)
- }
- function L() {
- var e, n, i = o.waitSeconds * 1e3,
- u = i && r.startTime + i < (new Date).getTime(),
- f = [],
- l = [],
- c = !1,
- h = !0;
- if (t) return;
- t = !0,
- eachProp(a,
- function(e) {
- var t = e.map,
- r = t.id;
- if (!e.enabled) return;
- t.isDefine || l.push(e);
- if (!e.error) if (!e.inited && u) b(r) ? (n = !0, c = !0) : (f.push(r), y(r));
- else if (!e.inited && e.fetched && t.isDefine) {
- c = !0;
- if (!t.prefix) return h = !1
- }
- });
- if (u && f.length) return e = makeError("timeout", "Load timeout for modules: " + f, null, f),
- e.contextName = r.contextName,
- T(e);
- h && each(l,
- function(e) {
- k(e, {},
- {})
- }),
- (!u || n) && c && (isBrowser || isWebWorker) && !s && (s = setTimeout(function() {
- s = 0,
- L()
- },
- 50)),
- t = !1
- }
- function A(e) {
- hasProp(c, e[0]) || S(E(e[0], null, !0)).init(e[1], e[2])
- }
- function O(e, t, n, r) {
- e.detachEvent && !isOpera ? r && e.detachEvent(r, t) : e.removeEventListener(n, t, !1)
- }
- function M(e) {
- var t = e.currentTarget || e.srcElement;
- return O(t, r.onScriptLoad, "load", "onreadystatechange"),
- O(t, r.onScriptError, "error"),
- {
- node: t,
- id: t && t.getAttribute("data-requiremodule")
- }
- }
- function _() {
- var e;
- N();
- while (l.length) {
- e = l.shift();
- if (e[0] === null) return null;
- A(e)
- }
- }
- var t, n, r, i, s, o = {
- waitSeconds: 7,
- baseUrl: "./",
- paths: {},
- bundles: {},
- pkgs: {},
- shim: {},
- config: {}
- },
- u = {},
- a = {},
- f = {},
- l = [],
- c = {},
- h = {},
- p = {},
- d = 1,
- v = 1;
- return i = {
- require: function(e) {
- return e.require ? e.require: e.require = r.makeRequire(e.map)
- },
- exports: function(e) {
- e.usingExports = !0;
- if (e.map.isDefine) return e.exports ? e.exports: e.exports = c[e.map.id] = {}
- },
- module: function(e) {
- return e.module ? e.module: e.module = {
- id: e.map.id,
- uri: e.map.url,
- config: function() {
- return getOwn(o.config, e.map.id) || {}
- },
- exports: i.exports(e)
- }
- }
- },
- n = function(e) {
- this.events = getOwn(f, e.id) || {},
- this.map = e,
- this.shim = getOwn(o.shim, e.id),
- this.depExports = [],
- this.depMaps = [],
- this.depMatched = [],
- this.pluginMaps = {},
- this.depCount = 0
- },
- n.prototype = {
- init: function(e, t, n, r) {
- r = r || {};
- if (this.inited) return;
- this.factory = t,
- n ? this.on("error", n) : this.events.error && (n = bind(this,
- function(e) {
- this.emit("error", e)
- })),
- this.depMaps = e && e.slice(0),
- this.errback = n,
- this.inited = !0,
- this.ignore = r.ignore,
- r.enabled || this.enabled ? this.enable() : this.check()
- },
- defineDep: function(e, t) {
- this.depMatched[e] || (this.depMatched[e] = !0, this.depCount -= 1, this.depExports[e] = t)
- },
- fetch: function() {
- if (this.fetched) return;
- this.fetched = !0,
- r.startTime = (new Date).getTime();
- var e = this.map;
- if (!this.shim) return e.prefix ? this.callPlugin() : this.load();
- r.makeRequire(this.map, {
- enableBuildCallback: !0
- })(this.shim.deps || [], bind(this,
- function() {
- return e.prefix ? this.callPlugin() : this.load()
- }))
- },
- load: function() {
- var e = this.map.url;
- h[e] || (h[e] = !0, r.load(this.map.id, e))
- },
- check: function() {
- if (!this.enabled || this.enabling) return;
- var e, t, n = this.map.id,
- i = this.depExports,
- s = this.exports,
- o = this.factory;
- if (!this.inited) this.fetch();
- else if (this.error) this.emit("error", this.error);
- else if (!this.defining) {
- this.defining = !0;
- if (this.depCount < 1 && !this.defined) {
- if (isFunction(o)) {
- if (this.events.error && this.map.isDefine || req.onError !== defaultOnError) try {
- s = r.execCb(n, o, i, s)
- } catch(u) {
- e = u
- } else s = r.execCb(n, o, i, s);
- this.map.isDefine && s === undefined && (t = this.module, t ? s = t.exports: this.usingExports && (s = this.exports));
- if (e) return e.requireMap = this.map,
- e.requireModules = this.map.isDefine ? [this.map.id] : null,
- e.requireType = this.map.isDefine ? "define": "require",
- T(this.error = e)
- } else s = o;
- this.exports = s,
- this.map.isDefine && !this.ignore && (c[n] = s, req.onResourceLoad && req.onResourceLoad(r, this.map, this.depMaps)),
- C(n),
- this.defined = !0
- }
- this.defining = !1,
- this.defined && !this.defineEmitted && (this.defineEmitted = !0, this.emit("defined", this.exports), this.defineEmitComplete = !0)
- }
- },
- callPlugin: function() {
- var e = this.map,
- t = e.id,
- n = E(e.prefix);
- this.depMaps.push(n),
- x(n, "defined", bind(this,
- function(n) {
- var i, s, a, f = getOwn(p, this.map.id),
- l = this.map.name,
- c = this.map.parentMap ? this.map.parentMap.name: null,
- h = r.makeRequire(e.parentMap, {
- enableBuildCallback: !0
- });
- if (this.map.unnormalized) {
- n.normalize && (l = n.normalize(l,
- function(e) {
- return g(e, c, !0)
- }) || ""),
- s = E(e.prefix + "!" + l, this.map.parentMap),
- x(s, "defined", bind(this,
- function(e) {
- this.init([],
- function() {
- return e
- },
- null, {
- enabled: !0,
- ignore: !0
- })
- })),
- a = getOwn(u, s.id),
- a && (this.depMaps.push(s), this.events.error && a.on("error", bind(this,
- function(e) {
- this.emit("error", e)
- })), a.enable());
- return
- }
- if (f) {
- this.map.url = r.nameToUrl(f),
- this.load();
- return
- }
- i = bind(this,
- function(e) {
- this.init([],
- function() {
- return e
- },
- null, {
- enabled: !0
- })
- }),
- i.error = bind(this,
- function(e) {
- this.inited = !0,
- this.error = e,
- e.requireModules = [t],
- eachProp(u,
- function(e) {
- e.map.id.indexOf(t + "_unnormalized") === 0 && C(e.map.id)
- }),
- T(e)
- }),
- i.fromText = bind(this,
- function(n, s) {
- var u = e.name,
- a = E(u),
- f = useInteractive;
- s && (n = s),
- f && (useInteractive = !1),
- S(a),
- hasProp(o.config, t) && (o.config[u] = o.config[t]);
- try {
- req.exec(n)
- } catch(l) {
- return T(makeError("fromtexteval", "fromText eval for " + t + " failed: " + l, l, [t]))
- }
- f && (useInteractive = !0),
- this.depMaps.push(a),
- r.completeLoad(u),
- h([u], i)
- }),
- n.load(e.name, h, i, o)
- })),
- r.enable(n, this),
- this.pluginMaps[n.id] = n
- },
- enable: function() {
- a[this.map.id] = this,
- this.enabled = !0,
- this.enabling = !0,
- each(this.depMaps, bind(this,
- function(e, t) {
- var n, s, o;
- if (typeof e == "string") {
- e = E(e, this.map.isDefine ? this.map: this.map.parentMap, !1, !this.skipMap),
- this.depMaps[t] = e,
- o = getOwn(i, e.id);
- if (o) {
- this.depExports[t] = o(this);
- return
- }
- this.depCount += 1,
- x(e, "defined", bind(this,
- function(e) {
- this.defineDep(t, e),
- this.check()
- })),
- this.errback && x(e, "error", bind(this, this.errback))
- }
- n = e.id,
- s = u[n],
- !hasProp(i, n) && s && !s.enabled && r.enable(e, this)
- })),
- eachProp(this.pluginMaps, bind(this,
- function(e) {
- var t = getOwn(u, e.id);
- t && !t.enabled && r.enable(e, this)
- })),
- this.enabling = !1,
- this.check()
- },
- on: function(e, t) {
- var n = this.events[e];
- n || (n = this.events[e] = []),
- n.push(t)
- },
- emit: function(e, t) {
- each(this.events[e],
- function(e) {
- e(t)
- }),
- e === "error" && delete this.events[e]
- }
- },
- r = {
- config: o,
- contextName: e,
- registry: u,
- defined: c,
- urlFetched: h,
- defQueue: l,
- Module: n,
- makeModuleMap: E,
- nextTick: req.nextTick,
- onError: T,
- configure: function(e) {
- e.baseUrl && e.baseUrl.charAt(e.baseUrl.length - 1) !== "/" && (e.baseUrl += "/");
- var t = o.shim,
- n = {
- paths: !0,
- bundles: !0,
- config: !0,
- map: !0
- };
- eachProp(e,
- function(e, t) {
- n[t] ? (o[t] || (o[t] = {}), mixin(o[t], e, !0, !0)) : o[t] = e
- }),
- e.bundles && eachProp(e.bundles,
- function(e, t) {
- each(e,
- function(e) {
- e !== t && (p[e] = t)
- })
- }),
- e.shim && (eachProp(e.shim,
- function(e, n) {
- isArray(e) && (e = {
- deps: e
- }),
- (e.exports || e.init) && !e.exportsFn && (e.exportsFn = r.makeShimExports(e)),
- t[n] = e
- }), o.shim = t),
- e.packages && each(e.packages,
- function(e) {
- var t, n;
- e = typeof e == "string" ? {
- name: e
- }: e,
- n = e.name,
- t = e.location,
- t && (o.paths[n] = e.location),
- o.pkgs[n] = e.name + "/" + (e.main || "main").replace(currDirRegExp, "").replace(jsSuffixRegExp, "")
- }),
- eachProp(u,
- function(e, t) { ! e.inited && !e.map.unnormalized && (e.map = E(t))
- }),
- (e.deps || e.callback) && r.require(e.deps || [], e.callback)
- },
- makeShimExports: function(e) {
- function t() {
- var t;
- return e.init && (t = e.init.apply(global, arguments)),
- t || e.exports && getGlobal(e.exports)
- }
- return t
- },
- makeRequire: function(t, n) {
- function s(o, a, f) {
- var l, h, p;
- return n.enableBuildCallback && a && isFunction(a) && (a.__requireJsBuild = !0),
- typeof o == "string" ? isFunction(a) ? T(makeError("requireargs", "Invalid require call"), f) : t && hasProp(i, o) ? i[o](u[t.id]) : req.get ? req.get(r, o, t, s) : (h = E(o, t, !1, !0), l = h.id, hasProp(c, l) ? c[l] : T(makeError("notloaded", 'Module name "' + l + '" has not been loaded yet for context: ' + e + (t ? "": ". Use require([])")))) : (_(), r.nextTick(function() {
- _(),
- p = S(E(null, t)),
- p.skipMap = n.skipMap,
- p.init(o, a, f, {
- enabled: !0
- }),
- L()
- }), s)
- }
- return n = n || {},
- mixin(s, {
- isBrowser: isBrowser,
- toUrl: function(e) {
- var n, i = e.lastIndexOf("."),
- s = e.split("/")[0],
- o = s === "." || s === "..";
- return i !== -1 && (!o || i > 1) && (n = e.substring(i, e.length), e = e.substring(0, i)),
- r.nameToUrl(g(e, t && t.id, !0), n, !0)
- },
- defined: function(e) {
- return hasProp(c, E(e, t, !1, !0).id)
- },
- specified: function(e) {
- return e = E(e, t, !1, !0).id,
- hasProp(c, e) || hasProp(u, e)
- }
- }),
- t || (s.undef = function(e) {
- N();
- var n = E(e, t, !0),
- r = getOwn(u, e);
- y(e),
- delete c[e],
- delete h[n.url],
- delete f[e],
- eachReverse(l,
- function(t, n) {
- t[0] === e && l.splice(n, 1)
- }),
- r && (r.events.defined && (f[e] = r.events), C(e))
- }),
- s
- },
- enable: function(e) {
- var t = getOwn(u, e.id);
- t && S(e).enable()
- },
- completeLoad: function(e) {
- var t, n, r, i = getOwn(o.shim, e) || {},
- s = i.exports;
- N();
- while (l.length) {
- n = l.shift();
- if (n[0] === null) {
- n[0] = e;
- if (t) break;
- t = !0
- } else n[0] === e && (t = !0);
- A(n)
- }
- r = getOwn(u, e);
- if (!t && !hasProp(c, e) && r && !r.inited) {
- if (o.enforceDefine && (!s || !getGlobal(s))) {
- if (b(e)) return;
- return T(makeError("nodefine", "No define call for " + e, null, [e]))
- }
- A([e, i.deps || [], i.exportsFn])
- }
- L()
- },
- nameToUrl: function(e, t, n) {
- var i, s, u, a, f, l, c, h = getOwn(o.pkgs, e);
- h && (e = h),
- c = getOwn(p, e);
- if (c) return r.nameToUrl(c, t, n);
- if (req.jsExtRegExp.test(e)) f = e + (t || "");
- else {
- i = o.paths,
- s = e.split("/");
- for (u = s.length; u > 0; u -= 1) {
- a = s.slice(0, u).join("/"),
- l = getOwn(i, a);
- if (l) {
- isArray(l) && (l = l[0]),
- s.splice(0, u, l);
- break
- }
- }
- f = s.join("/"),
- f += t || (/^data\:|\?/.test(f) || n ? "": ".js"),
- f = (f.charAt(0) === "/" || f.match(/^[\w\+\.\-]+:/) ? "": o.baseUrl) + f
- }
- return o.urlArgs ? f + ((f.indexOf("?") === -1 ? "?": "&") + o.urlArgs) : f
- },
- load: function(e, t) {
- req.load(r, e, t)
- },
- execCb: function(e, t, n, r) {
- return t.apply(r, n)
- },
- onScriptLoad: function(e) {
- if (e.type === "load" || readyRegExp.test((e.currentTarget || e.srcElement).readyState)) {
- interactiveScript = null;
- var t = M(e);
- r.completeLoad(t.id)
- }
- },
- onScriptError: function(e) {
- var t = M(e);
- if (!b(t.id)) return T(makeError("scripterror", "Script error for: " + t.id, e, [t.id]))
- }
- },
- r.require = r.makeRequire(),
- r
- }
- function getInteractiveScript() {
- return interactiveScript && interactiveScript.readyState === "interactive" ? interactiveScript: (eachReverse(scripts(),
- function(e) {
- if (e.readyState === "interactive") return interactiveScript = e
- }), interactiveScript)
- }
- var req, s, head, baseElement, dataMain, src, interactiveScript, currentlyAddingScript, mainScript, subPath, version = "2.1.10",
- commentRegExp = /(\/\*([\s\S]*?)\*\/|([^:]|^)\/\/(.*)$)/mg,
- cjsRequireRegExp = /[^.]\s*require\s*\(\s*["']([^'"\s]+)["']\s*\)/g,
- jsSuffixRegExp = /\.js$/,
- currDirRegExp = /^\.\//,
- op = Object.prototype,
- ostring = op.toString,
- hasOwn = op.hasOwnProperty,
- ap = Array.prototype,
- apsp = ap.splice,
- isBrowser = typeof window != "undefined" && typeof navigator != "undefined" && !!window.document,
- isWebWorker = !isBrowser && typeof importScripts != "undefined",
- readyRegExp = isBrowser && navigator.platform === "PLAYSTATION 3" ? /^complete$/: /^(complete|loaded)$/,
- defContextName = "_",
- isOpera = typeof opera != "undefined" && opera.toString() === "[object Opera]",
- contexts = {},
- cfg = {},
- globalDefQueue = [],
- useInteractive = !1;
- if (typeof define != "undefined") return;
- if (typeof requirejs != "undefined") {
- if (isFunction(requirejs)) return;
- cfg = requirejs,
- requirejs = undefined
- }
- typeof require != "undefined" && !isFunction(require) && (cfg = require, require = undefined),
- req = requirejs = function(e, t, n, r) {
- var i, s, o = defContextName;
- return ! isArray(e) && typeof e != "string" && (s = e, isArray(t) ? (e = t, t = n, n = r) : e = []),
- s && s.context && (o = s.context),
- i = getOwn(contexts, o),
- i || (i = contexts[o] = req.s.newContext(o)),
- s && i.configure(s),
- i.require(e, t, n)
- },
- req.config = function(e) {
- return req(e)
- },
- req.nextTick = typeof setTimeout != "undefined" ?
- function(e) {
- setTimeout(e, 4)
- }: function(e) {
- e()
- },
- require || (require = req),
- req.version = version,
- req.jsExtRegExp = /^\/|:|\?|\.js$/,
- req.isBrowser = isBrowser,
- s = req.s = {
- contexts: contexts,
- newContext: newContext
- },
- req({}),
- each(["toUrl", "undef", "defined", "specified"],
- function(e) {
- req[e] = function() {
- var t = contexts[defContextName];
- return t.require[e].apply(t, arguments)
- }
- }),
- isBrowser && (head = s.head = document.getElementsByTagName("head")[0], baseElement = document.getElementsByTagName("base")[0], baseElement && (head = s.head = baseElement.parentNode)),
- req.onError = defaultOnError,
- req.createNode = function(e, t, n) {
- var r = e.xhtml ? document.createElementNS("http://www.w3.org/1999/xhtml", "html:script") : document.createElement("script");
- return r.type = e.scriptType || "text/javascript",
- r.charset = "utf-8",
- r.async = !0,
- r
- },
- req.load = function(e, t, n) {
- var r = e && e.config || {},
- i;
- if (isBrowser) return i = req.createNode(r, t, n),
- i.setAttribute("data-requirecontext", e.contextName),
- i.setAttribute("data-requiremodule", t),
- i.attachEvent && !(i.attachEvent.toString && i.attachEvent.toString().indexOf("[native code") < 0) && !isOpera ? (useInteractive = !0, i.attachEvent("onreadystatechange", e.onScriptLoad)) : (i.addEventListener("load", e.onScriptLoad, !1), i.addEventListener("error", e.onScriptError, !1)),
- i.src = n,
- currentlyAddingScript = i,
- baseElement ? head.insertBefore(i, baseElement) : head.appendChild(i),
- currentlyAddingScript = null,
- i;
- if (isWebWorker) try {
- importScripts(n),
- e.completeLoad(t)
- } catch(s) {
- e.onError(makeError("importscripts", "importScripts failed for " + t + " at " + n, s, [t]))
- }
- },
- isBrowser && !cfg.skipDataMain && eachReverse(scripts(),
- function(e) {
- head || (head = e.parentNode),
- dataMain = e.getAttribute("data-main");
- if (dataMain) return mainScript = dataMain,
- cfg.baseUrl || (src = mainScript.split("/"), mainScript = src.pop(), subPath = src.length ? src.join("/") + "/": "./", cfg.baseUrl = subPath),
- mainScript = mainScript.replace(jsSuffixRegExp, ""),
- req.jsExtRegExp.test(mainScript) && (mainScript = dataMain),
- cfg.deps = cfg.deps ? cfg.deps.concat(mainScript) : [mainScript],
- !0
- }),
- define = function(e, t, n) {
- var r, i;
- typeof e != "string" && (n = t, t = e, e = null),
- isArray(t) || (n = t, t = null),
- !t && isFunction(n) && (t = [], n.length && (n.toString().replace(commentRegExp, "").replace(cjsRequireRegExp,
- function(e, n) {
- t.push(n)
- }), t = (n.length === 1 ? ["require"] : ["require", "exports", "module"]).concat(t))),
- useInteractive && (r = currentlyAddingScript || getInteractiveScript(), r && (e || (e = r.getAttribute("data-requiremodule")), i = contexts[r.getAttribute("data-requirecontext")])),
- (i ? i.defQueue: globalDefQueue).push([e, t, n])
- },
- define.amd = {
- jQuery: !0
- },
- req.exec = function(text) {
- return eval(text)
- },
- req(cfg)
- })(this),
- define("requireLib",
- function() {});
- var viewporter; (function() {
- var e;
- viewporter = {
- forceDetection: !1,
- disableLegacyAndroid: !0,
- ACTIVE: function() {
- return viewporter.disableLegacyAndroid && /android 2/i.test(navigator.userAgent) ? !1 : /ipad/i.test(navigator.userAgent) ? !1 : /webos/i.test(navigator.userAgent) ? !0 : "ontouchstart" in window ? !0 : !1
- },
- READY: !1,
- isLandscape: function() {
- return window.orientation === 90 || window.orientation === -90
- },
- ready: function(e) {
- window.addEventListener("viewportready", e, !1)
- },
- change: function(e) {
- window.addEventListener("viewportchange", e, !1)
- },
- refresh: function() {
- e && e.prepareVisualViewport()
- },
- preventPageScroll: function() {
- document.body.addEventListener("touchmove",
- function(e) {
- e.preventDefault()
- },
- !1),
- document.body.addEventListener("touchstart",
- function() {
- e.prepareVisualViewport()
- },
- !1)
- }
- },
- viewporter.ACTIVE = viewporter.ACTIVE();
- if (!viewporter.ACTIVE) return;
- var t = function() {
- var e = this;
- this.IS_ANDROID = /Android/.test(navigator.userAgent) && !/Chrome/.test(navigator.userAgent);
- var t = function() {
- e.prepareVisualViewport();
- var t = window.orientation;
- window.addEventListener("orientationchange",
- function() {
- window.orientation !== t && (e.prepareVisualViewport(), t = window.orientation)
- },
- !1)
- };
- document.readyState === "loading" ? document.addEventListener("DOMContentLoaded",
- function() {
- t()
- },
- !1) : t()
- };
- t.prototype = {
- getProfile: function() {
- if (viewporter.forceDetection) return null;
- for (var e in viewporter.profiles) if ((new RegExp(e)).test(navigator.userAgent)) return viewporter.profiles[e];
- return null
- },
- postProcess: function() {
- viewporter.READY = !0,
- this.triggerWindowEvent(this._firstUpdateExecuted ? "viewportchange": "viewportready"),
- this._firstUpdateExecuted = !0
- },
- prepareVisualViewport: function() {
- var e = this;
- if (navigator.standalone) return this.postProcess();
- document.documentElement.style.minHeight = "5000px";
- var t = window.innerHeight,
- n = this.getProfile(),
- r = viewporter.isLandscape() ? "landscape": "portrait";
- window.scrollTo(0, e.IS_ANDROID ? 1 : 0);
- var i = 40,
- s = window.setInterval(function() {
- function o() {
- return n ? window.innerHeight === n[r] : !1
- }
- function u() {
- return window.innerHeight > t
- }
- window.scrollTo(0, e.IS_ANDROID ? 1 : 0),
- i--;
- if ((e.IS_ANDROID ? o() : u()) || i < 0) document.documentElement.style.minHeight = window.innerHeight + "px",
- document.getElementById("viewporter").style.position = "relative",
- document.getElementById("viewporter").style.height = window.innerHeight + "px",
- clearInterval(s),
- e.postProcess()
- },
- 10)
- },
- triggerWindowEvent: function(e) {
- var t = document.createEvent("Event");
- t.initEvent(e, !1, !1),
- window.dispatchEvent(t)
- }
- },
- e = new t
- })(),
- viewporter.profiles = {
- MZ601: {
- portrait: 696,
- landscape: 1176
- },
- "GT-I9000|GT-I9100|Nexus S": {
- portrait: 508,
- landscape: 295
- },
- "GT-P1000": {
- portrait: 657,
- landscape: 400
- },
- "Desire_A8181|DesireHD_A9191": {
- portrait: 533,
- landscape: 320
- }
- },
- define("viewporter",
- function(e) {
- return function() {
- var t, n;
- return t || e.viewporter
- }
- } (this)),
- this.createjs = this.createjs || {},
- function() {
- var e = function(e, t, n) {
- this.initialize(e, t, n)
- },
- t = e.prototype;
- t.type = null,
- t.target = null,
- t.currentTarget = null,
- t.eventPhase = 0,
- t.bubbles = !1,
- t.cancelable = !1,
- t.timeStamp = 0,
- t.defaultPrevented = !1,
- t.propagationStopped = !1,
- t.immediatePropagationStopped = !1,
- t.removed = !1,
- t.initialize = function(e, t, n) {
- this.type = e,
- this.bubbles = t,
- this.cancelable = n,
- this.timeStamp = (new Date).getTime()
- },
- t.preventDefault = function() {
- this.defaultPrevented = !0
- },
- t.stopPropagation = function() {
- this.propagationStopped = !0
- },
- t.stopImmediatePropagation = function() {
- this.immediatePropagationStopped = this.propagationStopped = !0
- },
- t.remove = function() {
- this.removed = !0
- },
- t.clone = function() {
- return new e(this.type, this.bubbles, this.cancelable)
- },
- t.toString = function() {
- return "[Event (type=" + this.type + ")]"
- },
- createjs.Event = e
- } (),
- this.createjs = this.createjs || {},
- function() {
- var e = function() {},
- t = e.prototype;
- e.initialize = function(e) {
- e.addEventListener = t.addEventListener,
- e.on = t.on,
- e.removeEventListener = e.off = t.removeEventListener,
- e.removeAllEventListeners = t.removeAllEventListeners,
- e.hasEventListener = t.hasEventListener,
- e.dispatchEvent = t.dispatchEvent,
- e._dispatchEvent = t._dispatchEvent,
- e.willTrigger = t.willTrigger
- },
- t._listeners = null,
- t._captureListeners = null,
- t.initialize = function() {},
- t.addEventListener = function(e, t, n) {
- var r;
- n ? r = this._captureListeners = this._captureListeners || {}: r = this._listeners = this._listeners || {};
- var i = r[e];
- return i && this.removeEventListener(e, t, n),
- i = r[e],
- i ? i.push(t) : r[e] = [t],
- t
- },
- t.on = function(e, t, n, r, i, s) {
- return t.handleEvent && (n = n || t, t = t.handleEvent),
- n = n || this,
- this.addEventListener(e,
- function(e) {
- t.call(n, e, i),
- r && e.remove()
- },
- s)
- },
- t.removeEventListener = function(e, t, n) {
- var r = n ? this._captureListeners: this._listeners;
- if (!r) return;
- var i = r[e];
- if (!i) return;
- for (var s = 0,
- o = i.length; s < o; s++) if (i[s] == t) {
- o == 1 ? delete r[e] : i.splice(s, 1);
- break
- }
- },
- t.off = t.removeEventListener,
- t.removeAllEventListeners = function(e) {
- e ? (this._listeners && delete this._listeners[e], this._captureListeners && delete this._captureListeners[e]) : this._listeners = this._captureListeners = null
- },
- t.dispatchEvent = function(e, t) {
- if (typeof e == "string") {
- var n = this._listeners;
- if (!n || !n[e]) return ! 1;
- e = new createjs.Event(e)
- }
- e.target = t || this;
- if (!e.bubbles || !this.parent) this._dispatchEvent(e, 2);
- else {
- var r = this,
- i = [r];
- while (r.parent) i.push(r = r.parent);
- var s, o = i.length;
- for (s = o - 1; s >= 0 && !e.propagationStopped; s--) i[s]._dispatchEvent(e, 1 + (s == 0));
- for (s = 1; s < o && !e.propagationStopped; s++) i[s]._dispatchEvent(e, 3)
- }
- return e.defaultPrevented
- },
- t.hasEventListener = function(e) {
- var t = this._listeners,
- n = this._captureListeners;
- return !! (t && t[e] || n && n[e])
- },
- t.willTrigger = function(e) {
- var t = this;
- while (t) {
- if (t.hasEventListener(e)) return ! 0;
- t = t.parent
- }
- return ! 1
- },
- t.toString = function() {
- return "[EventDispatcher]"
- },
- t._dispatchEvent = function(e, t) {
- var n, r = t == 1 ? this._captureListeners: this._listeners;
- if (e && r) {
- var i = r[e.type];
- if (!i || !(n = i.length)) return;
- e.currentTarget = this,
- e.eventPhase = t,
- e.removed = !1,
- i = i.slice();
- for (var s = 0; s < n && !e.immediatePropagationStopped; s++) {
- var o = i[s];
- o.handleEvent ? o.handleEvent(e) : o(e),
- e.removed && (this.off(e.type, o, t == 1), e.removed = !1)
- }
- }
- },
- createjs.EventDispatcher = e
- } (),
- this.createjs = this.createjs || {},
- function() {
- createjs.indexOf = function(e, t) {
- for (var n = 0,
- r = e.length; n < r; n++) if (t === e[n]) return n;
- return - 1
- }
- } (),
- this.createjs = this.createjs || {},
- function() {
- var e = function() {
- throw "UID cannot be instantiated"
- };
- e._nextID = 0,
- e.get = function() {
- return e._nextID++
- },
- createjs.UID = e
- } (),
- this.createjs = this.createjs || {},
- function() {
- var e = function() {
- throw "Ticker cannot be instantiated."
- };
- e.RAF_SYNCHED = "synched",
- e.RAF = "raf",
- e.TIMEOUT = "timeout",
- e.useRAF = !1,
- e.timingMode = null,
- e.maxDelta = 0,
- e.removeEventListener = null,
- e.removeAllEventListeners = null,
- e.dispatchEvent = null,
- e.hasEventListener = null,
- e._listeners = null,
- createjs.EventDispatcher.initialize(e),
- e._addEventListener = e.addEventListener,
- e.addEventListener = function() {
- return ! e._inited && e.init(),
- e._addEventListener.apply(e, arguments)
- },
- e._paused = !1,
- e._inited = !1,
- e._startTime = 0,
- e._pausedTime = 0,
- e._ticks = 0,
- e._pausedTicks = 0,
- e._interval = 50,
- e._lastTime = 0,
- e._times = null,
- e._tickTimes = null,
- e._timerId = null,
- e._raf = !0,
- e.init = function() {
- if (e._inited) return;
- e._inited = !0,
- e._times = [],
- e._tickTimes = [],
- e._startTime = e._getTime(),
- e._times.push(e._lastTime = 0),
- e.setInterval(e._interval)
- },
- e.reset = function() {
- if (e._raf) {
- var t = window.cancelAnimationFrame || window.webkitCancelAnimationFrame || window.mozCancelAnimationFrame || window.oCancelAnimationFrame || window.msCancelAnimationFrame;
- t && t(e._timerId)
- } else clearTimeout(e._timerId);
- e.removeAllEventListeners("tick")
- },
- e.setInterval = function(t) {
- e._interval = t;
- if (!e._inited) return;
- e._setupTick()
- },
- e.getInterval = function() {
- return e._interval
- },
- e.setFPS = function(t) {
- e.setInterval(1e3 / t)
- },
- e.getFPS = function() {
- return 1e3 / e._interval
- },
- e.getMeasuredTickTime = function(t) {
- var n = 0,
- r = e._tickTimes;
- if (r.length < 1) return - 1;
- t = Math.min(r.length, t || e.getFPS() | 0);
- for (var i = 0; i < t; i++) n += r[i];
- return n / t
- },
- e.getMeasuredFPS = function(t) {
- var n = e._times;
- return n.length < 2 ? -1 : (t = Math.min(n.length - 1, t || e.getFPS() | 0), 1e3 / ((n[0] - n[t]) / t))
- },
- e.setPaused = function(t) {
- e._paused = t
- },
- e.getPaused = function() {
- return e._paused
- },
- e.getTime = function(t) {
- return e._getTime() - e._startTime - (t ? e._pausedTime: 0)
- },
- e.getEventTime = function(t) {
- return (e._lastTime || e._startTime) - (t ? e._pausedTime: 0)
- },
- e.getTicks = function(t) {
- return e._ticks - (t ? e._pausedTicks: 0)
- },
- e._handleSynch = function() {
- var t = e._getTime() - e._startTime;
- e._timerId = null,
- e._setupTick(),
- t - e._lastTime >= (e._interval - 1) * .97 && e._tick()
- },
- e._handleRAF = function() {
- e._timerId = null,
- e._setupTick(),
- e._tick()
- },
- e._handleTimeout = function() {
- e._timerId = null,
- e._setupTick(),
- e._tick()
- },
- e._setupTick = function() {
- if (e._timerId != null) return;
- var t = e.timingMode || e.useRAF && e.RAF_SYNCHED;
- if (t == e.RAF_SYNCHED || t == e.RAF) {
- var n = window.requestAnimationFrame || window.webkitRequestAnimationFrame || window.mozRequestAnimationFrame || window.oRequestAnimationFrame || window.msRequestAnimationFrame;
- if (n) {
- e._timerId = n(t == e.RAF ? e._handleRAF: e._handleSynch),
- e._raf = !0;
- return
- }
- }
- e._raf = !1,
- e._timerId = setTimeout(e._handleTimeout, e._interval)
- },
- e._tick = function() {
- var t = e._getTime() - e._startTime,
- n = t - e._lastTime,
- r = e._paused;
- e._ticks++,
- r && (e._pausedTicks++, e._pausedTime += n),
- e._lastTime = t;
- if (e.hasEventListener("tick")) {
- var i = new createjs.Event("tick"),
- s = e.maxDelta;
- i.delta = s && n > s ? s: n,
- i.paused = r,
- i.time = t,
- i.runTime = t - e._pausedTime,
- e.dispatchEvent(i)
- }
- e._tickTimes.unshift(e._getTime() - t);
- while (e._tickTimes.length > 100) e._tickTimes.pop();
- e._times.unshift(t);
- while (e._times.length > 100) e._times.pop()
- };
- var t = window.performance && (performance.now || performance.mozNow || performance.msNow || performance.oNow || performance.webkitNow);
- e._getTime = function() {
- return t && t.call(performance) || (new Date).getTime()
- },
- createjs.Ticker = e
- } (),
- this.createjs = this.createjs || {},
- function() {
- var e = function(e, t, n, r, i, s, o, u, a, f) {
- this.initialize(e, t, n, r, i, s, o, u, a, f)
- },
- t = e.prototype = new createjs.Event;
- t.stageX = 0,
- t.stageY = 0,
- t.rawX = 0,
- t.rawY = 0,
- t.nativeEvent = null,
- t.pointerID = 0,
- t.primary = !1,
- t.addEventListener = null,
- t.removeEventListener = null,
- t.removeAllEventListeners = null,
- t.dispatchEvent = null,
- t.hasEventListener = null,
- t._listeners = null,
- createjs.EventDispatcher.initialize(t),
- t._get_localX = function() {
- return this.currentTarget.globalToLocal(this.rawX, this.rawY).x
- },
- t._get_localY = function() {
- return this.currentTarget.globalToLocal(this.rawX, this.rawY).y
- };
- try {
- Object.defineProperties(t, {
- localX: {
- get: t._get_localX
- },
- localY: {
- get: t._get_localY
- }
- })
- } catch(n) {}
- t.Event_initialize = t.initialize,
- t.initialize = function(e, t, n, r, i, s, o, u, a, f) {
- this.Event_initialize(e, t, n),
- this.stageX = r,
- this.stageY = i,
- this.nativeEvent = s,
- this.pointerID = o,
- this.primary = u,
- this.rawX = a == null ? r: a,
- this.rawY = f == null ? i: f
- },
- t.clone = function() {
- return new e(this.type, this.bubbles, this.cancelable, this.stageX, this.stageY, this.target, this.nativeEvent, this.pointerID, this.primary, this.rawX, this.rawY)
- },
- t.toString = function() {
- return "[MouseEvent (type=" + this.type + " stageX=" + this.stageX + " stageY=" + this.stageY + ")]"
- },
- createjs.MouseEvent = e
- } (),
- this.createjs = this.createjs || {},
- function() {
- var e = function(e, t, n, r, i, s) {
- this.initialize(e, t, n, r, i, s)
- },
- t = e.prototype;
- e.identity = null,
- e.DEG_TO_RAD = Math.PI / 180,
- t.a = 1,
- t.b = 0,
- t.c = 0,
- t.d = 1,
- t.tx = 0,
- t.ty = 0,
- t.alpha = 1,
- t.shadow = null,
- t.compositeOperation = null,
- t.initialize = function(e, t, n, r, i, s) {
- return this.a = e == null ? 1 : e,
- this.b = t || 0,
- this.c = n || 0,
- this.d = r == null ? 1 : r,
- this.tx = i || 0,
- this.ty = s || 0,
- this
- },
- t.prepend = function(e, t, n, r, i, s) {
- var o = this.tx;
- if (e != 1 || t != 0 || n != 0 || r != 1) {
- var u = this.a,
- a = this.c;
- this.a = u * e + this.b * n,
- this.b = u * t + this.b * r,
- this.c = a * e + this.d * n,
- this.d = a * t + this.d * r
- }
- return this.tx = o * e + this.ty * n + i,
- this.ty = o * t + this.ty * r + s,
- this
- },
- t.append = function(e, t, n, r, i, s) {
- var o = this.a,
- u = this.b,
- a = this.c,
- f = this.d;
- return this.a = e * o + t * a,
- this.b = e * u + t * f,
- this.c = n * o + r * a,
- this.d = n * u + r * f,
- this.tx = i * o + s * a + this.tx,
- this.ty = i * u + s * f + this.ty,
- this
- },
- t.prependMatrix = function(e) {
- return this.prepend(e.a, e.b, e.c, e.d, e.tx, e.ty),
- this.prependProperties(e.alpha, e.shadow, e.compositeOperation),
- this
- },
- t.appendMatrix = function(e) {
- return this.append(e.a, e.b, e.c, e.d, e.tx, e.ty),
- this.appendProperties(e.alpha, e.shadow, e.compositeOperation),
- this
- },
- t.prependTransform = function(t, n, r, i, s, o, u, a, f) {
- if (s % 360) var l = s * e.DEG_TO_RAD,
- c = Math.cos(l),
- h = Math.sin(l);
- else c = 1,
- h = 0;
- if (a || f) this.tx -= a,
- this.ty -= f;
- return o || u ? (o *= e.DEG_TO_RAD, u *= e.DEG_TO_RAD, this.prepend(c * r, h * r, -h * i, c * i, 0, 0), this.prepend(Math.cos(u), Math.sin(u), -Math.sin(o), Math.cos(o), t, n)) : this.prepend(c * r, h * r, -h * i, c * i, t, n),
- this
- },
- t.appendTransform = function(t, n, r, i, s, o, u, a, f) {
- if (s % 360) var l = s * e.DEG_TO_RAD,
- c = Math.cos(l),
- h = Math.sin(l);
- else c = 1,
- h = 0;
- o || u ? (o *= e.DEG_TO_RAD, u *= e.DEG_TO_RAD, this.append(Math.cos(u), Math.sin(u), -Math.sin(o), Math.cos(o), t, n), this.append(c * r, h * r, -h * i, c * i, 0, 0)) : this.append(c * r, h * r, -h * i, c * i, t, n);
- if (a || f) this.tx -= a * this.a + f * this.c,
- this.ty -= a * this.b + f * this.d;
- return this
- },
- t.rotate = function(e) {
- var t = Math.cos(e),
- n = Math.sin(e),
- r = this.a,
- i = this.c,
- s = this.tx;
- return this.a = r * t - this.b * n,
- this.b = r * n + this.b * t,
- this.c = i * t - this.d * n,
- this.d = i * n + this.d * t,
- this.tx = s * t - this.ty * n,
- this.ty = s * n + this.ty * t,
- this
- },
- t.skew = function(t, n) {
- return t *= e.DEG_TO_RAD,
- n *= e.DEG_TO_RAD,
- this.append(Math.cos(n), Math.sin(n), -Math.sin(t), Math.cos(t), 0, 0),
- this
- },
- t.scale = function(e, t) {
- return this.a *= e,
- this.d *= t,
- this.c *= e,
- this.b *= t,
- this.tx *= e,
- this.ty *= t,
- this
- },
- t.translate = function(e, t) {
- return this.tx += e,
- this.ty += t,
- this
- },
- t.identity = function() {
- return this.alpha = this.a = this.d = 1,
- this.b = this.c = this.tx = this.ty = 0,
- this.shadow = this.compositeOperation = null,
- this
- },
- t.invert = function() {
- var e = this.a,
- t = this.b,
- n = this.c,
- r = this.d,
- i = this.tx,
- s = e * r - t * n;
- return this.a = r / s,
- this.b = -t / s,
- this.c = -n / s,
- this.d = e / s,
- this.tx = (n * this.ty - r * i) / s,
- this.ty = -(e * this.ty - t * i) / s,
- this
- },
- t.isIdentity = function() {
- return this.tx == 0 && this.ty == 0 && this.a == 1 && this.b == 0 && this.c == 0 && this.d == 1
- },
- t.transformPoint = function(e, t, n) {
- return n = n || {},
- n.x = e * this.a + t * this.c + this.tx,
- n.y = e * this.b + t * this.d + this.ty,
- n
- },
- t.decompose = function(t) {
- t == null && (t = {}),
- t.x = this.tx,
- t.y = this.ty,
- t.scaleX = Math.sqrt(this.a * this.a + this.b * this.b),
- t.scaleY = Math.sqrt(this.c * this.c + this.d * this.d);
- var n = Math.atan2( - this.c, this.d),
- r = Math.atan2(this.b, this.a);
- return n == r ? (t.rotation = r / e.DEG_TO_RAD, this.a < 0 && this.d >= 0 && (t.rotation += t.rotation <= 0 ? 180 : -180), t.skewX = t.skewY = 0) : (t.skewX = n / e.DEG_TO_RAD, t.skewY = r / e.DEG_TO_RAD),
- t
- },
- t.reinitialize = function(e, t, n, r, i, s, o, u, a) {
- return this.initialize(e, t, n, r, i, s),
- this.alpha = o == null ? 1 : o,
- this.shadow = u,
- this.compositeOperation = a,
- this
- },
- t.copy = function(e) {
- return this.reinitialize(e.a, e.b, e.c, e.d, e.tx, e.ty, e.alpha, e.shadow, e.compositeOperation)
- },
- t.appendProperties = function(e, t, n) {
- return this.alpha *= e,
- this.shadow = t || this.shadow,
- this.compositeOperation = n || this.compositeOperation,
- this
- },
- t.prependProperties = function(e, t, n) {
- return this.alpha *= e,
- this.shadow = this.shadow || t,
- this.compositeOperation = this.compositeOperation || n,
- this
- },
- t.clone = function() {
- return (new e).copy(this)
- },
- t.toString = function() {
- return "[Matrix2D (a=" + this.a + " b=" + this.b + " c=" + this.c + " d=" + this.d + " tx=" + this.tx + " ty=" + this.ty + ")]"
- },
- e.identity = new e,
- createjs.Matrix2D = e
- } (),
- this.createjs = this.createjs || {},
- function() {
- var e = function(e, t) {
- this.initialize(e, t)
- },
- t = e.prototype;
- t.x = 0,
- t.y = 0,
- t.initialize = function(e, t) {
- return this.x = e == null ? 0 : e,
- this.y = t == null ? 0 : t,
- this
- },
- t.copy = function(e) {
- return this.initialize(e.x, e.y)
- },
- t.clone = function() {
- return new e(this.x, this.y)
- },
- t.toString = function() {
- return "[Point (x=" + this.x + " y=" + this.y + ")]"
- },
- createjs.Point = e
- } (),
- this.createjs = this.createjs || {},
- function() {
- var e = function(e, t, n, r) {
- this.initialize(e, t, n, r)
- },
- t = e.prototype;
- t.x = 0,
- t.y = 0,
- t.width = 0,
- t.height = 0,
- t.initialize = function(e, t, n, r) {
- return this.x = e || 0,
- this.y = t || 0,
- this.width = n || 0,
- this.height = r || 0,
- this
- },
- t.copy = function(e) {
- return this.initialize(e.x, e.y, e.width, e.height)
- },
- t.clone = function() {
- return new e(this.x, this.y, this.width, this.height)
- },
- t.toString = function() {
- return "[Rectangle (x=" + this.x + " y=" + this.y + " width=" + this.width + " height=" + this.height + ")]"
- },
- createjs.Rectangle = e
- } (),
- this.createjs = this.createjs || {},
- function() {
- var e = function(e, t, n, r, i, s, o) {
- this.initialize(e, t, n, r, i, s, o)
- },
- t = e.prototype;
- t.target = null,
- t.overLabel = null,
- t.outLabel = null,
- t.downLabel = null,
- t.play = !1,
- t._isPressed = !1,
- t._isOver = !1,
- t.initialize = function(e, t, n, r, i, s, o) {
- if (!e.addEventListener) return;
- this.target = e,
- e.cursor = "pointer",
- this.overLabel = n == null ? "over": n,
- this.outLabel = t == null ? "out": t,
- this.downLabel = r == null ? "down": r,
- this.play = i,
- this.setEnabled(!0),
- this.handleEvent({}),
- s && (o && (s.actionsEnabled = !1, s.gotoAndStop && s.gotoAndStop(o)), e.hitArea = s)
- },
- t.setEnabled = function(e) {
- var t = this.target;
- e ? (t.addEventListener("rollover", this), t.addEventListener("rollout", this), t.addEventListener("mousedown", this), t.addEventListener("pressup", this)) : (t.removeEventListener("rollover", this), t.removeEventListener("rollout", this), t.removeEventListener("mousedown", this), t.removeEventListener("pressup", this))
- },
- t.toString = function() {
- return "[ButtonHelper]"
- },
- t.handleEvent = function(e) {
- var t, n = this.target,
- r = e.type;
- r == "mousedown" ? (this._isPressed = !0, t = this.downLabel) : r == "pressup" ? (this._isPressed = !1, t = this._isOver ? this.overLabel: this.outLabel) : r == "rollover" ? (this._isOver = !0, t = this._isPressed ? this.downLabel: this.overLabel) : (this._isOver = !1, t = this._isPressed ? this.overLabel: this.outLabel),
- this.play ? n.gotoAndPlay && n.gotoAndPlay(t) : n.gotoAndStop && n.gotoAndStop(t)
- },
- createjs.ButtonHelper = e
- } (),
- this.createjs = this.createjs || {},
- function() {
- var e = function(e, t, n, r) {
- this.initialize(e, t, n, r)
- },
- t = e.prototype;
- e.identity = null,
- t.color = null,
- t.offsetX = 0,
- t.offsetY = 0,
- t.blur = 0,
- t.initialize = function(e, t, n, r) {
- this.color = e,
- this.offsetX = t,
- this.offsetY = n,
- this.blur = r
- },
- t.toString = function() {
- return "[Shadow]"
- },
- t.clone = function() {
- return new e(this.color, this.offsetX, this.offsetY, this.blur)
- },
- e.identity = new e("transparent", 0, 0, 0),
- createjs.Shadow = e
- } (),
- this.createjs = this.createjs || {},
- function() {
- var e = function(e) {
- this.initialize(e)
- },
- t = e.prototype = new createjs.EventDispatcher;
- t.complete = !0,
- t.framerate = 0,
- t._animations = null,
- t._frames = null,
- t._images = null,
- t._data = null,
- t._loadCount = 0,
- t._frameHeight = 0,
- t._frameWidth = 0,
- t._numFrames = 0,
- t._regX = 0,
- t._regY = 0,
- t.initialize = function(e) {
- var t, n, r, i;
- if (e == null) return;
- this.framerate = e.framerate || 0;
- if (e.images && (n = e.images.length) > 0) {
- i = this._images = [];
- for (t = 0; t < n; t++) {
- var s = e.images[t];
- if (typeof s == "string") {
- var o = s;
- s = document.createElement("img"),
- s.src = o
- }
- i.push(s),
- !s.getContext && !s.complete && (this._loadCount++, this.complete = !1,
- function(e) {
- s.onload = function() {
- e._handleImageLoad()
- }
- } (this))
- }
- }
- if (e.frames != null) if (e.frames instanceof Array) {
- this._frames = [],
- i = e.frames;
- for (t = 0, n = i.length; t < n; t++) {
- var u = i[t];
- this._frames.push({
- image: this._images[u[4] ? u[4] : 0],
- rect: new createjs.Rectangle(u[0], u[1], u[2], u[3]),
- regX: u[5] || 0,
- regY: u[6] || 0
- })
- }
- } else r = e.frames,
- this._frameWidth = r.width,
- this._frameHeight = r.height,
- this._regX = r.regX || 0,
- this._regY = r.regY || 0,
- this._numFrames = r.count,
- this._loadCount == 0 && this._calculateFrames();
- this._animations = [];
- if ((r = e.animations) != null) {
- this._data = {};
- var a;
- for (a in r) {
- var f = {
- name: a
- },
- l = r[a];
- if (typeof l == "number") i = f.frames = [l];
- else if (l instanceof Array) if (l.length == 1) f.frames = [l[0]];
- else {
- f.speed = l[3],
- f.next = l[2],
- i = f.frames = [];
- for (t = l[0]; t <= l[1]; t++) i.push(t)
- } else {
- f.speed = l.speed,
- f.next = l.next;
- var c = l.frames;
- i = f.frames = typeof c == "number" ? [c] : c.slice(0)
- }
- if (f.next === !0 || f.next === undefined) f.next = a;
- if (f.next === !1 || i.length < 2 && f.next == a) f.next = null;
- f.speed || (f.speed = 1),
- this._animations.push(a),
- this._data[a] = f
- }
- }
- },
- t.getNumFrames = function(e) {
- if (e == null) return this._frames ? this._frames.length: this._numFrames;
- var t = this._data[e];
- return t == null ? 0 : t.frames.length
- },
- t.getAnimations = function() {
- return this._animations.slice(0)
- },
- t.getAnimation = function(e) {
- return this._data[e]
- },
- t.getFrame = function(e) {
- var t;
- return this._frames && (t = this._frames[e]) ? t: null
- },
- t.getFrameBounds = function(e, t) {
- var n = this.getFrame(e);
- return n ? (t || new createjs.Rectangle).initialize( - n.regX, -n.regY, n.rect.width, n.rect.height) : null
- },
- t.toString = function() {
- return "[SpriteSheet]"
- },
- t.clone = function() {
- var t = new e;
- return t.complete = this.complete,
- t._animations = this._animations,
- t._frames = this._frames,
- t._images = this._images,
- t._data = this._data,
- t._frameHeight = this._frameHeight,
- t._frameWidth = this._frameWidth,
- t._numFrames = this._numFrames,
- t._loadCount = this._loadCount,
- t
- },
- t._handleImageLoad = function() {--this._loadCount == 0 && (this._calculateFrames(), this.complete = !0, this.dispatchEvent("complete"))
- },
- t._calculateFrames = function() {
- if (this._frames || this._frameWidth == 0) return;
- this._frames = [];
- var e = 0,
- t = this._frameWidth,
- n = this._frameHeight;
- for (var r = 0,
- i = this._images; r < i.length; r++) {
- var s = i[r],
- o = s.width / t | 0,
- u = s.height / n | 0,
- a = this._numFrames > 0 ? Math.min(this._numFrames - e, o * u) : o * u;
- for (var f = 0; f < a; f++) this._frames.push({
- image: s,
- rect: new createjs.Rectangle(f % o * t, (f / o | 0) * n, t, n),
- regX: this._regX,
- regY: this._regY
- });
- e += a
- }
- this._numFrames = e
- },
- createjs.SpriteSheet = e
- } (),
- this.createjs = this.createjs || {},
- function() {
- function e(e, t, n) {
- this.f = e,
- this.params = t,
- this.path = n == null ? !0 : n
- }
- e.prototype.exec = function(e) {
- this.f.apply(e, this.params)
- };
- var t = function() {
- this.initialize()
- },
- n = t.prototype;
- t.getRGB = function(e, t, n, r) {
- return e != null && n == null && (r = t, n = e & 255, t = e >> 8 & 255, e = e >> 16 & 255),
- r == null ? "rgb(" + e + "," + t + "," + n + ")": "rgba(" + e + "," + t + "," + n + "," + r + ")"
- },
- t.getHSL = function(e, t, n, r) {
- return r == null ? "hsl(" + e % 360 + "," + t + "%," + n + "%)": "hsla(" + e % 360 + "," + t + "%," + n + "%," + r + ")"
- },
- t.Command = e,
- t.BASE_64 = {
- A: 0,
- B: 1,
- C: 2,
- D: 3,
- E: 4,
- F: 5,
- G: 6,
- H: 7,
- I: 8,
- J: 9,
- K: 10,
- L: 11,
- M: 12,
- N: 13,
- O: 14,
- P: 15,
- Q: 16,
- R: 17,
- S: 18,
- T: 19,
- U: 20,
- V: 21,
- W: 22,
- X: 23,
- Y: 24,
- Z: 25,
- a: 26,
- b: 27,
- c: 28,
- d: 29,
- e: 30,
- f: 31,
- g: 32,
- h: 33,
- i: 34,
- j: 35,
- k: 36,
- l: 37,
- m: 38,
- n: 39,
- o: 40,
- p: 41,
- q: 42,
- r: 43,
- s: 44,
- t: 45,
- u: 46,
- v: 47,
- w: 48,
- x: 49,
- y: 50,
- z: 51,
- 0 : 52,
- 1 : 53,
- 2 : 54,
- 3 : 55,
- 4 : 56,
- 5 : 57,
- 6 : 58,
- 7 : 59,
- 8 : 60,
- 9 : 61,
- "+": 62,
- "/": 63
- },
- t.STROKE_CAPS_MAP = ["butt", "round", "square"],
- t.STROKE_JOINTS_MAP = ["miter", "round", "bevel"];
- var r = createjs.createCanvas ? createjs.createCanvas() : document.createElement("canvas");
- if (r.getContext) {
- var i = t._ctx = r.getContext("2d");
- t.beginCmd = new e(i.beginPath, [], !1),
- t.fillCmd = new e(i.fill, [], !1),
- t.strokeCmd = new e(i.stroke, [], !1),
- r.width = r.height = 1
- }
- n._strokeInstructions = null,
- n._strokeStyleInstructions = null,
- n._strokeIgnoreScale = !1,
- n._fillInstructions = null,
- n._fillMatrix = null,
- n._instructions = null,
- n._oldInstructions = null,
- n._activeInstructions = null,
- n._active = !1,
- n._dirty = !1,
- n.initialize = function() {
- this.clear(),
- this._ctx = t._ctx
- },
- n.isEmpty = function() {
- return ! (this._instructions.length || this._oldInstructions.length || this._activeInstructions.length)
- },
- n.draw = function(e) {
- this._dirty && this._updateInstructions();
- var t = this._instructions;
- for (var n = 0,
- r = t.length; n < r; n++) t[n].exec(e)
- },
- n.drawAsPath = function(e) {
- this._dirty && this._updateInstructions();
- var t, n = this._instructions;
- for (var r = 0,
- i = n.length; r < i; r++)((t = n[r]).path || r == 0) && t.exec(e)
- },
- n.moveTo = function(t, n) {
- return this._activeInstructions.push(new e(this._ctx.moveTo, [t, n])),
- this
- },
- n.lineTo = function(t, n) {
- return this._dirty = this._active = !0,
- this._activeInstructions.push(new e(this._ctx.lineTo, [t, n])),
- this
- },
- n.arcTo = function(t, n, r, i, s) {
- return this._dirty = this._active = !0,
- this._activeInstructions.push(new e(this._ctx.arcTo, [t, n, r, i, s])),
- this
- },
- n.arc = function(t, n, r, i, s, o) {
- return this._dirty = this._active = !0,
- o == null && (o = !1),
- this._activeInstructions.push(new e(this._ctx.arc, [t, n, r, i, s, o])),
- this
- },
- n.quadraticCurveTo = function(t, n, r, i) {
- return this._dirty = this._active = !0,
- this._activeInstructions.push(new e(this._ctx.quadraticCurveTo, [t, n, r, i])),
- this
- },
- n.bezierCurveTo = function(t, n, r, i, s, o) {
- return this._dirty = this._active = !0,
- this._activeInstructions.push(new e(this._ctx.bezierCurveTo, [t, n, r, i, s, o])),
- this
- },
- n.rect = function(t, n, r, i) {
- return this._dirty = this._active = !0,
- this._activeInstructions.push(new e(this._ctx.rect, [t, n, r, i])),
- this
- },
- n.closePath = function() {
- return this._active && (this._dirty = !0, this._activeInstructions.push(new e(this._ctx.closePath, []))),
- this
- },
- n.clear = function() {
- return this._instructions = [],
- this._oldInstructions = [],
- this._activeInstructions = [],
- this._strokeStyleInstructions = this._strokeInstructions = this._fillInstructions = this._fillMatrix = null,
- this._active = this._dirty = this._strokeIgnoreScale = !1,
- this
- },
- n.beginFill = function(t) {
- return this._active && this._newPath(),
- this._fillInstructions = t ? [new e(this._setProp, ["fillStyle", t], !1)] : null,
- this._fillMatrix = null,
- this
- },
- n.beginLinearGradientFill = function(t, n, r, i, s, o) {
- this._active && this._newPath();
- var u = this._ctx.createLinearGradient(r, i, s, o);
- for (var a = 0,
- f = t.length; a < f; a++) u.addColorStop(n[a], t[a]);
- return this._fillInstructions = [new e(this._setProp, ["fillStyle", u], !1)],
- this._fillMatrix = null,
- this
- },
- n.beginRadialGradientFill = function(t, n, r, i, s, o, u, a) {
- this._active && this._newPath();
- var f = this._ctx.createRadialGradient(r, i, s, o, u, a);
- for (var l = 0,
- c = t.length; l < c; l++) f.addColorStop(n[l], t[l]);
- return this._fillInstructions = [new e(this._setProp, ["fillStyle", f], !1)],
- this._fillMatrix = null,
- this
- },
- n.beginBitmapFill = function(t, n, r) {
- this._active && this._newPath(),
- n = n || "";
- var i = this._ctx.createPattern(t, n);
- return this._fillInstructions = [new e(this._setProp, ["fillStyle", i], !1)],
- this._fillMatrix = r ? [r.a, r.b, r.c, r.d, r.tx, r.ty] : null,
- this
- },
- n.endFill = function() {
- return this.beginFill()
- },
- n.setStrokeStyle = function(n, r, i, s, o) {
- return this._active && this._newPath(),
- this._strokeStyleInstructions = [new e(this._setProp, ["lineWidth", n == null ? "1": n], !1), new e(this._setProp, ["lineCap", r == null ? "butt": isNaN(r) ? r: t.STROKE_CAPS_MAP[r]], !1), new e(this._setProp, ["lineJoin", i == null ? "miter": isNaN(i) ? i: t.STROKE_JOINTS_MAP[i]], !1), new e(this._setProp, ["miterLimit", s == null ? "10": s], !1)],
- this._strokeIgnoreScale = o,
- this
- },
- n.beginStroke = function(t) {
- return this._active && this._newPath(),
- this._strokeInstructions = t ? [new e(this._setProp, ["strokeStyle", t], !1)] : null,
- this
- },
- n.beginLinearGradientStroke = function(t, n, r, i, s, o) {
- this._active && this._newPath();
- var u = this._ctx.createLinearGradient(r, i, s, o);
- for (var a = 0,
- f = t.length; a < f; a++) u.addColorStop(n[a], t[a]);
- return this._strokeInstructions = [new e(this._setProp, ["strokeStyle", u], !1)],
- this
- },
- n.beginRadialGradientStroke = function(t, n, r, i, s, o, u, a) {
- this._active && this._newPath();
- var f = this._ctx.createRadialGradient(r, i, s, o, u, a);
- for (var l = 0,
- c = t.length; l < c; l++) f.addColorStop(n[l], t[l]);
- return this._strokeInstructions = [new e(this._setProp, ["strokeStyle", f], !1)],
- this
- },
- n.beginBitmapStroke = function(t, n) {
- this._active && this._newPath(),
- n = n || "";
- var r = this._ctx.createPattern(t, n);
- return this._strokeInstructions = [new e(this._setProp, ["strokeStyle", r], !1)],
- this
- },
- n.endStroke = function() {
- return this.beginStroke(),
- this
- },
- n.curveTo = n.quadraticCurveTo,
- n.drawRect = n.rect,
- n.drawRoundRect = function(e, t, n, r, i) {
- return this.drawRoundRectComplex(e, t, n, r, i, i, i, i),
- this
- },
- n.drawRoundRectComplex = function(t, n, r, i, s, o, u, a) {
- var f = (r < i ? r: i) / 2,
- l = 0,
- c = 0,
- h = 0,
- p = 0;
- s < 0 && (s *= l = -1),
- s > f && (s = f),
- o < 0 && (o *= c = -1),
- o > f && (o = f),
- u < 0 && (u *= h = -1),
- u > f && (u = f),
- a < 0 && (a *= p = -1),
- a > f && (a = f),
- this._dirty = this._active = !0;
- var d = this._ctx.arcTo,
- v = this._ctx.lineTo;
- return this._activeInstructions.push(new e(this._ctx.moveTo, [t + r - o, n]), new e(d, [t + r + o * c, n - o * c, t + r, n + o, o]), new e(v, [t + r, n + i - u]), new e(d, [t + r + u * h, n + i + u * h, t + r - u, n + i, u]), new e(v, [t + a, n + i]), new e(d, [t - a * p, n + i + a * p, t, n + i - a, a]), new e(v, [t, n + s]), new e(d, [t - s * l, n - s * l, t + s, n, s]), new e(this._ctx.closePath)),
- this
- },
- n.drawCircle = function(e, t, n) {
- return this.arc(e, t, n, 0, Math.PI * 2),
- this
- },
- n.drawEllipse = function(t, n, r, i) {
- this._dirty = this._active = !0;
- var s = .5522848,
- o = r / 2 * s,
- u = i / 2 * s,
- a = t + r,
- f = n + i,
- l = t + r / 2,
- c = n + i / 2;
- return this._activeInstructions.push(new e(this._ctx.moveTo, [t, c]), new e(this._ctx.bezierCurveTo, [t, c - u, l - o, n, l, n]), new e(this._ctx.bezierCurveTo, [l + o, n, a, c - u, a, c]), new e(this._ctx.bezierCurveTo, [a, c + u, l + o, f, l, f]), new e(this._ctx.bezierCurveTo, [l - o, f, t, c + u, t, c])),
- this
- },
- n.inject = function(t, n) {
- return this._dirty = this._active = !0,
- this._activeInstructions.push(new e(t, [n])),
- this
- },
- n.drawPolyStar = function(t, n, r, i, s, o) {
- this._dirty = this._active = !0,
- s == null && (s = 0),
- s = 1 - s,
- o == null ? o = 0 : o /= 180 / Math.PI;
- var u = Math.PI / i;
- this._activeInstructions.push(new e(this._ctx.moveTo, [t + Math.cos(o) * r, n + Math.sin(o) * r]));
- for (var a = 0; a < i; a++) o += u,
- s != 1 && this._activeInstructions.push(new e(this._ctx.lineTo, [t + Math.cos(o) * r * s, n + Math.sin(o) * r * s])),
- o += u,
- this._activeInstructions.push(new e(this._ctx.lineTo, [t + Math.cos(o) * r, n + Math.sin(o) * r]));
- return this
- },
- n.decodePath = function(e) {
- var n = [this.moveTo, this.lineTo, this.quadraticCurveTo, this.bezierCurveTo, this.closePath],
- r = [2, 2, 4, 6, 0],
- i = 0,
- s = e.length,
- o = [],
- u = 0,
- a = 0,
- f = t.BASE_64;
- while (i < s) {
- var l = e.charAt(i),
- c = f[l],
- h = c >> 3,
- p = n[h];
- if (!p || c & 3) throw "bad path data (@" + i + "): " + l;
- var d = r[h];
- h || (u = a = 0),
- o.length = 0,
- i++;
- var v = (c >> 2 & 1) + 2;
- for (var m = 0; m < d; m++) {
- var g = f[e.charAt(i)],
- y = g >> 5 ? -1 : 1;
- g = (g & 31) << 6 | f[e.charAt(i + 1)],
- v == 3 && (g = g << 6 | f[e.charAt(i + 2)]),
- g = y * g / 10,
- m % 2 ? u = g += u: a = g += a,
- o[m] = g,
- i += v
- }
- p.apply(this, o)
- }
- return this
- },
- n.clone = function() {
- var e = new t;
- return e._instructions = this._instructions.slice(),
- e._activeInstructions = this._activeInstructions.slice(),
- e._oldInstructions = this._oldInstructions.slice(),
- this._fillInstructions && (e._fillInstructions = this._fillInstructions.slice()),
- this._strokeInstructions && (e._strokeInstructions = this._strokeInstructions.slice()),
- this._strokeStyleInstructions && (e._strokeStyleInstructions = this._strokeStyleInstructions.slice()),
- e._active = this._active,
- e._dirty = this._dirty,
- e._fillMatrix = this._fillMatrix,
- e._strokeIgnoreScale = this._strokeIgnoreScale,
- e
- },
- n.toString = function() {
- return "[Graphics]"
- },
- n.mt = n.moveTo,
- n.lt = n.lineTo,
- n.at = n.arcTo,
- n.bt = n.bezierCurveTo,
- n.qt = n.quadraticCurveTo,
- n.a = n.arc,
- n.r = n.rect,
- n.cp = n.closePath,
- n.c = n.clear,
- n.f = n.beginFill,
- n.lf = n.beginLinearGradientFill,
- n.rf = n.beginRadialGradientFill,
- n.bf = n.beginBitmapFill,
- n.ef = n.endFill,
- n.ss = n.setStrokeStyle,
- n.s = n.beginStroke,
- n.ls = n.beginLinearGradientStroke,
- n.rs = n.beginRadialGradientStroke,
- n.bs = n.beginBitmapStroke,
- n.es = n.endStroke,
- n.dr = n.drawRect,
- n.rr = n.drawRoundRect,
- n.rc = n.drawRoundRectComplex,
- n.dc = n.drawCircle,
- n.de = n.drawEllipse,
- n.dp = n.drawPolyStar,
- n.p = n.decodePath,
- n._updateInstructions = function() {
- this._instructions = this._oldInstructions.slice(),
- this._instructions.push(t.beginCmd),
- this._appendInstructions(this._fillInstructions),
- this._appendInstructions(this._strokeInstructions),
- this._appendInstructions(this._strokeInstructions && this._strokeStyleInstructions),
- this._appendInstructions(this._activeInstructions),
- this._fillInstructions && this._appendDraw(t.fillCmd, this._fillMatrix),
- this._strokeInstructions && this._appendDraw(t.strokeCmd, this._strokeIgnoreScale && [1, 0, 0, 1, 0, 0])
- },
- n._appendInstructions = function(e) {
- e && this._instructions.push.apply(this._instructions, e)
- },
- n._appendDraw = function(t, n) {
- n ? this._instructions.push(new e(this._ctx.save, [], !1), new e(this._ctx.transform, n, !1), t, new e(this._ctx.restore, [], !1)) : this._instructions.push(t)
- },
- n._newPath = function() {
- this._dirty && this._updateInstructions(),
- this._oldInstructions = this._instructions,
- this._activeInstructions = [],
- this._active = this._dirty = !1
- },
- n._setProp = function(e, t) {
- this[e] = t
- },
- createjs.Graphics = t
- } (),
- this.createjs = this.createjs || {},
- function() {
- var e = function() {
- this.initialize()
- },
- t = e.prototype = new createjs.EventDispatcher;
- e._MOUSE_EVENTS = ["click", "dblclick", "mousedown", "mouseout", "mouseover", "pressmove", "pressup", "rollout", "rollover"],
- e.suppressCrossDomainErrors = !1;
- var n = createjs.createCanvas ? createjs.createCanvas() : document.createElement("canvas");
- n.getContext && (e._hitTestCanvas = n, e._hitTestContext = n.getContext("2d"), n.width = n.height = 1),
- e._nextCacheID = 1,
- t.alpha = 1,
- t.cacheCanvas = null,
- t.id = -1,
- t.mouseEnabled = !0,
- t.tickEnabled = !0,
- t.name = null,
- t.parent = null,
- t.regX = 0,
- t.regY = 0,
- t.rotation = 0,
- t.scaleX = 1,
- t.scaleY = 1,
- t.skewX = 0,
- t.skewY = 0,
- t.shadow = null,
- t.visible = !0,
- t.x = 0,
- t.y = 0,
- t.compositeOperation = null,
- t.snapToPixel = !1,
- t.filters = null,
- t.cacheID = 0,
- t.mask = null,
- t.hitArea = null,
- t.cursor = null,
- t._cacheOffsetX = 0,
- t._cacheOffsetY = 0,
- t._cacheScale = 1,
- t._cacheDataURLID = 0,
- t._cacheDataURL = null,
- t._matrix = null,
- t._rectangle = null,
- t._bounds = null,
- t.initialize = function() {
- this.id = createjs.UID.get(),
- this._matrix = new createjs.Matrix2D,
- this._rectangle = new createjs.Rectangle
- },
- t.isVisible = function() {
- return !! (this.visible && this.alpha > 0 && this.scaleX != 0 && this.scaleY != 0)
- },
- t.draw = function(e, t) {
- var n = this.cacheCanvas;
- if (t || !n) return ! 1;
- var r = this._cacheScale,
- i = this._cacheOffsetX,
- s = this._cacheOffsetY,
- o;
- if (o = this._applyFilterBounds(i, s, 0, 0)) i = o.x,
- s = o.y;
- return e.drawImage(n, i, s, n.width / r, n.height / r),
- !0
- },
- t.updateContext = function(e) {
- var t, n = this.mask,
- r = this;
- n && n.graphics && !n.graphics.isEmpty() && (t = n.getMatrix(n._matrix), e.transform(t.a, t.b, t.c, t.d, t.tx, t.ty), n.graphics.drawAsPath(e), e.clip(), t.invert(), e.transform(t.a, t.b, t.c, t.d, t.tx, t.ty)),
- t = r._matrix.identity().appendTransform(r.x, r.y, r.scaleX, r.scaleY, r.rotation, r.skewX, r.skewY, r.regX, r.regY),
- createjs.Stage._snapToPixelEnabled && r.snapToPixel ? e.transform(t.a, t.b, t.c, t.d, t.tx + .5 | 0, t.ty + .5 | 0) : e.transform(t.a, t.b, t.c, t.d, t.tx, t.ty),
- e.globalAlpha *= r.alpha,
- r.compositeOperation && (e.globalCompositeOperation = r.compositeOperation),
- r.shadow && this._applyShadow(e, r.shadow)
- },
- t.cache = function(e, t, n, r, i) {
- i = i || 1,
- this.cacheCanvas || (this.cacheCanvas = createjs.createCanvas ? createjs.createCanvas() : document.createElement("canvas")),
- this._cacheWidth = n,
- this._cacheHeight = r,
- this._cacheOffsetX = e,
- this._cacheOffsetY = t,
- this._cacheScale = i,
- this.updateCache()
- },
- t.updateCache = function(t) {
- var n = this.cacheCanvas,
- r = this._cacheScale,
- i = this._cacheOffsetX * r,
- s = this._cacheOffsetY * r,
- o = this._cacheWidth,
- u = this._cacheHeight,
- a;
- if (!n) throw "cache() must be called before updateCache()";
- var f = n.getContext("2d");
- if (a = this._applyFilterBounds(i, s, o, u)) i = a.x,
- s = a.y,
- o = a.width,
- u = a.height;
- o = Math.ceil(o * r),
- u = Math.ceil(u * r),
- o != n.width || u != n.height ? (n.width = o, n.height = u) : t || f.clearRect(0, 0, o + 1, u + 1),
- f.save(),
- f.globalCompositeOperation = t,
- f.setTransform(r, 0, 0, r, -i, -s),
- this.draw(f, !0),
- this._applyFilters(),
- f.restore(),
- this.cacheID = e._nextCacheID++
- },
- t.uncache = function() {
- this._cacheDataURL = this.cacheCanvas = null,
- this.cacheID = this._cacheOffsetX = this._cacheOffsetY = 0,
- this._cacheScale = 1
- },
- t.getCacheDataURL = function() {
- return this.cacheCanvas ? (this.cacheID != this._cacheDataURLID && (this._cacheDataURL = this.cacheCanvas.toDataURL()), this._cacheDataURL) : null
- },
- t.getStage = function() {
- var e = this;
- while (e.parent) e = e.parent;
- return e instanceof createjs.Stage ? e: null
- },
- t.localToGlobal = function(e, t) {
- var n = this.getConcatenatedMatrix(this._matrix);
- return n == null ? null: (n.append(1, 0, 0, 1, e, t), new createjs.Point(n.tx, n.ty))
- },
- t.globalToLocal = function(e, t) {
- var n = this.getConcatenatedMatrix(this._matrix);
- return n == null ? null: (n.invert(), n.append(1, 0, 0, 1, e, t), new createjs.Point(n.tx, n.ty))
- },
- t.localToLocal = function(e, t, n) {
- var r = this.localToGlobal(e, t);
- return n.globalToLocal(r.x, r.y)
- },
- t.setTransform = function(e, t, n, r, i, s, o, u, a) {
- return this.x = e || 0,
- this.y = t || 0,
- this.scaleX = n == null ? 1 : n,
- this.scaleY = r == null ? 1 : r,
- this.rotation = i || 0,
- this.skewX = s || 0,
- this.skewY = o || 0,
- this.regX = u || 0,
- this.regY = a || 0,
- this
- },
- t.getMatrix = function(e) {
- var t = this;
- return (e ? e.identity() : new createjs.Matrix2D).appendTransform(t.x, t.y, t.scaleX, t.scaleY, t.rotation, t.skewX, t.skewY, t.regX, t.regY).appendProperties(t.alpha, t.shadow, t.compositeOperation)
- },
- t.getConcatenatedMatrix = function(e) {
- e ? e.identity() : e = new createjs.Matrix2D;
- var t = this;
- while (t != null) e.prependTransform(t.x, t.y, t.scaleX, t.scaleY, t.rotation, t.skewX, t.skewY, t.regX, t.regY).prependProperties(t.alpha, t.shadow, t.compositeOperation),
- t = t.parent;
- return e
- },
- t.hitTest = function(t, n) {
- var r = e._hitTestContext;
- r.setTransform(1, 0, 0, 1, -t, -n),
- this.draw(r);
- var i = this._testHit(r);
- return r.setTransform(1, 0, 0, 1, 0, 0),
- r.clearRect(0, 0, 2, 2),
- i
- },
- t.set = function(e) {
- for (var t in e) this[t] = e[t];
- return this
- },
- t.getBounds = function() {
- if (this._bounds) return this._rectangle.copy(this._bounds);
- var e = this.cacheCanvas;
- if (e) {
- var t = this._cacheScale;
- return this._rectangle.initialize(this._cacheOffsetX, this._cacheOffsetY, e.width / t, e.height / t)
- }
- return null
- },
- t.getTransformedBounds = function() {
- return this._getBounds()
- },
- t.setBounds = function(e, t, n, r) {
- e == null && (this._bounds = e),
- this._bounds = (this._bounds || new createjs.Rectangle).initialize(e, t, n, r)
- },
- t.clone = function() {
- var t = new e;
- return this.cloneProps(t),
- t
- },
- t.toString = function() {
- return "[DisplayObject (name=" + this.name + ")]"
- },
- t.cloneProps = function(e) {
- e.alpha = this.alpha,
- e.name = this.name,
- e.regX = this.regX,
- e.regY = this.regY,
- e.rotation = this.rotation,
- e.scaleX = this.scaleX,
- e.scaleY = this.scaleY,
- e.shadow = this.shadow,
- e.skewX = this.skewX,
- e.skewY = this.skewY,
- e.visible = this.visible,
- e.x = this.x,
- e.y = this.y,
- e._bounds = this._bounds,
- e.mouseEnabled = this.mouseEnabled,
- e.compositeOperation = this.compositeOperation
- },
- t._applyShadow = function(e, t) {
- t = t || Shadow.identity,
- e.shadowColor = t.color,
- e.shadowOffsetX = t.offsetX,
- e.shadowOffsetY = t.offsetY,
- e.shadowBlur = t.blur
- },
- t._tick = function(e) {
- var t = this._listeners;
- if (t && t.tick) {
- var n = new createjs.Event("tick");
- n.params = e,
- this._dispatchEvent(n, this, 2)
- }
- },
- t._testHit = function(t) {
- try {
- var n = t.getImageData(0, 0, 1, 1).data[3] > 1
- } catch(r) {
- if (!e.suppressCrossDomainErrors) throw "An error has occurred. This is most likely due to security restrictions on reading canvas pixel data with local or cross-domain images."
- }
- return n
- },
- t._applyFilters = function() {
- if (!this.filters || this.filters.length == 0 || !this.cacheCanvas) return;
- var e = this.filters.length,
- t = this.cacheCanvas.getContext("2d"),
- n = this.cacheCanvas.width,
- r = this.cacheCanvas.height;
- for (var i = 0; i < e; i++) this.filters[i].applyFilter(t, 0, 0, n, r)
- },
- t._applyFilterBounds = function(e, t, n, r) {
- var i, s, o = this.filters;
- if (!o || !(s = o.length)) return null;
- for (var u = 0; u < s; u++) {
- var a = this.filters[u],
- f = a.getBounds && a.getBounds();
- if (!f) continue;
- i || (i = this._rectangle.initialize(e, t, n, r)),
- i.x += f.x,
- i.y += f.y,
- i.width += f.width,
- i.height += f.height
- }
- return i
- },
- t._getBounds = function(e, t) {
- return this._transformBounds(this.getBounds(), e, t)
- },
- t._transformBounds = function(e, t, n) {
- if (!e) return e;
- var r = e.x,
- i = e.y,
- s = e.width,
- o = e.height,
- u = n ? this._matrix.identity() : this.getMatrix(this._matrix); (r || i) && u.appendTransform(0, 0, 1, 1, 0, 0, 0, -r, -i),
- t && u.prependMatrix(t);
- var a = s * u.a,
- f = s * u.b,
- l = o * u.c,
- c = o * u.d,
- h = u.tx,
- p = u.ty,
- d = h,
- v = h,
- m = p,
- g = p;
- return (r = a + h) < d ? d = r: r > v && (v = r),
- (r = a + l + h) < d ? d = r: r > v && (v = r),
- (r = l + h) < d ? d = r: r > v && (v = r),
- (i = f + p) < m ? m = i: i > g && (g = i),
- (i = f + c + p) < m ? m = i: i > g && (g = i),
- (i = c + p) < m ? m = i: i > g && (g = i),
- e.initialize(d, m, v - d, g - m)
- },
- t._hasMouseEventListener = function() {
- var t = e._MOUSE_EVENTS;
- for (var n = 0,
- r = t.length; n < r; n++) if (this.hasEventListener(t[n])) return ! 0;
- return !! this.cursor
- },
- createjs.DisplayObject = e
- } (),
- this.createjs = this.createjs || {},
- function() {
- var e = function() {
- this.initialize()
- },
- t = e.prototype = new createjs.DisplayObject;
- t.children = null,
- t.mouseChildren = !0,
- t.tickChildren = !0,
- t.DisplayObject_initialize = t.initialize,
- t.initialize = function() {
- this.DisplayObject_initialize(),
- this.children = []
- },
- t.isVisible = function() {
- var e = this.cacheCanvas || this.children.length;
- return !! (this.visible && this.alpha > 0 && this.scaleX != 0 && this.scaleY != 0 && e)
- },
- t.DisplayObject_draw = t.draw,
- t.draw = function(e, t) {
- if (this.DisplayObject_draw(e, t)) return ! 0;
- var n = this.children.slice(0);
- for (var r = 0,
- i = n.length; r < i; r++) {
- var s = n[r];
- if (!s.isVisible()) continue;
- e.save(),
- s.updateContext(e),
- s.draw(e),
- e.restore()
- }
- return ! 0
- },
- t.addChild = function(e) {
- if (e == null) return e;
- var t = arguments.length;
- if (t > 1) {
- for (var n = 0; n < t; n++) this.addChild(arguments[n]);
- return arguments[t - 1]
- }
- return e.parent && e.parent.removeChild(e),
- e.parent = this,
- this.children.push(e),
- e
- },
- t.addChildAt = function(e, t) {
- var n = arguments.length,
- r = arguments[n - 1];
- if (r < 0 || r > this.children.length) return arguments[n - 2];
- if (n > 2) {
- for (var i = 0; i < n - 1; i++) this.addChildAt(arguments[i], r + i);
- return arguments[n - 2]
- }
- return e.parent && e.parent.removeChild(e),
- e.parent = this,
- this.children.splice(t, 0, e),
- e
- },
- t.removeChild = function(e) {
- var t = arguments.length;
- if (t > 1) {
- var n = !0;
- for (var r = 0; r < t; r++) n = n && this.removeChild(arguments[r]);
- return n
- }
- return this.removeChildAt(createjs.indexOf(this.children, e))
- },
- t.removeChildAt = function(e) {
- var t = arguments.length;
- if (t > 1) {
- var n = [];
- for (var r = 0; r < t; r++) n[r] = arguments[r];
- n.sort(function(e, t) {
- return t - e
- });
- var i = !0;
- for (var r = 0; r < t; r++) i = i && this.removeChildAt(n[r]);
- return i
- }
- if (e < 0 || e > this.children.length - 1) return ! 1;
- var s = this.children[e];
- return s && (s.parent = null),
- this.children.splice(e, 1),
- !0
- },
- t.removeAllChildren = function() {
- var e = this.children;
- while (e.length) e.pop().parent = null
- },
- t.getChildAt = function(e) {
- return this.children[e]
- },
- t.getChildByName = function(e) {
- var t = this.children;
- for (var n = 0,
- r = t.length; n < r; n++) if (t[n].name == e) return t[n];
- return null
- },
- t.sortChildren = function(e) {
- this.children.sort(e)
- },
- t.getChildIndex = function(e) {
- return createjs.indexOf(this.children, e)
- },
- t.getNumChildren = function() {
- return this.children.length
- },
- t.swapChildrenAt = function(e, t) {
- var n = this.children,
- r = n[e],
- i = n[t];
- if (!r || !i) return;
- n[e] = i,
- n[t] = r
- },
- t.swapChildren = function(e, t) {
- var n = this.children,
- r, i;
- for (var s = 0,
- o = n.length; s < o; s++) {
- n[s] == e && (r = s),
- n[s] == t && (i = s);
- if (r != null && i != null) break
- }
- if (s == o) return;
- n[r] = t,
- n[i] = e
- },
- t.setChildIndex = function(e, t) {
- var n = this.children,
- r = n.length;
- if (e.parent != this || t < 0 || t >= r) return;
- for (var i = 0; i < r; i++) if (n[i] == e) break;
- if (i == r || i == t) return;
- n.splice(i, 1),
- n.splice(t, 0, e)
- },
- t.contains = function(e) {
- while (e) {
- if (e == this) return ! 0;
- e = e.parent
- }
- return ! 1
- },
- t.hitTest = function(e, t) {
- return this.getObjectUnderPoint(e, t) != null
- },
- t.getObjectsUnderPoint = function(e, t) {
- var n = [],
- r = this.localToGlobal(e, t);
- return this._getObjectsUnderPoint(r.x, r.y, n),
- n
- },
- t.getObjectUnderPoint = function(e, t) {
- var n = this.localToGlobal(e, t);
- return this._getObjectsUnderPoint(n.x, n.y)
- },
- t.DisplayObject_getBounds = t.getBounds,
- t.getBounds = function() {
- return this._getBounds(null, !0)
- },
- t.getTransformedBounds = function() {
- return this._getBounds()
- },
- t.clone = function(t) {
- var n = new e;
- this.cloneProps(n);
- if (t) {
- var r = n.children = [];
- for (var i = 0,
- s = this.children.length; i < s; i++) {
- var o = this.children[i].clone(t);
- o.parent = n,
- r.push(o)
- }
- }
- return n
- },
- t.toString = function() {
- return "[Container (name=" + this.name + ")]"
- },
- t.DisplayObject__tick = t._tick,
- t._tick = function(e) {
- if (this.tickChildren) for (var t = this.children.length - 1; t >= 0; t--) {
- var n = this.children[t];
- n.tickEnabled && n._tick && n._tick(e)
- }
- this.DisplayObject__tick(e)
- },
- t._getObjectsUnderPoint = function(t, n, r, i, s) {
- var o = createjs.DisplayObject._hitTestContext,
- u = this._matrix;
- s = s || i && this._hasMouseEventListener();
- var a = this.children,
- f = a.length;
- for (var l = f - 1; l >= 0; l--) {
- var c = a[l],
- h = c.hitArea,
- p = c.mask;
- if (!c.visible || !h && !c.isVisible() || i && !c.mouseEnabled) continue;
- if (!h && p && p.graphics && !p.graphics.isEmpty()) {
- var d = p.getMatrix(p._matrix).prependMatrix(this.getConcatenatedMatrix(u));
- o.setTransform(d.a, d.b, d.c, d.d, d.tx - t, d.ty - n),
- p.graphics.drawAsPath(o),
- o.fillStyle = "#000",
- o.fill();
- if (!this._testHit(o)) continue;
- o.setTransform(1, 0, 0, 1, 0, 0),
- o.clearRect(0, 0, 2, 2)
- }
- if (!h && c instanceof e) {
- var v = c._getObjectsUnderPoint(t, n, r, i, s);
- if (!r && v) return i && !this.mouseChildren ? this: v
- } else {
- if (i && !s && !c._hasMouseEventListener()) continue;
- c.getConcatenatedMatrix(u);
- var m = (h || c).getBounds();
- if (m) {
- u.invert();
- var g = u.transformPoint(t, n);
- if (! (g.x >= m.x && g.x <= m.x + m.width && g.y >= m.y && g.y <= m.y + m.height)) continue
- } else {
- h && (u.appendTransform(h.x, h.y, h.scaleX, h.scaleY, h.rotation, h.skewX, h.skewY, h.regX, h.regY), u.alpha = h.alpha),
- o.globalAlpha = u.alpha,
- o.setTransform(u.a, u.b, u.c, u.d, u.tx - t, u.ty - n),
- (h || c).draw(o);
- if (!this._testHit(o)) continue;
- o.setTransform(1, 0, 0, 1, 0, 0),
- o.clearRect(0, 0, 2, 2)
- }
- if (!r) return i && !this.mouseChildren ? this: c;
- r.push(c)
- }
- }
- return null
- },
- t._getBounds = function(e, t) {
- var n = this.DisplayObject_getBounds();
- if (n) return this._transformBounds(n, e, t);
- var r, i, s, o, u = t ? this._matrix.identity() : this.getMatrix(this._matrix);
- e && u.prependMatrix(e);
- var a = this.children.length;
- for (var f = 0; f < a; f++) {
- var l = this.children[f];
- if (!l.visible || !(n = l._getBounds(u))) continue;
- var c = n.x,
- h = n.y,
- p = c + n.width,
- d = h + n.height;
- if (c < r || r == null) r = c;
- if (p > i || i == null) i = p;
- if (h < s || s == null) s = h;
- if (d > o || o == null) o = d
- }
- return i == null ? null: this._rectangle.initialize(r, s, i - r, o - s)
- },
- createjs.Container = e
- } (),
- this.createjs = this.createjs || {},
- function() {
- var e = function(e) {
- this.initialize(e)
- },
- t = e.prototype = new createjs.Container;
- e._snapToPixelEnabled = !1,
- t.autoClear = !0,
- t.canvas = null,
- t.mouseX = 0,
- t.mouseY = 0,
- t.snapToPixelEnabled = !1,
- t.mouseInBounds = !1,
- t.tickOnUpdate = !0,
- t.mouseMoveOutside = !1,
- t.nextStage = null,
- t._pointerData = null,
- t._pointerCount = 0,
- t._primaryPointerID = null,
- t._mouseOverIntervalID = null,
- t.Container_initialize = t.initialize,
- t.initialize = function(e) {
- this.Container_initialize(),
- this.canvas = typeof e == "string" ? document.getElementById(e) : e,
- this._pointerData = {},
- this.enableDOMEvents(!0)
- },
- t.update = function(t) {
- if (!this.canvas) return;
- this.tickOnUpdate && (this.dispatchEvent("tickstart"), this.tickEnabled && this._tick(arguments.length ? arguments: null), this.dispatchEvent("tickend")),
- this.dispatchEvent("drawstart"),
- e._snapToPixelEnabled = this.snapToPixelEnabled,
- this.autoClear && this.clear();
- var n = this.canvas.getContext("2d");
- n.save(),
- this.updateContext(n),
- this.draw(n, !1),
- n.restore(),
- this.dispatchEvent("drawend")
- },
- t.handleEvent = function(e) {
- e.type == "tick" && this.update(e)
- },
- t.clear = function() {
- if (!this.canvas) return;
- var e = this.canvas.getContext("2d");
- e.setTransform(1, 0, 0, 1, 0, 0),
- e.clearRect(0, 0, this.canvas.width + 1, this.canvas.height + 1)
- function isHUAWEI (){
- if( /huawei/i.test(navigator.userAgent.toLowerCase()) ){
- return true;
- }
- else{
- return false;
- }
- }
- if (isHUAWEI()) {
- this.canvas.style.visibility = 'hidden'; // Force a change in DOM
- this.canvas.offsetHeight; // Cause a repaint to take play
- this.canvas.style.visibility = 'inherit'; // Make visible again
- }
- else{
- this.canvas.width = this.canvas.width;
- }
- },
- t.toDataURL = function(e, t) {
- t || (t = "image/png");
- var n = this.canvas.getContext("2d"),
- r = this.canvas.width,
- i = this.canvas.height,
- s;
- if (e) {
- s = n.getImageData(0, 0, r, i);
- var o = n.globalCompositeOperation;
- n.globalCompositeOperation = "destination-over",
- n.fillStyle = e,
- n.fillRect(0, 0, r, i)
- }
- var u = this.canvas.toDataURL(t);
- return e && (n.clearRect(0, 0, r + 1, i + 1), n.putImageData(s, 0, 0), n.globalCompositeOperation = o),
- u
- },
- t.enableMouseOver = function(e) {
- this._mouseOverIntervalID && (clearInterval(this._mouseOverIntervalID), this._mouseOverIntervalID = null, e == 0 && this._testMouseOver(!0));
- if (e == null) e = 20;
- else if (e <= 0) return;
- var t = this;
- this._mouseOverIntervalID = setInterval(function() {
- t._testMouseOver()
- },
- 1e3 / Math.min(50, e))
- },
- t.enableDOMEvents = function(e) {
- e == null && (e = !0);
- var t, n, r = this._eventListeners;
- if (!e && r) {
- for (t in r) n = r[t],
- n.t.removeEventListener(t, n.f, !1);
- this._eventListeners = null
- } else if (e && !r && this.canvas) {
- var i = window.addEventListener ? window: document,
- s = this;
- r = this._eventListeners = {},
- r.mouseup = {
- t: i,
- f: function(e) {
- s._handleMouseUp(e)
- }
- },
- r.mousemove = {
- t: i,
- f: function(e) {
- s._handleMouseMove(e)
- }
- },
- r.dblclick = {
- t: this.canvas,
- f: function(e) {
- s._handleDoubleClick(e)
- }
- },
- r.mousedown = {
- t: this.canvas,
- f: function(e) {
- s._handleMouseDown(e)
- }
- };
- for (t in r) n = r[t],
- n.t.addEventListener(t, n.f, !1)
- }
- },
- t.clone = function() {
- var t = new e(null);
- return this.cloneProps(t),
- t
- },
- t.toString = function() {
- return "[Stage (name=" + this.name + ")]"
- },
- t._getElementRect = function(e) {
- var t;
- try {
- t = e.getBoundingClientRect()
- } catch(n) {
- t = {
- top: e.offsetTop,
- left: e.offsetLeft,
- width: e.offsetWidth,
- height: e.offsetHeight
- }
- }
- var r = (window.pageXOffset || document.scrollLeft || 0) - (document.clientLeft || document.body.clientLeft || 0),
- i = (window.pageYOffset || document.scrollTop || 0) - (document.clientTop || document.body.clientTop || 0),
- s = window.getComputedStyle ? getComputedStyle(e) : e.currentStyle,
- o = parseInt(s.paddingLeft) + parseInt(s.borderLeftWidth),
- u = parseInt(s.paddingTop) + parseInt(s.borderTopWidth),
- a = parseInt(s.paddingRight) + parseInt(s.borderRightWidth),
- f = parseInt(s.paddingBottom) + parseInt(s.borderBottomWidth);
- return {
- left: t.left + r + o,
- right: t.right + r - a,
- top: t.top + i + u,
- bottom: t.bottom + i - f
- }
- },
- t._getPointerData = function(e) {
- var t = this._pointerData[e];
- if (!t) {
- t = this._pointerData[e] = {
- x: 0,
- y: 0
- },
- this._primaryPointerID == null && (this._primaryPointerID = e);
- if (this._primaryPointerID == null || this._primaryPointerID == -1) this._primaryPointerID = e
- }
- return t
- },
- t._handleMouseMove = function(e) {
- e || (e = window.event),
- this._handlePointerMove( - 1, e, e.pageX, e.pageY)
- },
- t._handlePointerMove = function(e, t, n, r) {
- if (!this.canvas) return;
- var i = this._getPointerData(e),
- s = i.inBounds;
- this._updatePointerPosition(e, t, n, r);
- if (!s && !i.inBounds && !this.mouseMoveOutside) return;
- e == -1 && i.inBounds == !s && this._dispatchMouseEvent(this, s ? "mouseleave": "mouseenter", !1, e, i, t),
- this._dispatchMouseEvent(this, "stagemousemove", !1, e, i, t),
- this._dispatchMouseEvent(i.target, "pressmove", !0, e, i, t);
- var o = i.event;
- o && o.hasEventListener("mousemove") && o.dispatchEvent(new createjs.MouseEvent("mousemove", !1, !1, i.x, i.y, t, e, e == this._primaryPointerID, i.rawX, i.rawY), i.target),
- this.nextStage && this.nextStage._handlePointerMove(e, t, n, r)
- },
- t._updatePointerPosition = function(e, t, n, r) {
- var i = this._getElementRect(this.canvas);
- n -= i.left,
- r -= i.top;
- var s = this.canvas.width,
- o = this.canvas.height;
- n /= (i.right - i.left) / s,
- r /= (i.bottom - i.top) / o;
- var u = this._getPointerData(e); (u.inBounds = n >= 0 && r >= 0 && n <= s - 1 && r <= o - 1) ? (u.x = n, u.y = r) : this.mouseMoveOutside && (u.x = n < 0 ? 0 : n > s - 1 ? s - 1 : n, u.y = r < 0 ? 0 : r > o - 1 ? o - 1 : r),
- u.posEvtObj = t,
- u.rawX = n,
- u.rawY = r,
- e == this._primaryPointerID && (this.mouseX = u.x, this.mouseY = u.y, this.mouseInBounds = u.inBounds)
- },
- t._handleMouseUp = function(e) {
- this._handlePointerUp( - 1, e, !1)
- },
- t._handlePointerUp = function(e, t, n) {
- var r = this._getPointerData(e);
- this._dispatchMouseEvent(this, "stagemouseup", !1, e, r, t);
- var i = r.target;
- i && (this._getObjectsUnderPoint(r.x, r.y, null, true) == i && this._dispatchMouseEvent(i, "click", !0, e, r, t), this._dispatchMouseEvent(i, "pressup", !0, e, r, t));
- var s = r.event;
- s && s.hasEventListener("mouseup") && s.dispatchEvent(new createjs.MouseEvent("mouseup", !1, !1, r.x, r.y, t, e, e == this._primaryPointerID, r.rawX, r.rawY), i),
- n ? (e == this._primaryPointerID && (this._primaryPointerID = null), delete this._pointerData[e]) : r.event = r.target = null,
- this.nextStage && this.nextStage._handlePointerUp(e, t, n)
- },
- t._handleMouseDown = function(e) {
- this._handlePointerDown( - 1, e, e.pageX, e.pageY)
- },
- t._handlePointerDown = function(e, t, n, r) {
- r != null && this._updatePointerPosition(e, t, n, r);
- var i = this._getPointerData(e);
- this._dispatchMouseEvent(this, "stagemousedown", !1, e, i, t),
- i.target = this._getObjectsUnderPoint(i.x, i.y, null, !0),
- i.event = this._dispatchMouseEvent(i.target, "mousedown", !0, e, i, t),
- this.nextStage && this.nextStage._handlePointerDown(e, t, n, r)
- },
- t._testMouseOver = function(e) {
- if (this._primaryPointerID != -1 || !e && this.mouseX == this._mouseOverX && this.mouseY == this._mouseOverY && this.mouseInBounds) return;
- var t = this._getPointerData( - 1),
- n = t.posEvtObj,
- r,
- i = -1,
- s = "",
- o,
- u,
- a;
- if (e || this.mouseInBounds && n && n.target == this.canvas) r = this._getObjectsUnderPoint(this.mouseX, this.mouseY, null, !0),
- this._mouseOverX = this.mouseX,
- this._mouseOverY = this.mouseY;
- var f = this._mouseOverTarget || [],
- l = f[f.length - 1],
- c = this._mouseOverTarget = [];
- o = r;
- while (o) c.unshift(o),
- o.cursor != null && (s = o.cursor),
- o = o.parent;
- this.canvas.style.cursor = s;
- for (u = 0, a = c.length; u < a; u++) {
- if (c[u] != f[u]) break;
- i = u
- }
- l != r && this._dispatchMouseEvent(l, "mouseout", !0, -1, t, n);
- for (u = f.length - 1; u > i; u--) this._dispatchMouseEvent(f[u], "rollout", !1, -1, t, n);
- for (u = c.length - 1; u > i; u--) this._dispatchMouseEvent(c[u], "rollover", !1, -1, t, n);
- l != r && this._dispatchMouseEvent(r, "mouseover", !0, -1, t, n)
- },
- t._handleDoubleClick = function(e) {
- var t = this._getPointerData( - 1),
- n = this._getObjectsUnderPoint(t.x, t.y, null, !0);
- this._dispatchMouseEvent(n, "dblclick", !0, -1, t, e),
- this.nextStage && this.nextStage._handleDoubleClick(e)
- },
- t._dispatchMouseEvent = function(e, t, n, r, i, s) {
- if (!e || !n && !e.hasEventListener(t)) return;
- var o = new createjs.MouseEvent(t, n, !1, i.x, i.y, s, r, r == this._primaryPointerID, i.rawX, i.rawY);
- return e.dispatchEvent(o),
- o
- },
- createjs.Stage = e
- } (),
- this.createjs = this.createjs || {},
- function() {
- var e = function(e) {
- this.initialize(e)
- },
- t = e.prototype = new createjs.DisplayObject;
- t.image = null,
- t.snapToPixel = !0,
- t.sourceRect = null,
- t.DisplayObject_initialize = t.initialize,
- t.initialize = function(e) {
- this.DisplayObject_initialize(),
- typeof e == "string" ? (this.image = document.createElement("img"), this.image.src = e) : this.image = e
- },
- t.isVisible = function() {
- var e = this.cacheCanvas || this.image && (this.image.complete || this.image.getContext || this.image.readyState >= 2);
- return !! (this.visible && this.alpha > 0 && this.scaleX != 0 && this.scaleY != 0 && e)
- },
- t.DisplayObject_draw = t.draw,
- t.draw = function(e, t) {
- if (this.DisplayObject_draw(e, t)) return ! 0;
- var n = this.sourceRect;
- return n ? e.drawImage(this.image, n.x, n.y, n.width, n.height, 0, 0, n.width, n.height) : e.drawImage(this.image, 0, 0),
- !0
- },
- t.DisplayObject_getBounds = t.getBounds,
- t.getBounds = function() {
- var e = this.DisplayObject_getBounds();
- if (e) return e;
- var t = this.sourceRect || this.image,
- n = this.image && (this.image.complete || this.image.getContext || this.image.readyState >= 2);
- return n ? this._rectangle.initialize(0, 0, t.width, t.height) : null
- },
- t.clone = function() {
- var t = new e(this.image);
- return this.sourceRect && (t.sourceRect = this.sourceRect.clone()),
- this.cloneProps(t),
- t
- },
- t.toString = function() {
- return "[Bitmap (name=" + this.name + ")]"
- },
- createjs.Bitmap = e
- } (),
- this.createjs = this.createjs || {},
- function() {
- var e = function(e, t) {
- this.initialize(e, t)
- },
- t = e.prototype = new createjs.DisplayObject;
- t.currentFrame = 0,
- t.currentAnimation = null,
- t.paused = !0,
- t.spriteSheet = null,
- t.snapToPixel = !0,
- t.offset = 0,
- t.currentAnimationFrame = 0,
- t.framerate = 0,
- t._advanceCount = 0,
- t._animation = null,
- t._currentFrame = null,
- t.DisplayObject_initialize = t.initialize,
- t.initialize = function(e, t) {
- this.DisplayObject_initialize(),
- this.spriteSheet = e,
- t && this.gotoAndPlay(t)
- },
- t.isVisible = function() {
- var e = this.cacheCanvas || this.spriteSheet.complete;
- return !! (this.visible && this.alpha > 0 && this.scaleX != 0 && this.scaleY != 0 && e)
- },
- t.DisplayObject_draw = t.draw,
- t.draw = function(e, t) {
- if (this.DisplayObject_draw(e, t)) return ! 0;
- this._normalizeFrame();
- var n = this.spriteSheet.getFrame(this._currentFrame | 0);
- if (!n) return ! 1;
- var r = n.rect;
- return e.drawImage(n.image, r.x, r.y, r.width, r.height, -n.regX, -n.regY, r.width, r.height),
- !0
- },
- t.play = function() {
- this.paused = !1
- },
- t.stop = function() {
- this.paused = !0
- },
- t.gotoAndPlay = function(e) {
- this.paused = !1,
- this._goto(e)
- },
- t.gotoAndStop = function(e) {
- this.paused = !0,
- this._goto(e)
- },
- t.advance = function(e) {
- var t = this._animation && this._animation.speed || 1,
- n = this.framerate || this.spriteSheet.framerate,
- r = n && e != null ? e / (1e3 / n) : 1;
- this._animation ? this.currentAnimationFrame += r * t: this._currentFrame += r * t,
- this._normalizeFrame()
- },
- t.DisplayObject_getBounds = t.getBounds,
- t.getBounds = function() {
- return this.DisplayObject_getBounds() || this.spriteSheet.getFrameBounds(this.currentFrame, this._rectangle)
- },
- t.clone = function() {
- var t = new e(this.spriteSheet);
- return this.cloneProps(t),
- t
- },
- t.toString = function() {
- return "[Sprite (name=" + this.name + ")]"
- },
- t.DisplayObject__tick = t._tick,
- t._tick = function(e) {
- this.paused || this.advance(e && e[0] && e[0].delta),
- this.DisplayObject__tick(e)
- },
- t._normalizeFrame = function() {
- var e = this._animation,
- t = this.paused,
- n = this._currentFrame,
- r = this.currentAnimationFrame,
- i;
- if (e) {
- i = e.frames.length;
- if ((r | 0) >= i) {
- var s = e.next;
- if (!this._dispatchAnimationEnd(e, n, t, s, i - 1)) {
- if (s) return this._goto(s, r - i);
- this.paused = !0,
- r = this.currentAnimationFrame = e.frames.length - 1,
- this._currentFrame = e.frames[r]
- }
- } else this._currentFrame = e.frames[r | 0]
- } else {
- i = this.spriteSheet.getNumFrames();
- if (n >= i && !this._dispatchAnimationEnd(e, n, t, i - 1) && (this._currentFrame -= i) >= i) return this._normalizeFrame()
- }
- this.currentFrame = this._currentFrame | 0
- },
- t._dispatchAnimationEnd = function(e, t, n, r, i) {
- var s = e ? e.name: null;
- if (this.hasEventListener("animationend")) {
- var o = new createjs.Event("animationend");
- o.name = s,
- o.next = r,
- this.dispatchEvent(o)
- }
- var u = this._animation != e || this._currentFrame != t;
- return ! u && !n && this.paused && (this.currentAnimationFrame = i, u = !0),
- u
- },
- t.DisplayObject_cloneProps = t.cloneProps,
- t.cloneProps = function(e) {
- this.DisplayObject_cloneProps(e),
- e.currentFrame = this.currentFrame,
- e._currentFrame = this._currentFrame,
- e.currentAnimation = this.currentAnimation,
- e.paused = this.paused,
- e._animation = this._animation,
- e.currentAnimationFrame = this.currentAnimationFrame,
- e.framerate = this.framerate
- },
- t._goto = function(e, t) {
- if (isNaN(e)) {
- var n = this.spriteSheet.getAnimation(e);
- n && (this.currentAnimationFrame = t || 0, this._animation = n, this.currentAnimation = e, this._normalizeFrame())
- } else this.currentAnimationFrame = 0,
- this.currentAnimation = this._animation = null,
- this._currentFrame = e,
- this._normalizeFrame()
- },
- createjs.Sprite = e
- } (),
- this.createjs = this.createjs || {},
- function() {
- var e = "BitmapAnimation is deprecated in favour of Sprite. See VERSIONS file for info on changes.";
- if (!createjs.Sprite) throw e; (createjs.BitmapAnimation = function(t) {
- console.log(e),
- this.initialize(t)
- }).prototype = new createjs.Sprite
- } (),
- this.createjs = this.createjs || {},
- function() {
- var e = function(e) {
- this.initialize(e)
- },
- t = e.prototype = new createjs.DisplayObject;
- t.graphics = null,
- t.DisplayObject_initialize = t.initialize,
- t.initialize = function(e) {
- this.DisplayObject_initialize(),
- this.graphics = e ? e: new createjs.Graphics
- },
- t.isVisible = function() {
- var e = this.cacheCanvas || this.graphics && !this.graphics.isEmpty();
- return !! (this.visible && this.alpha > 0 && this.scaleX != 0 && this.scaleY != 0 && e)
- },
- t.DisplayObject_draw = t.draw,
- t.draw = function(e, t) {
- return this.DisplayObject_draw(e, t) ? !0 : (this.graphics.draw(e), !0)
- },
- t.clone = function(t) {
- var n = new e(t && this.graphics ? this.graphics.clone() : this.graphics);
- return this.cloneProps(n),
- n
- },
- t.toString = function() {
- return "[Shape (name=" + this.name + ")]"
- },
- createjs.Shape = e
- } (),
- this.createjs = this.createjs || {},
- function() {
- var e = function(e, t, n) {
- this.initialize(e, t, n)
- },
- t = e.prototype = new createjs.DisplayObject,
- n = createjs.createCanvas ? createjs.createCanvas() : document.createElement("canvas");
- n.getContext && (e._workingContext = n.getContext("2d"), n.width = n.height = 1),
- e.H_OFFSETS = {
- start: 0,
- left: 0,
- center: -0.5,
- end: -1,
- right: -1
- },
- e.V_OFFSETS = {
- top: 0,
- hanging: -0.01,
- middle: -0.4,
- alphabetic: -0.8,
- ideographic: -0.85,
- bottom: -1
- },
- t.text = "",
- t.font = null,
- t.color = null,
- t.textAlign = "left",
- t.textBaseline = "top",
- t.maxWidth = null,
- t.outline = 0,
- t.lineHeight = 0,
- t.lineWidth = null,
- t.DisplayObject_initialize = t.initialize,
- t.initialize = function(e, t, n) {
- this.DisplayObject_initialize(),
- this.text = e,
- this.font = t,
- this.color = n
- },
- t.isVisible = function() {
- var e = this.cacheCanvas || this.text != null && this.text !== "";
- return !! (this.visible && this.alpha > 0 && this.scaleX != 0 && this.scaleY != 0 && e)
- },
- t.DisplayObject_draw = t.draw,
- t.draw = function(e, t) {
- if (this.DisplayObject_draw(e, t)) return ! 0;
- var n = this.color || "#000";
- return this.outline ? (e.strokeStyle = n, e.lineWidth = this.outline * 1) : e.fillStyle = n,
- this._drawText(this._prepContext(e)),
- !0
- },
- t.getMeasuredWidth = function() {
- return this._prepContext(e._workingContext).measureText(this.text).width
- },
- t.getMeasuredLineHeight = function() {
- return this._prepContext(e._workingContext).measureText("M").width * 1.2
- },
- t.getMeasuredHeight = function() {
- return this._drawText(null, {}).height
- },
- t.DisplayObject_getBounds = t.getBounds,
- t.getBounds = function() {
- var t = this.DisplayObject_getBounds();
- if (t) return t;
- if (this.text == null || this.text == "") return null;
- var n = this._drawText(null, {}),
- r = this.maxWidth && this.maxWidth < n.width ? this.maxWidth: n.width,
- i = r * e.H_OFFSETS[this.textAlign || "left"],
- s = this.lineHeight || this.getMeasuredLineHeight(),
- o = s * e.V_OFFSETS[this.textBaseline || "top"];
- return this._rectangle.initialize(i, o, r, n.height)
- },
- t.clone = function() {
- var t = new e(this.text, this.font, this.color);
- return this.cloneProps(t),
- t
- },
- t.toString = function() {
- return "[Text (text=" + (this.text.length > 20 ? this.text.substr(0, 17) + "...": this.text) + ")]"
- },
- t.DisplayObject_cloneProps = t.cloneProps,
- t.cloneProps = function(e) {
- this.DisplayObject_cloneProps(e),
- e.textAlign = this.textAlign,
- e.textBaseline = this.textBaseline,
- e.maxWidth = this.maxWidth,
- e.outline = this.outline,
- e.lineHeight = this.lineHeight,
- e.lineWidth = this.lineWidth
- },
- t._prepContext = function(e) {
- return e.font = this.font,
- e.textAlign = this.textAlign || "left",
- e.textBaseline = this.textBaseline || "top",
- e
- },
- t._drawText = function(t, n) {
- var r = !!t;
- r || (t = this._prepContext(e._workingContext));
- var i = this.lineHeight || this.getMeasuredLineHeight(),
- s = 0,
- o = 0,
- u = String(this.text).split(/(?:\r\n|\r|\n)/);
- for (var a = 0,
- f = u.length; a < f; a++) {
- var l = u[a],
- c = null;
- if (this.lineWidth != null && (c = t.measureText(l).width) > this.lineWidth) {
- var h = l.split(/(\s)/);
- l = h[0],
- c = t.measureText(l).width;
- for (var p = 1,
- d = h.length; p < d; p += 2) {
- var v = t.measureText(h[p] + h[p + 1]).width;
- c + v > this.lineWidth ? (r && this._drawTextLine(t, l, o * i), c > s && (s = c), l = h[p + 1], c = t.measureText(l).width, o++) : (l += h[p] + h[p + 1], c += v)
- }
- }
- r && this._drawTextLine(t, l, o * i),
- n && c == null && (c = t.measureText(l).width),
- c > s && (s = c),
- o++
- }
- return n && (n.count = o, n.width = s, n.height = o * i),
- n
- },
- t._drawTextLine = function(e, t, n) {
- this.outline ? e.strokeText(t, 0, n, this.maxWidth || 65535) : e.fillText(t, 0, n, this.maxWidth || 65535)
- },
- createjs.Text = e
- } (),
- this.createjs = this.createjs || {},
- function() {
- function e(e, t) {
- this.initialize(e, t)
- }
- var t = e.prototype = new createjs.DisplayObject;
- t.text = "",
- t.spriteSheet = null,
- t.lineHeight = 0,
- t.letterSpacing = 0,
- t.spaceWidth = 0,
- t.DisplayObject_initialize = t.initialize,
- t.initialize = function(e, t) {
- this.DisplayObject_initialize(),
- this.text = e,
- this.spriteSheet = t
- },
- t.DisplayObject_draw = t.draw,
- t.draw = function(e, t) {
- if (this.DisplayObject_draw(e, t)) return ! 0;
- this._drawText(e)
- },
- t.isVisible = function() {
- var e = this.cacheCanvas || this.spriteSheet && this.spriteSheet.complete && this.text;
- return !! (this.visible && this.alpha > 0 && this.scaleX != 0 && this.scaleY != 0 && e)
- },
- t.getBounds = function() {
- var e = this._rectangle;
- return this._drawText(null, e),
- e.width ? e: null
- },
- t._getFrame = function(e, t) {
- var n, r = t.getAnimation(e);
- return r || (e != (n = e.toUpperCase()) || e != (n = e.toLowerCase()) || (n = null), n && (r = t.getAnimation(n))),
- r && t.getFrame(r.frames[0])
- },
- t._getLineHeight = function(e) {
- var t = this._getFrame("1", e) || this._getFrame("T", e) || this._getFrame("L", e) || e.getFrame(0);
- return t ? t.rect.height: 1
- },
- t._getSpaceWidth = function(e) {
- var t = this._getFrame("1", e) || this._getFrame("l", e) || this._getFrame("e", e) || this._getFrame("a", e) || e.getFrame(0);
- return t ? t.rect.width: 1
- },
- t._drawText = function(e, t) {
- var n, r, i, s = 0,
- o = 0,
- u = this.spaceWidth,
- a = this.lineHeight,
- f = this.spriteSheet,
- l = !!this._getFrame(" ", f); ! l && u == 0 && (u = this._getSpaceWidth(f)),
- a == 0 && (a = this._getLineHeight(f));
- var c = 0;
- for (var h = 0,
- p = this.text.length; h < p; h++) {
- var d = this.text.charAt(h);
- if (!l && d == " ") {
- s += u;
- continue
- }
- if (d == "\n" || d == "\r") {
- d == "\r" && this.text.charAt(h + 1) == "\n" && h++,
- s - i > c && (c = s - i),
- s = 0,
- o += a;
- continue
- }
- var v = this._getFrame(d, f);
- if (!v) continue;
- var m = v.rect;
- i = v.regX,
- n = m.width,
- e && e.drawImage(v.image, m.x, m.y, n, r = m.height, s - i, o - v.regY, n, r),
- s += n + this.letterSpacing
- }
- s - i > c && (c = s - i),
- t && (t.width = c - this.letterSpacing, t.height = o + a)
- },
- createjs.BitmapText = e
- } (),
- this.createjs = this.createjs || {},
- function() {
- var e = function() {
- throw "SpriteSheetUtils cannot be instantiated"
- },
- t = createjs.createCanvas ? createjs.createCanvas() : document.createElement("canvas");
- t.getContext && (e._workingCanvas = t, e._workingContext = t.getContext("2d"), t.width = t.height = 1),
- e.addFlippedFrames = function(t, n, r, i) {
- if (!n && !r && !i) return;
- var s = 0;
- n && e._flip(t, ++s, !0, !1),
- r && e._flip(t, ++s, !1, !0),
- i && e._flip(t, ++s, !0, !0)
- },
- e.extractFrame = function(t, n) {
- isNaN(n) && (n = t.getAnimation(n).frames[0]);
- var r = t.getFrame(n);
- if (!r) return null;
- var i = r.rect,
- s = e._workingCanvas;
- s.width = i.width,
- s.height = i.height,
- e._workingContext.drawImage(r.image, i.x, i.y, i.width, i.height, 0, 0, i.width, i.height);
- var o = document.createElement("img");
- return o.src = s.toDataURL("image/png"),
- o
- },
- e.mergeAlpha = function(e, t, n) {
- n || (n = createjs.createCanvas ? createjs.createCanvas() : document.createElement("canvas")),
- n.width = Math.max(t.width, e.width),
- n.height = Math.max(t.height, e.height);
- var r = n.getContext("2d");
- return r.save(),
- r.drawImage(e, 0, 0),
- r.globalCompositeOperation = "destination-in",
- r.drawImage(t, 0, 0),
- r.restore(),
- n
- },
- e._flip = function(t, n, r, i) {
- var s = t._images,
- o = e._workingCanvas,
- u = e._workingContext,
- a = s.length / n;
- for (var f = 0; f < a; f++) {
- var l = s[f];
- l.__tmp = f,
- u.setTransform(1, 0, 0, 1, 0, 0),
- u.clearRect(0, 0, o.width + 1, o.height + 1),
- o.width = l.width,
- o.height = l.height,
- u.setTransform(r ? -1 : 1, 0, 0, i ? -1 : 1, r ? l.width: 0, i ? l.height: 0),
- u.drawImage(l, 0, 0);
- var c = document.createElement("img");
- c.src = o.toDataURL("image/png"),
- c.width = l.width,
- c.height = l.height,
- s.push(c)
- }
- var h = t._frames,
- p = h.length / n;
- for (f = 0; f < p; f++) {
- l = h[f];
- var d = l.rect.clone();
- c = s[l.image.__tmp + a * n];
- var v = {
- image: c,
- rect: d,
- regX: l.regX,
- regY: l.regY
- };
- r && (d.x = c.width - d.x - d.width, v.regX = d.width - l.regX),
- i && (d.y = c.height - d.y - d.height, v.regY = d.height - l.regY),
- h.push(v)
- }
- var m = "_" + (r ? "h": "") + (i ? "v": ""),
- g = t._animations,
- y = t._data,
- b = g.length / n;
- for (f = 0; f < b; f++) {
- var w = g[f];
- l = y[w];
- var E = {
- name: w + m,
- speed: l.speed,
- next: l.next,
- frames: []
- };
- l.next && (E.next += m),
- h = l.frames;
- for (var S = 0,
- x = h.length; S < x; S++) E.frames.push(h[S] + p * n);
- y[E.name] = E,
- g.push(E.name)
- }
- },
- createjs.SpriteSheetUtils = e
- } (),
- this.createjs = this.createjs || {},
- function() {
- var e = function() {
- this.initialize()
- },
- t = e.prototype = new createjs.EventDispatcher;
- e.ERR_DIMENSIONS = "frame dimensions exceed max spritesheet dimensions",
- e.ERR_RUNNING = "a build is already running",
- t.maxWidth = 2048,
- t.maxHeight = 2048,
- t.spriteSheet = null,
- t.scale = 1,
- t.padding = 1,
- t.timeSlice = .3,
- t.progress = -1,
- t._frames = null,
- t._animations = null,
- t._data = null,
- t._nextFrameIndex = 0,
- t._index = 0,
- t._timerID = null,
- t._scale = 1,
- t.initialize = function() {
- this._frames = [],
- this._animations = {}
- },
- t.addFrame = function(t, n, r, i, s, o) {
- if (this._data) throw e.ERR_RUNNING;
- var u = n || t.bounds || t.nominalBounds;
- return ! u && t.getBounds && (u = t.getBounds()),
- u ? (r = r || 1, this._frames.push({
- source: t,
- sourceRect: u,
- scale: r,
- funct: i,
- params: s,
- scope: o,
- index: this._frames.length,
- height: u.height * r
- }) - 1) : null
- },
- t.addAnimation = function(t, n, r, i) {
- if (this._data) throw e.ERR_RUNNING;
- this._animations[t] = {
- frames: n,
- next: r,
- frequency: i
- }
- },
- t.addMovieClip = function(t, n, r) {
- if (this._data) throw e.ERR_RUNNING;
- var i = t.frameBounds,
- s = n || t.bounds || t.nominalBounds; ! s && t.getBounds && (s = t.getBounds());
- if (!s && !i) return null;
- var o = this._frames.length,
- u = t.timeline.duration;
- for (var a = 0; a < u; a++) {
- var f = i && i[a] ? i[a] : s;
- this.addFrame(t, f, r,
- function(e) {
- var t = this.actionsEnabled;
- this.actionsEnabled = !1,
- this.gotoAndStop(e),
- this.actionsEnabled = t
- },
- [a], t)
- }
- var l = t.timeline._labels,
- c = [];
- for (var h in l) c.push({
- index: l[h],
- label: h
- });
- if (c.length) {
- c.sort(function(e, t) {
- return e.index - t.index
- });
- for (var a = 0,
- p = c.length; a < p; a++) {
- var d = c[a].label,
- v = o + c[a].index,
- m = o + (a == p - 1 ? u: c[a + 1].index),
- g = [];
- for (var y = v; y < m; y++) g.push(y);
- this.addAnimation(d, g, !0)
- }
- }
- },
- t.build = function() {
- if (this._data) throw e.ERR_RUNNING;
- this._startBuild();
- while (this._drawNext());
- return this._endBuild(),
- this.spriteSheet
- },
- t.buildAsync = function(t) {
- if (this._data) throw e.ERR_RUNNING;
- this.timeSlice = t,
- this._startBuild();
- var n = this;
- this._timerID = setTimeout(function() {
- n._run()
- },
- 50 - Math.max(.01, Math.min(.99, this.timeSlice || .3)) * 50)
- },
- t.stopAsync = function() {
- clearTimeout(this._timerID),
- this._data = null
- },
- t.clone = function() {
- throw "SpriteSheetBuilder cannot be cloned."
- },
- t.toString = function() {
- return "[SpriteSheetBuilder]"
- },
- t._startBuild = function() {
- var t = this.padding || 0;
- this.progress = 0,
- this.spriteSheet = null,
- this._index = 0,
- this._scale = this.scale;
- var n = [];
- this._data = {
- images: [],
- frames: n,
- animations: this._animations
- };
- var r = this._frames.slice();
- r.sort(function(e, t) {
- return e.height <= t.height ? -1 : 1
- });
- if (r[r.length - 1].height + t * 2 > this.maxHeight) throw e.ERR_DIMENSIONS;
- var i = 0,
- s = 0,
- o = 0;
- while (r.length) {
- var u = this._fillRow(r, i, o, n, t);
- u.w > s && (s = u.w),
- i += u.h;
- if (!u.h || !r.length) {
- var a = createjs.createCanvas ? createjs.createCanvas() : document.createElement("canvas");
- a.width = this._getSize(s, this.maxWidth),
- a.height = this._getSize(i, this.maxHeight),
- this._data.images[o] = a,
- u.h || (s = i = 0, o++)
- }
- }
- },
- t._getSize = function(e, t) {
- var n = 4;
- while (Math.pow(2, ++n) < e);
- return Math.min(t, Math.pow(2, n))
- },
- t._fillRow = function(t, n, r, i, s) {
- var o = this.maxWidth,
- u = this.maxHeight;
- n += s;
- var a = u - n,
- f = s,
- l = 0;
- for (var c = t.length - 1; c >= 0; c--) {
- var h = t[c],
- p = this._scale * h.scale,
- d = h.sourceRect,
- v = h.source,
- m = Math.floor(p * d.x - s),
- g = Math.floor(p * d.y - s),
- y = Math.ceil(p * d.height + s * 2),
- b = Math.ceil(p * d.width + s * 2);
- if (b > o) throw e.ERR_DIMENSIONS;
- if (y > a || f + b > o) continue;
- h.img = r,
- h.rect = new createjs.Rectangle(f, n, b, y),
- l = l || y,
- t.splice(c, 1),
- i[h.index] = [f, n, b, y, r, Math.round( - m + p * v.regX - s), Math.round( - g + p * v.regY - s)],
- f += b
- }
- return {
- w: f,
- h: l
- }
- },
- t._endBuild = function() {
- this.spriteSheet = new createjs.SpriteSheet(this._data),
- this._data = null,
- this.progress = 1,
- this.dispatchEvent("complete")
- },
- t._run = function() {
- var e = Math.max(.01, Math.min(.99, this.timeSlice || .3)) * 50,
- t = (new Date).getTime() + e,
- n = !1;
- while (t > (new Date).getTime()) if (!this._drawNext()) {
- n = !0;
- break
- }
- if (n) this._endBuild();
- else {
- var r = this;
- this._timerID = setTimeout(function() {
- r._run()
- },
- 50 - e)
- }
- var i = this.progress = this._index / this._frames.length;
- if (this.hasEventListener("progress")) {
- var s = new createjs.Event("progress");
- s.progress = i,
- this.dispatchEvent(s)
- }
- },
- t._drawNext = function() {
- var e = this._frames[this._index],
- t = e.scale * this._scale,
- n = e.rect,
- r = e.sourceRect,
- i = this._data.images[e.img],
- s = i.getContext("2d");
- return e.funct && e.funct.apply(e.scope, e.params),
- s.save(),
- s.beginPath(),
- s.rect(n.x, n.y, n.width, n.height),
- s.clip(),
- s.translate(Math.ceil(n.x - r.x * t), Math.ceil(n.y - r.y * t)),
- s.scale(t, t),
- e.source.draw(s),
- s.restore(),
- ++this._index < this._frames.length
- },
- createjs.SpriteSheetBuilder = e
- } (),
- this.createjs = this.createjs || {},
- function() {
- var e = function(e) {
- this.initialize(e)
- },
- t = e.prototype = new createjs.DisplayObject;
- t.htmlElement = null,
- t._oldMtx = null,
- t._visible = !1,
- t.DisplayObject_initialize = t.initialize,
- t.initialize = function(e) {
- typeof e == "string" && (e = document.getElementById(e)),
- this.DisplayObject_initialize(),
- this.mouseEnabled = !1,
- this.htmlElement = e;
- var t = e.style;
- t.position = "absolute",
- t.transformOrigin = t.WebkitTransformOrigin = t.msTransformOrigin = t.MozTransformOrigin = t.OTransformOrigin = "0% 0%"
- },
- t.isVisible = function() {
- return this.htmlElement != null
- },
- t.draw = function(e, t) {
- return this.visible && (this._visible = !0),
- !0
- },
- t.cache = function() {},
- t.uncache = function() {},
- t.updateCache = function() {},
- t.hitTest = function() {},
- t.localToGlobal = function() {},
- t.globalToLocal = function() {},
- t.localToLocal = function() {},
- t.clone = function() {
- throw "DOMElement cannot be cloned."
- },
- t.toString = function() {
- return "[DOMElement (name=" + this.name + ")]"
- },
- t.DisplayObject__tick = t._tick,
- t._tick = function(e) {
- var t = this.getStage();
- this._visible = !1,
- t && t.on("drawend", this._handleDrawEnd, this, !0),
- this.DisplayObject__tick(e)
- },
- t._handleDrawEnd = function(e) {
- var t = this.htmlElement;
- if (!t) return;
- var n = t.style,
- r = this._visible ? "visible": "hidden";
- r != n.visibility && (n.visibility = r);
- if (!this._visible) return;
- var i = this.getConcatenatedMatrix(this._matrix),
- s = this._oldMtx,
- o = 1e4;
- if (!s || s.alpha != i.alpha) n.opacity = "" + (i.alpha * o | 0) / o,
- s && (s.alpha = i.alpha);
- if (!s || s.tx != i.tx || s.ty != i.ty || s.a != i.a || s.b != i.b || s.c != i.c || s.d != i.d) {
- var u = "matrix(" + (i.a * o | 0) / o + "," + (i.b * o | 0) / o + "," + (i.c * o | 0) / o + "," + (i.d * o | 0) / o + "," + (i.tx + .5 | 0);
- n.transform = n.WebkitTransform = n.OTransform = n.msTransform = u + "," + (i.ty + .5 | 0) + ")",
- n.MozTransform = u + "px," + (i.ty + .5 | 0) + "px)",
- this._oldMtx = s ? s.copy(i) : i.clone()
- }
- },
- createjs.DOMElement = e
- } (),
- this.createjs = this.createjs || {},
- function() {
- var e = function() {
- this.initialize()
- },
- t = e.prototype;
- t.initialize = function() {},
- t.getBounds = function() {
- return null
- },
- t.applyFilter = function(e, t, n, r, i, s, o, u) {},
- t.toString = function() {
- return "[Filter]"
- },
- t.clone = function() {
- return new e
- },
- createjs.Filter = e
- } (),
- this.createjs = this.createjs || {},
- function() {
- var e = function(e, t, n) {
- this.initialize(e, t, n)
- },
- t = e.prototype = new createjs.Filter;
- t.initialize = function(e, t, n) {
- if (isNaN(e) || e < 0) e = 0;
- this.blurX = e | 0;
- if (isNaN(t) || t < 0) t = 0;
- this.blurY = t | 0;
- if (isNaN(n) || n < 1) n = 1;
- this.quality = n | 0
- },
- t.blurX = 0,
- t.blurY = 0,
- t.quality = 1,
- t.mul_table = [1, 171, 205, 293, 57, 373, 79, 137, 241, 27, 391, 357, 41, 19, 283, 265, 497, 469, 443, 421, 25, 191, 365, 349, 335, 161, 155, 149, 9, 278, 269, 261, 505, 245, 475, 231, 449, 437, 213, 415, 405, 395, 193, 377, 369, 361, 353, 345, 169, 331, 325, 319, 313, 307, 301, 37, 145, 285, 281, 69, 271, 267, 263, 259, 509, 501, 493, 243, 479, 118, 465, 459, 113, 446, 55, 435, 429, 423, 209, 413, 51, 403, 199, 393, 97, 3, 379, 375, 371, 367, 363, 359, 355, 351, 347, 43, 85, 337, 333, 165, 327, 323, 5, 317, 157, 311, 77, 305, 303, 75, 297, 294, 73, 289, 287, 71, 141, 279, 277, 275, 68, 135, 67, 133, 33, 262, 260, 129, 511, 507, 503, 499, 495, 491, 61, 121, 481, 477, 237, 235, 467, 232, 115, 457, 227, 451, 7, 445, 221, 439, 218, 433, 215, 427, 425, 211, 419, 417, 207, 411, 409, 203, 202, 401, 399, 396, 197, 49, 389, 387, 385, 383, 95, 189, 47, 187, 93, 185, 23, 183, 91, 181, 45, 179, 89, 177, 11, 175, 87, 173, 345, 343, 341, 339, 337, 21, 167, 83, 331, 329, 327, 163, 81, 323, 321, 319, 159, 79, 315, 313, 39, 155, 309, 307, 153, 305, 303, 151, 75, 299, 149, 37, 295, 147, 73, 291, 145, 289, 287, 143, 285, 71, 141, 281, 35, 279, 139, 69, 275, 137, 273, 17, 271, 135, 269, 267, 133, 265, 33, 263, 131, 261, 130, 259, 129, 257, 1],
- t.shg_table = [0, 9, 10, 11, 9, 12, 10, 11, 12, 9, 13, 13, 10, 9, 13, 13, 14, 14, 14, 14, 10, 13, 14, 14, 14, 13, 13, 13, 9, 14, 14, 14, 15, 14, 15, 14, 15, 15, 14, 15, 15, 15, 14, 15, 15, 15, 15, 15, 14, 15, 15, 15, 15, 15, 15, 12, 14, 15, 15, 13, 15, 15, 15, 15, 16, 16, 16, 15, 16, 14, 16, 16, 14, 16, 13, 16, 16, 16, 15, 16, 13, 16, 15, 16, 14, 9, 16, 16, 16, 16, 16, 16, 16, 16, 16, 13, 14, 16, 16, 15, 16, 16, 10, 16, 15, 16, 14, 16, 16, 14, 16, 16, 14, 16, 16, 14, 15, 16, 16, 16, 14, 15, 14, 15, 13, 16, 16, 15, 17, 17, 17, 17, 17, 17, 14, 15, 17, 17, 16, 16, 17, 16, 15, 17, 16, 17, 11, 17, 16, 17, 16, 17, 16, 17, 17, 16, 17, 17, 16, 17, 17, 16, 16, 17, 17, 17, 16, 14, 17, 17, 17, 17, 15, 16, 14, 16, 15, 16, 13, 16, 15, 16, 14, 16, 15, 16, 12, 16, 15, 16, 17, 17, 17, 17, 17, 13, 16, 15, 17, 17, 17, 16, 15, 17, 17, 17, 16, 15, 17, 17, 14, 16, 17, 17, 16, 17, 17, 16, 15, 17, 16, 14, 17, 16, 15, 17, 16, 17, 17, 16, 17, 15, 16, 17, 14, 17, 16, 15, 17, 16, 17, 13, 17, 16, 17, 17, 16, 17, 14, 17, 16, 17, 16, 17, 16, 17, 9],
- t.getBounds = function() {
- var e = Math.pow(this.quality, .6) * .5;
- return new createjs.Rectangle( - this.blurX * e, -this.blurY * e, 2 * this.blurX * e, 2 * this.blurY * e)
- },
- t.applyFilter = function(e, t, n, r, i, s, o, u) {
- s = s || e,
- o == null && (o = t),
- u == null && (u = n);
- try {
- var a = e.getImageData(t, n, r, i)
- } catch(f) {
- return ! 1
- }
- var l = this.blurX / 2;
- if (isNaN(l) || l < 0) return ! 1;
- l |= 0;
- var c = this.blurY / 2;
- if (isNaN(c) || c < 0) return ! 1;
- c |= 0;
- if (l == 0 && c == 0) return ! 1;
- var h = this.quality;
- if (isNaN(h) || h < 1) h = 1;
- h |= 0,
- h > 3 && (h = 3),
- h < 1 && (h = 1);
- var p = a.data,
- t, n, d, v, m, g, y, b, w, E, S, x, T, N, C, k, L, A, O, M, _, D, P, H, B = l + l + 1,
- j = c + c + 1,
- F = r << 2,
- I = r - 1,
- q = i - 1,
- R = l + 1,
- U = c + 1,
- z = {
- r: 0,
- b: 0,
- g: 0,
- a: 0,
- next: null
- },
- W = z;
- for (d = 1; d < B; d++) {
- W = W.next = {
- r: 0,
- b: 0,
- g: 0,
- a: 0,
- next: null
- };
- if (d == R) var X = W
- }
- W.next = z;
- var V = {
- r: 0,
- b: 0,
- g: 0,
- a: 0,
- next: null
- },
- $ = V;
- for (d = 1; d < j; d++) {
- $ = $.next = {
- r: 0,
- b: 0,
- g: 0,
- a: 0,
- next: null
- };
- if (d == U) var J = $
- }
- $.next = V;
- var K = null;
- while (h-->0) {
- y = g = 0;
- var Q = this.mul_table[l],
- G = this.shg_table[l];
- for (n = i; --n > -1;) {
- b = R * (M = p[g]),
- w = R * (_ = p[g + 1]),
- E = R * (D = p[g + 2]),
- S = R * (P = p[g + 3]),
- W = z;
- for (d = R; --d > -1;) W.r = M,
- W.g = _,
- W.b = D,
- W.a = P,
- W = W.next;
- for (d = 1; d < R; d++) v = g + ((I < d ? I: d) << 2),
- b += W.r = p[v],
- w += W.g = p[v + 1],
- E += W.b = p[v + 2],
- S += W.a = p[v + 3],
- W = W.next;
- K = z;
- for (t = 0; t < r; t++) p[g++] = b * Q >>> G,
- p[g++] = w * Q >>> G,
- p[g++] = E * Q >>> G,
- p[g++] = S * Q >>> G,
- v = y + ((v = t + l + 1) < I ? v: I) << 2,
- b -= K.r - (K.r = p[v]),
- w -= K.g - (K.g = p[v + 1]),
- E -= K.b - (K.b = p[v + 2]),
- S -= K.a - (K.a = p[v + 3]),
- K = K.next;
- y += r
- }
- Q = this.mul_table[c],
- G = this.shg_table[c];
- for (t = 0; t < r; t++) {
- g = t << 2,
- b = U * (M = p[g]),
- w = U * (_ = p[g + 1]),
- E = U * (D = p[g + 2]),
- S = U * (P = p[g + 3]),
- $ = V;
- for (d = 0; d < U; d++) $.r = M,
- $.g = _,
- $.b = D,
- $.a = P,
- $ = $.next;
- m = r;
- for (d = 1; d <= c; d++) g = m + t << 2,
- b += $.r = p[g],
- w += $.g = p[g + 1],
- E += $.b = p[g + 2],
- S += $.a = p[g + 3],
- $ = $.next,
- d < q && (m += r);
- g = t,
- K = V;
- if (h > 0) for (n = 0; n < i; n++) v = g << 2,
- p[v + 3] = P = S * Q >>> G,
- P > 0 ? (p[v] = b * Q >>> G, p[v + 1] = w * Q >>> G, p[v + 2] = E * Q >>> G) : p[v] = p[v + 1] = p[v + 2] = 0,
- v = t + ((v = n + U) < q ? v: q) * r << 2,
- b -= K.r - (K.r = p[v]),
- w -= K.g - (K.g = p[v + 1]),
- E -= K.b - (K.b = p[v + 2]),
- S -= K.a - (K.a = p[v + 3]),
- K = K.next,
- g += r;
- else for (n = 0; n < i; n++) v = g << 2,
- p[v + 3] = P = S * Q >>> G,
- P > 0 ? (P = 255 / P, p[v] = (b * Q >>> G) * P, p[v + 1] = (w * Q >>> G) * P, p[v + 2] = (E * Q >>> G) * P) : p[v] = p[v + 1] = p[v + 2] = 0,
- v = t + ((v = n + U) < q ? v: q) * r << 2,
- b -= K.r - (K.r = p[v]),
- w -= K.g - (K.g = p[v + 1]),
- E -= K.b - (K.b = p[v + 2]),
- S -= K.a - (K.a = p[v + 3]),
- K = K.next,
- g += r
- }
- }
- return s.putImageData(a, o, u),
- !0
- },
- t.clone = function() {
- return new e(this.blurX, this.blurY, this.quality)
- },
- t.toString = function() {
- return "[BlurFilter]"
- },
- createjs.BlurFilter = e
- } (),
- this.createjs = this.createjs || {},
- function() {
- var e = function(e) {
- this.initialize(e)
- },
- t = e.prototype = new createjs.Filter;
- t.initialize = function(e) {
- this.alphaMap = e
- },
- t.alphaMap = null,
- t._alphaMap = null,
- t._mapData = null,
- t.applyFilter = function(e, t, n, r, i, s, o, u) {
- if (!this.alphaMap) return ! 0;
- if (!this._prepAlphaMap()) return ! 1;
- s = s || e,
- o == null && (o = t),
- u == null && (u = n);
- try {
- var a = e.getImageData(t, n, r, i)
- } catch(f) {
- return ! 1
- }
- var l = a.data,
- c = this._mapData,
- h = l.length;
- for (var p = 0; p < h; p += 4) l[p + 3] = c[p] || 0;
- return s.putImageData(a, o, u),
- !0
- },
- t.clone = function() {
- return new e(this.alphaMap)
- },
- t.toString = function() {
- return "[AlphaMapFilter]"
- },
- t._prepAlphaMap = function() {
- if (!this.alphaMap) return ! 1;
- if (this.alphaMap == this._alphaMap && this._mapData) return ! 0;
- this._mapData = null;
- var e = this._alphaMap = this.alphaMap,
- t = e,
- n;
- e instanceof HTMLCanvasElement ? n = t.getContext("2d") : (t = createjs.createCanvas ? createjs.createCanvas() : document.createElement("canvas"), t.width = e.width, t.height = e.height, n = t.getContext("2d"), n.drawImage(e, 0, 0));
- try {
- var r = n.getImageData(0, 0, e.width, e.height)
- } catch(i) {
- return ! 1
- }
- return this._mapData = r.data,
- !0
- },
- createjs.AlphaMapFilter = e
- } (),
- this.createjs = this.createjs || {},
- function() {
- var e = function(e) {
- this.initialize(e)
- },
- t = e.prototype = new createjs.Filter;
- t.initialize = function(e) {
- this.mask = e
- },
- t.mask = null,
- t.applyFilter = function(e, t, n, r, i, s, o, u) {
- return this.mask ? (s = s || e, o == null && (o = t), u == null && (u = n), s.save(), e != s, s.globalCompositeOperation = "destination-in", s.drawImage(this.mask, o, u), s.restore(), !0) : !0
- },
- t.clone = function() {
- return new e(this.mask)
- },
- t.toString = function() {
- return "[AlphaMaskFilter]"
- },
- createjs.AlphaMaskFilter = e
- } (),
- this.createjs = this.createjs || {},
- function() {
- var e = function(e, t, n, r, i, s, o, u) {
- this.initialize(e, t, n, r, i, s, o, u)
- },
- t = e.prototype = new createjs.Filter;
- t.redMultiplier = 1,
- t.greenMultiplier = 1,
- t.blueMultiplier = 1,
- t.alphaMultiplier = 1,
- t.redOffset = 0,
- t.greenOffset = 0,
- t.blueOffset = 0,
- t.alphaOffset = 0,
- t.initialize = function(e, t, n, r, i, s, o, u) {
- this.redMultiplier = e != null ? e: 1,
- this.greenMultiplier = t != null ? t: 1,
- this.blueMultiplier = n != null ? n: 1,
- this.alphaMultiplier = r != null ? r: 1,
- this.redOffset = i || 0,
- this.greenOffset = s || 0,
- this.blueOffset = o || 0,
- this.alphaOffset = u || 0
- },
- t.applyFilter = function(e, t, n, r, i, s, o, u) {
- s = s || e,
- o == null && (o = t),
- u == null && (u = n);
- try {
- var a = e.getImageData(t, n, r, i)
- } catch(f) {
- return ! 1
- }
- var l = a.data,
- c = l.length;
- for (var h = 0; h < c; h += 4) l[h] = l[h] * this.redMultiplier + this.redOffset,
- l[h + 1] = l[h + 1] * this.greenMultiplier + this.greenOffset,
- l[h + 2] = l[h + 2] * this.blueMultiplier + this.blueOffset,
- l[h + 3] = l[h + 3] * this.alphaMultiplier + this.alphaOffset;
- return s.putImageData(a, o, u),
- !0
- },
- t.toString = function() {
- return "[ColorFilter]"
- },
- t.clone = function() {
- return new e(this.redMultiplier, this.greenMultiplier, this.blueMultiplier, this.alphaMultiplier, this.redOffset, this.greenOffset, this.blueOffset, this.alphaOffset)
- },
- createjs.ColorFilter = e
- } (),
- this.createjs = this.createjs || {},
- function() {
- var e = function(e, t, n, r) {
- this.initialize(e, t, n, r)
- },
- t = e.prototype;
- e.DELTA_INDEX = [0, .01, .02, .04, .05, .06, .07, .08, .1, .11, .12, .14, .15, .16, .17, .18, .2, .21, .22, .24, .25, .27, .28, .3, .32, .34, .36, .38, .4, .42, .44, .46, .48, .5, .53, .56, .59, .62, .65, .68, .71, .74, .77, .8, .83, .86, .89, .92, .95, .98, 1, 1.06, 1.12, 1.18, 1.24, 1.3, 1.36, 1.42, 1.48, 1.54, 1.6, 1.66, 1.72, 1.78, 1.84, 1.9, 1.96, 2, 2.12, 2.25, 2.37, 2.5, 2.62, 2.75, 2.87, 3, 3.2, 3.4, 3.6, 3.8, 4, 4.3, 4.7, 4.9, 5, 5.5, 6, 6.5, 6.8, 7, 7.3, 7.5, 7.8, 8, 8.4, 8.7, 9, 9.4, 9.6, 9.8, 10],
- e.IDENTITY_MATRIX = [1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1],
- e.LENGTH = e.IDENTITY_MATRIX.length,
- t.initialize = function(e, t, n, r) {
- return this.reset(),
- this.adjustColor(e, t, n, r),
- this
- },
- t.reset = function() {
- return this.copyMatrix(e.IDENTITY_MATRIX)
- },
- t.adjustColor = function(e, t, n, r) {
- return this.adjustHue(r),
- this.adjustContrast(t),
- this.adjustBrightness(e),
- this.adjustSaturation(n)
- },
- t.adjustBrightness = function(e) {
- return e == 0 || isNaN(e) ? this: (e = this._cleanValue(e, 255), this._multiplyMatrix([1, 0, 0, 0, e, 0, 1, 0, 0, e, 0, 0, 1, 0, e, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1]), this)
- },
- t.adjustContrast = function(t) {
- if (t == 0 || isNaN(t)) return this;
- t = this._cleanValue(t, 100);
- var n;
- return t < 0 ? n = 127 + t / 100 * 127 : (n = t % 1, n == 0 ? n = e.DELTA_INDEX[t] : n = e.DELTA_INDEX[t << 0] * (1 - n) + e.DELTA_INDEX[(t << 0) + 1] * n, n = n * 127 + 127),
- this._multiplyMatrix([n / 127, 0, 0, 0, .5 * (127 - n), 0, n / 127, 0, 0, .5 * (127 - n), 0, 0, n / 127, 0, .5 * (127 - n), 0, 0, 0, 1, 0, 0, 0, 0, 0, 1]),
- this
- },
- t.adjustSaturation = function(e) {
- if (e == 0 || isNaN(e)) return this;
- e = this._cleanValue(e, 100);
- var t = 1 + (e > 0 ? 3 * e / 100 : e / 100),
- n = .3086,
- r = .6094,
- i = .082;
- return this._multiplyMatrix([n * (1 - t) + t, r * (1 - t), i * (1 - t), 0, 0, n * (1 - t), r * (1 - t) + t, i * (1 - t), 0, 0, n * (1 - t), r * (1 - t), i * (1 - t) + t, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1]),
- this
- },
- t.adjustHue = function(e) {
- if (e == 0 || isNaN(e)) return this;
- e = this._cleanValue(e, 180) / 180 * Math.PI;
- var t = Math.cos(e),
- n = Math.sin(e),
- r = .213,
- i = .715,
- s = .072;
- return this._multiplyMatrix([r + t * (1 - r) + n * -r, i + t * -i + n * -i, s + t * -s + n * (1 - s), 0, 0, r + t * -r + n * .143, i + t * (1 - i) + n * .14, s + t * -s + n * -0.283, 0, 0, r + t * -r + n * -(1 - r), i + t * -i + n * i, s + t * (1 - s) + n * s, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1]),
- this
- },
- t.concat = function(t) {
- return t = this._fixMatrix(t),
- t.length != e.LENGTH ? this: (this._multiplyMatrix(t), this)
- },
- t.clone = function() {
- return (new e).copyMatrix(this)
- },
- t.toArray = function() {
- var t = [];
- for (var n = 0,
- r = e.LENGTH; n < r; n++) t[n] = this[n];
- return t
- },
- t.copyMatrix = function(t) {
- var n = e.LENGTH;
- for (var r = 0; r < n; r++) this[r] = t[r];
- return this
- },
- t.toString = function() {
- return "[ColorMatrix]"
- },
- t._multiplyMatrix = function(e) {
- var t = [];
- for (var n = 0; n < 5; n++) {
- for (var r = 0; r < 5; r++) t[r] = this[r + n * 5];
- for (var r = 0; r < 5; r++) {
- var i = 0;
- for (var s = 0; s < 5; s++) i += e[r + s * 5] * t[s];
- this[r + n * 5] = i
- }
- }
- },
- t._cleanValue = function(e, t) {
- return Math.min(t, Math.max( - t, e))
- },
- t._fixMatrix = function(t) {
- return t instanceof e && (t = t.toArray()),
- t.length < e.LENGTH ? t = t.slice(0, t.length).concat(e.IDENTITY_MATRIX.slice(t.length, e.LENGTH)) : t.length > e.LENGTH && (t = t.slice(0, e.LENGTH)),
- t
- },
- createjs.ColorMatrix = e
- } (),
- this.createjs = this.createjs || {},
- function() {
- var e = function(e) {
- this.initialize(e)
- },
- t = e.prototype = new createjs.Filter;
- t.matrix = null,
- t.initialize = function(e) {
- this.matrix = e
- },
- t.applyFilter = function(e, t, n, r, i, s, o, u) {
- s = s || e,
- o == null && (o = t),
- u == null && (u = n);
- try {
- var a = e.getImageData(t, n, r, i)
- } catch(f) {
- return ! 1
- }
- var l = a.data,
- c = l.length,
- h, p, d, v, m = this.matrix,
- g = m[0],
- y = m[1],
- b = m[2],
- w = m[3],
- E = m[4],
- S = m[5],
- x = m[6],
- T = m[7],
- N = m[8],
- C = m[9],
- k = m[10],
- L = m[11],
- A = m[12],
- O = m[13],
- M = m[14],
- _ = m[15],
- D = m[16],
- P = m[17],
- H = m[18],
- B = m[19];
- for (var j = 0; j < c; j += 4) h = l[j],
- p = l[j + 1],
- d = l[j + 2],
- v = l[j + 3],
- l[j] = h * g + p * y + d * b + v * w + E,
- l[j + 1] = h * S + p * x + d * T + v * N + C,
- l[j + 2] = h * k + p * L + d * A + v * O + M,
- l[j + 3] = h * _ + p * D + d * P + v * H + B;
- return s.putImageData(a, o, u),
- !0
- },
- t.toString = function() {
- return "[ColorMatrixFilter]"
- },
- t.clone = function() {
- return new e(this.matrix)
- },
- createjs.ColorMatrixFilter = e
- } (),
- this.createjs = this.createjs || {},
- function() {
- var e = function() {
- throw "Touch cannot be instantiated"
- };
- e.isSupported = function() {
- return "ontouchstart" in window || window.navigator.msPointerEnabled && window.navigator.msMaxTouchPoints > 0 || window.navigator.pointerEnabled && window.navigator.maxTouchPoints > 0
- },
- e.enable = function(t, n, r) {
- return ! t || !t.canvas || !e.isSupported() ? !1 : (t.__touch = {
- pointers: {},
- multitouch: !n,
- preventDefault: !r,
- count: 0
- },
- "ontouchstart" in window ? e._IOS_enable(t) : (window.navigator.msPointerEnabled || window.navigator.pointerEnabled) && e._IE_enable(t), !0)
- },
- e.disable = function(t) {
- if (!t) return;
- "ontouchstart" in window ? e._IOS_disable(t) : (window.navigator.msPointerEnabled || window.navigator.pointerEnabled) && e._IE_disable(t)
- },
- e._IOS_enable = function(t) {
- var n = t.canvas,
- r = t.__touch.f = function(n) {
- e._IOS_handleEvent(t, n)
- };
- n.addEventListener("touchstart", r, !1),
- n.addEventListener("touchmove", r, !1),
- n.addEventListener("touchend", r, !1),
- n.addEventListener("touchcancel", r, !1)
- },
- e._IOS_disable = function(e) {
- var t = e.canvas;
- if (!t) return;
- var n = e.__touch.f;
- t.removeEventListener("touchstart", n, !1),
- t.removeEventListener("touchmove", n, !1),
- t.removeEventListener("touchend", n, !1),
- t.removeEventListener("touchcancel", n, !1)
- },
- e._IOS_handleEvent = function(e, t) {
- if (!e) return;
- e.__touch.preventDefault && t.preventDefault && t.preventDefault();
- var n = t.changedTouches,
- r = t.type;
- for (var i = 0,
- s = n.length; i < s; i++) {
- var o = n[i],
- u = o.identifier;
- if (o.target != e.canvas) continue;
- r == "touchstart" ? this._handleStart(e, u, t, o.pageX, o.pageY) : r == "touchmove" ? this._handleMove(e, u, t, o.pageX, o.pageY) : (r == "touchend" || r == "touchcancel") && this._handleEnd(e, u, t)
- }
- },
- e._IE_enable = function(t) {
- var n = t.canvas,
- r = t.__touch.f = function(n) {
- e._IE_handleEvent(t, n)
- };
- window.navigator.pointerEnabled === undefined ? (n.addEventListener("MSPointerDown", r, !1), window.addEventListener("MSPointerMove", r, !1), window.addEventListener("MSPointerUp", r, !1), window.addEventListener("MSPointerCancel", r, !1), t.__touch.preventDefault && (n.style.msTouchAction = "none")) : (n.addEventListener("pointerdown", r, !1), window.addEventListener("pointermove", r, !1), window.addEventListener("pointerup", r, !1), window.addEventListener("pointercancel", r, !1), t.__touch.preventDefault && (n.style.touchAction = "none")),
- t.__touch.activeIDs = {}
- },
- e._IE_disable = function(e) {
- var t = e.__touch.f;
- window.navigator.pointerEnabled === undefined ? (window.removeEventListener("MSPointerMove", t, !1), window.removeEventListener("MSPointerUp", t, !1), window.removeEventListener("MSPointerCancel", t, !1), e.canvas && e.canvas.removeEventListener("MSPointerDown", t, !1)) : (window.removeEventListener("pointermove", t, !1), window.removeEventListener("pointerup", t, !1), window.removeEventListener("pointercancel", t, !1), e.canvas && e.canvas.removeEventListener("pointerdown", t, !1))
- },
- e._IE_handleEvent = function(e, t) {
- if (!e) return;
- e.__touch.preventDefault && t.preventDefault && t.preventDefault();
- var n = t.type,
- r = t.pointerId,
- i = e.__touch.activeIDs;
- if (n == "MSPointerDown" || n == "pointerdown") {
- if (t.srcElement != e.canvas) return;
- i[r] = !0,
- this._handleStart(e, r, t, t.pageX, t.pageY)
- } else if (i[r]) if (n == "MSPointerMove" || n == "pointermove") this._handleMove(e, r, t, t.pageX, t.pageY);
- else if (n == "MSPointerUp" || n == "MSPointerCancel" || n == "pointerup" || n == "pointercancel") delete i[r],
- this._handleEnd(e, r, t)
- },
- e._handleStart = function(e, t, n, r, i) {
- var s = e.__touch;
- if (!s.multitouch && s.count) return;
- var o = s.pointers;
- if (o[t]) return;
- o[t] = !0,
- s.count++,
- e._handlePointerDown(t, n, r, i)
- },
- e._handleMove = function(e, t, n, r, i) {
- if (!e.__touch.pointers[t]) return;
- e._handlePointerMove(t, n, r, i)
- },
- e._handleEnd = function(e, t, n) {
- var r = e.__touch,
- i = r.pointers;
- if (!i[t]) return;
- r.count--,
- e._handlePointerUp(t, n, !0),
- delete i[t]
- },
- createjs.Touch = e
- } (),
- this.createjs = this.createjs || {},
- function() {
- var e = createjs.EaselJS = createjs.EaselJS || {};
- e.version = "0.7.1",
- e.buildDate = "Tue, 04 Mar 2014 23:51:13 GMT"
- } (),
- define("cjs",
- function(e) {
- return function() {
- var t, n;
- return t || e.createjs
- }
- } (this)),
- define("Screen", ["cjs"],
- function(e) {
- var t = function() {
- this.init()
- },
- n = t.prototype = new e.Container;
- return n.Container_draw = n.draw,
- n.getName = function() {
- return this._name
- },
- n.draw = function(e, t) {
- return this.Container_draw(e, t)
- },
- n.getScreenController = function() {
- return this._screenController
- },
- n.init = function() {
- this.initialize()
- },
- n.didScreenSelected = function(e) {},
- n.didScreenUnselected = function() {},
- n._name = null,
- n._builded = !1,
- n._screenController = null,
- n._build = function() {},
- t
- }),
- define("assetStorage", ["cjs"],
- function(e) {
- return {
- add: function(e, t) {
- if (t.indexOf("atlas.json") != -1) for (var n in e.frames) {
- if (!e.frames.hasOwnProperty(n)) continue;
- var r = "gfx/" + n.replace("0000", "") + ".png",
- i = t.replace(".json", ".png"),
- s = e.frames[n];
- this._atlas[r] = {
- png: i,
- frame: s.frame
- }
- }
- this._assets[t] = e
- },
- get: function(e) {
- return this._assets[e]
- },
- getBitmap: function(t) {
- var n = this.get(t),
- r;
- if (n) r = new e.Bitmap(n);
- else if (this._atlas.hasOwnProperty(t)) {
- var i = this._atlas[t];
- n = this.get(i.png),
- r = new e.Bitmap(n),
- r.sourceRect = new e.Rectangle(i.frame.x, i.frame.y, i.frame.w, i.frame.h)
- } else r = new e.Bitmap;
- return r
- },
- remove: function(e) {
- delete this._assets[e]
- },
- _assets: {},
- _atlas: {}
- }
- }),
- define("gui/ComponentRenderer", ["require"],
- function(e) {
- var t = function() {
- this.init()
- },
- n = t.prototype;
- return n.init = function() {},
- n.getOwner = function() {
- return this._owner
- },
- n.setOwner = function(e) {
- this._owner = e
- },
- n.validate = function(e) {},
- n._owner = null,
- t
- }),
- define("gui/Component", ["require", "cjs", "gui/ComponentRenderer"],
- function(e) {
- var t = e("cjs"),
- n = e("gui/ComponentRenderer"),
- r = function() {
- this.initialize()
- },
- i = r.prototype = new t.Container;
- return i.getRenderer = function() {
- return this._renderer
- },
- i.setRenderer = function(e) {
- this._renderer = e,
- this._renderer && (this._renderer._owner = this),
- this.invalidate()
- },
- i.Container_initialize = i.initialize,
- i.initialize = function() {
- this.Container_initialize(),
- this.setRenderer(new n),
- this.addChild(new t.DisplayObject)
- },
- i.Container_draw = i.draw,
- i.draw = function(e, t) {
- return this._invalid && this.validate(),
- this.Container_draw(e, t)
- },
- i.invalidate = function() {
- this._invalid = !0,
- this._invalidFlags = this._invalidFlags || {};
- for (var e = 0; e < arguments.length; e++) this._invalidFlags[arguments[e]] = null
- },
- i.validate = function() {
- this._renderer.validate(this._invalidFlags),
- this._invalidFlags = null,
- this._invalid = !1
- },
- i._invalid = !0,
- i._renderer = null,
- i._invalidFlags = null,
- r
- }),
- define("gui/Button", ["require", "gui/Component"],
- function(e) {
- var t = e("gui/Component"),
- n = {
- stateChanged: "stateChanged"
- },
- r = {
- enabled: 2,
- hover: 4,
- pressed: 8
- },
- i = function(e) {
- e || this.initialize()
- };
- i.invFlags = n,
- i.stateFlags = r;
- var s = i.prototype = new t;
- return s.Component_initialize = s.initialize,
- s.initialize = function() {
- this.Component_initialize(),
- this.mouseChildren = !1,
- this.subscribeToEvents()
- },
- s.getEnabled = function() {
- return this._enabled
- },
- s.getPressed = function() {
- return this._isPressed
- },
- s.getMouseHover = function() {
- return this._isOver
- },
- s.getActive = function() {
- return this._enabled
- },
- s.getState = function() {
- var e = 0;
- return this._isPressed && (e |= r.pressed),
- this._enabled && (e |= r.active),
- this._isOver && (e |= r.hover),
- e
- },
- s.subscribeToEvents = function() {
- this.cursor = "pointer",
- this.addEventListener("rollover", this),
- this.addEventListener("rollout", this),
- this.addEventListener("mousedown", this),
- this.addEventListener("pressup", this)
- },
- s.unsubscribeToEvents = function() {
- this.cursor = null,
- this.removeEventListener("rollover", this),
- this.removeEventListener("rollout", this),
- this.removeEventListener("mousedown", this),
- this.removeEventListener("pressup", this)
- },
- s.handleEvent = function(e) {
- var t = e.type;
- t == "mousedown" ? this._isPressed = !0 : t == "pressup" ? this._isPressed = !1 : this._isOver = t == "rollover",
- this.invalidate(n.stateChanged)
- },
- s._state = 0,
- s._isPressed = !1,
- s._isOver = !1,
- s._enabled = !0,
- i
- }),
- define("gui/ToggleButton", ["require", "cjs", "gui/Button"],
- function(e) {
- var t = e("cjs"),
- n = e("gui/Button"),
- r = function() {
- this.initialize()
- },
- i = r.prototype = new n(!0);
- return i.getSelected = function() {
- return this._selected
- },
- i.setSelected = function(e) {
- if (e == this._selected) return;
- this._selected = e,
- this.invalidate()
- },
- i.Button_handleEvent = i.handleEvent,
- i.handleEvent = function(e) {
- e.type == "pressup" && (this._selected = !this._selected, this.dispatchEvent(new t.Event("change"))),
- this.Button_handleEvent(e)
- },
- i._selected = !1,
- r
- }),
- define("gui/ButtonRenderer", ["require", "gui/ComponentRenderer"],
- function(e) {
- var t = e("gui/ComponentRenderer"),
- n = function() {},
- r = n.prototype = new t;
- return r.getButton = function() {},
- r.setButton = function() {},
- r.buttonStateChanged = function() {},
- r._button = null,
- n
- }),
- define("gui/BitmapButtonRenderer", ["require", "gui/ButtonRenderer", "gui/Button"],
- function(e) {
- var t = e("gui/ButtonRenderer"),
- n = e("gui/Button"),
- r = function() {},
- i = r.prototype = new t;
- return i.setFlagBitmaps = function(e) {
- this._flagBitmaps = e
- },
- i.setAnchors = function(e, t) {
- this._anchorX = e,
- this._anchorY = t,
- this.getOwner() && this.getOwner().invalidate()
- },
- i.validate = function(e) {
- var t = this.getOwner().getState(),
- n = this._getBitmapForState(t);
- if (this._currBitmap == n) return;
- this._currBitmap && this.getOwner().removeChild(this._currBitmap),
- n && (n.name = "bitmapButtonRenderer", n.x = -(n.getBounds().width * this._anchorX), n.y = -(n.getBounds().height * this._anchorY), this.getOwner().addChild(n), this._currBitmap = n)
- },
- i._flagBitmaps = null,
- i._getBitmapForState = function(e) {
- var t = n.stateFlags,
- r = this._flagBitmaps,
- i;
- e & t.pressed ? i = "pressed": e & t.hover && (i = "hover");
- var s = e & t.enabled ? r.enabled: r.disabled;
- s || (s = r["default"]);
- var o = s[i];
- return o || (o = r["default"][i]),
- o || (o = r["default"].active),
- o
- },
- i._currBitmap = null,
- i._anchorX = 0,
- i._anchorY = 0,
- r
- }),
- define("gui/ToggleButtonBitmapRenderer", ["require", "gui/ComponentRenderer", "gui/BitmapButtonRenderer", "gui/Button"],
- function(e) {
- var t = e("gui/ComponentRenderer"),
- n = e("gui/BitmapButtonRenderer"),
- r = e("gui/Button"),
- i = function() {
- this._bitmaps = {}
- },
- s = i.prototype = new n;
- return s.getBitmaps = function() {},
- s.setBitmaps = function() {},
- s._getBitmapForState = function(e) {
- var t = r.stateFlags,
- n = this._flagBitmaps,
- i = "idle";
- e & t.pressed ? i = "pressed": e & t.hover && (i = "hover");
- var s = e & t.enabled ? n.enabled: n.disabled;
- s || (s = n["default"]);
- var o = this.getOwner().getSelected() ? "selected": "idle",
- u = s[o];
- u || (u = n["default"]);
- var a = u[i];
- return a || (a = n["default"][o][i]),
- a || (a = n["default"][o].idle),
- a
- },
- s._bitmaps = null,
- s._selected = !1,
- i
- }),
- define("gui/BitmapButton", ["require", "gui/Button", "gui/BitmapButtonRenderer"],
- function(e) {
- var t = e("gui/Button"),
- n = e("gui/BitmapButtonRenderer"),
- r = function() {};
- r.createButton = function(e) {
- var r = new t;
- r.x = e.x || 0,
- r.y = e.y || 0;
- var i = new n;
- return i.setFlagBitmaps(e.flags || {}),
- i.setAnchors(e.anchorX || 0, e.anchorY || 0),
- r.setRenderer(i),
- r
- };
- var i = r.prototype;
- return r
- }),
- define("gui/popUpUtils", {
- show: function(e, t) {
- e && e.addChild && e.addChild(t)
- },
- hide: function(e) {
- e && e.parent && e.parent.removeChild && e.parent.removeChild(e)
- }
- }),
- define("ScaleUtils", ["require"],
- function(e) {
- return {
- fit: function(e, t, n, r) {
- var i = r / n,
- s = t / e,
- o = i > s ? n / e: r / t;
- return {
- width: e * o,
- height: t * o
- }
- },
- fill: function(e, t, n, r) {
- var i = r / n,
- s = t / e,
- o = i < s ? n / e: r / t;
- return {
- width: e * o,
- height: t * o
- }
- },
- fillX: function(e, t, n, r) {
- var i = r / n,
- s = t / e,
- o = n / e;
- return {
- width: e * o,
- height: t * o
- }
- },
- fillY: function(e, t, n, r) {
- var i = r / n,
- s = t / e,
- o = r / t;
- return {
- width: e * o,
- height: t * o
- }
- }
- }
- }),
- define("screenSize", ["require", "ScaleUtils"],
- function(e) {
- var t = e("ScaleUtils");
- return {
- baseWidth: undefined,
- baseHeight: undefined,
- width: undefined,
- height: undefined,
- maxWidth: undefined,
- maxHeight: undefined,
- getRatio: function() {
- return this.width / this.height
- },
- setUp: function(e, n, r, i) {
- this.maxWidth = r,
- this.maxHeight = i,
- this.baseWidth = e,
- this.baseHeight = n;
- var s = window.innerWidth,
- o = window.innerHeight,
- u = t.fit(this.baseWidth, this.baseHeight, s, o),
- a = u.width / this.baseWidth;
- this.width = Math.floor(s / a),
- this.height = Math.floor(o / a),
- this.width > r && (this.width = r),
- this.height > i && (this.height = i)
- },
- resize: function() {}
- }
- }),
- define("screens/InfoPopUp", ["require", "gui/popUpUtils", "cjs", "assetStorage", "screenSize"],
- function(e) {
- var t = e("gui/popUpUtils"),
- n = e("cjs"),
- r = e("assetStorage"),
- i = e("screenSize"),
- s = function() {
- this.initialize(),
- this.create()
- },
- o = s.prototype = new n.Container;
- return o.create = function() {
-
-
- return;
- },
- o.show = function(e) {
- t.show(e, this)
- },
- o.hide = function() {
- t.hide(this)
- },
- s
- }),
- this.createjs = this.createjs || {},
- function() {
- var e = createjs.SoundJS = createjs.SoundJS || {};
- e.version = "0.5.2",
- e.buildDate = "Thu, 12 Dec 2013 23:33:37 GMT"
- } (),
- this.createjs = this.createjs || {},
- function() {
- var e = function() {},
- t = e.prototype;
- e.initialize = function(e) {
- e.addEventListener = t.addEventListener,
- e.on = t.on,
- e.removeEventListener = e.off = t.removeEventListener,
- e.removeAllEventListeners = t.removeAllEventListeners,
- e.hasEventListener = t.hasEventListener,
- e.dispatchEvent = t.dispatchEvent,
- e._dispatchEvent = t._dispatchEvent,
- e.willTrigger = t.willTrigger
- },
- t._listeners = null,
- t._captureListeners = null,
- t.initialize = function() {},
- t.addEventListener = function(e, t, n) {
- var r;
- r = n ? this._captureListeners = this._captureListeners || {}: this._listeners = this._listeners || {};
- var i = r[e];
- return i && this.removeEventListener(e, t, n),
- i = r[e],
- i ? i.push(t) : r[e] = [t],
- t
- },
- t.on = function(e, t, n, r, i, s) {
- return t.handleEvent && (n = n || t, t = t.handleEvent),
- n = n || this,
- this.addEventListener(e,
- function(e) {
- t.call(n, e, i),
- r && e.remove()
- },
- s)
- },
- t.removeEventListener = function(e, t, n) {
- var r = n ? this._captureListeners: this._listeners;
- if (r) {
- var i = r[e];
- if (i) for (var s = 0,
- o = i.length; o > s; s++) if (i[s] == t) {
- 1 == o ? delete r[e] : i.splice(s, 1);
- break
- }
- }
- },
- t.off = t.removeEventListener,
- t.removeAllEventListeners = function(e) {
- e ? (this._listeners && delete this._listeners[e], this._captureListeners && delete this._captureListeners[e]) : this._listeners = this._captureListeners = null
- },
- t.dispatchEvent = function(e, t) {
- if ("string" == typeof e) {
- var n = this._listeners;
- if (!n || !n[e]) return ! 1;
- e = new createjs.Event(e)
- }
- if (e.target = t || this, e.bubbles && this.parent) {
- for (var r = this,
- i = [r]; r.parent;) i.push(r = r.parent);
- var s, o = i.length;
- for (s = o - 1; s >= 0 && !e.propagationStopped; s--) i[s]._dispatchEvent(e, 1 + (0 == s));
- for (s = 1; o > s && !e.propagationStopped; s++) i[s]._dispatchEvent(e, 3)
- } else this._dispatchEvent(e, 2);
- return e.defaultPrevented
- },
- t.hasEventListener = function(e) {
- var t = this._listeners,
- n = this._captureListeners;
- return !! (t && t[e] || n && n[e])
- },
- t.willTrigger = function(e) {
- for (var t = this; t;) {
- if (t.hasEventListener(e)) return ! 0;
- t = t.parent
- }
- return ! 1
- },
- t.toString = function() {
- return "[EventDispatcher]"
- },
- t._dispatchEvent = function(e, t) {
- var n, r = 1 == t ? this._captureListeners: this._listeners;
- if (e && r) {
- var i = r[e.type];
- if (!i || !(n = i.length)) return;
- e.currentTarget = this,
- e.eventPhase = t,
- e.removed = !1,
- i = i.slice();
- for (var s = 0; n > s && !e.immediatePropagationStopped; s++) {
- var o = i[s];
- o.handleEvent ? o.handleEvent(e) : o(e),
- e.removed && (this.off(e.type, o, 1 == t), e.removed = !1)
- }
- }
- },
- createjs.EventDispatcher = e
- } (),
- this.createjs = this.createjs || {},
- function() {
- var e = function(e, t, n) {
- this.initialize(e, t, n)
- },
- t = e.prototype;
- t.type = null,
- t.target = null,
- t.currentTarget = null,
- t.eventPhase = 0,
- t.bubbles = !1,
- t.cancelable = !1,
- t.timeStamp = 0,
- t.defaultPrevented = !1,
- t.propagationStopped = !1,
- t.immediatePropagationStopped = !1,
- t.removed = !1,
- t.initialize = function(e, t, n) {
- this.type = e,
- this.bubbles = t,
- this.cancelable = n,
- this.timeStamp = (new Date).getTime()
- },
- t.preventDefault = function() {
- this.defaultPrevented = !0
- },
- t.stopPropagation = function() {
- this.propagationStopped = !0
- },
- t.stopImmediatePropagation = function() {
- this.immediatePropagationStopped = this.propagationStopped = !0
- },
- t.remove = function() {
- this.removed = !0
- },
- t.clone = function() {
- return new e(this.type, this.bubbles, this.cancelable)
- },
- t.toString = function() {
- return "[Event (type=" + this.type + ")]"
- },
- createjs.Event = e
- } (),
- this.createjs = this.createjs || {},
- function() {
- createjs.indexOf = function(e, t) {
- for (var n = 0,
- r = e.length; r > n; n++) if (t === e[n]) return n;
- return - 1
- }
- } (),
- this.createjs = this.createjs || {},
- function() {
- createjs.proxy = function(e, t) {
- var n = Array.prototype.slice.call(arguments, 2);
- return function() {
- return e.apply(t, Array.prototype.slice.call(arguments, 0).concat(n))
- }
- }
- } (),
- this.createjs = this.createjs || {},
- function() {
- function e() {
- throw "Sound cannot be instantiated"
- }
- function t(e, t) {
- this.init(e, t)
- }
- function n() {
- this.isDefault = !0,
- this.addEventListener = this.removeEventListener = this.removeAllEventListeners = this.dispatchEvent = this.hasEventListener = this._listeners = this._interrupt = this._playFailed = this.pause = this.resume = this.play = this._beginPlaying = this._cleanUp = this.stop = this.setMasterVolume = this.setVolume = this.mute = this.setMute = this.getMute = this.setPan = this.getPosition = this.setPosition = this.playFailed = function() {
- return ! 1
- },
- this.getVolume = this.getPan = this.getDuration = function() {
- return 0
- },
- this.playState = e.PLAY_FAILED,
- this.toString = function() {
- return "[Sound Default Sound Instance]"
- }
- }
- function r() {}
- var i = e;
- i.DELIMITER = "|",
- i.INTERRUPT_ANY = "any",
- i.INTERRUPT_EARLY = "early",
- i.INTERRUPT_LATE = "late",
- i.INTERRUPT_NONE = "none",
- i.PLAY_INITED = "playInited",
- i.PLAY_SUCCEEDED = "playSucceeded",
- i.PLAY_INTERRUPTED = "playInterrupted",
- i.PLAY_FINISHED = "playFinished",
- i.PLAY_FAILED = "playFailed",
- i.SUPPORTED_EXTENSIONS = ["mp3", "ogg", "mpeg", "wav", "m4a", "mp4", "aiff", "wma", "mid"],
- i.EXTENSION_MAP = {
- m4a: "mp4"
- },
- i.FILE_PATTERN=/^(?:(\w+:)\/{2}(\w+(?:\.\w+)*\/?))?([/.]*?(?:[^?]+)?\/)?((?:[^/?]+)\.(\w+))(?:\?(\S+)?)?$/,i.defaultInterruptBehavior = i.INTERRUPT_NONE, i.alternateExtensions = [], i._lastID = 0, i.activePlugin = null, i._pluginsRegistered = !1, i._masterVolume = 1, i._masterMute = !1, i._instances = [], i._idHash = {},
- i._preloadHash = {},
- i._defaultSoundInstance = null, i.addEventListener = null, i.removeEventListener = null, i.removeAllEventListeners = null, i.dispatchEvent = null, i.hasEventListener = null, i._listeners = null, createjs.EventDispatcher.initialize(i), i._sendFileLoadEvent = function(e) {
- if (i._preloadHash[e]) for (var t = 0,
- n = i._preloadHash[e].length; n > t; t++) {
- var r = i._preloadHash[e][t];
- if (i._preloadHash[e][t] = !0, i.hasEventListener("fileload")) {
- var s = new createjs.Event("fileload");
- s.src = r.src,
- s.id = r.id,
- s.data = r.data,
- i.dispatchEvent(s)
- }
- }
- },
- i.getPreloadHandlers = function() {
- return {
- callback: createjs.proxy(i.initLoad, i),
- types: ["sound"],
- extensions: i.SUPPORTED_EXTENSIONS
- }
- },
- i.registerPlugin = function(e) {
- try {
- console.log("createjs.Sound.registerPlugin has been deprecated. Please use registerPlugins.")
- } catch(t) {}
- return i._registerPlugin(e)
- },
- i._registerPlugin = function(e) {
- return i._pluginsRegistered = !0,
- null == e ? !1 : e.isSupported() ? (i.activePlugin = new e, !0) : !1
- },
- i.registerPlugins = function(e) {
- for (var t = 0,
- n = e.length; n > t; t++) {
- var r = e[t];
- if (i._registerPlugin(r)) return ! 0
- }
- return ! 1
- },
- i.initializeDefaultPlugins = function() {
- return null != i.activePlugin ? !0 : i._pluginsRegistered ? !1 : i.registerPlugins([createjs.WebAudioPlugin, createjs.HTMLAudioPlugin]) ? !0 : !1
- },
- i.isReady = function() {
- return null != i.activePlugin
- },
- i.getCapabilities = function() {
- return null == i.activePlugin ? null: i.activePlugin._capabilities
- },
- i.getCapability = function(e) {
- return null == i.activePlugin ? null: i.activePlugin._capabilities[e]
- },
- i.initLoad = function(e, t, n, r, s) {
- e = e.replace(s, "");
- var o = i.registerSound(e, n, r, !1, s);
- return null == o ? !1 : o
- },
- i.registerSound = function(e, n, r, s, o) {
- if (!i.initializeDefaultPlugins()) return ! 1;
- if (e instanceof Object && (o = n, n = e.id, r = e.data, e = e.src), i.alternateExtensions.length) var u = i._parsePath2(e, "sound", n, r);
- else var u = i._parsePath(e, "sound", n, r);
- if (null == u) return ! 1;
- null != o && (e = o + e, u.src = o + u.src),
- null != n && (i._idHash[n] = u.src);
- var a = null;
- null != r && (isNaN(r.channels) ? isNaN(r) || (a = parseInt(r)) : a = parseInt(r.channels));
- var f = i.activePlugin.register(u.src, a);
- if (null != f && (null != f.numChannels && (a = f.numChannels), t.create(u.src, a), null != r && isNaN(r) ? r.channels = u.data.channels = a || t.maxPerChannel() : r = u.data = a || t.maxPerChannel(), null != f.tag ? u.tag = f.tag: f.src && (u.src = f.src), null != f.completeHandler && (u.completeHandler = f.completeHandler), f.type && (u.type = f.type)), 0 != s) if (i._preloadHash[u.src] || (i._preloadHash[u.src] = []), i._preloadHash[u.src].push({
- src: e,
- id: n,
- data: r
- }), 1 == i._preloadHash[u.src].length) i.activePlugin.preload(u.src, f);
- else if (1 == i._preloadHash[u.src][0]) return ! 0;
- return u
- },
- i.registerManifest = function(e, t) {
- for (var n = [], r = 0, i = e.length; i > r; r++) n[r] = createjs.Sound.registerSound(e[r].src, e[r].id, e[r].data, e[r].preload, t);
- return n
- },
- i.removeSound = function(e, n) {
- if (null == i.activePlugin) return ! 1;
- if (e instanceof Object && (e = e.src), e = i._getSrcById(e), i.alternateExtensions.length) var r = i._parsePath2(e);
- else var r = i._parsePath(e);
- if (null == r) return ! 1;
- null != n && (r.src = n + r.src),
- e = r.src;
- for (var s in i._idHash) i._idHash[s] == e && delete i._idHash[s];
- return t.removeSrc(e),
- delete i._preloadHash[e],
- i.activePlugin.removeSound(e),
- !0
- },
- i.removeManifest = function(e, t) {
- for (var n = [], r = 0, i = e.length; i > r; r++) n[r] = createjs.Sound.removeSound(e[r].src, t);
- return n
- },
- i.removeAllSounds = function() {
- i._idHash = {},
- i._preloadHash = {},
- t.removeAll(),
- i.activePlugin.removeAllSounds()
- },
- i.loadComplete = function(e) {
- if (i.alternateExtensions.length) var t = i._parsePath2(e, "sound");
- else var t = i._parsePath(e, "sound");
- return e = t ? i._getSrcById(t.src) : i._getSrcById(e),
- 1 == i._preloadHash[e][0]
- },
- i._parsePath = function(e, t, n, r) {
- "string" != typeof e && (e = e.toString());
- var s = e.split(i.DELIMITER);
- if (s.length > 1) try {
- console.log('createjs.Sound.DELIMITER "|" loading approach has been deprecated. Please use the new alternateExtensions property.')
- } catch(o) {}
- for (var u = {
- type: t || "sound",
- id: n,
- data: r
- },
- a = i.getCapabilities(), f = 0, l = s.length; l > f; f++) {
- var c = s[f],
- h = c.match(i.FILE_PATTERN);
- if (null == h) return ! 1;
- var p = h[4],
- d = h[5];
- if (a[d] && createjs.indexOf(i.SUPPORTED_EXTENSIONS, d) > -1) return u.name = p,
- u.src = c,
- u.extension = d,
- u
- }
- return null
- },
- i._parsePath2 = function(e, t, n, r) {
- "string" != typeof e && (e = e.toString());
- var s = e.match(i.FILE_PATTERN);
- if (null == s) return ! 1;
- for (var o = s[4], u = s[5], a = i.getCapabilities(), f = 0; ! a[u];) if (u = i.alternateExtensions[f++], f > i.alternateExtensions.length) return null;
- e = e.replace("." + s[5], "." + u);
- var l = {
- type: t || "sound",
- id: n,
- data: r
- };
- return l.name = o,
- l.src = e,
- l.extension = u,
- l
- },
- i.play = function(e, t, n, r, s, o, u) {
- var a = i.createInstance(e),
- f = i._playInstance(a, t, n, r, s, o, u);
- return f || a.playFailed(),
- a
- },
- i.createInstance = function(n) {
- if (!i.initializeDefaultPlugins()) return i._defaultSoundInstance;
- if (n = i._getSrcById(n), i.alternateExtensions.length) var r = i._parsePath2(n, "sound");
- else var r = i._parsePath(n, "sound");
- var s = null;
- return null != r && null != r.src ? (t.create(r.src), s = i.activePlugin.create(r.src)) : s = e._defaultSoundInstance,
- s.uniqueId = i._lastID++,
- s
- },
- i.setVolume = function(e) {
- if (null == Number(e)) return ! 1;
- if (e = Math.max(0, Math.min(1, e)), i._masterVolume = e, !this.activePlugin || !this.activePlugin.setVolume || !this.activePlugin.setVolume(e)) for (var t = this._instances,
- n = 0,
- r = t.length; r > n; n++) t[n].setMasterVolume(e)
- },
- i.getVolume = function() {
- return i._masterVolume
- },
- i.setMute = function(e) {
- if (null == e || void 0 == e) return ! 1;
- if (this._masterMute = e, !this.activePlugin || !this.activePlugin.setMute || !this.activePlugin.setMute(e)) for (var t = this._instances,
- n = 0,
- r = t.length; r > n; n++) t[n].setMasterMute(e);
- return ! 0
- },
- i.getMute = function() {
- return this._masterMute
- },
- i.stop = function() {
- for (var e = this._instances,
- t = e.length; t--;) e[t].stop()
- },
- i._playInstance = function(e, t, n, r, s, o, u) {
- if (t instanceof Object && (n = t.delay, r = t.offset, s = t.loop, o = t.volume, u = t.pan, t = t.interrupt), t = t || i.defaultInterruptBehavior, null == n && (n = 0), null == r && (r = e.getPosition()), null == s && (s = 0), null == o && (o = e.volume), null == u && (u = e.pan), 0 == n) {
- var a = i._beginPlaying(e, t, r, s, o, u);
- if (!a) return ! 1
- } else {
- var f = setTimeout(function() {
- i._beginPlaying(e, t, r, s, o, u)
- },
- n);
- e._delayTimeoutId = f
- }
- return this._instances.push(e),
- !0
- },
- i._beginPlaying = function(e, n, r, i, s, o) {
- if (!t.add(e, n)) return ! 1;
- var u = e._beginPlaying(r, i, s, o);
- if (!u) {
- var a = createjs.indexOf(this._instances, e);
- return a > -1 && this._instances.splice(a, 1),
- !1
- }
- return ! 0
- },
- i._getSrcById = function(e) {
- return null == i._idHash || null == i._idHash[e] ? e: i._idHash[e]
- },
- i._playFinished = function(e) {
- t.remove(e);
- var n = createjs.indexOf(this._instances, e);
- n > -1 && this._instances.splice(n, 1)
- },
- createjs.Sound = e, t.channels = {},
- t.create = function(e, n) {
- var r = t.get(e);
- return null == r ? (t.channels[e] = new t(e, n), !0) : !1
- },
- t.removeSrc = function(e) {
- var n = t.get(e);
- return null == n ? !1 : (n.removeAll(), delete t.channels[e], !0)
- },
- t.removeAll = function() {
- for (var e in t.channels) t.channels[e].removeAll();
- t.channels = {}
- },
- t.add = function(e, n) {
- var r = t.get(e.src);
- return null == r ? !1 : r.add(e, n)
- },
- t.remove = function(e) {
- var n = t.get(e.src);
- return null == n ? !1 : (n.remove(e), !0)
- },
- t.maxPerChannel = function() {
- return s.maxDefault
- },
- t.get = function(e) {
- return t.channels[e]
- };
- var s = t.prototype; s.src = null, s.max = null, s.maxDefault = 100, s.length = 0, s.init = function(e, t) {
- this.src = e,
- this.max = t || this.maxDefault,
- -1 == this.max && (this.max = this.maxDefault),
- this._instances = []
- },
- s.get = function(e) {
- return this._instances[e]
- },
- s.add = function(e, t) {
- return this.getSlot(t, e) ? (this._instances.push(e), this.length++, !0) : !1
- },
- s.remove = function(e) {
- var t = createjs.indexOf(this._instances, e);
- return - 1 == t ? !1 : (this._instances.splice(t, 1), this.length--, !0)
- },
- s.removeAll = function() {
- for (var e = this.length - 1; e >= 0; e--) this._instances[e].stop()
- },
- s.getSlot = function(t) {
- for (var n, r, i = 0,
- s = this.max; s > i; i++) {
- if (n = this.get(i), null == n) return ! 0; (t != e.INTERRUPT_NONE || n.playState == e.PLAY_FINISHED) && (0 != i ? n.playState == e.PLAY_FINISHED || n.playState == e.PLAY_INTERRUPTED || n.playState == e.PLAY_FAILED ? r = n: (t == e.INTERRUPT_EARLY && n.getPosition() < r.getPosition() || t == e.INTERRUPT_LATE && n.getPosition() > r.getPosition()) && (r = n) : r = n)
- }
- return null != r ? (r._interrupt(), this.remove(r), !0) : !1
- },
- s.toString = function() {
- return "[Sound SoundChannel]"
- },
- e._defaultSoundInstance = new n, r.init = function() {
- var e = window.navigator.userAgent;
- r.isFirefox = e.indexOf("Firefox") > -1,
- r.isOpera = null != window.opera,
- r.isChrome = e.indexOf("Chrome") > -1,
- r.isIOS = e.indexOf("iPod") > -1 || e.indexOf("iPhone") > -1 || e.indexOf("iPad") > -1,
- r.isAndroid = e.indexOf("Android") > -1,
- r.isBlackberry = e.indexOf("Blackberry") > -1
- },
- r.init(), createjs.Sound.BrowserDetect = r
- } (), this.createjs = this.createjs || {},
- function() {
- function e() {
- this._init()
- }
- var t = e;
- t._capabilities = null,
- t.isSupported = function() {
- var e = createjs.Sound.BrowserDetect.isIOS || createjs.Sound.BrowserDetect.isAndroid || createjs.Sound.BrowserDetect.isBlackberry;
- return "file:" != location.protocol || e || this._isFileXHRSupported() ? (t._generateCapabilities(), null == t.context ? !1 : !0) : !1
- },
- t._isFileXHRSupported = function() {
- var e = !0,
- t = new XMLHttpRequest;
- try {
- t.open("GET", "fail.fail", !1)
- } catch(n) {
- return e = !1
- }
- t.onerror = function() {
- e = !1
- },
- t.onload = function() {
- e = 404 == this.status || 200 == this.status || 0 == this.status && "" != this.response
- };
- try {
- t.send()
- } catch(n) {
- e = !1
- }
- return e
- },
- t._generateCapabilities = function() {
- if (null == t._capabilities) {
- var e = document.createElement("audio");
- if (null == e.canPlayType) return null;
- if (window.webkitAudioContext) t.context = new webkitAudioContext;
- else {
- if (!window.AudioContext) return null;
- t.context = new AudioContext
- }
- t._compatibilitySetUp(),
- t.playEmptySound(),
- t._capabilities = {
- panning: !0,
- volume: !0,
- tracks: -1
- };
- for (var n = createjs.Sound.SUPPORTED_EXTENSIONS,
- r = createjs.Sound.EXTENSION_MAP,
- i = 0,
- s = n.length; s > i; i++) {
- var o = n[i],
- u = r[o] || o;
- t._capabilities[o] = "no" != e.canPlayType("audio/" + o) && "" != e.canPlayType("audio/" + o) || "no" != e.canPlayType("audio/" + u) && "" != e.canPlayType("audio/" + u)
- }
- t.context.destination.numberOfChannels < 2 && (t._capabilities.panning = !1),
- t.dynamicsCompressorNode = t.context.createDynamicsCompressor(),
- t.dynamicsCompressorNode.connect(t.context.destination),
- t.gainNode = t.context.createGain(),
- t.gainNode.connect(t.dynamicsCompressorNode)
- }
- },
- t._compatibilitySetUp = function() {
- if (!t.context.createGain) {
- t.context.createGain = t.context.createGainNode;
- var e = t.context.createBufferSource();
- e.__proto__.start = e.__proto__.noteGrainOn,
- e.__proto__.stop = e.__proto__.noteOff,
- this._panningModel = 0
- }
- },
- t.playEmptySound = function() {
- var e = this.context.createBuffer(1, 1, 22050),
- t = this.context.createBufferSource();
- t.buffer = e,
- t.connect(this.context.destination),
- t.start(0, 0, 0)
- };
- var n = e.prototype;
- n._capabilities = null,
- n._volume = 1,
- n.context = null,
- n._panningModel = "equalpower",
- n.dynamicsCompressorNode = null,
- n.gainNode = null,
- n._arrayBuffers = null,
- n._init = function() {
- this._capabilities = t._capabilities,
- this._arrayBuffers = {},
- this.context = t.context,
- this.gainNode = t.gainNode,
- this.dynamicsCompressorNode = t.dynamicsCompressorNode
- },
- n.register = function(e) {
- this._arrayBuffers[e] = !0;
- var t = new createjs.WebAudioPlugin.Loader(e, this);
- return {
- tag: t
- }
- },
- n.isPreloadStarted = function(e) {
- return null != this._arrayBuffers[e]
- },
- n.isPreloadComplete = function(e) {
- return null != this._arrayBuffers[e] && 1 != this._arrayBuffers[e]
- },
- n.removeSound = function(e) {
- delete this._arrayBuffers[e]
- },
- n.removeAllSounds = function() {
- this._arrayBuffers = {}
- },
- n.addPreloadResults = function(e, t) {
- this._arrayBuffers[e] = t
- },
- n._handlePreloadComplete = function() {
- createjs.Sound._sendFileLoadEvent(this.src)
- },
- n.preload = function(e) {
- this._arrayBuffers[e] = !0;
- var t = new createjs.WebAudioPlugin.Loader(e, this);
- t.onload = this._handlePreloadComplete,
- t.load()
- },
- n.create = function(e) {
- return this.isPreloadStarted(e) || this.preload(e),
- new createjs.WebAudioPlugin.SoundInstance(e, this)
- },
- n.setVolume = function(e) {
- return this._volume = e,
- this._updateVolume(),
- !0
- },
- n._updateVolume = function() {
- var e = createjs.Sound._masterMute ? 0 : this._volume;
- e != this.gainNode.gain.value && (this.gainNode.gain.value = e)
- },
- n.getVolume = function() {
- return this._volume
- },
- n.setMute = function() {
- return this._updateVolume(),
- !0
- },
- n.toString = function() {
- return "[WebAudioPlugin]"
- },
- createjs.WebAudioPlugin = e
- } (),
- function() {
- function e(e, t) {
- this._init(e, t)
- }
- var t = e.prototype = new createjs.EventDispatcher;
- t.src = null,
- t.uniqueId = -1,
- t.playState = null,
- t._owner = null,
- t._offset = 0,
- t._delay = 0,
- t._volume = 1;
- try {
- Object.defineProperty(t, "volume", {
- get: function() {
- return this._volume
- },
- set: function(e) {
- return null == Number(e) ? !1 : (e = Math.max(0, Math.min(1, e)), this._volume = e, this._updateVolume(), void 0)
- }
- })
- } catch(n) {}
- t._pan = 0;
- try {
- Object.defineProperty(t, "pan", {
- get: function() {
- return this._pan
- },
- set: function(e) {
- return this._owner._capabilities.panning && null != Number(e) ? (e = Math.max( - 1, Math.min(1, e)), this._pan = e, this.panNode.setPosition(e, 0, -0.5), void 0) : !1
- }
- })
- } catch(n) {}
- t._duration = 0,
- t._remainingLoops = 0,
- t._delayTimeoutId = null,
- t._soundCompleteTimeout = null,
- t.gainNode = null,
- t.panNode = null,
- t.sourceNode = null,
- t._sourceNodeNext = null,
- t._muted = !1,
- t._paused = !1,
- t._startTime = 0,
- t._endedHandler = null,
- t._sendEvent = function(e) {
- var t = new createjs.Event(e);
- this.dispatchEvent(t)
- },
- t._init = function(e, t) {
- this._owner = t,
- this.src = e,
- this.gainNode = this._owner.context.createGain(),
- this.panNode = this._owner.context.createPanner(),
- this.panNode.panningModel = this._owner._panningModel,
- this.panNode.connect(this.gainNode),
- this._owner.isPreloadComplete(this.src) && (this._duration = 1e3 * this._owner._arrayBuffers[this.src].duration),
- this._endedHandler = createjs.proxy(this._handleSoundComplete, this)
- },
- t._cleanUp = function() {
- this.sourceNode && this.playState == createjs.Sound.PLAY_SUCCEEDED && (this.sourceNode = this._cleanUpAudioNode(this.sourceNode), this._sourceNodeNext = this._cleanUpAudioNode(this._sourceNodeNext)),
- 0 != this.gainNode.numberOfOutputs && this.gainNode.disconnect(0),
- clearTimeout(this._delayTimeoutId),
- clearTimeout(this._soundCompleteTimeout),
- this._startTime = 0,
- null != window.createjs && createjs.Sound._playFinished(this)
- },
- t._cleanUpAudioNode = function(e) {
- return e && (e.stop(0), e.disconnect(this.panNode), e = null),
- e
- },
- t._interrupt = function() {
- this._cleanUp(),
- this.playState = createjs.Sound.PLAY_INTERRUPTED,
- this._paused = !1,
- this._sendEvent("interrupted")
- },
- t._handleSoundReady = function() {
- if (null != window.createjs) {
- if (1e3 * this._offset > this.getDuration()) return this.playFailed(),
- void 0;
- this._offset < 0 && (this._offset = 0),
- this.playState = createjs.Sound.PLAY_SUCCEEDED,
- this._paused = !1,
- this.gainNode.connect(this._owner.gainNode);
- var e = this._owner._arrayBuffers[this.src].duration;
- this.sourceNode = this._createAndPlayAudioNode(this._owner.context.currentTime - e, this._offset),
- this._duration = 1e3 * e,
- this._startTime = this.sourceNode.startTime - this._offset,
- this._soundCompleteTimeout = setTimeout(this._endedHandler, 1e3 * (e - this._offset)),
- 0 != this._remainingLoops && (this._sourceNodeNext = this._createAndPlayAudioNode(this._startTime, 0))
- }
- },
- t._createAndPlayAudioNode = function(e, t) {
- var n = this._owner.context.createBufferSource();
- return n.buffer = this._owner._arrayBuffers[this.src],
- n.connect(this.panNode),
- this._owner.context.currentTime,
- n.startTime = e + n.buffer.duration,
- n.start(n.startTime, t, n.buffer.duration - t),
- n
- },
- t.play = function(e, t, n, r, i, s) {
- this._cleanUp(),
- createjs.Sound._playInstance(this, e, t, n, r, i, s)
- },
- t._beginPlaying = function(e, t, n, r) {
- return null != window.createjs && this.src ? (this._offset = e / 1e3, this._remainingLoops = t, this.volume = n, this.pan = r, this._owner.isPreloadComplete(this.src) ? (this._handleSoundReady(null), this._sendEvent("succeeded"), 1) : (this.playFailed(), void 0)) : void 0
- },
- t.pause = function() {
- return this._paused || this.playState != createjs.Sound.PLAY_SUCCEEDED ? !1 : (this._paused = !0, this._offset = this._owner.context.currentTime - this._startTime, this._cleanUpAudioNode(this.sourceNode), this._cleanUpAudioNode(this._sourceNodeNext), 0 != this.gainNode.numberOfOutputs && this.gainNode.disconnect(), clearTimeout(this._delayTimeoutId), clearTimeout(this._soundCompleteTimeout), !0)
- },
- t.resume = function() {
- return this._paused ? (this._handleSoundReady(null), !0) : !1
- },
- t.stop = function() {
- return this._cleanUp(),
- this.playState = createjs.Sound.PLAY_FINISHED,
- this._offset = 0,
- !0
- },
- t.setVolume = function(e) {
- return this.volume = e,
- !0
- },
- t._updateVolume = function() {
- var e = this._muted ? 0 : this._volume;
- return e != this.gainNode.gain.value ? (this.gainNode.gain.value = e, !0) : !1
- },
- t.getVolume = function() {
- return this.volume
- },
- t.setMute = function(e) {
- return null == e || void 0 == e ? !1 : (this._muted = e, this._updateVolume(), !0)
- },
- t.getMute = function() {
- return this._muted
- },
- t.setPan = function(e) {
- return this.pan = e,
- this.pan != e ? !1 : void 0
- },
- t.getPan = function() {
- return this.pan
- },
- t.getPosition = function() {
- if (this._paused || null == this.sourceNode) var e = this._offset;
- else var e = this._owner.context.currentTime - this._startTime;
- return 1e3 * e
- },
- t.setPosition = function(e) {
- return this._offset = e / 1e3,
- this.sourceNode && this.playState == createjs.Sound.PLAY_SUCCEEDED && (this._cleanUpAudioNode(this.sourceNode), this._cleanUpAudioNode(this._sourceNodeNext), clearTimeout(this._soundCompleteTimeout)),
- this._paused || this.playState != createjs.Sound.PLAY_SUCCEEDED || this._handleSoundReady(null),
- !0
- },
- t.getDuration = function() {
- return this._duration
- },
- t._handleSoundComplete = function() {
- return this._offset = 0,
- 0 != this._remainingLoops ? (this._remainingLoops--, this._sourceNodeNext ? (this._cleanUpAudioNode(this.sourceNode), this.sourceNode = this._sourceNodeNext, this._startTime = this.sourceNode.startTime, this._sourceNodeNext = this._createAndPlayAudioNode(this._startTime, 0), this._soundCompleteTimeout = setTimeout(this._endedHandler, this._duration)) : this._handleSoundReady(null), this._sendEvent("loop"), void 0) : (null != window.createjs && (this._cleanUp(), this.playState = createjs.Sound.PLAY_FINISHED, this._sendEvent("complete")), void 0)
- },
- t.playFailed = function() {
- null != window.createjs && (this._cleanUp(), this.playState = createjs.Sound.PLAY_FAILED, this._sendEvent("failed"))
- },
- t.toString = function() {
- return "[WebAudioPlugin SoundInstance]"
- },
- createjs.WebAudioPlugin.SoundInstance = e
- } (),
- function() {
- function e(e, t) {
- this._init(e, t)
- }
- var t = e.prototype;
- t.request = null,
- t.owner = null,
- t.progress = -1,
- t.src = null,
- t.originalSrc = null,
- t.result = null,
- t.onload = null,
- t.onprogress = null,
- t.onError = null,
- t._init = function(e, t) {
- this.src = e,
- this.originalSrc = e,
- this.owner = t
- },
- t.load = function(e) {
- null != e && (this.src = e),
- this.request = new XMLHttpRequest,
- this.request.open("GET", this.src, !0),
- this.request.responseType = "arraybuffer",
- this.request.onload = createjs.proxy(this.handleLoad, this),
- this.request.onError = createjs.proxy(this.handleError, this),
- this.request.onprogress = createjs.proxy(this.handleProgress, this),
- this.request.send()
- },
- t.handleProgress = function(e, t) {
- this.progress = e / t,
- null != this.onprogress && this.onprogress({
- loaded: e,
- total: t,
- progress: this.progress
- })
- },
- t.handleLoad = function() {
- this.owner.context.decodeAudioData(this.request.response, createjs.proxy(this.handleAudioDecoded, this), createjs.proxy(this.handleError, this))
- },
- t.handleAudioDecoded = function(e) {
- this.progress = 1,
- this.result = e,
- this.src = this.originalSrc,
- this.owner.addPreloadResults(this.src, this.result),
- this.onload && this.onload()
- },
- t.handleError = function(e) {
- this.owner.removeSound(this.src),
- this.onerror && this.onerror(e)
- },
- t.toString = function() {
- return "[WebAudioPlugin Loader]"
- },
- createjs.WebAudioPlugin.Loader = e
- } (), this.createjs = this.createjs || {},
- function() {
- function e() {
- this._init()
- }
- var t = e;
- t.MAX_INSTANCES = 30,
- t._AUDIO_READY = "canplaythrough",
- t._AUDIO_ENDED = "ended",
- t._AUDIO_SEEKED = "seeked",
- t._AUDIO_STALLED = "stalled",
- t._capabilities = null,
- t.enableIOS = !1,
- t.isSupported = function() {
- if (createjs.Sound.BrowserDetect.isIOS && !t.enableIOS) return ! 1;
- t._generateCapabilities();
- var e = t.tag;
- return null == e || null == t._capabilities ? !1 : !0
- },
- t._generateCapabilities = function() {
- if (null == t._capabilities) {
- var e = t.tag = document.createElement("audio");
- if (null == e.canPlayType) return null;
- t._capabilities = {
- panning: !0,
- volume: !0,
- tracks: -1
- };
- for (var n = createjs.Sound.SUPPORTED_EXTENSIONS,
- r = createjs.Sound.EXTENSION_MAP,
- i = 0,
- s = n.length; s > i; i++) {
- var o = n[i],
- u = r[o] || o;
- t._capabilities[o] = "no" != e.canPlayType("audio/" + o) && "" != e.canPlayType("audio/" + o) || "no" != e.canPlayType("audio/" + u) && "" != e.canPlayType("audio/" + u)
- }
- }
- };
- var n = e.prototype;
- n._capabilities = null,
- n._audioSources = null,
- n.defaultNumChannels = 2,
- n.loadedHandler = null,
- n._init = function() {
- this._capabilities = t._capabilities,
- this._audioSources = {}
- },
- n.register = function(e, t) {
- this._audioSources[e] = !0;
- for (var n = createjs.HTMLAudioPlugin.TagPool.get(e), r = null, i = t || this.defaultNumChannels, s = 0; i > s; s++) r = this._createTag(e),
- n.add(r);
- if (r.id = e, this.loadedHandler = createjs.proxy(this._handleTagLoad, this), r.addEventListener && r.addEventListener("canplaythrough", this.loadedHandler), null == r.onreadystatechange) r.onreadystatechange = this.loadedHandler;
- else {
- var o = r.onreadystatechange;
- r.onreadystatechange = function() {
- o(),
- this.loadedHandler()
- }
- }
- return {
- tag: r,
- numChannels: i
- }
- },
- n._handleTagLoad = function(e) {
- e.target.removeEventListener && e.target.removeEventListener("canplaythrough", this.loadedHandler),
- e.target.onreadystatechange = null,
- e.target.src != e.target.id && createjs.HTMLAudioPlugin.TagPool.checkSrc(e.target.id)
- },
- n._createTag = function(e) {
- var t = document.createElement("audio");
- return t.autoplay = !1,
- t.preload = "none",
- t.src = e,
- t
- },
- n.removeSound = function(e) {
- delete this._audioSources[e],
- createjs.HTMLAudioPlugin.TagPool.remove(e)
- },
- n.removeAllSounds = function() {
- this._audioSources = {},
- createjs.HTMLAudioPlugin.TagPool.removeAll()
- },
- n.create = function(e) {
- if (!this.isPreloadStarted(e)) {
- var t = createjs.HTMLAudioPlugin.TagPool.get(e),
- n = this._createTag(e);
- n.id = e,
- t.add(n),
- this.preload(e, {
- tag: n
- })
- }
- return new createjs.HTMLAudioPlugin.SoundInstance(e, this)
- },
- n.isPreloadStarted = function(e) {
- return null != this._audioSources[e]
- },
- n.preload = function(e, t) {
- this._audioSources[e] = !0,
- new createjs.HTMLAudioPlugin.Loader(e, t.tag)
- },
- n.toString = function() {
- return "[HTMLAudioPlugin]"
- },
- createjs.HTMLAudioPlugin = e
- } (),
- function() {
- function e(e, t) {
- this._init(e, t)
- }
- var t = e.prototype = new createjs.EventDispatcher;
- t.src = null,
- t.uniqueId = -1,
- t.playState = null,
- t._owner = null,
- t.loaded = !1,
- t._offset = 0,
- t._delay = 0,
- t._volume = 1;
- try {
- Object.defineProperty(t, "volume", {
- get: function() {
- return this._volume
- },
- set: function(e) {
- null != Number(e) && (e = Math.max(0, Math.min(1, e)), this._volume = e, this._updateVolume())
- }
- })
- } catch(n) {}
- t.pan = 0,
- t._duration = 0,
- t._remainingLoops = 0,
- t._delayTimeoutId = null,
- t.tag = null,
- t._muted = !1,
- t._paused = !1,
- t._endedHandler = null,
- t._readyHandler = null,
- t._stalledHandler = null,
- t.loopHandler = null,
- t._init = function(e, t) {
- this.src = e,
- this._owner = t,
- this._endedHandler = createjs.proxy(this._handleSoundComplete, this),
- this._readyHandler = createjs.proxy(this._handleSoundReady, this),
- this._stalledHandler = createjs.proxy(this._handleSoundStalled, this),
- this.loopHandler = createjs.proxy(this.handleSoundLoop, this)
- },
- t._sendEvent = function(e) {
- var t = new createjs.Event(e);
- this.dispatchEvent(t)
- },
- t._cleanUp = function() {
- var e = this.tag;
- if (null != e) {
- e.pause(),
- e.removeEventListener(createjs.HTMLAudioPlugin._AUDIO_ENDED, this._endedHandler, !1),
- e.removeEventListener(createjs.HTMLAudioPlugin._AUDIO_READY, this._readyHandler, !1),
- e.removeEventListener(createjs.HTMLAudioPlugin._AUDIO_SEEKED, this.loopHandler, !1);
- try {
- e.currentTime = 0
- } catch(t) {}
- createjs.HTMLAudioPlugin.TagPool.setInstance(this.src, e),
- this.tag = null
- }
- clearTimeout(this._delayTimeoutId),
- null != window.createjs && createjs.Sound._playFinished(this)
- },
- t._interrupt = function() {
- null != this.tag && (this.playState = createjs.Sound.PLAY_INTERRUPTED, this._cleanUp(), this._paused = !1, this._sendEvent("interrupted"))
- },
- t.play = function(e, t, n, r, i, s) {
- this._cleanUp(),
- createjs.Sound._playInstance(this, e, t, n, r, i, s)
- },
- t._beginPlaying = function(e, t, n, r) {
- if (null == window.createjs) return - 1;
- var i = this.tag = createjs.HTMLAudioPlugin.TagPool.getInstance(this.src);
- return null == i ? (this.playFailed(), -1) : (i.addEventListener(createjs.HTMLAudioPlugin._AUDIO_ENDED, this._endedHandler, !1), this._offset = e, this.volume = n, this.pan = r, this._updateVolume(), this._remainingLoops = t, 4 !== i.readyState ? (i.addEventListener(createjs.HTMLAudioPlugin._AUDIO_READY, this._readyHandler, !1), i.addEventListener(createjs.HTMLAudioPlugin._AUDIO_STALLED, this._stalledHandler, !1), i.preload = "auto", i.load()) : this._handleSoundReady(null), this._sendEvent("succeeded"), 1)
- },
- t._handleSoundStalled = function() {
- this._cleanUp(),
- this._sendEvent("failed")
- },
- t._handleSoundReady = function() {
- if (null != window.createjs) {
- if (this._duration = 1e3 * this.tag.duration, this.playState = createjs.Sound.PLAY_SUCCEEDED, this._paused = !1, this.tag.removeEventListener(createjs.HTMLAudioPlugin._AUDIO_READY, this._readyHandler, !1), this._offset >= this.getDuration()) return this.playFailed(),
- void 0;
- this._offset > 0 && (this.tag.currentTime = .001 * this._offset),
- -1 == this._remainingLoops && (this.tag.loop = !0),
- 0 != this._remainingLoops && (this.tag.addEventListener(createjs.HTMLAudioPlugin._AUDIO_SEEKED, this.loopHandler, !1), this.tag.loop = !0),
- this.tag.play()
- }
- },
- t.pause = function() {
- return this._paused || this.playState != createjs.Sound.PLAY_SUCCEEDED || null == this.tag ? !1 : (this._paused = !0, this.tag.pause(), clearTimeout(this._delayTimeoutId), !0)
- },
- t.resume = function() {
- return this._paused && null != this.tag ? (this._paused = !1, this.tag.play(), !0) : !1
- },
- t.stop = function() {
- return this._offset = 0,
- this.pause(),
- this.playState = createjs.Sound.PLAY_FINISHED,
- this._cleanUp(),
- !0
- },
- t.setMasterVolume = function() {
- return this._updateVolume(),
- !0
- },
- t.setVolume = function(e) {
- return this.volume = e,
- !0
- },
- t._updateVolume = function() {
- if (null != this.tag) {
- var e = this._muted || createjs.Sound._masterMute ? 0 : this._volume * createjs.Sound._masterVolume;
- return e != this.tag.volume && (this.tag.volume = e),
- !0
- }
- return ! 1
- },
- t.getVolume = function() {
- return this.volume
- },
- t.setMasterMute = function() {
- return this._updateVolume(),
- !0
- },
- t.setMute = function(e) {
- return null == e || void 0 == e ? !1 : (this._muted = e, this._updateVolume(), !0)
- },
- t.getMute = function() {
- return this._muted
- },
- t.setPan = function() {
- return ! 1
- },
- t.getPan = function() {
- return 0
- },
- t.getPosition = function() {
- return null == this.tag ? this._offset: 1e3 * this.tag.currentTime
- },
- t.setPosition = function(e) {
- if (null == this.tag) this._offset = e;
- else {
- this.tag.removeEventListener(createjs.HTMLAudioPlugin._AUDIO_SEEKED, this.loopHandler, !1);
- try {
- this.tag.currentTime = .001 * e
- } catch(t) {
- return ! 1
- }
- this.tag.addEventListener(createjs.HTMLAudioPlugin._AUDIO_SEEKED, this.loopHandler, !1)
- }
- return ! 0
- },
- t.getDuration = function() {
- return this._duration
- },
- t._handleSoundComplete = function() {
- this._offset = 0,
- null != window.createjs && (this.playState = createjs.Sound.PLAY_FINISHED, this._cleanUp(), this._sendEvent("complete"))
- },
- t.handleSoundLoop = function() {
- this._offset = 0,
- this._remainingLoops--,
- 0 == this._remainingLoops && (this.tag.loop = !1, this.tag.removeEventListener(createjs.HTMLAudioPlugin._AUDIO_SEEKED, this.loopHandler, !1)),
- this._sendEvent("loop")
- },
- t.playFailed = function() {
- null != window.createjs && (this.playState = createjs.Sound.PLAY_FAILED, this._cleanUp(), this._sendEvent("failed"))
- },
- t.toString = function() {
- return "[HTMLAudioPlugin SoundInstance]"
- },
- createjs.HTMLAudioPlugin.SoundInstance = e
- } (),
- function() {
- function e(e, t) {
- this._init(e, t)
- }
- var t = e.prototype;
- t.src = null,
- t.tag = null,
- t.preloadTimer = null,
- t.loadedHandler = null,
- t._init = function(e, t) {
- if (this.src = e, this.tag = t, this.preloadTimer = setInterval(createjs.proxy(this.preloadTick, this), 200), this.loadedHandler = createjs.proxy(this.sendLoadedEvent, this), this.tag.addEventListener && this.tag.addEventListener("canplaythrough", this.loadedHandler), null == this.tag.onreadystatechange) this.tag.onreadystatechange = createjs.proxy(this.sendLoadedEvent, this);
- else {
- var n = this.tag.onreadystatechange;
- this.tag.onreadystatechange = function() {
- n(),
- this.tag.onreadystatechange = createjs.proxy(this.sendLoadedEvent, this)
- }
- }
- this.tag.preload = "auto",
- this.tag.load()
- },
- t.preloadTick = function() {
- var e = this.tag.buffered,
- t = this.tag.duration;
- e.length > 0 && e.end(0) >= t - 1 && this.handleTagLoaded()
- },
- t.handleTagLoaded = function() {
- clearInterval(this.preloadTimer)
- },
- t.sendLoadedEvent = function() {
- this.tag.removeEventListener && this.tag.removeEventListener("canplaythrough", this.loadedHandler),
- this.tag.onreadystatechange = null,
- createjs.Sound._sendFileLoadEvent(this.src)
- },
- t.toString = function() {
- return "[HTMLAudioPlugin Loader]"
- },
- createjs.HTMLAudioPlugin.Loader = e
- } (),
- function() {
- function e(e) {
- this._init(e)
- }
- var t = e;
- t.tags = {},
- t.get = function(n) {
- var r = t.tags[n];
- return null == r && (r = t.tags[n] = new e(n)),
- r
- },
- t.remove = function(e) {
- var n = t.tags[e];
- return null == n ? !1 : (n.removeAll(), delete t.tags[e], !0)
- },
- t.removeAll = function() {
- for (var e in t.tags) t.tags[e].removeAll();
- t.tags = {}
- },
- t.getInstance = function(e) {
- var n = t.tags[e];
- return null == n ? null: n.get()
- },
- t.setInstance = function(e, n) {
- var r = t.tags[e];
- return null == r ? null: r.set(n)
- },
- t.checkSrc = function(e) {
- var n = t.tags[e];
- return null == n ? null: (n.checkSrcChange(), void 0)
- };
- var n = e.prototype;
- n.src = null,
- n.length = 0,
- n.available = 0,
- n.tags = null,
- n._init = function(e) {
- this.src = e,
- this.tags = []
- },
- n.add = function(e) {
- this.tags.push(e),
- this.length++,
- this.available++
- },
- n.removeAll = function() {
- for (; this.length--;) delete this.tags[this.length];
- this.src = null,
- this.tags.length = 0
- },
- n.get = function() {
- if (0 == this.tags.length) return null;
- this.available = this.tags.length;
- var e = this.tags.pop();
- return null == e.parentNode && document.body.appendChild(e),
- e
- },
- n.set = function(e) {
- var t = createjs.indexOf(this.tags, e); - 1 == t && this.tags.push(e),
- this.available = this.tags.length
- },
- n.checkSrcChange = function() {
- for (var e = this.tags.length - 1,
- t = this.tags[e].src; e--;) this.tags[e].src = t
- },
- n.toString = function() {
- return "[HTMLAudioPlugin TagPool]"
- },
- createjs.HTMLAudioPlugin.TagPool = e
- } (), define("soundjs",
- function(e) {
- return function() {
- var t, n;
- return t || e.createjs
- }
- } (this)), define("Sound+MuteDispatcher", ["soundjs"],
- function(e) {
- var t = e.Sound.setMute;
- e.Sound.setMute = function(n) {
- this.getMute() != n && (t.call(this, n), this.dispatchEvent(new e.Event("mute")))
- }
- }), define("screens/MainMenuScreen", ["require", "Screen", "assetStorage", "gui/ToggleButton", "gui/Button", "gui/ToggleButtonBitmapRenderer", "gui/BitmapButton", "screens/InfoPopUp", "Sound+MuteDispatcher", "soundjs", "screenSize"],
- function(e) {
- var t = e("Screen"),
- n = e("assetStorage"),
- r = e("gui/ToggleButton"),
- i = e("gui/Button"),
- s = e("gui/ToggleButtonBitmapRenderer"),
- o = e("gui/BitmapButton"),
- u = e("screens/InfoPopUp"),
- a = e("Sound+MuteDispatcher"),
- f = e("soundjs"),
- l = e("screenSize"),
- c = function() {
- this.init()
- },
- h = c.prototype = new t;
- return h._build = function() {
- var e = n.getBitmap("gfx/bigPlayButton.png"),
- t = o.createButton({
- x: l.width / 2,
- y: l.height / 2,
- anchorX: .5,
- anchorY: .5,
- flags: {
- "default": {
- active: e
- }
- }
- });
- t.on("click",
- function() {
- this.getScreenController().goToScreen("gameScreen")
- },
- this),
- this.addChild(t);
- var i = n.getBitmap("gfx/logo.png");
- i.x = (l.width - i.getBounds().width) / 2,
- i.y = (t.y - i.getBounds().height - 60) / 2,
- i.mouseEnabled = !1,
- this.addChild(i);
- var u = o.createButton({
- x: t.x + 125,
- y: t.y + 150,
- anchorX: .5,
- anchorY: .5,
- flags: {
- "default": {
- active: n.getBitmap("gfx/infoButton.png")
- }
- }
- });
- this.addChild(u),
- u.on("click",
- function(e) {
- this._showInfoPopUp()
- },
- this);
- var a = new s;
- a.setFlagBitmaps({
- "default": {
- idle: {
- idle: n.getBitmap("gfx/muteButton.png")
- },
- selected: {
- idle: n.getBitmap("gfx/unmuteButton.png")
- }
- }
- }),
- a.setAnchors(.5, .5);
- var c = new r;
- c.setRenderer(a),
- c.x = t.x - 125,
- c.y = t.y + 150,
- c.setSelected(f.Sound.getMute()),
- c.on("change",
- function(e) {
- f.Sound.setMute(c.getSelected())
- }),
- this.addChild(c)
- },
- h._showInfoPopUp = function() {
- if (this._infoPopUp) return;
- var e = new u;
- e.show(this);
- var t = e.on("click",
- function(e) {
- this._infoPopUp.hide(),
- this._infoPopUp.off("click", t),
- this._infoPopUp = null
- },
- this);
- this._infoPopUp = e
- },
- h._infoPopUp = null,
- c
- }), this.createjs = this.createjs || {},
- function() {
- var e = function(e, t, n) {
- this.initialize(e, t, n)
- },
- t = e.prototype;
- t.type = null,
- t.target = null,
- t.currentTarget = null,
- t.eventPhase = 0,
- t.bubbles = !1,
- t.cancelable = !1,
- t.timeStamp = 0,
- t.defaultPrevented = !1,
- t.propagationStopped = !1,
- t.immediatePropagationStopped = !1,
- t.removed = !1,
- t.initialize = function(e, t, n) {
- this.type = e,
- this.bubbles = t,
- this.cancelable = n,
- this.timeStamp = (new Date).getTime()
- },
- t.preventDefault = function() {
- this.defaultPrevented = !0
- },
- t.stopPropagation = function() {
- this.propagationStopped = !0
- },
- t.stopImmediatePropagation = function() {
- this.immediatePropagationStopped = this.propagationStopped = !0
- },
- t.remove = function() {
- this.removed = !0
- },
- t.clone = function() {
- return new e(this.type, this.bubbles, this.cancelable)
- },
- t.toString = function() {
- return "[Event (type=" + this.type + ")]"
- },
- createjs.Event = e
- } (), this.createjs = this.createjs || {},
- function() {
- var e = function() {},
- t = e.prototype;
- e.initialize = function(e) {
- e.addEventListener = t.addEventListener,
- e.on = t.on,
- e.removeEventListener = e.off = t.removeEventListener,
- e.removeAllEventListeners = t.removeAllEventListeners,
- e.hasEventListener = t.hasEventListener,
- e.dispatchEvent = t.dispatchEvent,
- e._dispatchEvent = t._dispatchEvent,
- e.willTrigger = t.willTrigger
- },
- t._listeners = null,
- t._captureListeners = null,
- t.initialize = function() {},
- t.addEventListener = function(e, t, n) {
- var r;
- r = n ? this._captureListeners = this._captureListeners || {}: this._listeners = this._listeners || {};
- var i = r[e];
- return i && this.removeEventListener(e, t, n),
- i = r[e],
- i ? i.push(t) : r[e] = [t],
- t
- },
- t.on = function(e, t, n, r, i, s) {
- return t.handleEvent && (n = n || t, t = t.handleEvent),
- n = n || this,
- this.addEventListener(e,
- function(e) {
- t.call(n, e, i),
- r && e.remove()
- },
- s)
- },
- t.removeEventListener = function(e, t, n) {
- var r = n ? this._captureListeners: this._listeners;
- if (r) {
- var i = r[e];
- if (i) for (var s = 0,
- o = i.length; o > s; s++) if (i[s] == t) {
- 1 == o ? delete r[e] : i.splice(s, 1);
- break
- }
- }
- },
- t.off = t.removeEventListener,
- t.removeAllEventListeners = function(e) {
- e ? (this._listeners && delete this._listeners[e], this._captureListeners && delete this._captureListeners[e]) : this._listeners = this._captureListeners = null
- },
- t.dispatchEvent = function(e, t) {
- if ("string" == typeof e) {
- var n = this._listeners;
- if (!n || !n[e]) return ! 1;
- e = new createjs.Event(e)
- }
- if (e.target = t || this, e.bubbles && this.parent) {
- for (var r = this,
- i = [r]; r.parent;) i.push(r = r.parent);
- var s, o = i.length;
- for (s = o - 1; s >= 0 && !e.propagationStopped; s--) i[s]._dispatchEvent(e, 1 + (0 == s));
- for (s = 1; o > s && !e.propagationStopped; s++) i[s]._dispatchEvent(e, 3)
- } else this._dispatchEvent(e, 2);
- return e.defaultPrevented
- },
- t.hasEventListener = function(e) {
- var t = this._listeners,
- n = this._captureListeners;
- return !! (t && t[e] || n && n[e])
- },
- t.willTrigger = function(e) {
- for (var t = this; t;) {
- if (t.hasEventListener(e)) return ! 0;
- t = t.parent
- }
- return ! 1
- },
- t.toString = function() {
- return "[EventDispatcher]"
- },
- t._dispatchEvent = function(e, t) {
- var n, r = 1 == t ? this._captureListeners: this._listeners;
- if (e && r) {
- var i = r[e.type];
- if (!i || !(n = i.length)) return;
- e.currentTarget = this,
- e.eventPhase = t,
- e.removed = !1,
- i = i.slice();
- for (var s = 0; n > s && !e.immediatePropagationStopped; s++) {
- var o = i[s];
- o.handleEvent ? o.handleEvent(e) : o(e),
- e.removed && (this.off(e.type, o, 1 == t), e.removed = !1)
- }
- }
- },
- createjs.EventDispatcher = e
- } (), this.createjs = this.createjs || {},
- function() {
- var e = function(e, t, n) {
- this.initialize(e, t, n)
- },
- t = e.prototype = new createjs.EventDispatcher;
- e.NONE = 0,
- e.LOOP = 1,
- e.REVERSE = 2,
- e.IGNORE = {},
- e._tweens = [],
- e._plugins = {},
- e.get = function(t, n, r, i) {
- return i && e.removeTweens(t),
- new e(t, n, r)
- },
- e.tick = function(t, n) {
- for (var r = e._tweens.slice(), i = r.length - 1; i >= 0; i--) {
- var s = r[i];
- n && !s.ignoreGlobalPause || s._paused || s.tick(s._useTicks ? 1 : t)
- }
- },
- e.handleEvent = function(e) {
- "tick" == e.type && this.tick(e.delta, e.paused)
- },
- e.removeTweens = function(t) {
- if (t.tweenjs_count) {
- for (var n = e._tweens,
- r = n.length - 1; r >= 0; r--) n[r]._target == t && (n[r]._paused = !0, n.splice(r, 1));
- t.tweenjs_count = 0
- }
- },
- e.removeAllTweens = function() {
- for (var t = e._tweens,
- n = 0,
- r = t.length; r > n; n++) {
- var i = t[n];
- i.paused = !0,
- i.target.tweenjs_count = 0
- }
- t.length = 0
- },
- e.hasActiveTweens = function(t) {
- return t ? t.tweenjs_count: e._tweens && !!e._tweens.length
- },
- e.installPlugin = function(t, n) {
- var r = t.priority;
- null == r && (t.priority = r = 0);
- for (var i = 0,
- s = n.length,
- o = e._plugins; s > i; i++) {
- var u = n[i];
- if (o[u]) {
- for (var f = o[u], l = 0, c = f.length; c > l && !(r < f[l].priority); l++);
- o[u].splice(l, 0, t)
- } else o[u] = [t]
- }
- },
- e._register = function(t, n) {
- var r = t._target,
- i = e._tweens;
- if (n) r && (r.tweenjs_count = r.tweenjs_count ? r.tweenjs_count + 1 : 1),
- i.push(t),
- !e._inited && createjs.Ticker && (createjs.Ticker.addEventListener("tick", e), e._inited = !0);
- else {
- r && r.tweenjs_count--;
- for (var s = i.length; s--;) if (i[s] == t) return i.splice(s, 1),
- void 0
- }
- },
- t.ignoreGlobalPause = !1,
- t.loop = !1,
- t.duration = 0,
- t.pluginData = null,
- t.target = null,
- t.position = null,
- t.passive = !1,
- t._paused = !1,
- t._curQueueProps = null,
- t._initQueueProps = null,
- t._steps = null,
- t._actions = null,
- t._prevPosition = 0,
- t._stepPosition = 0,
- t._prevPos = -1,
- t._target = null,
- t._useTicks = !1,
- t._inited = !1,
- t.initialize = function(t, n, r) {
- this.target = this._target = t,
- n && (this._useTicks = n.useTicks, this.ignoreGlobalPause = n.ignoreGlobalPause, this.loop = n.loop, n.onChange && this.addEventListener("change", n.onChange), n.override && e.removeTweens(t)),
- this.pluginData = r || {},
- this._curQueueProps = {},
- this._initQueueProps = {},
- this._steps = [],
- this._actions = [],
- n && n.paused ? this._paused = !0 : e._register(this, !0),
- n && null != n.position && this.setPosition(n.position, e.NONE)
- },
- t.wait = function(e, t) {
- if (null == e || 0 >= e) return this;
- var n = this._cloneProps(this._curQueueProps);
- return this._addStep({
- d: e,
- p0: n,
- e: this._linearEase,
- p1: n,
- v: t
- })
- },
- t.to = function(e, t, n) {
- return (isNaN(t) || 0 > t) && (t = 0),
- this._addStep({
- d: t || 0,
- p0: this._cloneProps(this._curQueueProps),
- e: n,
- p1: this._cloneProps(this._appendQueueProps(e))
- })
- },
- t.call = function(e, t, n) {
- return this._addAction({
- f: e,
- p: t ? t: [this],
- o: n ? n: this._target
- })
- },
- t.set = function(e, t) {
- return this._addAction({
- f: this._set,
- o: this,
- p: [e, t ? t: this._target]
- })
- },
- t.play = function(e) {
- return e || (e = this),
- this.call(e.setPaused, [!1], e)
- },
- t.pause = function(e) {
- return e || (e = this),
- this.call(e.setPaused, [!0], e)
- },
- t.setPosition = function(e, t) {
- 0 > e && (e = 0),
- null == t && (t = 1);
- var n = e,
- r = !1;
- if (n >= this.duration && (this.loop ? n %= this.duration: (n = this.duration, r = !0)), n == this._prevPos) return r;
- var i = this._prevPos;
- if (this.position = this._prevPos = n, this._prevPosition = e, this._target) if (r) this._updateTargetProps(null, 1);
- else if (this._steps.length > 0) {
- for (var s = 0,
- o = this._steps.length; o > s && !(this._steps[s].t > n); s++);
- var u = this._steps[s - 1];
- this._updateTargetProps(u, (this._stepPosition = n - u.t) / u.d)
- }
- return 0 != t && this._actions.length > 0 && (this._useTicks ? this._runActions(n, n) : 1 == t && i > n ? (i != this.duration && this._runActions(i, this.duration), this._runActions(0, n, !0)) : this._runActions(i, n)),
- r && this.setPaused(!0),
- this.dispatchEvent("change"),
- r
- },
- t.tick = function(e) {
- this._paused || this.setPosition(this._prevPosition + e)
- },
- t.setPaused = function(t) {
- return this._paused = !!t,
- e._register(this, !t),
- this
- },
- t.w = t.wait,
- t.t = t.to,
- t.c = t.call,
- t.s = t.set,
- t.toString = function() {
- return "[Tween]"
- },
- t.clone = function() {
- throw "Tween can not be cloned."
- },
- t._updateTargetProps = function(t, n) {
- var r, i, s, o, u, f;
- if (t || 1 != n) {
- if (this.passive = !!t.v, this.passive) return;
- t.e && (n = t.e(n, 0, 1, 1)),
- r = t.p0,
- i = t.p1
- } else this.passive = !1,
- r = i = this._curQueueProps;
- for (var l in this._initQueueProps) {
- null == (o = r[l]) && (r[l] = o = this._initQueueProps[l]),
- null == (u = i[l]) && (i[l] = u = o),
- s = o == u || 0 == n || 1 == n || "number" != typeof o ? 1 == n ? u: o: o + (u - o) * n;
- var c = !1;
- if (f = e._plugins[l]) for (var h = 0,
- p = f.length; p > h; h++) {
- var d = f[h].tween(this, l, s, r, i, n, !!t && r == i, !t);
- d == e.IGNORE ? c = !0 : s = d
- }
- c || (this._target[l] = s)
- }
- },
- t._runActions = function(e, t, n) {
- var r = e,
- i = t,
- s = -1,
- o = this._actions.length,
- u = 1;
- for (e > t && (r = t, i = e, s = o, o = u = -1); (s += u) != o;) {
- var a = this._actions[s],
- f = a.t; (f == i || f > r && i > f || n && f == e) && a.f.apply(a.o, a.p)
- }
- },
- t._appendQueueProps = function(t) {
- var n, r, i, s, o;
- for (var u in t) if (void 0 === this._initQueueProps[u]) {
- if (r = this._target[u], n = e._plugins[u]) for (i = 0, s = n.length; s > i; i++) r = n[i].init(this, u, r);
- this._initQueueProps[u] = this._curQueueProps[u] = void 0 === r ? null: r
- } else r = this._curQueueProps[u];
- for (var u in t) {
- if (r = this._curQueueProps[u], n = e._plugins[u]) for (o = o || {},
- i = 0, s = n.length; s > i; i++) n[i].step && n[i].step(this, u, r, t[u], o);
- this._curQueueProps[u] = t[u]
- }
- return o && this._appendQueueProps(o),
- this._curQueueProps
- },
- t._cloneProps = function(e) {
- var t = {};
- for (var n in e) t[n] = e[n];
- return t
- },
- t._addStep = function(e) {
- return e.d > 0 && (this._steps.push(e), e.t = this.duration, this.duration += e.d),
- this
- },
- t._addAction = function(e) {
- return e.t = this.duration,
- this._actions.push(e),
- this
- },
- t._set = function(e, t) {
- for (var n in e) t[n] = e[n]
- },
- createjs.Tween = e
- } (), this.createjs = this.createjs || {},
- function() {
- var e = function(e, t, n) {
- this.initialize(e, t, n)
- },
- t = e.prototype = new createjs.EventDispatcher;
- t.ignoreGlobalPause = !1,
- t.duration = 0,
- t.loop = !1,
- t.position = null,
- t._paused = !1,
- t._tweens = null,
- t._labels = null,
- t._labelList = null,
- t._prevPosition = 0,
- t._prevPos = -1,
- t._useTicks = !1,
- t.initialize = function(e, t, n) {
- this._tweens = [],
- n && (this._useTicks = n.useTicks, this.loop = n.loop, this.ignoreGlobalPause = n.ignoreGlobalPause, n.onChange && this.addEventListener("change", n.onChange)),
- e && this.addTween.apply(this, e),
- this.setLabels(t),
- n && n.paused ? this._paused = !0 : createjs.Tween._register(this, !0),
- n && null != n.position && this.setPosition(n.position, createjs.Tween.NONE)
- },
- t.addTween = function(e) {
- var t = arguments.length;
- if (t > 1) {
- for (var n = 0; t > n; n++) this.addTween(arguments[n]);
- return arguments[0]
- }
- return 0 == t ? null: (this.removeTween(e), this._tweens.push(e), e.setPaused(!0), e._paused = !1, e._useTicks = this._useTicks, e.duration > this.duration && (this.duration = e.duration), this._prevPos >= 0 && e.setPosition(this._prevPos, createjs.Tween.NONE), e)
- },
- t.removeTween = function(e) {
- var t = arguments.length;
- if (t > 1) {
- for (var n = !0,
- r = 0; t > r; r++) n = n && this.removeTween(arguments[r]);
- return n
- }
- if (0 == t) return ! 1;
- for (var i = this._tweens,
- r = i.length; r--;) if (i[r] == e) return i.splice(r, 1),
- e.duration >= this.duration && this.updateDuration(),
- !0;
- return ! 1
- },
- t.addLabel = function(e, t) {
- this._labels[e] = t;
- var n = this._labelList;
- if (n) {
- for (var r = 0,
- i = n.length; i > r && !(t < n[r].position); r++);
- n.splice(r, 0, {
- label: e,
- position: t
- })
- }
- },
- t.setLabels = function(e) {
- this._labels = e ? e: {}
- },
- t.getLabels = function() {
- var e = this._labelList;
- if (!e) {
- e = this._labelList = [];
- var t = this._labels;
- for (var n in t) e.push({
- label: n,
- position: t[n]
- });
- e.sort(function(e, t) {
- return e.position - t.position
- })
- }
- return e
- },
- t.getCurrentLabel = function() {
- var e = this.getLabels(),
- t = this.position,
- n = e.length;
- if (n) {
- for (var r = 0; n > r && !(t < e[r].position); r++);
- return 0 == r ? null: e[r - 1].label
- }
- return null
- },
- t.gotoAndPlay = function(e) {
- this.setPaused(!1),
- this._goto(e)
- },
- t.gotoAndStop = function(e) {
- this.setPaused(!0),
- this._goto(e)
- },
- t.setPosition = function(e, t) {
- 0 > e && (e = 0);
- var n = this.loop ? e % this.duration: e,
- r = !this.loop && e >= this.duration;
- if (n == this._prevPos) return r;
- this._prevPosition = e,
- this.position = this._prevPos = n;
- for (var i = 0,
- s = this._tweens.length; s > i; i++) if (this._tweens[i].setPosition(n, t), n != this._prevPos) return ! 1;
- return r && this.setPaused(!0),
- this.dispatchEvent("change"),
- r
- },
- t.setPaused = function(e) {
- this._paused = !!e,
- createjs.Tween._register(this, !e)
- },
- t.updateDuration = function() {
- this.duration = 0;
- for (var e = 0,
- t = this._tweens.length; t > e; e++) {
- var n = this._tweens[e];
- n.duration > this.duration && (this.duration = n.duration)
- }
- },
- t.tick = function(e) {
- this.setPosition(this._prevPosition + e)
- },
- t.resolve = function(e) {
- var t = parseFloat(e);
- return isNaN(t) && (t = this._labels[e]),
- t
- },
- t.toString = function() {
- return "[Timeline]"
- },
- t.clone = function() {
- throw "Timeline can not be cloned."
- },
- t._goto = function(e) {
- var t = this.resolve(e);
- null != t && this.setPosition(t)
- },
- createjs.Timeline = e
- } (), this.createjs = this.createjs || {},
- function() {
- var e = function() {
- throw "Ease cannot be instantiated."
- };
- e.linear = function(e) {
- return e
- },
- e.none = e.linear,
- e.get = function(e) {
- return - 1 > e && (e = -1),
- e > 1 && (e = 1),
- function(t) {
- return 0 == e ? t: 0 > e ? t * (t * -e + 1 + e) : t * ((2 - t) * e + (1 - e))
- }
- },
- e.getPowIn = function(e) {
- return function(t) {
- return Math.pow(t, e)
- }
- },
- e.getPowOut = function(e) {
- return function(t) {
- return 1 - Math.pow(1 - t, e)
- }
- },
- e.getPowInOut = function(e) {
- return function(t) {
- return (t *= 2) < 1 ? .5 * Math.pow(t, e) : 1 - .5 * Math.abs(Math.pow(2 - t, e))
- }
- },
- e.quadIn = e.getPowIn(2),
- e.quadOut = e.getPowOut(2),
- e.quadInOut = e.getPowInOut(2),
- e.cubicIn = e.getPowIn(3),
- e.cubicOut = e.getPowOut(3),
- e.cubicInOut = e.getPowInOut(3),
- e.quartIn = e.getPowIn(4),
- e.quartOut = e.getPowOut(4),
- e.quartInOut = e.getPowInOut(4),
- e.quintIn = e.getPowIn(5),
- e.quintOut = e.getPowOut(5),
- e.quintInOut = e.getPowInOut(5),
- e.sineIn = function(e) {
- return 1 - Math.cos(e * Math.PI / 2)
- },
- e.sineOut = function(e) {
- return Math.sin(e * Math.PI / 2)
- },
- e.sineInOut = function(e) {
- return - 0.5 * (Math.cos(Math.PI * e) - 1)
- },
- e.getBackIn = function(e) {
- return function(t) {
- return t * t * ((e + 1) * t - e)
- }
- },
- e.backIn = e.getBackIn(1.7),
- e.getBackOut = function(e) {
- return function(t) {
- return--t * t * ((e + 1) * t + e) + 1
- }
- },
- e.backOut = e.getBackOut(1.7),
- e.getBackInOut = function(e) {
- return e *= 1.525,
- function(t) {
- return (t *= 2) < 1 ? .5 * t * t * ((e + 1) * t - e) : .5 * ((t -= 2) * t * ((e + 1) * t + e) + 2)
- }
- },
- e.backInOut = e.getBackInOut(1.7),
- e.circIn = function(e) {
- return - (Math.sqrt(1 - e * e) - 1)
- },
- e.circOut = function(e) {
- return Math.sqrt(1 - --e * e)
- },
- e.circInOut = function(e) {
- return (e *= 2) < 1 ? -0.5 * (Math.sqrt(1 - e * e) - 1) : .5 * (Math.sqrt(1 - (e -= 2) * e) + 1)
- },
- e.bounceIn = function(t) {
- return 1 - e.bounceOut(1 - t)
- },
- e.bounceOut = function(e) {
- return 1 / 2.75 > e ? 7.5625 * e * e: 2 / 2.75 > e ? 7.5625 * (e -= 1.5 / 2.75) * e + .75 : 2.5 / 2.75 > e ? 7.5625 * (e -= 2.25 / 2.75) * e + .9375 : 7.5625 * (e -= 2.625 / 2.75) * e + .984375
- },
- e.bounceInOut = function(t) {
- return.5 > t ? .5 * e.bounceIn(2 * t) : .5 * e.bounceOut(2 * t - 1) + .5
- },
- e.getElasticIn = function(e, t) {
- var n = 2 * Math.PI;
- return function(r) {
- if (0 == r || 1 == r) return r;
- var i = t / n * Math.asin(1 / e);
- return - (e * Math.pow(2, 10 * (r -= 1)) * Math.sin((r - i) * n / t))
- }
- },
- e.elasticIn = e.getElasticIn(1, .3),
- e.getElasticOut = function(e, t) {
- var n = 2 * Math.PI;
- return function(r) {
- if (0 == r || 1 == r) return r;
- var i = t / n * Math.asin(1 / e);
- return e * Math.pow(2, -10 * r) * Math.sin((r - i) * n / t) + 1
- }
- },
- e.elasticOut = e.getElasticOut(1, .3),
- e.getElasticInOut = function(e, t) {
- var n = 2 * Math.PI;
- return function(r) {
- var i = t / n * Math.asin(1 / e);
- return (r *= 2) < 1 ? -0.5 * e * Math.pow(2, 10 * (r -= 1)) * Math.sin((r - i) * n / t) : .5 * e * Math.pow(2, -10 * (r -= 1)) * Math.sin((r - i) * n / t) + 1
- }
- },
- e.elasticInOut = e.getElasticInOut(1, .3 * 1.5),
- createjs.Ease = e
- } (), this.createjs = this.createjs || {},
- function() {
- var e = function() {
- throw "MotionGuidePlugin cannot be instantiated."
- };
- e.priority = 0,
- e._rotOffS,
- e._rotOffE,
- e._rotNormS,
- e._rotNormE,
- e.install = function() {
- return createjs.Tween.installPlugin(e, ["guide", "x", "y", "rotation"]),
- createjs.Tween.IGNORE
- },
- e.init = function(e, t, n) {
- var r = e.target;
- return r.hasOwnProperty("x") || (r.x = 0),
- r.hasOwnProperty("y") || (r.y = 0),
- r.hasOwnProperty("rotation") || (r.rotation = 0),
- "rotation" == t && (e.__needsRot = !0),
- "guide" == t ? null: n
- },
- e.step = function(t, n, r, i, s) {
- if ("rotation" == n && (t.__rotGlobalS = r, t.__rotGlobalE = i, e.testRotData(t, s)), "guide" != n) return i;
- var o, u = i;
- u.hasOwnProperty("path") || (u.path = []);
- var f = u.path;
- if (u.hasOwnProperty("end") || (u.end = 1), u.hasOwnProperty("start") || (u.start = r && r.hasOwnProperty("end") && r.path === f ? r.end: 0), u.hasOwnProperty("_segments") && u._length) return i;
- var l = f.length,
- c = 10;
- if (l >= 6 && 0 == (l - 2) % 4) {
- u._segments = [],
- u._length = 0;
- for (var h = 2; l > h; h += 4) {
- for (var p, d, v = f[h - 2], m = f[h - 1], g = f[h + 0], y = f[h + 1], b = f[h + 2], w = f[h + 3], E = v, S = m, x = 0, T = [], N = 1; c >= N; N++) {
- var C = N / c,
- k = 1 - C;
- p = k * k * v + 2 * k * C * g + C * C * b,
- d = k * k * m + 2 * k * C * y + C * C * w,
- x += T[T.push(Math.sqrt((o = p - E) * o + (o = d - S) * o)) - 1],
- E = p,
- S = d
- }
- u._segments.push(x),
- u._segments.push(T),
- u._length += x
- }
- o = u.orient,
- u.orient = !0;
- var L = {};
- return e.calc(u, u.start, L),
- t.__rotPathS = Number(L.rotation.toFixed(5)),
- e.calc(u, u.end, L),
- t.__rotPathE = Number(L.rotation.toFixed(5)),
- u.orient = !1,
- e.calc(u, u.end, s),
- u.orient = o,
- u.orient ? (t.__guideData = u, e.testRotData(t, s), i) : i
- }
- throw "invalid 'path' data, please see documentation for valid paths"
- },
- e.testRotData = function(e, t) {
- if (void 0 === e.__rotGlobalS || void 0 === e.__rotGlobalE) {
- if (e.__needsRot) return;
- e.__rotGlobalS = e.__rotGlobalE = void 0 !== e._curQueueProps.rotation ? e._curQueueProps.rotation: t.rotation = e.target.rotation || 0
- }
- if (void 0 !== e.__guideData) {
- var n = e.__guideData,
- r = e.__rotGlobalE - e.__rotGlobalS,
- i = e.__rotPathE - e.__rotPathS,
- s = r - i;
- if ("auto" == n.orient) s > 180 ? s -= 360 : -180 > s && (s += 360);
- else if ("cw" == n.orient) {
- for (; 0 > s;) s += 360;
- 0 == s && r > 0 && 180 != r && (s += 360)
- } else if ("ccw" == n.orient) {
- for (s = r - (i > 180 ? 360 - i: i); s > 0;) s -= 360;
- 0 == s && 0 > r && -180 != r && (s -= 360)
- }
- n.rotDelta = s,
- n.rotOffS = e.__rotGlobalS - e.__rotPathS,
- e.__rotGlobalS = e.__rotGlobalE = e.__guideData = e.__needsRot = void 0
- }
- },
- e.tween = function(t, n, r, i, s, o, u) {
- var f = s.guide;
- if (void 0 == f || f === i.guide) return r;
- if (f.lastRatio != o) {
- var l = (f.end - f.start) * (u ? f.end: o) + f.start;
- switch (e.calc(f, l, t.target), f.orient) {
- case "cw":
- case "ccw":
- case "auto":
- t.target.rotation += f.rotOffS + f.rotDelta * o;
- break;
- case "fixed":
- default:
- t.target.rotation += f.rotOffS
- }
- f.lastRatio = o
- }
- return "rotation" != n || f.orient && "false" != f.orient ? t.target[n] : r
- },
- e.calc = function(t, n, r) {
- void 0 == t._segments && e.validate(t),
- void 0 == r && (r = {
- x: 0,
- y: 0,
- rotation: 0
- });
- for (var i = t._segments,
- s = t.path,
- o = t._length * n,
- u = i.length - 2,
- f = 0; o > i[f] && u > f;) o -= i[f],
- f += 2;
- var l = i[f + 1],
- c = 0;
- for (u = l.length - 1; o > l[c] && u > c;) o -= l[c],
- c++;
- var h = c / ++u + o / (u * l[c]);
- f = 2 * f + 2;
- var p = 1 - h;
- return r.x = p * p * s[f - 2] + 2 * p * h * s[f + 0] + h * h * s[f + 2],
- r.y = p * p * s[f - 1] + 2 * p * h * s[f + 1] + h * h * s[f + 3],
- t.orient && (r.rotation = 57.2957795 * Math.atan2((s[f + 1] - s[f - 1]) * p + (s[f + 3] - s[f + 1]) * h, (s[f + 0] - s[f - 2]) * p + (s[f + 2] - s[f + 0]) * h)),
- r
- },
- createjs.MotionGuidePlugin = e
- } (), this.createjs = this.createjs || {},
- function() {
- var e = createjs.TweenJS = createjs.TweenJS || {};
- e.version = "0.5.1",
- e.buildDate = "Thu, 12 Dec 2013 23:33:38 GMT"
- } (), define("tweenjs",
- function(e) {
- return function() {
- var t, n;
- return t || e.createjs
- }
- } (this)), define("FSM", ["require"],
- function(e) {
- var t = function(e) {
- this.init(e)
- },
- n = t.prototype;
- return n.getPrevState = function() {
- return this._prevState
- },
- n.getCurrState = function() {
- return this._currState
- },
- n.init = function(e) {
- this._newState = e
- },
- n.execute = function() {
- this._newState && (this._newState.enter(), this._prevState = this._currState, this._currState = this._newState, this._newState = null),
- this._newState = this._currState.execute(this),
- this._newState && (this._currState.exit(), this._prevState = this._currState, this._currState = this._newState)
- },
- n._currState = null,
- n._newState = null,
- n._prevState = null,
- t
- }), define("State", ["require"],
- function(e) {
- var t = function(e, t, n) {
- this.init(e, t, n)
- };
- t.new = function(e, t) {
- var n = new Stats(e, t);
- return n
- };
- var n = t.prototype;
- return n.name = "",
- n.init = function(e, t, n) {
- this._conditions = [],
- this._enterCallback = e,
- this._exitCallback = t,
- this.name = n === undefined ? "": n
- },
- n.addTransition = function(e, t, n) {
- return this._conditions.push({
- state: e,
- conditionCallback: t,
- scope: n
- }),
- this
- },
- n.enter = function() {
- this._enterCallback && this._enterCallback.call()
- },
- n.exit = function() {
- this._exitCallback && this._exitCallback.call()
- },
- n.execute = function(e) {
- for (var t = 0; t < this._conditions.length; t++) if (this._conditions[t].conditionCallback.call(this._conditions[t].scope, e)) return this._conditions[t].state;
- return null
- },
- n._conditions = null,
- n._enterCallback = null,
- n._exitCallback = null,
- t
- }),
- function() {
- var e = this,
- t = e._,
- n = {},
- r = Array.prototype,
- i = Object.prototype,
- s = Function.prototype,
- o = r.push,
- u = r.slice,
- a = r.concat,
- f = i.toString,
- l = i.hasOwnProperty,
- c = r.forEach,
- h = r.map,
- p = r.reduce,
- d = r.reduceRight,
- v = r.filter,
- m = r.every,
- g = r.some,
- y = r.indexOf,
- b = r.lastIndexOf,
- w = Array.isArray,
- E = Object.keys,
- S = s.bind,
- x = function(e) {
- return e instanceof x ? e: this instanceof x ? (this._wrapped = e, void 0) : new x(e)
- };
- "undefined" != typeof exports ? ("undefined" != typeof module && module.exports && (exports = module.exports = x), exports._ = x) : e._ = x,
- x.VERSION = "1.5.2";
- var T = x.each = x.forEach = function(e, t, r) {
- if (null != e) if (c && e.forEach === c) e.forEach(t, r);
- else if (e.length === +e.length) {
- for (var i = 0,
- s = e.length; s > i; i++) if (t.call(r, e[i], i, e) === n) return
- } else for (var o = x.keys(e), i = 0, s = o.length; s > i; i++) if (t.call(r, e[o[i]], o[i], e) === n) return
- };
- x.map = x.collect = function(e, t, n) {
- var r = [];
- return null == e ? r: h && e.map === h ? e.map(t, n) : (T(e,
- function(e, i, s) {
- r.push(t.call(n, e, i, s))
- }), r)
- };
- var N = "Reduce of empty array with no initial value";
- x.reduce = x.foldl = x.inject = function(e, t, n, r) {
- var i = arguments.length > 2;
- if (null == e && (e = []), p && e.reduce === p) return r && (t = x.bind(t, r)),
- i ? e.reduce(t, n) : e.reduce(t);
- if (T(e,
- function(e, s, o) {
- i ? n = t.call(r, n, e, s, o) : (n = e, i = !0)
- }), !i) throw new TypeError(N);
- return n
- },
- x.reduceRight = x.foldr = function(e, t, n, r) {
- var i = arguments.length > 2;
- if (null == e && (e = []), d && e.reduceRight === d) return r && (t = x.bind(t, r)),
- i ? e.reduceRight(t, n) : e.reduceRight(t);
- var s = e.length;
- if (s !== +s) {
- var o = x.keys(e);
- s = o.length
- }
- if (T(e,
- function(u, a, f) {
- a = o ? o[--s] : --s,
- i ? n = t.call(r, n, e[a], a, f) : (n = e[a], i = !0)
- }), !i) throw new TypeError(N);
- return n
- },
- x.find = x.detect = function(e, t, n) {
- var r;
- return C(e,
- function(e, i, s) {
- return t.call(n, e, i, s) ? (r = e, !0) : void 0
- }),
- r
- },
- x.filter = x.select = function(e, t, n) {
- var r = [];
- return null == e ? r: v && e.filter === v ? e.filter(t, n) : (T(e,
- function(e, i, s) {
- t.call(n, e, i, s) && r.push(e)
- }), r)
- },
- x.reject = function(e, t, n) {
- return x.filter(e,
- function(e, r, i) {
- return ! t.call(n, e, r, i)
- },
- n)
- },
- x.every = x.all = function(e, t, r) {
- t || (t = x.identity);
- var i = !0;
- return null == e ? i: m && e.every === m ? e.every(t, r) : (T(e,
- function(e, s, o) {
- return (i = i && t.call(r, e, s, o)) ? void 0 : n
- }), !!i)
- };
- var C = x.some = x.any = function(e, t, r) {
- t || (t = x.identity);
- var i = !1;
- return null == e ? i: g && e.some === g ? e.some(t, r) : (T(e,
- function(e, s, o) {
- return i || (i = t.call(r, e, s, o)) ? n: void 0
- }), !!i)
- };
- x.contains = x.include = function(e, t) {
- return null == e ? !1 : y && e.indexOf === y ? e.indexOf(t) != -1 : C(e,
- function(e) {
- return e === t
- })
- },
- x.invoke = function(e, t) {
- var n = u.call(arguments, 2),
- r = x.isFunction(t);
- return x.map(e,
- function(e) {
- return (r ? t: e[t]).apply(e, n)
- })
- },
- x.pluck = function(e, t) {
- return x.map(e,
- function(e) {
- return e[t]
- })
- },
- x.where = function(e, t, n) {
- return x.isEmpty(t) ? n ? void 0 : [] : x[n ? "find": "filter"](e,
- function(e) {
- for (var n in t) if (t[n] !== e[n]) return ! 1;
- return ! 0
- })
- },
- x.findWhere = function(e, t) {
- return x.where(e, t, !0)
- },
- x.max = function(e, t, n) {
- if (!t && x.isArray(e) && e[0] === +e[0] && e.length < 65535) return Math.max.apply(Math, e);
- if (!t && x.isEmpty(e)) return - 1 / 0;
- var r = {
- computed: -1 / 0,
- value: -1 / 0
- };
- return T(e,
- function(e, i, s) {
- var o = t ? t.call(n, e, i, s) : e;
- o > r.computed && (r = {
- value: e,
- computed: o
- })
- }),
- r.value
- },
- x.min = function(e, t, n) {
- if (!t && x.isArray(e) && e[0] === +e[0] && e.length < 65535) return Math.min.apply(Math, e);
- if (!t && x.isEmpty(e)) return 1 / 0;
- var r = {
- computed: 1 / 0,
- value: 1 / 0
- };
- return T(e,
- function(e, i, s) {
- var o = t ? t.call(n, e, i, s) : e;
- o < r.computed && (r = {
- value: e,
- computed: o
- })
- }),
- r.value
- },
- x.shuffle = function(e) {
- var t, n = 0,
- r = [];
- return T(e,
- function(e) {
- t = x.random(n++),
- r[n - 1] = r[t],
- r[t] = e
- }),
- r
- },
- x.sample = function(e, t, n) {
- return arguments.length < 2 || n ? e[x.random(e.length - 1)] : x.shuffle(e).slice(0, Math.max(0, t))
- };
- var k = function(e) {
- return x.isFunction(e) ? e: function(t) {
- return t[e]
- }
- };
- x.sortBy = function(e, t, n) {
- var r = k(t);
- return x.pluck(x.map(e,
- function(e, t, i) {
- return {
- value: e,
- index: t,
- criteria: r.call(n, e, t, i)
- }
- }).sort(function(e, t) {
- var n = e.criteria,
- r = t.criteria;
- if (n !== r) {
- if (n > r || n === void 0) return 1;
- if (r > n || r === void 0) return - 1
- }
- return e.index - t.index
- }), "value")
- };
- var L = function(e) {
- return function(t, n, r) {
- var i = {},
- s = null == n ? x.identity: k(n);
- return T(t,
- function(n, o) {
- var u = s.call(r, n, o, t);
- e(i, u, n)
- }),
- i
- }
- };
- x.groupBy = L(function(e, t, n) { (x.has(e, t) ? e[t] : e[t] = []).push(n)
- }),
- x.indexBy = L(function(e, t, n) {
- e[t] = n
- }),
- x.countBy = L(function(e, t) {
- x.has(e, t) ? e[t]++:e[t] = 1
- }),
- x.sortedIndex = function(e, t, n, r) {
- n = null == n ? x.identity: k(n);
- for (var i = n.call(r, t), s = 0, o = e.length; o > s;) {
- var u = s + o >>> 1;
- n.call(r, e[u]) < i ? s = u + 1 : o = u
- }
- return s
- },
- x.toArray = function(e) {
- return e ? x.isArray(e) ? u.call(e) : e.length === +e.length ? x.map(e, x.identity) : x.values(e) : []
- },
- x.size = function(e) {
- return null == e ? 0 : e.length === +e.length ? e.length: x.keys(e).length
- },
- x.first = x.head = x.take = function(e, t, n) {
- return null == e ? void 0 : null == t || n ? e[0] : u.call(e, 0, t)
- },
- x.initial = function(e, t, n) {
- return u.call(e, 0, e.length - (null == t || n ? 1 : t))
- },
- x.last = function(e, t, n) {
- return null == e ? void 0 : null == t || n ? e[e.length - 1] : u.call(e, Math.max(e.length - t, 0))
- },
- x.rest = x.tail = x.drop = function(e, t, n) {
- return u.call(e, null == t || n ? 1 : t)
- },
- x.compact = function(e) {
- return x.filter(e, x.identity)
- };
- var A = function(e, t, n) {
- return t && x.every(e, x.isArray) ? a.apply(n, e) : (T(e,
- function(e) {
- x.isArray(e) || x.isArguments(e) ? t ? o.apply(n, e) : A(e, t, n) : n.push(e)
- }), n)
- };
- x.flatten = function(e, t) {
- return A(e, t, [])
- },
- x.without = function(e) {
- return x.difference(e, u.call(arguments, 1))
- },
- x.uniq = x.unique = function(e, t, n, r) {
- x.isFunction(t) && (r = n, n = t, t = !1);
- var i = n ? x.map(e, n, r) : e,
- s = [],
- o = [];
- return T(i,
- function(n, r) { (t ? r && o[o.length - 1] === n: x.contains(o, n)) || (o.push(n), s.push(e[r]))
- }),
- s
- },
- x.union = function() {
- return x.uniq(x.flatten(arguments, !0))
- },
- x.intersection = function(e) {
- var t = u.call(arguments, 1);
- return x.filter(x.uniq(e),
- function(e) {
- return x.every(t,
- function(t) {
- return x.indexOf(t, e) >= 0
- })
- })
- },
- x.difference = function(e) {
- var t = a.apply(r, u.call(arguments, 1));
- return x.filter(e,
- function(e) {
- return ! x.contains(t, e)
- })
- },
- x.zip = function() {
- for (var e = x.max(x.pluck(arguments, "length").concat(0)), t = new Array(e), n = 0; e > n; n++) t[n] = x.pluck(arguments, "" + n);
- return t
- },
- x.object = function(e, t) {
- if (null == e) return {};
- for (var n = {},
- r = 0,
- i = e.length; i > r; r++) t ? n[e[r]] = t[r] : n[e[r][0]] = e[r][1];
- return n
- },
- x.indexOf = function(e, t, n) {
- if (null == e) return - 1;
- var r = 0,
- i = e.length;
- if (n) {
- if ("number" != typeof n) return r = x.sortedIndex(e, t),
- e[r] === t ? r: -1;
- r = 0 > n ? Math.max(0, i + n) : n
- }
- if (y && e.indexOf === y) return e.indexOf(t, n);
- for (; i > r; r++) if (e[r] === t) return r;
- return - 1
- },
- x.lastIndexOf = function(e, t, n) {
- if (null == e) return - 1;
- var r = null != n;
- if (b && e.lastIndexOf === b) return r ? e.lastIndexOf(t, n) : e.lastIndexOf(t);
- for (var i = r ? n: e.length; i--;) if (e[i] === t) return i;
- return - 1
- },
- x.range = function(e, t, n) {
- arguments.length <= 1 && (t = e || 0, e = 0),
- n = arguments[2] || 1;
- for (var r = Math.max(Math.ceil((t - e) / n), 0), i = 0, s = new Array(r); r > i;) s[i++] = e,
- e += n;
- return s
- };
- var O = function() {};
- x.bind = function(e, t) {
- var n, r;
- if (S && e.bind === S) return S.apply(e, u.call(arguments, 1));
- if (!x.isFunction(e)) throw new TypeError;
- return n = u.call(arguments, 2),
- r = function() {
- if (this instanceof r) {
- O.prototype = e.prototype;
- var i = new O;
- O.prototype = null;
- var s = e.apply(i, n.concat(u.call(arguments)));
- return Object(s) === s ? s: i
- }
- return e.apply(t, n.concat(u.call(arguments)))
- }
- },
- x.partial = function(e) {
- var t = u.call(arguments, 1);
- return function() {
- return e.apply(this, t.concat(u.call(arguments)))
- }
- },
- x.bindAll = function(e) {
- var t = u.call(arguments, 1);
- if (0 === t.length) throw new Error("bindAll must be passed function names");
- return T(t,
- function(t) {
- e[t] = x.bind(e[t], e)
- }),
- e
- },
- x.memoize = function(e, t) {
- var n = {};
- return t || (t = x.identity),
- function() {
- var r = t.apply(this, arguments);
- return x.has(n, r) ? n[r] : n[r] = e.apply(this, arguments)
- }
- },
- x.delay = function(e, t) {
- var n = u.call(arguments, 2);
- return setTimeout(function() {
- return e.apply(null, n)
- },
- t)
- },
- x.defer = function(e) {
- return x.delay.apply(x, [e, 1].concat(u.call(arguments, 1)))
- },
- x.throttle = function(e, t, n) {
- var r, i, s, o = null,
- u = 0;
- n || (n = {});
- var a = function() {
- u = n.leading === !1 ? 0 : new Date,
- o = null,
- s = e.apply(r, i)
- };
- return function() {
- var f = new Date;
- u || n.leading !== !1 || (u = f);
- var l = t - (f - u);
- return r = this,
- i = arguments,
- 0 >= l ? (clearTimeout(o), o = null, u = f, s = e.apply(r, i)) : o || n.trailing === !1 || (o = setTimeout(a, l)),
- s
- }
- },
- x.debounce = function(e, t, n) {
- var r, i, s, o, u;
- return function() {
- s = this,
- i = arguments,
- o = new Date;
- var a = function() {
- var f = new Date - o;
- t > f ? r = setTimeout(a, t - f) : (r = null, n || (u = e.apply(s, i)))
- },
- f = n && !r;
- return r || (r = setTimeout(a, t)),
- f && (u = e.apply(s, i)),
- u
- }
- },
- x.once = function(e) {
- var t, n = !1;
- return function() {
- return n ? t: (n = !0, t = e.apply(this, arguments), e = null, t)
- }
- },
- x.wrap = function(e, t) {
- return function() {
- var n = [e];
- return o.apply(n, arguments),
- t.apply(this, n)
- }
- },
- x.compose = function() {
- var e = arguments;
- return function() {
- for (var t = arguments,
- n = e.length - 1; n >= 0; n--) t = [e[n].apply(this, t)];
- return t[0]
- }
- },
- x.after = function(e, t) {
- return function() {
- return--e < 1 ? t.apply(this, arguments) : void 0
- }
- },
- x.keys = E ||
- function(e) {
- if (e !== Object(e)) throw new TypeError("Invalid object");
- var t = [];
- for (var n in e) x.has(e, n) && t.push(n);
- return t
- },
- x.values = function(e) {
- for (var t = x.keys(e), n = t.length, r = new Array(n), i = 0; n > i; i++) r[i] = e[t[i]];
- return r
- },
- x.pairs = function(e) {
- for (var t = x.keys(e), n = t.length, r = new Array(n), i = 0; n > i; i++) r[i] = [t[i], e[t[i]]];
- return r
- },
- x.invert = function(e) {
- for (var t = {},
- n = x.keys(e), r = 0, i = n.length; i > r; r++) t[e[n[r]]] = n[r];
- return t
- },
- x.functions = x.methods = function(e) {
- var t = [];
- for (var n in e) x.isFunction(e[n]) && t.push(n);
- return t.sort()
- },
- x.extend = function(e) {
- return T(u.call(arguments, 1),
- function(t) {
- if (t) for (var n in t) e[n] = t[n]
- }),
- e
- },
- x.pick = function(e) {
- var t = {},
- n = a.apply(r, u.call(arguments, 1));
- return T(n,
- function(n) {
- n in e && (t[n] = e[n])
- }),
- t
- },
- x.omit = function(e) {
- var t = {},
- n = a.apply(r, u.call(arguments, 1));
- for (var i in e) x.contains(n, i) || (t[i] = e[i]);
- return t
- },
- x.defaults = function(e) {
- return T(u.call(arguments, 1),
- function(t) {
- if (t) for (var n in t) e[n] === void 0 && (e[n] = t[n])
- }),
- e
- },
- x.clone = function(e) {
- return x.isObject(e) ? x.isArray(e) ? e.slice() : x.extend({},
- e) : e
- },
- x.tap = function(e, t) {
- return t(e),
- e
- };
- var M = function(e, t, n, r) {
- if (e === t) return 0 !== e || 1 / e == 1 / t;
- if (null == e || null == t) return e === t;
- e instanceof x && (e = e._wrapped),
- t instanceof x && (t = t._wrapped);
- var i = f.call(e);
- if (i != f.call(t)) return ! 1;
- switch (i) {
- case "[object String]":
- return e == String(t);
- case "[object Number]":
- return e != +e ? t != +t: 0 == e ? 1 / e == 1 / t: e == +t;
- case "[object Date]":
- case "[object Boolean]":
- return + e == +t;
- case "[object RegExp]":
- return e.source == t.source && e.global == t.global && e.multiline == t.multiline && e.ignoreCase == t.ignoreCase
- }
- if ("object" != typeof e || "object" != typeof t) return ! 1;
- for (var s = n.length; s--;) if (n[s] == e) return r[s] == t;
- var o = e.constructor,
- u = t.constructor;
- if (o !== u && !(x.isFunction(o) && o instanceof o && x.isFunction(u) && u instanceof u)) return ! 1;
- n.push(e),
- r.push(t);
- var a = 0,
- l = !0;
- if ("[object Array]" == i) {
- if (a = e.length, l = a == t.length) for (; a--&&(l = M(e[a], t[a], n, r)););
- } else {
- for (var c in e) if (x.has(e, c) && (a++, !(l = x.has(t, c) && M(e[c], t[c], n, r)))) break;
- if (l) {
- for (c in t) if (x.has(t, c) && !(a--)) break;
- l = !a
- }
- }
- return n.pop(),
- r.pop(),
- l
- };
- x.isEqual = function(e, t) {
- return M(e, t, [], [])
- },
- x.isEmpty = function(e) {
- if (null == e) return ! 0;
- if (x.isArray(e) || x.isString(e)) return 0 === e.length;
- for (var t in e) if (x.has(e, t)) return ! 1;
- return ! 0
- },
- x.isElement = function(e) {
- return !! e && 1 === e.nodeType
- },
- x.isArray = w ||
- function(e) {
- return "[object Array]" == f.call(e)
- },
- x.isObject = function(e) {
- return e === Object(e)
- },
- T(["Arguments", "Function", "String", "Number", "Date", "RegExp"],
- function(e) {
- x["is" + e] = function(t) {
- return f.call(t) == "[object " + e + "]"
- }
- }),
- x.isArguments(arguments) || (x.isArguments = function(e) {
- return !! e && !!x.has(e, "callee")
- }),
- "function" != typeof / . / &&(x.isFunction = function(e) {
- return "function" == typeof e
- }),
- x.isFinite = function(e) {
- return isFinite(e) && !isNaN(parseFloat(e))
- },
- x.isNaN = function(e) {
- return x.isNumber(e) && e != +e
- },
- x.isBoolean = function(e) {
- return e === !0 || e === !1 || "[object Boolean]" == f.call(e)
- },
- x.isNull = function(e) {
- return null === e
- },
- x.isUndefined = function(e) {
- return e === void 0
- },
- x.has = function(e, t) {
- return l.call(e, t)
- },
- x.noConflict = function() {
- return e._ = t,
- this
- },
- x.identity = function(e) {
- return e
- },
- x.times = function(e, t, n) {
- for (var r = Array(Math.max(0, e)), i = 0; e > i; i++) r[i] = t.call(n, i);
- return r
- },
- x.random = function(e, t) {
- return null == t && (t = e, e = 0),
- e + Math.floor(Math.random() * (t - e + 1))
- };
- var _ = {
- escape: {
- "&": "&",
- "<": "<",
- ">": ">",
- '"': """,
- "'": "'"
- }
- };
- _.unescape = x.invert(_.escape);
- var D = {
- escape: new RegExp("[" + x.keys(_.escape).join("") + "]", "g"),
- unescape: new RegExp("(" + x.keys(_.unescape).join("|") + ")", "g")
- };
- x.each(["escape", "unescape"],
- function(e) {
- x[e] = function(t) {
- return null == t ? "": ("" + t).replace(D[e],
- function(t) {
- return _[e][t]
- })
- }
- }),
- x.result = function(e, t) {
- if (null == e) return void 0;
- var n = e[t];
- return x.isFunction(n) ? n.call(e) : n
- },
- x.mixin = function(e) {
- T(x.functions(e),
- function(t) {
- var n = x[t] = e[t];
- x.prototype[t] = function() {
- var e = [this._wrapped];
- return o.apply(e, arguments),
- F.call(this, n.apply(x, e))
- }
- })
- };
- var P = 0;
- x.uniqueId = function(e) {
- var t = ++P + "";
- return e ? e + t: t
- },
- x.templateSettings = {
- evaluate: /<%([\s\S]+?)%>/g,
- interpolate: /<%=([\s\S]+?)%>/g,
- escape: /<%-([\s\S]+?)%>/g
- };
- var H = /(.)^/,
- B = {
- "'": "'",
- "\\": "\\",
- "\r": "r",
- "\n": "n",
- " ": "t",
- "\u2028": "u2028",
- "\u2029": "u2029"
- },
- j = /\\|'|\r|\n|\t|\u2028|\u2029/g;
- x.template = function(e, t, n) {
- var r;
- n = x.defaults({},
- n, x.templateSettings);
- var i = new RegExp([(n.escape || H).source, (n.interpolate || H).source, (n.evaluate || H).source].join("|") + "|$", "g"),
- s = 0,
- o = "__p+='";
- e.replace(i,
- function(t, n, r, i, u) {
- return o += e.slice(s, u).replace(j,
- function(e) {
- return "\\" + B[e]
- }),
- n && (o += "'+\n((__t=(" + n + "))==null?'':_.escape(__t))+\n'"),
- r && (o += "'+\n((__t=(" + r + "))==null?'':__t)+\n'"),
- i && (o += "';\n" + i + "\n__p+='"),
- s = u + t.length,
- t
- }),
- o += "';\n",
- n.variable || (o = "with(obj||{}){\n" + o + "}\n"),
- o = "var __t,__p='',__j=Array.prototype.join,print=function(){__p+=__j.call(arguments,'');};\n" + o + "return __p;\n";
- try {
- r = new Function(n.variable || "obj", "_", o)
- } catch(u) {
- throw u.source = o,
- u
- }
- if (t) return r(t, x);
- var a = function(e) {
- return r.call(this, e, x)
- };
- return a.source = "function(" + (n.variable || "obj") + "){\n" + o + "}",
- a
- },
- x.chain = function(e) {
- return x(e).chain()
- };
- var F = function(e) {
- return this._chain ? x(e).chain() : e
- };
- x.mixin(x),
- T(["pop", "push", "reverse", "shift", "sort", "splice", "unshift"],
- function(e) {
- var t = r[e];
- x.prototype[e] = function() {
- var n = this._wrapped;
- return t.apply(n, arguments),
- "shift" != e && "splice" != e || 0 !== n.length || delete n[0],
- F.call(this, n)
- }
- }),
- T(["concat", "join", "slice"],
- function(e) {
- var t = r[e];
- x.prototype[e] = function() {
- return F.call(this, t.apply(this._wrapped, arguments))
- }
- }),
- x.extend(x.prototype, {
- chain: function() {
- return this._chain = !0,
- this
- },
- value: function() {
- return this._wrapped
- }
- })
- }.call(this), define("underscore",
- function(e) {
- return function() {
- var t, n;
- return t || e._
- }
- } (this)), define("game/Game", ["require", "assetStorage", "cjs", "tweenjs", "FSM", "State", "soundjs", "underscore", "screenSize"],
- function(e) {
- var t = e("assetStorage"),
- n = e("cjs"),
- r = e("tweenjs"),
- i = e("FSM"),
- s = e("State"),
- o = e("soundjs"),
- u = e("underscore"),
- a = e("screenSize"),
- f = function(e, t, n, r) {
- this.init(e, t, n, r)
- },
- l = f.prototype = new n.EventDispatcher;
- return l.init = function(e, r, i, s) {
- this.initialize(),
- this._view = e,
- this._touchArea = r,
- this._startPos = 200,
- this._potentialContacts = [];
- var o = 1;
- this._hero = new n.Container,
- this._hero.x = this._startPos,
- this._hero.y = 530,
- this._heroVelocity = {
- x: 0,
- y: 0
- },
- this._heroAccel = {
- x: 0,
- y: 0
- };
- var u = t.getBitmap("gfx/hero.png");
- u.x = -(u.getBounds().width / 2),
- u.y = -(u.getBounds().height / 2),
- this._hero.addChild(u),
- this._hero.scaleX = this._hero.scaleY = o,
- this._heroHalfWidth = 40 * o,
- this._heroBound = new n.Rectangle(0, 0, this._heroHalfWidth * 2, this._heroHalfWidth * 2),
- this._view.addChild(this._hero),
- this._progressChangeSpeed = 2,
- this._gravity = 2e3,
- this._platforms = [],
- this._touchArea.on("mousedown",
- function() {
- this._wasMouseDown = !0
- },
- this),
- this._touchArea.on("pressup",
- function() {
- this._wasMouseUp = !0
- },
- this),
- this._lastAddedPlatformPos = {
- x: 0,
- y: 0
- },
- this._progressBar = i,
- this._view.addChild(i),
- this._scoreLabel = s,
- this._lastUpdateNum = 0,
- this._updateEveryNumPixels = 300,
- this._setUpWaterSegments(),
- this._createBigPlatform(),
- this._setUpGameFSM()
- },
- l.getCurrScore = function() {
- return Math.floor((this._hero.x - this._startPos) / 10)
- },
- l.getDistance = function() {
- return this._hero.x - this._startPos
- },
- l.replay = function() {
- this._hero.x = 200,
- this._hero.y = 550,
- this._heroVelocity = {
- x: 0,
- y: 0
- },
- this._heroAccel = {
- x: 0,
- y: 0
- },
- this._setUpGameFSM(),
- this._score = 0,
- this._hero.rotation = 0,
- this._removeAllPlatforms(),
- this._lastAddedPlatformPos = {
- x: 0,
- y: 0
- },
- this._createBigPlatform(),
- this._lastUpdateNum = 0
- },
- l._removeAllPlatforms = function() {
- var e;
- while (e = this._platforms.pop()) this._view.removeChild(e.view);
- this._potentialContacts.length = 0
- },
- l._updatePlatforms = function() {
- var e = [],
- n;
- for (var r = this._platforms.length; r--;) n = this._platforms[r],
- n.view.x + n.bounds.width < -this._view.x ? this._view.removeChild(n.view) : e.push(n);
- this._platforms = e;
- while (this._platforms.length < 10) {
- var i = this._lastAddedPlatformPos.x,
- s = this._lastAddedPlatformPos.y;
- n = t.getBitmap("gfx/platform.png"),
- n.mouseEnabled = !1,
- n.x = i + (this._lastAddedPlatformBound.width + (100 + Math.random() * 220 * this._computeDistanceFactor())),
- n.y = s + u.sample([ - (50 + Math.random() * 100 * this._computeDistanceFactor()), Math.random() * 650]),
- n.y > 650 ? n.y = 650 : n.y < 150 && (n.y = 150),
- this._lastAddedPlatformPos.x = n.x,
- this._lastAddedPlatformPos.y = n.y,
- this.addPlatform({
- view: n,
- bounds: n.getBounds()
- }),
- this._lastAddedPlatformBound = n.getBounds()
- }
- },
- l._computeDistanceFactor = function() {
- var e = .1,
- t = e + (1 - e) * (this.getCurrScore() / 800);
- return t > 1 ? 1 : t
- },
- l._createBigPlatform = function() {
- var e = t.getBitmap("gfx/bigPlatformMiddleSegment.png");
- for (var n = 0; n < 6; n++) {
- var r = e.clone();
- r.mouseEnabled = !1,
- r.x = r.getBounds().width * n - n,
- r.y = 650,
- this.addPlatform({
- view: r,
- bounds: r.getBounds()
- })
- }
- var i = t.getBitmap("gfx/bigPlatformEndSegment.png");
- i.mouseEnabled = !1,
- i.x = n * e.getBounds().width - n,
- i.y = 650,
- this.addPlatform({
- view: i,
- bounds: i.getBounds()
- }),
- this._lastAddedPlatformBound = i.getBounds(),
- this._lastAddedPlatformPos.x = i.x,
- this._lastAddedPlatformPos.y = i.y
- },
- l._setUpWaterSegments = function() {
- this._waterSegments = [];
- var e = new createjs.SpriteSheet({
- images: [t.get("gfx/waterAnim.png")],
- frames: [[2, 2, 186, 111, 0, -0.25, .15], [190, 2, 186, 111, 0, -0.25, .15], [2, 115, 186, 111, 0, -0.25, .15], [190, 115, 186, 111, 0, -0.25, .15], [2, 228, 186, 111, 0, -0.25, .15]],
- animations: {
- idle: {
- frames: [0, 1, 2, 3, 4, 3, 2, 1]
- }
- }
- }),
- r = 184,
- i = Math.ceil(a.width / r) + 1;
- for (var s = 0; s < i; s++) {
- var o = new n.Sprite(e);
- o.mouseEnabled = !1,
- o.framerate = 10,
- this._waterSegments.push(o),
- this._view.addChild(o),
- o.y = 700,
- o.gotoAndPlay("idle")
- }
- },
- l._updateWater = function() {
- var e = this._waterSegments,
- t = 0 - this._view.x,
- n = 184,
- r = t % n;
- for (var i = e.length; i--;) {
- var s = e[i];
- s.x = t - r + i * n
- }
- },
- l._setUpGameFSM = function() {
- var e = this,
- t = new s,
- n = new s(function() {
- e._doGameOver()
- });
- t.addTransition(n,
- function() {
- return e._doControl(),
- e._moveHero(),
- e._resolveCollisions(),
- e._moveCamera(),
- e._updateProgress(),
- e._updateScoreLabel(),
- e._updateWater(),
- e._lastUpdateNum < Math.floor(e.getDistance() / e._updateEveryNumPixels) && (e._lastUpdateNum = Math.floor(e.getDistance() / e._updateEveryNumPixels), e._updatePlatforms()),
- e._checkGameOver() ? (o.Sound.play("sfx/splash.mp3"), !0) : !1
- }),
- this._gameFMS = new i(t)
- },
- l.update = function(e) {
- this._dt = e,
- this._gameFMS.execute(),
- this._updateControl()
- },
- l.addPlatform = function(e) {
- this._platforms.push(e),
- this._view.addChild(e.view)
- },
- l._lastAddedPlatformPos = null,
- l._lastAddedPlatformBound = null,
- l._waterSegments = null,
- l._dt = 0,
- l._gameFMS = null,
- l._view = null,
- l._touchArea = null,
- l._gravity = null,
- l._hero = null,
- l._heroBound = null,
- l._heroVelocity = null,
- l._heroAccel = null,
- l._heroBound = null,
- l._heroHalfWidth = 0,
- l._platforms = null,
- l._currContact = null,
- l._maxVelocity = 700,
- l._potentialContacts = null,
- l._wasMouseDown = !1,
- l._mouseDown = !1,
- l._wasMouseUp = !1,
- l._progressChangeSpeed = 0,
- l._currProgress = 0,
- l._progressBar = null,
- l._startPos = 0,
- l._scoreLabel = null,
- l._score = 0,
- l._platformDistanceFactor = 0,
- l._doGameOver = function() {
- this.dispatchEvent(new n.Event("gameOver"))
- },
- l._checkGameOver = function() {
- return this._hero.y > 800
- },
- l._updateScoreLabel = function() {
- this._scoreLabel.setText(this.getCurrScore().toString())
- },
- l._doControl = function() {
- if (this._currContact && this._wasMouseUp) {
- var e = this._computeCurrProgress(),
- t = -60 * (Math.PI / 180);
- this._heroVelocity.x = Math.cos(t) * (250 + 850 * e),
- this._heroVelocity.y = Math.sin(t) * (250 + 850 * e),
- r.Tween.get(this._hero).to({
- rotation: this._hero.rotation + 90
- },
- 200 + 500 * e),
- o.Sound.play("sfx/jump.mp3")
- }
- },
- l._moveCamera = function() {
- this._view.x = -(this._hero.x - 150),
- this._view.x > 0 && (this._view.x = 0)
- },
- l._moveHero = function() {
- var e = this._dt,
- t = this._heroAccel.x,
- n = this._heroAccel.y + this._gravity;
- this._heroVelocity.x += t * e,
- this._heroVelocity.y += n * e,
- this._heroVelocity.y > this._maxVelocity && (this._heroVelocity.y = this._maxVelocity),
- this._hero.x += this._heroVelocity.x * e,
- this._hero.y += this._heroVelocity.y * e
- },
- l._resolveCollisions = function() {
- this._currContact && (this._isOverlapWithPlatform(this._currContact.platform) ? this._resolveHeroVsPlatformCollision(this._currContact) : this._currContact = null);
- if (!this._currContact) for (var e = this._platforms.length; e--;) {
- var t = this._platforms[e];
- if (this._isOverlapWithPlatform(t)) {
- if (this._potentialContacts.indexOf(t) != -1) continue;
- this._currContact = this._getContactWith(t),
- this._currContact ? (this._resolveHeroVsPlatformCollision(this._currContact), o.Sound.play("sfx/landing.mp3")) : this._potentialContacts.push(t)
- } else this._potentialContacts.indexOf(t) != -1 && this._potentialContacts.splice(this._potentialContacts.indexOf(t), 1)
- }
- },
- l._updateProgress = function() {
- this._mouseDown && (this._currProgress += this._progressChangeSpeed * this._dt),
- this._wasMouseUp && (this._currProgress = 0),
- this._setProgressBarProgress(this._computeCurrProgress()),
- this._progressBar.x = this._hero.x - 65,
- this._progressBar.y = this._hero.y - this._heroHalfWidth - 50
- },
- l._computeCurrProgress = function() {
- var e;
- return this._currProgress % 2 < 1 ? e = this._currProgress % 1 : e = 1 - this._currProgress % 1,
- e
- },
- l._updateControl = function() {
- this._wasMouseDown && (this._mouseDown = !0),
- this._wasMouseUp && (this._mouseDown = !1),
- this._wasMouseDown = !1,
- this._wasMouseUp = !1
- },
- l._isOverlapWithPlatform = function(e) {
- var t = this._getHeroBound(),
- n = e.bounds;
- return n.x = e.view.x,
- n.y = e.view.y,
- t.y + t.height > n.y && t.y < n.y + n.height && t.x + t.width > n.x && t.x < n.x + n.width
- },
- l._getContactWith = function(e) {
- var t = this._getHeroBound(),
- n = e.bounds;
- n.x = e.view.x,
- n.y = e.view.y;
- var r = n.x + n.width - t.x,
- i = t.x + t.width - n.x,
- s = n.y + n.height - t.y,
- o = t.y + t.height - n.y;
- return o < r && o < i && o < s ? {
- penetration: o,
- platform: e
- }: null
- },
- l._resolveHeroVsPlatformCollision = function(e) {
- var t = e.platform,
- n = this._getHeroBound();
- this._hero.y = t.view.y - n.height / 2,
- this._heroVelocity.x = this._heroVelocity.y = 0
- },
- l._getHeroBound = function() {
- return this._heroBound.x = this._hero.x - this._heroHalfWidth,
- this._heroBound.y = this._hero.y - this._heroHalfWidth,
- this._heroBound
- },
- l._setProgressBarProgress = function(e) {
- this._progressBar.setValue(e)
- },
- f
- }), define("bitmapText/BitmapFont", ["require"],
- function(e) {
- var t = function(e, t) {},
- n = t.prototype;
- return n.getImage = function() {
- return this._img
- },
- n.getCharData = function(e) {
- return this.getCharDataByCode(e.charCodeAt(0))
- },
- n.getCharDataByCode = function(e) {
- for (var t = 0; t < this._chars.length; t++) if (this._chars[t].id == e) return this._chars[t];
- return null
- },
- n.getKerning = function(e, t) {
- var n = e.charCodeAt(0),
- r = t.charCodeAt(0);
- for (var i = 0; i < this._kernings.length; i++) if (this._kernings[i].first == n && this._kernings[i].second == r) return Number(this._kernings[i].amount);
- return undefined
- },
- n.initWithXml = function(e, t) {
- this._img = e,
- this.parseXml(t)
- },
- n.initWithJson = function(e, t) {
- this._img = e,
- this.parseJson(t)
- },
- n.parseXml = function(e) {
- var t = e.childNodes[0].getElementsByTagName("chars")[0].getElementsByTagName("char"),
- n = [],
- r = [];
- for (var i = 0; i < t.length; i++) {
- var s = {};
- s.id = t[i].getAttribute("id"),
- s.x = t[i].getAttribute("x"),
- s.y = t[i].getAttribute("y"),
- s.xAdvance = t[i].getAttribute("xadvance"),
- s.xOffset = t[i].getAttribute("xoffset"),
- s.yOffset = t[i].getAttribute("yoffset"),
- s.width = t[i].getAttribute("width"),
- s.height = t[i].getAttribute("height"),
- n.push(s)
- }
- if (e.childNodes[0].getElementsByTagName("kernings")[0] != null) {
- var o = e.childNodes[0].getElementsByTagName("kernings")[0].getElementsByTagName("kerning");
- for (var u = 0; u < o.length; u++) {
- var s = {};
- s.first = o[u].getAttribute("first"),
- s.second = o[u].getAttribute("second"),
- s.amount = o[u].getAttribute("amount"),
- r.push(s)
- }
- }
- this._chars = n,
- this._kernings = r
- },
- n.parseJson = function(e) {
- this._chars = e.chars.data.concat(),
- this._kernings = e.kernings.data.concat()
- },
- n._font = "",
- n._lineHeight = 0,
- n._spaceWidth = 0,
- n._base = 0,
- n._scaleW = 0,
- n._scaleH = 0,
- n._chars = null,
- n._kernings = null,
- n._img = null,
- n._offsetX = 0,
- n._offsetY = 0,
- t
- }), define("bitmapText/BitmapTextField", ["require", "cjs"],
- function(e) {
- var t = e("cjs"),
- n = function(e) {
- this.initialize(e)
- };
- n.format = {
- left: "left",
- center: "center",
- right: "right"
- };
- var r = n.prototype = new t.DisplayObject;
- return r.DisplayObject_initialize = r.initialize,
- r.initialize = function(e) {
- this.DisplayObject_initialize(),
- this._font = e,
- this._lines = [],
- this._lineWidths = [],
- this._invalidate()
- },
- r.DisplayObject_draw = r.draw,
- r.drawBorder = !1,
- r.getText = function() {
- return this._text
- },
- r.setText = function(e) {
- if (this._text.localeCompare(e) === 0) return;
- this._text = e,
- this._invalidate()
- },
- r.setSize = function(e, t) {
- this._width = e,
- this._height = t,
- this._invalidate()
- },
- r.setFormat = function(e) {
- this._format = e
- },
- r.setLetterSpacing = function(e) {
- if (this._letterSpacing === e) return;
- this._letterSpacing = e,
- this._invalidate()
- },
- r.getBounds = function() {
- return new t.Rectangle(0, 0, this._width, this._height)
- },
- r.draw = function(e, t) {
- return this.DisplayObject_draw(e, t) ? !0 : (this._invalid && this._validate(), this._doDraw(e), !0)
- },
- r._invalid = !0,
- r._text = "",
- r._lineHeight = 30,
- r._font = null,
- r._format = n.format.left,
- r._letterSpacing = 0,
- r._lineSpacing = "",
- r._leftMargin = "",
- r._rightMargin = "",
- r._width = 0,
- r._height = 0,
- r._cache = null,
- r._cursorX = 0,
- r._lines = null,
- r._lineWidths = null,
- r._currLineNum = 0,
- r._spaceWidth = 0,
- r._doDraw = function(e) {
- var t = this._font.getImage(),
- n = 0,
- r = 0;
- this.drawBorder && e.strokeRect(0, 0, this._width, this._height);
- for (var i = 0; i < this._lines.length; i++) {
- var s = this._lines[i];
- this._drawLine(e, t, s, this._computeXPosition(this._lineWidths[i]), r),
- r += this._lineHeight
- }
- },
- r._computeXPosition = function(e) {
- var t = 0;
- switch (this._format) {
- case n.format.center:
- t = this._width / 2 - e / 2;
- break;
- case n.format.right:
- t = this._width - e
- }
- return t
- },
- r._drawLine = function(e, t, n, r, i) {
- for (var s = 0; s < n.length; s++) {
- var o = n[s];
- if (o == " ") r += this._spaceWidth;
- else for (var u = 0; u < o.length; u++) {
- var a = this._font.getCharData(o.charAt(u)),
- f;
- u > 0 && (f = this._font.getKerning(o.charAt(u - 1), o.charAt(u))),
- f = f || 0,
- e.drawImage(t, a.x, a.y, a.width, a.height, r + f, i, a.width, a.height),
- r += Number(a.xadvance) + f + this._letterSpacing
- }
- }
- },
- r._invalidate = function() {
- this._invalid = !0
- },
- r._validate = function() {
- this._cursorX = 0,
- this._lines.length = 0,
- this._lineWidths.length = 0,
- this._lines.push([]),
- this._lineWidths.push(0),
- this._currLineNum = 0;
- var e = "",
- t = this._text,
- n = !1,
- r = t.length;
- for (var i = 0; i < r; i++) {
- var s = t.charAt(i);
- n = s === "\n" || s === " " || s == " ",
- n ? e.length > 0 && (this._pushWorld(e), e = "") : e += s,
- n && (s === "\n" ? this._pushNewLine() : s === " " ? this._pushTab() : s === " " && this._pushSpace())
- }
- e.length > 0 && this._pushWorld(e),
- this._invalid = !1
- },
- r._pushWorld = function(e) {
- var t = this._measureWordWidth(e);
- this._cursorX + t <= this._width || this._lines[this._currLineNum].length == 0 ? this._lines[this._currLineNum].push(e) : (this._pushNewLine(), this._lines[this._currLineNum].push(e)),
- this._cursorX += t,
- this._lineWidths[this._currLineNum] = this._cursorX
- },
- r._pushSpace = function() {
- this._lines[this._currLineNum].push(" "),
- this._cursorX += this._spaceWidth
- },
- r._pushTab = function() {},
- r._pushNewLine = function() {
- this._lineWidths.push(0),
- this._currLineNum++,
- this._lines.push([]),
- this._cursorX = 0
- },
- r._measureWordWidth = function(e) {
- var t = e.length;
- if (t == 0) return 0;
- var n = 0,
- r = e.charAt(0),
- i = this._font.getCharData(r);
- i && (n += i.xadvance);
- var s = null;
- for (var o = 1; o < e.length; o++) r = e.charAt(o),
- i = this._font.getCharData(r),
- i && (n += i.xadvance),
- s = this._font.getKerning(e.charAt(o - 1), r),
- s && (n += s),
- n += this._letterSpacing;
- return n
- },
- n
- }), define("screens/GameOverPopUp", ["require", "assetStorage", "cjs", "bitmapText/BitmapFont", "bitmapText/BitmapTextField", "screenSize"],
- function(e) {
- var t = e("assetStorage"),
- n = e("cjs"),
- r = e("bitmapText/BitmapFont"),
- i = e("bitmapText/BitmapTextField"),
- s = e("screenSize"),
- o = function() {
- this.initialize(),
- this.create()
- },
- u = o.prototype = new n.Container;
- return u.setScore = function(e) {
- this._score.setText(e)
- },
- u.setBestScore = function(e) {
- this._bestScore.setText(e)
- },
- u.create = function() {
- var e = new n.Shape;
- e.graphics.beginFill("rgba(0, 0, 0, 0.3)").drawRect(0, 0, s.width, s.height),
- this.addChild(e);
- var o = new n.Container,
- u = t.getBitmap("gfx/gameOverSign.png");
- o.addChild(u);
- var a = new n.Container,
- f = t.getBitmap("gfx/scoreSign.png");
- f.x = 0,
- f.y = 0,
- a.addChild(f);
- var l = t.getBitmap("gfx/bestSign.png");
- l.x = 250,
- l.y = 0,
- a.addChild(l);
- var c = new r;
- c.initWithJson(t.get("gfx/font.png"), t.get("gfx/font.json"));
- var h = new i(c);
- h.setText("000"),
- h.setSize(205, 100),
- h.x = f.x + (f.getBounds().width - h.getBounds().width) / 2,
- h.y = 60,
- h.setLetterSpacing( - 5),
- h.setFormat(i.format.center),
- h.mouseEnabled = !1,
- a.addChild(h),
- this._score = h;
- var p = new i(c);
- p.setSize(205, 100),
- p.setText("000"),
- p.x = l.x + (l.getBounds().width - p.getBounds().width) / 2,
- p.y = 60,
- p.setLetterSpacing( - 5),
- p.setFormat(i.format.center),
- p.mouseEnabled = !1,
- a.addChild(p),
- this._bestScore = p,
- a.x = (u.getBounds().width - a.getBounds().width) / 2 - a.getBounds().x,
- a.y = u.y + 150,
- o.x = (s.width - o.getBounds().width) / 2,
- o.y = (s.height - 325) / 2,
- o.addChild(a),
- this.addChild(o);
- var d = t.getBitmap("gfx/tapToContinueSign.png");
- d.x = (s.width - d.getBounds().width) / 2,
- d.y = s.height - d.getBounds().height - 20,
- this.addChild(d)
- },
- u.show = function(e) {
- e.addChild(this)
- },
- u.close = function() {
- this.parent && this.parent.removeChild(this)
- },
- u._score = null,
- u._bestScore = null,
- o
- }), define("ProgressBarRenderer", ["require", "assetStorage", "cjs"],
- function(e) {
- var t = e("assetStorage"),
- n = e("cjs"),
- r = function() {
- this.init()
- },
- i = r.prototype;
- return i.init = function() {},
- i.createView = function() {
- this._owner.addChild(t.getBitmap("gfx/progressBarBackground.png"));
- var e = t.getBitmap("gfx/progressBarForeground.png");
- e.x = 12,
- e.y = 6,
- this._owner.addChild(e),
- this._foreground = e
- },
- i.validate = function() {
- this._foreground.scaleX = this._owner.getComputedValue() * 100 / 12
- },
- i._setOwner = function(e) {
- this._owner = e,
- this._owner.removeAllChildren(),
- this.createView()
- },
- i._owner = null,
- i._foreground = null,
- r
- }), define("gui/ProgressBar", ["cjs", "../ProgressBarRenderer"],
- function(e, t) {
- var n = function() {
- this.initialize(new t)
- },
- r = n.prototype = new e.Container;
- return r.Container_draw = r.draw,
- r.Container_initialize = r.initialize,
- r.initialize = function(e) {
- this.Container_initialize(),
- this.setRenderer(e)
- },
- r.getRenderer = function() {
- return this._renderer
- },
- r.setRenderer = function(e) {
- this._renderer = e,
- this._renderer._setOwner(this)
- },
- r.getValue = function() {
- return this._value
- },
- r.setValue = function(e) {
- if (this._value == e) return;
- this._value = e,
- this.invalidate()
- },
- r.getMinValue = function() {
- return this._minValue
- },
- r.setMinValue = function(e) {
- if (this._minValue == e) return;
- this._minValue = e,
- this.invalidate()
- },
- r.getMaxValue = function() {
- return this._maxValue
- },
- r.setMaxValue = function(e) {
- if (this._maxValue == e) return;
- this._maxValue = e,
- this.invalidate()
- },
- r.getComputedValue = function() {
- var e = 1 / ((this._maxValue - this._minValue) / (this._value - this._minValue));
- return e < 0 ? 0 : e > 1 ? 1 : e
- },
- r.invalidate = function() {
- this._invalid || (this._invalid = !0)
- },
- r.validate = function() {
- this._invalid = !1,
- this._renderer.validate()
- },
- r.draw = function(e, t) {
- return this._invalid && this.validate(),
- this.Container_draw(e, t)
- },
- r._invalid = !0,
- r._value = .5,
- r._minValue = 0,
- r._maxValue = 1,
- r._renderer = null,
- n
- }), define("screens/GameScreen", ["require", "Screen", "cjs", "assetStorage", "game/Game", "screens/GameOverPopUp", "gui/ProgressBar", "gui/BitmapButton", "bitmapText/BitmapFont", "bitmapText/BitmapTextField", "tweenjs", "screenSize"],
- function(e) {
- var t = e("Screen"),
- n = e("cjs"),
- r = e("assetStorage"),
- i = e("game/Game"),
- s = e("screens/GameOverPopUp"),
- o = e("gui/ProgressBar"),
- u = e("gui/BitmapButton"),
- a = e("bitmapText/BitmapFont"),
- f = e("bitmapText/BitmapTextField"),
- l = e("tweenjs"),
- c = e("screenSize"),
- h = function(e, t) {
- this.init(e, t)
- },
- p = h.prototype = new t;
- return p.init = function(e, t) {
- this._gameStage = e,
- this._storage = t
- },
- p.didScreenSelected = function() {
- this._paused = !1
- },
- p.didScreenUnselected = function() {
- this._paused = !0
- },
- p._build = function() {
- var e = new n.Container,
- t = new n.Shape;
- t.graphics.beginFill("rgba(0, 0, 0, 0.01)").drawRect(0, 0, c.width, c.height),
- this.addChild(e),
- this.addChild(t);
- var s = new a;
- s.initWithJson(r.get("gfx/smallDigits.png"), r.get("gfx/smallDigits.json"));
- var h = new f(s);
- h.x = 0,
- h.y = 39,
- h.setLetterSpacing( - 4),
- h.setSize(c.width, 55),
- h.setFormat(f.format.center),
- h.mouseEnabled = !1,
- this.addChild(h);
- var p = r.getBitmap("gfx/scoreSignSmall.png");
- p.x = (c.width - p.getBounds().width) / 2,
- p.y = 13.5,
- this.addChild(p);
- var d = new o;
- d.x = 300,
- d.y = 300,
- d.setValue(.3);
- var v = new n.Container;
- v.y = c.height - 800,
- this.addChild(v),
- this._game = new i(v, t, d, h),
- this._game.on("gameOver",
- function() {
- this._showGameOverPopUp()
- },
- this);
- var m = this._createTutorialSprite();
- this.addChild(m),
- l.Tween.get(m).wait(5e3).to({
- alpha: 0
- },
- 500, l.Ease.backIn).call(function(e) {
- this.removeChild(e)
- },
- [m], this);
- var g = r.getBitmap("gfx/pauseButton.png"),
- y = u.createButton({
- x: c.width - 15,
- y: 15,
- anchorX: 1,
- anchorY: 0,
- flags: {
- "default": {
- active: g
- }
- }
- });
- y.on("click",
- function() {
- this.getScreenController().goToScreen("mainMenuScreen")
- },
- this),
- this.addChild(y),
- n.Ticker.on("tick",
- function(e) {
- if (this._paused) return;
- var t = n.Ticker.getTime(),
- r = (t - this._prevTime) / 1e3;
- r > .05 && (r = .05),
- this._game.update(r),
- this._prevTime = t
- },
- this)
- },
- p._showGameOverPopUp = function() {
- var e = this._storage.get("bestScore"),
- t = this._game.getCurrScore();
-
- //dp_submitScore(t);
- if (!e || e < t) e = t,
- this._storage.set("bestScore", e);
- var n = new s;
- n.show(this),
- n.setScore(t.toString()),
- n.setBestScore(e.toString());
- var r = n.on("click",
- function(e) {
- this._game.replay(),
- n.close(),
- n.off("click", r)
- },
- this)
- },
- p._createTutorialSprite = function() {
- var e = new createjs.SpriteSheet({
- images: [r.get("gfx/tutorial.png")],
- frames: [[1, 1, 126, 227, 0, 5.95, 3.95], [128, 1, 126, 227, 0, 5.95, 3.95]],
- animations: {
- idle: {
- frames: [0, 1]
- }
- }
- }),
- t = new n.Sprite(e);
- return t.x = (c.width - t.getBounds().width) / 2,
- t.y = c.height / 4,
- t.mouseEnabled = !1,
- t.framerate = 1,
- t.gotoAndPlay("idle"),
- t
- },
- p._prevTime = 0,
- p._storage = null,
- p._gameStage = null,
- p._game = null,
- p.paused = !1,
- h
- }), define("screens/PreloadingScreen", ["require", "Screen", "cjs", "wuki"],
- function(e) {
- var t = e("Screen"),
- n = e("cjs"),
- r = e("wuki"),
- i = function(e, t) {
- this.init(e, t)
- },
- s = i.prototype = new t;
- return s.init = function(e, t) {
- this.initialize(),
- this._loader = e,
- this._screenSize = t,
- this.mouseChildren = !1
- },
- s._loaderCompleteEventListener = null,
- s._loaderProgressEventListener = null,
- s._barForeground = null,
- s._loader = null,
- s._screenSize = null,
- s._build = function() {
- var e = 260,
- t = 10,
- r = new n.Shape;
- r.graphics.beginStroke("#ffffff").setStrokeStyle(2).beginFill("rgba(0, 0, 0, 0)").drawRect(0, 0, e, t),
- r.x = this._screenSize.width / 2 - e / 2,
- r.y = this._screenSize.height / 2 - t / 2,
- this.addChild(r);
- var i = new n.Shape;
- i.x = r.x,
- i.y = r.y,
- this.addChild(i),
- this._barForeground = i;
- var s = new n.Text("Loading", "bold 30px Arial, Helvetica, sans-serif", "#ffffff");
- s.x = this._screenSize.width / 2 - s.getBounds().width / 2,
- s.y = r.y - 40,
- s.name = "loadingText",
- this.addChild(s);
- var o = new n.Shape;
- o.graphics.beginFill("#ffffff").drawRect(0, 0, this._screenSize.width, this._screenSize.height),
- this.hitArea = o,
- this._loaderProgressEventListener = this._loader.on("progress", this._handleLoadQueueProgressEvent, this),
- this._loaderCompleteEventListener = this._loader.on("complete", this._handleLoadQueueCompleteEvent, this)
- },
- s._handleLoadQueueProgressEvent = function(e) {
- this._barForeground.graphics.clear().beginStroke("#ffffff").setStrokeStyle(2).beginFill("#ffffff").drawRect(0, 0, e.progress * 260, 10)
- },
- s._handleLoadQueueCompleteEvent = function() {
- this._loader.off("progress", this._loaderProgressEventListener),
- this._loader.off("complete", this._loaderCompleteEventListener),
- this._loaderProgressEventListener = null,
- this._loaderCompleteEventListener = null;
- var e = this;
- r("showSplash",
- function() {
- e.getScreenController().goToScreen("mainMenuScreen")
- })
- },
- i
- }), define("ScreenController", [],
- function() {
- var e = function(e) {
- this._activeScreen = null,
- this._screens = null,
- this._view = e
- },
- t = e.prototype;
- return t.getActiveScreen = function() {
- return this._activeScreen
- },
- t.getScreens = function() {
- return this._screens
- },
- t.setScreens = function(e) {
- var t = {};
- for (var n in e) e.hasOwnProperty(n) && (t[n] = e[n], t[n]._name = n);
- this._screens = t
- },
- t.goToScreen = function(e) {
- if (!this._screens.hasOwnProperty(e)) throw new Error("Can't find screen with provided name: " + e);
- var t = this._screens[e];
- t._builded || (t._build(), t._builded = !0),
- this._pushScreen(t)
- },
- t._pushScreen = function(e) {
- this._activeScreen && (this._activeScreen.didScreenUnselected(), this._activeScreen._screenController = null, this._view.removeChild(this._activeScreen)),
- this._activeScreen = e,
- this._activeScreen && (this._activeScreen._screenController = this, this._activeScreen.didScreenSelected(this), this._view.addChild(this._activeScreen))
- },
- e
- }), this.createjs = this.createjs || {},
- function() {
- var e = createjs.PreloadJS = createjs.PreloadJS || {};
- e.version = "0.4.1",
- e.buildDate = "Thu, 12 Dec 2013 23:33:38 GMT"
- } (), this.createjs = this.createjs || {},
- function() {
- var e = function(e, t, n) {
- this.initialize(e, t, n)
- },
- t = e.prototype;
- t.type = null,
- t.target = null,
- t.currentTarget = null,
- t.eventPhase = 0,
- t.bubbles = !1,
- t.cancelable = !1,
- t.timeStamp = 0,
- t.defaultPrevented = !1,
- t.propagationStopped = !1,
- t.immediatePropagationStopped = !1,
- t.removed = !1,
- t.initialize = function(e, t, n) {
- this.type = e,
- this.bubbles = t,
- this.cancelable = n,
- this.timeStamp = (new Date).getTime()
- },
- t.preventDefault = function() {
- this.defaultPrevented = !0
- },
- t.stopPropagation = function() {
- this.propagationStopped = !0
- },
- t.stopImmediatePropagation = function() {
- this.immediatePropagationStopped = this.propagationStopped = !0
- },
- t.remove = function() {
- this.removed = !0
- },
- t.clone = function() {
- return new e(this.type, this.bubbles, this.cancelable)
- },
- t.toString = function() {
- return "[Event (type=" + this.type + ")]"
- },
- createjs.Event = e
- } (), this.createjs = this.createjs || {},
- function() {
- var e = function() {},
- t = e.prototype;
- e.initialize = function(e) {
- e.addEventListener = t.addEventListener,
- e.on = t.on,
- e.removeEventListener = e.off = t.removeEventListener,
- e.removeAllEventListeners = t.removeAllEventListeners,
- e.hasEventListener = t.hasEventListener,
- e.dispatchEvent = t.dispatchEvent,
- e._dispatchEvent = t._dispatchEvent,
- e.willTrigger = t.willTrigger
- },
- t._listeners = null,
- t._captureListeners = null,
- t.initialize = function() {},
- t.addEventListener = function(e, t, n) {
- var r;
- r = n ? this._captureListeners = this._captureListeners || {}: this._listeners = this._listeners || {};
- var i = r[e];
- return i && this.removeEventListener(e, t, n),
- i = r[e],
- i ? i.push(t) : r[e] = [t],
- t
- },
- t.on = function(e, t, n, r, i, s) {
- return t.handleEvent && (n = n || t, t = t.handleEvent),
- n = n || this,
- this.addEventListener(e,
- function(e) {
- t.call(n, e, i),
- r && e.remove()
- },
- s)
- },
- t.removeEventListener = function(e, t, n) {
- var r = n ? this._captureListeners: this._listeners;
- if (r) {
- var i = r[e];
- if (i) for (var s = 0,
- o = i.length; o > s; s++) if (i[s] == t) {
- 1 == o ? delete r[e] : i.splice(s, 1);
- break
- }
- }
- },
- t.off = t.removeEventListener,
- t.removeAllEventListeners = function(e) {
- e ? (this._listeners && delete this._listeners[e], this._captureListeners && delete this._captureListeners[e]) : this._listeners = this._captureListeners = null
- },
- t.dispatchEvent = function(e, t) {
- if ("string" == typeof e) {
- var n = this._listeners;
- if (!n || !n[e]) return ! 1;
- e = new createjs.Event(e)
- }
- if (e.target = t || this, e.bubbles && this.parent) {
- for (var r = this,
- i = [r]; r.parent;) i.push(r = r.parent);
- var s, o = i.length;
- for (s = o - 1; s >= 0 && !e.propagationStopped; s--) i[s]._dispatchEvent(e, 1 + (0 == s));
- for (s = 1; o > s && !e.propagationStopped; s++) i[s]._dispatchEvent(e, 3)
- } else this._dispatchEvent(e, 2);
- return e.defaultPrevented
- },
- t.hasEventListener = function(e) {
- var t = this._listeners,
- n = this._captureListeners;
- return !! (t && t[e] || n && n[e])
- },
- t.willTrigger = function(e) {
- for (var t = this; t;) {
- if (t.hasEventListener(e)) return ! 0;
- t = t.parent
- }
- return ! 1
- },
- t.toString = function() {
- return "[EventDispatcher]"
- },
- t._dispatchEvent = function(e, t) {
- var n, r = 1 == t ? this._captureListeners: this._listeners;
- if (e && r) {
- var i = r[e.type];
- if (!i || !(n = i.length)) return;
- e.currentTarget = this,
- e.eventPhase = t,
- e.removed = !1,
- i = i.slice();
- for (var s = 0; n > s && !e.immediatePropagationStopped; s++) {
- var o = i[s];
- o.handleEvent ? o.handleEvent(e) : o(e),
- e.removed && (this.off(e.type, o, 1 == t), e.removed = !1)
- }
- }
- },
- createjs.EventDispatcher = e
- } (), this.createjs = this.createjs || {},
- function() {
- createjs.indexOf = function(e, t) {
- for (var n = 0,
- r = e.length; r > n; n++) if (t === e[n]) return n;
- return - 1
- }
- } (), this.createjs = this.createjs || {},
- function() {
- createjs.proxy = function(e, t) {
- var n = Array.prototype.slice.call(arguments, 2);
- return function() {
- return e.apply(t, Array.prototype.slice.call(arguments, 0).concat(n))
- }
- }
- } (), this.createjs = this.createjs || {},
- function() {
- var e = function() {
- this.init()
- };
- e.prototype = new createjs.EventDispatcher;
- var t = e.prototype,
- n = e;
- n.FILE_PATTERN=/^(?:(\w+:)\/{2}(\w+(?:\.\w+)*\/?)|(.{0,2}\/{1}))?([/.]*?(?:[^?]+)?\/)?((?:[^/?]+)\.(\w+))(?:\?(\S+)?)?$/,n.PATH_PATTERN=/^(?:(\w+:)\/{2})|(.{0,2}\/{1})?([/.]*?(?:[^?]+)?\/?)?$/,t.loaded = !1, t.canceled = !1, t.progress = 0, t._item = null, t.getItem = function() {
- return this._item
- },
- t.init = function() {},
- t.load = function() {},
- t.close = function() {},
- t._sendLoadStart = function() {
- this._isCanceled() || this.dispatchEvent("loadstart")
- },
- t._sendProgress = function(e) {
- if (!this._isCanceled()) {
- var t = null;
- "number" == typeof e ? (this.progress = e, t = new createjs.Event("progress"), t.loaded = this.progress, t.total = 1) : (t = e, this.progress = e.loaded / e.total, (isNaN(this.progress) || 1 / 0 == this.progress) && (this.progress = 0)),
- t.progress = this.progress,
- this.hasEventListener("progress") && this.dispatchEvent(t)
- }
- },
- t._sendComplete = function() {
- this._isCanceled() || this.dispatchEvent("complete")
- },
- t._sendError = function(e) { ! this._isCanceled() && this.hasEventListener("error") && (null == e && (e = new createjs.Event("error")), this.dispatchEvent(e))
- },
- t._isCanceled = function() {
- return null == window.createjs || this.canceled ? !0 : !1
- },
- t._parseURI = function(e) {
- return e ? e.match(n.FILE_PATTERN) : null
- },
- t._parsePath = function(e) {
- return e ? e.match(n.PATH_PATTERN) : null
- },
- t._formatQueryString = function(e, t) {
- if (null == e) throw new Error("You must specify data.");
- var n = [];
- for (var r in e) n.push(r + "=" + escape(e[r]));
- return t && (n = n.concat(t)),
- n.join("&")
- },
- t.buildPath = function(e, t) {
- if (null == t) return e;
- var n = [],
- r = e.indexOf("?");
- if ( - 1 != r) {
- var i = e.slice(r + 1);
- n = n.concat(i.split("&"))
- }
- return - 1 != r ? e.slice(0, r) + "?" + this._formatQueryString(t, n) : e + "?" + this._formatQueryString(t, n)
- },
- t._isCrossDomain = function(e) {
- var t = document.createElement("a");
- t.href = e.src;
- var n = document.createElement("a");
- n.href = location.href;
- var r = "" != t.hostname && (t.port != n.port || t.protocol != n.protocol || t.hostname != n.hostname);
- return r
- },
- t._isLocal = function(e) {
- var t = document.createElement("a");
- return t.href = e.src,
- "" == t.hostname && "file:" == t.protocol
- },
- t.toString = function() {
- return "[PreloadJS AbstractLoader]"
- },
- createjs.AbstractLoader = e
- } (), this.createjs = this.createjs || {},
- function() {
- var e = function(e, t, n) {
- this.init(e, t, n)
- },
- t = e.prototype = new createjs.AbstractLoader,
- n = e;
- n.loadTimeout = 8e3,
- n.LOAD_TIMEOUT = 0,
- n.BINARY = "binary",
- n.CSS = "css",
- n.IMAGE = "image",
- n.JAVASCRIPT = "javascript",
- n.JSON = "json",
- n.JSONP = "jsonp",
- n.MANIFEST = "manifest",
- n.SOUND = "sound",
- n.SVG = "svg",
- n.TEXT = "text",
- n.XML = "xml",
- n.POST = "POST",
- n.GET = "GET",
- t._basePath = null,
- t._crossOrigin = "",
- t.useXHR = !0,
- t.stopOnError = !1,
- t.maintainScriptOrder = !0,
- t.next = null,
- t._typeCallbacks = null,
- t._extensionCallbacks = null,
- t._loadStartWasDispatched = !1,
- t._maxConnections = 1,
- t._currentlyLoadingScript = null,
- t._currentLoads = null,
- t._loadQueue = null,
- t._loadQueueBackup = null,
- t._loadItemsById = null,
- t._loadItemsBySrc = null,
- t._loadedResults = null,
- t._loadedRawResults = null,
- t._numItems = 0,
- t._numItemsLoaded = 0,
- t._scriptOrder = null,
- t._loadedScripts = null,
- t.init = function(e, t, n) {
- this._numItems = this._numItemsLoaded = 0,
- this._paused = !1,
- this._loadStartWasDispatched = !1,
- this._currentLoads = [],
- this._loadQueue = [],
- this._loadQueueBackup = [],
- this._scriptOrder = [],
- this._loadedScripts = [],
- this._loadItemsById = {},
- this._loadItemsBySrc = {},
- this._loadedResults = {},
- this._loadedRawResults = {},
- this._typeCallbacks = {},
- this._extensionCallbacks = {},
- this._basePath = t,
- this.setUseXHR(e),
- this._crossOrigin = n === !0 ? "Anonymous": n === !1 || null == n ? "": n
- },
- t.setUseXHR = function(e) {
- return this.useXHR = 0 != e && null != window.XMLHttpRequest,
- this.useXHR
- },
- t.removeAll = function() {
- this.remove()
- },
- t.remove = function(e) {
- var t = null;
- if (!e || e instanceof Array) {
- if (e) t = e;
- else if (arguments.length > 0) return
- } else t = [e];
- var n = !1;
- if (t) {
- for (; t.length;) {
- var r = t.pop(),
- i = this.getResult(r);
- for (s = this._loadQueue.length - 1; s >= 0; s--) if (o = this._loadQueue[s].getItem(), o.id == r || o.src == r) {
- this._loadQueue.splice(s, 1)[0].cancel();
- break
- }
- for (s = this._loadQueueBackup.length - 1; s >= 0; s--) if (o = this._loadQueueBackup[s].getItem(), o.id == r || o.src == r) {
- this._loadQueueBackup.splice(s, 1)[0].cancel();
- break
- }
- if (i) delete this._loadItemsById[i.id],
- delete this._loadItemsBySrc[i.src],
- this._disposeItem(i);
- else for (var s = this._currentLoads.length - 1; s >= 0; s--) {
- var o = this._currentLoads[s].getItem();
- if (o.id == r || o.src == r) {
- this._currentLoads.splice(s, 1)[0].cancel(),
- n = !0;
- break
- }
- }
- }
- n && this._loadNext()
- } else {
- this.close();
- for (var u in this._loadItemsById) this._disposeItem(this._loadItemsById[u]);
- this.init(this.useXHR)
- }
- },
- t.reset = function() {
- this.close();
- for (var e in this._loadItemsById) this._disposeItem(this._loadItemsById[e]);
- for (var t = [], n = 0, r = this._loadQueueBackup.length; r > n; n++) t.push(this._loadQueueBackup[n].getItem());
- this.loadManifest(t, !1)
- },
- n.isBinary = function(e) {
- switch (e) {
- case createjs.LoadQueue.IMAGE:
- case createjs.LoadQueue.BINARY:
- return ! 0;
- default:
- return ! 1
- }
- },
- n.isText = function(e) {
- switch (e) {
- case createjs.LoadQueue.TEXT:
- case createjs.LoadQueue.JSON:
- case createjs.LoadQueue.MANIFEST:
- case createjs.LoadQueue.XML:
- case createjs.LoadQueue.HTML:
- case createjs.LoadQueue.CSS:
- case createjs.LoadQueue.SVG:
- case createjs.LoadQueue.JAVASCRIPT:
- return ! 0;
- default:
- return ! 1
- }
- },
- t.installPlugin = function(e) {
- if (null != e && null != e.getPreloadHandlers) {
- var t = e.getPreloadHandlers();
- if (t.scope = e, null != t.types) for (var n = 0,
- r = t.types.length; r > n; n++) this._typeCallbacks[t.types[n]] = t;
- if (null != t.extensions) for (n = 0, r = t.extensions.length; r > n; n++) this._extensionCallbacks[t.extensions[n]] = t
- }
- },
- t.setMaxConnections = function(e) {
- this._maxConnections = e,
- !this._paused && this._loadQueue.length > 0 && this._loadNext()
- },
- t.loadFile = function(e, t, n) {
- if (null == e) {
- var r = new createjs.Event("error");
- return r.text = "PRELOAD_NO_FILE",
- this._sendError(r),
- void 0
- }
- this._addItem(e, null, n),
- t !== !1 ? this.setPaused(!1) : this.setPaused(!0)
- },
- t.loadManifest = function(e, t, r) {
- var i = null,
- s = null;
- if (e instanceof Array) {
- if (0 == e.length) {
- var o = new createjs.Event("error");
- return o.text = "PRELOAD_MANIFEST_EMPTY",
- this._sendError(o),
- void 0
- }
- i = e
- } else if ("string" == typeof e) i = [{
- src: e,
- type: n.MANIFEST
- }];
- else {
- if ("object" != typeof e) {
- var o = new createjs.Event("error");
- return o.text = "PRELOAD_MANIFEST_NULL",
- this._sendError(o),
- void 0
- }
- if (void 0 !== e.src) {
- if (null == e.type) e.type = n.MANIFEST;
- else if (e.type != n.MANIFEST) {
- var o = new createjs.Event("error");
- o.text = "PRELOAD_MANIFEST_ERROR",
- this._sendError(o)
- }
- i = [e]
- } else void 0 !== e.manifest && (i = e.manifest, s = e.path)
- }
- for (var u = 0,
- a = i.length; a > u; u++) this._addItem(i[u], s, r);
- t !== !1 ? this.setPaused(!1) : this.setPaused(!0)
- },
- t.load = function() {
- this.setPaused(!1)
- },
- t.getItem = function(e) {
- return this._loadItemsById[e] || this._loadItemsBySrc[e]
- },
- t.getResult = function(e, t) {
- var n = this._loadItemsById[e] || this._loadItemsBySrc[e];
- if (null == n) return null;
- var r = n.id;
- return t && this._loadedRawResults[r] ? this._loadedRawResults[r] : this._loadedResults[r]
- },
- t.setPaused = function(e) {
- this._paused = e,
- this._paused || this._loadNext()
- },
- t.close = function() {
- for (; this._currentLoads.length;) this._currentLoads.pop().cancel();
- this._scriptOrder.length = 0,
- this._loadedScripts.length = 0,
- this.loadStartWasDispatched = !1
- },
- t._addItem = function(e, t, n) {
- var r = this._createLoadItem(e, t, n);
- if (null != r) {
- var i = this._createLoader(r);
- null != i && (this._loadQueue.push(i), this._loadQueueBackup.push(i), this._numItems++, this._updateProgress(), this.maintainScriptOrder && r.type == createjs.LoadQueue.JAVASCRIPT && i instanceof createjs.XHRLoader && (this._scriptOrder.push(r), this._loadedScripts.push(null)))
- }
- },
- t._createLoadItem = function(e, t, n) {
- var r = null;
- switch (typeof e) {
- case "string":
- r = {
- src: e
- };
- break;
- case "object":
- r = window.HTMLAudioElement && e instanceof window.HTMLAudioElement ? {
- tag: e,
- src: r.tag.src,
- type: createjs.LoadQueue.SOUND
- }: e;
- break;
- default:
- return null
- }
- var i = this._parseURI(r.src);
- null != i && (r.ext = i[6]),
- null == r.type && (r.type = this._getTypeByExtension(r.ext));
- var s = "",
- o = n || this._basePath,
- u = r.src;
- if (i && null == i[1] && null == i[3]) if (t) {
- s = t;
- var a = this._parsePath(t);
- u = t + u,
- null != o && a && null == a[1] && null == a[2] && (s = o + s)
- } else null != o && (s = o);
- if (r.src = s + r.src, r.path = s, (r.type == createjs.LoadQueue.JSON || r.type == createjs.LoadQueue.MANIFEST) && (r._loadAsJSONP = null != r.callback), r.type == createjs.LoadQueue.JSONP && null == r.callback) throw new Error("callback is required for loading JSONP requests."); (void 0 === r.tag || null === r.tag) && (r.tag = this._createTag(r)),
- (void 0 === r.id || null === r.id || "" === r.id) && (r.id = u);
- var f = this._typeCallbacks[r.type] || this._extensionCallbacks[r.ext];
- if (f) {
- var l = f.callback.call(f.scope, r.src, r.type, r.id, r.data, s, this);
- if (l === !1) return null;
- l === !0 || (null != l.src && (r.src = l.src), null != l.id && (r.id = l.id), null != l.tag && (r.tag = l.tag), null != l.completeHandler && (r.completeHandler = l.completeHandler), l.type && (r.type = l.type), i = this._parseURI(r.src), null != i && null != i[6] && (r.ext = i[6].toLowerCase()))
- }
- return this._loadItemsById[r.id] = r,
- this._loadItemsBySrc[r.src] = r,
- r
- },
- t._createLoader = function(e) {
- var t = this.useXHR;
- switch (e.type) {
- case createjs.LoadQueue.JSON:
- case createjs.LoadQueue.MANIFEST:
- t = !e._loadAsJSONP;
- break;
- case createjs.LoadQueue.XML:
- case createjs.LoadQueue.TEXT:
- t = !0;
- break;
- case createjs.LoadQueue.SOUND:
- case createjs.LoadQueue.JSONP:
- t = !1;
- break;
- case null:
- return null
- }
- return t ? new createjs.XHRLoader(e, this._crossOrigin) : new createjs.TagLoader(e)
- },
- t._loadNext = function() {
- if (!this._paused) {
- this._loadStartWasDispatched || (this._sendLoadStart(), this._loadStartWasDispatched = !0),
- this._numItems == this._numItemsLoaded ? (this.loaded = !0, this._sendComplete(), this.next && this.next.load && this.next.load()) : this.loaded = !1;
- for (var e = 0; e < this._loadQueue.length && !(this._currentLoads.length >= this._maxConnections); e++) {
- var t = this._loadQueue[e];
- if (this.maintainScriptOrder && t instanceof createjs.TagLoader && t.getItem().type == createjs.LoadQueue.JAVASCRIPT) {
- if (this._currentlyLoadingScript) continue;
- this._currentlyLoadingScript = !0
- }
- this._loadQueue.splice(e, 1),
- e--,
- this._loadItem(t)
- }
- }
- },
- t._loadItem = function(e) {
- e.on("progress", this._handleProgress, this),
- e.on("complete", this._handleFileComplete, this),
- e.on("error", this._handleFileError, this),
- this._currentLoads.push(e),
- this._sendFileStart(e.getItem()),
- e.load()
- },
- t._handleFileError = function(e) {
- var t = e.target;
- this._numItemsLoaded++,
- this._updateProgress();
- var n = new createjs.Event("error");
- n.text = "FILE_LOAD_ERROR",
- n.item = t.getItem(),
- this._sendError(n),
- this.stopOnError || (this._removeLoadItem(t), this._loadNext())
- },
- t._handleFileComplete = function(e) {
- var t = e.target,
- n = t.getItem();
- if (this._loadedResults[n.id] = t.getResult(), t instanceof createjs.XHRLoader && (this._loadedRawResults[n.id] = t.getResult(!0)), this._removeLoadItem(t), this.maintainScriptOrder && n.type == createjs.LoadQueue.JAVASCRIPT) {
- if (! (t instanceof createjs.TagLoader)) return this._loadedScripts[createjs.indexOf(this._scriptOrder, n)] = n,
- this._checkScriptLoadOrder(t),
- void 0;
- this._currentlyLoadingScript = !1
- }
- if (delete n._loadAsJSONP, n.type == createjs.LoadQueue.MANIFEST) {
- var r = t.getResult();
- null != r && void 0 !== r.manifest && this.loadManifest(r, !0)
- }
- this._processFinishedLoad(n, t)
- },
- t._processFinishedLoad = function(e, t) {
- this._numItemsLoaded++,
- this._updateProgress(),
- this._sendFileComplete(e, t),
- this._loadNext()
- },
- t._checkScriptLoadOrder = function() {
- for (var e = this._loadedScripts.length,
- t = 0; e > t; t++) {
- var n = this._loadedScripts[t];
- if (null === n) break;
- if (n !== !0) {
- var r = this._loadedResults[n.id]; (document.body || document.getElementsByTagName("body")[0]).appendChild(r),
- this._processFinishedLoad(n),
- this._loadedScripts[t] = !0
- }
- }
- },
- t._removeLoadItem = function(e) {
- for (var t = this._currentLoads.length,
- n = 0; t > n; n++) if (this._currentLoads[n] == e) {
- this._currentLoads.splice(n, 1);
- break
- }
- },
- t._handleProgress = function(e) {
- var t = e.target;
- this._sendFileProgress(t.getItem(), t.progress),
- this._updateProgress()
- },
- t._updateProgress = function() {
- var e = this._numItemsLoaded / this._numItems,
- t = this._numItems - this._numItemsLoaded;
- if (t > 0) {
- for (var n = 0,
- r = 0,
- i = this._currentLoads.length; i > r; r++) n += this._currentLoads[r].progress;
- e += n / t * (t / this._numItems)
- }
- this._sendProgress(e)
- },
- t._disposeItem = function(e) {
- delete this._loadedResults[e.id],
- delete this._loadedRawResults[e.id],
- delete this._loadItemsById[e.id],
- delete this._loadItemsBySrc[e.src]
- },
- t._createTag = function(e) {
- var t = null;
- switch (e.type) {
- case createjs.LoadQueue.IMAGE:
- return t = document.createElement("img"),
- "" == this._crossOrigin || this._isLocal(e) || (t.crossOrigin = this._crossOrigin),
- t;
- case createjs.LoadQueue.SOUND:
- return t = document.createElement("audio"),
- t.autoplay = !1,
- t;
- case createjs.LoadQueue.JSON:
- case createjs.LoadQueue.JSONP:
- case createjs.LoadQueue.JAVASCRIPT:
- case createjs.LoadQueue.MANIFEST:
- return t = document.createElement("script"),
- t.type = "text/javascript",
- t;
- case createjs.LoadQueue.CSS:
- return t = this.useXHR ? document.createElement("style") : document.createElement("link"),
- t.rel = "stylesheet",
- t.type = "text/css",
- t;
- case createjs.LoadQueue.SVG:
- return this.useXHR ? t = document.createElement("svg") : (t = document.createElement("object"), t.type = "image/svg+xml"),
- t
- }
- return null
- },
- t._getTypeByExtension = function(e) {
- if (null == e) return createjs.LoadQueue.TEXT;
- switch (e.toLowerCase()) {
- case "jpeg":
- case "jpg":
- case "gif":
- case "png":
- case "webp":
- case "bmp":
- return createjs.LoadQueue.IMAGE;
- case "ogg":
- case "mp3":
- case "wav":
- return createjs.LoadQueue.SOUND;
- case "json":
- return createjs.LoadQueue.JSON;
- case "xml":
- return createjs.LoadQueue.XML;
- case "css":
- return createjs.LoadQueue.CSS;
- case "js":
- return createjs.LoadQueue.JAVASCRIPT;
- case "svg":
- return createjs.LoadQueue.SVG;
- default:
- return createjs.LoadQueue.TEXT
- }
- },
- t._sendFileProgress = function(e, t) {
- if (this._isCanceled()) return this._cleanUp(),
- void 0;
- if (this.hasEventListener("fileprogress")) {
- var n = new createjs.Event("fileprogress");
- n.progress = t,
- n.loaded = t,
- n.total = 1,
- n.item = e,
- this.dispatchEvent(n)
- }
- },
- t._sendFileComplete = function(e, t) {
- if (!this._isCanceled()) {
- var n = new createjs.Event("fileload");
- n.prld = t,
- n.item = e,
- n.result = this._loadedResults[e.id],
- n.rawResult = this._loadedRawResults[e.id],
- e.completeHandler && e.completeHandler(n),
- this.hasEventListener("fileload") && this.dispatchEvent(n)
- }
- },
- t._sendFileStart = function(e) {
- var t = new createjs.Event("filestart");
- t.item = e,
- this.hasEventListener("filestart") && this.dispatchEvent(t)
- },
- t.toString = function() {
- return "[PreloadJS LoadQueue]"
- },
- createjs.LoadQueue = e;
- var r = function() {};
- r.init = function() {
- var e = navigator.userAgent;
- r.isFirefox = e.indexOf("Firefox") > -1,
- r.isOpera = null != window.opera,
- r.isChrome = e.indexOf("Chrome") > -1,
- r.isIOS = e.indexOf("iPod") > -1 || e.indexOf("iPhone") > -1 || e.indexOf("iPad") > -1
- },
- r.init(),
- createjs.LoadQueue.BrowserDetect = r
- } (), this.createjs = this.createjs || {},
- function() {
- var e = function(e) {
- this.init(e)
- },
- t = e.prototype = new createjs.AbstractLoader;
- t._loadTimeout = null,
- t._tagCompleteProxy = null,
- t._isAudio = !1,
- t._tag = null,
- t._jsonResult = null,
- t.init = function(e) {
- this._item = e,
- this._tag = e.tag,
- this._isAudio = window.HTMLAudioElement && e.tag instanceof window.HTMLAudioElement,
- this._tagCompleteProxy = createjs.proxy(this._handleLoad, this)
- },
- t.getResult = function() {
- return this._item.type == createjs.LoadQueue.JSONP || this._item.type == createjs.LoadQueue.MANIFEST ? this._jsonResult: this._tag
- },
- t.cancel = function() {
- this.canceled = !0,
- this._clean()
- },
- t.load = function() {
- var e = this._item,
- t = this._tag;
- clearTimeout(this._loadTimeout);
- var n = createjs.LoadQueue.LOAD_TIMEOUT;
- 0 == n && (n = createjs.LoadQueue.loadTimeout),
- this._loadTimeout = setTimeout(createjs.proxy(this._handleTimeout, this), n),
- this._isAudio && (t.src = null, t.preload = "auto"),
- t.onerror = createjs.proxy(this._handleError, this),
- this._isAudio ? (t.onstalled = createjs.proxy(this._handleStalled, this), t.addEventListener("canplaythrough", this._tagCompleteProxy, !1)) : (t.onload = createjs.proxy(this._handleLoad, this), t.onreadystatechange = createjs.proxy(this._handleReadyStateChange, this));
- var r = this.buildPath(e.src, e.values);
- switch (e.type) {
- case createjs.LoadQueue.CSS:
- t.href = r;
- break;
- case createjs.LoadQueue.SVG:
- t.data = r;
- break;
- default:
- t.src = r
- }
- if (e.type == createjs.LoadQueue.JSONP || e.type == createjs.LoadQueue.JSON || e.type == createjs.LoadQueue.MANIFEST) {
- if (null == e.callback) throw new Error("callback is required for loading JSONP requests.");
- if (null != window[e.callback]) throw new Error('JSONP callback "' + e.callback + '" already exists on window. You need to specify a different callback. Or re-name the current one.');
- window[e.callback] = createjs.proxy(this._handleJSONPLoad, this)
- } (e.type == createjs.LoadQueue.SVG || e.type == createjs.LoadQueue.JSONP || e.type == createjs.LoadQueue.JSON || e.type == createjs.LoadQueue.MANIFEST || e.type == createjs.LoadQueue.JAVASCRIPT || e.type == createjs.LoadQueue.CSS) && (this._startTagVisibility = t.style.visibility, t.style.visibility = "hidden", (document.body || document.getElementsByTagName("body")[0]).appendChild(t)),
- null != t.load && t.load()
- },
- t._handleJSONPLoad = function(e) {
- this._jsonResult = e
- },
- t._handleTimeout = function() {
- this._clean();
- var e = new createjs.Event("error");
- e.text = "PRELOAD_TIMEOUT",
- this._sendError(e)
- },
- t._handleStalled = function() {},
- t._handleError = function() {
- this._clean();
- var e = new createjs.Event("error");
- this._sendError(e)
- },
- t._handleReadyStateChange = function() {
- clearTimeout(this._loadTimeout);
- var e = this.getItem().tag; ("loaded" == e.readyState || "complete" == e.readyState) && this._handleLoad()
- },
- t._handleLoad = function() {
- if (!this._isCanceled()) {
- var e = this.getItem(),
- t = e.tag;
- if (! (this.loaded || this._isAudio && 4 !== t.readyState)) {
- switch (this.loaded = !0, e.type) {
- case createjs.LoadQueue.SVG:
- case createjs.LoadQueue.JSON:
- case createjs.LoadQueue.JSONP:
- case createjs.LoadQueue.MANIFEST:
- case createjs.LoadQueue.CSS:
- t.style.visibility = this._startTagVisibility,
- (document.body || document.getElementsByTagName("body")[0]).removeChild(t)
- }
- this._clean(),
- this._sendComplete()
- }
- }
- },
- t._clean = function() {
- clearTimeout(this._loadTimeout);
- var e = this.getItem(),
- t = e.tag;
- null != t && (t.onload = null, t.removeEventListener && t.removeEventListener("canplaythrough", this._tagCompleteProxy, !1), t.onstalled = null, t.onprogress = null, t.onerror = null, null != t.parentNode && e.type == createjs.LoadQueue.SVG && e.type == createjs.LoadQueue.JSON && e.type == createjs.LoadQueue.MANIFEST && e.type == createjs.LoadQueue.CSS && e.type == createjs.LoadQueue.JSONP && t.parentNode.removeChild(t));
- var e = this.getItem(); (e.type == createjs.LoadQueue.JSONP || e.type == createjs.LoadQueue.MANIFEST) && (window[e.callback] = null)
- },
- t.toString = function() {
- return "[PreloadJS TagLoader]"
- },
- createjs.TagLoader = e
- } (), this.createjs = this.createjs || {},
- function() {
- var e = function(e, t) {
- this.init(e, t)
- },
- t = e.prototype = new createjs.AbstractLoader;
- t._request = null,
- t._loadTimeout = null,
- t._xhrLevel = 1,
- t._response = null,
- t._rawResponse = null,
- t._crossOrigin = "",
- t.init = function(e, t) {
- this._item = e,
- this._crossOrigin = t,
- !this._createXHR(e)
- },
- t.getResult = function(e) {
- return e && this._rawResponse ? this._rawResponse: this._response
- },
- t.cancel = function() {
- this.canceled = !0,
- this._clean(),
- this._request.abort()
- },
- t.load = function() {
- if (null == this._request) return this._handleError(),
- void 0;
- if (this._request.onloadstart = createjs.proxy(this._handleLoadStart, this), this._request.onprogress = createjs.proxy(this._handleProgress, this), this._request.onabort = createjs.proxy(this._handleAbort, this), this._request.onerror = createjs.proxy(this._handleError, this), this._request.ontimeout = createjs.proxy(this._handleTimeout, this), 1 == this._xhrLevel) {
- var e = createjs.LoadQueue.LOAD_TIMEOUT;
- if (0 == e) e = createjs.LoadQueue.loadTimeout;
- else try {
- console.warn("LoadQueue.LOAD_TIMEOUT has been deprecated in favor of LoadQueue.loadTimeout")
- } catch(t) {}
- this._loadTimeout = setTimeout(createjs.proxy(this._handleTimeout, this), e)
- }
- this._request.onload = createjs.proxy(this._handleLoad, this),
- this._request.onreadystatechange = createjs.proxy(this._handleReadyStateChange, this);
- try {
- this._item.values && this._item.method != createjs.LoadQueue.GET ? this._item.method == createjs.LoadQueue.POST && this._request.send(this._formatQueryString(this._item.values)) : this._request.send()
- } catch(n) {
- var r = new createjs.Event("error");
- r.error = n,
- this._sendError(r)
- }
- },
- t.getAllResponseHeaders = function() {
- return this._request.getAllResponseHeaders instanceof Function ? this._request.getAllResponseHeaders() : null
- },
- t.getResponseHeader = function(e) {
- return this._request.getResponseHeader instanceof Function ? this._request.getResponseHeader(e) : null
- },
- t._handleProgress = function(e) {
- if (e && !(e.loaded > 0 && 0 == e.total)) {
- var t = new createjs.Event("progress");
- t.loaded = e.loaded,
- t.total = e.total,
- this._sendProgress(t)
- }
- },
- t._handleLoadStart = function() {
- clearTimeout(this._loadTimeout),
- this._sendLoadStart()
- },
- t._handleAbort = function() {
- this._clean();
- var e = new createjs.Event("error");
- e.text = "XHR_ABORTED",
- this._sendError(e)
- },
- t._handleError = function() {
- this._clean();
- var e = new createjs.Event("error");
- this._sendError(e)
- },
- t._handleReadyStateChange = function() {
- 4 == this._request.readyState && this._handleLoad()
- },
- t._handleLoad = function() {
- if (!this.loaded) {
- if (this.loaded = !0, !this._checkError()) return this._handleError(),
- void 0;
- this._response = this._getResponse(),
- this._clean();
- var e = this._generateTag();
- e && this._sendComplete()
- }
- },
- t._handleTimeout = function(e) {
- this._clean();
- var t = new createjs.Event("error");
- t.text = "PRELOAD_TIMEOUT",
- this._sendError(e)
- },
- t._checkError = function() {
- var e = parseInt(this._request.status);
- switch (e) {
- case 404:
- case 0:
- return ! 1
- }
- return ! 0
- },
- t._getResponse = function() {
- if (null != this._response) return this._response;
- if (null != this._request.response) return this._request.response;
- try {
- if (null != this._request.responseText) return this._request.responseText
- } catch(e) {}
- try {
- if (null != this._request.responseXML) return this._request.responseXML
- } catch(e) {}
- return null
- },
- t._createXHR = function(e) {
- var t = this._isCrossDomain(e),
- n = null;
- if (t && window.XDomainRequest) n = new XDomainRequest;
- else if (window.XMLHttpRequest) n = new XMLHttpRequest;
- else try {
- n = new ActiveXObject("Msxml2.XMLHTTP.6.0")
- } catch(r) {
- try {
- n = new ActiveXObject("Msxml2.XMLHTTP.3.0")
- } catch(r) {
- try {
- n = new ActiveXObject("Msxml2.XMLHTTP")
- } catch(r) {
- return ! 1
- }
- }
- }
- createjs.LoadQueue.isText(e.type) && n.overrideMimeType && n.overrideMimeType("text/plain; charset=utf-8"),
- this._xhrLevel = "string" == typeof n.responseType ? 2 : 1;
- var i = null;
- return i = e.method == createjs.LoadQueue.GET ? this.buildPath(e.src, e.values) : e.src,
- n.open(e.method || createjs.LoadQueue.GET, i, !0),
- t && n instanceof XMLHttpRequest && 1 == this._xhrLevel && n.setRequestHeader("Origin", location.origin),
- e.values && e.method == createjs.LoadQueue.POST && n.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"),
- createjs.LoadQueue.isBinary(e.type) && (n.responseType = "arraybuffer"),
- this._request = n,
- !0
- },
- t._clean = function() {
- clearTimeout(this._loadTimeout);
- var e = this._request;
- e.onloadstart = null,
- e.onprogress = null,
- e.onabort = null,
- e.onerror = null,
- e.onload = null,
- e.ontimeout = null,
- e.onloadend = null,
- e.onreadystatechange = null
- },
- t._generateTag = function() {
- var e = this._item.type,
- t = this._item.tag;
- switch (e) {
- case createjs.LoadQueue.IMAGE:
- return t.onload = createjs.proxy(this._handleTagReady, this),
- "" != this._crossOrigin && (t.crossOrigin = "Anonymous"),
- t.src = this.buildPath(this._item.src, this._item.values),
- this._rawResponse = this._response,
- this._response = t,
- !1;
- case createjs.LoadQueue.JAVASCRIPT:
- return t = document.createElement("script"),
- t.text = this._response,
- this._rawResponse = this._response,
- this._response = t,
- !0;
- case createjs.LoadQueue.CSS:
- var n = document.getElementsByTagName("head")[0];
- if (n.appendChild(t), t.styleSheet) t.styleSheet.cssText = this._response;
- else {
- var r = document.createTextNode(this._response);
- t.appendChild(r)
- }
- return this._rawResponse = this._response,
- this._response = t,
- !0;
- case createjs.LoadQueue.XML:
- var i = this._parseXML(this._response, "text/xml");
- return this._rawResponse = this._response,
- this._response = i,
- !0;
- case createjs.LoadQueue.SVG:
- var i = this._parseXML(this._response, "image/svg+xml");
- return this._rawResponse = this._response,
- null != i.documentElement ? (t.appendChild(i.documentElement), this._response = t) : this._response = i,
- !0;
- case createjs.LoadQueue.JSON:
- case createjs.LoadQueue.MANIFEST:
- var s = {};
- try {
- s = JSON.parse(this._response)
- } catch(o) {
- s = o
- }
- return this._rawResponse = this._response,
- this._response = s,
- !0
- }
- return ! 0
- },
- t._parseXML = function(e, t) {
- var n = null;
- try {
- if (window.DOMParser) {
- var r = new DOMParser;
- n = r.parseFromString(e, t)
- } else n = new ActiveXObject("Microsoft.XMLDOM"),
- n.async = !1,
- n.loadXML(e)
- } catch(i) {}
- return n
- },
- t._handleTagReady = function() {
- this._sendComplete()
- },
- t.toString = function() {
- return "[PreloadJS XHRLoader]"
- },
- createjs.XHRLoader = e
- } (), "object" != typeof JSON && (JSON = {}),
- function() {
- function f(e) {
- return 10 > e ? "0" + e: e
- }
- function quote(e) {
- return escapable.lastIndex = 0,
- escapable.test(e) ? '"' + e.replace(escapable,
- function(e) {
- var t = meta[e];
- return "string" == typeof t ? t: "\\u" + ("0000" + e.charCodeAt(0).toString(16)).slice( - 4)
- }) + '"': '"' + e + '"'
- }
- function str(e, t) {
- var n, r, i, s, o, u = gap,
- a = t[e];
- switch (a && "object" == typeof a && "function" == typeof a.toJSON && (a = a.toJSON(e)), "function" == typeof rep && (a = rep.call(t, e, a)), typeof a) {
- case "string":
- return quote(a);
- case "number":
- return isFinite(a) ? String(a) : "null";
- case "boolean":
- case "null":
- return String(a);
- case "object":
- if (!a) return "null";
- if (gap += indent, o = [], "[object Array]" === Object.prototype.toString.apply(a)) {
- for (s = a.length, n = 0; s > n; n += 1) o[n] = str(n, a) || "null";
- return i = 0 === o.length ? "[]": gap ? "[\n" + gap + o.join(",\n" + gap) + "\n" + u + "]": "[" + o.join(",") + "]",
- gap = u,
- i
- }
- if (rep && "object" == typeof rep) for (s = rep.length, n = 0; s > n; n += 1)"string" == typeof rep[n] && (r = rep[n], i = str(r, a), i && o.push(quote(r) + (gap ? ": ": ":") + i));
- else for (r in a) Object.prototype.hasOwnProperty.call(a, r) && (i = str(r, a), i && o.push(quote(r) + (gap ? ": ": ":") + i));
- return i = 0 === o.length ? "{}": gap ? "{\n" + gap + o.join(",\n" + gap) + "\n" + u + "}": "{" + o.join(",") + "}",
- gap = u,
- i
- }
- }
- "function" != typeof Date.prototype.toJSON && (Date.prototype.toJSON = function() {
- return isFinite(this.valueOf()) ? this.getUTCFullYear() + "-" + f(this.getUTCMonth() + 1) + "-" + f(this.getUTCDate()) + "T" + f(this.getUTCHours()) + ":" + f(this.getUTCMinutes()) + ":" + f(this.getUTCSeconds()) + "Z": null
- },
- String.prototype.toJSON = Number.prototype.toJSON = Boolean.prototype.toJSON = function() {
- return this.valueOf()
- });
- var cx = /[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,
- escapable = /[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,
- gap, indent, meta = {
- "\b": "\\b",
- " ": "\\t",
- "\n": "\\n",
- "\f": "\\f",
- "\r": "\\r",
- '"': '\\"',
- "\\": "\\\\"
- },
- rep;
- "function" != typeof JSON.stringify && (JSON.stringify = function(e, t, n) {
- var r;
- if (gap = "", indent = "", "number" == typeof n) for (r = 0; n > r; r += 1) indent += " ";
- else "string" == typeof n && (indent = n);
- if (rep = t, !t || "function" == typeof t || "object" == typeof t && "number" == typeof t.length) return str("", {
- "": e
- });
- throw new Error("JSON.stringify")
- }),
- "function" != typeof JSON.parse && (JSON.parse = function(text, reviver) {
- function walk(e, t) {
- var n, r, i = e[t];
- if (i && "object" == typeof i) for (n in i) Object.prototype.hasOwnProperty.call(i, n) && (r = walk(i, n), void 0 !== r ? i[n] = r: delete i[n]);
- return reviver.call(e, t, i)
- }
- var j;
- if (text = String(text), cx.lastIndex = 0, cx.test(text) && (text = text.replace(cx,
- function(e) {
- return "\\u" + ("0000" + e.charCodeAt(0).toString(16)).slice( - 4)
- })), /^[\],:{}\s]*$/.test(text.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g, "@").replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g, "]").replace(/(?:^|:|,)(?:\s*\[)+/g, ""))) return j = eval("(" + text + ")"),
- "function" == typeof reviver ? walk({
- "": j
- },
- "") : j;
- throw new SyntaxError("JSON.parse")
- })
- } (), define("prld",
- function(e) {
- return function() {
- var t, n;
- return t || e.createjs
- }
- } (this)), define("gameAssets", {
- gfx_font_png: "gfx/font.png",
- gfx_gfx_atlas_png: "gfx/gfx.atlas.png",
- gfx_smallDigits_png: "gfx/smallDigits.png",
- gfx_tutorial_png: "gfx/tutorial.png",
- gfx_waterAnim_png: "gfx/waterAnim.png",
- sfx_buttontap_mp3: "sfx/buttontap.mp3",
- sfx_jump_mp3: "sfx/jump.mp3",
- sfx_landing_mp3: "sfx/landing.mp3",
- sfx_splash_mp3: "sfx/splash.mp3",
- sfx_theme_mp3: "sfx/theme.mp3"
- }),
- function() {
- function v() {
- var e = !1;
- if ("localStorage" in window) try {
- window.localStorage.setItem("_tmptest", "tmpval"),
- e = !0,
- window.localStorage.removeItem("_tmptest")
- } catch(t) {}
- if (e) try {
- window.localStorage && (i = window.localStorage, u = "localStorage", l = i.jStorage_update)
- } catch(n) {} else if ("globalStorage" in window) try {
- window.globalStorage && (window.location.hostname == "localhost" ? i = window.globalStorage["localhost.localdomain"] : i = window.globalStorage[window.location.hostname], u = "globalStorage", l = i.jStorage_update)
- } catch(r) {} else {
- s = document.createElement("link");
- if (!s.addBehavior) {
- s = null;
- return
- }
- s.style.behavior = "url(#default#userData)",
- document.getElementsByTagName("head")[0].appendChild(s);
- try {
- s.load("jStorage")
- } catch(o) {
- s.setAttribute("jStorage", "{}"),
- s.save("jStorage"),
- s.load("jStorage")
- }
- var a = "{}";
- try {
- a = s.getAttribute("jStorage")
- } catch(f) {}
- try {
- l = s.getAttribute("jStorage_update")
- } catch(c) {}
- i.jStorage = a,
- u = "userDataBehavior"
- }
- S(),
- N(),
- g(),
- C(),
- "addEventListener" in window && window.addEventListener("pageshow",
- function(e) {
- e.persisted && y()
- },
- !1)
- }
- function m() {
- var e = "{}";
- if (u == "userDataBehavior") {
- s.load("jStorage");
- try {
- e = s.getAttribute("jStorage")
- } catch(t) {}
- try {
- l = s.getAttribute("jStorage_update")
- } catch(n) {}
- i.jStorage = e
- }
- S(),
- N(),
- C()
- }
- function g() {
- u == "localStorage" || u == "globalStorage" ? "addEventListener" in window ? window.addEventListener("storage", y, !1) : document.attachEvent("onstorage", y) : u == "userDataBehavior" && setInterval(y, 1e3)
- }
- function y() {
- var e;
- clearTimeout(f),
- f = setTimeout(function() {
- if (u == "localStorage" || u == "globalStorage") e = i.jStorage_update;
- else if (u == "userDataBehavior") {
- s.load("jStorage");
- try {
- e = s.getAttribute("jStorage_update")
- } catch(t) {}
- }
- e && e != l && (l = e, b())
- },
- 25)
- }
- function b() {
- var e = n.parse(n.stringify(r.__jstorage_meta.CRC32)),
- t;
- m(),
- t = n.parse(n.stringify(r.__jstorage_meta.CRC32));
- var i, s = [],
- o = [];
- for (i in e) if (e.hasOwnProperty(i)) {
- if (!t[i]) {
- o.push(i);
- continue
- }
- e[i] != t[i] && String(e[i]).substr(0, 2) == "2." && s.push(i)
- }
- for (i in t) t.hasOwnProperty(i) && (e[i] || s.push(i));
- w(s, "updated"),
- w(o, "deleted")
- }
- function w(e, t) {
- e = [].concat(e || []);
- if (t == "flushed") {
- e = [];
- for (var n in a) a.hasOwnProperty(n) && e.push(n);
- t = "deleted"
- }
- for (var r = 0,
- i = e.length; r < i; r++) {
- if (a[e[r]]) for (var s = 0,
- o = a[e[r]].length; s < o; s++) a[e[r]][s](e[r], t);
- if (a["*"]) for (var s = 0,
- o = a["*"].length; s < o; s++) a["*"][s](e[r], t)
- }
- }
- function E() {
- var e = ( + (new Date)).toString();
- if (u == "localStorage" || u == "globalStorage") try {
- i.jStorage_update = e
- } catch(t) {
- u = !1
- } else u == "userDataBehavior" && (s.setAttribute("jStorage_update", e), s.save("jStorage"));
- y()
- }
- function S() {
- if (i.jStorage) try {
- r = n.parse(String(i.jStorage))
- } catch(e) {
- i.jStorage = "{}"
- } else i.jStorage = "{}";
- o = i.jStorage ? String(i.jStorage).length: 0,
- r.__jstorage_meta || (r.__jstorage_meta = {}),
- r.__jstorage_meta.CRC32 || (r.__jstorage_meta.CRC32 = {})
- }
- function x() {
- L();
- try {
- i.jStorage = n.stringify(r),
- s && (s.setAttribute("jStorage", i.jStorage), s.save("jStorage")),
- o = i.jStorage ? String(i.jStorage).length: 0
- } catch(e) {}
- }
- function T(e) {
- if (typeof e != "string" && typeof e != "number") throw new TypeError("Key name must be string or numeric");
- if (e == "__jstorage_meta") throw new TypeError("Reserved key name");
- return ! 0
- }
- function N() {
- var e, t, n, i, s = Infinity,
- o = !1,
- u = [];
- clearTimeout(p);
- if (!r.__jstorage_meta || typeof r.__jstorage_meta.TTL != "object") return;
- e = +(new Date),
- n = r.__jstorage_meta.TTL,
- i = r.__jstorage_meta.CRC32;
- for (t in n) n.hasOwnProperty(t) && (n[t] <= e ? (delete n[t], delete i[t], delete r[t], o = !0, u.push(t)) : n[t] < s && (s = n[t]));
- s != Infinity && (p = setTimeout(Math.min(N, s - e, 2147483647))),
- o && (x(), E(), w(u, "deleted"))
- }
- function C() {
- var e, t;
- if (!r.__jstorage_meta.PubSub) return;
- var n, i = h;
- for (e = t = r.__jstorage_meta.PubSub.length - 1; e >= 0; e--) n = r.__jstorage_meta.PubSub[e],
- n[0] > h && (i = n[0], k(n[1], n[2]));
- h = i
- }
- function k(e, t) {
- if (c[e]) for (var r = 0,
- i = c[e].length; r < i; r++) try {
- c[e][r](e, n.parse(n.stringify(t)))
- } catch(s) {}
- }
- function L() {
- if (!r.__jstorage_meta.PubSub) return;
- var e = +(new Date) - 2e3;
- for (var t = 0,
- n = r.__jstorage_meta.PubSub.length; t < n; t++) if (r.__jstorage_meta.PubSub[t][0] <= e) {
- r.__jstorage_meta.PubSub.splice(t, r.__jstorage_meta.PubSub.length - t);
- break
- }
- r.__jstorage_meta.PubSub.length || delete r.__jstorage_meta.PubSub
- }
- function A(e, t) {
- r.__jstorage_meta || (r.__jstorage_meta = {}),
- r.__jstorage_meta.PubSub || (r.__jstorage_meta.PubSub = []),
- r.__jstorage_meta.PubSub.unshift([ + (new Date), e, t]),
- x(),
- E()
- }
- function O(e, t) {
- var n = e.length,
- r = t ^ n,
- i = 0,
- s;
- while (n >= 4) s = e.charCodeAt(i) & 255 | (e.charCodeAt(++i) & 255) << 8 | (e.charCodeAt(++i) & 255) << 16 | (e.charCodeAt(++i) & 255) << 24,
- s = (s & 65535) * 1540483477 + (((s >>> 16) * 1540483477 & 65535) << 16),
- s ^= s >>> 24,
- s = (s & 65535) * 1540483477 + (((s >>> 16) * 1540483477 & 65535) << 16),
- r = (r & 65535) * 1540483477 + (((r >>> 16) * 1540483477 & 65535) << 16) ^ s,
- n -= 4,
- ++i;
- switch (n) {
- case 3:
- r ^= (e.charCodeAt(i + 2) & 255) << 16;
- case 2:
- r ^= (e.charCodeAt(i + 1) & 255) << 8;
- case 1:
- r ^= e.charCodeAt(i) & 255,
- r = (r & 65535) * 1540483477 + (((r >>> 16) * 1540483477 & 65535) << 16)
- }
- return r ^= r >>> 13,
- r = (r & 65535) * 1540483477 + (((r >>> 16) * 1540483477 & 65535) << 16),
- r ^= r >>> 15,
- r >>> 0
- }
- var e = "0.4.8",
- t = window.jQuery || window.$ || (window.$ = {}),
- n = {
- parse: window.JSON && (window.JSON.parse || window.JSON.decode) || String.prototype.evalJSON &&
- function(e) {
- return String(e).evalJSON()
- } || t.parseJSON || t.evalJSON,
- stringify: Object.toJSON || window.JSON && (window.JSON.stringify || window.JSON.encode) || t.toJSON
- };
- if (! ("parse" in n && "stringify" in n)) throw new Error("No JSON support found, include //cdnjs.cloudflare.com/ajax/libs/json2/20110223/json2.js to page");
- var r = {
- __jstorage_meta: {
- CRC32: {}
- }
- },
- i = {
- jStorage: "{}"
- },
- s = null,
- o = 0,
- u = !1,
- a = {},
- f = !1,
- l = 0,
- c = {},
- h = +(new Date),
- p,
- d = {
- isXML: function(e) {
- var t = (e ? e.ownerDocument || e: 0).documentElement;
- return t ? t.nodeName !== "HTML": !1
- },
- encode: function(e) {
- if (!this.isXML(e)) return ! 1;
- try {
- return (new XMLSerializer).serializeToString(e)
- } catch(t) {
- try {
- return e.xml
- } catch(n) {}
- }
- return ! 1
- },
- decode: function(e) {
- var t = "DOMParser" in window && (new DOMParser).parseFromString || window.ActiveXObject &&
- function(e) {
- var t = new ActiveXObject("Microsoft.XMLDOM");
- return t.async = "false",
- t.loadXML(e),
- t
- },
- n;
- return t ? (n = t.call("DOMParser" in window && new DOMParser || window, e, "text/xml"), this.isXML(n) ? n: !1) : !1
- }
- };
- t.jStorage = {
- version: e,
- set: function(e, t, i) {
- T(e),
- i = i || {};
- if (typeof t == "undefined") return this.deleteKey(e),
- t;
- if (d.isXML(t)) t = {
- _is_xml: !0,
- xml: d.encode(t)
- };
- else {
- if (typeof t == "function") return undefined;
- t && typeof t == "object" && (t = n.parse(n.stringify(t)))
- }
- return r[e] = t,
- r.__jstorage_meta.CRC32[e] = "2." + O(n.stringify(t), 2538058380),
- this.setTTL(e, i.TTL || 0),
- w(e, "updated"),
- t
- },
- get: function(e, t) {
- return T(e),
- e in r ? r[e] && typeof r[e] == "object" && r[e]._is_xml ? d.decode(r[e].xml) : r[e] : typeof t == "undefined" ? null: t
- },
- deleteKey: function(e) {
- return T(e),
- e in r ? (delete r[e], typeof r.__jstorage_meta.TTL == "object" && e in r.__jstorage_meta.TTL && delete r.__jstorage_meta.TTL[e], delete r.__jstorage_meta.CRC32[e], x(), E(), w(e, "deleted"), !0) : !1
- },
- setTTL: function(e, t) {
- var n = +(new Date);
- return T(e),
- t = Number(t) || 0,
- e in r ? (r.__jstorage_meta.TTL || (r.__jstorage_meta.TTL = {}), t > 0 ? r.__jstorage_meta.TTL[e] = n + t: delete r.__jstorage_meta.TTL[e], x(), N(), E(), !0) : !1
- },
- getTTL: function(e) {
- var t = +(new Date),
- n;
- return T(e),
- e in r && r.__jstorage_meta.TTL && r.__jstorage_meta.TTL[e] ? (n = r.__jstorage_meta.TTL[e] - t, n || 0) : 0
- },
- flush: function() {
- return r = {
- __jstorage_meta: {
- CRC32: {}
- }
- },
- x(),
- E(),
- w(null, "flushed"),
- !0
- },
- storageObj: function() {
- function e() {}
- return e.prototype = r,
- new e
- },
- index: function() {
- var e = [],
- t;
- for (t in r) r.hasOwnProperty(t) && t != "__jstorage_meta" && e.push(t);
- return e
- },
- storageSize: function() {
- return o
- },
- currentBackend: function() {
- return u
- },
- storageAvailable: function() {
- return !! u
- },
- listenKeyChange: function(e, t) {
- T(e),
- a[e] || (a[e] = []),
- a[e].push(t)
- },
- stopListening: function(e, t) {
- T(e);
- if (!a[e]) return;
- if (!t) {
- delete a[e];
- return
- }
- for (var n = a[e].length - 1; n >= 0; n--) a[e][n] == t && a[e].splice(n, 1)
- },
- subscribe: function(e, t) {
- e = (e || "").toString();
- if (!e) throw new TypeError("Channel not defined");
- c[e] || (c[e] = []),
- c[e].push(t)
- },
- publish: function(e, t) {
- e = (e || "").toString();
- if (!e) throw new TypeError("Channel not defined");
- A(e, t)
- },
- reInit: function() {
- m()
- },
- noConflict: function(e) {
- return delete window.$.jStorage,
- e && (window.jStorage = this),
- this
- }
- },
- v()
- } (), define("jstorage",
- function(e) {
- return function() {
- var t, n;
- return t || e.$
- }
- } (this)), define("Storage", ["require", "jstorage"],
- function(e) {
- var t = e("jstorage").jStorage,
- n = function(e) {
- this._prefix = e,
- this._available = t.storageAvailable()
- },
- r = n.prototype;
- return r.get = function(e) {
- return this._available ? t.get(this._prefix + e) : null
- },
- r.set = function(e, n) {
- if (!this._available) return;
- t.set(this._prefix + e, n)
- },
- r.del = function(e) {
- if (!this._available) return;
- t.deleteKey(this._prefix + e)
- },
- r.clear = function() {
- if (!this._available) return;
- var e = t.index();
- for (var n = e.length; n--;) {
- var r = e[n];
- r.substr(0, this._prefix.length) == this._prefix && t.deleteKey(r)
- }
- },
- r._prefix = "",
- r._available = !0,
- n
- }), define("text", ["module"],
- function(e) {
- var t, n, r, i, s, o = ["Msxml2.XMLHTTP", "Microsoft.XMLHTTP", "Msxml2.XMLHTTP.4.0"],
- u = /^\s*<\?xml(\s)+version=[\'\"](\d)*.(\d)*[\'\"](\s)*\?>/im,
- a = /<body[^>]*>\s*([\s\S]+)\s*<\/body>/im,
- f = typeof location != "undefined" && location.href,
- l = f && location.protocol && location.protocol.replace(/\:/, ""),
- c = f && location.hostname,
- h = f && (location.port || undefined),
- p = {},
- d = e.config && e.config() || {};
- t = {
- version: "2.0.12",
- strip: function(e) {
- if (e) {
- e = e.replace(u, "");
- var t = e.match(a);
- t && (e = t[1])
- } else e = "";
- return e
- },
- jsEscape: function(e) {
- return e.replace(/(['\\])/g, "\\$1").replace(/[\f]/g, "\\f").replace(/[\b]/g, "\\b").replace(/[\n]/g, "\\n").replace(/[\t]/g, "\\t").replace(/[\r]/g, "\\r").replace(/[\u2028]/g, "\\u2028").replace(/[\u2029]/g, "\\u2029")
- },
- createXhr: d.createXhr ||
- function() {
- var e, t, n;
- if (typeof XMLHttpRequest != "undefined") return new XMLHttpRequest;
- if (typeof ActiveXObject != "undefined") for (t = 0; t < 3; t += 1) {
- n = o[t];
- try {
- e = new ActiveXObject(n)
- } catch(r) {}
- if (e) {
- o = [n];
- break
- }
- }
- return e
- },
- parseName: function(e) {
- var t, n, r, i = !1,
- s = e.indexOf("."),
- o = e.indexOf("./") === 0 || e.indexOf("../") === 0;
- return s !== -1 && (!o || s > 1) ? (t = e.substring(0, s), n = e.substring(s + 1, e.length)) : t = e,
- r = n || t,
- s = r.indexOf("!"),
- s !== -1 && (i = r.substring(s + 1) === "strip", r = r.substring(0, s), n ? n = r: t = r),
- {
- moduleName: t,
- ext: n,
- strip: i
- }
- },
- xdRegExp: /^((\w+)\:)?\/\/([^\/\\]+)/,
- useXhr: function(e, n, r, i) {
- var s, o, u, a = t.xdRegExp.exec(e);
- return a ? (s = a[2], o = a[3], o = o.split(":"), u = o[1], o = o[0], (!s || s === n) && (!o || o.toLowerCase() === r.toLowerCase()) && (!u && !o || u === i)) : !0
- },
- finishLoad: function(e, n, r, i) {
- r = n ? t.strip(r) : r,
- d.isBuild && (p[e] = r),
- i(r)
- },
- load: function(e, n, r, i) {
- if (i && i.isBuild && !i.inlineText) {
- r();
- return
- }
- d.isBuild = i && i.isBuild;
- var s = t.parseName(e),
- o = s.moduleName + (s.ext ? "." + s.ext: ""),
- u = n.toUrl(o),
- a = d.useXhr || t.useXhr;
- if (u.indexOf("empty:") === 0) {
- r();
- return
- } ! f || a(u, l, c, h) ? t.get(u,
- function(n) {
- t.finishLoad(e, s.strip, n, r)
- },
- function(e) {
- r.error && r.error(e)
- }) : n([o],
- function(e) {
- t.finishLoad(s.moduleName + "." + s.ext, s.strip, e, r)
- })
- },
- write: function(e, n, r, i) {
- if (p.hasOwnProperty(n)) {
- var s = t.jsEscape(p[n]);
- r.asModule(e + "!" + n, "define(function () { return '" + s + "';});\n")
- }
- },
- writeFile: function(e, n, r, i, s) {
- var o = t.parseName(n),
- u = o.ext ? "." + o.ext: "",
- a = o.moduleName + u,
- f = r.toUrl(o.moduleName + u) + ".js";
- t.load(a, r,
- function(n) {
- var r = function(e) {
- return i(f, e)
- };
- r.asModule = function(e, t) {
- return i.asModule(e, f, t)
- },
- t.write(e, a, r, s)
- },
- s)
- }
- };
- if (d.env === "node" || !d.env && typeof process != "undefined" && process.versions && !!process.versions.node && !process.versions["node-webkit"]) n = require.nodeRequire("fs"),
- t.get = function(e, t, r) {
- try {
- var i = n.readFileSync(e, "utf8");
- i.indexOf("") === 0 && (i = i.substring(1)),
- t(i)
- } catch(s) {
- r && r(s)
- }
- };
- else if (d.env === "xhr" || !d.env && t.createXhr()) t.get = function(e, n, r, i) {
- var s = t.createXhr(),
- o;
- s.open("GET", e, !0);
- if (i) for (o in i) i.hasOwnProperty(o) && s.setRequestHeader(o.toLowerCase(), i[o]);
- d.onXhr && d.onXhr(s, e),
- s.onreadystatechange = function(t) {
- var i, o;
- s.readyState === 4 && (i = s.status || 0, i > 399 && i < 600 ? (o = new Error(e + " HTTP status: " + i), o.xhr = s, r && r(o)) : n(s.responseText), d.onXhrComplete && d.onXhrComplete(s, e))
- },
- s.send(null)
- };
- else if (d.env === "rhino" || !d.env && typeof Packages != "undefined" && typeof java != "undefined") t.get = function(e, t) {
- var n, r, i = "utf-8",
- s = new java.io.File(e),
- o = java.lang.System.getProperty("line.separator"),
- u = new java.io.BufferedReader(new java.io.InputStreamReader(new java.io.FileInputStream(s), i)),
- a = "";
- try {
- n = new java.lang.StringBuffer,
- r = u.readLine(),
- r && r.length() && r.charAt(0) === 65279 && (r = r.substring(1)),
- r !== null && n.append(r);
- while ((r = u.readLine()) !== null) n.append(o),
- n.append(r);
- a = String(n.toString())
- } finally {
- u.close()
- }
- t(a)
- };
- else if (d.env === "xpconnect" || !d.env && typeof Components != "undefined" && Components.classes && Components.interfaces) r = Components.classes,
- i = Components.interfaces,
- Components.utils["import"]("resource://gre/modules/FileUtils.jsm"),
- s = "@mozilla.org/windows-registry-key;1" in r,
- t.get = function(e, t) {
- var n, o, u, a = {};
- s && (e = e.replace(/\//g, "\\")),
- u = new FileUtils.File(e);
- try {
- n = r["@mozilla.org/network/file-input-stream;1"].createInstance(i.nsIFileInputStream),
- n.init(u, 1, 0, !1),
- o = r["@mozilla.org/intl/converter-input-stream;1"].createInstance(i.nsIConverterInputStream),
- o.init(n, "utf-8", n.available(), i.nsIConverterInputStream.DEFAULT_REPLACEMENT_CHARACTER),
- o.readString(n.available(), a),
- o.close(),
- n.close(),
- t(a.value)
- } catch(f) {
- throw new Error((u && u.path || "") + ": " + f)
- }
- };
- return t
- }), define("text!screens/../../game_assets/gfx/font.json", [],
- function() {
- return '{\r\n "info": {\r\n "face": "font",\r\n "size": 32,\r\n "bold": 0,\r\n "italic": 0,\r\n "charset": 0,\r\n "unicode": 0,\r\n "stretchH": 100,\r\n "smooth": 1,\r\n "aa": 1,\r\n "padding": "0,0,0,0",\r\n "spacing": "1,1"\r\n },\r\n "common": {\r\n "lineHeight": 103,\r\n "base": 26,\r\n "scaleW": 256,\r\n "scaleH": 256,\r\n "pages": 1,\r\n "packed": 0,\r\n "alphaChnl": 1,\r\n "redChnl": 0,\r\n "greenChnl": 0,\r\n "blueChnl": 0\r\n },\r\n "page": {\r\n "id": 0,\r\n "file": "font.png"\r\n },\r\n "chars": {\r\n "count": 12,\r\n "data": [\r\n {\r\n "id": 49,\r\n "x": 156,\r\n "y": 72,\r\n "width": 30,\r\n "height": 68,\r\n "xoffset": 0,\r\n "yoffset": 34,\r\n "xadvance": 30,\r\n "page": 0,\r\n "chnl": 0,\r\n "letter": 1\r\n },\r\n {\r\n "id": 50,\r\n "x": 57,\r\n "y": 0,\r\n "width": 51,\r\n "height": 69,\r\n "xoffset": 0,\r\n "yoffset": 33,\r\n "xadvance": 51,\r\n "page": 0,\r\n "chnl": 0,\r\n "letter": 2\r\n },\r\n {\r\n "id": 51,\r\n "x": 109,\r\n "y": 0,\r\n "width": 49,\r\n "height": 71,\r\n "xoffset": 0,\r\n "yoffset": 34,\r\n "xadvance": 49,\r\n "page": 0,\r\n "chnl": 0,\r\n "letter": 3\r\n },\r\n {\r\n "id": 52,\r\n "x": 54,\r\n "y": 73,\r\n "width": 52,\r\n "height": 67,\r\n "xoffset": 0,\r\n "yoffset": 35,\r\n "xadvance": 52,\r\n "page": 0,\r\n "chnl": 0,\r\n "letter": 4\r\n },\r\n {\r\n "id": 53,\r\n "x": 107,\r\n "y": 72,\r\n "width": 48,\r\n "height": 68,\r\n "xoffset": 0,\r\n "yoffset": 35,\r\n "xadvance": 48,\r\n "page": 0,\r\n "chnl": 0,\r\n "letter": 5\r\n },\r\n {\r\n "id": 54,\r\n "x": 53,\r\n "y": 143,\r\n "width": 52,\r\n "height": 70,\r\n "xoffset": 0,\r\n "yoffset": 33,\r\n "xadvance": 52,\r\n "page": 0,\r\n "chnl": 0,\r\n "letter": 6\r\n },\r\n {\r\n "id": 55,\r\n "x": 106,\r\n "y": 141,\r\n "width": 51,\r\n "height": 67,\r\n "xoffset": 0,\r\n "yoffset": 35,\r\n "xadvance": 51,\r\n "page": 0,\r\n "chnl": 0,\r\n "letter": 7\r\n },\r\n {\r\n "id": 56,\r\n "x": 0,\r\n "y": 73,\r\n "width": 53,\r\n "height": 69,\r\n "xoffset": 0,\r\n "yoffset": 34,\r\n "xadvance": 53,\r\n "page": 0,\r\n "chnl": 0,\r\n "letter": 8\r\n },\r\n {\r\n "id": 57,\r\n "x": 0,\r\n "y": 143,\r\n "width": 52,\r\n "height": 69,\r\n "xoffset": 0,\r\n "yoffset": 34,\r\n "xadvance": 52,\r\n "page": 0,\r\n "chnl": 0,\r\n "letter": 9\r\n },\r\n {\r\n "id": 48,\r\n "x": 0,\r\n "y": 0,\r\n "width": 56,\r\n "height": 72,\r\n "xoffset": 0,\r\n "yoffset": 31,\r\n "xadvance": 56,\r\n "page": 0,\r\n "chnl": 0,\r\n "letter": 0\r\n }\r\n ]\r\n },\r\n "kernings": {\r\n "count": 0,\r\n "data": []\r\n }\r\n}'
- }), define("text!screens/../../game_assets/gfx/gfx.atlas.json", [],
- function() {
- return '{"frames": {\r\n\r\n"background0000":\r\n{\r\n "frame": {"x":1,"y":1,"w":351,"h":401},\r\n "rotated": false,\r\n "trimmed": false,\r\n "spriteSourceSize": {"x":0,"y":0,"w":351,"h":401},\r\n "sourceSize": {"w":351,"h":401}\r\n},\r\n"bestSign0000":\r\n{\r\n "frame": {"x":221,"y":403,"w":119,"h":42},\r\n "rotated": false,\r\n "trimmed": false,\r\n "spriteSourceSize": {"x":0,"y":0,"w":119,"h":42},\r\n "sourceSize": {"w":119,"h":42}\r\n},\r\n"bigPlatformEndSegment0000":\r\n{\r\n "frame": {"x":814,"y":1,"w":192,"h":196},\r\n "rotated": false,\r\n "trimmed": false,\r\n "spriteSourceSize": {"x":0,"y":0,"w":192,"h":196},\r\n "sourceSize": {"w":192,"h":196}\r\n},\r\n"bigPlatformMiddleSegment0000":\r\n{\r\n "frame": {"x":827,"y":198,"w":177,"h":196},\r\n "rotated": false,\r\n "trimmed": false,\r\n "spriteSourceSize": {"x":0,"y":0,"w":177,"h":196},\r\n "sourceSize": {"w":177,"h":196}\r\n},\r\n"bigPlayButton0000":\r\n{\r\n "frame": {"x":353,"y":285,"w":162,"h":164},\r\n "rotated": false,\r\n "trimmed": false,\r\n "spriteSourceSize": {"x":0,"y":0,"w":162,"h":164},\r\n "sourceSize": {"w":162,"h":164}\r\n},\r\n"gameOverSign0000":\r\n{\r\n "frame": {"x":353,"y":210,"w":473,"h":74},\r\n "rotated": false,\r\n "trimmed": false,\r\n "spriteSourceSize": {"x":0,"y":0,"w":473,"h":74},\r\n "sourceSize": {"w":473,"h":74}\r\n},\r\n"hero0000":\r\n{\r\n "frame": {"x":604,"y":285,"w":84,"h":84},\r\n "rotated": false,\r\n "trimmed": false,\r\n "spriteSourceSize": {"x":0,"y":0,"w":84,"h":84},\r\n "sourceSize": {"w":84,"h":84}\r\n},\r\n"infoButton0000":\r\n{\r\n "frame": {"x":890,"y":395,"w":109,"h":111},\r\n "rotated": false,\r\n "trimmed": false,\r\n "spriteSourceSize": {"x":0,"y":0,"w":109,"h":111},\r\n "sourceSize": {"w":109,"h":111}\r\n},\r\n"logo0000":\r\n{\r\n "frame": {"x":353,"y":1,"w":460,"h":208},\r\n "rotated": false,\r\n "trimmed": false,\r\n "spriteSourceSize": {"x":0,"y":0,"w":460,"h":208},\r\n "sourceSize": {"w":460,"h":208}\r\n},\r\n"muteButton0000":\r\n{\r\n "frame": {"x":1,"y":403,"w":109,"h":111},\r\n "rotated": false,\r\n "trimmed": false,\r\n "spriteSourceSize": {"x":0,"y":0,"w":109,"h":111},\r\n "sourceSize": {"w":109,"h":111}\r\n},\r\n"pauseButton0000":\r\n{\r\n "frame": {"x":516,"y":285,"w":87,"h":88},\r\n "rotated": false,\r\n "trimmed": false,\r\n "spriteSourceSize": {"x":0,"y":0,"w":87,"h":88},\r\n "sourceSize": {"w":87,"h":88}\r\n},\r\n"platform0000":\r\n{\r\n "frame": {"x":221,"y":446,"w":104,"h":39},\r\n "rotated": false,\r\n "trimmed": false,\r\n "spriteSourceSize": {"x":0,"y":0,"w":104,"h":39},\r\n "sourceSize": {"w":104,"h":39}\r\n},\r\n"progressBarBackground0000":\r\n{\r\n "frame": {"x":604,"y":370,"w":124,"h":24},\r\n "rotated": false,\r\n "trimmed": false,\r\n "spriteSourceSize": {"x":0,"y":0,"w":124,"h":24},\r\n "sourceSize": {"w":124,"h":24}\r\n},\r\n"progressBarForeground0000":\r\n{\r\n "frame": {"x":1007,"y":1,"w":12,"h":12},\r\n "rotated": false,\r\n "trimmed": false,\r\n "spriteSourceSize": {"x":0,"y":0,"w":12,"h":12},\r\n "sourceSize": {"w":12,"h":12}\r\n},\r\n"scoreSign0000":\r\n{\r\n "frame": {"x":516,"y":438,"w":154,"h":40},\r\n "rotated": false,\r\n "trimmed": false,\r\n "spriteSourceSize": {"x":0,"y":0,"w":154,"h":40},\r\n "sourceSize": {"w":154,"h":40}\r\n},\r\n"scoreSignSmall0000":\r\n{\r\n "frame": {"x":729,"y":285,"w":86,"h":23},\r\n "rotated": false,\r\n "trimmed": false,\r\n "spriteSourceSize": {"x":0,"y":0,"w":86,"h":23},\r\n "sourceSize": {"w":86,"h":23}\r\n},\r\n"tapToContinueSign0000":\r\n{\r\n "frame": {"x":516,"y":395,"w":373,"h":42},\r\n "rotated": false,\r\n "trimmed": false,\r\n "spriteSourceSize": {"x":0,"y":0,"w":373,"h":42},\r\n "sourceSize": {"w":373,"h":42}\r\n},\r\n"unmuteButton0000":\r\n{\r\n "frame": {"x":111,"y":403,"w":109,"h":111},\r\n "rotated": false,\r\n "trimmed": false,\r\n "spriteSourceSize": {"x":0,"y":0,"w":109,"h":111},\r\n "sourceSize": {"w":109,"h":111}\r\n}},\r\n"meta": {\r\n "app": "Adobe Flash Professional",\r\n "version": "13.0.0.759",\r\n "image": "gfx.atlas.png",\r\n "format": "RGBA8888",\r\n "size": {"w":1024,"h":1024},\r\n "scale": "1"\r\n}\r\n}\r\n'
- }), define("text!screens/../../game_assets/gfx/smallDigits.json", [],
- function() {
- return '{\r\n "info": {\r\n "face": "font",\r\n "size": 32,\r\n "bold": 0,\r\n "italic": 0,\r\n "charset": 0,\r\n "unicode": 0,\r\n "stretchH": 100,\r\n "smooth": 1,\r\n "aa": 1,\r\n "padding": "0,0,0,0",\r\n "spacing": "1,1"\r\n },\r\n "common": {\r\n "lineHeight": 103,\r\n "base": 26,\r\n "scaleW": 128,\r\n "scaleH": 256,\r\n "pages": 1,\r\n "packed": 0,\r\n "alphaChnl": 1,\r\n "redChnl": 0,\r\n "greenChnl": 0,\r\n "blueChnl": 0\r\n },\r\n "page": {\r\n "id": 0,\r\n "file": "font.png"\r\n },\r\n "chars": {\r\n "count": 12,\r\n "data": [\r\n {\r\n "id": 49,\r\n "x": 39,\r\n "y": 0,\r\n "width": 22,\r\n "height": 46,\r\n "xoffset": 0,\r\n "yoffset": 56,\r\n "xadvance": 22,\r\n "page": 0,\r\n "chnl": 0,\r\n "letter": 1\r\n },\r\n {\r\n "id": 50,\r\n "x": 36,\r\n "y": 194,\r\n "width": 35,\r\n "height": 47,\r\n "xoffset": 0,\r\n "yoffset": 55,\r\n "xadvance": 35,\r\n "page": 0,\r\n "chnl": 0,\r\n "letter": 2\r\n },\r\n {\r\n "id": 51,\r\n "x": 37,\r\n "y": 144,\r\n "width": 34,\r\n "height": 48,\r\n "xoffset": 0,\r\n "yoffset": 56,\r\n "xadvance": 34,\r\n "page": 0,\r\n "chnl": 0,\r\n "letter": 3\r\n },\r\n {\r\n "id": 52,\r\n "x": 0,\r\n "y": 194,\r\n "width": 35,\r\n "height": 45,\r\n "xoffset": 0,\r\n "yoffset": 57,\r\n "xadvance": 35,\r\n "page": 0,\r\n "chnl": 0,\r\n "letter": 4\r\n },\r\n {\r\n "id": 53,\r\n "x": 38,\r\n "y": 50,\r\n "width": 33,\r\n "height": 46,\r\n "xoffset": 0,\r\n "yoffset": 57,\r\n "xadvance": 33,\r\n "page": 0,\r\n "chnl": 0,\r\n "letter": 5\r\n },\r\n {\r\n "id": 54,\r\n "x": 0,\r\n "y": 146,\r\n "width": 36,\r\n "height": 47,\r\n "xoffset": 0,\r\n "yoffset": 56,\r\n "xadvance": 36,\r\n "page": 0,\r\n "chnl": 0,\r\n "letter": 6\r\n },\r\n {\r\n "id": 55,\r\n "x": 37,\r\n "y": 98,\r\n "width": 34,\r\n "height": 45,\r\n "xoffset": 0,\r\n "yoffset": 57,\r\n "xadvance": 34,\r\n "page": 0,\r\n "chnl": 0,\r\n "letter": 7\r\n },\r\n {\r\n "id": 56,\r\n "x": 0,\r\n "y": 50,\r\n "width": 37,\r\n "height": 47,\r\n "xoffset": 0,\r\n "yoffset": 56,\r\n "xadvance": 37,\r\n "page": 0,\r\n "chnl": 0,\r\n "letter": 8\r\n },\r\n {\r\n "id": 57,\r\n "x": 0,\r\n "y": 98,\r\n "width": 36,\r\n "height": 47,\r\n "xoffset": 0,\r\n "yoffset": 56,\r\n "xadvance": 36,\r\n "page": 0,\r\n "chnl": 0,\r\n "letter": 9\r\n },\r\n {\r\n "id": 48,\r\n "x": 0,\r\n "y": 0,\r\n "width": 38,\r\n "height": 49,\r\n "xoffset": 0,\r\n "yoffset": 54,\r\n "xadvance": 38,\r\n "page": 0,\r\n "chnl": 0,\r\n "letter": 0\r\n }\r\n ]\r\n },\r\n "kernings": {\r\n "count": 0,\r\n "data": []\r\n }\r\n}'
- }), define("text!screens/../../game_assets/gfx/waterAnim.json", [],
- function() {
- return '{"frames": {\r\n\r\n"waterAnim0000":\r\n{\r\n "frame": {"x":2,"y":2,"w":186,"h":110},\r\n "rotated": false,\r\n "trimmed": false,\r\n "spriteSourceSize": {"x":0,"y":0,"w":186,"h":110},\r\n "sourceSize": {"w":186,"h":110}\r\n},\r\n"waterAnim0001":\r\n{\r\n "frame": {"x":190,"y":2,"w":186,"h":110},\r\n "rotated": false,\r\n "trimmed": false,\r\n "spriteSourceSize": {"x":0,"y":0,"w":186,"h":110},\r\n "sourceSize": {"w":186,"h":110}\r\n},\r\n"waterAnim0002":\r\n{\r\n "frame": {"x":2,"y":114,"w":186,"h":110},\r\n "rotated": false,\r\n "trimmed": false,\r\n "spriteSourceSize": {"x":0,"y":0,"w":186,"h":110},\r\n "sourceSize": {"w":186,"h":110}\r\n},\r\n"waterAnim0003":\r\n{\r\n "frame": {"x":190,"y":114,"w":186,"h":110},\r\n "rotated": false,\r\n "trimmed": false,\r\n "spriteSourceSize": {"x":0,"y":0,"w":186,"h":110},\r\n "sourceSize": {"w":186,"h":110}\r\n},\r\n"waterAnim0004":\r\n{\r\n "frame": {"x":2,"y":226,"w":186,"h":110},\r\n "rotated": false,\r\n "trimmed": false,\r\n "spriteSourceSize": {"x":0,"y":0,"w":186,"h":110},\r\n "sourceSize": {"w":186,"h":110}\r\n}},\r\n"meta": {\r\n "app": "Adobe Flash Professional",\r\n "version": "13.1.0.217",\r\n "image": "waterAnim.png",\r\n "format": "RGBA8888",\r\n "size": {"w":512,"h":512},\r\n "scale": "1"\r\n}\r\n}\r\n'
- }), define("screens/ScreenController", ["require", "screens/MainMenuScreen", "screens/GameScreen", "screens/PreloadingScreen", "ScreenController", "prld", "gameAssets", "assetStorage", "gui/Button", "cjs", "soundjs", "tweenjs", "Storage", "ScaleUtils", "screenSize", "soundjs", "text!../../game_assets/gfx/font.json", "text!../../game_assets/gfx/gfx.atlas.json", "text!../../game_assets/gfx/smallDigits.json", "text!../../game_assets/gfx/waterAnim.json"],
- function(e) {
- var t = e("screens/MainMenuScreen"),
- n = e("screens/GameScreen"),
- r = e("screens/PreloadingScreen"),
- i = e("ScreenController"),
- s = e("prld"),
- o = e("gameAssets"),
- u = e("assetStorage"),
- a = e("gui/Button"),
- f = e("cjs"),
- l = e("soundjs"),
- c = e("tweenjs"),
- h = e("Storage"),
- p = e("ScaleUtils"),
- d = e("screenSize"),
- l = e("soundjs"),
- v = e("text!../../game_assets/gfx/font.json"),
- m = e("text!../../game_assets/gfx/gfx.atlas.json"),
- g = e("text!../../game_assets/gfx/smallDigits.json"),
- y = e("text!../../game_assets/gfx/waterAnim.json"),
- b = function(e, o) {
- this._view = new f.Container,
- this._fade = this._createFadeShape(),
- i.call(this, this._view),
- this.setupTicker();
- var c = new h("jumpingFrog");
- l.Sound.initializeDefaultPlugins(),
- l.Sound.alternateExtensions = ["ogg"],
- this._gameStage = new f.Stage(o),
- this._gameStage.enableMouseOver(20),
- createjs.Touch.enable(this._gameStage),
- this._gameStage.snapToPixelEnabled = !1,
- this._gameStage.addChild(this._view),
- this._gameStage.addChild(this._fade),
- this._backgroundStage = new f.Stage(e),
- this._backgroundStage.mouseEnabled = !1,
- this._backgroundStage.mouseChildren = !1;
- var p = new s.LoadQueue(!1, "game_assets/", !1);
- p.installPlugin(l.Sound),
- p.loadManifest(this.createManifest()),
- p.on("fileload",
- function(e) {
- u.add(e.result, e.item.id, !1)
- }),
- p.on("complete",
- function(e) {
- u.add(JSON.parse(v.toString()), "gfx/font.json", !1),
- u.add(JSON.parse(m.toString()), "gfx/gfx.atlas.json", !1),
- u.add(JSON.parse(g.toString()), "gfx/smallDigits.json", !1),
- u.add(JSON.parse(y.toString()), "gfx/waterAnim.json", !1)
- }),
- this.setScreens({
- mainMenuScreen: new t,
- gameScreen: new n(this._gameStage, c),
- preloadingScreen: new r(p, {
- x: 0,
- y: 0,
- width: d.width,
- height: d.height
- })
- }),
- this.goToScreen("preloadingScreen"),
- this._gameStage.on("mouseover",
- function(e) {
- var t = e.target;
- t instanceof a && (t.scaleX = t.scaleY = 1.05)
- }),
- this._gameStage.on("mouseout",
- function(e) {
- var t = e.target;
- t instanceof a && (t.scaleX = t.scaleY = 1)
- }),
- this._gameStage.on("click",
- function(e) {
- var t = e.target;
- t instanceof a && l.Sound.play("sfx/buttontap.mp3")
- })
- },
- w = b.prototype = Object.create(i.prototype);
- return w.constructor = b,
- w.setupTicker = function() {
- f.Ticker.timingMode = f.Ticker.RAF,
- f.Ticker.setFPS(30),
- f.Ticker.on("tick",
- function(e) {
- this._gameStage.update(e)
- },
- this)
- },
- w.createManifest = function() {
- var e = [];
- for (var t in o) o.hasOwnProperty(t) && e.push({
- src: o[t],
- id: o[t]
- });
- return e
- },
- w._BaseScreenController_pushScreen = w._pushScreen,
- w._pushScreen = function(e) {
- e.getName() == "preloadingScreen" ? this._BaseScreenController_pushScreen(e) : (this._fade.visible = !0, this._fade.alpha = 0, c.Tween.get(this._fade).to({
- alpha: 1
- },
- 100).call(function(e) {
- this.getActiveScreen() && this.getActiveScreen().getName() == "preloadingScreen" && (this._showBackground(), l.Sound.play("sfx/theme.mp3", {
- loop: -1
- })),
- this._BaseScreenController_pushScreen(e),
- c.Tween.get(this._fade).to({
- alpha: 0
- },
- 100).call(function() {
- this._fade.visible = !1
- },
- null, this)
- },
- [e], this))
- },
- w._createFadeShape = function() {
- var e = new f.Shape;
- return e.graphics.beginFill("#000000").drawRect(0, 0, d.width, d.height),
- e.alpha = 0,
- e
- },
- w._showBackground = function() {
- var e = u.getBitmap("gfx/background.png"),
- t = e.getBounds(),
- n = p.fill(t.width, t.height, d.width, d.height);
- e.scaleX = e.scaleY = n.width / t.width,
- e.x = (d.width - n.width) / 2,
- e.y = d.height - n.height,
- this._backgroundStage.addChild(e),
- this._backgroundStage.update()
- },
- b
- }), define("domReady", [],
- function() {
- function u(e) {
- var t;
- for (t = 0; t < e.length; t += 1) e[t](s)
- }
- function a() {
- var e = o;
- i && e.length && (o = [], u(e))
- }
- function f() {
- i || (i = !0, n && clearInterval(n), a())
- }
- function c(e) {
- return i ? e(s) : o.push(e),
- c
- }
- var e, t, n, r = typeof window != "undefined" && window.document,
- i = !r,
- s = r ? document: null,
- o = [];
- if (r) {
- if (document.addEventListener) document.addEventListener("DOMContentLoaded", f, !1),
- window.addEventListener("load", f, !1);
- else if (window.attachEvent) {
- window.attachEvent("onload", f),
- t = document.createElement("div");
- try {
- e = window.frameElement === null
- } catch(l) {}
- t.doScroll && e && window.external && (n = setInterval(function() {
- try {
- t.doScroll(),
- f()
- } catch(e) {}
- },
- 30))
- }
- document.readyState === "complete" && f()
- }
- return c.version = "2.0.1",
- c.load = function(e, t, n, r) {
- r.isBuild ? n(null) : c(n)
- },
- c
- });
- var Stats = function() {
- var e = Date.now(),
- t = e,
- n = 0,
- r = Infinity,
- i = 0,
- s = 0,
- o = Infinity,
- u = 0,
- a = 0,
- f = 0,
- l = document.createElement("div");
- l.id = "stats",
- l.addEventListener("mousedown",
- function(e) {
- e.preventDefault(),
- y(++f % 2)
- },
- !1),
- l.style.cssText = "width:80px;opacity:0.9;cursor:pointer";
- var c = document.createElement("div");
- c.id = "fps",
- c.style.cssText = "padding:0 0 3px 3px;text-align:left;background-color:#002",
- l.appendChild(c);
- var h = document.createElement("div");
- h.id = "fpsText",
- h.style.cssText = "color:#0ff;font-family:Helvetica,Arial,sans-serif;font-size:9px;font-weight:bold;line-height:15px",
- h.innerHTML = "FPS",
- c.appendChild(h);
- var p = document.createElement("div");
- p.id = "fpsGraph",
- p.style.cssText = "position:relative;width:74px;height:30px;background-color:#0ff",
- c.appendChild(p);
- while (p.children.length < 74) {
- var d = document.createElement("span");
- d.style.cssText = "width:1px;height:30px;float:left;background-color:#113",
- p.appendChild(d)
- }
- var v = document.createElement("div");
- v.id = "ms",
- v.style.cssText = "padding:0 0 3px 3px;text-align:left;background-color:#020;display:none",
- l.appendChild(v);
- var m = document.createElement("div");
- m.id = "msText",
- m.style.cssText = "color:#0f0;font-family:Helvetica,Arial,sans-serif;font-size:9px;font-weight:bold;line-height:15px",
- m.innerHTML = "MS",
- v.appendChild(m);
- var g = document.createElement("div");
- g.id = "msGraph",
- g.style.cssText = "position:relative;width:74px;height:30px;background-color:#0f0",
- v.appendChild(g);
- while (g.children.length < 74) {
- var d = document.createElement("span");
- d.style.cssText = "width:1px;height:30px;float:left;background-color:#131",
- g.appendChild(d)
- }
- var y = function(e) {
- f = e;
- switch (f) {
- case 0:
- c.style.display = "block",
- v.style.display = "none";
- break;
- case 1:
- c.style.display = "none",
- v.style.display = "block"
- }
- },
- b = function(e, t) {
- var n = e.appendChild(e.firstChild);
- n.style.height = t + "px"
- };
- return {
- REVISION: 11,
- domElement: l,
- setMode: y,
- begin: function() {
- e = Date.now()
- },
- end: function() {
- var f = Date.now();
- return n = f - e,
- r = Math.min(r, n),
- i = Math.max(i, n),
- m.textContent = n + " MS (" + r + "-" + i + ")",
- b(g, Math.min(30, 30 - n / 200 * 30)),
- a++,
- f > t + 1e3 && (s = Math.round(a * 1e3 / (f - t)), o = Math.min(o, s), u = Math.max(u, s), h.textContent = s + " FPS (" + o + "-" + u + ")", b(p, Math.min(30, 30 - s / 100 * 30)), t = f, a = 0),
- f
- },
- update: function() {
- e = this.end()
- }
- }
- }; define("Stats",
- function(e) {
- return function() {
- var t, n;
- return t || e.Stats
- }
- } (this)), require.config({
- enforceDefine: !0,
- shim: {
- cjs: {
- exports: "createjs"
- },
- prld: {
- exports: "createjs"
- },
- underscore: {
- exports: "_"
- },
- tweenjs: {
- exports: "createjs"
- },
- viewporter: {
- exports: "viewporter"
- },
- soundjs: {
- exports: "createjs"
- },
- Stats: {
- exports: "Stats"
- },
- jstorage: {
- exports: "$"
- },
- wuki: {
- exports: "admeen"
- }
- },
- paths: {
- cjs: "vendor/easeljs-0.7.1.combined",
- prld: "vendor/preloadjs-0.4.1.min",
- underscore: "vendor/underscore-min",
- viewporter: "vendor/viewporter",
- tweenjs: "vendor/tweenjs-0.5.1.min",
- soundjs: "vendor/soundjs-0.5.2.min",
- Stats: "vendor/Stats",
- jstorage: "vendor/jstorage",
- domReady: "vendor/domReady",
- text: "vendor/text",
- wuki: "./api"
- }
- }), define("Main", ["require", "viewporter", "screens/ScreenController", "domReady!", "cjs", "Stats", "screenSize", "wuki"],
- function(e) {
- function v(e, t, n) {
- var r = document.createElement("canvas");
- return r.width = e,
- r.height = t,
- n && n.appendChild(r),
- r
- }
- function m() {
- var e = l,
- t = d,
- n = window.innerWidth,
- r = window.innerHeight,
- i = n / r;
- i > t ? n = r * t: r = n / t,
- e.style.width = n + "px",
- e.style.height = r + "px",
- e.style.left = (window.innerWidth - n) / 2 + "px",
- e.style.top = (window.innerHeight - r) / 2 + "px"
- }
- var t = e("viewporter"),
- n = e("screens/ScreenController"),
- r = e("domReady!"),
- i = e("cjs"),
- s = e("Stats"),
- o = e("screenSize"),
- u = e("wuki");
- u("init", {
- name: "Jumping Rock"
- }),
- window.addEventListener("load",
- function() {
- function e(e) {
- e.preventDefault()
- }
- document.addEventListener("touchmove", e, !1),
- document.addEventListener("touchstart", e, !1)
- },
- !1),
- document.addEventListener("touchmove",
- function(e) {
- e.preventDefault()
- },
- !1),
- document.addEventListener("touchstart",
- function(e) {
- e.preventDefault()
- },
- !1);
- var a = 700,
- f = 800;
- o.setUp(a, f, a * 1.25, f * 1.25);
- var l = document.getElementById("canvasHolder"),
- c = v(o.width, o.height, l),
- h = v(o.width, o.height, l),
- p = new n(c, h, null);
- t.ACTIVE ? (window.addEventListener("viewportready", m), window.addEventListener("viewportchange", m), window.addEventListener("resize", t.refresh), window.addEventListener("orientationchange", t.refresh)) : (window.addEventListener("resize", m, !1), window.addEventListener("orientationchange", m, !1), m());
- var d = o.getRatio();
- m()
- });
|