123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316531753185319532053215322532353245325532653275328532953305331533253335334533553365337533853395340534153425343534453455346534753485349535053515352535353545355535653575358535953605361536253635364536553665367536853695370537153725373537453755376537753785379538053815382538353845385538653875388538953905391539253935394539553965397539853995400540154025403540454055406540754085409541054115412541354145415541654175418541954205421542254235424542554265427542854295430543154325433543454355436543754385439544054415442544354445445544654475448544954505451545254535454545554565457545854595460546154625463546454655466546754685469547054715472547354745475547654775478547954805481548254835484548554865487548854895490549154925493549454955496549754985499550055015502550355045505550655075508550955105511551255135514551555165517551855195520552155225523552455255526552755285529553055315532553355345535553655375538553955405541554255435544554555465547554855495550555155525553555455555556555755585559556055615562556355645565556655675568556955705571557255735574557555765577557855795580558155825583558455855586558755885589559055915592559355945595559655975598559956005601560256035604560556065607560856095610561156125613561456155616561756185619562056215622562356245625562656275628562956305631563256335634563556365637563856395640564156425643564456455646564756485649565056515652565356545655565656575658565956605661566256635664566556665667566856695670567156725673567456755676567756785679568056815682568356845685568656875688568956905691569256935694569556965697569856995700570157025703570457055706570757085709571057115712571357145715571657175718571957205721572257235724572557265727572857295730573157325733573457355736573757385739574057415742574357445745574657475748574957505751575257535754575557565757575857595760576157625763576457655766576757685769577057715772577357745775577657775778577957805781578257835784578557865787578857895790579157925793579457955796579757985799580058015802580358045805580658075808580958105811581258135814581558165817581858195820582158225823582458255826582758285829583058315832583358345835583658375838583958405841584258435844584558465847584858495850585158525853585458555856585758585859586058615862586358645865586658675868586958705871587258735874587558765877587858795880588158825883588458855886588758885889589058915892589358945895589658975898589959005901590259035904590559065907590859095910591159125913591459155916591759185919592059215922592359245925592659275928592959305931593259335934593559365937593859395940594159425943594459455946594759485949595059515952595359545955595659575958595959605961596259635964596559665967596859695970597159725973597459755976597759785979598059815982598359845985598659875988598959905991599259935994599559965997599859996000600160026003600460056006600760086009601060116012601360146015601660176018601960206021602260236024602560266027602860296030603160326033603460356036603760386039604060416042604360446045604660476048604960506051605260536054605560566057605860596060606160626063606460656066606760686069607060716072607360746075607660776078607960806081608260836084608560866087608860896090609160926093609460956096609760986099610061016102610361046105610661076108610961106111611261136114611561166117611861196120612161226123612461256126612761286129613061316132613361346135613661376138613961406141614261436144614561466147614861496150615161526153615461556156615761586159616061616162616361646165616661676168616961706171617261736174617561766177617861796180618161826183618461856186618761886189619061916192619361946195619661976198619962006201620262036204620562066207620862096210621162126213621462156216621762186219622062216222622362246225622662276228622962306231623262336234623562366237623862396240624162426243624462456246624762486249625062516252625362546255625662576258625962606261626262636264626562666267626862696270627162726273627462756276627762786279628062816282628362846285628662876288628962906291629262936294629562966297629862996300630163026303630463056306630763086309631063116312631363146315631663176318631963206321632263236324632563266327632863296330633163326333633463356336633763386339634063416342634363446345634663476348634963506351635263536354635563566357635863596360636163626363636463656366636763686369637063716372637363746375637663776378637963806381638263836384638563866387638863896390639163926393639463956396639763986399640064016402640364046405640664076408640964106411641264136414641564166417641864196420642164226423642464256426642764286429643064316432643364346435643664376438643964406441644264436444644564466447644864496450645164526453645464556456645764586459646064616462646364646465646664676468646964706471647264736474647564766477647864796480648164826483648464856486648764886489649064916492649364946495649664976498649965006501650265036504650565066507650865096510651165126513651465156516651765186519652065216522652365246525652665276528652965306531653265336534653565366537653865396540654165426543654465456546654765486549655065516552655365546555655665576558655965606561656265636564656565666567656865696570657165726573657465756576657765786579658065816582658365846585658665876588658965906591659265936594659565966597659865996600660166026603660466056606660766086609661066116612661366146615661666176618661966206621662266236624662566266627662866296630663166326633663466356636663766386639664066416642664366446645664666476648664966506651665266536654665566566657665866596660666166626663666466656666666766686669667066716672667366746675667666776678667966806681668266836684668566866687668866896690669166926693669466956696669766986699670067016702670367046705670667076708670967106711671267136714671567166717671867196720672167226723672467256726672767286729673067316732673367346735673667376738673967406741674267436744674567466747674867496750675167526753675467556756675767586759676067616762676367646765676667676768676967706771677267736774677567766777677867796780678167826783678467856786678767886789679067916792679367946795679667976798679968006801680268036804680568066807680868096810681168126813681468156816681768186819682068216822682368246825682668276828682968306831683268336834683568366837683868396840684168426843684468456846684768486849685068516852685368546855685668576858685968606861686268636864686568666867686868696870687168726873687468756876687768786879688068816882688368846885688668876888688968906891689268936894689568966897689868996900690169026903690469056906690769086909691069116912691369146915691669176918691969206921692269236924692569266927692869296930693169326933693469356936693769386939694069416942694369446945694669476948694969506951695269536954695569566957695869596960696169626963696469656966696769686969697069716972697369746975697669776978697969806981698269836984698569866987698869896990699169926993699469956996699769986999700070017002700370047005700670077008700970107011701270137014701570167017701870197020702170227023702470257026702770287029703070317032703370347035703670377038703970407041704270437044704570467047704870497050705170527053705470557056705770587059706070617062706370647065706670677068706970707071707270737074707570767077707870797080708170827083708470857086708770887089709070917092709370947095709670977098709971007101710271037104710571067107710871097110711171127113711471157116711771187119712071217122712371247125712671277128712971307131713271337134713571367137713871397140714171427143714471457146714771487149715071517152715371547155715671577158715971607161716271637164716571667167716871697170717171727173717471757176717771787179718071817182718371847185718671877188718971907191719271937194719571967197719871997200720172027203720472057206720772087209721072117212721372147215721672177218721972207221722272237224722572267227722872297230723172327233723472357236723772387239724072417242724372447245724672477248724972507251725272537254725572567257725872597260726172627263726472657266726772687269727072717272727372747275727672777278727972807281728272837284728572867287728872897290729172927293729472957296729772987299730073017302730373047305730673077308730973107311731273137314731573167317731873197320732173227323732473257326732773287329733073317332733373347335733673377338733973407341734273437344734573467347734873497350735173527353735473557356735773587359736073617362736373647365736673677368736973707371737273737374737573767377737873797380738173827383738473857386738773887389739073917392739373947395739673977398739974007401740274037404740574067407740874097410741174127413741474157416741774187419742074217422742374247425742674277428742974307431743274337434743574367437743874397440744174427443744474457446744774487449745074517452745374547455745674577458745974607461746274637464746574667467746874697470747174727473747474757476747774787479748074817482748374847485748674877488748974907491749274937494749574967497749874997500750175027503750475057506750775087509751075117512751375147515751675177518751975207521752275237524752575267527752875297530753175327533753475357536753775387539754075417542754375447545754675477548754975507551755275537554755575567557755875597560756175627563756475657566756775687569757075717572757375747575757675777578757975807581758275837584758575867587758875897590759175927593759475957596759775987599760076017602760376047605760676077608760976107611761276137614761576167617761876197620762176227623762476257626762776287629763076317632763376347635763676377638763976407641764276437644764576467647764876497650765176527653765476557656765776587659766076617662766376647665766676677668766976707671767276737674767576767677767876797680768176827683768476857686768776887689769076917692769376947695769676977698769977007701770277037704770577067707770877097710771177127713771477157716771777187719772077217722772377247725772677277728772977307731773277337734773577367737773877397740774177427743774477457746774777487749775077517752775377547755775677577758775977607761776277637764776577667767776877697770777177727773777477757776777777787779778077817782778377847785778677877788778977907791779277937794779577967797779877997800780178027803780478057806780778087809781078117812781378147815781678177818781978207821782278237824782578267827782878297830783178327833783478357836783778387839784078417842784378447845784678477848784978507851785278537854785578567857785878597860786178627863786478657866786778687869787078717872787378747875787678777878787978807881788278837884788578867887788878897890789178927893789478957896789778987899790079017902790379047905790679077908790979107911791279137914791579167917791879197920792179227923792479257926792779287929793079317932793379347935793679377938793979407941794279437944794579467947794879497950795179527953795479557956795779587959796079617962796379647965796679677968796979707971797279737974797579767977797879797980798179827983798479857986798779887989799079917992799379947995799679977998799980008001800280038004800580068007800880098010801180128013801480158016801780188019802080218022802380248025802680278028802980308031803280338034803580368037803880398040804180428043804480458046804780488049805080518052805380548055805680578058805980608061806280638064806580668067806880698070807180728073807480758076807780788079808080818082808380848085808680878088808980908091809280938094809580968097809880998100810181028103810481058106810781088109811081118112811381148115811681178118811981208121812281238124812581268127812881298130813181328133813481358136813781388139814081418142814381448145814681478148814981508151815281538154815581568157815881598160816181628163816481658166816781688169817081718172817381748175817681778178817981808181818281838184818581868187818881898190819181928193819481958196819781988199820082018202820382048205820682078208820982108211821282138214821582168217821882198220822182228223822482258226822782288229823082318232823382348235823682378238823982408241824282438244824582468247824882498250825182528253825482558256825782588259826082618262826382648265826682678268826982708271827282738274827582768277827882798280828182828283828482858286828782888289829082918292829382948295829682978298829983008301830283038304830583068307830883098310831183128313831483158316831783188319832083218322832383248325832683278328832983308331833283338334833583368337833883398340834183428343834483458346834783488349835083518352835383548355835683578358835983608361836283638364836583668367836883698370837183728373837483758376837783788379838083818382838383848385838683878388838983908391839283938394839583968397839883998400840184028403840484058406840784088409841084118412841384148415841684178418841984208421842284238424842584268427842884298430843184328433843484358436843784388439844084418442844384448445844684478448844984508451845284538454845584568457845884598460846184628463846484658466846784688469847084718472847384748475847684778478847984808481848284838484848584868487848884898490849184928493849484958496849784988499850085018502850385048505850685078508850985108511851285138514851585168517851885198520852185228523852485258526852785288529853085318532853385348535853685378538853985408541854285438544854585468547854885498550855185528553855485558556855785588559856085618562856385648565856685678568856985708571857285738574857585768577857885798580858185828583858485858586858785888589859085918592859385948595859685978598859986008601860286038604860586068607860886098610861186128613861486158616861786188619862086218622862386248625862686278628862986308631863286338634863586368637863886398640864186428643864486458646864786488649865086518652865386548655865686578658865986608661866286638664866586668667866886698670867186728673867486758676867786788679868086818682868386848685868686878688868986908691869286938694869586968697869886998700870187028703870487058706870787088709871087118712871387148715871687178718871987208721872287238724872587268727872887298730873187328733873487358736873787388739874087418742874387448745874687478748874987508751875287538754875587568757875887598760876187628763876487658766876787688769877087718772877387748775877687778778877987808781878287838784878587868787878887898790879187928793879487958796879787988799880088018802880388048805880688078808880988108811881288138814881588168817881888198820882188228823882488258826882788288829883088318832883388348835883688378838883988408841884288438844884588468847884888498850885188528853885488558856885788588859886088618862886388648865886688678868886988708871887288738874887588768877887888798880888188828883888488858886888788888889889088918892889388948895889688978898889989008901890289038904890589068907890889098910891189128913891489158916891789188919892089218922892389248925892689278928892989308931893289338934893589368937893889398940894189428943894489458946894789488949895089518952895389548955895689578958895989608961896289638964896589668967896889698970897189728973897489758976897789788979898089818982898389848985898689878988898989908991899289938994899589968997899889999000900190029003900490059006900790089009901090119012901390149015901690179018901990209021902290239024902590269027902890299030903190329033903490359036903790389039904090419042904390449045904690479048904990509051905290539054905590569057905890599060906190629063906490659066906790689069907090719072907390749075907690779078907990809081908290839084908590869087908890899090909190929093909490959096909790989099910091019102910391049105910691079108910991109111911291139114911591169117911891199120912191229123912491259126912791289129913091319132913391349135913691379138913991409141914291439144914591469147914891499150915191529153915491559156915791589159916091619162916391649165916691679168916991709171917291739174917591769177917891799180918191829183918491859186918791889189919091919192919391949195919691979198919992009201920292039204920592069207920892099210921192129213921492159216921792189219922092219222922392249225922692279228922992309231923292339234923592369237923892399240924192429243924492459246924792489249925092519252925392549255925692579258925992609261926292639264926592669267926892699270927192729273927492759276927792789279928092819282928392849285928692879288928992909291929292939294929592969297929892999300930193029303930493059306930793089309931093119312931393149315931693179318931993209321932293239324932593269327932893299330933193329333933493359336933793389339934093419342934393449345934693479348934993509351935293539354935593569357935893599360936193629363936493659366936793689369937093719372937393749375937693779378937993809381938293839384938593869387938893899390939193929393939493959396939793989399940094019402940394049405940694079408940994109411941294139414941594169417941894199420942194229423942494259426942794289429943094319432943394349435943694379438943994409441944294439444944594469447944894499450945194529453945494559456945794589459946094619462946394649465946694679468946994709471947294739474947594769477947894799480948194829483948494859486948794889489949094919492949394949495949694979498949995009501950295039504950595069507950895099510951195129513951495159516951795189519952095219522952395249525952695279528952995309531953295339534953595369537953895399540954195429543954495459546954795489549955095519552955395549555955695579558955995609561956295639564956595669567956895699570957195729573957495759576957795789579958095819582958395849585958695879588958995909591959295939594959595969597959895999600960196029603960496059606960796089609961096119612961396149615961696179618961996209621962296239624962596269627962896299630963196329633963496359636963796389639964096419642964396449645964696479648964996509651965296539654965596569657965896599660966196629663966496659666966796689669967096719672967396749675967696779678967996809681968296839684968596869687968896899690969196929693969496959696969796989699970097019702970397049705970697079708970997109711971297139714971597169717971897199720972197229723972497259726972797289729973097319732973397349735973697379738973997409741974297439744974597469747974897499750975197529753975497559756975797589759976097619762976397649765976697679768976997709771977297739774977597769777977897799780978197829783978497859786978797889789979097919792979397949795979697979798979998009801980298039804980598069807980898099810981198129813981498159816981798189819982098219822982398249825982698279828982998309831983298339834983598369837983898399840984198429843984498459846984798489849985098519852985398549855985698579858985998609861986298639864986598669867986898699870987198729873987498759876987798789879988098819882988398849885988698879888988998909891989298939894989598969897989898999900990199029903990499059906990799089909991099119912991399149915991699179918991999209921992299239924992599269927992899299930993199329933993499359936993799389939994099419942994399449945994699479948994999509951995299539954995599569957995899599960996199629963996499659966996799689969997099719972997399749975997699779978997999809981998299839984998599869987998899899990999199929993999499959996999799989999100001000110002100031000410005100061000710008100091001010011100121001310014100151001610017100181001910020100211002210023100241002510026100271002810029100301003110032100331003410035100361003710038100391004010041100421004310044100451004610047100481004910050100511005210053100541005510056100571005810059100601006110062100631006410065100661006710068100691007010071100721007310074100751007610077100781007910080100811008210083100841008510086100871008810089100901009110092100931009410095100961009710098100991010010101101021010310104101051010610107101081010910110101111011210113101141011510116101171011810119101201012110122101231012410125101261012710128101291013010131101321013310134101351013610137101381013910140101411014210143101441014510146101471014810149101501015110152101531015410155101561015710158101591016010161101621016310164101651016610167101681016910170101711017210173101741017510176101771017810179101801018110182101831018410185101861018710188101891019010191101921019310194101951019610197101981019910200102011020210203102041020510206102071020810209102101021110212102131021410215102161021710218102191022010221102221022310224102251022610227102281022910230102311023210233102341023510236102371023810239102401024110242102431024410245102461024710248102491025010251102521025310254102551025610257102581025910260102611026210263102641026510266102671026810269102701027110272102731027410275102761027710278102791028010281102821028310284102851028610287102881028910290102911029210293102941029510296102971029810299103001030110302103031030410305103061030710308103091031010311103121031310314103151031610317103181031910320103211032210323103241032510326103271032810329103301033110332103331033410335103361033710338103391034010341103421034310344103451034610347103481034910350103511035210353103541035510356103571035810359103601036110362103631036410365103661036710368103691037010371103721037310374103751037610377103781037910380103811038210383103841038510386103871038810389103901039110392103931039410395103961039710398103991040010401104021040310404104051040610407104081040910410104111041210413104141041510416104171041810419104201042110422104231042410425104261042710428104291043010431104321043310434104351043610437104381043910440104411044210443104441044510446104471044810449104501045110452104531045410455104561045710458104591046010461104621046310464104651046610467104681046910470104711047210473104741047510476104771047810479104801048110482104831048410485104861048710488104891049010491104921049310494104951049610497104981049910500105011050210503105041050510506105071050810509105101051110512105131051410515105161051710518105191052010521105221052310524105251052610527105281052910530105311053210533105341053510536105371053810539105401054110542105431054410545105461054710548105491055010551105521055310554105551055610557105581055910560105611056210563105641056510566105671056810569105701057110572105731057410575105761057710578105791058010581105821058310584105851058610587105881058910590105911059210593105941059510596105971059810599106001060110602106031060410605106061060710608106091061010611106121061310614106151061610617106181061910620106211062210623106241062510626106271062810629106301063110632106331063410635106361063710638106391064010641106421064310644106451064610647106481064910650106511065210653106541065510656106571065810659106601066110662106631066410665106661066710668106691067010671106721067310674106751067610677106781067910680106811068210683106841068510686106871068810689106901069110692106931069410695106961069710698106991070010701107021070310704107051070610707107081070910710107111071210713107141071510716107171071810719107201072110722107231072410725107261072710728107291073010731107321073310734107351073610737107381073910740107411074210743107441074510746107471074810749107501075110752107531075410755107561075710758107591076010761107621076310764107651076610767107681076910770107711077210773107741077510776107771077810779107801078110782107831078410785107861078710788107891079010791107921079310794107951079610797107981079910800108011080210803108041080510806108071080810809108101081110812108131081410815108161081710818108191082010821108221082310824108251082610827108281082910830108311083210833108341083510836108371083810839108401084110842108431084410845108461084710848108491085010851108521085310854108551085610857108581085910860108611086210863108641086510866108671086810869108701087110872108731087410875108761087710878108791088010881108821088310884108851088610887108881088910890108911089210893108941089510896108971089810899109001090110902109031090410905109061090710908109091091010911109121091310914109151091610917109181091910920109211092210923109241092510926109271092810929109301093110932109331093410935109361093710938109391094010941109421094310944109451094610947109481094910950109511095210953109541095510956109571095810959109601096110962109631096410965109661096710968109691097010971109721097310974109751097610977109781097910980109811098210983109841098510986109871098810989109901099110992109931099410995109961099710998109991100011001110021100311004110051100611007110081100911010110111101211013110141101511016110171101811019110201102111022110231102411025110261102711028110291103011031110321103311034110351103611037110381103911040110411104211043110441104511046110471104811049110501105111052110531105411055110561105711058110591106011061110621106311064110651106611067110681106911070110711107211073110741107511076110771107811079110801108111082110831108411085110861108711088110891109011091110921109311094110951109611097110981109911100111011110211103111041110511106111071110811109111101111111112111131111411115111161111711118111191112011121111221112311124111251112611127111281112911130111311113211133111341113511136111371113811139111401114111142111431114411145111461114711148111491115011151111521115311154111551115611157111581115911160111611116211163111641116511166111671116811169111701117111172111731117411175111761117711178111791118011181111821118311184111851118611187111881118911190111911119211193111941119511196111971119811199112001120111202112031120411205112061120711208112091121011211112121121311214112151121611217112181121911220112211122211223112241122511226112271122811229112301123111232112331123411235112361123711238112391124011241112421124311244112451124611247112481124911250112511125211253112541125511256112571125811259112601126111262112631126411265112661126711268112691127011271112721127311274112751127611277112781127911280112811128211283112841128511286112871128811289112901129111292112931129411295112961129711298112991130011301113021130311304113051130611307113081130911310113111131211313113141131511316113171131811319113201132111322113231132411325113261132711328113291133011331113321133311334113351133611337113381133911340113411134211343113441134511346113471134811349113501135111352113531135411355113561135711358113591136011361113621136311364113651136611367113681136911370113711137211373113741137511376113771137811379113801138111382113831138411385113861138711388113891139011391113921139311394113951139611397113981139911400114011140211403114041140511406114071140811409114101141111412114131141411415114161141711418114191142011421114221142311424114251142611427114281142911430114311143211433114341143511436114371143811439114401144111442114431144411445114461144711448114491145011451114521145311454114551145611457114581145911460114611146211463114641146511466114671146811469114701147111472114731147411475114761147711478114791148011481114821148311484114851148611487114881148911490114911149211493114941149511496114971149811499115001150111502115031150411505115061150711508115091151011511115121151311514115151151611517115181151911520115211152211523115241152511526115271152811529115301153111532115331153411535115361153711538115391154011541115421154311544115451154611547115481154911550115511155211553115541155511556115571155811559115601156111562115631156411565115661156711568115691157011571115721157311574115751157611577115781157911580115811158211583115841158511586115871158811589115901159111592115931159411595115961159711598115991160011601116021160311604116051160611607116081160911610116111161211613116141161511616116171161811619116201162111622116231162411625116261162711628116291163011631116321163311634116351163611637116381163911640116411164211643116441164511646116471164811649116501165111652116531165411655116561165711658116591166011661116621166311664116651166611667116681166911670116711167211673116741167511676116771167811679116801168111682116831168411685116861168711688116891169011691116921169311694116951169611697116981169911700117011170211703117041170511706117071170811709117101171111712117131171411715117161171711718117191172011721117221172311724117251172611727117281172911730117311173211733117341173511736117371173811739117401174111742117431174411745117461174711748117491175011751117521175311754117551175611757117581175911760117611176211763117641176511766117671176811769117701177111772117731177411775117761177711778117791178011781117821178311784117851178611787117881178911790117911179211793117941179511796117971179811799118001180111802118031180411805118061180711808118091181011811118121181311814118151181611817118181181911820118211182211823118241182511826118271182811829118301183111832118331183411835118361183711838118391184011841118421184311844118451184611847118481184911850118511185211853118541185511856118571185811859118601186111862118631186411865118661186711868118691187011871118721187311874118751187611877118781187911880118811188211883118841188511886118871188811889118901189111892118931189411895118961189711898118991190011901119021190311904119051190611907119081190911910119111191211913119141191511916119171191811919119201192111922119231192411925119261192711928119291193011931119321193311934119351193611937119381193911940119411194211943119441194511946119471194811949119501195111952119531195411955119561195711958119591196011961119621196311964119651196611967119681196911970119711197211973119741197511976119771197811979119801198111982119831198411985119861198711988119891199011991119921199311994119951199611997119981199912000120011200212003120041200512006120071200812009120101201112012120131201412015120161201712018120191202012021120221202312024120251202612027120281202912030120311203212033120341203512036120371203812039120401204112042120431204412045120461204712048120491205012051120521205312054120551205612057120581205912060120611206212063120641206512066120671206812069120701207112072120731207412075120761207712078120791208012081120821208312084120851208612087120881208912090120911209212093120941209512096120971209812099121001210112102121031210412105121061210712108121091211012111121121211312114121151211612117121181211912120121211212212123121241212512126121271212812129121301213112132121331213412135121361213712138121391214012141121421214312144121451214612147121481214912150121511215212153121541215512156121571215812159121601216112162121631216412165121661216712168121691217012171121721217312174121751217612177121781217912180121811218212183121841218512186121871218812189121901219112192121931219412195121961219712198121991220012201122021220312204122051220612207122081220912210122111221212213122141221512216122171221812219122201222112222122231222412225122261222712228122291223012231122321223312234122351223612237122381223912240122411224212243122441224512246122471224812249122501225112252122531225412255122561225712258122591226012261122621226312264122651226612267122681226912270122711227212273122741227512276122771227812279122801228112282122831228412285122861228712288122891229012291122921229312294122951229612297122981229912300123011230212303123041230512306123071230812309123101231112312123131231412315123161231712318123191232012321123221232312324123251232612327123281232912330123311233212333123341233512336123371233812339123401234112342123431234412345123461234712348123491235012351123521235312354123551235612357123581235912360123611236212363123641236512366123671236812369123701237112372123731237412375123761237712378123791238012381123821238312384123851238612387123881238912390123911239212393123941239512396123971239812399124001240112402124031240412405124061240712408124091241012411124121241312414124151241612417124181241912420124211242212423124241242512426124271242812429124301243112432124331243412435124361243712438124391244012441124421244312444124451244612447124481244912450124511245212453124541245512456124571245812459124601246112462124631246412465124661246712468124691247012471124721247312474124751247612477124781247912480124811248212483124841248512486124871248812489124901249112492124931249412495124961249712498124991250012501125021250312504125051250612507125081250912510125111251212513125141251512516125171251812519125201252112522125231252412525125261252712528125291253012531125321253312534125351253612537125381253912540125411254212543125441254512546125471254812549125501255112552125531255412555125561255712558125591256012561125621256312564125651256612567125681256912570125711257212573125741257512576125771257812579125801258112582125831258412585125861258712588125891259012591125921259312594125951259612597125981259912600126011260212603126041260512606126071260812609126101261112612126131261412615126161261712618126191262012621126221262312624126251262612627126281262912630126311263212633126341263512636126371263812639126401264112642126431264412645126461264712648126491265012651126521265312654126551265612657126581265912660126611266212663126641266512666126671266812669126701267112672126731267412675126761267712678126791268012681126821268312684126851268612687126881268912690126911269212693126941269512696126971269812699127001270112702127031270412705127061270712708127091271012711127121271312714127151271612717127181271912720127211272212723127241272512726127271272812729127301273112732127331273412735127361273712738127391274012741127421274312744127451274612747127481274912750127511275212753127541275512756127571275812759127601276112762127631276412765127661276712768127691277012771127721277312774127751277612777127781277912780127811278212783127841278512786127871278812789127901279112792127931279412795127961279712798127991280012801128021280312804128051280612807128081280912810128111281212813128141281512816128171281812819128201282112822128231282412825128261282712828128291283012831128321283312834128351283612837128381283912840128411284212843128441284512846128471284812849128501285112852128531285412855128561285712858128591286012861128621286312864128651286612867128681286912870128711287212873128741287512876128771287812879128801288112882128831288412885128861288712888128891289012891128921289312894128951289612897128981289912900129011290212903129041290512906129071290812909129101291112912129131291412915129161291712918129191292012921129221292312924129251292612927129281292912930129311293212933129341293512936129371293812939129401294112942129431294412945129461294712948129491295012951129521295312954129551295612957129581295912960129611296212963129641296512966129671296812969129701297112972129731297412975129761297712978129791298012981129821298312984129851298612987129881298912990129911299212993129941299512996129971299812999130001300113002130031300413005130061300713008130091301013011 |
- var __defProp = Object.defineProperty;
- var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
- var __publicField = (obj, key, value) => {
- __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
- return value;
- };
- (function() {
- "use strict";
- const version = "1.0.0";
- class JsSpiderSDK {
- // 初始化,传入规则
- constructor(rules = [], config = {}) {
- __publicField(this, "rulesList", []);
- __publicField(this, "config", {
- useAsync: true
- });
- this.rulesList = rules;
- Object.assign(this.config, config);
- }
- async run() {
- const { useAsync } = this.config;
- let result = [];
- if (useAsync) {
- const rulesRunPromiseList = this.rulesList.map((rule) => rule.run());
- result = await Promise.all(rulesRunPromiseList);
- } else {
- for (let i = 0; i < this.rulesList.length; i++) {
- const rule = this.rulesList[i];
- const runRes = await rule.run();
- result.push(runRes);
- }
- }
- return result;
- }
- check() {
- }
- }
- var commonjsGlobal = typeof globalThis !== "undefined" ? globalThis : typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : {};
- function getDefaultExportFromCjs(x) {
- return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, "default") ? x["default"] : x;
- }
- var jquery = { exports: {} };
- /*!
- * jQuery JavaScript Library v3.7.1
- * https://jquery.com/
- *
- * Copyright OpenJS Foundation and other contributors
- * Released under the MIT license
- * https://jquery.org/license
- *
- * Date: 2023-08-28T13:37Z
- */
- (function(module) {
- (function(global2, factory) {
- {
- module.exports = global2.document ? factory(global2, true) : function(w) {
- if (!w.document) {
- throw new Error("jQuery requires a window with a document");
- }
- return factory(w);
- };
- }
- })(typeof window !== "undefined" ? window : commonjsGlobal, function(window2, noGlobal) {
- var arr = [];
- var getProto = Object.getPrototypeOf;
- var slice = arr.slice;
- var flat = arr.flat ? function(array) {
- return arr.flat.call(array);
- } : function(array) {
- return arr.concat.apply([], array);
- };
- var push = arr.push;
- var indexOf = arr.indexOf;
- var class2type = {};
- var toString = class2type.toString;
- var hasOwn = class2type.hasOwnProperty;
- var fnToString = hasOwn.toString;
- var ObjectFunctionString = fnToString.call(Object);
- var support = {};
- var isFunction = function isFunction2(obj) {
- return typeof obj === "function" && typeof obj.nodeType !== "number" && typeof obj.item !== "function";
- };
- var isWindow = function isWindow2(obj) {
- return obj != null && obj === obj.window;
- };
- var document2 = window2.document;
- var preservedScriptAttributes = {
- type: true,
- src: true,
- nonce: true,
- noModule: true
- };
- function DOMEval(code, node, doc) {
- doc = doc || document2;
- var i, val, script = doc.createElement("script");
- script.text = code;
- if (node) {
- for (i in preservedScriptAttributes) {
- val = node[i] || node.getAttribute && node.getAttribute(i);
- if (val) {
- script.setAttribute(i, val);
- }
- }
- }
- doc.head.appendChild(script).parentNode.removeChild(script);
- }
- function toType(obj) {
- if (obj == null) {
- return obj + "";
- }
- return typeof obj === "object" || typeof obj === "function" ? class2type[toString.call(obj)] || "object" : typeof obj;
- }
- var version2 = "3.7.1", rhtmlSuffix = /HTML$/i, jQuery = function(selector, context) {
- return new jQuery.fn.init(selector, context);
- };
- jQuery.fn = jQuery.prototype = {
- // The current version of jQuery being used
- jquery: version2,
- constructor: jQuery,
- // The default length of a jQuery object is 0
- length: 0,
- toArray: function() {
- return slice.call(this);
- },
- // Get the Nth element in the matched element set OR
- // Get the whole matched element set as a clean array
- get: function(num) {
- if (num == null) {
- return slice.call(this);
- }
- return num < 0 ? this[num + this.length] : this[num];
- },
- // Take an array of elements and push it onto the stack
- // (returning the new matched element set)
- pushStack: function(elems) {
- var ret = jQuery.merge(this.constructor(), elems);
- ret.prevObject = this;
- return ret;
- },
- // Execute a callback for every element in the matched set.
- each: function(callback) {
- return jQuery.each(this, callback);
- },
- map: function(callback) {
- return this.pushStack(jQuery.map(this, function(elem, i) {
- return callback.call(elem, i, elem);
- }));
- },
- slice: function() {
- return this.pushStack(slice.apply(this, arguments));
- },
- first: function() {
- return this.eq(0);
- },
- last: function() {
- return this.eq(-1);
- },
- even: function() {
- return this.pushStack(jQuery.grep(this, function(_elem, i) {
- return (i + 1) % 2;
- }));
- },
- odd: function() {
- return this.pushStack(jQuery.grep(this, function(_elem, i) {
- return i % 2;
- }));
- },
- eq: function(i) {
- var len = this.length, j = +i + (i < 0 ? len : 0);
- return this.pushStack(j >= 0 && j < len ? [this[j]] : []);
- },
- end: function() {
- return this.prevObject || this.constructor();
- },
- // For internal use only.
- // Behaves like an Array's method, not like a jQuery method.
- push,
- sort: arr.sort,
- splice: arr.splice
- };
- jQuery.extend = jQuery.fn.extend = function() {
- var options, name, src, copy, copyIsArray, clone, target = arguments[0] || {}, i = 1, length = arguments.length, deep = false;
- if (typeof target === "boolean") {
- deep = target;
- target = arguments[i] || {};
- i++;
- }
- if (typeof target !== "object" && !isFunction(target)) {
- target = {};
- }
- if (i === length) {
- target = this;
- i--;
- }
- for (; i < length; i++) {
- if ((options = arguments[i]) != null) {
- for (name in options) {
- copy = options[name];
- if (name === "__proto__" || target === copy) {
- continue;
- }
- if (deep && copy && (jQuery.isPlainObject(copy) || (copyIsArray = Array.isArray(copy)))) {
- src = target[name];
- if (copyIsArray && !Array.isArray(src)) {
- clone = [];
- } else if (!copyIsArray && !jQuery.isPlainObject(src)) {
- clone = {};
- } else {
- clone = src;
- }
- copyIsArray = false;
- target[name] = jQuery.extend(deep, clone, copy);
- } else if (copy !== void 0) {
- target[name] = copy;
- }
- }
- }
- }
- return target;
- };
- jQuery.extend({
- // Unique for each copy of jQuery on the page
- expando: "jQuery" + (version2 + Math.random()).replace(/\D/g, ""),
- // Assume jQuery is ready without the ready module
- isReady: true,
- error: function(msg) {
- throw new Error(msg);
- },
- noop: function() {
- },
- isPlainObject: function(obj) {
- var proto, Ctor;
- if (!obj || toString.call(obj) !== "[object Object]") {
- return false;
- }
- proto = getProto(obj);
- if (!proto) {
- return true;
- }
- Ctor = hasOwn.call(proto, "constructor") && proto.constructor;
- return typeof Ctor === "function" && fnToString.call(Ctor) === ObjectFunctionString;
- },
- isEmptyObject: function(obj) {
- var name;
- for (name in obj) {
- return false;
- }
- return true;
- },
- // Evaluates a script in a provided context; falls back to the global one
- // if not specified.
- globalEval: function(code, options, doc) {
- DOMEval(code, { nonce: options && options.nonce }, doc);
- },
- each: function(obj, callback) {
- var length, i = 0;
- if (isArrayLike(obj)) {
- length = obj.length;
- for (; i < length; i++) {
- if (callback.call(obj[i], i, obj[i]) === false) {
- break;
- }
- }
- } else {
- for (i in obj) {
- if (callback.call(obj[i], i, obj[i]) === false) {
- break;
- }
- }
- }
- return obj;
- },
- // Retrieve the text value of an array of DOM nodes
- text: function(elem) {
- var node, ret = "", i = 0, nodeType = elem.nodeType;
- if (!nodeType) {
- while (node = elem[i++]) {
- ret += jQuery.text(node);
- }
- }
- if (nodeType === 1 || nodeType === 11) {
- return elem.textContent;
- }
- if (nodeType === 9) {
- return elem.documentElement.textContent;
- }
- if (nodeType === 3 || nodeType === 4) {
- return elem.nodeValue;
- }
- return ret;
- },
- // results is for internal usage only
- makeArray: function(arr2, results) {
- var ret = results || [];
- if (arr2 != null) {
- if (isArrayLike(Object(arr2))) {
- jQuery.merge(
- ret,
- typeof arr2 === "string" ? [arr2] : arr2
- );
- } else {
- push.call(ret, arr2);
- }
- }
- return ret;
- },
- inArray: function(elem, arr2, i) {
- return arr2 == null ? -1 : indexOf.call(arr2, elem, i);
- },
- isXMLDoc: function(elem) {
- var namespace = elem && elem.namespaceURI, docElem = elem && (elem.ownerDocument || elem).documentElement;
- return !rhtmlSuffix.test(namespace || docElem && docElem.nodeName || "HTML");
- },
- // Support: Android <=4.0 only, PhantomJS 1 only
- // push.apply(_, arraylike) throws on ancient WebKit
- merge: function(first, second) {
- var len = +second.length, j = 0, i = first.length;
- for (; j < len; j++) {
- first[i++] = second[j];
- }
- first.length = i;
- return first;
- },
- grep: function(elems, callback, invert) {
- var callbackInverse, matches = [], i = 0, length = elems.length, callbackExpect = !invert;
- for (; i < length; i++) {
- callbackInverse = !callback(elems[i], i);
- if (callbackInverse !== callbackExpect) {
- matches.push(elems[i]);
- }
- }
- return matches;
- },
- // arg is for internal usage only
- map: function(elems, callback, arg) {
- var length, value, i = 0, ret = [];
- if (isArrayLike(elems)) {
- length = elems.length;
- for (; i < length; i++) {
- value = callback(elems[i], i, arg);
- if (value != null) {
- ret.push(value);
- }
- }
- } else {
- for (i in elems) {
- value = callback(elems[i], i, arg);
- if (value != null) {
- ret.push(value);
- }
- }
- }
- return flat(ret);
- },
- // A global GUID counter for objects
- guid: 1,
- // jQuery.support is not used in Core but other projects attach their
- // properties to it so it needs to exist.
- support
- });
- if (typeof Symbol === "function") {
- jQuery.fn[Symbol.iterator] = arr[Symbol.iterator];
- }
- jQuery.each(
- "Boolean Number String Function Array Date RegExp Object Error Symbol".split(" "),
- function(_i, name) {
- class2type["[object " + name + "]"] = name.toLowerCase();
- }
- );
- function isArrayLike(obj) {
- var length = !!obj && "length" in obj && obj.length, type = toType(obj);
- if (isFunction(obj) || isWindow(obj)) {
- return false;
- }
- return type === "array" || length === 0 || typeof length === "number" && length > 0 && length - 1 in obj;
- }
- function nodeName(elem, name) {
- return elem.nodeName && elem.nodeName.toLowerCase() === name.toLowerCase();
- }
- var pop = arr.pop;
- var sort = arr.sort;
- var splice = arr.splice;
- var whitespace = "[\\x20\\t\\r\\n\\f]";
- var rtrimCSS = new RegExp(
- "^" + whitespace + "+|((?:^|[^\\\\])(?:\\\\.)*)" + whitespace + "+$",
- "g"
- );
- jQuery.contains = function(a, b) {
- var bup = b && b.parentNode;
- return a === bup || !!(bup && bup.nodeType === 1 && // Support: IE 9 - 11+
- // IE doesn't have `contains` on SVG.
- (a.contains ? a.contains(bup) : a.compareDocumentPosition && a.compareDocumentPosition(bup) & 16));
- };
- var rcssescape = /([\0-\x1f\x7f]|^-?\d)|^-$|[^\x80-\uFFFF\w-]/g;
- function fcssescape(ch, asCodePoint) {
- if (asCodePoint) {
- if (ch === "\0") {
- return "�";
- }
- return ch.slice(0, -1) + "\\" + ch.charCodeAt(ch.length - 1).toString(16) + " ";
- }
- return "\\" + ch;
- }
- jQuery.escapeSelector = function(sel) {
- return (sel + "").replace(rcssescape, fcssescape);
- };
- var preferredDoc = document2, pushNative = push;
- (function() {
- var i, Expr, outermostContext, sortInput, hasDuplicate, push2 = pushNative, document3, documentElement2, documentIsHTML, rbuggyQSA, matches, expando = jQuery.expando, dirruns = 0, done = 0, classCache = createCache(), tokenCache = createCache(), compilerCache = createCache(), nonnativeSelectorCache = createCache(), sortOrder = function(a, b) {
- if (a === b) {
- hasDuplicate = true;
- }
- return 0;
- }, booleans = "checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped", identifier = "(?:\\\\[\\da-fA-F]{1,6}" + whitespace + "?|\\\\[^\\r\\n\\f]|[\\w-]|[^\0-\\x7f])+", attributes = "\\[" + whitespace + "*(" + identifier + ")(?:" + whitespace + // Operator (capture 2)
- "*([*^$|!~]?=)" + whitespace + // "Attribute values must be CSS identifiers [capture 5] or strings [capture 3 or capture 4]"
- `*(?:'((?:\\\\.|[^\\\\'])*)'|"((?:\\\\.|[^\\\\"])*)"|(` + identifier + "))|)" + whitespace + "*\\]", pseudos = ":(" + identifier + `)(?:\\((('((?:\\\\.|[^\\\\'])*)'|"((?:\\\\.|[^\\\\"])*)")|((?:\\\\.|[^\\\\()[\\]]|` + attributes + ")*)|.*)\\)|)", rwhitespace = new RegExp(whitespace + "+", "g"), rcomma = new RegExp("^" + whitespace + "*," + whitespace + "*"), rleadingCombinator = new RegExp("^" + whitespace + "*([>+~]|" + whitespace + ")" + whitespace + "*"), rdescend = new RegExp(whitespace + "|>"), rpseudo = new RegExp(pseudos), ridentifier = new RegExp("^" + identifier + "$"), matchExpr = {
- ID: new RegExp("^#(" + identifier + ")"),
- CLASS: new RegExp("^\\.(" + identifier + ")"),
- TAG: new RegExp("^(" + identifier + "|[*])"),
- ATTR: new RegExp("^" + attributes),
- PSEUDO: new RegExp("^" + pseudos),
- CHILD: new RegExp(
- "^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\(" + whitespace + "*(even|odd|(([+-]|)(\\d*)n|)" + whitespace + "*(?:([+-]|)" + whitespace + "*(\\d+)|))" + whitespace + "*\\)|)",
- "i"
- ),
- bool: new RegExp("^(?:" + booleans + ")$", "i"),
- // For use in libraries implementing .is()
- // We use this for POS matching in `select`
- needsContext: new RegExp("^" + whitespace + "*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\(" + whitespace + "*((?:-\\d)?\\d*)" + whitespace + "*\\)|)(?=[^-]|$)", "i")
- }, rinputs = /^(?:input|select|textarea|button)$/i, rheader = /^h\d$/i, rquickExpr2 = /^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/, rsibling = /[+~]/, runescape = new RegExp("\\\\[\\da-fA-F]{1,6}" + whitespace + "?|\\\\([^\\r\\n\\f])", "g"), funescape = function(escape, nonHex) {
- var high = "0x" + escape.slice(1) - 65536;
- if (nonHex) {
- return nonHex;
- }
- return high < 0 ? String.fromCharCode(high + 65536) : String.fromCharCode(high >> 10 | 55296, high & 1023 | 56320);
- }, unloadHandler = function() {
- setDocument();
- }, inDisabledFieldset = addCombinator(
- function(elem) {
- return elem.disabled === true && nodeName(elem, "fieldset");
- },
- { dir: "parentNode", next: "legend" }
- );
- function safeActiveElement() {
- try {
- return document3.activeElement;
- } catch (err) {
- }
- }
- try {
- push2.apply(
- arr = slice.call(preferredDoc.childNodes),
- preferredDoc.childNodes
- );
- arr[preferredDoc.childNodes.length].nodeType;
- } catch (e) {
- push2 = {
- apply: function(target, els) {
- pushNative.apply(target, slice.call(els));
- },
- call: function(target) {
- pushNative.apply(target, slice.call(arguments, 1));
- }
- };
- }
- function find(selector, context, results, seed) {
- var m, i2, elem, nid, match, groups, newSelector, newContext = context && context.ownerDocument, nodeType = context ? context.nodeType : 9;
- results = results || [];
- if (typeof selector !== "string" || !selector || nodeType !== 1 && nodeType !== 9 && nodeType !== 11) {
- return results;
- }
- if (!seed) {
- setDocument(context);
- context = context || document3;
- if (documentIsHTML) {
- if (nodeType !== 11 && (match = rquickExpr2.exec(selector))) {
- if (m = match[1]) {
- if (nodeType === 9) {
- if (elem = context.getElementById(m)) {
- if (elem.id === m) {
- push2.call(results, elem);
- return results;
- }
- } else {
- return results;
- }
- } else {
- if (newContext && (elem = newContext.getElementById(m)) && find.contains(context, elem) && elem.id === m) {
- push2.call(results, elem);
- return results;
- }
- }
- } else if (match[2]) {
- push2.apply(results, context.getElementsByTagName(selector));
- return results;
- } else if ((m = match[3]) && context.getElementsByClassName) {
- push2.apply(results, context.getElementsByClassName(m));
- return results;
- }
- }
- if (!nonnativeSelectorCache[selector + " "] && (!rbuggyQSA || !rbuggyQSA.test(selector))) {
- newSelector = selector;
- newContext = context;
- if (nodeType === 1 && (rdescend.test(selector) || rleadingCombinator.test(selector))) {
- newContext = rsibling.test(selector) && testContext(context.parentNode) || context;
- if (newContext != context || !support.scope) {
- if (nid = context.getAttribute("id")) {
- nid = jQuery.escapeSelector(nid);
- } else {
- context.setAttribute("id", nid = expando);
- }
- }
- groups = tokenize(selector);
- i2 = groups.length;
- while (i2--) {
- groups[i2] = (nid ? "#" + nid : ":scope") + " " + toSelector(groups[i2]);
- }
- newSelector = groups.join(",");
- }
- try {
- push2.apply(
- results,
- newContext.querySelectorAll(newSelector)
- );
- return results;
- } catch (qsaError) {
- nonnativeSelectorCache(selector, true);
- } finally {
- if (nid === expando) {
- context.removeAttribute("id");
- }
- }
- }
- }
- }
- return select(selector.replace(rtrimCSS, "$1"), context, results, seed);
- }
- function createCache() {
- var keys = [];
- function cache(key, value) {
- if (keys.push(key + " ") > Expr.cacheLength) {
- delete cache[keys.shift()];
- }
- return cache[key + " "] = value;
- }
- return cache;
- }
- function markFunction(fn) {
- fn[expando] = true;
- return fn;
- }
- function assert(fn) {
- var el = document3.createElement("fieldset");
- try {
- return !!fn(el);
- } catch (e) {
- return false;
- } finally {
- if (el.parentNode) {
- el.parentNode.removeChild(el);
- }
- el = null;
- }
- }
- function createInputPseudo(type) {
- return function(elem) {
- return nodeName(elem, "input") && elem.type === type;
- };
- }
- function createButtonPseudo(type) {
- return function(elem) {
- return (nodeName(elem, "input") || nodeName(elem, "button")) && elem.type === type;
- };
- }
- function createDisabledPseudo(disabled) {
- return function(elem) {
- if ("form" in elem) {
- if (elem.parentNode && elem.disabled === false) {
- if ("label" in elem) {
- if ("label" in elem.parentNode) {
- return elem.parentNode.disabled === disabled;
- } else {
- return elem.disabled === disabled;
- }
- }
- return elem.isDisabled === disabled || // Where there is no isDisabled, check manually
- elem.isDisabled !== !disabled && inDisabledFieldset(elem) === disabled;
- }
- return elem.disabled === disabled;
- } else if ("label" in elem) {
- return elem.disabled === disabled;
- }
- return false;
- };
- }
- function createPositionalPseudo(fn) {
- return markFunction(function(argument) {
- argument = +argument;
- return markFunction(function(seed, matches2) {
- var j, matchIndexes = fn([], seed.length, argument), i2 = matchIndexes.length;
- while (i2--) {
- if (seed[j = matchIndexes[i2]]) {
- seed[j] = !(matches2[j] = seed[j]);
- }
- }
- });
- });
- }
- function testContext(context) {
- return context && typeof context.getElementsByTagName !== "undefined" && context;
- }
- function setDocument(node) {
- var subWindow, doc = node ? node.ownerDocument || node : preferredDoc;
- if (doc == document3 || doc.nodeType !== 9 || !doc.documentElement) {
- return document3;
- }
- document3 = doc;
- documentElement2 = document3.documentElement;
- documentIsHTML = !jQuery.isXMLDoc(document3);
- matches = documentElement2.matches || documentElement2.webkitMatchesSelector || documentElement2.msMatchesSelector;
- if (documentElement2.msMatchesSelector && // Support: IE 11+, Edge 17 - 18+
- // IE/Edge sometimes throw a "Permission denied" error when strict-comparing
- // two documents; shallow comparisons work.
- // eslint-disable-next-line eqeqeq
- preferredDoc != document3 && (subWindow = document3.defaultView) && subWindow.top !== subWindow) {
- subWindow.addEventListener("unload", unloadHandler);
- }
- support.getById = assert(function(el) {
- documentElement2.appendChild(el).id = jQuery.expando;
- return !document3.getElementsByName || !document3.getElementsByName(jQuery.expando).length;
- });
- support.disconnectedMatch = assert(function(el) {
- return matches.call(el, "*");
- });
- support.scope = assert(function() {
- return document3.querySelectorAll(":scope");
- });
- support.cssHas = assert(function() {
- try {
- document3.querySelector(":has(*,:jqfake)");
- return false;
- } catch (e) {
- return true;
- }
- });
- if (support.getById) {
- Expr.filter.ID = function(id) {
- var attrId = id.replace(runescape, funescape);
- return function(elem) {
- return elem.getAttribute("id") === attrId;
- };
- };
- Expr.find.ID = function(id, context) {
- if (typeof context.getElementById !== "undefined" && documentIsHTML) {
- var elem = context.getElementById(id);
- return elem ? [elem] : [];
- }
- };
- } else {
- Expr.filter.ID = function(id) {
- var attrId = id.replace(runescape, funescape);
- return function(elem) {
- var node2 = typeof elem.getAttributeNode !== "undefined" && elem.getAttributeNode("id");
- return node2 && node2.value === attrId;
- };
- };
- Expr.find.ID = function(id, context) {
- if (typeof context.getElementById !== "undefined" && documentIsHTML) {
- var node2, i2, elems, elem = context.getElementById(id);
- if (elem) {
- node2 = elem.getAttributeNode("id");
- if (node2 && node2.value === id) {
- return [elem];
- }
- elems = context.getElementsByName(id);
- i2 = 0;
- while (elem = elems[i2++]) {
- node2 = elem.getAttributeNode("id");
- if (node2 && node2.value === id) {
- return [elem];
- }
- }
- }
- return [];
- }
- };
- }
- Expr.find.TAG = function(tag, context) {
- if (typeof context.getElementsByTagName !== "undefined") {
- return context.getElementsByTagName(tag);
- } else {
- return context.querySelectorAll(tag);
- }
- };
- Expr.find.CLASS = function(className, context) {
- if (typeof context.getElementsByClassName !== "undefined" && documentIsHTML) {
- return context.getElementsByClassName(className);
- }
- };
- rbuggyQSA = [];
- assert(function(el) {
- var input;
- documentElement2.appendChild(el).innerHTML = "<a id='" + expando + "' href='' disabled='disabled'></a><select id='" + expando + "-\r\\' disabled='disabled'><option selected=''></option></select>";
- if (!el.querySelectorAll("[selected]").length) {
- rbuggyQSA.push("\\[" + whitespace + "*(?:value|" + booleans + ")");
- }
- if (!el.querySelectorAll("[id~=" + expando + "-]").length) {
- rbuggyQSA.push("~=");
- }
- if (!el.querySelectorAll("a#" + expando + "+*").length) {
- rbuggyQSA.push(".#.+[+~]");
- }
- if (!el.querySelectorAll(":checked").length) {
- rbuggyQSA.push(":checked");
- }
- input = document3.createElement("input");
- input.setAttribute("type", "hidden");
- el.appendChild(input).setAttribute("name", "D");
- documentElement2.appendChild(el).disabled = true;
- if (el.querySelectorAll(":disabled").length !== 2) {
- rbuggyQSA.push(":enabled", ":disabled");
- }
- input = document3.createElement("input");
- input.setAttribute("name", "");
- el.appendChild(input);
- if (!el.querySelectorAll("[name='']").length) {
- rbuggyQSA.push("\\[" + whitespace + "*name" + whitespace + "*=" + whitespace + `*(?:''|"")`);
- }
- });
- if (!support.cssHas) {
- rbuggyQSA.push(":has");
- }
- rbuggyQSA = rbuggyQSA.length && new RegExp(rbuggyQSA.join("|"));
- sortOrder = function(a, b) {
- if (a === b) {
- hasDuplicate = true;
- return 0;
- }
- var compare = !a.compareDocumentPosition - !b.compareDocumentPosition;
- if (compare) {
- return compare;
- }
- compare = (a.ownerDocument || a) == (b.ownerDocument || b) ? a.compareDocumentPosition(b) : (
- // Otherwise we know they are disconnected
- 1
- );
- if (compare & 1 || !support.sortDetached && b.compareDocumentPosition(a) === compare) {
- if (a === document3 || a.ownerDocument == preferredDoc && find.contains(preferredDoc, a)) {
- return -1;
- }
- if (b === document3 || b.ownerDocument == preferredDoc && find.contains(preferredDoc, b)) {
- return 1;
- }
- return sortInput ? indexOf.call(sortInput, a) - indexOf.call(sortInput, b) : 0;
- }
- return compare & 4 ? -1 : 1;
- };
- return document3;
- }
- find.matches = function(expr, elements) {
- return find(expr, null, null, elements);
- };
- find.matchesSelector = function(elem, expr) {
- setDocument(elem);
- if (documentIsHTML && !nonnativeSelectorCache[expr + " "] && (!rbuggyQSA || !rbuggyQSA.test(expr))) {
- try {
- var ret = matches.call(elem, expr);
- if (ret || support.disconnectedMatch || // As well, disconnected nodes are said to be in a document
- // fragment in IE 9
- elem.document && elem.document.nodeType !== 11) {
- return ret;
- }
- } catch (e) {
- nonnativeSelectorCache(expr, true);
- }
- }
- return find(expr, document3, null, [elem]).length > 0;
- };
- find.contains = function(context, elem) {
- if ((context.ownerDocument || context) != document3) {
- setDocument(context);
- }
- return jQuery.contains(context, elem);
- };
- find.attr = function(elem, name) {
- if ((elem.ownerDocument || elem) != document3) {
- setDocument(elem);
- }
- var fn = Expr.attrHandle[name.toLowerCase()], val = fn && hasOwn.call(Expr.attrHandle, name.toLowerCase()) ? fn(elem, name, !documentIsHTML) : void 0;
- if (val !== void 0) {
- return val;
- }
- return elem.getAttribute(name);
- };
- find.error = function(msg) {
- throw new Error("Syntax error, unrecognized expression: " + msg);
- };
- jQuery.uniqueSort = function(results) {
- var elem, duplicates = [], j = 0, i2 = 0;
- hasDuplicate = !support.sortStable;
- sortInput = !support.sortStable && slice.call(results, 0);
- sort.call(results, sortOrder);
- if (hasDuplicate) {
- while (elem = results[i2++]) {
- if (elem === results[i2]) {
- j = duplicates.push(i2);
- }
- }
- while (j--) {
- splice.call(results, duplicates[j], 1);
- }
- }
- sortInput = null;
- return results;
- };
- jQuery.fn.uniqueSort = function() {
- return this.pushStack(jQuery.uniqueSort(slice.apply(this)));
- };
- Expr = jQuery.expr = {
- // Can be adjusted by the user
- cacheLength: 50,
- createPseudo: markFunction,
- match: matchExpr,
- attrHandle: {},
- find: {},
- relative: {
- ">": { dir: "parentNode", first: true },
- " ": { dir: "parentNode" },
- "+": { dir: "previousSibling", first: true },
- "~": { dir: "previousSibling" }
- },
- preFilter: {
- ATTR: function(match) {
- match[1] = match[1].replace(runescape, funescape);
- match[3] = (match[3] || match[4] || match[5] || "").replace(runescape, funescape);
- if (match[2] === "~=") {
- match[3] = " " + match[3] + " ";
- }
- return match.slice(0, 4);
- },
- CHILD: function(match) {
- match[1] = match[1].toLowerCase();
- if (match[1].slice(0, 3) === "nth") {
- if (!match[3]) {
- find.error(match[0]);
- }
- match[4] = +(match[4] ? match[5] + (match[6] || 1) : 2 * (match[3] === "even" || match[3] === "odd"));
- match[5] = +(match[7] + match[8] || match[3] === "odd");
- } else if (match[3]) {
- find.error(match[0]);
- }
- return match;
- },
- PSEUDO: function(match) {
- var excess, unquoted = !match[6] && match[2];
- if (matchExpr.CHILD.test(match[0])) {
- return null;
- }
- if (match[3]) {
- match[2] = match[4] || match[5] || "";
- } else if (unquoted && rpseudo.test(unquoted) && // Get excess from tokenize (recursively)
- (excess = tokenize(unquoted, true)) && // advance to the next closing parenthesis
- (excess = unquoted.indexOf(")", unquoted.length - excess) - unquoted.length)) {
- match[0] = match[0].slice(0, excess);
- match[2] = unquoted.slice(0, excess);
- }
- return match.slice(0, 3);
- }
- },
- filter: {
- TAG: function(nodeNameSelector) {
- var expectedNodeName = nodeNameSelector.replace(runescape, funescape).toLowerCase();
- return nodeNameSelector === "*" ? function() {
- return true;
- } : function(elem) {
- return nodeName(elem, expectedNodeName);
- };
- },
- CLASS: function(className) {
- var pattern = classCache[className + " "];
- return pattern || (pattern = new RegExp("(^|" + whitespace + ")" + className + "(" + whitespace + "|$)")) && classCache(className, function(elem) {
- return pattern.test(
- typeof elem.className === "string" && elem.className || typeof elem.getAttribute !== "undefined" && elem.getAttribute("class") || ""
- );
- });
- },
- ATTR: function(name, operator, check) {
- return function(elem) {
- var result = find.attr(elem, name);
- if (result == null) {
- return operator === "!=";
- }
- if (!operator) {
- return true;
- }
- result += "";
- if (operator === "=") {
- return result === check;
- }
- if (operator === "!=") {
- return result !== check;
- }
- if (operator === "^=") {
- return check && result.indexOf(check) === 0;
- }
- if (operator === "*=") {
- return check && result.indexOf(check) > -1;
- }
- if (operator === "$=") {
- return check && result.slice(-check.length) === check;
- }
- if (operator === "~=") {
- return (" " + result.replace(rwhitespace, " ") + " ").indexOf(check) > -1;
- }
- if (operator === "|=") {
- return result === check || result.slice(0, check.length + 1) === check + "-";
- }
- return false;
- };
- },
- CHILD: function(type, what, _argument, first, last) {
- var simple = type.slice(0, 3) !== "nth", forward = type.slice(-4) !== "last", ofType = what === "of-type";
- return first === 1 && last === 0 ? (
- // Shortcut for :nth-*(n)
- function(elem) {
- return !!elem.parentNode;
- }
- ) : function(elem, _context, xml) {
- var cache, outerCache, node, nodeIndex, start, dir2 = simple !== forward ? "nextSibling" : "previousSibling", parent = elem.parentNode, name = ofType && elem.nodeName.toLowerCase(), useCache = !xml && !ofType, diff = false;
- if (parent) {
- if (simple) {
- while (dir2) {
- node = elem;
- while (node = node[dir2]) {
- if (ofType ? nodeName(node, name) : node.nodeType === 1) {
- return false;
- }
- }
- start = dir2 = type === "only" && !start && "nextSibling";
- }
- return true;
- }
- start = [forward ? parent.firstChild : parent.lastChild];
- if (forward && useCache) {
- outerCache = parent[expando] || (parent[expando] = {});
- cache = outerCache[type] || [];
- nodeIndex = cache[0] === dirruns && cache[1];
- diff = nodeIndex && cache[2];
- node = nodeIndex && parent.childNodes[nodeIndex];
- while (node = ++nodeIndex && node && node[dir2] || // Fallback to seeking `elem` from the start
- (diff = nodeIndex = 0) || start.pop()) {
- if (node.nodeType === 1 && ++diff && node === elem) {
- outerCache[type] = [dirruns, nodeIndex, diff];
- break;
- }
- }
- } else {
- if (useCache) {
- outerCache = elem[expando] || (elem[expando] = {});
- cache = outerCache[type] || [];
- nodeIndex = cache[0] === dirruns && cache[1];
- diff = nodeIndex;
- }
- if (diff === false) {
- while (node = ++nodeIndex && node && node[dir2] || (diff = nodeIndex = 0) || start.pop()) {
- if ((ofType ? nodeName(node, name) : node.nodeType === 1) && ++diff) {
- if (useCache) {
- outerCache = node[expando] || (node[expando] = {});
- outerCache[type] = [dirruns, diff];
- }
- if (node === elem) {
- break;
- }
- }
- }
- }
- }
- diff -= last;
- return diff === first || diff % first === 0 && diff / first >= 0;
- }
- };
- },
- PSEUDO: function(pseudo, argument) {
- var args, fn = Expr.pseudos[pseudo] || Expr.setFilters[pseudo.toLowerCase()] || find.error("unsupported pseudo: " + pseudo);
- if (fn[expando]) {
- return fn(argument);
- }
- if (fn.length > 1) {
- args = [pseudo, pseudo, "", argument];
- return Expr.setFilters.hasOwnProperty(pseudo.toLowerCase()) ? markFunction(function(seed, matches2) {
- var idx, matched = fn(seed, argument), i2 = matched.length;
- while (i2--) {
- idx = indexOf.call(seed, matched[i2]);
- seed[idx] = !(matches2[idx] = matched[i2]);
- }
- }) : function(elem) {
- return fn(elem, 0, args);
- };
- }
- return fn;
- }
- },
- pseudos: {
- // Potentially complex pseudos
- not: markFunction(function(selector) {
- var input = [], results = [], matcher = compile(selector.replace(rtrimCSS, "$1"));
- return matcher[expando] ? markFunction(function(seed, matches2, _context, xml) {
- var elem, unmatched = matcher(seed, null, xml, []), i2 = seed.length;
- while (i2--) {
- if (elem = unmatched[i2]) {
- seed[i2] = !(matches2[i2] = elem);
- }
- }
- }) : function(elem, _context, xml) {
- input[0] = elem;
- matcher(input, null, xml, results);
- input[0] = null;
- return !results.pop();
- };
- }),
- has: markFunction(function(selector) {
- return function(elem) {
- return find(selector, elem).length > 0;
- };
- }),
- contains: markFunction(function(text) {
- text = text.replace(runescape, funescape);
- return function(elem) {
- return (elem.textContent || jQuery.text(elem)).indexOf(text) > -1;
- };
- }),
- // "Whether an element is represented by a :lang() selector
- // is based solely on the element's language value
- // being equal to the identifier C,
- // or beginning with the identifier C immediately followed by "-".
- // The matching of C against the element's language value is performed case-insensitively.
- // The identifier C does not have to be a valid language name."
- // https://www.w3.org/TR/selectors/#lang-pseudo
- lang: markFunction(function(lang) {
- if (!ridentifier.test(lang || "")) {
- find.error("unsupported lang: " + lang);
- }
- lang = lang.replace(runescape, funescape).toLowerCase();
- return function(elem) {
- var elemLang;
- do {
- if (elemLang = documentIsHTML ? elem.lang : elem.getAttribute("xml:lang") || elem.getAttribute("lang")) {
- elemLang = elemLang.toLowerCase();
- return elemLang === lang || elemLang.indexOf(lang + "-") === 0;
- }
- } while ((elem = elem.parentNode) && elem.nodeType === 1);
- return false;
- };
- }),
- // Miscellaneous
- target: function(elem) {
- var hash = window2.location && window2.location.hash;
- return hash && hash.slice(1) === elem.id;
- },
- root: function(elem) {
- return elem === documentElement2;
- },
- focus: function(elem) {
- return elem === safeActiveElement() && document3.hasFocus() && !!(elem.type || elem.href || ~elem.tabIndex);
- },
- // Boolean properties
- enabled: createDisabledPseudo(false),
- disabled: createDisabledPseudo(true),
- checked: function(elem) {
- return nodeName(elem, "input") && !!elem.checked || nodeName(elem, "option") && !!elem.selected;
- },
- selected: function(elem) {
- if (elem.parentNode) {
- elem.parentNode.selectedIndex;
- }
- return elem.selected === true;
- },
- // Contents
- empty: function(elem) {
- for (elem = elem.firstChild; elem; elem = elem.nextSibling) {
- if (elem.nodeType < 6) {
- return false;
- }
- }
- return true;
- },
- parent: function(elem) {
- return !Expr.pseudos.empty(elem);
- },
- // Element/input types
- header: function(elem) {
- return rheader.test(elem.nodeName);
- },
- input: function(elem) {
- return rinputs.test(elem.nodeName);
- },
- button: function(elem) {
- return nodeName(elem, "input") && elem.type === "button" || nodeName(elem, "button");
- },
- text: function(elem) {
- var attr;
- return nodeName(elem, "input") && elem.type === "text" && // Support: IE <10 only
- // New HTML5 attribute values (e.g., "search") appear
- // with elem.type === "text"
- ((attr = elem.getAttribute("type")) == null || attr.toLowerCase() === "text");
- },
- // Position-in-collection
- first: createPositionalPseudo(function() {
- return [0];
- }),
- last: createPositionalPseudo(function(_matchIndexes, length) {
- return [length - 1];
- }),
- eq: createPositionalPseudo(function(_matchIndexes, length, argument) {
- return [argument < 0 ? argument + length : argument];
- }),
- even: createPositionalPseudo(function(matchIndexes, length) {
- var i2 = 0;
- for (; i2 < length; i2 += 2) {
- matchIndexes.push(i2);
- }
- return matchIndexes;
- }),
- odd: createPositionalPseudo(function(matchIndexes, length) {
- var i2 = 1;
- for (; i2 < length; i2 += 2) {
- matchIndexes.push(i2);
- }
- return matchIndexes;
- }),
- lt: createPositionalPseudo(function(matchIndexes, length, argument) {
- var i2;
- if (argument < 0) {
- i2 = argument + length;
- } else if (argument > length) {
- i2 = length;
- } else {
- i2 = argument;
- }
- for (; --i2 >= 0; ) {
- matchIndexes.push(i2);
- }
- return matchIndexes;
- }),
- gt: createPositionalPseudo(function(matchIndexes, length, argument) {
- var i2 = argument < 0 ? argument + length : argument;
- for (; ++i2 < length; ) {
- matchIndexes.push(i2);
- }
- return matchIndexes;
- })
- }
- };
- Expr.pseudos.nth = Expr.pseudos.eq;
- for (i in { radio: true, checkbox: true, file: true, password: true, image: true }) {
- Expr.pseudos[i] = createInputPseudo(i);
- }
- for (i in { submit: true, reset: true }) {
- Expr.pseudos[i] = createButtonPseudo(i);
- }
- function setFilters() {
- }
- setFilters.prototype = Expr.filters = Expr.pseudos;
- Expr.setFilters = new setFilters();
- function tokenize(selector, parseOnly) {
- var matched, match, tokens, type, soFar, groups, preFilters, cached = tokenCache[selector + " "];
- if (cached) {
- return parseOnly ? 0 : cached.slice(0);
- }
- soFar = selector;
- groups = [];
- preFilters = Expr.preFilter;
- while (soFar) {
- if (!matched || (match = rcomma.exec(soFar))) {
- if (match) {
- soFar = soFar.slice(match[0].length) || soFar;
- }
- groups.push(tokens = []);
- }
- matched = false;
- if (match = rleadingCombinator.exec(soFar)) {
- matched = match.shift();
- tokens.push({
- value: matched,
- // Cast descendant combinators to space
- type: match[0].replace(rtrimCSS, " ")
- });
- soFar = soFar.slice(matched.length);
- }
- for (type in Expr.filter) {
- if ((match = matchExpr[type].exec(soFar)) && (!preFilters[type] || (match = preFilters[type](match)))) {
- matched = match.shift();
- tokens.push({
- value: matched,
- type,
- matches: match
- });
- soFar = soFar.slice(matched.length);
- }
- }
- if (!matched) {
- break;
- }
- }
- if (parseOnly) {
- return soFar.length;
- }
- return soFar ? find.error(selector) : (
- // Cache the tokens
- tokenCache(selector, groups).slice(0)
- );
- }
- function toSelector(tokens) {
- var i2 = 0, len = tokens.length, selector = "";
- for (; i2 < len; i2++) {
- selector += tokens[i2].value;
- }
- return selector;
- }
- function addCombinator(matcher, combinator, base) {
- var dir2 = combinator.dir, skip = combinator.next, key = skip || dir2, checkNonElements = base && key === "parentNode", doneName = done++;
- return combinator.first ? (
- // Check against closest ancestor/preceding element
- function(elem, context, xml) {
- while (elem = elem[dir2]) {
- if (elem.nodeType === 1 || checkNonElements) {
- return matcher(elem, context, xml);
- }
- }
- return false;
- }
- ) : (
- // Check against all ancestor/preceding elements
- function(elem, context, xml) {
- var oldCache, outerCache, newCache = [dirruns, doneName];
- if (xml) {
- while (elem = elem[dir2]) {
- if (elem.nodeType === 1 || checkNonElements) {
- if (matcher(elem, context, xml)) {
- return true;
- }
- }
- }
- } else {
- while (elem = elem[dir2]) {
- if (elem.nodeType === 1 || checkNonElements) {
- outerCache = elem[expando] || (elem[expando] = {});
- if (skip && nodeName(elem, skip)) {
- elem = elem[dir2] || elem;
- } else if ((oldCache = outerCache[key]) && oldCache[0] === dirruns && oldCache[1] === doneName) {
- return newCache[2] = oldCache[2];
- } else {
- outerCache[key] = newCache;
- if (newCache[2] = matcher(elem, context, xml)) {
- return true;
- }
- }
- }
- }
- }
- return false;
- }
- );
- }
- function elementMatcher(matchers) {
- return matchers.length > 1 ? function(elem, context, xml) {
- var i2 = matchers.length;
- while (i2--) {
- if (!matchers[i2](elem, context, xml)) {
- return false;
- }
- }
- return true;
- } : matchers[0];
- }
- function multipleContexts(selector, contexts, results) {
- var i2 = 0, len = contexts.length;
- for (; i2 < len; i2++) {
- find(selector, contexts[i2], results);
- }
- return results;
- }
- function condense(unmatched, map, filter, context, xml) {
- var elem, newUnmatched = [], i2 = 0, len = unmatched.length, mapped = map != null;
- for (; i2 < len; i2++) {
- if (elem = unmatched[i2]) {
- if (!filter || filter(elem, context, xml)) {
- newUnmatched.push(elem);
- if (mapped) {
- map.push(i2);
- }
- }
- }
- }
- return newUnmatched;
- }
- function setMatcher(preFilter, selector, matcher, postFilter, postFinder, postSelector) {
- if (postFilter && !postFilter[expando]) {
- postFilter = setMatcher(postFilter);
- }
- if (postFinder && !postFinder[expando]) {
- postFinder = setMatcher(postFinder, postSelector);
- }
- return markFunction(function(seed, results, context, xml) {
- var temp, i2, elem, matcherOut, preMap = [], postMap = [], preexisting = results.length, elems = seed || multipleContexts(
- selector || "*",
- context.nodeType ? [context] : context,
- []
- ), matcherIn = preFilter && (seed || !selector) ? condense(elems, preMap, preFilter, context, xml) : elems;
- if (matcher) {
- matcherOut = postFinder || (seed ? preFilter : preexisting || postFilter) ? (
- // ...intermediate processing is necessary
- []
- ) : (
- // ...otherwise use results directly
- results
- );
- matcher(matcherIn, matcherOut, context, xml);
- } else {
- matcherOut = matcherIn;
- }
- if (postFilter) {
- temp = condense(matcherOut, postMap);
- postFilter(temp, [], context, xml);
- i2 = temp.length;
- while (i2--) {
- if (elem = temp[i2]) {
- matcherOut[postMap[i2]] = !(matcherIn[postMap[i2]] = elem);
- }
- }
- }
- if (seed) {
- if (postFinder || preFilter) {
- if (postFinder) {
- temp = [];
- i2 = matcherOut.length;
- while (i2--) {
- if (elem = matcherOut[i2]) {
- temp.push(matcherIn[i2] = elem);
- }
- }
- postFinder(null, matcherOut = [], temp, xml);
- }
- i2 = matcherOut.length;
- while (i2--) {
- if ((elem = matcherOut[i2]) && (temp = postFinder ? indexOf.call(seed, elem) : preMap[i2]) > -1) {
- seed[temp] = !(results[temp] = elem);
- }
- }
- }
- } else {
- matcherOut = condense(
- matcherOut === results ? matcherOut.splice(preexisting, matcherOut.length) : matcherOut
- );
- if (postFinder) {
- postFinder(null, results, matcherOut, xml);
- } else {
- push2.apply(results, matcherOut);
- }
- }
- });
- }
- function matcherFromTokens(tokens) {
- var checkContext, matcher, j, len = tokens.length, leadingRelative = Expr.relative[tokens[0].type], implicitRelative = leadingRelative || Expr.relative[" "], i2 = leadingRelative ? 1 : 0, matchContext = addCombinator(function(elem) {
- return elem === checkContext;
- }, implicitRelative, true), matchAnyContext = addCombinator(function(elem) {
- return indexOf.call(checkContext, elem) > -1;
- }, implicitRelative, true), matchers = [function(elem, context, xml) {
- var ret = !leadingRelative && (xml || context != outermostContext) || ((checkContext = context).nodeType ? matchContext(elem, context, xml) : matchAnyContext(elem, context, xml));
- checkContext = null;
- return ret;
- }];
- for (; i2 < len; i2++) {
- if (matcher = Expr.relative[tokens[i2].type]) {
- matchers = [addCombinator(elementMatcher(matchers), matcher)];
- } else {
- matcher = Expr.filter[tokens[i2].type].apply(null, tokens[i2].matches);
- if (matcher[expando]) {
- j = ++i2;
- for (; j < len; j++) {
- if (Expr.relative[tokens[j].type]) {
- break;
- }
- }
- return setMatcher(
- i2 > 1 && elementMatcher(matchers),
- i2 > 1 && toSelector(
- // If the preceding token was a descendant combinator, insert an implicit any-element `*`
- tokens.slice(0, i2 - 1).concat({ value: tokens[i2 - 2].type === " " ? "*" : "" })
- ).replace(rtrimCSS, "$1"),
- matcher,
- i2 < j && matcherFromTokens(tokens.slice(i2, j)),
- j < len && matcherFromTokens(tokens = tokens.slice(j)),
- j < len && toSelector(tokens)
- );
- }
- matchers.push(matcher);
- }
- }
- return elementMatcher(matchers);
- }
- function matcherFromGroupMatchers(elementMatchers, setMatchers) {
- var bySet = setMatchers.length > 0, byElement = elementMatchers.length > 0, superMatcher = function(seed, context, xml, results, outermost) {
- var elem, j, matcher, matchedCount = 0, i2 = "0", unmatched = seed && [], setMatched = [], contextBackup = outermostContext, elems = seed || byElement && Expr.find.TAG("*", outermost), dirrunsUnique = dirruns += contextBackup == null ? 1 : Math.random() || 0.1, len = elems.length;
- if (outermost) {
- outermostContext = context == document3 || context || outermost;
- }
- for (; i2 !== len && (elem = elems[i2]) != null; i2++) {
- if (byElement && elem) {
- j = 0;
- if (!context && elem.ownerDocument != document3) {
- setDocument(elem);
- xml = !documentIsHTML;
- }
- while (matcher = elementMatchers[j++]) {
- if (matcher(elem, context || document3, xml)) {
- push2.call(results, elem);
- break;
- }
- }
- if (outermost) {
- dirruns = dirrunsUnique;
- }
- }
- if (bySet) {
- if (elem = !matcher && elem) {
- matchedCount--;
- }
- if (seed) {
- unmatched.push(elem);
- }
- }
- }
- matchedCount += i2;
- if (bySet && i2 !== matchedCount) {
- j = 0;
- while (matcher = setMatchers[j++]) {
- matcher(unmatched, setMatched, context, xml);
- }
- if (seed) {
- if (matchedCount > 0) {
- while (i2--) {
- if (!(unmatched[i2] || setMatched[i2])) {
- setMatched[i2] = pop.call(results);
- }
- }
- }
- setMatched = condense(setMatched);
- }
- push2.apply(results, setMatched);
- if (outermost && !seed && setMatched.length > 0 && matchedCount + setMatchers.length > 1) {
- jQuery.uniqueSort(results);
- }
- }
- if (outermost) {
- dirruns = dirrunsUnique;
- outermostContext = contextBackup;
- }
- return unmatched;
- };
- return bySet ? markFunction(superMatcher) : superMatcher;
- }
- function compile(selector, match) {
- var i2, setMatchers = [], elementMatchers = [], cached = compilerCache[selector + " "];
- if (!cached) {
- if (!match) {
- match = tokenize(selector);
- }
- i2 = match.length;
- while (i2--) {
- cached = matcherFromTokens(match[i2]);
- if (cached[expando]) {
- setMatchers.push(cached);
- } else {
- elementMatchers.push(cached);
- }
- }
- cached = compilerCache(
- selector,
- matcherFromGroupMatchers(elementMatchers, setMatchers)
- );
- cached.selector = selector;
- }
- return cached;
- }
- function select(selector, context, results, seed) {
- var i2, tokens, token, type, find2, compiled = typeof selector === "function" && selector, match = !seed && tokenize(selector = compiled.selector || selector);
- results = results || [];
- if (match.length === 1) {
- tokens = match[0] = match[0].slice(0);
- if (tokens.length > 2 && (token = tokens[0]).type === "ID" && context.nodeType === 9 && documentIsHTML && Expr.relative[tokens[1].type]) {
- context = (Expr.find.ID(
- token.matches[0].replace(runescape, funescape),
- context
- ) || [])[0];
- if (!context) {
- return results;
- } else if (compiled) {
- context = context.parentNode;
- }
- selector = selector.slice(tokens.shift().value.length);
- }
- i2 = matchExpr.needsContext.test(selector) ? 0 : tokens.length;
- while (i2--) {
- token = tokens[i2];
- if (Expr.relative[type = token.type]) {
- break;
- }
- if (find2 = Expr.find[type]) {
- if (seed = find2(
- token.matches[0].replace(runescape, funescape),
- rsibling.test(tokens[0].type) && testContext(context.parentNode) || context
- )) {
- tokens.splice(i2, 1);
- selector = seed.length && toSelector(tokens);
- if (!selector) {
- push2.apply(results, seed);
- return results;
- }
- break;
- }
- }
- }
- }
- (compiled || compile(selector, match))(
- seed,
- context,
- !documentIsHTML,
- results,
- !context || rsibling.test(selector) && testContext(context.parentNode) || context
- );
- return results;
- }
- support.sortStable = expando.split("").sort(sortOrder).join("") === expando;
- setDocument();
- support.sortDetached = assert(function(el) {
- return el.compareDocumentPosition(document3.createElement("fieldset")) & 1;
- });
- jQuery.find = find;
- jQuery.expr[":"] = jQuery.expr.pseudos;
- jQuery.unique = jQuery.uniqueSort;
- find.compile = compile;
- find.select = select;
- find.setDocument = setDocument;
- find.tokenize = tokenize;
- find.escape = jQuery.escapeSelector;
- find.getText = jQuery.text;
- find.isXML = jQuery.isXMLDoc;
- find.selectors = jQuery.expr;
- find.support = jQuery.support;
- find.uniqueSort = jQuery.uniqueSort;
- })();
- var dir = function(elem, dir2, until) {
- var matched = [], truncate = until !== void 0;
- while ((elem = elem[dir2]) && elem.nodeType !== 9) {
- if (elem.nodeType === 1) {
- if (truncate && jQuery(elem).is(until)) {
- break;
- }
- matched.push(elem);
- }
- }
- return matched;
- };
- var siblings = function(n, elem) {
- var matched = [];
- for (; n; n = n.nextSibling) {
- if (n.nodeType === 1 && n !== elem) {
- matched.push(n);
- }
- }
- return matched;
- };
- var rneedsContext = jQuery.expr.match.needsContext;
- var rsingleTag = /^<([a-z][^\/\0>:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i;
- function winnow(elements, qualifier, not) {
- if (isFunction(qualifier)) {
- return jQuery.grep(elements, function(elem, i) {
- return !!qualifier.call(elem, i, elem) !== not;
- });
- }
- if (qualifier.nodeType) {
- return jQuery.grep(elements, function(elem) {
- return elem === qualifier !== not;
- });
- }
- if (typeof qualifier !== "string") {
- return jQuery.grep(elements, function(elem) {
- return indexOf.call(qualifier, elem) > -1 !== not;
- });
- }
- return jQuery.filter(qualifier, elements, not);
- }
- jQuery.filter = function(expr, elems, not) {
- var elem = elems[0];
- if (not) {
- expr = ":not(" + expr + ")";
- }
- if (elems.length === 1 && elem.nodeType === 1) {
- return jQuery.find.matchesSelector(elem, expr) ? [elem] : [];
- }
- return jQuery.find.matches(expr, jQuery.grep(elems, function(elem2) {
- return elem2.nodeType === 1;
- }));
- };
- jQuery.fn.extend({
- find: function(selector) {
- var i, ret, len = this.length, self2 = this;
- if (typeof selector !== "string") {
- return this.pushStack(jQuery(selector).filter(function() {
- for (i = 0; i < len; i++) {
- if (jQuery.contains(self2[i], this)) {
- return true;
- }
- }
- }));
- }
- ret = this.pushStack([]);
- for (i = 0; i < len; i++) {
- jQuery.find(selector, self2[i], ret);
- }
- return len > 1 ? jQuery.uniqueSort(ret) : ret;
- },
- filter: function(selector) {
- return this.pushStack(winnow(this, selector || [], false));
- },
- not: function(selector) {
- return this.pushStack(winnow(this, selector || [], true));
- },
- is: function(selector) {
- return !!winnow(
- this,
- // If this is a positional/relative selector, check membership in the returned set
- // so $("p:first").is("p:last") won't return true for a doc with two "p".
- typeof selector === "string" && rneedsContext.test(selector) ? jQuery(selector) : selector || [],
- false
- ).length;
- }
- });
- var rootjQuery, rquickExpr = /^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]+))$/, init = jQuery.fn.init = function(selector, context, root) {
- var match, elem;
- if (!selector) {
- return this;
- }
- root = root || rootjQuery;
- if (typeof selector === "string") {
- if (selector[0] === "<" && selector[selector.length - 1] === ">" && selector.length >= 3) {
- match = [null, selector, null];
- } else {
- match = rquickExpr.exec(selector);
- }
- if (match && (match[1] || !context)) {
- if (match[1]) {
- context = context instanceof jQuery ? context[0] : context;
- jQuery.merge(this, jQuery.parseHTML(
- match[1],
- context && context.nodeType ? context.ownerDocument || context : document2,
- true
- ));
- if (rsingleTag.test(match[1]) && jQuery.isPlainObject(context)) {
- for (match in context) {
- if (isFunction(this[match])) {
- this[match](context[match]);
- } else {
- this.attr(match, context[match]);
- }
- }
- }
- return this;
- } else {
- elem = document2.getElementById(match[2]);
- if (elem) {
- this[0] = elem;
- this.length = 1;
- }
- return this;
- }
- } else if (!context || context.jquery) {
- return (context || root).find(selector);
- } else {
- return this.constructor(context).find(selector);
- }
- } else if (selector.nodeType) {
- this[0] = selector;
- this.length = 1;
- return this;
- } else if (isFunction(selector)) {
- return root.ready !== void 0 ? root.ready(selector) : (
- // Execute immediately if ready is not present
- selector(jQuery)
- );
- }
- return jQuery.makeArray(selector, this);
- };
- init.prototype = jQuery.fn;
- rootjQuery = jQuery(document2);
- var rparentsprev = /^(?:parents|prev(?:Until|All))/, guaranteedUnique = {
- children: true,
- contents: true,
- next: true,
- prev: true
- };
- jQuery.fn.extend({
- has: function(target) {
- var targets = jQuery(target, this), l = targets.length;
- return this.filter(function() {
- var i = 0;
- for (; i < l; i++) {
- if (jQuery.contains(this, targets[i])) {
- return true;
- }
- }
- });
- },
- closest: function(selectors, context) {
- var cur, i = 0, l = this.length, matched = [], targets = typeof selectors !== "string" && jQuery(selectors);
- if (!rneedsContext.test(selectors)) {
- for (; i < l; i++) {
- for (cur = this[i]; cur && cur !== context; cur = cur.parentNode) {
- if (cur.nodeType < 11 && (targets ? targets.index(cur) > -1 : (
- // Don't pass non-elements to jQuery#find
- cur.nodeType === 1 && jQuery.find.matchesSelector(cur, selectors)
- ))) {
- matched.push(cur);
- break;
- }
- }
- }
- }
- return this.pushStack(matched.length > 1 ? jQuery.uniqueSort(matched) : matched);
- },
- // Determine the position of an element within the set
- index: function(elem) {
- if (!elem) {
- return this[0] && this[0].parentNode ? this.first().prevAll().length : -1;
- }
- if (typeof elem === "string") {
- return indexOf.call(jQuery(elem), this[0]);
- }
- return indexOf.call(
- this,
- // If it receives a jQuery object, the first element is used
- elem.jquery ? elem[0] : elem
- );
- },
- add: function(selector, context) {
- return this.pushStack(
- jQuery.uniqueSort(
- jQuery.merge(this.get(), jQuery(selector, context))
- )
- );
- },
- addBack: function(selector) {
- return this.add(
- selector == null ? this.prevObject : this.prevObject.filter(selector)
- );
- }
- });
- function sibling(cur, dir2) {
- while ((cur = cur[dir2]) && cur.nodeType !== 1) {
- }
- return cur;
- }
- jQuery.each({
- parent: function(elem) {
- var parent = elem.parentNode;
- return parent && parent.nodeType !== 11 ? parent : null;
- },
- parents: function(elem) {
- return dir(elem, "parentNode");
- },
- parentsUntil: function(elem, _i, until) {
- return dir(elem, "parentNode", until);
- },
- next: function(elem) {
- return sibling(elem, "nextSibling");
- },
- prev: function(elem) {
- return sibling(elem, "previousSibling");
- },
- nextAll: function(elem) {
- return dir(elem, "nextSibling");
- },
- prevAll: function(elem) {
- return dir(elem, "previousSibling");
- },
- nextUntil: function(elem, _i, until) {
- return dir(elem, "nextSibling", until);
- },
- prevUntil: function(elem, _i, until) {
- return dir(elem, "previousSibling", until);
- },
- siblings: function(elem) {
- return siblings((elem.parentNode || {}).firstChild, elem);
- },
- children: function(elem) {
- return siblings(elem.firstChild);
- },
- contents: function(elem) {
- if (elem.contentDocument != null && // Support: IE 11+
- // <object> elements with no `data` attribute has an object
- // `contentDocument` with a `null` prototype.
- getProto(elem.contentDocument)) {
- return elem.contentDocument;
- }
- if (nodeName(elem, "template")) {
- elem = elem.content || elem;
- }
- return jQuery.merge([], elem.childNodes);
- }
- }, function(name, fn) {
- jQuery.fn[name] = function(until, selector) {
- var matched = jQuery.map(this, fn, until);
- if (name.slice(-5) !== "Until") {
- selector = until;
- }
- if (selector && typeof selector === "string") {
- matched = jQuery.filter(selector, matched);
- }
- if (this.length > 1) {
- if (!guaranteedUnique[name]) {
- jQuery.uniqueSort(matched);
- }
- if (rparentsprev.test(name)) {
- matched.reverse();
- }
- }
- return this.pushStack(matched);
- };
- });
- var rnothtmlwhite = /[^\x20\t\r\n\f]+/g;
- function createOptions(options) {
- var object = {};
- jQuery.each(options.match(rnothtmlwhite) || [], function(_, flag) {
- object[flag] = true;
- });
- return object;
- }
- jQuery.Callbacks = function(options) {
- options = typeof options === "string" ? createOptions(options) : jQuery.extend({}, options);
- var firing, memory, fired, locked, list = [], queue = [], firingIndex = -1, fire = function() {
- locked = locked || options.once;
- fired = firing = true;
- for (; queue.length; firingIndex = -1) {
- memory = queue.shift();
- while (++firingIndex < list.length) {
- if (list[firingIndex].apply(memory[0], memory[1]) === false && options.stopOnFalse) {
- firingIndex = list.length;
- memory = false;
- }
- }
- }
- if (!options.memory) {
- memory = false;
- }
- firing = false;
- if (locked) {
- if (memory) {
- list = [];
- } else {
- list = "";
- }
- }
- }, self2 = {
- // Add a callback or a collection of callbacks to the list
- add: function() {
- if (list) {
- if (memory && !firing) {
- firingIndex = list.length - 1;
- queue.push(memory);
- }
- (function add(args) {
- jQuery.each(args, function(_, arg) {
- if (isFunction(arg)) {
- if (!options.unique || !self2.has(arg)) {
- list.push(arg);
- }
- } else if (arg && arg.length && toType(arg) !== "string") {
- add(arg);
- }
- });
- })(arguments);
- if (memory && !firing) {
- fire();
- }
- }
- return this;
- },
- // Remove a callback from the list
- remove: function() {
- jQuery.each(arguments, function(_, arg) {
- var index;
- while ((index = jQuery.inArray(arg, list, index)) > -1) {
- list.splice(index, 1);
- if (index <= firingIndex) {
- firingIndex--;
- }
- }
- });
- return this;
- },
- // Check if a given callback is in the list.
- // If no argument is given, return whether or not list has callbacks attached.
- has: function(fn) {
- return fn ? jQuery.inArray(fn, list) > -1 : list.length > 0;
- },
- // Remove all callbacks from the list
- empty: function() {
- if (list) {
- list = [];
- }
- return this;
- },
- // Disable .fire and .add
- // Abort any current/pending executions
- // Clear all callbacks and values
- disable: function() {
- locked = queue = [];
- list = memory = "";
- return this;
- },
- disabled: function() {
- return !list;
- },
- // Disable .fire
- // Also disable .add unless we have memory (since it would have no effect)
- // Abort any pending executions
- lock: function() {
- locked = queue = [];
- if (!memory && !firing) {
- list = memory = "";
- }
- return this;
- },
- locked: function() {
- return !!locked;
- },
- // Call all callbacks with the given context and arguments
- fireWith: function(context, args) {
- if (!locked) {
- args = args || [];
- args = [context, args.slice ? args.slice() : args];
- queue.push(args);
- if (!firing) {
- fire();
- }
- }
- return this;
- },
- // Call all the callbacks with the given arguments
- fire: function() {
- self2.fireWith(this, arguments);
- return this;
- },
- // To know if the callbacks have already been called at least once
- fired: function() {
- return !!fired;
- }
- };
- return self2;
- };
- function Identity(v) {
- return v;
- }
- function Thrower(ex) {
- throw ex;
- }
- function adoptValue(value, resolve, reject, noValue) {
- var method;
- try {
- if (value && isFunction(method = value.promise)) {
- method.call(value).done(resolve).fail(reject);
- } else if (value && isFunction(method = value.then)) {
- method.call(value, resolve, reject);
- } else {
- resolve.apply(void 0, [value].slice(noValue));
- }
- } catch (value2) {
- reject.apply(void 0, [value2]);
- }
- }
- jQuery.extend({
- Deferred: function(func) {
- var tuples = [
- // action, add listener, callbacks,
- // ... .then handlers, argument index, [final state]
- [
- "notify",
- "progress",
- jQuery.Callbacks("memory"),
- jQuery.Callbacks("memory"),
- 2
- ],
- [
- "resolve",
- "done",
- jQuery.Callbacks("once memory"),
- jQuery.Callbacks("once memory"),
- 0,
- "resolved"
- ],
- [
- "reject",
- "fail",
- jQuery.Callbacks("once memory"),
- jQuery.Callbacks("once memory"),
- 1,
- "rejected"
- ]
- ], state = "pending", promise = {
- state: function() {
- return state;
- },
- always: function() {
- deferred.done(arguments).fail(arguments);
- return this;
- },
- "catch": function(fn) {
- return promise.then(null, fn);
- },
- // Keep pipe for back-compat
- pipe: function() {
- var fns = arguments;
- return jQuery.Deferred(function(newDefer) {
- jQuery.each(tuples, function(_i, tuple) {
- var fn = isFunction(fns[tuple[4]]) && fns[tuple[4]];
- deferred[tuple[1]](function() {
- var returned = fn && fn.apply(this, arguments);
- if (returned && isFunction(returned.promise)) {
- returned.promise().progress(newDefer.notify).done(newDefer.resolve).fail(newDefer.reject);
- } else {
- newDefer[tuple[0] + "With"](
- this,
- fn ? [returned] : arguments
- );
- }
- });
- });
- fns = null;
- }).promise();
- },
- then: function(onFulfilled, onRejected, onProgress) {
- var maxDepth = 0;
- function resolve(depth, deferred2, handler, special) {
- return function() {
- var that = this, args = arguments, mightThrow = function() {
- var returned, then;
- if (depth < maxDepth) {
- return;
- }
- returned = handler.apply(that, args);
- if (returned === deferred2.promise()) {
- throw new TypeError("Thenable self-resolution");
- }
- then = returned && // Support: Promises/A+ section 2.3.4
- // https://promisesaplus.com/#point-64
- // Only check objects and functions for thenability
- (typeof returned === "object" || typeof returned === "function") && returned.then;
- if (isFunction(then)) {
- if (special) {
- then.call(
- returned,
- resolve(maxDepth, deferred2, Identity, special),
- resolve(maxDepth, deferred2, Thrower, special)
- );
- } else {
- maxDepth++;
- then.call(
- returned,
- resolve(maxDepth, deferred2, Identity, special),
- resolve(maxDepth, deferred2, Thrower, special),
- resolve(
- maxDepth,
- deferred2,
- Identity,
- deferred2.notifyWith
- )
- );
- }
- } else {
- if (handler !== Identity) {
- that = void 0;
- args = [returned];
- }
- (special || deferred2.resolveWith)(that, args);
- }
- }, process = special ? mightThrow : function() {
- try {
- mightThrow();
- } catch (e) {
- if (jQuery.Deferred.exceptionHook) {
- jQuery.Deferred.exceptionHook(
- e,
- process.error
- );
- }
- if (depth + 1 >= maxDepth) {
- if (handler !== Thrower) {
- that = void 0;
- args = [e];
- }
- deferred2.rejectWith(that, args);
- }
- }
- };
- if (depth) {
- process();
- } else {
- if (jQuery.Deferred.getErrorHook) {
- process.error = jQuery.Deferred.getErrorHook();
- } else if (jQuery.Deferred.getStackHook) {
- process.error = jQuery.Deferred.getStackHook();
- }
- window2.setTimeout(process);
- }
- };
- }
- return jQuery.Deferred(function(newDefer) {
- tuples[0][3].add(
- resolve(
- 0,
- newDefer,
- isFunction(onProgress) ? onProgress : Identity,
- newDefer.notifyWith
- )
- );
- tuples[1][3].add(
- resolve(
- 0,
- newDefer,
- isFunction(onFulfilled) ? onFulfilled : Identity
- )
- );
- tuples[2][3].add(
- resolve(
- 0,
- newDefer,
- isFunction(onRejected) ? onRejected : Thrower
- )
- );
- }).promise();
- },
- // Get a promise for this deferred
- // If obj is provided, the promise aspect is added to the object
- promise: function(obj) {
- return obj != null ? jQuery.extend(obj, promise) : promise;
- }
- }, deferred = {};
- jQuery.each(tuples, function(i, tuple) {
- var list = tuple[2], stateString = tuple[5];
- promise[tuple[1]] = list.add;
- if (stateString) {
- list.add(
- function() {
- state = stateString;
- },
- // rejected_callbacks.disable
- // fulfilled_callbacks.disable
- tuples[3 - i][2].disable,
- // rejected_handlers.disable
- // fulfilled_handlers.disable
- tuples[3 - i][3].disable,
- // progress_callbacks.lock
- tuples[0][2].lock,
- // progress_handlers.lock
- tuples[0][3].lock
- );
- }
- list.add(tuple[3].fire);
- deferred[tuple[0]] = function() {
- deferred[tuple[0] + "With"](this === deferred ? void 0 : this, arguments);
- return this;
- };
- deferred[tuple[0] + "With"] = list.fireWith;
- });
- promise.promise(deferred);
- if (func) {
- func.call(deferred, deferred);
- }
- return deferred;
- },
- // Deferred helper
- when: function(singleValue) {
- var remaining = arguments.length, i = remaining, resolveContexts = Array(i), resolveValues = slice.call(arguments), primary = jQuery.Deferred(), updateFunc = function(i2) {
- return function(value) {
- resolveContexts[i2] = this;
- resolveValues[i2] = arguments.length > 1 ? slice.call(arguments) : value;
- if (!--remaining) {
- primary.resolveWith(resolveContexts, resolveValues);
- }
- };
- };
- if (remaining <= 1) {
- adoptValue(
- singleValue,
- primary.done(updateFunc(i)).resolve,
- primary.reject,
- !remaining
- );
- if (primary.state() === "pending" || isFunction(resolveValues[i] && resolveValues[i].then)) {
- return primary.then();
- }
- }
- while (i--) {
- adoptValue(resolveValues[i], updateFunc(i), primary.reject);
- }
- return primary.promise();
- }
- });
- var rerrorNames = /^(Eval|Internal|Range|Reference|Syntax|Type|URI)Error$/;
- jQuery.Deferred.exceptionHook = function(error, asyncError) {
- if (window2.console && window2.console.warn && error && rerrorNames.test(error.name)) {
- window2.console.warn(
- "jQuery.Deferred exception: " + error.message,
- error.stack,
- asyncError
- );
- }
- };
- jQuery.readyException = function(error) {
- window2.setTimeout(function() {
- throw error;
- });
- };
- var readyList = jQuery.Deferred();
- jQuery.fn.ready = function(fn) {
- readyList.then(fn).catch(function(error) {
- jQuery.readyException(error);
- });
- return this;
- };
- jQuery.extend({
- // Is the DOM ready to be used? Set to true once it occurs.
- isReady: false,
- // A counter to track how many items to wait for before
- // the ready event fires. See trac-6781
- readyWait: 1,
- // Handle when the DOM is ready
- ready: function(wait) {
- if (wait === true ? --jQuery.readyWait : jQuery.isReady) {
- return;
- }
- jQuery.isReady = true;
- if (wait !== true && --jQuery.readyWait > 0) {
- return;
- }
- readyList.resolveWith(document2, [jQuery]);
- }
- });
- jQuery.ready.then = readyList.then;
- function completed() {
- document2.removeEventListener("DOMContentLoaded", completed);
- window2.removeEventListener("load", completed);
- jQuery.ready();
- }
- if (document2.readyState === "complete" || document2.readyState !== "loading" && !document2.documentElement.doScroll) {
- window2.setTimeout(jQuery.ready);
- } else {
- document2.addEventListener("DOMContentLoaded", completed);
- window2.addEventListener("load", completed);
- }
- var access = function(elems, fn, key, value, chainable, emptyGet, raw) {
- var i = 0, len = elems.length, bulk = key == null;
- if (toType(key) === "object") {
- chainable = true;
- for (i in key) {
- access(elems, fn, i, key[i], true, emptyGet, raw);
- }
- } else if (value !== void 0) {
- chainable = true;
- if (!isFunction(value)) {
- raw = true;
- }
- if (bulk) {
- if (raw) {
- fn.call(elems, value);
- fn = null;
- } else {
- bulk = fn;
- fn = function(elem, _key, value2) {
- return bulk.call(jQuery(elem), value2);
- };
- }
- }
- if (fn) {
- for (; i < len; i++) {
- fn(
- elems[i],
- key,
- raw ? value : value.call(elems[i], i, fn(elems[i], key))
- );
- }
- }
- }
- if (chainable) {
- return elems;
- }
- if (bulk) {
- return fn.call(elems);
- }
- return len ? fn(elems[0], key) : emptyGet;
- };
- var rmsPrefix = /^-ms-/, rdashAlpha = /-([a-z])/g;
- function fcamelCase(_all, letter) {
- return letter.toUpperCase();
- }
- function camelCase(string) {
- return string.replace(rmsPrefix, "ms-").replace(rdashAlpha, fcamelCase);
- }
- var acceptData = function(owner) {
- return owner.nodeType === 1 || owner.nodeType === 9 || !+owner.nodeType;
- };
- function Data() {
- this.expando = jQuery.expando + Data.uid++;
- }
- Data.uid = 1;
- Data.prototype = {
- cache: function(owner) {
- var value = owner[this.expando];
- if (!value) {
- value = {};
- if (acceptData(owner)) {
- if (owner.nodeType) {
- owner[this.expando] = value;
- } else {
- Object.defineProperty(owner, this.expando, {
- value,
- configurable: true
- });
- }
- }
- }
- return value;
- },
- set: function(owner, data, value) {
- var prop, cache = this.cache(owner);
- if (typeof data === "string") {
- cache[camelCase(data)] = value;
- } else {
- for (prop in data) {
- cache[camelCase(prop)] = data[prop];
- }
- }
- return cache;
- },
- get: function(owner, key) {
- return key === void 0 ? this.cache(owner) : (
- // Always use camelCase key (gh-2257)
- owner[this.expando] && owner[this.expando][camelCase(key)]
- );
- },
- access: function(owner, key, value) {
- if (key === void 0 || key && typeof key === "string" && value === void 0) {
- return this.get(owner, key);
- }
- this.set(owner, key, value);
- return value !== void 0 ? value : key;
- },
- remove: function(owner, key) {
- var i, cache = owner[this.expando];
- if (cache === void 0) {
- return;
- }
- if (key !== void 0) {
- if (Array.isArray(key)) {
- key = key.map(camelCase);
- } else {
- key = camelCase(key);
- key = key in cache ? [key] : key.match(rnothtmlwhite) || [];
- }
- i = key.length;
- while (i--) {
- delete cache[key[i]];
- }
- }
- if (key === void 0 || jQuery.isEmptyObject(cache)) {
- if (owner.nodeType) {
- owner[this.expando] = void 0;
- } else {
- delete owner[this.expando];
- }
- }
- },
- hasData: function(owner) {
- var cache = owner[this.expando];
- return cache !== void 0 && !jQuery.isEmptyObject(cache);
- }
- };
- var dataPriv = new Data();
- var dataUser = new Data();
- var rbrace = /^(?:\{[\w\W]*\}|\[[\w\W]*\])$/, rmultiDash = /[A-Z]/g;
- function getData(data) {
- if (data === "true") {
- return true;
- }
- if (data === "false") {
- return false;
- }
- if (data === "null") {
- return null;
- }
- if (data === +data + "") {
- return +data;
- }
- if (rbrace.test(data)) {
- return JSON.parse(data);
- }
- return data;
- }
- function dataAttr(elem, key, data) {
- var name;
- if (data === void 0 && elem.nodeType === 1) {
- name = "data-" + key.replace(rmultiDash, "-$&").toLowerCase();
- data = elem.getAttribute(name);
- if (typeof data === "string") {
- try {
- data = getData(data);
- } catch (e) {
- }
- dataUser.set(elem, key, data);
- } else {
- data = void 0;
- }
- }
- return data;
- }
- jQuery.extend({
- hasData: function(elem) {
- return dataUser.hasData(elem) || dataPriv.hasData(elem);
- },
- data: function(elem, name, data) {
- return dataUser.access(elem, name, data);
- },
- removeData: function(elem, name) {
- dataUser.remove(elem, name);
- },
- // TODO: Now that all calls to _data and _removeData have been replaced
- // with direct calls to dataPriv methods, these can be deprecated.
- _data: function(elem, name, data) {
- return dataPriv.access(elem, name, data);
- },
- _removeData: function(elem, name) {
- dataPriv.remove(elem, name);
- }
- });
- jQuery.fn.extend({
- data: function(key, value) {
- var i, name, data, elem = this[0], attrs = elem && elem.attributes;
- if (key === void 0) {
- if (this.length) {
- data = dataUser.get(elem);
- if (elem.nodeType === 1 && !dataPriv.get(elem, "hasDataAttrs")) {
- i = attrs.length;
- while (i--) {
- if (attrs[i]) {
- name = attrs[i].name;
- if (name.indexOf("data-") === 0) {
- name = camelCase(name.slice(5));
- dataAttr(elem, name, data[name]);
- }
- }
- }
- dataPriv.set(elem, "hasDataAttrs", true);
- }
- }
- return data;
- }
- if (typeof key === "object") {
- return this.each(function() {
- dataUser.set(this, key);
- });
- }
- return access(this, function(value2) {
- var data2;
- if (elem && value2 === void 0) {
- data2 = dataUser.get(elem, key);
- if (data2 !== void 0) {
- return data2;
- }
- data2 = dataAttr(elem, key);
- if (data2 !== void 0) {
- return data2;
- }
- return;
- }
- this.each(function() {
- dataUser.set(this, key, value2);
- });
- }, null, value, arguments.length > 1, null, true);
- },
- removeData: function(key) {
- return this.each(function() {
- dataUser.remove(this, key);
- });
- }
- });
- jQuery.extend({
- queue: function(elem, type, data) {
- var queue;
- if (elem) {
- type = (type || "fx") + "queue";
- queue = dataPriv.get(elem, type);
- if (data) {
- if (!queue || Array.isArray(data)) {
- queue = dataPriv.access(elem, type, jQuery.makeArray(data));
- } else {
- queue.push(data);
- }
- }
- return queue || [];
- }
- },
- dequeue: function(elem, type) {
- type = type || "fx";
- var queue = jQuery.queue(elem, type), startLength = queue.length, fn = queue.shift(), hooks = jQuery._queueHooks(elem, type), next = function() {
- jQuery.dequeue(elem, type);
- };
- if (fn === "inprogress") {
- fn = queue.shift();
- startLength--;
- }
- if (fn) {
- if (type === "fx") {
- queue.unshift("inprogress");
- }
- delete hooks.stop;
- fn.call(elem, next, hooks);
- }
- if (!startLength && hooks) {
- hooks.empty.fire();
- }
- },
- // Not public - generate a queueHooks object, or return the current one
- _queueHooks: function(elem, type) {
- var key = type + "queueHooks";
- return dataPriv.get(elem, key) || dataPriv.access(elem, key, {
- empty: jQuery.Callbacks("once memory").add(function() {
- dataPriv.remove(elem, [type + "queue", key]);
- })
- });
- }
- });
- jQuery.fn.extend({
- queue: function(type, data) {
- var setter = 2;
- if (typeof type !== "string") {
- data = type;
- type = "fx";
- setter--;
- }
- if (arguments.length < setter) {
- return jQuery.queue(this[0], type);
- }
- return data === void 0 ? this : this.each(function() {
- var queue = jQuery.queue(this, type, data);
- jQuery._queueHooks(this, type);
- if (type === "fx" && queue[0] !== "inprogress") {
- jQuery.dequeue(this, type);
- }
- });
- },
- dequeue: function(type) {
- return this.each(function() {
- jQuery.dequeue(this, type);
- });
- },
- clearQueue: function(type) {
- return this.queue(type || "fx", []);
- },
- // Get a promise resolved when queues of a certain type
- // are emptied (fx is the type by default)
- promise: function(type, obj) {
- var tmp, count = 1, defer = jQuery.Deferred(), elements = this, i = this.length, resolve = function() {
- if (!--count) {
- defer.resolveWith(elements, [elements]);
- }
- };
- if (typeof type !== "string") {
- obj = type;
- type = void 0;
- }
- type = type || "fx";
- while (i--) {
- tmp = dataPriv.get(elements[i], type + "queueHooks");
- if (tmp && tmp.empty) {
- count++;
- tmp.empty.add(resolve);
- }
- }
- resolve();
- return defer.promise(obj);
- }
- });
- var pnum = /[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source;
- var rcssNum = new RegExp("^(?:([+-])=|)(" + pnum + ")([a-z%]*)$", "i");
- var cssExpand = ["Top", "Right", "Bottom", "Left"];
- var documentElement = document2.documentElement;
- var isAttached = function(elem) {
- return jQuery.contains(elem.ownerDocument, elem);
- }, composed = { composed: true };
- if (documentElement.getRootNode) {
- isAttached = function(elem) {
- return jQuery.contains(elem.ownerDocument, elem) || elem.getRootNode(composed) === elem.ownerDocument;
- };
- }
- var isHiddenWithinTree = function(elem, el) {
- elem = el || elem;
- return elem.style.display === "none" || elem.style.display === "" && // Otherwise, check computed style
- // Support: Firefox <=43 - 45
- // Disconnected elements can have computed display: none, so first confirm that elem is
- // in the document.
- isAttached(elem) && jQuery.css(elem, "display") === "none";
- };
- function adjustCSS(elem, prop, valueParts, tween) {
- var adjusted, scale, maxIterations = 20, currentValue = tween ? function() {
- return tween.cur();
- } : function() {
- return jQuery.css(elem, prop, "");
- }, initial = currentValue(), unit = valueParts && valueParts[3] || (jQuery.cssNumber[prop] ? "" : "px"), initialInUnit = elem.nodeType && (jQuery.cssNumber[prop] || unit !== "px" && +initial) && rcssNum.exec(jQuery.css(elem, prop));
- if (initialInUnit && initialInUnit[3] !== unit) {
- initial = initial / 2;
- unit = unit || initialInUnit[3];
- initialInUnit = +initial || 1;
- while (maxIterations--) {
- jQuery.style(elem, prop, initialInUnit + unit);
- if ((1 - scale) * (1 - (scale = currentValue() / initial || 0.5)) <= 0) {
- maxIterations = 0;
- }
- initialInUnit = initialInUnit / scale;
- }
- initialInUnit = initialInUnit * 2;
- jQuery.style(elem, prop, initialInUnit + unit);
- valueParts = valueParts || [];
- }
- if (valueParts) {
- initialInUnit = +initialInUnit || +initial || 0;
- adjusted = valueParts[1] ? initialInUnit + (valueParts[1] + 1) * valueParts[2] : +valueParts[2];
- if (tween) {
- tween.unit = unit;
- tween.start = initialInUnit;
- tween.end = adjusted;
- }
- }
- return adjusted;
- }
- var defaultDisplayMap = {};
- function getDefaultDisplay(elem) {
- var temp, doc = elem.ownerDocument, nodeName2 = elem.nodeName, display = defaultDisplayMap[nodeName2];
- if (display) {
- return display;
- }
- temp = doc.body.appendChild(doc.createElement(nodeName2));
- display = jQuery.css(temp, "display");
- temp.parentNode.removeChild(temp);
- if (display === "none") {
- display = "block";
- }
- defaultDisplayMap[nodeName2] = display;
- return display;
- }
- function showHide(elements, show) {
- var display, elem, values = [], index = 0, length = elements.length;
- for (; index < length; index++) {
- elem = elements[index];
- if (!elem.style) {
- continue;
- }
- display = elem.style.display;
- if (show) {
- if (display === "none") {
- values[index] = dataPriv.get(elem, "display") || null;
- if (!values[index]) {
- elem.style.display = "";
- }
- }
- if (elem.style.display === "" && isHiddenWithinTree(elem)) {
- values[index] = getDefaultDisplay(elem);
- }
- } else {
- if (display !== "none") {
- values[index] = "none";
- dataPriv.set(elem, "display", display);
- }
- }
- }
- for (index = 0; index < length; index++) {
- if (values[index] != null) {
- elements[index].style.display = values[index];
- }
- }
- return elements;
- }
- jQuery.fn.extend({
- show: function() {
- return showHide(this, true);
- },
- hide: function() {
- return showHide(this);
- },
- toggle: function(state) {
- if (typeof state === "boolean") {
- return state ? this.show() : this.hide();
- }
- return this.each(function() {
- if (isHiddenWithinTree(this)) {
- jQuery(this).show();
- } else {
- jQuery(this).hide();
- }
- });
- }
- });
- var rcheckableType = /^(?:checkbox|radio)$/i;
- var rtagName = /<([a-z][^\/\0>\x20\t\r\n\f]*)/i;
- var rscriptType = /^$|^module$|\/(?:java|ecma)script/i;
- (function() {
- var fragment = document2.createDocumentFragment(), div = fragment.appendChild(document2.createElement("div")), input = document2.createElement("input");
- input.setAttribute("type", "radio");
- input.setAttribute("checked", "checked");
- input.setAttribute("name", "t");
- div.appendChild(input);
- support.checkClone = div.cloneNode(true).cloneNode(true).lastChild.checked;
- div.innerHTML = "<textarea>x</textarea>";
- support.noCloneChecked = !!div.cloneNode(true).lastChild.defaultValue;
- div.innerHTML = "<option></option>";
- support.option = !!div.lastChild;
- })();
- var wrapMap = {
- // XHTML parsers do not magically insert elements in the
- // same way that tag soup parsers do. So we cannot shorten
- // this by omitting <tbody> or other required elements.
- thead: [1, "<table>", "</table>"],
- col: [2, "<table><colgroup>", "</colgroup></table>"],
- tr: [2, "<table><tbody>", "</tbody></table>"],
- td: [3, "<table><tbody><tr>", "</tr></tbody></table>"],
- _default: [0, "", ""]
- };
- wrapMap.tbody = wrapMap.tfoot = wrapMap.colgroup = wrapMap.caption = wrapMap.thead;
- wrapMap.th = wrapMap.td;
- if (!support.option) {
- wrapMap.optgroup = wrapMap.option = [1, "<select multiple='multiple'>", "</select>"];
- }
- function getAll(context, tag) {
- var ret;
- if (typeof context.getElementsByTagName !== "undefined") {
- ret = context.getElementsByTagName(tag || "*");
- } else if (typeof context.querySelectorAll !== "undefined") {
- ret = context.querySelectorAll(tag || "*");
- } else {
- ret = [];
- }
- if (tag === void 0 || tag && nodeName(context, tag)) {
- return jQuery.merge([context], ret);
- }
- return ret;
- }
- function setGlobalEval(elems, refElements) {
- var i = 0, l = elems.length;
- for (; i < l; i++) {
- dataPriv.set(
- elems[i],
- "globalEval",
- !refElements || dataPriv.get(refElements[i], "globalEval")
- );
- }
- }
- var rhtml = /<|&#?\w+;/;
- function buildFragment(elems, context, scripts, selection, ignored) {
- var elem, tmp, tag, wrap, attached, j, fragment = context.createDocumentFragment(), nodes = [], i = 0, l = elems.length;
- for (; i < l; i++) {
- elem = elems[i];
- if (elem || elem === 0) {
- if (toType(elem) === "object") {
- jQuery.merge(nodes, elem.nodeType ? [elem] : elem);
- } else if (!rhtml.test(elem)) {
- nodes.push(context.createTextNode(elem));
- } else {
- tmp = tmp || fragment.appendChild(context.createElement("div"));
- tag = (rtagName.exec(elem) || ["", ""])[1].toLowerCase();
- wrap = wrapMap[tag] || wrapMap._default;
- tmp.innerHTML = wrap[1] + jQuery.htmlPrefilter(elem) + wrap[2];
- j = wrap[0];
- while (j--) {
- tmp = tmp.lastChild;
- }
- jQuery.merge(nodes, tmp.childNodes);
- tmp = fragment.firstChild;
- tmp.textContent = "";
- }
- }
- }
- fragment.textContent = "";
- i = 0;
- while (elem = nodes[i++]) {
- if (selection && jQuery.inArray(elem, selection) > -1) {
- if (ignored) {
- ignored.push(elem);
- }
- continue;
- }
- attached = isAttached(elem);
- tmp = getAll(fragment.appendChild(elem), "script");
- if (attached) {
- setGlobalEval(tmp);
- }
- if (scripts) {
- j = 0;
- while (elem = tmp[j++]) {
- if (rscriptType.test(elem.type || "")) {
- scripts.push(elem);
- }
- }
- }
- }
- return fragment;
- }
- var rtypenamespace = /^([^.]*)(?:\.(.+)|)/;
- function returnTrue() {
- return true;
- }
- function returnFalse() {
- return false;
- }
- function on(elem, types, selector, data, fn, one) {
- var origFn, type;
- if (typeof types === "object") {
- if (typeof selector !== "string") {
- data = data || selector;
- selector = void 0;
- }
- for (type in types) {
- on(elem, type, selector, data, types[type], one);
- }
- return elem;
- }
- if (data == null && fn == null) {
- fn = selector;
- data = selector = void 0;
- } else if (fn == null) {
- if (typeof selector === "string") {
- fn = data;
- data = void 0;
- } else {
- fn = data;
- data = selector;
- selector = void 0;
- }
- }
- if (fn === false) {
- fn = returnFalse;
- } else if (!fn) {
- return elem;
- }
- if (one === 1) {
- origFn = fn;
- fn = function(event) {
- jQuery().off(event);
- return origFn.apply(this, arguments);
- };
- fn.guid = origFn.guid || (origFn.guid = jQuery.guid++);
- }
- return elem.each(function() {
- jQuery.event.add(this, types, fn, data, selector);
- });
- }
- jQuery.event = {
- global: {},
- add: function(elem, types, handler, data, selector) {
- var handleObjIn, eventHandle, tmp, events, t, handleObj, special, handlers, type, namespaces, origType, elemData = dataPriv.get(elem);
- if (!acceptData(elem)) {
- return;
- }
- if (handler.handler) {
- handleObjIn = handler;
- handler = handleObjIn.handler;
- selector = handleObjIn.selector;
- }
- if (selector) {
- jQuery.find.matchesSelector(documentElement, selector);
- }
- if (!handler.guid) {
- handler.guid = jQuery.guid++;
- }
- if (!(events = elemData.events)) {
- events = elemData.events = /* @__PURE__ */ Object.create(null);
- }
- if (!(eventHandle = elemData.handle)) {
- eventHandle = elemData.handle = function(e) {
- return typeof jQuery !== "undefined" && jQuery.event.triggered !== e.type ? jQuery.event.dispatch.apply(elem, arguments) : void 0;
- };
- }
- types = (types || "").match(rnothtmlwhite) || [""];
- t = types.length;
- while (t--) {
- tmp = rtypenamespace.exec(types[t]) || [];
- type = origType = tmp[1];
- namespaces = (tmp[2] || "").split(".").sort();
- if (!type) {
- continue;
- }
- special = jQuery.event.special[type] || {};
- type = (selector ? special.delegateType : special.bindType) || type;
- special = jQuery.event.special[type] || {};
- handleObj = jQuery.extend({
- type,
- origType,
- data,
- handler,
- guid: handler.guid,
- selector,
- needsContext: selector && jQuery.expr.match.needsContext.test(selector),
- namespace: namespaces.join(".")
- }, handleObjIn);
- if (!(handlers = events[type])) {
- handlers = events[type] = [];
- handlers.delegateCount = 0;
- if (!special.setup || special.setup.call(elem, data, namespaces, eventHandle) === false) {
- if (elem.addEventListener) {
- elem.addEventListener(type, eventHandle);
- }
- }
- }
- if (special.add) {
- special.add.call(elem, handleObj);
- if (!handleObj.handler.guid) {
- handleObj.handler.guid = handler.guid;
- }
- }
- if (selector) {
- handlers.splice(handlers.delegateCount++, 0, handleObj);
- } else {
- handlers.push(handleObj);
- }
- jQuery.event.global[type] = true;
- }
- },
- // Detach an event or set of events from an element
- remove: function(elem, types, handler, selector, mappedTypes) {
- var j, origCount, tmp, events, t, handleObj, special, handlers, type, namespaces, origType, elemData = dataPriv.hasData(elem) && dataPriv.get(elem);
- if (!elemData || !(events = elemData.events)) {
- return;
- }
- types = (types || "").match(rnothtmlwhite) || [""];
- t = types.length;
- while (t--) {
- tmp = rtypenamespace.exec(types[t]) || [];
- type = origType = tmp[1];
- namespaces = (tmp[2] || "").split(".").sort();
- if (!type) {
- for (type in events) {
- jQuery.event.remove(elem, type + types[t], handler, selector, true);
- }
- continue;
- }
- special = jQuery.event.special[type] || {};
- type = (selector ? special.delegateType : special.bindType) || type;
- handlers = events[type] || [];
- tmp = tmp[2] && new RegExp("(^|\\.)" + namespaces.join("\\.(?:.*\\.|)") + "(\\.|$)");
- origCount = j = handlers.length;
- while (j--) {
- handleObj = handlers[j];
- if ((mappedTypes || origType === handleObj.origType) && (!handler || handler.guid === handleObj.guid) && (!tmp || tmp.test(handleObj.namespace)) && (!selector || selector === handleObj.selector || selector === "**" && handleObj.selector)) {
- handlers.splice(j, 1);
- if (handleObj.selector) {
- handlers.delegateCount--;
- }
- if (special.remove) {
- special.remove.call(elem, handleObj);
- }
- }
- }
- if (origCount && !handlers.length) {
- if (!special.teardown || special.teardown.call(elem, namespaces, elemData.handle) === false) {
- jQuery.removeEvent(elem, type, elemData.handle);
- }
- delete events[type];
- }
- }
- if (jQuery.isEmptyObject(events)) {
- dataPriv.remove(elem, "handle events");
- }
- },
- dispatch: function(nativeEvent) {
- var i, j, ret, matched, handleObj, handlerQueue, args = new Array(arguments.length), event = jQuery.event.fix(nativeEvent), handlers = (dataPriv.get(this, "events") || /* @__PURE__ */ Object.create(null))[event.type] || [], special = jQuery.event.special[event.type] || {};
- args[0] = event;
- for (i = 1; i < arguments.length; i++) {
- args[i] = arguments[i];
- }
- event.delegateTarget = this;
- if (special.preDispatch && special.preDispatch.call(this, event) === false) {
- return;
- }
- handlerQueue = jQuery.event.handlers.call(this, event, handlers);
- i = 0;
- while ((matched = handlerQueue[i++]) && !event.isPropagationStopped()) {
- event.currentTarget = matched.elem;
- j = 0;
- while ((handleObj = matched.handlers[j++]) && !event.isImmediatePropagationStopped()) {
- if (!event.rnamespace || handleObj.namespace === false || event.rnamespace.test(handleObj.namespace)) {
- event.handleObj = handleObj;
- event.data = handleObj.data;
- ret = ((jQuery.event.special[handleObj.origType] || {}).handle || handleObj.handler).apply(matched.elem, args);
- if (ret !== void 0) {
- if ((event.result = ret) === false) {
- event.preventDefault();
- event.stopPropagation();
- }
- }
- }
- }
- }
- if (special.postDispatch) {
- special.postDispatch.call(this, event);
- }
- return event.result;
- },
- handlers: function(event, handlers) {
- var i, handleObj, sel, matchedHandlers, matchedSelectors, handlerQueue = [], delegateCount = handlers.delegateCount, cur = event.target;
- if (delegateCount && // Support: IE <=9
- // Black-hole SVG <use> instance trees (trac-13180)
- cur.nodeType && // Support: Firefox <=42
- // Suppress spec-violating clicks indicating a non-primary pointer button (trac-3861)
- // https://www.w3.org/TR/DOM-Level-3-Events/#event-type-click
- // Support: IE 11 only
- // ...but not arrow key "clicks" of radio inputs, which can have `button` -1 (gh-2343)
- !(event.type === "click" && event.button >= 1)) {
- for (; cur !== this; cur = cur.parentNode || this) {
- if (cur.nodeType === 1 && !(event.type === "click" && cur.disabled === true)) {
- matchedHandlers = [];
- matchedSelectors = {};
- for (i = 0; i < delegateCount; i++) {
- handleObj = handlers[i];
- sel = handleObj.selector + " ";
- if (matchedSelectors[sel] === void 0) {
- matchedSelectors[sel] = handleObj.needsContext ? jQuery(sel, this).index(cur) > -1 : jQuery.find(sel, this, null, [cur]).length;
- }
- if (matchedSelectors[sel]) {
- matchedHandlers.push(handleObj);
- }
- }
- if (matchedHandlers.length) {
- handlerQueue.push({ elem: cur, handlers: matchedHandlers });
- }
- }
- }
- }
- cur = this;
- if (delegateCount < handlers.length) {
- handlerQueue.push({ elem: cur, handlers: handlers.slice(delegateCount) });
- }
- return handlerQueue;
- },
- addProp: function(name, hook) {
- Object.defineProperty(jQuery.Event.prototype, name, {
- enumerable: true,
- configurable: true,
- get: isFunction(hook) ? function() {
- if (this.originalEvent) {
- return hook(this.originalEvent);
- }
- } : function() {
- if (this.originalEvent) {
- return this.originalEvent[name];
- }
- },
- set: function(value) {
- Object.defineProperty(this, name, {
- enumerable: true,
- configurable: true,
- writable: true,
- value
- });
- }
- });
- },
- fix: function(originalEvent) {
- return originalEvent[jQuery.expando] ? originalEvent : new jQuery.Event(originalEvent);
- },
- special: {
- load: {
- // Prevent triggered image.load events from bubbling to window.load
- noBubble: true
- },
- click: {
- // Utilize native event to ensure correct state for checkable inputs
- setup: function(data) {
- var el = this || data;
- if (rcheckableType.test(el.type) && el.click && nodeName(el, "input")) {
- leverageNative(el, "click", true);
- }
- return false;
- },
- trigger: function(data) {
- var el = this || data;
- if (rcheckableType.test(el.type) && el.click && nodeName(el, "input")) {
- leverageNative(el, "click");
- }
- return true;
- },
- // For cross-browser consistency, suppress native .click() on links
- // Also prevent it if we're currently inside a leveraged native-event stack
- _default: function(event) {
- var target = event.target;
- return rcheckableType.test(target.type) && target.click && nodeName(target, "input") && dataPriv.get(target, "click") || nodeName(target, "a");
- }
- },
- beforeunload: {
- postDispatch: function(event) {
- if (event.result !== void 0 && event.originalEvent) {
- event.originalEvent.returnValue = event.result;
- }
- }
- }
- }
- };
- function leverageNative(el, type, isSetup) {
- if (!isSetup) {
- if (dataPriv.get(el, type) === void 0) {
- jQuery.event.add(el, type, returnTrue);
- }
- return;
- }
- dataPriv.set(el, type, false);
- jQuery.event.add(el, type, {
- namespace: false,
- handler: function(event) {
- var result, saved = dataPriv.get(this, type);
- if (event.isTrigger & 1 && this[type]) {
- if (!saved) {
- saved = slice.call(arguments);
- dataPriv.set(this, type, saved);
- this[type]();
- result = dataPriv.get(this, type);
- dataPriv.set(this, type, false);
- if (saved !== result) {
- event.stopImmediatePropagation();
- event.preventDefault();
- return result;
- }
- } else if ((jQuery.event.special[type] || {}).delegateType) {
- event.stopPropagation();
- }
- } else if (saved) {
- dataPriv.set(this, type, jQuery.event.trigger(
- saved[0],
- saved.slice(1),
- this
- ));
- event.stopPropagation();
- event.isImmediatePropagationStopped = returnTrue;
- }
- }
- });
- }
- jQuery.removeEvent = function(elem, type, handle) {
- if (elem.removeEventListener) {
- elem.removeEventListener(type, handle);
- }
- };
- jQuery.Event = function(src, props) {
- if (!(this instanceof jQuery.Event)) {
- return new jQuery.Event(src, props);
- }
- if (src && src.type) {
- this.originalEvent = src;
- this.type = src.type;
- this.isDefaultPrevented = src.defaultPrevented || src.defaultPrevented === void 0 && // Support: Android <=2.3 only
- src.returnValue === false ? returnTrue : returnFalse;
- this.target = src.target && src.target.nodeType === 3 ? src.target.parentNode : src.target;
- this.currentTarget = src.currentTarget;
- this.relatedTarget = src.relatedTarget;
- } else {
- this.type = src;
- }
- if (props) {
- jQuery.extend(this, props);
- }
- this.timeStamp = src && src.timeStamp || Date.now();
- this[jQuery.expando] = true;
- };
- jQuery.Event.prototype = {
- constructor: jQuery.Event,
- isDefaultPrevented: returnFalse,
- isPropagationStopped: returnFalse,
- isImmediatePropagationStopped: returnFalse,
- isSimulated: false,
- preventDefault: function() {
- var e = this.originalEvent;
- this.isDefaultPrevented = returnTrue;
- if (e && !this.isSimulated) {
- e.preventDefault();
- }
- },
- stopPropagation: function() {
- var e = this.originalEvent;
- this.isPropagationStopped = returnTrue;
- if (e && !this.isSimulated) {
- e.stopPropagation();
- }
- },
- stopImmediatePropagation: function() {
- var e = this.originalEvent;
- this.isImmediatePropagationStopped = returnTrue;
- if (e && !this.isSimulated) {
- e.stopImmediatePropagation();
- }
- this.stopPropagation();
- }
- };
- jQuery.each({
- altKey: true,
- bubbles: true,
- cancelable: true,
- changedTouches: true,
- ctrlKey: true,
- detail: true,
- eventPhase: true,
- metaKey: true,
- pageX: true,
- pageY: true,
- shiftKey: true,
- view: true,
- "char": true,
- code: true,
- charCode: true,
- key: true,
- keyCode: true,
- button: true,
- buttons: true,
- clientX: true,
- clientY: true,
- offsetX: true,
- offsetY: true,
- pointerId: true,
- pointerType: true,
- screenX: true,
- screenY: true,
- targetTouches: true,
- toElement: true,
- touches: true,
- which: true
- }, jQuery.event.addProp);
- jQuery.each({ focus: "focusin", blur: "focusout" }, function(type, delegateType) {
- function focusMappedHandler(nativeEvent) {
- if (document2.documentMode) {
- var handle = dataPriv.get(this, "handle"), event = jQuery.event.fix(nativeEvent);
- event.type = nativeEvent.type === "focusin" ? "focus" : "blur";
- event.isSimulated = true;
- handle(nativeEvent);
- if (event.target === event.currentTarget) {
- handle(event);
- }
- } else {
- jQuery.event.simulate(
- delegateType,
- nativeEvent.target,
- jQuery.event.fix(nativeEvent)
- );
- }
- }
- jQuery.event.special[type] = {
- // Utilize native event if possible so blur/focus sequence is correct
- setup: function() {
- var attaches;
- leverageNative(this, type, true);
- if (document2.documentMode) {
- attaches = dataPriv.get(this, delegateType);
- if (!attaches) {
- this.addEventListener(delegateType, focusMappedHandler);
- }
- dataPriv.set(this, delegateType, (attaches || 0) + 1);
- } else {
- return false;
- }
- },
- trigger: function() {
- leverageNative(this, type);
- return true;
- },
- teardown: function() {
- var attaches;
- if (document2.documentMode) {
- attaches = dataPriv.get(this, delegateType) - 1;
- if (!attaches) {
- this.removeEventListener(delegateType, focusMappedHandler);
- dataPriv.remove(this, delegateType);
- } else {
- dataPriv.set(this, delegateType, attaches);
- }
- } else {
- return false;
- }
- },
- // Suppress native focus or blur if we're currently inside
- // a leveraged native-event stack
- _default: function(event) {
- return dataPriv.get(event.target, type);
- },
- delegateType
- };
- jQuery.event.special[delegateType] = {
- setup: function() {
- var doc = this.ownerDocument || this.document || this, dataHolder = document2.documentMode ? this : doc, attaches = dataPriv.get(dataHolder, delegateType);
- if (!attaches) {
- if (document2.documentMode) {
- this.addEventListener(delegateType, focusMappedHandler);
- } else {
- doc.addEventListener(type, focusMappedHandler, true);
- }
- }
- dataPriv.set(dataHolder, delegateType, (attaches || 0) + 1);
- },
- teardown: function() {
- var doc = this.ownerDocument || this.document || this, dataHolder = document2.documentMode ? this : doc, attaches = dataPriv.get(dataHolder, delegateType) - 1;
- if (!attaches) {
- if (document2.documentMode) {
- this.removeEventListener(delegateType, focusMappedHandler);
- } else {
- doc.removeEventListener(type, focusMappedHandler, true);
- }
- dataPriv.remove(dataHolder, delegateType);
- } else {
- dataPriv.set(dataHolder, delegateType, attaches);
- }
- }
- };
- });
- jQuery.each({
- mouseenter: "mouseover",
- mouseleave: "mouseout",
- pointerenter: "pointerover",
- pointerleave: "pointerout"
- }, function(orig, fix) {
- jQuery.event.special[orig] = {
- delegateType: fix,
- bindType: fix,
- handle: function(event) {
- var ret, target = this, related = event.relatedTarget, handleObj = event.handleObj;
- if (!related || related !== target && !jQuery.contains(target, related)) {
- event.type = handleObj.origType;
- ret = handleObj.handler.apply(this, arguments);
- event.type = fix;
- }
- return ret;
- }
- };
- });
- jQuery.fn.extend({
- on: function(types, selector, data, fn) {
- return on(this, types, selector, data, fn);
- },
- one: function(types, selector, data, fn) {
- return on(this, types, selector, data, fn, 1);
- },
- off: function(types, selector, fn) {
- var handleObj, type;
- if (types && types.preventDefault && types.handleObj) {
- handleObj = types.handleObj;
- jQuery(types.delegateTarget).off(
- handleObj.namespace ? handleObj.origType + "." + handleObj.namespace : handleObj.origType,
- handleObj.selector,
- handleObj.handler
- );
- return this;
- }
- if (typeof types === "object") {
- for (type in types) {
- this.off(type, selector, types[type]);
- }
- return this;
- }
- if (selector === false || typeof selector === "function") {
- fn = selector;
- selector = void 0;
- }
- if (fn === false) {
- fn = returnFalse;
- }
- return this.each(function() {
- jQuery.event.remove(this, types, fn, selector);
- });
- }
- });
- var rnoInnerhtml = /<script|<style|<link/i, rchecked = /checked\s*(?:[^=]|=\s*.checked.)/i, rcleanScript = /^\s*<!\[CDATA\[|\]\]>\s*$/g;
- function manipulationTarget(elem, content) {
- if (nodeName(elem, "table") && nodeName(content.nodeType !== 11 ? content : content.firstChild, "tr")) {
- return jQuery(elem).children("tbody")[0] || elem;
- }
- return elem;
- }
- function disableScript(elem) {
- elem.type = (elem.getAttribute("type") !== null) + "/" + elem.type;
- return elem;
- }
- function restoreScript(elem) {
- if ((elem.type || "").slice(0, 5) === "true/") {
- elem.type = elem.type.slice(5);
- } else {
- elem.removeAttribute("type");
- }
- return elem;
- }
- function cloneCopyEvent(src, dest) {
- var i, l, type, pdataOld, udataOld, udataCur, events;
- if (dest.nodeType !== 1) {
- return;
- }
- if (dataPriv.hasData(src)) {
- pdataOld = dataPriv.get(src);
- events = pdataOld.events;
- if (events) {
- dataPriv.remove(dest, "handle events");
- for (type in events) {
- for (i = 0, l = events[type].length; i < l; i++) {
- jQuery.event.add(dest, type, events[type][i]);
- }
- }
- }
- }
- if (dataUser.hasData(src)) {
- udataOld = dataUser.access(src);
- udataCur = jQuery.extend({}, udataOld);
- dataUser.set(dest, udataCur);
- }
- }
- function fixInput(src, dest) {
- var nodeName2 = dest.nodeName.toLowerCase();
- if (nodeName2 === "input" && rcheckableType.test(src.type)) {
- dest.checked = src.checked;
- } else if (nodeName2 === "input" || nodeName2 === "textarea") {
- dest.defaultValue = src.defaultValue;
- }
- }
- function domManip(collection, args, callback, ignored) {
- args = flat(args);
- var fragment, first, scripts, hasScripts, node, doc, i = 0, l = collection.length, iNoClone = l - 1, value = args[0], valueIsFunction = isFunction(value);
- if (valueIsFunction || l > 1 && typeof value === "string" && !support.checkClone && rchecked.test(value)) {
- return collection.each(function(index) {
- var self2 = collection.eq(index);
- if (valueIsFunction) {
- args[0] = value.call(this, index, self2.html());
- }
- domManip(self2, args, callback, ignored);
- });
- }
- if (l) {
- fragment = buildFragment(args, collection[0].ownerDocument, false, collection, ignored);
- first = fragment.firstChild;
- if (fragment.childNodes.length === 1) {
- fragment = first;
- }
- if (first || ignored) {
- scripts = jQuery.map(getAll(fragment, "script"), disableScript);
- hasScripts = scripts.length;
- for (; i < l; i++) {
- node = fragment;
- if (i !== iNoClone) {
- node = jQuery.clone(node, true, true);
- if (hasScripts) {
- jQuery.merge(scripts, getAll(node, "script"));
- }
- }
- callback.call(collection[i], node, i);
- }
- if (hasScripts) {
- doc = scripts[scripts.length - 1].ownerDocument;
- jQuery.map(scripts, restoreScript);
- for (i = 0; i < hasScripts; i++) {
- node = scripts[i];
- if (rscriptType.test(node.type || "") && !dataPriv.access(node, "globalEval") && jQuery.contains(doc, node)) {
- if (node.src && (node.type || "").toLowerCase() !== "module") {
- if (jQuery._evalUrl && !node.noModule) {
- jQuery._evalUrl(node.src, {
- nonce: node.nonce || node.getAttribute("nonce")
- }, doc);
- }
- } else {
- DOMEval(node.textContent.replace(rcleanScript, ""), node, doc);
- }
- }
- }
- }
- }
- }
- return collection;
- }
- function remove(elem, selector, keepData) {
- var node, nodes = selector ? jQuery.filter(selector, elem) : elem, i = 0;
- for (; (node = nodes[i]) != null; i++) {
- if (!keepData && node.nodeType === 1) {
- jQuery.cleanData(getAll(node));
- }
- if (node.parentNode) {
- if (keepData && isAttached(node)) {
- setGlobalEval(getAll(node, "script"));
- }
- node.parentNode.removeChild(node);
- }
- }
- return elem;
- }
- jQuery.extend({
- htmlPrefilter: function(html) {
- return html;
- },
- clone: function(elem, dataAndEvents, deepDataAndEvents) {
- var i, l, srcElements, destElements, clone = elem.cloneNode(true), inPage = isAttached(elem);
- if (!support.noCloneChecked && (elem.nodeType === 1 || elem.nodeType === 11) && !jQuery.isXMLDoc(elem)) {
- destElements = getAll(clone);
- srcElements = getAll(elem);
- for (i = 0, l = srcElements.length; i < l; i++) {
- fixInput(srcElements[i], destElements[i]);
- }
- }
- if (dataAndEvents) {
- if (deepDataAndEvents) {
- srcElements = srcElements || getAll(elem);
- destElements = destElements || getAll(clone);
- for (i = 0, l = srcElements.length; i < l; i++) {
- cloneCopyEvent(srcElements[i], destElements[i]);
- }
- } else {
- cloneCopyEvent(elem, clone);
- }
- }
- destElements = getAll(clone, "script");
- if (destElements.length > 0) {
- setGlobalEval(destElements, !inPage && getAll(elem, "script"));
- }
- return clone;
- },
- cleanData: function(elems) {
- var data, elem, type, special = jQuery.event.special, i = 0;
- for (; (elem = elems[i]) !== void 0; i++) {
- if (acceptData(elem)) {
- if (data = elem[dataPriv.expando]) {
- if (data.events) {
- for (type in data.events) {
- if (special[type]) {
- jQuery.event.remove(elem, type);
- } else {
- jQuery.removeEvent(elem, type, data.handle);
- }
- }
- }
- elem[dataPriv.expando] = void 0;
- }
- if (elem[dataUser.expando]) {
- elem[dataUser.expando] = void 0;
- }
- }
- }
- }
- });
- jQuery.fn.extend({
- detach: function(selector) {
- return remove(this, selector, true);
- },
- remove: function(selector) {
- return remove(this, selector);
- },
- text: function(value) {
- return access(this, function(value2) {
- return value2 === void 0 ? jQuery.text(this) : this.empty().each(function() {
- if (this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9) {
- this.textContent = value2;
- }
- });
- }, null, value, arguments.length);
- },
- append: function() {
- return domManip(this, arguments, function(elem) {
- if (this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9) {
- var target = manipulationTarget(this, elem);
- target.appendChild(elem);
- }
- });
- },
- prepend: function() {
- return domManip(this, arguments, function(elem) {
- if (this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9) {
- var target = manipulationTarget(this, elem);
- target.insertBefore(elem, target.firstChild);
- }
- });
- },
- before: function() {
- return domManip(this, arguments, function(elem) {
- if (this.parentNode) {
- this.parentNode.insertBefore(elem, this);
- }
- });
- },
- after: function() {
- return domManip(this, arguments, function(elem) {
- if (this.parentNode) {
- this.parentNode.insertBefore(elem, this.nextSibling);
- }
- });
- },
- empty: function() {
- var elem, i = 0;
- for (; (elem = this[i]) != null; i++) {
- if (elem.nodeType === 1) {
- jQuery.cleanData(getAll(elem, false));
- elem.textContent = "";
- }
- }
- return this;
- },
- clone: function(dataAndEvents, deepDataAndEvents) {
- dataAndEvents = dataAndEvents == null ? false : dataAndEvents;
- deepDataAndEvents = deepDataAndEvents == null ? dataAndEvents : deepDataAndEvents;
- return this.map(function() {
- return jQuery.clone(this, dataAndEvents, deepDataAndEvents);
- });
- },
- html: function(value) {
- return access(this, function(value2) {
- var elem = this[0] || {}, i = 0, l = this.length;
- if (value2 === void 0 && elem.nodeType === 1) {
- return elem.innerHTML;
- }
- if (typeof value2 === "string" && !rnoInnerhtml.test(value2) && !wrapMap[(rtagName.exec(value2) || ["", ""])[1].toLowerCase()]) {
- value2 = jQuery.htmlPrefilter(value2);
- try {
- for (; i < l; i++) {
- elem = this[i] || {};
- if (elem.nodeType === 1) {
- jQuery.cleanData(getAll(elem, false));
- elem.innerHTML = value2;
- }
- }
- elem = 0;
- } catch (e) {
- }
- }
- if (elem) {
- this.empty().append(value2);
- }
- }, null, value, arguments.length);
- },
- replaceWith: function() {
- var ignored = [];
- return domManip(this, arguments, function(elem) {
- var parent = this.parentNode;
- if (jQuery.inArray(this, ignored) < 0) {
- jQuery.cleanData(getAll(this));
- if (parent) {
- parent.replaceChild(elem, this);
- }
- }
- }, ignored);
- }
- });
- jQuery.each({
- appendTo: "append",
- prependTo: "prepend",
- insertBefore: "before",
- insertAfter: "after",
- replaceAll: "replaceWith"
- }, function(name, original) {
- jQuery.fn[name] = function(selector) {
- var elems, ret = [], insert = jQuery(selector), last = insert.length - 1, i = 0;
- for (; i <= last; i++) {
- elems = i === last ? this : this.clone(true);
- jQuery(insert[i])[original](elems);
- push.apply(ret, elems.get());
- }
- return this.pushStack(ret);
- };
- });
- var rnumnonpx = new RegExp("^(" + pnum + ")(?!px)[a-z%]+$", "i");
- var rcustomProp = /^--/;
- var getStyles = function(elem) {
- var view = elem.ownerDocument.defaultView;
- if (!view || !view.opener) {
- view = window2;
- }
- return view.getComputedStyle(elem);
- };
- var swap = function(elem, options, callback) {
- var ret, name, old = {};
- for (name in options) {
- old[name] = elem.style[name];
- elem.style[name] = options[name];
- }
- ret = callback.call(elem);
- for (name in options) {
- elem.style[name] = old[name];
- }
- return ret;
- };
- var rboxStyle = new RegExp(cssExpand.join("|"), "i");
- (function() {
- function computeStyleTests() {
- if (!div) {
- return;
- }
- container.style.cssText = "position:absolute;left:-11111px;width:60px;margin-top:1px;padding:0;border:0";
- div.style.cssText = "position:relative;display:block;box-sizing:border-box;overflow:scroll;margin:auto;border:1px;padding:1px;width:60%;top:1%";
- documentElement.appendChild(container).appendChild(div);
- var divStyle = window2.getComputedStyle(div);
- pixelPositionVal = divStyle.top !== "1%";
- reliableMarginLeftVal = roundPixelMeasures(divStyle.marginLeft) === 12;
- div.style.right = "60%";
- pixelBoxStylesVal = roundPixelMeasures(divStyle.right) === 36;
- boxSizingReliableVal = roundPixelMeasures(divStyle.width) === 36;
- div.style.position = "absolute";
- scrollboxSizeVal = roundPixelMeasures(div.offsetWidth / 3) === 12;
- documentElement.removeChild(container);
- div = null;
- }
- function roundPixelMeasures(measure) {
- return Math.round(parseFloat(measure));
- }
- var pixelPositionVal, boxSizingReliableVal, scrollboxSizeVal, pixelBoxStylesVal, reliableTrDimensionsVal, reliableMarginLeftVal, container = document2.createElement("div"), div = document2.createElement("div");
- if (!div.style) {
- return;
- }
- div.style.backgroundClip = "content-box";
- div.cloneNode(true).style.backgroundClip = "";
- support.clearCloneStyle = div.style.backgroundClip === "content-box";
- jQuery.extend(support, {
- boxSizingReliable: function() {
- computeStyleTests();
- return boxSizingReliableVal;
- },
- pixelBoxStyles: function() {
- computeStyleTests();
- return pixelBoxStylesVal;
- },
- pixelPosition: function() {
- computeStyleTests();
- return pixelPositionVal;
- },
- reliableMarginLeft: function() {
- computeStyleTests();
- return reliableMarginLeftVal;
- },
- scrollboxSize: function() {
- computeStyleTests();
- return scrollboxSizeVal;
- },
- // Support: IE 9 - 11+, Edge 15 - 18+
- // IE/Edge misreport `getComputedStyle` of table rows with width/height
- // set in CSS while `offset*` properties report correct values.
- // Behavior in IE 9 is more subtle than in newer versions & it passes
- // some versions of this test; make sure not to make it pass there!
- //
- // Support: Firefox 70+
- // Only Firefox includes border widths
- // in computed dimensions. (gh-4529)
- reliableTrDimensions: function() {
- var table, tr, trChild, trStyle;
- if (reliableTrDimensionsVal == null) {
- table = document2.createElement("table");
- tr = document2.createElement("tr");
- trChild = document2.createElement("div");
- table.style.cssText = "position:absolute;left:-11111px;border-collapse:separate";
- tr.style.cssText = "box-sizing:content-box;border:1px solid";
- tr.style.height = "1px";
- trChild.style.height = "9px";
- trChild.style.display = "block";
- documentElement.appendChild(table).appendChild(tr).appendChild(trChild);
- trStyle = window2.getComputedStyle(tr);
- reliableTrDimensionsVal = parseInt(trStyle.height, 10) + parseInt(trStyle.borderTopWidth, 10) + parseInt(trStyle.borderBottomWidth, 10) === tr.offsetHeight;
- documentElement.removeChild(table);
- }
- return reliableTrDimensionsVal;
- }
- });
- })();
- function curCSS(elem, name, computed) {
- var width, minWidth, maxWidth, ret, isCustomProp = rcustomProp.test(name), style = elem.style;
- computed = computed || getStyles(elem);
- if (computed) {
- ret = computed.getPropertyValue(name) || computed[name];
- if (isCustomProp && ret) {
- ret = ret.replace(rtrimCSS, "$1") || void 0;
- }
- if (ret === "" && !isAttached(elem)) {
- ret = jQuery.style(elem, name);
- }
- if (!support.pixelBoxStyles() && rnumnonpx.test(ret) && rboxStyle.test(name)) {
- width = style.width;
- minWidth = style.minWidth;
- maxWidth = style.maxWidth;
- style.minWidth = style.maxWidth = style.width = ret;
- ret = computed.width;
- style.width = width;
- style.minWidth = minWidth;
- style.maxWidth = maxWidth;
- }
- }
- return ret !== void 0 ? (
- // Support: IE <=9 - 11 only
- // IE returns zIndex value as an integer.
- ret + ""
- ) : ret;
- }
- function addGetHookIf(conditionFn, hookFn) {
- return {
- get: function() {
- if (conditionFn()) {
- delete this.get;
- return;
- }
- return (this.get = hookFn).apply(this, arguments);
- }
- };
- }
- var cssPrefixes = ["Webkit", "Moz", "ms"], emptyStyle = document2.createElement("div").style, vendorProps = {};
- function vendorPropName(name) {
- var capName = name[0].toUpperCase() + name.slice(1), i = cssPrefixes.length;
- while (i--) {
- name = cssPrefixes[i] + capName;
- if (name in emptyStyle) {
- return name;
- }
- }
- }
- function finalPropName(name) {
- var final = jQuery.cssProps[name] || vendorProps[name];
- if (final) {
- return final;
- }
- if (name in emptyStyle) {
- return name;
- }
- return vendorProps[name] = vendorPropName(name) || name;
- }
- var rdisplayswap = /^(none|table(?!-c[ea]).+)/, cssShow = { position: "absolute", visibility: "hidden", display: "block" }, cssNormalTransform = {
- letterSpacing: "0",
- fontWeight: "400"
- };
- function setPositiveNumber(_elem, value, subtract) {
- var matches = rcssNum.exec(value);
- return matches ? (
- // Guard against undefined "subtract", e.g., when used as in cssHooks
- Math.max(0, matches[2] - (subtract || 0)) + (matches[3] || "px")
- ) : value;
- }
- function boxModelAdjustment(elem, dimension, box, isBorderBox, styles, computedVal) {
- var i = dimension === "width" ? 1 : 0, extra = 0, delta = 0, marginDelta = 0;
- if (box === (isBorderBox ? "border" : "content")) {
- return 0;
- }
- for (; i < 4; i += 2) {
- if (box === "margin") {
- marginDelta += jQuery.css(elem, box + cssExpand[i], true, styles);
- }
- if (!isBorderBox) {
- delta += jQuery.css(elem, "padding" + cssExpand[i], true, styles);
- if (box !== "padding") {
- delta += jQuery.css(elem, "border" + cssExpand[i] + "Width", true, styles);
- } else {
- extra += jQuery.css(elem, "border" + cssExpand[i] + "Width", true, styles);
- }
- } else {
- if (box === "content") {
- delta -= jQuery.css(elem, "padding" + cssExpand[i], true, styles);
- }
- if (box !== "margin") {
- delta -= jQuery.css(elem, "border" + cssExpand[i] + "Width", true, styles);
- }
- }
- }
- if (!isBorderBox && computedVal >= 0) {
- delta += Math.max(0, Math.ceil(
- elem["offset" + dimension[0].toUpperCase() + dimension.slice(1)] - computedVal - delta - extra - 0.5
- // If offsetWidth/offsetHeight is unknown, then we can't determine content-box scroll gutter
- // Use an explicit zero to avoid NaN (gh-3964)
- )) || 0;
- }
- return delta + marginDelta;
- }
- function getWidthOrHeight(elem, dimension, extra) {
- var styles = getStyles(elem), boxSizingNeeded = !support.boxSizingReliable() || extra, isBorderBox = boxSizingNeeded && jQuery.css(elem, "boxSizing", false, styles) === "border-box", valueIsBorderBox = isBorderBox, val = curCSS(elem, dimension, styles), offsetProp = "offset" + dimension[0].toUpperCase() + dimension.slice(1);
- if (rnumnonpx.test(val)) {
- if (!extra) {
- return val;
- }
- val = "auto";
- }
- if ((!support.boxSizingReliable() && isBorderBox || // Support: IE 10 - 11+, Edge 15 - 18+
- // IE/Edge misreport `getComputedStyle` of table rows with width/height
- // set in CSS while `offset*` properties report correct values.
- // Interestingly, in some cases IE 9 doesn't suffer from this issue.
- !support.reliableTrDimensions() && nodeName(elem, "tr") || // Fall back to offsetWidth/offsetHeight when value is "auto"
- // This happens for inline elements with no explicit setting (gh-3571)
- val === "auto" || // Support: Android <=4.1 - 4.3 only
- // Also use offsetWidth/offsetHeight for misreported inline dimensions (gh-3602)
- !parseFloat(val) && jQuery.css(elem, "display", false, styles) === "inline") && // Make sure the element is visible & connected
- elem.getClientRects().length) {
- isBorderBox = jQuery.css(elem, "boxSizing", false, styles) === "border-box";
- valueIsBorderBox = offsetProp in elem;
- if (valueIsBorderBox) {
- val = elem[offsetProp];
- }
- }
- val = parseFloat(val) || 0;
- return val + boxModelAdjustment(
- elem,
- dimension,
- extra || (isBorderBox ? "border" : "content"),
- valueIsBorderBox,
- styles,
- // Provide the current computed size to request scroll gutter calculation (gh-3589)
- val
- ) + "px";
- }
- jQuery.extend({
- // Add in style property hooks for overriding the default
- // behavior of getting and setting a style property
- cssHooks: {
- opacity: {
- get: function(elem, computed) {
- if (computed) {
- var ret = curCSS(elem, "opacity");
- return ret === "" ? "1" : ret;
- }
- }
- }
- },
- // Don't automatically add "px" to these possibly-unitless properties
- cssNumber: {
- animationIterationCount: true,
- aspectRatio: true,
- borderImageSlice: true,
- columnCount: true,
- flexGrow: true,
- flexShrink: true,
- fontWeight: true,
- gridArea: true,
- gridColumn: true,
- gridColumnEnd: true,
- gridColumnStart: true,
- gridRow: true,
- gridRowEnd: true,
- gridRowStart: true,
- lineHeight: true,
- opacity: true,
- order: true,
- orphans: true,
- scale: true,
- widows: true,
- zIndex: true,
- zoom: true,
- // SVG-related
- fillOpacity: true,
- floodOpacity: true,
- stopOpacity: true,
- strokeMiterlimit: true,
- strokeOpacity: true
- },
- // Add in properties whose names you wish to fix before
- // setting or getting the value
- cssProps: {},
- // Get and set the style property on a DOM Node
- style: function(elem, name, value, extra) {
- if (!elem || elem.nodeType === 3 || elem.nodeType === 8 || !elem.style) {
- return;
- }
- var ret, type, hooks, origName = camelCase(name), isCustomProp = rcustomProp.test(name), style = elem.style;
- if (!isCustomProp) {
- name = finalPropName(origName);
- }
- hooks = jQuery.cssHooks[name] || jQuery.cssHooks[origName];
- if (value !== void 0) {
- type = typeof value;
- if (type === "string" && (ret = rcssNum.exec(value)) && ret[1]) {
- value = adjustCSS(elem, name, ret);
- type = "number";
- }
- if (value == null || value !== value) {
- return;
- }
- if (type === "number" && !isCustomProp) {
- value += ret && ret[3] || (jQuery.cssNumber[origName] ? "" : "px");
- }
- if (!support.clearCloneStyle && value === "" && name.indexOf("background") === 0) {
- style[name] = "inherit";
- }
- if (!hooks || !("set" in hooks) || (value = hooks.set(elem, value, extra)) !== void 0) {
- if (isCustomProp) {
- style.setProperty(name, value);
- } else {
- style[name] = value;
- }
- }
- } else {
- if (hooks && "get" in hooks && (ret = hooks.get(elem, false, extra)) !== void 0) {
- return ret;
- }
- return style[name];
- }
- },
- css: function(elem, name, extra, styles) {
- var val, num, hooks, origName = camelCase(name), isCustomProp = rcustomProp.test(name);
- if (!isCustomProp) {
- name = finalPropName(origName);
- }
- hooks = jQuery.cssHooks[name] || jQuery.cssHooks[origName];
- if (hooks && "get" in hooks) {
- val = hooks.get(elem, true, extra);
- }
- if (val === void 0) {
- val = curCSS(elem, name, styles);
- }
- if (val === "normal" && name in cssNormalTransform) {
- val = cssNormalTransform[name];
- }
- if (extra === "" || extra) {
- num = parseFloat(val);
- return extra === true || isFinite(num) ? num || 0 : val;
- }
- return val;
- }
- });
- jQuery.each(["height", "width"], function(_i, dimension) {
- jQuery.cssHooks[dimension] = {
- get: function(elem, computed, extra) {
- if (computed) {
- return rdisplayswap.test(jQuery.css(elem, "display")) && // Support: Safari 8+
- // Table columns in Safari have non-zero offsetWidth & zero
- // getBoundingClientRect().width unless display is changed.
- // Support: IE <=11 only
- // Running getBoundingClientRect on a disconnected node
- // in IE throws an error.
- (!elem.getClientRects().length || !elem.getBoundingClientRect().width) ? swap(elem, cssShow, function() {
- return getWidthOrHeight(elem, dimension, extra);
- }) : getWidthOrHeight(elem, dimension, extra);
- }
- },
- set: function(elem, value, extra) {
- var matches, styles = getStyles(elem), scrollboxSizeBuggy = !support.scrollboxSize() && styles.position === "absolute", boxSizingNeeded = scrollboxSizeBuggy || extra, isBorderBox = boxSizingNeeded && jQuery.css(elem, "boxSizing", false, styles) === "border-box", subtract = extra ? boxModelAdjustment(
- elem,
- dimension,
- extra,
- isBorderBox,
- styles
- ) : 0;
- if (isBorderBox && scrollboxSizeBuggy) {
- subtract -= Math.ceil(
- elem["offset" + dimension[0].toUpperCase() + dimension.slice(1)] - parseFloat(styles[dimension]) - boxModelAdjustment(elem, dimension, "border", false, styles) - 0.5
- );
- }
- if (subtract && (matches = rcssNum.exec(value)) && (matches[3] || "px") !== "px") {
- elem.style[dimension] = value;
- value = jQuery.css(elem, dimension);
- }
- return setPositiveNumber(elem, value, subtract);
- }
- };
- });
- jQuery.cssHooks.marginLeft = addGetHookIf(
- support.reliableMarginLeft,
- function(elem, computed) {
- if (computed) {
- return (parseFloat(curCSS(elem, "marginLeft")) || elem.getBoundingClientRect().left - swap(elem, { marginLeft: 0 }, function() {
- return elem.getBoundingClientRect().left;
- })) + "px";
- }
- }
- );
- jQuery.each({
- margin: "",
- padding: "",
- border: "Width"
- }, function(prefix, suffix) {
- jQuery.cssHooks[prefix + suffix] = {
- expand: function(value) {
- var i = 0, expanded = {}, parts = typeof value === "string" ? value.split(" ") : [value];
- for (; i < 4; i++) {
- expanded[prefix + cssExpand[i] + suffix] = parts[i] || parts[i - 2] || parts[0];
- }
- return expanded;
- }
- };
- if (prefix !== "margin") {
- jQuery.cssHooks[prefix + suffix].set = setPositiveNumber;
- }
- });
- jQuery.fn.extend({
- css: function(name, value) {
- return access(this, function(elem, name2, value2) {
- var styles, len, map = {}, i = 0;
- if (Array.isArray(name2)) {
- styles = getStyles(elem);
- len = name2.length;
- for (; i < len; i++) {
- map[name2[i]] = jQuery.css(elem, name2[i], false, styles);
- }
- return map;
- }
- return value2 !== void 0 ? jQuery.style(elem, name2, value2) : jQuery.css(elem, name2);
- }, name, value, arguments.length > 1);
- }
- });
- function Tween(elem, options, prop, end, easing) {
- return new Tween.prototype.init(elem, options, prop, end, easing);
- }
- jQuery.Tween = Tween;
- Tween.prototype = {
- constructor: Tween,
- init: function(elem, options, prop, end, easing, unit) {
- this.elem = elem;
- this.prop = prop;
- this.easing = easing || jQuery.easing._default;
- this.options = options;
- this.start = this.now = this.cur();
- this.end = end;
- this.unit = unit || (jQuery.cssNumber[prop] ? "" : "px");
- },
- cur: function() {
- var hooks = Tween.propHooks[this.prop];
- return hooks && hooks.get ? hooks.get(this) : Tween.propHooks._default.get(this);
- },
- run: function(percent) {
- var eased, hooks = Tween.propHooks[this.prop];
- if (this.options.duration) {
- this.pos = eased = jQuery.easing[this.easing](
- percent,
- this.options.duration * percent,
- 0,
- 1,
- this.options.duration
- );
- } else {
- this.pos = eased = percent;
- }
- this.now = (this.end - this.start) * eased + this.start;
- if (this.options.step) {
- this.options.step.call(this.elem, this.now, this);
- }
- if (hooks && hooks.set) {
- hooks.set(this);
- } else {
- Tween.propHooks._default.set(this);
- }
- return this;
- }
- };
- Tween.prototype.init.prototype = Tween.prototype;
- Tween.propHooks = {
- _default: {
- get: function(tween) {
- var result;
- if (tween.elem.nodeType !== 1 || tween.elem[tween.prop] != null && tween.elem.style[tween.prop] == null) {
- return tween.elem[tween.prop];
- }
- result = jQuery.css(tween.elem, tween.prop, "");
- return !result || result === "auto" ? 0 : result;
- },
- set: function(tween) {
- if (jQuery.fx.step[tween.prop]) {
- jQuery.fx.step[tween.prop](tween);
- } else if (tween.elem.nodeType === 1 && (jQuery.cssHooks[tween.prop] || tween.elem.style[finalPropName(tween.prop)] != null)) {
- jQuery.style(tween.elem, tween.prop, tween.now + tween.unit);
- } else {
- tween.elem[tween.prop] = tween.now;
- }
- }
- }
- };
- Tween.propHooks.scrollTop = Tween.propHooks.scrollLeft = {
- set: function(tween) {
- if (tween.elem.nodeType && tween.elem.parentNode) {
- tween.elem[tween.prop] = tween.now;
- }
- }
- };
- jQuery.easing = {
- linear: function(p) {
- return p;
- },
- swing: function(p) {
- return 0.5 - Math.cos(p * Math.PI) / 2;
- },
- _default: "swing"
- };
- jQuery.fx = Tween.prototype.init;
- jQuery.fx.step = {};
- var fxNow, inProgress, rfxtypes = /^(?:toggle|show|hide)$/, rrun = /queueHooks$/;
- function schedule() {
- if (inProgress) {
- if (document2.hidden === false && window2.requestAnimationFrame) {
- window2.requestAnimationFrame(schedule);
- } else {
- window2.setTimeout(schedule, jQuery.fx.interval);
- }
- jQuery.fx.tick();
- }
- }
- function createFxNow() {
- window2.setTimeout(function() {
- fxNow = void 0;
- });
- return fxNow = Date.now();
- }
- function genFx(type, includeWidth) {
- var which, i = 0, attrs = { height: type };
- includeWidth = includeWidth ? 1 : 0;
- for (; i < 4; i += 2 - includeWidth) {
- which = cssExpand[i];
- attrs["margin" + which] = attrs["padding" + which] = type;
- }
- if (includeWidth) {
- attrs.opacity = attrs.width = type;
- }
- return attrs;
- }
- function createTween(value, prop, animation) {
- var tween, collection = (Animation.tweeners[prop] || []).concat(Animation.tweeners["*"]), index = 0, length = collection.length;
- for (; index < length; index++) {
- if (tween = collection[index].call(animation, prop, value)) {
- return tween;
- }
- }
- }
- function defaultPrefilter(elem, props, opts) {
- var prop, value, toggle, hooks, oldfire, propTween, restoreDisplay, display, isBox = "width" in props || "height" in props, anim = this, orig = {}, style = elem.style, hidden = elem.nodeType && isHiddenWithinTree(elem), dataShow = dataPriv.get(elem, "fxshow");
- if (!opts.queue) {
- hooks = jQuery._queueHooks(elem, "fx");
- if (hooks.unqueued == null) {
- hooks.unqueued = 0;
- oldfire = hooks.empty.fire;
- hooks.empty.fire = function() {
- if (!hooks.unqueued) {
- oldfire();
- }
- };
- }
- hooks.unqueued++;
- anim.always(function() {
- anim.always(function() {
- hooks.unqueued--;
- if (!jQuery.queue(elem, "fx").length) {
- hooks.empty.fire();
- }
- });
- });
- }
- for (prop in props) {
- value = props[prop];
- if (rfxtypes.test(value)) {
- delete props[prop];
- toggle = toggle || value === "toggle";
- if (value === (hidden ? "hide" : "show")) {
- if (value === "show" && dataShow && dataShow[prop] !== void 0) {
- hidden = true;
- } else {
- continue;
- }
- }
- orig[prop] = dataShow && dataShow[prop] || jQuery.style(elem, prop);
- }
- }
- propTween = !jQuery.isEmptyObject(props);
- if (!propTween && jQuery.isEmptyObject(orig)) {
- return;
- }
- if (isBox && elem.nodeType === 1) {
- opts.overflow = [style.overflow, style.overflowX, style.overflowY];
- restoreDisplay = dataShow && dataShow.display;
- if (restoreDisplay == null) {
- restoreDisplay = dataPriv.get(elem, "display");
- }
- display = jQuery.css(elem, "display");
- if (display === "none") {
- if (restoreDisplay) {
- display = restoreDisplay;
- } else {
- showHide([elem], true);
- restoreDisplay = elem.style.display || restoreDisplay;
- display = jQuery.css(elem, "display");
- showHide([elem]);
- }
- }
- if (display === "inline" || display === "inline-block" && restoreDisplay != null) {
- if (jQuery.css(elem, "float") === "none") {
- if (!propTween) {
- anim.done(function() {
- style.display = restoreDisplay;
- });
- if (restoreDisplay == null) {
- display = style.display;
- restoreDisplay = display === "none" ? "" : display;
- }
- }
- style.display = "inline-block";
- }
- }
- }
- if (opts.overflow) {
- style.overflow = "hidden";
- anim.always(function() {
- style.overflow = opts.overflow[0];
- style.overflowX = opts.overflow[1];
- style.overflowY = opts.overflow[2];
- });
- }
- propTween = false;
- for (prop in orig) {
- if (!propTween) {
- if (dataShow) {
- if ("hidden" in dataShow) {
- hidden = dataShow.hidden;
- }
- } else {
- dataShow = dataPriv.access(elem, "fxshow", { display: restoreDisplay });
- }
- if (toggle) {
- dataShow.hidden = !hidden;
- }
- if (hidden) {
- showHide([elem], true);
- }
- anim.done(function() {
- if (!hidden) {
- showHide([elem]);
- }
- dataPriv.remove(elem, "fxshow");
- for (prop in orig) {
- jQuery.style(elem, prop, orig[prop]);
- }
- });
- }
- propTween = createTween(hidden ? dataShow[prop] : 0, prop, anim);
- if (!(prop in dataShow)) {
- dataShow[prop] = propTween.start;
- if (hidden) {
- propTween.end = propTween.start;
- propTween.start = 0;
- }
- }
- }
- }
- function propFilter(props, specialEasing) {
- var index, name, easing, value, hooks;
- for (index in props) {
- name = camelCase(index);
- easing = specialEasing[name];
- value = props[index];
- if (Array.isArray(value)) {
- easing = value[1];
- value = props[index] = value[0];
- }
- if (index !== name) {
- props[name] = value;
- delete props[index];
- }
- hooks = jQuery.cssHooks[name];
- if (hooks && "expand" in hooks) {
- value = hooks.expand(value);
- delete props[name];
- for (index in value) {
- if (!(index in props)) {
- props[index] = value[index];
- specialEasing[index] = easing;
- }
- }
- } else {
- specialEasing[name] = easing;
- }
- }
- }
- function Animation(elem, properties, options) {
- var result, stopped, index = 0, length = Animation.prefilters.length, deferred = jQuery.Deferred().always(function() {
- delete tick.elem;
- }), tick = function() {
- if (stopped) {
- return false;
- }
- var currentTime = fxNow || createFxNow(), remaining = Math.max(0, animation.startTime + animation.duration - currentTime), temp = remaining / animation.duration || 0, percent = 1 - temp, index2 = 0, length2 = animation.tweens.length;
- for (; index2 < length2; index2++) {
- animation.tweens[index2].run(percent);
- }
- deferred.notifyWith(elem, [animation, percent, remaining]);
- if (percent < 1 && length2) {
- return remaining;
- }
- if (!length2) {
- deferred.notifyWith(elem, [animation, 1, 0]);
- }
- deferred.resolveWith(elem, [animation]);
- return false;
- }, animation = deferred.promise({
- elem,
- props: jQuery.extend({}, properties),
- opts: jQuery.extend(true, {
- specialEasing: {},
- easing: jQuery.easing._default
- }, options),
- originalProperties: properties,
- originalOptions: options,
- startTime: fxNow || createFxNow(),
- duration: options.duration,
- tweens: [],
- createTween: function(prop, end) {
- var tween = jQuery.Tween(
- elem,
- animation.opts,
- prop,
- end,
- animation.opts.specialEasing[prop] || animation.opts.easing
- );
- animation.tweens.push(tween);
- return tween;
- },
- stop: function(gotoEnd) {
- var index2 = 0, length2 = gotoEnd ? animation.tweens.length : 0;
- if (stopped) {
- return this;
- }
- stopped = true;
- for (; index2 < length2; index2++) {
- animation.tweens[index2].run(1);
- }
- if (gotoEnd) {
- deferred.notifyWith(elem, [animation, 1, 0]);
- deferred.resolveWith(elem, [animation, gotoEnd]);
- } else {
- deferred.rejectWith(elem, [animation, gotoEnd]);
- }
- return this;
- }
- }), props = animation.props;
- propFilter(props, animation.opts.specialEasing);
- for (; index < length; index++) {
- result = Animation.prefilters[index].call(animation, elem, props, animation.opts);
- if (result) {
- if (isFunction(result.stop)) {
- jQuery._queueHooks(animation.elem, animation.opts.queue).stop = result.stop.bind(result);
- }
- return result;
- }
- }
- jQuery.map(props, createTween, animation);
- if (isFunction(animation.opts.start)) {
- animation.opts.start.call(elem, animation);
- }
- animation.progress(animation.opts.progress).done(animation.opts.done, animation.opts.complete).fail(animation.opts.fail).always(animation.opts.always);
- jQuery.fx.timer(
- jQuery.extend(tick, {
- elem,
- anim: animation,
- queue: animation.opts.queue
- })
- );
- return animation;
- }
- jQuery.Animation = jQuery.extend(Animation, {
- tweeners: {
- "*": [function(prop, value) {
- var tween = this.createTween(prop, value);
- adjustCSS(tween.elem, prop, rcssNum.exec(value), tween);
- return tween;
- }]
- },
- tweener: function(props, callback) {
- if (isFunction(props)) {
- callback = props;
- props = ["*"];
- } else {
- props = props.match(rnothtmlwhite);
- }
- var prop, index = 0, length = props.length;
- for (; index < length; index++) {
- prop = props[index];
- Animation.tweeners[prop] = Animation.tweeners[prop] || [];
- Animation.tweeners[prop].unshift(callback);
- }
- },
- prefilters: [defaultPrefilter],
- prefilter: function(callback, prepend) {
- if (prepend) {
- Animation.prefilters.unshift(callback);
- } else {
- Animation.prefilters.push(callback);
- }
- }
- });
- jQuery.speed = function(speed, easing, fn) {
- var opt = speed && typeof speed === "object" ? jQuery.extend({}, speed) : {
- complete: fn || !fn && easing || isFunction(speed) && speed,
- duration: speed,
- easing: fn && easing || easing && !isFunction(easing) && easing
- };
- if (jQuery.fx.off) {
- opt.duration = 0;
- } else {
- if (typeof opt.duration !== "number") {
- if (opt.duration in jQuery.fx.speeds) {
- opt.duration = jQuery.fx.speeds[opt.duration];
- } else {
- opt.duration = jQuery.fx.speeds._default;
- }
- }
- }
- if (opt.queue == null || opt.queue === true) {
- opt.queue = "fx";
- }
- opt.old = opt.complete;
- opt.complete = function() {
- if (isFunction(opt.old)) {
- opt.old.call(this);
- }
- if (opt.queue) {
- jQuery.dequeue(this, opt.queue);
- }
- };
- return opt;
- };
- jQuery.fn.extend({
- fadeTo: function(speed, to, easing, callback) {
- return this.filter(isHiddenWithinTree).css("opacity", 0).show().end().animate({ opacity: to }, speed, easing, callback);
- },
- animate: function(prop, speed, easing, callback) {
- var empty = jQuery.isEmptyObject(prop), optall = jQuery.speed(speed, easing, callback), doAnimation = function() {
- var anim = Animation(this, jQuery.extend({}, prop), optall);
- if (empty || dataPriv.get(this, "finish")) {
- anim.stop(true);
- }
- };
- doAnimation.finish = doAnimation;
- return empty || optall.queue === false ? this.each(doAnimation) : this.queue(optall.queue, doAnimation);
- },
- stop: function(type, clearQueue, gotoEnd) {
- var stopQueue = function(hooks) {
- var stop = hooks.stop;
- delete hooks.stop;
- stop(gotoEnd);
- };
- if (typeof type !== "string") {
- gotoEnd = clearQueue;
- clearQueue = type;
- type = void 0;
- }
- if (clearQueue) {
- this.queue(type || "fx", []);
- }
- return this.each(function() {
- var dequeue = true, index = type != null && type + "queueHooks", timers = jQuery.timers, data = dataPriv.get(this);
- if (index) {
- if (data[index] && data[index].stop) {
- stopQueue(data[index]);
- }
- } else {
- for (index in data) {
- if (data[index] && data[index].stop && rrun.test(index)) {
- stopQueue(data[index]);
- }
- }
- }
- for (index = timers.length; index--; ) {
- if (timers[index].elem === this && (type == null || timers[index].queue === type)) {
- timers[index].anim.stop(gotoEnd);
- dequeue = false;
- timers.splice(index, 1);
- }
- }
- if (dequeue || !gotoEnd) {
- jQuery.dequeue(this, type);
- }
- });
- },
- finish: function(type) {
- if (type !== false) {
- type = type || "fx";
- }
- return this.each(function() {
- var index, data = dataPriv.get(this), queue = data[type + "queue"], hooks = data[type + "queueHooks"], timers = jQuery.timers, length = queue ? queue.length : 0;
- data.finish = true;
- jQuery.queue(this, type, []);
- if (hooks && hooks.stop) {
- hooks.stop.call(this, true);
- }
- for (index = timers.length; index--; ) {
- if (timers[index].elem === this && timers[index].queue === type) {
- timers[index].anim.stop(true);
- timers.splice(index, 1);
- }
- }
- for (index = 0; index < length; index++) {
- if (queue[index] && queue[index].finish) {
- queue[index].finish.call(this);
- }
- }
- delete data.finish;
- });
- }
- });
- jQuery.each(["toggle", "show", "hide"], function(_i, name) {
- var cssFn = jQuery.fn[name];
- jQuery.fn[name] = function(speed, easing, callback) {
- return speed == null || typeof speed === "boolean" ? cssFn.apply(this, arguments) : this.animate(genFx(name, true), speed, easing, callback);
- };
- });
- jQuery.each({
- slideDown: genFx("show"),
- slideUp: genFx("hide"),
- slideToggle: genFx("toggle"),
- fadeIn: { opacity: "show" },
- fadeOut: { opacity: "hide" },
- fadeToggle: { opacity: "toggle" }
- }, function(name, props) {
- jQuery.fn[name] = function(speed, easing, callback) {
- return this.animate(props, speed, easing, callback);
- };
- });
- jQuery.timers = [];
- jQuery.fx.tick = function() {
- var timer, i = 0, timers = jQuery.timers;
- fxNow = Date.now();
- for (; i < timers.length; i++) {
- timer = timers[i];
- if (!timer() && timers[i] === timer) {
- timers.splice(i--, 1);
- }
- }
- if (!timers.length) {
- jQuery.fx.stop();
- }
- fxNow = void 0;
- };
- jQuery.fx.timer = function(timer) {
- jQuery.timers.push(timer);
- jQuery.fx.start();
- };
- jQuery.fx.interval = 13;
- jQuery.fx.start = function() {
- if (inProgress) {
- return;
- }
- inProgress = true;
- schedule();
- };
- jQuery.fx.stop = function() {
- inProgress = null;
- };
- jQuery.fx.speeds = {
- slow: 600,
- fast: 200,
- // Default speed
- _default: 400
- };
- jQuery.fn.delay = function(time, type) {
- time = jQuery.fx ? jQuery.fx.speeds[time] || time : time;
- type = type || "fx";
- return this.queue(type, function(next, hooks) {
- var timeout = window2.setTimeout(next, time);
- hooks.stop = function() {
- window2.clearTimeout(timeout);
- };
- });
- };
- (function() {
- var input = document2.createElement("input"), select = document2.createElement("select"), opt = select.appendChild(document2.createElement("option"));
- input.type = "checkbox";
- support.checkOn = input.value !== "";
- support.optSelected = opt.selected;
- input = document2.createElement("input");
- input.value = "t";
- input.type = "radio";
- support.radioValue = input.value === "t";
- })();
- var boolHook, attrHandle = jQuery.expr.attrHandle;
- jQuery.fn.extend({
- attr: function(name, value) {
- return access(this, jQuery.attr, name, value, arguments.length > 1);
- },
- removeAttr: function(name) {
- return this.each(function() {
- jQuery.removeAttr(this, name);
- });
- }
- });
- jQuery.extend({
- attr: function(elem, name, value) {
- var ret, hooks, nType = elem.nodeType;
- if (nType === 3 || nType === 8 || nType === 2) {
- return;
- }
- if (typeof elem.getAttribute === "undefined") {
- return jQuery.prop(elem, name, value);
- }
- if (nType !== 1 || !jQuery.isXMLDoc(elem)) {
- hooks = jQuery.attrHooks[name.toLowerCase()] || (jQuery.expr.match.bool.test(name) ? boolHook : void 0);
- }
- if (value !== void 0) {
- if (value === null) {
- jQuery.removeAttr(elem, name);
- return;
- }
- if (hooks && "set" in hooks && (ret = hooks.set(elem, value, name)) !== void 0) {
- return ret;
- }
- elem.setAttribute(name, value + "");
- return value;
- }
- if (hooks && "get" in hooks && (ret = hooks.get(elem, name)) !== null) {
- return ret;
- }
- ret = jQuery.find.attr(elem, name);
- return ret == null ? void 0 : ret;
- },
- attrHooks: {
- type: {
- set: function(elem, value) {
- if (!support.radioValue && value === "radio" && nodeName(elem, "input")) {
- var val = elem.value;
- elem.setAttribute("type", value);
- if (val) {
- elem.value = val;
- }
- return value;
- }
- }
- }
- },
- removeAttr: function(elem, value) {
- var name, i = 0, attrNames = value && value.match(rnothtmlwhite);
- if (attrNames && elem.nodeType === 1) {
- while (name = attrNames[i++]) {
- elem.removeAttribute(name);
- }
- }
- }
- });
- boolHook = {
- set: function(elem, value, name) {
- if (value === false) {
- jQuery.removeAttr(elem, name);
- } else {
- elem.setAttribute(name, name);
- }
- return name;
- }
- };
- jQuery.each(jQuery.expr.match.bool.source.match(/\w+/g), function(_i, name) {
- var getter = attrHandle[name] || jQuery.find.attr;
- attrHandle[name] = function(elem, name2, isXML) {
- var ret, handle, lowercaseName = name2.toLowerCase();
- if (!isXML) {
- handle = attrHandle[lowercaseName];
- attrHandle[lowercaseName] = ret;
- ret = getter(elem, name2, isXML) != null ? lowercaseName : null;
- attrHandle[lowercaseName] = handle;
- }
- return ret;
- };
- });
- var rfocusable = /^(?:input|select|textarea|button)$/i, rclickable = /^(?:a|area)$/i;
- jQuery.fn.extend({
- prop: function(name, value) {
- return access(this, jQuery.prop, name, value, arguments.length > 1);
- },
- removeProp: function(name) {
- return this.each(function() {
- delete this[jQuery.propFix[name] || name];
- });
- }
- });
- jQuery.extend({
- prop: function(elem, name, value) {
- var ret, hooks, nType = elem.nodeType;
- if (nType === 3 || nType === 8 || nType === 2) {
- return;
- }
- if (nType !== 1 || !jQuery.isXMLDoc(elem)) {
- name = jQuery.propFix[name] || name;
- hooks = jQuery.propHooks[name];
- }
- if (value !== void 0) {
- if (hooks && "set" in hooks && (ret = hooks.set(elem, value, name)) !== void 0) {
- return ret;
- }
- return elem[name] = value;
- }
- if (hooks && "get" in hooks && (ret = hooks.get(elem, name)) !== null) {
- return ret;
- }
- return elem[name];
- },
- propHooks: {
- tabIndex: {
- get: function(elem) {
- var tabindex = jQuery.find.attr(elem, "tabindex");
- if (tabindex) {
- return parseInt(tabindex, 10);
- }
- if (rfocusable.test(elem.nodeName) || rclickable.test(elem.nodeName) && elem.href) {
- return 0;
- }
- return -1;
- }
- }
- },
- propFix: {
- "for": "htmlFor",
- "class": "className"
- }
- });
- if (!support.optSelected) {
- jQuery.propHooks.selected = {
- get: function(elem) {
- var parent = elem.parentNode;
- if (parent && parent.parentNode) {
- parent.parentNode.selectedIndex;
- }
- return null;
- },
- set: function(elem) {
- var parent = elem.parentNode;
- if (parent) {
- parent.selectedIndex;
- if (parent.parentNode) {
- parent.parentNode.selectedIndex;
- }
- }
- }
- };
- }
- jQuery.each([
- "tabIndex",
- "readOnly",
- "maxLength",
- "cellSpacing",
- "cellPadding",
- "rowSpan",
- "colSpan",
- "useMap",
- "frameBorder",
- "contentEditable"
- ], function() {
- jQuery.propFix[this.toLowerCase()] = this;
- });
- function stripAndCollapse(value) {
- var tokens = value.match(rnothtmlwhite) || [];
- return tokens.join(" ");
- }
- function getClass(elem) {
- return elem.getAttribute && elem.getAttribute("class") || "";
- }
- function classesToArray(value) {
- if (Array.isArray(value)) {
- return value;
- }
- if (typeof value === "string") {
- return value.match(rnothtmlwhite) || [];
- }
- return [];
- }
- jQuery.fn.extend({
- addClass: function(value) {
- var classNames, cur, curValue, className, i, finalValue;
- if (isFunction(value)) {
- return this.each(function(j) {
- jQuery(this).addClass(value.call(this, j, getClass(this)));
- });
- }
- classNames = classesToArray(value);
- if (classNames.length) {
- return this.each(function() {
- curValue = getClass(this);
- cur = this.nodeType === 1 && " " + stripAndCollapse(curValue) + " ";
- if (cur) {
- for (i = 0; i < classNames.length; i++) {
- className = classNames[i];
- if (cur.indexOf(" " + className + " ") < 0) {
- cur += className + " ";
- }
- }
- finalValue = stripAndCollapse(cur);
- if (curValue !== finalValue) {
- this.setAttribute("class", finalValue);
- }
- }
- });
- }
- return this;
- },
- removeClass: function(value) {
- var classNames, cur, curValue, className, i, finalValue;
- if (isFunction(value)) {
- return this.each(function(j) {
- jQuery(this).removeClass(value.call(this, j, getClass(this)));
- });
- }
- if (!arguments.length) {
- return this.attr("class", "");
- }
- classNames = classesToArray(value);
- if (classNames.length) {
- return this.each(function() {
- curValue = getClass(this);
- cur = this.nodeType === 1 && " " + stripAndCollapse(curValue) + " ";
- if (cur) {
- for (i = 0; i < classNames.length; i++) {
- className = classNames[i];
- while (cur.indexOf(" " + className + " ") > -1) {
- cur = cur.replace(" " + className + " ", " ");
- }
- }
- finalValue = stripAndCollapse(cur);
- if (curValue !== finalValue) {
- this.setAttribute("class", finalValue);
- }
- }
- });
- }
- return this;
- },
- toggleClass: function(value, stateVal) {
- var classNames, className, i, self2, type = typeof value, isValidValue = type === "string" || Array.isArray(value);
- if (isFunction(value)) {
- return this.each(function(i2) {
- jQuery(this).toggleClass(
- value.call(this, i2, getClass(this), stateVal),
- stateVal
- );
- });
- }
- if (typeof stateVal === "boolean" && isValidValue) {
- return stateVal ? this.addClass(value) : this.removeClass(value);
- }
- classNames = classesToArray(value);
- return this.each(function() {
- if (isValidValue) {
- self2 = jQuery(this);
- for (i = 0; i < classNames.length; i++) {
- className = classNames[i];
- if (self2.hasClass(className)) {
- self2.removeClass(className);
- } else {
- self2.addClass(className);
- }
- }
- } else if (value === void 0 || type === "boolean") {
- className = getClass(this);
- if (className) {
- dataPriv.set(this, "__className__", className);
- }
- if (this.setAttribute) {
- this.setAttribute(
- "class",
- className || value === false ? "" : dataPriv.get(this, "__className__") || ""
- );
- }
- }
- });
- },
- hasClass: function(selector) {
- var className, elem, i = 0;
- className = " " + selector + " ";
- while (elem = this[i++]) {
- if (elem.nodeType === 1 && (" " + stripAndCollapse(getClass(elem)) + " ").indexOf(className) > -1) {
- return true;
- }
- }
- return false;
- }
- });
- var rreturn = /\r/g;
- jQuery.fn.extend({
- val: function(value) {
- var hooks, ret, valueIsFunction, elem = this[0];
- if (!arguments.length) {
- if (elem) {
- hooks = jQuery.valHooks[elem.type] || jQuery.valHooks[elem.nodeName.toLowerCase()];
- if (hooks && "get" in hooks && (ret = hooks.get(elem, "value")) !== void 0) {
- return ret;
- }
- ret = elem.value;
- if (typeof ret === "string") {
- return ret.replace(rreturn, "");
- }
- return ret == null ? "" : ret;
- }
- return;
- }
- valueIsFunction = isFunction(value);
- return this.each(function(i) {
- var val;
- if (this.nodeType !== 1) {
- return;
- }
- if (valueIsFunction) {
- val = value.call(this, i, jQuery(this).val());
- } else {
- val = value;
- }
- if (val == null) {
- val = "";
- } else if (typeof val === "number") {
- val += "";
- } else if (Array.isArray(val)) {
- val = jQuery.map(val, function(value2) {
- return value2 == null ? "" : value2 + "";
- });
- }
- hooks = jQuery.valHooks[this.type] || jQuery.valHooks[this.nodeName.toLowerCase()];
- if (!hooks || !("set" in hooks) || hooks.set(this, val, "value") === void 0) {
- this.value = val;
- }
- });
- }
- });
- jQuery.extend({
- valHooks: {
- option: {
- get: function(elem) {
- var val = jQuery.find.attr(elem, "value");
- return val != null ? val : (
- // Support: IE <=10 - 11 only
- // option.text throws exceptions (trac-14686, trac-14858)
- // Strip and collapse whitespace
- // https://html.spec.whatwg.org/#strip-and-collapse-whitespace
- stripAndCollapse(jQuery.text(elem))
- );
- }
- },
- select: {
- get: function(elem) {
- var value, option, i, options = elem.options, index = elem.selectedIndex, one = elem.type === "select-one", values = one ? null : [], max = one ? index + 1 : options.length;
- if (index < 0) {
- i = max;
- } else {
- i = one ? index : 0;
- }
- for (; i < max; i++) {
- option = options[i];
- if ((option.selected || i === index) && // Don't return options that are disabled or in a disabled optgroup
- !option.disabled && (!option.parentNode.disabled || !nodeName(option.parentNode, "optgroup"))) {
- value = jQuery(option).val();
- if (one) {
- return value;
- }
- values.push(value);
- }
- }
- return values;
- },
- set: function(elem, value) {
- var optionSet, option, options = elem.options, values = jQuery.makeArray(value), i = options.length;
- while (i--) {
- option = options[i];
- if (option.selected = jQuery.inArray(jQuery.valHooks.option.get(option), values) > -1) {
- optionSet = true;
- }
- }
- if (!optionSet) {
- elem.selectedIndex = -1;
- }
- return values;
- }
- }
- }
- });
- jQuery.each(["radio", "checkbox"], function() {
- jQuery.valHooks[this] = {
- set: function(elem, value) {
- if (Array.isArray(value)) {
- return elem.checked = jQuery.inArray(jQuery(elem).val(), value) > -1;
- }
- }
- };
- if (!support.checkOn) {
- jQuery.valHooks[this].get = function(elem) {
- return elem.getAttribute("value") === null ? "on" : elem.value;
- };
- }
- });
- var location2 = window2.location;
- var nonce = { guid: Date.now() };
- var rquery = /\?/;
- jQuery.parseXML = function(data) {
- var xml, parserErrorElem;
- if (!data || typeof data !== "string") {
- return null;
- }
- try {
- xml = new window2.DOMParser().parseFromString(data, "text/xml");
- } catch (e) {
- }
- parserErrorElem = xml && xml.getElementsByTagName("parsererror")[0];
- if (!xml || parserErrorElem) {
- jQuery.error("Invalid XML: " + (parserErrorElem ? jQuery.map(parserErrorElem.childNodes, function(el) {
- return el.textContent;
- }).join("\n") : data));
- }
- return xml;
- };
- var rfocusMorph = /^(?:focusinfocus|focusoutblur)$/, stopPropagationCallback = function(e) {
- e.stopPropagation();
- };
- jQuery.extend(jQuery.event, {
- trigger: function(event, data, elem, onlyHandlers) {
- var i, cur, tmp, bubbleType, ontype, handle, special, lastElement, eventPath = [elem || document2], type = hasOwn.call(event, "type") ? event.type : event, namespaces = hasOwn.call(event, "namespace") ? event.namespace.split(".") : [];
- cur = lastElement = tmp = elem = elem || document2;
- if (elem.nodeType === 3 || elem.nodeType === 8) {
- return;
- }
- if (rfocusMorph.test(type + jQuery.event.triggered)) {
- return;
- }
- if (type.indexOf(".") > -1) {
- namespaces = type.split(".");
- type = namespaces.shift();
- namespaces.sort();
- }
- ontype = type.indexOf(":") < 0 && "on" + type;
- event = event[jQuery.expando] ? event : new jQuery.Event(type, typeof event === "object" && event);
- event.isTrigger = onlyHandlers ? 2 : 3;
- event.namespace = namespaces.join(".");
- event.rnamespace = event.namespace ? new RegExp("(^|\\.)" + namespaces.join("\\.(?:.*\\.|)") + "(\\.|$)") : null;
- event.result = void 0;
- if (!event.target) {
- event.target = elem;
- }
- data = data == null ? [event] : jQuery.makeArray(data, [event]);
- special = jQuery.event.special[type] || {};
- if (!onlyHandlers && special.trigger && special.trigger.apply(elem, data) === false) {
- return;
- }
- if (!onlyHandlers && !special.noBubble && !isWindow(elem)) {
- bubbleType = special.delegateType || type;
- if (!rfocusMorph.test(bubbleType + type)) {
- cur = cur.parentNode;
- }
- for (; cur; cur = cur.parentNode) {
- eventPath.push(cur);
- tmp = cur;
- }
- if (tmp === (elem.ownerDocument || document2)) {
- eventPath.push(tmp.defaultView || tmp.parentWindow || window2);
- }
- }
- i = 0;
- while ((cur = eventPath[i++]) && !event.isPropagationStopped()) {
- lastElement = cur;
- event.type = i > 1 ? bubbleType : special.bindType || type;
- handle = (dataPriv.get(cur, "events") || /* @__PURE__ */ Object.create(null))[event.type] && dataPriv.get(cur, "handle");
- if (handle) {
- handle.apply(cur, data);
- }
- handle = ontype && cur[ontype];
- if (handle && handle.apply && acceptData(cur)) {
- event.result = handle.apply(cur, data);
- if (event.result === false) {
- event.preventDefault();
- }
- }
- }
- event.type = type;
- if (!onlyHandlers && !event.isDefaultPrevented()) {
- if ((!special._default || special._default.apply(eventPath.pop(), data) === false) && acceptData(elem)) {
- if (ontype && isFunction(elem[type]) && !isWindow(elem)) {
- tmp = elem[ontype];
- if (tmp) {
- elem[ontype] = null;
- }
- jQuery.event.triggered = type;
- if (event.isPropagationStopped()) {
- lastElement.addEventListener(type, stopPropagationCallback);
- }
- elem[type]();
- if (event.isPropagationStopped()) {
- lastElement.removeEventListener(type, stopPropagationCallback);
- }
- jQuery.event.triggered = void 0;
- if (tmp) {
- elem[ontype] = tmp;
- }
- }
- }
- }
- return event.result;
- },
- // Piggyback on a donor event to simulate a different one
- // Used only for `focus(in | out)` events
- simulate: function(type, elem, event) {
- var e = jQuery.extend(
- new jQuery.Event(),
- event,
- {
- type,
- isSimulated: true
- }
- );
- jQuery.event.trigger(e, null, elem);
- }
- });
- jQuery.fn.extend({
- trigger: function(type, data) {
- return this.each(function() {
- jQuery.event.trigger(type, data, this);
- });
- },
- triggerHandler: function(type, data) {
- var elem = this[0];
- if (elem) {
- return jQuery.event.trigger(type, data, elem, true);
- }
- }
- });
- var rbracket = /\[\]$/, rCRLF = /\r?\n/g, rsubmitterTypes = /^(?:submit|button|image|reset|file)$/i, rsubmittable = /^(?:input|select|textarea|keygen)/i;
- function buildParams(prefix, obj, traditional, add) {
- var name;
- if (Array.isArray(obj)) {
- jQuery.each(obj, function(i, v) {
- if (traditional || rbracket.test(prefix)) {
- add(prefix, v);
- } else {
- buildParams(
- prefix + "[" + (typeof v === "object" && v != null ? i : "") + "]",
- v,
- traditional,
- add
- );
- }
- });
- } else if (!traditional && toType(obj) === "object") {
- for (name in obj) {
- buildParams(prefix + "[" + name + "]", obj[name], traditional, add);
- }
- } else {
- add(prefix, obj);
- }
- }
- jQuery.param = function(a, traditional) {
- var prefix, s = [], add = function(key, valueOrFunction) {
- var value = isFunction(valueOrFunction) ? valueOrFunction() : valueOrFunction;
- s[s.length] = encodeURIComponent(key) + "=" + encodeURIComponent(value == null ? "" : value);
- };
- if (a == null) {
- return "";
- }
- if (Array.isArray(a) || a.jquery && !jQuery.isPlainObject(a)) {
- jQuery.each(a, function() {
- add(this.name, this.value);
- });
- } else {
- for (prefix in a) {
- buildParams(prefix, a[prefix], traditional, add);
- }
- }
- return s.join("&");
- };
- jQuery.fn.extend({
- serialize: function() {
- return jQuery.param(this.serializeArray());
- },
- serializeArray: function() {
- return this.map(function() {
- var elements = jQuery.prop(this, "elements");
- return elements ? jQuery.makeArray(elements) : this;
- }).filter(function() {
- var type = this.type;
- return this.name && !jQuery(this).is(":disabled") && rsubmittable.test(this.nodeName) && !rsubmitterTypes.test(type) && (this.checked || !rcheckableType.test(type));
- }).map(function(_i, elem) {
- var val = jQuery(this).val();
- if (val == null) {
- return null;
- }
- if (Array.isArray(val)) {
- return jQuery.map(val, function(val2) {
- return { name: elem.name, value: val2.replace(rCRLF, "\r\n") };
- });
- }
- return { name: elem.name, value: val.replace(rCRLF, "\r\n") };
- }).get();
- }
- });
- var r20 = /%20/g, rhash = /#.*$/, rantiCache = /([?&])_=[^&]*/, rheaders = /^(.*?):[ \t]*([^\r\n]*)$/mg, rlocalProtocol = /^(?:about|app|app-storage|.+-extension|file|res|widget):$/, rnoContent = /^(?:GET|HEAD)$/, rprotocol = /^\/\//, prefilters = {}, transports = {}, allTypes = "*/".concat("*"), originAnchor = document2.createElement("a");
- originAnchor.href = location2.href;
- function addToPrefiltersOrTransports(structure) {
- return function(dataTypeExpression, func) {
- if (typeof dataTypeExpression !== "string") {
- func = dataTypeExpression;
- dataTypeExpression = "*";
- }
- var dataType, i = 0, dataTypes = dataTypeExpression.toLowerCase().match(rnothtmlwhite) || [];
- if (isFunction(func)) {
- while (dataType = dataTypes[i++]) {
- if (dataType[0] === "+") {
- dataType = dataType.slice(1) || "*";
- (structure[dataType] = structure[dataType] || []).unshift(func);
- } else {
- (structure[dataType] = structure[dataType] || []).push(func);
- }
- }
- }
- };
- }
- function inspectPrefiltersOrTransports(structure, options, originalOptions, jqXHR) {
- var inspected = {}, seekingTransport = structure === transports;
- function inspect(dataType) {
- var selected;
- inspected[dataType] = true;
- jQuery.each(structure[dataType] || [], function(_, prefilterOrFactory) {
- var dataTypeOrTransport = prefilterOrFactory(options, originalOptions, jqXHR);
- if (typeof dataTypeOrTransport === "string" && !seekingTransport && !inspected[dataTypeOrTransport]) {
- options.dataTypes.unshift(dataTypeOrTransport);
- inspect(dataTypeOrTransport);
- return false;
- } else if (seekingTransport) {
- return !(selected = dataTypeOrTransport);
- }
- });
- return selected;
- }
- return inspect(options.dataTypes[0]) || !inspected["*"] && inspect("*");
- }
- function ajaxExtend(target, src) {
- var key, deep, flatOptions = jQuery.ajaxSettings.flatOptions || {};
- for (key in src) {
- if (src[key] !== void 0) {
- (flatOptions[key] ? target : deep || (deep = {}))[key] = src[key];
- }
- }
- if (deep) {
- jQuery.extend(true, target, deep);
- }
- return target;
- }
- function ajaxHandleResponses(s, jqXHR, responses) {
- var ct, type, finalDataType, firstDataType, contents = s.contents, dataTypes = s.dataTypes;
- while (dataTypes[0] === "*") {
- dataTypes.shift();
- if (ct === void 0) {
- ct = s.mimeType || jqXHR.getResponseHeader("Content-Type");
- }
- }
- if (ct) {
- for (type in contents) {
- if (contents[type] && contents[type].test(ct)) {
- dataTypes.unshift(type);
- break;
- }
- }
- }
- if (dataTypes[0] in responses) {
- finalDataType = dataTypes[0];
- } else {
- for (type in responses) {
- if (!dataTypes[0] || s.converters[type + " " + dataTypes[0]]) {
- finalDataType = type;
- break;
- }
- if (!firstDataType) {
- firstDataType = type;
- }
- }
- finalDataType = finalDataType || firstDataType;
- }
- if (finalDataType) {
- if (finalDataType !== dataTypes[0]) {
- dataTypes.unshift(finalDataType);
- }
- return responses[finalDataType];
- }
- }
- function ajaxConvert(s, response, jqXHR, isSuccess) {
- var conv2, current, conv, tmp, prev, converters = {}, dataTypes = s.dataTypes.slice();
- if (dataTypes[1]) {
- for (conv in s.converters) {
- converters[conv.toLowerCase()] = s.converters[conv];
- }
- }
- current = dataTypes.shift();
- while (current) {
- if (s.responseFields[current]) {
- jqXHR[s.responseFields[current]] = response;
- }
- if (!prev && isSuccess && s.dataFilter) {
- response = s.dataFilter(response, s.dataType);
- }
- prev = current;
- current = dataTypes.shift();
- if (current) {
- if (current === "*") {
- current = prev;
- } else if (prev !== "*" && prev !== current) {
- conv = converters[prev + " " + current] || converters["* " + current];
- if (!conv) {
- for (conv2 in converters) {
- tmp = conv2.split(" ");
- if (tmp[1] === current) {
- conv = converters[prev + " " + tmp[0]] || converters["* " + tmp[0]];
- if (conv) {
- if (conv === true) {
- conv = converters[conv2];
- } else if (converters[conv2] !== true) {
- current = tmp[0];
- dataTypes.unshift(tmp[1]);
- }
- break;
- }
- }
- }
- }
- if (conv !== true) {
- if (conv && s.throws) {
- response = conv(response);
- } else {
- try {
- response = conv(response);
- } catch (e) {
- return {
- state: "parsererror",
- error: conv ? e : "No conversion from " + prev + " to " + current
- };
- }
- }
- }
- }
- }
- }
- return { state: "success", data: response };
- }
- jQuery.extend({
- // Counter for holding the number of active queries
- active: 0,
- // Last-Modified header cache for next request
- lastModified: {},
- etag: {},
- ajaxSettings: {
- url: location2.href,
- type: "GET",
- isLocal: rlocalProtocol.test(location2.protocol),
- global: true,
- processData: true,
- async: true,
- contentType: "application/x-www-form-urlencoded; charset=UTF-8",
- /*
- timeout: 0,
- data: null,
- dataType: null,
- username: null,
- password: null,
- cache: null,
- throws: false,
- traditional: false,
- headers: {},
- */
- accepts: {
- "*": allTypes,
- text: "text/plain",
- html: "text/html",
- xml: "application/xml, text/xml",
- json: "application/json, text/javascript"
- },
- contents: {
- xml: /\bxml\b/,
- html: /\bhtml/,
- json: /\bjson\b/
- },
- responseFields: {
- xml: "responseXML",
- text: "responseText",
- json: "responseJSON"
- },
- // Data converters
- // Keys separate source (or catchall "*") and destination types with a single space
- converters: {
- // Convert anything to text
- "* text": String,
- // Text to html (true = no transformation)
- "text html": true,
- // Evaluate text as a json expression
- "text json": JSON.parse,
- // Parse text as xml
- "text xml": jQuery.parseXML
- },
- // For options that shouldn't be deep extended:
- // you can add your own custom options here if
- // and when you create one that shouldn't be
- // deep extended (see ajaxExtend)
- flatOptions: {
- url: true,
- context: true
- }
- },
- // Creates a full fledged settings object into target
- // with both ajaxSettings and settings fields.
- // If target is omitted, writes into ajaxSettings.
- ajaxSetup: function(target, settings) {
- return settings ? (
- // Building a settings object
- ajaxExtend(ajaxExtend(target, jQuery.ajaxSettings), settings)
- ) : (
- // Extending ajaxSettings
- ajaxExtend(jQuery.ajaxSettings, target)
- );
- },
- ajaxPrefilter: addToPrefiltersOrTransports(prefilters),
- ajaxTransport: addToPrefiltersOrTransports(transports),
- // Main method
- ajax: function(url, options) {
- if (typeof url === "object") {
- options = url;
- url = void 0;
- }
- options = options || {};
- var transport, cacheURL, responseHeadersString, responseHeaders, timeoutTimer, urlAnchor, completed2, fireGlobals, i, uncached, s = jQuery.ajaxSetup({}, options), callbackContext = s.context || s, globalEventContext = s.context && (callbackContext.nodeType || callbackContext.jquery) ? jQuery(callbackContext) : jQuery.event, deferred = jQuery.Deferred(), completeDeferred = jQuery.Callbacks("once memory"), statusCode = s.statusCode || {}, requestHeaders = {}, requestHeadersNames = {}, strAbort = "canceled", jqXHR = {
- readyState: 0,
- // Builds headers hashtable if needed
- getResponseHeader: function(key) {
- var match;
- if (completed2) {
- if (!responseHeaders) {
- responseHeaders = {};
- while (match = rheaders.exec(responseHeadersString)) {
- responseHeaders[match[1].toLowerCase() + " "] = (responseHeaders[match[1].toLowerCase() + " "] || []).concat(match[2]);
- }
- }
- match = responseHeaders[key.toLowerCase() + " "];
- }
- return match == null ? null : match.join(", ");
- },
- // Raw string
- getAllResponseHeaders: function() {
- return completed2 ? responseHeadersString : null;
- },
- // Caches the header
- setRequestHeader: function(name, value) {
- if (completed2 == null) {
- name = requestHeadersNames[name.toLowerCase()] = requestHeadersNames[name.toLowerCase()] || name;
- requestHeaders[name] = value;
- }
- return this;
- },
- // Overrides response content-type header
- overrideMimeType: function(type) {
- if (completed2 == null) {
- s.mimeType = type;
- }
- return this;
- },
- // Status-dependent callbacks
- statusCode: function(map) {
- var code;
- if (map) {
- if (completed2) {
- jqXHR.always(map[jqXHR.status]);
- } else {
- for (code in map) {
- statusCode[code] = [statusCode[code], map[code]];
- }
- }
- }
- return this;
- },
- // Cancel the request
- abort: function(statusText) {
- var finalText = statusText || strAbort;
- if (transport) {
- transport.abort(finalText);
- }
- done(0, finalText);
- return this;
- }
- };
- deferred.promise(jqXHR);
- s.url = ((url || s.url || location2.href) + "").replace(rprotocol, location2.protocol + "//");
- s.type = options.method || options.type || s.method || s.type;
- s.dataTypes = (s.dataType || "*").toLowerCase().match(rnothtmlwhite) || [""];
- if (s.crossDomain == null) {
- urlAnchor = document2.createElement("a");
- try {
- urlAnchor.href = s.url;
- urlAnchor.href = urlAnchor.href;
- s.crossDomain = originAnchor.protocol + "//" + originAnchor.host !== urlAnchor.protocol + "//" + urlAnchor.host;
- } catch (e) {
- s.crossDomain = true;
- }
- }
- if (s.data && s.processData && typeof s.data !== "string") {
- s.data = jQuery.param(s.data, s.traditional);
- }
- inspectPrefiltersOrTransports(prefilters, s, options, jqXHR);
- if (completed2) {
- return jqXHR;
- }
- fireGlobals = jQuery.event && s.global;
- if (fireGlobals && jQuery.active++ === 0) {
- jQuery.event.trigger("ajaxStart");
- }
- s.type = s.type.toUpperCase();
- s.hasContent = !rnoContent.test(s.type);
- cacheURL = s.url.replace(rhash, "");
- if (!s.hasContent) {
- uncached = s.url.slice(cacheURL.length);
- if (s.data && (s.processData || typeof s.data === "string")) {
- cacheURL += (rquery.test(cacheURL) ? "&" : "?") + s.data;
- delete s.data;
- }
- if (s.cache === false) {
- cacheURL = cacheURL.replace(rantiCache, "$1");
- uncached = (rquery.test(cacheURL) ? "&" : "?") + "_=" + nonce.guid++ + uncached;
- }
- s.url = cacheURL + uncached;
- } else if (s.data && s.processData && (s.contentType || "").indexOf("application/x-www-form-urlencoded") === 0) {
- s.data = s.data.replace(r20, "+");
- }
- if (s.ifModified) {
- if (jQuery.lastModified[cacheURL]) {
- jqXHR.setRequestHeader("If-Modified-Since", jQuery.lastModified[cacheURL]);
- }
- if (jQuery.etag[cacheURL]) {
- jqXHR.setRequestHeader("If-None-Match", jQuery.etag[cacheURL]);
- }
- }
- if (s.data && s.hasContent && s.contentType !== false || options.contentType) {
- jqXHR.setRequestHeader("Content-Type", s.contentType);
- }
- jqXHR.setRequestHeader(
- "Accept",
- s.dataTypes[0] && s.accepts[s.dataTypes[0]] ? s.accepts[s.dataTypes[0]] + (s.dataTypes[0] !== "*" ? ", " + allTypes + "; q=0.01" : "") : s.accepts["*"]
- );
- for (i in s.headers) {
- jqXHR.setRequestHeader(i, s.headers[i]);
- }
- if (s.beforeSend && (s.beforeSend.call(callbackContext, jqXHR, s) === false || completed2)) {
- return jqXHR.abort();
- }
- strAbort = "abort";
- completeDeferred.add(s.complete);
- jqXHR.done(s.success);
- jqXHR.fail(s.error);
- transport = inspectPrefiltersOrTransports(transports, s, options, jqXHR);
- if (!transport) {
- done(-1, "No Transport");
- } else {
- jqXHR.readyState = 1;
- if (fireGlobals) {
- globalEventContext.trigger("ajaxSend", [jqXHR, s]);
- }
- if (completed2) {
- return jqXHR;
- }
- if (s.async && s.timeout > 0) {
- timeoutTimer = window2.setTimeout(function() {
- jqXHR.abort("timeout");
- }, s.timeout);
- }
- try {
- completed2 = false;
- transport.send(requestHeaders, done);
- } catch (e) {
- if (completed2) {
- throw e;
- }
- done(-1, e);
- }
- }
- function done(status, nativeStatusText, responses, headers) {
- var isSuccess, success, error, response, modified, statusText = nativeStatusText;
- if (completed2) {
- return;
- }
- completed2 = true;
- if (timeoutTimer) {
- window2.clearTimeout(timeoutTimer);
- }
- transport = void 0;
- responseHeadersString = headers || "";
- jqXHR.readyState = status > 0 ? 4 : 0;
- isSuccess = status >= 200 && status < 300 || status === 304;
- if (responses) {
- response = ajaxHandleResponses(s, jqXHR, responses);
- }
- if (!isSuccess && jQuery.inArray("script", s.dataTypes) > -1 && jQuery.inArray("json", s.dataTypes) < 0) {
- s.converters["text script"] = function() {
- };
- }
- response = ajaxConvert(s, response, jqXHR, isSuccess);
- if (isSuccess) {
- if (s.ifModified) {
- modified = jqXHR.getResponseHeader("Last-Modified");
- if (modified) {
- jQuery.lastModified[cacheURL] = modified;
- }
- modified = jqXHR.getResponseHeader("etag");
- if (modified) {
- jQuery.etag[cacheURL] = modified;
- }
- }
- if (status === 204 || s.type === "HEAD") {
- statusText = "nocontent";
- } else if (status === 304) {
- statusText = "notmodified";
- } else {
- statusText = response.state;
- success = response.data;
- error = response.error;
- isSuccess = !error;
- }
- } else {
- error = statusText;
- if (status || !statusText) {
- statusText = "error";
- if (status < 0) {
- status = 0;
- }
- }
- }
- jqXHR.status = status;
- jqXHR.statusText = (nativeStatusText || statusText) + "";
- if (isSuccess) {
- deferred.resolveWith(callbackContext, [success, statusText, jqXHR]);
- } else {
- deferred.rejectWith(callbackContext, [jqXHR, statusText, error]);
- }
- jqXHR.statusCode(statusCode);
- statusCode = void 0;
- if (fireGlobals) {
- globalEventContext.trigger(
- isSuccess ? "ajaxSuccess" : "ajaxError",
- [jqXHR, s, isSuccess ? success : error]
- );
- }
- completeDeferred.fireWith(callbackContext, [jqXHR, statusText]);
- if (fireGlobals) {
- globalEventContext.trigger("ajaxComplete", [jqXHR, s]);
- if (!--jQuery.active) {
- jQuery.event.trigger("ajaxStop");
- }
- }
- }
- return jqXHR;
- },
- getJSON: function(url, data, callback) {
- return jQuery.get(url, data, callback, "json");
- },
- getScript: function(url, callback) {
- return jQuery.get(url, void 0, callback, "script");
- }
- });
- jQuery.each(["get", "post"], function(_i, method) {
- jQuery[method] = function(url, data, callback, type) {
- if (isFunction(data)) {
- type = type || callback;
- callback = data;
- data = void 0;
- }
- return jQuery.ajax(jQuery.extend({
- url,
- type: method,
- dataType: type,
- data,
- success: callback
- }, jQuery.isPlainObject(url) && url));
- };
- });
- jQuery.ajaxPrefilter(function(s) {
- var i;
- for (i in s.headers) {
- if (i.toLowerCase() === "content-type") {
- s.contentType = s.headers[i] || "";
- }
- }
- });
- jQuery._evalUrl = function(url, options, doc) {
- return jQuery.ajax({
- url,
- // Make this explicit, since user can override this through ajaxSetup (trac-11264)
- type: "GET",
- dataType: "script",
- cache: true,
- async: false,
- global: false,
- // Only evaluate the response if it is successful (gh-4126)
- // dataFilter is not invoked for failure responses, so using it instead
- // of the default converter is kludgy but it works.
- converters: {
- "text script": function() {
- }
- },
- dataFilter: function(response) {
- jQuery.globalEval(response, options, doc);
- }
- });
- };
- jQuery.fn.extend({
- wrapAll: function(html) {
- var wrap;
- if (this[0]) {
- if (isFunction(html)) {
- html = html.call(this[0]);
- }
- wrap = jQuery(html, this[0].ownerDocument).eq(0).clone(true);
- if (this[0].parentNode) {
- wrap.insertBefore(this[0]);
- }
- wrap.map(function() {
- var elem = this;
- while (elem.firstElementChild) {
- elem = elem.firstElementChild;
- }
- return elem;
- }).append(this);
- }
- return this;
- },
- wrapInner: function(html) {
- if (isFunction(html)) {
- return this.each(function(i) {
- jQuery(this).wrapInner(html.call(this, i));
- });
- }
- return this.each(function() {
- var self2 = jQuery(this), contents = self2.contents();
- if (contents.length) {
- contents.wrapAll(html);
- } else {
- self2.append(html);
- }
- });
- },
- wrap: function(html) {
- var htmlIsFunction = isFunction(html);
- return this.each(function(i) {
- jQuery(this).wrapAll(htmlIsFunction ? html.call(this, i) : html);
- });
- },
- unwrap: function(selector) {
- this.parent(selector).not("body").each(function() {
- jQuery(this).replaceWith(this.childNodes);
- });
- return this;
- }
- });
- jQuery.expr.pseudos.hidden = function(elem) {
- return !jQuery.expr.pseudos.visible(elem);
- };
- jQuery.expr.pseudos.visible = function(elem) {
- return !!(elem.offsetWidth || elem.offsetHeight || elem.getClientRects().length);
- };
- jQuery.ajaxSettings.xhr = function() {
- try {
- return new window2.XMLHttpRequest();
- } catch (e) {
- }
- };
- var xhrSuccessStatus = {
- // File protocol always yields status code 0, assume 200
- 0: 200,
- // Support: IE <=9 only
- // trac-1450: sometimes IE returns 1223 when it should be 204
- 1223: 204
- }, xhrSupported = jQuery.ajaxSettings.xhr();
- support.cors = !!xhrSupported && "withCredentials" in xhrSupported;
- support.ajax = xhrSupported = !!xhrSupported;
- jQuery.ajaxTransport(function(options) {
- var callback, errorCallback;
- if (support.cors || xhrSupported && !options.crossDomain) {
- return {
- send: function(headers, complete) {
- var i, xhr = options.xhr();
- xhr.open(
- options.type,
- options.url,
- options.async,
- options.username,
- options.password
- );
- if (options.xhrFields) {
- for (i in options.xhrFields) {
- xhr[i] = options.xhrFields[i];
- }
- }
- if (options.mimeType && xhr.overrideMimeType) {
- xhr.overrideMimeType(options.mimeType);
- }
- if (!options.crossDomain && !headers["X-Requested-With"]) {
- headers["X-Requested-With"] = "XMLHttpRequest";
- }
- for (i in headers) {
- xhr.setRequestHeader(i, headers[i]);
- }
- callback = function(type) {
- return function() {
- if (callback) {
- callback = errorCallback = xhr.onload = xhr.onerror = xhr.onabort = xhr.ontimeout = xhr.onreadystatechange = null;
- if (type === "abort") {
- xhr.abort();
- } else if (type === "error") {
- if (typeof xhr.status !== "number") {
- complete(0, "error");
- } else {
- complete(
- // File: protocol always yields status 0; see trac-8605, trac-14207
- xhr.status,
- xhr.statusText
- );
- }
- } else {
- complete(
- xhrSuccessStatus[xhr.status] || xhr.status,
- xhr.statusText,
- // Support: IE <=9 only
- // IE9 has no XHR2 but throws on binary (trac-11426)
- // For XHR2 non-text, let the caller handle it (gh-2498)
- (xhr.responseType || "text") !== "text" || typeof xhr.responseText !== "string" ? { binary: xhr.response } : { text: xhr.responseText },
- xhr.getAllResponseHeaders()
- );
- }
- }
- };
- };
- xhr.onload = callback();
- errorCallback = xhr.onerror = xhr.ontimeout = callback("error");
- if (xhr.onabort !== void 0) {
- xhr.onabort = errorCallback;
- } else {
- xhr.onreadystatechange = function() {
- if (xhr.readyState === 4) {
- window2.setTimeout(function() {
- if (callback) {
- errorCallback();
- }
- });
- }
- };
- }
- callback = callback("abort");
- try {
- xhr.send(options.hasContent && options.data || null);
- } catch (e) {
- if (callback) {
- throw e;
- }
- }
- },
- abort: function() {
- if (callback) {
- callback();
- }
- }
- };
- }
- });
- jQuery.ajaxPrefilter(function(s) {
- if (s.crossDomain) {
- s.contents.script = false;
- }
- });
- jQuery.ajaxSetup({
- accepts: {
- script: "text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"
- },
- contents: {
- script: /\b(?:java|ecma)script\b/
- },
- converters: {
- "text script": function(text) {
- jQuery.globalEval(text);
- return text;
- }
- }
- });
- jQuery.ajaxPrefilter("script", function(s) {
- if (s.cache === void 0) {
- s.cache = false;
- }
- if (s.crossDomain) {
- s.type = "GET";
- }
- });
- jQuery.ajaxTransport("script", function(s) {
- if (s.crossDomain || s.scriptAttrs) {
- var script, callback;
- return {
- send: function(_, complete) {
- script = jQuery("<script>").attr(s.scriptAttrs || {}).prop({ charset: s.scriptCharset, src: s.url }).on("load error", callback = function(evt) {
- script.remove();
- callback = null;
- if (evt) {
- complete(evt.type === "error" ? 404 : 200, evt.type);
- }
- });
- document2.head.appendChild(script[0]);
- },
- abort: function() {
- if (callback) {
- callback();
- }
- }
- };
- }
- });
- var oldCallbacks = [], rjsonp = /(=)\?(?=&|$)|\?\?/;
- jQuery.ajaxSetup({
- jsonp: "callback",
- jsonpCallback: function() {
- var callback = oldCallbacks.pop() || jQuery.expando + "_" + nonce.guid++;
- this[callback] = true;
- return callback;
- }
- });
- jQuery.ajaxPrefilter("json jsonp", function(s, originalSettings, jqXHR) {
- var callbackName, overwritten, responseContainer, jsonProp = s.jsonp !== false && (rjsonp.test(s.url) ? "url" : typeof s.data === "string" && (s.contentType || "").indexOf("application/x-www-form-urlencoded") === 0 && rjsonp.test(s.data) && "data");
- if (jsonProp || s.dataTypes[0] === "jsonp") {
- callbackName = s.jsonpCallback = isFunction(s.jsonpCallback) ? s.jsonpCallback() : s.jsonpCallback;
- if (jsonProp) {
- s[jsonProp] = s[jsonProp].replace(rjsonp, "$1" + callbackName);
- } else if (s.jsonp !== false) {
- s.url += (rquery.test(s.url) ? "&" : "?") + s.jsonp + "=" + callbackName;
- }
- s.converters["script json"] = function() {
- if (!responseContainer) {
- jQuery.error(callbackName + " was not called");
- }
- return responseContainer[0];
- };
- s.dataTypes[0] = "json";
- overwritten = window2[callbackName];
- window2[callbackName] = function() {
- responseContainer = arguments;
- };
- jqXHR.always(function() {
- if (overwritten === void 0) {
- jQuery(window2).removeProp(callbackName);
- } else {
- window2[callbackName] = overwritten;
- }
- if (s[callbackName]) {
- s.jsonpCallback = originalSettings.jsonpCallback;
- oldCallbacks.push(callbackName);
- }
- if (responseContainer && isFunction(overwritten)) {
- overwritten(responseContainer[0]);
- }
- responseContainer = overwritten = void 0;
- });
- return "script";
- }
- });
- support.createHTMLDocument = function() {
- var body = document2.implementation.createHTMLDocument("").body;
- body.innerHTML = "<form></form><form></form>";
- return body.childNodes.length === 2;
- }();
- jQuery.parseHTML = function(data, context, keepScripts) {
- if (typeof data !== "string") {
- return [];
- }
- if (typeof context === "boolean") {
- keepScripts = context;
- context = false;
- }
- var base, parsed, scripts;
- if (!context) {
- if (support.createHTMLDocument) {
- context = document2.implementation.createHTMLDocument("");
- base = context.createElement("base");
- base.href = document2.location.href;
- context.head.appendChild(base);
- } else {
- context = document2;
- }
- }
- parsed = rsingleTag.exec(data);
- scripts = !keepScripts && [];
- if (parsed) {
- return [context.createElement(parsed[1])];
- }
- parsed = buildFragment([data], context, scripts);
- if (scripts && scripts.length) {
- jQuery(scripts).remove();
- }
- return jQuery.merge([], parsed.childNodes);
- };
- jQuery.fn.load = function(url, params, callback) {
- var selector, type, response, self2 = this, off = url.indexOf(" ");
- if (off > -1) {
- selector = stripAndCollapse(url.slice(off));
- url = url.slice(0, off);
- }
- if (isFunction(params)) {
- callback = params;
- params = void 0;
- } else if (params && typeof params === "object") {
- type = "POST";
- }
- if (self2.length > 0) {
- jQuery.ajax({
- url,
- // If "type" variable is undefined, then "GET" method will be used.
- // Make value of this field explicit since
- // user can override it through ajaxSetup method
- type: type || "GET",
- dataType: "html",
- data: params
- }).done(function(responseText) {
- response = arguments;
- self2.html(selector ? (
- // If a selector was specified, locate the right elements in a dummy div
- // Exclude scripts to avoid IE 'Permission Denied' errors
- jQuery("<div>").append(jQuery.parseHTML(responseText)).find(selector)
- ) : (
- // Otherwise use the full result
- responseText
- ));
- }).always(callback && function(jqXHR, status) {
- self2.each(function() {
- callback.apply(this, response || [jqXHR.responseText, status, jqXHR]);
- });
- });
- }
- return this;
- };
- jQuery.expr.pseudos.animated = function(elem) {
- return jQuery.grep(jQuery.timers, function(fn) {
- return elem === fn.elem;
- }).length;
- };
- jQuery.offset = {
- setOffset: function(elem, options, i) {
- var curPosition, curLeft, curCSSTop, curTop, curOffset, curCSSLeft, calculatePosition, position = jQuery.css(elem, "position"), curElem = jQuery(elem), props = {};
- if (position === "static") {
- elem.style.position = "relative";
- }
- curOffset = curElem.offset();
- curCSSTop = jQuery.css(elem, "top");
- curCSSLeft = jQuery.css(elem, "left");
- calculatePosition = (position === "absolute" || position === "fixed") && (curCSSTop + curCSSLeft).indexOf("auto") > -1;
- if (calculatePosition) {
- curPosition = curElem.position();
- curTop = curPosition.top;
- curLeft = curPosition.left;
- } else {
- curTop = parseFloat(curCSSTop) || 0;
- curLeft = parseFloat(curCSSLeft) || 0;
- }
- if (isFunction(options)) {
- options = options.call(elem, i, jQuery.extend({}, curOffset));
- }
- if (options.top != null) {
- props.top = options.top - curOffset.top + curTop;
- }
- if (options.left != null) {
- props.left = options.left - curOffset.left + curLeft;
- }
- if ("using" in options) {
- options.using.call(elem, props);
- } else {
- curElem.css(props);
- }
- }
- };
- jQuery.fn.extend({
- // offset() relates an element's border box to the document origin
- offset: function(options) {
- if (arguments.length) {
- return options === void 0 ? this : this.each(function(i) {
- jQuery.offset.setOffset(this, options, i);
- });
- }
- var rect, win, elem = this[0];
- if (!elem) {
- return;
- }
- if (!elem.getClientRects().length) {
- return { top: 0, left: 0 };
- }
- rect = elem.getBoundingClientRect();
- win = elem.ownerDocument.defaultView;
- return {
- top: rect.top + win.pageYOffset,
- left: rect.left + win.pageXOffset
- };
- },
- // position() relates an element's margin box to its offset parent's padding box
- // This corresponds to the behavior of CSS absolute positioning
- position: function() {
- if (!this[0]) {
- return;
- }
- var offsetParent, offset, doc, elem = this[0], parentOffset = { top: 0, left: 0 };
- if (jQuery.css(elem, "position") === "fixed") {
- offset = elem.getBoundingClientRect();
- } else {
- offset = this.offset();
- doc = elem.ownerDocument;
- offsetParent = elem.offsetParent || doc.documentElement;
- while (offsetParent && (offsetParent === doc.body || offsetParent === doc.documentElement) && jQuery.css(offsetParent, "position") === "static") {
- offsetParent = offsetParent.parentNode;
- }
- if (offsetParent && offsetParent !== elem && offsetParent.nodeType === 1) {
- parentOffset = jQuery(offsetParent).offset();
- parentOffset.top += jQuery.css(offsetParent, "borderTopWidth", true);
- parentOffset.left += jQuery.css(offsetParent, "borderLeftWidth", true);
- }
- }
- return {
- top: offset.top - parentOffset.top - jQuery.css(elem, "marginTop", true),
- left: offset.left - parentOffset.left - jQuery.css(elem, "marginLeft", true)
- };
- },
- // This method will return documentElement in the following cases:
- // 1) For the element inside the iframe without offsetParent, this method will return
- // documentElement of the parent window
- // 2) For the hidden or detached element
- // 3) For body or html element, i.e. in case of the html node - it will return itself
- //
- // but those exceptions were never presented as a real life use-cases
- // and might be considered as more preferable results.
- //
- // This logic, however, is not guaranteed and can change at any point in the future
- offsetParent: function() {
- return this.map(function() {
- var offsetParent = this.offsetParent;
- while (offsetParent && jQuery.css(offsetParent, "position") === "static") {
- offsetParent = offsetParent.offsetParent;
- }
- return offsetParent || documentElement;
- });
- }
- });
- jQuery.each({ scrollLeft: "pageXOffset", scrollTop: "pageYOffset" }, function(method, prop) {
- var top = "pageYOffset" === prop;
- jQuery.fn[method] = function(val) {
- return access(this, function(elem, method2, val2) {
- var win;
- if (isWindow(elem)) {
- win = elem;
- } else if (elem.nodeType === 9) {
- win = elem.defaultView;
- }
- if (val2 === void 0) {
- return win ? win[prop] : elem[method2];
- }
- if (win) {
- win.scrollTo(
- !top ? val2 : win.pageXOffset,
- top ? val2 : win.pageYOffset
- );
- } else {
- elem[method2] = val2;
- }
- }, method, val, arguments.length);
- };
- });
- jQuery.each(["top", "left"], function(_i, prop) {
- jQuery.cssHooks[prop] = addGetHookIf(
- support.pixelPosition,
- function(elem, computed) {
- if (computed) {
- computed = curCSS(elem, prop);
- return rnumnonpx.test(computed) ? jQuery(elem).position()[prop] + "px" : computed;
- }
- }
- );
- });
- jQuery.each({ Height: "height", Width: "width" }, function(name, type) {
- jQuery.each({
- padding: "inner" + name,
- content: type,
- "": "outer" + name
- }, function(defaultExtra, funcName) {
- jQuery.fn[funcName] = function(margin, value) {
- var chainable = arguments.length && (defaultExtra || typeof margin !== "boolean"), extra = defaultExtra || (margin === true || value === true ? "margin" : "border");
- return access(this, function(elem, type2, value2) {
- var doc;
- if (isWindow(elem)) {
- return funcName.indexOf("outer") === 0 ? elem["inner" + name] : elem.document.documentElement["client" + name];
- }
- if (elem.nodeType === 9) {
- doc = elem.documentElement;
- return Math.max(
- elem.body["scroll" + name],
- doc["scroll" + name],
- elem.body["offset" + name],
- doc["offset" + name],
- doc["client" + name]
- );
- }
- return value2 === void 0 ? (
- // Get width or height on the element, requesting but not forcing parseFloat
- jQuery.css(elem, type2, extra)
- ) : (
- // Set width or height on the element
- jQuery.style(elem, type2, value2, extra)
- );
- }, type, chainable ? margin : void 0, chainable);
- };
- });
- });
- jQuery.each([
- "ajaxStart",
- "ajaxStop",
- "ajaxComplete",
- "ajaxError",
- "ajaxSuccess",
- "ajaxSend"
- ], function(_i, type) {
- jQuery.fn[type] = function(fn) {
- return this.on(type, fn);
- };
- });
- jQuery.fn.extend({
- bind: function(types, data, fn) {
- return this.on(types, null, data, fn);
- },
- unbind: function(types, fn) {
- return this.off(types, null, fn);
- },
- delegate: function(selector, types, data, fn) {
- return this.on(types, selector, data, fn);
- },
- undelegate: function(selector, types, fn) {
- return arguments.length === 1 ? this.off(selector, "**") : this.off(types, selector || "**", fn);
- },
- hover: function(fnOver, fnOut) {
- return this.on("mouseenter", fnOver).on("mouseleave", fnOut || fnOver);
- }
- });
- jQuery.each(
- "blur focus focusin focusout resize scroll click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup contextmenu".split(" "),
- function(_i, name) {
- jQuery.fn[name] = function(data, fn) {
- return arguments.length > 0 ? this.on(name, null, data, fn) : this.trigger(name);
- };
- }
- );
- var rtrim = /^[\s\uFEFF\xA0]+|([^\s\uFEFF\xA0])[\s\uFEFF\xA0]+$/g;
- jQuery.proxy = function(fn, context) {
- var tmp, args, proxy;
- if (typeof context === "string") {
- tmp = fn[context];
- context = fn;
- fn = tmp;
- }
- if (!isFunction(fn)) {
- return void 0;
- }
- args = slice.call(arguments, 2);
- proxy = function() {
- return fn.apply(context || this, args.concat(slice.call(arguments)));
- };
- proxy.guid = fn.guid = fn.guid || jQuery.guid++;
- return proxy;
- };
- jQuery.holdReady = function(hold) {
- if (hold) {
- jQuery.readyWait++;
- } else {
- jQuery.ready(true);
- }
- };
- jQuery.isArray = Array.isArray;
- jQuery.parseJSON = JSON.parse;
- jQuery.nodeName = nodeName;
- jQuery.isFunction = isFunction;
- jQuery.isWindow = isWindow;
- jQuery.camelCase = camelCase;
- jQuery.type = toType;
- jQuery.now = Date.now;
- jQuery.isNumeric = function(obj) {
- var type = jQuery.type(obj);
- return (type === "number" || type === "string") && // parseFloat NaNs numeric-cast false positives ("")
- // ...but misinterprets leading-number strings, particularly hex literals ("0x...")
- // subtraction forces infinities to NaN
- !isNaN(obj - parseFloat(obj));
- };
- jQuery.trim = function(text) {
- return text == null ? "" : (text + "").replace(rtrim, "$1");
- };
- var _jQuery = window2.jQuery, _$ = window2.$;
- jQuery.noConflict = function(deep) {
- if (window2.$ === jQuery) {
- window2.$ = _$;
- }
- if (deep && window2.jQuery === jQuery) {
- window2.jQuery = _jQuery;
- }
- return jQuery;
- };
- if (typeof noGlobal === "undefined") {
- window2.jQuery = window2.$ = jQuery;
- }
- return jQuery;
- });
- })(jquery);
- var jqueryExports = jquery.exports;
- const $ = /* @__PURE__ */ getDefaultExportFromCjs(jqueryExports);
- class RuleBaseInterface {
- constructor() {
- __publicField(this, "$", window.jQuery || $);
- // 通用属性配置,以及工具函数。可在规则类中覆盖
- __publicField(this, "minTitleLength", 8);
- // 标题最少汉字数(不能在小了,这个值变小会造成更多数据误差)
- __publicField(this, "maxDepthLevel", 30);
- // DOM树最大深度
- __publicField(this, "companyNameReg", /(集团|公司|研究所|设计院|平台)$/);
- __publicField(this, "includeTags", [
- "A",
- "DIV",
- "SPAN",
- "TD",
- "H1",
- "H2",
- "H3",
- "H4",
- "H5",
- "H6",
- "P",
- "TD",
- "TR"
- ]);
- // 非法节点,需要排除
- __publicField(this, "excludeTags", ["SCRIPT", "STYLE"]);
- __publicField(this, "chineseCharReg", /[\u4e00-\u9fa5]/g);
- __publicField(this, "datePatterns", [
- /\b(\d{4})\/(\d{0,2})\/(\d{0,2})\b/,
- /\b(\d{4})-(\d{0,2})-(\d{0,2})\b/,
- /\b(\d{0,2})-(\d{0,2})\b/,
- /\b(\d{0,2})\/(\d{0,2})\b/,
- /\b(\d{4})\/(\d{0,2})\/(\d{0,2}) (\d{0,2}):(\d{0,2})\b/,
- /\b(\d{4})-(\d{0,2})-(\d{0,2}) (\d{0,2}):(\d{0,2})\b/,
- /\b(\d{2})\/(\d{0,2}) (\d{0,2}):(\d{0,2})\b/,
- /\b(\d{2})-(\d{0,2}) (\d{0,2}):(\d{0,2})\b/,
- // 匹配年月
- /\b(\d{4})\/(\d{0,2})\b/,
- /\b(\d{4})-(\d{0,2})\b/,
- // 范围更大的匹配
- /\b(\d{4})([\\\/\.\-年月日点时分秒\:])(\d{0,2})([\\\/\.\-年月日点时分秒\:])(\d{0,2})\b/,
- /\b(\d{4})([\\\/\.\-年月日点时分秒\:])(\d{0,2})\b/
- ]);
- __publicField(this, "todayDatePatternString", [
- "(%s年)(\\D+)(%s月)(\\D+)(%s日)",
- "(%s月)(\\D+)(%s日)"
- ]);
- __publicField(this, "infoTypeList", [
- "拟建",
- "采购意向",
- "预告",
- "预审",
- "预审结果",
- "论证意见",
- "需求公示",
- "招标",
- "邀标",
- "询价",
- "竞谈",
- "单一",
- "竞价",
- "中标",
- "成交",
- "废标",
- "流标",
- "合同",
- "验收",
- "违规"
- ]);
- __publicField(this, "otherKeyList", [
- "项目",
- "公告",
- "公示",
- "采购",
- "更正",
- "变更"
- ]);
- __publicField(this, "importantTags", [
- "h1",
- "h2",
- "h3",
- "h4",
- "h5",
- "a"
- ]);
- }
- run() {
- }
- check() {
- }
- get todayPatterns() {
- const now = /* @__PURE__ */ new Date();
- const year = now.getFullYear();
- const month = now.getMonth() + 1;
- const day = now.getDate();
- const monthStr = `${month}`.padStart(2, "0");
- const dayStr = `${day}`.padStart(2, "0");
- const arr = [];
- const todayDatePatternList = this.todayDatePatternString;
- if (Array.isArray(todayDatePatternList)) {
- todayDatePatternList.forEach((p) => {
- let np = p.replace("%s年", `${year}`);
- arr.push(np.replace("%s月", `${month}`).replace("%s日", `${day}`));
- arr.push(np.replace("%s月", `${month}`).replace("%s日", `${dayStr}`));
- arr.push(np.replace("%s月", `${monthStr}`).replace("%s日", `${day}`));
- arr.push(np.replace("%s月", `${monthStr}`).replace("%s日", `${dayStr}`));
- });
- return arr.map((r) => new RegExp(r));
- } else {
- return [];
- }
- }
- get importantKeyList() {
- let list = [];
- return list.concat(this.infoTypeList).concat(this.otherKeyList);
- }
- get importantTagList() {
- const tagList = this.importantTags;
- if (Array.isArray(tagList)) {
- return tagList.map((i) => i.toUpperCase());
- } else {
- return [];
- }
- }
- // 辅助函数:遍历DOM节点,查找符合条件的末级节点
- findEligibleLeafNodes(node, condition) {
- const result = [];
- const includeTags = this.includeTags;
- const excludeTags = this.excludeTags;
- function pushResult(n) {
- var _a;
- result.push({ node: n, text: (_a = n.textContent) == null ? void 0 : _a.trim(), selector: null });
- }
- function traverse(node2) {
- if (!node2)
- return;
- if (excludeTags.includes(node2.nodeName))
- return;
- if (node2.nodeType === Node.ELEMENT_NODE) {
- if (includeTags.includes(node2.nodeName) && !node2.children.length && node2.textContent) {
- if (typeof condition === "function") {
- if (condition(node2)) {
- pushResult(node2);
- }
- } else {
- pushResult(node2);
- }
- } else {
- node2.childNodes.forEach((item) => {
- traverse(item);
- });
- }
- } else if (node2.nodeType === Node.TEXT_NODE) {
- if (node2.textContent) {
- if (typeof condition === "function") {
- if (condition(node2)) {
- pushResult(node2);
- }
- } else {
- pushResult(node2);
- }
- }
- }
- }
- traverse(node);
- return result;
- }
- // 辅助函数:从文本中提取日期
- extractDates(text) {
- text = text || "";
- var dates = [];
- this.datePatterns.forEach((pattern) => {
- var match = text.match(pattern);
- if (match && match.length > 0) {
- dates.push(match[0]);
- }
- });
- return dates;
- }
- // 判断是否是元素节点
- isElementNode(node) {
- return node && node.nodeType === Node.ELEMENT_NODE;
- }
- // 元素是否隐藏(文本节点无法计算显示隐藏,则默认非隐藏)
- checkNodeHidden(node) {
- let isHidden = false;
- if (this.isElementNode(node)) {
- isHidden = this.$(node).is(":hidden");
- }
- return isHidden;
- }
- isCompanyName(text) {
- return this.companyNameReg.test(text);
- }
- getTagName(node) {
- if (this.isElementNode(node)) {
- return node.tagName;
- } else {
- return "";
- }
- }
- // 统计中文字符个数
- countChineseCharacters(str) {
- str = str || "";
- var matches = str.match(this.chineseCharReg);
- return matches ? matches.length : 0;
- }
- // 上报:lua脚本中会取window.result变量中的内容
- report(result) {
- window.result = result;
- }
- }
- function getSiblings(elem) {
- var _a;
- var r = [];
- var n = (_a = elem.parentNode) == null ? void 0 : _a.firstChild;
- for (; n; n = n.nextSibling) {
- if (n.nodeType === 1 && n !== elem) {
- r.push(n);
- }
- }
- return r;
- }
- function getMaxCount(arr) {
- return Math.max.apply(null, arr);
- }
- var lodash = { exports: {} };
- /**
- * @license
- * Lodash <https://lodash.com/>
- * Copyright OpenJS Foundation and other contributors <https://openjsf.org/>
- * Released under MIT license <https://lodash.com/license>
- * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
- * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
- */
- lodash.exports;
- (function(module, exports) {
- (function() {
- var undefined$1;
- var VERSION = "4.17.21";
- var LARGE_ARRAY_SIZE = 200;
- var CORE_ERROR_TEXT = "Unsupported core-js use. Try https://npms.io/search?q=ponyfill.", FUNC_ERROR_TEXT = "Expected a function", INVALID_TEMPL_VAR_ERROR_TEXT = "Invalid `variable` option passed into `_.template`";
- var HASH_UNDEFINED = "__lodash_hash_undefined__";
- var MAX_MEMOIZE_SIZE = 500;
- var PLACEHOLDER = "__lodash_placeholder__";
- var CLONE_DEEP_FLAG = 1, CLONE_FLAT_FLAG = 2, CLONE_SYMBOLS_FLAG = 4;
- var COMPARE_PARTIAL_FLAG = 1, COMPARE_UNORDERED_FLAG = 2;
- var WRAP_BIND_FLAG = 1, WRAP_BIND_KEY_FLAG = 2, WRAP_CURRY_BOUND_FLAG = 4, WRAP_CURRY_FLAG = 8, WRAP_CURRY_RIGHT_FLAG = 16, WRAP_PARTIAL_FLAG = 32, WRAP_PARTIAL_RIGHT_FLAG = 64, WRAP_ARY_FLAG = 128, WRAP_REARG_FLAG = 256, WRAP_FLIP_FLAG = 512;
- var DEFAULT_TRUNC_LENGTH = 30, DEFAULT_TRUNC_OMISSION = "...";
- var HOT_COUNT = 800, HOT_SPAN = 16;
- var LAZY_FILTER_FLAG = 1, LAZY_MAP_FLAG = 2, LAZY_WHILE_FLAG = 3;
- var INFINITY = 1 / 0, MAX_SAFE_INTEGER = 9007199254740991, MAX_INTEGER = 17976931348623157e292, NAN = 0 / 0;
- var MAX_ARRAY_LENGTH = 4294967295, MAX_ARRAY_INDEX = MAX_ARRAY_LENGTH - 1, HALF_MAX_ARRAY_LENGTH = MAX_ARRAY_LENGTH >>> 1;
- var wrapFlags = [
- ["ary", WRAP_ARY_FLAG],
- ["bind", WRAP_BIND_FLAG],
- ["bindKey", WRAP_BIND_KEY_FLAG],
- ["curry", WRAP_CURRY_FLAG],
- ["curryRight", WRAP_CURRY_RIGHT_FLAG],
- ["flip", WRAP_FLIP_FLAG],
- ["partial", WRAP_PARTIAL_FLAG],
- ["partialRight", WRAP_PARTIAL_RIGHT_FLAG],
- ["rearg", WRAP_REARG_FLAG]
- ];
- var argsTag = "[object Arguments]", arrayTag = "[object Array]", asyncTag = "[object AsyncFunction]", boolTag = "[object Boolean]", dateTag = "[object Date]", domExcTag = "[object DOMException]", errorTag = "[object Error]", funcTag = "[object Function]", genTag = "[object GeneratorFunction]", mapTag = "[object Map]", numberTag = "[object Number]", nullTag = "[object Null]", objectTag = "[object Object]", promiseTag = "[object Promise]", proxyTag = "[object Proxy]", regexpTag = "[object RegExp]", setTag = "[object Set]", stringTag = "[object String]", symbolTag = "[object Symbol]", undefinedTag = "[object Undefined]", weakMapTag = "[object WeakMap]", weakSetTag = "[object WeakSet]";
- var arrayBufferTag = "[object ArrayBuffer]", dataViewTag = "[object DataView]", float32Tag = "[object Float32Array]", float64Tag = "[object Float64Array]", int8Tag = "[object Int8Array]", int16Tag = "[object Int16Array]", int32Tag = "[object Int32Array]", uint8Tag = "[object Uint8Array]", uint8ClampedTag = "[object Uint8ClampedArray]", uint16Tag = "[object Uint16Array]", uint32Tag = "[object Uint32Array]";
- var reEmptyStringLeading = /\b__p \+= '';/g, reEmptyStringMiddle = /\b(__p \+=) '' \+/g, reEmptyStringTrailing = /(__e\(.*?\)|\b__t\)) \+\n'';/g;
- var reEscapedHtml = /&(?:amp|lt|gt|quot|#39);/g, reUnescapedHtml = /[&<>"']/g, reHasEscapedHtml = RegExp(reEscapedHtml.source), reHasUnescapedHtml = RegExp(reUnescapedHtml.source);
- var reEscape = /<%-([\s\S]+?)%>/g, reEvaluate = /<%([\s\S]+?)%>/g, reInterpolate = /<%=([\s\S]+?)%>/g;
- var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/, reIsPlainProp = /^\w*$/, rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g;
- var reRegExpChar = /[\\^$.*+?()[\]{}|]/g, reHasRegExpChar = RegExp(reRegExpChar.source);
- var reTrimStart = /^\s+/;
- var reWhitespace = /\s/;
- var reWrapComment = /\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/, reWrapDetails = /\{\n\/\* \[wrapped with (.+)\] \*/, reSplitDetails = /,? & /;
- var reAsciiWord = /[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;
- var reForbiddenIdentifierChars = /[()=,{}\[\]\/\s]/;
- var reEscapeChar = /\\(\\)?/g;
- var reEsTemplate = /\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g;
- var reFlags = /\w*$/;
- var reIsBadHex = /^[-+]0x[0-9a-f]+$/i;
- var reIsBinary = /^0b[01]+$/i;
- var reIsHostCtor = /^\[object .+?Constructor\]$/;
- var reIsOctal = /^0o[0-7]+$/i;
- var reIsUint = /^(?:0|[1-9]\d*)$/;
- var reLatin = /[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g;
- var reNoMatch = /($^)/;
- var reUnescapedString = /['\n\r\u2028\u2029\\]/g;
- var rsAstralRange = "\\ud800-\\udfff", rsComboMarksRange = "\\u0300-\\u036f", reComboHalfMarksRange = "\\ufe20-\\ufe2f", rsComboSymbolsRange = "\\u20d0-\\u20ff", rsComboRange = rsComboMarksRange + reComboHalfMarksRange + rsComboSymbolsRange, rsDingbatRange = "\\u2700-\\u27bf", rsLowerRange = "a-z\\xdf-\\xf6\\xf8-\\xff", rsMathOpRange = "\\xac\\xb1\\xd7\\xf7", rsNonCharRange = "\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf", rsPunctuationRange = "\\u2000-\\u206f", rsSpaceRange = " \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000", rsUpperRange = "A-Z\\xc0-\\xd6\\xd8-\\xde", rsVarRange = "\\ufe0e\\ufe0f", rsBreakRange = rsMathOpRange + rsNonCharRange + rsPunctuationRange + rsSpaceRange;
- var rsApos = "['’]", rsAstral = "[" + rsAstralRange + "]", rsBreak = "[" + rsBreakRange + "]", rsCombo = "[" + rsComboRange + "]", rsDigits = "\\d+", rsDingbat = "[" + rsDingbatRange + "]", rsLower = "[" + rsLowerRange + "]", rsMisc = "[^" + rsAstralRange + rsBreakRange + rsDigits + rsDingbatRange + rsLowerRange + rsUpperRange + "]", rsFitz = "\\ud83c[\\udffb-\\udfff]", rsModifier = "(?:" + rsCombo + "|" + rsFitz + ")", rsNonAstral = "[^" + rsAstralRange + "]", rsRegional = "(?:\\ud83c[\\udde6-\\uddff]){2}", rsSurrPair = "[\\ud800-\\udbff][\\udc00-\\udfff]", rsUpper = "[" + rsUpperRange + "]", rsZWJ = "\\u200d";
- var rsMiscLower = "(?:" + rsLower + "|" + rsMisc + ")", rsMiscUpper = "(?:" + rsUpper + "|" + rsMisc + ")", rsOptContrLower = "(?:" + rsApos + "(?:d|ll|m|re|s|t|ve))?", rsOptContrUpper = "(?:" + rsApos + "(?:D|LL|M|RE|S|T|VE))?", reOptMod = rsModifier + "?", rsOptVar = "[" + rsVarRange + "]?", rsOptJoin = "(?:" + rsZWJ + "(?:" + [rsNonAstral, rsRegional, rsSurrPair].join("|") + ")" + rsOptVar + reOptMod + ")*", rsOrdLower = "\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])", rsOrdUpper = "\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])", rsSeq = rsOptVar + reOptMod + rsOptJoin, rsEmoji = "(?:" + [rsDingbat, rsRegional, rsSurrPair].join("|") + ")" + rsSeq, rsSymbol = "(?:" + [rsNonAstral + rsCombo + "?", rsCombo, rsRegional, rsSurrPair, rsAstral].join("|") + ")";
- var reApos = RegExp(rsApos, "g");
- var reComboMark = RegExp(rsCombo, "g");
- var reUnicode = RegExp(rsFitz + "(?=" + rsFitz + ")|" + rsSymbol + rsSeq, "g");
- var reUnicodeWord = RegExp([
- rsUpper + "?" + rsLower + "+" + rsOptContrLower + "(?=" + [rsBreak, rsUpper, "$"].join("|") + ")",
- rsMiscUpper + "+" + rsOptContrUpper + "(?=" + [rsBreak, rsUpper + rsMiscLower, "$"].join("|") + ")",
- rsUpper + "?" + rsMiscLower + "+" + rsOptContrLower,
- rsUpper + "+" + rsOptContrUpper,
- rsOrdUpper,
- rsOrdLower,
- rsDigits,
- rsEmoji
- ].join("|"), "g");
- var reHasUnicode = RegExp("[" + rsZWJ + rsAstralRange + rsComboRange + rsVarRange + "]");
- var reHasUnicodeWord = /[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/;
- var contextProps = [
- "Array",
- "Buffer",
- "DataView",
- "Date",
- "Error",
- "Float32Array",
- "Float64Array",
- "Function",
- "Int8Array",
- "Int16Array",
- "Int32Array",
- "Map",
- "Math",
- "Object",
- "Promise",
- "RegExp",
- "Set",
- "String",
- "Symbol",
- "TypeError",
- "Uint8Array",
- "Uint8ClampedArray",
- "Uint16Array",
- "Uint32Array",
- "WeakMap",
- "_",
- "clearTimeout",
- "isFinite",
- "parseInt",
- "setTimeout"
- ];
- var templateCounter = -1;
- var typedArrayTags = {};
- typedArrayTags[float32Tag] = typedArrayTags[float64Tag] = typedArrayTags[int8Tag] = typedArrayTags[int16Tag] = typedArrayTags[int32Tag] = typedArrayTags[uint8Tag] = typedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] = typedArrayTags[uint32Tag] = true;
- typedArrayTags[argsTag] = typedArrayTags[arrayTag] = typedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] = typedArrayTags[dataViewTag] = typedArrayTags[dateTag] = typedArrayTags[errorTag] = typedArrayTags[funcTag] = typedArrayTags[mapTag] = typedArrayTags[numberTag] = typedArrayTags[objectTag] = typedArrayTags[regexpTag] = typedArrayTags[setTag] = typedArrayTags[stringTag] = typedArrayTags[weakMapTag] = false;
- var cloneableTags = {};
- cloneableTags[argsTag] = cloneableTags[arrayTag] = cloneableTags[arrayBufferTag] = cloneableTags[dataViewTag] = cloneableTags[boolTag] = cloneableTags[dateTag] = cloneableTags[float32Tag] = cloneableTags[float64Tag] = cloneableTags[int8Tag] = cloneableTags[int16Tag] = cloneableTags[int32Tag] = cloneableTags[mapTag] = cloneableTags[numberTag] = cloneableTags[objectTag] = cloneableTags[regexpTag] = cloneableTags[setTag] = cloneableTags[stringTag] = cloneableTags[symbolTag] = cloneableTags[uint8Tag] = cloneableTags[uint8ClampedTag] = cloneableTags[uint16Tag] = cloneableTags[uint32Tag] = true;
- cloneableTags[errorTag] = cloneableTags[funcTag] = cloneableTags[weakMapTag] = false;
- var deburredLetters = {
- // Latin-1 Supplement block.
- "À": "A",
- "Á": "A",
- "Â": "A",
- "Ã": "A",
- "Ä": "A",
- "Å": "A",
- "à": "a",
- "á": "a",
- "â": "a",
- "ã": "a",
- "ä": "a",
- "å": "a",
- "Ç": "C",
- "ç": "c",
- "Ð": "D",
- "ð": "d",
- "È": "E",
- "É": "E",
- "Ê": "E",
- "Ë": "E",
- "è": "e",
- "é": "e",
- "ê": "e",
- "ë": "e",
- "Ì": "I",
- "Í": "I",
- "Î": "I",
- "Ï": "I",
- "ì": "i",
- "í": "i",
- "î": "i",
- "ï": "i",
- "Ñ": "N",
- "ñ": "n",
- "Ò": "O",
- "Ó": "O",
- "Ô": "O",
- "Õ": "O",
- "Ö": "O",
- "Ø": "O",
- "ò": "o",
- "ó": "o",
- "ô": "o",
- "õ": "o",
- "ö": "o",
- "ø": "o",
- "Ù": "U",
- "Ú": "U",
- "Û": "U",
- "Ü": "U",
- "ù": "u",
- "ú": "u",
- "û": "u",
- "ü": "u",
- "Ý": "Y",
- "ý": "y",
- "ÿ": "y",
- "Æ": "Ae",
- "æ": "ae",
- "Þ": "Th",
- "þ": "th",
- "ß": "ss",
- // Latin Extended-A block.
- "Ā": "A",
- "Ă": "A",
- "Ą": "A",
- "ā": "a",
- "ă": "a",
- "ą": "a",
- "Ć": "C",
- "Ĉ": "C",
- "Ċ": "C",
- "Č": "C",
- "ć": "c",
- "ĉ": "c",
- "ċ": "c",
- "č": "c",
- "Ď": "D",
- "Đ": "D",
- "ď": "d",
- "đ": "d",
- "Ē": "E",
- "Ĕ": "E",
- "Ė": "E",
- "Ę": "E",
- "Ě": "E",
- "ē": "e",
- "ĕ": "e",
- "ė": "e",
- "ę": "e",
- "ě": "e",
- "Ĝ": "G",
- "Ğ": "G",
- "Ġ": "G",
- "Ģ": "G",
- "ĝ": "g",
- "ğ": "g",
- "ġ": "g",
- "ģ": "g",
- "Ĥ": "H",
- "Ħ": "H",
- "ĥ": "h",
- "ħ": "h",
- "Ĩ": "I",
- "Ī": "I",
- "Ĭ": "I",
- "Į": "I",
- "İ": "I",
- "ĩ": "i",
- "ī": "i",
- "ĭ": "i",
- "į": "i",
- "ı": "i",
- "Ĵ": "J",
- "ĵ": "j",
- "Ķ": "K",
- "ķ": "k",
- "ĸ": "k",
- "Ĺ": "L",
- "Ļ": "L",
- "Ľ": "L",
- "Ŀ": "L",
- "Ł": "L",
- "ĺ": "l",
- "ļ": "l",
- "ľ": "l",
- "ŀ": "l",
- "ł": "l",
- "Ń": "N",
- "Ņ": "N",
- "Ň": "N",
- "Ŋ": "N",
- "ń": "n",
- "ņ": "n",
- "ň": "n",
- "ŋ": "n",
- "Ō": "O",
- "Ŏ": "O",
- "Ő": "O",
- "ō": "o",
- "ŏ": "o",
- "ő": "o",
- "Ŕ": "R",
- "Ŗ": "R",
- "Ř": "R",
- "ŕ": "r",
- "ŗ": "r",
- "ř": "r",
- "Ś": "S",
- "Ŝ": "S",
- "Ş": "S",
- "Š": "S",
- "ś": "s",
- "ŝ": "s",
- "ş": "s",
- "š": "s",
- "Ţ": "T",
- "Ť": "T",
- "Ŧ": "T",
- "ţ": "t",
- "ť": "t",
- "ŧ": "t",
- "Ũ": "U",
- "Ū": "U",
- "Ŭ": "U",
- "Ů": "U",
- "Ű": "U",
- "Ų": "U",
- "ũ": "u",
- "ū": "u",
- "ŭ": "u",
- "ů": "u",
- "ű": "u",
- "ų": "u",
- "Ŵ": "W",
- "ŵ": "w",
- "Ŷ": "Y",
- "ŷ": "y",
- "Ÿ": "Y",
- "Ź": "Z",
- "Ż": "Z",
- "Ž": "Z",
- "ź": "z",
- "ż": "z",
- "ž": "z",
- "IJ": "IJ",
- "ij": "ij",
- "Œ": "Oe",
- "œ": "oe",
- "ʼn": "'n",
- "ſ": "s"
- };
- var htmlEscapes = {
- "&": "&",
- "<": "<",
- ">": ">",
- '"': """,
- "'": "'"
- };
- var htmlUnescapes = {
- "&": "&",
- "<": "<",
- ">": ">",
- """: '"',
- "'": "'"
- };
- var stringEscapes = {
- "\\": "\\",
- "'": "'",
- "\n": "n",
- "\r": "r",
- "\u2028": "u2028",
- "\u2029": "u2029"
- };
- var freeParseFloat = parseFloat, freeParseInt = parseInt;
- var freeGlobal = typeof commonjsGlobal == "object" && commonjsGlobal && commonjsGlobal.Object === Object && commonjsGlobal;
- var freeSelf = typeof self == "object" && self && self.Object === Object && self;
- var root = freeGlobal || freeSelf || Function("return this")();
- var freeExports = exports && !exports.nodeType && exports;
- var freeModule = freeExports && true && module && !module.nodeType && module;
- var moduleExports = freeModule && freeModule.exports === freeExports;
- var freeProcess = moduleExports && freeGlobal.process;
- var nodeUtil = function() {
- try {
- var types = freeModule && freeModule.require && freeModule.require("util").types;
- if (types) {
- return types;
- }
- return freeProcess && freeProcess.binding && freeProcess.binding("util");
- } catch (e) {
- }
- }();
- var nodeIsArrayBuffer = nodeUtil && nodeUtil.isArrayBuffer, nodeIsDate = nodeUtil && nodeUtil.isDate, nodeIsMap = nodeUtil && nodeUtil.isMap, nodeIsRegExp = nodeUtil && nodeUtil.isRegExp, nodeIsSet = nodeUtil && nodeUtil.isSet, nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray;
- function apply(func, thisArg, args) {
- switch (args.length) {
- case 0:
- return func.call(thisArg);
- case 1:
- return func.call(thisArg, args[0]);
- case 2:
- return func.call(thisArg, args[0], args[1]);
- case 3:
- return func.call(thisArg, args[0], args[1], args[2]);
- }
- return func.apply(thisArg, args);
- }
- function arrayAggregator(array, setter, iteratee, accumulator) {
- var index = -1, length = array == null ? 0 : array.length;
- while (++index < length) {
- var value = array[index];
- setter(accumulator, value, iteratee(value), array);
- }
- return accumulator;
- }
- function arrayEach(array, iteratee) {
- var index = -1, length = array == null ? 0 : array.length;
- while (++index < length) {
- if (iteratee(array[index], index, array) === false) {
- break;
- }
- }
- return array;
- }
- function arrayEachRight(array, iteratee) {
- var length = array == null ? 0 : array.length;
- while (length--) {
- if (iteratee(array[length], length, array) === false) {
- break;
- }
- }
- return array;
- }
- function arrayEvery(array, predicate) {
- var index = -1, length = array == null ? 0 : array.length;
- while (++index < length) {
- if (!predicate(array[index], index, array)) {
- return false;
- }
- }
- return true;
- }
- function arrayFilter(array, predicate) {
- var index = -1, length = array == null ? 0 : array.length, resIndex = 0, result = [];
- while (++index < length) {
- var value = array[index];
- if (predicate(value, index, array)) {
- result[resIndex++] = value;
- }
- }
- return result;
- }
- function arrayIncludes(array, value) {
- var length = array == null ? 0 : array.length;
- return !!length && baseIndexOf(array, value, 0) > -1;
- }
- function arrayIncludesWith(array, value, comparator) {
- var index = -1, length = array == null ? 0 : array.length;
- while (++index < length) {
- if (comparator(value, array[index])) {
- return true;
- }
- }
- return false;
- }
- function arrayMap(array, iteratee) {
- var index = -1, length = array == null ? 0 : array.length, result = Array(length);
- while (++index < length) {
- result[index] = iteratee(array[index], index, array);
- }
- return result;
- }
- function arrayPush(array, values) {
- var index = -1, length = values.length, offset = array.length;
- while (++index < length) {
- array[offset + index] = values[index];
- }
- return array;
- }
- function arrayReduce(array, iteratee, accumulator, initAccum) {
- var index = -1, length = array == null ? 0 : array.length;
- if (initAccum && length) {
- accumulator = array[++index];
- }
- while (++index < length) {
- accumulator = iteratee(accumulator, array[index], index, array);
- }
- return accumulator;
- }
- function arrayReduceRight(array, iteratee, accumulator, initAccum) {
- var length = array == null ? 0 : array.length;
- if (initAccum && length) {
- accumulator = array[--length];
- }
- while (length--) {
- accumulator = iteratee(accumulator, array[length], length, array);
- }
- return accumulator;
- }
- function arraySome(array, predicate) {
- var index = -1, length = array == null ? 0 : array.length;
- while (++index < length) {
- if (predicate(array[index], index, array)) {
- return true;
- }
- }
- return false;
- }
- var asciiSize = baseProperty("length");
- function asciiToArray(string) {
- return string.split("");
- }
- function asciiWords(string) {
- return string.match(reAsciiWord) || [];
- }
- function baseFindKey(collection, predicate, eachFunc) {
- var result;
- eachFunc(collection, function(value, key, collection2) {
- if (predicate(value, key, collection2)) {
- result = key;
- return false;
- }
- });
- return result;
- }
- function baseFindIndex(array, predicate, fromIndex, fromRight) {
- var length = array.length, index = fromIndex + (fromRight ? 1 : -1);
- while (fromRight ? index-- : ++index < length) {
- if (predicate(array[index], index, array)) {
- return index;
- }
- }
- return -1;
- }
- function baseIndexOf(array, value, fromIndex) {
- return value === value ? strictIndexOf(array, value, fromIndex) : baseFindIndex(array, baseIsNaN, fromIndex);
- }
- function baseIndexOfWith(array, value, fromIndex, comparator) {
- var index = fromIndex - 1, length = array.length;
- while (++index < length) {
- if (comparator(array[index], value)) {
- return index;
- }
- }
- return -1;
- }
- function baseIsNaN(value) {
- return value !== value;
- }
- function baseMean(array, iteratee) {
- var length = array == null ? 0 : array.length;
- return length ? baseSum(array, iteratee) / length : NAN;
- }
- function baseProperty(key) {
- return function(object) {
- return object == null ? undefined$1 : object[key];
- };
- }
- function basePropertyOf(object) {
- return function(key) {
- return object == null ? undefined$1 : object[key];
- };
- }
- function baseReduce(collection, iteratee, accumulator, initAccum, eachFunc) {
- eachFunc(collection, function(value, index, collection2) {
- accumulator = initAccum ? (initAccum = false, value) : iteratee(accumulator, value, index, collection2);
- });
- return accumulator;
- }
- function baseSortBy(array, comparer) {
- var length = array.length;
- array.sort(comparer);
- while (length--) {
- array[length] = array[length].value;
- }
- return array;
- }
- function baseSum(array, iteratee) {
- var result, index = -1, length = array.length;
- while (++index < length) {
- var current = iteratee(array[index]);
- if (current !== undefined$1) {
- result = result === undefined$1 ? current : result + current;
- }
- }
- return result;
- }
- function baseTimes(n, iteratee) {
- var index = -1, result = Array(n);
- while (++index < n) {
- result[index] = iteratee(index);
- }
- return result;
- }
- function baseToPairs(object, props) {
- return arrayMap(props, function(key) {
- return [key, object[key]];
- });
- }
- function baseTrim(string) {
- return string ? string.slice(0, trimmedEndIndex(string) + 1).replace(reTrimStart, "") : string;
- }
- function baseUnary(func) {
- return function(value) {
- return func(value);
- };
- }
- function baseValues(object, props) {
- return arrayMap(props, function(key) {
- return object[key];
- });
- }
- function cacheHas(cache, key) {
- return cache.has(key);
- }
- function charsStartIndex(strSymbols, chrSymbols) {
- var index = -1, length = strSymbols.length;
- while (++index < length && baseIndexOf(chrSymbols, strSymbols[index], 0) > -1) {
- }
- return index;
- }
- function charsEndIndex(strSymbols, chrSymbols) {
- var index = strSymbols.length;
- while (index-- && baseIndexOf(chrSymbols, strSymbols[index], 0) > -1) {
- }
- return index;
- }
- function countHolders(array, placeholder) {
- var length = array.length, result = 0;
- while (length--) {
- if (array[length] === placeholder) {
- ++result;
- }
- }
- return result;
- }
- var deburrLetter = basePropertyOf(deburredLetters);
- var escapeHtmlChar = basePropertyOf(htmlEscapes);
- function escapeStringChar(chr) {
- return "\\" + stringEscapes[chr];
- }
- function getValue(object, key) {
- return object == null ? undefined$1 : object[key];
- }
- function hasUnicode(string) {
- return reHasUnicode.test(string);
- }
- function hasUnicodeWord(string) {
- return reHasUnicodeWord.test(string);
- }
- function iteratorToArray(iterator) {
- var data, result = [];
- while (!(data = iterator.next()).done) {
- result.push(data.value);
- }
- return result;
- }
- function mapToArray(map) {
- var index = -1, result = Array(map.size);
- map.forEach(function(value, key) {
- result[++index] = [key, value];
- });
- return result;
- }
- function overArg(func, transform) {
- return function(arg) {
- return func(transform(arg));
- };
- }
- function replaceHolders(array, placeholder) {
- var index = -1, length = array.length, resIndex = 0, result = [];
- while (++index < length) {
- var value = array[index];
- if (value === placeholder || value === PLACEHOLDER) {
- array[index] = PLACEHOLDER;
- result[resIndex++] = index;
- }
- }
- return result;
- }
- function setToArray(set) {
- var index = -1, result = Array(set.size);
- set.forEach(function(value) {
- result[++index] = value;
- });
- return result;
- }
- function setToPairs(set) {
- var index = -1, result = Array(set.size);
- set.forEach(function(value) {
- result[++index] = [value, value];
- });
- return result;
- }
- function strictIndexOf(array, value, fromIndex) {
- var index = fromIndex - 1, length = array.length;
- while (++index < length) {
- if (array[index] === value) {
- return index;
- }
- }
- return -1;
- }
- function strictLastIndexOf(array, value, fromIndex) {
- var index = fromIndex + 1;
- while (index--) {
- if (array[index] === value) {
- return index;
- }
- }
- return index;
- }
- function stringSize(string) {
- return hasUnicode(string) ? unicodeSize(string) : asciiSize(string);
- }
- function stringToArray(string) {
- return hasUnicode(string) ? unicodeToArray(string) : asciiToArray(string);
- }
- function trimmedEndIndex(string) {
- var index = string.length;
- while (index-- && reWhitespace.test(string.charAt(index))) {
- }
- return index;
- }
- var unescapeHtmlChar = basePropertyOf(htmlUnescapes);
- function unicodeSize(string) {
- var result = reUnicode.lastIndex = 0;
- while (reUnicode.test(string)) {
- ++result;
- }
- return result;
- }
- function unicodeToArray(string) {
- return string.match(reUnicode) || [];
- }
- function unicodeWords(string) {
- return string.match(reUnicodeWord) || [];
- }
- var runInContext = function runInContext2(context) {
- context = context == null ? root : _.defaults(root.Object(), context, _.pick(root, contextProps));
- var Array2 = context.Array, Date2 = context.Date, Error2 = context.Error, Function2 = context.Function, Math2 = context.Math, Object2 = context.Object, RegExp2 = context.RegExp, String2 = context.String, TypeError2 = context.TypeError;
- var arrayProto = Array2.prototype, funcProto = Function2.prototype, objectProto = Object2.prototype;
- var coreJsData = context["__core-js_shared__"];
- var funcToString = funcProto.toString;
- var hasOwnProperty = objectProto.hasOwnProperty;
- var idCounter = 0;
- var maskSrcKey = function() {
- var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || "");
- return uid ? "Symbol(src)_1." + uid : "";
- }();
- var nativeObjectToString = objectProto.toString;
- var objectCtorString = funcToString.call(Object2);
- var oldDash = root._;
- var reIsNative = RegExp2(
- "^" + funcToString.call(hasOwnProperty).replace(reRegExpChar, "\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, "$1.*?") + "$"
- );
- var Buffer2 = moduleExports ? context.Buffer : undefined$1, Symbol2 = context.Symbol, Uint8Array2 = context.Uint8Array, allocUnsafe = Buffer2 ? Buffer2.allocUnsafe : undefined$1, getPrototype = overArg(Object2.getPrototypeOf, Object2), objectCreate = Object2.create, propertyIsEnumerable = objectProto.propertyIsEnumerable, splice = arrayProto.splice, spreadableSymbol = Symbol2 ? Symbol2.isConcatSpreadable : undefined$1, symIterator = Symbol2 ? Symbol2.iterator : undefined$1, symToStringTag = Symbol2 ? Symbol2.toStringTag : undefined$1;
- var defineProperty = function() {
- try {
- var func = getNative(Object2, "defineProperty");
- func({}, "", {});
- return func;
- } catch (e) {
- }
- }();
- var ctxClearTimeout = context.clearTimeout !== root.clearTimeout && context.clearTimeout, ctxNow = Date2 && Date2.now !== root.Date.now && Date2.now, ctxSetTimeout = context.setTimeout !== root.setTimeout && context.setTimeout;
- var nativeCeil = Math2.ceil, nativeFloor = Math2.floor, nativeGetSymbols = Object2.getOwnPropertySymbols, nativeIsBuffer = Buffer2 ? Buffer2.isBuffer : undefined$1, nativeIsFinite = context.isFinite, nativeJoin = arrayProto.join, nativeKeys = overArg(Object2.keys, Object2), nativeMax = Math2.max, nativeMin = Math2.min, nativeNow = Date2.now, nativeParseInt = context.parseInt, nativeRandom = Math2.random, nativeReverse = arrayProto.reverse;
- var DataView = getNative(context, "DataView"), Map = getNative(context, "Map"), Promise2 = getNative(context, "Promise"), Set = getNative(context, "Set"), WeakMap = getNative(context, "WeakMap"), nativeCreate = getNative(Object2, "create");
- var metaMap = WeakMap && new WeakMap();
- var realNames = {};
- var dataViewCtorString = toSource(DataView), mapCtorString = toSource(Map), promiseCtorString = toSource(Promise2), setCtorString = toSource(Set), weakMapCtorString = toSource(WeakMap);
- var symbolProto = Symbol2 ? Symbol2.prototype : undefined$1, symbolValueOf = symbolProto ? symbolProto.valueOf : undefined$1, symbolToString = symbolProto ? symbolProto.toString : undefined$1;
- function lodash2(value) {
- if (isObjectLike(value) && !isArray(value) && !(value instanceof LazyWrapper)) {
- if (value instanceof LodashWrapper) {
- return value;
- }
- if (hasOwnProperty.call(value, "__wrapped__")) {
- return wrapperClone(value);
- }
- }
- return new LodashWrapper(value);
- }
- var baseCreate = function() {
- function object() {
- }
- return function(proto) {
- if (!isObject(proto)) {
- return {};
- }
- if (objectCreate) {
- return objectCreate(proto);
- }
- object.prototype = proto;
- var result2 = new object();
- object.prototype = undefined$1;
- return result2;
- };
- }();
- function baseLodash() {
- }
- function LodashWrapper(value, chainAll) {
- this.__wrapped__ = value;
- this.__actions__ = [];
- this.__chain__ = !!chainAll;
- this.__index__ = 0;
- this.__values__ = undefined$1;
- }
- lodash2.templateSettings = {
- /**
- * Used to detect `data` property values to be HTML-escaped.
- *
- * @memberOf _.templateSettings
- * @type {RegExp}
- */
- "escape": reEscape,
- /**
- * Used to detect code to be evaluated.
- *
- * @memberOf _.templateSettings
- * @type {RegExp}
- */
- "evaluate": reEvaluate,
- /**
- * Used to detect `data` property values to inject.
- *
- * @memberOf _.templateSettings
- * @type {RegExp}
- */
- "interpolate": reInterpolate,
- /**
- * Used to reference the data object in the template text.
- *
- * @memberOf _.templateSettings
- * @type {string}
- */
- "variable": "",
- /**
- * Used to import variables into the compiled template.
- *
- * @memberOf _.templateSettings
- * @type {Object}
- */
- "imports": {
- /**
- * A reference to the `lodash` function.
- *
- * @memberOf _.templateSettings.imports
- * @type {Function}
- */
- "_": lodash2
- }
- };
- lodash2.prototype = baseLodash.prototype;
- lodash2.prototype.constructor = lodash2;
- LodashWrapper.prototype = baseCreate(baseLodash.prototype);
- LodashWrapper.prototype.constructor = LodashWrapper;
- function LazyWrapper(value) {
- this.__wrapped__ = value;
- this.__actions__ = [];
- this.__dir__ = 1;
- this.__filtered__ = false;
- this.__iteratees__ = [];
- this.__takeCount__ = MAX_ARRAY_LENGTH;
- this.__views__ = [];
- }
- function lazyClone() {
- var result2 = new LazyWrapper(this.__wrapped__);
- result2.__actions__ = copyArray(this.__actions__);
- result2.__dir__ = this.__dir__;
- result2.__filtered__ = this.__filtered__;
- result2.__iteratees__ = copyArray(this.__iteratees__);
- result2.__takeCount__ = this.__takeCount__;
- result2.__views__ = copyArray(this.__views__);
- return result2;
- }
- function lazyReverse() {
- if (this.__filtered__) {
- var result2 = new LazyWrapper(this);
- result2.__dir__ = -1;
- result2.__filtered__ = true;
- } else {
- result2 = this.clone();
- result2.__dir__ *= -1;
- }
- return result2;
- }
- function lazyValue() {
- var array = this.__wrapped__.value(), dir = this.__dir__, isArr = isArray(array), isRight = dir < 0, arrLength = isArr ? array.length : 0, view = getView(0, arrLength, this.__views__), start = view.start, end = view.end, length = end - start, index = isRight ? end : start - 1, iteratees = this.__iteratees__, iterLength = iteratees.length, resIndex = 0, takeCount = nativeMin(length, this.__takeCount__);
- if (!isArr || !isRight && arrLength == length && takeCount == length) {
- return baseWrapperValue(array, this.__actions__);
- }
- var result2 = [];
- outer:
- while (length-- && resIndex < takeCount) {
- index += dir;
- var iterIndex = -1, value = array[index];
- while (++iterIndex < iterLength) {
- var data = iteratees[iterIndex], iteratee2 = data.iteratee, type = data.type, computed = iteratee2(value);
- if (type == LAZY_MAP_FLAG) {
- value = computed;
- } else if (!computed) {
- if (type == LAZY_FILTER_FLAG) {
- continue outer;
- } else {
- break outer;
- }
- }
- }
- result2[resIndex++] = value;
- }
- return result2;
- }
- LazyWrapper.prototype = baseCreate(baseLodash.prototype);
- LazyWrapper.prototype.constructor = LazyWrapper;
- function Hash(entries) {
- var index = -1, length = entries == null ? 0 : entries.length;
- this.clear();
- while (++index < length) {
- var entry = entries[index];
- this.set(entry[0], entry[1]);
- }
- }
- function hashClear() {
- this.__data__ = nativeCreate ? nativeCreate(null) : {};
- this.size = 0;
- }
- function hashDelete(key) {
- var result2 = this.has(key) && delete this.__data__[key];
- this.size -= result2 ? 1 : 0;
- return result2;
- }
- function hashGet(key) {
- var data = this.__data__;
- if (nativeCreate) {
- var result2 = data[key];
- return result2 === HASH_UNDEFINED ? undefined$1 : result2;
- }
- return hasOwnProperty.call(data, key) ? data[key] : undefined$1;
- }
- function hashHas(key) {
- var data = this.__data__;
- return nativeCreate ? data[key] !== undefined$1 : hasOwnProperty.call(data, key);
- }
- function hashSet(key, value) {
- var data = this.__data__;
- this.size += this.has(key) ? 0 : 1;
- data[key] = nativeCreate && value === undefined$1 ? HASH_UNDEFINED : value;
- return this;
- }
- Hash.prototype.clear = hashClear;
- Hash.prototype["delete"] = hashDelete;
- Hash.prototype.get = hashGet;
- Hash.prototype.has = hashHas;
- Hash.prototype.set = hashSet;
- function ListCache(entries) {
- var index = -1, length = entries == null ? 0 : entries.length;
- this.clear();
- while (++index < length) {
- var entry = entries[index];
- this.set(entry[0], entry[1]);
- }
- }
- function listCacheClear() {
- this.__data__ = [];
- this.size = 0;
- }
- function listCacheDelete(key) {
- var data = this.__data__, index = assocIndexOf(data, key);
- if (index < 0) {
- return false;
- }
- var lastIndex = data.length - 1;
- if (index == lastIndex) {
- data.pop();
- } else {
- splice.call(data, index, 1);
- }
- --this.size;
- return true;
- }
- function listCacheGet(key) {
- var data = this.__data__, index = assocIndexOf(data, key);
- return index < 0 ? undefined$1 : data[index][1];
- }
- function listCacheHas(key) {
- return assocIndexOf(this.__data__, key) > -1;
- }
- function listCacheSet(key, value) {
- var data = this.__data__, index = assocIndexOf(data, key);
- if (index < 0) {
- ++this.size;
- data.push([key, value]);
- } else {
- data[index][1] = value;
- }
- return this;
- }
- ListCache.prototype.clear = listCacheClear;
- ListCache.prototype["delete"] = listCacheDelete;
- ListCache.prototype.get = listCacheGet;
- ListCache.prototype.has = listCacheHas;
- ListCache.prototype.set = listCacheSet;
- function MapCache(entries) {
- var index = -1, length = entries == null ? 0 : entries.length;
- this.clear();
- while (++index < length) {
- var entry = entries[index];
- this.set(entry[0], entry[1]);
- }
- }
- function mapCacheClear() {
- this.size = 0;
- this.__data__ = {
- "hash": new Hash(),
- "map": new (Map || ListCache)(),
- "string": new Hash()
- };
- }
- function mapCacheDelete(key) {
- var result2 = getMapData(this, key)["delete"](key);
- this.size -= result2 ? 1 : 0;
- return result2;
- }
- function mapCacheGet(key) {
- return getMapData(this, key).get(key);
- }
- function mapCacheHas(key) {
- return getMapData(this, key).has(key);
- }
- function mapCacheSet(key, value) {
- var data = getMapData(this, key), size2 = data.size;
- data.set(key, value);
- this.size += data.size == size2 ? 0 : 1;
- return this;
- }
- MapCache.prototype.clear = mapCacheClear;
- MapCache.prototype["delete"] = mapCacheDelete;
- MapCache.prototype.get = mapCacheGet;
- MapCache.prototype.has = mapCacheHas;
- MapCache.prototype.set = mapCacheSet;
- function SetCache(values2) {
- var index = -1, length = values2 == null ? 0 : values2.length;
- this.__data__ = new MapCache();
- while (++index < length) {
- this.add(values2[index]);
- }
- }
- function setCacheAdd(value) {
- this.__data__.set(value, HASH_UNDEFINED);
- return this;
- }
- function setCacheHas(value) {
- return this.__data__.has(value);
- }
- SetCache.prototype.add = SetCache.prototype.push = setCacheAdd;
- SetCache.prototype.has = setCacheHas;
- function Stack(entries) {
- var data = this.__data__ = new ListCache(entries);
- this.size = data.size;
- }
- function stackClear() {
- this.__data__ = new ListCache();
- this.size = 0;
- }
- function stackDelete(key) {
- var data = this.__data__, result2 = data["delete"](key);
- this.size = data.size;
- return result2;
- }
- function stackGet(key) {
- return this.__data__.get(key);
- }
- function stackHas(key) {
- return this.__data__.has(key);
- }
- function stackSet(key, value) {
- var data = this.__data__;
- if (data instanceof ListCache) {
- var pairs = data.__data__;
- if (!Map || pairs.length < LARGE_ARRAY_SIZE - 1) {
- pairs.push([key, value]);
- this.size = ++data.size;
- return this;
- }
- data = this.__data__ = new MapCache(pairs);
- }
- data.set(key, value);
- this.size = data.size;
- return this;
- }
- Stack.prototype.clear = stackClear;
- Stack.prototype["delete"] = stackDelete;
- Stack.prototype.get = stackGet;
- Stack.prototype.has = stackHas;
- Stack.prototype.set = stackSet;
- function arrayLikeKeys(value, inherited) {
- var isArr = isArray(value), isArg = !isArr && isArguments(value), isBuff = !isArr && !isArg && isBuffer(value), isType = !isArr && !isArg && !isBuff && isTypedArray(value), skipIndexes = isArr || isArg || isBuff || isType, result2 = skipIndexes ? baseTimes(value.length, String2) : [], length = result2.length;
- for (var key in value) {
- if ((inherited || hasOwnProperty.call(value, key)) && !(skipIndexes && // Safari 9 has enumerable `arguments.length` in strict mode.
- (key == "length" || // Node.js 0.10 has enumerable non-index properties on buffers.
- isBuff && (key == "offset" || key == "parent") || // PhantomJS 2 has enumerable non-index properties on typed arrays.
- isType && (key == "buffer" || key == "byteLength" || key == "byteOffset") || // Skip index properties.
- isIndex(key, length)))) {
- result2.push(key);
- }
- }
- return result2;
- }
- function arraySample(array) {
- var length = array.length;
- return length ? array[baseRandom(0, length - 1)] : undefined$1;
- }
- function arraySampleSize(array, n) {
- return shuffleSelf(copyArray(array), baseClamp(n, 0, array.length));
- }
- function arrayShuffle(array) {
- return shuffleSelf(copyArray(array));
- }
- function assignMergeValue(object, key, value) {
- if (value !== undefined$1 && !eq(object[key], value) || value === undefined$1 && !(key in object)) {
- baseAssignValue(object, key, value);
- }
- }
- function assignValue(object, key, value) {
- var objValue = object[key];
- if (!(hasOwnProperty.call(object, key) && eq(objValue, value)) || value === undefined$1 && !(key in object)) {
- baseAssignValue(object, key, value);
- }
- }
- function assocIndexOf(array, key) {
- var length = array.length;
- while (length--) {
- if (eq(array[length][0], key)) {
- return length;
- }
- }
- return -1;
- }
- function baseAggregator(collection, setter, iteratee2, accumulator) {
- baseEach(collection, function(value, key, collection2) {
- setter(accumulator, value, iteratee2(value), collection2);
- });
- return accumulator;
- }
- function baseAssign(object, source) {
- return object && copyObject(source, keys(source), object);
- }
- function baseAssignIn(object, source) {
- return object && copyObject(source, keysIn(source), object);
- }
- function baseAssignValue(object, key, value) {
- if (key == "__proto__" && defineProperty) {
- defineProperty(object, key, {
- "configurable": true,
- "enumerable": true,
- "value": value,
- "writable": true
- });
- } else {
- object[key] = value;
- }
- }
- function baseAt(object, paths) {
- var index = -1, length = paths.length, result2 = Array2(length), skip = object == null;
- while (++index < length) {
- result2[index] = skip ? undefined$1 : get(object, paths[index]);
- }
- return result2;
- }
- function baseClamp(number, lower, upper) {
- if (number === number) {
- if (upper !== undefined$1) {
- number = number <= upper ? number : upper;
- }
- if (lower !== undefined$1) {
- number = number >= lower ? number : lower;
- }
- }
- return number;
- }
- function baseClone(value, bitmask, customizer, key, object, stack) {
- var result2, isDeep = bitmask & CLONE_DEEP_FLAG, isFlat = bitmask & CLONE_FLAT_FLAG, isFull = bitmask & CLONE_SYMBOLS_FLAG;
- if (customizer) {
- result2 = object ? customizer(value, key, object, stack) : customizer(value);
- }
- if (result2 !== undefined$1) {
- return result2;
- }
- if (!isObject(value)) {
- return value;
- }
- var isArr = isArray(value);
- if (isArr) {
- result2 = initCloneArray(value);
- if (!isDeep) {
- return copyArray(value, result2);
- }
- } else {
- var tag = getTag(value), isFunc = tag == funcTag || tag == genTag;
- if (isBuffer(value)) {
- return cloneBuffer(value, isDeep);
- }
- if (tag == objectTag || tag == argsTag || isFunc && !object) {
- result2 = isFlat || isFunc ? {} : initCloneObject(value);
- if (!isDeep) {
- return isFlat ? copySymbolsIn(value, baseAssignIn(result2, value)) : copySymbols(value, baseAssign(result2, value));
- }
- } else {
- if (!cloneableTags[tag]) {
- return object ? value : {};
- }
- result2 = initCloneByTag(value, tag, isDeep);
- }
- }
- stack || (stack = new Stack());
- var stacked = stack.get(value);
- if (stacked) {
- return stacked;
- }
- stack.set(value, result2);
- if (isSet(value)) {
- value.forEach(function(subValue) {
- result2.add(baseClone(subValue, bitmask, customizer, subValue, value, stack));
- });
- } else if (isMap(value)) {
- value.forEach(function(subValue, key2) {
- result2.set(key2, baseClone(subValue, bitmask, customizer, key2, value, stack));
- });
- }
- var keysFunc = isFull ? isFlat ? getAllKeysIn : getAllKeys : isFlat ? keysIn : keys;
- var props = isArr ? undefined$1 : keysFunc(value);
- arrayEach(props || value, function(subValue, key2) {
- if (props) {
- key2 = subValue;
- subValue = value[key2];
- }
- assignValue(result2, key2, baseClone(subValue, bitmask, customizer, key2, value, stack));
- });
- return result2;
- }
- function baseConforms(source) {
- var props = keys(source);
- return function(object) {
- return baseConformsTo(object, source, props);
- };
- }
- function baseConformsTo(object, source, props) {
- var length = props.length;
- if (object == null) {
- return !length;
- }
- object = Object2(object);
- while (length--) {
- var key = props[length], predicate = source[key], value = object[key];
- if (value === undefined$1 && !(key in object) || !predicate(value)) {
- return false;
- }
- }
- return true;
- }
- function baseDelay(func, wait, args) {
- if (typeof func != "function") {
- throw new TypeError2(FUNC_ERROR_TEXT);
- }
- return setTimeout(function() {
- func.apply(undefined$1, args);
- }, wait);
- }
- function baseDifference(array, values2, iteratee2, comparator) {
- var index = -1, includes2 = arrayIncludes, isCommon = true, length = array.length, result2 = [], valuesLength = values2.length;
- if (!length) {
- return result2;
- }
- if (iteratee2) {
- values2 = arrayMap(values2, baseUnary(iteratee2));
- }
- if (comparator) {
- includes2 = arrayIncludesWith;
- isCommon = false;
- } else if (values2.length >= LARGE_ARRAY_SIZE) {
- includes2 = cacheHas;
- isCommon = false;
- values2 = new SetCache(values2);
- }
- outer:
- while (++index < length) {
- var value = array[index], computed = iteratee2 == null ? value : iteratee2(value);
- value = comparator || value !== 0 ? value : 0;
- if (isCommon && computed === computed) {
- var valuesIndex = valuesLength;
- while (valuesIndex--) {
- if (values2[valuesIndex] === computed) {
- continue outer;
- }
- }
- result2.push(value);
- } else if (!includes2(values2, computed, comparator)) {
- result2.push(value);
- }
- }
- return result2;
- }
- var baseEach = createBaseEach(baseForOwn);
- var baseEachRight = createBaseEach(baseForOwnRight, true);
- function baseEvery(collection, predicate) {
- var result2 = true;
- baseEach(collection, function(value, index, collection2) {
- result2 = !!predicate(value, index, collection2);
- return result2;
- });
- return result2;
- }
- function baseExtremum(array, iteratee2, comparator) {
- var index = -1, length = array.length;
- while (++index < length) {
- var value = array[index], current = iteratee2(value);
- if (current != null && (computed === undefined$1 ? current === current && !isSymbol(current) : comparator(current, computed))) {
- var computed = current, result2 = value;
- }
- }
- return result2;
- }
- function baseFill(array, value, start, end) {
- var length = array.length;
- start = toInteger(start);
- if (start < 0) {
- start = -start > length ? 0 : length + start;
- }
- end = end === undefined$1 || end > length ? length : toInteger(end);
- if (end < 0) {
- end += length;
- }
- end = start > end ? 0 : toLength(end);
- while (start < end) {
- array[start++] = value;
- }
- return array;
- }
- function baseFilter(collection, predicate) {
- var result2 = [];
- baseEach(collection, function(value, index, collection2) {
- if (predicate(value, index, collection2)) {
- result2.push(value);
- }
- });
- return result2;
- }
- function baseFlatten(array, depth, predicate, isStrict, result2) {
- var index = -1, length = array.length;
- predicate || (predicate = isFlattenable);
- result2 || (result2 = []);
- while (++index < length) {
- var value = array[index];
- if (depth > 0 && predicate(value)) {
- if (depth > 1) {
- baseFlatten(value, depth - 1, predicate, isStrict, result2);
- } else {
- arrayPush(result2, value);
- }
- } else if (!isStrict) {
- result2[result2.length] = value;
- }
- }
- return result2;
- }
- var baseFor = createBaseFor();
- var baseForRight = createBaseFor(true);
- function baseForOwn(object, iteratee2) {
- return object && baseFor(object, iteratee2, keys);
- }
- function baseForOwnRight(object, iteratee2) {
- return object && baseForRight(object, iteratee2, keys);
- }
- function baseFunctions(object, props) {
- return arrayFilter(props, function(key) {
- return isFunction(object[key]);
- });
- }
- function baseGet(object, path) {
- path = castPath(path, object);
- var index = 0, length = path.length;
- while (object != null && index < length) {
- object = object[toKey(path[index++])];
- }
- return index && index == length ? object : undefined$1;
- }
- function baseGetAllKeys(object, keysFunc, symbolsFunc) {
- var result2 = keysFunc(object);
- return isArray(object) ? result2 : arrayPush(result2, symbolsFunc(object));
- }
- function baseGetTag(value) {
- if (value == null) {
- return value === undefined$1 ? undefinedTag : nullTag;
- }
- return symToStringTag && symToStringTag in Object2(value) ? getRawTag(value) : objectToString(value);
- }
- function baseGt(value, other) {
- return value > other;
- }
- function baseHas(object, key) {
- return object != null && hasOwnProperty.call(object, key);
- }
- function baseHasIn(object, key) {
- return object != null && key in Object2(object);
- }
- function baseInRange(number, start, end) {
- return number >= nativeMin(start, end) && number < nativeMax(start, end);
- }
- function baseIntersection(arrays, iteratee2, comparator) {
- var includes2 = comparator ? arrayIncludesWith : arrayIncludes, length = arrays[0].length, othLength = arrays.length, othIndex = othLength, caches = Array2(othLength), maxLength = Infinity, result2 = [];
- while (othIndex--) {
- var array = arrays[othIndex];
- if (othIndex && iteratee2) {
- array = arrayMap(array, baseUnary(iteratee2));
- }
- maxLength = nativeMin(array.length, maxLength);
- caches[othIndex] = !comparator && (iteratee2 || length >= 120 && array.length >= 120) ? new SetCache(othIndex && array) : undefined$1;
- }
- array = arrays[0];
- var index = -1, seen = caches[0];
- outer:
- while (++index < length && result2.length < maxLength) {
- var value = array[index], computed = iteratee2 ? iteratee2(value) : value;
- value = comparator || value !== 0 ? value : 0;
- if (!(seen ? cacheHas(seen, computed) : includes2(result2, computed, comparator))) {
- othIndex = othLength;
- while (--othIndex) {
- var cache = caches[othIndex];
- if (!(cache ? cacheHas(cache, computed) : includes2(arrays[othIndex], computed, comparator))) {
- continue outer;
- }
- }
- if (seen) {
- seen.push(computed);
- }
- result2.push(value);
- }
- }
- return result2;
- }
- function baseInverter(object, setter, iteratee2, accumulator) {
- baseForOwn(object, function(value, key, object2) {
- setter(accumulator, iteratee2(value), key, object2);
- });
- return accumulator;
- }
- function baseInvoke(object, path, args) {
- path = castPath(path, object);
- object = parent(object, path);
- var func = object == null ? object : object[toKey(last(path))];
- return func == null ? undefined$1 : apply(func, object, args);
- }
- function baseIsArguments(value) {
- return isObjectLike(value) && baseGetTag(value) == argsTag;
- }
- function baseIsArrayBuffer(value) {
- return isObjectLike(value) && baseGetTag(value) == arrayBufferTag;
- }
- function baseIsDate(value) {
- return isObjectLike(value) && baseGetTag(value) == dateTag;
- }
- function baseIsEqual(value, other, bitmask, customizer, stack) {
- if (value === other) {
- return true;
- }
- if (value == null || other == null || !isObjectLike(value) && !isObjectLike(other)) {
- return value !== value && other !== other;
- }
- return baseIsEqualDeep(value, other, bitmask, customizer, baseIsEqual, stack);
- }
- function baseIsEqualDeep(object, other, bitmask, customizer, equalFunc, stack) {
- var objIsArr = isArray(object), othIsArr = isArray(other), objTag = objIsArr ? arrayTag : getTag(object), othTag = othIsArr ? arrayTag : getTag(other);
- objTag = objTag == argsTag ? objectTag : objTag;
- othTag = othTag == argsTag ? objectTag : othTag;
- var objIsObj = objTag == objectTag, othIsObj = othTag == objectTag, isSameTag = objTag == othTag;
- if (isSameTag && isBuffer(object)) {
- if (!isBuffer(other)) {
- return false;
- }
- objIsArr = true;
- objIsObj = false;
- }
- if (isSameTag && !objIsObj) {
- stack || (stack = new Stack());
- return objIsArr || isTypedArray(object) ? equalArrays(object, other, bitmask, customizer, equalFunc, stack) : equalByTag(object, other, objTag, bitmask, customizer, equalFunc, stack);
- }
- if (!(bitmask & COMPARE_PARTIAL_FLAG)) {
- var objIsWrapped = objIsObj && hasOwnProperty.call(object, "__wrapped__"), othIsWrapped = othIsObj && hasOwnProperty.call(other, "__wrapped__");
- if (objIsWrapped || othIsWrapped) {
- var objUnwrapped = objIsWrapped ? object.value() : object, othUnwrapped = othIsWrapped ? other.value() : other;
- stack || (stack = new Stack());
- return equalFunc(objUnwrapped, othUnwrapped, bitmask, customizer, stack);
- }
- }
- if (!isSameTag) {
- return false;
- }
- stack || (stack = new Stack());
- return equalObjects(object, other, bitmask, customizer, equalFunc, stack);
- }
- function baseIsMap(value) {
- return isObjectLike(value) && getTag(value) == mapTag;
- }
- function baseIsMatch(object, source, matchData, customizer) {
- var index = matchData.length, length = index, noCustomizer = !customizer;
- if (object == null) {
- return !length;
- }
- object = Object2(object);
- while (index--) {
- var data = matchData[index];
- if (noCustomizer && data[2] ? data[1] !== object[data[0]] : !(data[0] in object)) {
- return false;
- }
- }
- while (++index < length) {
- data = matchData[index];
- var key = data[0], objValue = object[key], srcValue = data[1];
- if (noCustomizer && data[2]) {
- if (objValue === undefined$1 && !(key in object)) {
- return false;
- }
- } else {
- var stack = new Stack();
- if (customizer) {
- var result2 = customizer(objValue, srcValue, key, object, source, stack);
- }
- if (!(result2 === undefined$1 ? baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG, customizer, stack) : result2)) {
- return false;
- }
- }
- }
- return true;
- }
- function baseIsNative(value) {
- if (!isObject(value) || isMasked(value)) {
- return false;
- }
- var pattern = isFunction(value) ? reIsNative : reIsHostCtor;
- return pattern.test(toSource(value));
- }
- function baseIsRegExp(value) {
- return isObjectLike(value) && baseGetTag(value) == regexpTag;
- }
- function baseIsSet(value) {
- return isObjectLike(value) && getTag(value) == setTag;
- }
- function baseIsTypedArray(value) {
- return isObjectLike(value) && isLength(value.length) && !!typedArrayTags[baseGetTag(value)];
- }
- function baseIteratee(value) {
- if (typeof value == "function") {
- return value;
- }
- if (value == null) {
- return identity;
- }
- if (typeof value == "object") {
- return isArray(value) ? baseMatchesProperty(value[0], value[1]) : baseMatches(value);
- }
- return property(value);
- }
- function baseKeys(object) {
- if (!isPrototype(object)) {
- return nativeKeys(object);
- }
- var result2 = [];
- for (var key in Object2(object)) {
- if (hasOwnProperty.call(object, key) && key != "constructor") {
- result2.push(key);
- }
- }
- return result2;
- }
- function baseKeysIn(object) {
- if (!isObject(object)) {
- return nativeKeysIn(object);
- }
- var isProto = isPrototype(object), result2 = [];
- for (var key in object) {
- if (!(key == "constructor" && (isProto || !hasOwnProperty.call(object, key)))) {
- result2.push(key);
- }
- }
- return result2;
- }
- function baseLt(value, other) {
- return value < other;
- }
- function baseMap(collection, iteratee2) {
- var index = -1, result2 = isArrayLike(collection) ? Array2(collection.length) : [];
- baseEach(collection, function(value, key, collection2) {
- result2[++index] = iteratee2(value, key, collection2);
- });
- return result2;
- }
- function baseMatches(source) {
- var matchData = getMatchData(source);
- if (matchData.length == 1 && matchData[0][2]) {
- return matchesStrictComparable(matchData[0][0], matchData[0][1]);
- }
- return function(object) {
- return object === source || baseIsMatch(object, source, matchData);
- };
- }
- function baseMatchesProperty(path, srcValue) {
- if (isKey(path) && isStrictComparable(srcValue)) {
- return matchesStrictComparable(toKey(path), srcValue);
- }
- return function(object) {
- var objValue = get(object, path);
- return objValue === undefined$1 && objValue === srcValue ? hasIn(object, path) : baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG);
- };
- }
- function baseMerge(object, source, srcIndex, customizer, stack) {
- if (object === source) {
- return;
- }
- baseFor(source, function(srcValue, key) {
- stack || (stack = new Stack());
- if (isObject(srcValue)) {
- baseMergeDeep(object, source, key, srcIndex, baseMerge, customizer, stack);
- } else {
- var newValue = customizer ? customizer(safeGet(object, key), srcValue, key + "", object, source, stack) : undefined$1;
- if (newValue === undefined$1) {
- newValue = srcValue;
- }
- assignMergeValue(object, key, newValue);
- }
- }, keysIn);
- }
- function baseMergeDeep(object, source, key, srcIndex, mergeFunc, customizer, stack) {
- var objValue = safeGet(object, key), srcValue = safeGet(source, key), stacked = stack.get(srcValue);
- if (stacked) {
- assignMergeValue(object, key, stacked);
- return;
- }
- var newValue = customizer ? customizer(objValue, srcValue, key + "", object, source, stack) : undefined$1;
- var isCommon = newValue === undefined$1;
- if (isCommon) {
- var isArr = isArray(srcValue), isBuff = !isArr && isBuffer(srcValue), isTyped = !isArr && !isBuff && isTypedArray(srcValue);
- newValue = srcValue;
- if (isArr || isBuff || isTyped) {
- if (isArray(objValue)) {
- newValue = objValue;
- } else if (isArrayLikeObject(objValue)) {
- newValue = copyArray(objValue);
- } else if (isBuff) {
- isCommon = false;
- newValue = cloneBuffer(srcValue, true);
- } else if (isTyped) {
- isCommon = false;
- newValue = cloneTypedArray(srcValue, true);
- } else {
- newValue = [];
- }
- } else if (isPlainObject(srcValue) || isArguments(srcValue)) {
- newValue = objValue;
- if (isArguments(objValue)) {
- newValue = toPlainObject(objValue);
- } else if (!isObject(objValue) || isFunction(objValue)) {
- newValue = initCloneObject(srcValue);
- }
- } else {
- isCommon = false;
- }
- }
- if (isCommon) {
- stack.set(srcValue, newValue);
- mergeFunc(newValue, srcValue, srcIndex, customizer, stack);
- stack["delete"](srcValue);
- }
- assignMergeValue(object, key, newValue);
- }
- function baseNth(array, n) {
- var length = array.length;
- if (!length) {
- return;
- }
- n += n < 0 ? length : 0;
- return isIndex(n, length) ? array[n] : undefined$1;
- }
- function baseOrderBy(collection, iteratees, orders) {
- if (iteratees.length) {
- iteratees = arrayMap(iteratees, function(iteratee2) {
- if (isArray(iteratee2)) {
- return function(value) {
- return baseGet(value, iteratee2.length === 1 ? iteratee2[0] : iteratee2);
- };
- }
- return iteratee2;
- });
- } else {
- iteratees = [identity];
- }
- var index = -1;
- iteratees = arrayMap(iteratees, baseUnary(getIteratee()));
- var result2 = baseMap(collection, function(value, key, collection2) {
- var criteria = arrayMap(iteratees, function(iteratee2) {
- return iteratee2(value);
- });
- return { "criteria": criteria, "index": ++index, "value": value };
- });
- return baseSortBy(result2, function(object, other) {
- return compareMultiple(object, other, orders);
- });
- }
- function basePick(object, paths) {
- return basePickBy(object, paths, function(value, path) {
- return hasIn(object, path);
- });
- }
- function basePickBy(object, paths, predicate) {
- var index = -1, length = paths.length, result2 = {};
- while (++index < length) {
- var path = paths[index], value = baseGet(object, path);
- if (predicate(value, path)) {
- baseSet(result2, castPath(path, object), value);
- }
- }
- return result2;
- }
- function basePropertyDeep(path) {
- return function(object) {
- return baseGet(object, path);
- };
- }
- function basePullAll(array, values2, iteratee2, comparator) {
- var indexOf2 = comparator ? baseIndexOfWith : baseIndexOf, index = -1, length = values2.length, seen = array;
- if (array === values2) {
- values2 = copyArray(values2);
- }
- if (iteratee2) {
- seen = arrayMap(array, baseUnary(iteratee2));
- }
- while (++index < length) {
- var fromIndex = 0, value = values2[index], computed = iteratee2 ? iteratee2(value) : value;
- while ((fromIndex = indexOf2(seen, computed, fromIndex, comparator)) > -1) {
- if (seen !== array) {
- splice.call(seen, fromIndex, 1);
- }
- splice.call(array, fromIndex, 1);
- }
- }
- return array;
- }
- function basePullAt(array, indexes) {
- var length = array ? indexes.length : 0, lastIndex = length - 1;
- while (length--) {
- var index = indexes[length];
- if (length == lastIndex || index !== previous) {
- var previous = index;
- if (isIndex(index)) {
- splice.call(array, index, 1);
- } else {
- baseUnset(array, index);
- }
- }
- }
- return array;
- }
- function baseRandom(lower, upper) {
- return lower + nativeFloor(nativeRandom() * (upper - lower + 1));
- }
- function baseRange(start, end, step, fromRight) {
- var index = -1, length = nativeMax(nativeCeil((end - start) / (step || 1)), 0), result2 = Array2(length);
- while (length--) {
- result2[fromRight ? length : ++index] = start;
- start += step;
- }
- return result2;
- }
- function baseRepeat(string, n) {
- var result2 = "";
- if (!string || n < 1 || n > MAX_SAFE_INTEGER) {
- return result2;
- }
- do {
- if (n % 2) {
- result2 += string;
- }
- n = nativeFloor(n / 2);
- if (n) {
- string += string;
- }
- } while (n);
- return result2;
- }
- function baseRest(func, start) {
- return setToString(overRest(func, start, identity), func + "");
- }
- function baseSample(collection) {
- return arraySample(values(collection));
- }
- function baseSampleSize(collection, n) {
- var array = values(collection);
- return shuffleSelf(array, baseClamp(n, 0, array.length));
- }
- function baseSet(object, path, value, customizer) {
- if (!isObject(object)) {
- return object;
- }
- path = castPath(path, object);
- var index = -1, length = path.length, lastIndex = length - 1, nested = object;
- while (nested != null && ++index < length) {
- var key = toKey(path[index]), newValue = value;
- if (key === "__proto__" || key === "constructor" || key === "prototype") {
- return object;
- }
- if (index != lastIndex) {
- var objValue = nested[key];
- newValue = customizer ? customizer(objValue, key, nested) : undefined$1;
- if (newValue === undefined$1) {
- newValue = isObject(objValue) ? objValue : isIndex(path[index + 1]) ? [] : {};
- }
- }
- assignValue(nested, key, newValue);
- nested = nested[key];
- }
- return object;
- }
- var baseSetData = !metaMap ? identity : function(func, data) {
- metaMap.set(func, data);
- return func;
- };
- var baseSetToString = !defineProperty ? identity : function(func, string) {
- return defineProperty(func, "toString", {
- "configurable": true,
- "enumerable": false,
- "value": constant(string),
- "writable": true
- });
- };
- function baseShuffle(collection) {
- return shuffleSelf(values(collection));
- }
- function baseSlice(array, start, end) {
- var index = -1, length = array.length;
- if (start < 0) {
- start = -start > length ? 0 : length + start;
- }
- end = end > length ? length : end;
- if (end < 0) {
- end += length;
- }
- length = start > end ? 0 : end - start >>> 0;
- start >>>= 0;
- var result2 = Array2(length);
- while (++index < length) {
- result2[index] = array[index + start];
- }
- return result2;
- }
- function baseSome(collection, predicate) {
- var result2;
- baseEach(collection, function(value, index, collection2) {
- result2 = predicate(value, index, collection2);
- return !result2;
- });
- return !!result2;
- }
- function baseSortedIndex(array, value, retHighest) {
- var low = 0, high = array == null ? low : array.length;
- if (typeof value == "number" && value === value && high <= HALF_MAX_ARRAY_LENGTH) {
- while (low < high) {
- var mid = low + high >>> 1, computed = array[mid];
- if (computed !== null && !isSymbol(computed) && (retHighest ? computed <= value : computed < value)) {
- low = mid + 1;
- } else {
- high = mid;
- }
- }
- return high;
- }
- return baseSortedIndexBy(array, value, identity, retHighest);
- }
- function baseSortedIndexBy(array, value, iteratee2, retHighest) {
- var low = 0, high = array == null ? 0 : array.length;
- if (high === 0) {
- return 0;
- }
- value = iteratee2(value);
- var valIsNaN = value !== value, valIsNull = value === null, valIsSymbol = isSymbol(value), valIsUndefined = value === undefined$1;
- while (low < high) {
- var mid = nativeFloor((low + high) / 2), computed = iteratee2(array[mid]), othIsDefined = computed !== undefined$1, othIsNull = computed === null, othIsReflexive = computed === computed, othIsSymbol = isSymbol(computed);
- if (valIsNaN) {
- var setLow = retHighest || othIsReflexive;
- } else if (valIsUndefined) {
- setLow = othIsReflexive && (retHighest || othIsDefined);
- } else if (valIsNull) {
- setLow = othIsReflexive && othIsDefined && (retHighest || !othIsNull);
- } else if (valIsSymbol) {
- setLow = othIsReflexive && othIsDefined && !othIsNull && (retHighest || !othIsSymbol);
- } else if (othIsNull || othIsSymbol) {
- setLow = false;
- } else {
- setLow = retHighest ? computed <= value : computed < value;
- }
- if (setLow) {
- low = mid + 1;
- } else {
- high = mid;
- }
- }
- return nativeMin(high, MAX_ARRAY_INDEX);
- }
- function baseSortedUniq(array, iteratee2) {
- var index = -1, length = array.length, resIndex = 0, result2 = [];
- while (++index < length) {
- var value = array[index], computed = iteratee2 ? iteratee2(value) : value;
- if (!index || !eq(computed, seen)) {
- var seen = computed;
- result2[resIndex++] = value === 0 ? 0 : value;
- }
- }
- return result2;
- }
- function baseToNumber(value) {
- if (typeof value == "number") {
- return value;
- }
- if (isSymbol(value)) {
- return NAN;
- }
- return +value;
- }
- function baseToString(value) {
- if (typeof value == "string") {
- return value;
- }
- if (isArray(value)) {
- return arrayMap(value, baseToString) + "";
- }
- if (isSymbol(value)) {
- return symbolToString ? symbolToString.call(value) : "";
- }
- var result2 = value + "";
- return result2 == "0" && 1 / value == -INFINITY ? "-0" : result2;
- }
- function baseUniq(array, iteratee2, comparator) {
- var index = -1, includes2 = arrayIncludes, length = array.length, isCommon = true, result2 = [], seen = result2;
- if (comparator) {
- isCommon = false;
- includes2 = arrayIncludesWith;
- } else if (length >= LARGE_ARRAY_SIZE) {
- var set2 = iteratee2 ? null : createSet(array);
- if (set2) {
- return setToArray(set2);
- }
- isCommon = false;
- includes2 = cacheHas;
- seen = new SetCache();
- } else {
- seen = iteratee2 ? [] : result2;
- }
- outer:
- while (++index < length) {
- var value = array[index], computed = iteratee2 ? iteratee2(value) : value;
- value = comparator || value !== 0 ? value : 0;
- if (isCommon && computed === computed) {
- var seenIndex = seen.length;
- while (seenIndex--) {
- if (seen[seenIndex] === computed) {
- continue outer;
- }
- }
- if (iteratee2) {
- seen.push(computed);
- }
- result2.push(value);
- } else if (!includes2(seen, computed, comparator)) {
- if (seen !== result2) {
- seen.push(computed);
- }
- result2.push(value);
- }
- }
- return result2;
- }
- function baseUnset(object, path) {
- path = castPath(path, object);
- object = parent(object, path);
- return object == null || delete object[toKey(last(path))];
- }
- function baseUpdate(object, path, updater, customizer) {
- return baseSet(object, path, updater(baseGet(object, path)), customizer);
- }
- function baseWhile(array, predicate, isDrop, fromRight) {
- var length = array.length, index = fromRight ? length : -1;
- while ((fromRight ? index-- : ++index < length) && predicate(array[index], index, array)) {
- }
- return isDrop ? baseSlice(array, fromRight ? 0 : index, fromRight ? index + 1 : length) : baseSlice(array, fromRight ? index + 1 : 0, fromRight ? length : index);
- }
- function baseWrapperValue(value, actions) {
- var result2 = value;
- if (result2 instanceof LazyWrapper) {
- result2 = result2.value();
- }
- return arrayReduce(actions, function(result3, action) {
- return action.func.apply(action.thisArg, arrayPush([result3], action.args));
- }, result2);
- }
- function baseXor(arrays, iteratee2, comparator) {
- var length = arrays.length;
- if (length < 2) {
- return length ? baseUniq(arrays[0]) : [];
- }
- var index = -1, result2 = Array2(length);
- while (++index < length) {
- var array = arrays[index], othIndex = -1;
- while (++othIndex < length) {
- if (othIndex != index) {
- result2[index] = baseDifference(result2[index] || array, arrays[othIndex], iteratee2, comparator);
- }
- }
- }
- return baseUniq(baseFlatten(result2, 1), iteratee2, comparator);
- }
- function baseZipObject(props, values2, assignFunc) {
- var index = -1, length = props.length, valsLength = values2.length, result2 = {};
- while (++index < length) {
- var value = index < valsLength ? values2[index] : undefined$1;
- assignFunc(result2, props[index], value);
- }
- return result2;
- }
- function castArrayLikeObject(value) {
- return isArrayLikeObject(value) ? value : [];
- }
- function castFunction(value) {
- return typeof value == "function" ? value : identity;
- }
- function castPath(value, object) {
- if (isArray(value)) {
- return value;
- }
- return isKey(value, object) ? [value] : stringToPath(toString(value));
- }
- var castRest = baseRest;
- function castSlice(array, start, end) {
- var length = array.length;
- end = end === undefined$1 ? length : end;
- return !start && end >= length ? array : baseSlice(array, start, end);
- }
- var clearTimeout = ctxClearTimeout || function(id) {
- return root.clearTimeout(id);
- };
- function cloneBuffer(buffer, isDeep) {
- if (isDeep) {
- return buffer.slice();
- }
- var length = buffer.length, result2 = allocUnsafe ? allocUnsafe(length) : new buffer.constructor(length);
- buffer.copy(result2);
- return result2;
- }
- function cloneArrayBuffer(arrayBuffer) {
- var result2 = new arrayBuffer.constructor(arrayBuffer.byteLength);
- new Uint8Array2(result2).set(new Uint8Array2(arrayBuffer));
- return result2;
- }
- function cloneDataView(dataView, isDeep) {
- var buffer = isDeep ? cloneArrayBuffer(dataView.buffer) : dataView.buffer;
- return new dataView.constructor(buffer, dataView.byteOffset, dataView.byteLength);
- }
- function cloneRegExp(regexp) {
- var result2 = new regexp.constructor(regexp.source, reFlags.exec(regexp));
- result2.lastIndex = regexp.lastIndex;
- return result2;
- }
- function cloneSymbol(symbol) {
- return symbolValueOf ? Object2(symbolValueOf.call(symbol)) : {};
- }
- function cloneTypedArray(typedArray, isDeep) {
- var buffer = isDeep ? cloneArrayBuffer(typedArray.buffer) : typedArray.buffer;
- return new typedArray.constructor(buffer, typedArray.byteOffset, typedArray.length);
- }
- function compareAscending(value, other) {
- if (value !== other) {
- var valIsDefined = value !== undefined$1, valIsNull = value === null, valIsReflexive = value === value, valIsSymbol = isSymbol(value);
- var othIsDefined = other !== undefined$1, othIsNull = other === null, othIsReflexive = other === other, othIsSymbol = isSymbol(other);
- if (!othIsNull && !othIsSymbol && !valIsSymbol && value > other || valIsSymbol && othIsDefined && othIsReflexive && !othIsNull && !othIsSymbol || valIsNull && othIsDefined && othIsReflexive || !valIsDefined && othIsReflexive || !valIsReflexive) {
- return 1;
- }
- if (!valIsNull && !valIsSymbol && !othIsSymbol && value < other || othIsSymbol && valIsDefined && valIsReflexive && !valIsNull && !valIsSymbol || othIsNull && valIsDefined && valIsReflexive || !othIsDefined && valIsReflexive || !othIsReflexive) {
- return -1;
- }
- }
- return 0;
- }
- function compareMultiple(object, other, orders) {
- var index = -1, objCriteria = object.criteria, othCriteria = other.criteria, length = objCriteria.length, ordersLength = orders.length;
- while (++index < length) {
- var result2 = compareAscending(objCriteria[index], othCriteria[index]);
- if (result2) {
- if (index >= ordersLength) {
- return result2;
- }
- var order = orders[index];
- return result2 * (order == "desc" ? -1 : 1);
- }
- }
- return object.index - other.index;
- }
- function composeArgs(args, partials, holders, isCurried) {
- var argsIndex = -1, argsLength = args.length, holdersLength = holders.length, leftIndex = -1, leftLength = partials.length, rangeLength = nativeMax(argsLength - holdersLength, 0), result2 = Array2(leftLength + rangeLength), isUncurried = !isCurried;
- while (++leftIndex < leftLength) {
- result2[leftIndex] = partials[leftIndex];
- }
- while (++argsIndex < holdersLength) {
- if (isUncurried || argsIndex < argsLength) {
- result2[holders[argsIndex]] = args[argsIndex];
- }
- }
- while (rangeLength--) {
- result2[leftIndex++] = args[argsIndex++];
- }
- return result2;
- }
- function composeArgsRight(args, partials, holders, isCurried) {
- var argsIndex = -1, argsLength = args.length, holdersIndex = -1, holdersLength = holders.length, rightIndex = -1, rightLength = partials.length, rangeLength = nativeMax(argsLength - holdersLength, 0), result2 = Array2(rangeLength + rightLength), isUncurried = !isCurried;
- while (++argsIndex < rangeLength) {
- result2[argsIndex] = args[argsIndex];
- }
- var offset = argsIndex;
- while (++rightIndex < rightLength) {
- result2[offset + rightIndex] = partials[rightIndex];
- }
- while (++holdersIndex < holdersLength) {
- if (isUncurried || argsIndex < argsLength) {
- result2[offset + holders[holdersIndex]] = args[argsIndex++];
- }
- }
- return result2;
- }
- function copyArray(source, array) {
- var index = -1, length = source.length;
- array || (array = Array2(length));
- while (++index < length) {
- array[index] = source[index];
- }
- return array;
- }
- function copyObject(source, props, object, customizer) {
- var isNew = !object;
- object || (object = {});
- var index = -1, length = props.length;
- while (++index < length) {
- var key = props[index];
- var newValue = customizer ? customizer(object[key], source[key], key, object, source) : undefined$1;
- if (newValue === undefined$1) {
- newValue = source[key];
- }
- if (isNew) {
- baseAssignValue(object, key, newValue);
- } else {
- assignValue(object, key, newValue);
- }
- }
- return object;
- }
- function copySymbols(source, object) {
- return copyObject(source, getSymbols(source), object);
- }
- function copySymbolsIn(source, object) {
- return copyObject(source, getSymbolsIn(source), object);
- }
- function createAggregator(setter, initializer) {
- return function(collection, iteratee2) {
- var func = isArray(collection) ? arrayAggregator : baseAggregator, accumulator = initializer ? initializer() : {};
- return func(collection, setter, getIteratee(iteratee2, 2), accumulator);
- };
- }
- function createAssigner(assigner) {
- return baseRest(function(object, sources) {
- var index = -1, length = sources.length, customizer = length > 1 ? sources[length - 1] : undefined$1, guard = length > 2 ? sources[2] : undefined$1;
- customizer = assigner.length > 3 && typeof customizer == "function" ? (length--, customizer) : undefined$1;
- if (guard && isIterateeCall(sources[0], sources[1], guard)) {
- customizer = length < 3 ? undefined$1 : customizer;
- length = 1;
- }
- object = Object2(object);
- while (++index < length) {
- var source = sources[index];
- if (source) {
- assigner(object, source, index, customizer);
- }
- }
- return object;
- });
- }
- function createBaseEach(eachFunc, fromRight) {
- return function(collection, iteratee2) {
- if (collection == null) {
- return collection;
- }
- if (!isArrayLike(collection)) {
- return eachFunc(collection, iteratee2);
- }
- var length = collection.length, index = fromRight ? length : -1, iterable = Object2(collection);
- while (fromRight ? index-- : ++index < length) {
- if (iteratee2(iterable[index], index, iterable) === false) {
- break;
- }
- }
- return collection;
- };
- }
- function createBaseFor(fromRight) {
- return function(object, iteratee2, keysFunc) {
- var index = -1, iterable = Object2(object), props = keysFunc(object), length = props.length;
- while (length--) {
- var key = props[fromRight ? length : ++index];
- if (iteratee2(iterable[key], key, iterable) === false) {
- break;
- }
- }
- return object;
- };
- }
- function createBind(func, bitmask, thisArg) {
- var isBind = bitmask & WRAP_BIND_FLAG, Ctor = createCtor(func);
- function wrapper() {
- var fn = this && this !== root && this instanceof wrapper ? Ctor : func;
- return fn.apply(isBind ? thisArg : this, arguments);
- }
- return wrapper;
- }
- function createCaseFirst(methodName) {
- return function(string) {
- string = toString(string);
- var strSymbols = hasUnicode(string) ? stringToArray(string) : undefined$1;
- var chr = strSymbols ? strSymbols[0] : string.charAt(0);
- var trailing = strSymbols ? castSlice(strSymbols, 1).join("") : string.slice(1);
- return chr[methodName]() + trailing;
- };
- }
- function createCompounder(callback) {
- return function(string) {
- return arrayReduce(words(deburr(string).replace(reApos, "")), callback, "");
- };
- }
- function createCtor(Ctor) {
- return function() {
- var args = arguments;
- switch (args.length) {
- case 0:
- return new Ctor();
- case 1:
- return new Ctor(args[0]);
- case 2:
- return new Ctor(args[0], args[1]);
- case 3:
- return new Ctor(args[0], args[1], args[2]);
- case 4:
- return new Ctor(args[0], args[1], args[2], args[3]);
- case 5:
- return new Ctor(args[0], args[1], args[2], args[3], args[4]);
- case 6:
- return new Ctor(args[0], args[1], args[2], args[3], args[4], args[5]);
- case 7:
- return new Ctor(args[0], args[1], args[2], args[3], args[4], args[5], args[6]);
- }
- var thisBinding = baseCreate(Ctor.prototype), result2 = Ctor.apply(thisBinding, args);
- return isObject(result2) ? result2 : thisBinding;
- };
- }
- function createCurry(func, bitmask, arity) {
- var Ctor = createCtor(func);
- function wrapper() {
- var length = arguments.length, args = Array2(length), index = length, placeholder = getHolder(wrapper);
- while (index--) {
- args[index] = arguments[index];
- }
- var holders = length < 3 && args[0] !== placeholder && args[length - 1] !== placeholder ? [] : replaceHolders(args, placeholder);
- length -= holders.length;
- if (length < arity) {
- return createRecurry(
- func,
- bitmask,
- createHybrid,
- wrapper.placeholder,
- undefined$1,
- args,
- holders,
- undefined$1,
- undefined$1,
- arity - length
- );
- }
- var fn = this && this !== root && this instanceof wrapper ? Ctor : func;
- return apply(fn, this, args);
- }
- return wrapper;
- }
- function createFind(findIndexFunc) {
- return function(collection, predicate, fromIndex) {
- var iterable = Object2(collection);
- if (!isArrayLike(collection)) {
- var iteratee2 = getIteratee(predicate, 3);
- collection = keys(collection);
- predicate = function(key) {
- return iteratee2(iterable[key], key, iterable);
- };
- }
- var index = findIndexFunc(collection, predicate, fromIndex);
- return index > -1 ? iterable[iteratee2 ? collection[index] : index] : undefined$1;
- };
- }
- function createFlow(fromRight) {
- return flatRest(function(funcs) {
- var length = funcs.length, index = length, prereq = LodashWrapper.prototype.thru;
- if (fromRight) {
- funcs.reverse();
- }
- while (index--) {
- var func = funcs[index];
- if (typeof func != "function") {
- throw new TypeError2(FUNC_ERROR_TEXT);
- }
- if (prereq && !wrapper && getFuncName(func) == "wrapper") {
- var wrapper = new LodashWrapper([], true);
- }
- }
- index = wrapper ? index : length;
- while (++index < length) {
- func = funcs[index];
- var funcName = getFuncName(func), data = funcName == "wrapper" ? getData(func) : undefined$1;
- if (data && isLaziable(data[0]) && data[1] == (WRAP_ARY_FLAG | WRAP_CURRY_FLAG | WRAP_PARTIAL_FLAG | WRAP_REARG_FLAG) && !data[4].length && data[9] == 1) {
- wrapper = wrapper[getFuncName(data[0])].apply(wrapper, data[3]);
- } else {
- wrapper = func.length == 1 && isLaziable(func) ? wrapper[funcName]() : wrapper.thru(func);
- }
- }
- return function() {
- var args = arguments, value = args[0];
- if (wrapper && args.length == 1 && isArray(value)) {
- return wrapper.plant(value).value();
- }
- var index2 = 0, result2 = length ? funcs[index2].apply(this, args) : value;
- while (++index2 < length) {
- result2 = funcs[index2].call(this, result2);
- }
- return result2;
- };
- });
- }
- function createHybrid(func, bitmask, thisArg, partials, holders, partialsRight, holdersRight, argPos, ary2, arity) {
- var isAry = bitmask & WRAP_ARY_FLAG, isBind = bitmask & WRAP_BIND_FLAG, isBindKey = bitmask & WRAP_BIND_KEY_FLAG, isCurried = bitmask & (WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG), isFlip = bitmask & WRAP_FLIP_FLAG, Ctor = isBindKey ? undefined$1 : createCtor(func);
- function wrapper() {
- var length = arguments.length, args = Array2(length), index = length;
- while (index--) {
- args[index] = arguments[index];
- }
- if (isCurried) {
- var placeholder = getHolder(wrapper), holdersCount = countHolders(args, placeholder);
- }
- if (partials) {
- args = composeArgs(args, partials, holders, isCurried);
- }
- if (partialsRight) {
- args = composeArgsRight(args, partialsRight, holdersRight, isCurried);
- }
- length -= holdersCount;
- if (isCurried && length < arity) {
- var newHolders = replaceHolders(args, placeholder);
- return createRecurry(
- func,
- bitmask,
- createHybrid,
- wrapper.placeholder,
- thisArg,
- args,
- newHolders,
- argPos,
- ary2,
- arity - length
- );
- }
- var thisBinding = isBind ? thisArg : this, fn = isBindKey ? thisBinding[func] : func;
- length = args.length;
- if (argPos) {
- args = reorder(args, argPos);
- } else if (isFlip && length > 1) {
- args.reverse();
- }
- if (isAry && ary2 < length) {
- args.length = ary2;
- }
- if (this && this !== root && this instanceof wrapper) {
- fn = Ctor || createCtor(fn);
- }
- return fn.apply(thisBinding, args);
- }
- return wrapper;
- }
- function createInverter(setter, toIteratee) {
- return function(object, iteratee2) {
- return baseInverter(object, setter, toIteratee(iteratee2), {});
- };
- }
- function createMathOperation(operator, defaultValue) {
- return function(value, other) {
- var result2;
- if (value === undefined$1 && other === undefined$1) {
- return defaultValue;
- }
- if (value !== undefined$1) {
- result2 = value;
- }
- if (other !== undefined$1) {
- if (result2 === undefined$1) {
- return other;
- }
- if (typeof value == "string" || typeof other == "string") {
- value = baseToString(value);
- other = baseToString(other);
- } else {
- value = baseToNumber(value);
- other = baseToNumber(other);
- }
- result2 = operator(value, other);
- }
- return result2;
- };
- }
- function createOver(arrayFunc) {
- return flatRest(function(iteratees) {
- iteratees = arrayMap(iteratees, baseUnary(getIteratee()));
- return baseRest(function(args) {
- var thisArg = this;
- return arrayFunc(iteratees, function(iteratee2) {
- return apply(iteratee2, thisArg, args);
- });
- });
- });
- }
- function createPadding(length, chars) {
- chars = chars === undefined$1 ? " " : baseToString(chars);
- var charsLength = chars.length;
- if (charsLength < 2) {
- return charsLength ? baseRepeat(chars, length) : chars;
- }
- var result2 = baseRepeat(chars, nativeCeil(length / stringSize(chars)));
- return hasUnicode(chars) ? castSlice(stringToArray(result2), 0, length).join("") : result2.slice(0, length);
- }
- function createPartial(func, bitmask, thisArg, partials) {
- var isBind = bitmask & WRAP_BIND_FLAG, Ctor = createCtor(func);
- function wrapper() {
- var argsIndex = -1, argsLength = arguments.length, leftIndex = -1, leftLength = partials.length, args = Array2(leftLength + argsLength), fn = this && this !== root && this instanceof wrapper ? Ctor : func;
- while (++leftIndex < leftLength) {
- args[leftIndex] = partials[leftIndex];
- }
- while (argsLength--) {
- args[leftIndex++] = arguments[++argsIndex];
- }
- return apply(fn, isBind ? thisArg : this, args);
- }
- return wrapper;
- }
- function createRange(fromRight) {
- return function(start, end, step) {
- if (step && typeof step != "number" && isIterateeCall(start, end, step)) {
- end = step = undefined$1;
- }
- start = toFinite(start);
- if (end === undefined$1) {
- end = start;
- start = 0;
- } else {
- end = toFinite(end);
- }
- step = step === undefined$1 ? start < end ? 1 : -1 : toFinite(step);
- return baseRange(start, end, step, fromRight);
- };
- }
- function createRelationalOperation(operator) {
- return function(value, other) {
- if (!(typeof value == "string" && typeof other == "string")) {
- value = toNumber(value);
- other = toNumber(other);
- }
- return operator(value, other);
- };
- }
- function createRecurry(func, bitmask, wrapFunc, placeholder, thisArg, partials, holders, argPos, ary2, arity) {
- var isCurry = bitmask & WRAP_CURRY_FLAG, newHolders = isCurry ? holders : undefined$1, newHoldersRight = isCurry ? undefined$1 : holders, newPartials = isCurry ? partials : undefined$1, newPartialsRight = isCurry ? undefined$1 : partials;
- bitmask |= isCurry ? WRAP_PARTIAL_FLAG : WRAP_PARTIAL_RIGHT_FLAG;
- bitmask &= ~(isCurry ? WRAP_PARTIAL_RIGHT_FLAG : WRAP_PARTIAL_FLAG);
- if (!(bitmask & WRAP_CURRY_BOUND_FLAG)) {
- bitmask &= ~(WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG);
- }
- var newData = [
- func,
- bitmask,
- thisArg,
- newPartials,
- newHolders,
- newPartialsRight,
- newHoldersRight,
- argPos,
- ary2,
- arity
- ];
- var result2 = wrapFunc.apply(undefined$1, newData);
- if (isLaziable(func)) {
- setData(result2, newData);
- }
- result2.placeholder = placeholder;
- return setWrapToString(result2, func, bitmask);
- }
- function createRound(methodName) {
- var func = Math2[methodName];
- return function(number, precision) {
- number = toNumber(number);
- precision = precision == null ? 0 : nativeMin(toInteger(precision), 292);
- if (precision && nativeIsFinite(number)) {
- var pair = (toString(number) + "e").split("e"), value = func(pair[0] + "e" + (+pair[1] + precision));
- pair = (toString(value) + "e").split("e");
- return +(pair[0] + "e" + (+pair[1] - precision));
- }
- return func(number);
- };
- }
- var createSet = !(Set && 1 / setToArray(new Set([, -0]))[1] == INFINITY) ? noop : function(values2) {
- return new Set(values2);
- };
- function createToPairs(keysFunc) {
- return function(object) {
- var tag = getTag(object);
- if (tag == mapTag) {
- return mapToArray(object);
- }
- if (tag == setTag) {
- return setToPairs(object);
- }
- return baseToPairs(object, keysFunc(object));
- };
- }
- function createWrap(func, bitmask, thisArg, partials, holders, argPos, ary2, arity) {
- var isBindKey = bitmask & WRAP_BIND_KEY_FLAG;
- if (!isBindKey && typeof func != "function") {
- throw new TypeError2(FUNC_ERROR_TEXT);
- }
- var length = partials ? partials.length : 0;
- if (!length) {
- bitmask &= ~(WRAP_PARTIAL_FLAG | WRAP_PARTIAL_RIGHT_FLAG);
- partials = holders = undefined$1;
- }
- ary2 = ary2 === undefined$1 ? ary2 : nativeMax(toInteger(ary2), 0);
- arity = arity === undefined$1 ? arity : toInteger(arity);
- length -= holders ? holders.length : 0;
- if (bitmask & WRAP_PARTIAL_RIGHT_FLAG) {
- var partialsRight = partials, holdersRight = holders;
- partials = holders = undefined$1;
- }
- var data = isBindKey ? undefined$1 : getData(func);
- var newData = [
- func,
- bitmask,
- thisArg,
- partials,
- holders,
- partialsRight,
- holdersRight,
- argPos,
- ary2,
- arity
- ];
- if (data) {
- mergeData(newData, data);
- }
- func = newData[0];
- bitmask = newData[1];
- thisArg = newData[2];
- partials = newData[3];
- holders = newData[4];
- arity = newData[9] = newData[9] === undefined$1 ? isBindKey ? 0 : func.length : nativeMax(newData[9] - length, 0);
- if (!arity && bitmask & (WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG)) {
- bitmask &= ~(WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG);
- }
- if (!bitmask || bitmask == WRAP_BIND_FLAG) {
- var result2 = createBind(func, bitmask, thisArg);
- } else if (bitmask == WRAP_CURRY_FLAG || bitmask == WRAP_CURRY_RIGHT_FLAG) {
- result2 = createCurry(func, bitmask, arity);
- } else if ((bitmask == WRAP_PARTIAL_FLAG || bitmask == (WRAP_BIND_FLAG | WRAP_PARTIAL_FLAG)) && !holders.length) {
- result2 = createPartial(func, bitmask, thisArg, partials);
- } else {
- result2 = createHybrid.apply(undefined$1, newData);
- }
- var setter = data ? baseSetData : setData;
- return setWrapToString(setter(result2, newData), func, bitmask);
- }
- function customDefaultsAssignIn(objValue, srcValue, key, object) {
- if (objValue === undefined$1 || eq(objValue, objectProto[key]) && !hasOwnProperty.call(object, key)) {
- return srcValue;
- }
- return objValue;
- }
- function customDefaultsMerge(objValue, srcValue, key, object, source, stack) {
- if (isObject(objValue) && isObject(srcValue)) {
- stack.set(srcValue, objValue);
- baseMerge(objValue, srcValue, undefined$1, customDefaultsMerge, stack);
- stack["delete"](srcValue);
- }
- return objValue;
- }
- function customOmitClone(value) {
- return isPlainObject(value) ? undefined$1 : value;
- }
- function equalArrays(array, other, bitmask, customizer, equalFunc, stack) {
- var isPartial = bitmask & COMPARE_PARTIAL_FLAG, arrLength = array.length, othLength = other.length;
- if (arrLength != othLength && !(isPartial && othLength > arrLength)) {
- return false;
- }
- var arrStacked = stack.get(array);
- var othStacked = stack.get(other);
- if (arrStacked && othStacked) {
- return arrStacked == other && othStacked == array;
- }
- var index = -1, result2 = true, seen = bitmask & COMPARE_UNORDERED_FLAG ? new SetCache() : undefined$1;
- stack.set(array, other);
- stack.set(other, array);
- while (++index < arrLength) {
- var arrValue = array[index], othValue = other[index];
- if (customizer) {
- var compared = isPartial ? customizer(othValue, arrValue, index, other, array, stack) : customizer(arrValue, othValue, index, array, other, stack);
- }
- if (compared !== undefined$1) {
- if (compared) {
- continue;
- }
- result2 = false;
- break;
- }
- if (seen) {
- if (!arraySome(other, function(othValue2, othIndex) {
- if (!cacheHas(seen, othIndex) && (arrValue === othValue2 || equalFunc(arrValue, othValue2, bitmask, customizer, stack))) {
- return seen.push(othIndex);
- }
- })) {
- result2 = false;
- break;
- }
- } else if (!(arrValue === othValue || equalFunc(arrValue, othValue, bitmask, customizer, stack))) {
- result2 = false;
- break;
- }
- }
- stack["delete"](array);
- stack["delete"](other);
- return result2;
- }
- function equalByTag(object, other, tag, bitmask, customizer, equalFunc, stack) {
- switch (tag) {
- case dataViewTag:
- if (object.byteLength != other.byteLength || object.byteOffset != other.byteOffset) {
- return false;
- }
- object = object.buffer;
- other = other.buffer;
- case arrayBufferTag:
- if (object.byteLength != other.byteLength || !equalFunc(new Uint8Array2(object), new Uint8Array2(other))) {
- return false;
- }
- return true;
- case boolTag:
- case dateTag:
- case numberTag:
- return eq(+object, +other);
- case errorTag:
- return object.name == other.name && object.message == other.message;
- case regexpTag:
- case stringTag:
- return object == other + "";
- case mapTag:
- var convert = mapToArray;
- case setTag:
- var isPartial = bitmask & COMPARE_PARTIAL_FLAG;
- convert || (convert = setToArray);
- if (object.size != other.size && !isPartial) {
- return false;
- }
- var stacked = stack.get(object);
- if (stacked) {
- return stacked == other;
- }
- bitmask |= COMPARE_UNORDERED_FLAG;
- stack.set(object, other);
- var result2 = equalArrays(convert(object), convert(other), bitmask, customizer, equalFunc, stack);
- stack["delete"](object);
- return result2;
- case symbolTag:
- if (symbolValueOf) {
- return symbolValueOf.call(object) == symbolValueOf.call(other);
- }
- }
- return false;
- }
- function equalObjects(object, other, bitmask, customizer, equalFunc, stack) {
- var isPartial = bitmask & COMPARE_PARTIAL_FLAG, objProps = getAllKeys(object), objLength = objProps.length, othProps = getAllKeys(other), othLength = othProps.length;
- if (objLength != othLength && !isPartial) {
- return false;
- }
- var index = objLength;
- while (index--) {
- var key = objProps[index];
- if (!(isPartial ? key in other : hasOwnProperty.call(other, key))) {
- return false;
- }
- }
- var objStacked = stack.get(object);
- var othStacked = stack.get(other);
- if (objStacked && othStacked) {
- return objStacked == other && othStacked == object;
- }
- var result2 = true;
- stack.set(object, other);
- stack.set(other, object);
- var skipCtor = isPartial;
- while (++index < objLength) {
- key = objProps[index];
- var objValue = object[key], othValue = other[key];
- if (customizer) {
- var compared = isPartial ? customizer(othValue, objValue, key, other, object, stack) : customizer(objValue, othValue, key, object, other, stack);
- }
- if (!(compared === undefined$1 ? objValue === othValue || equalFunc(objValue, othValue, bitmask, customizer, stack) : compared)) {
- result2 = false;
- break;
- }
- skipCtor || (skipCtor = key == "constructor");
- }
- if (result2 && !skipCtor) {
- var objCtor = object.constructor, othCtor = other.constructor;
- if (objCtor != othCtor && ("constructor" in object && "constructor" in other) && !(typeof objCtor == "function" && objCtor instanceof objCtor && typeof othCtor == "function" && othCtor instanceof othCtor)) {
- result2 = false;
- }
- }
- stack["delete"](object);
- stack["delete"](other);
- return result2;
- }
- function flatRest(func) {
- return setToString(overRest(func, undefined$1, flatten), func + "");
- }
- function getAllKeys(object) {
- return baseGetAllKeys(object, keys, getSymbols);
- }
- function getAllKeysIn(object) {
- return baseGetAllKeys(object, keysIn, getSymbolsIn);
- }
- var getData = !metaMap ? noop : function(func) {
- return metaMap.get(func);
- };
- function getFuncName(func) {
- var result2 = func.name + "", array = realNames[result2], length = hasOwnProperty.call(realNames, result2) ? array.length : 0;
- while (length--) {
- var data = array[length], otherFunc = data.func;
- if (otherFunc == null || otherFunc == func) {
- return data.name;
- }
- }
- return result2;
- }
- function getHolder(func) {
- var object = hasOwnProperty.call(lodash2, "placeholder") ? lodash2 : func;
- return object.placeholder;
- }
- function getIteratee() {
- var result2 = lodash2.iteratee || iteratee;
- result2 = result2 === iteratee ? baseIteratee : result2;
- return arguments.length ? result2(arguments[0], arguments[1]) : result2;
- }
- function getMapData(map2, key) {
- var data = map2.__data__;
- return isKeyable(key) ? data[typeof key == "string" ? "string" : "hash"] : data.map;
- }
- function getMatchData(object) {
- var result2 = keys(object), length = result2.length;
- while (length--) {
- var key = result2[length], value = object[key];
- result2[length] = [key, value, isStrictComparable(value)];
- }
- return result2;
- }
- function getNative(object, key) {
- var value = getValue(object, key);
- return baseIsNative(value) ? value : undefined$1;
- }
- function getRawTag(value) {
- var isOwn = hasOwnProperty.call(value, symToStringTag), tag = value[symToStringTag];
- try {
- value[symToStringTag] = undefined$1;
- var unmasked = true;
- } catch (e) {
- }
- var result2 = nativeObjectToString.call(value);
- if (unmasked) {
- if (isOwn) {
- value[symToStringTag] = tag;
- } else {
- delete value[symToStringTag];
- }
- }
- return result2;
- }
- var getSymbols = !nativeGetSymbols ? stubArray : function(object) {
- if (object == null) {
- return [];
- }
- object = Object2(object);
- return arrayFilter(nativeGetSymbols(object), function(symbol) {
- return propertyIsEnumerable.call(object, symbol);
- });
- };
- var getSymbolsIn = !nativeGetSymbols ? stubArray : function(object) {
- var result2 = [];
- while (object) {
- arrayPush(result2, getSymbols(object));
- object = getPrototype(object);
- }
- return result2;
- };
- var getTag = baseGetTag;
- if (DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag || Map && getTag(new Map()) != mapTag || Promise2 && getTag(Promise2.resolve()) != promiseTag || Set && getTag(new Set()) != setTag || WeakMap && getTag(new WeakMap()) != weakMapTag) {
- getTag = function(value) {
- var result2 = baseGetTag(value), Ctor = result2 == objectTag ? value.constructor : undefined$1, ctorString = Ctor ? toSource(Ctor) : "";
- if (ctorString) {
- switch (ctorString) {
- case dataViewCtorString:
- return dataViewTag;
- case mapCtorString:
- return mapTag;
- case promiseCtorString:
- return promiseTag;
- case setCtorString:
- return setTag;
- case weakMapCtorString:
- return weakMapTag;
- }
- }
- return result2;
- };
- }
- function getView(start, end, transforms) {
- var index = -1, length = transforms.length;
- while (++index < length) {
- var data = transforms[index], size2 = data.size;
- switch (data.type) {
- case "drop":
- start += size2;
- break;
- case "dropRight":
- end -= size2;
- break;
- case "take":
- end = nativeMin(end, start + size2);
- break;
- case "takeRight":
- start = nativeMax(start, end - size2);
- break;
- }
- }
- return { "start": start, "end": end };
- }
- function getWrapDetails(source) {
- var match = source.match(reWrapDetails);
- return match ? match[1].split(reSplitDetails) : [];
- }
- function hasPath(object, path, hasFunc) {
- path = castPath(path, object);
- var index = -1, length = path.length, result2 = false;
- while (++index < length) {
- var key = toKey(path[index]);
- if (!(result2 = object != null && hasFunc(object, key))) {
- break;
- }
- object = object[key];
- }
- if (result2 || ++index != length) {
- return result2;
- }
- length = object == null ? 0 : object.length;
- return !!length && isLength(length) && isIndex(key, length) && (isArray(object) || isArguments(object));
- }
- function initCloneArray(array) {
- var length = array.length, result2 = new array.constructor(length);
- if (length && typeof array[0] == "string" && hasOwnProperty.call(array, "index")) {
- result2.index = array.index;
- result2.input = array.input;
- }
- return result2;
- }
- function initCloneObject(object) {
- return typeof object.constructor == "function" && !isPrototype(object) ? baseCreate(getPrototype(object)) : {};
- }
- function initCloneByTag(object, tag, isDeep) {
- var Ctor = object.constructor;
- switch (tag) {
- case arrayBufferTag:
- return cloneArrayBuffer(object);
- case boolTag:
- case dateTag:
- return new Ctor(+object);
- case dataViewTag:
- return cloneDataView(object, isDeep);
- case float32Tag:
- case float64Tag:
- case int8Tag:
- case int16Tag:
- case int32Tag:
- case uint8Tag:
- case uint8ClampedTag:
- case uint16Tag:
- case uint32Tag:
- return cloneTypedArray(object, isDeep);
- case mapTag:
- return new Ctor();
- case numberTag:
- case stringTag:
- return new Ctor(object);
- case regexpTag:
- return cloneRegExp(object);
- case setTag:
- return new Ctor();
- case symbolTag:
- return cloneSymbol(object);
- }
- }
- function insertWrapDetails(source, details) {
- var length = details.length;
- if (!length) {
- return source;
- }
- var lastIndex = length - 1;
- details[lastIndex] = (length > 1 ? "& " : "") + details[lastIndex];
- details = details.join(length > 2 ? ", " : " ");
- return source.replace(reWrapComment, "{\n/* [wrapped with " + details + "] */\n");
- }
- function isFlattenable(value) {
- return isArray(value) || isArguments(value) || !!(spreadableSymbol && value && value[spreadableSymbol]);
- }
- function isIndex(value, length) {
- var type = typeof value;
- length = length == null ? MAX_SAFE_INTEGER : length;
- return !!length && (type == "number" || type != "symbol" && reIsUint.test(value)) && (value > -1 && value % 1 == 0 && value < length);
- }
- function isIterateeCall(value, index, object) {
- if (!isObject(object)) {
- return false;
- }
- var type = typeof index;
- if (type == "number" ? isArrayLike(object) && isIndex(index, object.length) : type == "string" && index in object) {
- return eq(object[index], value);
- }
- return false;
- }
- function isKey(value, object) {
- if (isArray(value)) {
- return false;
- }
- var type = typeof value;
- if (type == "number" || type == "symbol" || type == "boolean" || value == null || isSymbol(value)) {
- return true;
- }
- return reIsPlainProp.test(value) || !reIsDeepProp.test(value) || object != null && value in Object2(object);
- }
- function isKeyable(value) {
- var type = typeof value;
- return type == "string" || type == "number" || type == "symbol" || type == "boolean" ? value !== "__proto__" : value === null;
- }
- function isLaziable(func) {
- var funcName = getFuncName(func), other = lodash2[funcName];
- if (typeof other != "function" || !(funcName in LazyWrapper.prototype)) {
- return false;
- }
- if (func === other) {
- return true;
- }
- var data = getData(other);
- return !!data && func === data[0];
- }
- function isMasked(func) {
- return !!maskSrcKey && maskSrcKey in func;
- }
- var isMaskable = coreJsData ? isFunction : stubFalse;
- function isPrototype(value) {
- var Ctor = value && value.constructor, proto = typeof Ctor == "function" && Ctor.prototype || objectProto;
- return value === proto;
- }
- function isStrictComparable(value) {
- return value === value && !isObject(value);
- }
- function matchesStrictComparable(key, srcValue) {
- return function(object) {
- if (object == null) {
- return false;
- }
- return object[key] === srcValue && (srcValue !== undefined$1 || key in Object2(object));
- };
- }
- function memoizeCapped(func) {
- var result2 = memoize(func, function(key) {
- if (cache.size === MAX_MEMOIZE_SIZE) {
- cache.clear();
- }
- return key;
- });
- var cache = result2.cache;
- return result2;
- }
- function mergeData(data, source) {
- var bitmask = data[1], srcBitmask = source[1], newBitmask = bitmask | srcBitmask, isCommon = newBitmask < (WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG | WRAP_ARY_FLAG);
- var isCombo = srcBitmask == WRAP_ARY_FLAG && bitmask == WRAP_CURRY_FLAG || srcBitmask == WRAP_ARY_FLAG && bitmask == WRAP_REARG_FLAG && data[7].length <= source[8] || srcBitmask == (WRAP_ARY_FLAG | WRAP_REARG_FLAG) && source[7].length <= source[8] && bitmask == WRAP_CURRY_FLAG;
- if (!(isCommon || isCombo)) {
- return data;
- }
- if (srcBitmask & WRAP_BIND_FLAG) {
- data[2] = source[2];
- newBitmask |= bitmask & WRAP_BIND_FLAG ? 0 : WRAP_CURRY_BOUND_FLAG;
- }
- var value = source[3];
- if (value) {
- var partials = data[3];
- data[3] = partials ? composeArgs(partials, value, source[4]) : value;
- data[4] = partials ? replaceHolders(data[3], PLACEHOLDER) : source[4];
- }
- value = source[5];
- if (value) {
- partials = data[5];
- data[5] = partials ? composeArgsRight(partials, value, source[6]) : value;
- data[6] = partials ? replaceHolders(data[5], PLACEHOLDER) : source[6];
- }
- value = source[7];
- if (value) {
- data[7] = value;
- }
- if (srcBitmask & WRAP_ARY_FLAG) {
- data[8] = data[8] == null ? source[8] : nativeMin(data[8], source[8]);
- }
- if (data[9] == null) {
- data[9] = source[9];
- }
- data[0] = source[0];
- data[1] = newBitmask;
- return data;
- }
- function nativeKeysIn(object) {
- var result2 = [];
- if (object != null) {
- for (var key in Object2(object)) {
- result2.push(key);
- }
- }
- return result2;
- }
- function objectToString(value) {
- return nativeObjectToString.call(value);
- }
- function overRest(func, start, transform2) {
- start = nativeMax(start === undefined$1 ? func.length - 1 : start, 0);
- return function() {
- var args = arguments, index = -1, length = nativeMax(args.length - start, 0), array = Array2(length);
- while (++index < length) {
- array[index] = args[start + index];
- }
- index = -1;
- var otherArgs = Array2(start + 1);
- while (++index < start) {
- otherArgs[index] = args[index];
- }
- otherArgs[start] = transform2(array);
- return apply(func, this, otherArgs);
- };
- }
- function parent(object, path) {
- return path.length < 2 ? object : baseGet(object, baseSlice(path, 0, -1));
- }
- function reorder(array, indexes) {
- var arrLength = array.length, length = nativeMin(indexes.length, arrLength), oldArray = copyArray(array);
- while (length--) {
- var index = indexes[length];
- array[length] = isIndex(index, arrLength) ? oldArray[index] : undefined$1;
- }
- return array;
- }
- function safeGet(object, key) {
- if (key === "constructor" && typeof object[key] === "function") {
- return;
- }
- if (key == "__proto__") {
- return;
- }
- return object[key];
- }
- var setData = shortOut(baseSetData);
- var setTimeout = ctxSetTimeout || function(func, wait) {
- return root.setTimeout(func, wait);
- };
- var setToString = shortOut(baseSetToString);
- function setWrapToString(wrapper, reference, bitmask) {
- var source = reference + "";
- return setToString(wrapper, insertWrapDetails(source, updateWrapDetails(getWrapDetails(source), bitmask)));
- }
- function shortOut(func) {
- var count = 0, lastCalled = 0;
- return function() {
- var stamp = nativeNow(), remaining = HOT_SPAN - (stamp - lastCalled);
- lastCalled = stamp;
- if (remaining > 0) {
- if (++count >= HOT_COUNT) {
- return arguments[0];
- }
- } else {
- count = 0;
- }
- return func.apply(undefined$1, arguments);
- };
- }
- function shuffleSelf(array, size2) {
- var index = -1, length = array.length, lastIndex = length - 1;
- size2 = size2 === undefined$1 ? length : size2;
- while (++index < size2) {
- var rand = baseRandom(index, lastIndex), value = array[rand];
- array[rand] = array[index];
- array[index] = value;
- }
- array.length = size2;
- return array;
- }
- var stringToPath = memoizeCapped(function(string) {
- var result2 = [];
- if (string.charCodeAt(0) === 46) {
- result2.push("");
- }
- string.replace(rePropName, function(match, number, quote, subString) {
- result2.push(quote ? subString.replace(reEscapeChar, "$1") : number || match);
- });
- return result2;
- });
- function toKey(value) {
- if (typeof value == "string" || isSymbol(value)) {
- return value;
- }
- var result2 = value + "";
- return result2 == "0" && 1 / value == -INFINITY ? "-0" : result2;
- }
- function toSource(func) {
- if (func != null) {
- try {
- return funcToString.call(func);
- } catch (e) {
- }
- try {
- return func + "";
- } catch (e) {
- }
- }
- return "";
- }
- function updateWrapDetails(details, bitmask) {
- arrayEach(wrapFlags, function(pair) {
- var value = "_." + pair[0];
- if (bitmask & pair[1] && !arrayIncludes(details, value)) {
- details.push(value);
- }
- });
- return details.sort();
- }
- function wrapperClone(wrapper) {
- if (wrapper instanceof LazyWrapper) {
- return wrapper.clone();
- }
- var result2 = new LodashWrapper(wrapper.__wrapped__, wrapper.__chain__);
- result2.__actions__ = copyArray(wrapper.__actions__);
- result2.__index__ = wrapper.__index__;
- result2.__values__ = wrapper.__values__;
- return result2;
- }
- function chunk(array, size2, guard) {
- if (guard ? isIterateeCall(array, size2, guard) : size2 === undefined$1) {
- size2 = 1;
- } else {
- size2 = nativeMax(toInteger(size2), 0);
- }
- var length = array == null ? 0 : array.length;
- if (!length || size2 < 1) {
- return [];
- }
- var index = 0, resIndex = 0, result2 = Array2(nativeCeil(length / size2));
- while (index < length) {
- result2[resIndex++] = baseSlice(array, index, index += size2);
- }
- return result2;
- }
- function compact(array) {
- var index = -1, length = array == null ? 0 : array.length, resIndex = 0, result2 = [];
- while (++index < length) {
- var value = array[index];
- if (value) {
- result2[resIndex++] = value;
- }
- }
- return result2;
- }
- function concat() {
- var length = arguments.length;
- if (!length) {
- return [];
- }
- var args = Array2(length - 1), array = arguments[0], index = length;
- while (index--) {
- args[index - 1] = arguments[index];
- }
- return arrayPush(isArray(array) ? copyArray(array) : [array], baseFlatten(args, 1));
- }
- var difference = baseRest(function(array, values2) {
- return isArrayLikeObject(array) ? baseDifference(array, baseFlatten(values2, 1, isArrayLikeObject, true)) : [];
- });
- var differenceBy = baseRest(function(array, values2) {
- var iteratee2 = last(values2);
- if (isArrayLikeObject(iteratee2)) {
- iteratee2 = undefined$1;
- }
- return isArrayLikeObject(array) ? baseDifference(array, baseFlatten(values2, 1, isArrayLikeObject, true), getIteratee(iteratee2, 2)) : [];
- });
- var differenceWith = baseRest(function(array, values2) {
- var comparator = last(values2);
- if (isArrayLikeObject(comparator)) {
- comparator = undefined$1;
- }
- return isArrayLikeObject(array) ? baseDifference(array, baseFlatten(values2, 1, isArrayLikeObject, true), undefined$1, comparator) : [];
- });
- function drop(array, n, guard) {
- var length = array == null ? 0 : array.length;
- if (!length) {
- return [];
- }
- n = guard || n === undefined$1 ? 1 : toInteger(n);
- return baseSlice(array, n < 0 ? 0 : n, length);
- }
- function dropRight(array, n, guard) {
- var length = array == null ? 0 : array.length;
- if (!length) {
- return [];
- }
- n = guard || n === undefined$1 ? 1 : toInteger(n);
- n = length - n;
- return baseSlice(array, 0, n < 0 ? 0 : n);
- }
- function dropRightWhile(array, predicate) {
- return array && array.length ? baseWhile(array, getIteratee(predicate, 3), true, true) : [];
- }
- function dropWhile(array, predicate) {
- return array && array.length ? baseWhile(array, getIteratee(predicate, 3), true) : [];
- }
- function fill(array, value, start, end) {
- var length = array == null ? 0 : array.length;
- if (!length) {
- return [];
- }
- if (start && typeof start != "number" && isIterateeCall(array, value, start)) {
- start = 0;
- end = length;
- }
- return baseFill(array, value, start, end);
- }
- function findIndex(array, predicate, fromIndex) {
- var length = array == null ? 0 : array.length;
- if (!length) {
- return -1;
- }
- var index = fromIndex == null ? 0 : toInteger(fromIndex);
- if (index < 0) {
- index = nativeMax(length + index, 0);
- }
- return baseFindIndex(array, getIteratee(predicate, 3), index);
- }
- function findLastIndex(array, predicate, fromIndex) {
- var length = array == null ? 0 : array.length;
- if (!length) {
- return -1;
- }
- var index = length - 1;
- if (fromIndex !== undefined$1) {
- index = toInteger(fromIndex);
- index = fromIndex < 0 ? nativeMax(length + index, 0) : nativeMin(index, length - 1);
- }
- return baseFindIndex(array, getIteratee(predicate, 3), index, true);
- }
- function flatten(array) {
- var length = array == null ? 0 : array.length;
- return length ? baseFlatten(array, 1) : [];
- }
- function flattenDeep(array) {
- var length = array == null ? 0 : array.length;
- return length ? baseFlatten(array, INFINITY) : [];
- }
- function flattenDepth(array, depth) {
- var length = array == null ? 0 : array.length;
- if (!length) {
- return [];
- }
- depth = depth === undefined$1 ? 1 : toInteger(depth);
- return baseFlatten(array, depth);
- }
- function fromPairs(pairs) {
- var index = -1, length = pairs == null ? 0 : pairs.length, result2 = {};
- while (++index < length) {
- var pair = pairs[index];
- result2[pair[0]] = pair[1];
- }
- return result2;
- }
- function head(array) {
- return array && array.length ? array[0] : undefined$1;
- }
- function indexOf(array, value, fromIndex) {
- var length = array == null ? 0 : array.length;
- if (!length) {
- return -1;
- }
- var index = fromIndex == null ? 0 : toInteger(fromIndex);
- if (index < 0) {
- index = nativeMax(length + index, 0);
- }
- return baseIndexOf(array, value, index);
- }
- function initial(array) {
- var length = array == null ? 0 : array.length;
- return length ? baseSlice(array, 0, -1) : [];
- }
- var intersection = baseRest(function(arrays) {
- var mapped = arrayMap(arrays, castArrayLikeObject);
- return mapped.length && mapped[0] === arrays[0] ? baseIntersection(mapped) : [];
- });
- var intersectionBy = baseRest(function(arrays) {
- var iteratee2 = last(arrays), mapped = arrayMap(arrays, castArrayLikeObject);
- if (iteratee2 === last(mapped)) {
- iteratee2 = undefined$1;
- } else {
- mapped.pop();
- }
- return mapped.length && mapped[0] === arrays[0] ? baseIntersection(mapped, getIteratee(iteratee2, 2)) : [];
- });
- var intersectionWith = baseRest(function(arrays) {
- var comparator = last(arrays), mapped = arrayMap(arrays, castArrayLikeObject);
- comparator = typeof comparator == "function" ? comparator : undefined$1;
- if (comparator) {
- mapped.pop();
- }
- return mapped.length && mapped[0] === arrays[0] ? baseIntersection(mapped, undefined$1, comparator) : [];
- });
- function join(array, separator) {
- return array == null ? "" : nativeJoin.call(array, separator);
- }
- function last(array) {
- var length = array == null ? 0 : array.length;
- return length ? array[length - 1] : undefined$1;
- }
- function lastIndexOf(array, value, fromIndex) {
- var length = array == null ? 0 : array.length;
- if (!length) {
- return -1;
- }
- var index = length;
- if (fromIndex !== undefined$1) {
- index = toInteger(fromIndex);
- index = index < 0 ? nativeMax(length + index, 0) : nativeMin(index, length - 1);
- }
- return value === value ? strictLastIndexOf(array, value, index) : baseFindIndex(array, baseIsNaN, index, true);
- }
- function nth(array, n) {
- return array && array.length ? baseNth(array, toInteger(n)) : undefined$1;
- }
- var pull = baseRest(pullAll);
- function pullAll(array, values2) {
- return array && array.length && values2 && values2.length ? basePullAll(array, values2) : array;
- }
- function pullAllBy(array, values2, iteratee2) {
- return array && array.length && values2 && values2.length ? basePullAll(array, values2, getIteratee(iteratee2, 2)) : array;
- }
- function pullAllWith(array, values2, comparator) {
- return array && array.length && values2 && values2.length ? basePullAll(array, values2, undefined$1, comparator) : array;
- }
- var pullAt = flatRest(function(array, indexes) {
- var length = array == null ? 0 : array.length, result2 = baseAt(array, indexes);
- basePullAt(array, arrayMap(indexes, function(index) {
- return isIndex(index, length) ? +index : index;
- }).sort(compareAscending));
- return result2;
- });
- function remove(array, predicate) {
- var result2 = [];
- if (!(array && array.length)) {
- return result2;
- }
- var index = -1, indexes = [], length = array.length;
- predicate = getIteratee(predicate, 3);
- while (++index < length) {
- var value = array[index];
- if (predicate(value, index, array)) {
- result2.push(value);
- indexes.push(index);
- }
- }
- basePullAt(array, indexes);
- return result2;
- }
- function reverse(array) {
- return array == null ? array : nativeReverse.call(array);
- }
- function slice(array, start, end) {
- var length = array == null ? 0 : array.length;
- if (!length) {
- return [];
- }
- if (end && typeof end != "number" && isIterateeCall(array, start, end)) {
- start = 0;
- end = length;
- } else {
- start = start == null ? 0 : toInteger(start);
- end = end === undefined$1 ? length : toInteger(end);
- }
- return baseSlice(array, start, end);
- }
- function sortedIndex(array, value) {
- return baseSortedIndex(array, value);
- }
- function sortedIndexBy(array, value, iteratee2) {
- return baseSortedIndexBy(array, value, getIteratee(iteratee2, 2));
- }
- function sortedIndexOf(array, value) {
- var length = array == null ? 0 : array.length;
- if (length) {
- var index = baseSortedIndex(array, value);
- if (index < length && eq(array[index], value)) {
- return index;
- }
- }
- return -1;
- }
- function sortedLastIndex(array, value) {
- return baseSortedIndex(array, value, true);
- }
- function sortedLastIndexBy(array, value, iteratee2) {
- return baseSortedIndexBy(array, value, getIteratee(iteratee2, 2), true);
- }
- function sortedLastIndexOf(array, value) {
- var length = array == null ? 0 : array.length;
- if (length) {
- var index = baseSortedIndex(array, value, true) - 1;
- if (eq(array[index], value)) {
- return index;
- }
- }
- return -1;
- }
- function sortedUniq(array) {
- return array && array.length ? baseSortedUniq(array) : [];
- }
- function sortedUniqBy(array, iteratee2) {
- return array && array.length ? baseSortedUniq(array, getIteratee(iteratee2, 2)) : [];
- }
- function tail(array) {
- var length = array == null ? 0 : array.length;
- return length ? baseSlice(array, 1, length) : [];
- }
- function take(array, n, guard) {
- if (!(array && array.length)) {
- return [];
- }
- n = guard || n === undefined$1 ? 1 : toInteger(n);
- return baseSlice(array, 0, n < 0 ? 0 : n);
- }
- function takeRight(array, n, guard) {
- var length = array == null ? 0 : array.length;
- if (!length) {
- return [];
- }
- n = guard || n === undefined$1 ? 1 : toInteger(n);
- n = length - n;
- return baseSlice(array, n < 0 ? 0 : n, length);
- }
- function takeRightWhile(array, predicate) {
- return array && array.length ? baseWhile(array, getIteratee(predicate, 3), false, true) : [];
- }
- function takeWhile(array, predicate) {
- return array && array.length ? baseWhile(array, getIteratee(predicate, 3)) : [];
- }
- var union = baseRest(function(arrays) {
- return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true));
- });
- var unionBy = baseRest(function(arrays) {
- var iteratee2 = last(arrays);
- if (isArrayLikeObject(iteratee2)) {
- iteratee2 = undefined$1;
- }
- return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true), getIteratee(iteratee2, 2));
- });
- var unionWith = baseRest(function(arrays) {
- var comparator = last(arrays);
- comparator = typeof comparator == "function" ? comparator : undefined$1;
- return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true), undefined$1, comparator);
- });
- function uniq(array) {
- return array && array.length ? baseUniq(array) : [];
- }
- function uniqBy(array, iteratee2) {
- return array && array.length ? baseUniq(array, getIteratee(iteratee2, 2)) : [];
- }
- function uniqWith(array, comparator) {
- comparator = typeof comparator == "function" ? comparator : undefined$1;
- return array && array.length ? baseUniq(array, undefined$1, comparator) : [];
- }
- function unzip(array) {
- if (!(array && array.length)) {
- return [];
- }
- var length = 0;
- array = arrayFilter(array, function(group) {
- if (isArrayLikeObject(group)) {
- length = nativeMax(group.length, length);
- return true;
- }
- });
- return baseTimes(length, function(index) {
- return arrayMap(array, baseProperty(index));
- });
- }
- function unzipWith(array, iteratee2) {
- if (!(array && array.length)) {
- return [];
- }
- var result2 = unzip(array);
- if (iteratee2 == null) {
- return result2;
- }
- return arrayMap(result2, function(group) {
- return apply(iteratee2, undefined$1, group);
- });
- }
- var without = baseRest(function(array, values2) {
- return isArrayLikeObject(array) ? baseDifference(array, values2) : [];
- });
- var xor = baseRest(function(arrays) {
- return baseXor(arrayFilter(arrays, isArrayLikeObject));
- });
- var xorBy = baseRest(function(arrays) {
- var iteratee2 = last(arrays);
- if (isArrayLikeObject(iteratee2)) {
- iteratee2 = undefined$1;
- }
- return baseXor(arrayFilter(arrays, isArrayLikeObject), getIteratee(iteratee2, 2));
- });
- var xorWith = baseRest(function(arrays) {
- var comparator = last(arrays);
- comparator = typeof comparator == "function" ? comparator : undefined$1;
- return baseXor(arrayFilter(arrays, isArrayLikeObject), undefined$1, comparator);
- });
- var zip = baseRest(unzip);
- function zipObject(props, values2) {
- return baseZipObject(props || [], values2 || [], assignValue);
- }
- function zipObjectDeep(props, values2) {
- return baseZipObject(props || [], values2 || [], baseSet);
- }
- var zipWith = baseRest(function(arrays) {
- var length = arrays.length, iteratee2 = length > 1 ? arrays[length - 1] : undefined$1;
- iteratee2 = typeof iteratee2 == "function" ? (arrays.pop(), iteratee2) : undefined$1;
- return unzipWith(arrays, iteratee2);
- });
- function chain(value) {
- var result2 = lodash2(value);
- result2.__chain__ = true;
- return result2;
- }
- function tap(value, interceptor) {
- interceptor(value);
- return value;
- }
- function thru(value, interceptor) {
- return interceptor(value);
- }
- var wrapperAt = flatRest(function(paths) {
- var length = paths.length, start = length ? paths[0] : 0, value = this.__wrapped__, interceptor = function(object) {
- return baseAt(object, paths);
- };
- if (length > 1 || this.__actions__.length || !(value instanceof LazyWrapper) || !isIndex(start)) {
- return this.thru(interceptor);
- }
- value = value.slice(start, +start + (length ? 1 : 0));
- value.__actions__.push({
- "func": thru,
- "args": [interceptor],
- "thisArg": undefined$1
- });
- return new LodashWrapper(value, this.__chain__).thru(function(array) {
- if (length && !array.length) {
- array.push(undefined$1);
- }
- return array;
- });
- });
- function wrapperChain() {
- return chain(this);
- }
- function wrapperCommit() {
- return new LodashWrapper(this.value(), this.__chain__);
- }
- function wrapperNext() {
- if (this.__values__ === undefined$1) {
- this.__values__ = toArray(this.value());
- }
- var done = this.__index__ >= this.__values__.length, value = done ? undefined$1 : this.__values__[this.__index__++];
- return { "done": done, "value": value };
- }
- function wrapperToIterator() {
- return this;
- }
- function wrapperPlant(value) {
- var result2, parent2 = this;
- while (parent2 instanceof baseLodash) {
- var clone2 = wrapperClone(parent2);
- clone2.__index__ = 0;
- clone2.__values__ = undefined$1;
- if (result2) {
- previous.__wrapped__ = clone2;
- } else {
- result2 = clone2;
- }
- var previous = clone2;
- parent2 = parent2.__wrapped__;
- }
- previous.__wrapped__ = value;
- return result2;
- }
- function wrapperReverse() {
- var value = this.__wrapped__;
- if (value instanceof LazyWrapper) {
- var wrapped = value;
- if (this.__actions__.length) {
- wrapped = new LazyWrapper(this);
- }
- wrapped = wrapped.reverse();
- wrapped.__actions__.push({
- "func": thru,
- "args": [reverse],
- "thisArg": undefined$1
- });
- return new LodashWrapper(wrapped, this.__chain__);
- }
- return this.thru(reverse);
- }
- function wrapperValue() {
- return baseWrapperValue(this.__wrapped__, this.__actions__);
- }
- var countBy = createAggregator(function(result2, value, key) {
- if (hasOwnProperty.call(result2, key)) {
- ++result2[key];
- } else {
- baseAssignValue(result2, key, 1);
- }
- });
- function every(collection, predicate, guard) {
- var func = isArray(collection) ? arrayEvery : baseEvery;
- if (guard && isIterateeCall(collection, predicate, guard)) {
- predicate = undefined$1;
- }
- return func(collection, getIteratee(predicate, 3));
- }
- function filter(collection, predicate) {
- var func = isArray(collection) ? arrayFilter : baseFilter;
- return func(collection, getIteratee(predicate, 3));
- }
- var find = createFind(findIndex);
- var findLast = createFind(findLastIndex);
- function flatMap(collection, iteratee2) {
- return baseFlatten(map(collection, iteratee2), 1);
- }
- function flatMapDeep(collection, iteratee2) {
- return baseFlatten(map(collection, iteratee2), INFINITY);
- }
- function flatMapDepth(collection, iteratee2, depth) {
- depth = depth === undefined$1 ? 1 : toInteger(depth);
- return baseFlatten(map(collection, iteratee2), depth);
- }
- function forEach(collection, iteratee2) {
- var func = isArray(collection) ? arrayEach : baseEach;
- return func(collection, getIteratee(iteratee2, 3));
- }
- function forEachRight(collection, iteratee2) {
- var func = isArray(collection) ? arrayEachRight : baseEachRight;
- return func(collection, getIteratee(iteratee2, 3));
- }
- var groupBy = createAggregator(function(result2, value, key) {
- if (hasOwnProperty.call(result2, key)) {
- result2[key].push(value);
- } else {
- baseAssignValue(result2, key, [value]);
- }
- });
- function includes(collection, value, fromIndex, guard) {
- collection = isArrayLike(collection) ? collection : values(collection);
- fromIndex = fromIndex && !guard ? toInteger(fromIndex) : 0;
- var length = collection.length;
- if (fromIndex < 0) {
- fromIndex = nativeMax(length + fromIndex, 0);
- }
- return isString(collection) ? fromIndex <= length && collection.indexOf(value, fromIndex) > -1 : !!length && baseIndexOf(collection, value, fromIndex) > -1;
- }
- var invokeMap = baseRest(function(collection, path, args) {
- var index = -1, isFunc = typeof path == "function", result2 = isArrayLike(collection) ? Array2(collection.length) : [];
- baseEach(collection, function(value) {
- result2[++index] = isFunc ? apply(path, value, args) : baseInvoke(value, path, args);
- });
- return result2;
- });
- var keyBy = createAggregator(function(result2, value, key) {
- baseAssignValue(result2, key, value);
- });
- function map(collection, iteratee2) {
- var func = isArray(collection) ? arrayMap : baseMap;
- return func(collection, getIteratee(iteratee2, 3));
- }
- function orderBy(collection, iteratees, orders, guard) {
- if (collection == null) {
- return [];
- }
- if (!isArray(iteratees)) {
- iteratees = iteratees == null ? [] : [iteratees];
- }
- orders = guard ? undefined$1 : orders;
- if (!isArray(orders)) {
- orders = orders == null ? [] : [orders];
- }
- return baseOrderBy(collection, iteratees, orders);
- }
- var partition = createAggregator(function(result2, value, key) {
- result2[key ? 0 : 1].push(value);
- }, function() {
- return [[], []];
- });
- function reduce(collection, iteratee2, accumulator) {
- var func = isArray(collection) ? arrayReduce : baseReduce, initAccum = arguments.length < 3;
- return func(collection, getIteratee(iteratee2, 4), accumulator, initAccum, baseEach);
- }
- function reduceRight(collection, iteratee2, accumulator) {
- var func = isArray(collection) ? arrayReduceRight : baseReduce, initAccum = arguments.length < 3;
- return func(collection, getIteratee(iteratee2, 4), accumulator, initAccum, baseEachRight);
- }
- function reject(collection, predicate) {
- var func = isArray(collection) ? arrayFilter : baseFilter;
- return func(collection, negate(getIteratee(predicate, 3)));
- }
- function sample(collection) {
- var func = isArray(collection) ? arraySample : baseSample;
- return func(collection);
- }
- function sampleSize(collection, n, guard) {
- if (guard ? isIterateeCall(collection, n, guard) : n === undefined$1) {
- n = 1;
- } else {
- n = toInteger(n);
- }
- var func = isArray(collection) ? arraySampleSize : baseSampleSize;
- return func(collection, n);
- }
- function shuffle(collection) {
- var func = isArray(collection) ? arrayShuffle : baseShuffle;
- return func(collection);
- }
- function size(collection) {
- if (collection == null) {
- return 0;
- }
- if (isArrayLike(collection)) {
- return isString(collection) ? stringSize(collection) : collection.length;
- }
- var tag = getTag(collection);
- if (tag == mapTag || tag == setTag) {
- return collection.size;
- }
- return baseKeys(collection).length;
- }
- function some(collection, predicate, guard) {
- var func = isArray(collection) ? arraySome : baseSome;
- if (guard && isIterateeCall(collection, predicate, guard)) {
- predicate = undefined$1;
- }
- return func(collection, getIteratee(predicate, 3));
- }
- var sortBy = baseRest(function(collection, iteratees) {
- if (collection == null) {
- return [];
- }
- var length = iteratees.length;
- if (length > 1 && isIterateeCall(collection, iteratees[0], iteratees[1])) {
- iteratees = [];
- } else if (length > 2 && isIterateeCall(iteratees[0], iteratees[1], iteratees[2])) {
- iteratees = [iteratees[0]];
- }
- return baseOrderBy(collection, baseFlatten(iteratees, 1), []);
- });
- var now = ctxNow || function() {
- return root.Date.now();
- };
- function after(n, func) {
- if (typeof func != "function") {
- throw new TypeError2(FUNC_ERROR_TEXT);
- }
- n = toInteger(n);
- return function() {
- if (--n < 1) {
- return func.apply(this, arguments);
- }
- };
- }
- function ary(func, n, guard) {
- n = guard ? undefined$1 : n;
- n = func && n == null ? func.length : n;
- return createWrap(func, WRAP_ARY_FLAG, undefined$1, undefined$1, undefined$1, undefined$1, n);
- }
- function before(n, func) {
- var result2;
- if (typeof func != "function") {
- throw new TypeError2(FUNC_ERROR_TEXT);
- }
- n = toInteger(n);
- return function() {
- if (--n > 0) {
- result2 = func.apply(this, arguments);
- }
- if (n <= 1) {
- func = undefined$1;
- }
- return result2;
- };
- }
- var bind = baseRest(function(func, thisArg, partials) {
- var bitmask = WRAP_BIND_FLAG;
- if (partials.length) {
- var holders = replaceHolders(partials, getHolder(bind));
- bitmask |= WRAP_PARTIAL_FLAG;
- }
- return createWrap(func, bitmask, thisArg, partials, holders);
- });
- var bindKey = baseRest(function(object, key, partials) {
- var bitmask = WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG;
- if (partials.length) {
- var holders = replaceHolders(partials, getHolder(bindKey));
- bitmask |= WRAP_PARTIAL_FLAG;
- }
- return createWrap(key, bitmask, object, partials, holders);
- });
- function curry(func, arity, guard) {
- arity = guard ? undefined$1 : arity;
- var result2 = createWrap(func, WRAP_CURRY_FLAG, undefined$1, undefined$1, undefined$1, undefined$1, undefined$1, arity);
- result2.placeholder = curry.placeholder;
- return result2;
- }
- function curryRight(func, arity, guard) {
- arity = guard ? undefined$1 : arity;
- var result2 = createWrap(func, WRAP_CURRY_RIGHT_FLAG, undefined$1, undefined$1, undefined$1, undefined$1, undefined$1, arity);
- result2.placeholder = curryRight.placeholder;
- return result2;
- }
- function debounce(func, wait, options) {
- var lastArgs, lastThis, maxWait, result2, timerId, lastCallTime, lastInvokeTime = 0, leading = false, maxing = false, trailing = true;
- if (typeof func != "function") {
- throw new TypeError2(FUNC_ERROR_TEXT);
- }
- wait = toNumber(wait) || 0;
- if (isObject(options)) {
- leading = !!options.leading;
- maxing = "maxWait" in options;
- maxWait = maxing ? nativeMax(toNumber(options.maxWait) || 0, wait) : maxWait;
- trailing = "trailing" in options ? !!options.trailing : trailing;
- }
- function invokeFunc(time) {
- var args = lastArgs, thisArg = lastThis;
- lastArgs = lastThis = undefined$1;
- lastInvokeTime = time;
- result2 = func.apply(thisArg, args);
- return result2;
- }
- function leadingEdge(time) {
- lastInvokeTime = time;
- timerId = setTimeout(timerExpired, wait);
- return leading ? invokeFunc(time) : result2;
- }
- function remainingWait(time) {
- var timeSinceLastCall = time - lastCallTime, timeSinceLastInvoke = time - lastInvokeTime, timeWaiting = wait - timeSinceLastCall;
- return maxing ? nativeMin(timeWaiting, maxWait - timeSinceLastInvoke) : timeWaiting;
- }
- function shouldInvoke(time) {
- var timeSinceLastCall = time - lastCallTime, timeSinceLastInvoke = time - lastInvokeTime;
- return lastCallTime === undefined$1 || timeSinceLastCall >= wait || timeSinceLastCall < 0 || maxing && timeSinceLastInvoke >= maxWait;
- }
- function timerExpired() {
- var time = now();
- if (shouldInvoke(time)) {
- return trailingEdge(time);
- }
- timerId = setTimeout(timerExpired, remainingWait(time));
- }
- function trailingEdge(time) {
- timerId = undefined$1;
- if (trailing && lastArgs) {
- return invokeFunc(time);
- }
- lastArgs = lastThis = undefined$1;
- return result2;
- }
- function cancel() {
- if (timerId !== undefined$1) {
- clearTimeout(timerId);
- }
- lastInvokeTime = 0;
- lastArgs = lastCallTime = lastThis = timerId = undefined$1;
- }
- function flush() {
- return timerId === undefined$1 ? result2 : trailingEdge(now());
- }
- function debounced() {
- var time = now(), isInvoking = shouldInvoke(time);
- lastArgs = arguments;
- lastThis = this;
- lastCallTime = time;
- if (isInvoking) {
- if (timerId === undefined$1) {
- return leadingEdge(lastCallTime);
- }
- if (maxing) {
- clearTimeout(timerId);
- timerId = setTimeout(timerExpired, wait);
- return invokeFunc(lastCallTime);
- }
- }
- if (timerId === undefined$1) {
- timerId = setTimeout(timerExpired, wait);
- }
- return result2;
- }
- debounced.cancel = cancel;
- debounced.flush = flush;
- return debounced;
- }
- var defer = baseRest(function(func, args) {
- return baseDelay(func, 1, args);
- });
- var delay = baseRest(function(func, wait, args) {
- return baseDelay(func, toNumber(wait) || 0, args);
- });
- function flip(func) {
- return createWrap(func, WRAP_FLIP_FLAG);
- }
- function memoize(func, resolver) {
- if (typeof func != "function" || resolver != null && typeof resolver != "function") {
- throw new TypeError2(FUNC_ERROR_TEXT);
- }
- var memoized = function() {
- var args = arguments, key = resolver ? resolver.apply(this, args) : args[0], cache = memoized.cache;
- if (cache.has(key)) {
- return cache.get(key);
- }
- var result2 = func.apply(this, args);
- memoized.cache = cache.set(key, result2) || cache;
- return result2;
- };
- memoized.cache = new (memoize.Cache || MapCache)();
- return memoized;
- }
- memoize.Cache = MapCache;
- function negate(predicate) {
- if (typeof predicate != "function") {
- throw new TypeError2(FUNC_ERROR_TEXT);
- }
- return function() {
- var args = arguments;
- switch (args.length) {
- case 0:
- return !predicate.call(this);
- case 1:
- return !predicate.call(this, args[0]);
- case 2:
- return !predicate.call(this, args[0], args[1]);
- case 3:
- return !predicate.call(this, args[0], args[1], args[2]);
- }
- return !predicate.apply(this, args);
- };
- }
- function once(func) {
- return before(2, func);
- }
- var overArgs = castRest(function(func, transforms) {
- transforms = transforms.length == 1 && isArray(transforms[0]) ? arrayMap(transforms[0], baseUnary(getIteratee())) : arrayMap(baseFlatten(transforms, 1), baseUnary(getIteratee()));
- var funcsLength = transforms.length;
- return baseRest(function(args) {
- var index = -1, length = nativeMin(args.length, funcsLength);
- while (++index < length) {
- args[index] = transforms[index].call(this, args[index]);
- }
- return apply(func, this, args);
- });
- });
- var partial = baseRest(function(func, partials) {
- var holders = replaceHolders(partials, getHolder(partial));
- return createWrap(func, WRAP_PARTIAL_FLAG, undefined$1, partials, holders);
- });
- var partialRight = baseRest(function(func, partials) {
- var holders = replaceHolders(partials, getHolder(partialRight));
- return createWrap(func, WRAP_PARTIAL_RIGHT_FLAG, undefined$1, partials, holders);
- });
- var rearg = flatRest(function(func, indexes) {
- return createWrap(func, WRAP_REARG_FLAG, undefined$1, undefined$1, undefined$1, indexes);
- });
- function rest(func, start) {
- if (typeof func != "function") {
- throw new TypeError2(FUNC_ERROR_TEXT);
- }
- start = start === undefined$1 ? start : toInteger(start);
- return baseRest(func, start);
- }
- function spread(func, start) {
- if (typeof func != "function") {
- throw new TypeError2(FUNC_ERROR_TEXT);
- }
- start = start == null ? 0 : nativeMax(toInteger(start), 0);
- return baseRest(function(args) {
- var array = args[start], otherArgs = castSlice(args, 0, start);
- if (array) {
- arrayPush(otherArgs, array);
- }
- return apply(func, this, otherArgs);
- });
- }
- function throttle(func, wait, options) {
- var leading = true, trailing = true;
- if (typeof func != "function") {
- throw new TypeError2(FUNC_ERROR_TEXT);
- }
- if (isObject(options)) {
- leading = "leading" in options ? !!options.leading : leading;
- trailing = "trailing" in options ? !!options.trailing : trailing;
- }
- return debounce(func, wait, {
- "leading": leading,
- "maxWait": wait,
- "trailing": trailing
- });
- }
- function unary(func) {
- return ary(func, 1);
- }
- function wrap(value, wrapper) {
- return partial(castFunction(wrapper), value);
- }
- function castArray() {
- if (!arguments.length) {
- return [];
- }
- var value = arguments[0];
- return isArray(value) ? value : [value];
- }
- function clone(value) {
- return baseClone(value, CLONE_SYMBOLS_FLAG);
- }
- function cloneWith(value, customizer) {
- customizer = typeof customizer == "function" ? customizer : undefined$1;
- return baseClone(value, CLONE_SYMBOLS_FLAG, customizer);
- }
- function cloneDeep(value) {
- return baseClone(value, CLONE_DEEP_FLAG | CLONE_SYMBOLS_FLAG);
- }
- function cloneDeepWith(value, customizer) {
- customizer = typeof customizer == "function" ? customizer : undefined$1;
- return baseClone(value, CLONE_DEEP_FLAG | CLONE_SYMBOLS_FLAG, customizer);
- }
- function conformsTo(object, source) {
- return source == null || baseConformsTo(object, source, keys(source));
- }
- function eq(value, other) {
- return value === other || value !== value && other !== other;
- }
- var gt = createRelationalOperation(baseGt);
- var gte = createRelationalOperation(function(value, other) {
- return value >= other;
- });
- var isArguments = baseIsArguments(function() {
- return arguments;
- }()) ? baseIsArguments : function(value) {
- return isObjectLike(value) && hasOwnProperty.call(value, "callee") && !propertyIsEnumerable.call(value, "callee");
- };
- var isArray = Array2.isArray;
- var isArrayBuffer = nodeIsArrayBuffer ? baseUnary(nodeIsArrayBuffer) : baseIsArrayBuffer;
- function isArrayLike(value) {
- return value != null && isLength(value.length) && !isFunction(value);
- }
- function isArrayLikeObject(value) {
- return isObjectLike(value) && isArrayLike(value);
- }
- function isBoolean(value) {
- return value === true || value === false || isObjectLike(value) && baseGetTag(value) == boolTag;
- }
- var isBuffer = nativeIsBuffer || stubFalse;
- var isDate = nodeIsDate ? baseUnary(nodeIsDate) : baseIsDate;
- function isElement(value) {
- return isObjectLike(value) && value.nodeType === 1 && !isPlainObject(value);
- }
- function isEmpty(value) {
- if (value == null) {
- return true;
- }
- if (isArrayLike(value) && (isArray(value) || typeof value == "string" || typeof value.splice == "function" || isBuffer(value) || isTypedArray(value) || isArguments(value))) {
- return !value.length;
- }
- var tag = getTag(value);
- if (tag == mapTag || tag == setTag) {
- return !value.size;
- }
- if (isPrototype(value)) {
- return !baseKeys(value).length;
- }
- for (var key in value) {
- if (hasOwnProperty.call(value, key)) {
- return false;
- }
- }
- return true;
- }
- function isEqual(value, other) {
- return baseIsEqual(value, other);
- }
- function isEqualWith(value, other, customizer) {
- customizer = typeof customizer == "function" ? customizer : undefined$1;
- var result2 = customizer ? customizer(value, other) : undefined$1;
- return result2 === undefined$1 ? baseIsEqual(value, other, undefined$1, customizer) : !!result2;
- }
- function isError(value) {
- if (!isObjectLike(value)) {
- return false;
- }
- var tag = baseGetTag(value);
- return tag == errorTag || tag == domExcTag || typeof value.message == "string" && typeof value.name == "string" && !isPlainObject(value);
- }
- function isFinite2(value) {
- return typeof value == "number" && nativeIsFinite(value);
- }
- function isFunction(value) {
- if (!isObject(value)) {
- return false;
- }
- var tag = baseGetTag(value);
- return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag;
- }
- function isInteger(value) {
- return typeof value == "number" && value == toInteger(value);
- }
- function isLength(value) {
- return typeof value == "number" && value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;
- }
- function isObject(value) {
- var type = typeof value;
- return value != null && (type == "object" || type == "function");
- }
- function isObjectLike(value) {
- return value != null && typeof value == "object";
- }
- var isMap = nodeIsMap ? baseUnary(nodeIsMap) : baseIsMap;
- function isMatch(object, source) {
- return object === source || baseIsMatch(object, source, getMatchData(source));
- }
- function isMatchWith(object, source, customizer) {
- customizer = typeof customizer == "function" ? customizer : undefined$1;
- return baseIsMatch(object, source, getMatchData(source), customizer);
- }
- function isNaN2(value) {
- return isNumber(value) && value != +value;
- }
- function isNative(value) {
- if (isMaskable(value)) {
- throw new Error2(CORE_ERROR_TEXT);
- }
- return baseIsNative(value);
- }
- function isNull(value) {
- return value === null;
- }
- function isNil(value) {
- return value == null;
- }
- function isNumber(value) {
- return typeof value == "number" || isObjectLike(value) && baseGetTag(value) == numberTag;
- }
- function isPlainObject(value) {
- if (!isObjectLike(value) || baseGetTag(value) != objectTag) {
- return false;
- }
- var proto = getPrototype(value);
- if (proto === null) {
- return true;
- }
- var Ctor = hasOwnProperty.call(proto, "constructor") && proto.constructor;
- return typeof Ctor == "function" && Ctor instanceof Ctor && funcToString.call(Ctor) == objectCtorString;
- }
- var isRegExp = nodeIsRegExp ? baseUnary(nodeIsRegExp) : baseIsRegExp;
- function isSafeInteger(value) {
- return isInteger(value) && value >= -MAX_SAFE_INTEGER && value <= MAX_SAFE_INTEGER;
- }
- var isSet = nodeIsSet ? baseUnary(nodeIsSet) : baseIsSet;
- function isString(value) {
- return typeof value == "string" || !isArray(value) && isObjectLike(value) && baseGetTag(value) == stringTag;
- }
- function isSymbol(value) {
- return typeof value == "symbol" || isObjectLike(value) && baseGetTag(value) == symbolTag;
- }
- var isTypedArray = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray;
- function isUndefined(value) {
- return value === undefined$1;
- }
- function isWeakMap(value) {
- return isObjectLike(value) && getTag(value) == weakMapTag;
- }
- function isWeakSet(value) {
- return isObjectLike(value) && baseGetTag(value) == weakSetTag;
- }
- var lt = createRelationalOperation(baseLt);
- var lte = createRelationalOperation(function(value, other) {
- return value <= other;
- });
- function toArray(value) {
- if (!value) {
- return [];
- }
- if (isArrayLike(value)) {
- return isString(value) ? stringToArray(value) : copyArray(value);
- }
- if (symIterator && value[symIterator]) {
- return iteratorToArray(value[symIterator]());
- }
- var tag = getTag(value), func = tag == mapTag ? mapToArray : tag == setTag ? setToArray : values;
- return func(value);
- }
- function toFinite(value) {
- if (!value) {
- return value === 0 ? value : 0;
- }
- value = toNumber(value);
- if (value === INFINITY || value === -INFINITY) {
- var sign = value < 0 ? -1 : 1;
- return sign * MAX_INTEGER;
- }
- return value === value ? value : 0;
- }
- function toInteger(value) {
- var result2 = toFinite(value), remainder = result2 % 1;
- return result2 === result2 ? remainder ? result2 - remainder : result2 : 0;
- }
- function toLength(value) {
- return value ? baseClamp(toInteger(value), 0, MAX_ARRAY_LENGTH) : 0;
- }
- function toNumber(value) {
- if (typeof value == "number") {
- return value;
- }
- if (isSymbol(value)) {
- return NAN;
- }
- if (isObject(value)) {
- var other = typeof value.valueOf == "function" ? value.valueOf() : value;
- value = isObject(other) ? other + "" : other;
- }
- if (typeof value != "string") {
- return value === 0 ? value : +value;
- }
- value = baseTrim(value);
- var isBinary = reIsBinary.test(value);
- return isBinary || reIsOctal.test(value) ? freeParseInt(value.slice(2), isBinary ? 2 : 8) : reIsBadHex.test(value) ? NAN : +value;
- }
- function toPlainObject(value) {
- return copyObject(value, keysIn(value));
- }
- function toSafeInteger(value) {
- return value ? baseClamp(toInteger(value), -MAX_SAFE_INTEGER, MAX_SAFE_INTEGER) : value === 0 ? value : 0;
- }
- function toString(value) {
- return value == null ? "" : baseToString(value);
- }
- var assign = createAssigner(function(object, source) {
- if (isPrototype(source) || isArrayLike(source)) {
- copyObject(source, keys(source), object);
- return;
- }
- for (var key in source) {
- if (hasOwnProperty.call(source, key)) {
- assignValue(object, key, source[key]);
- }
- }
- });
- var assignIn = createAssigner(function(object, source) {
- copyObject(source, keysIn(source), object);
- });
- var assignInWith = createAssigner(function(object, source, srcIndex, customizer) {
- copyObject(source, keysIn(source), object, customizer);
- });
- var assignWith = createAssigner(function(object, source, srcIndex, customizer) {
- copyObject(source, keys(source), object, customizer);
- });
- var at = flatRest(baseAt);
- function create(prototype, properties) {
- var result2 = baseCreate(prototype);
- return properties == null ? result2 : baseAssign(result2, properties);
- }
- var defaults = baseRest(function(object, sources) {
- object = Object2(object);
- var index = -1;
- var length = sources.length;
- var guard = length > 2 ? sources[2] : undefined$1;
- if (guard && isIterateeCall(sources[0], sources[1], guard)) {
- length = 1;
- }
- while (++index < length) {
- var source = sources[index];
- var props = keysIn(source);
- var propsIndex = -1;
- var propsLength = props.length;
- while (++propsIndex < propsLength) {
- var key = props[propsIndex];
- var value = object[key];
- if (value === undefined$1 || eq(value, objectProto[key]) && !hasOwnProperty.call(object, key)) {
- object[key] = source[key];
- }
- }
- }
- return object;
- });
- var defaultsDeep = baseRest(function(args) {
- args.push(undefined$1, customDefaultsMerge);
- return apply(mergeWith, undefined$1, args);
- });
- function findKey(object, predicate) {
- return baseFindKey(object, getIteratee(predicate, 3), baseForOwn);
- }
- function findLastKey(object, predicate) {
- return baseFindKey(object, getIteratee(predicate, 3), baseForOwnRight);
- }
- function forIn(object, iteratee2) {
- return object == null ? object : baseFor(object, getIteratee(iteratee2, 3), keysIn);
- }
- function forInRight(object, iteratee2) {
- return object == null ? object : baseForRight(object, getIteratee(iteratee2, 3), keysIn);
- }
- function forOwn(object, iteratee2) {
- return object && baseForOwn(object, getIteratee(iteratee2, 3));
- }
- function forOwnRight(object, iteratee2) {
- return object && baseForOwnRight(object, getIteratee(iteratee2, 3));
- }
- function functions(object) {
- return object == null ? [] : baseFunctions(object, keys(object));
- }
- function functionsIn(object) {
- return object == null ? [] : baseFunctions(object, keysIn(object));
- }
- function get(object, path, defaultValue) {
- var result2 = object == null ? undefined$1 : baseGet(object, path);
- return result2 === undefined$1 ? defaultValue : result2;
- }
- function has(object, path) {
- return object != null && hasPath(object, path, baseHas);
- }
- function hasIn(object, path) {
- return object != null && hasPath(object, path, baseHasIn);
- }
- var invert = createInverter(function(result2, value, key) {
- if (value != null && typeof value.toString != "function") {
- value = nativeObjectToString.call(value);
- }
- result2[value] = key;
- }, constant(identity));
- var invertBy = createInverter(function(result2, value, key) {
- if (value != null && typeof value.toString != "function") {
- value = nativeObjectToString.call(value);
- }
- if (hasOwnProperty.call(result2, value)) {
- result2[value].push(key);
- } else {
- result2[value] = [key];
- }
- }, getIteratee);
- var invoke = baseRest(baseInvoke);
- function keys(object) {
- return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object);
- }
- function keysIn(object) {
- return isArrayLike(object) ? arrayLikeKeys(object, true) : baseKeysIn(object);
- }
- function mapKeys(object, iteratee2) {
- var result2 = {};
- iteratee2 = getIteratee(iteratee2, 3);
- baseForOwn(object, function(value, key, object2) {
- baseAssignValue(result2, iteratee2(value, key, object2), value);
- });
- return result2;
- }
- function mapValues(object, iteratee2) {
- var result2 = {};
- iteratee2 = getIteratee(iteratee2, 3);
- baseForOwn(object, function(value, key, object2) {
- baseAssignValue(result2, key, iteratee2(value, key, object2));
- });
- return result2;
- }
- var merge = createAssigner(function(object, source, srcIndex) {
- baseMerge(object, source, srcIndex);
- });
- var mergeWith = createAssigner(function(object, source, srcIndex, customizer) {
- baseMerge(object, source, srcIndex, customizer);
- });
- var omit = flatRest(function(object, paths) {
- var result2 = {};
- if (object == null) {
- return result2;
- }
- var isDeep = false;
- paths = arrayMap(paths, function(path) {
- path = castPath(path, object);
- isDeep || (isDeep = path.length > 1);
- return path;
- });
- copyObject(object, getAllKeysIn(object), result2);
- if (isDeep) {
- result2 = baseClone(result2, CLONE_DEEP_FLAG | CLONE_FLAT_FLAG | CLONE_SYMBOLS_FLAG, customOmitClone);
- }
- var length = paths.length;
- while (length--) {
- baseUnset(result2, paths[length]);
- }
- return result2;
- });
- function omitBy(object, predicate) {
- return pickBy(object, negate(getIteratee(predicate)));
- }
- var pick = flatRest(function(object, paths) {
- return object == null ? {} : basePick(object, paths);
- });
- function pickBy(object, predicate) {
- if (object == null) {
- return {};
- }
- var props = arrayMap(getAllKeysIn(object), function(prop) {
- return [prop];
- });
- predicate = getIteratee(predicate);
- return basePickBy(object, props, function(value, path) {
- return predicate(value, path[0]);
- });
- }
- function result(object, path, defaultValue) {
- path = castPath(path, object);
- var index = -1, length = path.length;
- if (!length) {
- length = 1;
- object = undefined$1;
- }
- while (++index < length) {
- var value = object == null ? undefined$1 : object[toKey(path[index])];
- if (value === undefined$1) {
- index = length;
- value = defaultValue;
- }
- object = isFunction(value) ? value.call(object) : value;
- }
- return object;
- }
- function set(object, path, value) {
- return object == null ? object : baseSet(object, path, value);
- }
- function setWith(object, path, value, customizer) {
- customizer = typeof customizer == "function" ? customizer : undefined$1;
- return object == null ? object : baseSet(object, path, value, customizer);
- }
- var toPairs = createToPairs(keys);
- var toPairsIn = createToPairs(keysIn);
- function transform(object, iteratee2, accumulator) {
- var isArr = isArray(object), isArrLike = isArr || isBuffer(object) || isTypedArray(object);
- iteratee2 = getIteratee(iteratee2, 4);
- if (accumulator == null) {
- var Ctor = object && object.constructor;
- if (isArrLike) {
- accumulator = isArr ? new Ctor() : [];
- } else if (isObject(object)) {
- accumulator = isFunction(Ctor) ? baseCreate(getPrototype(object)) : {};
- } else {
- accumulator = {};
- }
- }
- (isArrLike ? arrayEach : baseForOwn)(object, function(value, index, object2) {
- return iteratee2(accumulator, value, index, object2);
- });
- return accumulator;
- }
- function unset(object, path) {
- return object == null ? true : baseUnset(object, path);
- }
- function update(object, path, updater) {
- return object == null ? object : baseUpdate(object, path, castFunction(updater));
- }
- function updateWith(object, path, updater, customizer) {
- customizer = typeof customizer == "function" ? customizer : undefined$1;
- return object == null ? object : baseUpdate(object, path, castFunction(updater), customizer);
- }
- function values(object) {
- return object == null ? [] : baseValues(object, keys(object));
- }
- function valuesIn(object) {
- return object == null ? [] : baseValues(object, keysIn(object));
- }
- function clamp(number, lower, upper) {
- if (upper === undefined$1) {
- upper = lower;
- lower = undefined$1;
- }
- if (upper !== undefined$1) {
- upper = toNumber(upper);
- upper = upper === upper ? upper : 0;
- }
- if (lower !== undefined$1) {
- lower = toNumber(lower);
- lower = lower === lower ? lower : 0;
- }
- return baseClamp(toNumber(number), lower, upper);
- }
- function inRange(number, start, end) {
- start = toFinite(start);
- if (end === undefined$1) {
- end = start;
- start = 0;
- } else {
- end = toFinite(end);
- }
- number = toNumber(number);
- return baseInRange(number, start, end);
- }
- function random(lower, upper, floating) {
- if (floating && typeof floating != "boolean" && isIterateeCall(lower, upper, floating)) {
- upper = floating = undefined$1;
- }
- if (floating === undefined$1) {
- if (typeof upper == "boolean") {
- floating = upper;
- upper = undefined$1;
- } else if (typeof lower == "boolean") {
- floating = lower;
- lower = undefined$1;
- }
- }
- if (lower === undefined$1 && upper === undefined$1) {
- lower = 0;
- upper = 1;
- } else {
- lower = toFinite(lower);
- if (upper === undefined$1) {
- upper = lower;
- lower = 0;
- } else {
- upper = toFinite(upper);
- }
- }
- if (lower > upper) {
- var temp = lower;
- lower = upper;
- upper = temp;
- }
- if (floating || lower % 1 || upper % 1) {
- var rand = nativeRandom();
- return nativeMin(lower + rand * (upper - lower + freeParseFloat("1e-" + ((rand + "").length - 1))), upper);
- }
- return baseRandom(lower, upper);
- }
- var camelCase = createCompounder(function(result2, word, index) {
- word = word.toLowerCase();
- return result2 + (index ? capitalize(word) : word);
- });
- function capitalize(string) {
- return upperFirst(toString(string).toLowerCase());
- }
- function deburr(string) {
- string = toString(string);
- return string && string.replace(reLatin, deburrLetter).replace(reComboMark, "");
- }
- function endsWith(string, target, position) {
- string = toString(string);
- target = baseToString(target);
- var length = string.length;
- position = position === undefined$1 ? length : baseClamp(toInteger(position), 0, length);
- var end = position;
- position -= target.length;
- return position >= 0 && string.slice(position, end) == target;
- }
- function escape(string) {
- string = toString(string);
- return string && reHasUnescapedHtml.test(string) ? string.replace(reUnescapedHtml, escapeHtmlChar) : string;
- }
- function escapeRegExp(string) {
- string = toString(string);
- return string && reHasRegExpChar.test(string) ? string.replace(reRegExpChar, "\\$&") : string;
- }
- var kebabCase = createCompounder(function(result2, word, index) {
- return result2 + (index ? "-" : "") + word.toLowerCase();
- });
- var lowerCase = createCompounder(function(result2, word, index) {
- return result2 + (index ? " " : "") + word.toLowerCase();
- });
- var lowerFirst = createCaseFirst("toLowerCase");
- function pad(string, length, chars) {
- string = toString(string);
- length = toInteger(length);
- var strLength = length ? stringSize(string) : 0;
- if (!length || strLength >= length) {
- return string;
- }
- var mid = (length - strLength) / 2;
- return createPadding(nativeFloor(mid), chars) + string + createPadding(nativeCeil(mid), chars);
- }
- function padEnd(string, length, chars) {
- string = toString(string);
- length = toInteger(length);
- var strLength = length ? stringSize(string) : 0;
- return length && strLength < length ? string + createPadding(length - strLength, chars) : string;
- }
- function padStart(string, length, chars) {
- string = toString(string);
- length = toInteger(length);
- var strLength = length ? stringSize(string) : 0;
- return length && strLength < length ? createPadding(length - strLength, chars) + string : string;
- }
- function parseInt2(string, radix, guard) {
- if (guard || radix == null) {
- radix = 0;
- } else if (radix) {
- radix = +radix;
- }
- return nativeParseInt(toString(string).replace(reTrimStart, ""), radix || 0);
- }
- function repeat(string, n, guard) {
- if (guard ? isIterateeCall(string, n, guard) : n === undefined$1) {
- n = 1;
- } else {
- n = toInteger(n);
- }
- return baseRepeat(toString(string), n);
- }
- function replace() {
- var args = arguments, string = toString(args[0]);
- return args.length < 3 ? string : string.replace(args[1], args[2]);
- }
- var snakeCase = createCompounder(function(result2, word, index) {
- return result2 + (index ? "_" : "") + word.toLowerCase();
- });
- function split(string, separator, limit) {
- if (limit && typeof limit != "number" && isIterateeCall(string, separator, limit)) {
- separator = limit = undefined$1;
- }
- limit = limit === undefined$1 ? MAX_ARRAY_LENGTH : limit >>> 0;
- if (!limit) {
- return [];
- }
- string = toString(string);
- if (string && (typeof separator == "string" || separator != null && !isRegExp(separator))) {
- separator = baseToString(separator);
- if (!separator && hasUnicode(string)) {
- return castSlice(stringToArray(string), 0, limit);
- }
- }
- return string.split(separator, limit);
- }
- var startCase = createCompounder(function(result2, word, index) {
- return result2 + (index ? " " : "") + upperFirst(word);
- });
- function startsWith(string, target, position) {
- string = toString(string);
- position = position == null ? 0 : baseClamp(toInteger(position), 0, string.length);
- target = baseToString(target);
- return string.slice(position, position + target.length) == target;
- }
- function template(string, options, guard) {
- var settings = lodash2.templateSettings;
- if (guard && isIterateeCall(string, options, guard)) {
- options = undefined$1;
- }
- string = toString(string);
- options = assignInWith({}, options, settings, customDefaultsAssignIn);
- var imports = assignInWith({}, options.imports, settings.imports, customDefaultsAssignIn), importsKeys = keys(imports), importsValues = baseValues(imports, importsKeys);
- var isEscaping, isEvaluating, index = 0, interpolate = options.interpolate || reNoMatch, source = "__p += '";
- var reDelimiters = RegExp2(
- (options.escape || reNoMatch).source + "|" + interpolate.source + "|" + (interpolate === reInterpolate ? reEsTemplate : reNoMatch).source + "|" + (options.evaluate || reNoMatch).source + "|$",
- "g"
- );
- var sourceURL = "//# sourceURL=" + (hasOwnProperty.call(options, "sourceURL") ? (options.sourceURL + "").replace(/\s/g, " ") : "lodash.templateSources[" + ++templateCounter + "]") + "\n";
- string.replace(reDelimiters, function(match, escapeValue, interpolateValue, esTemplateValue, evaluateValue, offset) {
- interpolateValue || (interpolateValue = esTemplateValue);
- source += string.slice(index, offset).replace(reUnescapedString, escapeStringChar);
- if (escapeValue) {
- isEscaping = true;
- source += "' +\n__e(" + escapeValue + ") +\n'";
- }
- if (evaluateValue) {
- isEvaluating = true;
- source += "';\n" + evaluateValue + ";\n__p += '";
- }
- if (interpolateValue) {
- source += "' +\n((__t = (" + interpolateValue + ")) == null ? '' : __t) +\n'";
- }
- index = offset + match.length;
- return match;
- });
- source += "';\n";
- var variable = hasOwnProperty.call(options, "variable") && options.variable;
- if (!variable) {
- source = "with (obj) {\n" + source + "\n}\n";
- } else if (reForbiddenIdentifierChars.test(variable)) {
- throw new Error2(INVALID_TEMPL_VAR_ERROR_TEXT);
- }
- source = (isEvaluating ? source.replace(reEmptyStringLeading, "") : source).replace(reEmptyStringMiddle, "$1").replace(reEmptyStringTrailing, "$1;");
- source = "function(" + (variable || "obj") + ") {\n" + (variable ? "" : "obj || (obj = {});\n") + "var __t, __p = ''" + (isEscaping ? ", __e = _.escape" : "") + (isEvaluating ? ", __j = Array.prototype.join;\nfunction print() { __p += __j.call(arguments, '') }\n" : ";\n") + source + "return __p\n}";
- var result2 = attempt(function() {
- return Function2(importsKeys, sourceURL + "return " + source).apply(undefined$1, importsValues);
- });
- result2.source = source;
- if (isError(result2)) {
- throw result2;
- }
- return result2;
- }
- function toLower(value) {
- return toString(value).toLowerCase();
- }
- function toUpper(value) {
- return toString(value).toUpperCase();
- }
- function trim(string, chars, guard) {
- string = toString(string);
- if (string && (guard || chars === undefined$1)) {
- return baseTrim(string);
- }
- if (!string || !(chars = baseToString(chars))) {
- return string;
- }
- var strSymbols = stringToArray(string), chrSymbols = stringToArray(chars), start = charsStartIndex(strSymbols, chrSymbols), end = charsEndIndex(strSymbols, chrSymbols) + 1;
- return castSlice(strSymbols, start, end).join("");
- }
- function trimEnd(string, chars, guard) {
- string = toString(string);
- if (string && (guard || chars === undefined$1)) {
- return string.slice(0, trimmedEndIndex(string) + 1);
- }
- if (!string || !(chars = baseToString(chars))) {
- return string;
- }
- var strSymbols = stringToArray(string), end = charsEndIndex(strSymbols, stringToArray(chars)) + 1;
- return castSlice(strSymbols, 0, end).join("");
- }
- function trimStart(string, chars, guard) {
- string = toString(string);
- if (string && (guard || chars === undefined$1)) {
- return string.replace(reTrimStart, "");
- }
- if (!string || !(chars = baseToString(chars))) {
- return string;
- }
- var strSymbols = stringToArray(string), start = charsStartIndex(strSymbols, stringToArray(chars));
- return castSlice(strSymbols, start).join("");
- }
- function truncate(string, options) {
- var length = DEFAULT_TRUNC_LENGTH, omission = DEFAULT_TRUNC_OMISSION;
- if (isObject(options)) {
- var separator = "separator" in options ? options.separator : separator;
- length = "length" in options ? toInteger(options.length) : length;
- omission = "omission" in options ? baseToString(options.omission) : omission;
- }
- string = toString(string);
- var strLength = string.length;
- if (hasUnicode(string)) {
- var strSymbols = stringToArray(string);
- strLength = strSymbols.length;
- }
- if (length >= strLength) {
- return string;
- }
- var end = length - stringSize(omission);
- if (end < 1) {
- return omission;
- }
- var result2 = strSymbols ? castSlice(strSymbols, 0, end).join("") : string.slice(0, end);
- if (separator === undefined$1) {
- return result2 + omission;
- }
- if (strSymbols) {
- end += result2.length - end;
- }
- if (isRegExp(separator)) {
- if (string.slice(end).search(separator)) {
- var match, substring = result2;
- if (!separator.global) {
- separator = RegExp2(separator.source, toString(reFlags.exec(separator)) + "g");
- }
- separator.lastIndex = 0;
- while (match = separator.exec(substring)) {
- var newEnd = match.index;
- }
- result2 = result2.slice(0, newEnd === undefined$1 ? end : newEnd);
- }
- } else if (string.indexOf(baseToString(separator), end) != end) {
- var index = result2.lastIndexOf(separator);
- if (index > -1) {
- result2 = result2.slice(0, index);
- }
- }
- return result2 + omission;
- }
- function unescape(string) {
- string = toString(string);
- return string && reHasEscapedHtml.test(string) ? string.replace(reEscapedHtml, unescapeHtmlChar) : string;
- }
- var upperCase = createCompounder(function(result2, word, index) {
- return result2 + (index ? " " : "") + word.toUpperCase();
- });
- var upperFirst = createCaseFirst("toUpperCase");
- function words(string, pattern, guard) {
- string = toString(string);
- pattern = guard ? undefined$1 : pattern;
- if (pattern === undefined$1) {
- return hasUnicodeWord(string) ? unicodeWords(string) : asciiWords(string);
- }
- return string.match(pattern) || [];
- }
- var attempt = baseRest(function(func, args) {
- try {
- return apply(func, undefined$1, args);
- } catch (e) {
- return isError(e) ? e : new Error2(e);
- }
- });
- var bindAll = flatRest(function(object, methodNames) {
- arrayEach(methodNames, function(key) {
- key = toKey(key);
- baseAssignValue(object, key, bind(object[key], object));
- });
- return object;
- });
- function cond(pairs) {
- var length = pairs == null ? 0 : pairs.length, toIteratee = getIteratee();
- pairs = !length ? [] : arrayMap(pairs, function(pair) {
- if (typeof pair[1] != "function") {
- throw new TypeError2(FUNC_ERROR_TEXT);
- }
- return [toIteratee(pair[0]), pair[1]];
- });
- return baseRest(function(args) {
- var index = -1;
- while (++index < length) {
- var pair = pairs[index];
- if (apply(pair[0], this, args)) {
- return apply(pair[1], this, args);
- }
- }
- });
- }
- function conforms(source) {
- return baseConforms(baseClone(source, CLONE_DEEP_FLAG));
- }
- function constant(value) {
- return function() {
- return value;
- };
- }
- function defaultTo(value, defaultValue) {
- return value == null || value !== value ? defaultValue : value;
- }
- var flow = createFlow();
- var flowRight = createFlow(true);
- function identity(value) {
- return value;
- }
- function iteratee(func) {
- return baseIteratee(typeof func == "function" ? func : baseClone(func, CLONE_DEEP_FLAG));
- }
- function matches(source) {
- return baseMatches(baseClone(source, CLONE_DEEP_FLAG));
- }
- function matchesProperty(path, srcValue) {
- return baseMatchesProperty(path, baseClone(srcValue, CLONE_DEEP_FLAG));
- }
- var method = baseRest(function(path, args) {
- return function(object) {
- return baseInvoke(object, path, args);
- };
- });
- var methodOf = baseRest(function(object, args) {
- return function(path) {
- return baseInvoke(object, path, args);
- };
- });
- function mixin(object, source, options) {
- var props = keys(source), methodNames = baseFunctions(source, props);
- if (options == null && !(isObject(source) && (methodNames.length || !props.length))) {
- options = source;
- source = object;
- object = this;
- methodNames = baseFunctions(source, keys(source));
- }
- var chain2 = !(isObject(options) && "chain" in options) || !!options.chain, isFunc = isFunction(object);
- arrayEach(methodNames, function(methodName) {
- var func = source[methodName];
- object[methodName] = func;
- if (isFunc) {
- object.prototype[methodName] = function() {
- var chainAll = this.__chain__;
- if (chain2 || chainAll) {
- var result2 = object(this.__wrapped__), actions = result2.__actions__ = copyArray(this.__actions__);
- actions.push({ "func": func, "args": arguments, "thisArg": object });
- result2.__chain__ = chainAll;
- return result2;
- }
- return func.apply(object, arrayPush([this.value()], arguments));
- };
- }
- });
- return object;
- }
- function noConflict() {
- if (root._ === this) {
- root._ = oldDash;
- }
- return this;
- }
- function noop() {
- }
- function nthArg(n) {
- n = toInteger(n);
- return baseRest(function(args) {
- return baseNth(args, n);
- });
- }
- var over = createOver(arrayMap);
- var overEvery = createOver(arrayEvery);
- var overSome = createOver(arraySome);
- function property(path) {
- return isKey(path) ? baseProperty(toKey(path)) : basePropertyDeep(path);
- }
- function propertyOf(object) {
- return function(path) {
- return object == null ? undefined$1 : baseGet(object, path);
- };
- }
- var range = createRange();
- var rangeRight = createRange(true);
- function stubArray() {
- return [];
- }
- function stubFalse() {
- return false;
- }
- function stubObject() {
- return {};
- }
- function stubString() {
- return "";
- }
- function stubTrue() {
- return true;
- }
- function times(n, iteratee2) {
- n = toInteger(n);
- if (n < 1 || n > MAX_SAFE_INTEGER) {
- return [];
- }
- var index = MAX_ARRAY_LENGTH, length = nativeMin(n, MAX_ARRAY_LENGTH);
- iteratee2 = getIteratee(iteratee2);
- n -= MAX_ARRAY_LENGTH;
- var result2 = baseTimes(length, iteratee2);
- while (++index < n) {
- iteratee2(index);
- }
- return result2;
- }
- function toPath(value) {
- if (isArray(value)) {
- return arrayMap(value, toKey);
- }
- return isSymbol(value) ? [value] : copyArray(stringToPath(toString(value)));
- }
- function uniqueId(prefix) {
- var id = ++idCounter;
- return toString(prefix) + id;
- }
- var add = createMathOperation(function(augend, addend) {
- return augend + addend;
- }, 0);
- var ceil = createRound("ceil");
- var divide = createMathOperation(function(dividend, divisor) {
- return dividend / divisor;
- }, 1);
- var floor = createRound("floor");
- function max(array) {
- return array && array.length ? baseExtremum(array, identity, baseGt) : undefined$1;
- }
- function maxBy(array, iteratee2) {
- return array && array.length ? baseExtremum(array, getIteratee(iteratee2, 2), baseGt) : undefined$1;
- }
- function mean(array) {
- return baseMean(array, identity);
- }
- function meanBy(array, iteratee2) {
- return baseMean(array, getIteratee(iteratee2, 2));
- }
- function min(array) {
- return array && array.length ? baseExtremum(array, identity, baseLt) : undefined$1;
- }
- function minBy(array, iteratee2) {
- return array && array.length ? baseExtremum(array, getIteratee(iteratee2, 2), baseLt) : undefined$1;
- }
- var multiply = createMathOperation(function(multiplier, multiplicand) {
- return multiplier * multiplicand;
- }, 1);
- var round = createRound("round");
- var subtract = createMathOperation(function(minuend, subtrahend) {
- return minuend - subtrahend;
- }, 0);
- function sum(array) {
- return array && array.length ? baseSum(array, identity) : 0;
- }
- function sumBy(array, iteratee2) {
- return array && array.length ? baseSum(array, getIteratee(iteratee2, 2)) : 0;
- }
- lodash2.after = after;
- lodash2.ary = ary;
- lodash2.assign = assign;
- lodash2.assignIn = assignIn;
- lodash2.assignInWith = assignInWith;
- lodash2.assignWith = assignWith;
- lodash2.at = at;
- lodash2.before = before;
- lodash2.bind = bind;
- lodash2.bindAll = bindAll;
- lodash2.bindKey = bindKey;
- lodash2.castArray = castArray;
- lodash2.chain = chain;
- lodash2.chunk = chunk;
- lodash2.compact = compact;
- lodash2.concat = concat;
- lodash2.cond = cond;
- lodash2.conforms = conforms;
- lodash2.constant = constant;
- lodash2.countBy = countBy;
- lodash2.create = create;
- lodash2.curry = curry;
- lodash2.curryRight = curryRight;
- lodash2.debounce = debounce;
- lodash2.defaults = defaults;
- lodash2.defaultsDeep = defaultsDeep;
- lodash2.defer = defer;
- lodash2.delay = delay;
- lodash2.difference = difference;
- lodash2.differenceBy = differenceBy;
- lodash2.differenceWith = differenceWith;
- lodash2.drop = drop;
- lodash2.dropRight = dropRight;
- lodash2.dropRightWhile = dropRightWhile;
- lodash2.dropWhile = dropWhile;
- lodash2.fill = fill;
- lodash2.filter = filter;
- lodash2.flatMap = flatMap;
- lodash2.flatMapDeep = flatMapDeep;
- lodash2.flatMapDepth = flatMapDepth;
- lodash2.flatten = flatten;
- lodash2.flattenDeep = flattenDeep;
- lodash2.flattenDepth = flattenDepth;
- lodash2.flip = flip;
- lodash2.flow = flow;
- lodash2.flowRight = flowRight;
- lodash2.fromPairs = fromPairs;
- lodash2.functions = functions;
- lodash2.functionsIn = functionsIn;
- lodash2.groupBy = groupBy;
- lodash2.initial = initial;
- lodash2.intersection = intersection;
- lodash2.intersectionBy = intersectionBy;
- lodash2.intersectionWith = intersectionWith;
- lodash2.invert = invert;
- lodash2.invertBy = invertBy;
- lodash2.invokeMap = invokeMap;
- lodash2.iteratee = iteratee;
- lodash2.keyBy = keyBy;
- lodash2.keys = keys;
- lodash2.keysIn = keysIn;
- lodash2.map = map;
- lodash2.mapKeys = mapKeys;
- lodash2.mapValues = mapValues;
- lodash2.matches = matches;
- lodash2.matchesProperty = matchesProperty;
- lodash2.memoize = memoize;
- lodash2.merge = merge;
- lodash2.mergeWith = mergeWith;
- lodash2.method = method;
- lodash2.methodOf = methodOf;
- lodash2.mixin = mixin;
- lodash2.negate = negate;
- lodash2.nthArg = nthArg;
- lodash2.omit = omit;
- lodash2.omitBy = omitBy;
- lodash2.once = once;
- lodash2.orderBy = orderBy;
- lodash2.over = over;
- lodash2.overArgs = overArgs;
- lodash2.overEvery = overEvery;
- lodash2.overSome = overSome;
- lodash2.partial = partial;
- lodash2.partialRight = partialRight;
- lodash2.partition = partition;
- lodash2.pick = pick;
- lodash2.pickBy = pickBy;
- lodash2.property = property;
- lodash2.propertyOf = propertyOf;
- lodash2.pull = pull;
- lodash2.pullAll = pullAll;
- lodash2.pullAllBy = pullAllBy;
- lodash2.pullAllWith = pullAllWith;
- lodash2.pullAt = pullAt;
- lodash2.range = range;
- lodash2.rangeRight = rangeRight;
- lodash2.rearg = rearg;
- lodash2.reject = reject;
- lodash2.remove = remove;
- lodash2.rest = rest;
- lodash2.reverse = reverse;
- lodash2.sampleSize = sampleSize;
- lodash2.set = set;
- lodash2.setWith = setWith;
- lodash2.shuffle = shuffle;
- lodash2.slice = slice;
- lodash2.sortBy = sortBy;
- lodash2.sortedUniq = sortedUniq;
- lodash2.sortedUniqBy = sortedUniqBy;
- lodash2.split = split;
- lodash2.spread = spread;
- lodash2.tail = tail;
- lodash2.take = take;
- lodash2.takeRight = takeRight;
- lodash2.takeRightWhile = takeRightWhile;
- lodash2.takeWhile = takeWhile;
- lodash2.tap = tap;
- lodash2.throttle = throttle;
- lodash2.thru = thru;
- lodash2.toArray = toArray;
- lodash2.toPairs = toPairs;
- lodash2.toPairsIn = toPairsIn;
- lodash2.toPath = toPath;
- lodash2.toPlainObject = toPlainObject;
- lodash2.transform = transform;
- lodash2.unary = unary;
- lodash2.union = union;
- lodash2.unionBy = unionBy;
- lodash2.unionWith = unionWith;
- lodash2.uniq = uniq;
- lodash2.uniqBy = uniqBy;
- lodash2.uniqWith = uniqWith;
- lodash2.unset = unset;
- lodash2.unzip = unzip;
- lodash2.unzipWith = unzipWith;
- lodash2.update = update;
- lodash2.updateWith = updateWith;
- lodash2.values = values;
- lodash2.valuesIn = valuesIn;
- lodash2.without = without;
- lodash2.words = words;
- lodash2.wrap = wrap;
- lodash2.xor = xor;
- lodash2.xorBy = xorBy;
- lodash2.xorWith = xorWith;
- lodash2.zip = zip;
- lodash2.zipObject = zipObject;
- lodash2.zipObjectDeep = zipObjectDeep;
- lodash2.zipWith = zipWith;
- lodash2.entries = toPairs;
- lodash2.entriesIn = toPairsIn;
- lodash2.extend = assignIn;
- lodash2.extendWith = assignInWith;
- mixin(lodash2, lodash2);
- lodash2.add = add;
- lodash2.attempt = attempt;
- lodash2.camelCase = camelCase;
- lodash2.capitalize = capitalize;
- lodash2.ceil = ceil;
- lodash2.clamp = clamp;
- lodash2.clone = clone;
- lodash2.cloneDeep = cloneDeep;
- lodash2.cloneDeepWith = cloneDeepWith;
- lodash2.cloneWith = cloneWith;
- lodash2.conformsTo = conformsTo;
- lodash2.deburr = deburr;
- lodash2.defaultTo = defaultTo;
- lodash2.divide = divide;
- lodash2.endsWith = endsWith;
- lodash2.eq = eq;
- lodash2.escape = escape;
- lodash2.escapeRegExp = escapeRegExp;
- lodash2.every = every;
- lodash2.find = find;
- lodash2.findIndex = findIndex;
- lodash2.findKey = findKey;
- lodash2.findLast = findLast;
- lodash2.findLastIndex = findLastIndex;
- lodash2.findLastKey = findLastKey;
- lodash2.floor = floor;
- lodash2.forEach = forEach;
- lodash2.forEachRight = forEachRight;
- lodash2.forIn = forIn;
- lodash2.forInRight = forInRight;
- lodash2.forOwn = forOwn;
- lodash2.forOwnRight = forOwnRight;
- lodash2.get = get;
- lodash2.gt = gt;
- lodash2.gte = gte;
- lodash2.has = has;
- lodash2.hasIn = hasIn;
- lodash2.head = head;
- lodash2.identity = identity;
- lodash2.includes = includes;
- lodash2.indexOf = indexOf;
- lodash2.inRange = inRange;
- lodash2.invoke = invoke;
- lodash2.isArguments = isArguments;
- lodash2.isArray = isArray;
- lodash2.isArrayBuffer = isArrayBuffer;
- lodash2.isArrayLike = isArrayLike;
- lodash2.isArrayLikeObject = isArrayLikeObject;
- lodash2.isBoolean = isBoolean;
- lodash2.isBuffer = isBuffer;
- lodash2.isDate = isDate;
- lodash2.isElement = isElement;
- lodash2.isEmpty = isEmpty;
- lodash2.isEqual = isEqual;
- lodash2.isEqualWith = isEqualWith;
- lodash2.isError = isError;
- lodash2.isFinite = isFinite2;
- lodash2.isFunction = isFunction;
- lodash2.isInteger = isInteger;
- lodash2.isLength = isLength;
- lodash2.isMap = isMap;
- lodash2.isMatch = isMatch;
- lodash2.isMatchWith = isMatchWith;
- lodash2.isNaN = isNaN2;
- lodash2.isNative = isNative;
- lodash2.isNil = isNil;
- lodash2.isNull = isNull;
- lodash2.isNumber = isNumber;
- lodash2.isObject = isObject;
- lodash2.isObjectLike = isObjectLike;
- lodash2.isPlainObject = isPlainObject;
- lodash2.isRegExp = isRegExp;
- lodash2.isSafeInteger = isSafeInteger;
- lodash2.isSet = isSet;
- lodash2.isString = isString;
- lodash2.isSymbol = isSymbol;
- lodash2.isTypedArray = isTypedArray;
- lodash2.isUndefined = isUndefined;
- lodash2.isWeakMap = isWeakMap;
- lodash2.isWeakSet = isWeakSet;
- lodash2.join = join;
- lodash2.kebabCase = kebabCase;
- lodash2.last = last;
- lodash2.lastIndexOf = lastIndexOf;
- lodash2.lowerCase = lowerCase;
- lodash2.lowerFirst = lowerFirst;
- lodash2.lt = lt;
- lodash2.lte = lte;
- lodash2.max = max;
- lodash2.maxBy = maxBy;
- lodash2.mean = mean;
- lodash2.meanBy = meanBy;
- lodash2.min = min;
- lodash2.minBy = minBy;
- lodash2.stubArray = stubArray;
- lodash2.stubFalse = stubFalse;
- lodash2.stubObject = stubObject;
- lodash2.stubString = stubString;
- lodash2.stubTrue = stubTrue;
- lodash2.multiply = multiply;
- lodash2.nth = nth;
- lodash2.noConflict = noConflict;
- lodash2.noop = noop;
- lodash2.now = now;
- lodash2.pad = pad;
- lodash2.padEnd = padEnd;
- lodash2.padStart = padStart;
- lodash2.parseInt = parseInt2;
- lodash2.random = random;
- lodash2.reduce = reduce;
- lodash2.reduceRight = reduceRight;
- lodash2.repeat = repeat;
- lodash2.replace = replace;
- lodash2.result = result;
- lodash2.round = round;
- lodash2.runInContext = runInContext2;
- lodash2.sample = sample;
- lodash2.size = size;
- lodash2.snakeCase = snakeCase;
- lodash2.some = some;
- lodash2.sortedIndex = sortedIndex;
- lodash2.sortedIndexBy = sortedIndexBy;
- lodash2.sortedIndexOf = sortedIndexOf;
- lodash2.sortedLastIndex = sortedLastIndex;
- lodash2.sortedLastIndexBy = sortedLastIndexBy;
- lodash2.sortedLastIndexOf = sortedLastIndexOf;
- lodash2.startCase = startCase;
- lodash2.startsWith = startsWith;
- lodash2.subtract = subtract;
- lodash2.sum = sum;
- lodash2.sumBy = sumBy;
- lodash2.template = template;
- lodash2.times = times;
- lodash2.toFinite = toFinite;
- lodash2.toInteger = toInteger;
- lodash2.toLength = toLength;
- lodash2.toLower = toLower;
- lodash2.toNumber = toNumber;
- lodash2.toSafeInteger = toSafeInteger;
- lodash2.toString = toString;
- lodash2.toUpper = toUpper;
- lodash2.trim = trim;
- lodash2.trimEnd = trimEnd;
- lodash2.trimStart = trimStart;
- lodash2.truncate = truncate;
- lodash2.unescape = unescape;
- lodash2.uniqueId = uniqueId;
- lodash2.upperCase = upperCase;
- lodash2.upperFirst = upperFirst;
- lodash2.each = forEach;
- lodash2.eachRight = forEachRight;
- lodash2.first = head;
- mixin(lodash2, function() {
- var source = {};
- baseForOwn(lodash2, function(func, methodName) {
- if (!hasOwnProperty.call(lodash2.prototype, methodName)) {
- source[methodName] = func;
- }
- });
- return source;
- }(), { "chain": false });
- lodash2.VERSION = VERSION;
- arrayEach(["bind", "bindKey", "curry", "curryRight", "partial", "partialRight"], function(methodName) {
- lodash2[methodName].placeholder = lodash2;
- });
- arrayEach(["drop", "take"], function(methodName, index) {
- LazyWrapper.prototype[methodName] = function(n) {
- n = n === undefined$1 ? 1 : nativeMax(toInteger(n), 0);
- var result2 = this.__filtered__ && !index ? new LazyWrapper(this) : this.clone();
- if (result2.__filtered__) {
- result2.__takeCount__ = nativeMin(n, result2.__takeCount__);
- } else {
- result2.__views__.push({
- "size": nativeMin(n, MAX_ARRAY_LENGTH),
- "type": methodName + (result2.__dir__ < 0 ? "Right" : "")
- });
- }
- return result2;
- };
- LazyWrapper.prototype[methodName + "Right"] = function(n) {
- return this.reverse()[methodName](n).reverse();
- };
- });
- arrayEach(["filter", "map", "takeWhile"], function(methodName, index) {
- var type = index + 1, isFilter = type == LAZY_FILTER_FLAG || type == LAZY_WHILE_FLAG;
- LazyWrapper.prototype[methodName] = function(iteratee2) {
- var result2 = this.clone();
- result2.__iteratees__.push({
- "iteratee": getIteratee(iteratee2, 3),
- "type": type
- });
- result2.__filtered__ = result2.__filtered__ || isFilter;
- return result2;
- };
- });
- arrayEach(["head", "last"], function(methodName, index) {
- var takeName = "take" + (index ? "Right" : "");
- LazyWrapper.prototype[methodName] = function() {
- return this[takeName](1).value()[0];
- };
- });
- arrayEach(["initial", "tail"], function(methodName, index) {
- var dropName = "drop" + (index ? "" : "Right");
- LazyWrapper.prototype[methodName] = function() {
- return this.__filtered__ ? new LazyWrapper(this) : this[dropName](1);
- };
- });
- LazyWrapper.prototype.compact = function() {
- return this.filter(identity);
- };
- LazyWrapper.prototype.find = function(predicate) {
- return this.filter(predicate).head();
- };
- LazyWrapper.prototype.findLast = function(predicate) {
- return this.reverse().find(predicate);
- };
- LazyWrapper.prototype.invokeMap = baseRest(function(path, args) {
- if (typeof path == "function") {
- return new LazyWrapper(this);
- }
- return this.map(function(value) {
- return baseInvoke(value, path, args);
- });
- });
- LazyWrapper.prototype.reject = function(predicate) {
- return this.filter(negate(getIteratee(predicate)));
- };
- LazyWrapper.prototype.slice = function(start, end) {
- start = toInteger(start);
- var result2 = this;
- if (result2.__filtered__ && (start > 0 || end < 0)) {
- return new LazyWrapper(result2);
- }
- if (start < 0) {
- result2 = result2.takeRight(-start);
- } else if (start) {
- result2 = result2.drop(start);
- }
- if (end !== undefined$1) {
- end = toInteger(end);
- result2 = end < 0 ? result2.dropRight(-end) : result2.take(end - start);
- }
- return result2;
- };
- LazyWrapper.prototype.takeRightWhile = function(predicate) {
- return this.reverse().takeWhile(predicate).reverse();
- };
- LazyWrapper.prototype.toArray = function() {
- return this.take(MAX_ARRAY_LENGTH);
- };
- baseForOwn(LazyWrapper.prototype, function(func, methodName) {
- var checkIteratee = /^(?:filter|find|map|reject)|While$/.test(methodName), isTaker = /^(?:head|last)$/.test(methodName), lodashFunc = lodash2[isTaker ? "take" + (methodName == "last" ? "Right" : "") : methodName], retUnwrapped = isTaker || /^find/.test(methodName);
- if (!lodashFunc) {
- return;
- }
- lodash2.prototype[methodName] = function() {
- var value = this.__wrapped__, args = isTaker ? [1] : arguments, isLazy = value instanceof LazyWrapper, iteratee2 = args[0], useLazy = isLazy || isArray(value);
- var interceptor = function(value2) {
- var result3 = lodashFunc.apply(lodash2, arrayPush([value2], args));
- return isTaker && chainAll ? result3[0] : result3;
- };
- if (useLazy && checkIteratee && typeof iteratee2 == "function" && iteratee2.length != 1) {
- isLazy = useLazy = false;
- }
- var chainAll = this.__chain__, isHybrid = !!this.__actions__.length, isUnwrapped = retUnwrapped && !chainAll, onlyLazy = isLazy && !isHybrid;
- if (!retUnwrapped && useLazy) {
- value = onlyLazy ? value : new LazyWrapper(this);
- var result2 = func.apply(value, args);
- result2.__actions__.push({ "func": thru, "args": [interceptor], "thisArg": undefined$1 });
- return new LodashWrapper(result2, chainAll);
- }
- if (isUnwrapped && onlyLazy) {
- return func.apply(this, args);
- }
- result2 = this.thru(interceptor);
- return isUnwrapped ? isTaker ? result2.value()[0] : result2.value() : result2;
- };
- });
- arrayEach(["pop", "push", "shift", "sort", "splice", "unshift"], function(methodName) {
- var func = arrayProto[methodName], chainName = /^(?:push|sort|unshift)$/.test(methodName) ? "tap" : "thru", retUnwrapped = /^(?:pop|shift)$/.test(methodName);
- lodash2.prototype[methodName] = function() {
- var args = arguments;
- if (retUnwrapped && !this.__chain__) {
- var value = this.value();
- return func.apply(isArray(value) ? value : [], args);
- }
- return this[chainName](function(value2) {
- return func.apply(isArray(value2) ? value2 : [], args);
- });
- };
- });
- baseForOwn(LazyWrapper.prototype, function(func, methodName) {
- var lodashFunc = lodash2[methodName];
- if (lodashFunc) {
- var key = lodashFunc.name + "";
- if (!hasOwnProperty.call(realNames, key)) {
- realNames[key] = [];
- }
- realNames[key].push({ "name": methodName, "func": lodashFunc });
- }
- });
- realNames[createHybrid(undefined$1, WRAP_BIND_KEY_FLAG).name] = [{
- "name": "wrapper",
- "func": undefined$1
- }];
- LazyWrapper.prototype.clone = lazyClone;
- LazyWrapper.prototype.reverse = lazyReverse;
- LazyWrapper.prototype.value = lazyValue;
- lodash2.prototype.at = wrapperAt;
- lodash2.prototype.chain = wrapperChain;
- lodash2.prototype.commit = wrapperCommit;
- lodash2.prototype.next = wrapperNext;
- lodash2.prototype.plant = wrapperPlant;
- lodash2.prototype.reverse = wrapperReverse;
- lodash2.prototype.toJSON = lodash2.prototype.valueOf = lodash2.prototype.value = wrapperValue;
- lodash2.prototype.first = lodash2.prototype.head;
- if (symIterator) {
- lodash2.prototype[symIterator] = wrapperToIterator;
- }
- return lodash2;
- };
- var _ = runInContext();
- if (freeModule) {
- (freeModule.exports = _)._ = _;
- freeExports._ = _;
- } else {
- root._ = _;
- }
- }).call(commonjsGlobal);
- })(lodash, lodash.exports);
- var lodashExports = lodash.exports;
- class ListRuleB extends RuleBaseInterface {
- constructor(config) {
- super();
- __publicField(this, "config", {
- onlyTodayData: false
- // 是否只保留当天的数据
- });
- // 寻找父级列表时,找寻的最大级数
- __publicField(this, "findParentsMaxDeep", 5);
- if (config) {
- Object.assign(this.config, config);
- }
- }
- // 主函数:处理DOM并返回所需信息
- run(container = document.body) {
- const { onlyTodayData } = this.config;
- const eligibleNodes = this.findEligibleLeafNodesForContentLtMark(container);
- const findResultNodeList = this.findResultNodeList(eligibleNodes);
- const resultNode = findResultNodeList.filter((temp) => {
- return temp.length > 0;
- });
- const { resultList, todayList } = this.calcResultList(resultNode);
- const result = {
- todayHasData: todayList.length > 0,
- todayData: onlyTodayData ? todayList : resultList
- };
- this.report(result);
- console.log(result, todayList);
- return result;
- }
- check() {
- }
- // 节点过滤
- findResultNodeList(eligibleNodes = []) {
- eligibleNodes.forEach((node, index) => {
- node._index_find = index;
- });
- const groupedNodes = this.groupNodes(eligibleNodes);
- const needNodes = this.checkNeedGroupNode(groupedNodes);
- const correctedNodes = this.checkNodeCountCorrect(needNodes);
- const nodeInfoList = this.calcNodesInfo(correctedNodes);
- return nodeInfoList;
- }
- calcNodesInfo(list = []) {
- const result = list.map((group) => {
- const parentSelector = this.generateCSSSelector(group[0]._listItem);
- const hasDateNode = group.filter((gChildren) => {
- const arr = this.hasDateElement(gChildren._listItem);
- return arr.some((item) => item.hasDate);
- });
- const dateElementSelector = hasDateNode.map((item) => {
- const date = this.hasDateElement(item._listItem).filter((temp) => {
- return temp.hasDate;
- });
- return {
- ...item,
- dateArr: date
- };
- });
- const formatted = dateElementSelector.map((nodeObj) => {
- nodeObj.selector = this.generateCSSSelector(nodeObj.node);
- const href = this.getNodeHref(nodeObj);
- return {
- text: nodeObj.text,
- date: nodeObj.dateArr[0].date,
- selector: nodeObj.selector,
- href,
- // listSelector: this.generateCSSSelector(nodeObj._list),
- parentSelector,
- // 后续排序索引
- _index_find: nodeObj._index_find,
- _index_in_list: this.$(nodeObj._listItem).index()
- };
- });
- return formatted;
- });
- return result;
- }
- getNodeHref(node) {
- var _a;
- let href = "";
- if (node._listItem) {
- const $listItem = this.$(node._listItem);
- const $a = $listItem.find("a[href]");
- href = (_a = $a[0]) == null ? void 0 : _a.href;
- }
- return href;
- }
- todayDateTest(text = "") {
- let pass = false;
- if (!text)
- return pass;
- const nowDayRegList = this.getTodayDateReg();
- for (let i = 0; i < nowDayRegList.length; i++) {
- const item = nowDayRegList[i];
- if (item.test(text)) {
- pass = true;
- break;
- }
- }
- return pass;
- }
- calcResultList(resultNode = []) {
- const todayList = [];
- const resultList = resultNode.flat();
- let calcSortKey = "_index_find";
- if (resultList[0] && resultList[0]._index_in_list) {
- const _index_in_list = resultList[0]._index_in_list;
- if (_index_in_list !== -1) {
- calcSortKey = "_index_in_list";
- }
- }
- const sortedResultList = resultList.sort((a, b) => a[calcSortKey] - b[calcSortKey]);
- sortedResultList.forEach((r) => {
- const dateArr = r.date;
- delete r._index_find;
- delete r._index_in_list;
- if (Array.isArray(dateArr)) {
- for (let i = 0; i < dateArr.length; i++) {
- const item = dateArr[i];
- const today = this.todayDateTest(item);
- if (today) {
- todayList.push(r);
- break;
- }
- }
- }
- });
- return {
- resultList: sortedResultList,
- todayList
- };
- }
- // 辅助函数:遍历DOM节点,查找符合条件的末级节点
- findEligibleLeafNodesForContentLtMark(node) {
- return this.findEligibleLeafNodes(node, (node2) => {
- const chineseChars = this.countChineseCharacters((node2 == null ? void 0 : node2.textContent) || "");
- return chineseChars >= this.minTitleLength && !this.checkNodeHidden(node2);
- });
- }
- // 辅助函数:根据父节点对末级节点进行分组
- groupNodes(nodes) {
- this.findTableInPage();
- let result = this.groupNodesBySiblings(nodes);
- if (this.checkNeedGroupNode(result).length <= 0) {
- result = this.groupNodesByParent(nodes);
- }
- return result;
- }
- findTableInPage() {
- const step = 3;
- const table = this.$("table");
- if (table.length > 0) {
- this.findParentsMaxDeep += step;
- }
- }
- // 保留元素个数在5个以上的分组
- checkNeedGroupNode(list) {
- const s = list.filter((group) => group.length > 5);
- return s;
- }
- // 分组函数(以nodesItem中的某个值为id进行分组)
- groupedListByList(nodes, key = "_list") {
- const groupArr = [];
- nodes.forEach((nodeObj) => {
- const target = groupArr.find((g) => g.id === nodeObj[key]);
- if (target && Array.isArray(target.list)) {
- target.list.push(nodeObj);
- } else {
- groupArr.push({
- id: nodeObj[key],
- list: [nodeObj]
- });
- }
- });
- const sortedArr = [];
- groupArr.forEach((g) => {
- if (Array.isArray(g.list) && g.list.length > 0) {
- sortedArr.push(g.list);
- }
- });
- return sortedArr;
- }
- groupNodesBySiblings(nodes) {
- nodes.forEach((node) => {
- var _a;
- const {
- parentNodeArr,
- // parentSiblingsCountArr,
- parentSiblingsWeightArr
- } = this.getNodeParentsSiblingsArr(node.node);
- const targetArr = parentSiblingsWeightArr;
- const maxSiblingCount = getMaxCount(targetArr);
- const maxIndex = targetArr.indexOf(maxSiblingCount);
- node._listItem = parentNodeArr[maxIndex];
- node._list = (_a = node._listItem) == null ? void 0 : _a.parentNode;
- node.weight = this.calcWeight(node);
- });
- const grouped1 = this.groupedListByList(nodes);
- return grouped1;
- }
- createGroupId(node) {
- var _a, _b;
- if (node._list) {
- const pClassNameStr = (_a = node._list) == null ? void 0 : _a.className;
- const listItemClassNameStr = (_b = node._listItem) == null ? void 0 : _b.className;
- node._groupId = `${this.getTagName(node._list)}__${pClassNameStr}__${this.getTagName(node.node)}__${listItemClassNameStr}`;
- } else {
- node._groupId = node._list;
- }
- }
- // 列表根据元素标签,元素className进行分类。
- calcClassifyNode(nodeList = []) {
- if (!Array.isArray(nodeList))
- return;
- const map = {};
- nodeList.forEach((item) => {
- const elem = item.node;
- if (!elem)
- return;
- let id = "__";
- if (elem.nodeType === Node.ELEMENT_NODE) {
- id = `${elem.tagName}_${Array.from(elem.classList)}`;
- } else if (elem.nodeType === Node.TEXT_NODE) {
- id = `text_`;
- }
- if (map[id]) {
- map[id].push(item);
- } else {
- map[id] = [item];
- }
- });
- return map;
- }
- getMaxValueLength(map = {}) {
- if (!map)
- return;
- let max = -Infinity;
- let maxItem = "";
- for (const key in map) {
- const item = key;
- if (Array.isArray(item)) {
- if (item.length > max && item.length > 0) {
- max = item.length;
- maxItem = item;
- }
- }
- }
- return maxItem;
- }
- checkNodeCountCorrect(needNode = []) {
- const listChildrenArr = [];
- const listDOMChildrenArr = [];
- needNode.forEach((group) => {
- if (Array.isArray(group)) {
- listChildrenArr.push(group.length);
- if (group[0] && group[0]._list) {
- const _list = group[0]._list;
- listDOMChildrenArr.push(_list == null ? void 0 : _list.childElementCount);
- }
- }
- });
- if (lodashExports.isEqual(listChildrenArr, listDOMChildrenArr) && needNode.length <= 1) {
- return needNode;
- }
- let targetList = needNode.flat().sort((a, b) => {
- return b.weight - a.weight;
- });
- targetList = lodashExports.uniqWith(targetList, function(a, b) {
- const hasListItem = a._listItem && b._listItem;
- return hasListItem && a._listItem === b._listItem;
- });
- const textGroupArr = this.groupedListByList(targetList);
- if (Array.isArray(textGroupArr) && textGroupArr.length > 0) {
- let maxWeight = -Infinity;
- let maxWeightArr = [];
- textGroupArr.forEach((group) => {
- if (Array.isArray(group)) {
- const groupLength = group.length > 3;
- const avg = lodashExports.meanBy(group, "weight");
- if (avg > maxWeight && groupLength) {
- maxWeight = avg;
- maxWeightArr = group;
- }
- }
- });
- if (maxWeightArr.length > 0) {
- let maxNodeExample = maxWeightArr[0];
- const resMap = this.calcClassifyNode(maxWeightArr);
- if (Object.keys(resMap).length > 1) {
- const maxItem = this.getMaxValueLength(resMap);
- if (Array.isArray(maxItem) && maxItem.length > 0) {
- maxNodeExample = maxItem[0];
- }
- }
- const maxNodeExampleNode = maxNodeExample.node;
- const maxNodeTextSelector = [`${maxNodeExampleNode.localName}`];
- if (maxNodeExampleNode.classList) {
- maxNodeTextSelector.push(`${Array.from(maxNodeExampleNode.classList).join(".")}`);
- }
- const maxNodeTextSelectorText = maxNodeTextSelector.filter((v) => !!v).join(".");
- const maxNodeExampleList = maxNodeExample._list;
- if (maxNodeExampleList) {
- const $list = this.$(maxNodeExampleList);
- const listChildren = $list.children();
- const listItemArr = maxWeightArr.map((node) => {
- return node._listItem;
- });
- listChildren.each((_, item) => {
- if (!listItemArr.includes(item)) {
- const nodeItemExp = Object.assign({}, maxNodeExample);
- const $listItem = this.$(item);
- const target = $listItem.find(maxNodeTextSelectorText);
- const text = target.text();
- if (text) {
- nodeItemExp.node = target[0];
- nodeItemExp.text = text;
- nodeItemExp.weight = this.calcWeight(nodeItemExp);
- nodeItemExp._listItem = item;
- maxWeightArr.push(nodeItemExp);
- }
- }
- });
- }
- }
- if (maxWeightArr.length > 0) {
- return [maxWeightArr];
- } else {
- return [];
- }
- } else {
- return [targetList];
- }
- }
- // 分组算法1:根据父元素进行分组,相同父元素为一组
- groupNodesByParent(nodes = []) {
- const groups = {};
- nodes.forEach((nodeObj) => {
- const parent = nodeObj.node.parentNode;
- if (!groups[parent]) {
- groups[parent] = [];
- }
- groups[parent].push(nodeObj);
- });
- return Object.entries(groups).map(([_, group]) => group);
- }
- // 获取每个元素的父级,最多获取5级,如果遇到取不到parentNode的情况,直接结束寻找,并返回结果
- // 排除body和body的直接子集
- getNodeParentsSiblingsArr(node) {
- const parentNodeArr = [];
- const parentSiblingsCountArr = [];
- const parentSiblingsWeightArr = [];
- const maxDeep = this.findParentsMaxDeep;
- let parent = node.parentNode;
- for (let i = 0; i < maxDeep; i++) {
- if (!parent) {
- break;
- }
- if (parent.tagName === "BODY") {
- parentNodeArr.pop();
- parentSiblingsCountArr.pop();
- parentSiblingsWeightArr.pop();
- break;
- }
- const parentSiblings = getSiblings(parent);
- if (Array.isArray(parentSiblings)) {
- parentSiblingsCountArr.push(parentSiblings.length);
- const weight = parentSiblings.length * ((maxDeep - i) * 20);
- parentSiblingsWeightArr.push(weight);
- }
- parentNodeArr.push(parent);
- parent = parent.parentNode;
- }
- return {
- parentNodeArr,
- parentSiblingsCountArr,
- parentSiblingsWeightArr
- };
- }
- // 辅助函数:生成CSS选择器
- generateCSSSelector(element) {
- if (!element) {
- return;
- }
- let selector = this.getTagName(element).toLowerCase();
- if (element.id) {
- selector = `#${element.id}`;
- } else {
- let siblings = [];
- if (element.parentNode) {
- siblings = Array.from(element.parentNode.children);
- }
- const index = siblings.indexOf(element) + 1;
- selector += `:nth-child(${index})`;
- }
- if (element.parentNode && element.parentNode !== document.body) {
- selector = `${this.generateCSSSelector(element.parentNode)} > ${selector}`;
- }
- return selector;
- }
- // 辅助函数:检测节点或其后代中是否包含日期元素
- hasDateElement(node) {
- let tagList = this.findEligibleLeafNodes(node, () => true);
- tagList = tagList.map((i) => i.node);
- const arr = tagList.map((elem) => {
- var _a;
- const dateArr = this.extractDates((_a = elem.textContent) == null ? void 0 : _a.trim());
- return {
- date: dateArr,
- hasDate: dateArr.length > 0,
- textContent: elem.textContent
- };
- });
- return arr;
- }
- // 辅助函数:整理今日日期格式
- getTodayDateReg() {
- return this.todayPatterns;
- }
- // 传入node计算权重
- // 1. 包含特殊字符的权重为10
- // 2. 特殊标签h1/h2/h3/h4/h5/a权重为8
- // 3. 文字长度权重=文字长度*0.05
- calcWeight(node) {
- var _a, _b;
- const titleMaxLength = 35;
- const weightMap = {
- importKey: 14,
- importTag: 8,
- className: 3,
- textLength: 0.05,
- maxTextLength: -0.1,
- companyName: -3
- };
- let weight = 0;
- for (let i = 0; i < this.importantKeyList.length; i++) {
- const key = this.importantKeyList[i];
- if (node.text.includes(key)) {
- weight += weightMap.importKey;
- break;
- }
- }
- const tagName = this.getTagName(node.node);
- if (this.importantTagList.includes(tagName)) {
- weight += weightMap.importTag;
- }
- if ((_a = node.node) == null ? void 0 : _a.className) {
- const className = (_b = node.node) == null ? void 0 : _b.className;
- const targetStrList = ["title"];
- for (let i = 0; i < targetStrList.length; i++) {
- const item = targetStrList[i];
- if (className.includes(item)) {
- weight += weightMap.className;
- break;
- }
- }
- }
- if (this.isCompanyName(node.text)) {
- weight += weightMap.companyName;
- }
- const textLength = node.text ? node.text.length : 0;
- weight += textLength * weightMap.textLength;
- if (textLength >= titleMaxLength) {
- const maxTextLengthWeight = (textLength - weightMap.maxTextLength) * weightMap.maxTextLength;
- weight += maxTextLengthWeight;
- }
- return weight;
- }
- }
- class FindFileAttachment {
- constructor({ autoUpload } = {}) {
- __publicField(this, "autoUpload", false);
- __publicField(this, "extensions", ["pdf", "doc", "docx", "xls", "xlsx", "zip", "rar", "PDF", "DOC", "DOCX", "XLS", "XLSX", "ZIP", "RAR"]);
- __publicField(this, "uploadUrl", "http://127.0.0.1:18080/uploadFile");
- this.autoUpload = autoUpload;
- }
- run(container = document.body) {
- const fileAttachmentTagOptions = this.findFileAttachmentTag(container);
- if (this.autoUpload) {
- this.doFileListDownload(fileAttachmentTagOptions);
- }
- const targetFiles = fileAttachmentTagOptions.map((f) => {
- return {
- title: f.title,
- href: f.href,
- filename: f.filename
- };
- });
- const result = {
- files: targetFiles
- };
- console.log({
- ...result,
- fileAttachmentTagOptions
- });
- return result;
- }
- findFileAttachmentTag(container) {
- const ns = [];
- const extensions = this.extensions;
- const extensionRegex = new RegExp("\\.(" + extensions.join("|") + ")$", "i");
- const aTagList = container.querySelectorAll("a[href]");
- aTagList.forEach((v, i) => {
- v.setAttribute("target", "_blank");
- const linkText = v.innerText;
- const href = v.href;
- const filename = v.download || v.filename || linkText;
- if (extensionRegex.test(linkText.toLowerCase()) || extensionRegex.test(href.toLowerCase())) {
- ns.push({
- node: v,
- title: linkText,
- href: v.href,
- filename
- });
- }
- });
- return ns;
- }
- // 文件批量下载
- doFileListDownload(list = []) {
- if (Array.isArray(list)) {
- list.forEach((item) => {
- this.download(item.href, item.filename);
- });
- }
- }
- // 文件下载上传
- // 这是一个JavaScript代码,用于劫持浏览器下载附件。首先通过fetch请求获取文件内容,然后将文件内容转换为blob对象。接着创建一个FormData对象,将文件名和文件内容添加到其中。最后,将文件上传到服务器,并在上传成功后处理服务器返回的数据。
- download(href, filename) {
- const articleUrl = location.href;
- fetch(href).then((response) => {
- if (!response.ok) {
- throw new Error("Network response was not ok");
- }
- return response.blob();
- }).then((blob) => {
- const formData = new FormData();
- formData.append("filename", filename);
- formData.append("file", blob, filename);
- formData.append("orgurl", href);
- formData.append("articleurl", articleUrl);
- return fetch(this.uploadUrl, {
- method: "POST",
- body: formData
- });
- }).then((uploadResponse) => {
- if (!uploadResponse.ok) {
- throw new Error("Upload failed!");
- }
- console.log("File uploaded successfully!");
- return uploadResponse.json();
- }).then((data) => {
- console.log(data);
- }).catch((error) => {
- console.error("Error:", error);
- });
- }
- }
- class ContentRuleA extends RuleBaseInterface {
- constructor(config) {
- super();
- __publicField(this, "importPublishTimeKey", ["发布时间"]);
- __publicField(this, "minContentTextLength", 50);
- // 正文最小值,小于该值的丢弃
- __publicField(this, "maxDeep", 5);
- __publicField(this, "config", {
- titleList: []
- });
- if (config) {
- Object.assign(this.config, config);
- }
- }
- // 主函数:处理DOM并返回所需信息
- run(container = document.body) {
- var _a;
- const { titleList } = this.config;
- let eligibleNodes = [];
- if (Array.isArray(titleList)) {
- titleList.forEach((t) => {
- const gotNodes = this.findEligibleLeafNodesForContentLtMark(container, t);
- if (Array.isArray(gotNodes) && gotNodes.length > 0) {
- eligibleNodes = eligibleNodes.concat(gotNodes);
- }
- });
- } else if (typeof titleList === "string") {
- eligibleNodes = this.findEligibleLeafNodesForContentLtMark(container, titleList);
- }
- const needNodes = this.calcNodesInfo(eligibleNodes);
- const title = this.getTitleText(needNodes);
- const contentNodeOptions = this.getNeedNodesParentsAndSiblings(needNodes);
- const dateTime = this.findTargetDateTime(needNodes);
- let targetNode = null;
- if (contentNodeOptions.length > 0) {
- targetNode = contentNodeOptions[0];
- if (targetNode.node) {
- targetNode.node = this.simplifyDOM(targetNode.node);
- }
- }
- const files = this.getFileList();
- const result = {
- href: location.href,
- title,
- listTitle: Array.isArray(titleList) ? titleList[0] : titleList,
- content: targetNode ? (_a = targetNode.node) == null ? void 0 : _a.innerHTML : "",
- publishtime: dateTime,
- files
- };
- console.log({
- ...result,
- eligibleNodes,
- needNodes,
- contentNodeOptions,
- targetNode
- });
- this.report(result);
- return result;
- }
- check() {
- }
- findEligibleLeafNodesForContentLtMark(node, markText) {
- if (!markText) {
- markText = "";
- }
- const maskTextSorted = markText.trim().replace(/\.{2,}/g, "");
- return this.findEligibleLeafNodes(node, (node2) => {
- const contentText = node2 == null ? void 0 : node2.textContent;
- if (contentText && contentText.includes(maskTextSorted)) {
- return true;
- } else {
- return false;
- }
- });
- }
- // 找发布时间
- findTargetDateTime(nodes = []) {
- if (!Array.isArray(nodes)) {
- return;
- }
- if (nodes.length <= 0) {
- return;
- }
- let targetList = [];
- for (let i = 0; i < nodes.length; i++) {
- const node = nodes[i];
- const dateTimeArr = this.findDateTimeString(node);
- dateTimeArr.forEach((item) => {
- item.baseNodeIndex = i;
- });
- targetList = targetList.concat(dateTimeArr);
- }
- targetList.forEach((item) => {
- item.weight = this.calcDateTimeWeight(item);
- });
- const sorted = targetList.sort((a, b) => b.weight - a.weight);
- const resultArr = sorted.filter((item) => {
- return this.hasMatchPublishTimeKey(item);
- });
- let tarArr = resultArr.length > 0 ? resultArr : sorted;
- const tar = tarArr[0];
- if (Array.isArray(tar.times) && tar.times.length > 0) {
- return tar == null ? void 0 : tar.times[0];
- }
- }
- findDateTimeString(node) {
- const elem = node.node;
- if (!node.node) {
- return;
- }
- const arr = this.getEachNeedNodeParentsAndSiblings(elem, ({ item, deep }) => {
- const text = item.innerText;
- if (text) {
- const r = this.extractDates(text);
- if (r && Array.isArray(r) && r.length > 0) {
- return {
- times: r,
- node: item
- };
- } else {
- return false;
- }
- } else {
- return false;
- }
- });
- return arr;
- }
- getNeedNodesParentsAndSiblings(nodes = []) {
- if (!Array.isArray(nodes))
- return;
- let arr = [];
- nodes.forEach((node) => {
- const passInfoArr = this.getEachNeedNodeParentsAndSiblings(node.node, ({ item, deep }) => {
- const text = item.innerText;
- if (text && text.length > this.minContentTextLength) {
- const passInfo = {
- node: item,
- text
- };
- passInfo.weight = this.calcContentWeight(passInfo, deep);
- return passInfo;
- } else {
- return false;
- }
- });
- if (passInfoArr.length > 0) {
- arr = arr.concat(passInfoArr);
- }
- });
- return arr.sort((a, b) => b.weight - a.weight);
- }
- getTitleText(titleNeedList = []) {
- if (!Array.isArray(titleNeedList))
- return;
- if (titleNeedList.length === 0)
- return;
- const maxWeightNode = titleNeedList[0];
- if (maxWeightNode) {
- return maxWeightNode.text;
- }
- }
- // 通用函数:找兄弟元素以及父级元素兄弟元素
- getEachNeedNodeParentsAndSiblings(elem, callback, deep = this.maxDeep) {
- if (!elem)
- return;
- let passElemArr = [];
- const $elem = this.$(elem);
- const $parent = $elem.parent();
- const siblings = $elem.siblings();
- if (siblings.length > 0) {
- siblings.each((i, item) => {
- const tagName = this.getTagName(item);
- const isExcludeTags = this.excludeTags.includes(tagName);
- const passInfo = callback && callback({ item, deep });
- if (passInfo && !isExcludeTags) {
- passElemArr.push(passInfo);
- }
- });
- }
- if (deep > 0) {
- const passArr = this.getEachNeedNodeParentsAndSiblings($parent[0], callback, --deep);
- passElemArr = passElemArr.concat(passArr);
- }
- return passElemArr;
- }
- calcNodesInfo(nodes = []) {
- if (!Array.isArray(nodes))
- return;
- const weightNodes = nodes.map((n) => {
- n.weight = this.calcTitleWeight(n);
- return n;
- });
- return weightNodes.sort((a, b) => b.weight - a.weight);
- }
- simplifyDOM(elem) {
- const $elem = this.$(elem);
- $elem.find("style").remove();
- $elem.find("script").remove();
- return elem;
- }
- calcTitleWeight(node) {
- var _a, _b;
- const titleMaxLength = 25;
- const weightMap = {
- importTag: 8,
- className: 3,
- textLength: 0.05,
- maxTextLength: -0.1
- };
- let weight = 0;
- const tagName = this.getTagName(node.node);
- if (this.importantTagList.includes(tagName)) {
- weight += weightMap.importTag;
- }
- if ((_a = node.node) == null ? void 0 : _a.className) {
- const className = (_b = node.node) == null ? void 0 : _b.className;
- const targetStrList = ["title"];
- for (let i = 0; i < targetStrList.length; i++) {
- const item = targetStrList[i];
- if (className.includes(item)) {
- weight += weightMap.className;
- break;
- }
- }
- }
- const textLength = node.text ? node.text.length : 0;
- weight += textLength * weightMap.textLength;
- if (textLength >= titleMaxLength) {
- const maxTextLengthWeight = (textLength - weightMap.maxTextLength) * weightMap.maxTextLength;
- weight += maxTextLengthWeight;
- }
- return weight;
- }
- calcContentWeight(node, deep) {
- const weightMap = {
- textLength: 0.05,
- deep: [200, 170, 90, 50, 20, 10]
- // 从元素往上走,兄弟元素视为第0级,
- // children: -1, // 子元素越多,权重越小
- };
- let weight = 0;
- const weightDeepValue = weightMap.deep[this.maxDeep - deep] || 1;
- const textLength = node.text ? node.text.length : 0;
- weight += textLength * weightMap.textLength;
- if (weightDeepValue) {
- weight += weightDeepValue;
- }
- return weight;
- }
- calcDateTimeWeight(node) {
- const textMaxLength = 30;
- const weightMap = {
- importKey: 300,
- className: 30,
- baseNodeIndex: [200, 170, 90, 50, 20, 10],
- // 从元素往上走,兄弟元素视为第0级,
- maxTextLength: -3
- };
- let weight = 0;
- if (!node)
- return weight;
- const elem = node.node;
- const baseIndex = node.baseNodeIndex;
- const weightDeepValue = weightMap.baseNodeIndex[baseIndex] || 1;
- if (weightDeepValue) {
- weight += weightDeepValue;
- }
- if (elem == null ? void 0 : elem.className) {
- const className = elem == null ? void 0 : elem.className;
- const targetStrList = ["time"];
- for (let i = 0; i < targetStrList.length; i++) {
- const item = targetStrList[i];
- if (className.includes(item)) {
- weight += weightMap.className;
- break;
- }
- }
- }
- if (elem == null ? void 0 : elem.innerText) {
- const text = elem == null ? void 0 : elem.innerText;
- if (text.length >= textMaxLength) {
- const maxTextLengthWeight = (text.length - textMaxLength) * weightMap.maxTextLength;
- weight += maxTextLengthWeight;
- }
- }
- return weight;
- }
- hasMatchPublishTimeKey(node) {
- const elem = node.node;
- const target = [];
- for (let i = 0; i < this.importPublishTimeKey.length; i++) {
- const key = this.importPublishTimeKey[i];
- const selfText = elem == null ? void 0 : elem.innerText;
- if (selfText.includes(key)) {
- target.push(node);
- break;
- }
- const arr = this.getEachNeedNodeParentsAndSiblings(elem, ({ item }) => {
- const text = item.innerText;
- if (text) {
- const matched = text.includes(key);
- if (matched) {
- return elem;
- }
- }
- }, 0);
- if (arr.length > 0) {
- target.push(node);
- break;
- }
- }
- return target.length > 0;
- }
- getFileList() {
- const fileAttachmentFinder = new FindFileAttachment();
- this.fileAttachmentFinder = fileAttachmentFinder;
- const { files } = fileAttachmentFinder.run();
- return files;
- }
- }
- function runNow() {
- const rulesList = [
- // new ListRuleA(),
- new ListRuleB(),
- // new ContentRuleA({
- // titleList: [
- // "合肥市大数据资产运营有限公司2024年度公开招聘公告"
- // // http://www.bigdatahefei.com/index.php/index/show/index?id=2309
- // ]
- // }),
- // new FindFileAttachment({ autoUpload: true })
- ];
- const runner = new JsSpiderSDK(rulesList, {
- useAsync: false
- });
- runner.run();
- return {
- core: runner,
- rulesList
- };
- }
- window.spiderSdk = {
- version,
- SpiderCore: JsSpiderSDK,
- RuleBase: RuleBaseInterface,
- ListRuleB,
- ContentRuleA,
- FindFileAttachment,
- runNow
- };
- runNow();
- })();
- result;
|