jquery.slim.js 229 KB

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