the bola v2 website
Você não pode selecionar mais de 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.

jquery.js 312KB

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