the bola v2 website
Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.

jquery.js 279KB

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