You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

jquery.slim.js 322KB

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