jquery.slim.js 210 KB

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