jquery-2.2.1.js 252 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316531753185319532053215322532353245325532653275328532953305331533253335334533553365337533853395340534153425343534453455346534753485349535053515352535353545355535653575358535953605361536253635364536553665367536853695370537153725373537453755376537753785379538053815382538353845385538653875388538953905391539253935394539553965397539853995400540154025403540454055406540754085409541054115412541354145415541654175418541954205421542254235424542554265427542854295430543154325433543454355436543754385439544054415442544354445445544654475448544954505451545254535454545554565457545854595460546154625463546454655466546754685469547054715472547354745475547654775478547954805481548254835484548554865487548854895490549154925493549454955496549754985499550055015502550355045505550655075508550955105511551255135514551555165517551855195520552155225523552455255526552755285529553055315532553355345535553655375538553955405541554255435544554555465547554855495550555155525553555455555556555755585559556055615562556355645565556655675568556955705571557255735574557555765577557855795580558155825583558455855586558755885589559055915592559355945595559655975598559956005601560256035604560556065607560856095610561156125613561456155616561756185619562056215622562356245625562656275628562956305631563256335634563556365637563856395640564156425643564456455646564756485649565056515652565356545655565656575658565956605661566256635664566556665667566856695670567156725673567456755676567756785679568056815682568356845685568656875688568956905691569256935694569556965697569856995700570157025703570457055706570757085709571057115712571357145715571657175718571957205721572257235724572557265727572857295730573157325733573457355736573757385739574057415742574357445745574657475748574957505751575257535754575557565757575857595760576157625763576457655766576757685769577057715772577357745775577657775778577957805781578257835784578557865787578857895790579157925793579457955796579757985799580058015802580358045805580658075808580958105811581258135814581558165817581858195820582158225823582458255826582758285829583058315832583358345835583658375838583958405841584258435844584558465847584858495850585158525853585458555856585758585859586058615862586358645865586658675868586958705871587258735874587558765877587858795880588158825883588458855886588758885889589058915892589358945895589658975898589959005901590259035904590559065907590859095910591159125913591459155916591759185919592059215922592359245925592659275928592959305931593259335934593559365937593859395940594159425943594459455946594759485949595059515952595359545955595659575958595959605961596259635964596559665967596859695970597159725973597459755976597759785979598059815982598359845985598659875988598959905991599259935994599559965997599859996000600160026003600460056006600760086009601060116012601360146015601660176018601960206021602260236024602560266027602860296030603160326033603460356036603760386039604060416042604360446045604660476048604960506051605260536054605560566057605860596060606160626063606460656066606760686069607060716072607360746075607660776078607960806081608260836084608560866087608860896090609160926093609460956096609760986099610061016102610361046105610661076108610961106111611261136114611561166117611861196120612161226123612461256126612761286129613061316132613361346135613661376138613961406141614261436144614561466147614861496150615161526153615461556156615761586159616061616162616361646165616661676168616961706171617261736174617561766177617861796180618161826183618461856186618761886189619061916192619361946195619661976198619962006201620262036204620562066207620862096210621162126213621462156216621762186219622062216222622362246225622662276228622962306231623262336234623562366237623862396240624162426243624462456246624762486249625062516252625362546255625662576258625962606261626262636264626562666267626862696270627162726273627462756276627762786279628062816282628362846285628662876288628962906291629262936294629562966297629862996300630163026303630463056306630763086309631063116312631363146315631663176318631963206321632263236324632563266327632863296330633163326333633463356336633763386339634063416342634363446345634663476348634963506351635263536354635563566357635863596360636163626363636463656366636763686369637063716372637363746375637663776378637963806381638263836384638563866387638863896390639163926393639463956396639763986399640064016402640364046405640664076408640964106411641264136414641564166417641864196420642164226423642464256426642764286429643064316432643364346435643664376438643964406441644264436444644564466447644864496450645164526453645464556456645764586459646064616462646364646465646664676468646964706471647264736474647564766477647864796480648164826483648464856486648764886489649064916492649364946495649664976498649965006501650265036504650565066507650865096510651165126513651465156516651765186519652065216522652365246525652665276528652965306531653265336534653565366537653865396540654165426543654465456546654765486549655065516552655365546555655665576558655965606561656265636564656565666567656865696570657165726573657465756576657765786579658065816582658365846585658665876588658965906591659265936594659565966597659865996600660166026603660466056606660766086609661066116612661366146615661666176618661966206621662266236624662566266627662866296630663166326633663466356636663766386639664066416642664366446645664666476648664966506651665266536654665566566657665866596660666166626663666466656666666766686669667066716672667366746675667666776678667966806681668266836684668566866687668866896690669166926693669466956696669766986699670067016702670367046705670667076708670967106711671267136714671567166717671867196720672167226723672467256726672767286729673067316732673367346735673667376738673967406741674267436744674567466747674867496750675167526753675467556756675767586759676067616762676367646765676667676768676967706771677267736774677567766777677867796780678167826783678467856786678767886789679067916792679367946795679667976798679968006801680268036804680568066807680868096810681168126813681468156816681768186819682068216822682368246825682668276828682968306831683268336834683568366837683868396840684168426843684468456846684768486849685068516852685368546855685668576858685968606861686268636864686568666867686868696870687168726873687468756876687768786879688068816882688368846885688668876888688968906891689268936894689568966897689868996900690169026903690469056906690769086909691069116912691369146915691669176918691969206921692269236924692569266927692869296930693169326933693469356936693769386939694069416942694369446945694669476948694969506951695269536954695569566957695869596960696169626963696469656966696769686969697069716972697369746975697669776978697969806981698269836984698569866987698869896990699169926993699469956996699769986999700070017002700370047005700670077008700970107011701270137014701570167017701870197020702170227023702470257026702770287029703070317032703370347035703670377038703970407041704270437044704570467047704870497050705170527053705470557056705770587059706070617062706370647065706670677068706970707071707270737074707570767077707870797080708170827083708470857086708770887089709070917092709370947095709670977098709971007101710271037104710571067107710871097110711171127113711471157116711771187119712071217122712371247125712671277128712971307131713271337134713571367137713871397140714171427143714471457146714771487149715071517152715371547155715671577158715971607161716271637164716571667167716871697170717171727173717471757176717771787179718071817182718371847185718671877188718971907191719271937194719571967197719871997200720172027203720472057206720772087209721072117212721372147215721672177218721972207221722272237224722572267227722872297230723172327233723472357236723772387239724072417242724372447245724672477248724972507251725272537254725572567257725872597260726172627263726472657266726772687269727072717272727372747275727672777278727972807281728272837284728572867287728872897290729172927293729472957296729772987299730073017302730373047305730673077308730973107311731273137314731573167317731873197320732173227323732473257326732773287329733073317332733373347335733673377338733973407341734273437344734573467347734873497350735173527353735473557356735773587359736073617362736373647365736673677368736973707371737273737374737573767377737873797380738173827383738473857386738773887389739073917392739373947395739673977398739974007401740274037404740574067407740874097410741174127413741474157416741774187419742074217422742374247425742674277428742974307431743274337434743574367437743874397440744174427443744474457446744774487449745074517452745374547455745674577458745974607461746274637464746574667467746874697470747174727473747474757476747774787479748074817482748374847485748674877488748974907491749274937494749574967497749874997500750175027503750475057506750775087509751075117512751375147515751675177518751975207521752275237524752575267527752875297530753175327533753475357536753775387539754075417542754375447545754675477548754975507551755275537554755575567557755875597560756175627563756475657566756775687569757075717572757375747575757675777578757975807581758275837584758575867587758875897590759175927593759475957596759775987599760076017602760376047605760676077608760976107611761276137614761576167617761876197620762176227623762476257626762776287629763076317632763376347635763676377638763976407641764276437644764576467647764876497650765176527653765476557656765776587659766076617662766376647665766676677668766976707671767276737674767576767677767876797680768176827683768476857686768776887689769076917692769376947695769676977698769977007701770277037704770577067707770877097710771177127713771477157716771777187719772077217722772377247725772677277728772977307731773277337734773577367737773877397740774177427743774477457746774777487749775077517752775377547755775677577758775977607761776277637764776577667767776877697770777177727773777477757776777777787779778077817782778377847785778677877788778977907791779277937794779577967797779877997800780178027803780478057806780778087809781078117812781378147815781678177818781978207821782278237824782578267827782878297830783178327833783478357836783778387839784078417842784378447845784678477848784978507851785278537854785578567857785878597860786178627863786478657866786778687869787078717872787378747875787678777878787978807881788278837884788578867887788878897890789178927893789478957896789778987899790079017902790379047905790679077908790979107911791279137914791579167917791879197920792179227923792479257926792779287929793079317932793379347935793679377938793979407941794279437944794579467947794879497950795179527953795479557956795779587959796079617962796379647965796679677968796979707971797279737974797579767977797879797980798179827983798479857986798779887989799079917992799379947995799679977998799980008001800280038004800580068007800880098010801180128013801480158016801780188019802080218022802380248025802680278028802980308031803280338034803580368037803880398040804180428043804480458046804780488049805080518052805380548055805680578058805980608061806280638064806580668067806880698070807180728073807480758076807780788079808080818082808380848085808680878088808980908091809280938094809580968097809880998100810181028103810481058106810781088109811081118112811381148115811681178118811981208121812281238124812581268127812881298130813181328133813481358136813781388139814081418142814381448145814681478148814981508151815281538154815581568157815881598160816181628163816481658166816781688169817081718172817381748175817681778178817981808181818281838184818581868187818881898190819181928193819481958196819781988199820082018202820382048205820682078208820982108211821282138214821582168217821882198220822182228223822482258226822782288229823082318232823382348235823682378238823982408241824282438244824582468247824882498250825182528253825482558256825782588259826082618262826382648265826682678268826982708271827282738274827582768277827882798280828182828283828482858286828782888289829082918292829382948295829682978298829983008301830283038304830583068307830883098310831183128313831483158316831783188319832083218322832383248325832683278328832983308331833283338334833583368337833883398340834183428343834483458346834783488349835083518352835383548355835683578358835983608361836283638364836583668367836883698370837183728373837483758376837783788379838083818382838383848385838683878388838983908391839283938394839583968397839883998400840184028403840484058406840784088409841084118412841384148415841684178418841984208421842284238424842584268427842884298430843184328433843484358436843784388439844084418442844384448445844684478448844984508451845284538454845584568457845884598460846184628463846484658466846784688469847084718472847384748475847684778478847984808481848284838484848584868487848884898490849184928493849484958496849784988499850085018502850385048505850685078508850985108511851285138514851585168517851885198520852185228523852485258526852785288529853085318532853385348535853685378538853985408541854285438544854585468547854885498550855185528553855485558556855785588559856085618562856385648565856685678568856985708571857285738574857585768577857885798580858185828583858485858586858785888589859085918592859385948595859685978598859986008601860286038604860586068607860886098610861186128613861486158616861786188619862086218622862386248625862686278628862986308631863286338634863586368637863886398640864186428643864486458646864786488649865086518652865386548655865686578658865986608661866286638664866586668667866886698670867186728673867486758676867786788679868086818682868386848685868686878688868986908691869286938694869586968697869886998700870187028703870487058706870787088709871087118712871387148715871687178718871987208721872287238724872587268727872887298730873187328733873487358736873787388739874087418742874387448745874687478748874987508751875287538754875587568757875887598760876187628763876487658766876787688769877087718772877387748775877687778778877987808781878287838784878587868787878887898790879187928793879487958796879787988799880088018802880388048805880688078808880988108811881288138814881588168817881888198820882188228823882488258826882788288829883088318832883388348835883688378838883988408841884288438844884588468847884888498850885188528853885488558856885788588859886088618862886388648865886688678868886988708871887288738874887588768877887888798880888188828883888488858886888788888889889088918892889388948895889688978898889989008901890289038904890589068907890889098910891189128913891489158916891789188919892089218922892389248925892689278928892989308931893289338934893589368937893889398940894189428943894489458946894789488949895089518952895389548955895689578958895989608961896289638964896589668967896889698970897189728973897489758976897789788979898089818982898389848985898689878988898989908991899289938994899589968997899889999000900190029003900490059006900790089009901090119012901390149015901690179018901990209021902290239024902590269027902890299030903190329033903490359036903790389039904090419042904390449045904690479048904990509051905290539054905590569057905890599060906190629063906490659066906790689069907090719072907390749075907690779078907990809081908290839084908590869087908890899090909190929093909490959096909790989099910091019102910391049105910691079108910991109111911291139114911591169117911891199120912191229123912491259126912791289129913091319132913391349135913691379138913991409141914291439144914591469147914891499150915191529153915491559156915791589159916091619162916391649165916691679168916991709171917291739174917591769177917891799180918191829183918491859186918791889189919091919192919391949195919691979198919992009201920292039204920592069207920892099210921192129213921492159216921792189219922092219222922392249225922692279228922992309231923292339234923592369237923892399240924192429243924492459246924792489249925092519252925392549255925692579258925992609261926292639264926592669267926892699270927192729273927492759276927792789279928092819282928392849285928692879288928992909291929292939294929592969297929892999300930193029303930493059306930793089309931093119312931393149315931693179318931993209321932293239324932593269327932893299330933193329333933493359336933793389339934093419342934393449345934693479348934993509351935293539354935593569357935893599360936193629363936493659366936793689369937093719372937393749375937693779378937993809381938293839384938593869387938893899390939193929393939493959396939793989399940094019402940394049405940694079408940994109411941294139414941594169417941894199420942194229423942494259426942794289429943094319432943394349435943694379438943994409441944294439444944594469447944894499450945194529453945494559456945794589459946094619462946394649465946694679468946994709471947294739474947594769477947894799480948194829483948494859486948794889489949094919492949394949495949694979498949995009501950295039504950595069507950895099510951195129513951495159516951795189519952095219522952395249525952695279528952995309531953295339534953595369537953895399540954195429543954495459546954795489549955095519552955395549555955695579558955995609561956295639564956595669567956895699570957195729573957495759576957795789579958095819582958395849585958695879588958995909591959295939594959595969597959895999600960196029603960496059606960796089609961096119612961396149615961696179618961996209621962296239624962596269627962896299630963196329633963496359636963796389639964096419642964396449645964696479648964996509651965296539654965596569657965896599660966196629663966496659666966796689669967096719672967396749675967696779678967996809681968296839684968596869687968896899690969196929693969496959696969796989699970097019702970397049705970697079708970997109711971297139714971597169717971897199720972197229723972497259726972797289729973097319732973397349735973697379738973997409741974297439744974597469747974897499750975197529753975497559756975797589759976097619762976397649765976697679768976997709771977297739774977597769777977897799780978197829783978497859786978797889789979097919792979397949795979697979798979998009801980298039804980598069807980898099810981198129813981498159816981798189819982098219822982398249825982698279828982998309831
  1. /*!
  2. * jQuery JavaScript Library v2.2.1
  3. * http://jquery.com/
  4. *
  5. * Includes Sizzle.js
  6. * http://sizzlejs.com/
  7. *
  8. * Copyright jQuery Foundation and other contributors
  9. * Released under the MIT license
  10. * http://jquery.org/license
  11. *
  12. * Date: 2016-02-22T19:11Z
  13. */
  14. (function( global, factory ) {
  15. if ( typeof module === "object" && typeof module.exports === "object" ) {
  16. // For CommonJS and CommonJS-like environments where a proper `window`
  17. // is present, execute the factory and get jQuery.
  18. // For environments that do not have a `window` with a `document`
  19. // (such as Node.js), expose a factory as module.exports.
  20. // This accentuates the need for the creation of a real `window`.
  21. // e.g. var jQuery = require("jquery")(window);
  22. // See ticket #14549 for more info.
  23. module.exports = global.document ?
  24. factory( global, true ) :
  25. function( w ) {
  26. if ( !w.document ) {
  27. throw new Error( "jQuery requires a window with a document" );
  28. }
  29. return factory( w );
  30. };
  31. } else {
  32. factory( global );
  33. }
  34. // Pass this if window is not defined yet
  35. }(typeof window !== "undefined" ? window : this, function( window, noGlobal ) {
  36. // Support: Firefox 18+
  37. // Can't be in strict mode, several libs including ASP.NET trace
  38. // the stack via arguments.caller.callee and Firefox dies if
  39. // you try to trace through "use strict" call chains. (#13335)
  40. //"use strict";
  41. var arr = [];
  42. var document = window.document;
  43. var slice = arr.slice;
  44. var concat = arr.concat;
  45. var push = arr.push;
  46. var indexOf = arr.indexOf;
  47. var class2type = {};
  48. var toString = class2type.toString;
  49. var hasOwn = class2type.hasOwnProperty;
  50. var support = {};
  51. var
  52. version = "2.2.1",
  53. // Define a local copy of jQuery
  54. jQuery = function( selector, context ) {
  55. // The jQuery object is actually just the init constructor 'enhanced'
  56. // Need init if jQuery is called (just allow error to be thrown if not included)
  57. return new jQuery.fn.init( selector, context );
  58. },
  59. // Support: Android<4.1
  60. // Make sure we trim BOM and NBSP
  61. rtrim = /^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,
  62. // Matches dashed string for camelizing
  63. rmsPrefix = /^-ms-/,
  64. rdashAlpha = /-([\da-z])/gi,
  65. // Used by jQuery.camelCase as callback to replace()
  66. fcamelCase = function( all, letter ) {
  67. return letter.toUpperCase();
  68. };
  69. jQuery.fn = jQuery.prototype = {
  70. // The current version of jQuery being used
  71. jquery: version,
  72. constructor: jQuery,
  73. // Start with an empty selector
  74. selector: "",
  75. // The default length of a jQuery object is 0
  76. length: 0,
  77. toArray: function() {
  78. return slice.call( this );
  79. },
  80. // Get the Nth element in the matched element set OR
  81. // Get the whole matched element set as a clean array
  82. get: function( num ) {
  83. return num != null ?
  84. // Return just the one element from the set
  85. ( num < 0 ? this[ num + this.length ] : this[ num ] ) :
  86. // Return all the elements in a clean array
  87. slice.call( this );
  88. },
  89. // Take an array of elements and push it onto the stack
  90. // (returning the new matched element set)
  91. pushStack: function( elems ) {
  92. // Build a new jQuery matched element set
  93. var ret = jQuery.merge( this.constructor(), elems );
  94. // Add the old object onto the stack (as a reference)
  95. ret.prevObject = this;
  96. ret.context = this.context;
  97. // Return the newly-formed element set
  98. return ret;
  99. },
  100. // Execute a callback for every element in the matched set.
  101. each: function( callback ) {
  102. return jQuery.each( this, callback );
  103. },
  104. map: function( callback ) {
  105. return this.pushStack( jQuery.map( this, function( elem, i ) {
  106. return callback.call( elem, i, elem );
  107. } ) );
  108. },
  109. slice: function() {
  110. return this.pushStack( slice.apply( this, arguments ) );
  111. },
  112. first: function() {
  113. return this.eq( 0 );
  114. },
  115. last: function() {
  116. return this.eq( -1 );
  117. },
  118. eq: function( i ) {
  119. var len = this.length,
  120. j = +i + ( i < 0 ? len : 0 );
  121. return this.pushStack( j >= 0 && j < len ? [ this[ j ] ] : [] );
  122. },
  123. end: function() {
  124. return this.prevObject || this.constructor();
  125. },
  126. // For internal use only.
  127. // Behaves like an Array's method, not like a jQuery method.
  128. push: push,
  129. sort: arr.sort,
  130. splice: arr.splice
  131. };
  132. jQuery.extend = jQuery.fn.extend = function() {
  133. var options, name, src, copy, copyIsArray, clone,
  134. target = arguments[ 0 ] || {},
  135. i = 1,
  136. length = arguments.length,
  137. deep = false;
  138. // Handle a deep copy situation
  139. if ( typeof target === "boolean" ) {
  140. deep = target;
  141. // Skip the boolean and the target
  142. target = arguments[ i ] || {};
  143. i++;
  144. }
  145. // Handle case when target is a string or something (possible in deep copy)
  146. if ( typeof target !== "object" && !jQuery.isFunction( target ) ) {
  147. target = {};
  148. }
  149. // Extend jQuery itself if only one argument is passed
  150. if ( i === length ) {
  151. target = this;
  152. i--;
  153. }
  154. for ( ; i < length; i++ ) {
  155. // Only deal with non-null/undefined values
  156. if ( ( options = arguments[ i ] ) != null ) {
  157. // Extend the base object
  158. for ( name in options ) {
  159. src = target[ name ];
  160. copy = options[ name ];
  161. // Prevent never-ending loop
  162. if ( target === copy ) {
  163. continue;
  164. }
  165. // Recurse if we're merging plain objects or arrays
  166. if ( deep && copy && ( jQuery.isPlainObject( copy ) ||
  167. ( copyIsArray = jQuery.isArray( copy ) ) ) ) {
  168. if ( copyIsArray ) {
  169. copyIsArray = false;
  170. clone = src && jQuery.isArray( src ) ? src : [];
  171. } else {
  172. clone = src && jQuery.isPlainObject( src ) ? src : {};
  173. }
  174. // Never move original objects, clone them
  175. target[ name ] = jQuery.extend( deep, clone, copy );
  176. // Don't bring in undefined values
  177. } else if ( copy !== undefined ) {
  178. target[ name ] = copy;
  179. }
  180. }
  181. }
  182. }
  183. // Return the modified object
  184. return target;
  185. };
  186. jQuery.extend( {
  187. // Unique for each copy of jQuery on the page
  188. expando: "jQuery" + ( version + Math.random() ).replace( /\D/g, "" ),
  189. // Assume jQuery is ready without the ready module
  190. isReady: true,
  191. error: function( msg ) {
  192. throw new Error( msg );
  193. },
  194. noop: function() {},
  195. isFunction: function( obj ) {
  196. return jQuery.type( obj ) === "function";
  197. },
  198. isArray: Array.isArray,
  199. isWindow: function( obj ) {
  200. return obj != null && obj === obj.window;
  201. },
  202. isNumeric: function( obj ) {
  203. // parseFloat NaNs numeric-cast false positives (null|true|false|"")
  204. // ...but misinterprets leading-number strings, particularly hex literals ("0x...")
  205. // subtraction forces infinities to NaN
  206. // adding 1 corrects loss of precision from parseFloat (#15100)
  207. var realStringObj = obj && obj.toString();
  208. return !jQuery.isArray( obj ) && ( realStringObj - parseFloat( realStringObj ) + 1 ) >= 0;
  209. },
  210. isPlainObject: function( obj ) {
  211. // Not plain objects:
  212. // - Any object or value whose internal [[Class]] property is not "[object Object]"
  213. // - DOM nodes
  214. // - window
  215. if ( jQuery.type( obj ) !== "object" || obj.nodeType || jQuery.isWindow( obj ) ) {
  216. return false;
  217. }
  218. if ( obj.constructor &&
  219. !hasOwn.call( obj.constructor.prototype, "isPrototypeOf" ) ) {
  220. return false;
  221. }
  222. // If the function hasn't returned already, we're confident that
  223. // |obj| is a plain object, created by {} or constructed with new Object
  224. return true;
  225. },
  226. isEmptyObject: function( obj ) {
  227. var name;
  228. for ( name in obj ) {
  229. return false;
  230. }
  231. return true;
  232. },
  233. type: function( obj ) {
  234. if ( obj == null ) {
  235. return obj + "";
  236. }
  237. // Support: Android<4.0, iOS<6 (functionish RegExp)
  238. return typeof obj === "object" || typeof obj === "function" ?
  239. class2type[ toString.call( obj ) ] || "object" :
  240. typeof obj;
  241. },
  242. // Evaluates a script in a global context
  243. globalEval: function( code ) {
  244. var script,
  245. indirect = eval;
  246. code = jQuery.trim( code );
  247. if ( code ) {
  248. // If the code includes a valid, prologue position
  249. // strict mode pragma, execute code by injecting a
  250. // script tag into the document.
  251. if ( code.indexOf( "use strict" ) === 1 ) {
  252. script = document.createElement( "script" );
  253. script.text = code;
  254. document.head.appendChild( script ).parentNode.removeChild( script );
  255. } else {
  256. // Otherwise, avoid the DOM node creation, insertion
  257. // and removal by using an indirect global eval
  258. indirect( code );
  259. }
  260. }
  261. },
  262. // Convert dashed to camelCase; used by the css and data modules
  263. // Support: IE9-11+
  264. // Microsoft forgot to hump their vendor prefix (#9572)
  265. camelCase: function( string ) {
  266. return string.replace( rmsPrefix, "ms-" ).replace( rdashAlpha, fcamelCase );
  267. },
  268. nodeName: function( elem, name ) {
  269. return elem.nodeName && elem.nodeName.toLowerCase() === name.toLowerCase();
  270. },
  271. each: function( obj, callback ) {
  272. var length, i = 0;
  273. if ( isArrayLike( obj ) ) {
  274. length = obj.length;
  275. for ( ; i < length; i++ ) {
  276. if ( callback.call( obj[ i ], i, obj[ i ] ) === false ) {
  277. break;
  278. }
  279. }
  280. } else {
  281. for ( i in obj ) {
  282. if ( callback.call( obj[ i ], i, obj[ i ] ) === false ) {
  283. break;
  284. }
  285. }
  286. }
  287. return obj;
  288. },
  289. // Support: Android<4.1
  290. trim: function( text ) {
  291. return text == null ?
  292. "" :
  293. ( text + "" ).replace( rtrim, "" );
  294. },
  295. // results is for internal usage only
  296. makeArray: function( arr, results ) {
  297. var ret = results || [];
  298. if ( arr != null ) {
  299. if ( isArrayLike( Object( arr ) ) ) {
  300. jQuery.merge( ret,
  301. typeof arr === "string" ?
  302. [ arr ] : arr
  303. );
  304. } else {
  305. push.call( ret, arr );
  306. }
  307. }
  308. return ret;
  309. },
  310. inArray: function( elem, arr, i ) {
  311. return arr == null ? -1 : indexOf.call( arr, elem, i );
  312. },
  313. merge: function( first, second ) {
  314. var len = +second.length,
  315. j = 0,
  316. i = first.length;
  317. for ( ; j < len; j++ ) {
  318. first[ i++ ] = second[ j ];
  319. }
  320. first.length = i;
  321. return first;
  322. },
  323. grep: function( elems, callback, invert ) {
  324. var callbackInverse,
  325. matches = [],
  326. i = 0,
  327. length = elems.length,
  328. callbackExpect = !invert;
  329. // Go through the array, only saving the items
  330. // that pass the validator function
  331. for ( ; i < length; i++ ) {
  332. callbackInverse = !callback( elems[ i ], i );
  333. if ( callbackInverse !== callbackExpect ) {
  334. matches.push( elems[ i ] );
  335. }
  336. }
  337. return matches;
  338. },
  339. // arg is for internal usage only
  340. map: function( elems, callback, arg ) {
  341. var length, value,
  342. i = 0,
  343. ret = [];
  344. // Go through the array, translating each of the items to their new values
  345. if ( isArrayLike( elems ) ) {
  346. length = elems.length;
  347. for ( ; i < length; i++ ) {
  348. value = callback( elems[ i ], i, arg );
  349. if ( value != null ) {
  350. ret.push( value );
  351. }
  352. }
  353. // Go through every key on the object,
  354. } else {
  355. for ( i in elems ) {
  356. value = callback( elems[ i ], i, arg );
  357. if ( value != null ) {
  358. ret.push( value );
  359. }
  360. }
  361. }
  362. // Flatten any nested arrays
  363. return concat.apply( [], ret );
  364. },
  365. // A global GUID counter for objects
  366. guid: 1,
  367. // Bind a function to a context, optionally partially applying any
  368. // arguments.
  369. proxy: function( fn, context ) {
  370. var tmp, args, proxy;
  371. if ( typeof context === "string" ) {
  372. tmp = fn[ context ];
  373. context = fn;
  374. fn = tmp;
  375. }
  376. // Quick check to determine if target is callable, in the spec
  377. // this throws a TypeError, but we will just return undefined.
  378. if ( !jQuery.isFunction( fn ) ) {
  379. return undefined;
  380. }
  381. // Simulated bind
  382. args = slice.call( arguments, 2 );
  383. proxy = function() {
  384. return fn.apply( context || this, args.concat( slice.call( arguments ) ) );
  385. };
  386. // Set the guid of unique handler to the same of original handler, so it can be removed
  387. proxy.guid = fn.guid = fn.guid || jQuery.guid++;
  388. return proxy;
  389. },
  390. now: Date.now,
  391. // jQuery.support is not used in Core but other projects attach their
  392. // properties to it so it needs to exist.
  393. support: support
  394. } );
  395. // JSHint would error on this code due to the Symbol not being defined in ES5.
  396. // Defining this global in .jshintrc would create a danger of using the global
  397. // unguarded in another place, it seems safer to just disable JSHint for these
  398. // three lines.
  399. /* jshint ignore: start */
  400. if ( typeof Symbol === "function" ) {
  401. jQuery.fn[ Symbol.iterator ] = arr[ Symbol.iterator ];
  402. }
  403. /* jshint ignore: end */
  404. // Populate the class2type map
  405. jQuery.each( "Boolean Number String Function Array Date RegExp Object Error Symbol".split( " " ),
  406. function( i, name ) {
  407. class2type[ "[object " + name + "]" ] = name.toLowerCase();
  408. } );
  409. function isArrayLike( obj ) {
  410. // Support: iOS 8.2 (not reproducible in simulator)
  411. // `in` check used to prevent JIT error (gh-2145)
  412. // hasOwn isn't used here due to false negatives
  413. // regarding Nodelist length in IE
  414. var length = !!obj && "length" in obj && obj.length,
  415. type = jQuery.type( obj );
  416. if ( type === "function" || jQuery.isWindow( obj ) ) {
  417. return false;
  418. }
  419. return type === "array" || length === 0 ||
  420. typeof length === "number" && length > 0 && ( length - 1 ) in obj;
  421. }
  422. var Sizzle =
  423. /*!
  424. * Sizzle CSS Selector Engine v2.2.1
  425. * http://sizzlejs.com/
  426. *
  427. * Copyright jQuery Foundation and other contributors
  428. * Released under the MIT license
  429. * http://jquery.org/license
  430. *
  431. * Date: 2015-10-17
  432. */
  433. (function( window ) {
  434. var i,
  435. support,
  436. Expr,
  437. getText,
  438. isXML,
  439. tokenize,
  440. compile,
  441. select,
  442. outermostContext,
  443. sortInput,
  444. hasDuplicate,
  445. // Local document vars
  446. setDocument,
  447. document,
  448. docElem,
  449. documentIsHTML,
  450. rbuggyQSA,
  451. rbuggyMatches,
  452. matches,
  453. contains,
  454. // Instance-specific data
  455. expando = "sizzle" + 1 * new Date(),
  456. preferredDoc = window.document,
  457. dirruns = 0,
  458. done = 0,
  459. classCache = createCache(),
  460. tokenCache = createCache(),
  461. compilerCache = createCache(),
  462. sortOrder = function( a, b ) {
  463. if ( a === b ) {
  464. hasDuplicate = true;
  465. }
  466. return 0;
  467. },
  468. // General-purpose constants
  469. MAX_NEGATIVE = 1 << 31,
  470. // Instance methods
  471. hasOwn = ({}).hasOwnProperty,
  472. arr = [],
  473. pop = arr.pop,
  474. push_native = arr.push,
  475. push = arr.push,
  476. slice = arr.slice,
  477. // Use a stripped-down indexOf as it's faster than native
  478. // http://jsperf.com/thor-indexof-vs-for/5
  479. indexOf = function( list, elem ) {
  480. var i = 0,
  481. len = list.length;
  482. for ( ; i < len; i++ ) {
  483. if ( list[i] === elem ) {
  484. return i;
  485. }
  486. }
  487. return -1;
  488. },
  489. booleans = "checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",
  490. // Regular expressions
  491. // http://www.w3.org/TR/css3-selectors/#whitespace
  492. whitespace = "[\\x20\\t\\r\\n\\f]",
  493. // http://www.w3.org/TR/CSS21/syndata.html#value-def-identifier
  494. identifier = "(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+",
  495. // Attribute selectors: http://www.w3.org/TR/selectors/#attribute-selectors
  496. attributes = "\\[" + whitespace + "*(" + identifier + ")(?:" + whitespace +
  497. // Operator (capture 2)
  498. "*([*^$|!~]?=)" + whitespace +
  499. // "Attribute values must be CSS identifiers [capture 5] or strings [capture 3 or capture 4]"
  500. "*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|(" + identifier + "))|)" + whitespace +
  501. "*\\]",
  502. pseudos = ":(" + identifier + ")(?:\\((" +
  503. // To reduce the number of selectors needing tokenize in the preFilter, prefer arguments:
  504. // 1. quoted (capture 3; capture 4 or capture 5)
  505. "('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|" +
  506. // 2. simple (capture 6)
  507. "((?:\\\\.|[^\\\\()[\\]]|" + attributes + ")*)|" +
  508. // 3. anything else (capture 2)
  509. ".*" +
  510. ")\\)|)",
  511. // Leading and non-escaped trailing whitespace, capturing some non-whitespace characters preceding the latter
  512. rwhitespace = new RegExp( whitespace + "+", "g" ),
  513. rtrim = new RegExp( "^" + whitespace + "+|((?:^|[^\\\\])(?:\\\\.)*)" + whitespace + "+$", "g" ),
  514. rcomma = new RegExp( "^" + whitespace + "*," + whitespace + "*" ),
  515. rcombinators = new RegExp( "^" + whitespace + "*([>+~]|" + whitespace + ")" + whitespace + "*" ),
  516. rattributeQuotes = new RegExp( "=" + whitespace + "*([^\\]'\"]*?)" + whitespace + "*\\]", "g" ),
  517. rpseudo = new RegExp( pseudos ),
  518. ridentifier = new RegExp( "^" + identifier + "$" ),
  519. matchExpr = {
  520. "ID": new RegExp( "^#(" + identifier + ")" ),
  521. "CLASS": new RegExp( "^\\.(" + identifier + ")" ),
  522. "TAG": new RegExp( "^(" + identifier + "|[*])" ),
  523. "ATTR": new RegExp( "^" + attributes ),
  524. "PSEUDO": new RegExp( "^" + pseudos ),
  525. "CHILD": new RegExp( "^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\(" + whitespace +
  526. "*(even|odd|(([+-]|)(\\d*)n|)" + whitespace + "*(?:([+-]|)" + whitespace +
  527. "*(\\d+)|))" + whitespace + "*\\)|)", "i" ),
  528. "bool": new RegExp( "^(?:" + booleans + ")$", "i" ),
  529. // For use in libraries implementing .is()
  530. // We use this for POS matching in `select`
  531. "needsContext": new RegExp( "^" + whitespace + "*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\(" +
  532. whitespace + "*((?:-\\d)?\\d*)" + whitespace + "*\\)|)(?=[^-]|$)", "i" )
  533. },
  534. rinputs = /^(?:input|select|textarea|button)$/i,
  535. rheader = /^h\d$/i,
  536. rnative = /^[^{]+\{\s*\[native \w/,
  537. // Easily-parseable/retrievable ID or TAG or CLASS selectors
  538. rquickExpr = /^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,
  539. rsibling = /[+~]/,
  540. rescape = /'|\\/g,
  541. // CSS escapes http://www.w3.org/TR/CSS21/syndata.html#escaped-characters
  542. runescape = new RegExp( "\\\\([\\da-f]{1,6}" + whitespace + "?|(" + whitespace + ")|.)", "ig" ),
  543. funescape = function( _, escaped, escapedWhitespace ) {
  544. var high = "0x" + escaped - 0x10000;
  545. // NaN means non-codepoint
  546. // Support: Firefox<24
  547. // Workaround erroneous numeric interpretation of +"0x"
  548. return high !== high || escapedWhitespace ?
  549. escaped :
  550. high < 0 ?
  551. // BMP codepoint
  552. String.fromCharCode( high + 0x10000 ) :
  553. // Supplemental Plane codepoint (surrogate pair)
  554. String.fromCharCode( high >> 10 | 0xD800, high & 0x3FF | 0xDC00 );
  555. },
  556. // Used for iframes
  557. // See setDocument()
  558. // Removing the function wrapper causes a "Permission Denied"
  559. // error in IE
  560. unloadHandler = function() {
  561. setDocument();
  562. };
  563. // Optimize for push.apply( _, NodeList )
  564. try {
  565. push.apply(
  566. (arr = slice.call( preferredDoc.childNodes )),
  567. preferredDoc.childNodes
  568. );
  569. // Support: Android<4.0
  570. // Detect silently failing push.apply
  571. arr[ preferredDoc.childNodes.length ].nodeType;
  572. } catch ( e ) {
  573. push = { apply: arr.length ?
  574. // Leverage slice if possible
  575. function( target, els ) {
  576. push_native.apply( target, slice.call(els) );
  577. } :
  578. // Support: IE<9
  579. // Otherwise append directly
  580. function( target, els ) {
  581. var j = target.length,
  582. i = 0;
  583. // Can't trust NodeList.length
  584. while ( (target[j++] = els[i++]) ) {}
  585. target.length = j - 1;
  586. }
  587. };
  588. }
  589. function Sizzle( selector, context, results, seed ) {
  590. var m, i, elem, nid, nidselect, match, groups, newSelector,
  591. newContext = context && context.ownerDocument,
  592. // nodeType defaults to 9, since context defaults to document
  593. nodeType = context ? context.nodeType : 9;
  594. results = results || [];
  595. // Return early from calls with invalid selector or context
  596. if ( typeof selector !== "string" || !selector ||
  597. nodeType !== 1 && nodeType !== 9 && nodeType !== 11 ) {
  598. return results;
  599. }
  600. // Try to shortcut find operations (as opposed to filters) in HTML documents
  601. if ( !seed ) {
  602. if ( ( context ? context.ownerDocument || context : preferredDoc ) !== document ) {
  603. setDocument( context );
  604. }
  605. context = context || document;
  606. if ( documentIsHTML ) {
  607. // If the selector is sufficiently simple, try using a "get*By*" DOM method
  608. // (excepting DocumentFragment context, where the methods don't exist)
  609. if ( nodeType !== 11 && (match = rquickExpr.exec( selector )) ) {
  610. // ID selector
  611. if ( (m = match[1]) ) {
  612. // Document context
  613. if ( nodeType === 9 ) {
  614. if ( (elem = context.getElementById( m )) ) {
  615. // Support: IE, Opera, Webkit
  616. // TODO: identify versions
  617. // getElementById can match elements by name instead of ID
  618. if ( elem.id === m ) {
  619. results.push( elem );
  620. return results;
  621. }
  622. } else {
  623. return results;
  624. }
  625. // Element context
  626. } else {
  627. // Support: IE, Opera, Webkit
  628. // TODO: identify versions
  629. // getElementById can match elements by name instead of ID
  630. if ( newContext && (elem = newContext.getElementById( m )) &&
  631. contains( context, elem ) &&
  632. elem.id === m ) {
  633. results.push( elem );
  634. return results;
  635. }
  636. }
  637. // Type selector
  638. } else if ( match[2] ) {
  639. push.apply( results, context.getElementsByTagName( selector ) );
  640. return results;
  641. // Class selector
  642. } else if ( (m = match[3]) && support.getElementsByClassName &&
  643. context.getElementsByClassName ) {
  644. push.apply( results, context.getElementsByClassName( m ) );
  645. return results;
  646. }
  647. }
  648. // Take advantage of querySelectorAll
  649. if ( support.qsa &&
  650. !compilerCache[ selector + " " ] &&
  651. (!rbuggyQSA || !rbuggyQSA.test( selector )) ) {
  652. if ( nodeType !== 1 ) {
  653. newContext = context;
  654. newSelector = selector;
  655. // qSA looks outside Element context, which is not what we want
  656. // Thanks to Andrew Dupont for this workaround technique
  657. // Support: IE <=8
  658. // Exclude object elements
  659. } else if ( context.nodeName.toLowerCase() !== "object" ) {
  660. // Capture the context ID, setting it first if necessary
  661. if ( (nid = context.getAttribute( "id" )) ) {
  662. nid = nid.replace( rescape, "\\$&" );
  663. } else {
  664. context.setAttribute( "id", (nid = expando) );
  665. }
  666. // Prefix every selector in the list
  667. groups = tokenize( selector );
  668. i = groups.length;
  669. nidselect = ridentifier.test( nid ) ? "#" + nid : "[id='" + nid + "']";
  670. while ( i-- ) {
  671. groups[i] = nidselect + " " + toSelector( groups[i] );
  672. }
  673. newSelector = groups.join( "," );
  674. // Expand context for sibling selectors
  675. newContext = rsibling.test( selector ) && testContext( context.parentNode ) ||
  676. context;
  677. }
  678. if ( newSelector ) {
  679. try {
  680. push.apply( results,
  681. newContext.querySelectorAll( newSelector )
  682. );
  683. return results;
  684. } catch ( qsaError ) {
  685. } finally {
  686. if ( nid === expando ) {
  687. context.removeAttribute( "id" );
  688. }
  689. }
  690. }
  691. }
  692. }
  693. }
  694. // All others
  695. return select( selector.replace( rtrim, "$1" ), context, results, seed );
  696. }
  697. /**
  698. * Create key-value caches of limited size
  699. * @returns {function(string, object)} Returns the Object data after storing it on itself with
  700. * property name the (space-suffixed) string and (if the cache is larger than Expr.cacheLength)
  701. * deleting the oldest entry
  702. */
  703. function createCache() {
  704. var keys = [];
  705. function cache( key, value ) {
  706. // Use (key + " ") to avoid collision with native prototype properties (see Issue #157)
  707. if ( keys.push( key + " " ) > Expr.cacheLength ) {
  708. // Only keep the most recent entries
  709. delete cache[ keys.shift() ];
  710. }
  711. return (cache[ key + " " ] = value);
  712. }
  713. return cache;
  714. }
  715. /**
  716. * Mark a function for special use by Sizzle
  717. * @param {Function} fn The function to mark
  718. */
  719. function markFunction( fn ) {
  720. fn[ expando ] = true;
  721. return fn;
  722. }
  723. /**
  724. * Support testing using an element
  725. * @param {Function} fn Passed the created div and expects a boolean result
  726. */
  727. function assert( fn ) {
  728. var div = document.createElement("div");
  729. try {
  730. return !!fn( div );
  731. } catch (e) {
  732. return false;
  733. } finally {
  734. // Remove from its parent by default
  735. if ( div.parentNode ) {
  736. div.parentNode.removeChild( div );
  737. }
  738. // release memory in IE
  739. div = null;
  740. }
  741. }
  742. /**
  743. * Adds the same handler for all of the specified attrs
  744. * @param {String} attrs Pipe-separated list of attributes
  745. * @param {Function} handler The method that will be applied
  746. */
  747. function addHandle( attrs, handler ) {
  748. var arr = attrs.split("|"),
  749. i = arr.length;
  750. while ( i-- ) {
  751. Expr.attrHandle[ arr[i] ] = handler;
  752. }
  753. }
  754. /**
  755. * Checks document order of two siblings
  756. * @param {Element} a
  757. * @param {Element} b
  758. * @returns {Number} Returns less than 0 if a precedes b, greater than 0 if a follows b
  759. */
  760. function siblingCheck( a, b ) {
  761. var cur = b && a,
  762. diff = cur && a.nodeType === 1 && b.nodeType === 1 &&
  763. ( ~b.sourceIndex || MAX_NEGATIVE ) -
  764. ( ~a.sourceIndex || MAX_NEGATIVE );
  765. // Use IE sourceIndex if available on both nodes
  766. if ( diff ) {
  767. return diff;
  768. }
  769. // Check if b follows a
  770. if ( cur ) {
  771. while ( (cur = cur.nextSibling) ) {
  772. if ( cur === b ) {
  773. return -1;
  774. }
  775. }
  776. }
  777. return a ? 1 : -1;
  778. }
  779. /**
  780. * Returns a function to use in pseudos for input types
  781. * @param {String} type
  782. */
  783. function createInputPseudo( type ) {
  784. return function( elem ) {
  785. var name = elem.nodeName.toLowerCase();
  786. return name === "input" && elem.type === type;
  787. };
  788. }
  789. /**
  790. * Returns a function to use in pseudos for buttons
  791. * @param {String} type
  792. */
  793. function createButtonPseudo( type ) {
  794. return function( elem ) {
  795. var name = elem.nodeName.toLowerCase();
  796. return (name === "input" || name === "button") && elem.type === type;
  797. };
  798. }
  799. /**
  800. * Returns a function to use in pseudos for positionals
  801. * @param {Function} fn
  802. */
  803. function createPositionalPseudo( fn ) {
  804. return markFunction(function( argument ) {
  805. argument = +argument;
  806. return markFunction(function( seed, matches ) {
  807. var j,
  808. matchIndexes = fn( [], seed.length, argument ),
  809. i = matchIndexes.length;
  810. // Match elements found at the specified indexes
  811. while ( i-- ) {
  812. if ( seed[ (j = matchIndexes[i]) ] ) {
  813. seed[j] = !(matches[j] = seed[j]);
  814. }
  815. }
  816. });
  817. });
  818. }
  819. /**
  820. * Checks a node for validity as a Sizzle context
  821. * @param {Element|Object=} context
  822. * @returns {Element|Object|Boolean} The input node if acceptable, otherwise a falsy value
  823. */
  824. function testContext( context ) {
  825. return context && typeof context.getElementsByTagName !== "undefined" && context;
  826. }
  827. // Expose support vars for convenience
  828. support = Sizzle.support = {};
  829. /**
  830. * Detects XML nodes
  831. * @param {Element|Object} elem An element or a document
  832. * @returns {Boolean} True iff elem is a non-HTML XML node
  833. */
  834. isXML = Sizzle.isXML = function( elem ) {
  835. // documentElement is verified for cases where it doesn't yet exist
  836. // (such as loading iframes in IE - #4833)
  837. var documentElement = elem && (elem.ownerDocument || elem).documentElement;
  838. return documentElement ? documentElement.nodeName !== "HTML" : false;
  839. };
  840. /**
  841. * Sets document-related variables once based on the current document
  842. * @param {Element|Object} [doc] An element or document object to use to set the document
  843. * @returns {Object} Returns the current document
  844. */
  845. setDocument = Sizzle.setDocument = function( node ) {
  846. var hasCompare, parent,
  847. doc = node ? node.ownerDocument || node : preferredDoc;
  848. // Return early if doc is invalid or already selected
  849. if ( doc === document || doc.nodeType !== 9 || !doc.documentElement ) {
  850. return document;
  851. }
  852. // Update global variables
  853. document = doc;
  854. docElem = document.documentElement;
  855. documentIsHTML = !isXML( document );
  856. // Support: IE 9-11, Edge
  857. // Accessing iframe documents after unload throws "permission denied" errors (jQuery #13936)
  858. if ( (parent = document.defaultView) && parent.top !== parent ) {
  859. // Support: IE 11
  860. if ( parent.addEventListener ) {
  861. parent.addEventListener( "unload", unloadHandler, false );
  862. // Support: IE 9 - 10 only
  863. } else if ( parent.attachEvent ) {
  864. parent.attachEvent( "onunload", unloadHandler );
  865. }
  866. }
  867. /* Attributes
  868. ---------------------------------------------------------------------- */
  869. // Support: IE<8
  870. // Verify that getAttribute really returns attributes and not properties
  871. // (excepting IE8 booleans)
  872. support.attributes = assert(function( div ) {
  873. div.className = "i";
  874. return !div.getAttribute("className");
  875. });
  876. /* getElement(s)By*
  877. ---------------------------------------------------------------------- */
  878. // Check if getElementsByTagName("*") returns only elements
  879. support.getElementsByTagName = assert(function( div ) {
  880. div.appendChild( document.createComment("") );
  881. return !div.getElementsByTagName("*").length;
  882. });
  883. // Support: IE<9
  884. support.getElementsByClassName = rnative.test( document.getElementsByClassName );
  885. // Support: IE<10
  886. // Check if getElementById returns elements by name
  887. // The broken getElementById methods don't pick up programatically-set names,
  888. // so use a roundabout getElementsByName test
  889. support.getById = assert(function( div ) {
  890. docElem.appendChild( div ).id = expando;
  891. return !document.getElementsByName || !document.getElementsByName( expando ).length;
  892. });
  893. // ID find and filter
  894. if ( support.getById ) {
  895. Expr.find["ID"] = function( id, context ) {
  896. if ( typeof context.getElementById !== "undefined" && documentIsHTML ) {
  897. var m = context.getElementById( id );
  898. return m ? [ m ] : [];
  899. }
  900. };
  901. Expr.filter["ID"] = function( id ) {
  902. var attrId = id.replace( runescape, funescape );
  903. return function( elem ) {
  904. return elem.getAttribute("id") === attrId;
  905. };
  906. };
  907. } else {
  908. // Support: IE6/7
  909. // getElementById is not reliable as a find shortcut
  910. delete Expr.find["ID"];
  911. Expr.filter["ID"] = function( id ) {
  912. var attrId = id.replace( runescape, funescape );
  913. return function( elem ) {
  914. var node = typeof elem.getAttributeNode !== "undefined" &&
  915. elem.getAttributeNode("id");
  916. return node && node.value === attrId;
  917. };
  918. };
  919. }
  920. // Tag
  921. Expr.find["TAG"] = support.getElementsByTagName ?
  922. function( tag, context ) {
  923. if ( typeof context.getElementsByTagName !== "undefined" ) {
  924. return context.getElementsByTagName( tag );
  925. // DocumentFragment nodes don't have gEBTN
  926. } else if ( support.qsa ) {
  927. return context.querySelectorAll( tag );
  928. }
  929. } :
  930. function( tag, context ) {
  931. var elem,
  932. tmp = [],
  933. i = 0,
  934. // By happy coincidence, a (broken) gEBTN appears on DocumentFragment nodes too
  935. results = context.getElementsByTagName( tag );
  936. // Filter out possible comments
  937. if ( tag === "*" ) {
  938. while ( (elem = results[i++]) ) {
  939. if ( elem.nodeType === 1 ) {
  940. tmp.push( elem );
  941. }
  942. }
  943. return tmp;
  944. }
  945. return results;
  946. };
  947. // Class
  948. Expr.find["CLASS"] = support.getElementsByClassName && function( className, context ) {
  949. if ( typeof context.getElementsByClassName !== "undefined" && documentIsHTML ) {
  950. return context.getElementsByClassName( className );
  951. }
  952. };
  953. /* QSA/matchesSelector
  954. ---------------------------------------------------------------------- */
  955. // QSA and matchesSelector support
  956. // matchesSelector(:active) reports false when true (IE9/Opera 11.5)
  957. rbuggyMatches = [];
  958. // qSa(:focus) reports false when true (Chrome 21)
  959. // We allow this because of a bug in IE8/9 that throws an error
  960. // whenever `document.activeElement` is accessed on an iframe
  961. // So, we allow :focus to pass through QSA all the time to avoid the IE error
  962. // See http://bugs.jquery.com/ticket/13378
  963. rbuggyQSA = [];
  964. if ( (support.qsa = rnative.test( document.querySelectorAll )) ) {
  965. // Build QSA regex
  966. // Regex strategy adopted from Diego Perini
  967. assert(function( div ) {
  968. // Select is set to empty string on purpose
  969. // This is to test IE's treatment of not explicitly
  970. // setting a boolean content attribute,
  971. // since its presence should be enough
  972. // http://bugs.jquery.com/ticket/12359
  973. docElem.appendChild( div ).innerHTML = "<a id='" + expando + "'></a>" +
  974. "<select id='" + expando + "-\r\\' msallowcapture=''>" +
  975. "<option selected=''></option></select>";
  976. // Support: IE8, Opera 11-12.16
  977. // Nothing should be selected when empty strings follow ^= or $= or *=
  978. // The test attribute must be unknown in Opera but "safe" for WinRT
  979. // http://msdn.microsoft.com/en-us/library/ie/hh465388.aspx#attribute_section
  980. if ( div.querySelectorAll("[msallowcapture^='']").length ) {
  981. rbuggyQSA.push( "[*^$]=" + whitespace + "*(?:''|\"\")" );
  982. }
  983. // Support: IE8
  984. // Boolean attributes and "value" are not treated correctly
  985. if ( !div.querySelectorAll("[selected]").length ) {
  986. rbuggyQSA.push( "\\[" + whitespace + "*(?:value|" + booleans + ")" );
  987. }
  988. // Support: Chrome<29, Android<4.4, Safari<7.0+, iOS<7.0+, PhantomJS<1.9.8+
  989. if ( !div.querySelectorAll( "[id~=" + expando + "-]" ).length ) {
  990. rbuggyQSA.push("~=");
  991. }
  992. // Webkit/Opera - :checked should return selected option elements
  993. // http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked
  994. // IE8 throws error here and will not see later tests
  995. if ( !div.querySelectorAll(":checked").length ) {
  996. rbuggyQSA.push(":checked");
  997. }
  998. // Support: Safari 8+, iOS 8+
  999. // https://bugs.webkit.org/show_bug.cgi?id=136851
  1000. // In-page `selector#id sibing-combinator selector` fails
  1001. if ( !div.querySelectorAll( "a#" + expando + "+*" ).length ) {
  1002. rbuggyQSA.push(".#.+[+~]");
  1003. }
  1004. });
  1005. assert(function( div ) {
  1006. // Support: Windows 8 Native Apps
  1007. // The type and name attributes are restricted during .innerHTML assignment
  1008. var input = document.createElement("input");
  1009. input.setAttribute( "type", "hidden" );
  1010. div.appendChild( input ).setAttribute( "name", "D" );
  1011. // Support: IE8
  1012. // Enforce case-sensitivity of name attribute
  1013. if ( div.querySelectorAll("[name=d]").length ) {
  1014. rbuggyQSA.push( "name" + whitespace + "*[*^$|!~]?=" );
  1015. }
  1016. // FF 3.5 - :enabled/:disabled and hidden elements (hidden elements are still enabled)
  1017. // IE8 throws error here and will not see later tests
  1018. if ( !div.querySelectorAll(":enabled").length ) {
  1019. rbuggyQSA.push( ":enabled", ":disabled" );
  1020. }
  1021. // Opera 10-11 does not throw on post-comma invalid pseudos
  1022. div.querySelectorAll("*,:x");
  1023. rbuggyQSA.push(",.*:");
  1024. });
  1025. }
  1026. if ( (support.matchesSelector = rnative.test( (matches = docElem.matches ||
  1027. docElem.webkitMatchesSelector ||
  1028. docElem.mozMatchesSelector ||
  1029. docElem.oMatchesSelector ||
  1030. docElem.msMatchesSelector) )) ) {
  1031. assert(function( div ) {
  1032. // Check to see if it's possible to do matchesSelector
  1033. // on a disconnected node (IE 9)
  1034. support.disconnectedMatch = matches.call( div, "div" );
  1035. // This should fail with an exception
  1036. // Gecko does not error, returns false instead
  1037. matches.call( div, "[s!='']:x" );
  1038. rbuggyMatches.push( "!=", pseudos );
  1039. });
  1040. }
  1041. rbuggyQSA = rbuggyQSA.length && new RegExp( rbuggyQSA.join("|") );
  1042. rbuggyMatches = rbuggyMatches.length && new RegExp( rbuggyMatches.join("|") );
  1043. /* Contains
  1044. ---------------------------------------------------------------------- */
  1045. hasCompare = rnative.test( docElem.compareDocumentPosition );
  1046. // Element contains another
  1047. // Purposefully self-exclusive
  1048. // As in, an element does not contain itself
  1049. contains = hasCompare || rnative.test( docElem.contains ) ?
  1050. function( a, b ) {
  1051. var adown = a.nodeType === 9 ? a.documentElement : a,
  1052. bup = b && b.parentNode;
  1053. return a === bup || !!( bup && bup.nodeType === 1 && (
  1054. adown.contains ?
  1055. adown.contains( bup ) :
  1056. a.compareDocumentPosition && a.compareDocumentPosition( bup ) & 16
  1057. ));
  1058. } :
  1059. function( a, b ) {
  1060. if ( b ) {
  1061. while ( (b = b.parentNode) ) {
  1062. if ( b === a ) {
  1063. return true;
  1064. }
  1065. }
  1066. }
  1067. return false;
  1068. };
  1069. /* Sorting
  1070. ---------------------------------------------------------------------- */
  1071. // Document order sorting
  1072. sortOrder = hasCompare ?
  1073. function( a, b ) {
  1074. // Flag for duplicate removal
  1075. if ( a === b ) {
  1076. hasDuplicate = true;
  1077. return 0;
  1078. }
  1079. // Sort on method existence if only one input has compareDocumentPosition
  1080. var compare = !a.compareDocumentPosition - !b.compareDocumentPosition;
  1081. if ( compare ) {
  1082. return compare;
  1083. }
  1084. // Calculate position if both inputs belong to the same document
  1085. compare = ( a.ownerDocument || a ) === ( b.ownerDocument || b ) ?
  1086. a.compareDocumentPosition( b ) :
  1087. // Otherwise we know they are disconnected
  1088. 1;
  1089. // Disconnected nodes
  1090. if ( compare & 1 ||
  1091. (!support.sortDetached && b.compareDocumentPosition( a ) === compare) ) {
  1092. // Choose the first element that is related to our preferred document
  1093. if ( a === document || a.ownerDocument === preferredDoc && contains(preferredDoc, a) ) {
  1094. return -1;
  1095. }
  1096. if ( b === document || b.ownerDocument === preferredDoc && contains(preferredDoc, b) ) {
  1097. return 1;
  1098. }
  1099. // Maintain original order
  1100. return sortInput ?
  1101. ( indexOf( sortInput, a ) - indexOf( sortInput, b ) ) :
  1102. 0;
  1103. }
  1104. return compare & 4 ? -1 : 1;
  1105. } :
  1106. function( a, b ) {
  1107. // Exit early if the nodes are identical
  1108. if ( a === b ) {
  1109. hasDuplicate = true;
  1110. return 0;
  1111. }
  1112. var cur,
  1113. i = 0,
  1114. aup = a.parentNode,
  1115. bup = b.parentNode,
  1116. ap = [ a ],
  1117. bp = [ b ];
  1118. // Parentless nodes are either documents or disconnected
  1119. if ( !aup || !bup ) {
  1120. return a === document ? -1 :
  1121. b === document ? 1 :
  1122. aup ? -1 :
  1123. bup ? 1 :
  1124. sortInput ?
  1125. ( indexOf( sortInput, a ) - indexOf( sortInput, b ) ) :
  1126. 0;
  1127. // If the nodes are siblings, we can do a quick check
  1128. } else if ( aup === bup ) {
  1129. return siblingCheck( a, b );
  1130. }
  1131. // Otherwise we need full lists of their ancestors for comparison
  1132. cur = a;
  1133. while ( (cur = cur.parentNode) ) {
  1134. ap.unshift( cur );
  1135. }
  1136. cur = b;
  1137. while ( (cur = cur.parentNode) ) {
  1138. bp.unshift( cur );
  1139. }
  1140. // Walk down the tree looking for a discrepancy
  1141. while ( ap[i] === bp[i] ) {
  1142. i++;
  1143. }
  1144. return i ?
  1145. // Do a sibling check if the nodes have a common ancestor
  1146. siblingCheck( ap[i], bp[i] ) :
  1147. // Otherwise nodes in our document sort first
  1148. ap[i] === preferredDoc ? -1 :
  1149. bp[i] === preferredDoc ? 1 :
  1150. 0;
  1151. };
  1152. return document;
  1153. };
  1154. Sizzle.matches = function( expr, elements ) {
  1155. return Sizzle( expr, null, null, elements );
  1156. };
  1157. Sizzle.matchesSelector = function( elem, expr ) {
  1158. // Set document vars if needed
  1159. if ( ( elem.ownerDocument || elem ) !== document ) {
  1160. setDocument( elem );
  1161. }
  1162. // Make sure that attribute selectors are quoted
  1163. expr = expr.replace( rattributeQuotes, "='$1']" );
  1164. if ( support.matchesSelector && documentIsHTML &&
  1165. !compilerCache[ expr + " " ] &&
  1166. ( !rbuggyMatches || !rbuggyMatches.test( expr ) ) &&
  1167. ( !rbuggyQSA || !rbuggyQSA.test( expr ) ) ) {
  1168. try {
  1169. var ret = matches.call( elem, expr );
  1170. // IE 9's matchesSelector returns false on disconnected nodes
  1171. if ( ret || support.disconnectedMatch ||
  1172. // As well, disconnected nodes are said to be in a document
  1173. // fragment in IE 9
  1174. elem.document && elem.document.nodeType !== 11 ) {
  1175. return ret;
  1176. }
  1177. } catch (e) {}
  1178. }
  1179. return Sizzle( expr, document, null, [ elem ] ).length > 0;
  1180. };
  1181. Sizzle.contains = function( context, elem ) {
  1182. // Set document vars if needed
  1183. if ( ( context.ownerDocument || context ) !== document ) {
  1184. setDocument( context );
  1185. }
  1186. return contains( context, elem );
  1187. };
  1188. Sizzle.attr = function( elem, name ) {
  1189. // Set document vars if needed
  1190. if ( ( elem.ownerDocument || elem ) !== document ) {
  1191. setDocument( elem );
  1192. }
  1193. var fn = Expr.attrHandle[ name.toLowerCase() ],
  1194. // Don't get fooled by Object.prototype properties (jQuery #13807)
  1195. val = fn && hasOwn.call( Expr.attrHandle, name.toLowerCase() ) ?
  1196. fn( elem, name, !documentIsHTML ) :
  1197. undefined;
  1198. return val !== undefined ?
  1199. val :
  1200. support.attributes || !documentIsHTML ?
  1201. elem.getAttribute( name ) :
  1202. (val = elem.getAttributeNode(name)) && val.specified ?
  1203. val.value :
  1204. null;
  1205. };
  1206. Sizzle.error = function( msg ) {
  1207. throw new Error( "Syntax error, unrecognized expression: " + msg );
  1208. };
  1209. /**
  1210. * Document sorting and removing duplicates
  1211. * @param {ArrayLike} results
  1212. */
  1213. Sizzle.uniqueSort = function( results ) {
  1214. var elem,
  1215. duplicates = [],
  1216. j = 0,
  1217. i = 0;
  1218. // Unless we *know* we can detect duplicates, assume their presence
  1219. hasDuplicate = !support.detectDuplicates;
  1220. sortInput = !support.sortStable && results.slice( 0 );
  1221. results.sort( sortOrder );
  1222. if ( hasDuplicate ) {
  1223. while ( (elem = results[i++]) ) {
  1224. if ( elem === results[ i ] ) {
  1225. j = duplicates.push( i );
  1226. }
  1227. }
  1228. while ( j-- ) {
  1229. results.splice( duplicates[ j ], 1 );
  1230. }
  1231. }
  1232. // Clear input after sorting to release objects
  1233. // See https://github.com/jquery/sizzle/pull/225
  1234. sortInput = null;
  1235. return results;
  1236. };
  1237. /**
  1238. * Utility function for retrieving the text value of an array of DOM nodes
  1239. * @param {Array|Element} elem
  1240. */
  1241. getText = Sizzle.getText = function( elem ) {
  1242. var node,
  1243. ret = "",
  1244. i = 0,
  1245. nodeType = elem.nodeType;
  1246. if ( !nodeType ) {
  1247. // If no nodeType, this is expected to be an array
  1248. while ( (node = elem[i++]) ) {
  1249. // Do not traverse comment nodes
  1250. ret += getText( node );
  1251. }
  1252. } else if ( nodeType === 1 || nodeType === 9 || nodeType === 11 ) {
  1253. // Use textContent for elements
  1254. // innerText usage removed for consistency of new lines (jQuery #11153)
  1255. if ( typeof elem.textContent === "string" ) {
  1256. return elem.textContent;
  1257. } else {
  1258. // Traverse its children
  1259. for ( elem = elem.firstChild; elem; elem = elem.nextSibling ) {
  1260. ret += getText( elem );
  1261. }
  1262. }
  1263. } else if ( nodeType === 3 || nodeType === 4 ) {
  1264. return elem.nodeValue;
  1265. }
  1266. // Do not include comment or processing instruction nodes
  1267. return ret;
  1268. };
  1269. Expr = Sizzle.selectors = {
  1270. // Can be adjusted by the user
  1271. cacheLength: 50,
  1272. createPseudo: markFunction,
  1273. match: matchExpr,
  1274. attrHandle: {},
  1275. find: {},
  1276. relative: {
  1277. ">": { dir: "parentNode", first: true },
  1278. " ": { dir: "parentNode" },
  1279. "+": { dir: "previousSibling", first: true },
  1280. "~": { dir: "previousSibling" }
  1281. },
  1282. preFilter: {
  1283. "ATTR": function( match ) {
  1284. match[1] = match[1].replace( runescape, funescape );
  1285. // Move the given value to match[3] whether quoted or unquoted
  1286. match[3] = ( match[3] || match[4] || match[5] || "" ).replace( runescape, funescape );
  1287. if ( match[2] === "~=" ) {
  1288. match[3] = " " + match[3] + " ";
  1289. }
  1290. return match.slice( 0, 4 );
  1291. },
  1292. "CHILD": function( match ) {
  1293. /* matches from matchExpr["CHILD"]
  1294. 1 type (only|nth|...)
  1295. 2 what (child|of-type)
  1296. 3 argument (even|odd|\d*|\d*n([+-]\d+)?|...)
  1297. 4 xn-component of xn+y argument ([+-]?\d*n|)
  1298. 5 sign of xn-component
  1299. 6 x of xn-component
  1300. 7 sign of y-component
  1301. 8 y of y-component
  1302. */
  1303. match[1] = match[1].toLowerCase();
  1304. if ( match[1].slice( 0, 3 ) === "nth" ) {
  1305. // nth-* requires argument
  1306. if ( !match[3] ) {
  1307. Sizzle.error( match[0] );
  1308. }
  1309. // numeric x and y parameters for Expr.filter.CHILD
  1310. // remember that false/true cast respectively to 0/1
  1311. match[4] = +( match[4] ? match[5] + (match[6] || 1) : 2 * ( match[3] === "even" || match[3] === "odd" ) );
  1312. match[5] = +( ( match[7] + match[8] ) || match[3] === "odd" );
  1313. // other types prohibit arguments
  1314. } else if ( match[3] ) {
  1315. Sizzle.error( match[0] );
  1316. }
  1317. return match;
  1318. },
  1319. "PSEUDO": function( match ) {
  1320. var excess,
  1321. unquoted = !match[6] && match[2];
  1322. if ( matchExpr["CHILD"].test( match[0] ) ) {
  1323. return null;
  1324. }
  1325. // Accept quoted arguments as-is
  1326. if ( match[3] ) {
  1327. match[2] = match[4] || match[5] || "";
  1328. // Strip excess characters from unquoted arguments
  1329. } else if ( unquoted && rpseudo.test( unquoted ) &&
  1330. // Get excess from tokenize (recursively)
  1331. (excess = tokenize( unquoted, true )) &&
  1332. // advance to the next closing parenthesis
  1333. (excess = unquoted.indexOf( ")", unquoted.length - excess ) - unquoted.length) ) {
  1334. // excess is a negative index
  1335. match[0] = match[0].slice( 0, excess );
  1336. match[2] = unquoted.slice( 0, excess );
  1337. }
  1338. // Return only captures needed by the pseudo filter method (type and argument)
  1339. return match.slice( 0, 3 );
  1340. }
  1341. },
  1342. filter: {
  1343. "TAG": function( nodeNameSelector ) {
  1344. var nodeName = nodeNameSelector.replace( runescape, funescape ).toLowerCase();
  1345. return nodeNameSelector === "*" ?
  1346. function() { return true; } :
  1347. function( elem ) {
  1348. return elem.nodeName && elem.nodeName.toLowerCase() === nodeName;
  1349. };
  1350. },
  1351. "CLASS": function( className ) {
  1352. var pattern = classCache[ className + " " ];
  1353. return pattern ||
  1354. (pattern = new RegExp( "(^|" + whitespace + ")" + className + "(" + whitespace + "|$)" )) &&
  1355. classCache( className, function( elem ) {
  1356. return pattern.test( typeof elem.className === "string" && elem.className || typeof elem.getAttribute !== "undefined" && elem.getAttribute("class") || "" );
  1357. });
  1358. },
  1359. "ATTR": function( name, operator, check ) {
  1360. return function( elem ) {
  1361. var result = Sizzle.attr( elem, name );
  1362. if ( result == null ) {
  1363. return operator === "!=";
  1364. }
  1365. if ( !operator ) {
  1366. return true;
  1367. }
  1368. result += "";
  1369. return operator === "=" ? result === check :
  1370. operator === "!=" ? result !== check :
  1371. operator === "^=" ? check && result.indexOf( check ) === 0 :
  1372. operator === "*=" ? check && result.indexOf( check ) > -1 :
  1373. operator === "$=" ? check && result.slice( -check.length ) === check :
  1374. operator === "~=" ? ( " " + result.replace( rwhitespace, " " ) + " " ).indexOf( check ) > -1 :
  1375. operator === "|=" ? result === check || result.slice( 0, check.length + 1 ) === check + "-" :
  1376. false;
  1377. };
  1378. },
  1379. "CHILD": function( type, what, argument, first, last ) {
  1380. var simple = type.slice( 0, 3 ) !== "nth",
  1381. forward = type.slice( -4 ) !== "last",
  1382. ofType = what === "of-type";
  1383. return first === 1 && last === 0 ?
  1384. // Shortcut for :nth-*(n)
  1385. function( elem ) {
  1386. return !!elem.parentNode;
  1387. } :
  1388. function( elem, context, xml ) {
  1389. var cache, uniqueCache, outerCache, node, nodeIndex, start,
  1390. dir = simple !== forward ? "nextSibling" : "previousSibling",
  1391. parent = elem.parentNode,
  1392. name = ofType && elem.nodeName.toLowerCase(),
  1393. useCache = !xml && !ofType,
  1394. diff = false;
  1395. if ( parent ) {
  1396. // :(first|last|only)-(child|of-type)
  1397. if ( simple ) {
  1398. while ( dir ) {
  1399. node = elem;
  1400. while ( (node = node[ dir ]) ) {
  1401. if ( ofType ?
  1402. node.nodeName.toLowerCase() === name :
  1403. node.nodeType === 1 ) {
  1404. return false;
  1405. }
  1406. }
  1407. // Reverse direction for :only-* (if we haven't yet done so)
  1408. start = dir = type === "only" && !start && "nextSibling";
  1409. }
  1410. return true;
  1411. }
  1412. start = [ forward ? parent.firstChild : parent.lastChild ];
  1413. // non-xml :nth-child(...) stores cache data on `parent`
  1414. if ( forward && useCache ) {
  1415. // Seek `elem` from a previously-cached index
  1416. // ...in a gzip-friendly way
  1417. node = parent;
  1418. outerCache = node[ expando ] || (node[ expando ] = {});
  1419. // Support: IE <9 only
  1420. // Defend against cloned attroperties (jQuery gh-1709)
  1421. uniqueCache = outerCache[ node.uniqueID ] ||
  1422. (outerCache[ node.uniqueID ] = {});
  1423. cache = uniqueCache[ type ] || [];
  1424. nodeIndex = cache[ 0 ] === dirruns && cache[ 1 ];
  1425. diff = nodeIndex && cache[ 2 ];
  1426. node = nodeIndex && parent.childNodes[ nodeIndex ];
  1427. while ( (node = ++nodeIndex && node && node[ dir ] ||
  1428. // Fallback to seeking `elem` from the start
  1429. (diff = nodeIndex = 0) || start.pop()) ) {
  1430. // When found, cache indexes on `parent` and break
  1431. if ( node.nodeType === 1 && ++diff && node === elem ) {
  1432. uniqueCache[ type ] = [ dirruns, nodeIndex, diff ];
  1433. break;
  1434. }
  1435. }
  1436. } else {
  1437. // Use previously-cached element index if available
  1438. if ( useCache ) {
  1439. // ...in a gzip-friendly way
  1440. node = elem;
  1441. outerCache = node[ expando ] || (node[ expando ] = {});
  1442. // Support: IE <9 only
  1443. // Defend against cloned attroperties (jQuery gh-1709)
  1444. uniqueCache = outerCache[ node.uniqueID ] ||
  1445. (outerCache[ node.uniqueID ] = {});
  1446. cache = uniqueCache[ type ] || [];
  1447. nodeIndex = cache[ 0 ] === dirruns && cache[ 1 ];
  1448. diff = nodeIndex;
  1449. }
  1450. // xml :nth-child(...)
  1451. // or :nth-last-child(...) or :nth(-last)?-of-type(...)
  1452. if ( diff === false ) {
  1453. // Use the same loop as above to seek `elem` from the start
  1454. while ( (node = ++nodeIndex && node && node[ dir ] ||
  1455. (diff = nodeIndex = 0) || start.pop()) ) {
  1456. if ( ( ofType ?
  1457. node.nodeName.toLowerCase() === name :
  1458. node.nodeType === 1 ) &&
  1459. ++diff ) {
  1460. // Cache the index of each encountered element
  1461. if ( useCache ) {
  1462. outerCache = node[ expando ] || (node[ expando ] = {});
  1463. // Support: IE <9 only
  1464. // Defend against cloned attroperties (jQuery gh-1709)
  1465. uniqueCache = outerCache[ node.uniqueID ] ||
  1466. (outerCache[ node.uniqueID ] = {});
  1467. uniqueCache[ type ] = [ dirruns, diff ];
  1468. }
  1469. if ( node === elem ) {
  1470. break;
  1471. }
  1472. }
  1473. }
  1474. }
  1475. }
  1476. // Incorporate the offset, then check against cycle size
  1477. diff -= last;
  1478. return diff === first || ( diff % first === 0 && diff / first >= 0 );
  1479. }
  1480. };
  1481. },
  1482. "PSEUDO": function( pseudo, argument ) {
  1483. // pseudo-class names are case-insensitive
  1484. // http://www.w3.org/TR/selectors/#pseudo-classes
  1485. // Prioritize by case sensitivity in case custom pseudos are added with uppercase letters
  1486. // Remember that setFilters inherits from pseudos
  1487. var args,
  1488. fn = Expr.pseudos[ pseudo ] || Expr.setFilters[ pseudo.toLowerCase() ] ||
  1489. Sizzle.error( "unsupported pseudo: " + pseudo );
  1490. // The user may use createPseudo to indicate that
  1491. // arguments are needed to create the filter function
  1492. // just as Sizzle does
  1493. if ( fn[ expando ] ) {
  1494. return fn( argument );
  1495. }
  1496. // But maintain support for old signatures
  1497. if ( fn.length > 1 ) {
  1498. args = [ pseudo, pseudo, "", argument ];
  1499. return Expr.setFilters.hasOwnProperty( pseudo.toLowerCase() ) ?
  1500. markFunction(function( seed, matches ) {
  1501. var idx,
  1502. matched = fn( seed, argument ),
  1503. i = matched.length;
  1504. while ( i-- ) {
  1505. idx = indexOf( seed, matched[i] );
  1506. seed[ idx ] = !( matches[ idx ] = matched[i] );
  1507. }
  1508. }) :
  1509. function( elem ) {
  1510. return fn( elem, 0, args );
  1511. };
  1512. }
  1513. return fn;
  1514. }
  1515. },
  1516. pseudos: {
  1517. // Potentially complex pseudos
  1518. "not": markFunction(function( selector ) {
  1519. // Trim the selector passed to compile
  1520. // to avoid treating leading and trailing
  1521. // spaces as combinators
  1522. var input = [],
  1523. results = [],
  1524. matcher = compile( selector.replace( rtrim, "$1" ) );
  1525. return matcher[ expando ] ?
  1526. markFunction(function( seed, matches, context, xml ) {
  1527. var elem,
  1528. unmatched = matcher( seed, null, xml, [] ),
  1529. i = seed.length;
  1530. // Match elements unmatched by `matcher`
  1531. while ( i-- ) {
  1532. if ( (elem = unmatched[i]) ) {
  1533. seed[i] = !(matches[i] = elem);
  1534. }
  1535. }
  1536. }) :
  1537. function( elem, context, xml ) {
  1538. input[0] = elem;
  1539. matcher( input, null, xml, results );
  1540. // Don't keep the element (issue #299)
  1541. input[0] = null;
  1542. return !results.pop();
  1543. };
  1544. }),
  1545. "has": markFunction(function( selector ) {
  1546. return function( elem ) {
  1547. return Sizzle( selector, elem ).length > 0;
  1548. };
  1549. }),
  1550. "contains": markFunction(function( text ) {
  1551. text = text.replace( runescape, funescape );
  1552. return function( elem ) {
  1553. return ( elem.textContent || elem.innerText || getText( elem ) ).indexOf( text ) > -1;
  1554. };
  1555. }),
  1556. // "Whether an element is represented by a :lang() selector
  1557. // is based solely on the element's language value
  1558. // being equal to the identifier C,
  1559. // or beginning with the identifier C immediately followed by "-".
  1560. // The matching of C against the element's language value is performed case-insensitively.
  1561. // The identifier C does not have to be a valid language name."
  1562. // http://www.w3.org/TR/selectors/#lang-pseudo
  1563. "lang": markFunction( function( lang ) {
  1564. // lang value must be a valid identifier
  1565. if ( !ridentifier.test(lang || "") ) {
  1566. Sizzle.error( "unsupported lang: " + lang );
  1567. }
  1568. lang = lang.replace( runescape, funescape ).toLowerCase();
  1569. return function( elem ) {
  1570. var elemLang;
  1571. do {
  1572. if ( (elemLang = documentIsHTML ?
  1573. elem.lang :
  1574. elem.getAttribute("xml:lang") || elem.getAttribute("lang")) ) {
  1575. elemLang = elemLang.toLowerCase();
  1576. return elemLang === lang || elemLang.indexOf( lang + "-" ) === 0;
  1577. }
  1578. } while ( (elem = elem.parentNode) && elem.nodeType === 1 );
  1579. return false;
  1580. };
  1581. }),
  1582. // Miscellaneous
  1583. "target": function( elem ) {
  1584. var hash = window.location && window.location.hash;
  1585. return hash && hash.slice( 1 ) === elem.id;
  1586. },
  1587. "root": function( elem ) {
  1588. return elem === docElem;
  1589. },
  1590. "focus": function( elem ) {
  1591. return elem === document.activeElement && (!document.hasFocus || document.hasFocus()) && !!(elem.type || elem.href || ~elem.tabIndex);
  1592. },
  1593. // Boolean properties
  1594. "enabled": function( elem ) {
  1595. return elem.disabled === false;
  1596. },
  1597. "disabled": function( elem ) {
  1598. return elem.disabled === true;
  1599. },
  1600. "checked": function( elem ) {
  1601. // In CSS3, :checked should return both checked and selected elements
  1602. // http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked
  1603. var nodeName = elem.nodeName.toLowerCase();
  1604. return (nodeName === "input" && !!elem.checked) || (nodeName === "option" && !!elem.selected);
  1605. },
  1606. "selected": function( elem ) {
  1607. // Accessing this property makes selected-by-default
  1608. // options in Safari work properly
  1609. if ( elem.parentNode ) {
  1610. elem.parentNode.selectedIndex;
  1611. }
  1612. return elem.selected === true;
  1613. },
  1614. // Contents
  1615. "empty": function( elem ) {
  1616. // http://www.w3.org/TR/selectors/#empty-pseudo
  1617. // :empty is negated by element (1) or content nodes (text: 3; cdata: 4; entity ref: 5),
  1618. // but not by others (comment: 8; processing instruction: 7; etc.)
  1619. // nodeType < 6 works because attributes (2) do not appear as children
  1620. for ( elem = elem.firstChild; elem; elem = elem.nextSibling ) {
  1621. if ( elem.nodeType < 6 ) {
  1622. return false;
  1623. }
  1624. }
  1625. return true;
  1626. },
  1627. "parent": function( elem ) {
  1628. return !Expr.pseudos["empty"]( elem );
  1629. },
  1630. // Element/input types
  1631. "header": function( elem ) {
  1632. return rheader.test( elem.nodeName );
  1633. },
  1634. "input": function( elem ) {
  1635. return rinputs.test( elem.nodeName );
  1636. },
  1637. "button": function( elem ) {
  1638. var name = elem.nodeName.toLowerCase();
  1639. return name === "input" && elem.type === "button" || name === "button";
  1640. },
  1641. "text": function( elem ) {
  1642. var attr;
  1643. return elem.nodeName.toLowerCase() === "input" &&
  1644. elem.type === "text" &&
  1645. // Support: IE<8
  1646. // New HTML5 attribute values (e.g., "search") appear with elem.type === "text"
  1647. ( (attr = elem.getAttribute("type")) == null || attr.toLowerCase() === "text" );
  1648. },
  1649. // Position-in-collection
  1650. "first": createPositionalPseudo(function() {
  1651. return [ 0 ];
  1652. }),
  1653. "last": createPositionalPseudo(function( matchIndexes, length ) {
  1654. return [ length - 1 ];
  1655. }),
  1656. "eq": createPositionalPseudo(function( matchIndexes, length, argument ) {
  1657. return [ argument < 0 ? argument + length : argument ];
  1658. }),
  1659. "even": createPositionalPseudo(function( matchIndexes, length ) {
  1660. var i = 0;
  1661. for ( ; i < length; i += 2 ) {
  1662. matchIndexes.push( i );
  1663. }
  1664. return matchIndexes;
  1665. }),
  1666. "odd": createPositionalPseudo(function( matchIndexes, length ) {
  1667. var i = 1;
  1668. for ( ; i < length; i += 2 ) {
  1669. matchIndexes.push( i );
  1670. }
  1671. return matchIndexes;
  1672. }),
  1673. "lt": createPositionalPseudo(function( matchIndexes, length, argument ) {
  1674. var i = argument < 0 ? argument + length : argument;
  1675. for ( ; --i >= 0; ) {
  1676. matchIndexes.push( i );
  1677. }
  1678. return matchIndexes;
  1679. }),
  1680. "gt": createPositionalPseudo(function( matchIndexes, length, argument ) {
  1681. var i = argument < 0 ? argument + length : argument;
  1682. for ( ; ++i < length; ) {
  1683. matchIndexes.push( i );
  1684. }
  1685. return matchIndexes;
  1686. })
  1687. }
  1688. };
  1689. Expr.pseudos["nth"] = Expr.pseudos["eq"];
  1690. // Add button/input type pseudos
  1691. for ( i in { radio: true, checkbox: true, file: true, password: true, image: true } ) {
  1692. Expr.pseudos[ i ] = createInputPseudo( i );
  1693. }
  1694. for ( i in { submit: true, reset: true } ) {
  1695. Expr.pseudos[ i ] = createButtonPseudo( i );
  1696. }
  1697. // Easy API for creating new setFilters
  1698. function setFilters() {}
  1699. setFilters.prototype = Expr.filters = Expr.pseudos;
  1700. Expr.setFilters = new setFilters();
  1701. tokenize = Sizzle.tokenize = function( selector, parseOnly ) {
  1702. var matched, match, tokens, type,
  1703. soFar, groups, preFilters,
  1704. cached = tokenCache[ selector + " " ];
  1705. if ( cached ) {
  1706. return parseOnly ? 0 : cached.slice( 0 );
  1707. }
  1708. soFar = selector;
  1709. groups = [];
  1710. preFilters = Expr.preFilter;
  1711. while ( soFar ) {
  1712. // Comma and first run
  1713. if ( !matched || (match = rcomma.exec( soFar )) ) {
  1714. if ( match ) {
  1715. // Don't consume trailing commas as valid
  1716. soFar = soFar.slice( match[0].length ) || soFar;
  1717. }
  1718. groups.push( (tokens = []) );
  1719. }
  1720. matched = false;
  1721. // Combinators
  1722. if ( (match = rcombinators.exec( soFar )) ) {
  1723. matched = match.shift();
  1724. tokens.push({
  1725. value: matched,
  1726. // Cast descendant combinators to space
  1727. type: match[0].replace( rtrim, " " )
  1728. });
  1729. soFar = soFar.slice( matched.length );
  1730. }
  1731. // Filters
  1732. for ( type in Expr.filter ) {
  1733. if ( (match = matchExpr[ type ].exec( soFar )) && (!preFilters[ type ] ||
  1734. (match = preFilters[ type ]( match ))) ) {
  1735. matched = match.shift();
  1736. tokens.push({
  1737. value: matched,
  1738. type: type,
  1739. matches: match
  1740. });
  1741. soFar = soFar.slice( matched.length );
  1742. }
  1743. }
  1744. if ( !matched ) {
  1745. break;
  1746. }
  1747. }
  1748. // Return the length of the invalid excess
  1749. // if we're just parsing
  1750. // Otherwise, throw an error or return tokens
  1751. return parseOnly ?
  1752. soFar.length :
  1753. soFar ?
  1754. Sizzle.error( selector ) :
  1755. // Cache the tokens
  1756. tokenCache( selector, groups ).slice( 0 );
  1757. };
  1758. function toSelector( tokens ) {
  1759. var i = 0,
  1760. len = tokens.length,
  1761. selector = "";
  1762. for ( ; i < len; i++ ) {
  1763. selector += tokens[i].value;
  1764. }
  1765. return selector;
  1766. }
  1767. function addCombinator( matcher, combinator, base ) {
  1768. var dir = combinator.dir,
  1769. checkNonElements = base && dir === "parentNode",
  1770. doneName = done++;
  1771. return combinator.first ?
  1772. // Check against closest ancestor/preceding element
  1773. function( elem, context, xml ) {
  1774. while ( (elem = elem[ dir ]) ) {
  1775. if ( elem.nodeType === 1 || checkNonElements ) {
  1776. return matcher( elem, context, xml );
  1777. }
  1778. }
  1779. } :
  1780. // Check against all ancestor/preceding elements
  1781. function( elem, context, xml ) {
  1782. var oldCache, uniqueCache, outerCache,
  1783. newCache = [ dirruns, doneName ];
  1784. // We can't set arbitrary data on XML nodes, so they don't benefit from combinator caching
  1785. if ( xml ) {
  1786. while ( (elem = elem[ dir ]) ) {
  1787. if ( elem.nodeType === 1 || checkNonElements ) {
  1788. if ( matcher( elem, context, xml ) ) {
  1789. return true;
  1790. }
  1791. }
  1792. }
  1793. } else {
  1794. while ( (elem = elem[ dir ]) ) {
  1795. if ( elem.nodeType === 1 || checkNonElements ) {
  1796. outerCache = elem[ expando ] || (elem[ expando ] = {});
  1797. // Support: IE <9 only
  1798. // Defend against cloned attroperties (jQuery gh-1709)
  1799. uniqueCache = outerCache[ elem.uniqueID ] || (outerCache[ elem.uniqueID ] = {});
  1800. if ( (oldCache = uniqueCache[ dir ]) &&
  1801. oldCache[ 0 ] === dirruns && oldCache[ 1 ] === doneName ) {
  1802. // Assign to newCache so results back-propagate to previous elements
  1803. return (newCache[ 2 ] = oldCache[ 2 ]);
  1804. } else {
  1805. // Reuse newcache so results back-propagate to previous elements
  1806. uniqueCache[ dir ] = newCache;
  1807. // A match means we're done; a fail means we have to keep checking
  1808. if ( (newCache[ 2 ] = matcher( elem, context, xml )) ) {
  1809. return true;
  1810. }
  1811. }
  1812. }
  1813. }
  1814. }
  1815. };
  1816. }
  1817. function elementMatcher( matchers ) {
  1818. return matchers.length > 1 ?
  1819. function( elem, context, xml ) {
  1820. var i = matchers.length;
  1821. while ( i-- ) {
  1822. if ( !matchers[i]( elem, context, xml ) ) {
  1823. return false;
  1824. }
  1825. }
  1826. return true;
  1827. } :
  1828. matchers[0];
  1829. }
  1830. function multipleContexts( selector, contexts, results ) {
  1831. var i = 0,
  1832. len = contexts.length;
  1833. for ( ; i < len; i++ ) {
  1834. Sizzle( selector, contexts[i], results );
  1835. }
  1836. return results;
  1837. }
  1838. function condense( unmatched, map, filter, context, xml ) {
  1839. var elem,
  1840. newUnmatched = [],
  1841. i = 0,
  1842. len = unmatched.length,
  1843. mapped = map != null;
  1844. for ( ; i < len; i++ ) {
  1845. if ( (elem = unmatched[i]) ) {
  1846. if ( !filter || filter( elem, context, xml ) ) {
  1847. newUnmatched.push( elem );
  1848. if ( mapped ) {
  1849. map.push( i );
  1850. }
  1851. }
  1852. }
  1853. }
  1854. return newUnmatched;
  1855. }
  1856. function setMatcher( preFilter, selector, matcher, postFilter, postFinder, postSelector ) {
  1857. if ( postFilter && !postFilter[ expando ] ) {
  1858. postFilter = setMatcher( postFilter );
  1859. }
  1860. if ( postFinder && !postFinder[ expando ] ) {
  1861. postFinder = setMatcher( postFinder, postSelector );
  1862. }
  1863. return markFunction(function( seed, results, context, xml ) {
  1864. var temp, i, elem,
  1865. preMap = [],
  1866. postMap = [],
  1867. preexisting = results.length,
  1868. // Get initial elements from seed or context
  1869. elems = seed || multipleContexts( selector || "*", context.nodeType ? [ context ] : context, [] ),
  1870. // Prefilter to get matcher input, preserving a map for seed-results synchronization
  1871. matcherIn = preFilter && ( seed || !selector ) ?
  1872. condense( elems, preMap, preFilter, context, xml ) :
  1873. elems,
  1874. matcherOut = matcher ?
  1875. // If we have a postFinder, or filtered seed, or non-seed postFilter or preexisting results,
  1876. postFinder || ( seed ? preFilter : preexisting || postFilter ) ?
  1877. // ...intermediate processing is necessary
  1878. [] :
  1879. // ...otherwise use results directly
  1880. results :
  1881. matcherIn;
  1882. // Find primary matches
  1883. if ( matcher ) {
  1884. matcher( matcherIn, matcherOut, context, xml );
  1885. }
  1886. // Apply postFilter
  1887. if ( postFilter ) {
  1888. temp = condense( matcherOut, postMap );
  1889. postFilter( temp, [], context, xml );
  1890. // Un-match failing elements by moving them back to matcherIn
  1891. i = temp.length;
  1892. while ( i-- ) {
  1893. if ( (elem = temp[i]) ) {
  1894. matcherOut[ postMap[i] ] = !(matcherIn[ postMap[i] ] = elem);
  1895. }
  1896. }
  1897. }
  1898. if ( seed ) {
  1899. if ( postFinder || preFilter ) {
  1900. if ( postFinder ) {
  1901. // Get the final matcherOut by condensing this intermediate into postFinder contexts
  1902. temp = [];
  1903. i = matcherOut.length;
  1904. while ( i-- ) {
  1905. if ( (elem = matcherOut[i]) ) {
  1906. // Restore matcherIn since elem is not yet a final match
  1907. temp.push( (matcherIn[i] = elem) );
  1908. }
  1909. }
  1910. postFinder( null, (matcherOut = []), temp, xml );
  1911. }
  1912. // Move matched elements from seed to results to keep them synchronized
  1913. i = matcherOut.length;
  1914. while ( i-- ) {
  1915. if ( (elem = matcherOut[i]) &&
  1916. (temp = postFinder ? indexOf( seed, elem ) : preMap[i]) > -1 ) {
  1917. seed[temp] = !(results[temp] = elem);
  1918. }
  1919. }
  1920. }
  1921. // Add elements to results, through postFinder if defined
  1922. } else {
  1923. matcherOut = condense(
  1924. matcherOut === results ?
  1925. matcherOut.splice( preexisting, matcherOut.length ) :
  1926. matcherOut
  1927. );
  1928. if ( postFinder ) {
  1929. postFinder( null, results, matcherOut, xml );
  1930. } else {
  1931. push.apply( results, matcherOut );
  1932. }
  1933. }
  1934. });
  1935. }
  1936. function matcherFromTokens( tokens ) {
  1937. var checkContext, matcher, j,
  1938. len = tokens.length,
  1939. leadingRelative = Expr.relative[ tokens[0].type ],
  1940. implicitRelative = leadingRelative || Expr.relative[" "],
  1941. i = leadingRelative ? 1 : 0,
  1942. // The foundational matcher ensures that elements are reachable from top-level context(s)
  1943. matchContext = addCombinator( function( elem ) {
  1944. return elem === checkContext;
  1945. }, implicitRelative, true ),
  1946. matchAnyContext = addCombinator( function( elem ) {
  1947. return indexOf( checkContext, elem ) > -1;
  1948. }, implicitRelative, true ),
  1949. matchers = [ function( elem, context, xml ) {
  1950. var ret = ( !leadingRelative && ( xml || context !== outermostContext ) ) || (
  1951. (checkContext = context).nodeType ?
  1952. matchContext( elem, context, xml ) :
  1953. matchAnyContext( elem, context, xml ) );
  1954. // Avoid hanging onto element (issue #299)
  1955. checkContext = null;
  1956. return ret;
  1957. } ];
  1958. for ( ; i < len; i++ ) {
  1959. if ( (matcher = Expr.relative[ tokens[i].type ]) ) {
  1960. matchers = [ addCombinator(elementMatcher( matchers ), matcher) ];
  1961. } else {
  1962. matcher = Expr.filter[ tokens[i].type ].apply( null, tokens[i].matches );
  1963. // Return special upon seeing a positional matcher
  1964. if ( matcher[ expando ] ) {
  1965. // Find the next relative operator (if any) for proper handling
  1966. j = ++i;
  1967. for ( ; j < len; j++ ) {
  1968. if ( Expr.relative[ tokens[j].type ] ) {
  1969. break;
  1970. }
  1971. }
  1972. return setMatcher(
  1973. i > 1 && elementMatcher( matchers ),
  1974. i > 1 && toSelector(
  1975. // If the preceding token was a descendant combinator, insert an implicit any-element `*`
  1976. tokens.slice( 0, i - 1 ).concat({ value: tokens[ i - 2 ].type === " " ? "*" : "" })
  1977. ).replace( rtrim, "$1" ),
  1978. matcher,
  1979. i < j && matcherFromTokens( tokens.slice( i, j ) ),
  1980. j < len && matcherFromTokens( (tokens = tokens.slice( j )) ),
  1981. j < len && toSelector( tokens )
  1982. );
  1983. }
  1984. matchers.push( matcher );
  1985. }
  1986. }
  1987. return elementMatcher( matchers );
  1988. }
  1989. function matcherFromGroupMatchers( elementMatchers, setMatchers ) {
  1990. var bySet = setMatchers.length > 0,
  1991. byElement = elementMatchers.length > 0,
  1992. superMatcher = function( seed, context, xml, results, outermost ) {
  1993. var elem, j, matcher,
  1994. matchedCount = 0,
  1995. i = "0",
  1996. unmatched = seed && [],
  1997. setMatched = [],
  1998. contextBackup = outermostContext,
  1999. // We must always have either seed elements or outermost context
  2000. elems = seed || byElement && Expr.find["TAG"]( "*", outermost ),
  2001. // Use integer dirruns iff this is the outermost matcher
  2002. dirrunsUnique = (dirruns += contextBackup == null ? 1 : Math.random() || 0.1),
  2003. len = elems.length;
  2004. if ( outermost ) {
  2005. outermostContext = context === document || context || outermost;
  2006. }
  2007. // Add elements passing elementMatchers directly to results
  2008. // Support: IE<9, Safari
  2009. // Tolerate NodeList properties (IE: "length"; Safari: <number>) matching elements by id
  2010. for ( ; i !== len && (elem = elems[i]) != null; i++ ) {
  2011. if ( byElement && elem ) {
  2012. j = 0;
  2013. if ( !context && elem.ownerDocument !== document ) {
  2014. setDocument( elem );
  2015. xml = !documentIsHTML;
  2016. }
  2017. while ( (matcher = elementMatchers[j++]) ) {
  2018. if ( matcher( elem, context || document, xml) ) {
  2019. results.push( elem );
  2020. break;
  2021. }
  2022. }
  2023. if ( outermost ) {
  2024. dirruns = dirrunsUnique;
  2025. }
  2026. }
  2027. // Track unmatched elements for set filters
  2028. if ( bySet ) {
  2029. // They will have gone through all possible matchers
  2030. if ( (elem = !matcher && elem) ) {
  2031. matchedCount--;
  2032. }
  2033. // Lengthen the array for every element, matched or not
  2034. if ( seed ) {
  2035. unmatched.push( elem );
  2036. }
  2037. }
  2038. }
  2039. // `i` is now the count of elements visited above, and adding it to `matchedCount`
  2040. // makes the latter nonnegative.
  2041. matchedCount += i;
  2042. // Apply set filters to unmatched elements
  2043. // NOTE: This can be skipped if there are no unmatched elements (i.e., `matchedCount`
  2044. // equals `i`), unless we didn't visit _any_ elements in the above loop because we have
  2045. // no element matchers and no seed.
  2046. // Incrementing an initially-string "0" `i` allows `i` to remain a string only in that
  2047. // case, which will result in a "00" `matchedCount` that differs from `i` but is also
  2048. // numerically zero.
  2049. if ( bySet && i !== matchedCount ) {
  2050. j = 0;
  2051. while ( (matcher = setMatchers[j++]) ) {
  2052. matcher( unmatched, setMatched, context, xml );
  2053. }
  2054. if ( seed ) {
  2055. // Reintegrate element matches to eliminate the need for sorting
  2056. if ( matchedCount > 0 ) {
  2057. while ( i-- ) {
  2058. if ( !(unmatched[i] || setMatched[i]) ) {
  2059. setMatched[i] = pop.call( results );
  2060. }
  2061. }
  2062. }
  2063. // Discard index placeholder values to get only actual matches
  2064. setMatched = condense( setMatched );
  2065. }
  2066. // Add matches to results
  2067. push.apply( results, setMatched );
  2068. // Seedless set matches succeeding multiple successful matchers stipulate sorting
  2069. if ( outermost && !seed && setMatched.length > 0 &&
  2070. ( matchedCount + setMatchers.length ) > 1 ) {
  2071. Sizzle.uniqueSort( results );
  2072. }
  2073. }
  2074. // Override manipulation of globals by nested matchers
  2075. if ( outermost ) {
  2076. dirruns = dirrunsUnique;
  2077. outermostContext = contextBackup;
  2078. }
  2079. return unmatched;
  2080. };
  2081. return bySet ?
  2082. markFunction( superMatcher ) :
  2083. superMatcher;
  2084. }
  2085. compile = Sizzle.compile = function( selector, match /* Internal Use Only */ ) {
  2086. var i,
  2087. setMatchers = [],
  2088. elementMatchers = [],
  2089. cached = compilerCache[ selector + " " ];
  2090. if ( !cached ) {
  2091. // Generate a function of recursive functions that can be used to check each element
  2092. if ( !match ) {
  2093. match = tokenize( selector );
  2094. }
  2095. i = match.length;
  2096. while ( i-- ) {
  2097. cached = matcherFromTokens( match[i] );
  2098. if ( cached[ expando ] ) {
  2099. setMatchers.push( cached );
  2100. } else {
  2101. elementMatchers.push( cached );
  2102. }
  2103. }
  2104. // Cache the compiled function
  2105. cached = compilerCache( selector, matcherFromGroupMatchers( elementMatchers, setMatchers ) );
  2106. // Save selector and tokenization
  2107. cached.selector = selector;
  2108. }
  2109. return cached;
  2110. };
  2111. /**
  2112. * A low-level selection function that works with Sizzle's compiled
  2113. * selector functions
  2114. * @param {String|Function} selector A selector or a pre-compiled
  2115. * selector function built with Sizzle.compile
  2116. * @param {Element} context
  2117. * @param {Array} [results]
  2118. * @param {Array} [seed] A set of elements to match against
  2119. */
  2120. select = Sizzle.select = function( selector, context, results, seed ) {
  2121. var i, tokens, token, type, find,
  2122. compiled = typeof selector === "function" && selector,
  2123. match = !seed && tokenize( (selector = compiled.selector || selector) );
  2124. results = results || [];
  2125. // Try to minimize operations if there is only one selector in the list and no seed
  2126. // (the latter of which guarantees us context)
  2127. if ( match.length === 1 ) {
  2128. // Reduce context if the leading compound selector is an ID
  2129. tokens = match[0] = match[0].slice( 0 );
  2130. if ( tokens.length > 2 && (token = tokens[0]).type === "ID" &&
  2131. support.getById && context.nodeType === 9 && documentIsHTML &&
  2132. Expr.relative[ tokens[1].type ] ) {
  2133. context = ( Expr.find["ID"]( token.matches[0].replace(runescape, funescape), context ) || [] )[0];
  2134. if ( !context ) {
  2135. return results;
  2136. // Precompiled matchers will still verify ancestry, so step up a level
  2137. } else if ( compiled ) {
  2138. context = context.parentNode;
  2139. }
  2140. selector = selector.slice( tokens.shift().value.length );
  2141. }
  2142. // Fetch a seed set for right-to-left matching
  2143. i = matchExpr["needsContext"].test( selector ) ? 0 : tokens.length;
  2144. while ( i-- ) {
  2145. token = tokens[i];
  2146. // Abort if we hit a combinator
  2147. if ( Expr.relative[ (type = token.type) ] ) {
  2148. break;
  2149. }
  2150. if ( (find = Expr.find[ type ]) ) {
  2151. // Search, expanding context for leading sibling combinators
  2152. if ( (seed = find(
  2153. token.matches[0].replace( runescape, funescape ),
  2154. rsibling.test( tokens[0].type ) && testContext( context.parentNode ) || context
  2155. )) ) {
  2156. // If seed is empty or no tokens remain, we can return early
  2157. tokens.splice( i, 1 );
  2158. selector = seed.length && toSelector( tokens );
  2159. if ( !selector ) {
  2160. push.apply( results, seed );
  2161. return results;
  2162. }
  2163. break;
  2164. }
  2165. }
  2166. }
  2167. }
  2168. // Compile and execute a filtering function if one is not provided
  2169. // Provide `match` to avoid retokenization if we modified the selector above
  2170. ( compiled || compile( selector, match ) )(
  2171. seed,
  2172. context,
  2173. !documentIsHTML,
  2174. results,
  2175. !context || rsibling.test( selector ) && testContext( context.parentNode ) || context
  2176. );
  2177. return results;
  2178. };
  2179. // One-time assignments
  2180. // Sort stability
  2181. support.sortStable = expando.split("").sort( sortOrder ).join("") === expando;
  2182. // Support: Chrome 14-35+
  2183. // Always assume duplicates if they aren't passed to the comparison function
  2184. support.detectDuplicates = !!hasDuplicate;
  2185. // Initialize against the default document
  2186. setDocument();
  2187. // Support: Webkit<537.32 - Safari 6.0.3/Chrome 25 (fixed in Chrome 27)
  2188. // Detached nodes confoundingly follow *each other*
  2189. support.sortDetached = assert(function( div1 ) {
  2190. // Should return 1, but returns 4 (following)
  2191. return div1.compareDocumentPosition( document.createElement("div") ) & 1;
  2192. });
  2193. // Support: IE<8
  2194. // Prevent attribute/property "interpolation"
  2195. // http://msdn.microsoft.com/en-us/library/ms536429%28VS.85%29.aspx
  2196. if ( !assert(function( div ) {
  2197. div.innerHTML = "<a href='#'></a>";
  2198. return div.firstChild.getAttribute("href") === "#" ;
  2199. }) ) {
  2200. addHandle( "type|href|height|width", function( elem, name, isXML ) {
  2201. if ( !isXML ) {
  2202. return elem.getAttribute( name, name.toLowerCase() === "type" ? 1 : 2 );
  2203. }
  2204. });
  2205. }
  2206. // Support: IE<9
  2207. // Use defaultValue in place of getAttribute("value")
  2208. if ( !support.attributes || !assert(function( div ) {
  2209. div.innerHTML = "<input/>";
  2210. div.firstChild.setAttribute( "value", "" );
  2211. return div.firstChild.getAttribute( "value" ) === "";
  2212. }) ) {
  2213. addHandle( "value", function( elem, name, isXML ) {
  2214. if ( !isXML && elem.nodeName.toLowerCase() === "input" ) {
  2215. return elem.defaultValue;
  2216. }
  2217. });
  2218. }
  2219. // Support: IE<9
  2220. // Use getAttributeNode to fetch booleans when getAttribute lies
  2221. if ( !assert(function( div ) {
  2222. return div.getAttribute("disabled") == null;
  2223. }) ) {
  2224. addHandle( booleans, function( elem, name, isXML ) {
  2225. var val;
  2226. if ( !isXML ) {
  2227. return elem[ name ] === true ? name.toLowerCase() :
  2228. (val = elem.getAttributeNode( name )) && val.specified ?
  2229. val.value :
  2230. null;
  2231. }
  2232. });
  2233. }
  2234. return Sizzle;
  2235. })( window );
  2236. jQuery.find = Sizzle;
  2237. jQuery.expr = Sizzle.selectors;
  2238. jQuery.expr[ ":" ] = jQuery.expr.pseudos;
  2239. jQuery.uniqueSort = jQuery.unique = Sizzle.uniqueSort;
  2240. jQuery.text = Sizzle.getText;
  2241. jQuery.isXMLDoc = Sizzle.isXML;
  2242. jQuery.contains = Sizzle.contains;
  2243. var dir = function( elem, dir, until ) {
  2244. var matched = [],
  2245. truncate = until !== undefined;
  2246. while ( ( elem = elem[ dir ] ) && elem.nodeType !== 9 ) {
  2247. if ( elem.nodeType === 1 ) {
  2248. if ( truncate && jQuery( elem ).is( until ) ) {
  2249. break;
  2250. }
  2251. matched.push( elem );
  2252. }
  2253. }
  2254. return matched;
  2255. };
  2256. var siblings = function( n, elem ) {
  2257. var matched = [];
  2258. for ( ; n; n = n.nextSibling ) {
  2259. if ( n.nodeType === 1 && n !== elem ) {
  2260. matched.push( n );
  2261. }
  2262. }
  2263. return matched;
  2264. };
  2265. var rneedsContext = jQuery.expr.match.needsContext;
  2266. var rsingleTag = ( /^<([\w-]+)\s*\/?>(?:<\/\1>|)$/ );
  2267. var risSimple = /^.[^:#\[\.,]*$/;
  2268. // Implement the identical functionality for filter and not
  2269. function winnow( elements, qualifier, not ) {
  2270. if ( jQuery.isFunction( qualifier ) ) {
  2271. return jQuery.grep( elements, function( elem, i ) {
  2272. /* jshint -W018 */
  2273. return !!qualifier.call( elem, i, elem ) !== not;
  2274. } );
  2275. }
  2276. if ( qualifier.nodeType ) {
  2277. return jQuery.grep( elements, function( elem ) {
  2278. return ( elem === qualifier ) !== not;
  2279. } );
  2280. }
  2281. if ( typeof qualifier === "string" ) {
  2282. if ( risSimple.test( qualifier ) ) {
  2283. return jQuery.filter( qualifier, elements, not );
  2284. }
  2285. qualifier = jQuery.filter( qualifier, elements );
  2286. }
  2287. return jQuery.grep( elements, function( elem ) {
  2288. return ( indexOf.call( qualifier, elem ) > -1 ) !== not;
  2289. } );
  2290. }
  2291. jQuery.filter = function( expr, elems, not ) {
  2292. var elem = elems[ 0 ];
  2293. if ( not ) {
  2294. expr = ":not(" + expr + ")";
  2295. }
  2296. return elems.length === 1 && elem.nodeType === 1 ?
  2297. jQuery.find.matchesSelector( elem, expr ) ? [ elem ] : [] :
  2298. jQuery.find.matches( expr, jQuery.grep( elems, function( elem ) {
  2299. return elem.nodeType === 1;
  2300. } ) );
  2301. };
  2302. jQuery.fn.extend( {
  2303. find: function( selector ) {
  2304. var i,
  2305. len = this.length,
  2306. ret = [],
  2307. self = this;
  2308. if ( typeof selector !== "string" ) {
  2309. return this.pushStack( jQuery( selector ).filter( function() {
  2310. for ( i = 0; i < len; i++ ) {
  2311. if ( jQuery.contains( self[ i ], this ) ) {
  2312. return true;
  2313. }
  2314. }
  2315. } ) );
  2316. }
  2317. for ( i = 0; i < len; i++ ) {
  2318. jQuery.find( selector, self[ i ], ret );
  2319. }
  2320. // Needed because $( selector, context ) becomes $( context ).find( selector )
  2321. ret = this.pushStack( len > 1 ? jQuery.unique( ret ) : ret );
  2322. ret.selector = this.selector ? this.selector + " " + selector : selector;
  2323. return ret;
  2324. },
  2325. filter: function( selector ) {
  2326. return this.pushStack( winnow( this, selector || [], false ) );
  2327. },
  2328. not: function( selector ) {
  2329. return this.pushStack( winnow( this, selector || [], true ) );
  2330. },
  2331. is: function( selector ) {
  2332. return !!winnow(
  2333. this,
  2334. // If this is a positional/relative selector, check membership in the returned set
  2335. // so $("p:first").is("p:last") won't return true for a doc with two "p".
  2336. typeof selector === "string" && rneedsContext.test( selector ) ?
  2337. jQuery( selector ) :
  2338. selector || [],
  2339. false
  2340. ).length;
  2341. }
  2342. } );
  2343. // Initialize a jQuery object
  2344. // A central reference to the root jQuery(document)
  2345. var rootjQuery,
  2346. // A simple way to check for HTML strings
  2347. // Prioritize #id over <tag> to avoid XSS via location.hash (#9521)
  2348. // Strict HTML recognition (#11290: must start with <)
  2349. rquickExpr = /^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]*))$/,
  2350. init = jQuery.fn.init = function( selector, context, root ) {
  2351. var match, elem;
  2352. // HANDLE: $(""), $(null), $(undefined), $(false)
  2353. if ( !selector ) {
  2354. return this;
  2355. }
  2356. // Method init() accepts an alternate rootjQuery
  2357. // so migrate can support jQuery.sub (gh-2101)
  2358. root = root || rootjQuery;
  2359. // Handle HTML strings
  2360. if ( typeof selector === "string" ) {
  2361. if ( selector[ 0 ] === "<" &&
  2362. selector[ selector.length - 1 ] === ">" &&
  2363. selector.length >= 3 ) {
  2364. // Assume that strings that start and end with <> are HTML and skip the regex check
  2365. match = [ null, selector, null ];
  2366. } else {
  2367. match = rquickExpr.exec( selector );
  2368. }
  2369. // Match html or make sure no context is specified for #id
  2370. if ( match && ( match[ 1 ] || !context ) ) {
  2371. // HANDLE: $(html) -> $(array)
  2372. if ( match[ 1 ] ) {
  2373. context = context instanceof jQuery ? context[ 0 ] : context;
  2374. // Option to run scripts is true for back-compat
  2375. // Intentionally let the error be thrown if parseHTML is not present
  2376. jQuery.merge( this, jQuery.parseHTML(
  2377. match[ 1 ],
  2378. context && context.nodeType ? context.ownerDocument || context : document,
  2379. true
  2380. ) );
  2381. // HANDLE: $(html, props)
  2382. if ( rsingleTag.test( match[ 1 ] ) && jQuery.isPlainObject( context ) ) {
  2383. for ( match in context ) {
  2384. // Properties of context are called as methods if possible
  2385. if ( jQuery.isFunction( this[ match ] ) ) {
  2386. this[ match ]( context[ match ] );
  2387. // ...and otherwise set as attributes
  2388. } else {
  2389. this.attr( match, context[ match ] );
  2390. }
  2391. }
  2392. }
  2393. return this;
  2394. // HANDLE: $(#id)
  2395. } else {
  2396. elem = document.getElementById( match[ 2 ] );
  2397. // Support: Blackberry 4.6
  2398. // gEBID returns nodes no longer in the document (#6963)
  2399. if ( elem && elem.parentNode ) {
  2400. // Inject the element directly into the jQuery object
  2401. this.length = 1;
  2402. this[ 0 ] = elem;
  2403. }
  2404. this.context = document;
  2405. this.selector = selector;
  2406. return this;
  2407. }
  2408. // HANDLE: $(expr, $(...))
  2409. } else if ( !context || context.jquery ) {
  2410. return ( context || root ).find( selector );
  2411. // HANDLE: $(expr, context)
  2412. // (which is just equivalent to: $(context).find(expr)
  2413. } else {
  2414. return this.constructor( context ).find( selector );
  2415. }
  2416. // HANDLE: $(DOMElement)
  2417. } else if ( selector.nodeType ) {
  2418. this.context = this[ 0 ] = selector;
  2419. this.length = 1;
  2420. return this;
  2421. // HANDLE: $(function)
  2422. // Shortcut for document ready
  2423. } else if ( jQuery.isFunction( selector ) ) {
  2424. return root.ready !== undefined ?
  2425. root.ready( selector ) :
  2426. // Execute immediately if ready is not present
  2427. selector( jQuery );
  2428. }
  2429. if ( selector.selector !== undefined ) {
  2430. this.selector = selector.selector;
  2431. this.context = selector.context;
  2432. }
  2433. return jQuery.makeArray( selector, this );
  2434. };
  2435. // Give the init function the jQuery prototype for later instantiation
  2436. init.prototype = jQuery.fn;
  2437. // Initialize central reference
  2438. rootjQuery = jQuery( document );
  2439. var rparentsprev = /^(?:parents|prev(?:Until|All))/,
  2440. // Methods guaranteed to produce a unique set when starting from a unique set
  2441. guaranteedUnique = {
  2442. children: true,
  2443. contents: true,
  2444. next: true,
  2445. prev: true
  2446. };
  2447. jQuery.fn.extend( {
  2448. has: function( target ) {
  2449. var targets = jQuery( target, this ),
  2450. l = targets.length;
  2451. return this.filter( function() {
  2452. var i = 0;
  2453. for ( ; i < l; i++ ) {
  2454. if ( jQuery.contains( this, targets[ i ] ) ) {
  2455. return true;
  2456. }
  2457. }
  2458. } );
  2459. },
  2460. closest: function( selectors, context ) {
  2461. var cur,
  2462. i = 0,
  2463. l = this.length,
  2464. matched = [],
  2465. pos = rneedsContext.test( selectors ) || typeof selectors !== "string" ?
  2466. jQuery( selectors, context || this.context ) :
  2467. 0;
  2468. for ( ; i < l; i++ ) {
  2469. for ( cur = this[ i ]; cur && cur !== context; cur = cur.parentNode ) {
  2470. // Always skip document fragments
  2471. if ( cur.nodeType < 11 && ( pos ?
  2472. pos.index( cur ) > -1 :
  2473. // Don't pass non-elements to Sizzle
  2474. cur.nodeType === 1 &&
  2475. jQuery.find.matchesSelector( cur, selectors ) ) ) {
  2476. matched.push( cur );
  2477. break;
  2478. }
  2479. }
  2480. }
  2481. return this.pushStack( matched.length > 1 ? jQuery.uniqueSort( matched ) : matched );
  2482. },
  2483. // Determine the position of an element within the set
  2484. index: function( elem ) {
  2485. // No argument, return index in parent
  2486. if ( !elem ) {
  2487. return ( this[ 0 ] && this[ 0 ].parentNode ) ? this.first().prevAll().length : -1;
  2488. }
  2489. // Index in selector
  2490. if ( typeof elem === "string" ) {
  2491. return indexOf.call( jQuery( elem ), this[ 0 ] );
  2492. }
  2493. // Locate the position of the desired element
  2494. return indexOf.call( this,
  2495. // If it receives a jQuery object, the first element is used
  2496. elem.jquery ? elem[ 0 ] : elem
  2497. );
  2498. },
  2499. add: function( selector, context ) {
  2500. return this.pushStack(
  2501. jQuery.uniqueSort(
  2502. jQuery.merge( this.get(), jQuery( selector, context ) )
  2503. )
  2504. );
  2505. },
  2506. addBack: function( selector ) {
  2507. return this.add( selector == null ?
  2508. this.prevObject : this.prevObject.filter( selector )
  2509. );
  2510. }
  2511. } );
  2512. function sibling( cur, dir ) {
  2513. while ( ( cur = cur[ dir ] ) && cur.nodeType !== 1 ) {}
  2514. return cur;
  2515. }
  2516. jQuery.each( {
  2517. parent: function( elem ) {
  2518. var parent = elem.parentNode;
  2519. return parent && parent.nodeType !== 11 ? parent : null;
  2520. },
  2521. parents: function( elem ) {
  2522. return dir( elem, "parentNode" );
  2523. },
  2524. parentsUntil: function( elem, i, until ) {
  2525. return dir( elem, "parentNode", until );
  2526. },
  2527. next: function( elem ) {
  2528. return sibling( elem, "nextSibling" );
  2529. },
  2530. prev: function( elem ) {
  2531. return sibling( elem, "previousSibling" );
  2532. },
  2533. nextAll: function( elem ) {
  2534. return dir( elem, "nextSibling" );
  2535. },
  2536. prevAll: function( elem ) {
  2537. return dir( elem, "previousSibling" );
  2538. },
  2539. nextUntil: function( elem, i, until ) {
  2540. return dir( elem, "nextSibling", until );
  2541. },
  2542. prevUntil: function( elem, i, until ) {
  2543. return dir( elem, "previousSibling", until );
  2544. },
  2545. siblings: function( elem ) {
  2546. return siblings( ( elem.parentNode || {} ).firstChild, elem );
  2547. },
  2548. children: function( elem ) {
  2549. return siblings( elem.firstChild );
  2550. },
  2551. contents: function( elem ) {
  2552. return elem.contentDocument || jQuery.merge( [], elem.childNodes );
  2553. }
  2554. }, function( name, fn ) {
  2555. jQuery.fn[ name ] = function( until, selector ) {
  2556. var matched = jQuery.map( this, fn, until );
  2557. if ( name.slice( -5 ) !== "Until" ) {
  2558. selector = until;
  2559. }
  2560. if ( selector && typeof selector === "string" ) {
  2561. matched = jQuery.filter( selector, matched );
  2562. }
  2563. if ( this.length > 1 ) {
  2564. // Remove duplicates
  2565. if ( !guaranteedUnique[ name ] ) {
  2566. jQuery.uniqueSort( matched );
  2567. }
  2568. // Reverse order for parents* and prev-derivatives
  2569. if ( rparentsprev.test( name ) ) {
  2570. matched.reverse();
  2571. }
  2572. }
  2573. return this.pushStack( matched );
  2574. };
  2575. } );
  2576. var rnotwhite = ( /\S+/g );
  2577. // Convert String-formatted options into Object-formatted ones
  2578. function createOptions( options ) {
  2579. var object = {};
  2580. jQuery.each( options.match( rnotwhite ) || [], function( _, flag ) {
  2581. object[ flag ] = true;
  2582. } );
  2583. return object;
  2584. }
  2585. /*
  2586. * Create a callback list using the following parameters:
  2587. *
  2588. * options: an optional list of space-separated options that will change how
  2589. * the callback list behaves or a more traditional option object
  2590. *
  2591. * By default a callback list will act like an event callback list and can be
  2592. * "fired" multiple times.
  2593. *
  2594. * Possible options:
  2595. *
  2596. * once: will ensure the callback list can only be fired once (like a Deferred)
  2597. *
  2598. * memory: will keep track of previous values and will call any callback added
  2599. * after the list has been fired right away with the latest "memorized"
  2600. * values (like a Deferred)
  2601. *
  2602. * unique: will ensure a callback can only be added once (no duplicate in the list)
  2603. *
  2604. * stopOnFalse: interrupt callings when a callback returns false
  2605. *
  2606. */
  2607. jQuery.Callbacks = function( options ) {
  2608. // Convert options from String-formatted to Object-formatted if needed
  2609. // (we check in cache first)
  2610. options = typeof options === "string" ?
  2611. createOptions( options ) :
  2612. jQuery.extend( {}, options );
  2613. var // Flag to know if list is currently firing
  2614. firing,
  2615. // Last fire value for non-forgettable lists
  2616. memory,
  2617. // Flag to know if list was already fired
  2618. fired,
  2619. // Flag to prevent firing
  2620. locked,
  2621. // Actual callback list
  2622. list = [],
  2623. // Queue of execution data for repeatable lists
  2624. queue = [],
  2625. // Index of currently firing callback (modified by add/remove as needed)
  2626. firingIndex = -1,
  2627. // Fire callbacks
  2628. fire = function() {
  2629. // Enforce single-firing
  2630. locked = options.once;
  2631. // Execute callbacks for all pending executions,
  2632. // respecting firingIndex overrides and runtime changes
  2633. fired = firing = true;
  2634. for ( ; queue.length; firingIndex = -1 ) {
  2635. memory = queue.shift();
  2636. while ( ++firingIndex < list.length ) {
  2637. // Run callback and check for early termination
  2638. if ( list[ firingIndex ].apply( memory[ 0 ], memory[ 1 ] ) === false &&
  2639. options.stopOnFalse ) {
  2640. // Jump to end and forget the data so .add doesn't re-fire
  2641. firingIndex = list.length;
  2642. memory = false;
  2643. }
  2644. }
  2645. }
  2646. // Forget the data if we're done with it
  2647. if ( !options.memory ) {
  2648. memory = false;
  2649. }
  2650. firing = false;
  2651. // Clean up if we're done firing for good
  2652. if ( locked ) {
  2653. // Keep an empty list if we have data for future add calls
  2654. if ( memory ) {
  2655. list = [];
  2656. // Otherwise, this object is spent
  2657. } else {
  2658. list = "";
  2659. }
  2660. }
  2661. },
  2662. // Actual Callbacks object
  2663. self = {
  2664. // Add a callback or a collection of callbacks to the list
  2665. add: function() {
  2666. if ( list ) {
  2667. // If we have memory from a past run, we should fire after adding
  2668. if ( memory && !firing ) {
  2669. firingIndex = list.length - 1;
  2670. queue.push( memory );
  2671. }
  2672. ( function add( args ) {
  2673. jQuery.each( args, function( _, arg ) {
  2674. if ( jQuery.isFunction( arg ) ) {
  2675. if ( !options.unique || !self.has( arg ) ) {
  2676. list.push( arg );
  2677. }
  2678. } else if ( arg && arg.length && jQuery.type( arg ) !== "string" ) {
  2679. // Inspect recursively
  2680. add( arg );
  2681. }
  2682. } );
  2683. } )( arguments );
  2684. if ( memory && !firing ) {
  2685. fire();
  2686. }
  2687. }
  2688. return this;
  2689. },
  2690. // Remove a callback from the list
  2691. remove: function() {
  2692. jQuery.each( arguments, function( _, arg ) {
  2693. var index;
  2694. while ( ( index = jQuery.inArray( arg, list, index ) ) > -1 ) {
  2695. list.splice( index, 1 );
  2696. // Handle firing indexes
  2697. if ( index <= firingIndex ) {
  2698. firingIndex--;
  2699. }
  2700. }
  2701. } );
  2702. return this;
  2703. },
  2704. // Check if a given callback is in the list.
  2705. // If no argument is given, return whether or not list has callbacks attached.
  2706. has: function( fn ) {
  2707. return fn ?
  2708. jQuery.inArray( fn, list ) > -1 :
  2709. list.length > 0;
  2710. },
  2711. // Remove all callbacks from the list
  2712. empty: function() {
  2713. if ( list ) {
  2714. list = [];
  2715. }
  2716. return this;
  2717. },
  2718. // Disable .fire and .add
  2719. // Abort any current/pending executions
  2720. // Clear all callbacks and values
  2721. disable: function() {
  2722. locked = queue = [];
  2723. list = memory = "";
  2724. return this;
  2725. },
  2726. disabled: function() {
  2727. return !list;
  2728. },
  2729. // Disable .fire
  2730. // Also disable .add unless we have memory (since it would have no effect)
  2731. // Abort any pending executions
  2732. lock: function() {
  2733. locked = queue = [];
  2734. if ( !memory ) {
  2735. list = memory = "";
  2736. }
  2737. return this;
  2738. },
  2739. locked: function() {
  2740. return !!locked;
  2741. },
  2742. // Call all callbacks with the given context and arguments
  2743. fireWith: function( context, args ) {
  2744. if ( !locked ) {
  2745. args = args || [];
  2746. args = [ context, args.slice ? args.slice() : args ];
  2747. queue.push( args );
  2748. if ( !firing ) {
  2749. fire();
  2750. }
  2751. }
  2752. return this;
  2753. },
  2754. // Call all the callbacks with the given arguments
  2755. fire: function() {
  2756. self.fireWith( this, arguments );
  2757. return this;
  2758. },
  2759. // To know if the callbacks have already been called at least once
  2760. fired: function() {
  2761. return !!fired;
  2762. }
  2763. };
  2764. return self;
  2765. };
  2766. jQuery.extend( {
  2767. Deferred: function( func ) {
  2768. var tuples = [
  2769. // action, add listener, listener list, final state
  2770. [ "resolve", "done", jQuery.Callbacks( "once memory" ), "resolved" ],
  2771. [ "reject", "fail", jQuery.Callbacks( "once memory" ), "rejected" ],
  2772. [ "notify", "progress", jQuery.Callbacks( "memory" ) ]
  2773. ],
  2774. state = "pending",
  2775. promise = {
  2776. state: function() {
  2777. return state;
  2778. },
  2779. always: function() {
  2780. deferred.done( arguments ).fail( arguments );
  2781. return this;
  2782. },
  2783. then: function( /* fnDone, fnFail, fnProgress */ ) {
  2784. var fns = arguments;
  2785. return jQuery.Deferred( function( newDefer ) {
  2786. jQuery.each( tuples, function( i, tuple ) {
  2787. var fn = jQuery.isFunction( fns[ i ] ) && fns[ i ];
  2788. // deferred[ done | fail | progress ] for forwarding actions to newDefer
  2789. deferred[ tuple[ 1 ] ]( function() {
  2790. var returned = fn && fn.apply( this, arguments );
  2791. if ( returned && jQuery.isFunction( returned.promise ) ) {
  2792. returned.promise()
  2793. .progress( newDefer.notify )
  2794. .done( newDefer.resolve )
  2795. .fail( newDefer.reject );
  2796. } else {
  2797. newDefer[ tuple[ 0 ] + "With" ](
  2798. this === promise ? newDefer.promise() : this,
  2799. fn ? [ returned ] : arguments
  2800. );
  2801. }
  2802. } );
  2803. } );
  2804. fns = null;
  2805. } ).promise();
  2806. },
  2807. // Get a promise for this deferred
  2808. // If obj is provided, the promise aspect is added to the object
  2809. promise: function( obj ) {
  2810. return obj != null ? jQuery.extend( obj, promise ) : promise;
  2811. }
  2812. },
  2813. deferred = {};
  2814. // Keep pipe for back-compat
  2815. promise.pipe = promise.then;
  2816. // Add list-specific methods
  2817. jQuery.each( tuples, function( i, tuple ) {
  2818. var list = tuple[ 2 ],
  2819. stateString = tuple[ 3 ];
  2820. // promise[ done | fail | progress ] = list.add
  2821. promise[ tuple[ 1 ] ] = list.add;
  2822. // Handle state
  2823. if ( stateString ) {
  2824. list.add( function() {
  2825. // state = [ resolved | rejected ]
  2826. state = stateString;
  2827. // [ reject_list | resolve_list ].disable; progress_list.lock
  2828. }, tuples[ i ^ 1 ][ 2 ].disable, tuples[ 2 ][ 2 ].lock );
  2829. }
  2830. // deferred[ resolve | reject | notify ]
  2831. deferred[ tuple[ 0 ] ] = function() {
  2832. deferred[ tuple[ 0 ] + "With" ]( this === deferred ? promise : this, arguments );
  2833. return this;
  2834. };
  2835. deferred[ tuple[ 0 ] + "With" ] = list.fireWith;
  2836. } );
  2837. // Make the deferred a promise
  2838. promise.promise( deferred );
  2839. // Call given func if any
  2840. if ( func ) {
  2841. func.call( deferred, deferred );
  2842. }
  2843. // All done!
  2844. return deferred;
  2845. },
  2846. // Deferred helper
  2847. when: function( subordinate /* , ..., subordinateN */ ) {
  2848. var i = 0,
  2849. resolveValues = slice.call( arguments ),
  2850. length = resolveValues.length,
  2851. // the count of uncompleted subordinates
  2852. remaining = length !== 1 ||
  2853. ( subordinate && jQuery.isFunction( subordinate.promise ) ) ? length : 0,
  2854. // the master Deferred.
  2855. // If resolveValues consist of only a single Deferred, just use that.
  2856. deferred = remaining === 1 ? subordinate : jQuery.Deferred(),
  2857. // Update function for both resolve and progress values
  2858. updateFunc = function( i, contexts, values ) {
  2859. return function( value ) {
  2860. contexts[ i ] = this;
  2861. values[ i ] = arguments.length > 1 ? slice.call( arguments ) : value;
  2862. if ( values === progressValues ) {
  2863. deferred.notifyWith( contexts, values );
  2864. } else if ( !( --remaining ) ) {
  2865. deferred.resolveWith( contexts, values );
  2866. }
  2867. };
  2868. },
  2869. progressValues, progressContexts, resolveContexts;
  2870. // Add listeners to Deferred subordinates; treat others as resolved
  2871. if ( length > 1 ) {
  2872. progressValues = new Array( length );
  2873. progressContexts = new Array( length );
  2874. resolveContexts = new Array( length );
  2875. for ( ; i < length; i++ ) {
  2876. if ( resolveValues[ i ] && jQuery.isFunction( resolveValues[ i ].promise ) ) {
  2877. resolveValues[ i ].promise()
  2878. .progress( updateFunc( i, progressContexts, progressValues ) )
  2879. .done( updateFunc( i, resolveContexts, resolveValues ) )
  2880. .fail( deferred.reject );
  2881. } else {
  2882. --remaining;
  2883. }
  2884. }
  2885. }
  2886. // If we're not waiting on anything, resolve the master
  2887. if ( !remaining ) {
  2888. deferred.resolveWith( resolveContexts, resolveValues );
  2889. }
  2890. return deferred.promise();
  2891. }
  2892. } );
  2893. // The deferred used on DOM ready
  2894. var readyList;
  2895. jQuery.fn.ready = function( fn ) {
  2896. // Add the callback
  2897. jQuery.ready.promise().done( fn );
  2898. return this;
  2899. };
  2900. jQuery.extend( {
  2901. // Is the DOM ready to be used? Set to true once it occurs.
  2902. isReady: false,
  2903. // A counter to track how many items to wait for before
  2904. // the ready event fires. See #6781
  2905. readyWait: 1,
  2906. // Hold (or release) the ready event
  2907. holdReady: function( hold ) {
  2908. if ( hold ) {
  2909. jQuery.readyWait++;
  2910. } else {
  2911. jQuery.ready( true );
  2912. }
  2913. },
  2914. // Handle when the DOM is ready
  2915. ready: function( wait ) {
  2916. // Abort if there are pending holds or we're already ready
  2917. if ( wait === true ? --jQuery.readyWait : jQuery.isReady ) {
  2918. return;
  2919. }
  2920. // Remember that the DOM is ready
  2921. jQuery.isReady = true;
  2922. // If a normal DOM Ready event fired, decrement, and wait if need be
  2923. if ( wait !== true && --jQuery.readyWait > 0 ) {
  2924. return;
  2925. }
  2926. // If there are functions bound, to execute
  2927. readyList.resolveWith( document, [ jQuery ] );
  2928. // Trigger any bound ready events
  2929. if ( jQuery.fn.triggerHandler ) {
  2930. jQuery( document ).triggerHandler( "ready" );
  2931. jQuery( document ).off( "ready" );
  2932. }
  2933. }
  2934. } );
  2935. /**
  2936. * The ready event handler and self cleanup method
  2937. */
  2938. function completed() {
  2939. document.removeEventListener( "DOMContentLoaded", completed );
  2940. window.removeEventListener( "load", completed );
  2941. jQuery.ready();
  2942. }
  2943. jQuery.ready.promise = function( obj ) {
  2944. if ( !readyList ) {
  2945. readyList = jQuery.Deferred();
  2946. // Catch cases where $(document).ready() is called
  2947. // after the browser event has already occurred.
  2948. // Support: IE9-10 only
  2949. // Older IE sometimes signals "interactive" too soon
  2950. if ( document.readyState === "complete" ||
  2951. ( document.readyState !== "loading" && !document.documentElement.doScroll ) ) {
  2952. // Handle it asynchronously to allow scripts the opportunity to delay ready
  2953. window.setTimeout( jQuery.ready );
  2954. } else {
  2955. // Use the handy event callback
  2956. document.addEventListener( "DOMContentLoaded", completed );
  2957. // A fallback to window.onload, that will always work
  2958. window.addEventListener( "load", completed );
  2959. }
  2960. }
  2961. return readyList.promise( obj );
  2962. };
  2963. // Kick off the DOM ready check even if the user does not
  2964. jQuery.ready.promise();
  2965. // Multifunctional method to get and set values of a collection
  2966. // The value/s can optionally be executed if it's a function
  2967. var access = function( elems, fn, key, value, chainable, emptyGet, raw ) {
  2968. var i = 0,
  2969. len = elems.length,
  2970. bulk = key == null;
  2971. // Sets many values
  2972. if ( jQuery.type( key ) === "object" ) {
  2973. chainable = true;
  2974. for ( i in key ) {
  2975. access( elems, fn, i, key[ i ], true, emptyGet, raw );
  2976. }
  2977. // Sets one value
  2978. } else if ( value !== undefined ) {
  2979. chainable = true;
  2980. if ( !jQuery.isFunction( value ) ) {
  2981. raw = true;
  2982. }
  2983. if ( bulk ) {
  2984. // Bulk operations run against the entire set
  2985. if ( raw ) {
  2986. fn.call( elems, value );
  2987. fn = null;
  2988. // ...except when executing function values
  2989. } else {
  2990. bulk = fn;
  2991. fn = function( elem, key, value ) {
  2992. return bulk.call( jQuery( elem ), value );
  2993. };
  2994. }
  2995. }
  2996. if ( fn ) {
  2997. for ( ; i < len; i++ ) {
  2998. fn(
  2999. elems[ i ], key, raw ?
  3000. value :
  3001. value.call( elems[ i ], i, fn( elems[ i ], key ) )
  3002. );
  3003. }
  3004. }
  3005. }
  3006. return chainable ?
  3007. elems :
  3008. // Gets
  3009. bulk ?
  3010. fn.call( elems ) :
  3011. len ? fn( elems[ 0 ], key ) : emptyGet;
  3012. };
  3013. var acceptData = function( owner ) {
  3014. // Accepts only:
  3015. // - Node
  3016. // - Node.ELEMENT_NODE
  3017. // - Node.DOCUMENT_NODE
  3018. // - Object
  3019. // - Any
  3020. /* jshint -W018 */
  3021. return owner.nodeType === 1 || owner.nodeType === 9 || !( +owner.nodeType );
  3022. };
  3023. function Data() {
  3024. this.expando = jQuery.expando + Data.uid++;
  3025. }
  3026. Data.uid = 1;
  3027. Data.prototype = {
  3028. register: function( owner, initial ) {
  3029. var value = initial || {};
  3030. // If it is a node unlikely to be stringify-ed or looped over
  3031. // use plain assignment
  3032. if ( owner.nodeType ) {
  3033. owner[ this.expando ] = value;
  3034. // Otherwise secure it in a non-enumerable, non-writable property
  3035. // configurability must be true to allow the property to be
  3036. // deleted with the delete operator
  3037. } else {
  3038. Object.defineProperty( owner, this.expando, {
  3039. value: value,
  3040. writable: true,
  3041. configurable: true
  3042. } );
  3043. }
  3044. return owner[ this.expando ];
  3045. },
  3046. cache: function( owner ) {
  3047. // We can accept data for non-element nodes in modern browsers,
  3048. // but we should not, see #8335.
  3049. // Always return an empty object.
  3050. if ( !acceptData( owner ) ) {
  3051. return {};
  3052. }
  3053. // Check if the owner object already has a cache
  3054. var value = owner[ this.expando ];
  3055. // If not, create one
  3056. if ( !value ) {
  3057. value = {};
  3058. // We can accept data for non-element nodes in modern browsers,
  3059. // but we should not, see #8335.
  3060. // Always return an empty object.
  3061. if ( acceptData( owner ) ) {
  3062. // If it is a node unlikely to be stringify-ed or looped over
  3063. // use plain assignment
  3064. if ( owner.nodeType ) {
  3065. owner[ this.expando ] = value;
  3066. // Otherwise secure it in a non-enumerable property
  3067. // configurable must be true to allow the property to be
  3068. // deleted when data is removed
  3069. } else {
  3070. Object.defineProperty( owner, this.expando, {
  3071. value: value,
  3072. configurable: true
  3073. } );
  3074. }
  3075. }
  3076. }
  3077. return value;
  3078. },
  3079. set: function( owner, data, value ) {
  3080. var prop,
  3081. cache = this.cache( owner );
  3082. // Handle: [ owner, key, value ] args
  3083. if ( typeof data === "string" ) {
  3084. cache[ data ] = value;
  3085. // Handle: [ owner, { properties } ] args
  3086. } else {
  3087. // Copy the properties one-by-one to the cache object
  3088. for ( prop in data ) {
  3089. cache[ prop ] = data[ prop ];
  3090. }
  3091. }
  3092. return cache;
  3093. },
  3094. get: function( owner, key ) {
  3095. return key === undefined ?
  3096. this.cache( owner ) :
  3097. owner[ this.expando ] && owner[ this.expando ][ key ];
  3098. },
  3099. access: function( owner, key, value ) {
  3100. var stored;
  3101. // In cases where either:
  3102. //
  3103. // 1. No key was specified
  3104. // 2. A string key was specified, but no value provided
  3105. //
  3106. // Take the "read" path and allow the get method to determine
  3107. // which value to return, respectively either:
  3108. //
  3109. // 1. The entire cache object
  3110. // 2. The data stored at the key
  3111. //
  3112. if ( key === undefined ||
  3113. ( ( key && typeof key === "string" ) && value === undefined ) ) {
  3114. stored = this.get( owner, key );
  3115. return stored !== undefined ?
  3116. stored : this.get( owner, jQuery.camelCase( key ) );
  3117. }
  3118. // When the key is not a string, or both a key and value
  3119. // are specified, set or extend (existing objects) with either:
  3120. //
  3121. // 1. An object of properties
  3122. // 2. A key and value
  3123. //
  3124. this.set( owner, key, value );
  3125. // Since the "set" path can have two possible entry points
  3126. // return the expected data based on which path was taken[*]
  3127. return value !== undefined ? value : key;
  3128. },
  3129. remove: function( owner, key ) {
  3130. var i, name, camel,
  3131. cache = owner[ this.expando ];
  3132. if ( cache === undefined ) {
  3133. return;
  3134. }
  3135. if ( key === undefined ) {
  3136. this.register( owner );
  3137. } else {
  3138. // Support array or space separated string of keys
  3139. if ( jQuery.isArray( key ) ) {
  3140. // If "name" is an array of keys...
  3141. // When data is initially created, via ("key", "val") signature,
  3142. // keys will be converted to camelCase.
  3143. // Since there is no way to tell _how_ a key was added, remove
  3144. // both plain key and camelCase key. #12786
  3145. // This will only penalize the array argument path.
  3146. name = key.concat( key.map( jQuery.camelCase ) );
  3147. } else {
  3148. camel = jQuery.camelCase( key );
  3149. // Try the string as a key before any manipulation
  3150. if ( key in cache ) {
  3151. name = [ key, camel ];
  3152. } else {
  3153. // If a key with the spaces exists, use it.
  3154. // Otherwise, create an array by matching non-whitespace
  3155. name = camel;
  3156. name = name in cache ?
  3157. [ name ] : ( name.match( rnotwhite ) || [] );
  3158. }
  3159. }
  3160. i = name.length;
  3161. while ( i-- ) {
  3162. delete cache[ name[ i ] ];
  3163. }
  3164. }
  3165. // Remove the expando if there's no more data
  3166. if ( key === undefined || jQuery.isEmptyObject( cache ) ) {
  3167. // Support: Chrome <= 35-45+
  3168. // Webkit & Blink performance suffers when deleting properties
  3169. // from DOM nodes, so set to undefined instead
  3170. // https://code.google.com/p/chromium/issues/detail?id=378607
  3171. if ( owner.nodeType ) {
  3172. owner[ this.expando ] = undefined;
  3173. } else {
  3174. delete owner[ this.expando ];
  3175. }
  3176. }
  3177. },
  3178. hasData: function( owner ) {
  3179. var cache = owner[ this.expando ];
  3180. return cache !== undefined && !jQuery.isEmptyObject( cache );
  3181. }
  3182. };
  3183. var dataPriv = new Data();
  3184. var dataUser = new Data();
  3185. // Implementation Summary
  3186. //
  3187. // 1. Enforce API surface and semantic compatibility with 1.9.x branch
  3188. // 2. Improve the module's maintainability by reducing the storage
  3189. // paths to a single mechanism.
  3190. // 3. Use the same single mechanism to support "private" and "user" data.
  3191. // 4. _Never_ expose "private" data to user code (TODO: Drop _data, _removeData)
  3192. // 5. Avoid exposing implementation details on user objects (eg. expando properties)
  3193. // 6. Provide a clear path for implementation upgrade to WeakMap in 2014
  3194. var rbrace = /^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,
  3195. rmultiDash = /[A-Z]/g;
  3196. function dataAttr( elem, key, data ) {
  3197. var name;
  3198. // If nothing was found internally, try to fetch any
  3199. // data from the HTML5 data-* attribute
  3200. if ( data === undefined && elem.nodeType === 1 ) {
  3201. name = "data-" + key.replace( rmultiDash, "-$&" ).toLowerCase();
  3202. data = elem.getAttribute( name );
  3203. if ( typeof data === "string" ) {
  3204. try {
  3205. data = data === "true" ? true :
  3206. data === "false" ? false :
  3207. data === "null" ? null :
  3208. // Only convert to a number if it doesn't change the string
  3209. +data + "" === data ? +data :
  3210. rbrace.test( data ) ? jQuery.parseJSON( data ) :
  3211. data;
  3212. } catch ( e ) {}
  3213. // Make sure we set the data so it isn't changed later
  3214. dataUser.set( elem, key, data );
  3215. } else {
  3216. data = undefined;
  3217. }
  3218. }
  3219. return data;
  3220. }
  3221. jQuery.extend( {
  3222. hasData: function( elem ) {
  3223. return dataUser.hasData( elem ) || dataPriv.hasData( elem );
  3224. },
  3225. data: function( elem, name, data ) {
  3226. return dataUser.access( elem, name, data );
  3227. },
  3228. removeData: function( elem, name ) {
  3229. dataUser.remove( elem, name );
  3230. },
  3231. // TODO: Now that all calls to _data and _removeData have been replaced
  3232. // with direct calls to dataPriv methods, these can be deprecated.
  3233. _data: function( elem, name, data ) {
  3234. return dataPriv.access( elem, name, data );
  3235. },
  3236. _removeData: function( elem, name ) {
  3237. dataPriv.remove( elem, name );
  3238. }
  3239. } );
  3240. jQuery.fn.extend( {
  3241. data: function( key, value ) {
  3242. var i, name, data,
  3243. elem = this[ 0 ],
  3244. attrs = elem && elem.attributes;
  3245. // Gets all values
  3246. if ( key === undefined ) {
  3247. if ( this.length ) {
  3248. data = dataUser.get( elem );
  3249. if ( elem.nodeType === 1 && !dataPriv.get( elem, "hasDataAttrs" ) ) {
  3250. i = attrs.length;
  3251. while ( i-- ) {
  3252. // Support: IE11+
  3253. // The attrs elements can be null (#14894)
  3254. if ( attrs[ i ] ) {
  3255. name = attrs[ i ].name;
  3256. if ( name.indexOf( "data-" ) === 0 ) {
  3257. name = jQuery.camelCase( name.slice( 5 ) );
  3258. dataAttr( elem, name, data[ name ] );
  3259. }
  3260. }
  3261. }
  3262. dataPriv.set( elem, "hasDataAttrs", true );
  3263. }
  3264. }
  3265. return data;
  3266. }
  3267. // Sets multiple values
  3268. if ( typeof key === "object" ) {
  3269. return this.each( function() {
  3270. dataUser.set( this, key );
  3271. } );
  3272. }
  3273. return access( this, function( value ) {
  3274. var data, camelKey;
  3275. // The calling jQuery object (element matches) is not empty
  3276. // (and therefore has an element appears at this[ 0 ]) and the
  3277. // `value` parameter was not undefined. An empty jQuery object
  3278. // will result in `undefined` for elem = this[ 0 ] which will
  3279. // throw an exception if an attempt to read a data cache is made.
  3280. if ( elem && value === undefined ) {
  3281. // Attempt to get data from the cache
  3282. // with the key as-is
  3283. data = dataUser.get( elem, key ) ||
  3284. // Try to find dashed key if it exists (gh-2779)
  3285. // This is for 2.2.x only
  3286. dataUser.get( elem, key.replace( rmultiDash, "-$&" ).toLowerCase() );
  3287. if ( data !== undefined ) {
  3288. return data;
  3289. }
  3290. camelKey = jQuery.camelCase( key );
  3291. // Attempt to get data from the cache
  3292. // with the key camelized
  3293. data = dataUser.get( elem, camelKey );
  3294. if ( data !== undefined ) {
  3295. return data;
  3296. }
  3297. // Attempt to "discover" the data in
  3298. // HTML5 custom data-* attrs
  3299. data = dataAttr( elem, camelKey, undefined );
  3300. if ( data !== undefined ) {
  3301. return data;
  3302. }
  3303. // We tried really hard, but the data doesn't exist.
  3304. return;
  3305. }
  3306. // Set the data...
  3307. camelKey = jQuery.camelCase( key );
  3308. this.each( function() {
  3309. // First, attempt to store a copy or reference of any
  3310. // data that might've been store with a camelCased key.
  3311. var data = dataUser.get( this, camelKey );
  3312. // For HTML5 data-* attribute interop, we have to
  3313. // store property names with dashes in a camelCase form.
  3314. // This might not apply to all properties...*
  3315. dataUser.set( this, camelKey, value );
  3316. // *... In the case of properties that might _actually_
  3317. // have dashes, we need to also store a copy of that
  3318. // unchanged property.
  3319. if ( key.indexOf( "-" ) > -1 && data !== undefined ) {
  3320. dataUser.set( this, key, value );
  3321. }
  3322. } );
  3323. }, null, value, arguments.length > 1, null, true );
  3324. },
  3325. removeData: function( key ) {
  3326. return this.each( function() {
  3327. dataUser.remove( this, key );
  3328. } );
  3329. }
  3330. } );
  3331. jQuery.extend( {
  3332. queue: function( elem, type, data ) {
  3333. var queue;
  3334. if ( elem ) {
  3335. type = ( type || "fx" ) + "queue";
  3336. queue = dataPriv.get( elem, type );
  3337. // Speed up dequeue by getting out quickly if this is just a lookup
  3338. if ( data ) {
  3339. if ( !queue || jQuery.isArray( data ) ) {
  3340. queue = dataPriv.access( elem, type, jQuery.makeArray( data ) );
  3341. } else {
  3342. queue.push( data );
  3343. }
  3344. }
  3345. return queue || [];
  3346. }
  3347. },
  3348. dequeue: function( elem, type ) {
  3349. type = type || "fx";
  3350. var queue = jQuery.queue( elem, type ),
  3351. startLength = queue.length,
  3352. fn = queue.shift(),
  3353. hooks = jQuery._queueHooks( elem, type ),
  3354. next = function() {
  3355. jQuery.dequeue( elem, type );
  3356. };
  3357. // If the fx queue is dequeued, always remove the progress sentinel
  3358. if ( fn === "inprogress" ) {
  3359. fn = queue.shift();
  3360. startLength--;
  3361. }
  3362. if ( fn ) {
  3363. // Add a progress sentinel to prevent the fx queue from being
  3364. // automatically dequeued
  3365. if ( type === "fx" ) {
  3366. queue.unshift( "inprogress" );
  3367. }
  3368. // Clear up the last queue stop function
  3369. delete hooks.stop;
  3370. fn.call( elem, next, hooks );
  3371. }
  3372. if ( !startLength && hooks ) {
  3373. hooks.empty.fire();
  3374. }
  3375. },
  3376. // Not public - generate a queueHooks object, or return the current one
  3377. _queueHooks: function( elem, type ) {
  3378. var key = type + "queueHooks";
  3379. return dataPriv.get( elem, key ) || dataPriv.access( elem, key, {
  3380. empty: jQuery.Callbacks( "once memory" ).add( function() {
  3381. dataPriv.remove( elem, [ type + "queue", key ] );
  3382. } )
  3383. } );
  3384. }
  3385. } );
  3386. jQuery.fn.extend( {
  3387. queue: function( type, data ) {
  3388. var setter = 2;
  3389. if ( typeof type !== "string" ) {
  3390. data = type;
  3391. type = "fx";
  3392. setter--;
  3393. }
  3394. if ( arguments.length < setter ) {
  3395. return jQuery.queue( this[ 0 ], type );
  3396. }
  3397. return data === undefined ?
  3398. this :
  3399. this.each( function() {
  3400. var queue = jQuery.queue( this, type, data );
  3401. // Ensure a hooks for this queue
  3402. jQuery._queueHooks( this, type );
  3403. if ( type === "fx" && queue[ 0 ] !== "inprogress" ) {
  3404. jQuery.dequeue( this, type );
  3405. }
  3406. } );
  3407. },
  3408. dequeue: function( type ) {
  3409. return this.each( function() {
  3410. jQuery.dequeue( this, type );
  3411. } );
  3412. },
  3413. clearQueue: function( type ) {
  3414. return this.queue( type || "fx", [] );
  3415. },
  3416. // Get a promise resolved when queues of a certain type
  3417. // are emptied (fx is the type by default)
  3418. promise: function( type, obj ) {
  3419. var tmp,
  3420. count = 1,
  3421. defer = jQuery.Deferred(),
  3422. elements = this,
  3423. i = this.length,
  3424. resolve = function() {
  3425. if ( !( --count ) ) {
  3426. defer.resolveWith( elements, [ elements ] );
  3427. }
  3428. };
  3429. if ( typeof type !== "string" ) {
  3430. obj = type;
  3431. type = undefined;
  3432. }
  3433. type = type || "fx";
  3434. while ( i-- ) {
  3435. tmp = dataPriv.get( elements[ i ], type + "queueHooks" );
  3436. if ( tmp && tmp.empty ) {
  3437. count++;
  3438. tmp.empty.add( resolve );
  3439. }
  3440. }
  3441. resolve();
  3442. return defer.promise( obj );
  3443. }
  3444. } );
  3445. var pnum = ( /[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/ ).source;
  3446. var rcssNum = new RegExp( "^(?:([+-])=|)(" + pnum + ")([a-z%]*)$", "i" );
  3447. var cssExpand = [ "Top", "Right", "Bottom", "Left" ];
  3448. var isHidden = function( elem, el ) {
  3449. // isHidden might be called from jQuery#filter function;
  3450. // in that case, element will be second argument
  3451. elem = el || elem;
  3452. return jQuery.css( elem, "display" ) === "none" ||
  3453. !jQuery.contains( elem.ownerDocument, elem );
  3454. };
  3455. function adjustCSS( elem, prop, valueParts, tween ) {
  3456. var adjusted,
  3457. scale = 1,
  3458. maxIterations = 20,
  3459. currentValue = tween ?
  3460. function() { return tween.cur(); } :
  3461. function() { return jQuery.css( elem, prop, "" ); },
  3462. initial = currentValue(),
  3463. unit = valueParts && valueParts[ 3 ] || ( jQuery.cssNumber[ prop ] ? "" : "px" ),
  3464. // Starting value computation is required for potential unit mismatches
  3465. initialInUnit = ( jQuery.cssNumber[ prop ] || unit !== "px" && +initial ) &&
  3466. rcssNum.exec( jQuery.css( elem, prop ) );
  3467. if ( initialInUnit && initialInUnit[ 3 ] !== unit ) {
  3468. // Trust units reported by jQuery.css
  3469. unit = unit || initialInUnit[ 3 ];
  3470. // Make sure we update the tween properties later on
  3471. valueParts = valueParts || [];
  3472. // Iteratively approximate from a nonzero starting point
  3473. initialInUnit = +initial || 1;
  3474. do {
  3475. // If previous iteration zeroed out, double until we get *something*.
  3476. // Use string for doubling so we don't accidentally see scale as unchanged below
  3477. scale = scale || ".5";
  3478. // Adjust and apply
  3479. initialInUnit = initialInUnit / scale;
  3480. jQuery.style( elem, prop, initialInUnit + unit );
  3481. // Update scale, tolerating zero or NaN from tween.cur()
  3482. // Break the loop if scale is unchanged or perfect, or if we've just had enough.
  3483. } while (
  3484. scale !== ( scale = currentValue() / initial ) && scale !== 1 && --maxIterations
  3485. );
  3486. }
  3487. if ( valueParts ) {
  3488. initialInUnit = +initialInUnit || +initial || 0;
  3489. // Apply relative offset (+=/-=) if specified
  3490. adjusted = valueParts[ 1 ] ?
  3491. initialInUnit + ( valueParts[ 1 ] + 1 ) * valueParts[ 2 ] :
  3492. +valueParts[ 2 ];
  3493. if ( tween ) {
  3494. tween.unit = unit;
  3495. tween.start = initialInUnit;
  3496. tween.end = adjusted;
  3497. }
  3498. }
  3499. return adjusted;
  3500. }
  3501. var rcheckableType = ( /^(?:checkbox|radio)$/i );
  3502. var rtagName = ( /<([\w:-]+)/ );
  3503. var rscriptType = ( /^$|\/(?:java|ecma)script/i );
  3504. // We have to close these tags to support XHTML (#13200)
  3505. var wrapMap = {
  3506. // Support: IE9
  3507. option: [ 1, "<select multiple='multiple'>", "</select>" ],
  3508. // XHTML parsers do not magically insert elements in the
  3509. // same way that tag soup parsers do. So we cannot shorten
  3510. // this by omitting <tbody> or other required elements.
  3511. thead: [ 1, "<table>", "</table>" ],
  3512. col: [ 2, "<table><colgroup>", "</colgroup></table>" ],
  3513. tr: [ 2, "<table><tbody>", "</tbody></table>" ],
  3514. td: [ 3, "<table><tbody><tr>", "</tr></tbody></table>" ],
  3515. _default: [ 0, "", "" ]
  3516. };
  3517. // Support: IE9
  3518. wrapMap.optgroup = wrapMap.option;
  3519. wrapMap.tbody = wrapMap.tfoot = wrapMap.colgroup = wrapMap.caption = wrapMap.thead;
  3520. wrapMap.th = wrapMap.td;
  3521. function getAll( context, tag ) {
  3522. // Support: IE9-11+
  3523. // Use typeof to avoid zero-argument method invocation on host objects (#15151)
  3524. var ret = typeof context.getElementsByTagName !== "undefined" ?
  3525. context.getElementsByTagName( tag || "*" ) :
  3526. typeof context.querySelectorAll !== "undefined" ?
  3527. context.querySelectorAll( tag || "*" ) :
  3528. [];
  3529. return tag === undefined || tag && jQuery.nodeName( context, tag ) ?
  3530. jQuery.merge( [ context ], ret ) :
  3531. ret;
  3532. }
  3533. // Mark scripts as having already been evaluated
  3534. function setGlobalEval( elems, refElements ) {
  3535. var i = 0,
  3536. l = elems.length;
  3537. for ( ; i < l; i++ ) {
  3538. dataPriv.set(
  3539. elems[ i ],
  3540. "globalEval",
  3541. !refElements || dataPriv.get( refElements[ i ], "globalEval" )
  3542. );
  3543. }
  3544. }
  3545. var rhtml = /<|&#?\w+;/;
  3546. function buildFragment( elems, context, scripts, selection, ignored ) {
  3547. var elem, tmp, tag, wrap, contains, j,
  3548. fragment = context.createDocumentFragment(),
  3549. nodes = [],
  3550. i = 0,
  3551. l = elems.length;
  3552. for ( ; i < l; i++ ) {
  3553. elem = elems[ i ];
  3554. if ( elem || elem === 0 ) {
  3555. // Add nodes directly
  3556. if ( jQuery.type( elem ) === "object" ) {
  3557. // Support: Android<4.1, PhantomJS<2
  3558. // push.apply(_, arraylike) throws on ancient WebKit
  3559. jQuery.merge( nodes, elem.nodeType ? [ elem ] : elem );
  3560. // Convert non-html into a text node
  3561. } else if ( !rhtml.test( elem ) ) {
  3562. nodes.push( context.createTextNode( elem ) );
  3563. // Convert html into DOM nodes
  3564. } else {
  3565. tmp = tmp || fragment.appendChild( context.createElement( "div" ) );
  3566. // Deserialize a standard representation
  3567. tag = ( rtagName.exec( elem ) || [ "", "" ] )[ 1 ].toLowerCase();
  3568. wrap = wrapMap[ tag ] || wrapMap._default;
  3569. tmp.innerHTML = wrap[ 1 ] + jQuery.htmlPrefilter( elem ) + wrap[ 2 ];
  3570. // Descend through wrappers to the right content
  3571. j = wrap[ 0 ];
  3572. while ( j-- ) {
  3573. tmp = tmp.lastChild;
  3574. }
  3575. // Support: Android<4.1, PhantomJS<2
  3576. // push.apply(_, arraylike) throws on ancient WebKit
  3577. jQuery.merge( nodes, tmp.childNodes );
  3578. // Remember the top-level container
  3579. tmp = fragment.firstChild;
  3580. // Ensure the created nodes are orphaned (#12392)
  3581. tmp.textContent = "";
  3582. }
  3583. }
  3584. }
  3585. // Remove wrapper from fragment
  3586. fragment.textContent = "";
  3587. i = 0;
  3588. while ( ( elem = nodes[ i++ ] ) ) {
  3589. // Skip elements already in the context collection (trac-4087)
  3590. if ( selection && jQuery.inArray( elem, selection ) > -1 ) {
  3591. if ( ignored ) {
  3592. ignored.push( elem );
  3593. }
  3594. continue;
  3595. }
  3596. contains = jQuery.contains( elem.ownerDocument, elem );
  3597. // Append to fragment
  3598. tmp = getAll( fragment.appendChild( elem ), "script" );
  3599. // Preserve script evaluation history
  3600. if ( contains ) {
  3601. setGlobalEval( tmp );
  3602. }
  3603. // Capture executables
  3604. if ( scripts ) {
  3605. j = 0;
  3606. while ( ( elem = tmp[ j++ ] ) ) {
  3607. if ( rscriptType.test( elem.type || "" ) ) {
  3608. scripts.push( elem );
  3609. }
  3610. }
  3611. }
  3612. }
  3613. return fragment;
  3614. }
  3615. ( function() {
  3616. var fragment = document.createDocumentFragment(),
  3617. div = fragment.appendChild( document.createElement( "div" ) ),
  3618. input = document.createElement( "input" );
  3619. // Support: Android 4.0-4.3, Safari<=5.1
  3620. // Check state lost if the name is set (#11217)
  3621. // Support: Windows Web Apps (WWA)
  3622. // `name` and `type` must use .setAttribute for WWA (#14901)
  3623. input.setAttribute( "type", "radio" );
  3624. input.setAttribute( "checked", "checked" );
  3625. input.setAttribute( "name", "t" );
  3626. div.appendChild( input );
  3627. // Support: Safari<=5.1, Android<4.2
  3628. // Older WebKit doesn't clone checked state correctly in fragments
  3629. support.checkClone = div.cloneNode( true ).cloneNode( true ).lastChild.checked;
  3630. // Support: IE<=11+
  3631. // Make sure textarea (and checkbox) defaultValue is properly cloned
  3632. div.innerHTML = "<textarea>x</textarea>";
  3633. support.noCloneChecked = !!div.cloneNode( true ).lastChild.defaultValue;
  3634. } )();
  3635. var
  3636. rkeyEvent = /^key/,
  3637. rmouseEvent = /^(?:mouse|pointer|contextmenu|drag|drop)|click/,
  3638. rtypenamespace = /^([^.]*)(?:\.(.+)|)/;
  3639. function returnTrue() {
  3640. return true;
  3641. }
  3642. function returnFalse() {
  3643. return false;
  3644. }
  3645. // Support: IE9
  3646. // See #13393 for more info
  3647. function safeActiveElement() {
  3648. try {
  3649. return document.activeElement;
  3650. } catch ( err ) { }
  3651. }
  3652. function on( elem, types, selector, data, fn, one ) {
  3653. var origFn, type;
  3654. // Types can be a map of types/handlers
  3655. if ( typeof types === "object" ) {
  3656. // ( types-Object, selector, data )
  3657. if ( typeof selector !== "string" ) {
  3658. // ( types-Object, data )
  3659. data = data || selector;
  3660. selector = undefined;
  3661. }
  3662. for ( type in types ) {
  3663. on( elem, type, selector, data, types[ type ], one );
  3664. }
  3665. return elem;
  3666. }
  3667. if ( data == null && fn == null ) {
  3668. // ( types, fn )
  3669. fn = selector;
  3670. data = selector = undefined;
  3671. } else if ( fn == null ) {
  3672. if ( typeof selector === "string" ) {
  3673. // ( types, selector, fn )
  3674. fn = data;
  3675. data = undefined;
  3676. } else {
  3677. // ( types, data, fn )
  3678. fn = data;
  3679. data = selector;
  3680. selector = undefined;
  3681. }
  3682. }
  3683. if ( fn === false ) {
  3684. fn = returnFalse;
  3685. } else if ( !fn ) {
  3686. return elem;
  3687. }
  3688. if ( one === 1 ) {
  3689. origFn = fn;
  3690. fn = function( event ) {
  3691. // Can use an empty set, since event contains the info
  3692. jQuery().off( event );
  3693. return origFn.apply( this, arguments );
  3694. };
  3695. // Use same guid so caller can remove using origFn
  3696. fn.guid = origFn.guid || ( origFn.guid = jQuery.guid++ );
  3697. }
  3698. return elem.each( function() {
  3699. jQuery.event.add( this, types, fn, data, selector );
  3700. } );
  3701. }
  3702. /*
  3703. * Helper functions for managing events -- not part of the public interface.
  3704. * Props to Dean Edwards' addEvent library for many of the ideas.
  3705. */
  3706. jQuery.event = {
  3707. global: {},
  3708. add: function( elem, types, handler, data, selector ) {
  3709. var handleObjIn, eventHandle, tmp,
  3710. events, t, handleObj,
  3711. special, handlers, type, namespaces, origType,
  3712. elemData = dataPriv.get( elem );
  3713. // Don't attach events to noData or text/comment nodes (but allow plain objects)
  3714. if ( !elemData ) {
  3715. return;
  3716. }
  3717. // Caller can pass in an object of custom data in lieu of the handler
  3718. if ( handler.handler ) {
  3719. handleObjIn = handler;
  3720. handler = handleObjIn.handler;
  3721. selector = handleObjIn.selector;
  3722. }
  3723. // Make sure that the handler has a unique ID, used to find/remove it later
  3724. if ( !handler.guid ) {
  3725. handler.guid = jQuery.guid++;
  3726. }
  3727. // Init the element's event structure and main handler, if this is the first
  3728. if ( !( events = elemData.events ) ) {
  3729. events = elemData.events = {};
  3730. }
  3731. if ( !( eventHandle = elemData.handle ) ) {
  3732. eventHandle = elemData.handle = function( e ) {
  3733. // Discard the second event of a jQuery.event.trigger() and
  3734. // when an event is called after a page has unloaded
  3735. return typeof jQuery !== "undefined" && jQuery.event.triggered !== e.type ?
  3736. jQuery.event.dispatch.apply( elem, arguments ) : undefined;
  3737. };
  3738. }
  3739. // Handle multiple events separated by a space
  3740. types = ( types || "" ).match( rnotwhite ) || [ "" ];
  3741. t = types.length;
  3742. while ( t-- ) {
  3743. tmp = rtypenamespace.exec( types[ t ] ) || [];
  3744. type = origType = tmp[ 1 ];
  3745. namespaces = ( tmp[ 2 ] || "" ).split( "." ).sort();
  3746. // There *must* be a type, no attaching namespace-only handlers
  3747. if ( !type ) {
  3748. continue;
  3749. }
  3750. // If event changes its type, use the special event handlers for the changed type
  3751. special = jQuery.event.special[ type ] || {};
  3752. // If selector defined, determine special event api type, otherwise given type
  3753. type = ( selector ? special.delegateType : special.bindType ) || type;
  3754. // Update special based on newly reset type
  3755. special = jQuery.event.special[ type ] || {};
  3756. // handleObj is passed to all event handlers
  3757. handleObj = jQuery.extend( {
  3758. type: type,
  3759. origType: origType,
  3760. data: data,
  3761. handler: handler,
  3762. guid: handler.guid,
  3763. selector: selector,
  3764. needsContext: selector && jQuery.expr.match.needsContext.test( selector ),
  3765. namespace: namespaces.join( "." )
  3766. }, handleObjIn );
  3767. // Init the event handler queue if we're the first
  3768. if ( !( handlers = events[ type ] ) ) {
  3769. handlers = events[ type ] = [];
  3770. handlers.delegateCount = 0;
  3771. // Only use addEventListener if the special events handler returns false
  3772. if ( !special.setup ||
  3773. special.setup.call( elem, data, namespaces, eventHandle ) === false ) {
  3774. if ( elem.addEventListener ) {
  3775. elem.addEventListener( type, eventHandle );
  3776. }
  3777. }
  3778. }
  3779. if ( special.add ) {
  3780. special.add.call( elem, handleObj );
  3781. if ( !handleObj.handler.guid ) {
  3782. handleObj.handler.guid = handler.guid;
  3783. }
  3784. }
  3785. // Add to the element's handler list, delegates in front
  3786. if ( selector ) {
  3787. handlers.splice( handlers.delegateCount++, 0, handleObj );
  3788. } else {
  3789. handlers.push( handleObj );
  3790. }
  3791. // Keep track of which events have ever been used, for event optimization
  3792. jQuery.event.global[ type ] = true;
  3793. }
  3794. },
  3795. // Detach an event or set of events from an element
  3796. remove: function( elem, types, handler, selector, mappedTypes ) {
  3797. var j, origCount, tmp,
  3798. events, t, handleObj,
  3799. special, handlers, type, namespaces, origType,
  3800. elemData = dataPriv.hasData( elem ) && dataPriv.get( elem );
  3801. if ( !elemData || !( events = elemData.events ) ) {
  3802. return;
  3803. }
  3804. // Once for each type.namespace in types; type may be omitted
  3805. types = ( types || "" ).match( rnotwhite ) || [ "" ];
  3806. t = types.length;
  3807. while ( t-- ) {
  3808. tmp = rtypenamespace.exec( types[ t ] ) || [];
  3809. type = origType = tmp[ 1 ];
  3810. namespaces = ( tmp[ 2 ] || "" ).split( "." ).sort();
  3811. // Unbind all events (on this namespace, if provided) for the element
  3812. if ( !type ) {
  3813. for ( type in events ) {
  3814. jQuery.event.remove( elem, type + types[ t ], handler, selector, true );
  3815. }
  3816. continue;
  3817. }
  3818. special = jQuery.event.special[ type ] || {};
  3819. type = ( selector ? special.delegateType : special.bindType ) || type;
  3820. handlers = events[ type ] || [];
  3821. tmp = tmp[ 2 ] &&
  3822. new RegExp( "(^|\\.)" + namespaces.join( "\\.(?:.*\\.|)" ) + "(\\.|$)" );
  3823. // Remove matching events
  3824. origCount = j = handlers.length;
  3825. while ( j-- ) {
  3826. handleObj = handlers[ j ];
  3827. if ( ( mappedTypes || origType === handleObj.origType ) &&
  3828. ( !handler || handler.guid === handleObj.guid ) &&
  3829. ( !tmp || tmp.test( handleObj.namespace ) ) &&
  3830. ( !selector || selector === handleObj.selector ||
  3831. selector === "**" && handleObj.selector ) ) {
  3832. handlers.splice( j, 1 );
  3833. if ( handleObj.selector ) {
  3834. handlers.delegateCount--;
  3835. }
  3836. if ( special.remove ) {
  3837. special.remove.call( elem, handleObj );
  3838. }
  3839. }
  3840. }
  3841. // Remove generic event handler if we removed something and no more handlers exist
  3842. // (avoids potential for endless recursion during removal of special event handlers)
  3843. if ( origCount && !handlers.length ) {
  3844. if ( !special.teardown ||
  3845. special.teardown.call( elem, namespaces, elemData.handle ) === false ) {
  3846. jQuery.removeEvent( elem, type, elemData.handle );
  3847. }
  3848. delete events[ type ];
  3849. }
  3850. }
  3851. // Remove data and the expando if it's no longer used
  3852. if ( jQuery.isEmptyObject( events ) ) {
  3853. dataPriv.remove( elem, "handle events" );
  3854. }
  3855. },
  3856. dispatch: function( event ) {
  3857. // Make a writable jQuery.Event from the native event object
  3858. event = jQuery.event.fix( event );
  3859. var i, j, ret, matched, handleObj,
  3860. handlerQueue = [],
  3861. args = slice.call( arguments ),
  3862. handlers = ( dataPriv.get( this, "events" ) || {} )[ event.type ] || [],
  3863. special = jQuery.event.special[ event.type ] || {};
  3864. // Use the fix-ed jQuery.Event rather than the (read-only) native event
  3865. args[ 0 ] = event;
  3866. event.delegateTarget = this;
  3867. // Call the preDispatch hook for the mapped type, and let it bail if desired
  3868. if ( special.preDispatch && special.preDispatch.call( this, event ) === false ) {
  3869. return;
  3870. }
  3871. // Determine handlers
  3872. handlerQueue = jQuery.event.handlers.call( this, event, handlers );
  3873. // Run delegates first; they may want to stop propagation beneath us
  3874. i = 0;
  3875. while ( ( matched = handlerQueue[ i++ ] ) && !event.isPropagationStopped() ) {
  3876. event.currentTarget = matched.elem;
  3877. j = 0;
  3878. while ( ( handleObj = matched.handlers[ j++ ] ) &&
  3879. !event.isImmediatePropagationStopped() ) {
  3880. // Triggered event must either 1) have no namespace, or 2) have namespace(s)
  3881. // a subset or equal to those in the bound event (both can have no namespace).
  3882. if ( !event.rnamespace || event.rnamespace.test( handleObj.namespace ) ) {
  3883. event.handleObj = handleObj;
  3884. event.data = handleObj.data;
  3885. ret = ( ( jQuery.event.special[ handleObj.origType ] || {} ).handle ||
  3886. handleObj.handler ).apply( matched.elem, args );
  3887. if ( ret !== undefined ) {
  3888. if ( ( event.result = ret ) === false ) {
  3889. event.preventDefault();
  3890. event.stopPropagation();
  3891. }
  3892. }
  3893. }
  3894. }
  3895. }
  3896. // Call the postDispatch hook for the mapped type
  3897. if ( special.postDispatch ) {
  3898. special.postDispatch.call( this, event );
  3899. }
  3900. return event.result;
  3901. },
  3902. handlers: function( event, handlers ) {
  3903. var i, matches, sel, handleObj,
  3904. handlerQueue = [],
  3905. delegateCount = handlers.delegateCount,
  3906. cur = event.target;
  3907. // Support (at least): Chrome, IE9
  3908. // Find delegate handlers
  3909. // Black-hole SVG <use> instance trees (#13180)
  3910. //
  3911. // Support: Firefox<=42+
  3912. // Avoid non-left-click in FF but don't block IE radio events (#3861, gh-2343)
  3913. if ( delegateCount && cur.nodeType &&
  3914. ( event.type !== "click" || isNaN( event.button ) || event.button < 1 ) ) {
  3915. for ( ; cur !== this; cur = cur.parentNode || this ) {
  3916. // Don't check non-elements (#13208)
  3917. // Don't process clicks on disabled elements (#6911, #8165, #11382, #11764)
  3918. if ( cur.nodeType === 1 && ( cur.disabled !== true || event.type !== "click" ) ) {
  3919. matches = [];
  3920. for ( i = 0; i < delegateCount; i++ ) {
  3921. handleObj = handlers[ i ];
  3922. // Don't conflict with Object.prototype properties (#13203)
  3923. sel = handleObj.selector + " ";
  3924. if ( matches[ sel ] === undefined ) {
  3925. matches[ sel ] = handleObj.needsContext ?
  3926. jQuery( sel, this ).index( cur ) > -1 :
  3927. jQuery.find( sel, this, null, [ cur ] ).length;
  3928. }
  3929. if ( matches[ sel ] ) {
  3930. matches.push( handleObj );
  3931. }
  3932. }
  3933. if ( matches.length ) {
  3934. handlerQueue.push( { elem: cur, handlers: matches } );
  3935. }
  3936. }
  3937. }
  3938. }
  3939. // Add the remaining (directly-bound) handlers
  3940. if ( delegateCount < handlers.length ) {
  3941. handlerQueue.push( { elem: this, handlers: handlers.slice( delegateCount ) } );
  3942. }
  3943. return handlerQueue;
  3944. },
  3945. // Includes some event props shared by KeyEvent and MouseEvent
  3946. props: ( "altKey bubbles cancelable ctrlKey currentTarget detail eventPhase " +
  3947. "metaKey relatedTarget shiftKey target timeStamp view which" ).split( " " ),
  3948. fixHooks: {},
  3949. keyHooks: {
  3950. props: "char charCode key keyCode".split( " " ),
  3951. filter: function( event, original ) {
  3952. // Add which for key events
  3953. if ( event.which == null ) {
  3954. event.which = original.charCode != null ? original.charCode : original.keyCode;
  3955. }
  3956. return event;
  3957. }
  3958. },
  3959. mouseHooks: {
  3960. props: ( "button buttons clientX clientY offsetX offsetY pageX pageY " +
  3961. "screenX screenY toElement" ).split( " " ),
  3962. filter: function( event, original ) {
  3963. var eventDoc, doc, body,
  3964. button = original.button;
  3965. // Calculate pageX/Y if missing and clientX/Y available
  3966. if ( event.pageX == null && original.clientX != null ) {
  3967. eventDoc = event.target.ownerDocument || document;
  3968. doc = eventDoc.documentElement;
  3969. body = eventDoc.body;
  3970. event.pageX = original.clientX +
  3971. ( doc && doc.scrollLeft || body && body.scrollLeft || 0 ) -
  3972. ( doc && doc.clientLeft || body && body.clientLeft || 0 );
  3973. event.pageY = original.clientY +
  3974. ( doc && doc.scrollTop || body && body.scrollTop || 0 ) -
  3975. ( doc && doc.clientTop || body && body.clientTop || 0 );
  3976. }
  3977. // Add which for click: 1 === left; 2 === middle; 3 === right
  3978. // Note: button is not normalized, so don't use it
  3979. if ( !event.which && button !== undefined ) {
  3980. event.which = ( button & 1 ? 1 : ( button & 2 ? 3 : ( button & 4 ? 2 : 0 ) ) );
  3981. }
  3982. return event;
  3983. }
  3984. },
  3985. fix: function( event ) {
  3986. if ( event[ jQuery.expando ] ) {
  3987. return event;
  3988. }
  3989. // Create a writable copy of the event object and normalize some properties
  3990. var i, prop, copy,
  3991. type = event.type,
  3992. originalEvent = event,
  3993. fixHook = this.fixHooks[ type ];
  3994. if ( !fixHook ) {
  3995. this.fixHooks[ type ] = fixHook =
  3996. rmouseEvent.test( type ) ? this.mouseHooks :
  3997. rkeyEvent.test( type ) ? this.keyHooks :
  3998. {};
  3999. }
  4000. copy = fixHook.props ? this.props.concat( fixHook.props ) : this.props;
  4001. event = new jQuery.Event( originalEvent );
  4002. i = copy.length;
  4003. while ( i-- ) {
  4004. prop = copy[ i ];
  4005. event[ prop ] = originalEvent[ prop ];
  4006. }
  4007. // Support: Cordova 2.5 (WebKit) (#13255)
  4008. // All events should have a target; Cordova deviceready doesn't
  4009. if ( !event.target ) {
  4010. event.target = document;
  4011. }
  4012. // Support: Safari 6.0+, Chrome<28
  4013. // Target should not be a text node (#504, #13143)
  4014. if ( event.target.nodeType === 3 ) {
  4015. event.target = event.target.parentNode;
  4016. }
  4017. return fixHook.filter ? fixHook.filter( event, originalEvent ) : event;
  4018. },
  4019. special: {
  4020. load: {
  4021. // Prevent triggered image.load events from bubbling to window.load
  4022. noBubble: true
  4023. },
  4024. focus: {
  4025. // Fire native event if possible so blur/focus sequence is correct
  4026. trigger: function() {
  4027. if ( this !== safeActiveElement() && this.focus ) {
  4028. this.focus();
  4029. return false;
  4030. }
  4031. },
  4032. delegateType: "focusin"
  4033. },
  4034. blur: {
  4035. trigger: function() {
  4036. if ( this === safeActiveElement() && this.blur ) {
  4037. this.blur();
  4038. return false;
  4039. }
  4040. },
  4041. delegateType: "focusout"
  4042. },
  4043. click: {
  4044. // For checkbox, fire native event so checked state will be right
  4045. trigger: function() {
  4046. if ( this.type === "checkbox" && this.click && jQuery.nodeName( this, "input" ) ) {
  4047. this.click();
  4048. return false;
  4049. }
  4050. },
  4051. // For cross-browser consistency, don't fire native .click() on links
  4052. _default: function( event ) {
  4053. return jQuery.nodeName( event.target, "a" );
  4054. }
  4055. },
  4056. beforeunload: {
  4057. postDispatch: function( event ) {
  4058. // Support: Firefox 20+
  4059. // Firefox doesn't alert if the returnValue field is not set.
  4060. if ( event.result !== undefined && event.originalEvent ) {
  4061. event.originalEvent.returnValue = event.result;
  4062. }
  4063. }
  4064. }
  4065. }
  4066. };
  4067. jQuery.removeEvent = function( elem, type, handle ) {
  4068. // This "if" is needed for plain objects
  4069. if ( elem.removeEventListener ) {
  4070. elem.removeEventListener( type, handle );
  4071. }
  4072. };
  4073. jQuery.Event = function( src, props ) {
  4074. // Allow instantiation without the 'new' keyword
  4075. if ( !( this instanceof jQuery.Event ) ) {
  4076. return new jQuery.Event( src, props );
  4077. }
  4078. // Event object
  4079. if ( src && src.type ) {
  4080. this.originalEvent = src;
  4081. this.type = src.type;
  4082. // Events bubbling up the document may have been marked as prevented
  4083. // by a handler lower down the tree; reflect the correct value.
  4084. this.isDefaultPrevented = src.defaultPrevented ||
  4085. src.defaultPrevented === undefined &&
  4086. // Support: Android<4.0
  4087. src.returnValue === false ?
  4088. returnTrue :
  4089. returnFalse;
  4090. // Event type
  4091. } else {
  4092. this.type = src;
  4093. }
  4094. // Put explicitly provided properties onto the event object
  4095. if ( props ) {
  4096. jQuery.extend( this, props );
  4097. }
  4098. // Create a timestamp if incoming event doesn't have one
  4099. this.timeStamp = src && src.timeStamp || jQuery.now();
  4100. // Mark it as fixed
  4101. this[ jQuery.expando ] = true;
  4102. };
  4103. // jQuery.Event is based on DOM3 Events as specified by the ECMAScript Language Binding
  4104. // http://www.w3.org/TR/2003/WD-DOM-Level-3-Events-20030331/ecma-script-binding.html
  4105. jQuery.Event.prototype = {
  4106. constructor: jQuery.Event,
  4107. isDefaultPrevented: returnFalse,
  4108. isPropagationStopped: returnFalse,
  4109. isImmediatePropagationStopped: returnFalse,
  4110. preventDefault: function() {
  4111. var e = this.originalEvent;
  4112. this.isDefaultPrevented = returnTrue;
  4113. if ( e ) {
  4114. e.preventDefault();
  4115. }
  4116. },
  4117. stopPropagation: function() {
  4118. var e = this.originalEvent;
  4119. this.isPropagationStopped = returnTrue;
  4120. if ( e ) {
  4121. e.stopPropagation();
  4122. }
  4123. },
  4124. stopImmediatePropagation: function() {
  4125. var e = this.originalEvent;
  4126. this.isImmediatePropagationStopped = returnTrue;
  4127. if ( e ) {
  4128. e.stopImmediatePropagation();
  4129. }
  4130. this.stopPropagation();
  4131. }
  4132. };
  4133. // Create mouseenter/leave events using mouseover/out and event-time checks
  4134. // so that event delegation works in jQuery.
  4135. // Do the same for pointerenter/pointerleave and pointerover/pointerout
  4136. //
  4137. // Support: Safari 7 only
  4138. // Safari sends mouseenter too often; see:
  4139. // https://code.google.com/p/chromium/issues/detail?id=470258
  4140. // for the description of the bug (it existed in older Chrome versions as well).
  4141. jQuery.each( {
  4142. mouseenter: "mouseover",
  4143. mouseleave: "mouseout",
  4144. pointerenter: "pointerover",
  4145. pointerleave: "pointerout"
  4146. }, function( orig, fix ) {
  4147. jQuery.event.special[ orig ] = {
  4148. delegateType: fix,
  4149. bindType: fix,
  4150. handle: function( event ) {
  4151. var ret,
  4152. target = this,
  4153. related = event.relatedTarget,
  4154. handleObj = event.handleObj;
  4155. // For mouseenter/leave call the handler if related is outside the target.
  4156. // NB: No relatedTarget if the mouse left/entered the browser window
  4157. if ( !related || ( related !== target && !jQuery.contains( target, related ) ) ) {
  4158. event.type = handleObj.origType;
  4159. ret = handleObj.handler.apply( this, arguments );
  4160. event.type = fix;
  4161. }
  4162. return ret;
  4163. }
  4164. };
  4165. } );
  4166. jQuery.fn.extend( {
  4167. on: function( types, selector, data, fn ) {
  4168. return on( this, types, selector, data, fn );
  4169. },
  4170. one: function( types, selector, data, fn ) {
  4171. return on( this, types, selector, data, fn, 1 );
  4172. },
  4173. off: function( types, selector, fn ) {
  4174. var handleObj, type;
  4175. if ( types && types.preventDefault && types.handleObj ) {
  4176. // ( event ) dispatched jQuery.Event
  4177. handleObj = types.handleObj;
  4178. jQuery( types.delegateTarget ).off(
  4179. handleObj.namespace ?
  4180. handleObj.origType + "." + handleObj.namespace :
  4181. handleObj.origType,
  4182. handleObj.selector,
  4183. handleObj.handler
  4184. );
  4185. return this;
  4186. }
  4187. if ( typeof types === "object" ) {
  4188. // ( types-object [, selector] )
  4189. for ( type in types ) {
  4190. this.off( type, selector, types[ type ] );
  4191. }
  4192. return this;
  4193. }
  4194. if ( selector === false || typeof selector === "function" ) {
  4195. // ( types [, fn] )
  4196. fn = selector;
  4197. selector = undefined;
  4198. }
  4199. if ( fn === false ) {
  4200. fn = returnFalse;
  4201. }
  4202. return this.each( function() {
  4203. jQuery.event.remove( this, types, fn, selector );
  4204. } );
  4205. }
  4206. } );
  4207. var
  4208. rxhtmlTag = /<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:-]+)[^>]*)\/>/gi,
  4209. // Support: IE 10-11, Edge 10240+
  4210. // In IE/Edge using regex groups here causes severe slowdowns.
  4211. // See https://connect.microsoft.com/IE/feedback/details/1736512/
  4212. rnoInnerhtml = /<script|<style|<link/i,
  4213. // checked="checked" or checked
  4214. rchecked = /checked\s*(?:[^=]|=\s*.checked.)/i,
  4215. rscriptTypeMasked = /^true\/(.*)/,
  4216. rcleanScript = /^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g;
  4217. // Manipulating tables requires a tbody
  4218. function manipulationTarget( elem, content ) {
  4219. return jQuery.nodeName( elem, "table" ) &&
  4220. jQuery.nodeName( content.nodeType !== 11 ? content : content.firstChild, "tr" ) ?
  4221. elem.getElementsByTagName( "tbody" )[ 0 ] ||
  4222. elem.appendChild( elem.ownerDocument.createElement( "tbody" ) ) :
  4223. elem;
  4224. }
  4225. // Replace/restore the type attribute of script elements for safe DOM manipulation
  4226. function disableScript( elem ) {
  4227. elem.type = ( elem.getAttribute( "type" ) !== null ) + "/" + elem.type;
  4228. return elem;
  4229. }
  4230. function restoreScript( elem ) {
  4231. var match = rscriptTypeMasked.exec( elem.type );
  4232. if ( match ) {
  4233. elem.type = match[ 1 ];
  4234. } else {
  4235. elem.removeAttribute( "type" );
  4236. }
  4237. return elem;
  4238. }
  4239. function cloneCopyEvent( src, dest ) {
  4240. var i, l, type, pdataOld, pdataCur, udataOld, udataCur, events;
  4241. if ( dest.nodeType !== 1 ) {
  4242. return;
  4243. }
  4244. // 1. Copy private data: events, handlers, etc.
  4245. if ( dataPriv.hasData( src ) ) {
  4246. pdataOld = dataPriv.access( src );
  4247. pdataCur = dataPriv.set( dest, pdataOld );
  4248. events = pdataOld.events;
  4249. if ( events ) {
  4250. delete pdataCur.handle;
  4251. pdataCur.events = {};
  4252. for ( type in events ) {
  4253. for ( i = 0, l = events[ type ].length; i < l; i++ ) {
  4254. jQuery.event.add( dest, type, events[ type ][ i ] );
  4255. }
  4256. }
  4257. }
  4258. }
  4259. // 2. Copy user data
  4260. if ( dataUser.hasData( src ) ) {
  4261. udataOld = dataUser.access( src );
  4262. udataCur = jQuery.extend( {}, udataOld );
  4263. dataUser.set( dest, udataCur );
  4264. }
  4265. }
  4266. // Fix IE bugs, see support tests
  4267. function fixInput( src, dest ) {
  4268. var nodeName = dest.nodeName.toLowerCase();
  4269. // Fails to persist the checked state of a cloned checkbox or radio button.
  4270. if ( nodeName === "input" && rcheckableType.test( src.type ) ) {
  4271. dest.checked = src.checked;
  4272. // Fails to return the selected option to the default selected state when cloning options
  4273. } else if ( nodeName === "input" || nodeName === "textarea" ) {
  4274. dest.defaultValue = src.defaultValue;
  4275. }
  4276. }
  4277. function domManip( collection, args, callback, ignored ) {
  4278. // Flatten any nested arrays
  4279. args = concat.apply( [], args );
  4280. var fragment, first, scripts, hasScripts, node, doc,
  4281. i = 0,
  4282. l = collection.length,
  4283. iNoClone = l - 1,
  4284. value = args[ 0 ],
  4285. isFunction = jQuery.isFunction( value );
  4286. // We can't cloneNode fragments that contain checked, in WebKit
  4287. if ( isFunction ||
  4288. ( l > 1 && typeof value === "string" &&
  4289. !support.checkClone && rchecked.test( value ) ) ) {
  4290. return collection.each( function( index ) {
  4291. var self = collection.eq( index );
  4292. if ( isFunction ) {
  4293. args[ 0 ] = value.call( this, index, self.html() );
  4294. }
  4295. domManip( self, args, callback, ignored );
  4296. } );
  4297. }
  4298. if ( l ) {
  4299. fragment = buildFragment( args, collection[ 0 ].ownerDocument, false, collection, ignored );
  4300. first = fragment.firstChild;
  4301. if ( fragment.childNodes.length === 1 ) {
  4302. fragment = first;
  4303. }
  4304. // Require either new content or an interest in ignored elements to invoke the callback
  4305. if ( first || ignored ) {
  4306. scripts = jQuery.map( getAll( fragment, "script" ), disableScript );
  4307. hasScripts = scripts.length;
  4308. // Use the original fragment for the last item
  4309. // instead of the first because it can end up
  4310. // being emptied incorrectly in certain situations (#8070).
  4311. for ( ; i < l; i++ ) {
  4312. node = fragment;
  4313. if ( i !== iNoClone ) {
  4314. node = jQuery.clone( node, true, true );
  4315. // Keep references to cloned scripts for later restoration
  4316. if ( hasScripts ) {
  4317. // Support: Android<4.1, PhantomJS<2
  4318. // push.apply(_, arraylike) throws on ancient WebKit
  4319. jQuery.merge( scripts, getAll( node, "script" ) );
  4320. }
  4321. }
  4322. callback.call( collection[ i ], node, i );
  4323. }
  4324. if ( hasScripts ) {
  4325. doc = scripts[ scripts.length - 1 ].ownerDocument;
  4326. // Reenable scripts
  4327. jQuery.map( scripts, restoreScript );
  4328. // Evaluate executable scripts on first document insertion
  4329. for ( i = 0; i < hasScripts; i++ ) {
  4330. node = scripts[ i ];
  4331. if ( rscriptType.test( node.type || "" ) &&
  4332. !dataPriv.access( node, "globalEval" ) &&
  4333. jQuery.contains( doc, node ) ) {
  4334. if ( node.src ) {
  4335. // Optional AJAX dependency, but won't run scripts if not present
  4336. if ( jQuery._evalUrl ) {
  4337. jQuery._evalUrl( node.src );
  4338. }
  4339. } else {
  4340. jQuery.globalEval( node.textContent.replace( rcleanScript, "" ) );
  4341. }
  4342. }
  4343. }
  4344. }
  4345. }
  4346. }
  4347. return collection;
  4348. }
  4349. function remove( elem, selector, keepData ) {
  4350. var node,
  4351. nodes = selector ? jQuery.filter( selector, elem ) : elem,
  4352. i = 0;
  4353. for ( ; ( node = nodes[ i ] ) != null; i++ ) {
  4354. if ( !keepData && node.nodeType === 1 ) {
  4355. jQuery.cleanData( getAll( node ) );
  4356. }
  4357. if ( node.parentNode ) {
  4358. if ( keepData && jQuery.contains( node.ownerDocument, node ) ) {
  4359. setGlobalEval( getAll( node, "script" ) );
  4360. }
  4361. node.parentNode.removeChild( node );
  4362. }
  4363. }
  4364. return elem;
  4365. }
  4366. jQuery.extend( {
  4367. htmlPrefilter: function( html ) {
  4368. return html.replace( rxhtmlTag, "<$1></$2>" );
  4369. },
  4370. clone: function( elem, dataAndEvents, deepDataAndEvents ) {
  4371. var i, l, srcElements, destElements,
  4372. clone = elem.cloneNode( true ),
  4373. inPage = jQuery.contains( elem.ownerDocument, elem );
  4374. // Fix IE cloning issues
  4375. if ( !support.noCloneChecked && ( elem.nodeType === 1 || elem.nodeType === 11 ) &&
  4376. !jQuery.isXMLDoc( elem ) ) {
  4377. // We eschew Sizzle here for performance reasons: http://jsperf.com/getall-vs-sizzle/2
  4378. destElements = getAll( clone );
  4379. srcElements = getAll( elem );
  4380. for ( i = 0, l = srcElements.length; i < l; i++ ) {
  4381. fixInput( srcElements[ i ], destElements[ i ] );
  4382. }
  4383. }
  4384. // Copy the events from the original to the clone
  4385. if ( dataAndEvents ) {
  4386. if ( deepDataAndEvents ) {
  4387. srcElements = srcElements || getAll( elem );
  4388. destElements = destElements || getAll( clone );
  4389. for ( i = 0, l = srcElements.length; i < l; i++ ) {
  4390. cloneCopyEvent( srcElements[ i ], destElements[ i ] );
  4391. }
  4392. } else {
  4393. cloneCopyEvent( elem, clone );
  4394. }
  4395. }
  4396. // Preserve script evaluation history
  4397. destElements = getAll( clone, "script" );
  4398. if ( destElements.length > 0 ) {
  4399. setGlobalEval( destElements, !inPage && getAll( elem, "script" ) );
  4400. }
  4401. // Return the cloned set
  4402. return clone;
  4403. },
  4404. cleanData: function( elems ) {
  4405. var data, elem, type,
  4406. special = jQuery.event.special,
  4407. i = 0;
  4408. for ( ; ( elem = elems[ i ] ) !== undefined; i++ ) {
  4409. if ( acceptData( elem ) ) {
  4410. if ( ( data = elem[ dataPriv.expando ] ) ) {
  4411. if ( data.events ) {
  4412. for ( type in data.events ) {
  4413. if ( special[ type ] ) {
  4414. jQuery.event.remove( elem, type );
  4415. // This is a shortcut to avoid jQuery.event.remove's overhead
  4416. } else {
  4417. jQuery.removeEvent( elem, type, data.handle );
  4418. }
  4419. }
  4420. }
  4421. // Support: Chrome <= 35-45+
  4422. // Assign undefined instead of using delete, see Data#remove
  4423. elem[ dataPriv.expando ] = undefined;
  4424. }
  4425. if ( elem[ dataUser.expando ] ) {
  4426. // Support: Chrome <= 35-45+
  4427. // Assign undefined instead of using delete, see Data#remove
  4428. elem[ dataUser.expando ] = undefined;
  4429. }
  4430. }
  4431. }
  4432. }
  4433. } );
  4434. jQuery.fn.extend( {
  4435. // Keep domManip exposed until 3.0 (gh-2225)
  4436. domManip: domManip,
  4437. detach: function( selector ) {
  4438. return remove( this, selector, true );
  4439. },
  4440. remove: function( selector ) {
  4441. return remove( this, selector );
  4442. },
  4443. text: function( value ) {
  4444. return access( this, function( value ) {
  4445. return value === undefined ?
  4446. jQuery.text( this ) :
  4447. this.empty().each( function() {
  4448. if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) {
  4449. this.textContent = value;
  4450. }
  4451. } );
  4452. }, null, value, arguments.length );
  4453. },
  4454. append: function() {
  4455. return domManip( this, arguments, function( elem ) {
  4456. if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) {
  4457. var target = manipulationTarget( this, elem );
  4458. target.appendChild( elem );
  4459. }
  4460. } );
  4461. },
  4462. prepend: function() {
  4463. return domManip( this, arguments, function( elem ) {
  4464. if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) {
  4465. var target = manipulationTarget( this, elem );
  4466. target.insertBefore( elem, target.firstChild );
  4467. }
  4468. } );
  4469. },
  4470. before: function() {
  4471. return domManip( this, arguments, function( elem ) {
  4472. if ( this.parentNode ) {
  4473. this.parentNode.insertBefore( elem, this );
  4474. }
  4475. } );
  4476. },
  4477. after: function() {
  4478. return domManip( this, arguments, function( elem ) {
  4479. if ( this.parentNode ) {
  4480. this.parentNode.insertBefore( elem, this.nextSibling );
  4481. }
  4482. } );
  4483. },
  4484. empty: function() {
  4485. var elem,
  4486. i = 0;
  4487. for ( ; ( elem = this[ i ] ) != null; i++ ) {
  4488. if ( elem.nodeType === 1 ) {
  4489. // Prevent memory leaks
  4490. jQuery.cleanData( getAll( elem, false ) );
  4491. // Remove any remaining nodes
  4492. elem.textContent = "";
  4493. }
  4494. }
  4495. return this;
  4496. },
  4497. clone: function( dataAndEvents, deepDataAndEvents ) {
  4498. dataAndEvents = dataAndEvents == null ? false : dataAndEvents;
  4499. deepDataAndEvents = deepDataAndEvents == null ? dataAndEvents : deepDataAndEvents;
  4500. return this.map( function() {
  4501. return jQuery.clone( this, dataAndEvents, deepDataAndEvents );
  4502. } );
  4503. },
  4504. html: function( value ) {
  4505. return access( this, function( value ) {
  4506. var elem = this[ 0 ] || {},
  4507. i = 0,
  4508. l = this.length;
  4509. if ( value === undefined && elem.nodeType === 1 ) {
  4510. return elem.innerHTML;
  4511. }
  4512. // See if we can take a shortcut and just use innerHTML
  4513. if ( typeof value === "string" && !rnoInnerhtml.test( value ) &&
  4514. !wrapMap[ ( rtagName.exec( value ) || [ "", "" ] )[ 1 ].toLowerCase() ] ) {
  4515. value = jQuery.htmlPrefilter( value );
  4516. try {
  4517. for ( ; i < l; i++ ) {
  4518. elem = this[ i ] || {};
  4519. // Remove element nodes and prevent memory leaks
  4520. if ( elem.nodeType === 1 ) {
  4521. jQuery.cleanData( getAll( elem, false ) );
  4522. elem.innerHTML = value;
  4523. }
  4524. }
  4525. elem = 0;
  4526. // If using innerHTML throws an exception, use the fallback method
  4527. } catch ( e ) {}
  4528. }
  4529. if ( elem ) {
  4530. this.empty().append( value );
  4531. }
  4532. }, null, value, arguments.length );
  4533. },
  4534. replaceWith: function() {
  4535. var ignored = [];
  4536. // Make the changes, replacing each non-ignored context element with the new content
  4537. return domManip( this, arguments, function( elem ) {
  4538. var parent = this.parentNode;
  4539. if ( jQuery.inArray( this, ignored ) < 0 ) {
  4540. jQuery.cleanData( getAll( this ) );
  4541. if ( parent ) {
  4542. parent.replaceChild( elem, this );
  4543. }
  4544. }
  4545. // Force callback invocation
  4546. }, ignored );
  4547. }
  4548. } );
  4549. jQuery.each( {
  4550. appendTo: "append",
  4551. prependTo: "prepend",
  4552. insertBefore: "before",
  4553. insertAfter: "after",
  4554. replaceAll: "replaceWith"
  4555. }, function( name, original ) {
  4556. jQuery.fn[ name ] = function( selector ) {
  4557. var elems,
  4558. ret = [],
  4559. insert = jQuery( selector ),
  4560. last = insert.length - 1,
  4561. i = 0;
  4562. for ( ; i <= last; i++ ) {
  4563. elems = i === last ? this : this.clone( true );
  4564. jQuery( insert[ i ] )[ original ]( elems );
  4565. // Support: QtWebKit
  4566. // .get() because push.apply(_, arraylike) throws
  4567. push.apply( ret, elems.get() );
  4568. }
  4569. return this.pushStack( ret );
  4570. };
  4571. } );
  4572. var iframe,
  4573. elemdisplay = {
  4574. // Support: Firefox
  4575. // We have to pre-define these values for FF (#10227)
  4576. HTML: "block",
  4577. BODY: "block"
  4578. };
  4579. /**
  4580. * Retrieve the actual display of a element
  4581. * @param {String} name nodeName of the element
  4582. * @param {Object} doc Document object
  4583. */
  4584. // Called only from within defaultDisplay
  4585. function actualDisplay( name, doc ) {
  4586. var elem = jQuery( doc.createElement( name ) ).appendTo( doc.body ),
  4587. display = jQuery.css( elem[ 0 ], "display" );
  4588. // We don't have any data stored on the element,
  4589. // so use "detach" method as fast way to get rid of the element
  4590. elem.detach();
  4591. return display;
  4592. }
  4593. /**
  4594. * Try to determine the default display value of an element
  4595. * @param {String} nodeName
  4596. */
  4597. function defaultDisplay( nodeName ) {
  4598. var doc = document,
  4599. display = elemdisplay[ nodeName ];
  4600. if ( !display ) {
  4601. display = actualDisplay( nodeName, doc );
  4602. // If the simple way fails, read from inside an iframe
  4603. if ( display === "none" || !display ) {
  4604. // Use the already-created iframe if possible
  4605. iframe = ( iframe || jQuery( "<iframe frameborder='0' width='0' height='0'/>" ) )
  4606. .appendTo( doc.documentElement );
  4607. // Always write a new HTML skeleton so Webkit and Firefox don't choke on reuse
  4608. doc = iframe[ 0 ].contentDocument;
  4609. // Support: IE
  4610. doc.write();
  4611. doc.close();
  4612. display = actualDisplay( nodeName, doc );
  4613. iframe.detach();
  4614. }
  4615. // Store the correct default display
  4616. elemdisplay[ nodeName ] = display;
  4617. }
  4618. return display;
  4619. }
  4620. var rmargin = ( /^margin/ );
  4621. var rnumnonpx = new RegExp( "^(" + pnum + ")(?!px)[a-z%]+$", "i" );
  4622. var getStyles = function( elem ) {
  4623. // Support: IE<=11+, Firefox<=30+ (#15098, #14150)
  4624. // IE throws on elements created in popups
  4625. // FF meanwhile throws on frame elements through "defaultView.getComputedStyle"
  4626. var view = elem.ownerDocument.defaultView;
  4627. if ( !view || !view.opener ) {
  4628. view = window;
  4629. }
  4630. return view.getComputedStyle( elem );
  4631. };
  4632. var swap = function( elem, options, callback, args ) {
  4633. var ret, name,
  4634. old = {};
  4635. // Remember the old values, and insert the new ones
  4636. for ( name in options ) {
  4637. old[ name ] = elem.style[ name ];
  4638. elem.style[ name ] = options[ name ];
  4639. }
  4640. ret = callback.apply( elem, args || [] );
  4641. // Revert the old values
  4642. for ( name in options ) {
  4643. elem.style[ name ] = old[ name ];
  4644. }
  4645. return ret;
  4646. };
  4647. var documentElement = document.documentElement;
  4648. ( function() {
  4649. var pixelPositionVal, boxSizingReliableVal, pixelMarginRightVal, reliableMarginLeftVal,
  4650. container = document.createElement( "div" ),
  4651. div = document.createElement( "div" );
  4652. // Finish early in limited (non-browser) environments
  4653. if ( !div.style ) {
  4654. return;
  4655. }
  4656. // Support: IE9-11+
  4657. // Style of cloned element affects source element cloned (#8908)
  4658. div.style.backgroundClip = "content-box";
  4659. div.cloneNode( true ).style.backgroundClip = "";
  4660. support.clearCloneStyle = div.style.backgroundClip === "content-box";
  4661. container.style.cssText = "border:0;width:8px;height:0;top:0;left:-9999px;" +
  4662. "padding:0;margin-top:1px;position:absolute";
  4663. container.appendChild( div );
  4664. // Executing both pixelPosition & boxSizingReliable tests require only one layout
  4665. // so they're executed at the same time to save the second computation.
  4666. function computeStyleTests() {
  4667. div.style.cssText =
  4668. // Support: Firefox<29, Android 2.3
  4669. // Vendor-prefix box-sizing
  4670. "-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;" +
  4671. "position:relative;display:block;" +
  4672. "margin:auto;border:1px;padding:1px;" +
  4673. "top:1%;width:50%";
  4674. div.innerHTML = "";
  4675. documentElement.appendChild( container );
  4676. var divStyle = window.getComputedStyle( div );
  4677. pixelPositionVal = divStyle.top !== "1%";
  4678. reliableMarginLeftVal = divStyle.marginLeft === "2px";
  4679. boxSizingReliableVal = divStyle.width === "4px";
  4680. // Support: Android 4.0 - 4.3 only
  4681. // Some styles come back with percentage values, even though they shouldn't
  4682. div.style.marginRight = "50%";
  4683. pixelMarginRightVal = divStyle.marginRight === "4px";
  4684. documentElement.removeChild( container );
  4685. }
  4686. jQuery.extend( support, {
  4687. pixelPosition: function() {
  4688. // This test is executed only once but we still do memoizing
  4689. // since we can use the boxSizingReliable pre-computing.
  4690. // No need to check if the test was already performed, though.
  4691. computeStyleTests();
  4692. return pixelPositionVal;
  4693. },
  4694. boxSizingReliable: function() {
  4695. if ( boxSizingReliableVal == null ) {
  4696. computeStyleTests();
  4697. }
  4698. return boxSizingReliableVal;
  4699. },
  4700. pixelMarginRight: function() {
  4701. // Support: Android 4.0-4.3
  4702. // We're checking for boxSizingReliableVal here instead of pixelMarginRightVal
  4703. // since that compresses better and they're computed together anyway.
  4704. if ( boxSizingReliableVal == null ) {
  4705. computeStyleTests();
  4706. }
  4707. return pixelMarginRightVal;
  4708. },
  4709. reliableMarginLeft: function() {
  4710. // Support: IE <=8 only, Android 4.0 - 4.3 only, Firefox <=3 - 37
  4711. if ( boxSizingReliableVal == null ) {
  4712. computeStyleTests();
  4713. }
  4714. return reliableMarginLeftVal;
  4715. },
  4716. reliableMarginRight: function() {
  4717. // Support: Android 2.3
  4718. // Check if div with explicit width and no margin-right incorrectly
  4719. // gets computed margin-right based on width of container. (#3333)
  4720. // WebKit Bug 13343 - getComputedStyle returns wrong value for margin-right
  4721. // This support function is only executed once so no memoizing is needed.
  4722. var ret,
  4723. marginDiv = div.appendChild( document.createElement( "div" ) );
  4724. // Reset CSS: box-sizing; display; margin; border; padding
  4725. marginDiv.style.cssText = div.style.cssText =
  4726. // Support: Android 2.3
  4727. // Vendor-prefix box-sizing
  4728. "-webkit-box-sizing:content-box;box-sizing:content-box;" +
  4729. "display:block;margin:0;border:0;padding:0";
  4730. marginDiv.style.marginRight = marginDiv.style.width = "0";
  4731. div.style.width = "1px";
  4732. documentElement.appendChild( container );
  4733. ret = !parseFloat( window.getComputedStyle( marginDiv ).marginRight );
  4734. documentElement.removeChild( container );
  4735. div.removeChild( marginDiv );
  4736. return ret;
  4737. }
  4738. } );
  4739. } )();
  4740. function curCSS( elem, name, computed ) {
  4741. var width, minWidth, maxWidth, ret,
  4742. style = elem.style;
  4743. computed = computed || getStyles( elem );
  4744. ret = computed ? computed.getPropertyValue( name ) || computed[ name ] : undefined;
  4745. // Support: Opera 12.1x only
  4746. // Fall back to style even without computed
  4747. // computed is undefined for elems on document fragments
  4748. if ( ( ret === "" || ret === undefined ) && !jQuery.contains( elem.ownerDocument, elem ) ) {
  4749. ret = jQuery.style( elem, name );
  4750. }
  4751. // Support: IE9
  4752. // getPropertyValue is only needed for .css('filter') (#12537)
  4753. if ( computed ) {
  4754. // A tribute to the "awesome hack by Dean Edwards"
  4755. // Android Browser returns percentage for some values,
  4756. // but width seems to be reliably pixels.
  4757. // This is against the CSSOM draft spec:
  4758. // http://dev.w3.org/csswg/cssom/#resolved-values
  4759. if ( !support.pixelMarginRight() && rnumnonpx.test( ret ) && rmargin.test( name ) ) {
  4760. // Remember the original values
  4761. width = style.width;
  4762. minWidth = style.minWidth;
  4763. maxWidth = style.maxWidth;
  4764. // Put in the new values to get a computed value out
  4765. style.minWidth = style.maxWidth = style.width = ret;
  4766. ret = computed.width;
  4767. // Revert the changed values
  4768. style.width = width;
  4769. style.minWidth = minWidth;
  4770. style.maxWidth = maxWidth;
  4771. }
  4772. }
  4773. return ret !== undefined ?
  4774. // Support: IE9-11+
  4775. // IE returns zIndex value as an integer.
  4776. ret + "" :
  4777. ret;
  4778. }
  4779. function addGetHookIf( conditionFn, hookFn ) {
  4780. // Define the hook, we'll check on the first run if it's really needed.
  4781. return {
  4782. get: function() {
  4783. if ( conditionFn() ) {
  4784. // Hook not needed (or it's not possible to use it due
  4785. // to missing dependency), remove it.
  4786. delete this.get;
  4787. return;
  4788. }
  4789. // Hook needed; redefine it so that the support test is not executed again.
  4790. return ( this.get = hookFn ).apply( this, arguments );
  4791. }
  4792. };
  4793. }
  4794. var
  4795. // Swappable if display is none or starts with table
  4796. // except "table", "table-cell", or "table-caption"
  4797. // See here for display values: https://developer.mozilla.org/en-US/docs/CSS/display
  4798. rdisplayswap = /^(none|table(?!-c[ea]).+)/,
  4799. cssShow = { position: "absolute", visibility: "hidden", display: "block" },
  4800. cssNormalTransform = {
  4801. letterSpacing: "0",
  4802. fontWeight: "400"
  4803. },
  4804. cssPrefixes = [ "Webkit", "O", "Moz", "ms" ],
  4805. emptyStyle = document.createElement( "div" ).style;
  4806. // Return a css property mapped to a potentially vendor prefixed property
  4807. function vendorPropName( name ) {
  4808. // Shortcut for names that are not vendor prefixed
  4809. if ( name in emptyStyle ) {
  4810. return name;
  4811. }
  4812. // Check for vendor prefixed names
  4813. var capName = name[ 0 ].toUpperCase() + name.slice( 1 ),
  4814. i = cssPrefixes.length;
  4815. while ( i-- ) {
  4816. name = cssPrefixes[ i ] + capName;
  4817. if ( name in emptyStyle ) {
  4818. return name;
  4819. }
  4820. }
  4821. }
  4822. function setPositiveNumber( elem, value, subtract ) {
  4823. // Any relative (+/-) values have already been
  4824. // normalized at this point
  4825. var matches = rcssNum.exec( value );
  4826. return matches ?
  4827. // Guard against undefined "subtract", e.g., when used as in cssHooks
  4828. Math.max( 0, matches[ 2 ] - ( subtract || 0 ) ) + ( matches[ 3 ] || "px" ) :
  4829. value;
  4830. }
  4831. function augmentWidthOrHeight( elem, name, extra, isBorderBox, styles ) {
  4832. var i = extra === ( isBorderBox ? "border" : "content" ) ?
  4833. // If we already have the right measurement, avoid augmentation
  4834. 4 :
  4835. // Otherwise initialize for horizontal or vertical properties
  4836. name === "width" ? 1 : 0,
  4837. val = 0;
  4838. for ( ; i < 4; i += 2 ) {
  4839. // Both box models exclude margin, so add it if we want it
  4840. if ( extra === "margin" ) {
  4841. val += jQuery.css( elem, extra + cssExpand[ i ], true, styles );
  4842. }
  4843. if ( isBorderBox ) {
  4844. // border-box includes padding, so remove it if we want content
  4845. if ( extra === "content" ) {
  4846. val -= jQuery.css( elem, "padding" + cssExpand[ i ], true, styles );
  4847. }
  4848. // At this point, extra isn't border nor margin, so remove border
  4849. if ( extra !== "margin" ) {
  4850. val -= jQuery.css( elem, "border" + cssExpand[ i ] + "Width", true, styles );
  4851. }
  4852. } else {
  4853. // At this point, extra isn't content, so add padding
  4854. val += jQuery.css( elem, "padding" + cssExpand[ i ], true, styles );
  4855. // At this point, extra isn't content nor padding, so add border
  4856. if ( extra !== "padding" ) {
  4857. val += jQuery.css( elem, "border" + cssExpand[ i ] + "Width", true, styles );
  4858. }
  4859. }
  4860. }
  4861. return val;
  4862. }
  4863. function getWidthOrHeight( elem, name, extra ) {
  4864. // Start with offset property, which is equivalent to the border-box value
  4865. var valueIsBorderBox = true,
  4866. val = name === "width" ? elem.offsetWidth : elem.offsetHeight,
  4867. styles = getStyles( elem ),
  4868. isBorderBox = jQuery.css( elem, "boxSizing", false, styles ) === "border-box";
  4869. // Support: IE11 only
  4870. // In IE 11 fullscreen elements inside of an iframe have
  4871. // 100x too small dimensions (gh-1764).
  4872. if ( document.msFullscreenElement && window.top !== window ) {
  4873. // Support: IE11 only
  4874. // Running getBoundingClientRect on a disconnected node
  4875. // in IE throws an error.
  4876. if ( elem.getClientRects().length ) {
  4877. val = Math.round( elem.getBoundingClientRect()[ name ] * 100 );
  4878. }
  4879. }
  4880. // Some non-html elements return undefined for offsetWidth, so check for null/undefined
  4881. // svg - https://bugzilla.mozilla.org/show_bug.cgi?id=649285
  4882. // MathML - https://bugzilla.mozilla.org/show_bug.cgi?id=491668
  4883. if ( val <= 0 || val == null ) {
  4884. // Fall back to computed then uncomputed css if necessary
  4885. val = curCSS( elem, name, styles );
  4886. if ( val < 0 || val == null ) {
  4887. val = elem.style[ name ];
  4888. }
  4889. // Computed unit is not pixels. Stop here and return.
  4890. if ( rnumnonpx.test( val ) ) {
  4891. return val;
  4892. }
  4893. // Check for style in case a browser which returns unreliable values
  4894. // for getComputedStyle silently falls back to the reliable elem.style
  4895. valueIsBorderBox = isBorderBox &&
  4896. ( support.boxSizingReliable() || val === elem.style[ name ] );
  4897. // Normalize "", auto, and prepare for extra
  4898. val = parseFloat( val ) || 0;
  4899. }
  4900. // Use the active box-sizing model to add/subtract irrelevant styles
  4901. return ( val +
  4902. augmentWidthOrHeight(
  4903. elem,
  4904. name,
  4905. extra || ( isBorderBox ? "border" : "content" ),
  4906. valueIsBorderBox,
  4907. styles
  4908. )
  4909. ) + "px";
  4910. }
  4911. function showHide( elements, show ) {
  4912. var display, elem, hidden,
  4913. values = [],
  4914. index = 0,
  4915. length = elements.length;
  4916. for ( ; index < length; index++ ) {
  4917. elem = elements[ index ];
  4918. if ( !elem.style ) {
  4919. continue;
  4920. }
  4921. values[ index ] = dataPriv.get( elem, "olddisplay" );
  4922. display = elem.style.display;
  4923. if ( show ) {
  4924. // Reset the inline display of this element to learn if it is
  4925. // being hidden by cascaded rules or not
  4926. if ( !values[ index ] && display === "none" ) {
  4927. elem.style.display = "";
  4928. }
  4929. // Set elements which have been overridden with display: none
  4930. // in a stylesheet to whatever the default browser style is
  4931. // for such an element
  4932. if ( elem.style.display === "" && isHidden( elem ) ) {
  4933. values[ index ] = dataPriv.access(
  4934. elem,
  4935. "olddisplay",
  4936. defaultDisplay( elem.nodeName )
  4937. );
  4938. }
  4939. } else {
  4940. hidden = isHidden( elem );
  4941. if ( display !== "none" || !hidden ) {
  4942. dataPriv.set(
  4943. elem,
  4944. "olddisplay",
  4945. hidden ? display : jQuery.css( elem, "display" )
  4946. );
  4947. }
  4948. }
  4949. }
  4950. // Set the display of most of the elements in a second loop
  4951. // to avoid the constant reflow
  4952. for ( index = 0; index < length; index++ ) {
  4953. elem = elements[ index ];
  4954. if ( !elem.style ) {
  4955. continue;
  4956. }
  4957. if ( !show || elem.style.display === "none" || elem.style.display === "" ) {
  4958. elem.style.display = show ? values[ index ] || "" : "none";
  4959. }
  4960. }
  4961. return elements;
  4962. }
  4963. jQuery.extend( {
  4964. // Add in style property hooks for overriding the default
  4965. // behavior of getting and setting a style property
  4966. cssHooks: {
  4967. opacity: {
  4968. get: function( elem, computed ) {
  4969. if ( computed ) {
  4970. // We should always get a number back from opacity
  4971. var ret = curCSS( elem, "opacity" );
  4972. return ret === "" ? "1" : ret;
  4973. }
  4974. }
  4975. }
  4976. },
  4977. // Don't automatically add "px" to these possibly-unitless properties
  4978. cssNumber: {
  4979. "animationIterationCount": true,
  4980. "columnCount": true,
  4981. "fillOpacity": true,
  4982. "flexGrow": true,
  4983. "flexShrink": true,
  4984. "fontWeight": true,
  4985. "lineHeight": true,
  4986. "opacity": true,
  4987. "order": true,
  4988. "orphans": true,
  4989. "widows": true,
  4990. "zIndex": true,
  4991. "zoom": true
  4992. },
  4993. // Add in properties whose names you wish to fix before
  4994. // setting or getting the value
  4995. cssProps: {
  4996. "float": "cssFloat"
  4997. },
  4998. // Get and set the style property on a DOM Node
  4999. style: function( elem, name, value, extra ) {
  5000. // Don't set styles on text and comment nodes
  5001. if ( !elem || elem.nodeType === 3 || elem.nodeType === 8 || !elem.style ) {
  5002. return;
  5003. }
  5004. // Make sure that we're working with the right name
  5005. var ret, type, hooks,
  5006. origName = jQuery.camelCase( name ),
  5007. style = elem.style;
  5008. name = jQuery.cssProps[ origName ] ||
  5009. ( jQuery.cssProps[ origName ] = vendorPropName( origName ) || origName );
  5010. // Gets hook for the prefixed version, then unprefixed version
  5011. hooks = jQuery.cssHooks[ name ] || jQuery.cssHooks[ origName ];
  5012. // Check if we're setting a value
  5013. if ( value !== undefined ) {
  5014. type = typeof value;
  5015. // Convert "+=" or "-=" to relative numbers (#7345)
  5016. if ( type === "string" && ( ret = rcssNum.exec( value ) ) && ret[ 1 ] ) {
  5017. value = adjustCSS( elem, name, ret );
  5018. // Fixes bug #9237
  5019. type = "number";
  5020. }
  5021. // Make sure that null and NaN values aren't set (#7116)
  5022. if ( value == null || value !== value ) {
  5023. return;
  5024. }
  5025. // If a number was passed in, add the unit (except for certain CSS properties)
  5026. if ( type === "number" ) {
  5027. value += ret && ret[ 3 ] || ( jQuery.cssNumber[ origName ] ? "" : "px" );
  5028. }
  5029. // Support: IE9-11+
  5030. // background-* props affect original clone's values
  5031. if ( !support.clearCloneStyle && value === "" && name.indexOf( "background" ) === 0 ) {
  5032. style[ name ] = "inherit";
  5033. }
  5034. // If a hook was provided, use that value, otherwise just set the specified value
  5035. if ( !hooks || !( "set" in hooks ) ||
  5036. ( value = hooks.set( elem, value, extra ) ) !== undefined ) {
  5037. style[ name ] = value;
  5038. }
  5039. } else {
  5040. // If a hook was provided get the non-computed value from there
  5041. if ( hooks && "get" in hooks &&
  5042. ( ret = hooks.get( elem, false, extra ) ) !== undefined ) {
  5043. return ret;
  5044. }
  5045. // Otherwise just get the value from the style object
  5046. return style[ name ];
  5047. }
  5048. },
  5049. css: function( elem, name, extra, styles ) {
  5050. var val, num, hooks,
  5051. origName = jQuery.camelCase( name );
  5052. // Make sure that we're working with the right name
  5053. name = jQuery.cssProps[ origName ] ||
  5054. ( jQuery.cssProps[ origName ] = vendorPropName( origName ) || origName );
  5055. // Try prefixed name followed by the unprefixed name
  5056. hooks = jQuery.cssHooks[ name ] || jQuery.cssHooks[ origName ];
  5057. // If a hook was provided get the computed value from there
  5058. if ( hooks && "get" in hooks ) {
  5059. val = hooks.get( elem, true, extra );
  5060. }
  5061. // Otherwise, if a way to get the computed value exists, use that
  5062. if ( val === undefined ) {
  5063. val = curCSS( elem, name, styles );
  5064. }
  5065. // Convert "normal" to computed value
  5066. if ( val === "normal" && name in cssNormalTransform ) {
  5067. val = cssNormalTransform[ name ];
  5068. }
  5069. // Make numeric if forced or a qualifier was provided and val looks numeric
  5070. if ( extra === "" || extra ) {
  5071. num = parseFloat( val );
  5072. return extra === true || isFinite( num ) ? num || 0 : val;
  5073. }
  5074. return val;
  5075. }
  5076. } );
  5077. jQuery.each( [ "height", "width" ], function( i, name ) {
  5078. jQuery.cssHooks[ name ] = {
  5079. get: function( elem, computed, extra ) {
  5080. if ( computed ) {
  5081. // Certain elements can have dimension info if we invisibly show them
  5082. // but it must have a current display style that would benefit
  5083. return rdisplayswap.test( jQuery.css( elem, "display" ) ) &&
  5084. elem.offsetWidth === 0 ?
  5085. swap( elem, cssShow, function() {
  5086. return getWidthOrHeight( elem, name, extra );
  5087. } ) :
  5088. getWidthOrHeight( elem, name, extra );
  5089. }
  5090. },
  5091. set: function( elem, value, extra ) {
  5092. var matches,
  5093. styles = extra && getStyles( elem ),
  5094. subtract = extra && augmentWidthOrHeight(
  5095. elem,
  5096. name,
  5097. extra,
  5098. jQuery.css( elem, "boxSizing", false, styles ) === "border-box",
  5099. styles
  5100. );
  5101. // Convert to pixels if value adjustment is needed
  5102. if ( subtract && ( matches = rcssNum.exec( value ) ) &&
  5103. ( matches[ 3 ] || "px" ) !== "px" ) {
  5104. elem.style[ name ] = value;
  5105. value = jQuery.css( elem, name );
  5106. }
  5107. return setPositiveNumber( elem, value, subtract );
  5108. }
  5109. };
  5110. } );
  5111. jQuery.cssHooks.marginLeft = addGetHookIf( support.reliableMarginLeft,
  5112. function( elem, computed ) {
  5113. if ( computed ) {
  5114. return ( parseFloat( curCSS( elem, "marginLeft" ) ) ||
  5115. elem.getBoundingClientRect().left -
  5116. swap( elem, { marginLeft: 0 }, function() {
  5117. return elem.getBoundingClientRect().left;
  5118. } )
  5119. ) + "px";
  5120. }
  5121. }
  5122. );
  5123. // Support: Android 2.3
  5124. jQuery.cssHooks.marginRight = addGetHookIf( support.reliableMarginRight,
  5125. function( elem, computed ) {
  5126. if ( computed ) {
  5127. return swap( elem, { "display": "inline-block" },
  5128. curCSS, [ elem, "marginRight" ] );
  5129. }
  5130. }
  5131. );
  5132. // These hooks are used by animate to expand properties
  5133. jQuery.each( {
  5134. margin: "",
  5135. padding: "",
  5136. border: "Width"
  5137. }, function( prefix, suffix ) {
  5138. jQuery.cssHooks[ prefix + suffix ] = {
  5139. expand: function( value ) {
  5140. var i = 0,
  5141. expanded = {},
  5142. // Assumes a single number if not a string
  5143. parts = typeof value === "string" ? value.split( " " ) : [ value ];
  5144. for ( ; i < 4; i++ ) {
  5145. expanded[ prefix + cssExpand[ i ] + suffix ] =
  5146. parts[ i ] || parts[ i - 2 ] || parts[ 0 ];
  5147. }
  5148. return expanded;
  5149. }
  5150. };
  5151. if ( !rmargin.test( prefix ) ) {
  5152. jQuery.cssHooks[ prefix + suffix ].set = setPositiveNumber;
  5153. }
  5154. } );
  5155. jQuery.fn.extend( {
  5156. css: function( name, value ) {
  5157. return access( this, function( elem, name, value ) {
  5158. var styles, len,
  5159. map = {},
  5160. i = 0;
  5161. if ( jQuery.isArray( name ) ) {
  5162. styles = getStyles( elem );
  5163. len = name.length;
  5164. for ( ; i < len; i++ ) {
  5165. map[ name[ i ] ] = jQuery.css( elem, name[ i ], false, styles );
  5166. }
  5167. return map;
  5168. }
  5169. return value !== undefined ?
  5170. jQuery.style( elem, name, value ) :
  5171. jQuery.css( elem, name );
  5172. }, name, value, arguments.length > 1 );
  5173. },
  5174. show: function() {
  5175. return showHide( this, true );
  5176. },
  5177. hide: function() {
  5178. return showHide( this );
  5179. },
  5180. toggle: function( state ) {
  5181. if ( typeof state === "boolean" ) {
  5182. return state ? this.show() : this.hide();
  5183. }
  5184. return this.each( function() {
  5185. if ( isHidden( this ) ) {
  5186. jQuery( this ).show();
  5187. } else {
  5188. jQuery( this ).hide();
  5189. }
  5190. } );
  5191. }
  5192. } );
  5193. function Tween( elem, options, prop, end, easing ) {
  5194. return new Tween.prototype.init( elem, options, prop, end, easing );
  5195. }
  5196. jQuery.Tween = Tween;
  5197. Tween.prototype = {
  5198. constructor: Tween,
  5199. init: function( elem, options, prop, end, easing, unit ) {
  5200. this.elem = elem;
  5201. this.prop = prop;
  5202. this.easing = easing || jQuery.easing._default;
  5203. this.options = options;
  5204. this.start = this.now = this.cur();
  5205. this.end = end;
  5206. this.unit = unit || ( jQuery.cssNumber[ prop ] ? "" : "px" );
  5207. },
  5208. cur: function() {
  5209. var hooks = Tween.propHooks[ this.prop ];
  5210. return hooks && hooks.get ?
  5211. hooks.get( this ) :
  5212. Tween.propHooks._default.get( this );
  5213. },
  5214. run: function( percent ) {
  5215. var eased,
  5216. hooks = Tween.propHooks[ this.prop ];
  5217. if ( this.options.duration ) {
  5218. this.pos = eased = jQuery.easing[ this.easing ](
  5219. percent, this.options.duration * percent, 0, 1, this.options.duration
  5220. );
  5221. } else {
  5222. this.pos = eased = percent;
  5223. }
  5224. this.now = ( this.end - this.start ) * eased + this.start;
  5225. if ( this.options.step ) {
  5226. this.options.step.call( this.elem, this.now, this );
  5227. }
  5228. if ( hooks && hooks.set ) {
  5229. hooks.set( this );
  5230. } else {
  5231. Tween.propHooks._default.set( this );
  5232. }
  5233. return this;
  5234. }
  5235. };
  5236. Tween.prototype.init.prototype = Tween.prototype;
  5237. Tween.propHooks = {
  5238. _default: {
  5239. get: function( tween ) {
  5240. var result;
  5241. // Use a property on the element directly when it is not a DOM element,
  5242. // or when there is no matching style property that exists.
  5243. if ( tween.elem.nodeType !== 1 ||
  5244. tween.elem[ tween.prop ] != null && tween.elem.style[ tween.prop ] == null ) {
  5245. return tween.elem[ tween.prop ];
  5246. }
  5247. // Passing an empty string as a 3rd parameter to .css will automatically
  5248. // attempt a parseFloat and fallback to a string if the parse fails.
  5249. // Simple values such as "10px" are parsed to Float;
  5250. // complex values such as "rotate(1rad)" are returned as-is.
  5251. result = jQuery.css( tween.elem, tween.prop, "" );
  5252. // Empty strings, null, undefined and "auto" are converted to 0.
  5253. return !result || result === "auto" ? 0 : result;
  5254. },
  5255. set: function( tween ) {
  5256. // Use step hook for back compat.
  5257. // Use cssHook if its there.
  5258. // Use .style if available and use plain properties where available.
  5259. if ( jQuery.fx.step[ tween.prop ] ) {
  5260. jQuery.fx.step[ tween.prop ]( tween );
  5261. } else if ( tween.elem.nodeType === 1 &&
  5262. ( tween.elem.style[ jQuery.cssProps[ tween.prop ] ] != null ||
  5263. jQuery.cssHooks[ tween.prop ] ) ) {
  5264. jQuery.style( tween.elem, tween.prop, tween.now + tween.unit );
  5265. } else {
  5266. tween.elem[ tween.prop ] = tween.now;
  5267. }
  5268. }
  5269. }
  5270. };
  5271. // Support: IE9
  5272. // Panic based approach to setting things on disconnected nodes
  5273. Tween.propHooks.scrollTop = Tween.propHooks.scrollLeft = {
  5274. set: function( tween ) {
  5275. if ( tween.elem.nodeType && tween.elem.parentNode ) {
  5276. tween.elem[ tween.prop ] = tween.now;
  5277. }
  5278. }
  5279. };
  5280. jQuery.easing = {
  5281. linear: function( p ) {
  5282. return p;
  5283. },
  5284. swing: function( p ) {
  5285. return 0.5 - Math.cos( p * Math.PI ) / 2;
  5286. },
  5287. _default: "swing"
  5288. };
  5289. jQuery.fx = Tween.prototype.init;
  5290. // Back Compat <1.8 extension point
  5291. jQuery.fx.step = {};
  5292. var
  5293. fxNow, timerId,
  5294. rfxtypes = /^(?:toggle|show|hide)$/,
  5295. rrun = /queueHooks$/;
  5296. // Animations created synchronously will run synchronously
  5297. function createFxNow() {
  5298. window.setTimeout( function() {
  5299. fxNow = undefined;
  5300. } );
  5301. return ( fxNow = jQuery.now() );
  5302. }
  5303. // Generate parameters to create a standard animation
  5304. function genFx( type, includeWidth ) {
  5305. var which,
  5306. i = 0,
  5307. attrs = { height: type };
  5308. // If we include width, step value is 1 to do all cssExpand values,
  5309. // otherwise step value is 2 to skip over Left and Right
  5310. includeWidth = includeWidth ? 1 : 0;
  5311. for ( ; i < 4 ; i += 2 - includeWidth ) {
  5312. which = cssExpand[ i ];
  5313. attrs[ "margin" + which ] = attrs[ "padding" + which ] = type;
  5314. }
  5315. if ( includeWidth ) {
  5316. attrs.opacity = attrs.width = type;
  5317. }
  5318. return attrs;
  5319. }
  5320. function createTween( value, prop, animation ) {
  5321. var tween,
  5322. collection = ( Animation.tweeners[ prop ] || [] ).concat( Animation.tweeners[ "*" ] ),
  5323. index = 0,
  5324. length = collection.length;
  5325. for ( ; index < length; index++ ) {
  5326. if ( ( tween = collection[ index ].call( animation, prop, value ) ) ) {
  5327. // We're done with this property
  5328. return tween;
  5329. }
  5330. }
  5331. }
  5332. function defaultPrefilter( elem, props, opts ) {
  5333. /* jshint validthis: true */
  5334. var prop, value, toggle, tween, hooks, oldfire, display, checkDisplay,
  5335. anim = this,
  5336. orig = {},
  5337. style = elem.style,
  5338. hidden = elem.nodeType && isHidden( elem ),
  5339. dataShow = dataPriv.get( elem, "fxshow" );
  5340. // Handle queue: false promises
  5341. if ( !opts.queue ) {
  5342. hooks = jQuery._queueHooks( elem, "fx" );
  5343. if ( hooks.unqueued == null ) {
  5344. hooks.unqueued = 0;
  5345. oldfire = hooks.empty.fire;
  5346. hooks.empty.fire = function() {
  5347. if ( !hooks.unqueued ) {
  5348. oldfire();
  5349. }
  5350. };
  5351. }
  5352. hooks.unqueued++;
  5353. anim.always( function() {
  5354. // Ensure the complete handler is called before this completes
  5355. anim.always( function() {
  5356. hooks.unqueued--;
  5357. if ( !jQuery.queue( elem, "fx" ).length ) {
  5358. hooks.empty.fire();
  5359. }
  5360. } );
  5361. } );
  5362. }
  5363. // Height/width overflow pass
  5364. if ( elem.nodeType === 1 && ( "height" in props || "width" in props ) ) {
  5365. // Make sure that nothing sneaks out
  5366. // Record all 3 overflow attributes because IE9-10 do not
  5367. // change the overflow attribute when overflowX and
  5368. // overflowY are set to the same value
  5369. opts.overflow = [ style.overflow, style.overflowX, style.overflowY ];
  5370. // Set display property to inline-block for height/width
  5371. // animations on inline elements that are having width/height animated
  5372. display = jQuery.css( elem, "display" );
  5373. // Test default display if display is currently "none"
  5374. checkDisplay = display === "none" ?
  5375. dataPriv.get( elem, "olddisplay" ) || defaultDisplay( elem.nodeName ) : display;
  5376. if ( checkDisplay === "inline" && jQuery.css( elem, "float" ) === "none" ) {
  5377. style.display = "inline-block";
  5378. }
  5379. }
  5380. if ( opts.overflow ) {
  5381. style.overflow = "hidden";
  5382. anim.always( function() {
  5383. style.overflow = opts.overflow[ 0 ];
  5384. style.overflowX = opts.overflow[ 1 ];
  5385. style.overflowY = opts.overflow[ 2 ];
  5386. } );
  5387. }
  5388. // show/hide pass
  5389. for ( prop in props ) {
  5390. value = props[ prop ];
  5391. if ( rfxtypes.exec( value ) ) {
  5392. delete props[ prop ];
  5393. toggle = toggle || value === "toggle";
  5394. if ( value === ( hidden ? "hide" : "show" ) ) {
  5395. // If there is dataShow left over from a stopped hide or show
  5396. // and we are going to proceed with show, we should pretend to be hidden
  5397. if ( value === "show" && dataShow && dataShow[ prop ] !== undefined ) {
  5398. hidden = true;
  5399. } else {
  5400. continue;
  5401. }
  5402. }
  5403. orig[ prop ] = dataShow && dataShow[ prop ] || jQuery.style( elem, prop );
  5404. // Any non-fx value stops us from restoring the original display value
  5405. } else {
  5406. display = undefined;
  5407. }
  5408. }
  5409. if ( !jQuery.isEmptyObject( orig ) ) {
  5410. if ( dataShow ) {
  5411. if ( "hidden" in dataShow ) {
  5412. hidden = dataShow.hidden;
  5413. }
  5414. } else {
  5415. dataShow = dataPriv.access( elem, "fxshow", {} );
  5416. }
  5417. // Store state if its toggle - enables .stop().toggle() to "reverse"
  5418. if ( toggle ) {
  5419. dataShow.hidden = !hidden;
  5420. }
  5421. if ( hidden ) {
  5422. jQuery( elem ).show();
  5423. } else {
  5424. anim.done( function() {
  5425. jQuery( elem ).hide();
  5426. } );
  5427. }
  5428. anim.done( function() {
  5429. var prop;
  5430. dataPriv.remove( elem, "fxshow" );
  5431. for ( prop in orig ) {
  5432. jQuery.style( elem, prop, orig[ prop ] );
  5433. }
  5434. } );
  5435. for ( prop in orig ) {
  5436. tween = createTween( hidden ? dataShow[ prop ] : 0, prop, anim );
  5437. if ( !( prop in dataShow ) ) {
  5438. dataShow[ prop ] = tween.start;
  5439. if ( hidden ) {
  5440. tween.end = tween.start;
  5441. tween.start = prop === "width" || prop === "height" ? 1 : 0;
  5442. }
  5443. }
  5444. }
  5445. // If this is a noop like .hide().hide(), restore an overwritten display value
  5446. } else if ( ( display === "none" ? defaultDisplay( elem.nodeName ) : display ) === "inline" ) {
  5447. style.display = display;
  5448. }
  5449. }
  5450. function propFilter( props, specialEasing ) {
  5451. var index, name, easing, value, hooks;
  5452. // camelCase, specialEasing and expand cssHook pass
  5453. for ( index in props ) {
  5454. name = jQuery.camelCase( index );
  5455. easing = specialEasing[ name ];
  5456. value = props[ index ];
  5457. if ( jQuery.isArray( value ) ) {
  5458. easing = value[ 1 ];
  5459. value = props[ index ] = value[ 0 ];
  5460. }
  5461. if ( index !== name ) {
  5462. props[ name ] = value;
  5463. delete props[ index ];
  5464. }
  5465. hooks = jQuery.cssHooks[ name ];
  5466. if ( hooks && "expand" in hooks ) {
  5467. value = hooks.expand( value );
  5468. delete props[ name ];
  5469. // Not quite $.extend, this won't overwrite existing keys.
  5470. // Reusing 'index' because we have the correct "name"
  5471. for ( index in value ) {
  5472. if ( !( index in props ) ) {
  5473. props[ index ] = value[ index ];
  5474. specialEasing[ index ] = easing;
  5475. }
  5476. }
  5477. } else {
  5478. specialEasing[ name ] = easing;
  5479. }
  5480. }
  5481. }
  5482. function Animation( elem, properties, options ) {
  5483. var result,
  5484. stopped,
  5485. index = 0,
  5486. length = Animation.prefilters.length,
  5487. deferred = jQuery.Deferred().always( function() {
  5488. // Don't match elem in the :animated selector
  5489. delete tick.elem;
  5490. } ),
  5491. tick = function() {
  5492. if ( stopped ) {
  5493. return false;
  5494. }
  5495. var currentTime = fxNow || createFxNow(),
  5496. remaining = Math.max( 0, animation.startTime + animation.duration - currentTime ),
  5497. // Support: Android 2.3
  5498. // Archaic crash bug won't allow us to use `1 - ( 0.5 || 0 )` (#12497)
  5499. temp = remaining / animation.duration || 0,
  5500. percent = 1 - temp,
  5501. index = 0,
  5502. length = animation.tweens.length;
  5503. for ( ; index < length ; index++ ) {
  5504. animation.tweens[ index ].run( percent );
  5505. }
  5506. deferred.notifyWith( elem, [ animation, percent, remaining ] );
  5507. if ( percent < 1 && length ) {
  5508. return remaining;
  5509. } else {
  5510. deferred.resolveWith( elem, [ animation ] );
  5511. return false;
  5512. }
  5513. },
  5514. animation = deferred.promise( {
  5515. elem: elem,
  5516. props: jQuery.extend( {}, properties ),
  5517. opts: jQuery.extend( true, {
  5518. specialEasing: {},
  5519. easing: jQuery.easing._default
  5520. }, options ),
  5521. originalProperties: properties,
  5522. originalOptions: options,
  5523. startTime: fxNow || createFxNow(),
  5524. duration: options.duration,
  5525. tweens: [],
  5526. createTween: function( prop, end ) {
  5527. var tween = jQuery.Tween( elem, animation.opts, prop, end,
  5528. animation.opts.specialEasing[ prop ] || animation.opts.easing );
  5529. animation.tweens.push( tween );
  5530. return tween;
  5531. },
  5532. stop: function( gotoEnd ) {
  5533. var index = 0,
  5534. // If we are going to the end, we want to run all the tweens
  5535. // otherwise we skip this part
  5536. length = gotoEnd ? animation.tweens.length : 0;
  5537. if ( stopped ) {
  5538. return this;
  5539. }
  5540. stopped = true;
  5541. for ( ; index < length ; index++ ) {
  5542. animation.tweens[ index ].run( 1 );
  5543. }
  5544. // Resolve when we played the last frame; otherwise, reject
  5545. if ( gotoEnd ) {
  5546. deferred.notifyWith( elem, [ animation, 1, 0 ] );
  5547. deferred.resolveWith( elem, [ animation, gotoEnd ] );
  5548. } else {
  5549. deferred.rejectWith( elem, [ animation, gotoEnd ] );
  5550. }
  5551. return this;
  5552. }
  5553. } ),
  5554. props = animation.props;
  5555. propFilter( props, animation.opts.specialEasing );
  5556. for ( ; index < length ; index++ ) {
  5557. result = Animation.prefilters[ index ].call( animation, elem, props, animation.opts );
  5558. if ( result ) {
  5559. if ( jQuery.isFunction( result.stop ) ) {
  5560. jQuery._queueHooks( animation.elem, animation.opts.queue ).stop =
  5561. jQuery.proxy( result.stop, result );
  5562. }
  5563. return result;
  5564. }
  5565. }
  5566. jQuery.map( props, createTween, animation );
  5567. if ( jQuery.isFunction( animation.opts.start ) ) {
  5568. animation.opts.start.call( elem, animation );
  5569. }
  5570. jQuery.fx.timer(
  5571. jQuery.extend( tick, {
  5572. elem: elem,
  5573. anim: animation,
  5574. queue: animation.opts.queue
  5575. } )
  5576. );
  5577. // attach callbacks from options
  5578. return animation.progress( animation.opts.progress )
  5579. .done( animation.opts.done, animation.opts.complete )
  5580. .fail( animation.opts.fail )
  5581. .always( animation.opts.always );
  5582. }
  5583. jQuery.Animation = jQuery.extend( Animation, {
  5584. tweeners: {
  5585. "*": [ function( prop, value ) {
  5586. var tween = this.createTween( prop, value );
  5587. adjustCSS( tween.elem, prop, rcssNum.exec( value ), tween );
  5588. return tween;
  5589. } ]
  5590. },
  5591. tweener: function( props, callback ) {
  5592. if ( jQuery.isFunction( props ) ) {
  5593. callback = props;
  5594. props = [ "*" ];
  5595. } else {
  5596. props = props.match( rnotwhite );
  5597. }
  5598. var prop,
  5599. index = 0,
  5600. length = props.length;
  5601. for ( ; index < length ; index++ ) {
  5602. prop = props[ index ];
  5603. Animation.tweeners[ prop ] = Animation.tweeners[ prop ] || [];
  5604. Animation.tweeners[ prop ].unshift( callback );
  5605. }
  5606. },
  5607. prefilters: [ defaultPrefilter ],
  5608. prefilter: function( callback, prepend ) {
  5609. if ( prepend ) {
  5610. Animation.prefilters.unshift( callback );
  5611. } else {
  5612. Animation.prefilters.push( callback );
  5613. }
  5614. }
  5615. } );
  5616. jQuery.speed = function( speed, easing, fn ) {
  5617. var opt = speed && typeof speed === "object" ? jQuery.extend( {}, speed ) : {
  5618. complete: fn || !fn && easing ||
  5619. jQuery.isFunction( speed ) && speed,
  5620. duration: speed,
  5621. easing: fn && easing || easing && !jQuery.isFunction( easing ) && easing
  5622. };
  5623. opt.duration = jQuery.fx.off ? 0 : typeof opt.duration === "number" ?
  5624. opt.duration : opt.duration in jQuery.fx.speeds ?
  5625. jQuery.fx.speeds[ opt.duration ] : jQuery.fx.speeds._default;
  5626. // Normalize opt.queue - true/undefined/null -> "fx"
  5627. if ( opt.queue == null || opt.queue === true ) {
  5628. opt.queue = "fx";
  5629. }
  5630. // Queueing
  5631. opt.old = opt.complete;
  5632. opt.complete = function() {
  5633. if ( jQuery.isFunction( opt.old ) ) {
  5634. opt.old.call( this );
  5635. }
  5636. if ( opt.queue ) {
  5637. jQuery.dequeue( this, opt.queue );
  5638. }
  5639. };
  5640. return opt;
  5641. };
  5642. jQuery.fn.extend( {
  5643. fadeTo: function( speed, to, easing, callback ) {
  5644. // Show any hidden elements after setting opacity to 0
  5645. return this.filter( isHidden ).css( "opacity", 0 ).show()
  5646. // Animate to the value specified
  5647. .end().animate( { opacity: to }, speed, easing, callback );
  5648. },
  5649. animate: function( prop, speed, easing, callback ) {
  5650. var empty = jQuery.isEmptyObject( prop ),
  5651. optall = jQuery.speed( speed, easing, callback ),
  5652. doAnimation = function() {
  5653. // Operate on a copy of prop so per-property easing won't be lost
  5654. var anim = Animation( this, jQuery.extend( {}, prop ), optall );
  5655. // Empty animations, or finishing resolves immediately
  5656. if ( empty || dataPriv.get( this, "finish" ) ) {
  5657. anim.stop( true );
  5658. }
  5659. };
  5660. doAnimation.finish = doAnimation;
  5661. return empty || optall.queue === false ?
  5662. this.each( doAnimation ) :
  5663. this.queue( optall.queue, doAnimation );
  5664. },
  5665. stop: function( type, clearQueue, gotoEnd ) {
  5666. var stopQueue = function( hooks ) {
  5667. var stop = hooks.stop;
  5668. delete hooks.stop;
  5669. stop( gotoEnd );
  5670. };
  5671. if ( typeof type !== "string" ) {
  5672. gotoEnd = clearQueue;
  5673. clearQueue = type;
  5674. type = undefined;
  5675. }
  5676. if ( clearQueue && type !== false ) {
  5677. this.queue( type || "fx", [] );
  5678. }
  5679. return this.each( function() {
  5680. var dequeue = true,
  5681. index = type != null && type + "queueHooks",
  5682. timers = jQuery.timers,
  5683. data = dataPriv.get( this );
  5684. if ( index ) {
  5685. if ( data[ index ] && data[ index ].stop ) {
  5686. stopQueue( data[ index ] );
  5687. }
  5688. } else {
  5689. for ( index in data ) {
  5690. if ( data[ index ] && data[ index ].stop && rrun.test( index ) ) {
  5691. stopQueue( data[ index ] );
  5692. }
  5693. }
  5694. }
  5695. for ( index = timers.length; index--; ) {
  5696. if ( timers[ index ].elem === this &&
  5697. ( type == null || timers[ index ].queue === type ) ) {
  5698. timers[ index ].anim.stop( gotoEnd );
  5699. dequeue = false;
  5700. timers.splice( index, 1 );
  5701. }
  5702. }
  5703. // Start the next in the queue if the last step wasn't forced.
  5704. // Timers currently will call their complete callbacks, which
  5705. // will dequeue but only if they were gotoEnd.
  5706. if ( dequeue || !gotoEnd ) {
  5707. jQuery.dequeue( this, type );
  5708. }
  5709. } );
  5710. },
  5711. finish: function( type ) {
  5712. if ( type !== false ) {
  5713. type = type || "fx";
  5714. }
  5715. return this.each( function() {
  5716. var index,
  5717. data = dataPriv.get( this ),
  5718. queue = data[ type + "queue" ],
  5719. hooks = data[ type + "queueHooks" ],
  5720. timers = jQuery.timers,
  5721. length = queue ? queue.length : 0;
  5722. // Enable finishing flag on private data
  5723. data.finish = true;
  5724. // Empty the queue first
  5725. jQuery.queue( this, type, [] );
  5726. if ( hooks && hooks.stop ) {
  5727. hooks.stop.call( this, true );
  5728. }
  5729. // Look for any active animations, and finish them
  5730. for ( index = timers.length; index--; ) {
  5731. if ( timers[ index ].elem === this && timers[ index ].queue === type ) {
  5732. timers[ index ].anim.stop( true );
  5733. timers.splice( index, 1 );
  5734. }
  5735. }
  5736. // Look for any animations in the old queue and finish them
  5737. for ( index = 0; index < length; index++ ) {
  5738. if ( queue[ index ] && queue[ index ].finish ) {
  5739. queue[ index ].finish.call( this );
  5740. }
  5741. }
  5742. // Turn off finishing flag
  5743. delete data.finish;
  5744. } );
  5745. }
  5746. } );
  5747. jQuery.each( [ "toggle", "show", "hide" ], function( i, name ) {
  5748. var cssFn = jQuery.fn[ name ];
  5749. jQuery.fn[ name ] = function( speed, easing, callback ) {
  5750. return speed == null || typeof speed === "boolean" ?
  5751. cssFn.apply( this, arguments ) :
  5752. this.animate( genFx( name, true ), speed, easing, callback );
  5753. };
  5754. } );
  5755. // Generate shortcuts for custom animations
  5756. jQuery.each( {
  5757. slideDown: genFx( "show" ),
  5758. slideUp: genFx( "hide" ),
  5759. slideToggle: genFx( "toggle" ),
  5760. fadeIn: { opacity: "show" },
  5761. fadeOut: { opacity: "hide" },
  5762. fadeToggle: { opacity: "toggle" }
  5763. }, function( name, props ) {
  5764. jQuery.fn[ name ] = function( speed, easing, callback ) {
  5765. return this.animate( props, speed, easing, callback );
  5766. };
  5767. } );
  5768. jQuery.timers = [];
  5769. jQuery.fx.tick = function() {
  5770. var timer,
  5771. i = 0,
  5772. timers = jQuery.timers;
  5773. fxNow = jQuery.now();
  5774. for ( ; i < timers.length; i++ ) {
  5775. timer = timers[ i ];
  5776. // Checks the timer has not already been removed
  5777. if ( !timer() && timers[ i ] === timer ) {
  5778. timers.splice( i--, 1 );
  5779. }
  5780. }
  5781. if ( !timers.length ) {
  5782. jQuery.fx.stop();
  5783. }
  5784. fxNow = undefined;
  5785. };
  5786. jQuery.fx.timer = function( timer ) {
  5787. jQuery.timers.push( timer );
  5788. if ( timer() ) {
  5789. jQuery.fx.start();
  5790. } else {
  5791. jQuery.timers.pop();
  5792. }
  5793. };
  5794. jQuery.fx.interval = 13;
  5795. jQuery.fx.start = function() {
  5796. if ( !timerId ) {
  5797. timerId = window.setInterval( jQuery.fx.tick, jQuery.fx.interval );
  5798. }
  5799. };
  5800. jQuery.fx.stop = function() {
  5801. window.clearInterval( timerId );
  5802. timerId = null;
  5803. };
  5804. jQuery.fx.speeds = {
  5805. slow: 600,
  5806. fast: 200,
  5807. // Default speed
  5808. _default: 400
  5809. };
  5810. // Based off of the plugin by Clint Helfers, with permission.
  5811. // http://web.archive.org/web/20100324014747/http://blindsignals.com/index.php/2009/07/jquery-delay/
  5812. jQuery.fn.delay = function( time, type ) {
  5813. time = jQuery.fx ? jQuery.fx.speeds[ time ] || time : time;
  5814. type = type || "fx";
  5815. return this.queue( type, function( next, hooks ) {
  5816. var timeout = window.setTimeout( next, time );
  5817. hooks.stop = function() {
  5818. window.clearTimeout( timeout );
  5819. };
  5820. } );
  5821. };
  5822. ( function() {
  5823. var input = document.createElement( "input" ),
  5824. select = document.createElement( "select" ),
  5825. opt = select.appendChild( document.createElement( "option" ) );
  5826. input.type = "checkbox";
  5827. // Support: iOS<=5.1, Android<=4.2+
  5828. // Default value for a checkbox should be "on"
  5829. support.checkOn = input.value !== "";
  5830. // Support: IE<=11+
  5831. // Must access selectedIndex to make default options select
  5832. support.optSelected = opt.selected;
  5833. // Support: Android<=2.3
  5834. // Options inside disabled selects are incorrectly marked as disabled
  5835. select.disabled = true;
  5836. support.optDisabled = !opt.disabled;
  5837. // Support: IE<=11+
  5838. // An input loses its value after becoming a radio
  5839. input = document.createElement( "input" );
  5840. input.value = "t";
  5841. input.type = "radio";
  5842. support.radioValue = input.value === "t";
  5843. } )();
  5844. var boolHook,
  5845. attrHandle = jQuery.expr.attrHandle;
  5846. jQuery.fn.extend( {
  5847. attr: function( name, value ) {
  5848. return access( this, jQuery.attr, name, value, arguments.length > 1 );
  5849. },
  5850. removeAttr: function( name ) {
  5851. return this.each( function() {
  5852. jQuery.removeAttr( this, name );
  5853. } );
  5854. }
  5855. } );
  5856. jQuery.extend( {
  5857. attr: function( elem, name, value ) {
  5858. var ret, hooks,
  5859. nType = elem.nodeType;
  5860. // Don't get/set attributes on text, comment and attribute nodes
  5861. if ( nType === 3 || nType === 8 || nType === 2 ) {
  5862. return;
  5863. }
  5864. // Fallback to prop when attributes are not supported
  5865. if ( typeof elem.getAttribute === "undefined" ) {
  5866. return jQuery.prop( elem, name, value );
  5867. }
  5868. // All attributes are lowercase
  5869. // Grab necessary hook if one is defined
  5870. if ( nType !== 1 || !jQuery.isXMLDoc( elem ) ) {
  5871. name = name.toLowerCase();
  5872. hooks = jQuery.attrHooks[ name ] ||
  5873. ( jQuery.expr.match.bool.test( name ) ? boolHook : undefined );
  5874. }
  5875. if ( value !== undefined ) {
  5876. if ( value === null ) {
  5877. jQuery.removeAttr( elem, name );
  5878. return;
  5879. }
  5880. if ( hooks && "set" in hooks &&
  5881. ( ret = hooks.set( elem, value, name ) ) !== undefined ) {
  5882. return ret;
  5883. }
  5884. elem.setAttribute( name, value + "" );
  5885. return value;
  5886. }
  5887. if ( hooks && "get" in hooks && ( ret = hooks.get( elem, name ) ) !== null ) {
  5888. return ret;
  5889. }
  5890. ret = jQuery.find.attr( elem, name );
  5891. // Non-existent attributes return null, we normalize to undefined
  5892. return ret == null ? undefined : ret;
  5893. },
  5894. attrHooks: {
  5895. type: {
  5896. set: function( elem, value ) {
  5897. if ( !support.radioValue && value === "radio" &&
  5898. jQuery.nodeName( elem, "input" ) ) {
  5899. var val = elem.value;
  5900. elem.setAttribute( "type", value );
  5901. if ( val ) {
  5902. elem.value = val;
  5903. }
  5904. return value;
  5905. }
  5906. }
  5907. }
  5908. },
  5909. removeAttr: function( elem, value ) {
  5910. var name, propName,
  5911. i = 0,
  5912. attrNames = value && value.match( rnotwhite );
  5913. if ( attrNames && elem.nodeType === 1 ) {
  5914. while ( ( name = attrNames[ i++ ] ) ) {
  5915. propName = jQuery.propFix[ name ] || name;
  5916. // Boolean attributes get special treatment (#10870)
  5917. if ( jQuery.expr.match.bool.test( name ) ) {
  5918. // Set corresponding property to false
  5919. elem[ propName ] = false;
  5920. }
  5921. elem.removeAttribute( name );
  5922. }
  5923. }
  5924. }
  5925. } );
  5926. // Hooks for boolean attributes
  5927. boolHook = {
  5928. set: function( elem, value, name ) {
  5929. if ( value === false ) {
  5930. // Remove boolean attributes when set to false
  5931. jQuery.removeAttr( elem, name );
  5932. } else {
  5933. elem.setAttribute( name, name );
  5934. }
  5935. return name;
  5936. }
  5937. };
  5938. jQuery.each( jQuery.expr.match.bool.source.match( /\w+/g ), function( i, name ) {
  5939. var getter = attrHandle[ name ] || jQuery.find.attr;
  5940. attrHandle[ name ] = function( elem, name, isXML ) {
  5941. var ret, handle;
  5942. if ( !isXML ) {
  5943. // Avoid an infinite loop by temporarily removing this function from the getter
  5944. handle = attrHandle[ name ];
  5945. attrHandle[ name ] = ret;
  5946. ret = getter( elem, name, isXML ) != null ?
  5947. name.toLowerCase() :
  5948. null;
  5949. attrHandle[ name ] = handle;
  5950. }
  5951. return ret;
  5952. };
  5953. } );
  5954. var rfocusable = /^(?:input|select|textarea|button)$/i,
  5955. rclickable = /^(?:a|area)$/i;
  5956. jQuery.fn.extend( {
  5957. prop: function( name, value ) {
  5958. return access( this, jQuery.prop, name, value, arguments.length > 1 );
  5959. },
  5960. removeProp: function( name ) {
  5961. return this.each( function() {
  5962. delete this[ jQuery.propFix[ name ] || name ];
  5963. } );
  5964. }
  5965. } );
  5966. jQuery.extend( {
  5967. prop: function( elem, name, value ) {
  5968. var ret, hooks,
  5969. nType = elem.nodeType;
  5970. // Don't get/set properties on text, comment and attribute nodes
  5971. if ( nType === 3 || nType === 8 || nType === 2 ) {
  5972. return;
  5973. }
  5974. if ( nType !== 1 || !jQuery.isXMLDoc( elem ) ) {
  5975. // Fix name and attach hooks
  5976. name = jQuery.propFix[ name ] || name;
  5977. hooks = jQuery.propHooks[ name ];
  5978. }
  5979. if ( value !== undefined ) {
  5980. if ( hooks && "set" in hooks &&
  5981. ( ret = hooks.set( elem, value, name ) ) !== undefined ) {
  5982. return ret;
  5983. }
  5984. return ( elem[ name ] = value );
  5985. }
  5986. if ( hooks && "get" in hooks && ( ret = hooks.get( elem, name ) ) !== null ) {
  5987. return ret;
  5988. }
  5989. return elem[ name ];
  5990. },
  5991. propHooks: {
  5992. tabIndex: {
  5993. get: function( elem ) {
  5994. // elem.tabIndex doesn't always return the
  5995. // correct value when it hasn't been explicitly set
  5996. // http://fluidproject.org/blog/2008/01/09/getting-setting-and-removing-tabindex-values-with-javascript/
  5997. // Use proper attribute retrieval(#12072)
  5998. var tabindex = jQuery.find.attr( elem, "tabindex" );
  5999. return tabindex ?
  6000. parseInt( tabindex, 10 ) :
  6001. rfocusable.test( elem.nodeName ) ||
  6002. rclickable.test( elem.nodeName ) && elem.href ?
  6003. 0 :
  6004. -1;
  6005. }
  6006. }
  6007. },
  6008. propFix: {
  6009. "for": "htmlFor",
  6010. "class": "className"
  6011. }
  6012. } );
  6013. if ( !support.optSelected ) {
  6014. jQuery.propHooks.selected = {
  6015. get: function( elem ) {
  6016. var parent = elem.parentNode;
  6017. if ( parent && parent.parentNode ) {
  6018. parent.parentNode.selectedIndex;
  6019. }
  6020. return null;
  6021. }
  6022. };
  6023. }
  6024. jQuery.each( [
  6025. "tabIndex",
  6026. "readOnly",
  6027. "maxLength",
  6028. "cellSpacing",
  6029. "cellPadding",
  6030. "rowSpan",
  6031. "colSpan",
  6032. "useMap",
  6033. "frameBorder",
  6034. "contentEditable"
  6035. ], function() {
  6036. jQuery.propFix[ this.toLowerCase() ] = this;
  6037. } );
  6038. var rclass = /[\t\r\n\f]/g;
  6039. function getClass( elem ) {
  6040. return elem.getAttribute && elem.getAttribute( "class" ) || "";
  6041. }
  6042. jQuery.fn.extend( {
  6043. addClass: function( value ) {
  6044. var classes, elem, cur, curValue, clazz, j, finalValue,
  6045. i = 0;
  6046. if ( jQuery.isFunction( value ) ) {
  6047. return this.each( function( j ) {
  6048. jQuery( this ).addClass( value.call( this, j, getClass( this ) ) );
  6049. } );
  6050. }
  6051. if ( typeof value === "string" && value ) {
  6052. classes = value.match( rnotwhite ) || [];
  6053. while ( ( elem = this[ i++ ] ) ) {
  6054. curValue = getClass( elem );
  6055. cur = elem.nodeType === 1 &&
  6056. ( " " + curValue + " " ).replace( rclass, " " );
  6057. if ( cur ) {
  6058. j = 0;
  6059. while ( ( clazz = classes[ j++ ] ) ) {
  6060. if ( cur.indexOf( " " + clazz + " " ) < 0 ) {
  6061. cur += clazz + " ";
  6062. }
  6063. }
  6064. // Only assign if different to avoid unneeded rendering.
  6065. finalValue = jQuery.trim( cur );
  6066. if ( curValue !== finalValue ) {
  6067. elem.setAttribute( "class", finalValue );
  6068. }
  6069. }
  6070. }
  6071. }
  6072. return this;
  6073. },
  6074. removeClass: function( value ) {
  6075. var classes, elem, cur, curValue, clazz, j, finalValue,
  6076. i = 0;
  6077. if ( jQuery.isFunction( value ) ) {
  6078. return this.each( function( j ) {
  6079. jQuery( this ).removeClass( value.call( this, j, getClass( this ) ) );
  6080. } );
  6081. }
  6082. if ( !arguments.length ) {
  6083. return this.attr( "class", "" );
  6084. }
  6085. if ( typeof value === "string" && value ) {
  6086. classes = value.match( rnotwhite ) || [];
  6087. while ( ( elem = this[ i++ ] ) ) {
  6088. curValue = getClass( elem );
  6089. // This expression is here for better compressibility (see addClass)
  6090. cur = elem.nodeType === 1 &&
  6091. ( " " + curValue + " " ).replace( rclass, " " );
  6092. if ( cur ) {
  6093. j = 0;
  6094. while ( ( clazz = classes[ j++ ] ) ) {
  6095. // Remove *all* instances
  6096. while ( cur.indexOf( " " + clazz + " " ) > -1 ) {
  6097. cur = cur.replace( " " + clazz + " ", " " );
  6098. }
  6099. }
  6100. // Only assign if different to avoid unneeded rendering.
  6101. finalValue = jQuery.trim( cur );
  6102. if ( curValue !== finalValue ) {
  6103. elem.setAttribute( "class", finalValue );
  6104. }
  6105. }
  6106. }
  6107. }
  6108. return this;
  6109. },
  6110. toggleClass: function( value, stateVal ) {
  6111. var type = typeof value;
  6112. if ( typeof stateVal === "boolean" && type === "string" ) {
  6113. return stateVal ? this.addClass( value ) : this.removeClass( value );
  6114. }
  6115. if ( jQuery.isFunction( value ) ) {
  6116. return this.each( function( i ) {
  6117. jQuery( this ).toggleClass(
  6118. value.call( this, i, getClass( this ), stateVal ),
  6119. stateVal
  6120. );
  6121. } );
  6122. }
  6123. return this.each( function() {
  6124. var className, i, self, classNames;
  6125. if ( type === "string" ) {
  6126. // Toggle individual class names
  6127. i = 0;
  6128. self = jQuery( this );
  6129. classNames = value.match( rnotwhite ) || [];
  6130. while ( ( className = classNames[ i++ ] ) ) {
  6131. // Check each className given, space separated list
  6132. if ( self.hasClass( className ) ) {
  6133. self.removeClass( className );
  6134. } else {
  6135. self.addClass( className );
  6136. }
  6137. }
  6138. // Toggle whole class name
  6139. } else if ( value === undefined || type === "boolean" ) {
  6140. className = getClass( this );
  6141. if ( className ) {
  6142. // Store className if set
  6143. dataPriv.set( this, "__className__", className );
  6144. }
  6145. // If the element has a class name or if we're passed `false`,
  6146. // then remove the whole classname (if there was one, the above saved it).
  6147. // Otherwise bring back whatever was previously saved (if anything),
  6148. // falling back to the empty string if nothing was stored.
  6149. if ( this.setAttribute ) {
  6150. this.setAttribute( "class",
  6151. className || value === false ?
  6152. "" :
  6153. dataPriv.get( this, "__className__" ) || ""
  6154. );
  6155. }
  6156. }
  6157. } );
  6158. },
  6159. hasClass: function( selector ) {
  6160. var className, elem,
  6161. i = 0;
  6162. className = " " + selector + " ";
  6163. while ( ( elem = this[ i++ ] ) ) {
  6164. if ( elem.nodeType === 1 &&
  6165. ( " " + getClass( elem ) + " " ).replace( rclass, " " )
  6166. .indexOf( className ) > -1
  6167. ) {
  6168. return true;
  6169. }
  6170. }
  6171. return false;
  6172. }
  6173. } );
  6174. var rreturn = /\r/g;
  6175. jQuery.fn.extend( {
  6176. val: function( value ) {
  6177. var hooks, ret, isFunction,
  6178. elem = this[ 0 ];
  6179. if ( !arguments.length ) {
  6180. if ( elem ) {
  6181. hooks = jQuery.valHooks[ elem.type ] ||
  6182. jQuery.valHooks[ elem.nodeName.toLowerCase() ];
  6183. if ( hooks &&
  6184. "get" in hooks &&
  6185. ( ret = hooks.get( elem, "value" ) ) !== undefined
  6186. ) {
  6187. return ret;
  6188. }
  6189. ret = elem.value;
  6190. return typeof ret === "string" ?
  6191. // Handle most common string cases
  6192. ret.replace( rreturn, "" ) :
  6193. // Handle cases where value is null/undef or number
  6194. ret == null ? "" : ret;
  6195. }
  6196. return;
  6197. }
  6198. isFunction = jQuery.isFunction( value );
  6199. return this.each( function( i ) {
  6200. var val;
  6201. if ( this.nodeType !== 1 ) {
  6202. return;
  6203. }
  6204. if ( isFunction ) {
  6205. val = value.call( this, i, jQuery( this ).val() );
  6206. } else {
  6207. val = value;
  6208. }
  6209. // Treat null/undefined as ""; convert numbers to string
  6210. if ( val == null ) {
  6211. val = "";
  6212. } else if ( typeof val === "number" ) {
  6213. val += "";
  6214. } else if ( jQuery.isArray( val ) ) {
  6215. val = jQuery.map( val, function( value ) {
  6216. return value == null ? "" : value + "";
  6217. } );
  6218. }
  6219. hooks = jQuery.valHooks[ this.type ] || jQuery.valHooks[ this.nodeName.toLowerCase() ];
  6220. // If set returns undefined, fall back to normal setting
  6221. if ( !hooks || !( "set" in hooks ) || hooks.set( this, val, "value" ) === undefined ) {
  6222. this.value = val;
  6223. }
  6224. } );
  6225. }
  6226. } );
  6227. jQuery.extend( {
  6228. valHooks: {
  6229. option: {
  6230. get: function( elem ) {
  6231. // Support: IE<11
  6232. // option.value not trimmed (#14858)
  6233. return jQuery.trim( elem.value );
  6234. }
  6235. },
  6236. select: {
  6237. get: function( elem ) {
  6238. var value, option,
  6239. options = elem.options,
  6240. index = elem.selectedIndex,
  6241. one = elem.type === "select-one" || index < 0,
  6242. values = one ? null : [],
  6243. max = one ? index + 1 : options.length,
  6244. i = index < 0 ?
  6245. max :
  6246. one ? index : 0;
  6247. // Loop through all the selected options
  6248. for ( ; i < max; i++ ) {
  6249. option = options[ i ];
  6250. // IE8-9 doesn't update selected after form reset (#2551)
  6251. if ( ( option.selected || i === index ) &&
  6252. // Don't return options that are disabled or in a disabled optgroup
  6253. ( support.optDisabled ?
  6254. !option.disabled : option.getAttribute( "disabled" ) === null ) &&
  6255. ( !option.parentNode.disabled ||
  6256. !jQuery.nodeName( option.parentNode, "optgroup" ) ) ) {
  6257. // Get the specific value for the option
  6258. value = jQuery( option ).val();
  6259. // We don't need an array for one selects
  6260. if ( one ) {
  6261. return value;
  6262. }
  6263. // Multi-Selects return an array
  6264. values.push( value );
  6265. }
  6266. }
  6267. return values;
  6268. },
  6269. set: function( elem, value ) {
  6270. var optionSet, option,
  6271. options = elem.options,
  6272. values = jQuery.makeArray( value ),
  6273. i = options.length;
  6274. while ( i-- ) {
  6275. option = options[ i ];
  6276. if ( option.selected =
  6277. jQuery.inArray( jQuery.valHooks.option.get( option ), values ) > -1
  6278. ) {
  6279. optionSet = true;
  6280. }
  6281. }
  6282. // Force browsers to behave consistently when non-matching value is set
  6283. if ( !optionSet ) {
  6284. elem.selectedIndex = -1;
  6285. }
  6286. return values;
  6287. }
  6288. }
  6289. }
  6290. } );
  6291. // Radios and checkboxes getter/setter
  6292. jQuery.each( [ "radio", "checkbox" ], function() {
  6293. jQuery.valHooks[ this ] = {
  6294. set: function( elem, value ) {
  6295. if ( jQuery.isArray( value ) ) {
  6296. return ( elem.checked = jQuery.inArray( jQuery( elem ).val(), value ) > -1 );
  6297. }
  6298. }
  6299. };
  6300. if ( !support.checkOn ) {
  6301. jQuery.valHooks[ this ].get = function( elem ) {
  6302. return elem.getAttribute( "value" ) === null ? "on" : elem.value;
  6303. };
  6304. }
  6305. } );
  6306. // Return jQuery for attributes-only inclusion
  6307. var rfocusMorph = /^(?:focusinfocus|focusoutblur)$/;
  6308. jQuery.extend( jQuery.event, {
  6309. trigger: function( event, data, elem, onlyHandlers ) {
  6310. var i, cur, tmp, bubbleType, ontype, handle, special,
  6311. eventPath = [ elem || document ],
  6312. type = hasOwn.call( event, "type" ) ? event.type : event,
  6313. namespaces = hasOwn.call( event, "namespace" ) ? event.namespace.split( "." ) : [];
  6314. cur = tmp = elem = elem || document;
  6315. // Don't do events on text and comment nodes
  6316. if ( elem.nodeType === 3 || elem.nodeType === 8 ) {
  6317. return;
  6318. }
  6319. // focus/blur morphs to focusin/out; ensure we're not firing them right now
  6320. if ( rfocusMorph.test( type + jQuery.event.triggered ) ) {
  6321. return;
  6322. }
  6323. if ( type.indexOf( "." ) > -1 ) {
  6324. // Namespaced trigger; create a regexp to match event type in handle()
  6325. namespaces = type.split( "." );
  6326. type = namespaces.shift();
  6327. namespaces.sort();
  6328. }
  6329. ontype = type.indexOf( ":" ) < 0 && "on" + type;
  6330. // Caller can pass in a jQuery.Event object, Object, or just an event type string
  6331. event = event[ jQuery.expando ] ?
  6332. event :
  6333. new jQuery.Event( type, typeof event === "object" && event );
  6334. // Trigger bitmask: & 1 for native handlers; & 2 for jQuery (always true)
  6335. event.isTrigger = onlyHandlers ? 2 : 3;
  6336. event.namespace = namespaces.join( "." );
  6337. event.rnamespace = event.namespace ?
  6338. new RegExp( "(^|\\.)" + namespaces.join( "\\.(?:.*\\.|)" ) + "(\\.|$)" ) :
  6339. null;
  6340. // Clean up the event in case it is being reused
  6341. event.result = undefined;
  6342. if ( !event.target ) {
  6343. event.target = elem;
  6344. }
  6345. // Clone any incoming data and prepend the event, creating the handler arg list
  6346. data = data == null ?
  6347. [ event ] :
  6348. jQuery.makeArray( data, [ event ] );
  6349. // Allow special events to draw outside the lines
  6350. special = jQuery.event.special[ type ] || {};
  6351. if ( !onlyHandlers && special.trigger && special.trigger.apply( elem, data ) === false ) {
  6352. return;
  6353. }
  6354. // Determine event propagation path in advance, per W3C events spec (#9951)
  6355. // Bubble up to document, then to window; watch for a global ownerDocument var (#9724)
  6356. if ( !onlyHandlers && !special.noBubble && !jQuery.isWindow( elem ) ) {
  6357. bubbleType = special.delegateType || type;
  6358. if ( !rfocusMorph.test( bubbleType + type ) ) {
  6359. cur = cur.parentNode;
  6360. }
  6361. for ( ; cur; cur = cur.parentNode ) {
  6362. eventPath.push( cur );
  6363. tmp = cur;
  6364. }
  6365. // Only add window if we got to document (e.g., not plain obj or detached DOM)
  6366. if ( tmp === ( elem.ownerDocument || document ) ) {
  6367. eventPath.push( tmp.defaultView || tmp.parentWindow || window );
  6368. }
  6369. }
  6370. // Fire handlers on the event path
  6371. i = 0;
  6372. while ( ( cur = eventPath[ i++ ] ) && !event.isPropagationStopped() ) {
  6373. event.type = i > 1 ?
  6374. bubbleType :
  6375. special.bindType || type;
  6376. // jQuery handler
  6377. handle = ( dataPriv.get( cur, "events" ) || {} )[ event.type ] &&
  6378. dataPriv.get( cur, "handle" );
  6379. if ( handle ) {
  6380. handle.apply( cur, data );
  6381. }
  6382. // Native handler
  6383. handle = ontype && cur[ ontype ];
  6384. if ( handle && handle.apply && acceptData( cur ) ) {
  6385. event.result = handle.apply( cur, data );
  6386. if ( event.result === false ) {
  6387. event.preventDefault();
  6388. }
  6389. }
  6390. }
  6391. event.type = type;
  6392. // If nobody prevented the default action, do it now
  6393. if ( !onlyHandlers && !event.isDefaultPrevented() ) {
  6394. if ( ( !special._default ||
  6395. special._default.apply( eventPath.pop(), data ) === false ) &&
  6396. acceptData( elem ) ) {
  6397. // Call a native DOM method on the target with the same name name as the event.
  6398. // Don't do default actions on window, that's where global variables be (#6170)
  6399. if ( ontype && jQuery.isFunction( elem[ type ] ) && !jQuery.isWindow( elem ) ) {
  6400. // Don't re-trigger an onFOO event when we call its FOO() method
  6401. tmp = elem[ ontype ];
  6402. if ( tmp ) {
  6403. elem[ ontype ] = null;
  6404. }
  6405. // Prevent re-triggering of the same event, since we already bubbled it above
  6406. jQuery.event.triggered = type;
  6407. elem[ type ]();
  6408. jQuery.event.triggered = undefined;
  6409. if ( tmp ) {
  6410. elem[ ontype ] = tmp;
  6411. }
  6412. }
  6413. }
  6414. }
  6415. return event.result;
  6416. },
  6417. // Piggyback on a donor event to simulate a different one
  6418. simulate: function( type, elem, event ) {
  6419. var e = jQuery.extend(
  6420. new jQuery.Event(),
  6421. event,
  6422. {
  6423. type: type,
  6424. isSimulated: true
  6425. // Previously, `originalEvent: {}` was set here, so stopPropagation call
  6426. // would not be triggered on donor event, since in our own
  6427. // jQuery.event.stopPropagation function we had a check for existence of
  6428. // originalEvent.stopPropagation method, so, consequently it would be a noop.
  6429. //
  6430. // But now, this "simulate" function is used only for events
  6431. // for which stopPropagation() is noop, so there is no need for that anymore.
  6432. //
  6433. // For the 1.x branch though, guard for "click" and "submit"
  6434. // events is still used, but was moved to jQuery.event.stopPropagation function
  6435. // because `originalEvent` should point to the original event for the constancy
  6436. // with other events and for more focused logic
  6437. }
  6438. );
  6439. jQuery.event.trigger( e, null, elem );
  6440. if ( e.isDefaultPrevented() ) {
  6441. event.preventDefault();
  6442. }
  6443. }
  6444. } );
  6445. jQuery.fn.extend( {
  6446. trigger: function( type, data ) {
  6447. return this.each( function() {
  6448. jQuery.event.trigger( type, data, this );
  6449. } );
  6450. },
  6451. triggerHandler: function( type, data ) {
  6452. var elem = this[ 0 ];
  6453. if ( elem ) {
  6454. return jQuery.event.trigger( type, data, elem, true );
  6455. }
  6456. }
  6457. } );
  6458. jQuery.each( ( "blur focus focusin focusout load resize scroll unload click dblclick " +
  6459. "mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave " +
  6460. "change select submit keydown keypress keyup error contextmenu" ).split( " " ),
  6461. function( i, name ) {
  6462. // Handle event binding
  6463. jQuery.fn[ name ] = function( data, fn ) {
  6464. return arguments.length > 0 ?
  6465. this.on( name, null, data, fn ) :
  6466. this.trigger( name );
  6467. };
  6468. } );
  6469. jQuery.fn.extend( {
  6470. hover: function( fnOver, fnOut ) {
  6471. return this.mouseenter( fnOver ).mouseleave( fnOut || fnOver );
  6472. }
  6473. } );
  6474. support.focusin = "onfocusin" in window;
  6475. // Support: Firefox
  6476. // Firefox doesn't have focus(in | out) events
  6477. // Related ticket - https://bugzilla.mozilla.org/show_bug.cgi?id=687787
  6478. //
  6479. // Support: Chrome, Safari
  6480. // focus(in | out) events fire after focus & blur events,
  6481. // which is spec violation - http://www.w3.org/TR/DOM-Level-3-Events/#events-focusevent-event-order
  6482. // Related ticket - https://code.google.com/p/chromium/issues/detail?id=449857
  6483. if ( !support.focusin ) {
  6484. jQuery.each( { focus: "focusin", blur: "focusout" }, function( orig, fix ) {
  6485. // Attach a single capturing handler on the document while someone wants focusin/focusout
  6486. var handler = function( event ) {
  6487. jQuery.event.simulate( fix, event.target, jQuery.event.fix( event ) );
  6488. };
  6489. jQuery.event.special[ fix ] = {
  6490. setup: function() {
  6491. var doc = this.ownerDocument || this,
  6492. attaches = dataPriv.access( doc, fix );
  6493. if ( !attaches ) {
  6494. doc.addEventListener( orig, handler, true );
  6495. }
  6496. dataPriv.access( doc, fix, ( attaches || 0 ) + 1 );
  6497. },
  6498. teardown: function() {
  6499. var doc = this.ownerDocument || this,
  6500. attaches = dataPriv.access( doc, fix ) - 1;
  6501. if ( !attaches ) {
  6502. doc.removeEventListener( orig, handler, true );
  6503. dataPriv.remove( doc, fix );
  6504. } else {
  6505. dataPriv.access( doc, fix, attaches );
  6506. }
  6507. }
  6508. };
  6509. } );
  6510. }
  6511. var location = window.location;
  6512. var nonce = jQuery.now();
  6513. var rquery = ( /\?/ );
  6514. // Support: Android 2.3
  6515. // Workaround failure to string-cast null input
  6516. jQuery.parseJSON = function( data ) {
  6517. return JSON.parse( data + "" );
  6518. };
  6519. // Cross-browser xml parsing
  6520. jQuery.parseXML = function( data ) {
  6521. var xml;
  6522. if ( !data || typeof data !== "string" ) {
  6523. return null;
  6524. }
  6525. // Support: IE9
  6526. try {
  6527. xml = ( new window.DOMParser() ).parseFromString( data, "text/xml" );
  6528. } catch ( e ) {
  6529. xml = undefined;
  6530. }
  6531. if ( !xml || xml.getElementsByTagName( "parsererror" ).length ) {
  6532. jQuery.error( "Invalid XML: " + data );
  6533. }
  6534. return xml;
  6535. };
  6536. var
  6537. rhash = /#.*$/,
  6538. rts = /([?&])_=[^&]*/,
  6539. rheaders = /^(.*?):[ \t]*([^\r\n]*)$/mg,
  6540. // #7653, #8125, #8152: local protocol detection
  6541. rlocalProtocol = /^(?:about|app|app-storage|.+-extension|file|res|widget):$/,
  6542. rnoContent = /^(?:GET|HEAD)$/,
  6543. rprotocol = /^\/\//,
  6544. /* Prefilters
  6545. * 1) They are useful to introduce custom dataTypes (see ajax/jsonp.js for an example)
  6546. * 2) These are called:
  6547. * - BEFORE asking for a transport
  6548. * - AFTER param serialization (s.data is a string if s.processData is true)
  6549. * 3) key is the dataType
  6550. * 4) the catchall symbol "*" can be used
  6551. * 5) execution will start with transport dataType and THEN continue down to "*" if needed
  6552. */
  6553. prefilters = {},
  6554. /* Transports bindings
  6555. * 1) key is the dataType
  6556. * 2) the catchall symbol "*" can be used
  6557. * 3) selection will start with transport dataType and THEN go to "*" if needed
  6558. */
  6559. transports = {},
  6560. // Avoid comment-prolog char sequence (#10098); must appease lint and evade compression
  6561. allTypes = "*/".concat( "*" ),
  6562. // Anchor tag for parsing the document origin
  6563. originAnchor = document.createElement( "a" );
  6564. originAnchor.href = location.href;
  6565. // Base "constructor" for jQuery.ajaxPrefilter and jQuery.ajaxTransport
  6566. function addToPrefiltersOrTransports( structure ) {
  6567. // dataTypeExpression is optional and defaults to "*"
  6568. return function( dataTypeExpression, func ) {
  6569. if ( typeof dataTypeExpression !== "string" ) {
  6570. func = dataTypeExpression;
  6571. dataTypeExpression = "*";
  6572. }
  6573. var dataType,
  6574. i = 0,
  6575. dataTypes = dataTypeExpression.toLowerCase().match( rnotwhite ) || [];
  6576. if ( jQuery.isFunction( func ) ) {
  6577. // For each dataType in the dataTypeExpression
  6578. while ( ( dataType = dataTypes[ i++ ] ) ) {
  6579. // Prepend if requested
  6580. if ( dataType[ 0 ] === "+" ) {
  6581. dataType = dataType.slice( 1 ) || "*";
  6582. ( structure[ dataType ] = structure[ dataType ] || [] ).unshift( func );
  6583. // Otherwise append
  6584. } else {
  6585. ( structure[ dataType ] = structure[ dataType ] || [] ).push( func );
  6586. }
  6587. }
  6588. }
  6589. };
  6590. }
  6591. // Base inspection function for prefilters and transports
  6592. function inspectPrefiltersOrTransports( structure, options, originalOptions, jqXHR ) {
  6593. var inspected = {},
  6594. seekingTransport = ( structure === transports );
  6595. function inspect( dataType ) {
  6596. var selected;
  6597. inspected[ dataType ] = true;
  6598. jQuery.each( structure[ dataType ] || [], function( _, prefilterOrFactory ) {
  6599. var dataTypeOrTransport = prefilterOrFactory( options, originalOptions, jqXHR );
  6600. if ( typeof dataTypeOrTransport === "string" &&
  6601. !seekingTransport && !inspected[ dataTypeOrTransport ] ) {
  6602. options.dataTypes.unshift( dataTypeOrTransport );
  6603. inspect( dataTypeOrTransport );
  6604. return false;
  6605. } else if ( seekingTransport ) {
  6606. return !( selected = dataTypeOrTransport );
  6607. }
  6608. } );
  6609. return selected;
  6610. }
  6611. return inspect( options.dataTypes[ 0 ] ) || !inspected[ "*" ] && inspect( "*" );
  6612. }
  6613. // A special extend for ajax options
  6614. // that takes "flat" options (not to be deep extended)
  6615. // Fixes #9887
  6616. function ajaxExtend( target, src ) {
  6617. var key, deep,
  6618. flatOptions = jQuery.ajaxSettings.flatOptions || {};
  6619. for ( key in src ) {
  6620. if ( src[ key ] !== undefined ) {
  6621. ( flatOptions[ key ] ? target : ( deep || ( deep = {} ) ) )[ key ] = src[ key ];
  6622. }
  6623. }
  6624. if ( deep ) {
  6625. jQuery.extend( true, target, deep );
  6626. }
  6627. return target;
  6628. }
  6629. /* Handles responses to an ajax request:
  6630. * - finds the right dataType (mediates between content-type and expected dataType)
  6631. * - returns the corresponding response
  6632. */
  6633. function ajaxHandleResponses( s, jqXHR, responses ) {
  6634. var ct, type, finalDataType, firstDataType,
  6635. contents = s.contents,
  6636. dataTypes = s.dataTypes;
  6637. // Remove auto dataType and get content-type in the process
  6638. while ( dataTypes[ 0 ] === "*" ) {
  6639. dataTypes.shift();
  6640. if ( ct === undefined ) {
  6641. ct = s.mimeType || jqXHR.getResponseHeader( "Content-Type" );
  6642. }
  6643. }
  6644. // Check if we're dealing with a known content-type
  6645. if ( ct ) {
  6646. for ( type in contents ) {
  6647. if ( contents[ type ] && contents[ type ].test( ct ) ) {
  6648. dataTypes.unshift( type );
  6649. break;
  6650. }
  6651. }
  6652. }
  6653. // Check to see if we have a response for the expected dataType
  6654. if ( dataTypes[ 0 ] in responses ) {
  6655. finalDataType = dataTypes[ 0 ];
  6656. } else {
  6657. // Try convertible dataTypes
  6658. for ( type in responses ) {
  6659. if ( !dataTypes[ 0 ] || s.converters[ type + " " + dataTypes[ 0 ] ] ) {
  6660. finalDataType = type;
  6661. break;
  6662. }
  6663. if ( !firstDataType ) {
  6664. firstDataType = type;
  6665. }
  6666. }
  6667. // Or just use first one
  6668. finalDataType = finalDataType || firstDataType;
  6669. }
  6670. // If we found a dataType
  6671. // We add the dataType to the list if needed
  6672. // and return the corresponding response
  6673. if ( finalDataType ) {
  6674. if ( finalDataType !== dataTypes[ 0 ] ) {
  6675. dataTypes.unshift( finalDataType );
  6676. }
  6677. return responses[ finalDataType ];
  6678. }
  6679. }
  6680. /* Chain conversions given the request and the original response
  6681. * Also sets the responseXXX fields on the jqXHR instance
  6682. */
  6683. function ajaxConvert( s, response, jqXHR, isSuccess ) {
  6684. var conv2, current, conv, tmp, prev,
  6685. converters = {},
  6686. // Work with a copy of dataTypes in case we need to modify it for conversion
  6687. dataTypes = s.dataTypes.slice();
  6688. // Create converters map with lowercased keys
  6689. if ( dataTypes[ 1 ] ) {
  6690. for ( conv in s.converters ) {
  6691. converters[ conv.toLowerCase() ] = s.converters[ conv ];
  6692. }
  6693. }
  6694. current = dataTypes.shift();
  6695. // Convert to each sequential dataType
  6696. while ( current ) {
  6697. if ( s.responseFields[ current ] ) {
  6698. jqXHR[ s.responseFields[ current ] ] = response;
  6699. }
  6700. // Apply the dataFilter if provided
  6701. if ( !prev && isSuccess && s.dataFilter ) {
  6702. response = s.dataFilter( response, s.dataType );
  6703. }
  6704. prev = current;
  6705. current = dataTypes.shift();
  6706. if ( current ) {
  6707. // There's only work to do if current dataType is non-auto
  6708. if ( current === "*" ) {
  6709. current = prev;
  6710. // Convert response if prev dataType is non-auto and differs from current
  6711. } else if ( prev !== "*" && prev !== current ) {
  6712. // Seek a direct converter
  6713. conv = converters[ prev + " " + current ] || converters[ "* " + current ];
  6714. // If none found, seek a pair
  6715. if ( !conv ) {
  6716. for ( conv2 in converters ) {
  6717. // If conv2 outputs current
  6718. tmp = conv2.split( " " );
  6719. if ( tmp[ 1 ] === current ) {
  6720. // If prev can be converted to accepted input
  6721. conv = converters[ prev + " " + tmp[ 0 ] ] ||
  6722. converters[ "* " + tmp[ 0 ] ];
  6723. if ( conv ) {
  6724. // Condense equivalence converters
  6725. if ( conv === true ) {
  6726. conv = converters[ conv2 ];
  6727. // Otherwise, insert the intermediate dataType
  6728. } else if ( converters[ conv2 ] !== true ) {
  6729. current = tmp[ 0 ];
  6730. dataTypes.unshift( tmp[ 1 ] );
  6731. }
  6732. break;
  6733. }
  6734. }
  6735. }
  6736. }
  6737. // Apply converter (if not an equivalence)
  6738. if ( conv !== true ) {
  6739. // Unless errors are allowed to bubble, catch and return them
  6740. if ( conv && s.throws ) {
  6741. response = conv( response );
  6742. } else {
  6743. try {
  6744. response = conv( response );
  6745. } catch ( e ) {
  6746. return {
  6747. state: "parsererror",
  6748. error: conv ? e : "No conversion from " + prev + " to " + current
  6749. };
  6750. }
  6751. }
  6752. }
  6753. }
  6754. }
  6755. }
  6756. return { state: "success", data: response };
  6757. }
  6758. jQuery.extend( {
  6759. // Counter for holding the number of active queries
  6760. active: 0,
  6761. // Last-Modified header cache for next request
  6762. lastModified: {},
  6763. etag: {},
  6764. ajaxSettings: {
  6765. url: location.href,
  6766. type: "GET",
  6767. isLocal: rlocalProtocol.test( location.protocol ),
  6768. global: true,
  6769. processData: true,
  6770. async: true,
  6771. contentType: "application/x-www-form-urlencoded; charset=UTF-8",
  6772. /*
  6773. timeout: 0,
  6774. data: null,
  6775. dataType: null,
  6776. username: null,
  6777. password: null,
  6778. cache: null,
  6779. throws: false,
  6780. traditional: false,
  6781. headers: {},
  6782. */
  6783. accepts: {
  6784. "*": allTypes,
  6785. text: "text/plain",
  6786. html: "text/html",
  6787. xml: "application/xml, text/xml",
  6788. json: "application/json, text/javascript"
  6789. },
  6790. contents: {
  6791. xml: /\bxml\b/,
  6792. html: /\bhtml/,
  6793. json: /\bjson\b/
  6794. },
  6795. responseFields: {
  6796. xml: "responseXML",
  6797. text: "responseText",
  6798. json: "responseJSON"
  6799. },
  6800. // Data converters
  6801. // Keys separate source (or catchall "*") and destination types with a single space
  6802. converters: {
  6803. // Convert anything to text
  6804. "* text": String,
  6805. // Text to html (true = no transformation)
  6806. "text html": true,
  6807. // Evaluate text as a json expression
  6808. "text json": jQuery.parseJSON,
  6809. // Parse text as xml
  6810. "text xml": jQuery.parseXML
  6811. },
  6812. // For options that shouldn't be deep extended:
  6813. // you can add your own custom options here if
  6814. // and when you create one that shouldn't be
  6815. // deep extended (see ajaxExtend)
  6816. flatOptions: {
  6817. url: true,
  6818. context: true
  6819. }
  6820. },
  6821. // Creates a full fledged settings object into target
  6822. // with both ajaxSettings and settings fields.
  6823. // If target is omitted, writes into ajaxSettings.
  6824. ajaxSetup: function( target, settings ) {
  6825. return settings ?
  6826. // Building a settings object
  6827. ajaxExtend( ajaxExtend( target, jQuery.ajaxSettings ), settings ) :
  6828. // Extending ajaxSettings
  6829. ajaxExtend( jQuery.ajaxSettings, target );
  6830. },
  6831. ajaxPrefilter: addToPrefiltersOrTransports( prefilters ),
  6832. ajaxTransport: addToPrefiltersOrTransports( transports ),
  6833. // Main method
  6834. ajax: function( url, options ) {
  6835. // If url is an object, simulate pre-1.5 signature
  6836. if ( typeof url === "object" ) {
  6837. options = url;
  6838. url = undefined;
  6839. }
  6840. // Force options to be an object
  6841. options = options || {};
  6842. var transport,
  6843. // URL without anti-cache param
  6844. cacheURL,
  6845. // Response headers
  6846. responseHeadersString,
  6847. responseHeaders,
  6848. // timeout handle
  6849. timeoutTimer,
  6850. // Url cleanup var
  6851. urlAnchor,
  6852. // To know if global events are to be dispatched
  6853. fireGlobals,
  6854. // Loop variable
  6855. i,
  6856. // Create the final options object
  6857. s = jQuery.ajaxSetup( {}, options ),
  6858. // Callbacks context
  6859. callbackContext = s.context || s,
  6860. // Context for global events is callbackContext if it is a DOM node or jQuery collection
  6861. globalEventContext = s.context &&
  6862. ( callbackContext.nodeType || callbackContext.jquery ) ?
  6863. jQuery( callbackContext ) :
  6864. jQuery.event,
  6865. // Deferreds
  6866. deferred = jQuery.Deferred(),
  6867. completeDeferred = jQuery.Callbacks( "once memory" ),
  6868. // Status-dependent callbacks
  6869. statusCode = s.statusCode || {},
  6870. // Headers (they are sent all at once)
  6871. requestHeaders = {},
  6872. requestHeadersNames = {},
  6873. // The jqXHR state
  6874. state = 0,
  6875. // Default abort message
  6876. strAbort = "canceled",
  6877. // Fake xhr
  6878. jqXHR = {
  6879. readyState: 0,
  6880. // Builds headers hashtable if needed
  6881. getResponseHeader: function( key ) {
  6882. var match;
  6883. if ( state === 2 ) {
  6884. if ( !responseHeaders ) {
  6885. responseHeaders = {};
  6886. while ( ( match = rheaders.exec( responseHeadersString ) ) ) {
  6887. responseHeaders[ match[ 1 ].toLowerCase() ] = match[ 2 ];
  6888. }
  6889. }
  6890. match = responseHeaders[ key.toLowerCase() ];
  6891. }
  6892. return match == null ? null : match;
  6893. },
  6894. // Raw string
  6895. getAllResponseHeaders: function() {
  6896. return state === 2 ? responseHeadersString : null;
  6897. },
  6898. // Caches the header
  6899. setRequestHeader: function( name, value ) {
  6900. var lname = name.toLowerCase();
  6901. if ( !state ) {
  6902. name = requestHeadersNames[ lname ] = requestHeadersNames[ lname ] || name;
  6903. requestHeaders[ name ] = value;
  6904. }
  6905. return this;
  6906. },
  6907. // Overrides response content-type header
  6908. overrideMimeType: function( type ) {
  6909. if ( !state ) {
  6910. s.mimeType = type;
  6911. }
  6912. return this;
  6913. },
  6914. // Status-dependent callbacks
  6915. statusCode: function( map ) {
  6916. var code;
  6917. if ( map ) {
  6918. if ( state < 2 ) {
  6919. for ( code in map ) {
  6920. // Lazy-add the new callback in a way that preserves old ones
  6921. statusCode[ code ] = [ statusCode[ code ], map[ code ] ];
  6922. }
  6923. } else {
  6924. // Execute the appropriate callbacks
  6925. jqXHR.always( map[ jqXHR.status ] );
  6926. }
  6927. }
  6928. return this;
  6929. },
  6930. // Cancel the request
  6931. abort: function( statusText ) {
  6932. var finalText = statusText || strAbort;
  6933. if ( transport ) {
  6934. transport.abort( finalText );
  6935. }
  6936. done( 0, finalText );
  6937. return this;
  6938. }
  6939. };
  6940. // Attach deferreds
  6941. deferred.promise( jqXHR ).complete = completeDeferred.add;
  6942. jqXHR.success = jqXHR.done;
  6943. jqXHR.error = jqXHR.fail;
  6944. // Remove hash character (#7531: and string promotion)
  6945. // Add protocol if not provided (prefilters might expect it)
  6946. // Handle falsy url in the settings object (#10093: consistency with old signature)
  6947. // We also use the url parameter if available
  6948. s.url = ( ( url || s.url || location.href ) + "" ).replace( rhash, "" )
  6949. .replace( rprotocol, location.protocol + "//" );
  6950. // Alias method option to type as per ticket #12004
  6951. s.type = options.method || options.type || s.method || s.type;
  6952. // Extract dataTypes list
  6953. s.dataTypes = jQuery.trim( s.dataType || "*" ).toLowerCase().match( rnotwhite ) || [ "" ];
  6954. // A cross-domain request is in order when the origin doesn't match the current origin.
  6955. if ( s.crossDomain == null ) {
  6956. urlAnchor = document.createElement( "a" );
  6957. // Support: IE8-11+
  6958. // IE throws exception if url is malformed, e.g. http://example.com:80x/
  6959. try {
  6960. urlAnchor.href = s.url;
  6961. // Support: IE8-11+
  6962. // Anchor's host property isn't correctly set when s.url is relative
  6963. urlAnchor.href = urlAnchor.href;
  6964. s.crossDomain = originAnchor.protocol + "//" + originAnchor.host !==
  6965. urlAnchor.protocol + "//" + urlAnchor.host;
  6966. } catch ( e ) {
  6967. // If there is an error parsing the URL, assume it is crossDomain,
  6968. // it can be rejected by the transport if it is invalid
  6969. s.crossDomain = true;
  6970. }
  6971. }
  6972. // Convert data if not already a string
  6973. if ( s.data && s.processData && typeof s.data !== "string" ) {
  6974. s.data = jQuery.param( s.data, s.traditional );
  6975. }
  6976. // Apply prefilters
  6977. inspectPrefiltersOrTransports( prefilters, s, options, jqXHR );
  6978. // If request was aborted inside a prefilter, stop there
  6979. if ( state === 2 ) {
  6980. return jqXHR;
  6981. }
  6982. // We can fire global events as of now if asked to
  6983. // Don't fire events if jQuery.event is undefined in an AMD-usage scenario (#15118)
  6984. fireGlobals = jQuery.event && s.global;
  6985. // Watch for a new set of requests
  6986. if ( fireGlobals && jQuery.active++ === 0 ) {
  6987. jQuery.event.trigger( "ajaxStart" );
  6988. }
  6989. // Uppercase the type
  6990. s.type = s.type.toUpperCase();
  6991. // Determine if request has content
  6992. s.hasContent = !rnoContent.test( s.type );
  6993. // Save the URL in case we're toying with the If-Modified-Since
  6994. // and/or If-None-Match header later on
  6995. cacheURL = s.url;
  6996. // More options handling for requests with no content
  6997. if ( !s.hasContent ) {
  6998. // If data is available, append data to url
  6999. if ( s.data ) {
  7000. cacheURL = ( s.url += ( rquery.test( cacheURL ) ? "&" : "?" ) + s.data );
  7001. // #9682: remove data so that it's not used in an eventual retry
  7002. delete s.data;
  7003. }
  7004. // Add anti-cache in url if needed
  7005. if ( s.cache === false ) {
  7006. s.url = rts.test( cacheURL ) ?
  7007. // If there is already a '_' parameter, set its value
  7008. cacheURL.replace( rts, "$1_=" + nonce++ ) :
  7009. // Otherwise add one to the end
  7010. cacheURL + ( rquery.test( cacheURL ) ? "&" : "?" ) + "_=" + nonce++;
  7011. }
  7012. }
  7013. // Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode.
  7014. if ( s.ifModified ) {
  7015. if ( jQuery.lastModified[ cacheURL ] ) {
  7016. jqXHR.setRequestHeader( "If-Modified-Since", jQuery.lastModified[ cacheURL ] );
  7017. }
  7018. if ( jQuery.etag[ cacheURL ] ) {
  7019. jqXHR.setRequestHeader( "If-None-Match", jQuery.etag[ cacheURL ] );
  7020. }
  7021. }
  7022. // Set the correct header, if data is being sent
  7023. if ( s.data && s.hasContent && s.contentType !== false || options.contentType ) {
  7024. jqXHR.setRequestHeader( "Content-Type", s.contentType );
  7025. }
  7026. // Set the Accepts header for the server, depending on the dataType
  7027. jqXHR.setRequestHeader(
  7028. "Accept",
  7029. s.dataTypes[ 0 ] && s.accepts[ s.dataTypes[ 0 ] ] ?
  7030. s.accepts[ s.dataTypes[ 0 ] ] +
  7031. ( s.dataTypes[ 0 ] !== "*" ? ", " + allTypes + "; q=0.01" : "" ) :
  7032. s.accepts[ "*" ]
  7033. );
  7034. // Check for headers option
  7035. for ( i in s.headers ) {
  7036. jqXHR.setRequestHeader( i, s.headers[ i ] );
  7037. }
  7038. // Allow custom headers/mimetypes and early abort
  7039. if ( s.beforeSend &&
  7040. ( s.beforeSend.call( callbackContext, jqXHR, s ) === false || state === 2 ) ) {
  7041. // Abort if not done already and return
  7042. return jqXHR.abort();
  7043. }
  7044. // Aborting is no longer a cancellation
  7045. strAbort = "abort";
  7046. // Install callbacks on deferreds
  7047. for ( i in { success: 1, error: 1, complete: 1 } ) {
  7048. jqXHR[ i ]( s[ i ] );
  7049. }
  7050. // Get transport
  7051. transport = inspectPrefiltersOrTransports( transports, s, options, jqXHR );
  7052. // If no transport, we auto-abort
  7053. if ( !transport ) {
  7054. done( -1, "No Transport" );
  7055. } else {
  7056. jqXHR.readyState = 1;
  7057. // Send global event
  7058. if ( fireGlobals ) {
  7059. globalEventContext.trigger( "ajaxSend", [ jqXHR, s ] );
  7060. }
  7061. // If request was aborted inside ajaxSend, stop there
  7062. if ( state === 2 ) {
  7063. return jqXHR;
  7064. }
  7065. // Timeout
  7066. if ( s.async && s.timeout > 0 ) {
  7067. timeoutTimer = window.setTimeout( function() {
  7068. jqXHR.abort( "timeout" );
  7069. }, s.timeout );
  7070. }
  7071. try {
  7072. state = 1;
  7073. transport.send( requestHeaders, done );
  7074. } catch ( e ) {
  7075. // Propagate exception as error if not done
  7076. if ( state < 2 ) {
  7077. done( -1, e );
  7078. // Simply rethrow otherwise
  7079. } else {
  7080. throw e;
  7081. }
  7082. }
  7083. }
  7084. // Callback for when everything is done
  7085. function done( status, nativeStatusText, responses, headers ) {
  7086. var isSuccess, success, error, response, modified,
  7087. statusText = nativeStatusText;
  7088. // Called once
  7089. if ( state === 2 ) {
  7090. return;
  7091. }
  7092. // State is "done" now
  7093. state = 2;
  7094. // Clear timeout if it exists
  7095. if ( timeoutTimer ) {
  7096. window.clearTimeout( timeoutTimer );
  7097. }
  7098. // Dereference transport for early garbage collection
  7099. // (no matter how long the jqXHR object will be used)
  7100. transport = undefined;
  7101. // Cache response headers
  7102. responseHeadersString = headers || "";
  7103. // Set readyState
  7104. jqXHR.readyState = status > 0 ? 4 : 0;
  7105. // Determine if successful
  7106. isSuccess = status >= 200 && status < 300 || status === 304;
  7107. // Get response data
  7108. if ( responses ) {
  7109. response = ajaxHandleResponses( s, jqXHR, responses );
  7110. }
  7111. // Convert no matter what (that way responseXXX fields are always set)
  7112. response = ajaxConvert( s, response, jqXHR, isSuccess );
  7113. // If successful, handle type chaining
  7114. if ( isSuccess ) {
  7115. // Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode.
  7116. if ( s.ifModified ) {
  7117. modified = jqXHR.getResponseHeader( "Last-Modified" );
  7118. if ( modified ) {
  7119. jQuery.lastModified[ cacheURL ] = modified;
  7120. }
  7121. modified = jqXHR.getResponseHeader( "etag" );
  7122. if ( modified ) {
  7123. jQuery.etag[ cacheURL ] = modified;
  7124. }
  7125. }
  7126. // if no content
  7127. if ( status === 204 || s.type === "HEAD" ) {
  7128. statusText = "nocontent";
  7129. // if not modified
  7130. } else if ( status === 304 ) {
  7131. statusText = "notmodified";
  7132. // If we have data, let's convert it
  7133. } else {
  7134. statusText = response.state;
  7135. success = response.data;
  7136. error = response.error;
  7137. isSuccess = !error;
  7138. }
  7139. } else {
  7140. // Extract error from statusText and normalize for non-aborts
  7141. error = statusText;
  7142. if ( status || !statusText ) {
  7143. statusText = "error";
  7144. if ( status < 0 ) {
  7145. status = 0;
  7146. }
  7147. }
  7148. }
  7149. // Set data for the fake xhr object
  7150. jqXHR.status = status;
  7151. jqXHR.statusText = ( nativeStatusText || statusText ) + "";
  7152. // Success/Error
  7153. if ( isSuccess ) {
  7154. deferred.resolveWith( callbackContext, [ success, statusText, jqXHR ] );
  7155. } else {
  7156. deferred.rejectWith( callbackContext, [ jqXHR, statusText, error ] );
  7157. }
  7158. // Status-dependent callbacks
  7159. jqXHR.statusCode( statusCode );
  7160. statusCode = undefined;
  7161. if ( fireGlobals ) {
  7162. globalEventContext.trigger( isSuccess ? "ajaxSuccess" : "ajaxError",
  7163. [ jqXHR, s, isSuccess ? success : error ] );
  7164. }
  7165. // Complete
  7166. completeDeferred.fireWith( callbackContext, [ jqXHR, statusText ] );
  7167. if ( fireGlobals ) {
  7168. globalEventContext.trigger( "ajaxComplete", [ jqXHR, s ] );
  7169. // Handle the global AJAX counter
  7170. if ( !( --jQuery.active ) ) {
  7171. jQuery.event.trigger( "ajaxStop" );
  7172. }
  7173. }
  7174. }
  7175. return jqXHR;
  7176. },
  7177. getJSON: function( url, data, callback ) {
  7178. return jQuery.get( url, data, callback, "json" );
  7179. },
  7180. getScript: function( url, callback ) {
  7181. return jQuery.get( url, undefined, callback, "script" );
  7182. }
  7183. } );
  7184. jQuery.each( [ "get", "post" ], function( i, method ) {
  7185. jQuery[ method ] = function( url, data, callback, type ) {
  7186. // Shift arguments if data argument was omitted
  7187. if ( jQuery.isFunction( data ) ) {
  7188. type = type || callback;
  7189. callback = data;
  7190. data = undefined;
  7191. }
  7192. // The url can be an options object (which then must have .url)
  7193. return jQuery.ajax( jQuery.extend( {
  7194. url: url,
  7195. type: method,
  7196. dataType: type,
  7197. data: data,
  7198. success: callback
  7199. }, jQuery.isPlainObject( url ) && url ) );
  7200. };
  7201. } );
  7202. jQuery._evalUrl = function( url ) {
  7203. return jQuery.ajax( {
  7204. url: url,
  7205. // Make this explicit, since user can override this through ajaxSetup (#11264)
  7206. type: "GET",
  7207. dataType: "script",
  7208. async: false,
  7209. global: false,
  7210. "throws": true
  7211. } );
  7212. };
  7213. jQuery.fn.extend( {
  7214. wrapAll: function( html ) {
  7215. var wrap;
  7216. if ( jQuery.isFunction( html ) ) {
  7217. return this.each( function( i ) {
  7218. jQuery( this ).wrapAll( html.call( this, i ) );
  7219. } );
  7220. }
  7221. if ( this[ 0 ] ) {
  7222. // The elements to wrap the target around
  7223. wrap = jQuery( html, this[ 0 ].ownerDocument ).eq( 0 ).clone( true );
  7224. if ( this[ 0 ].parentNode ) {
  7225. wrap.insertBefore( this[ 0 ] );
  7226. }
  7227. wrap.map( function() {
  7228. var elem = this;
  7229. while ( elem.firstElementChild ) {
  7230. elem = elem.firstElementChild;
  7231. }
  7232. return elem;
  7233. } ).append( this );
  7234. }
  7235. return this;
  7236. },
  7237. wrapInner: function( html ) {
  7238. if ( jQuery.isFunction( html ) ) {
  7239. return this.each( function( i ) {
  7240. jQuery( this ).wrapInner( html.call( this, i ) );
  7241. } );
  7242. }
  7243. return this.each( function() {
  7244. var self = jQuery( this ),
  7245. contents = self.contents();
  7246. if ( contents.length ) {
  7247. contents.wrapAll( html );
  7248. } else {
  7249. self.append( html );
  7250. }
  7251. } );
  7252. },
  7253. wrap: function( html ) {
  7254. var isFunction = jQuery.isFunction( html );
  7255. return this.each( function( i ) {
  7256. jQuery( this ).wrapAll( isFunction ? html.call( this, i ) : html );
  7257. } );
  7258. },
  7259. unwrap: function() {
  7260. return this.parent().each( function() {
  7261. if ( !jQuery.nodeName( this, "body" ) ) {
  7262. jQuery( this ).replaceWith( this.childNodes );
  7263. }
  7264. } ).end();
  7265. }
  7266. } );
  7267. jQuery.expr.filters.hidden = function( elem ) {
  7268. return !jQuery.expr.filters.visible( elem );
  7269. };
  7270. jQuery.expr.filters.visible = function( elem ) {
  7271. // Support: Opera <= 12.12
  7272. // Opera reports offsetWidths and offsetHeights less than zero on some elements
  7273. // Use OR instead of AND as the element is not visible if either is true
  7274. // See tickets #10406 and #13132
  7275. return elem.offsetWidth > 0 || elem.offsetHeight > 0 || elem.getClientRects().length > 0;
  7276. };
  7277. var r20 = /%20/g,
  7278. rbracket = /\[\]$/,
  7279. rCRLF = /\r?\n/g,
  7280. rsubmitterTypes = /^(?:submit|button|image|reset|file)$/i,
  7281. rsubmittable = /^(?:input|select|textarea|keygen)/i;
  7282. function buildParams( prefix, obj, traditional, add ) {
  7283. var name;
  7284. if ( jQuery.isArray( obj ) ) {
  7285. // Serialize array item.
  7286. jQuery.each( obj, function( i, v ) {
  7287. if ( traditional || rbracket.test( prefix ) ) {
  7288. // Treat each array item as a scalar.
  7289. add( prefix, v );
  7290. } else {
  7291. // Item is non-scalar (array or object), encode its numeric index.
  7292. buildParams(
  7293. prefix + "[" + ( typeof v === "object" && v != null ? i : "" ) + "]",
  7294. v,
  7295. traditional,
  7296. add
  7297. );
  7298. }
  7299. } );
  7300. } else if ( !traditional && jQuery.type( obj ) === "object" ) {
  7301. // Serialize object item.
  7302. for ( name in obj ) {
  7303. buildParams( prefix + "[" + name + "]", obj[ name ], traditional, add );
  7304. }
  7305. } else {
  7306. // Serialize scalar item.
  7307. add( prefix, obj );
  7308. }
  7309. }
  7310. // Serialize an array of form elements or a set of
  7311. // key/values into a query string
  7312. jQuery.param = function( a, traditional ) {
  7313. var prefix,
  7314. s = [],
  7315. add = function( key, value ) {
  7316. // If value is a function, invoke it and return its value
  7317. value = jQuery.isFunction( value ) ? value() : ( value == null ? "" : value );
  7318. s[ s.length ] = encodeURIComponent( key ) + "=" + encodeURIComponent( value );
  7319. };
  7320. // Set traditional to true for jQuery <= 1.3.2 behavior.
  7321. if ( traditional === undefined ) {
  7322. traditional = jQuery.ajaxSettings && jQuery.ajaxSettings.traditional;
  7323. }
  7324. // If an array was passed in, assume that it is an array of form elements.
  7325. if ( jQuery.isArray( a ) || ( a.jquery && !jQuery.isPlainObject( a ) ) ) {
  7326. // Serialize the form elements
  7327. jQuery.each( a, function() {
  7328. add( this.name, this.value );
  7329. } );
  7330. } else {
  7331. // If traditional, encode the "old" way (the way 1.3.2 or older
  7332. // did it), otherwise encode params recursively.
  7333. for ( prefix in a ) {
  7334. buildParams( prefix, a[ prefix ], traditional, add );
  7335. }
  7336. }
  7337. // Return the resulting serialization
  7338. return s.join( "&" ).replace( r20, "+" );
  7339. };
  7340. jQuery.fn.extend( {
  7341. serialize: function() {
  7342. return jQuery.param( this.serializeArray() );
  7343. },
  7344. serializeArray: function() {
  7345. return this.map( function() {
  7346. // Can add propHook for "elements" to filter or add form elements
  7347. var elements = jQuery.prop( this, "elements" );
  7348. return elements ? jQuery.makeArray( elements ) : this;
  7349. } )
  7350. .filter( function() {
  7351. var type = this.type;
  7352. // Use .is( ":disabled" ) so that fieldset[disabled] works
  7353. return this.name && !jQuery( this ).is( ":disabled" ) &&
  7354. rsubmittable.test( this.nodeName ) && !rsubmitterTypes.test( type ) &&
  7355. ( this.checked || !rcheckableType.test( type ) );
  7356. } )
  7357. .map( function( i, elem ) {
  7358. var val = jQuery( this ).val();
  7359. return val == null ?
  7360. null :
  7361. jQuery.isArray( val ) ?
  7362. jQuery.map( val, function( val ) {
  7363. return { name: elem.name, value: val.replace( rCRLF, "\r\n" ) };
  7364. } ) :
  7365. { name: elem.name, value: val.replace( rCRLF, "\r\n" ) };
  7366. } ).get();
  7367. }
  7368. } );
  7369. jQuery.ajaxSettings.xhr = function() {
  7370. try {
  7371. return new window.XMLHttpRequest();
  7372. } catch ( e ) {}
  7373. };
  7374. var xhrSuccessStatus = {
  7375. // File protocol always yields status code 0, assume 200
  7376. 0: 200,
  7377. // Support: IE9
  7378. // #1450: sometimes IE returns 1223 when it should be 204
  7379. 1223: 204
  7380. },
  7381. xhrSupported = jQuery.ajaxSettings.xhr();
  7382. support.cors = !!xhrSupported && ( "withCredentials" in xhrSupported );
  7383. support.ajax = xhrSupported = !!xhrSupported;
  7384. jQuery.ajaxTransport( function( options ) {
  7385. var callback, errorCallback;
  7386. // Cross domain only allowed if supported through XMLHttpRequest
  7387. if ( support.cors || xhrSupported && !options.crossDomain ) {
  7388. return {
  7389. send: function( headers, complete ) {
  7390. var i,
  7391. xhr = options.xhr();
  7392. xhr.open(
  7393. options.type,
  7394. options.url,
  7395. options.async,
  7396. options.username,
  7397. options.password
  7398. );
  7399. // Apply custom fields if provided
  7400. if ( options.xhrFields ) {
  7401. for ( i in options.xhrFields ) {
  7402. xhr[ i ] = options.xhrFields[ i ];
  7403. }
  7404. }
  7405. // Override mime type if needed
  7406. if ( options.mimeType && xhr.overrideMimeType ) {
  7407. xhr.overrideMimeType( options.mimeType );
  7408. }
  7409. // X-Requested-With header
  7410. // For cross-domain requests, seeing as conditions for a preflight are
  7411. // akin to a jigsaw puzzle, we simply never set it to be sure.
  7412. // (it can always be set on a per-request basis or even using ajaxSetup)
  7413. // For same-domain requests, won't change header if already provided.
  7414. if ( !options.crossDomain && !headers[ "X-Requested-With" ] ) {
  7415. headers[ "X-Requested-With" ] = "XMLHttpRequest";
  7416. }
  7417. // Set headers
  7418. for ( i in headers ) {
  7419. xhr.setRequestHeader( i, headers[ i ] );
  7420. }
  7421. // Callback
  7422. callback = function( type ) {
  7423. return function() {
  7424. if ( callback ) {
  7425. callback = errorCallback = xhr.onload =
  7426. xhr.onerror = xhr.onabort = xhr.onreadystatechange = null;
  7427. if ( type === "abort" ) {
  7428. xhr.abort();
  7429. } else if ( type === "error" ) {
  7430. // Support: IE9
  7431. // On a manual native abort, IE9 throws
  7432. // errors on any property access that is not readyState
  7433. if ( typeof xhr.status !== "number" ) {
  7434. complete( 0, "error" );
  7435. } else {
  7436. complete(
  7437. // File: protocol always yields status 0; see #8605, #14207
  7438. xhr.status,
  7439. xhr.statusText
  7440. );
  7441. }
  7442. } else {
  7443. complete(
  7444. xhrSuccessStatus[ xhr.status ] || xhr.status,
  7445. xhr.statusText,
  7446. // Support: IE9 only
  7447. // IE9 has no XHR2 but throws on binary (trac-11426)
  7448. // For XHR2 non-text, let the caller handle it (gh-2498)
  7449. ( xhr.responseType || "text" ) !== "text" ||
  7450. typeof xhr.responseText !== "string" ?
  7451. { binary: xhr.response } :
  7452. { text: xhr.responseText },
  7453. xhr.getAllResponseHeaders()
  7454. );
  7455. }
  7456. }
  7457. };
  7458. };
  7459. // Listen to events
  7460. xhr.onload = callback();
  7461. errorCallback = xhr.onerror = callback( "error" );
  7462. // Support: IE9
  7463. // Use onreadystatechange to replace onabort
  7464. // to handle uncaught aborts
  7465. if ( xhr.onabort !== undefined ) {
  7466. xhr.onabort = errorCallback;
  7467. } else {
  7468. xhr.onreadystatechange = function() {
  7469. // Check readyState before timeout as it changes
  7470. if ( xhr.readyState === 4 ) {
  7471. // Allow onerror to be called first,
  7472. // but that will not handle a native abort
  7473. // Also, save errorCallback to a variable
  7474. // as xhr.onerror cannot be accessed
  7475. window.setTimeout( function() {
  7476. if ( callback ) {
  7477. errorCallback();
  7478. }
  7479. } );
  7480. }
  7481. };
  7482. }
  7483. // Create the abort callback
  7484. callback = callback( "abort" );
  7485. try {
  7486. // Do send the request (this may raise an exception)
  7487. xhr.send( options.hasContent && options.data || null );
  7488. } catch ( e ) {
  7489. // #14683: Only rethrow if this hasn't been notified as an error yet
  7490. if ( callback ) {
  7491. throw e;
  7492. }
  7493. }
  7494. },
  7495. abort: function() {
  7496. if ( callback ) {
  7497. callback();
  7498. }
  7499. }
  7500. };
  7501. }
  7502. } );
  7503. // Install script dataType
  7504. jQuery.ajaxSetup( {
  7505. accepts: {
  7506. script: "text/javascript, application/javascript, " +
  7507. "application/ecmascript, application/x-ecmascript"
  7508. },
  7509. contents: {
  7510. script: /\b(?:java|ecma)script\b/
  7511. },
  7512. converters: {
  7513. "text script": function( text ) {
  7514. jQuery.globalEval( text );
  7515. return text;
  7516. }
  7517. }
  7518. } );
  7519. // Handle cache's special case and crossDomain
  7520. jQuery.ajaxPrefilter( "script", function( s ) {
  7521. if ( s.cache === undefined ) {
  7522. s.cache = false;
  7523. }
  7524. if ( s.crossDomain ) {
  7525. s.type = "GET";
  7526. }
  7527. } );
  7528. // Bind script tag hack transport
  7529. jQuery.ajaxTransport( "script", function( s ) {
  7530. // This transport only deals with cross domain requests
  7531. if ( s.crossDomain ) {
  7532. var script, callback;
  7533. return {
  7534. send: function( _, complete ) {
  7535. script = jQuery( "<script>" ).prop( {
  7536. charset: s.scriptCharset,
  7537. src: s.url
  7538. } ).on(
  7539. "load error",
  7540. callback = function( evt ) {
  7541. script.remove();
  7542. callback = null;
  7543. if ( evt ) {
  7544. complete( evt.type === "error" ? 404 : 200, evt.type );
  7545. }
  7546. }
  7547. );
  7548. // Use native DOM manipulation to avoid our domManip AJAX trickery
  7549. document.head.appendChild( script[ 0 ] );
  7550. },
  7551. abort: function() {
  7552. if ( callback ) {
  7553. callback();
  7554. }
  7555. }
  7556. };
  7557. }
  7558. } );
  7559. var oldCallbacks = [],
  7560. rjsonp = /(=)\?(?=&|$)|\?\?/;
  7561. // Default jsonp settings
  7562. jQuery.ajaxSetup( {
  7563. jsonp: "callback",
  7564. jsonpCallback: function() {
  7565. var callback = oldCallbacks.pop() || ( jQuery.expando + "_" + ( nonce++ ) );
  7566. this[ callback ] = true;
  7567. return callback;
  7568. }
  7569. } );
  7570. // Detect, normalize options and install callbacks for jsonp requests
  7571. jQuery.ajaxPrefilter( "json jsonp", function( s, originalSettings, jqXHR ) {
  7572. var callbackName, overwritten, responseContainer,
  7573. jsonProp = s.jsonp !== false && ( rjsonp.test( s.url ) ?
  7574. "url" :
  7575. typeof s.data === "string" &&
  7576. ( s.contentType || "" )
  7577. .indexOf( "application/x-www-form-urlencoded" ) === 0 &&
  7578. rjsonp.test( s.data ) && "data"
  7579. );
  7580. // Handle iff the expected data type is "jsonp" or we have a parameter to set
  7581. if ( jsonProp || s.dataTypes[ 0 ] === "jsonp" ) {
  7582. // Get callback name, remembering preexisting value associated with it
  7583. callbackName = s.jsonpCallback = jQuery.isFunction( s.jsonpCallback ) ?
  7584. s.jsonpCallback() :
  7585. s.jsonpCallback;
  7586. // Insert callback into url or form data
  7587. if ( jsonProp ) {
  7588. s[ jsonProp ] = s[ jsonProp ].replace( rjsonp, "$1" + callbackName );
  7589. } else if ( s.jsonp !== false ) {
  7590. s.url += ( rquery.test( s.url ) ? "&" : "?" ) + s.jsonp + "=" + callbackName;
  7591. }
  7592. // Use data converter to retrieve json after script execution
  7593. s.converters[ "script json" ] = function() {
  7594. if ( !responseContainer ) {
  7595. jQuery.error( callbackName + " was not called" );
  7596. }
  7597. return responseContainer[ 0 ];
  7598. };
  7599. // Force json dataType
  7600. s.dataTypes[ 0 ] = "json";
  7601. // Install callback
  7602. overwritten = window[ callbackName ];
  7603. window[ callbackName ] = function() {
  7604. responseContainer = arguments;
  7605. };
  7606. // Clean-up function (fires after converters)
  7607. jqXHR.always( function() {
  7608. // If previous value didn't exist - remove it
  7609. if ( overwritten === undefined ) {
  7610. jQuery( window ).removeProp( callbackName );
  7611. // Otherwise restore preexisting value
  7612. } else {
  7613. window[ callbackName ] = overwritten;
  7614. }
  7615. // Save back as free
  7616. if ( s[ callbackName ] ) {
  7617. // Make sure that re-using the options doesn't screw things around
  7618. s.jsonpCallback = originalSettings.jsonpCallback;
  7619. // Save the callback name for future use
  7620. oldCallbacks.push( callbackName );
  7621. }
  7622. // Call if it was a function and we have a response
  7623. if ( responseContainer && jQuery.isFunction( overwritten ) ) {
  7624. overwritten( responseContainer[ 0 ] );
  7625. }
  7626. responseContainer = overwritten = undefined;
  7627. } );
  7628. // Delegate to script
  7629. return "script";
  7630. }
  7631. } );
  7632. // Support: Safari 8+
  7633. // In Safari 8 documents created via document.implementation.createHTMLDocument
  7634. // collapse sibling forms: the second one becomes a child of the first one.
  7635. // Because of that, this security measure has to be disabled in Safari 8.
  7636. // https://bugs.webkit.org/show_bug.cgi?id=137337
  7637. support.createHTMLDocument = ( function() {
  7638. var body = document.implementation.createHTMLDocument( "" ).body;
  7639. body.innerHTML = "<form></form><form></form>";
  7640. return body.childNodes.length === 2;
  7641. } )();
  7642. // Argument "data" should be string of html
  7643. // context (optional): If specified, the fragment will be created in this context,
  7644. // defaults to document
  7645. // keepScripts (optional): If true, will include scripts passed in the html string
  7646. jQuery.parseHTML = function( data, context, keepScripts ) {
  7647. if ( !data || typeof data !== "string" ) {
  7648. return null;
  7649. }
  7650. if ( typeof context === "boolean" ) {
  7651. keepScripts = context;
  7652. context = false;
  7653. }
  7654. // Stop scripts or inline event handlers from being executed immediately
  7655. // by using document.implementation
  7656. context = context || ( support.createHTMLDocument ?
  7657. document.implementation.createHTMLDocument( "" ) :
  7658. document );
  7659. var parsed = rsingleTag.exec( data ),
  7660. scripts = !keepScripts && [];
  7661. // Single tag
  7662. if ( parsed ) {
  7663. return [ context.createElement( parsed[ 1 ] ) ];
  7664. }
  7665. parsed = buildFragment( [ data ], context, scripts );
  7666. if ( scripts && scripts.length ) {
  7667. jQuery( scripts ).remove();
  7668. }
  7669. return jQuery.merge( [], parsed.childNodes );
  7670. };
  7671. // Keep a copy of the old load method
  7672. var _load = jQuery.fn.load;
  7673. /**
  7674. * Load a url into a page
  7675. */
  7676. jQuery.fn.load = function( url, params, callback ) {
  7677. if ( typeof url !== "string" && _load ) {
  7678. return _load.apply( this, arguments );
  7679. }
  7680. var selector, type, response,
  7681. self = this,
  7682. off = url.indexOf( " " );
  7683. if ( off > -1 ) {
  7684. selector = jQuery.trim( url.slice( off ) );
  7685. url = url.slice( 0, off );
  7686. }
  7687. // If it's a function
  7688. if ( jQuery.isFunction( params ) ) {
  7689. // We assume that it's the callback
  7690. callback = params;
  7691. params = undefined;
  7692. // Otherwise, build a param string
  7693. } else if ( params && typeof params === "object" ) {
  7694. type = "POST";
  7695. }
  7696. // If we have elements to modify, make the request
  7697. if ( self.length > 0 ) {
  7698. jQuery.ajax( {
  7699. url: url,
  7700. // If "type" variable is undefined, then "GET" method will be used.
  7701. // Make value of this field explicit since
  7702. // user can override it through ajaxSetup method
  7703. type: type || "GET",
  7704. dataType: "html",
  7705. data: params
  7706. } ).done( function( responseText ) {
  7707. // Save response for use in complete callback
  7708. response = arguments;
  7709. self.html( selector ?
  7710. // If a selector was specified, locate the right elements in a dummy div
  7711. // Exclude scripts to avoid IE 'Permission Denied' errors
  7712. jQuery( "<div>" ).append( jQuery.parseHTML( responseText ) ).find( selector ) :
  7713. // Otherwise use the full result
  7714. responseText );
  7715. // If the request succeeds, this function gets "data", "status", "jqXHR"
  7716. // but they are ignored because response was set above.
  7717. // If it fails, this function gets "jqXHR", "status", "error"
  7718. } ).always( callback && function( jqXHR, status ) {
  7719. self.each( function() {
  7720. callback.apply( self, response || [ jqXHR.responseText, status, jqXHR ] );
  7721. } );
  7722. } );
  7723. }
  7724. return this;
  7725. };
  7726. // Attach a bunch of functions for handling common AJAX events
  7727. jQuery.each( [
  7728. "ajaxStart",
  7729. "ajaxStop",
  7730. "ajaxComplete",
  7731. "ajaxError",
  7732. "ajaxSuccess",
  7733. "ajaxSend"
  7734. ], function( i, type ) {
  7735. jQuery.fn[ type ] = function( fn ) {
  7736. return this.on( type, fn );
  7737. };
  7738. } );
  7739. jQuery.expr.filters.animated = function( elem ) {
  7740. return jQuery.grep( jQuery.timers, function( fn ) {
  7741. return elem === fn.elem;
  7742. } ).length;
  7743. };
  7744. /**
  7745. * Gets a window from an element
  7746. */
  7747. function getWindow( elem ) {
  7748. return jQuery.isWindow( elem ) ? elem : elem.nodeType === 9 && elem.defaultView;
  7749. }
  7750. jQuery.offset = {
  7751. setOffset: function( elem, options, i ) {
  7752. var curPosition, curLeft, curCSSTop, curTop, curOffset, curCSSLeft, calculatePosition,
  7753. position = jQuery.css( elem, "position" ),
  7754. curElem = jQuery( elem ),
  7755. props = {};
  7756. // Set position first, in-case top/left are set even on static elem
  7757. if ( position === "static" ) {
  7758. elem.style.position = "relative";
  7759. }
  7760. curOffset = curElem.offset();
  7761. curCSSTop = jQuery.css( elem, "top" );
  7762. curCSSLeft = jQuery.css( elem, "left" );
  7763. calculatePosition = ( position === "absolute" || position === "fixed" ) &&
  7764. ( curCSSTop + curCSSLeft ).indexOf( "auto" ) > -1;
  7765. // Need to be able to calculate position if either
  7766. // top or left is auto and position is either absolute or fixed
  7767. if ( calculatePosition ) {
  7768. curPosition = curElem.position();
  7769. curTop = curPosition.top;
  7770. curLeft = curPosition.left;
  7771. } else {
  7772. curTop = parseFloat( curCSSTop ) || 0;
  7773. curLeft = parseFloat( curCSSLeft ) || 0;
  7774. }
  7775. if ( jQuery.isFunction( options ) ) {
  7776. // Use jQuery.extend here to allow modification of coordinates argument (gh-1848)
  7777. options = options.call( elem, i, jQuery.extend( {}, curOffset ) );
  7778. }
  7779. if ( options.top != null ) {
  7780. props.top = ( options.top - curOffset.top ) + curTop;
  7781. }
  7782. if ( options.left != null ) {
  7783. props.left = ( options.left - curOffset.left ) + curLeft;
  7784. }
  7785. if ( "using" in options ) {
  7786. options.using.call( elem, props );
  7787. } else {
  7788. curElem.css( props );
  7789. }
  7790. }
  7791. };
  7792. jQuery.fn.extend( {
  7793. offset: function( options ) {
  7794. if ( arguments.length ) {
  7795. return options === undefined ?
  7796. this :
  7797. this.each( function( i ) {
  7798. jQuery.offset.setOffset( this, options, i );
  7799. } );
  7800. }
  7801. var docElem, win,
  7802. elem = this[ 0 ],
  7803. box = { top: 0, left: 0 },
  7804. doc = elem && elem.ownerDocument;
  7805. if ( !doc ) {
  7806. return;
  7807. }
  7808. docElem = doc.documentElement;
  7809. // Make sure it's not a disconnected DOM node
  7810. if ( !jQuery.contains( docElem, elem ) ) {
  7811. return box;
  7812. }
  7813. box = elem.getBoundingClientRect();
  7814. win = getWindow( doc );
  7815. return {
  7816. top: box.top + win.pageYOffset - docElem.clientTop,
  7817. left: box.left + win.pageXOffset - docElem.clientLeft
  7818. };
  7819. },
  7820. position: function() {
  7821. if ( !this[ 0 ] ) {
  7822. return;
  7823. }
  7824. var offsetParent, offset,
  7825. elem = this[ 0 ],
  7826. parentOffset = { top: 0, left: 0 };
  7827. // Fixed elements are offset from window (parentOffset = {top:0, left: 0},
  7828. // because it is its only offset parent
  7829. if ( jQuery.css( elem, "position" ) === "fixed" ) {
  7830. // Assume getBoundingClientRect is there when computed position is fixed
  7831. offset = elem.getBoundingClientRect();
  7832. } else {
  7833. // Get *real* offsetParent
  7834. offsetParent = this.offsetParent();
  7835. // Get correct offsets
  7836. offset = this.offset();
  7837. if ( !jQuery.nodeName( offsetParent[ 0 ], "html" ) ) {
  7838. parentOffset = offsetParent.offset();
  7839. }
  7840. // Add offsetParent borders
  7841. parentOffset.top += jQuery.css( offsetParent[ 0 ], "borderTopWidth", true );
  7842. parentOffset.left += jQuery.css( offsetParent[ 0 ], "borderLeftWidth", true );
  7843. }
  7844. // Subtract parent offsets and element margins
  7845. return {
  7846. top: offset.top - parentOffset.top - jQuery.css( elem, "marginTop", true ),
  7847. left: offset.left - parentOffset.left - jQuery.css( elem, "marginLeft", true )
  7848. };
  7849. },
  7850. // This method will return documentElement in the following cases:
  7851. // 1) For the element inside the iframe without offsetParent, this method will return
  7852. // documentElement of the parent window
  7853. // 2) For the hidden or detached element
  7854. // 3) For body or html element, i.e. in case of the html node - it will return itself
  7855. //
  7856. // but those exceptions were never presented as a real life use-cases
  7857. // and might be considered as more preferable results.
  7858. //
  7859. // This logic, however, is not guaranteed and can change at any point in the future
  7860. offsetParent: function() {
  7861. return this.map( function() {
  7862. var offsetParent = this.offsetParent;
  7863. while ( offsetParent && jQuery.css( offsetParent, "position" ) === "static" ) {
  7864. offsetParent = offsetParent.offsetParent;
  7865. }
  7866. return offsetParent || documentElement;
  7867. } );
  7868. }
  7869. } );
  7870. // Create scrollLeft and scrollTop methods
  7871. jQuery.each( { scrollLeft: "pageXOffset", scrollTop: "pageYOffset" }, function( method, prop ) {
  7872. var top = "pageYOffset" === prop;
  7873. jQuery.fn[ method ] = function( val ) {
  7874. return access( this, function( elem, method, val ) {
  7875. var win = getWindow( elem );
  7876. if ( val === undefined ) {
  7877. return win ? win[ prop ] : elem[ method ];
  7878. }
  7879. if ( win ) {
  7880. win.scrollTo(
  7881. !top ? val : win.pageXOffset,
  7882. top ? val : win.pageYOffset
  7883. );
  7884. } else {
  7885. elem[ method ] = val;
  7886. }
  7887. }, method, val, arguments.length );
  7888. };
  7889. } );
  7890. // Support: Safari<7-8+, Chrome<37-44+
  7891. // Add the top/left cssHooks using jQuery.fn.position
  7892. // Webkit bug: https://bugs.webkit.org/show_bug.cgi?id=29084
  7893. // Blink bug: https://code.google.com/p/chromium/issues/detail?id=229280
  7894. // getComputedStyle returns percent when specified for top/left/bottom/right;
  7895. // rather than make the css module depend on the offset module, just check for it here
  7896. jQuery.each( [ "top", "left" ], function( i, prop ) {
  7897. jQuery.cssHooks[ prop ] = addGetHookIf( support.pixelPosition,
  7898. function( elem, computed ) {
  7899. if ( computed ) {
  7900. computed = curCSS( elem, prop );
  7901. // If curCSS returns percentage, fallback to offset
  7902. return rnumnonpx.test( computed ) ?
  7903. jQuery( elem ).position()[ prop ] + "px" :
  7904. computed;
  7905. }
  7906. }
  7907. );
  7908. } );
  7909. // Create innerHeight, innerWidth, height, width, outerHeight and outerWidth methods
  7910. jQuery.each( { Height: "height", Width: "width" }, function( name, type ) {
  7911. jQuery.each( { padding: "inner" + name, content: type, "": "outer" + name },
  7912. function( defaultExtra, funcName ) {
  7913. // Margin is only for outerHeight, outerWidth
  7914. jQuery.fn[ funcName ] = function( margin, value ) {
  7915. var chainable = arguments.length && ( defaultExtra || typeof margin !== "boolean" ),
  7916. extra = defaultExtra || ( margin === true || value === true ? "margin" : "border" );
  7917. return access( this, function( elem, type, value ) {
  7918. var doc;
  7919. if ( jQuery.isWindow( elem ) ) {
  7920. // As of 5/8/2012 this will yield incorrect results for Mobile Safari, but there
  7921. // isn't a whole lot we can do. See pull request at this URL for discussion:
  7922. // https://github.com/jquery/jquery/pull/764
  7923. return elem.document.documentElement[ "client" + name ];
  7924. }
  7925. // Get document width or height
  7926. if ( elem.nodeType === 9 ) {
  7927. doc = elem.documentElement;
  7928. // Either scroll[Width/Height] or offset[Width/Height] or client[Width/Height],
  7929. // whichever is greatest
  7930. return Math.max(
  7931. elem.body[ "scroll" + name ], doc[ "scroll" + name ],
  7932. elem.body[ "offset" + name ], doc[ "offset" + name ],
  7933. doc[ "client" + name ]
  7934. );
  7935. }
  7936. return value === undefined ?
  7937. // Get width or height on the element, requesting but not forcing parseFloat
  7938. jQuery.css( elem, type, extra ) :
  7939. // Set width or height on the element
  7940. jQuery.style( elem, type, value, extra );
  7941. }, type, chainable ? margin : undefined, chainable, null );
  7942. };
  7943. } );
  7944. } );
  7945. jQuery.fn.extend( {
  7946. bind: function( types, data, fn ) {
  7947. return this.on( types, null, data, fn );
  7948. },
  7949. unbind: function( types, fn ) {
  7950. return this.off( types, null, fn );
  7951. },
  7952. delegate: function( selector, types, data, fn ) {
  7953. return this.on( types, selector, data, fn );
  7954. },
  7955. undelegate: function( selector, types, fn ) {
  7956. // ( namespace ) or ( selector, types [, fn] )
  7957. return arguments.length === 1 ?
  7958. this.off( selector, "**" ) :
  7959. this.off( types, selector || "**", fn );
  7960. },
  7961. size: function() {
  7962. return this.length;
  7963. }
  7964. } );
  7965. jQuery.fn.andSelf = jQuery.fn.addBack;
  7966. // Register as a named AMD module, since jQuery can be concatenated with other
  7967. // files that may use define, but not via a proper concatenation script that
  7968. // understands anonymous AMD modules. A named AMD is safest and most robust
  7969. // way to register. Lowercase jquery is used because AMD module names are
  7970. // derived from file names, and jQuery is normally delivered in a lowercase
  7971. // file name. Do this after creating the global so that if an AMD module wants
  7972. // to call noConflict to hide this version of jQuery, it will work.
  7973. // Note that for maximum portability, libraries that are not jQuery should
  7974. // declare themselves as anonymous modules, and avoid setting a global if an
  7975. // AMD loader is present. jQuery is a special case. For more information, see
  7976. // https://github.com/jrburke/requirejs/wiki/Updating-existing-libraries#wiki-anon
  7977. if ( typeof define === "function" && define.amd ) {
  7978. define( "jquery", [], function() {
  7979. return jQuery;
  7980. } );
  7981. }
  7982. var
  7983. // Map over jQuery in case of overwrite
  7984. _jQuery = window.jQuery,
  7985. // Map over the $ in case of overwrite
  7986. _$ = window.$;
  7987. jQuery.noConflict = function( deep ) {
  7988. if ( window.$ === jQuery ) {
  7989. window.$ = _$;
  7990. }
  7991. if ( deep && window.jQuery === jQuery ) {
  7992. window.jQuery = _jQuery;
  7993. }
  7994. return jQuery;
  7995. };
  7996. // Expose jQuery and $ identifiers, even in AMD
  7997. // (#7102#comment:10, https://github.com/jquery/jquery/pull/557)
  7998. // and CommonJS for browser emulators (#13566)
  7999. if ( !noGlobal ) {
  8000. window.jQuery = window.$ = jQuery;
  8001. }
  8002. return jQuery;
  8003. }));