resources_js_pages_home_Index_vue.js 676KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316531753185319532053215322532353245325532653275328532953305331533253335334533553365337533853395340534153425343534453455346534753485349535053515352535353545355535653575358535953605361536253635364536553665367536853695370537153725373537453755376537753785379538053815382538353845385538653875388538953905391539253935394539553965397539853995400540154025403540454055406540754085409541054115412541354145415541654175418541954205421542254235424542554265427542854295430543154325433543454355436543754385439544054415442544354445445544654475448544954505451545254535454545554565457545854595460546154625463546454655466546754685469547054715472547354745475547654775478547954805481548254835484548554865487548854895490549154925493549454955496549754985499550055015502550355045505550655075508550955105511551255135514551555165517551855195520552155225523552455255526552755285529553055315532553355345535553655375538553955405541554255435544554555465547554855495550555155525553555455555556555755585559556055615562556355645565556655675568556955705571557255735574557555765577557855795580558155825583558455855586558755885589559055915592559355945595559655975598559956005601560256035604560556065607560856095610561156125613561456155616561756185619562056215622562356245625562656275628562956305631563256335634563556365637563856395640564156425643564456455646564756485649565056515652565356545655565656575658565956605661566256635664566556665667566856695670567156725673567456755676567756785679568056815682568356845685568656875688568956905691569256935694569556965697569856995700570157025703570457055706570757085709571057115712571357145715571657175718571957205721572257235724572557265727572857295730573157325733573457355736573757385739574057415742574357445745574657475748574957505751575257535754575557565757575857595760576157625763576457655766576757685769577057715772577357745775577657775778577957805781578257835784578557865787578857895790579157925793579457955796579757985799580058015802580358045805580658075808580958105811581258135814581558165817581858195820582158225823582458255826582758285829583058315832583358345835583658375838583958405841584258435844584558465847584858495850585158525853585458555856585758585859586058615862586358645865586658675868586958705871587258735874587558765877587858795880588158825883588458855886588758885889589058915892589358945895589658975898589959005901590259035904590559065907590859095910591159125913591459155916591759185919592059215922592359245925592659275928592959305931593259335934593559365937593859395940594159425943594459455946594759485949595059515952595359545955595659575958595959605961596259635964596559665967596859695970597159725973597459755976597759785979598059815982598359845985598659875988598959905991599259935994599559965997599859996000600160026003600460056006600760086009601060116012601360146015601660176018601960206021602260236024602560266027602860296030603160326033603460356036603760386039604060416042604360446045604660476048604960506051605260536054605560566057605860596060606160626063606460656066606760686069607060716072607360746075607660776078607960806081608260836084608560866087608860896090609160926093609460956096609760986099610061016102610361046105610661076108610961106111611261136114611561166117611861196120612161226123612461256126612761286129613061316132613361346135613661376138613961406141614261436144614561466147614861496150615161526153615461556156615761586159616061616162616361646165616661676168616961706171617261736174617561766177617861796180618161826183618461856186618761886189619061916192619361946195619661976198619962006201620262036204620562066207620862096210621162126213621462156216621762186219622062216222622362246225622662276228622962306231623262336234623562366237623862396240624162426243624462456246624762486249625062516252625362546255625662576258625962606261626262636264626562666267626862696270627162726273627462756276627762786279628062816282628362846285628662876288628962906291629262936294629562966297629862996300630163026303630463056306630763086309631063116312631363146315631663176318631963206321632263236324632563266327632863296330633163326333633463356336633763386339634063416342634363446345634663476348634963506351635263536354635563566357635863596360636163626363636463656366636763686369637063716372637363746375637663776378637963806381638263836384638563866387638863896390639163926393639463956396639763986399640064016402640364046405640664076408640964106411641264136414641564166417641864196420642164226423642464256426642764286429643064316432643364346435643664376438643964406441644264436444644564466447644864496450645164526453645464556456645764586459646064616462646364646465646664676468646964706471647264736474647564766477647864796480648164826483648464856486648764886489649064916492649364946495649664976498649965006501650265036504650565066507650865096510651165126513651465156516651765186519652065216522652365246525652665276528652965306531653265336534653565366537653865396540654165426543654465456546654765486549655065516552655365546555655665576558655965606561656265636564656565666567656865696570657165726573657465756576657765786579658065816582658365846585658665876588658965906591659265936594659565966597659865996600660166026603660466056606660766086609661066116612661366146615661666176618661966206621662266236624662566266627662866296630663166326633663466356636663766386639664066416642664366446645664666476648664966506651665266536654665566566657665866596660666166626663666466656666666766686669667066716672667366746675667666776678667966806681668266836684668566866687668866896690669166926693669466956696669766986699670067016702670367046705670667076708670967106711671267136714671567166717671867196720672167226723672467256726672767286729673067316732673367346735673667376738673967406741674267436744674567466747674867496750675167526753675467556756675767586759676067616762676367646765676667676768676967706771677267736774677567766777677867796780678167826783678467856786678767886789679067916792679367946795679667976798679968006801680268036804680568066807680868096810681168126813681468156816681768186819682068216822682368246825682668276828682968306831683268336834683568366837683868396840684168426843684468456846684768486849685068516852685368546855685668576858685968606861686268636864686568666867686868696870687168726873687468756876687768786879688068816882688368846885688668876888688968906891689268936894689568966897689868996900690169026903690469056906690769086909691069116912691369146915691669176918691969206921692269236924692569266927692869296930693169326933693469356936693769386939694069416942694369446945694669476948694969506951695269536954695569566957695869596960696169626963696469656966696769686969697069716972697369746975697669776978697969806981698269836984698569866987698869896990699169926993699469956996699769986999700070017002700370047005700670077008700970107011701270137014701570167017701870197020702170227023702470257026702770287029703070317032703370347035703670377038703970407041704270437044704570467047704870497050705170527053705470557056705770587059706070617062706370647065706670677068706970707071707270737074707570767077707870797080708170827083708470857086708770887089709070917092709370947095709670977098709971007101710271037104710571067107710871097110711171127113711471157116711771187119712071217122712371247125712671277128712971307131713271337134713571367137713871397140714171427143714471457146714771487149715071517152715371547155715671577158715971607161716271637164716571667167716871697170717171727173717471757176717771787179718071817182718371847185718671877188718971907191719271937194719571967197719871997200720172027203720472057206720772087209721072117212721372147215721672177218721972207221722272237224722572267227722872297230723172327233723472357236723772387239724072417242724372447245724672477248724972507251725272537254725572567257725872597260726172627263726472657266726772687269727072717272727372747275727672777278727972807281728272837284728572867287728872897290729172927293729472957296729772987299730073017302730373047305730673077308730973107311731273137314731573167317731873197320732173227323732473257326732773287329733073317332733373347335733673377338733973407341734273437344734573467347734873497350735173527353735473557356735773587359736073617362736373647365736673677368736973707371737273737374737573767377737873797380738173827383738473857386738773887389739073917392739373947395739673977398739974007401740274037404740574067407740874097410741174127413741474157416741774187419742074217422742374247425742674277428742974307431743274337434743574367437743874397440744174427443744474457446744774487449745074517452745374547455745674577458745974607461746274637464746574667467746874697470747174727473747474757476747774787479748074817482748374847485748674877488748974907491749274937494749574967497749874997500750175027503750475057506750775087509751075117512751375147515751675177518751975207521752275237524752575267527752875297530753175327533753475357536753775387539754075417542754375447545754675477548754975507551755275537554755575567557755875597560756175627563756475657566756775687569757075717572757375747575757675777578757975807581758275837584758575867587758875897590759175927593759475957596759775987599760076017602760376047605760676077608760976107611761276137614761576167617761876197620762176227623762476257626762776287629763076317632763376347635763676377638763976407641764276437644764576467647764876497650765176527653765476557656765776587659766076617662766376647665766676677668766976707671767276737674767576767677767876797680768176827683768476857686768776887689769076917692769376947695769676977698769977007701770277037704770577067707770877097710771177127713771477157716771777187719772077217722772377247725772677277728772977307731773277337734773577367737773877397740774177427743774477457746774777487749775077517752775377547755775677577758775977607761776277637764776577667767776877697770777177727773777477757776777777787779778077817782778377847785778677877788778977907791779277937794779577967797779877997800780178027803780478057806780778087809781078117812781378147815781678177818781978207821782278237824782578267827782878297830783178327833783478357836783778387839784078417842784378447845784678477848784978507851785278537854785578567857785878597860786178627863786478657866786778687869787078717872787378747875787678777878787978807881788278837884788578867887788878897890789178927893789478957896789778987899790079017902790379047905790679077908790979107911791279137914791579167917791879197920792179227923792479257926792779287929793079317932793379347935793679377938793979407941794279437944794579467947794879497950795179527953795479557956795779587959796079617962796379647965796679677968796979707971797279737974797579767977797879797980798179827983798479857986798779887989799079917992799379947995799679977998799980008001800280038004800580068007800880098010801180128013801480158016801780188019802080218022802380248025802680278028802980308031803280338034803580368037803880398040804180428043804480458046804780488049805080518052805380548055805680578058805980608061806280638064806580668067806880698070807180728073807480758076807780788079808080818082808380848085808680878088808980908091809280938094809580968097809880998100810181028103810481058106810781088109811081118112811381148115811681178118811981208121812281238124812581268127812881298130813181328133813481358136813781388139814081418142814381448145814681478148814981508151815281538154815581568157815881598160816181628163816481658166816781688169817081718172817381748175817681778178817981808181818281838184818581868187818881898190819181928193819481958196819781988199820082018202820382048205820682078208820982108211821282138214821582168217821882198220822182228223822482258226822782288229823082318232823382348235823682378238823982408241824282438244824582468247824882498250825182528253825482558256825782588259826082618262826382648265826682678268826982708271827282738274827582768277827882798280828182828283828482858286828782888289829082918292829382948295829682978298829983008301830283038304830583068307830883098310831183128313831483158316831783188319832083218322832383248325832683278328832983308331833283338334833583368337833883398340834183428343834483458346834783488349835083518352835383548355835683578358835983608361836283638364836583668367836883698370837183728373837483758376837783788379838083818382838383848385838683878388838983908391839283938394839583968397839883998400840184028403840484058406840784088409841084118412841384148415841684178418841984208421842284238424842584268427842884298430843184328433843484358436843784388439844084418442844384448445844684478448844984508451845284538454845584568457845884598460846184628463846484658466846784688469847084718472847384748475847684778478847984808481848284838484848584868487848884898490849184928493849484958496849784988499850085018502850385048505850685078508850985108511851285138514851585168517851885198520852185228523852485258526852785288529853085318532853385348535853685378538853985408541854285438544854585468547854885498550855185528553855485558556855785588559856085618562856385648565856685678568856985708571857285738574857585768577857885798580858185828583858485858586858785888589859085918592859385948595859685978598859986008601860286038604860586068607860886098610861186128613861486158616861786188619862086218622862386248625862686278628862986308631863286338634863586368637863886398640864186428643864486458646864786488649865086518652865386548655865686578658865986608661866286638664866586668667866886698670867186728673867486758676867786788679868086818682868386848685868686878688868986908691869286938694869586968697869886998700870187028703870487058706870787088709871087118712871387148715871687178718871987208721872287238724872587268727872887298730873187328733873487358736873787388739874087418742874387448745874687478748874987508751875287538754875587568757875887598760876187628763876487658766876787688769877087718772877387748775877687778778877987808781878287838784878587868787878887898790879187928793879487958796879787988799880088018802880388048805880688078808880988108811881288138814881588168817881888198820882188228823882488258826882788288829883088318832883388348835883688378838883988408841884288438844884588468847884888498850885188528853885488558856885788588859886088618862886388648865886688678868886988708871887288738874887588768877887888798880888188828883888488858886888788888889889088918892889388948895889688978898889989008901890289038904890589068907890889098910891189128913891489158916891789188919892089218922892389248925892689278928892989308931893289338934893589368937893889398940894189428943894489458946894789488949895089518952895389548955895689578958895989608961896289638964896589668967896889698970897189728973897489758976897789788979898089818982898389848985898689878988898989908991899289938994899589968997899889999000900190029003900490059006900790089009901090119012901390149015901690179018901990209021902290239024902590269027902890299030903190329033903490359036903790389039904090419042904390449045904690479048904990509051905290539054905590569057905890599060906190629063906490659066906790689069907090719072907390749075907690779078907990809081908290839084908590869087908890899090909190929093909490959096909790989099910091019102910391049105910691079108910991109111911291139114911591169117911891199120912191229123912491259126912791289129913091319132913391349135913691379138913991409141914291439144914591469147914891499150915191529153915491559156915791589159916091619162916391649165916691679168916991709171917291739174917591769177917891799180918191829183918491859186918791889189919091919192919391949195919691979198919992009201920292039204920592069207920892099210921192129213921492159216921792189219922092219222922392249225922692279228922992309231923292339234923592369237923892399240924192429243924492459246924792489249925092519252925392549255925692579258925992609261926292639264926592669267926892699270927192729273927492759276927792789279928092819282928392849285928692879288928992909291929292939294929592969297929892999300930193029303930493059306930793089309931093119312931393149315931693179318931993209321932293239324932593269327932893299330933193329333933493359336933793389339934093419342934393449345934693479348934993509351935293539354935593569357935893599360936193629363936493659366936793689369937093719372937393749375937693779378937993809381938293839384938593869387938893899390939193929393939493959396939793989399940094019402940394049405940694079408940994109411941294139414941594169417941894199420942194229423942494259426942794289429943094319432943394349435943694379438943994409441944294439444944594469447944894499450945194529453945494559456945794589459946094619462946394649465946694679468946994709471947294739474947594769477947894799480948194829483948494859486948794889489949094919492949394949495949694979498949995009501950295039504950595069507950895099510951195129513951495159516951795189519952095219522952395249525952695279528952995309531953295339534953595369537953895399540954195429543954495459546954795489549955095519552955395549555955695579558955995609561956295639564956595669567956895699570957195729573957495759576957795789579958095819582958395849585958695879588958995909591959295939594959595969597959895999600960196029603960496059606960796089609961096119612961396149615961696179618961996209621962296239624962596269627962896299630963196329633963496359636963796389639964096419642964396449645964696479648964996509651965296539654965596569657965896599660966196629663966496659666966796689669967096719672967396749675967696779678967996809681968296839684968596869687968896899690969196929693969496959696969796989699970097019702970397049705970697079708970997109711971297139714971597169717971897199720972197229723972497259726972797289729973097319732973397349735973697379738973997409741974297439744974597469747974897499750975197529753975497559756975797589759976097619762976397649765976697679768976997709771977297739774977597769777977897799780978197829783978497859786978797889789979097919792979397949795979697979798979998009801980298039804980598069807980898099810981198129813981498159816981798189819982098219822982398249825982698279828982998309831983298339834983598369837983898399840984198429843984498459846984798489849985098519852985398549855985698579858985998609861986298639864986598669867986898699870987198729873987498759876987798789879988098819882988398849885988698879888988998909891989298939894989598969897989898999900990199029903990499059906990799089909991099119912991399149915991699179918991999209921992299239924992599269927992899299930993199329933993499359936993799389939994099419942994399449945994699479948994999509951995299539954995599569957995899599960996199629963996499659966996799689969997099719972997399749975997699779978997999809981998299839984998599869987998899899990999199929993999499959996999799989999100001000110002100031000410005100061000710008100091001010011100121001310014100151001610017100181001910020100211002210023100241002510026100271002810029100301003110032100331003410035100361003710038100391004010041100421004310044100451004610047100481004910050100511005210053100541005510056100571005810059100601006110062100631006410065100661006710068100691007010071100721007310074100751007610077100781007910080100811008210083100841008510086100871008810089100901009110092100931009410095100961009710098100991010010101101021010310104101051010610107101081010910110101111011210113101141011510116101171011810119101201012110122101231012410125101261012710128101291013010131101321013310134101351013610137101381013910140101411014210143101441014510146101471014810149101501015110152101531015410155101561015710158101591016010161101621016310164101651016610167101681016910170101711017210173101741017510176101771017810179101801018110182101831018410185101861018710188101891019010191101921019310194101951019610197101981019910200102011020210203102041020510206102071020810209102101021110212102131021410215102161021710218102191022010221102221022310224102251022610227102281022910230102311023210233102341023510236102371023810239102401024110242102431024410245102461024710248102491025010251102521025310254102551025610257102581025910260102611026210263102641026510266102671026810269102701027110272102731027410275102761027710278102791028010281102821028310284102851028610287102881028910290102911029210293102941029510296102971029810299103001030110302103031030410305103061030710308103091031010311103121031310314103151031610317103181031910320103211032210323103241032510326103271032810329103301033110332103331033410335103361033710338103391034010341103421034310344103451034610347103481034910350103511035210353103541035510356103571035810359103601036110362103631036410365103661036710368103691037010371103721037310374103751037610377103781037910380103811038210383103841038510386103871038810389103901039110392103931039410395103961039710398103991040010401104021040310404104051040610407104081040910410104111041210413104141041510416104171041810419104201042110422104231042410425104261042710428104291043010431104321043310434104351043610437104381043910440104411044210443104441044510446104471044810449104501045110452104531045410455104561045710458104591046010461104621046310464104651046610467104681046910470104711047210473104741047510476104771047810479104801048110482104831048410485104861048710488104891049010491104921049310494104951049610497104981049910500105011050210503105041050510506105071050810509105101051110512105131051410515105161051710518105191052010521105221052310524105251052610527105281052910530105311053210533105341053510536105371053810539105401054110542105431054410545105461054710548105491055010551105521055310554105551055610557105581055910560105611056210563105641056510566105671056810569105701057110572105731057410575105761057710578105791058010581105821058310584105851058610587105881058910590105911059210593105941059510596105971059810599106001060110602106031060410605106061060710608106091061010611106121061310614106151061610617106181061910620106211062210623106241062510626106271062810629106301063110632106331063410635106361063710638106391064010641106421064310644106451064610647106481064910650106511065210653106541065510656106571065810659106601066110662106631066410665106661066710668106691067010671106721067310674106751067610677106781067910680106811068210683106841068510686106871068810689106901069110692106931069410695106961069710698106991070010701107021070310704107051070610707107081070910710107111071210713107141071510716107171071810719107201072110722107231072410725107261072710728107291073010731107321073310734107351073610737107381073910740107411074210743107441074510746107471074810749107501075110752107531075410755107561075710758107591076010761107621076310764107651076610767107681076910770107711077210773107741077510776107771077810779107801078110782107831078410785107861078710788107891079010791107921079310794107951079610797107981079910800108011080210803108041080510806108071080810809108101081110812108131081410815108161081710818108191082010821108221082310824108251082610827108281082910830108311083210833108341083510836108371083810839108401084110842108431084410845108461084710848108491085010851108521085310854108551085610857108581085910860108611086210863108641086510866108671086810869108701087110872108731087410875108761087710878108791088010881108821088310884108851088610887108881088910890108911089210893108941089510896108971089810899109001090110902109031090410905109061090710908109091091010911109121091310914109151091610917109181091910920109211092210923109241092510926109271092810929109301093110932109331093410935109361093710938109391094010941109421094310944109451094610947109481094910950109511095210953109541095510956109571095810959109601096110962109631096410965109661096710968109691097010971109721097310974109751097610977109781097910980109811098210983109841098510986109871098810989109901099110992109931099410995109961099710998109991100011001110021100311004110051100611007110081100911010110111101211013110141101511016110171101811019110201102111022110231102411025110261102711028110291103011031110321103311034110351103611037110381103911040110411104211043110441104511046110471104811049110501105111052110531105411055110561105711058110591106011061110621106311064110651106611067110681106911070110711107211073110741107511076110771107811079110801108111082110831108411085110861108711088110891109011091110921109311094110951109611097110981109911100111011110211103111041110511106111071110811109111101111111112111131111411115111161111711118111191112011121111221112311124111251112611127111281112911130111311113211133111341113511136111371113811139111401114111142111431114411145111461114711148111491115011151111521115311154111551115611157111581115911160111611116211163111641116511166111671116811169111701117111172111731117411175111761117711178111791118011181111821118311184111851118611187111881118911190111911119211193111941119511196111971119811199112001120111202112031120411205112061120711208112091121011211112121121311214112151121611217112181121911220112211122211223112241122511226112271122811229112301123111232112331123411235112361123711238112391124011241112421124311244112451124611247112481124911250112511125211253112541125511256112571125811259112601126111262112631126411265112661126711268112691127011271112721127311274112751127611277112781127911280112811128211283112841128511286112871128811289112901129111292112931129411295112961129711298112991130011301113021130311304113051130611307113081130911310113111131211313113141131511316113171131811319113201132111322113231132411325113261132711328113291133011331113321133311334113351133611337113381133911340113411134211343113441134511346113471134811349113501135111352113531135411355113561135711358113591136011361113621136311364113651136611367113681136911370113711137211373113741137511376113771137811379113801138111382113831138411385113861138711388113891139011391113921139311394113951139611397113981139911400114011140211403114041140511406114071140811409114101141111412114131141411415114161141711418114191142011421114221142311424114251142611427114281142911430114311143211433114341143511436114371143811439114401144111442114431144411445114461144711448114491145011451114521145311454114551145611457114581145911460114611146211463114641146511466114671146811469114701147111472114731147411475114761147711478114791148011481114821148311484114851148611487114881148911490114911149211493114941149511496114971149811499115001150111502115031150411505115061150711508115091151011511115121151311514115151151611517115181151911520115211152211523115241152511526115271152811529115301153111532115331153411535115361153711538115391154011541115421154311544115451154611547115481154911550115511155211553115541155511556115571155811559115601156111562115631156411565115661156711568115691157011571115721157311574115751157611577115781157911580115811158211583115841158511586115871158811589115901159111592115931159411595115961159711598115991160011601116021160311604116051160611607116081160911610116111161211613116141161511616116171161811619116201162111622116231162411625116261162711628116291163011631116321163311634116351163611637116381163911640116411164211643116441164511646116471164811649116501165111652116531165411655116561165711658116591166011661116621166311664116651166611667116681166911670116711167211673116741167511676116771167811679116801168111682116831168411685116861168711688116891169011691116921169311694116951169611697116981169911700117011170211703117041170511706117071170811709117101171111712117131171411715117161171711718117191172011721117221172311724117251172611727117281172911730117311173211733117341173511736117371173811739117401174111742117431174411745117461174711748117491175011751117521175311754117551175611757117581175911760117611176211763117641176511766117671176811769117701177111772117731177411775117761177711778117791178011781117821178311784117851178611787117881178911790117911179211793117941179511796117971179811799118001180111802118031180411805118061180711808118091181011811118121181311814118151181611817118181181911820118211182211823118241182511826118271182811829118301183111832118331183411835118361183711838118391184011841118421184311844118451184611847118481184911850118511185211853118541185511856118571185811859118601186111862118631186411865118661186711868118691187011871118721187311874118751187611877118781187911880118811188211883118841188511886118871188811889118901189111892118931189411895118961189711898118991190011901119021190311904119051190611907119081190911910119111191211913119141191511916119171191811919119201192111922119231192411925119261192711928119291193011931119321193311934119351193611937119381193911940119411194211943119441194511946119471194811949119501195111952119531195411955119561195711958119591196011961119621196311964119651196611967119681196911970119711197211973119741197511976119771197811979119801198111982119831198411985119861198711988119891199011991119921199311994119951199611997119981199912000120011200212003120041200512006120071200812009120101201112012120131201412015120161201712018120191202012021120221202312024120251202612027120281202912030120311203212033120341203512036120371203812039120401204112042120431204412045120461204712048120491205012051120521205312054120551205612057120581205912060120611206212063120641206512066120671206812069120701207112072120731207412075120761207712078120791208012081120821208312084120851208612087120881208912090120911209212093120941209512096120971209812099121001210112102121031210412105121061210712108121091211012111121121211312114121151211612117121181211912120121211212212123121241212512126121271212812129121301213112132121331213412135121361213712138121391214012141121421214312144121451214612147121481214912150121511215212153121541215512156121571215812159121601216112162121631216412165121661216712168121691217012171121721217312174121751217612177121781217912180121811218212183121841218512186121871218812189121901219112192121931219412195121961219712198121991220012201122021220312204122051220612207122081220912210122111221212213122141221512216122171221812219122201222112222122231222412225122261222712228122291223012231122321223312234122351223612237122381223912240122411224212243122441224512246122471224812249122501225112252122531225412255122561225712258122591226012261122621226312264122651226612267122681226912270122711227212273122741227512276122771227812279122801228112282122831228412285122861228712288122891229012291122921229312294122951229612297122981229912300123011230212303123041230512306123071230812309123101231112312123131231412315123161231712318123191232012321123221232312324123251232612327123281232912330123311233212333123341233512336123371233812339123401234112342123431234412345123461234712348123491235012351123521235312354123551235612357123581235912360123611236212363123641236512366123671236812369123701237112372123731237412375123761237712378123791238012381123821238312384123851238612387123881238912390123911239212393123941239512396123971239812399124001240112402124031240412405124061240712408124091241012411124121241312414124151241612417124181241912420124211242212423124241242512426124271242812429124301243112432124331243412435124361243712438124391244012441124421244312444124451244612447124481244912450124511245212453124541245512456124571245812459124601246112462124631246412465124661246712468124691247012471124721247312474124751247612477124781247912480124811248212483124841248512486124871248812489124901249112492124931249412495124961249712498124991250012501125021250312504125051250612507125081250912510125111251212513125141251512516125171251812519125201252112522125231252412525125261252712528125291253012531125321253312534125351253612537125381253912540125411254212543125441254512546125471254812549125501255112552125531255412555125561255712558125591256012561125621256312564125651256612567125681256912570125711257212573125741257512576125771257812579125801258112582125831258412585125861258712588125891259012591125921259312594125951259612597125981259912600126011260212603126041260512606126071260812609126101261112612126131261412615126161261712618126191262012621126221262312624126251262612627126281262912630126311263212633126341263512636126371263812639126401264112642126431264412645126461264712648126491265012651126521265312654126551265612657126581265912660126611266212663126641266512666126671266812669126701267112672126731267412675126761267712678126791268012681126821268312684126851268612687126881268912690126911269212693126941269512696126971269812699127001270112702127031270412705127061270712708127091271012711127121271312714127151271612717127181271912720127211272212723127241272512726127271272812729127301273112732127331273412735127361273712738127391274012741127421274312744127451274612747127481274912750127511275212753127541275512756127571275812759127601276112762127631276412765127661276712768127691277012771127721277312774127751277612777127781277912780127811278212783127841278512786127871278812789127901279112792127931279412795127961279712798127991280012801128021280312804128051280612807128081280912810128111281212813128141281512816128171281812819128201282112822128231282412825128261282712828128291283012831128321283312834128351283612837128381283912840128411284212843128441284512846128471284812849128501285112852128531285412855128561285712858128591286012861128621286312864128651286612867128681286912870128711287212873128741287512876128771287812879128801288112882128831288412885128861288712888128891289012891128921289312894128951289612897128981289912900129011290212903129041290512906129071290812909129101291112912129131291412915129161291712918129191292012921129221292312924129251292612927129281292912930129311293212933129341293512936129371293812939129401294112942129431294412945129461294712948129491295012951129521295312954129551295612957129581295912960129611296212963129641296512966129671296812969129701297112972129731297412975129761297712978129791298012981129821298312984129851298612987129881298912990129911299212993129941299512996129971299812999130001300113002130031300413005130061300713008130091301013011130121301313014130151301613017130181301913020130211302213023130241302513026130271302813029130301303113032130331303413035130361303713038130391304013041130421304313044130451304613047130481304913050130511305213053130541305513056130571305813059130601306113062130631306413065130661306713068130691307013071130721307313074130751307613077130781307913080130811308213083130841308513086130871308813089130901309113092130931309413095130961309713098130991310013101131021310313104131051310613107131081310913110131111311213113131141311513116131171311813119131201312113122131231312413125131261312713128131291313013131131321313313134131351313613137131381313913140131411314213143131441314513146131471314813149131501315113152131531315413155131561315713158131591316013161131621316313164131651316613167131681316913170131711317213173131741317513176131771317813179131801318113182131831318413185131861318713188131891319013191131921319313194131951319613197131981319913200132011320213203132041320513206132071320813209132101321113212132131321413215132161321713218132191322013221132221322313224132251322613227132281322913230132311323213233132341323513236132371323813239132401324113242132431324413245132461324713248132491325013251132521325313254132551325613257132581325913260132611326213263132641326513266132671326813269132701327113272132731327413275132761327713278132791328013281132821328313284132851328613287132881328913290132911329213293132941329513296132971329813299133001330113302133031330413305133061330713308133091331013311133121331313314133151331613317133181331913320133211332213323133241332513326133271332813329133301333113332133331333413335133361333713338133391334013341133421334313344133451334613347133481334913350133511335213353133541335513356133571335813359133601336113362133631336413365133661336713368133691337013371133721337313374133751337613377133781337913380133811338213383133841338513386133871338813389133901339113392133931339413395133961339713398133991340013401134021340313404134051340613407134081340913410134111341213413134141341513416134171341813419134201342113422134231342413425134261342713428134291343013431134321343313434134351343613437134381343913440134411344213443134441344513446134471344813449134501345113452134531345413455134561345713458134591346013461134621346313464134651346613467134681346913470134711347213473134741347513476134771347813479134801348113482134831348413485134861348713488134891349013491134921349313494134951349613497134981349913500135011350213503135041350513506135071350813509135101351113512135131351413515135161351713518135191352013521135221352313524135251352613527135281352913530135311353213533135341353513536135371353813539135401354113542135431354413545135461354713548135491355013551135521355313554135551355613557135581355913560135611356213563135641356513566135671356813569135701357113572135731357413575135761357713578135791358013581135821358313584135851358613587135881358913590135911359213593135941359513596135971359813599136001360113602136031360413605136061360713608136091361013611136121361313614136151361613617136181361913620136211362213623136241362513626136271362813629136301363113632136331363413635136361363713638136391364013641136421364313644136451364613647136481364913650136511365213653136541365513656136571365813659136601366113662136631366413665136661366713668136691367013671136721367313674136751367613677136781367913680136811368213683136841368513686136871368813689136901369113692136931369413695136961369713698136991370013701137021370313704137051370613707137081370913710137111371213713137141371513716137171371813719137201372113722137231372413725137261372713728137291373013731137321373313734137351373613737137381373913740137411374213743137441374513746137471374813749137501375113752137531375413755137561375713758137591376013761137621376313764137651376613767137681376913770137711377213773137741377513776137771377813779137801378113782137831378413785137861378713788137891379013791137921379313794137951379613797137981379913800138011380213803138041380513806138071380813809138101381113812138131381413815138161381713818138191382013821138221382313824138251382613827138281382913830138311383213833138341383513836138371383813839138401384113842138431384413845138461384713848138491385013851138521385313854138551385613857138581385913860138611386213863138641386513866138671386813869138701387113872138731387413875138761387713878138791388013881138821388313884138851388613887138881388913890138911389213893138941389513896138971389813899139001390113902139031390413905139061390713908139091391013911139121391313914139151391613917139181391913920139211392213923139241392513926139271392813929139301393113932139331393413935139361393713938139391394013941139421394313944139451394613947139481394913950139511395213953139541395513956139571395813959139601396113962139631396413965139661396713968139691397013971139721397313974139751397613977139781397913980139811398213983139841398513986139871398813989139901399113992139931399413995139961399713998139991400014001140021400314004140051400614007140081400914010140111401214013140141401514016140171401814019140201402114022140231402414025140261402714028140291403014031140321403314034140351403614037140381403914040140411404214043140441404514046140471404814049140501405114052140531405414055140561405714058140591406014061140621406314064140651406614067140681406914070140711407214073140741407514076140771407814079140801408114082140831408414085140861408714088140891409014091140921409314094140951409614097140981409914100141011410214103141041410514106141071410814109141101411114112141131411414115141161411714118141191412014121141221412314124141251412614127141281412914130141311413214133141341413514136141371413814139141401414114142141431414414145141461414714148141491415014151141521415314154141551415614157141581415914160141611416214163141641416514166141671416814169141701417114172141731417414175141761417714178141791418014181141821418314184141851418614187141881418914190141911419214193141941419514196141971419814199142001420114202142031420414205142061420714208142091421014211142121421314214142151421614217142181421914220142211422214223142241422514226142271422814229142301423114232142331423414235142361423714238142391424014241142421424314244142451424614247142481424914250142511425214253142541425514256142571425814259142601426114262142631426414265142661426714268142691427014271142721427314274142751427614277142781427914280142811428214283142841428514286142871428814289142901429114292142931429414295142961429714298142991430014301143021430314304143051430614307143081430914310143111431214313143141431514316143171431814319143201432114322143231432414325143261432714328143291433014331143321433314334143351433614337143381433914340143411434214343143441434514346143471434814349143501435114352143531435414355143561435714358143591436014361143621436314364143651436614367143681436914370143711437214373143741437514376143771437814379143801438114382143831438414385143861438714388143891439014391143921439314394143951439614397143981439914400144011440214403144041440514406144071440814409144101441114412144131441414415144161441714418144191442014421144221442314424144251442614427144281442914430144311443214433144341443514436144371443814439144401444114442144431444414445144461444714448144491445014451144521445314454144551445614457144581445914460144611446214463144641446514466144671446814469144701447114472144731447414475144761447714478144791448014481144821448314484144851448614487144881448914490144911449214493144941449514496144971449814499145001450114502145031450414505145061450714508145091451014511145121451314514145151451614517145181451914520145211452214523145241452514526145271452814529145301453114532145331453414535145361453714538145391454014541145421454314544145451454614547145481454914550145511455214553145541455514556145571455814559145601456114562145631456414565145661456714568145691457014571145721457314574145751457614577145781457914580145811458214583145841458514586145871458814589145901459114592145931459414595145961459714598145991460014601146021460314604146051460614607146081460914610146111461214613146141461514616146171461814619146201462114622146231462414625146261462714628146291463014631146321463314634146351463614637146381463914640146411464214643146441464514646146471464814649146501465114652146531465414655146561465714658146591466014661146621466314664146651466614667146681466914670146711467214673146741467514676146771467814679146801468114682146831468414685146861468714688146891469014691146921469314694146951469614697146981469914700147011470214703147041470514706147071470814709147101471114712147131471414715147161471714718147191472014721147221472314724147251472614727147281472914730147311473214733147341473514736147371473814739147401474114742147431474414745147461474714748147491475014751147521475314754147551475614757147581475914760147611476214763147641476514766147671476814769147701477114772147731477414775147761477714778147791478014781147821478314784147851478614787147881478914790147911479214793147941479514796147971479814799148001480114802148031480414805148061480714808148091481014811148121481314814148151481614817148181481914820148211482214823148241482514826148271482814829148301483114832148331483414835148361483714838148391484014841148421484314844148451484614847148481484914850148511485214853148541485514856148571485814859148601486114862148631486414865148661486714868148691487014871148721487314874148751487614877148781487914880148811488214883148841488514886148871488814889148901489114892148931489414895148961489714898148991490014901149021490314904149051490614907149081490914910149111491214913149141491514916149171491814919149201492114922149231492414925149261492714928149291493014931149321493314934149351493614937149381493914940149411494214943149441494514946149471494814949149501495114952149531495414955149561495714958149591496014961149621496314964149651496614967149681496914970149711497214973149741497514976149771497814979149801498114982149831498414985149861498714988149891499014991149921499314994149951499614997149981499915000150011500215003150041500515006150071500815009150101501115012150131501415015150161501715018150191502015021150221502315024150251502615027150281502915030150311503215033150341503515036150371503815039150401504115042150431504415045150461504715048150491505015051150521505315054150551505615057150581505915060150611506215063150641506515066150671506815069150701507115072150731507415075150761507715078150791508015081150821508315084150851508615087150881508915090150911509215093150941509515096150971509815099151001510115102151031510415105151061510715108151091511015111151121511315114151151511615117151181511915120151211512215123151241512515126151271512815129151301513115132151331513415135151361513715138151391514015141151421514315144151451514615147151481514915150151511515215153151541515515156151571515815159151601516115162151631516415165151661516715168151691517015171151721517315174151751517615177151781517915180151811518215183151841518515186151871518815189151901519115192151931519415195151961519715198151991520015201152021520315204152051520615207152081520915210152111521215213152141521515216152171521815219152201522115222152231522415225152261522715228152291523015231152321523315234152351523615237152381523915240152411524215243152441524515246152471524815249152501525115252152531525415255152561525715258152591526015261152621526315264152651526615267152681526915270152711527215273152741527515276152771527815279152801528115282152831528415285152861528715288152891529015291152921529315294152951529615297152981529915300153011530215303153041530515306153071530815309153101531115312153131531415315153161531715318153191532015321153221532315324153251532615327153281532915330153311533215333153341533515336153371533815339153401534115342153431534415345153461534715348153491535015351153521535315354153551535615357153581535915360153611536215363153641536515366153671536815369153701537115372153731537415375153761537715378153791538015381153821538315384153851538615387153881538915390153911539215393153941539515396153971539815399154001540115402154031540415405154061540715408154091541015411154121541315414154151541615417154181541915420154211542215423154241542515426154271542815429154301543115432154331543415435154361543715438154391544015441154421544315444154451544615447154481544915450154511545215453154541545515456154571545815459154601546115462154631546415465154661546715468154691547015471154721547315474154751547615477154781547915480154811548215483154841548515486154871548815489154901549115492154931549415495154961549715498154991550015501155021550315504155051550615507155081550915510155111551215513155141551515516155171551815519155201552115522155231552415525155261552715528155291553015531155321553315534155351553615537155381553915540155411554215543155441554515546155471554815549155501555115552155531555415555155561555715558155591556015561155621556315564155651556615567155681556915570155711557215573155741557515576155771557815579155801558115582155831558415585155861558715588155891559015591155921559315594155951559615597155981559915600156011560215603156041560515606156071560815609156101561115612156131561415615156161561715618156191562015621156221562315624156251562615627156281562915630156311563215633156341563515636156371563815639156401564115642156431564415645156461564715648156491565015651156521565315654156551565615657156581565915660156611566215663156641566515666156671566815669156701567115672156731567415675156761567715678156791568015681156821568315684156851568615687156881568915690156911569215693156941569515696156971569815699157001570115702157031570415705157061570715708157091571015711157121571315714157151571615717157181571915720157211572215723157241572515726157271572815729157301573115732157331573415735157361573715738157391574015741157421574315744157451574615747157481574915750157511575215753157541575515756157571575815759157601576115762157631576415765157661576715768157691577015771157721577315774157751577615777157781577915780157811578215783157841578515786157871578815789157901579115792157931579415795157961579715798157991580015801158021580315804158051580615807158081580915810158111581215813158141581515816158171581815819158201582115822158231582415825158261582715828158291583015831158321583315834158351583615837158381583915840158411584215843158441584515846158471584815849158501585115852158531585415855158561585715858158591586015861158621586315864158651586615867158681586915870158711587215873158741587515876158771587815879158801588115882158831588415885158861588715888158891589015891158921589315894158951589615897158981589915900159011590215903159041590515906159071590815909159101591115912159131591415915159161591715918159191592015921159221592315924159251592615927159281592915930159311593215933159341593515936159371593815939159401594115942159431594415945159461594715948159491595015951159521595315954159551595615957159581595915960159611596215963159641596515966159671596815969159701597115972159731597415975159761597715978159791598015981159821598315984159851598615987159881598915990159911599215993159941599515996159971599815999160001600116002160031600416005160061600716008160091601016011160121601316014160151601616017160181601916020160211602216023160241602516026160271602816029160301603116032160331603416035160361603716038160391604016041160421604316044160451604616047160481604916050160511605216053160541605516056160571605816059160601606116062160631606416065160661606716068160691607016071160721607316074160751607616077160781607916080160811608216083160841608516086160871608816089160901609116092160931609416095160961609716098160991610016101161021610316104161051610616107161081610916110161111611216113161141611516116161171611816119161201612116122161231612416125161261612716128161291613016131161321613316134161351613616137161381613916140161411614216143161441614516146161471614816149161501615116152161531615416155161561615716158161591616016161161621616316164161651616616167161681616916170161711617216173161741617516176161771617816179161801618116182161831618416185161861618716188161891619016191161921619316194161951619616197161981619916200162011620216203162041620516206162071620816209162101621116212162131621416215162161621716218162191622016221162221622316224162251622616227162281622916230162311623216233162341623516236162371623816239162401624116242162431624416245162461624716248162491625016251162521625316254162551625616257162581625916260162611626216263162641626516266162671626816269162701627116272162731627416275162761627716278162791628016281162821628316284162851628616287162881628916290162911629216293162941629516296162971629816299163001630116302163031630416305163061630716308163091631016311163121631316314163151631616317163181631916320163211632216323163241632516326163271632816329163301633116332163331633416335163361633716338163391634016341163421634316344163451634616347163481634916350163511635216353163541635516356163571635816359163601636116362163631636416365163661636716368163691637016371163721637316374163751637616377163781637916380163811638216383163841638516386163871638816389163901639116392163931639416395163961639716398163991640016401164021640316404164051640616407164081640916410164111641216413164141641516416164171641816419164201642116422164231642416425164261642716428164291643016431164321643316434164351643616437164381643916440164411644216443164441644516446164471644816449164501645116452164531645416455164561645716458164591646016461164621646316464164651646616467164681646916470164711647216473164741647516476164771647816479164801648116482164831648416485164861648716488164891649016491164921649316494164951649616497164981649916500165011650216503165041650516506165071650816509165101651116512165131651416515165161651716518165191652016521165221652316524165251652616527165281652916530165311653216533165341653516536165371653816539165401654116542165431654416545165461654716548165491655016551165521655316554165551655616557165581655916560165611656216563165641656516566165671656816569165701657116572165731657416575165761657716578165791658016581165821658316584165851658616587165881658916590165911659216593165941659516596165971659816599166001660116602166031660416605166061660716608166091661016611166121661316614166151661616617166181661916620166211662216623166241662516626166271662816629166301663116632166331663416635166361663716638166391664016641166421664316644166451664616647166481664916650166511665216653166541665516656166571665816659166601666116662166631666416665166661666716668166691667016671166721667316674166751667616677166781667916680166811668216683166841668516686166871668816689166901669116692166931669416695166961669716698166991670016701167021670316704167051670616707167081670916710167111671216713167141671516716167171671816719167201672116722167231672416725167261672716728167291673016731167321673316734167351673616737167381673916740167411674216743167441674516746167471674816749167501675116752167531675416755167561675716758167591676016761167621676316764167651676616767167681676916770167711677216773167741677516776167771677816779167801678116782167831678416785167861678716788167891679016791167921679316794167951679616797167981679916800168011680216803168041680516806168071680816809168101681116812168131681416815168161681716818168191682016821168221682316824168251682616827168281682916830168311683216833168341683516836168371683816839168401684116842168431684416845168461684716848168491685016851168521685316854168551685616857168581685916860168611686216863168641686516866168671686816869168701687116872168731687416875168761687716878168791688016881168821688316884168851688616887168881688916890168911689216893168941689516896168971689816899169001690116902169031690416905169061690716908169091691016911169121691316914169151691616917169181691916920169211692216923169241692516926169271692816929169301693116932169331693416935169361693716938169391694016941169421694316944169451694616947169481694916950169511695216953169541695516956169571695816959169601696116962169631696416965169661696716968169691697016971169721697316974169751697616977169781697916980169811698216983169841698516986169871698816989169901699116992169931699416995169961699716998169991700017001170021700317004170051700617007170081700917010170111701217013170141701517016170171701817019170201702117022170231702417025170261702717028170291703017031170321703317034170351703617037170381703917040170411704217043170441704517046170471704817049170501705117052170531705417055170561705717058170591706017061170621706317064170651706617067170681706917070170711707217073170741707517076170771707817079170801708117082170831708417085170861708717088170891709017091170921709317094170951709617097170981709917100171011710217103171041710517106171071710817109171101711117112171131711417115171161711717118171191712017121171221712317124171251712617127171281712917130171311713217133171341713517136171371713817139171401714117142171431714417145171461714717148171491715017151171521715317154171551715617157171581715917160171611716217163171641716517166171671716817169171701717117172171731717417175171761717717178171791718017181171821718317184171851718617187171881718917190171911719217193171941719517196171971719817199172001720117202172031720417205172061720717208172091721017211172121721317214172151721617217172181721917220172211722217223172241722517226172271722817229172301723117232172331723417235172361723717238172391724017241172421724317244172451724617247172481724917250172511725217253172541725517256172571725817259172601726117262172631726417265172661726717268172691727017271172721727317274172751727617277172781727917280172811728217283172841728517286172871728817289172901729117292172931729417295172961729717298172991730017301173021730317304173051730617307173081730917310173111731217313173141731517316173171731817319173201732117322173231732417325173261732717328173291733017331173321733317334173351733617337173381733917340173411734217343173441734517346173471734817349173501735117352173531735417355173561735717358173591736017361173621736317364173651736617367173681736917370173711737217373173741737517376173771737817379173801738117382173831738417385173861738717388173891739017391173921739317394173951739617397173981739917400174011740217403174041740517406174071740817409174101741117412174131741417415174161741717418174191742017421174221742317424174251742617427174281742917430174311743217433174341743517436174371743817439174401744117442174431744417445174461744717448174491745017451174521745317454174551745617457174581745917460174611746217463174641746517466174671746817469174701747117472174731747417475174761747717478174791748017481174821748317484174851748617487174881748917490174911749217493174941749517496174971749817499175001750117502175031750417505175061750717508175091751017511175121751317514175151751617517175181751917520175211752217523175241752517526175271752817529175301753117532175331753417535175361753717538175391754017541175421754317544175451754617547175481754917550175511755217553175541755517556175571755817559175601756117562175631756417565175661756717568175691757017571175721757317574175751757617577175781757917580175811758217583175841758517586175871758817589175901759117592175931759417595175961759717598175991760017601176021760317604176051760617607176081760917610176111761217613176141761517616176171761817619176201762117622176231762417625176261762717628176291763017631176321763317634176351763617637176381763917640176411764217643176441764517646176471764817649176501765117652176531765417655176561765717658176591766017661176621766317664176651766617667176681766917670176711767217673176741767517676176771767817679176801768117682176831768417685176861768717688176891769017691176921769317694176951769617697176981769917700177011770217703177041770517706177071770817709177101771117712177131771417715177161771717718177191772017721177221772317724177251772617727177281772917730177311773217733177341773517736177371773817739177401774117742177431774417745177461774717748177491775017751177521775317754177551775617757177581775917760177611776217763177641776517766177671776817769177701777117772177731777417775177761777717778177791778017781177821778317784177851778617787177881778917790177911779217793177941779517796177971779817799178001780117802178031780417805178061780717808178091781017811178121781317814178151781617817178181781917820178211782217823178241782517826178271782817829178301783117832178331783417835178361783717838178391784017841178421784317844178451784617847178481784917850178511785217853178541785517856178571785817859178601786117862178631786417865178661786717868178691787017871178721787317874178751787617877178781787917880178811788217883178841788517886178871788817889178901789117892178931789417895178961789717898178991790017901179021790317904179051790617907179081790917910179111791217913179141791517916179171791817919179201792117922179231792417925179261792717928179291793017931179321793317934179351793617937179381793917940179411794217943179441794517946179471794817949179501795117952179531795417955179561795717958179591796017961179621796317964179651796617967179681796917970179711797217973179741797517976179771797817979179801798117982179831798417985179861798717988179891799017991179921799317994179951799617997179981799918000180011800218003180041800518006180071800818009180101801118012180131801418015180161801718018180191802018021180221802318024180251802618027180281802918030180311803218033180341803518036180371803818039180401804118042180431804418045180461804718048180491805018051180521805318054180551805618057180581805918060180611806218063180641806518066180671806818069180701807118072180731807418075180761807718078180791808018081180821808318084180851808618087180881808918090180911809218093180941809518096180971809818099181001810118102181031810418105181061810718108181091811018111181121811318114181151811618117181181811918120181211812218123181241812518126181271812818129181301813118132181331813418135181361813718138181391814018141181421814318144181451814618147181481814918150181511815218153181541815518156181571815818159181601816118162181631816418165181661816718168181691817018171181721817318174181751817618177181781817918180181811818218183181841818518186181871818818189181901819118192181931819418195181961819718198181991820018201182021820318204182051820618207182081820918210182111821218213182141821518216182171821818219182201822118222182231822418225182261822718228182291823018231182321823318234182351823618237182381823918240182411824218243182441824518246182471824818249182501825118252182531825418255182561825718258182591826018261182621826318264182651826618267182681826918270182711827218273182741827518276182771827818279182801828118282182831828418285182861828718288182891829018291182921829318294182951829618297182981829918300183011830218303183041830518306183071830818309183101831118312183131831418315183161831718318183191832018321183221832318324183251832618327183281832918330183311833218333183341833518336183371833818339183401834118342183431834418345183461834718348183491835018351183521835318354183551835618357183581835918360183611836218363183641836518366183671836818369183701837118372183731837418375183761837718378183791838018381183821838318384183851838618387183881838918390183911839218393183941839518396183971839818399184001840118402184031840418405184061840718408184091841018411184121841318414184151841618417184181841918420184211842218423184241842518426184271842818429184301843118432184331843418435184361843718438184391844018441184421844318444184451844618447184481844918450184511845218453184541845518456184571845818459184601846118462184631846418465184661846718468184691847018471184721847318474184751847618477184781847918480184811848218483184841848518486184871848818489184901849118492184931849418495184961849718498184991850018501185021850318504185051850618507185081850918510185111851218513185141851518516185171851818519185201852118522185231852418525185261852718528185291853018531185321853318534185351853618537185381853918540185411854218543185441854518546185471854818549185501855118552185531855418555185561855718558185591856018561185621856318564185651856618567185681856918570185711857218573185741857518576185771857818579185801858118582185831858418585185861858718588185891859018591185921859318594185951859618597185981859918600186011860218603186041860518606186071860818609186101861118612186131861418615186161861718618186191862018621186221862318624186251862618627186281862918630186311863218633186341863518636186371863818639186401864118642186431864418645186461864718648186491865018651186521865318654186551865618657186581865918660186611866218663186641866518666186671866818669186701867118672186731867418675186761867718678186791868018681186821868318684186851868618687186881868918690186911869218693186941869518696186971869818699187001870118702187031870418705187061870718708187091871018711187121871318714187151871618717187181871918720187211872218723187241872518726187271872818729187301873118732187331873418735187361873718738187391874018741187421874318744187451874618747187481874918750187511875218753187541875518756187571875818759187601876118762187631876418765187661876718768187691877018771187721877318774187751877618777187781877918780187811878218783187841878518786187871878818789187901879118792187931879418795187961879718798187991880018801188021880318804188051880618807188081880918810188111881218813188141881518816188171881818819188201882118822188231882418825188261882718828188291883018831188321883318834188351883618837188381883918840188411884218843188441884518846188471884818849188501885118852188531885418855188561885718858188591886018861188621886318864188651886618867188681886918870188711887218873188741887518876188771887818879188801888118882188831888418885188861888718888188891889018891188921889318894188951889618897188981889918900189011890218903189041890518906189071890818909189101891118912189131891418915189161891718918189191892018921189221892318924189251892618927189281892918930189311893218933189341893518936189371893818939189401894118942189431894418945189461894718948189491895018951189521895318954189551895618957189581895918960189611896218963189641896518966189671896818969189701897118972189731897418975189761897718978189791898018981189821898318984189851898618987189881898918990189911899218993189941899518996189971899818999190001900119002190031900419005190061900719008190091901019011190121901319014190151901619017190181901919020190211902219023190241902519026190271902819029190301903119032190331903419035190361903719038190391904019041190421904319044190451904619047190481904919050190511905219053190541905519056190571905819059
  1. (self["webpackChunk"] = self["webpackChunk"] || []).push([["resources_js_pages_home_Index_vue"],{
  2. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppMessage.vue?vue&type=script&setup=true&lang=js":
  3. /*!***************************************************************************************************************************************************************************************************************!*\
  4. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppMessage.vue?vue&type=script&setup=true&lang=js ***!
  5. \***************************************************************************************************************************************************************************************************************/
  6. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  7. "use strict";
  8. __webpack_require__.r(__webpack_exports__);
  9. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  10. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  11. /* harmony export */ });
  12. /* harmony import */ var _inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @inertiajs/inertia-vue3 */ "./node_modules/@inertiajs/inertia-vue3/dist/index.js");
  13. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
  14. setup: function setup(__props, _ref) {
  15. var expose = _ref.expose;
  16. expose();
  17. var onClose = function onClose() {
  18. (0,_inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_0__.usePage)().props.value.errors = {};
  19. (0,_inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_0__.usePage)().props.value.flash.success = null;
  20. (0,_inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_0__.usePage)().props.value.flash.error = null;
  21. };
  22. var __returned__ = {
  23. onClose: onClose,
  24. usePage: _inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_0__.usePage
  25. };
  26. Object.defineProperty(__returned__, '__isScriptSetup', {
  27. enumerable: false,
  28. value: true
  29. });
  30. return __returned__;
  31. }
  32. });
  33. /***/ }),
  34. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppSidebar.vue?vue&type=script&setup=true&lang=js":
  35. /*!***************************************************************************************************************************************************************************************************************!*\
  36. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppSidebar.vue?vue&type=script&setup=true&lang=js ***!
  37. \***************************************************************************************************************************************************************************************************************/
  38. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  39. "use strict";
  40. __webpack_require__.r(__webpack_exports__);
  41. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  42. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  43. /* harmony export */ });
  44. /* harmony import */ var _components_AppSubSidebar_vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @/components/AppSubSidebar.vue */ "./resources/js/components/AppSubSidebar.vue");
  45. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
  46. props: {
  47. menu: Array
  48. },
  49. setup: function setup(__props, _ref) {
  50. var expose = _ref.expose;
  51. expose();
  52. var __returned__ = {
  53. AppSubSidebar: _components_AppSubSidebar_vue__WEBPACK_IMPORTED_MODULE_0__["default"]
  54. };
  55. Object.defineProperty(__returned__, '__isScriptSetup', {
  56. enumerable: false,
  57. value: true
  58. });
  59. return __returned__;
  60. }
  61. });
  62. /***/ }),
  63. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppSubSidebar.vue?vue&type=script&setup=true&lang=js":
  64. /*!******************************************************************************************************************************************************************************************************************!*\
  65. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppSubSidebar.vue?vue&type=script&setup=true&lang=js ***!
  66. \******************************************************************************************************************************************************************************************************************/
  67. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  68. "use strict";
  69. __webpack_require__.r(__webpack_exports__);
  70. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  71. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  72. /* harmony export */ });
  73. /* harmony import */ var _inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @inertiajs/inertia-vue3 */ "./node_modules/@inertiajs/inertia-vue3/dist/index.js");
  74. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
  75. props: {
  76. items: Array,
  77. root: {
  78. type: Boolean,
  79. "default": false
  80. }
  81. },
  82. setup: function setup(__props, _ref) {
  83. var expose = _ref.expose;
  84. expose();
  85. var __returned__ = {
  86. Link: _inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_0__.Link
  87. };
  88. Object.defineProperty(__returned__, '__isScriptSetup', {
  89. enumerable: false,
  90. value: true
  91. });
  92. return __returned__;
  93. }
  94. });
  95. /***/ }),
  96. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppTopBar.vue?vue&type=script&setup=true&lang=js":
  97. /*!**************************************************************************************************************************************************************************************************************!*\
  98. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppTopBar.vue?vue&type=script&setup=true&lang=js ***!
  99. \**************************************************************************************************************************************************************************************************************/
  100. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  101. "use strict";
  102. __webpack_require__.r(__webpack_exports__);
  103. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  104. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  105. /* harmony export */ });
  106. /* harmony import */ var _inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @inertiajs/inertia-vue3 */ "./node_modules/@inertiajs/inertia-vue3/dist/index.js");
  107. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
  108. emits: ['menu-toggle'],
  109. setup: function setup(__props, _ref) {
  110. var expose = _ref.expose;
  111. expose();
  112. var __returned__ = {
  113. Link: _inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_0__.Link
  114. };
  115. Object.defineProperty(__returned__, '__isScriptSetup', {
  116. enumerable: false,
  117. value: true
  118. });
  119. return __returned__;
  120. }
  121. });
  122. /***/ }),
  123. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/layouts/DashboardLayout.vue?vue&type=script&setup=true&lang=js":
  124. /*!*****************************************************************************************************************************************************************************************************************!*\
  125. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/layouts/DashboardLayout.vue?vue&type=script&setup=true&lang=js ***!
  126. \*****************************************************************************************************************************************************************************************************************/
  127. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  128. "use strict";
  129. __webpack_require__.r(__webpack_exports__);
  130. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  131. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  132. /* harmony export */ });
  133. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  134. /* harmony import */ var _components_AppTopBar_vue__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @/components/AppTopBar.vue */ "./resources/js/components/AppTopBar.vue");
  135. /* harmony import */ var _components_AppSidebar_vue__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @/components/AppSidebar.vue */ "./resources/js/components/AppSidebar.vue");
  136. /* harmony import */ var _components_AppFooter_vue__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @/components/AppFooter.vue */ "./resources/js/components/AppFooter.vue");
  137. /* harmony import */ var _components_AppMessage_vue__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @/components/AppMessage.vue */ "./resources/js/components/AppMessage.vue");
  138. /* harmony import */ var _utils_menu__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @/utils/menu */ "./resources/js/utils/menu.js");
  139. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
  140. setup: function setup(__props, _ref) {
  141. var expose = _ref.expose;
  142. expose();
  143. var mobileMenuActive = (0,vue__WEBPACK_IMPORTED_MODULE_0__.ref)(false);
  144. var staticMenuInactive = (0,vue__WEBPACK_IMPORTED_MODULE_0__.ref)(false);
  145. var menuClick = (0,vue__WEBPACK_IMPORTED_MODULE_0__.ref)(false);
  146. var isDesktop = function isDesktop() {
  147. return window.innerWidth >= 992;
  148. };
  149. var containerClass = (0,vue__WEBPACK_IMPORTED_MODULE_0__.computed)(function () {
  150. return ['layout-wrapper', {
  151. 'layout-static-sidebar-inactive': staticMenuInactive.value,
  152. 'layout-mobile-sidebar-active': mobileMenuActive.value
  153. }];
  154. });
  155. var onWrapperClick = function onWrapperClick() {
  156. if (!menuClick.value) {
  157. mobileMenuActive.value = false;
  158. }
  159. menuClick.value = false;
  160. };
  161. var onMenuToggle = function onMenuToggle(event) {
  162. menuClick.value = true;
  163. if (isDesktop()) {
  164. staticMenuInactive.value = !staticMenuInactive.value;
  165. } else {
  166. mobileMenuActive.value = !mobileMenuActive.value;
  167. }
  168. event.preventDefault();
  169. };
  170. var __returned__ = {
  171. mobileMenuActive: mobileMenuActive,
  172. staticMenuInactive: staticMenuInactive,
  173. menuClick: menuClick,
  174. isDesktop: isDesktop,
  175. containerClass: containerClass,
  176. onWrapperClick: onWrapperClick,
  177. onMenuToggle: onMenuToggle,
  178. ref: vue__WEBPACK_IMPORTED_MODULE_0__.ref,
  179. computed: vue__WEBPACK_IMPORTED_MODULE_0__.computed,
  180. AppTopBar: _components_AppTopBar_vue__WEBPACK_IMPORTED_MODULE_1__["default"],
  181. AppSidebar: _components_AppSidebar_vue__WEBPACK_IMPORTED_MODULE_2__["default"],
  182. AppFooter: _components_AppFooter_vue__WEBPACK_IMPORTED_MODULE_3__["default"],
  183. AppMessage: _components_AppMessage_vue__WEBPACK_IMPORTED_MODULE_4__["default"],
  184. menu: _utils_menu__WEBPACK_IMPORTED_MODULE_5__["default"]
  185. };
  186. Object.defineProperty(__returned__, '__isScriptSetup', {
  187. enumerable: false,
  188. value: true
  189. });
  190. return __returned__;
  191. }
  192. });
  193. /***/ }),
  194. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/pages/home/Index.vue?vue&type=script&setup=true&lang=js":
  195. /*!**********************************************************************************************************************************************************************************************************!*\
  196. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/pages/home/Index.vue?vue&type=script&setup=true&lang=js ***!
  197. \**********************************************************************************************************************************************************************************************************/
  198. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  199. "use strict";
  200. __webpack_require__.r(__webpack_exports__);
  201. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  202. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  203. /* harmony export */ });
  204. /* harmony import */ var _inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @inertiajs/inertia-vue3 */ "./node_modules/@inertiajs/inertia-vue3/dist/index.js");
  205. /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! lodash */ "./node_modules/lodash/lodash.js");
  206. /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_1__);
  207. /* harmony import */ var _layouts_DashboardLayout_vue__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @/layouts/DashboardLayout.vue */ "./resources/js/layouts/DashboardLayout.vue");
  208. function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it["return"] != null) it["return"](); } finally { if (didErr) throw err; } } }; }
  209. function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
  210. function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
  211. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
  212. props: {
  213. cardStatistics: Array,
  214. barStatistics: Array,
  215. barHorizontalStatistics: Array
  216. },
  217. setup: function setup(__props, _ref) {
  218. var expose = _ref.expose;
  219. expose();
  220. var colors = ['#349dcf', '#00b2da', '#00c7dd', '#1fdbdb', '#57eed3', '#88ffc9', '#96ed9a', '#a8d96c', '#bbc242', '#cda91d'];
  221. var barChart = function barChart(chartData) {
  222. var colors = ['#349dcf', '#a8d96c'];
  223. var data = {
  224. datasets: []
  225. };
  226. var id = 0;
  227. for (var key in chartData) {
  228. data.datasets.push({
  229. label: key,
  230. backgroundColor: colors[id],
  231. data: chartData[key]
  232. });
  233. id++;
  234. }
  235. return data;
  236. };
  237. var barChartOption = {
  238. maintainAspectRatio: false,
  239. datasetFill: false
  240. };
  241. var barHorizontalChart = function barHorizontalChart(chartData) {
  242. var labels = [];
  243. var data = [];
  244. var _iterator = _createForOfIteratorHelper(chartData),
  245. _step;
  246. try {
  247. for (_iterator.s(); !(_step = _iterator.n()).done;) {
  248. var obj = _step.value;
  249. labels.push([obj.label1, obj.label2]);
  250. data.push(obj.data);
  251. }
  252. } catch (err) {
  253. _iterator.e(err);
  254. } finally {
  255. _iterator.f();
  256. }
  257. return {
  258. labels: labels,
  259. datasets: [{
  260. data: data,
  261. backgroundColor: colors
  262. }]
  263. };
  264. };
  265. var barHorizontalChartOption = {
  266. maintainAspectRatio: false,
  267. datasetFill: false,
  268. indexAxis: 'y',
  269. plugins: {
  270. legend: {
  271. display: false
  272. }
  273. }
  274. };
  275. var pieChart = function pieChart(chartData) {
  276. var labels = [];
  277. var data = [];
  278. for (var key in chartData) {
  279. labels.push(key);
  280. data.push(chartData[key]);
  281. }
  282. return {
  283. labels: labels,
  284. datasets: [{
  285. data: data,
  286. backgroundColor: colors
  287. }]
  288. };
  289. };
  290. var pieChartOption = {
  291. maintainAspectRatio: false,
  292. datasetFill: false
  293. };
  294. var __returned__ = {
  295. colors: colors,
  296. barChart: barChart,
  297. barChartOption: barChartOption,
  298. barHorizontalChart: barHorizontalChart,
  299. barHorizontalChartOption: barHorizontalChartOption,
  300. pieChart: pieChart,
  301. pieChartOption: pieChartOption,
  302. Head: _inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_0__.Head,
  303. includes: lodash__WEBPACK_IMPORTED_MODULE_1__.includes,
  304. DashboardLayout: _layouts_DashboardLayout_vue__WEBPACK_IMPORTED_MODULE_2__["default"]
  305. };
  306. Object.defineProperty(__returned__, '__isScriptSetup', {
  307. enumerable: false,
  308. value: true
  309. });
  310. return __returned__;
  311. }
  312. });
  313. /***/ }),
  314. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppFooter.vue?vue&type=template&id=4ab6097e&scoped=true":
  315. /*!*******************************************************************************************************************************************************************************************************************************************************************************************!*\
  316. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppFooter.vue?vue&type=template&id=4ab6097e&scoped=true ***!
  317. \*******************************************************************************************************************************************************************************************************************************************************************************************/
  318. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  319. "use strict";
  320. __webpack_require__.r(__webpack_exports__);
  321. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  322. /* harmony export */ "render": () => (/* binding */ render)
  323. /* harmony export */ });
  324. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  325. var _withScopeId = function _withScopeId(n) {
  326. return (0,vue__WEBPACK_IMPORTED_MODULE_0__.pushScopeId)("data-v-4ab6097e"), n = n(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.popScopeId)(), n;
  327. };
  328. var _hoisted_1 = {
  329. "class": "layout-footer"
  330. };
  331. var _hoisted_2 = /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createTextVNode)(" Developed by ");
  332. var _hoisted_3 = /*#__PURE__*/_withScopeId(function () {
  333. return /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("a", {
  334. href: "https://dijitalcode.com",
  335. target: "_blank",
  336. "class": "font-medium ml-2"
  337. }, "DijitalCODE", -1
  338. /* HOISTED */
  339. );
  340. });
  341. var _hoisted_4 = [_hoisted_2, _hoisted_3];
  342. function render(_ctx, _cache) {
  343. return (0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)("div", _hoisted_1, _hoisted_4);
  344. }
  345. /***/ }),
  346. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppMessage.vue?vue&type=template&id=07159051":
  347. /*!********************************************************************************************************************************************************************************************************************************************************************************!*\
  348. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppMessage.vue?vue&type=template&id=07159051 ***!
  349. \********************************************************************************************************************************************************************************************************************************************************************************/
  350. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  351. "use strict";
  352. __webpack_require__.r(__webpack_exports__);
  353. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  354. /* harmony export */ "render": () => (/* binding */ render)
  355. /* harmony export */ });
  356. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  357. var _hoisted_1 = {
  358. "class": "grid"
  359. };
  360. var _hoisted_2 = {
  361. "class": "col-12"
  362. };
  363. var _hoisted_3 = {
  364. key: 0
  365. };
  366. var _hoisted_4 = {
  367. key: 1
  368. };
  369. function render(_ctx, _cache, $props, $setup, $data, $options) {
  370. var _component_Message = (0,vue__WEBPACK_IMPORTED_MODULE_0__.resolveComponent)("Message");
  371. return (0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)("div", _hoisted_1, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("div", _hoisted_2, [_ctx.$page.props.flash.success ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createBlock)(_component_Message, {
  372. key: 0,
  373. severity: "success",
  374. onClose: $setup.onClose
  375. }, {
  376. "default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  377. return [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createTextVNode)((0,vue__WEBPACK_IMPORTED_MODULE_0__.toDisplayString)(_ctx.$page.props.flash.success), 1
  378. /* TEXT */
  379. )];
  380. }),
  381. _: 1
  382. /* STABLE */
  383. })) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true), _ctx.$page.props.flash.error ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createBlock)(_component_Message, {
  384. key: 1,
  385. severity: "error",
  386. onClose: $setup.onClose
  387. }, {
  388. "default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  389. return [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createTextVNode)((0,vue__WEBPACK_IMPORTED_MODULE_0__.toDisplayString)(_ctx.$page.props.flash.error), 1
  390. /* TEXT */
  391. )];
  392. }),
  393. _: 1
  394. /* STABLE */
  395. })) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true), Object.keys(_ctx.$page.props.errors).length > 0 ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createBlock)(_component_Message, {
  396. key: 2,
  397. severity: "error",
  398. onClose: $setup.onClose
  399. }, {
  400. "default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  401. return [Object.keys(_ctx.$page.props.errors).length === 1 ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)("div", _hoisted_3, "Ditemukan satu error pada form")) : ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)("div", _hoisted_4, "Ditemukan " + (0,vue__WEBPACK_IMPORTED_MODULE_0__.toDisplayString)(Object.keys(_ctx.$page.props.errors).length) + " error pada form", 1
  402. /* TEXT */
  403. ))];
  404. }),
  405. _: 1
  406. /* STABLE */
  407. })) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true)])]);
  408. }
  409. /***/ }),
  410. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppSidebar.vue?vue&type=template&id=22a4e926&scoped=true":
  411. /*!********************************************************************************************************************************************************************************************************************************************************************************************!*\
  412. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppSidebar.vue?vue&type=template&id=22a4e926&scoped=true ***!
  413. \********************************************************************************************************************************************************************************************************************************************************************************************/
  414. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  415. "use strict";
  416. __webpack_require__.r(__webpack_exports__);
  417. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  418. /* harmony export */ "render": () => (/* binding */ render)
  419. /* harmony export */ });
  420. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  421. function render(_ctx, _cache, $props, $setup, $data, $options) {
  422. return (0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)("div", null, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)($setup["AppSubSidebar"], {
  423. "class": "layout-menu",
  424. items: $props.menu,
  425. root: true
  426. }, null, 8
  427. /* PROPS */
  428. , ["items"])]);
  429. }
  430. /***/ }),
  431. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppSubSidebar.vue?vue&type=template&id=0addd9bc&scoped=true":
  432. /*!***********************************************************************************************************************************************************************************************************************************************************************************************!*\
  433. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppSubSidebar.vue?vue&type=template&id=0addd9bc&scoped=true ***!
  434. \***********************************************************************************************************************************************************************************************************************************************************************************************/
  435. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  436. "use strict";
  437. __webpack_require__.r(__webpack_exports__);
  438. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  439. /* harmony export */ "render": () => (/* binding */ render)
  440. /* harmony export */ });
  441. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  442. var _withScopeId = function _withScopeId(n) {
  443. return (0,vue__WEBPACK_IMPORTED_MODULE_0__.pushScopeId)("data-v-0addd9bc"), n = n(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.popScopeId)(), n;
  444. };
  445. var _hoisted_1 = {
  446. key: 0
  447. };
  448. var _hoisted_2 = ["aria-label"];
  449. var _hoisted_3 = ["aria-label"];
  450. function render(_ctx, _cache, $props, $setup, $data, $options) {
  451. var _component_AppSubSidebar = (0,vue__WEBPACK_IMPORTED_MODULE_0__.resolveComponent)("AppSubSidebar", true);
  452. return $props.items ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)("ul", _hoisted_1, [((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(true), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)(vue__WEBPACK_IMPORTED_MODULE_0__.Fragment, null, (0,vue__WEBPACK_IMPORTED_MODULE_0__.renderList)($props.items, function (item, i) {
  453. return (0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)(vue__WEBPACK_IMPORTED_MODULE_0__.Fragment, null, [item ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)("li", {
  454. key: i,
  455. "class": (0,vue__WEBPACK_IMPORTED_MODULE_0__.normalizeClass)([{
  456. 'layout-menuitem-category': $props.root
  457. }]),
  458. role: "none"
  459. }, [$props.root ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)(vue__WEBPACK_IMPORTED_MODULE_0__.Fragment, {
  460. key: 0
  461. }, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("div", {
  462. "class": "layout-menuitem-root-text",
  463. "aria-label": item.label
  464. }, (0,vue__WEBPACK_IMPORTED_MODULE_0__.toDisplayString)(item.label), 9
  465. /* TEXT, PROPS */
  466. , _hoisted_2), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(_component_AppSubSidebar, {
  467. items: item.items
  468. }, null, 8
  469. /* PROPS */
  470. , ["items"])], 64
  471. /* STABLE_FRAGMENT */
  472. )) : ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)(vue__WEBPACK_IMPORTED_MODULE_0__.Fragment, {
  473. key: 1
  474. }, [item.to ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createBlock)($setup["Link"], {
  475. key: 0,
  476. role: "menuitem",
  477. href: item.to,
  478. "class": (0,vue__WEBPACK_IMPORTED_MODULE_0__.normalizeClass)([{
  479. 'router-link-active': _ctx.$page.component.startsWith(item.component) || _ctx.$page.url.startsWith(item.to),
  480. 'router-link-exact-active': _ctx.$page.component.startsWith(item.component) || _ctx.$page.url.startsWith(item.to)
  481. }]),
  482. "aria-label": item.label
  483. }, {
  484. "default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  485. return [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("i", {
  486. "class": (0,vue__WEBPACK_IMPORTED_MODULE_0__.normalizeClass)(item.icon)
  487. }, null, 2
  488. /* CLASS */
  489. ), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("span", null, (0,vue__WEBPACK_IMPORTED_MODULE_0__.toDisplayString)(item.label), 1
  490. /* TEXT */
  491. )];
  492. }),
  493. _: 2
  494. /* DYNAMIC */
  495. }, 1032
  496. /* PROPS, DYNAMIC_SLOTS */
  497. , ["href", "class", "aria-label"])) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true), !item.to ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)("a", {
  498. key: 1,
  499. href: "#",
  500. role: "menuitem",
  501. "aria-label": item.label
  502. }, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("i", {
  503. "class": (0,vue__WEBPACK_IMPORTED_MODULE_0__.normalizeClass)(item.icon)
  504. }, null, 2
  505. /* CLASS */
  506. ), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("span", null, (0,vue__WEBPACK_IMPORTED_MODULE_0__.toDisplayString)(item.label), 1
  507. /* TEXT */
  508. )], 8
  509. /* PROPS */
  510. , _hoisted_3)) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(_component_AppSubSidebar, {
  511. items: item.items
  512. }, null, 8
  513. /* PROPS */
  514. , ["items"])], 64
  515. /* STABLE_FRAGMENT */
  516. ))], 2
  517. /* CLASS */
  518. )) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true)], 64
  519. /* STABLE_FRAGMENT */
  520. );
  521. }), 256
  522. /* UNKEYED_FRAGMENT */
  523. ))])) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true);
  524. }
  525. /***/ }),
  526. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppTopBar.vue?vue&type=template&id=42bf62a4&scoped=true":
  527. /*!*******************************************************************************************************************************************************************************************************************************************************************************************!*\
  528. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppTopBar.vue?vue&type=template&id=42bf62a4&scoped=true ***!
  529. \*******************************************************************************************************************************************************************************************************************************************************************************************/
  530. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  531. "use strict";
  532. __webpack_require__.r(__webpack_exports__);
  533. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  534. /* harmony export */ "render": () => (/* binding */ render)
  535. /* harmony export */ });
  536. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  537. var _withScopeId = function _withScopeId(n) {
  538. return (0,vue__WEBPACK_IMPORTED_MODULE_0__.pushScopeId)("data-v-42bf62a4"), n = n(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.popScopeId)(), n;
  539. };
  540. var _hoisted_1 = {
  541. "class": "layout-topbar"
  542. };
  543. var _hoisted_2 = /*#__PURE__*/_withScopeId(function () {
  544. return /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("img", {
  545. alt: "Logo",
  546. src: "/images/logo.svg",
  547. "class": "md:mr-3"
  548. }, null, -1
  549. /* HOISTED */
  550. );
  551. });
  552. var _hoisted_3 = /*#__PURE__*/_withScopeId(function () {
  553. return /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("span", null, "Parkirin", -1
  554. /* HOISTED */
  555. );
  556. });
  557. var _hoisted_4 = /*#__PURE__*/_withScopeId(function () {
  558. return /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("i", {
  559. "class": "pi pi-bars"
  560. }, null, -1
  561. /* HOISTED */
  562. );
  563. });
  564. var _hoisted_5 = [_hoisted_4];
  565. var _hoisted_6 = {
  566. "class": "p-link layout-topbar-menu-button layout-topbar-button"
  567. };
  568. var _hoisted_7 = /*#__PURE__*/_withScopeId(function () {
  569. return /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("i", {
  570. "class": "pi pi-ellipsis-v"
  571. }, null, -1
  572. /* HOISTED */
  573. );
  574. });
  575. var _hoisted_8 = [_hoisted_7];
  576. var _hoisted_9 = {
  577. "class": "layout-topbar-menu hidden lg:flex origin-top"
  578. };
  579. var _hoisted_10 = {
  580. "class": "align-self-center"
  581. };
  582. var _hoisted_11 = {
  583. "class": "hidden lg:inline"
  584. };
  585. var _hoisted_12 = /*#__PURE__*/_withScopeId(function () {
  586. return /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("i", {
  587. "class": "pi pi-user"
  588. }, null, -1
  589. /* HOISTED */
  590. );
  591. });
  592. var _hoisted_13 = /*#__PURE__*/_withScopeId(function () {
  593. return /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("span", null, "Profil Saya", -1
  594. /* HOISTED */
  595. );
  596. });
  597. var _hoisted_14 = /*#__PURE__*/_withScopeId(function () {
  598. return /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("i", {
  599. "class": "pi pi-sign-out"
  600. }, null, -1
  601. /* HOISTED */
  602. );
  603. });
  604. var _hoisted_15 = /*#__PURE__*/_withScopeId(function () {
  605. return /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("span", null, "Sign Out", -1
  606. /* HOISTED */
  607. );
  608. });
  609. function render(_ctx, _cache, $props, $setup, $data, $options) {
  610. var _directive_styleclass = (0,vue__WEBPACK_IMPORTED_MODULE_0__.resolveDirective)("styleclass");
  611. return (0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)("div", _hoisted_1, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)($setup["Link"], {
  612. href: "/",
  613. "class": "layout-topbar-logo"
  614. }, {
  615. "default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  616. return [_hoisted_2, _hoisted_3];
  617. }),
  618. _: 1
  619. /* STABLE */
  620. }), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("button", {
  621. "class": "p-link layout-menu-button layout-topbar-button",
  622. onClick: _cache[0] || (_cache[0] = function ($event) {
  623. return _ctx.$emit('menu-toggle', $event);
  624. })
  625. }, _hoisted_5), (0,vue__WEBPACK_IMPORTED_MODULE_0__.withDirectives)(((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)("button", _hoisted_6, _hoisted_8)), [[_directive_styleclass, {
  626. selector: '@next',
  627. enterClass: 'hidden',
  628. enterActiveClass: 'scalein',
  629. leaveToClass: 'hidden',
  630. leaveActiveClass: 'fadeout',
  631. hideOnOutsideClick: true
  632. }]]), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("ul", _hoisted_9, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("li", _hoisted_10, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("span", _hoisted_11, (0,vue__WEBPACK_IMPORTED_MODULE_0__.toDisplayString)(_ctx.$page.props.auth.user.name), 1
  633. /* TEXT */
  634. )]), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("li", null, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)($setup["Link"], {
  635. href: _ctx.route('users.show', _ctx.$page.props.auth.user.id),
  636. "class": "p-link layout-topbar-button"
  637. }, {
  638. "default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  639. return [_hoisted_12, _hoisted_13];
  640. }),
  641. _: 1
  642. /* STABLE */
  643. }, 8
  644. /* PROPS */
  645. , ["href"])]), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("li", null, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)($setup["Link"], {
  646. href: _ctx.route('logout'),
  647. as: "button",
  648. method: "post",
  649. "class": "p-link layout-topbar-button"
  650. }, {
  651. "default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  652. return [_hoisted_14, _hoisted_15];
  653. }),
  654. _: 1
  655. /* STABLE */
  656. }, 8
  657. /* PROPS */
  658. , ["href"])])])]);
  659. }
  660. /***/ }),
  661. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/layouts/DashboardLayout.vue?vue&type=template&id=549bf5ac&scoped=true":
  662. /*!**********************************************************************************************************************************************************************************************************************************************************************************************!*\
  663. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/layouts/DashboardLayout.vue?vue&type=template&id=549bf5ac&scoped=true ***!
  664. \**********************************************************************************************************************************************************************************************************************************************************************************************/
  665. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  666. "use strict";
  667. __webpack_require__.r(__webpack_exports__);
  668. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  669. /* harmony export */ "render": () => (/* binding */ render)
  670. /* harmony export */ });
  671. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  672. var _withScopeId = function _withScopeId(n) {
  673. return (0,vue__WEBPACK_IMPORTED_MODULE_0__.pushScopeId)("data-v-549bf5ac"), n = n(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.popScopeId)(), n;
  674. };
  675. var _hoisted_1 = {
  676. "class": "layout-sidebar"
  677. };
  678. var _hoisted_2 = {
  679. "class": "layout-main-container"
  680. };
  681. var _hoisted_3 = {
  682. "class": "layout-main"
  683. };
  684. var _hoisted_4 = {
  685. key: 0,
  686. "class": "layout-mask p-component-overlay"
  687. };
  688. function render(_ctx, _cache, $props, $setup, $data, $options) {
  689. return (0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)("div", {
  690. "class": (0,vue__WEBPACK_IMPORTED_MODULE_0__.normalizeClass)($setup.containerClass),
  691. onClick: $setup.onWrapperClick
  692. }, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)($setup["AppTopBar"], {
  693. onMenuToggle: $setup.onMenuToggle
  694. }), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("div", _hoisted_1, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)($setup["AppSidebar"], {
  695. menu: $setup.menu[_ctx.$page.props.auth.user.role_id]
  696. }, null, 8
  697. /* PROPS */
  698. , ["menu"])]), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("div", _hoisted_2, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("div", _hoisted_3, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)($setup["AppMessage"]), (0,vue__WEBPACK_IMPORTED_MODULE_0__.renderSlot)(_ctx.$slots, "default", {}, undefined, true)]), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)($setup["AppFooter"])]), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(vue__WEBPACK_IMPORTED_MODULE_0__.Transition, {
  699. name: "layout-mask"
  700. }, {
  701. "default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  702. return [$setup.mobileMenuActive ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)("div", _hoisted_4)) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true)];
  703. }),
  704. _: 1
  705. /* STABLE */
  706. })], 2
  707. /* CLASS */
  708. );
  709. }
  710. /***/ }),
  711. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/pages/home/Index.vue?vue&type=template&id=9329f6aa":
  712. /*!***************************************************************************************************************************************************************************************************************************************************************************!*\
  713. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/pages/home/Index.vue?vue&type=template&id=9329f6aa ***!
  714. \***************************************************************************************************************************************************************************************************************************************************************************/
  715. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  716. "use strict";
  717. __webpack_require__.r(__webpack_exports__);
  718. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  719. /* harmony export */ "render": () => (/* binding */ render)
  720. /* harmony export */ });
  721. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  722. var _hoisted_1 = {
  723. "class": "grid"
  724. };
  725. var _hoisted_2 = {
  726. key: 0,
  727. "class": "col-12 md:col-4 xl:col-3"
  728. };
  729. var _hoisted_3 = {
  730. "class": "flex justify-content-between mb-3"
  731. };
  732. var _hoisted_4 = {
  733. "class": "block text-500 font-medium mb-3"
  734. };
  735. var _hoisted_5 = {
  736. key: 0,
  737. "class": "text-900 font-medium text-xl"
  738. };
  739. var _hoisted_6 = {
  740. "class": "flex align-items-center justify-content-center bg-orange-100 border-round",
  741. style: {
  742. "width": "2.5rem",
  743. "height": "2.5rem"
  744. }
  745. };
  746. var _hoisted_7 = {
  747. "class": "text-green-500 font-medium"
  748. };
  749. var _hoisted_8 = {
  750. "class": "text-500"
  751. };
  752. var _hoisted_9 = {
  753. "class": "grid"
  754. };
  755. var _hoisted_10 = {
  756. key: 0,
  757. "class": "col-12 md:col-6"
  758. };
  759. var _hoisted_11 = {
  760. "class": "flex flex-column"
  761. };
  762. var _hoisted_12 = {
  763. key: 0,
  764. "class": "text-base font-normal"
  765. };
  766. function render(_ctx, _cache, $props, $setup, $data, $options) {
  767. var _component_Card = (0,vue__WEBPACK_IMPORTED_MODULE_0__.resolveComponent)("Card");
  768. var _component_Chart = (0,vue__WEBPACK_IMPORTED_MODULE_0__.resolveComponent)("Chart");
  769. return (0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createBlock)($setup["DashboardLayout"], null, {
  770. "default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  771. return [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)($setup["Head"], {
  772. title: "Dashboard"
  773. }), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("div", _hoisted_1, [((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(true), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)(vue__WEBPACK_IMPORTED_MODULE_0__.Fragment, null, (0,vue__WEBPACK_IMPORTED_MODULE_0__.renderList)($props.cardStatistics, function (cardStatistic) {
  774. return (0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)(vue__WEBPACK_IMPORTED_MODULE_0__.Fragment, null, [$setup.includes(cardStatistic.roleId, _ctx.$page.props.auth.user.role_id) ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)("div", _hoisted_2, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(_component_Card, {
  775. "class": "h-full"
  776. }, {
  777. content: (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  778. return [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("div", _hoisted_3, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("div", null, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("span", _hoisted_4, (0,vue__WEBPACK_IMPORTED_MODULE_0__.toDisplayString)(cardStatistic.title), 1
  779. /* TEXT */
  780. ), cardStatistic.value ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)("div", _hoisted_5, (0,vue__WEBPACK_IMPORTED_MODULE_0__.toDisplayString)(cardStatistic.value), 1
  781. /* TEXT */
  782. )) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true)]), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("div", _hoisted_6, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("i", {
  783. "class": (0,vue__WEBPACK_IMPORTED_MODULE_0__.normalizeClass)(["text-orange-500 text-xl", cardStatistic.icon])
  784. }, null, 2
  785. /* CLASS */
  786. )])]), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("span", _hoisted_7, (0,vue__WEBPACK_IMPORTED_MODULE_0__.toDisplayString)(cardStatistic.amount), 1
  787. /* TEXT */
  788. ), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("span", _hoisted_8, (0,vue__WEBPACK_IMPORTED_MODULE_0__.toDisplayString)(' ' + cardStatistic.amountLabel), 1
  789. /* TEXT */
  790. )];
  791. }),
  792. _: 2
  793. /* DYNAMIC */
  794. }, 1024
  795. /* DYNAMIC_SLOTS */
  796. )])) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true)], 64
  797. /* STABLE_FRAGMENT */
  798. );
  799. }), 256
  800. /* UNKEYED_FRAGMENT */
  801. ))]), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("div", _hoisted_9, [((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(true), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)(vue__WEBPACK_IMPORTED_MODULE_0__.Fragment, null, (0,vue__WEBPACK_IMPORTED_MODULE_0__.renderList)($props.barStatistics, function (barStatistic) {
  802. return (0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)(vue__WEBPACK_IMPORTED_MODULE_0__.Fragment, null, [$setup.includes(barStatistic.roleId, _ctx.$page.props.auth.user.role_id) ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)("div", _hoisted_10, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(_component_Card, null, (0,vue__WEBPACK_IMPORTED_MODULE_0__.createSlots)({
  803. title: (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  804. return [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("div", _hoisted_11, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("span", null, (0,vue__WEBPACK_IMPORTED_MODULE_0__.toDisplayString)(barStatistic.title), 1
  805. /* TEXT */
  806. ), barStatistic.description ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)("span", _hoisted_12, (0,vue__WEBPACK_IMPORTED_MODULE_0__.toDisplayString)(barStatistic.description), 1
  807. /* TEXT */
  808. )) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true)])];
  809. }),
  810. _: 2
  811. /* DYNAMIC */
  812. }, [Object.keys(barStatistic.data).length ? {
  813. name: "content",
  814. fn: (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  815. return [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(_component_Chart, {
  816. type: "bar",
  817. width: 600,
  818. height: 300,
  819. data: $setup.barChart(barStatistic.data),
  820. options: $setup.barChartOption
  821. }, null, 8
  822. /* PROPS */
  823. , ["data"])];
  824. })
  825. } : undefined]), 1024
  826. /* DYNAMIC_SLOTS */
  827. )])) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true)], 64
  828. /* STABLE_FRAGMENT */
  829. );
  830. }), 256
  831. /* UNKEYED_FRAGMENT */
  832. )), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)(" <div v-for=\"barHorizontalStatistic in barHorizontalStatistics\" class=\"col-12 md:col-6\">\n <Card>\n <template #title>\n <div class=\"flex flex-column\">\n <span>{{ barHorizontalStatistic.title }}</span>\n <span v-if=\"barHorizontalStatistic.description\" class=\"text-base font-normal\">{{\n barHorizontalStatistic.description\n }}</span>\n </div>\n </template>\n <template #content>\n <Chart\n type=\"bar\"\n :width=\"600\"\n :height=\"300\"\n :data=\"barHorizontalChart(barHorizontalStatistic.data)\"\n :options=\"barHorizontalChartOption\"\n />\n </template>\n </Card>\n </div> "), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)(" <div v-for=\"pieStatistic in pieStatistics\" class=\"col-12 md:col-6\">\n <Card>\n <template #title>\n <div class=\"flex flex-column\">\n <span>{{ pieStatistic.title }}</span>\n <span v-if=\"pieStatistic.description\" class=\"text-base font-normal\">{{ pieStatistic.description }}</span>\n </div>\n </template>\n <template #content>\n <Chart\n type=\"pie\"\n :width=\"600\"\n :height=\"300\"\n :data=\"pieChart(pieStatistic.data)\"\n :options=\"pieChartOption\"\n />\n </template>\n </Card>\n </div> ")])];
  833. }),
  834. _: 1
  835. /* STABLE */
  836. });
  837. }
  838. /***/ }),
  839. /***/ "./resources/js/utils/menu.js":
  840. /*!************************************!*\
  841. !*** ./resources/js/utils/menu.js ***!
  842. \************************************/
  843. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  844. "use strict";
  845. __webpack_require__.r(__webpack_exports__);
  846. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  847. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  848. /* harmony export */ });
  849. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
  850. // Admin
  851. 1: [{
  852. label: 'Home',
  853. items: [{
  854. label: 'Dashboard',
  855. icon: 'pi pi-home',
  856. to: '/dashboards',
  857. component: 'home/Index'
  858. }]
  859. }, {
  860. label: 'Master',
  861. items: [{
  862. label: 'User',
  863. icon: 'pi pi-user',
  864. to: '/users',
  865. component: 'user/Index'
  866. }]
  867. }],
  868. // Supervisor
  869. 2: [{
  870. label: 'Home',
  871. items: [{
  872. label: 'Dashboard',
  873. icon: 'pi pi-home',
  874. to: '/dashboards',
  875. component: 'home/Index'
  876. }]
  877. }, {
  878. label: 'Menu',
  879. items: [{
  880. label: 'Pengeluaran',
  881. icon: 'pi pi-wallet',
  882. to: '/expenses',
  883. component: 'expense/Index'
  884. }, {
  885. label: 'Laporan',
  886. icon: 'pi pi-book',
  887. items: [{
  888. label: 'Mutasi',
  889. icon: 'pi pi-circle',
  890. to: '/reports/mutations',
  891. component: 'mutation/Report'
  892. }]
  893. }]
  894. }, {
  895. label: 'Master',
  896. items: [{
  897. label: 'Jenis Kendaraan',
  898. icon: 'pi pi-car',
  899. to: '/type-vehicles',
  900. component: 'typevehicle/Index'
  901. }, {
  902. label: 'Jenis Member',
  903. icon: 'pi pi-id-card',
  904. to: '/type-members',
  905. component: 'typemember/Index'
  906. }]
  907. }, {
  908. label: 'Pengaturan',
  909. items: [{
  910. label: 'Tarif Parkir',
  911. icon: 'pi pi-car',
  912. to: '/parking-fees/create',
  913. component: 'parkingfee/Create'
  914. }]
  915. }],
  916. // Operator
  917. 3: [{
  918. label: 'Home',
  919. items: [{
  920. label: 'Dashboard',
  921. icon: 'pi pi-home',
  922. to: '/dashboards',
  923. component: 'home/Index'
  924. }]
  925. }, {
  926. label: 'Menu',
  927. items: [{
  928. label: 'Pengeluaran',
  929. icon: 'pi pi-wallet',
  930. to: '/expenses',
  931. component: 'expense/Index'
  932. }, {
  933. label: 'Member',
  934. icon: 'pi pi-id-card',
  935. to: '/members',
  936. component: 'member/Index'
  937. }, {
  938. label: 'Top Up',
  939. icon: 'pi pi-car',
  940. to: '/top-ups',
  941. component: 'topup/Index'
  942. }]
  943. }]
  944. });
  945. /***/ }),
  946. /***/ "./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppFooter.vue?vue&type=style&index=0&id=4ab6097e&lang=scss&scoped=true":
  947. /*!***********************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  948. !*** ./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppFooter.vue?vue&type=style&index=0&id=4ab6097e&lang=scss&scoped=true ***!
  949. \***********************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  950. /***/ ((module, __webpack_exports__, __webpack_require__) => {
  951. "use strict";
  952. __webpack_require__.r(__webpack_exports__);
  953. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  954. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  955. /* harmony export */ });
  956. /* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../node_modules/css-loader/dist/runtime/api.js */ "./node_modules/css-loader/dist/runtime/api.js");
  957. /* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_0__);
  958. // Imports
  959. var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_0___default()(function(i){return i[1]});
  960. // Module
  961. ___CSS_LOADER_EXPORT___.push([module.id, ".layout-footer[data-v-4ab6097e] {\n transition: margin-left 0.2s;\n display: flex;\n align-items: center;\n justify-content: center;\n padding-top: 1rem;\n border-top: 1px solid var(--surface-border);\n}", ""]);
  962. // Exports
  963. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);
  964. /***/ }),
  965. /***/ "./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppSidebar.vue?vue&type=style&index=0&id=22a4e926&lang=scss&scoped=true":
  966. /*!************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  967. !*** ./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppSidebar.vue?vue&type=style&index=0&id=22a4e926&lang=scss&scoped=true ***!
  968. \************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  969. /***/ ((module, __webpack_exports__, __webpack_require__) => {
  970. "use strict";
  971. __webpack_require__.r(__webpack_exports__);
  972. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  973. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  974. /* harmony export */ });
  975. /* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../node_modules/css-loader/dist/runtime/api.js */ "./node_modules/css-loader/dist/runtime/api.js");
  976. /* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_0__);
  977. // Imports
  978. var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_0___default()(function(i){return i[1]});
  979. // Module
  980. ___CSS_LOADER_EXPORT___.push([module.id, ".layout-menu[data-v-22a4e926] {\n list-style-type: none;\n margin: 0;\n padding: 0;\n}", ""]);
  981. // Exports
  982. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);
  983. /***/ }),
  984. /***/ "./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppSubSidebar.vue?vue&type=style&index=0&id=0addd9bc&lang=scss&scoped=true":
  985. /*!***************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  986. !*** ./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppSubSidebar.vue?vue&type=style&index=0&id=0addd9bc&lang=scss&scoped=true ***!
  987. \***************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  988. /***/ ((module, __webpack_exports__, __webpack_require__) => {
  989. "use strict";
  990. __webpack_require__.r(__webpack_exports__);
  991. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  992. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  993. /* harmony export */ });
  994. /* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../node_modules/css-loader/dist/runtime/api.js */ "./node_modules/css-loader/dist/runtime/api.js");
  995. /* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_0__);
  996. // Imports
  997. var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_0___default()(function(i){return i[1]});
  998. // Module
  999. ___CSS_LOADER_EXPORT___.push([module.id, "li.layout-menuitem-category[data-v-0addd9bc] {\n margin-top: 0.75rem;\n}\nli.layout-menuitem-category[data-v-0addd9bc]:first-child {\n margin-top: 0;\n}\nli .layout-menuitem-root-text[data-v-0addd9bc] {\n text-transform: uppercase;\n color: var(--surface-900);\n font-weight: 600;\n margin-bottom: 0.5rem;\n font-size: 0.875rem;\n}\nli a[data-v-0addd9bc] {\n cursor: pointer;\n text-decoration: none;\n display: flex;\n align-items: center;\n color: var(--text-color);\n transition: color 0.2s;\n border-radius: 12px;\n padding: 0.75rem 1rem;\n transition: background-color 0.15s;\n}\nli a span[data-v-0addd9bc] {\n margin-left: 0.5rem;\n}\nli a .menuitem-toggle-icon[data-v-0addd9bc] {\n margin-left: auto;\n}\nli a[data-v-0addd9bc]:focus {\n outline: 0 none;\n outline-offset: 0;\n transition: box-shadow 0.2s;\n box-shadow: inset var(--focus-ring);\n}\nli a[data-v-0addd9bc]:hover {\n background-color: var(--surface-hover);\n}\nli a.router-link-exact-active[data-v-0addd9bc] {\n font-weight: 700;\n color: var(--primary-color);\n}\nli ul[data-v-0addd9bc] {\n list-style-type: none;\n margin: 0;\n padding: 0;\n}\nli ul ul[data-v-0addd9bc] {\n padding-left: 1rem;\n}", ""]);
  1000. // Exports
  1001. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);
  1002. /***/ }),
  1003. /***/ "./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppTopBar.vue?vue&type=style&index=0&id=42bf62a4&lang=scss&scoped=true":
  1004. /*!***********************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  1005. !*** ./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppTopBar.vue?vue&type=style&index=0&id=42bf62a4&lang=scss&scoped=true ***!
  1006. \***********************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  1007. /***/ ((module, __webpack_exports__, __webpack_require__) => {
  1008. "use strict";
  1009. __webpack_require__.r(__webpack_exports__);
  1010. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  1011. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  1012. /* harmony export */ });
  1013. /* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../node_modules/css-loader/dist/runtime/api.js */ "./node_modules/css-loader/dist/runtime/api.js");
  1014. /* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_0__);
  1015. // Imports
  1016. var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_0___default()(function(i){return i[1]});
  1017. // Module
  1018. ___CSS_LOADER_EXPORT___.push([module.id, ".layout-topbar[data-v-42bf62a4] {\n position: fixed;\n height: 5rem;\n z-index: 997;\n left: 0;\n top: 0;\n width: 100%;\n padding: 0 2rem;\n background-color: var(--surface-card);\n transition: left 0.2s;\n display: flex;\n align-items: center;\n box-shadow: 0px 3px 5px rgba(0, 0, 0, 0.02), 0px 0px 2px rgba(0, 0, 0, 0.05), 0px 1px 4px rgba(0, 0, 0, 0.08);\n}\n.layout-topbar .layout-topbar-logo[data-v-42bf62a4] {\n display: flex;\n align-items: center;\n color: var(--surface-900);\n font-size: 1.5rem;\n font-weight: 500;\n width: 300px;\n border-radius: 12px;\n}\n.layout-topbar .layout-topbar-logo img[data-v-42bf62a4] {\n height: 2.5rem;\n margin-right: 0.5rem;\n}\n.layout-topbar .layout-topbar-logo[data-v-42bf62a4]:focus {\n outline: 0 none;\n outline-offset: 0;\n transition: box-shadow 0.2s;\n box-shadow: var(--focus-ring);\n}\n.layout-topbar .layout-topbar-button[data-v-42bf62a4] {\n display: inline-flex;\n justify-content: center;\n align-items: center;\n position: relative;\n color: var(--text-color-secondary);\n border-radius: 50%;\n width: 3rem;\n height: 3rem;\n cursor: pointer;\n transition: background-color 0.2s;\n}\n.layout-topbar .layout-topbar-button[data-v-42bf62a4]:hover {\n color: var(--text-color);\n background-color: var(--surface-hover);\n}\n.layout-topbar .layout-topbar-button[data-v-42bf62a4]:focus {\n outline: 0 none;\n outline-offset: 0;\n transition: box-shadow 0.2s;\n box-shadow: var(--focus-ring);\n}\n.layout-topbar .layout-topbar-button i[data-v-42bf62a4] {\n font-size: 1.5rem;\n}\n.layout-topbar .layout-topbar-button span[data-v-42bf62a4] {\n font-size: 1rem;\n display: none;\n}\n.layout-topbar .layout-menu-button[data-v-42bf62a4] {\n margin-left: 2rem;\n}\n.layout-topbar .layout-topbar-menu-button[data-v-42bf62a4] {\n display: none;\n}\n.layout-topbar .layout-topbar-menu-button i[data-v-42bf62a4] {\n font-size: 1.25rem;\n}\n.layout-topbar .layout-topbar-menu[data-v-42bf62a4] {\n margin: 0 0 0 auto;\n padding: 0;\n list-style: none;\n display: flex;\n}\n.layout-topbar .layout-topbar-menu .layout-topbar-button[data-v-42bf62a4] {\n margin-left: 1rem;\n}\n@media (max-width: 991px) {\n.layout-topbar[data-v-42bf62a4] {\n justify-content: space-between;\n}\n.layout-topbar .layout-topbar-logo[data-v-42bf62a4] {\n width: auto;\n order: 2;\n}\n.layout-topbar .layout-menu-button[data-v-42bf62a4] {\n margin-left: 0;\n order: 1;\n}\n.layout-topbar .layout-topbar-menu-button[data-v-42bf62a4] {\n display: inline-flex;\n margin-left: 0;\n order: 3;\n}\n.layout-topbar .layout-topbar-menu[data-v-42bf62a4] {\n margin-left: 0;\n position: absolute;\n flex-direction: column;\n background-color: var(--surface-overlay);\n box-shadow: 0px 3px 5px rgba(0, 0, 0, 0.02), 0px 0px 2px rgba(0, 0, 0, 0.05), 0px 1px 4px rgba(0, 0, 0, 0.08);\n border-radius: 12px;\n padding: 1rem;\n right: 2rem;\n top: 5rem;\n min-width: 15rem;\n}\n.layout-topbar .layout-topbar-menu .layout-topbar-button[data-v-42bf62a4] {\n margin-left: 0;\n display: flex;\n width: 100%;\n height: auto;\n justify-content: flex-start;\n border-radius: 12px;\n padding: 1rem;\n}\n.layout-topbar .layout-topbar-menu .layout-topbar-button i[data-v-42bf62a4] {\n font-size: 1rem;\n margin-right: 0.5rem;\n}\n.layout-topbar .layout-topbar-menu .layout-topbar-button span[data-v-42bf62a4] {\n font-weight: medium;\n display: block;\n}\n}", ""]);
  1019. // Exports
  1020. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);
  1021. /***/ }),
  1022. /***/ "./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/layouts/DashboardLayout.vue?vue&type=style&index=0&id=549bf5ac&lang=scss&scoped=true":
  1023. /*!**************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  1024. !*** ./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/layouts/DashboardLayout.vue?vue&type=style&index=0&id=549bf5ac&lang=scss&scoped=true ***!
  1025. \**************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  1026. /***/ ((module, __webpack_exports__, __webpack_require__) => {
  1027. "use strict";
  1028. __webpack_require__.r(__webpack_exports__);
  1029. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  1030. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  1031. /* harmony export */ });
  1032. /* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../node_modules/css-loader/dist/runtime/api.js */ "./node_modules/css-loader/dist/runtime/api.js");
  1033. /* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_0__);
  1034. // Imports
  1035. var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_0___default()(function(i){return i[1]});
  1036. // Module
  1037. ___CSS_LOADER_EXPORT___.push([module.id, ".layout-sidebar[data-v-549bf5ac] {\n position: fixed;\n width: 300px;\n height: calc(100vh - 9rem);\n z-index: 999;\n overflow-y: auto;\n -webkit-user-select: none;\n -moz-user-select: none;\n -ms-user-select: none;\n user-select: none;\n top: 7rem;\n left: 2rem;\n transition: transform 0.2s, left 0.2s;\n background-color: var(--surface-overlay);\n border-radius: 4px;\n padding: 1.5rem;\n box-shadow: 0px 3px 5px rgba(0, 0, 0, 0.02), 0px 0px 2px rgba(0, 0, 0, 0.05), 0px 1px 4px rgba(0, 0, 0, 0.08);\n}\n.layout-main-container[data-v-549bf5ac] {\n display: flex;\n flex-direction: column;\n min-height: 100vh;\n justify-content: space-between;\n padding: 7rem 2rem 2rem 4rem;\n transition: margin-left 0.2s;\n}\n.layout-main[data-v-549bf5ac] {\n flex: 1 1 auto;\n}\n@media (min-width: 992px) {\n.layout-wrapper .layout-main-container[data-v-549bf5ac] {\n margin-left: 300px;\n}\n.layout-wrapper.layout-static-sidebar-inactive .layout-sidebar[data-v-549bf5ac] {\n transform: translateX(-100%);\n left: 0;\n}\n.layout-wrapper.layout-static-sidebar-inactive .layout-main-container[data-v-549bf5ac] {\n margin-left: 0;\n padding-left: 2rem;\n}\n.layout-wrapper .layout-mask[data-v-549bf5ac] {\n display: none;\n}\n}\n@media (max-width: 991px) {\n.layout-wrapper .layout-main-container[data-v-549bf5ac] {\n margin-left: 0;\n padding-left: 2rem;\n}\n.layout-wrapper .layout-sidebar[data-v-549bf5ac] {\n transform: translateX(-100%);\n left: 0;\n top: 0;\n height: 100vh;\n border-top-left-radius: 0;\n border-bottom-left-radius: 0;\n}\n.layout-wrapper .layout-mask[data-v-549bf5ac] {\n z-index: 998;\n background-color: var(--maskbg);\n}\n.layout-wrapper .layout-mask.layout-mask-enter-from[data-v-549bf5ac], .layout-wrapper .layout-mask.layout-mask-leave-to[data-v-549bf5ac] {\n background-color: transparent;\n}\n.layout-wrapper.layout-mobile-sidebar-active .layout-sidebar[data-v-549bf5ac] {\n transform: translateX(0);\n}\n.layout-wrapper.layout-mobile-sidebar-active .layout-mask[data-v-549bf5ac] {\n display: block;\n}\n}", ""]);
  1038. // Exports
  1039. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);
  1040. /***/ }),
  1041. /***/ "./node_modules/lodash/lodash.js":
  1042. /*!***************************************!*\
  1043. !*** ./node_modules/lodash/lodash.js ***!
  1044. \***************************************/
  1045. /***/ (function(module, exports, __webpack_require__) {
  1046. /* module decorator */ module = __webpack_require__.nmd(module);
  1047. var __WEBPACK_AMD_DEFINE_RESULT__;/**
  1048. * @license
  1049. * Lodash <https://lodash.com/>
  1050. * Copyright OpenJS Foundation and other contributors <https://openjsf.org/>
  1051. * Released under MIT license <https://lodash.com/license>
  1052. * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
  1053. * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
  1054. */
  1055. ;(function() {
  1056. /** Used as a safe reference for `undefined` in pre-ES5 environments. */
  1057. var undefined;
  1058. /** Used as the semantic version number. */
  1059. var VERSION = '4.17.21';
  1060. /** Used as the size to enable large array optimizations. */
  1061. var LARGE_ARRAY_SIZE = 200;
  1062. /** Error message constants. */
  1063. var CORE_ERROR_TEXT = 'Unsupported core-js use. Try https://npms.io/search?q=ponyfill.',
  1064. FUNC_ERROR_TEXT = 'Expected a function',
  1065. INVALID_TEMPL_VAR_ERROR_TEXT = 'Invalid `variable` option passed into `_.template`';
  1066. /** Used to stand-in for `undefined` hash values. */
  1067. var HASH_UNDEFINED = '__lodash_hash_undefined__';
  1068. /** Used as the maximum memoize cache size. */
  1069. var MAX_MEMOIZE_SIZE = 500;
  1070. /** Used as the internal argument placeholder. */
  1071. var PLACEHOLDER = '__lodash_placeholder__';
  1072. /** Used to compose bitmasks for cloning. */
  1073. var CLONE_DEEP_FLAG = 1,
  1074. CLONE_FLAT_FLAG = 2,
  1075. CLONE_SYMBOLS_FLAG = 4;
  1076. /** Used to compose bitmasks for value comparisons. */
  1077. var COMPARE_PARTIAL_FLAG = 1,
  1078. COMPARE_UNORDERED_FLAG = 2;
  1079. /** Used to compose bitmasks for function metadata. */
  1080. var WRAP_BIND_FLAG = 1,
  1081. WRAP_BIND_KEY_FLAG = 2,
  1082. WRAP_CURRY_BOUND_FLAG = 4,
  1083. WRAP_CURRY_FLAG = 8,
  1084. WRAP_CURRY_RIGHT_FLAG = 16,
  1085. WRAP_PARTIAL_FLAG = 32,
  1086. WRAP_PARTIAL_RIGHT_FLAG = 64,
  1087. WRAP_ARY_FLAG = 128,
  1088. WRAP_REARG_FLAG = 256,
  1089. WRAP_FLIP_FLAG = 512;
  1090. /** Used as default options for `_.truncate`. */
  1091. var DEFAULT_TRUNC_LENGTH = 30,
  1092. DEFAULT_TRUNC_OMISSION = '...';
  1093. /** Used to detect hot functions by number of calls within a span of milliseconds. */
  1094. var HOT_COUNT = 800,
  1095. HOT_SPAN = 16;
  1096. /** Used to indicate the type of lazy iteratees. */
  1097. var LAZY_FILTER_FLAG = 1,
  1098. LAZY_MAP_FLAG = 2,
  1099. LAZY_WHILE_FLAG = 3;
  1100. /** Used as references for various `Number` constants. */
  1101. var INFINITY = 1 / 0,
  1102. MAX_SAFE_INTEGER = 9007199254740991,
  1103. MAX_INTEGER = 1.7976931348623157e+308,
  1104. NAN = 0 / 0;
  1105. /** Used as references for the maximum length and index of an array. */
  1106. var MAX_ARRAY_LENGTH = 4294967295,
  1107. MAX_ARRAY_INDEX = MAX_ARRAY_LENGTH - 1,
  1108. HALF_MAX_ARRAY_LENGTH = MAX_ARRAY_LENGTH >>> 1;
  1109. /** Used to associate wrap methods with their bit flags. */
  1110. var wrapFlags = [
  1111. ['ary', WRAP_ARY_FLAG],
  1112. ['bind', WRAP_BIND_FLAG],
  1113. ['bindKey', WRAP_BIND_KEY_FLAG],
  1114. ['curry', WRAP_CURRY_FLAG],
  1115. ['curryRight', WRAP_CURRY_RIGHT_FLAG],
  1116. ['flip', WRAP_FLIP_FLAG],
  1117. ['partial', WRAP_PARTIAL_FLAG],
  1118. ['partialRight', WRAP_PARTIAL_RIGHT_FLAG],
  1119. ['rearg', WRAP_REARG_FLAG]
  1120. ];
  1121. /** `Object#toString` result references. */
  1122. var argsTag = '[object Arguments]',
  1123. arrayTag = '[object Array]',
  1124. asyncTag = '[object AsyncFunction]',
  1125. boolTag = '[object Boolean]',
  1126. dateTag = '[object Date]',
  1127. domExcTag = '[object DOMException]',
  1128. errorTag = '[object Error]',
  1129. funcTag = '[object Function]',
  1130. genTag = '[object GeneratorFunction]',
  1131. mapTag = '[object Map]',
  1132. numberTag = '[object Number]',
  1133. nullTag = '[object Null]',
  1134. objectTag = '[object Object]',
  1135. promiseTag = '[object Promise]',
  1136. proxyTag = '[object Proxy]',
  1137. regexpTag = '[object RegExp]',
  1138. setTag = '[object Set]',
  1139. stringTag = '[object String]',
  1140. symbolTag = '[object Symbol]',
  1141. undefinedTag = '[object Undefined]',
  1142. weakMapTag = '[object WeakMap]',
  1143. weakSetTag = '[object WeakSet]';
  1144. var arrayBufferTag = '[object ArrayBuffer]',
  1145. dataViewTag = '[object DataView]',
  1146. float32Tag = '[object Float32Array]',
  1147. float64Tag = '[object Float64Array]',
  1148. int8Tag = '[object Int8Array]',
  1149. int16Tag = '[object Int16Array]',
  1150. int32Tag = '[object Int32Array]',
  1151. uint8Tag = '[object Uint8Array]',
  1152. uint8ClampedTag = '[object Uint8ClampedArray]',
  1153. uint16Tag = '[object Uint16Array]',
  1154. uint32Tag = '[object Uint32Array]';
  1155. /** Used to match empty string literals in compiled template source. */
  1156. var reEmptyStringLeading = /\b__p \+= '';/g,
  1157. reEmptyStringMiddle = /\b(__p \+=) '' \+/g,
  1158. reEmptyStringTrailing = /(__e\(.*?\)|\b__t\)) \+\n'';/g;
  1159. /** Used to match HTML entities and HTML characters. */
  1160. var reEscapedHtml = /&(?:amp|lt|gt|quot|#39);/g,
  1161. reUnescapedHtml = /[&<>"']/g,
  1162. reHasEscapedHtml = RegExp(reEscapedHtml.source),
  1163. reHasUnescapedHtml = RegExp(reUnescapedHtml.source);
  1164. /** Used to match template delimiters. */
  1165. var reEscape = /<%-([\s\S]+?)%>/g,
  1166. reEvaluate = /<%([\s\S]+?)%>/g,
  1167. reInterpolate = /<%=([\s\S]+?)%>/g;
  1168. /** Used to match property names within property paths. */
  1169. var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,
  1170. reIsPlainProp = /^\w*$/,
  1171. rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g;
  1172. /**
  1173. * Used to match `RegExp`
  1174. * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).
  1175. */
  1176. var reRegExpChar = /[\\^$.*+?()[\]{}|]/g,
  1177. reHasRegExpChar = RegExp(reRegExpChar.source);
  1178. /** Used to match leading whitespace. */
  1179. var reTrimStart = /^\s+/;
  1180. /** Used to match a single whitespace character. */
  1181. var reWhitespace = /\s/;
  1182. /** Used to match wrap detail comments. */
  1183. var reWrapComment = /\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,
  1184. reWrapDetails = /\{\n\/\* \[wrapped with (.+)\] \*/,
  1185. reSplitDetails = /,? & /;
  1186. /** Used to match words composed of alphanumeric characters. */
  1187. var reAsciiWord = /[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;
  1188. /**
  1189. * Used to validate the `validate` option in `_.template` variable.
  1190. *
  1191. * Forbids characters which could potentially change the meaning of the function argument definition:
  1192. * - "()," (modification of function parameters)
  1193. * - "=" (default value)
  1194. * - "[]{}" (destructuring of function parameters)
  1195. * - "/" (beginning of a comment)
  1196. * - whitespace
  1197. */
  1198. var reForbiddenIdentifierChars = /[()=,{}\[\]\/\s]/;
  1199. /** Used to match backslashes in property paths. */
  1200. var reEscapeChar = /\\(\\)?/g;
  1201. /**
  1202. * Used to match
  1203. * [ES template delimiters](http://ecma-international.org/ecma-262/7.0/#sec-template-literal-lexical-components).
  1204. */
  1205. var reEsTemplate = /\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g;
  1206. /** Used to match `RegExp` flags from their coerced string values. */
  1207. var reFlags = /\w*$/;
  1208. /** Used to detect bad signed hexadecimal string values. */
  1209. var reIsBadHex = /^[-+]0x[0-9a-f]+$/i;
  1210. /** Used to detect binary string values. */
  1211. var reIsBinary = /^0b[01]+$/i;
  1212. /** Used to detect host constructors (Safari). */
  1213. var reIsHostCtor = /^\[object .+?Constructor\]$/;
  1214. /** Used to detect octal string values. */
  1215. var reIsOctal = /^0o[0-7]+$/i;
  1216. /** Used to detect unsigned integer values. */
  1217. var reIsUint = /^(?:0|[1-9]\d*)$/;
  1218. /** Used to match Latin Unicode letters (excluding mathematical operators). */
  1219. var reLatin = /[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g;
  1220. /** Used to ensure capturing order of template delimiters. */
  1221. var reNoMatch = /($^)/;
  1222. /** Used to match unescaped characters in compiled string literals. */
  1223. var reUnescapedString = /['\n\r\u2028\u2029\\]/g;
  1224. /** Used to compose unicode character classes. */
  1225. var rsAstralRange = '\\ud800-\\udfff',
  1226. rsComboMarksRange = '\\u0300-\\u036f',
  1227. reComboHalfMarksRange = '\\ufe20-\\ufe2f',
  1228. rsComboSymbolsRange = '\\u20d0-\\u20ff',
  1229. rsComboRange = rsComboMarksRange + reComboHalfMarksRange + rsComboSymbolsRange,
  1230. rsDingbatRange = '\\u2700-\\u27bf',
  1231. rsLowerRange = 'a-z\\xdf-\\xf6\\xf8-\\xff',
  1232. rsMathOpRange = '\\xac\\xb1\\xd7\\xf7',
  1233. rsNonCharRange = '\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf',
  1234. rsPunctuationRange = '\\u2000-\\u206f',
  1235. 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',
  1236. rsUpperRange = 'A-Z\\xc0-\\xd6\\xd8-\\xde',
  1237. rsVarRange = '\\ufe0e\\ufe0f',
  1238. rsBreakRange = rsMathOpRange + rsNonCharRange + rsPunctuationRange + rsSpaceRange;
  1239. /** Used to compose unicode capture groups. */
  1240. var rsApos = "['\u2019]",
  1241. rsAstral = '[' + rsAstralRange + ']',
  1242. rsBreak = '[' + rsBreakRange + ']',
  1243. rsCombo = '[' + rsComboRange + ']',
  1244. rsDigits = '\\d+',
  1245. rsDingbat = '[' + rsDingbatRange + ']',
  1246. rsLower = '[' + rsLowerRange + ']',
  1247. rsMisc = '[^' + rsAstralRange + rsBreakRange + rsDigits + rsDingbatRange + rsLowerRange + rsUpperRange + ']',
  1248. rsFitz = '\\ud83c[\\udffb-\\udfff]',
  1249. rsModifier = '(?:' + rsCombo + '|' + rsFitz + ')',
  1250. rsNonAstral = '[^' + rsAstralRange + ']',
  1251. rsRegional = '(?:\\ud83c[\\udde6-\\uddff]){2}',
  1252. rsSurrPair = '[\\ud800-\\udbff][\\udc00-\\udfff]',
  1253. rsUpper = '[' + rsUpperRange + ']',
  1254. rsZWJ = '\\u200d';
  1255. /** Used to compose unicode regexes. */
  1256. var rsMiscLower = '(?:' + rsLower + '|' + rsMisc + ')',
  1257. rsMiscUpper = '(?:' + rsUpper + '|' + rsMisc + ')',
  1258. rsOptContrLower = '(?:' + rsApos + '(?:d|ll|m|re|s|t|ve))?',
  1259. rsOptContrUpper = '(?:' + rsApos + '(?:D|LL|M|RE|S|T|VE))?',
  1260. reOptMod = rsModifier + '?',
  1261. rsOptVar = '[' + rsVarRange + ']?',
  1262. rsOptJoin = '(?:' + rsZWJ + '(?:' + [rsNonAstral, rsRegional, rsSurrPair].join('|') + ')' + rsOptVar + reOptMod + ')*',
  1263. rsOrdLower = '\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])',
  1264. rsOrdUpper = '\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])',
  1265. rsSeq = rsOptVar + reOptMod + rsOptJoin,
  1266. rsEmoji = '(?:' + [rsDingbat, rsRegional, rsSurrPair].join('|') + ')' + rsSeq,
  1267. rsSymbol = '(?:' + [rsNonAstral + rsCombo + '?', rsCombo, rsRegional, rsSurrPair, rsAstral].join('|') + ')';
  1268. /** Used to match apostrophes. */
  1269. var reApos = RegExp(rsApos, 'g');
  1270. /**
  1271. * Used to match [combining diacritical marks](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks) and
  1272. * [combining diacritical marks for symbols](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks_for_Symbols).
  1273. */
  1274. var reComboMark = RegExp(rsCombo, 'g');
  1275. /** Used to match [string symbols](https://mathiasbynens.be/notes/javascript-unicode). */
  1276. var reUnicode = RegExp(rsFitz + '(?=' + rsFitz + ')|' + rsSymbol + rsSeq, 'g');
  1277. /** Used to match complex or compound words. */
  1278. var reUnicodeWord = RegExp([
  1279. rsUpper + '?' + rsLower + '+' + rsOptContrLower + '(?=' + [rsBreak, rsUpper, '$'].join('|') + ')',
  1280. rsMiscUpper + '+' + rsOptContrUpper + '(?=' + [rsBreak, rsUpper + rsMiscLower, '$'].join('|') + ')',
  1281. rsUpper + '?' + rsMiscLower + '+' + rsOptContrLower,
  1282. rsUpper + '+' + rsOptContrUpper,
  1283. rsOrdUpper,
  1284. rsOrdLower,
  1285. rsDigits,
  1286. rsEmoji
  1287. ].join('|'), 'g');
  1288. /** Used to detect strings with [zero-width joiners or code points from the astral planes](http://eev.ee/blog/2015/09/12/dark-corners-of-unicode/). */
  1289. var reHasUnicode = RegExp('[' + rsZWJ + rsAstralRange + rsComboRange + rsVarRange + ']');
  1290. /** Used to detect strings that need a more robust regexp to match words. */
  1291. 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 ]/;
  1292. /** Used to assign default `context` object properties. */
  1293. var contextProps = [
  1294. 'Array', 'Buffer', 'DataView', 'Date', 'Error', 'Float32Array', 'Float64Array',
  1295. 'Function', 'Int8Array', 'Int16Array', 'Int32Array', 'Map', 'Math', 'Object',
  1296. 'Promise', 'RegExp', 'Set', 'String', 'Symbol', 'TypeError', 'Uint8Array',
  1297. 'Uint8ClampedArray', 'Uint16Array', 'Uint32Array', 'WeakMap',
  1298. '_', 'clearTimeout', 'isFinite', 'parseInt', 'setTimeout'
  1299. ];
  1300. /** Used to make template sourceURLs easier to identify. */
  1301. var templateCounter = -1;
  1302. /** Used to identify `toStringTag` values of typed arrays. */
  1303. var typedArrayTags = {};
  1304. typedArrayTags[float32Tag] = typedArrayTags[float64Tag] =
  1305. typedArrayTags[int8Tag] = typedArrayTags[int16Tag] =
  1306. typedArrayTags[int32Tag] = typedArrayTags[uint8Tag] =
  1307. typedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] =
  1308. typedArrayTags[uint32Tag] = true;
  1309. typedArrayTags[argsTag] = typedArrayTags[arrayTag] =
  1310. typedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] =
  1311. typedArrayTags[dataViewTag] = typedArrayTags[dateTag] =
  1312. typedArrayTags[errorTag] = typedArrayTags[funcTag] =
  1313. typedArrayTags[mapTag] = typedArrayTags[numberTag] =
  1314. typedArrayTags[objectTag] = typedArrayTags[regexpTag] =
  1315. typedArrayTags[setTag] = typedArrayTags[stringTag] =
  1316. typedArrayTags[weakMapTag] = false;
  1317. /** Used to identify `toStringTag` values supported by `_.clone`. */
  1318. var cloneableTags = {};
  1319. cloneableTags[argsTag] = cloneableTags[arrayTag] =
  1320. cloneableTags[arrayBufferTag] = cloneableTags[dataViewTag] =
  1321. cloneableTags[boolTag] = cloneableTags[dateTag] =
  1322. cloneableTags[float32Tag] = cloneableTags[float64Tag] =
  1323. cloneableTags[int8Tag] = cloneableTags[int16Tag] =
  1324. cloneableTags[int32Tag] = cloneableTags[mapTag] =
  1325. cloneableTags[numberTag] = cloneableTags[objectTag] =
  1326. cloneableTags[regexpTag] = cloneableTags[setTag] =
  1327. cloneableTags[stringTag] = cloneableTags[symbolTag] =
  1328. cloneableTags[uint8Tag] = cloneableTags[uint8ClampedTag] =
  1329. cloneableTags[uint16Tag] = cloneableTags[uint32Tag] = true;
  1330. cloneableTags[errorTag] = cloneableTags[funcTag] =
  1331. cloneableTags[weakMapTag] = false;
  1332. /** Used to map Latin Unicode letters to basic Latin letters. */
  1333. var deburredLetters = {
  1334. // Latin-1 Supplement block.
  1335. '\xc0': 'A', '\xc1': 'A', '\xc2': 'A', '\xc3': 'A', '\xc4': 'A', '\xc5': 'A',
  1336. '\xe0': 'a', '\xe1': 'a', '\xe2': 'a', '\xe3': 'a', '\xe4': 'a', '\xe5': 'a',
  1337. '\xc7': 'C', '\xe7': 'c',
  1338. '\xd0': 'D', '\xf0': 'd',
  1339. '\xc8': 'E', '\xc9': 'E', '\xca': 'E', '\xcb': 'E',
  1340. '\xe8': 'e', '\xe9': 'e', '\xea': 'e', '\xeb': 'e',
  1341. '\xcc': 'I', '\xcd': 'I', '\xce': 'I', '\xcf': 'I',
  1342. '\xec': 'i', '\xed': 'i', '\xee': 'i', '\xef': 'i',
  1343. '\xd1': 'N', '\xf1': 'n',
  1344. '\xd2': 'O', '\xd3': 'O', '\xd4': 'O', '\xd5': 'O', '\xd6': 'O', '\xd8': 'O',
  1345. '\xf2': 'o', '\xf3': 'o', '\xf4': 'o', '\xf5': 'o', '\xf6': 'o', '\xf8': 'o',
  1346. '\xd9': 'U', '\xda': 'U', '\xdb': 'U', '\xdc': 'U',
  1347. '\xf9': 'u', '\xfa': 'u', '\xfb': 'u', '\xfc': 'u',
  1348. '\xdd': 'Y', '\xfd': 'y', '\xff': 'y',
  1349. '\xc6': 'Ae', '\xe6': 'ae',
  1350. '\xde': 'Th', '\xfe': 'th',
  1351. '\xdf': 'ss',
  1352. // Latin Extended-A block.
  1353. '\u0100': 'A', '\u0102': 'A', '\u0104': 'A',
  1354. '\u0101': 'a', '\u0103': 'a', '\u0105': 'a',
  1355. '\u0106': 'C', '\u0108': 'C', '\u010a': 'C', '\u010c': 'C',
  1356. '\u0107': 'c', '\u0109': 'c', '\u010b': 'c', '\u010d': 'c',
  1357. '\u010e': 'D', '\u0110': 'D', '\u010f': 'd', '\u0111': 'd',
  1358. '\u0112': 'E', '\u0114': 'E', '\u0116': 'E', '\u0118': 'E', '\u011a': 'E',
  1359. '\u0113': 'e', '\u0115': 'e', '\u0117': 'e', '\u0119': 'e', '\u011b': 'e',
  1360. '\u011c': 'G', '\u011e': 'G', '\u0120': 'G', '\u0122': 'G',
  1361. '\u011d': 'g', '\u011f': 'g', '\u0121': 'g', '\u0123': 'g',
  1362. '\u0124': 'H', '\u0126': 'H', '\u0125': 'h', '\u0127': 'h',
  1363. '\u0128': 'I', '\u012a': 'I', '\u012c': 'I', '\u012e': 'I', '\u0130': 'I',
  1364. '\u0129': 'i', '\u012b': 'i', '\u012d': 'i', '\u012f': 'i', '\u0131': 'i',
  1365. '\u0134': 'J', '\u0135': 'j',
  1366. '\u0136': 'K', '\u0137': 'k', '\u0138': 'k',
  1367. '\u0139': 'L', '\u013b': 'L', '\u013d': 'L', '\u013f': 'L', '\u0141': 'L',
  1368. '\u013a': 'l', '\u013c': 'l', '\u013e': 'l', '\u0140': 'l', '\u0142': 'l',
  1369. '\u0143': 'N', '\u0145': 'N', '\u0147': 'N', '\u014a': 'N',
  1370. '\u0144': 'n', '\u0146': 'n', '\u0148': 'n', '\u014b': 'n',
  1371. '\u014c': 'O', '\u014e': 'O', '\u0150': 'O',
  1372. '\u014d': 'o', '\u014f': 'o', '\u0151': 'o',
  1373. '\u0154': 'R', '\u0156': 'R', '\u0158': 'R',
  1374. '\u0155': 'r', '\u0157': 'r', '\u0159': 'r',
  1375. '\u015a': 'S', '\u015c': 'S', '\u015e': 'S', '\u0160': 'S',
  1376. '\u015b': 's', '\u015d': 's', '\u015f': 's', '\u0161': 's',
  1377. '\u0162': 'T', '\u0164': 'T', '\u0166': 'T',
  1378. '\u0163': 't', '\u0165': 't', '\u0167': 't',
  1379. '\u0168': 'U', '\u016a': 'U', '\u016c': 'U', '\u016e': 'U', '\u0170': 'U', '\u0172': 'U',
  1380. '\u0169': 'u', '\u016b': 'u', '\u016d': 'u', '\u016f': 'u', '\u0171': 'u', '\u0173': 'u',
  1381. '\u0174': 'W', '\u0175': 'w',
  1382. '\u0176': 'Y', '\u0177': 'y', '\u0178': 'Y',
  1383. '\u0179': 'Z', '\u017b': 'Z', '\u017d': 'Z',
  1384. '\u017a': 'z', '\u017c': 'z', '\u017e': 'z',
  1385. '\u0132': 'IJ', '\u0133': 'ij',
  1386. '\u0152': 'Oe', '\u0153': 'oe',
  1387. '\u0149': "'n", '\u017f': 's'
  1388. };
  1389. /** Used to map characters to HTML entities. */
  1390. var htmlEscapes = {
  1391. '&': '&amp;',
  1392. '<': '&lt;',
  1393. '>': '&gt;',
  1394. '"': '&quot;',
  1395. "'": '&#39;'
  1396. };
  1397. /** Used to map HTML entities to characters. */
  1398. var htmlUnescapes = {
  1399. '&amp;': '&',
  1400. '&lt;': '<',
  1401. '&gt;': '>',
  1402. '&quot;': '"',
  1403. '&#39;': "'"
  1404. };
  1405. /** Used to escape characters for inclusion in compiled string literals. */
  1406. var stringEscapes = {
  1407. '\\': '\\',
  1408. "'": "'",
  1409. '\n': 'n',
  1410. '\r': 'r',
  1411. '\u2028': 'u2028',
  1412. '\u2029': 'u2029'
  1413. };
  1414. /** Built-in method references without a dependency on `root`. */
  1415. var freeParseFloat = parseFloat,
  1416. freeParseInt = parseInt;
  1417. /** Detect free variable `global` from Node.js. */
  1418. var freeGlobal = typeof __webpack_require__.g == 'object' && __webpack_require__.g && __webpack_require__.g.Object === Object && __webpack_require__.g;
  1419. /** Detect free variable `self`. */
  1420. var freeSelf = typeof self == 'object' && self && self.Object === Object && self;
  1421. /** Used as a reference to the global object. */
  1422. var root = freeGlobal || freeSelf || Function('return this')();
  1423. /** Detect free variable `exports`. */
  1424. var freeExports = true && exports && !exports.nodeType && exports;
  1425. /** Detect free variable `module`. */
  1426. var freeModule = freeExports && "object" == 'object' && module && !module.nodeType && module;
  1427. /** Detect the popular CommonJS extension `module.exports`. */
  1428. var moduleExports = freeModule && freeModule.exports === freeExports;
  1429. /** Detect free variable `process` from Node.js. */
  1430. var freeProcess = moduleExports && freeGlobal.process;
  1431. /** Used to access faster Node.js helpers. */
  1432. var nodeUtil = (function() {
  1433. try {
  1434. // Use `util.types` for Node.js 10+.
  1435. var types = freeModule && freeModule.require && freeModule.require('util').types;
  1436. if (types) {
  1437. return types;
  1438. }
  1439. // Legacy `process.binding('util')` for Node.js < 10.
  1440. return freeProcess && freeProcess.binding && freeProcess.binding('util');
  1441. } catch (e) {}
  1442. }());
  1443. /* Node.js helper references. */
  1444. var nodeIsArrayBuffer = nodeUtil && nodeUtil.isArrayBuffer,
  1445. nodeIsDate = nodeUtil && nodeUtil.isDate,
  1446. nodeIsMap = nodeUtil && nodeUtil.isMap,
  1447. nodeIsRegExp = nodeUtil && nodeUtil.isRegExp,
  1448. nodeIsSet = nodeUtil && nodeUtil.isSet,
  1449. nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray;
  1450. /*--------------------------------------------------------------------------*/
  1451. /**
  1452. * A faster alternative to `Function#apply`, this function invokes `func`
  1453. * with the `this` binding of `thisArg` and the arguments of `args`.
  1454. *
  1455. * @private
  1456. * @param {Function} func The function to invoke.
  1457. * @param {*} thisArg The `this` binding of `func`.
  1458. * @param {Array} args The arguments to invoke `func` with.
  1459. * @returns {*} Returns the result of `func`.
  1460. */
  1461. function apply(func, thisArg, args) {
  1462. switch (args.length) {
  1463. case 0: return func.call(thisArg);
  1464. case 1: return func.call(thisArg, args[0]);
  1465. case 2: return func.call(thisArg, args[0], args[1]);
  1466. case 3: return func.call(thisArg, args[0], args[1], args[2]);
  1467. }
  1468. return func.apply(thisArg, args);
  1469. }
  1470. /**
  1471. * A specialized version of `baseAggregator` for arrays.
  1472. *
  1473. * @private
  1474. * @param {Array} [array] The array to iterate over.
  1475. * @param {Function} setter The function to set `accumulator` values.
  1476. * @param {Function} iteratee The iteratee to transform keys.
  1477. * @param {Object} accumulator The initial aggregated object.
  1478. * @returns {Function} Returns `accumulator`.
  1479. */
  1480. function arrayAggregator(array, setter, iteratee, accumulator) {
  1481. var index = -1,
  1482. length = array == null ? 0 : array.length;
  1483. while (++index < length) {
  1484. var value = array[index];
  1485. setter(accumulator, value, iteratee(value), array);
  1486. }
  1487. return accumulator;
  1488. }
  1489. /**
  1490. * A specialized version of `_.forEach` for arrays without support for
  1491. * iteratee shorthands.
  1492. *
  1493. * @private
  1494. * @param {Array} [array] The array to iterate over.
  1495. * @param {Function} iteratee The function invoked per iteration.
  1496. * @returns {Array} Returns `array`.
  1497. */
  1498. function arrayEach(array, iteratee) {
  1499. var index = -1,
  1500. length = array == null ? 0 : array.length;
  1501. while (++index < length) {
  1502. if (iteratee(array[index], index, array) === false) {
  1503. break;
  1504. }
  1505. }
  1506. return array;
  1507. }
  1508. /**
  1509. * A specialized version of `_.forEachRight` for arrays without support for
  1510. * iteratee shorthands.
  1511. *
  1512. * @private
  1513. * @param {Array} [array] The array to iterate over.
  1514. * @param {Function} iteratee The function invoked per iteration.
  1515. * @returns {Array} Returns `array`.
  1516. */
  1517. function arrayEachRight(array, iteratee) {
  1518. var length = array == null ? 0 : array.length;
  1519. while (length--) {
  1520. if (iteratee(array[length], length, array) === false) {
  1521. break;
  1522. }
  1523. }
  1524. return array;
  1525. }
  1526. /**
  1527. * A specialized version of `_.every` for arrays without support for
  1528. * iteratee shorthands.
  1529. *
  1530. * @private
  1531. * @param {Array} [array] The array to iterate over.
  1532. * @param {Function} predicate The function invoked per iteration.
  1533. * @returns {boolean} Returns `true` if all elements pass the predicate check,
  1534. * else `false`.
  1535. */
  1536. function arrayEvery(array, predicate) {
  1537. var index = -1,
  1538. length = array == null ? 0 : array.length;
  1539. while (++index < length) {
  1540. if (!predicate(array[index], index, array)) {
  1541. return false;
  1542. }
  1543. }
  1544. return true;
  1545. }
  1546. /**
  1547. * A specialized version of `_.filter` for arrays without support for
  1548. * iteratee shorthands.
  1549. *
  1550. * @private
  1551. * @param {Array} [array] The array to iterate over.
  1552. * @param {Function} predicate The function invoked per iteration.
  1553. * @returns {Array} Returns the new filtered array.
  1554. */
  1555. function arrayFilter(array, predicate) {
  1556. var index = -1,
  1557. length = array == null ? 0 : array.length,
  1558. resIndex = 0,
  1559. result = [];
  1560. while (++index < length) {
  1561. var value = array[index];
  1562. if (predicate(value, index, array)) {
  1563. result[resIndex++] = value;
  1564. }
  1565. }
  1566. return result;
  1567. }
  1568. /**
  1569. * A specialized version of `_.includes` for arrays without support for
  1570. * specifying an index to search from.
  1571. *
  1572. * @private
  1573. * @param {Array} [array] The array to inspect.
  1574. * @param {*} target The value to search for.
  1575. * @returns {boolean} Returns `true` if `target` is found, else `false`.
  1576. */
  1577. function arrayIncludes(array, value) {
  1578. var length = array == null ? 0 : array.length;
  1579. return !!length && baseIndexOf(array, value, 0) > -1;
  1580. }
  1581. /**
  1582. * This function is like `arrayIncludes` except that it accepts a comparator.
  1583. *
  1584. * @private
  1585. * @param {Array} [array] The array to inspect.
  1586. * @param {*} target The value to search for.
  1587. * @param {Function} comparator The comparator invoked per element.
  1588. * @returns {boolean} Returns `true` if `target` is found, else `false`.
  1589. */
  1590. function arrayIncludesWith(array, value, comparator) {
  1591. var index = -1,
  1592. length = array == null ? 0 : array.length;
  1593. while (++index < length) {
  1594. if (comparator(value, array[index])) {
  1595. return true;
  1596. }
  1597. }
  1598. return false;
  1599. }
  1600. /**
  1601. * A specialized version of `_.map` for arrays without support for iteratee
  1602. * shorthands.
  1603. *
  1604. * @private
  1605. * @param {Array} [array] The array to iterate over.
  1606. * @param {Function} iteratee The function invoked per iteration.
  1607. * @returns {Array} Returns the new mapped array.
  1608. */
  1609. function arrayMap(array, iteratee) {
  1610. var index = -1,
  1611. length = array == null ? 0 : array.length,
  1612. result = Array(length);
  1613. while (++index < length) {
  1614. result[index] = iteratee(array[index], index, array);
  1615. }
  1616. return result;
  1617. }
  1618. /**
  1619. * Appends the elements of `values` to `array`.
  1620. *
  1621. * @private
  1622. * @param {Array} array The array to modify.
  1623. * @param {Array} values The values to append.
  1624. * @returns {Array} Returns `array`.
  1625. */
  1626. function arrayPush(array, values) {
  1627. var index = -1,
  1628. length = values.length,
  1629. offset = array.length;
  1630. while (++index < length) {
  1631. array[offset + index] = values[index];
  1632. }
  1633. return array;
  1634. }
  1635. /**
  1636. * A specialized version of `_.reduce` for arrays without support for
  1637. * iteratee shorthands.
  1638. *
  1639. * @private
  1640. * @param {Array} [array] The array to iterate over.
  1641. * @param {Function} iteratee The function invoked per iteration.
  1642. * @param {*} [accumulator] The initial value.
  1643. * @param {boolean} [initAccum] Specify using the first element of `array` as
  1644. * the initial value.
  1645. * @returns {*} Returns the accumulated value.
  1646. */
  1647. function arrayReduce(array, iteratee, accumulator, initAccum) {
  1648. var index = -1,
  1649. length = array == null ? 0 : array.length;
  1650. if (initAccum && length) {
  1651. accumulator = array[++index];
  1652. }
  1653. while (++index < length) {
  1654. accumulator = iteratee(accumulator, array[index], index, array);
  1655. }
  1656. return accumulator;
  1657. }
  1658. /**
  1659. * A specialized version of `_.reduceRight` for arrays without support for
  1660. * iteratee shorthands.
  1661. *
  1662. * @private
  1663. * @param {Array} [array] The array to iterate over.
  1664. * @param {Function} iteratee The function invoked per iteration.
  1665. * @param {*} [accumulator] The initial value.
  1666. * @param {boolean} [initAccum] Specify using the last element of `array` as
  1667. * the initial value.
  1668. * @returns {*} Returns the accumulated value.
  1669. */
  1670. function arrayReduceRight(array, iteratee, accumulator, initAccum) {
  1671. var length = array == null ? 0 : array.length;
  1672. if (initAccum && length) {
  1673. accumulator = array[--length];
  1674. }
  1675. while (length--) {
  1676. accumulator = iteratee(accumulator, array[length], length, array);
  1677. }
  1678. return accumulator;
  1679. }
  1680. /**
  1681. * A specialized version of `_.some` for arrays without support for iteratee
  1682. * shorthands.
  1683. *
  1684. * @private
  1685. * @param {Array} [array] The array to iterate over.
  1686. * @param {Function} predicate The function invoked per iteration.
  1687. * @returns {boolean} Returns `true` if any element passes the predicate check,
  1688. * else `false`.
  1689. */
  1690. function arraySome(array, predicate) {
  1691. var index = -1,
  1692. length = array == null ? 0 : array.length;
  1693. while (++index < length) {
  1694. if (predicate(array[index], index, array)) {
  1695. return true;
  1696. }
  1697. }
  1698. return false;
  1699. }
  1700. /**
  1701. * Gets the size of an ASCII `string`.
  1702. *
  1703. * @private
  1704. * @param {string} string The string inspect.
  1705. * @returns {number} Returns the string size.
  1706. */
  1707. var asciiSize = baseProperty('length');
  1708. /**
  1709. * Converts an ASCII `string` to an array.
  1710. *
  1711. * @private
  1712. * @param {string} string The string to convert.
  1713. * @returns {Array} Returns the converted array.
  1714. */
  1715. function asciiToArray(string) {
  1716. return string.split('');
  1717. }
  1718. /**
  1719. * Splits an ASCII `string` into an array of its words.
  1720. *
  1721. * @private
  1722. * @param {string} The string to inspect.
  1723. * @returns {Array} Returns the words of `string`.
  1724. */
  1725. function asciiWords(string) {
  1726. return string.match(reAsciiWord) || [];
  1727. }
  1728. /**
  1729. * The base implementation of methods like `_.findKey` and `_.findLastKey`,
  1730. * without support for iteratee shorthands, which iterates over `collection`
  1731. * using `eachFunc`.
  1732. *
  1733. * @private
  1734. * @param {Array|Object} collection The collection to inspect.
  1735. * @param {Function} predicate The function invoked per iteration.
  1736. * @param {Function} eachFunc The function to iterate over `collection`.
  1737. * @returns {*} Returns the found element or its key, else `undefined`.
  1738. */
  1739. function baseFindKey(collection, predicate, eachFunc) {
  1740. var result;
  1741. eachFunc(collection, function(value, key, collection) {
  1742. if (predicate(value, key, collection)) {
  1743. result = key;
  1744. return false;
  1745. }
  1746. });
  1747. return result;
  1748. }
  1749. /**
  1750. * The base implementation of `_.findIndex` and `_.findLastIndex` without
  1751. * support for iteratee shorthands.
  1752. *
  1753. * @private
  1754. * @param {Array} array The array to inspect.
  1755. * @param {Function} predicate The function invoked per iteration.
  1756. * @param {number} fromIndex The index to search from.
  1757. * @param {boolean} [fromRight] Specify iterating from right to left.
  1758. * @returns {number} Returns the index of the matched value, else `-1`.
  1759. */
  1760. function baseFindIndex(array, predicate, fromIndex, fromRight) {
  1761. var length = array.length,
  1762. index = fromIndex + (fromRight ? 1 : -1);
  1763. while ((fromRight ? index-- : ++index < length)) {
  1764. if (predicate(array[index], index, array)) {
  1765. return index;
  1766. }
  1767. }
  1768. return -1;
  1769. }
  1770. /**
  1771. * The base implementation of `_.indexOf` without `fromIndex` bounds checks.
  1772. *
  1773. * @private
  1774. * @param {Array} array The array to inspect.
  1775. * @param {*} value The value to search for.
  1776. * @param {number} fromIndex The index to search from.
  1777. * @returns {number} Returns the index of the matched value, else `-1`.
  1778. */
  1779. function baseIndexOf(array, value, fromIndex) {
  1780. return value === value
  1781. ? strictIndexOf(array, value, fromIndex)
  1782. : baseFindIndex(array, baseIsNaN, fromIndex);
  1783. }
  1784. /**
  1785. * This function is like `baseIndexOf` except that it accepts a comparator.
  1786. *
  1787. * @private
  1788. * @param {Array} array The array to inspect.
  1789. * @param {*} value The value to search for.
  1790. * @param {number} fromIndex The index to search from.
  1791. * @param {Function} comparator The comparator invoked per element.
  1792. * @returns {number} Returns the index of the matched value, else `-1`.
  1793. */
  1794. function baseIndexOfWith(array, value, fromIndex, comparator) {
  1795. var index = fromIndex - 1,
  1796. length = array.length;
  1797. while (++index < length) {
  1798. if (comparator(array[index], value)) {
  1799. return index;
  1800. }
  1801. }
  1802. return -1;
  1803. }
  1804. /**
  1805. * The base implementation of `_.isNaN` without support for number objects.
  1806. *
  1807. * @private
  1808. * @param {*} value The value to check.
  1809. * @returns {boolean} Returns `true` if `value` is `NaN`, else `false`.
  1810. */
  1811. function baseIsNaN(value) {
  1812. return value !== value;
  1813. }
  1814. /**
  1815. * The base implementation of `_.mean` and `_.meanBy` without support for
  1816. * iteratee shorthands.
  1817. *
  1818. * @private
  1819. * @param {Array} array The array to iterate over.
  1820. * @param {Function} iteratee The function invoked per iteration.
  1821. * @returns {number} Returns the mean.
  1822. */
  1823. function baseMean(array, iteratee) {
  1824. var length = array == null ? 0 : array.length;
  1825. return length ? (baseSum(array, iteratee) / length) : NAN;
  1826. }
  1827. /**
  1828. * The base implementation of `_.property` without support for deep paths.
  1829. *
  1830. * @private
  1831. * @param {string} key The key of the property to get.
  1832. * @returns {Function} Returns the new accessor function.
  1833. */
  1834. function baseProperty(key) {
  1835. return function(object) {
  1836. return object == null ? undefined : object[key];
  1837. };
  1838. }
  1839. /**
  1840. * The base implementation of `_.propertyOf` without support for deep paths.
  1841. *
  1842. * @private
  1843. * @param {Object} object The object to query.
  1844. * @returns {Function} Returns the new accessor function.
  1845. */
  1846. function basePropertyOf(object) {
  1847. return function(key) {
  1848. return object == null ? undefined : object[key];
  1849. };
  1850. }
  1851. /**
  1852. * The base implementation of `_.reduce` and `_.reduceRight`, without support
  1853. * for iteratee shorthands, which iterates over `collection` using `eachFunc`.
  1854. *
  1855. * @private
  1856. * @param {Array|Object} collection The collection to iterate over.
  1857. * @param {Function} iteratee The function invoked per iteration.
  1858. * @param {*} accumulator The initial value.
  1859. * @param {boolean} initAccum Specify using the first or last element of
  1860. * `collection` as the initial value.
  1861. * @param {Function} eachFunc The function to iterate over `collection`.
  1862. * @returns {*} Returns the accumulated value.
  1863. */
  1864. function baseReduce(collection, iteratee, accumulator, initAccum, eachFunc) {
  1865. eachFunc(collection, function(value, index, collection) {
  1866. accumulator = initAccum
  1867. ? (initAccum = false, value)
  1868. : iteratee(accumulator, value, index, collection);
  1869. });
  1870. return accumulator;
  1871. }
  1872. /**
  1873. * The base implementation of `_.sortBy` which uses `comparer` to define the
  1874. * sort order of `array` and replaces criteria objects with their corresponding
  1875. * values.
  1876. *
  1877. * @private
  1878. * @param {Array} array The array to sort.
  1879. * @param {Function} comparer The function to define sort order.
  1880. * @returns {Array} Returns `array`.
  1881. */
  1882. function baseSortBy(array, comparer) {
  1883. var length = array.length;
  1884. array.sort(comparer);
  1885. while (length--) {
  1886. array[length] = array[length].value;
  1887. }
  1888. return array;
  1889. }
  1890. /**
  1891. * The base implementation of `_.sum` and `_.sumBy` without support for
  1892. * iteratee shorthands.
  1893. *
  1894. * @private
  1895. * @param {Array} array The array to iterate over.
  1896. * @param {Function} iteratee The function invoked per iteration.
  1897. * @returns {number} Returns the sum.
  1898. */
  1899. function baseSum(array, iteratee) {
  1900. var result,
  1901. index = -1,
  1902. length = array.length;
  1903. while (++index < length) {
  1904. var current = iteratee(array[index]);
  1905. if (current !== undefined) {
  1906. result = result === undefined ? current : (result + current);
  1907. }
  1908. }
  1909. return result;
  1910. }
  1911. /**
  1912. * The base implementation of `_.times` without support for iteratee shorthands
  1913. * or max array length checks.
  1914. *
  1915. * @private
  1916. * @param {number} n The number of times to invoke `iteratee`.
  1917. * @param {Function} iteratee The function invoked per iteration.
  1918. * @returns {Array} Returns the array of results.
  1919. */
  1920. function baseTimes(n, iteratee) {
  1921. var index = -1,
  1922. result = Array(n);
  1923. while (++index < n) {
  1924. result[index] = iteratee(index);
  1925. }
  1926. return result;
  1927. }
  1928. /**
  1929. * The base implementation of `_.toPairs` and `_.toPairsIn` which creates an array
  1930. * of key-value pairs for `object` corresponding to the property names of `props`.
  1931. *
  1932. * @private
  1933. * @param {Object} object The object to query.
  1934. * @param {Array} props The property names to get values for.
  1935. * @returns {Object} Returns the key-value pairs.
  1936. */
  1937. function baseToPairs(object, props) {
  1938. return arrayMap(props, function(key) {
  1939. return [key, object[key]];
  1940. });
  1941. }
  1942. /**
  1943. * The base implementation of `_.trim`.
  1944. *
  1945. * @private
  1946. * @param {string} string The string to trim.
  1947. * @returns {string} Returns the trimmed string.
  1948. */
  1949. function baseTrim(string) {
  1950. return string
  1951. ? string.slice(0, trimmedEndIndex(string) + 1).replace(reTrimStart, '')
  1952. : string;
  1953. }
  1954. /**
  1955. * The base implementation of `_.unary` without support for storing metadata.
  1956. *
  1957. * @private
  1958. * @param {Function} func The function to cap arguments for.
  1959. * @returns {Function} Returns the new capped function.
  1960. */
  1961. function baseUnary(func) {
  1962. return function(value) {
  1963. return func(value);
  1964. };
  1965. }
  1966. /**
  1967. * The base implementation of `_.values` and `_.valuesIn` which creates an
  1968. * array of `object` property values corresponding to the property names
  1969. * of `props`.
  1970. *
  1971. * @private
  1972. * @param {Object} object The object to query.
  1973. * @param {Array} props The property names to get values for.
  1974. * @returns {Object} Returns the array of property values.
  1975. */
  1976. function baseValues(object, props) {
  1977. return arrayMap(props, function(key) {
  1978. return object[key];
  1979. });
  1980. }
  1981. /**
  1982. * Checks if a `cache` value for `key` exists.
  1983. *
  1984. * @private
  1985. * @param {Object} cache The cache to query.
  1986. * @param {string} key The key of the entry to check.
  1987. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  1988. */
  1989. function cacheHas(cache, key) {
  1990. return cache.has(key);
  1991. }
  1992. /**
  1993. * Used by `_.trim` and `_.trimStart` to get the index of the first string symbol
  1994. * that is not found in the character symbols.
  1995. *
  1996. * @private
  1997. * @param {Array} strSymbols The string symbols to inspect.
  1998. * @param {Array} chrSymbols The character symbols to find.
  1999. * @returns {number} Returns the index of the first unmatched string symbol.
  2000. */
  2001. function charsStartIndex(strSymbols, chrSymbols) {
  2002. var index = -1,
  2003. length = strSymbols.length;
  2004. while (++index < length && baseIndexOf(chrSymbols, strSymbols[index], 0) > -1) {}
  2005. return index;
  2006. }
  2007. /**
  2008. * Used by `_.trim` and `_.trimEnd` to get the index of the last string symbol
  2009. * that is not found in the character symbols.
  2010. *
  2011. * @private
  2012. * @param {Array} strSymbols The string symbols to inspect.
  2013. * @param {Array} chrSymbols The character symbols to find.
  2014. * @returns {number} Returns the index of the last unmatched string symbol.
  2015. */
  2016. function charsEndIndex(strSymbols, chrSymbols) {
  2017. var index = strSymbols.length;
  2018. while (index-- && baseIndexOf(chrSymbols, strSymbols[index], 0) > -1) {}
  2019. return index;
  2020. }
  2021. /**
  2022. * Gets the number of `placeholder` occurrences in `array`.
  2023. *
  2024. * @private
  2025. * @param {Array} array The array to inspect.
  2026. * @param {*} placeholder The placeholder to search for.
  2027. * @returns {number} Returns the placeholder count.
  2028. */
  2029. function countHolders(array, placeholder) {
  2030. var length = array.length,
  2031. result = 0;
  2032. while (length--) {
  2033. if (array[length] === placeholder) {
  2034. ++result;
  2035. }
  2036. }
  2037. return result;
  2038. }
  2039. /**
  2040. * Used by `_.deburr` to convert Latin-1 Supplement and Latin Extended-A
  2041. * letters to basic Latin letters.
  2042. *
  2043. * @private
  2044. * @param {string} letter The matched letter to deburr.
  2045. * @returns {string} Returns the deburred letter.
  2046. */
  2047. var deburrLetter = basePropertyOf(deburredLetters);
  2048. /**
  2049. * Used by `_.escape` to convert characters to HTML entities.
  2050. *
  2051. * @private
  2052. * @param {string} chr The matched character to escape.
  2053. * @returns {string} Returns the escaped character.
  2054. */
  2055. var escapeHtmlChar = basePropertyOf(htmlEscapes);
  2056. /**
  2057. * Used by `_.template` to escape characters for inclusion in compiled string literals.
  2058. *
  2059. * @private
  2060. * @param {string} chr The matched character to escape.
  2061. * @returns {string} Returns the escaped character.
  2062. */
  2063. function escapeStringChar(chr) {
  2064. return '\\' + stringEscapes[chr];
  2065. }
  2066. /**
  2067. * Gets the value at `key` of `object`.
  2068. *
  2069. * @private
  2070. * @param {Object} [object] The object to query.
  2071. * @param {string} key The key of the property to get.
  2072. * @returns {*} Returns the property value.
  2073. */
  2074. function getValue(object, key) {
  2075. return object == null ? undefined : object[key];
  2076. }
  2077. /**
  2078. * Checks if `string` contains Unicode symbols.
  2079. *
  2080. * @private
  2081. * @param {string} string The string to inspect.
  2082. * @returns {boolean} Returns `true` if a symbol is found, else `false`.
  2083. */
  2084. function hasUnicode(string) {
  2085. return reHasUnicode.test(string);
  2086. }
  2087. /**
  2088. * Checks if `string` contains a word composed of Unicode symbols.
  2089. *
  2090. * @private
  2091. * @param {string} string The string to inspect.
  2092. * @returns {boolean} Returns `true` if a word is found, else `false`.
  2093. */
  2094. function hasUnicodeWord(string) {
  2095. return reHasUnicodeWord.test(string);
  2096. }
  2097. /**
  2098. * Converts `iterator` to an array.
  2099. *
  2100. * @private
  2101. * @param {Object} iterator The iterator to convert.
  2102. * @returns {Array} Returns the converted array.
  2103. */
  2104. function iteratorToArray(iterator) {
  2105. var data,
  2106. result = [];
  2107. while (!(data = iterator.next()).done) {
  2108. result.push(data.value);
  2109. }
  2110. return result;
  2111. }
  2112. /**
  2113. * Converts `map` to its key-value pairs.
  2114. *
  2115. * @private
  2116. * @param {Object} map The map to convert.
  2117. * @returns {Array} Returns the key-value pairs.
  2118. */
  2119. function mapToArray(map) {
  2120. var index = -1,
  2121. result = Array(map.size);
  2122. map.forEach(function(value, key) {
  2123. result[++index] = [key, value];
  2124. });
  2125. return result;
  2126. }
  2127. /**
  2128. * Creates a unary function that invokes `func` with its argument transformed.
  2129. *
  2130. * @private
  2131. * @param {Function} func The function to wrap.
  2132. * @param {Function} transform The argument transform.
  2133. * @returns {Function} Returns the new function.
  2134. */
  2135. function overArg(func, transform) {
  2136. return function(arg) {
  2137. return func(transform(arg));
  2138. };
  2139. }
  2140. /**
  2141. * Replaces all `placeholder` elements in `array` with an internal placeholder
  2142. * and returns an array of their indexes.
  2143. *
  2144. * @private
  2145. * @param {Array} array The array to modify.
  2146. * @param {*} placeholder The placeholder to replace.
  2147. * @returns {Array} Returns the new array of placeholder indexes.
  2148. */
  2149. function replaceHolders(array, placeholder) {
  2150. var index = -1,
  2151. length = array.length,
  2152. resIndex = 0,
  2153. result = [];
  2154. while (++index < length) {
  2155. var value = array[index];
  2156. if (value === placeholder || value === PLACEHOLDER) {
  2157. array[index] = PLACEHOLDER;
  2158. result[resIndex++] = index;
  2159. }
  2160. }
  2161. return result;
  2162. }
  2163. /**
  2164. * Converts `set` to an array of its values.
  2165. *
  2166. * @private
  2167. * @param {Object} set The set to convert.
  2168. * @returns {Array} Returns the values.
  2169. */
  2170. function setToArray(set) {
  2171. var index = -1,
  2172. result = Array(set.size);
  2173. set.forEach(function(value) {
  2174. result[++index] = value;
  2175. });
  2176. return result;
  2177. }
  2178. /**
  2179. * Converts `set` to its value-value pairs.
  2180. *
  2181. * @private
  2182. * @param {Object} set The set to convert.
  2183. * @returns {Array} Returns the value-value pairs.
  2184. */
  2185. function setToPairs(set) {
  2186. var index = -1,
  2187. result = Array(set.size);
  2188. set.forEach(function(value) {
  2189. result[++index] = [value, value];
  2190. });
  2191. return result;
  2192. }
  2193. /**
  2194. * A specialized version of `_.indexOf` which performs strict equality
  2195. * comparisons of values, i.e. `===`.
  2196. *
  2197. * @private
  2198. * @param {Array} array The array to inspect.
  2199. * @param {*} value The value to search for.
  2200. * @param {number} fromIndex The index to search from.
  2201. * @returns {number} Returns the index of the matched value, else `-1`.
  2202. */
  2203. function strictIndexOf(array, value, fromIndex) {
  2204. var index = fromIndex - 1,
  2205. length = array.length;
  2206. while (++index < length) {
  2207. if (array[index] === value) {
  2208. return index;
  2209. }
  2210. }
  2211. return -1;
  2212. }
  2213. /**
  2214. * A specialized version of `_.lastIndexOf` which performs strict equality
  2215. * comparisons of values, i.e. `===`.
  2216. *
  2217. * @private
  2218. * @param {Array} array The array to inspect.
  2219. * @param {*} value The value to search for.
  2220. * @param {number} fromIndex The index to search from.
  2221. * @returns {number} Returns the index of the matched value, else `-1`.
  2222. */
  2223. function strictLastIndexOf(array, value, fromIndex) {
  2224. var index = fromIndex + 1;
  2225. while (index--) {
  2226. if (array[index] === value) {
  2227. return index;
  2228. }
  2229. }
  2230. return index;
  2231. }
  2232. /**
  2233. * Gets the number of symbols in `string`.
  2234. *
  2235. * @private
  2236. * @param {string} string The string to inspect.
  2237. * @returns {number} Returns the string size.
  2238. */
  2239. function stringSize(string) {
  2240. return hasUnicode(string)
  2241. ? unicodeSize(string)
  2242. : asciiSize(string);
  2243. }
  2244. /**
  2245. * Converts `string` to an array.
  2246. *
  2247. * @private
  2248. * @param {string} string The string to convert.
  2249. * @returns {Array} Returns the converted array.
  2250. */
  2251. function stringToArray(string) {
  2252. return hasUnicode(string)
  2253. ? unicodeToArray(string)
  2254. : asciiToArray(string);
  2255. }
  2256. /**
  2257. * Used by `_.trim` and `_.trimEnd` to get the index of the last non-whitespace
  2258. * character of `string`.
  2259. *
  2260. * @private
  2261. * @param {string} string The string to inspect.
  2262. * @returns {number} Returns the index of the last non-whitespace character.
  2263. */
  2264. function trimmedEndIndex(string) {
  2265. var index = string.length;
  2266. while (index-- && reWhitespace.test(string.charAt(index))) {}
  2267. return index;
  2268. }
  2269. /**
  2270. * Used by `_.unescape` to convert HTML entities to characters.
  2271. *
  2272. * @private
  2273. * @param {string} chr The matched character to unescape.
  2274. * @returns {string} Returns the unescaped character.
  2275. */
  2276. var unescapeHtmlChar = basePropertyOf(htmlUnescapes);
  2277. /**
  2278. * Gets the size of a Unicode `string`.
  2279. *
  2280. * @private
  2281. * @param {string} string The string inspect.
  2282. * @returns {number} Returns the string size.
  2283. */
  2284. function unicodeSize(string) {
  2285. var result = reUnicode.lastIndex = 0;
  2286. while (reUnicode.test(string)) {
  2287. ++result;
  2288. }
  2289. return result;
  2290. }
  2291. /**
  2292. * Converts a Unicode `string` to an array.
  2293. *
  2294. * @private
  2295. * @param {string} string The string to convert.
  2296. * @returns {Array} Returns the converted array.
  2297. */
  2298. function unicodeToArray(string) {
  2299. return string.match(reUnicode) || [];
  2300. }
  2301. /**
  2302. * Splits a Unicode `string` into an array of its words.
  2303. *
  2304. * @private
  2305. * @param {string} The string to inspect.
  2306. * @returns {Array} Returns the words of `string`.
  2307. */
  2308. function unicodeWords(string) {
  2309. return string.match(reUnicodeWord) || [];
  2310. }
  2311. /*--------------------------------------------------------------------------*/
  2312. /**
  2313. * Create a new pristine `lodash` function using the `context` object.
  2314. *
  2315. * @static
  2316. * @memberOf _
  2317. * @since 1.1.0
  2318. * @category Util
  2319. * @param {Object} [context=root] The context object.
  2320. * @returns {Function} Returns a new `lodash` function.
  2321. * @example
  2322. *
  2323. * _.mixin({ 'foo': _.constant('foo') });
  2324. *
  2325. * var lodash = _.runInContext();
  2326. * lodash.mixin({ 'bar': lodash.constant('bar') });
  2327. *
  2328. * _.isFunction(_.foo);
  2329. * // => true
  2330. * _.isFunction(_.bar);
  2331. * // => false
  2332. *
  2333. * lodash.isFunction(lodash.foo);
  2334. * // => false
  2335. * lodash.isFunction(lodash.bar);
  2336. * // => true
  2337. *
  2338. * // Create a suped-up `defer` in Node.js.
  2339. * var defer = _.runInContext({ 'setTimeout': setImmediate }).defer;
  2340. */
  2341. var runInContext = (function runInContext(context) {
  2342. context = context == null ? root : _.defaults(root.Object(), context, _.pick(root, contextProps));
  2343. /** Built-in constructor references. */
  2344. var Array = context.Array,
  2345. Date = context.Date,
  2346. Error = context.Error,
  2347. Function = context.Function,
  2348. Math = context.Math,
  2349. Object = context.Object,
  2350. RegExp = context.RegExp,
  2351. String = context.String,
  2352. TypeError = context.TypeError;
  2353. /** Used for built-in method references. */
  2354. var arrayProto = Array.prototype,
  2355. funcProto = Function.prototype,
  2356. objectProto = Object.prototype;
  2357. /** Used to detect overreaching core-js shims. */
  2358. var coreJsData = context['__core-js_shared__'];
  2359. /** Used to resolve the decompiled source of functions. */
  2360. var funcToString = funcProto.toString;
  2361. /** Used to check objects for own properties. */
  2362. var hasOwnProperty = objectProto.hasOwnProperty;
  2363. /** Used to generate unique IDs. */
  2364. var idCounter = 0;
  2365. /** Used to detect methods masquerading as native. */
  2366. var maskSrcKey = (function() {
  2367. var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || '');
  2368. return uid ? ('Symbol(src)_1.' + uid) : '';
  2369. }());
  2370. /**
  2371. * Used to resolve the
  2372. * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
  2373. * of values.
  2374. */
  2375. var nativeObjectToString = objectProto.toString;
  2376. /** Used to infer the `Object` constructor. */
  2377. var objectCtorString = funcToString.call(Object);
  2378. /** Used to restore the original `_` reference in `_.noConflict`. */
  2379. var oldDash = root._;
  2380. /** Used to detect if a method is native. */
  2381. var reIsNative = RegExp('^' +
  2382. funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\$&')
  2383. .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$'
  2384. );
  2385. /** Built-in value references. */
  2386. var Buffer = moduleExports ? context.Buffer : undefined,
  2387. Symbol = context.Symbol,
  2388. Uint8Array = context.Uint8Array,
  2389. allocUnsafe = Buffer ? Buffer.allocUnsafe : undefined,
  2390. getPrototype = overArg(Object.getPrototypeOf, Object),
  2391. objectCreate = Object.create,
  2392. propertyIsEnumerable = objectProto.propertyIsEnumerable,
  2393. splice = arrayProto.splice,
  2394. spreadableSymbol = Symbol ? Symbol.isConcatSpreadable : undefined,
  2395. symIterator = Symbol ? Symbol.iterator : undefined,
  2396. symToStringTag = Symbol ? Symbol.toStringTag : undefined;
  2397. var defineProperty = (function() {
  2398. try {
  2399. var func = getNative(Object, 'defineProperty');
  2400. func({}, '', {});
  2401. return func;
  2402. } catch (e) {}
  2403. }());
  2404. /** Mocked built-ins. */
  2405. var ctxClearTimeout = context.clearTimeout !== root.clearTimeout && context.clearTimeout,
  2406. ctxNow = Date && Date.now !== root.Date.now && Date.now,
  2407. ctxSetTimeout = context.setTimeout !== root.setTimeout && context.setTimeout;
  2408. /* Built-in method references for those with the same name as other `lodash` methods. */
  2409. var nativeCeil = Math.ceil,
  2410. nativeFloor = Math.floor,
  2411. nativeGetSymbols = Object.getOwnPropertySymbols,
  2412. nativeIsBuffer = Buffer ? Buffer.isBuffer : undefined,
  2413. nativeIsFinite = context.isFinite,
  2414. nativeJoin = arrayProto.join,
  2415. nativeKeys = overArg(Object.keys, Object),
  2416. nativeMax = Math.max,
  2417. nativeMin = Math.min,
  2418. nativeNow = Date.now,
  2419. nativeParseInt = context.parseInt,
  2420. nativeRandom = Math.random,
  2421. nativeReverse = arrayProto.reverse;
  2422. /* Built-in method references that are verified to be native. */
  2423. var DataView = getNative(context, 'DataView'),
  2424. Map = getNative(context, 'Map'),
  2425. Promise = getNative(context, 'Promise'),
  2426. Set = getNative(context, 'Set'),
  2427. WeakMap = getNative(context, 'WeakMap'),
  2428. nativeCreate = getNative(Object, 'create');
  2429. /** Used to store function metadata. */
  2430. var metaMap = WeakMap && new WeakMap;
  2431. /** Used to lookup unminified function names. */
  2432. var realNames = {};
  2433. /** Used to detect maps, sets, and weakmaps. */
  2434. var dataViewCtorString = toSource(DataView),
  2435. mapCtorString = toSource(Map),
  2436. promiseCtorString = toSource(Promise),
  2437. setCtorString = toSource(Set),
  2438. weakMapCtorString = toSource(WeakMap);
  2439. /** Used to convert symbols to primitives and strings. */
  2440. var symbolProto = Symbol ? Symbol.prototype : undefined,
  2441. symbolValueOf = symbolProto ? symbolProto.valueOf : undefined,
  2442. symbolToString = symbolProto ? symbolProto.toString : undefined;
  2443. /*------------------------------------------------------------------------*/
  2444. /**
  2445. * Creates a `lodash` object which wraps `value` to enable implicit method
  2446. * chain sequences. Methods that operate on and return arrays, collections,
  2447. * and functions can be chained together. Methods that retrieve a single value
  2448. * or may return a primitive value will automatically end the chain sequence
  2449. * and return the unwrapped value. Otherwise, the value must be unwrapped
  2450. * with `_#value`.
  2451. *
  2452. * Explicit chain sequences, which must be unwrapped with `_#value`, may be
  2453. * enabled using `_.chain`.
  2454. *
  2455. * The execution of chained methods is lazy, that is, it's deferred until
  2456. * `_#value` is implicitly or explicitly called.
  2457. *
  2458. * Lazy evaluation allows several methods to support shortcut fusion.
  2459. * Shortcut fusion is an optimization to merge iteratee calls; this avoids
  2460. * the creation of intermediate arrays and can greatly reduce the number of
  2461. * iteratee executions. Sections of a chain sequence qualify for shortcut
  2462. * fusion if the section is applied to an array and iteratees accept only
  2463. * one argument. The heuristic for whether a section qualifies for shortcut
  2464. * fusion is subject to change.
  2465. *
  2466. * Chaining is supported in custom builds as long as the `_#value` method is
  2467. * directly or indirectly included in the build.
  2468. *
  2469. * In addition to lodash methods, wrappers have `Array` and `String` methods.
  2470. *
  2471. * The wrapper `Array` methods are:
  2472. * `concat`, `join`, `pop`, `push`, `shift`, `sort`, `splice`, and `unshift`
  2473. *
  2474. * The wrapper `String` methods are:
  2475. * `replace` and `split`
  2476. *
  2477. * The wrapper methods that support shortcut fusion are:
  2478. * `at`, `compact`, `drop`, `dropRight`, `dropWhile`, `filter`, `find`,
  2479. * `findLast`, `head`, `initial`, `last`, `map`, `reject`, `reverse`, `slice`,
  2480. * `tail`, `take`, `takeRight`, `takeRightWhile`, `takeWhile`, and `toArray`
  2481. *
  2482. * The chainable wrapper methods are:
  2483. * `after`, `ary`, `assign`, `assignIn`, `assignInWith`, `assignWith`, `at`,
  2484. * `before`, `bind`, `bindAll`, `bindKey`, `castArray`, `chain`, `chunk`,
  2485. * `commit`, `compact`, `concat`, `conforms`, `constant`, `countBy`, `create`,
  2486. * `curry`, `debounce`, `defaults`, `defaultsDeep`, `defer`, `delay`,
  2487. * `difference`, `differenceBy`, `differenceWith`, `drop`, `dropRight`,
  2488. * `dropRightWhile`, `dropWhile`, `extend`, `extendWith`, `fill`, `filter`,
  2489. * `flatMap`, `flatMapDeep`, `flatMapDepth`, `flatten`, `flattenDeep`,
  2490. * `flattenDepth`, `flip`, `flow`, `flowRight`, `fromPairs`, `functions`,
  2491. * `functionsIn`, `groupBy`, `initial`, `intersection`, `intersectionBy`,
  2492. * `intersectionWith`, `invert`, `invertBy`, `invokeMap`, `iteratee`, `keyBy`,
  2493. * `keys`, `keysIn`, `map`, `mapKeys`, `mapValues`, `matches`, `matchesProperty`,
  2494. * `memoize`, `merge`, `mergeWith`, `method`, `methodOf`, `mixin`, `negate`,
  2495. * `nthArg`, `omit`, `omitBy`, `once`, `orderBy`, `over`, `overArgs`,
  2496. * `overEvery`, `overSome`, `partial`, `partialRight`, `partition`, `pick`,
  2497. * `pickBy`, `plant`, `property`, `propertyOf`, `pull`, `pullAll`, `pullAllBy`,
  2498. * `pullAllWith`, `pullAt`, `push`, `range`, `rangeRight`, `rearg`, `reject`,
  2499. * `remove`, `rest`, `reverse`, `sampleSize`, `set`, `setWith`, `shuffle`,
  2500. * `slice`, `sort`, `sortBy`, `splice`, `spread`, `tail`, `take`, `takeRight`,
  2501. * `takeRightWhile`, `takeWhile`, `tap`, `throttle`, `thru`, `toArray`,
  2502. * `toPairs`, `toPairsIn`, `toPath`, `toPlainObject`, `transform`, `unary`,
  2503. * `union`, `unionBy`, `unionWith`, `uniq`, `uniqBy`, `uniqWith`, `unset`,
  2504. * `unshift`, `unzip`, `unzipWith`, `update`, `updateWith`, `values`,
  2505. * `valuesIn`, `without`, `wrap`, `xor`, `xorBy`, `xorWith`, `zip`,
  2506. * `zipObject`, `zipObjectDeep`, and `zipWith`
  2507. *
  2508. * The wrapper methods that are **not** chainable by default are:
  2509. * `add`, `attempt`, `camelCase`, `capitalize`, `ceil`, `clamp`, `clone`,
  2510. * `cloneDeep`, `cloneDeepWith`, `cloneWith`, `conformsTo`, `deburr`,
  2511. * `defaultTo`, `divide`, `each`, `eachRight`, `endsWith`, `eq`, `escape`,
  2512. * `escapeRegExp`, `every`, `find`, `findIndex`, `findKey`, `findLast`,
  2513. * `findLastIndex`, `findLastKey`, `first`, `floor`, `forEach`, `forEachRight`,
  2514. * `forIn`, `forInRight`, `forOwn`, `forOwnRight`, `get`, `gt`, `gte`, `has`,
  2515. * `hasIn`, `head`, `identity`, `includes`, `indexOf`, `inRange`, `invoke`,
  2516. * `isArguments`, `isArray`, `isArrayBuffer`, `isArrayLike`, `isArrayLikeObject`,
  2517. * `isBoolean`, `isBuffer`, `isDate`, `isElement`, `isEmpty`, `isEqual`,
  2518. * `isEqualWith`, `isError`, `isFinite`, `isFunction`, `isInteger`, `isLength`,
  2519. * `isMap`, `isMatch`, `isMatchWith`, `isNaN`, `isNative`, `isNil`, `isNull`,
  2520. * `isNumber`, `isObject`, `isObjectLike`, `isPlainObject`, `isRegExp`,
  2521. * `isSafeInteger`, `isSet`, `isString`, `isUndefined`, `isTypedArray`,
  2522. * `isWeakMap`, `isWeakSet`, `join`, `kebabCase`, `last`, `lastIndexOf`,
  2523. * `lowerCase`, `lowerFirst`, `lt`, `lte`, `max`, `maxBy`, `mean`, `meanBy`,
  2524. * `min`, `minBy`, `multiply`, `noConflict`, `noop`, `now`, `nth`, `pad`,
  2525. * `padEnd`, `padStart`, `parseInt`, `pop`, `random`, `reduce`, `reduceRight`,
  2526. * `repeat`, `result`, `round`, `runInContext`, `sample`, `shift`, `size`,
  2527. * `snakeCase`, `some`, `sortedIndex`, `sortedIndexBy`, `sortedLastIndex`,
  2528. * `sortedLastIndexBy`, `startCase`, `startsWith`, `stubArray`, `stubFalse`,
  2529. * `stubObject`, `stubString`, `stubTrue`, `subtract`, `sum`, `sumBy`,
  2530. * `template`, `times`, `toFinite`, `toInteger`, `toJSON`, `toLength`,
  2531. * `toLower`, `toNumber`, `toSafeInteger`, `toString`, `toUpper`, `trim`,
  2532. * `trimEnd`, `trimStart`, `truncate`, `unescape`, `uniqueId`, `upperCase`,
  2533. * `upperFirst`, `value`, and `words`
  2534. *
  2535. * @name _
  2536. * @constructor
  2537. * @category Seq
  2538. * @param {*} value The value to wrap in a `lodash` instance.
  2539. * @returns {Object} Returns the new `lodash` wrapper instance.
  2540. * @example
  2541. *
  2542. * function square(n) {
  2543. * return n * n;
  2544. * }
  2545. *
  2546. * var wrapped = _([1, 2, 3]);
  2547. *
  2548. * // Returns an unwrapped value.
  2549. * wrapped.reduce(_.add);
  2550. * // => 6
  2551. *
  2552. * // Returns a wrapped value.
  2553. * var squares = wrapped.map(square);
  2554. *
  2555. * _.isArray(squares);
  2556. * // => false
  2557. *
  2558. * _.isArray(squares.value());
  2559. * // => true
  2560. */
  2561. function lodash(value) {
  2562. if (isObjectLike(value) && !isArray(value) && !(value instanceof LazyWrapper)) {
  2563. if (value instanceof LodashWrapper) {
  2564. return value;
  2565. }
  2566. if (hasOwnProperty.call(value, '__wrapped__')) {
  2567. return wrapperClone(value);
  2568. }
  2569. }
  2570. return new LodashWrapper(value);
  2571. }
  2572. /**
  2573. * The base implementation of `_.create` without support for assigning
  2574. * properties to the created object.
  2575. *
  2576. * @private
  2577. * @param {Object} proto The object to inherit from.
  2578. * @returns {Object} Returns the new object.
  2579. */
  2580. var baseCreate = (function() {
  2581. function object() {}
  2582. return function(proto) {
  2583. if (!isObject(proto)) {
  2584. return {};
  2585. }
  2586. if (objectCreate) {
  2587. return objectCreate(proto);
  2588. }
  2589. object.prototype = proto;
  2590. var result = new object;
  2591. object.prototype = undefined;
  2592. return result;
  2593. };
  2594. }());
  2595. /**
  2596. * The function whose prototype chain sequence wrappers inherit from.
  2597. *
  2598. * @private
  2599. */
  2600. function baseLodash() {
  2601. // No operation performed.
  2602. }
  2603. /**
  2604. * The base constructor for creating `lodash` wrapper objects.
  2605. *
  2606. * @private
  2607. * @param {*} value The value to wrap.
  2608. * @param {boolean} [chainAll] Enable explicit method chain sequences.
  2609. */
  2610. function LodashWrapper(value, chainAll) {
  2611. this.__wrapped__ = value;
  2612. this.__actions__ = [];
  2613. this.__chain__ = !!chainAll;
  2614. this.__index__ = 0;
  2615. this.__values__ = undefined;
  2616. }
  2617. /**
  2618. * By default, the template delimiters used by lodash are like those in
  2619. * embedded Ruby (ERB) as well as ES2015 template strings. Change the
  2620. * following template settings to use alternative delimiters.
  2621. *
  2622. * @static
  2623. * @memberOf _
  2624. * @type {Object}
  2625. */
  2626. lodash.templateSettings = {
  2627. /**
  2628. * Used to detect `data` property values to be HTML-escaped.
  2629. *
  2630. * @memberOf _.templateSettings
  2631. * @type {RegExp}
  2632. */
  2633. 'escape': reEscape,
  2634. /**
  2635. * Used to detect code to be evaluated.
  2636. *
  2637. * @memberOf _.templateSettings
  2638. * @type {RegExp}
  2639. */
  2640. 'evaluate': reEvaluate,
  2641. /**
  2642. * Used to detect `data` property values to inject.
  2643. *
  2644. * @memberOf _.templateSettings
  2645. * @type {RegExp}
  2646. */
  2647. 'interpolate': reInterpolate,
  2648. /**
  2649. * Used to reference the data object in the template text.
  2650. *
  2651. * @memberOf _.templateSettings
  2652. * @type {string}
  2653. */
  2654. 'variable': '',
  2655. /**
  2656. * Used to import variables into the compiled template.
  2657. *
  2658. * @memberOf _.templateSettings
  2659. * @type {Object}
  2660. */
  2661. 'imports': {
  2662. /**
  2663. * A reference to the `lodash` function.
  2664. *
  2665. * @memberOf _.templateSettings.imports
  2666. * @type {Function}
  2667. */
  2668. '_': lodash
  2669. }
  2670. };
  2671. // Ensure wrappers are instances of `baseLodash`.
  2672. lodash.prototype = baseLodash.prototype;
  2673. lodash.prototype.constructor = lodash;
  2674. LodashWrapper.prototype = baseCreate(baseLodash.prototype);
  2675. LodashWrapper.prototype.constructor = LodashWrapper;
  2676. /*------------------------------------------------------------------------*/
  2677. /**
  2678. * Creates a lazy wrapper object which wraps `value` to enable lazy evaluation.
  2679. *
  2680. * @private
  2681. * @constructor
  2682. * @param {*} value The value to wrap.
  2683. */
  2684. function LazyWrapper(value) {
  2685. this.__wrapped__ = value;
  2686. this.__actions__ = [];
  2687. this.__dir__ = 1;
  2688. this.__filtered__ = false;
  2689. this.__iteratees__ = [];
  2690. this.__takeCount__ = MAX_ARRAY_LENGTH;
  2691. this.__views__ = [];
  2692. }
  2693. /**
  2694. * Creates a clone of the lazy wrapper object.
  2695. *
  2696. * @private
  2697. * @name clone
  2698. * @memberOf LazyWrapper
  2699. * @returns {Object} Returns the cloned `LazyWrapper` object.
  2700. */
  2701. function lazyClone() {
  2702. var result = new LazyWrapper(this.__wrapped__);
  2703. result.__actions__ = copyArray(this.__actions__);
  2704. result.__dir__ = this.__dir__;
  2705. result.__filtered__ = this.__filtered__;
  2706. result.__iteratees__ = copyArray(this.__iteratees__);
  2707. result.__takeCount__ = this.__takeCount__;
  2708. result.__views__ = copyArray(this.__views__);
  2709. return result;
  2710. }
  2711. /**
  2712. * Reverses the direction of lazy iteration.
  2713. *
  2714. * @private
  2715. * @name reverse
  2716. * @memberOf LazyWrapper
  2717. * @returns {Object} Returns the new reversed `LazyWrapper` object.
  2718. */
  2719. function lazyReverse() {
  2720. if (this.__filtered__) {
  2721. var result = new LazyWrapper(this);
  2722. result.__dir__ = -1;
  2723. result.__filtered__ = true;
  2724. } else {
  2725. result = this.clone();
  2726. result.__dir__ *= -1;
  2727. }
  2728. return result;
  2729. }
  2730. /**
  2731. * Extracts the unwrapped value from its lazy wrapper.
  2732. *
  2733. * @private
  2734. * @name value
  2735. * @memberOf LazyWrapper
  2736. * @returns {*} Returns the unwrapped value.
  2737. */
  2738. function lazyValue() {
  2739. var array = this.__wrapped__.value(),
  2740. dir = this.__dir__,
  2741. isArr = isArray(array),
  2742. isRight = dir < 0,
  2743. arrLength = isArr ? array.length : 0,
  2744. view = getView(0, arrLength, this.__views__),
  2745. start = view.start,
  2746. end = view.end,
  2747. length = end - start,
  2748. index = isRight ? end : (start - 1),
  2749. iteratees = this.__iteratees__,
  2750. iterLength = iteratees.length,
  2751. resIndex = 0,
  2752. takeCount = nativeMin(length, this.__takeCount__);
  2753. if (!isArr || (!isRight && arrLength == length && takeCount == length)) {
  2754. return baseWrapperValue(array, this.__actions__);
  2755. }
  2756. var result = [];
  2757. outer:
  2758. while (length-- && resIndex < takeCount) {
  2759. index += dir;
  2760. var iterIndex = -1,
  2761. value = array[index];
  2762. while (++iterIndex < iterLength) {
  2763. var data = iteratees[iterIndex],
  2764. iteratee = data.iteratee,
  2765. type = data.type,
  2766. computed = iteratee(value);
  2767. if (type == LAZY_MAP_FLAG) {
  2768. value = computed;
  2769. } else if (!computed) {
  2770. if (type == LAZY_FILTER_FLAG) {
  2771. continue outer;
  2772. } else {
  2773. break outer;
  2774. }
  2775. }
  2776. }
  2777. result[resIndex++] = value;
  2778. }
  2779. return result;
  2780. }
  2781. // Ensure `LazyWrapper` is an instance of `baseLodash`.
  2782. LazyWrapper.prototype = baseCreate(baseLodash.prototype);
  2783. LazyWrapper.prototype.constructor = LazyWrapper;
  2784. /*------------------------------------------------------------------------*/
  2785. /**
  2786. * Creates a hash object.
  2787. *
  2788. * @private
  2789. * @constructor
  2790. * @param {Array} [entries] The key-value pairs to cache.
  2791. */
  2792. function Hash(entries) {
  2793. var index = -1,
  2794. length = entries == null ? 0 : entries.length;
  2795. this.clear();
  2796. while (++index < length) {
  2797. var entry = entries[index];
  2798. this.set(entry[0], entry[1]);
  2799. }
  2800. }
  2801. /**
  2802. * Removes all key-value entries from the hash.
  2803. *
  2804. * @private
  2805. * @name clear
  2806. * @memberOf Hash
  2807. */
  2808. function hashClear() {
  2809. this.__data__ = nativeCreate ? nativeCreate(null) : {};
  2810. this.size = 0;
  2811. }
  2812. /**
  2813. * Removes `key` and its value from the hash.
  2814. *
  2815. * @private
  2816. * @name delete
  2817. * @memberOf Hash
  2818. * @param {Object} hash The hash to modify.
  2819. * @param {string} key The key of the value to remove.
  2820. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  2821. */
  2822. function hashDelete(key) {
  2823. var result = this.has(key) && delete this.__data__[key];
  2824. this.size -= result ? 1 : 0;
  2825. return result;
  2826. }
  2827. /**
  2828. * Gets the hash value for `key`.
  2829. *
  2830. * @private
  2831. * @name get
  2832. * @memberOf Hash
  2833. * @param {string} key The key of the value to get.
  2834. * @returns {*} Returns the entry value.
  2835. */
  2836. function hashGet(key) {
  2837. var data = this.__data__;
  2838. if (nativeCreate) {
  2839. var result = data[key];
  2840. return result === HASH_UNDEFINED ? undefined : result;
  2841. }
  2842. return hasOwnProperty.call(data, key) ? data[key] : undefined;
  2843. }
  2844. /**
  2845. * Checks if a hash value for `key` exists.
  2846. *
  2847. * @private
  2848. * @name has
  2849. * @memberOf Hash
  2850. * @param {string} key The key of the entry to check.
  2851. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  2852. */
  2853. function hashHas(key) {
  2854. var data = this.__data__;
  2855. return nativeCreate ? (data[key] !== undefined) : hasOwnProperty.call(data, key);
  2856. }
  2857. /**
  2858. * Sets the hash `key` to `value`.
  2859. *
  2860. * @private
  2861. * @name set
  2862. * @memberOf Hash
  2863. * @param {string} key The key of the value to set.
  2864. * @param {*} value The value to set.
  2865. * @returns {Object} Returns the hash instance.
  2866. */
  2867. function hashSet(key, value) {
  2868. var data = this.__data__;
  2869. this.size += this.has(key) ? 0 : 1;
  2870. data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value;
  2871. return this;
  2872. }
  2873. // Add methods to `Hash`.
  2874. Hash.prototype.clear = hashClear;
  2875. Hash.prototype['delete'] = hashDelete;
  2876. Hash.prototype.get = hashGet;
  2877. Hash.prototype.has = hashHas;
  2878. Hash.prototype.set = hashSet;
  2879. /*------------------------------------------------------------------------*/
  2880. /**
  2881. * Creates an list cache object.
  2882. *
  2883. * @private
  2884. * @constructor
  2885. * @param {Array} [entries] The key-value pairs to cache.
  2886. */
  2887. function ListCache(entries) {
  2888. var index = -1,
  2889. length = entries == null ? 0 : entries.length;
  2890. this.clear();
  2891. while (++index < length) {
  2892. var entry = entries[index];
  2893. this.set(entry[0], entry[1]);
  2894. }
  2895. }
  2896. /**
  2897. * Removes all key-value entries from the list cache.
  2898. *
  2899. * @private
  2900. * @name clear
  2901. * @memberOf ListCache
  2902. */
  2903. function listCacheClear() {
  2904. this.__data__ = [];
  2905. this.size = 0;
  2906. }
  2907. /**
  2908. * Removes `key` and its value from the list cache.
  2909. *
  2910. * @private
  2911. * @name delete
  2912. * @memberOf ListCache
  2913. * @param {string} key The key of the value to remove.
  2914. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  2915. */
  2916. function listCacheDelete(key) {
  2917. var data = this.__data__,
  2918. index = assocIndexOf(data, key);
  2919. if (index < 0) {
  2920. return false;
  2921. }
  2922. var lastIndex = data.length - 1;
  2923. if (index == lastIndex) {
  2924. data.pop();
  2925. } else {
  2926. splice.call(data, index, 1);
  2927. }
  2928. --this.size;
  2929. return true;
  2930. }
  2931. /**
  2932. * Gets the list cache value for `key`.
  2933. *
  2934. * @private
  2935. * @name get
  2936. * @memberOf ListCache
  2937. * @param {string} key The key of the value to get.
  2938. * @returns {*} Returns the entry value.
  2939. */
  2940. function listCacheGet(key) {
  2941. var data = this.__data__,
  2942. index = assocIndexOf(data, key);
  2943. return index < 0 ? undefined : data[index][1];
  2944. }
  2945. /**
  2946. * Checks if a list cache value for `key` exists.
  2947. *
  2948. * @private
  2949. * @name has
  2950. * @memberOf ListCache
  2951. * @param {string} key The key of the entry to check.
  2952. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  2953. */
  2954. function listCacheHas(key) {
  2955. return assocIndexOf(this.__data__, key) > -1;
  2956. }
  2957. /**
  2958. * Sets the list cache `key` to `value`.
  2959. *
  2960. * @private
  2961. * @name set
  2962. * @memberOf ListCache
  2963. * @param {string} key The key of the value to set.
  2964. * @param {*} value The value to set.
  2965. * @returns {Object} Returns the list cache instance.
  2966. */
  2967. function listCacheSet(key, value) {
  2968. var data = this.__data__,
  2969. index = assocIndexOf(data, key);
  2970. if (index < 0) {
  2971. ++this.size;
  2972. data.push([key, value]);
  2973. } else {
  2974. data[index][1] = value;
  2975. }
  2976. return this;
  2977. }
  2978. // Add methods to `ListCache`.
  2979. ListCache.prototype.clear = listCacheClear;
  2980. ListCache.prototype['delete'] = listCacheDelete;
  2981. ListCache.prototype.get = listCacheGet;
  2982. ListCache.prototype.has = listCacheHas;
  2983. ListCache.prototype.set = listCacheSet;
  2984. /*------------------------------------------------------------------------*/
  2985. /**
  2986. * Creates a map cache object to store key-value pairs.
  2987. *
  2988. * @private
  2989. * @constructor
  2990. * @param {Array} [entries] The key-value pairs to cache.
  2991. */
  2992. function MapCache(entries) {
  2993. var index = -1,
  2994. length = entries == null ? 0 : entries.length;
  2995. this.clear();
  2996. while (++index < length) {
  2997. var entry = entries[index];
  2998. this.set(entry[0], entry[1]);
  2999. }
  3000. }
  3001. /**
  3002. * Removes all key-value entries from the map.
  3003. *
  3004. * @private
  3005. * @name clear
  3006. * @memberOf MapCache
  3007. */
  3008. function mapCacheClear() {
  3009. this.size = 0;
  3010. this.__data__ = {
  3011. 'hash': new Hash,
  3012. 'map': new (Map || ListCache),
  3013. 'string': new Hash
  3014. };
  3015. }
  3016. /**
  3017. * Removes `key` and its value from the map.
  3018. *
  3019. * @private
  3020. * @name delete
  3021. * @memberOf MapCache
  3022. * @param {string} key The key of the value to remove.
  3023. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  3024. */
  3025. function mapCacheDelete(key) {
  3026. var result = getMapData(this, key)['delete'](key);
  3027. this.size -= result ? 1 : 0;
  3028. return result;
  3029. }
  3030. /**
  3031. * Gets the map value for `key`.
  3032. *
  3033. * @private
  3034. * @name get
  3035. * @memberOf MapCache
  3036. * @param {string} key The key of the value to get.
  3037. * @returns {*} Returns the entry value.
  3038. */
  3039. function mapCacheGet(key) {
  3040. return getMapData(this, key).get(key);
  3041. }
  3042. /**
  3043. * Checks if a map value for `key` exists.
  3044. *
  3045. * @private
  3046. * @name has
  3047. * @memberOf MapCache
  3048. * @param {string} key The key of the entry to check.
  3049. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  3050. */
  3051. function mapCacheHas(key) {
  3052. return getMapData(this, key).has(key);
  3053. }
  3054. /**
  3055. * Sets the map `key` to `value`.
  3056. *
  3057. * @private
  3058. * @name set
  3059. * @memberOf MapCache
  3060. * @param {string} key The key of the value to set.
  3061. * @param {*} value The value to set.
  3062. * @returns {Object} Returns the map cache instance.
  3063. */
  3064. function mapCacheSet(key, value) {
  3065. var data = getMapData(this, key),
  3066. size = data.size;
  3067. data.set(key, value);
  3068. this.size += data.size == size ? 0 : 1;
  3069. return this;
  3070. }
  3071. // Add methods to `MapCache`.
  3072. MapCache.prototype.clear = mapCacheClear;
  3073. MapCache.prototype['delete'] = mapCacheDelete;
  3074. MapCache.prototype.get = mapCacheGet;
  3075. MapCache.prototype.has = mapCacheHas;
  3076. MapCache.prototype.set = mapCacheSet;
  3077. /*------------------------------------------------------------------------*/
  3078. /**
  3079. *
  3080. * Creates an array cache object to store unique values.
  3081. *
  3082. * @private
  3083. * @constructor
  3084. * @param {Array} [values] The values to cache.
  3085. */
  3086. function SetCache(values) {
  3087. var index = -1,
  3088. length = values == null ? 0 : values.length;
  3089. this.__data__ = new MapCache;
  3090. while (++index < length) {
  3091. this.add(values[index]);
  3092. }
  3093. }
  3094. /**
  3095. * Adds `value` to the array cache.
  3096. *
  3097. * @private
  3098. * @name add
  3099. * @memberOf SetCache
  3100. * @alias push
  3101. * @param {*} value The value to cache.
  3102. * @returns {Object} Returns the cache instance.
  3103. */
  3104. function setCacheAdd(value) {
  3105. this.__data__.set(value, HASH_UNDEFINED);
  3106. return this;
  3107. }
  3108. /**
  3109. * Checks if `value` is in the array cache.
  3110. *
  3111. * @private
  3112. * @name has
  3113. * @memberOf SetCache
  3114. * @param {*} value The value to search for.
  3115. * @returns {number} Returns `true` if `value` is found, else `false`.
  3116. */
  3117. function setCacheHas(value) {
  3118. return this.__data__.has(value);
  3119. }
  3120. // Add methods to `SetCache`.
  3121. SetCache.prototype.add = SetCache.prototype.push = setCacheAdd;
  3122. SetCache.prototype.has = setCacheHas;
  3123. /*------------------------------------------------------------------------*/
  3124. /**
  3125. * Creates a stack cache object to store key-value pairs.
  3126. *
  3127. * @private
  3128. * @constructor
  3129. * @param {Array} [entries] The key-value pairs to cache.
  3130. */
  3131. function Stack(entries) {
  3132. var data = this.__data__ = new ListCache(entries);
  3133. this.size = data.size;
  3134. }
  3135. /**
  3136. * Removes all key-value entries from the stack.
  3137. *
  3138. * @private
  3139. * @name clear
  3140. * @memberOf Stack
  3141. */
  3142. function stackClear() {
  3143. this.__data__ = new ListCache;
  3144. this.size = 0;
  3145. }
  3146. /**
  3147. * Removes `key` and its value from the stack.
  3148. *
  3149. * @private
  3150. * @name delete
  3151. * @memberOf Stack
  3152. * @param {string} key The key of the value to remove.
  3153. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  3154. */
  3155. function stackDelete(key) {
  3156. var data = this.__data__,
  3157. result = data['delete'](key);
  3158. this.size = data.size;
  3159. return result;
  3160. }
  3161. /**
  3162. * Gets the stack value for `key`.
  3163. *
  3164. * @private
  3165. * @name get
  3166. * @memberOf Stack
  3167. * @param {string} key The key of the value to get.
  3168. * @returns {*} Returns the entry value.
  3169. */
  3170. function stackGet(key) {
  3171. return this.__data__.get(key);
  3172. }
  3173. /**
  3174. * Checks if a stack value for `key` exists.
  3175. *
  3176. * @private
  3177. * @name has
  3178. * @memberOf Stack
  3179. * @param {string} key The key of the entry to check.
  3180. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  3181. */
  3182. function stackHas(key) {
  3183. return this.__data__.has(key);
  3184. }
  3185. /**
  3186. * Sets the stack `key` to `value`.
  3187. *
  3188. * @private
  3189. * @name set
  3190. * @memberOf Stack
  3191. * @param {string} key The key of the value to set.
  3192. * @param {*} value The value to set.
  3193. * @returns {Object} Returns the stack cache instance.
  3194. */
  3195. function stackSet(key, value) {
  3196. var data = this.__data__;
  3197. if (data instanceof ListCache) {
  3198. var pairs = data.__data__;
  3199. if (!Map || (pairs.length < LARGE_ARRAY_SIZE - 1)) {
  3200. pairs.push([key, value]);
  3201. this.size = ++data.size;
  3202. return this;
  3203. }
  3204. data = this.__data__ = new MapCache(pairs);
  3205. }
  3206. data.set(key, value);
  3207. this.size = data.size;
  3208. return this;
  3209. }
  3210. // Add methods to `Stack`.
  3211. Stack.prototype.clear = stackClear;
  3212. Stack.prototype['delete'] = stackDelete;
  3213. Stack.prototype.get = stackGet;
  3214. Stack.prototype.has = stackHas;
  3215. Stack.prototype.set = stackSet;
  3216. /*------------------------------------------------------------------------*/
  3217. /**
  3218. * Creates an array of the enumerable property names of the array-like `value`.
  3219. *
  3220. * @private
  3221. * @param {*} value The value to query.
  3222. * @param {boolean} inherited Specify returning inherited property names.
  3223. * @returns {Array} Returns the array of property names.
  3224. */
  3225. function arrayLikeKeys(value, inherited) {
  3226. var isArr = isArray(value),
  3227. isArg = !isArr && isArguments(value),
  3228. isBuff = !isArr && !isArg && isBuffer(value),
  3229. isType = !isArr && !isArg && !isBuff && isTypedArray(value),
  3230. skipIndexes = isArr || isArg || isBuff || isType,
  3231. result = skipIndexes ? baseTimes(value.length, String) : [],
  3232. length = result.length;
  3233. for (var key in value) {
  3234. if ((inherited || hasOwnProperty.call(value, key)) &&
  3235. !(skipIndexes && (
  3236. // Safari 9 has enumerable `arguments.length` in strict mode.
  3237. key == 'length' ||
  3238. // Node.js 0.10 has enumerable non-index properties on buffers.
  3239. (isBuff && (key == 'offset' || key == 'parent')) ||
  3240. // PhantomJS 2 has enumerable non-index properties on typed arrays.
  3241. (isType && (key == 'buffer' || key == 'byteLength' || key == 'byteOffset')) ||
  3242. // Skip index properties.
  3243. isIndex(key, length)
  3244. ))) {
  3245. result.push(key);
  3246. }
  3247. }
  3248. return result;
  3249. }
  3250. /**
  3251. * A specialized version of `_.sample` for arrays.
  3252. *
  3253. * @private
  3254. * @param {Array} array The array to sample.
  3255. * @returns {*} Returns the random element.
  3256. */
  3257. function arraySample(array) {
  3258. var length = array.length;
  3259. return length ? array[baseRandom(0, length - 1)] : undefined;
  3260. }
  3261. /**
  3262. * A specialized version of `_.sampleSize` for arrays.
  3263. *
  3264. * @private
  3265. * @param {Array} array The array to sample.
  3266. * @param {number} n The number of elements to sample.
  3267. * @returns {Array} Returns the random elements.
  3268. */
  3269. function arraySampleSize(array, n) {
  3270. return shuffleSelf(copyArray(array), baseClamp(n, 0, array.length));
  3271. }
  3272. /**
  3273. * A specialized version of `_.shuffle` for arrays.
  3274. *
  3275. * @private
  3276. * @param {Array} array The array to shuffle.
  3277. * @returns {Array} Returns the new shuffled array.
  3278. */
  3279. function arrayShuffle(array) {
  3280. return shuffleSelf(copyArray(array));
  3281. }
  3282. /**
  3283. * This function is like `assignValue` except that it doesn't assign
  3284. * `undefined` values.
  3285. *
  3286. * @private
  3287. * @param {Object} object The object to modify.
  3288. * @param {string} key The key of the property to assign.
  3289. * @param {*} value The value to assign.
  3290. */
  3291. function assignMergeValue(object, key, value) {
  3292. if ((value !== undefined && !eq(object[key], value)) ||
  3293. (value === undefined && !(key in object))) {
  3294. baseAssignValue(object, key, value);
  3295. }
  3296. }
  3297. /**
  3298. * Assigns `value` to `key` of `object` if the existing value is not equivalent
  3299. * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  3300. * for equality comparisons.
  3301. *
  3302. * @private
  3303. * @param {Object} object The object to modify.
  3304. * @param {string} key The key of the property to assign.
  3305. * @param {*} value The value to assign.
  3306. */
  3307. function assignValue(object, key, value) {
  3308. var objValue = object[key];
  3309. if (!(hasOwnProperty.call(object, key) && eq(objValue, value)) ||
  3310. (value === undefined && !(key in object))) {
  3311. baseAssignValue(object, key, value);
  3312. }
  3313. }
  3314. /**
  3315. * Gets the index at which the `key` is found in `array` of key-value pairs.
  3316. *
  3317. * @private
  3318. * @param {Array} array The array to inspect.
  3319. * @param {*} key The key to search for.
  3320. * @returns {number} Returns the index of the matched value, else `-1`.
  3321. */
  3322. function assocIndexOf(array, key) {
  3323. var length = array.length;
  3324. while (length--) {
  3325. if (eq(array[length][0], key)) {
  3326. return length;
  3327. }
  3328. }
  3329. return -1;
  3330. }
  3331. /**
  3332. * Aggregates elements of `collection` on `accumulator` with keys transformed
  3333. * by `iteratee` and values set by `setter`.
  3334. *
  3335. * @private
  3336. * @param {Array|Object} collection The collection to iterate over.
  3337. * @param {Function} setter The function to set `accumulator` values.
  3338. * @param {Function} iteratee The iteratee to transform keys.
  3339. * @param {Object} accumulator The initial aggregated object.
  3340. * @returns {Function} Returns `accumulator`.
  3341. */
  3342. function baseAggregator(collection, setter, iteratee, accumulator) {
  3343. baseEach(collection, function(value, key, collection) {
  3344. setter(accumulator, value, iteratee(value), collection);
  3345. });
  3346. return accumulator;
  3347. }
  3348. /**
  3349. * The base implementation of `_.assign` without support for multiple sources
  3350. * or `customizer` functions.
  3351. *
  3352. * @private
  3353. * @param {Object} object The destination object.
  3354. * @param {Object} source The source object.
  3355. * @returns {Object} Returns `object`.
  3356. */
  3357. function baseAssign(object, source) {
  3358. return object && copyObject(source, keys(source), object);
  3359. }
  3360. /**
  3361. * The base implementation of `_.assignIn` without support for multiple sources
  3362. * or `customizer` functions.
  3363. *
  3364. * @private
  3365. * @param {Object} object The destination object.
  3366. * @param {Object} source The source object.
  3367. * @returns {Object} Returns `object`.
  3368. */
  3369. function baseAssignIn(object, source) {
  3370. return object && copyObject(source, keysIn(source), object);
  3371. }
  3372. /**
  3373. * The base implementation of `assignValue` and `assignMergeValue` without
  3374. * value checks.
  3375. *
  3376. * @private
  3377. * @param {Object} object The object to modify.
  3378. * @param {string} key The key of the property to assign.
  3379. * @param {*} value The value to assign.
  3380. */
  3381. function baseAssignValue(object, key, value) {
  3382. if (key == '__proto__' && defineProperty) {
  3383. defineProperty(object, key, {
  3384. 'configurable': true,
  3385. 'enumerable': true,
  3386. 'value': value,
  3387. 'writable': true
  3388. });
  3389. } else {
  3390. object[key] = value;
  3391. }
  3392. }
  3393. /**
  3394. * The base implementation of `_.at` without support for individual paths.
  3395. *
  3396. * @private
  3397. * @param {Object} object The object to iterate over.
  3398. * @param {string[]} paths The property paths to pick.
  3399. * @returns {Array} Returns the picked elements.
  3400. */
  3401. function baseAt(object, paths) {
  3402. var index = -1,
  3403. length = paths.length,
  3404. result = Array(length),
  3405. skip = object == null;
  3406. while (++index < length) {
  3407. result[index] = skip ? undefined : get(object, paths[index]);
  3408. }
  3409. return result;
  3410. }
  3411. /**
  3412. * The base implementation of `_.clamp` which doesn't coerce arguments.
  3413. *
  3414. * @private
  3415. * @param {number} number The number to clamp.
  3416. * @param {number} [lower] The lower bound.
  3417. * @param {number} upper The upper bound.
  3418. * @returns {number} Returns the clamped number.
  3419. */
  3420. function baseClamp(number, lower, upper) {
  3421. if (number === number) {
  3422. if (upper !== undefined) {
  3423. number = number <= upper ? number : upper;
  3424. }
  3425. if (lower !== undefined) {
  3426. number = number >= lower ? number : lower;
  3427. }
  3428. }
  3429. return number;
  3430. }
  3431. /**
  3432. * The base implementation of `_.clone` and `_.cloneDeep` which tracks
  3433. * traversed objects.
  3434. *
  3435. * @private
  3436. * @param {*} value The value to clone.
  3437. * @param {boolean} bitmask The bitmask flags.
  3438. * 1 - Deep clone
  3439. * 2 - Flatten inherited properties
  3440. * 4 - Clone symbols
  3441. * @param {Function} [customizer] The function to customize cloning.
  3442. * @param {string} [key] The key of `value`.
  3443. * @param {Object} [object] The parent object of `value`.
  3444. * @param {Object} [stack] Tracks traversed objects and their clone counterparts.
  3445. * @returns {*} Returns the cloned value.
  3446. */
  3447. function baseClone(value, bitmask, customizer, key, object, stack) {
  3448. var result,
  3449. isDeep = bitmask & CLONE_DEEP_FLAG,
  3450. isFlat = bitmask & CLONE_FLAT_FLAG,
  3451. isFull = bitmask & CLONE_SYMBOLS_FLAG;
  3452. if (customizer) {
  3453. result = object ? customizer(value, key, object, stack) : customizer(value);
  3454. }
  3455. if (result !== undefined) {
  3456. return result;
  3457. }
  3458. if (!isObject(value)) {
  3459. return value;
  3460. }
  3461. var isArr = isArray(value);
  3462. if (isArr) {
  3463. result = initCloneArray(value);
  3464. if (!isDeep) {
  3465. return copyArray(value, result);
  3466. }
  3467. } else {
  3468. var tag = getTag(value),
  3469. isFunc = tag == funcTag || tag == genTag;
  3470. if (isBuffer(value)) {
  3471. return cloneBuffer(value, isDeep);
  3472. }
  3473. if (tag == objectTag || tag == argsTag || (isFunc && !object)) {
  3474. result = (isFlat || isFunc) ? {} : initCloneObject(value);
  3475. if (!isDeep) {
  3476. return isFlat
  3477. ? copySymbolsIn(value, baseAssignIn(result, value))
  3478. : copySymbols(value, baseAssign(result, value));
  3479. }
  3480. } else {
  3481. if (!cloneableTags[tag]) {
  3482. return object ? value : {};
  3483. }
  3484. result = initCloneByTag(value, tag, isDeep);
  3485. }
  3486. }
  3487. // Check for circular references and return its corresponding clone.
  3488. stack || (stack = new Stack);
  3489. var stacked = stack.get(value);
  3490. if (stacked) {
  3491. return stacked;
  3492. }
  3493. stack.set(value, result);
  3494. if (isSet(value)) {
  3495. value.forEach(function(subValue) {
  3496. result.add(baseClone(subValue, bitmask, customizer, subValue, value, stack));
  3497. });
  3498. } else if (isMap(value)) {
  3499. value.forEach(function(subValue, key) {
  3500. result.set(key, baseClone(subValue, bitmask, customizer, key, value, stack));
  3501. });
  3502. }
  3503. var keysFunc = isFull
  3504. ? (isFlat ? getAllKeysIn : getAllKeys)
  3505. : (isFlat ? keysIn : keys);
  3506. var props = isArr ? undefined : keysFunc(value);
  3507. arrayEach(props || value, function(subValue, key) {
  3508. if (props) {
  3509. key = subValue;
  3510. subValue = value[key];
  3511. }
  3512. // Recursively populate clone (susceptible to call stack limits).
  3513. assignValue(result, key, baseClone(subValue, bitmask, customizer, key, value, stack));
  3514. });
  3515. return result;
  3516. }
  3517. /**
  3518. * The base implementation of `_.conforms` which doesn't clone `source`.
  3519. *
  3520. * @private
  3521. * @param {Object} source The object of property predicates to conform to.
  3522. * @returns {Function} Returns the new spec function.
  3523. */
  3524. function baseConforms(source) {
  3525. var props = keys(source);
  3526. return function(object) {
  3527. return baseConformsTo(object, source, props);
  3528. };
  3529. }
  3530. /**
  3531. * The base implementation of `_.conformsTo` which accepts `props` to check.
  3532. *
  3533. * @private
  3534. * @param {Object} object The object to inspect.
  3535. * @param {Object} source The object of property predicates to conform to.
  3536. * @returns {boolean} Returns `true` if `object` conforms, else `false`.
  3537. */
  3538. function baseConformsTo(object, source, props) {
  3539. var length = props.length;
  3540. if (object == null) {
  3541. return !length;
  3542. }
  3543. object = Object(object);
  3544. while (length--) {
  3545. var key = props[length],
  3546. predicate = source[key],
  3547. value = object[key];
  3548. if ((value === undefined && !(key in object)) || !predicate(value)) {
  3549. return false;
  3550. }
  3551. }
  3552. return true;
  3553. }
  3554. /**
  3555. * The base implementation of `_.delay` and `_.defer` which accepts `args`
  3556. * to provide to `func`.
  3557. *
  3558. * @private
  3559. * @param {Function} func The function to delay.
  3560. * @param {number} wait The number of milliseconds to delay invocation.
  3561. * @param {Array} args The arguments to provide to `func`.
  3562. * @returns {number|Object} Returns the timer id or timeout object.
  3563. */
  3564. function baseDelay(func, wait, args) {
  3565. if (typeof func != 'function') {
  3566. throw new TypeError(FUNC_ERROR_TEXT);
  3567. }
  3568. return setTimeout(function() { func.apply(undefined, args); }, wait);
  3569. }
  3570. /**
  3571. * The base implementation of methods like `_.difference` without support
  3572. * for excluding multiple arrays or iteratee shorthands.
  3573. *
  3574. * @private
  3575. * @param {Array} array The array to inspect.
  3576. * @param {Array} values The values to exclude.
  3577. * @param {Function} [iteratee] The iteratee invoked per element.
  3578. * @param {Function} [comparator] The comparator invoked per element.
  3579. * @returns {Array} Returns the new array of filtered values.
  3580. */
  3581. function baseDifference(array, values, iteratee, comparator) {
  3582. var index = -1,
  3583. includes = arrayIncludes,
  3584. isCommon = true,
  3585. length = array.length,
  3586. result = [],
  3587. valuesLength = values.length;
  3588. if (!length) {
  3589. return result;
  3590. }
  3591. if (iteratee) {
  3592. values = arrayMap(values, baseUnary(iteratee));
  3593. }
  3594. if (comparator) {
  3595. includes = arrayIncludesWith;
  3596. isCommon = false;
  3597. }
  3598. else if (values.length >= LARGE_ARRAY_SIZE) {
  3599. includes = cacheHas;
  3600. isCommon = false;
  3601. values = new SetCache(values);
  3602. }
  3603. outer:
  3604. while (++index < length) {
  3605. var value = array[index],
  3606. computed = iteratee == null ? value : iteratee(value);
  3607. value = (comparator || value !== 0) ? value : 0;
  3608. if (isCommon && computed === computed) {
  3609. var valuesIndex = valuesLength;
  3610. while (valuesIndex--) {
  3611. if (values[valuesIndex] === computed) {
  3612. continue outer;
  3613. }
  3614. }
  3615. result.push(value);
  3616. }
  3617. else if (!includes(values, computed, comparator)) {
  3618. result.push(value);
  3619. }
  3620. }
  3621. return result;
  3622. }
  3623. /**
  3624. * The base implementation of `_.forEach` without support for iteratee shorthands.
  3625. *
  3626. * @private
  3627. * @param {Array|Object} collection The collection to iterate over.
  3628. * @param {Function} iteratee The function invoked per iteration.
  3629. * @returns {Array|Object} Returns `collection`.
  3630. */
  3631. var baseEach = createBaseEach(baseForOwn);
  3632. /**
  3633. * The base implementation of `_.forEachRight` without support for iteratee shorthands.
  3634. *
  3635. * @private
  3636. * @param {Array|Object} collection The collection to iterate over.
  3637. * @param {Function} iteratee The function invoked per iteration.
  3638. * @returns {Array|Object} Returns `collection`.
  3639. */
  3640. var baseEachRight = createBaseEach(baseForOwnRight, true);
  3641. /**
  3642. * The base implementation of `_.every` without support for iteratee shorthands.
  3643. *
  3644. * @private
  3645. * @param {Array|Object} collection The collection to iterate over.
  3646. * @param {Function} predicate The function invoked per iteration.
  3647. * @returns {boolean} Returns `true` if all elements pass the predicate check,
  3648. * else `false`
  3649. */
  3650. function baseEvery(collection, predicate) {
  3651. var result = true;
  3652. baseEach(collection, function(value, index, collection) {
  3653. result = !!predicate(value, index, collection);
  3654. return result;
  3655. });
  3656. return result;
  3657. }
  3658. /**
  3659. * The base implementation of methods like `_.max` and `_.min` which accepts a
  3660. * `comparator` to determine the extremum value.
  3661. *
  3662. * @private
  3663. * @param {Array} array The array to iterate over.
  3664. * @param {Function} iteratee The iteratee invoked per iteration.
  3665. * @param {Function} comparator The comparator used to compare values.
  3666. * @returns {*} Returns the extremum value.
  3667. */
  3668. function baseExtremum(array, iteratee, comparator) {
  3669. var index = -1,
  3670. length = array.length;
  3671. while (++index < length) {
  3672. var value = array[index],
  3673. current = iteratee(value);
  3674. if (current != null && (computed === undefined
  3675. ? (current === current && !isSymbol(current))
  3676. : comparator(current, computed)
  3677. )) {
  3678. var computed = current,
  3679. result = value;
  3680. }
  3681. }
  3682. return result;
  3683. }
  3684. /**
  3685. * The base implementation of `_.fill` without an iteratee call guard.
  3686. *
  3687. * @private
  3688. * @param {Array} array The array to fill.
  3689. * @param {*} value The value to fill `array` with.
  3690. * @param {number} [start=0] The start position.
  3691. * @param {number} [end=array.length] The end position.
  3692. * @returns {Array} Returns `array`.
  3693. */
  3694. function baseFill(array, value, start, end) {
  3695. var length = array.length;
  3696. start = toInteger(start);
  3697. if (start < 0) {
  3698. start = -start > length ? 0 : (length + start);
  3699. }
  3700. end = (end === undefined || end > length) ? length : toInteger(end);
  3701. if (end < 0) {
  3702. end += length;
  3703. }
  3704. end = start > end ? 0 : toLength(end);
  3705. while (start < end) {
  3706. array[start++] = value;
  3707. }
  3708. return array;
  3709. }
  3710. /**
  3711. * The base implementation of `_.filter` without support for iteratee shorthands.
  3712. *
  3713. * @private
  3714. * @param {Array|Object} collection The collection to iterate over.
  3715. * @param {Function} predicate The function invoked per iteration.
  3716. * @returns {Array} Returns the new filtered array.
  3717. */
  3718. function baseFilter(collection, predicate) {
  3719. var result = [];
  3720. baseEach(collection, function(value, index, collection) {
  3721. if (predicate(value, index, collection)) {
  3722. result.push(value);
  3723. }
  3724. });
  3725. return result;
  3726. }
  3727. /**
  3728. * The base implementation of `_.flatten` with support for restricting flattening.
  3729. *
  3730. * @private
  3731. * @param {Array} array The array to flatten.
  3732. * @param {number} depth The maximum recursion depth.
  3733. * @param {boolean} [predicate=isFlattenable] The function invoked per iteration.
  3734. * @param {boolean} [isStrict] Restrict to values that pass `predicate` checks.
  3735. * @param {Array} [result=[]] The initial result value.
  3736. * @returns {Array} Returns the new flattened array.
  3737. */
  3738. function baseFlatten(array, depth, predicate, isStrict, result) {
  3739. var index = -1,
  3740. length = array.length;
  3741. predicate || (predicate = isFlattenable);
  3742. result || (result = []);
  3743. while (++index < length) {
  3744. var value = array[index];
  3745. if (depth > 0 && predicate(value)) {
  3746. if (depth > 1) {
  3747. // Recursively flatten arrays (susceptible to call stack limits).
  3748. baseFlatten(value, depth - 1, predicate, isStrict, result);
  3749. } else {
  3750. arrayPush(result, value);
  3751. }
  3752. } else if (!isStrict) {
  3753. result[result.length] = value;
  3754. }
  3755. }
  3756. return result;
  3757. }
  3758. /**
  3759. * The base implementation of `baseForOwn` which iterates over `object`
  3760. * properties returned by `keysFunc` and invokes `iteratee` for each property.
  3761. * Iteratee functions may exit iteration early by explicitly returning `false`.
  3762. *
  3763. * @private
  3764. * @param {Object} object The object to iterate over.
  3765. * @param {Function} iteratee The function invoked per iteration.
  3766. * @param {Function} keysFunc The function to get the keys of `object`.
  3767. * @returns {Object} Returns `object`.
  3768. */
  3769. var baseFor = createBaseFor();
  3770. /**
  3771. * This function is like `baseFor` except that it iterates over properties
  3772. * in the opposite order.
  3773. *
  3774. * @private
  3775. * @param {Object} object The object to iterate over.
  3776. * @param {Function} iteratee The function invoked per iteration.
  3777. * @param {Function} keysFunc The function to get the keys of `object`.
  3778. * @returns {Object} Returns `object`.
  3779. */
  3780. var baseForRight = createBaseFor(true);
  3781. /**
  3782. * The base implementation of `_.forOwn` without support for iteratee shorthands.
  3783. *
  3784. * @private
  3785. * @param {Object} object The object to iterate over.
  3786. * @param {Function} iteratee The function invoked per iteration.
  3787. * @returns {Object} Returns `object`.
  3788. */
  3789. function baseForOwn(object, iteratee) {
  3790. return object && baseFor(object, iteratee, keys);
  3791. }
  3792. /**
  3793. * The base implementation of `_.forOwnRight` without support for iteratee shorthands.
  3794. *
  3795. * @private
  3796. * @param {Object} object The object to iterate over.
  3797. * @param {Function} iteratee The function invoked per iteration.
  3798. * @returns {Object} Returns `object`.
  3799. */
  3800. function baseForOwnRight(object, iteratee) {
  3801. return object && baseForRight(object, iteratee, keys);
  3802. }
  3803. /**
  3804. * The base implementation of `_.functions` which creates an array of
  3805. * `object` function property names filtered from `props`.
  3806. *
  3807. * @private
  3808. * @param {Object} object The object to inspect.
  3809. * @param {Array} props The property names to filter.
  3810. * @returns {Array} Returns the function names.
  3811. */
  3812. function baseFunctions(object, props) {
  3813. return arrayFilter(props, function(key) {
  3814. return isFunction(object[key]);
  3815. });
  3816. }
  3817. /**
  3818. * The base implementation of `_.get` without support for default values.
  3819. *
  3820. * @private
  3821. * @param {Object} object The object to query.
  3822. * @param {Array|string} path The path of the property to get.
  3823. * @returns {*} Returns the resolved value.
  3824. */
  3825. function baseGet(object, path) {
  3826. path = castPath(path, object);
  3827. var index = 0,
  3828. length = path.length;
  3829. while (object != null && index < length) {
  3830. object = object[toKey(path[index++])];
  3831. }
  3832. return (index && index == length) ? object : undefined;
  3833. }
  3834. /**
  3835. * The base implementation of `getAllKeys` and `getAllKeysIn` which uses
  3836. * `keysFunc` and `symbolsFunc` to get the enumerable property names and
  3837. * symbols of `object`.
  3838. *
  3839. * @private
  3840. * @param {Object} object The object to query.
  3841. * @param {Function} keysFunc The function to get the keys of `object`.
  3842. * @param {Function} symbolsFunc The function to get the symbols of `object`.
  3843. * @returns {Array} Returns the array of property names and symbols.
  3844. */
  3845. function baseGetAllKeys(object, keysFunc, symbolsFunc) {
  3846. var result = keysFunc(object);
  3847. return isArray(object) ? result : arrayPush(result, symbolsFunc(object));
  3848. }
  3849. /**
  3850. * The base implementation of `getTag` without fallbacks for buggy environments.
  3851. *
  3852. * @private
  3853. * @param {*} value The value to query.
  3854. * @returns {string} Returns the `toStringTag`.
  3855. */
  3856. function baseGetTag(value) {
  3857. if (value == null) {
  3858. return value === undefined ? undefinedTag : nullTag;
  3859. }
  3860. return (symToStringTag && symToStringTag in Object(value))
  3861. ? getRawTag(value)
  3862. : objectToString(value);
  3863. }
  3864. /**
  3865. * The base implementation of `_.gt` which doesn't coerce arguments.
  3866. *
  3867. * @private
  3868. * @param {*} value The value to compare.
  3869. * @param {*} other The other value to compare.
  3870. * @returns {boolean} Returns `true` if `value` is greater than `other`,
  3871. * else `false`.
  3872. */
  3873. function baseGt(value, other) {
  3874. return value > other;
  3875. }
  3876. /**
  3877. * The base implementation of `_.has` without support for deep paths.
  3878. *
  3879. * @private
  3880. * @param {Object} [object] The object to query.
  3881. * @param {Array|string} key The key to check.
  3882. * @returns {boolean} Returns `true` if `key` exists, else `false`.
  3883. */
  3884. function baseHas(object, key) {
  3885. return object != null && hasOwnProperty.call(object, key);
  3886. }
  3887. /**
  3888. * The base implementation of `_.hasIn` without support for deep paths.
  3889. *
  3890. * @private
  3891. * @param {Object} [object] The object to query.
  3892. * @param {Array|string} key The key to check.
  3893. * @returns {boolean} Returns `true` if `key` exists, else `false`.
  3894. */
  3895. function baseHasIn(object, key) {
  3896. return object != null && key in Object(object);
  3897. }
  3898. /**
  3899. * The base implementation of `_.inRange` which doesn't coerce arguments.
  3900. *
  3901. * @private
  3902. * @param {number} number The number to check.
  3903. * @param {number} start The start of the range.
  3904. * @param {number} end The end of the range.
  3905. * @returns {boolean} Returns `true` if `number` is in the range, else `false`.
  3906. */
  3907. function baseInRange(number, start, end) {
  3908. return number >= nativeMin(start, end) && number < nativeMax(start, end);
  3909. }
  3910. /**
  3911. * The base implementation of methods like `_.intersection`, without support
  3912. * for iteratee shorthands, that accepts an array of arrays to inspect.
  3913. *
  3914. * @private
  3915. * @param {Array} arrays The arrays to inspect.
  3916. * @param {Function} [iteratee] The iteratee invoked per element.
  3917. * @param {Function} [comparator] The comparator invoked per element.
  3918. * @returns {Array} Returns the new array of shared values.
  3919. */
  3920. function baseIntersection(arrays, iteratee, comparator) {
  3921. var includes = comparator ? arrayIncludesWith : arrayIncludes,
  3922. length = arrays[0].length,
  3923. othLength = arrays.length,
  3924. othIndex = othLength,
  3925. caches = Array(othLength),
  3926. maxLength = Infinity,
  3927. result = [];
  3928. while (othIndex--) {
  3929. var array = arrays[othIndex];
  3930. if (othIndex && iteratee) {
  3931. array = arrayMap(array, baseUnary(iteratee));
  3932. }
  3933. maxLength = nativeMin(array.length, maxLength);
  3934. caches[othIndex] = !comparator && (iteratee || (length >= 120 && array.length >= 120))
  3935. ? new SetCache(othIndex && array)
  3936. : undefined;
  3937. }
  3938. array = arrays[0];
  3939. var index = -1,
  3940. seen = caches[0];
  3941. outer:
  3942. while (++index < length && result.length < maxLength) {
  3943. var value = array[index],
  3944. computed = iteratee ? iteratee(value) : value;
  3945. value = (comparator || value !== 0) ? value : 0;
  3946. if (!(seen
  3947. ? cacheHas(seen, computed)
  3948. : includes(result, computed, comparator)
  3949. )) {
  3950. othIndex = othLength;
  3951. while (--othIndex) {
  3952. var cache = caches[othIndex];
  3953. if (!(cache
  3954. ? cacheHas(cache, computed)
  3955. : includes(arrays[othIndex], computed, comparator))
  3956. ) {
  3957. continue outer;
  3958. }
  3959. }
  3960. if (seen) {
  3961. seen.push(computed);
  3962. }
  3963. result.push(value);
  3964. }
  3965. }
  3966. return result;
  3967. }
  3968. /**
  3969. * The base implementation of `_.invert` and `_.invertBy` which inverts
  3970. * `object` with values transformed by `iteratee` and set by `setter`.
  3971. *
  3972. * @private
  3973. * @param {Object} object The object to iterate over.
  3974. * @param {Function} setter The function to set `accumulator` values.
  3975. * @param {Function} iteratee The iteratee to transform values.
  3976. * @param {Object} accumulator The initial inverted object.
  3977. * @returns {Function} Returns `accumulator`.
  3978. */
  3979. function baseInverter(object, setter, iteratee, accumulator) {
  3980. baseForOwn(object, function(value, key, object) {
  3981. setter(accumulator, iteratee(value), key, object);
  3982. });
  3983. return accumulator;
  3984. }
  3985. /**
  3986. * The base implementation of `_.invoke` without support for individual
  3987. * method arguments.
  3988. *
  3989. * @private
  3990. * @param {Object} object The object to query.
  3991. * @param {Array|string} path The path of the method to invoke.
  3992. * @param {Array} args The arguments to invoke the method with.
  3993. * @returns {*} Returns the result of the invoked method.
  3994. */
  3995. function baseInvoke(object, path, args) {
  3996. path = castPath(path, object);
  3997. object = parent(object, path);
  3998. var func = object == null ? object : object[toKey(last(path))];
  3999. return func == null ? undefined : apply(func, object, args);
  4000. }
  4001. /**
  4002. * The base implementation of `_.isArguments`.
  4003. *
  4004. * @private
  4005. * @param {*} value The value to check.
  4006. * @returns {boolean} Returns `true` if `value` is an `arguments` object,
  4007. */
  4008. function baseIsArguments(value) {
  4009. return isObjectLike(value) && baseGetTag(value) == argsTag;
  4010. }
  4011. /**
  4012. * The base implementation of `_.isArrayBuffer` without Node.js optimizations.
  4013. *
  4014. * @private
  4015. * @param {*} value The value to check.
  4016. * @returns {boolean} Returns `true` if `value` is an array buffer, else `false`.
  4017. */
  4018. function baseIsArrayBuffer(value) {
  4019. return isObjectLike(value) && baseGetTag(value) == arrayBufferTag;
  4020. }
  4021. /**
  4022. * The base implementation of `_.isDate` without Node.js optimizations.
  4023. *
  4024. * @private
  4025. * @param {*} value The value to check.
  4026. * @returns {boolean} Returns `true` if `value` is a date object, else `false`.
  4027. */
  4028. function baseIsDate(value) {
  4029. return isObjectLike(value) && baseGetTag(value) == dateTag;
  4030. }
  4031. /**
  4032. * The base implementation of `_.isEqual` which supports partial comparisons
  4033. * and tracks traversed objects.
  4034. *
  4035. * @private
  4036. * @param {*} value The value to compare.
  4037. * @param {*} other The other value to compare.
  4038. * @param {boolean} bitmask The bitmask flags.
  4039. * 1 - Unordered comparison
  4040. * 2 - Partial comparison
  4041. * @param {Function} [customizer] The function to customize comparisons.
  4042. * @param {Object} [stack] Tracks traversed `value` and `other` objects.
  4043. * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
  4044. */
  4045. function baseIsEqual(value, other, bitmask, customizer, stack) {
  4046. if (value === other) {
  4047. return true;
  4048. }
  4049. if (value == null || other == null || (!isObjectLike(value) && !isObjectLike(other))) {
  4050. return value !== value && other !== other;
  4051. }
  4052. return baseIsEqualDeep(value, other, bitmask, customizer, baseIsEqual, stack);
  4053. }
  4054. /**
  4055. * A specialized version of `baseIsEqual` for arrays and objects which performs
  4056. * deep comparisons and tracks traversed objects enabling objects with circular
  4057. * references to be compared.
  4058. *
  4059. * @private
  4060. * @param {Object} object The object to compare.
  4061. * @param {Object} other The other object to compare.
  4062. * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
  4063. * @param {Function} customizer The function to customize comparisons.
  4064. * @param {Function} equalFunc The function to determine equivalents of values.
  4065. * @param {Object} [stack] Tracks traversed `object` and `other` objects.
  4066. * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
  4067. */
  4068. function baseIsEqualDeep(object, other, bitmask, customizer, equalFunc, stack) {
  4069. var objIsArr = isArray(object),
  4070. othIsArr = isArray(other),
  4071. objTag = objIsArr ? arrayTag : getTag(object),
  4072. othTag = othIsArr ? arrayTag : getTag(other);
  4073. objTag = objTag == argsTag ? objectTag : objTag;
  4074. othTag = othTag == argsTag ? objectTag : othTag;
  4075. var objIsObj = objTag == objectTag,
  4076. othIsObj = othTag == objectTag,
  4077. isSameTag = objTag == othTag;
  4078. if (isSameTag && isBuffer(object)) {
  4079. if (!isBuffer(other)) {
  4080. return false;
  4081. }
  4082. objIsArr = true;
  4083. objIsObj = false;
  4084. }
  4085. if (isSameTag && !objIsObj) {
  4086. stack || (stack = new Stack);
  4087. return (objIsArr || isTypedArray(object))
  4088. ? equalArrays(object, other, bitmask, customizer, equalFunc, stack)
  4089. : equalByTag(object, other, objTag, bitmask, customizer, equalFunc, stack);
  4090. }
  4091. if (!(bitmask & COMPARE_PARTIAL_FLAG)) {
  4092. var objIsWrapped = objIsObj && hasOwnProperty.call(object, '__wrapped__'),
  4093. othIsWrapped = othIsObj && hasOwnProperty.call(other, '__wrapped__');
  4094. if (objIsWrapped || othIsWrapped) {
  4095. var objUnwrapped = objIsWrapped ? object.value() : object,
  4096. othUnwrapped = othIsWrapped ? other.value() : other;
  4097. stack || (stack = new Stack);
  4098. return equalFunc(objUnwrapped, othUnwrapped, bitmask, customizer, stack);
  4099. }
  4100. }
  4101. if (!isSameTag) {
  4102. return false;
  4103. }
  4104. stack || (stack = new Stack);
  4105. return equalObjects(object, other, bitmask, customizer, equalFunc, stack);
  4106. }
  4107. /**
  4108. * The base implementation of `_.isMap` without Node.js optimizations.
  4109. *
  4110. * @private
  4111. * @param {*} value The value to check.
  4112. * @returns {boolean} Returns `true` if `value` is a map, else `false`.
  4113. */
  4114. function baseIsMap(value) {
  4115. return isObjectLike(value) && getTag(value) == mapTag;
  4116. }
  4117. /**
  4118. * The base implementation of `_.isMatch` without support for iteratee shorthands.
  4119. *
  4120. * @private
  4121. * @param {Object} object The object to inspect.
  4122. * @param {Object} source The object of property values to match.
  4123. * @param {Array} matchData The property names, values, and compare flags to match.
  4124. * @param {Function} [customizer] The function to customize comparisons.
  4125. * @returns {boolean} Returns `true` if `object` is a match, else `false`.
  4126. */
  4127. function baseIsMatch(object, source, matchData, customizer) {
  4128. var index = matchData.length,
  4129. length = index,
  4130. noCustomizer = !customizer;
  4131. if (object == null) {
  4132. return !length;
  4133. }
  4134. object = Object(object);
  4135. while (index--) {
  4136. var data = matchData[index];
  4137. if ((noCustomizer && data[2])
  4138. ? data[1] !== object[data[0]]
  4139. : !(data[0] in object)
  4140. ) {
  4141. return false;
  4142. }
  4143. }
  4144. while (++index < length) {
  4145. data = matchData[index];
  4146. var key = data[0],
  4147. objValue = object[key],
  4148. srcValue = data[1];
  4149. if (noCustomizer && data[2]) {
  4150. if (objValue === undefined && !(key in object)) {
  4151. return false;
  4152. }
  4153. } else {
  4154. var stack = new Stack;
  4155. if (customizer) {
  4156. var result = customizer(objValue, srcValue, key, object, source, stack);
  4157. }
  4158. if (!(result === undefined
  4159. ? baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG, customizer, stack)
  4160. : result
  4161. )) {
  4162. return false;
  4163. }
  4164. }
  4165. }
  4166. return true;
  4167. }
  4168. /**
  4169. * The base implementation of `_.isNative` without bad shim checks.
  4170. *
  4171. * @private
  4172. * @param {*} value The value to check.
  4173. * @returns {boolean} Returns `true` if `value` is a native function,
  4174. * else `false`.
  4175. */
  4176. function baseIsNative(value) {
  4177. if (!isObject(value) || isMasked(value)) {
  4178. return false;
  4179. }
  4180. var pattern = isFunction(value) ? reIsNative : reIsHostCtor;
  4181. return pattern.test(toSource(value));
  4182. }
  4183. /**
  4184. * The base implementation of `_.isRegExp` without Node.js optimizations.
  4185. *
  4186. * @private
  4187. * @param {*} value The value to check.
  4188. * @returns {boolean} Returns `true` if `value` is a regexp, else `false`.
  4189. */
  4190. function baseIsRegExp(value) {
  4191. return isObjectLike(value) && baseGetTag(value) == regexpTag;
  4192. }
  4193. /**
  4194. * The base implementation of `_.isSet` without Node.js optimizations.
  4195. *
  4196. * @private
  4197. * @param {*} value The value to check.
  4198. * @returns {boolean} Returns `true` if `value` is a set, else `false`.
  4199. */
  4200. function baseIsSet(value) {
  4201. return isObjectLike(value) && getTag(value) == setTag;
  4202. }
  4203. /**
  4204. * The base implementation of `_.isTypedArray` without Node.js optimizations.
  4205. *
  4206. * @private
  4207. * @param {*} value The value to check.
  4208. * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.
  4209. */
  4210. function baseIsTypedArray(value) {
  4211. return isObjectLike(value) &&
  4212. isLength(value.length) && !!typedArrayTags[baseGetTag(value)];
  4213. }
  4214. /**
  4215. * The base implementation of `_.iteratee`.
  4216. *
  4217. * @private
  4218. * @param {*} [value=_.identity] The value to convert to an iteratee.
  4219. * @returns {Function} Returns the iteratee.
  4220. */
  4221. function baseIteratee(value) {
  4222. // Don't store the `typeof` result in a variable to avoid a JIT bug in Safari 9.
  4223. // See https://bugs.webkit.org/show_bug.cgi?id=156034 for more details.
  4224. if (typeof value == 'function') {
  4225. return value;
  4226. }
  4227. if (value == null) {
  4228. return identity;
  4229. }
  4230. if (typeof value == 'object') {
  4231. return isArray(value)
  4232. ? baseMatchesProperty(value[0], value[1])
  4233. : baseMatches(value);
  4234. }
  4235. return property(value);
  4236. }
  4237. /**
  4238. * The base implementation of `_.keys` which doesn't treat sparse arrays as dense.
  4239. *
  4240. * @private
  4241. * @param {Object} object The object to query.
  4242. * @returns {Array} Returns the array of property names.
  4243. */
  4244. function baseKeys(object) {
  4245. if (!isPrototype(object)) {
  4246. return nativeKeys(object);
  4247. }
  4248. var result = [];
  4249. for (var key in Object(object)) {
  4250. if (hasOwnProperty.call(object, key) && key != 'constructor') {
  4251. result.push(key);
  4252. }
  4253. }
  4254. return result;
  4255. }
  4256. /**
  4257. * The base implementation of `_.keysIn` which doesn't treat sparse arrays as dense.
  4258. *
  4259. * @private
  4260. * @param {Object} object The object to query.
  4261. * @returns {Array} Returns the array of property names.
  4262. */
  4263. function baseKeysIn(object) {
  4264. if (!isObject(object)) {
  4265. return nativeKeysIn(object);
  4266. }
  4267. var isProto = isPrototype(object),
  4268. result = [];
  4269. for (var key in object) {
  4270. if (!(key == 'constructor' && (isProto || !hasOwnProperty.call(object, key)))) {
  4271. result.push(key);
  4272. }
  4273. }
  4274. return result;
  4275. }
  4276. /**
  4277. * The base implementation of `_.lt` which doesn't coerce arguments.
  4278. *
  4279. * @private
  4280. * @param {*} value The value to compare.
  4281. * @param {*} other The other value to compare.
  4282. * @returns {boolean} Returns `true` if `value` is less than `other`,
  4283. * else `false`.
  4284. */
  4285. function baseLt(value, other) {
  4286. return value < other;
  4287. }
  4288. /**
  4289. * The base implementation of `_.map` without support for iteratee shorthands.
  4290. *
  4291. * @private
  4292. * @param {Array|Object} collection The collection to iterate over.
  4293. * @param {Function} iteratee The function invoked per iteration.
  4294. * @returns {Array} Returns the new mapped array.
  4295. */
  4296. function baseMap(collection, iteratee) {
  4297. var index = -1,
  4298. result = isArrayLike(collection) ? Array(collection.length) : [];
  4299. baseEach(collection, function(value, key, collection) {
  4300. result[++index] = iteratee(value, key, collection);
  4301. });
  4302. return result;
  4303. }
  4304. /**
  4305. * The base implementation of `_.matches` which doesn't clone `source`.
  4306. *
  4307. * @private
  4308. * @param {Object} source The object of property values to match.
  4309. * @returns {Function} Returns the new spec function.
  4310. */
  4311. function baseMatches(source) {
  4312. var matchData = getMatchData(source);
  4313. if (matchData.length == 1 && matchData[0][2]) {
  4314. return matchesStrictComparable(matchData[0][0], matchData[0][1]);
  4315. }
  4316. return function(object) {
  4317. return object === source || baseIsMatch(object, source, matchData);
  4318. };
  4319. }
  4320. /**
  4321. * The base implementation of `_.matchesProperty` which doesn't clone `srcValue`.
  4322. *
  4323. * @private
  4324. * @param {string} path The path of the property to get.
  4325. * @param {*} srcValue The value to match.
  4326. * @returns {Function} Returns the new spec function.
  4327. */
  4328. function baseMatchesProperty(path, srcValue) {
  4329. if (isKey(path) && isStrictComparable(srcValue)) {
  4330. return matchesStrictComparable(toKey(path), srcValue);
  4331. }
  4332. return function(object) {
  4333. var objValue = get(object, path);
  4334. return (objValue === undefined && objValue === srcValue)
  4335. ? hasIn(object, path)
  4336. : baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG);
  4337. };
  4338. }
  4339. /**
  4340. * The base implementation of `_.merge` without support for multiple sources.
  4341. *
  4342. * @private
  4343. * @param {Object} object The destination object.
  4344. * @param {Object} source The source object.
  4345. * @param {number} srcIndex The index of `source`.
  4346. * @param {Function} [customizer] The function to customize merged values.
  4347. * @param {Object} [stack] Tracks traversed source values and their merged
  4348. * counterparts.
  4349. */
  4350. function baseMerge(object, source, srcIndex, customizer, stack) {
  4351. if (object === source) {
  4352. return;
  4353. }
  4354. baseFor(source, function(srcValue, key) {
  4355. stack || (stack = new Stack);
  4356. if (isObject(srcValue)) {
  4357. baseMergeDeep(object, source, key, srcIndex, baseMerge, customizer, stack);
  4358. }
  4359. else {
  4360. var newValue = customizer
  4361. ? customizer(safeGet(object, key), srcValue, (key + ''), object, source, stack)
  4362. : undefined;
  4363. if (newValue === undefined) {
  4364. newValue = srcValue;
  4365. }
  4366. assignMergeValue(object, key, newValue);
  4367. }
  4368. }, keysIn);
  4369. }
  4370. /**
  4371. * A specialized version of `baseMerge` for arrays and objects which performs
  4372. * deep merges and tracks traversed objects enabling objects with circular
  4373. * references to be merged.
  4374. *
  4375. * @private
  4376. * @param {Object} object The destination object.
  4377. * @param {Object} source The source object.
  4378. * @param {string} key The key of the value to merge.
  4379. * @param {number} srcIndex The index of `source`.
  4380. * @param {Function} mergeFunc The function to merge values.
  4381. * @param {Function} [customizer] The function to customize assigned values.
  4382. * @param {Object} [stack] Tracks traversed source values and their merged
  4383. * counterparts.
  4384. */
  4385. function baseMergeDeep(object, source, key, srcIndex, mergeFunc, customizer, stack) {
  4386. var objValue = safeGet(object, key),
  4387. srcValue = safeGet(source, key),
  4388. stacked = stack.get(srcValue);
  4389. if (stacked) {
  4390. assignMergeValue(object, key, stacked);
  4391. return;
  4392. }
  4393. var newValue = customizer
  4394. ? customizer(objValue, srcValue, (key + ''), object, source, stack)
  4395. : undefined;
  4396. var isCommon = newValue === undefined;
  4397. if (isCommon) {
  4398. var isArr = isArray(srcValue),
  4399. isBuff = !isArr && isBuffer(srcValue),
  4400. isTyped = !isArr && !isBuff && isTypedArray(srcValue);
  4401. newValue = srcValue;
  4402. if (isArr || isBuff || isTyped) {
  4403. if (isArray(objValue)) {
  4404. newValue = objValue;
  4405. }
  4406. else if (isArrayLikeObject(objValue)) {
  4407. newValue = copyArray(objValue);
  4408. }
  4409. else if (isBuff) {
  4410. isCommon = false;
  4411. newValue = cloneBuffer(srcValue, true);
  4412. }
  4413. else if (isTyped) {
  4414. isCommon = false;
  4415. newValue = cloneTypedArray(srcValue, true);
  4416. }
  4417. else {
  4418. newValue = [];
  4419. }
  4420. }
  4421. else if (isPlainObject(srcValue) || isArguments(srcValue)) {
  4422. newValue = objValue;
  4423. if (isArguments(objValue)) {
  4424. newValue = toPlainObject(objValue);
  4425. }
  4426. else if (!isObject(objValue) || isFunction(objValue)) {
  4427. newValue = initCloneObject(srcValue);
  4428. }
  4429. }
  4430. else {
  4431. isCommon = false;
  4432. }
  4433. }
  4434. if (isCommon) {
  4435. // Recursively merge objects and arrays (susceptible to call stack limits).
  4436. stack.set(srcValue, newValue);
  4437. mergeFunc(newValue, srcValue, srcIndex, customizer, stack);
  4438. stack['delete'](srcValue);
  4439. }
  4440. assignMergeValue(object, key, newValue);
  4441. }
  4442. /**
  4443. * The base implementation of `_.nth` which doesn't coerce arguments.
  4444. *
  4445. * @private
  4446. * @param {Array} array The array to query.
  4447. * @param {number} n The index of the element to return.
  4448. * @returns {*} Returns the nth element of `array`.
  4449. */
  4450. function baseNth(array, n) {
  4451. var length = array.length;
  4452. if (!length) {
  4453. return;
  4454. }
  4455. n += n < 0 ? length : 0;
  4456. return isIndex(n, length) ? array[n] : undefined;
  4457. }
  4458. /**
  4459. * The base implementation of `_.orderBy` without param guards.
  4460. *
  4461. * @private
  4462. * @param {Array|Object} collection The collection to iterate over.
  4463. * @param {Function[]|Object[]|string[]} iteratees The iteratees to sort by.
  4464. * @param {string[]} orders The sort orders of `iteratees`.
  4465. * @returns {Array} Returns the new sorted array.
  4466. */
  4467. function baseOrderBy(collection, iteratees, orders) {
  4468. if (iteratees.length) {
  4469. iteratees = arrayMap(iteratees, function(iteratee) {
  4470. if (isArray(iteratee)) {
  4471. return function(value) {
  4472. return baseGet(value, iteratee.length === 1 ? iteratee[0] : iteratee);
  4473. }
  4474. }
  4475. return iteratee;
  4476. });
  4477. } else {
  4478. iteratees = [identity];
  4479. }
  4480. var index = -1;
  4481. iteratees = arrayMap(iteratees, baseUnary(getIteratee()));
  4482. var result = baseMap(collection, function(value, key, collection) {
  4483. var criteria = arrayMap(iteratees, function(iteratee) {
  4484. return iteratee(value);
  4485. });
  4486. return { 'criteria': criteria, 'index': ++index, 'value': value };
  4487. });
  4488. return baseSortBy(result, function(object, other) {
  4489. return compareMultiple(object, other, orders);
  4490. });
  4491. }
  4492. /**
  4493. * The base implementation of `_.pick` without support for individual
  4494. * property identifiers.
  4495. *
  4496. * @private
  4497. * @param {Object} object The source object.
  4498. * @param {string[]} paths The property paths to pick.
  4499. * @returns {Object} Returns the new object.
  4500. */
  4501. function basePick(object, paths) {
  4502. return basePickBy(object, paths, function(value, path) {
  4503. return hasIn(object, path);
  4504. });
  4505. }
  4506. /**
  4507. * The base implementation of `_.pickBy` without support for iteratee shorthands.
  4508. *
  4509. * @private
  4510. * @param {Object} object The source object.
  4511. * @param {string[]} paths The property paths to pick.
  4512. * @param {Function} predicate The function invoked per property.
  4513. * @returns {Object} Returns the new object.
  4514. */
  4515. function basePickBy(object, paths, predicate) {
  4516. var index = -1,
  4517. length = paths.length,
  4518. result = {};
  4519. while (++index < length) {
  4520. var path = paths[index],
  4521. value = baseGet(object, path);
  4522. if (predicate(value, path)) {
  4523. baseSet(result, castPath(path, object), value);
  4524. }
  4525. }
  4526. return result;
  4527. }
  4528. /**
  4529. * A specialized version of `baseProperty` which supports deep paths.
  4530. *
  4531. * @private
  4532. * @param {Array|string} path The path of the property to get.
  4533. * @returns {Function} Returns the new accessor function.
  4534. */
  4535. function basePropertyDeep(path) {
  4536. return function(object) {
  4537. return baseGet(object, path);
  4538. };
  4539. }
  4540. /**
  4541. * The base implementation of `_.pullAllBy` without support for iteratee
  4542. * shorthands.
  4543. *
  4544. * @private
  4545. * @param {Array} array The array to modify.
  4546. * @param {Array} values The values to remove.
  4547. * @param {Function} [iteratee] The iteratee invoked per element.
  4548. * @param {Function} [comparator] The comparator invoked per element.
  4549. * @returns {Array} Returns `array`.
  4550. */
  4551. function basePullAll(array, values, iteratee, comparator) {
  4552. var indexOf = comparator ? baseIndexOfWith : baseIndexOf,
  4553. index = -1,
  4554. length = values.length,
  4555. seen = array;
  4556. if (array === values) {
  4557. values = copyArray(values);
  4558. }
  4559. if (iteratee) {
  4560. seen = arrayMap(array, baseUnary(iteratee));
  4561. }
  4562. while (++index < length) {
  4563. var fromIndex = 0,
  4564. value = values[index],
  4565. computed = iteratee ? iteratee(value) : value;
  4566. while ((fromIndex = indexOf(seen, computed, fromIndex, comparator)) > -1) {
  4567. if (seen !== array) {
  4568. splice.call(seen, fromIndex, 1);
  4569. }
  4570. splice.call(array, fromIndex, 1);
  4571. }
  4572. }
  4573. return array;
  4574. }
  4575. /**
  4576. * The base implementation of `_.pullAt` without support for individual
  4577. * indexes or capturing the removed elements.
  4578. *
  4579. * @private
  4580. * @param {Array} array The array to modify.
  4581. * @param {number[]} indexes The indexes of elements to remove.
  4582. * @returns {Array} Returns `array`.
  4583. */
  4584. function basePullAt(array, indexes) {
  4585. var length = array ? indexes.length : 0,
  4586. lastIndex = length - 1;
  4587. while (length--) {
  4588. var index = indexes[length];
  4589. if (length == lastIndex || index !== previous) {
  4590. var previous = index;
  4591. if (isIndex(index)) {
  4592. splice.call(array, index, 1);
  4593. } else {
  4594. baseUnset(array, index);
  4595. }
  4596. }
  4597. }
  4598. return array;
  4599. }
  4600. /**
  4601. * The base implementation of `_.random` without support for returning
  4602. * floating-point numbers.
  4603. *
  4604. * @private
  4605. * @param {number} lower The lower bound.
  4606. * @param {number} upper The upper bound.
  4607. * @returns {number} Returns the random number.
  4608. */
  4609. function baseRandom(lower, upper) {
  4610. return lower + nativeFloor(nativeRandom() * (upper - lower + 1));
  4611. }
  4612. /**
  4613. * The base implementation of `_.range` and `_.rangeRight` which doesn't
  4614. * coerce arguments.
  4615. *
  4616. * @private
  4617. * @param {number} start The start of the range.
  4618. * @param {number} end The end of the range.
  4619. * @param {number} step The value to increment or decrement by.
  4620. * @param {boolean} [fromRight] Specify iterating from right to left.
  4621. * @returns {Array} Returns the range of numbers.
  4622. */
  4623. function baseRange(start, end, step, fromRight) {
  4624. var index = -1,
  4625. length = nativeMax(nativeCeil((end - start) / (step || 1)), 0),
  4626. result = Array(length);
  4627. while (length--) {
  4628. result[fromRight ? length : ++index] = start;
  4629. start += step;
  4630. }
  4631. return result;
  4632. }
  4633. /**
  4634. * The base implementation of `_.repeat` which doesn't coerce arguments.
  4635. *
  4636. * @private
  4637. * @param {string} string The string to repeat.
  4638. * @param {number} n The number of times to repeat the string.
  4639. * @returns {string} Returns the repeated string.
  4640. */
  4641. function baseRepeat(string, n) {
  4642. var result = '';
  4643. if (!string || n < 1 || n > MAX_SAFE_INTEGER) {
  4644. return result;
  4645. }
  4646. // Leverage the exponentiation by squaring algorithm for a faster repeat.
  4647. // See https://en.wikipedia.org/wiki/Exponentiation_by_squaring for more details.
  4648. do {
  4649. if (n % 2) {
  4650. result += string;
  4651. }
  4652. n = nativeFloor(n / 2);
  4653. if (n) {
  4654. string += string;
  4655. }
  4656. } while (n);
  4657. return result;
  4658. }
  4659. /**
  4660. * The base implementation of `_.rest` which doesn't validate or coerce arguments.
  4661. *
  4662. * @private
  4663. * @param {Function} func The function to apply a rest parameter to.
  4664. * @param {number} [start=func.length-1] The start position of the rest parameter.
  4665. * @returns {Function} Returns the new function.
  4666. */
  4667. function baseRest(func, start) {
  4668. return setToString(overRest(func, start, identity), func + '');
  4669. }
  4670. /**
  4671. * The base implementation of `_.sample`.
  4672. *
  4673. * @private
  4674. * @param {Array|Object} collection The collection to sample.
  4675. * @returns {*} Returns the random element.
  4676. */
  4677. function baseSample(collection) {
  4678. return arraySample(values(collection));
  4679. }
  4680. /**
  4681. * The base implementation of `_.sampleSize` without param guards.
  4682. *
  4683. * @private
  4684. * @param {Array|Object} collection The collection to sample.
  4685. * @param {number} n The number of elements to sample.
  4686. * @returns {Array} Returns the random elements.
  4687. */
  4688. function baseSampleSize(collection, n) {
  4689. var array = values(collection);
  4690. return shuffleSelf(array, baseClamp(n, 0, array.length));
  4691. }
  4692. /**
  4693. * The base implementation of `_.set`.
  4694. *
  4695. * @private
  4696. * @param {Object} object The object to modify.
  4697. * @param {Array|string} path The path of the property to set.
  4698. * @param {*} value The value to set.
  4699. * @param {Function} [customizer] The function to customize path creation.
  4700. * @returns {Object} Returns `object`.
  4701. */
  4702. function baseSet(object, path, value, customizer) {
  4703. if (!isObject(object)) {
  4704. return object;
  4705. }
  4706. path = castPath(path, object);
  4707. var index = -1,
  4708. length = path.length,
  4709. lastIndex = length - 1,
  4710. nested = object;
  4711. while (nested != null && ++index < length) {
  4712. var key = toKey(path[index]),
  4713. newValue = value;
  4714. if (key === '__proto__' || key === 'constructor' || key === 'prototype') {
  4715. return object;
  4716. }
  4717. if (index != lastIndex) {
  4718. var objValue = nested[key];
  4719. newValue = customizer ? customizer(objValue, key, nested) : undefined;
  4720. if (newValue === undefined) {
  4721. newValue = isObject(objValue)
  4722. ? objValue
  4723. : (isIndex(path[index + 1]) ? [] : {});
  4724. }
  4725. }
  4726. assignValue(nested, key, newValue);
  4727. nested = nested[key];
  4728. }
  4729. return object;
  4730. }
  4731. /**
  4732. * The base implementation of `setData` without support for hot loop shorting.
  4733. *
  4734. * @private
  4735. * @param {Function} func The function to associate metadata with.
  4736. * @param {*} data The metadata.
  4737. * @returns {Function} Returns `func`.
  4738. */
  4739. var baseSetData = !metaMap ? identity : function(func, data) {
  4740. metaMap.set(func, data);
  4741. return func;
  4742. };
  4743. /**
  4744. * The base implementation of `setToString` without support for hot loop shorting.
  4745. *
  4746. * @private
  4747. * @param {Function} func The function to modify.
  4748. * @param {Function} string The `toString` result.
  4749. * @returns {Function} Returns `func`.
  4750. */
  4751. var baseSetToString = !defineProperty ? identity : function(func, string) {
  4752. return defineProperty(func, 'toString', {
  4753. 'configurable': true,
  4754. 'enumerable': false,
  4755. 'value': constant(string),
  4756. 'writable': true
  4757. });
  4758. };
  4759. /**
  4760. * The base implementation of `_.shuffle`.
  4761. *
  4762. * @private
  4763. * @param {Array|Object} collection The collection to shuffle.
  4764. * @returns {Array} Returns the new shuffled array.
  4765. */
  4766. function baseShuffle(collection) {
  4767. return shuffleSelf(values(collection));
  4768. }
  4769. /**
  4770. * The base implementation of `_.slice` without an iteratee call guard.
  4771. *
  4772. * @private
  4773. * @param {Array} array The array to slice.
  4774. * @param {number} [start=0] The start position.
  4775. * @param {number} [end=array.length] The end position.
  4776. * @returns {Array} Returns the slice of `array`.
  4777. */
  4778. function baseSlice(array, start, end) {
  4779. var index = -1,
  4780. length = array.length;
  4781. if (start < 0) {
  4782. start = -start > length ? 0 : (length + start);
  4783. }
  4784. end = end > length ? length : end;
  4785. if (end < 0) {
  4786. end += length;
  4787. }
  4788. length = start > end ? 0 : ((end - start) >>> 0);
  4789. start >>>= 0;
  4790. var result = Array(length);
  4791. while (++index < length) {
  4792. result[index] = array[index + start];
  4793. }
  4794. return result;
  4795. }
  4796. /**
  4797. * The base implementation of `_.some` without support for iteratee shorthands.
  4798. *
  4799. * @private
  4800. * @param {Array|Object} collection The collection to iterate over.
  4801. * @param {Function} predicate The function invoked per iteration.
  4802. * @returns {boolean} Returns `true` if any element passes the predicate check,
  4803. * else `false`.
  4804. */
  4805. function baseSome(collection, predicate) {
  4806. var result;
  4807. baseEach(collection, function(value, index, collection) {
  4808. result = predicate(value, index, collection);
  4809. return !result;
  4810. });
  4811. return !!result;
  4812. }
  4813. /**
  4814. * The base implementation of `_.sortedIndex` and `_.sortedLastIndex` which
  4815. * performs a binary search of `array` to determine the index at which `value`
  4816. * should be inserted into `array` in order to maintain its sort order.
  4817. *
  4818. * @private
  4819. * @param {Array} array The sorted array to inspect.
  4820. * @param {*} value The value to evaluate.
  4821. * @param {boolean} [retHighest] Specify returning the highest qualified index.
  4822. * @returns {number} Returns the index at which `value` should be inserted
  4823. * into `array`.
  4824. */
  4825. function baseSortedIndex(array, value, retHighest) {
  4826. var low = 0,
  4827. high = array == null ? low : array.length;
  4828. if (typeof value == 'number' && value === value && high <= HALF_MAX_ARRAY_LENGTH) {
  4829. while (low < high) {
  4830. var mid = (low + high) >>> 1,
  4831. computed = array[mid];
  4832. if (computed !== null && !isSymbol(computed) &&
  4833. (retHighest ? (computed <= value) : (computed < value))) {
  4834. low = mid + 1;
  4835. } else {
  4836. high = mid;
  4837. }
  4838. }
  4839. return high;
  4840. }
  4841. return baseSortedIndexBy(array, value, identity, retHighest);
  4842. }
  4843. /**
  4844. * The base implementation of `_.sortedIndexBy` and `_.sortedLastIndexBy`
  4845. * which invokes `iteratee` for `value` and each element of `array` to compute
  4846. * their sort ranking. The iteratee is invoked with one argument; (value).
  4847. *
  4848. * @private
  4849. * @param {Array} array The sorted array to inspect.
  4850. * @param {*} value The value to evaluate.
  4851. * @param {Function} iteratee The iteratee invoked per element.
  4852. * @param {boolean} [retHighest] Specify returning the highest qualified index.
  4853. * @returns {number} Returns the index at which `value` should be inserted
  4854. * into `array`.
  4855. */
  4856. function baseSortedIndexBy(array, value, iteratee, retHighest) {
  4857. var low = 0,
  4858. high = array == null ? 0 : array.length;
  4859. if (high === 0) {
  4860. return 0;
  4861. }
  4862. value = iteratee(value);
  4863. var valIsNaN = value !== value,
  4864. valIsNull = value === null,
  4865. valIsSymbol = isSymbol(value),
  4866. valIsUndefined = value === undefined;
  4867. while (low < high) {
  4868. var mid = nativeFloor((low + high) / 2),
  4869. computed = iteratee(array[mid]),
  4870. othIsDefined = computed !== undefined,
  4871. othIsNull = computed === null,
  4872. othIsReflexive = computed === computed,
  4873. othIsSymbol = isSymbol(computed);
  4874. if (valIsNaN) {
  4875. var setLow = retHighest || othIsReflexive;
  4876. } else if (valIsUndefined) {
  4877. setLow = othIsReflexive && (retHighest || othIsDefined);
  4878. } else if (valIsNull) {
  4879. setLow = othIsReflexive && othIsDefined && (retHighest || !othIsNull);
  4880. } else if (valIsSymbol) {
  4881. setLow = othIsReflexive && othIsDefined && !othIsNull && (retHighest || !othIsSymbol);
  4882. } else if (othIsNull || othIsSymbol) {
  4883. setLow = false;
  4884. } else {
  4885. setLow = retHighest ? (computed <= value) : (computed < value);
  4886. }
  4887. if (setLow) {
  4888. low = mid + 1;
  4889. } else {
  4890. high = mid;
  4891. }
  4892. }
  4893. return nativeMin(high, MAX_ARRAY_INDEX);
  4894. }
  4895. /**
  4896. * The base implementation of `_.sortedUniq` and `_.sortedUniqBy` without
  4897. * support for iteratee shorthands.
  4898. *
  4899. * @private
  4900. * @param {Array} array The array to inspect.
  4901. * @param {Function} [iteratee] The iteratee invoked per element.
  4902. * @returns {Array} Returns the new duplicate free array.
  4903. */
  4904. function baseSortedUniq(array, iteratee) {
  4905. var index = -1,
  4906. length = array.length,
  4907. resIndex = 0,
  4908. result = [];
  4909. while (++index < length) {
  4910. var value = array[index],
  4911. computed = iteratee ? iteratee(value) : value;
  4912. if (!index || !eq(computed, seen)) {
  4913. var seen = computed;
  4914. result[resIndex++] = value === 0 ? 0 : value;
  4915. }
  4916. }
  4917. return result;
  4918. }
  4919. /**
  4920. * The base implementation of `_.toNumber` which doesn't ensure correct
  4921. * conversions of binary, hexadecimal, or octal string values.
  4922. *
  4923. * @private
  4924. * @param {*} value The value to process.
  4925. * @returns {number} Returns the number.
  4926. */
  4927. function baseToNumber(value) {
  4928. if (typeof value == 'number') {
  4929. return value;
  4930. }
  4931. if (isSymbol(value)) {
  4932. return NAN;
  4933. }
  4934. return +value;
  4935. }
  4936. /**
  4937. * The base implementation of `_.toString` which doesn't convert nullish
  4938. * values to empty strings.
  4939. *
  4940. * @private
  4941. * @param {*} value The value to process.
  4942. * @returns {string} Returns the string.
  4943. */
  4944. function baseToString(value) {
  4945. // Exit early for strings to avoid a performance hit in some environments.
  4946. if (typeof value == 'string') {
  4947. return value;
  4948. }
  4949. if (isArray(value)) {
  4950. // Recursively convert values (susceptible to call stack limits).
  4951. return arrayMap(value, baseToString) + '';
  4952. }
  4953. if (isSymbol(value)) {
  4954. return symbolToString ? symbolToString.call(value) : '';
  4955. }
  4956. var result = (value + '');
  4957. return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;
  4958. }
  4959. /**
  4960. * The base implementation of `_.uniqBy` without support for iteratee shorthands.
  4961. *
  4962. * @private
  4963. * @param {Array} array The array to inspect.
  4964. * @param {Function} [iteratee] The iteratee invoked per element.
  4965. * @param {Function} [comparator] The comparator invoked per element.
  4966. * @returns {Array} Returns the new duplicate free array.
  4967. */
  4968. function baseUniq(array, iteratee, comparator) {
  4969. var index = -1,
  4970. includes = arrayIncludes,
  4971. length = array.length,
  4972. isCommon = true,
  4973. result = [],
  4974. seen = result;
  4975. if (comparator) {
  4976. isCommon = false;
  4977. includes = arrayIncludesWith;
  4978. }
  4979. else if (length >= LARGE_ARRAY_SIZE) {
  4980. var set = iteratee ? null : createSet(array);
  4981. if (set) {
  4982. return setToArray(set);
  4983. }
  4984. isCommon = false;
  4985. includes = cacheHas;
  4986. seen = new SetCache;
  4987. }
  4988. else {
  4989. seen = iteratee ? [] : result;
  4990. }
  4991. outer:
  4992. while (++index < length) {
  4993. var value = array[index],
  4994. computed = iteratee ? iteratee(value) : value;
  4995. value = (comparator || value !== 0) ? value : 0;
  4996. if (isCommon && computed === computed) {
  4997. var seenIndex = seen.length;
  4998. while (seenIndex--) {
  4999. if (seen[seenIndex] === computed) {
  5000. continue outer;
  5001. }
  5002. }
  5003. if (iteratee) {
  5004. seen.push(computed);
  5005. }
  5006. result.push(value);
  5007. }
  5008. else if (!includes(seen, computed, comparator)) {
  5009. if (seen !== result) {
  5010. seen.push(computed);
  5011. }
  5012. result.push(value);
  5013. }
  5014. }
  5015. return result;
  5016. }
  5017. /**
  5018. * The base implementation of `_.unset`.
  5019. *
  5020. * @private
  5021. * @param {Object} object The object to modify.
  5022. * @param {Array|string} path The property path to unset.
  5023. * @returns {boolean} Returns `true` if the property is deleted, else `false`.
  5024. */
  5025. function baseUnset(object, path) {
  5026. path = castPath(path, object);
  5027. object = parent(object, path);
  5028. return object == null || delete object[toKey(last(path))];
  5029. }
  5030. /**
  5031. * The base implementation of `_.update`.
  5032. *
  5033. * @private
  5034. * @param {Object} object The object to modify.
  5035. * @param {Array|string} path The path of the property to update.
  5036. * @param {Function} updater The function to produce the updated value.
  5037. * @param {Function} [customizer] The function to customize path creation.
  5038. * @returns {Object} Returns `object`.
  5039. */
  5040. function baseUpdate(object, path, updater, customizer) {
  5041. return baseSet(object, path, updater(baseGet(object, path)), customizer);
  5042. }
  5043. /**
  5044. * The base implementation of methods like `_.dropWhile` and `_.takeWhile`
  5045. * without support for iteratee shorthands.
  5046. *
  5047. * @private
  5048. * @param {Array} array The array to query.
  5049. * @param {Function} predicate The function invoked per iteration.
  5050. * @param {boolean} [isDrop] Specify dropping elements instead of taking them.
  5051. * @param {boolean} [fromRight] Specify iterating from right to left.
  5052. * @returns {Array} Returns the slice of `array`.
  5053. */
  5054. function baseWhile(array, predicate, isDrop, fromRight) {
  5055. var length = array.length,
  5056. index = fromRight ? length : -1;
  5057. while ((fromRight ? index-- : ++index < length) &&
  5058. predicate(array[index], index, array)) {}
  5059. return isDrop
  5060. ? baseSlice(array, (fromRight ? 0 : index), (fromRight ? index + 1 : length))
  5061. : baseSlice(array, (fromRight ? index + 1 : 0), (fromRight ? length : index));
  5062. }
  5063. /**
  5064. * The base implementation of `wrapperValue` which returns the result of
  5065. * performing a sequence of actions on the unwrapped `value`, where each
  5066. * successive action is supplied the return value of the previous.
  5067. *
  5068. * @private
  5069. * @param {*} value The unwrapped value.
  5070. * @param {Array} actions Actions to perform to resolve the unwrapped value.
  5071. * @returns {*} Returns the resolved value.
  5072. */
  5073. function baseWrapperValue(value, actions) {
  5074. var result = value;
  5075. if (result instanceof LazyWrapper) {
  5076. result = result.value();
  5077. }
  5078. return arrayReduce(actions, function(result, action) {
  5079. return action.func.apply(action.thisArg, arrayPush([result], action.args));
  5080. }, result);
  5081. }
  5082. /**
  5083. * The base implementation of methods like `_.xor`, without support for
  5084. * iteratee shorthands, that accepts an array of arrays to inspect.
  5085. *
  5086. * @private
  5087. * @param {Array} arrays The arrays to inspect.
  5088. * @param {Function} [iteratee] The iteratee invoked per element.
  5089. * @param {Function} [comparator] The comparator invoked per element.
  5090. * @returns {Array} Returns the new array of values.
  5091. */
  5092. function baseXor(arrays, iteratee, comparator) {
  5093. var length = arrays.length;
  5094. if (length < 2) {
  5095. return length ? baseUniq(arrays[0]) : [];
  5096. }
  5097. var index = -1,
  5098. result = Array(length);
  5099. while (++index < length) {
  5100. var array = arrays[index],
  5101. othIndex = -1;
  5102. while (++othIndex < length) {
  5103. if (othIndex != index) {
  5104. result[index] = baseDifference(result[index] || array, arrays[othIndex], iteratee, comparator);
  5105. }
  5106. }
  5107. }
  5108. return baseUniq(baseFlatten(result, 1), iteratee, comparator);
  5109. }
  5110. /**
  5111. * This base implementation of `_.zipObject` which assigns values using `assignFunc`.
  5112. *
  5113. * @private
  5114. * @param {Array} props The property identifiers.
  5115. * @param {Array} values The property values.
  5116. * @param {Function} assignFunc The function to assign values.
  5117. * @returns {Object} Returns the new object.
  5118. */
  5119. function baseZipObject(props, values, assignFunc) {
  5120. var index = -1,
  5121. length = props.length,
  5122. valsLength = values.length,
  5123. result = {};
  5124. while (++index < length) {
  5125. var value = index < valsLength ? values[index] : undefined;
  5126. assignFunc(result, props[index], value);
  5127. }
  5128. return result;
  5129. }
  5130. /**
  5131. * Casts `value` to an empty array if it's not an array like object.
  5132. *
  5133. * @private
  5134. * @param {*} value The value to inspect.
  5135. * @returns {Array|Object} Returns the cast array-like object.
  5136. */
  5137. function castArrayLikeObject(value) {
  5138. return isArrayLikeObject(value) ? value : [];
  5139. }
  5140. /**
  5141. * Casts `value` to `identity` if it's not a function.
  5142. *
  5143. * @private
  5144. * @param {*} value The value to inspect.
  5145. * @returns {Function} Returns cast function.
  5146. */
  5147. function castFunction(value) {
  5148. return typeof value == 'function' ? value : identity;
  5149. }
  5150. /**
  5151. * Casts `value` to a path array if it's not one.
  5152. *
  5153. * @private
  5154. * @param {*} value The value to inspect.
  5155. * @param {Object} [object] The object to query keys on.
  5156. * @returns {Array} Returns the cast property path array.
  5157. */
  5158. function castPath(value, object) {
  5159. if (isArray(value)) {
  5160. return value;
  5161. }
  5162. return isKey(value, object) ? [value] : stringToPath(toString(value));
  5163. }
  5164. /**
  5165. * A `baseRest` alias which can be replaced with `identity` by module
  5166. * replacement plugins.
  5167. *
  5168. * @private
  5169. * @type {Function}
  5170. * @param {Function} func The function to apply a rest parameter to.
  5171. * @returns {Function} Returns the new function.
  5172. */
  5173. var castRest = baseRest;
  5174. /**
  5175. * Casts `array` to a slice if it's needed.
  5176. *
  5177. * @private
  5178. * @param {Array} array The array to inspect.
  5179. * @param {number} start The start position.
  5180. * @param {number} [end=array.length] The end position.
  5181. * @returns {Array} Returns the cast slice.
  5182. */
  5183. function castSlice(array, start, end) {
  5184. var length = array.length;
  5185. end = end === undefined ? length : end;
  5186. return (!start && end >= length) ? array : baseSlice(array, start, end);
  5187. }
  5188. /**
  5189. * A simple wrapper around the global [`clearTimeout`](https://mdn.io/clearTimeout).
  5190. *
  5191. * @private
  5192. * @param {number|Object} id The timer id or timeout object of the timer to clear.
  5193. */
  5194. var clearTimeout = ctxClearTimeout || function(id) {
  5195. return root.clearTimeout(id);
  5196. };
  5197. /**
  5198. * Creates a clone of `buffer`.
  5199. *
  5200. * @private
  5201. * @param {Buffer} buffer The buffer to clone.
  5202. * @param {boolean} [isDeep] Specify a deep clone.
  5203. * @returns {Buffer} Returns the cloned buffer.
  5204. */
  5205. function cloneBuffer(buffer, isDeep) {
  5206. if (isDeep) {
  5207. return buffer.slice();
  5208. }
  5209. var length = buffer.length,
  5210. result = allocUnsafe ? allocUnsafe(length) : new buffer.constructor(length);
  5211. buffer.copy(result);
  5212. return result;
  5213. }
  5214. /**
  5215. * Creates a clone of `arrayBuffer`.
  5216. *
  5217. * @private
  5218. * @param {ArrayBuffer} arrayBuffer The array buffer to clone.
  5219. * @returns {ArrayBuffer} Returns the cloned array buffer.
  5220. */
  5221. function cloneArrayBuffer(arrayBuffer) {
  5222. var result = new arrayBuffer.constructor(arrayBuffer.byteLength);
  5223. new Uint8Array(result).set(new Uint8Array(arrayBuffer));
  5224. return result;
  5225. }
  5226. /**
  5227. * Creates a clone of `dataView`.
  5228. *
  5229. * @private
  5230. * @param {Object} dataView The data view to clone.
  5231. * @param {boolean} [isDeep] Specify a deep clone.
  5232. * @returns {Object} Returns the cloned data view.
  5233. */
  5234. function cloneDataView(dataView, isDeep) {
  5235. var buffer = isDeep ? cloneArrayBuffer(dataView.buffer) : dataView.buffer;
  5236. return new dataView.constructor(buffer, dataView.byteOffset, dataView.byteLength);
  5237. }
  5238. /**
  5239. * Creates a clone of `regexp`.
  5240. *
  5241. * @private
  5242. * @param {Object} regexp The regexp to clone.
  5243. * @returns {Object} Returns the cloned regexp.
  5244. */
  5245. function cloneRegExp(regexp) {
  5246. var result = new regexp.constructor(regexp.source, reFlags.exec(regexp));
  5247. result.lastIndex = regexp.lastIndex;
  5248. return result;
  5249. }
  5250. /**
  5251. * Creates a clone of the `symbol` object.
  5252. *
  5253. * @private
  5254. * @param {Object} symbol The symbol object to clone.
  5255. * @returns {Object} Returns the cloned symbol object.
  5256. */
  5257. function cloneSymbol(symbol) {
  5258. return symbolValueOf ? Object(symbolValueOf.call(symbol)) : {};
  5259. }
  5260. /**
  5261. * Creates a clone of `typedArray`.
  5262. *
  5263. * @private
  5264. * @param {Object} typedArray The typed array to clone.
  5265. * @param {boolean} [isDeep] Specify a deep clone.
  5266. * @returns {Object} Returns the cloned typed array.
  5267. */
  5268. function cloneTypedArray(typedArray, isDeep) {
  5269. var buffer = isDeep ? cloneArrayBuffer(typedArray.buffer) : typedArray.buffer;
  5270. return new typedArray.constructor(buffer, typedArray.byteOffset, typedArray.length);
  5271. }
  5272. /**
  5273. * Compares values to sort them in ascending order.
  5274. *
  5275. * @private
  5276. * @param {*} value The value to compare.
  5277. * @param {*} other The other value to compare.
  5278. * @returns {number} Returns the sort order indicator for `value`.
  5279. */
  5280. function compareAscending(value, other) {
  5281. if (value !== other) {
  5282. var valIsDefined = value !== undefined,
  5283. valIsNull = value === null,
  5284. valIsReflexive = value === value,
  5285. valIsSymbol = isSymbol(value);
  5286. var othIsDefined = other !== undefined,
  5287. othIsNull = other === null,
  5288. othIsReflexive = other === other,
  5289. othIsSymbol = isSymbol(other);
  5290. if ((!othIsNull && !othIsSymbol && !valIsSymbol && value > other) ||
  5291. (valIsSymbol && othIsDefined && othIsReflexive && !othIsNull && !othIsSymbol) ||
  5292. (valIsNull && othIsDefined && othIsReflexive) ||
  5293. (!valIsDefined && othIsReflexive) ||
  5294. !valIsReflexive) {
  5295. return 1;
  5296. }
  5297. if ((!valIsNull && !valIsSymbol && !othIsSymbol && value < other) ||
  5298. (othIsSymbol && valIsDefined && valIsReflexive && !valIsNull && !valIsSymbol) ||
  5299. (othIsNull && valIsDefined && valIsReflexive) ||
  5300. (!othIsDefined && valIsReflexive) ||
  5301. !othIsReflexive) {
  5302. return -1;
  5303. }
  5304. }
  5305. return 0;
  5306. }
  5307. /**
  5308. * Used by `_.orderBy` to compare multiple properties of a value to another
  5309. * and stable sort them.
  5310. *
  5311. * If `orders` is unspecified, all values are sorted in ascending order. Otherwise,
  5312. * specify an order of "desc" for descending or "asc" for ascending sort order
  5313. * of corresponding values.
  5314. *
  5315. * @private
  5316. * @param {Object} object The object to compare.
  5317. * @param {Object} other The other object to compare.
  5318. * @param {boolean[]|string[]} orders The order to sort by for each property.
  5319. * @returns {number} Returns the sort order indicator for `object`.
  5320. */
  5321. function compareMultiple(object, other, orders) {
  5322. var index = -1,
  5323. objCriteria = object.criteria,
  5324. othCriteria = other.criteria,
  5325. length = objCriteria.length,
  5326. ordersLength = orders.length;
  5327. while (++index < length) {
  5328. var result = compareAscending(objCriteria[index], othCriteria[index]);
  5329. if (result) {
  5330. if (index >= ordersLength) {
  5331. return result;
  5332. }
  5333. var order = orders[index];
  5334. return result * (order == 'desc' ? -1 : 1);
  5335. }
  5336. }
  5337. // Fixes an `Array#sort` bug in the JS engine embedded in Adobe applications
  5338. // that causes it, under certain circumstances, to provide the same value for
  5339. // `object` and `other`. See https://github.com/jashkenas/underscore/pull/1247
  5340. // for more details.
  5341. //
  5342. // This also ensures a stable sort in V8 and other engines.
  5343. // See https://bugs.chromium.org/p/v8/issues/detail?id=90 for more details.
  5344. return object.index - other.index;
  5345. }
  5346. /**
  5347. * Creates an array that is the composition of partially applied arguments,
  5348. * placeholders, and provided arguments into a single array of arguments.
  5349. *
  5350. * @private
  5351. * @param {Array} args The provided arguments.
  5352. * @param {Array} partials The arguments to prepend to those provided.
  5353. * @param {Array} holders The `partials` placeholder indexes.
  5354. * @params {boolean} [isCurried] Specify composing for a curried function.
  5355. * @returns {Array} Returns the new array of composed arguments.
  5356. */
  5357. function composeArgs(args, partials, holders, isCurried) {
  5358. var argsIndex = -1,
  5359. argsLength = args.length,
  5360. holdersLength = holders.length,
  5361. leftIndex = -1,
  5362. leftLength = partials.length,
  5363. rangeLength = nativeMax(argsLength - holdersLength, 0),
  5364. result = Array(leftLength + rangeLength),
  5365. isUncurried = !isCurried;
  5366. while (++leftIndex < leftLength) {
  5367. result[leftIndex] = partials[leftIndex];
  5368. }
  5369. while (++argsIndex < holdersLength) {
  5370. if (isUncurried || argsIndex < argsLength) {
  5371. result[holders[argsIndex]] = args[argsIndex];
  5372. }
  5373. }
  5374. while (rangeLength--) {
  5375. result[leftIndex++] = args[argsIndex++];
  5376. }
  5377. return result;
  5378. }
  5379. /**
  5380. * This function is like `composeArgs` except that the arguments composition
  5381. * is tailored for `_.partialRight`.
  5382. *
  5383. * @private
  5384. * @param {Array} args The provided arguments.
  5385. * @param {Array} partials The arguments to append to those provided.
  5386. * @param {Array} holders The `partials` placeholder indexes.
  5387. * @params {boolean} [isCurried] Specify composing for a curried function.
  5388. * @returns {Array} Returns the new array of composed arguments.
  5389. */
  5390. function composeArgsRight(args, partials, holders, isCurried) {
  5391. var argsIndex = -1,
  5392. argsLength = args.length,
  5393. holdersIndex = -1,
  5394. holdersLength = holders.length,
  5395. rightIndex = -1,
  5396. rightLength = partials.length,
  5397. rangeLength = nativeMax(argsLength - holdersLength, 0),
  5398. result = Array(rangeLength + rightLength),
  5399. isUncurried = !isCurried;
  5400. while (++argsIndex < rangeLength) {
  5401. result[argsIndex] = args[argsIndex];
  5402. }
  5403. var offset = argsIndex;
  5404. while (++rightIndex < rightLength) {
  5405. result[offset + rightIndex] = partials[rightIndex];
  5406. }
  5407. while (++holdersIndex < holdersLength) {
  5408. if (isUncurried || argsIndex < argsLength) {
  5409. result[offset + holders[holdersIndex]] = args[argsIndex++];
  5410. }
  5411. }
  5412. return result;
  5413. }
  5414. /**
  5415. * Copies the values of `source` to `array`.
  5416. *
  5417. * @private
  5418. * @param {Array} source The array to copy values from.
  5419. * @param {Array} [array=[]] The array to copy values to.
  5420. * @returns {Array} Returns `array`.
  5421. */
  5422. function copyArray(source, array) {
  5423. var index = -1,
  5424. length = source.length;
  5425. array || (array = Array(length));
  5426. while (++index < length) {
  5427. array[index] = source[index];
  5428. }
  5429. return array;
  5430. }
  5431. /**
  5432. * Copies properties of `source` to `object`.
  5433. *
  5434. * @private
  5435. * @param {Object} source The object to copy properties from.
  5436. * @param {Array} props The property identifiers to copy.
  5437. * @param {Object} [object={}] The object to copy properties to.
  5438. * @param {Function} [customizer] The function to customize copied values.
  5439. * @returns {Object} Returns `object`.
  5440. */
  5441. function copyObject(source, props, object, customizer) {
  5442. var isNew = !object;
  5443. object || (object = {});
  5444. var index = -1,
  5445. length = props.length;
  5446. while (++index < length) {
  5447. var key = props[index];
  5448. var newValue = customizer
  5449. ? customizer(object[key], source[key], key, object, source)
  5450. : undefined;
  5451. if (newValue === undefined) {
  5452. newValue = source[key];
  5453. }
  5454. if (isNew) {
  5455. baseAssignValue(object, key, newValue);
  5456. } else {
  5457. assignValue(object, key, newValue);
  5458. }
  5459. }
  5460. return object;
  5461. }
  5462. /**
  5463. * Copies own symbols of `source` to `object`.
  5464. *
  5465. * @private
  5466. * @param {Object} source The object to copy symbols from.
  5467. * @param {Object} [object={}] The object to copy symbols to.
  5468. * @returns {Object} Returns `object`.
  5469. */
  5470. function copySymbols(source, object) {
  5471. return copyObject(source, getSymbols(source), object);
  5472. }
  5473. /**
  5474. * Copies own and inherited symbols of `source` to `object`.
  5475. *
  5476. * @private
  5477. * @param {Object} source The object to copy symbols from.
  5478. * @param {Object} [object={}] The object to copy symbols to.
  5479. * @returns {Object} Returns `object`.
  5480. */
  5481. function copySymbolsIn(source, object) {
  5482. return copyObject(source, getSymbolsIn(source), object);
  5483. }
  5484. /**
  5485. * Creates a function like `_.groupBy`.
  5486. *
  5487. * @private
  5488. * @param {Function} setter The function to set accumulator values.
  5489. * @param {Function} [initializer] The accumulator object initializer.
  5490. * @returns {Function} Returns the new aggregator function.
  5491. */
  5492. function createAggregator(setter, initializer) {
  5493. return function(collection, iteratee) {
  5494. var func = isArray(collection) ? arrayAggregator : baseAggregator,
  5495. accumulator = initializer ? initializer() : {};
  5496. return func(collection, setter, getIteratee(iteratee, 2), accumulator);
  5497. };
  5498. }
  5499. /**
  5500. * Creates a function like `_.assign`.
  5501. *
  5502. * @private
  5503. * @param {Function} assigner The function to assign values.
  5504. * @returns {Function} Returns the new assigner function.
  5505. */
  5506. function createAssigner(assigner) {
  5507. return baseRest(function(object, sources) {
  5508. var index = -1,
  5509. length = sources.length,
  5510. customizer = length > 1 ? sources[length - 1] : undefined,
  5511. guard = length > 2 ? sources[2] : undefined;
  5512. customizer = (assigner.length > 3 && typeof customizer == 'function')
  5513. ? (length--, customizer)
  5514. : undefined;
  5515. if (guard && isIterateeCall(sources[0], sources[1], guard)) {
  5516. customizer = length < 3 ? undefined : customizer;
  5517. length = 1;
  5518. }
  5519. object = Object(object);
  5520. while (++index < length) {
  5521. var source = sources[index];
  5522. if (source) {
  5523. assigner(object, source, index, customizer);
  5524. }
  5525. }
  5526. return object;
  5527. });
  5528. }
  5529. /**
  5530. * Creates a `baseEach` or `baseEachRight` function.
  5531. *
  5532. * @private
  5533. * @param {Function} eachFunc The function to iterate over a collection.
  5534. * @param {boolean} [fromRight] Specify iterating from right to left.
  5535. * @returns {Function} Returns the new base function.
  5536. */
  5537. function createBaseEach(eachFunc, fromRight) {
  5538. return function(collection, iteratee) {
  5539. if (collection == null) {
  5540. return collection;
  5541. }
  5542. if (!isArrayLike(collection)) {
  5543. return eachFunc(collection, iteratee);
  5544. }
  5545. var length = collection.length,
  5546. index = fromRight ? length : -1,
  5547. iterable = Object(collection);
  5548. while ((fromRight ? index-- : ++index < length)) {
  5549. if (iteratee(iterable[index], index, iterable) === false) {
  5550. break;
  5551. }
  5552. }
  5553. return collection;
  5554. };
  5555. }
  5556. /**
  5557. * Creates a base function for methods like `_.forIn` and `_.forOwn`.
  5558. *
  5559. * @private
  5560. * @param {boolean} [fromRight] Specify iterating from right to left.
  5561. * @returns {Function} Returns the new base function.
  5562. */
  5563. function createBaseFor(fromRight) {
  5564. return function(object, iteratee, keysFunc) {
  5565. var index = -1,
  5566. iterable = Object(object),
  5567. props = keysFunc(object),
  5568. length = props.length;
  5569. while (length--) {
  5570. var key = props[fromRight ? length : ++index];
  5571. if (iteratee(iterable[key], key, iterable) === false) {
  5572. break;
  5573. }
  5574. }
  5575. return object;
  5576. };
  5577. }
  5578. /**
  5579. * Creates a function that wraps `func` to invoke it with the optional `this`
  5580. * binding of `thisArg`.
  5581. *
  5582. * @private
  5583. * @param {Function} func The function to wrap.
  5584. * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
  5585. * @param {*} [thisArg] The `this` binding of `func`.
  5586. * @returns {Function} Returns the new wrapped function.
  5587. */
  5588. function createBind(func, bitmask, thisArg) {
  5589. var isBind = bitmask & WRAP_BIND_FLAG,
  5590. Ctor = createCtor(func);
  5591. function wrapper() {
  5592. var fn = (this && this !== root && this instanceof wrapper) ? Ctor : func;
  5593. return fn.apply(isBind ? thisArg : this, arguments);
  5594. }
  5595. return wrapper;
  5596. }
  5597. /**
  5598. * Creates a function like `_.lowerFirst`.
  5599. *
  5600. * @private
  5601. * @param {string} methodName The name of the `String` case method to use.
  5602. * @returns {Function} Returns the new case function.
  5603. */
  5604. function createCaseFirst(methodName) {
  5605. return function(string) {
  5606. string = toString(string);
  5607. var strSymbols = hasUnicode(string)
  5608. ? stringToArray(string)
  5609. : undefined;
  5610. var chr = strSymbols
  5611. ? strSymbols[0]
  5612. : string.charAt(0);
  5613. var trailing = strSymbols
  5614. ? castSlice(strSymbols, 1).join('')
  5615. : string.slice(1);
  5616. return chr[methodName]() + trailing;
  5617. };
  5618. }
  5619. /**
  5620. * Creates a function like `_.camelCase`.
  5621. *
  5622. * @private
  5623. * @param {Function} callback The function to combine each word.
  5624. * @returns {Function} Returns the new compounder function.
  5625. */
  5626. function createCompounder(callback) {
  5627. return function(string) {
  5628. return arrayReduce(words(deburr(string).replace(reApos, '')), callback, '');
  5629. };
  5630. }
  5631. /**
  5632. * Creates a function that produces an instance of `Ctor` regardless of
  5633. * whether it was invoked as part of a `new` expression or by `call` or `apply`.
  5634. *
  5635. * @private
  5636. * @param {Function} Ctor The constructor to wrap.
  5637. * @returns {Function} Returns the new wrapped function.
  5638. */
  5639. function createCtor(Ctor) {
  5640. return function() {
  5641. // Use a `switch` statement to work with class constructors. See
  5642. // http://ecma-international.org/ecma-262/7.0/#sec-ecmascript-function-objects-call-thisargument-argumentslist
  5643. // for more details.
  5644. var args = arguments;
  5645. switch (args.length) {
  5646. case 0: return new Ctor;
  5647. case 1: return new Ctor(args[0]);
  5648. case 2: return new Ctor(args[0], args[1]);
  5649. case 3: return new Ctor(args[0], args[1], args[2]);
  5650. case 4: return new Ctor(args[0], args[1], args[2], args[3]);
  5651. case 5: return new Ctor(args[0], args[1], args[2], args[3], args[4]);
  5652. case 6: return new Ctor(args[0], args[1], args[2], args[3], args[4], args[5]);
  5653. case 7: return new Ctor(args[0], args[1], args[2], args[3], args[4], args[5], args[6]);
  5654. }
  5655. var thisBinding = baseCreate(Ctor.prototype),
  5656. result = Ctor.apply(thisBinding, args);
  5657. // Mimic the constructor's `return` behavior.
  5658. // See https://es5.github.io/#x13.2.2 for more details.
  5659. return isObject(result) ? result : thisBinding;
  5660. };
  5661. }
  5662. /**
  5663. * Creates a function that wraps `func` to enable currying.
  5664. *
  5665. * @private
  5666. * @param {Function} func The function to wrap.
  5667. * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
  5668. * @param {number} arity The arity of `func`.
  5669. * @returns {Function} Returns the new wrapped function.
  5670. */
  5671. function createCurry(func, bitmask, arity) {
  5672. var Ctor = createCtor(func);
  5673. function wrapper() {
  5674. var length = arguments.length,
  5675. args = Array(length),
  5676. index = length,
  5677. placeholder = getHolder(wrapper);
  5678. while (index--) {
  5679. args[index] = arguments[index];
  5680. }
  5681. var holders = (length < 3 && args[0] !== placeholder && args[length - 1] !== placeholder)
  5682. ? []
  5683. : replaceHolders(args, placeholder);
  5684. length -= holders.length;
  5685. if (length < arity) {
  5686. return createRecurry(
  5687. func, bitmask, createHybrid, wrapper.placeholder, undefined,
  5688. args, holders, undefined, undefined, arity - length);
  5689. }
  5690. var fn = (this && this !== root && this instanceof wrapper) ? Ctor : func;
  5691. return apply(fn, this, args);
  5692. }
  5693. return wrapper;
  5694. }
  5695. /**
  5696. * Creates a `_.find` or `_.findLast` function.
  5697. *
  5698. * @private
  5699. * @param {Function} findIndexFunc The function to find the collection index.
  5700. * @returns {Function} Returns the new find function.
  5701. */
  5702. function createFind(findIndexFunc) {
  5703. return function(collection, predicate, fromIndex) {
  5704. var iterable = Object(collection);
  5705. if (!isArrayLike(collection)) {
  5706. var iteratee = getIteratee(predicate, 3);
  5707. collection = keys(collection);
  5708. predicate = function(key) { return iteratee(iterable[key], key, iterable); };
  5709. }
  5710. var index = findIndexFunc(collection, predicate, fromIndex);
  5711. return index > -1 ? iterable[iteratee ? collection[index] : index] : undefined;
  5712. };
  5713. }
  5714. /**
  5715. * Creates a `_.flow` or `_.flowRight` function.
  5716. *
  5717. * @private
  5718. * @param {boolean} [fromRight] Specify iterating from right to left.
  5719. * @returns {Function} Returns the new flow function.
  5720. */
  5721. function createFlow(fromRight) {
  5722. return flatRest(function(funcs) {
  5723. var length = funcs.length,
  5724. index = length,
  5725. prereq = LodashWrapper.prototype.thru;
  5726. if (fromRight) {
  5727. funcs.reverse();
  5728. }
  5729. while (index--) {
  5730. var func = funcs[index];
  5731. if (typeof func != 'function') {
  5732. throw new TypeError(FUNC_ERROR_TEXT);
  5733. }
  5734. if (prereq && !wrapper && getFuncName(func) == 'wrapper') {
  5735. var wrapper = new LodashWrapper([], true);
  5736. }
  5737. }
  5738. index = wrapper ? index : length;
  5739. while (++index < length) {
  5740. func = funcs[index];
  5741. var funcName = getFuncName(func),
  5742. data = funcName == 'wrapper' ? getData(func) : undefined;
  5743. if (data && isLaziable(data[0]) &&
  5744. data[1] == (WRAP_ARY_FLAG | WRAP_CURRY_FLAG | WRAP_PARTIAL_FLAG | WRAP_REARG_FLAG) &&
  5745. !data[4].length && data[9] == 1
  5746. ) {
  5747. wrapper = wrapper[getFuncName(data[0])].apply(wrapper, data[3]);
  5748. } else {
  5749. wrapper = (func.length == 1 && isLaziable(func))
  5750. ? wrapper[funcName]()
  5751. : wrapper.thru(func);
  5752. }
  5753. }
  5754. return function() {
  5755. var args = arguments,
  5756. value = args[0];
  5757. if (wrapper && args.length == 1 && isArray(value)) {
  5758. return wrapper.plant(value).value();
  5759. }
  5760. var index = 0,
  5761. result = length ? funcs[index].apply(this, args) : value;
  5762. while (++index < length) {
  5763. result = funcs[index].call(this, result);
  5764. }
  5765. return result;
  5766. };
  5767. });
  5768. }
  5769. /**
  5770. * Creates a function that wraps `func` to invoke it with optional `this`
  5771. * binding of `thisArg`, partial application, and currying.
  5772. *
  5773. * @private
  5774. * @param {Function|string} func The function or method name to wrap.
  5775. * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
  5776. * @param {*} [thisArg] The `this` binding of `func`.
  5777. * @param {Array} [partials] The arguments to prepend to those provided to
  5778. * the new function.
  5779. * @param {Array} [holders] The `partials` placeholder indexes.
  5780. * @param {Array} [partialsRight] The arguments to append to those provided
  5781. * to the new function.
  5782. * @param {Array} [holdersRight] The `partialsRight` placeholder indexes.
  5783. * @param {Array} [argPos] The argument positions of the new function.
  5784. * @param {number} [ary] The arity cap of `func`.
  5785. * @param {number} [arity] The arity of `func`.
  5786. * @returns {Function} Returns the new wrapped function.
  5787. */
  5788. function createHybrid(func, bitmask, thisArg, partials, holders, partialsRight, holdersRight, argPos, ary, arity) {
  5789. var isAry = bitmask & WRAP_ARY_FLAG,
  5790. isBind = bitmask & WRAP_BIND_FLAG,
  5791. isBindKey = bitmask & WRAP_BIND_KEY_FLAG,
  5792. isCurried = bitmask & (WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG),
  5793. isFlip = bitmask & WRAP_FLIP_FLAG,
  5794. Ctor = isBindKey ? undefined : createCtor(func);
  5795. function wrapper() {
  5796. var length = arguments.length,
  5797. args = Array(length),
  5798. index = length;
  5799. while (index--) {
  5800. args[index] = arguments[index];
  5801. }
  5802. if (isCurried) {
  5803. var placeholder = getHolder(wrapper),
  5804. holdersCount = countHolders(args, placeholder);
  5805. }
  5806. if (partials) {
  5807. args = composeArgs(args, partials, holders, isCurried);
  5808. }
  5809. if (partialsRight) {
  5810. args = composeArgsRight(args, partialsRight, holdersRight, isCurried);
  5811. }
  5812. length -= holdersCount;
  5813. if (isCurried && length < arity) {
  5814. var newHolders = replaceHolders(args, placeholder);
  5815. return createRecurry(
  5816. func, bitmask, createHybrid, wrapper.placeholder, thisArg,
  5817. args, newHolders, argPos, ary, arity - length
  5818. );
  5819. }
  5820. var thisBinding = isBind ? thisArg : this,
  5821. fn = isBindKey ? thisBinding[func] : func;
  5822. length = args.length;
  5823. if (argPos) {
  5824. args = reorder(args, argPos);
  5825. } else if (isFlip && length > 1) {
  5826. args.reverse();
  5827. }
  5828. if (isAry && ary < length) {
  5829. args.length = ary;
  5830. }
  5831. if (this && this !== root && this instanceof wrapper) {
  5832. fn = Ctor || createCtor(fn);
  5833. }
  5834. return fn.apply(thisBinding, args);
  5835. }
  5836. return wrapper;
  5837. }
  5838. /**
  5839. * Creates a function like `_.invertBy`.
  5840. *
  5841. * @private
  5842. * @param {Function} setter The function to set accumulator values.
  5843. * @param {Function} toIteratee The function to resolve iteratees.
  5844. * @returns {Function} Returns the new inverter function.
  5845. */
  5846. function createInverter(setter, toIteratee) {
  5847. return function(object, iteratee) {
  5848. return baseInverter(object, setter, toIteratee(iteratee), {});
  5849. };
  5850. }
  5851. /**
  5852. * Creates a function that performs a mathematical operation on two values.
  5853. *
  5854. * @private
  5855. * @param {Function} operator The function to perform the operation.
  5856. * @param {number} [defaultValue] The value used for `undefined` arguments.
  5857. * @returns {Function} Returns the new mathematical operation function.
  5858. */
  5859. function createMathOperation(operator, defaultValue) {
  5860. return function(value, other) {
  5861. var result;
  5862. if (value === undefined && other === undefined) {
  5863. return defaultValue;
  5864. }
  5865. if (value !== undefined) {
  5866. result = value;
  5867. }
  5868. if (other !== undefined) {
  5869. if (result === undefined) {
  5870. return other;
  5871. }
  5872. if (typeof value == 'string' || typeof other == 'string') {
  5873. value = baseToString(value);
  5874. other = baseToString(other);
  5875. } else {
  5876. value = baseToNumber(value);
  5877. other = baseToNumber(other);
  5878. }
  5879. result = operator(value, other);
  5880. }
  5881. return result;
  5882. };
  5883. }
  5884. /**
  5885. * Creates a function like `_.over`.
  5886. *
  5887. * @private
  5888. * @param {Function} arrayFunc The function to iterate over iteratees.
  5889. * @returns {Function} Returns the new over function.
  5890. */
  5891. function createOver(arrayFunc) {
  5892. return flatRest(function(iteratees) {
  5893. iteratees = arrayMap(iteratees, baseUnary(getIteratee()));
  5894. return baseRest(function(args) {
  5895. var thisArg = this;
  5896. return arrayFunc(iteratees, function(iteratee) {
  5897. return apply(iteratee, thisArg, args);
  5898. });
  5899. });
  5900. });
  5901. }
  5902. /**
  5903. * Creates the padding for `string` based on `length`. The `chars` string
  5904. * is truncated if the number of characters exceeds `length`.
  5905. *
  5906. * @private
  5907. * @param {number} length The padding length.
  5908. * @param {string} [chars=' '] The string used as padding.
  5909. * @returns {string} Returns the padding for `string`.
  5910. */
  5911. function createPadding(length, chars) {
  5912. chars = chars === undefined ? ' ' : baseToString(chars);
  5913. var charsLength = chars.length;
  5914. if (charsLength < 2) {
  5915. return charsLength ? baseRepeat(chars, length) : chars;
  5916. }
  5917. var result = baseRepeat(chars, nativeCeil(length / stringSize(chars)));
  5918. return hasUnicode(chars)
  5919. ? castSlice(stringToArray(result), 0, length).join('')
  5920. : result.slice(0, length);
  5921. }
  5922. /**
  5923. * Creates a function that wraps `func` to invoke it with the `this` binding
  5924. * of `thisArg` and `partials` prepended to the arguments it receives.
  5925. *
  5926. * @private
  5927. * @param {Function} func The function to wrap.
  5928. * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
  5929. * @param {*} thisArg The `this` binding of `func`.
  5930. * @param {Array} partials The arguments to prepend to those provided to
  5931. * the new function.
  5932. * @returns {Function} Returns the new wrapped function.
  5933. */
  5934. function createPartial(func, bitmask, thisArg, partials) {
  5935. var isBind = bitmask & WRAP_BIND_FLAG,
  5936. Ctor = createCtor(func);
  5937. function wrapper() {
  5938. var argsIndex = -1,
  5939. argsLength = arguments.length,
  5940. leftIndex = -1,
  5941. leftLength = partials.length,
  5942. args = Array(leftLength + argsLength),
  5943. fn = (this && this !== root && this instanceof wrapper) ? Ctor : func;
  5944. while (++leftIndex < leftLength) {
  5945. args[leftIndex] = partials[leftIndex];
  5946. }
  5947. while (argsLength--) {
  5948. args[leftIndex++] = arguments[++argsIndex];
  5949. }
  5950. return apply(fn, isBind ? thisArg : this, args);
  5951. }
  5952. return wrapper;
  5953. }
  5954. /**
  5955. * Creates a `_.range` or `_.rangeRight` function.
  5956. *
  5957. * @private
  5958. * @param {boolean} [fromRight] Specify iterating from right to left.
  5959. * @returns {Function} Returns the new range function.
  5960. */
  5961. function createRange(fromRight) {
  5962. return function(start, end, step) {
  5963. if (step && typeof step != 'number' && isIterateeCall(start, end, step)) {
  5964. end = step = undefined;
  5965. }
  5966. // Ensure the sign of `-0` is preserved.
  5967. start = toFinite(start);
  5968. if (end === undefined) {
  5969. end = start;
  5970. start = 0;
  5971. } else {
  5972. end = toFinite(end);
  5973. }
  5974. step = step === undefined ? (start < end ? 1 : -1) : toFinite(step);
  5975. return baseRange(start, end, step, fromRight);
  5976. };
  5977. }
  5978. /**
  5979. * Creates a function that performs a relational operation on two values.
  5980. *
  5981. * @private
  5982. * @param {Function} operator The function to perform the operation.
  5983. * @returns {Function} Returns the new relational operation function.
  5984. */
  5985. function createRelationalOperation(operator) {
  5986. return function(value, other) {
  5987. if (!(typeof value == 'string' && typeof other == 'string')) {
  5988. value = toNumber(value);
  5989. other = toNumber(other);
  5990. }
  5991. return operator(value, other);
  5992. };
  5993. }
  5994. /**
  5995. * Creates a function that wraps `func` to continue currying.
  5996. *
  5997. * @private
  5998. * @param {Function} func The function to wrap.
  5999. * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
  6000. * @param {Function} wrapFunc The function to create the `func` wrapper.
  6001. * @param {*} placeholder The placeholder value.
  6002. * @param {*} [thisArg] The `this` binding of `func`.
  6003. * @param {Array} [partials] The arguments to prepend to those provided to
  6004. * the new function.
  6005. * @param {Array} [holders] The `partials` placeholder indexes.
  6006. * @param {Array} [argPos] The argument positions of the new function.
  6007. * @param {number} [ary] The arity cap of `func`.
  6008. * @param {number} [arity] The arity of `func`.
  6009. * @returns {Function} Returns the new wrapped function.
  6010. */
  6011. function createRecurry(func, bitmask, wrapFunc, placeholder, thisArg, partials, holders, argPos, ary, arity) {
  6012. var isCurry = bitmask & WRAP_CURRY_FLAG,
  6013. newHolders = isCurry ? holders : undefined,
  6014. newHoldersRight = isCurry ? undefined : holders,
  6015. newPartials = isCurry ? partials : undefined,
  6016. newPartialsRight = isCurry ? undefined : partials;
  6017. bitmask |= (isCurry ? WRAP_PARTIAL_FLAG : WRAP_PARTIAL_RIGHT_FLAG);
  6018. bitmask &= ~(isCurry ? WRAP_PARTIAL_RIGHT_FLAG : WRAP_PARTIAL_FLAG);
  6019. if (!(bitmask & WRAP_CURRY_BOUND_FLAG)) {
  6020. bitmask &= ~(WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG);
  6021. }
  6022. var newData = [
  6023. func, bitmask, thisArg, newPartials, newHolders, newPartialsRight,
  6024. newHoldersRight, argPos, ary, arity
  6025. ];
  6026. var result = wrapFunc.apply(undefined, newData);
  6027. if (isLaziable(func)) {
  6028. setData(result, newData);
  6029. }
  6030. result.placeholder = placeholder;
  6031. return setWrapToString(result, func, bitmask);
  6032. }
  6033. /**
  6034. * Creates a function like `_.round`.
  6035. *
  6036. * @private
  6037. * @param {string} methodName The name of the `Math` method to use when rounding.
  6038. * @returns {Function} Returns the new round function.
  6039. */
  6040. function createRound(methodName) {
  6041. var func = Math[methodName];
  6042. return function(number, precision) {
  6043. number = toNumber(number);
  6044. precision = precision == null ? 0 : nativeMin(toInteger(precision), 292);
  6045. if (precision && nativeIsFinite(number)) {
  6046. // Shift with exponential notation to avoid floating-point issues.
  6047. // See [MDN](https://mdn.io/round#Examples) for more details.
  6048. var pair = (toString(number) + 'e').split('e'),
  6049. value = func(pair[0] + 'e' + (+pair[1] + precision));
  6050. pair = (toString(value) + 'e').split('e');
  6051. return +(pair[0] + 'e' + (+pair[1] - precision));
  6052. }
  6053. return func(number);
  6054. };
  6055. }
  6056. /**
  6057. * Creates a set object of `values`.
  6058. *
  6059. * @private
  6060. * @param {Array} values The values to add to the set.
  6061. * @returns {Object} Returns the new set.
  6062. */
  6063. var createSet = !(Set && (1 / setToArray(new Set([,-0]))[1]) == INFINITY) ? noop : function(values) {
  6064. return new Set(values);
  6065. };
  6066. /**
  6067. * Creates a `_.toPairs` or `_.toPairsIn` function.
  6068. *
  6069. * @private
  6070. * @param {Function} keysFunc The function to get the keys of a given object.
  6071. * @returns {Function} Returns the new pairs function.
  6072. */
  6073. function createToPairs(keysFunc) {
  6074. return function(object) {
  6075. var tag = getTag(object);
  6076. if (tag == mapTag) {
  6077. return mapToArray(object);
  6078. }
  6079. if (tag == setTag) {
  6080. return setToPairs(object);
  6081. }
  6082. return baseToPairs(object, keysFunc(object));
  6083. };
  6084. }
  6085. /**
  6086. * Creates a function that either curries or invokes `func` with optional
  6087. * `this` binding and partially applied arguments.
  6088. *
  6089. * @private
  6090. * @param {Function|string} func The function or method name to wrap.
  6091. * @param {number} bitmask The bitmask flags.
  6092. * 1 - `_.bind`
  6093. * 2 - `_.bindKey`
  6094. * 4 - `_.curry` or `_.curryRight` of a bound function
  6095. * 8 - `_.curry`
  6096. * 16 - `_.curryRight`
  6097. * 32 - `_.partial`
  6098. * 64 - `_.partialRight`
  6099. * 128 - `_.rearg`
  6100. * 256 - `_.ary`
  6101. * 512 - `_.flip`
  6102. * @param {*} [thisArg] The `this` binding of `func`.
  6103. * @param {Array} [partials] The arguments to be partially applied.
  6104. * @param {Array} [holders] The `partials` placeholder indexes.
  6105. * @param {Array} [argPos] The argument positions of the new function.
  6106. * @param {number} [ary] The arity cap of `func`.
  6107. * @param {number} [arity] The arity of `func`.
  6108. * @returns {Function} Returns the new wrapped function.
  6109. */
  6110. function createWrap(func, bitmask, thisArg, partials, holders, argPos, ary, arity) {
  6111. var isBindKey = bitmask & WRAP_BIND_KEY_FLAG;
  6112. if (!isBindKey && typeof func != 'function') {
  6113. throw new TypeError(FUNC_ERROR_TEXT);
  6114. }
  6115. var length = partials ? partials.length : 0;
  6116. if (!length) {
  6117. bitmask &= ~(WRAP_PARTIAL_FLAG | WRAP_PARTIAL_RIGHT_FLAG);
  6118. partials = holders = undefined;
  6119. }
  6120. ary = ary === undefined ? ary : nativeMax(toInteger(ary), 0);
  6121. arity = arity === undefined ? arity : toInteger(arity);
  6122. length -= holders ? holders.length : 0;
  6123. if (bitmask & WRAP_PARTIAL_RIGHT_FLAG) {
  6124. var partialsRight = partials,
  6125. holdersRight = holders;
  6126. partials = holders = undefined;
  6127. }
  6128. var data = isBindKey ? undefined : getData(func);
  6129. var newData = [
  6130. func, bitmask, thisArg, partials, holders, partialsRight, holdersRight,
  6131. argPos, ary, arity
  6132. ];
  6133. if (data) {
  6134. mergeData(newData, data);
  6135. }
  6136. func = newData[0];
  6137. bitmask = newData[1];
  6138. thisArg = newData[2];
  6139. partials = newData[3];
  6140. holders = newData[4];
  6141. arity = newData[9] = newData[9] === undefined
  6142. ? (isBindKey ? 0 : func.length)
  6143. : nativeMax(newData[9] - length, 0);
  6144. if (!arity && bitmask & (WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG)) {
  6145. bitmask &= ~(WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG);
  6146. }
  6147. if (!bitmask || bitmask == WRAP_BIND_FLAG) {
  6148. var result = createBind(func, bitmask, thisArg);
  6149. } else if (bitmask == WRAP_CURRY_FLAG || bitmask == WRAP_CURRY_RIGHT_FLAG) {
  6150. result = createCurry(func, bitmask, arity);
  6151. } else if ((bitmask == WRAP_PARTIAL_FLAG || bitmask == (WRAP_BIND_FLAG | WRAP_PARTIAL_FLAG)) && !holders.length) {
  6152. result = createPartial(func, bitmask, thisArg, partials);
  6153. } else {
  6154. result = createHybrid.apply(undefined, newData);
  6155. }
  6156. var setter = data ? baseSetData : setData;
  6157. return setWrapToString(setter(result, newData), func, bitmask);
  6158. }
  6159. /**
  6160. * Used by `_.defaults` to customize its `_.assignIn` use to assign properties
  6161. * of source objects to the destination object for all destination properties
  6162. * that resolve to `undefined`.
  6163. *
  6164. * @private
  6165. * @param {*} objValue The destination value.
  6166. * @param {*} srcValue The source value.
  6167. * @param {string} key The key of the property to assign.
  6168. * @param {Object} object The parent object of `objValue`.
  6169. * @returns {*} Returns the value to assign.
  6170. */
  6171. function customDefaultsAssignIn(objValue, srcValue, key, object) {
  6172. if (objValue === undefined ||
  6173. (eq(objValue, objectProto[key]) && !hasOwnProperty.call(object, key))) {
  6174. return srcValue;
  6175. }
  6176. return objValue;
  6177. }
  6178. /**
  6179. * Used by `_.defaultsDeep` to customize its `_.merge` use to merge source
  6180. * objects into destination objects that are passed thru.
  6181. *
  6182. * @private
  6183. * @param {*} objValue The destination value.
  6184. * @param {*} srcValue The source value.
  6185. * @param {string} key The key of the property to merge.
  6186. * @param {Object} object The parent object of `objValue`.
  6187. * @param {Object} source The parent object of `srcValue`.
  6188. * @param {Object} [stack] Tracks traversed source values and their merged
  6189. * counterparts.
  6190. * @returns {*} Returns the value to assign.
  6191. */
  6192. function customDefaultsMerge(objValue, srcValue, key, object, source, stack) {
  6193. if (isObject(objValue) && isObject(srcValue)) {
  6194. // Recursively merge objects and arrays (susceptible to call stack limits).
  6195. stack.set(srcValue, objValue);
  6196. baseMerge(objValue, srcValue, undefined, customDefaultsMerge, stack);
  6197. stack['delete'](srcValue);
  6198. }
  6199. return objValue;
  6200. }
  6201. /**
  6202. * Used by `_.omit` to customize its `_.cloneDeep` use to only clone plain
  6203. * objects.
  6204. *
  6205. * @private
  6206. * @param {*} value The value to inspect.
  6207. * @param {string} key The key of the property to inspect.
  6208. * @returns {*} Returns the uncloned value or `undefined` to defer cloning to `_.cloneDeep`.
  6209. */
  6210. function customOmitClone(value) {
  6211. return isPlainObject(value) ? undefined : value;
  6212. }
  6213. /**
  6214. * A specialized version of `baseIsEqualDeep` for arrays with support for
  6215. * partial deep comparisons.
  6216. *
  6217. * @private
  6218. * @param {Array} array The array to compare.
  6219. * @param {Array} other The other array to compare.
  6220. * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
  6221. * @param {Function} customizer The function to customize comparisons.
  6222. * @param {Function} equalFunc The function to determine equivalents of values.
  6223. * @param {Object} stack Tracks traversed `array` and `other` objects.
  6224. * @returns {boolean} Returns `true` if the arrays are equivalent, else `false`.
  6225. */
  6226. function equalArrays(array, other, bitmask, customizer, equalFunc, stack) {
  6227. var isPartial = bitmask & COMPARE_PARTIAL_FLAG,
  6228. arrLength = array.length,
  6229. othLength = other.length;
  6230. if (arrLength != othLength && !(isPartial && othLength > arrLength)) {
  6231. return false;
  6232. }
  6233. // Check that cyclic values are equal.
  6234. var arrStacked = stack.get(array);
  6235. var othStacked = stack.get(other);
  6236. if (arrStacked && othStacked) {
  6237. return arrStacked == other && othStacked == array;
  6238. }
  6239. var index = -1,
  6240. result = true,
  6241. seen = (bitmask & COMPARE_UNORDERED_FLAG) ? new SetCache : undefined;
  6242. stack.set(array, other);
  6243. stack.set(other, array);
  6244. // Ignore non-index properties.
  6245. while (++index < arrLength) {
  6246. var arrValue = array[index],
  6247. othValue = other[index];
  6248. if (customizer) {
  6249. var compared = isPartial
  6250. ? customizer(othValue, arrValue, index, other, array, stack)
  6251. : customizer(arrValue, othValue, index, array, other, stack);
  6252. }
  6253. if (compared !== undefined) {
  6254. if (compared) {
  6255. continue;
  6256. }
  6257. result = false;
  6258. break;
  6259. }
  6260. // Recursively compare arrays (susceptible to call stack limits).
  6261. if (seen) {
  6262. if (!arraySome(other, function(othValue, othIndex) {
  6263. if (!cacheHas(seen, othIndex) &&
  6264. (arrValue === othValue || equalFunc(arrValue, othValue, bitmask, customizer, stack))) {
  6265. return seen.push(othIndex);
  6266. }
  6267. })) {
  6268. result = false;
  6269. break;
  6270. }
  6271. } else if (!(
  6272. arrValue === othValue ||
  6273. equalFunc(arrValue, othValue, bitmask, customizer, stack)
  6274. )) {
  6275. result = false;
  6276. break;
  6277. }
  6278. }
  6279. stack['delete'](array);
  6280. stack['delete'](other);
  6281. return result;
  6282. }
  6283. /**
  6284. * A specialized version of `baseIsEqualDeep` for comparing objects of
  6285. * the same `toStringTag`.
  6286. *
  6287. * **Note:** This function only supports comparing values with tags of
  6288. * `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`.
  6289. *
  6290. * @private
  6291. * @param {Object} object The object to compare.
  6292. * @param {Object} other The other object to compare.
  6293. * @param {string} tag The `toStringTag` of the objects to compare.
  6294. * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
  6295. * @param {Function} customizer The function to customize comparisons.
  6296. * @param {Function} equalFunc The function to determine equivalents of values.
  6297. * @param {Object} stack Tracks traversed `object` and `other` objects.
  6298. * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
  6299. */
  6300. function equalByTag(object, other, tag, bitmask, customizer, equalFunc, stack) {
  6301. switch (tag) {
  6302. case dataViewTag:
  6303. if ((object.byteLength != other.byteLength) ||
  6304. (object.byteOffset != other.byteOffset)) {
  6305. return false;
  6306. }
  6307. object = object.buffer;
  6308. other = other.buffer;
  6309. case arrayBufferTag:
  6310. if ((object.byteLength != other.byteLength) ||
  6311. !equalFunc(new Uint8Array(object), new Uint8Array(other))) {
  6312. return false;
  6313. }
  6314. return true;
  6315. case boolTag:
  6316. case dateTag:
  6317. case numberTag:
  6318. // Coerce booleans to `1` or `0` and dates to milliseconds.
  6319. // Invalid dates are coerced to `NaN`.
  6320. return eq(+object, +other);
  6321. case errorTag:
  6322. return object.name == other.name && object.message == other.message;
  6323. case regexpTag:
  6324. case stringTag:
  6325. // Coerce regexes to strings and treat strings, primitives and objects,
  6326. // as equal. See http://www.ecma-international.org/ecma-262/7.0/#sec-regexp.prototype.tostring
  6327. // for more details.
  6328. return object == (other + '');
  6329. case mapTag:
  6330. var convert = mapToArray;
  6331. case setTag:
  6332. var isPartial = bitmask & COMPARE_PARTIAL_FLAG;
  6333. convert || (convert = setToArray);
  6334. if (object.size != other.size && !isPartial) {
  6335. return false;
  6336. }
  6337. // Assume cyclic values are equal.
  6338. var stacked = stack.get(object);
  6339. if (stacked) {
  6340. return stacked == other;
  6341. }
  6342. bitmask |= COMPARE_UNORDERED_FLAG;
  6343. // Recursively compare objects (susceptible to call stack limits).
  6344. stack.set(object, other);
  6345. var result = equalArrays(convert(object), convert(other), bitmask, customizer, equalFunc, stack);
  6346. stack['delete'](object);
  6347. return result;
  6348. case symbolTag:
  6349. if (symbolValueOf) {
  6350. return symbolValueOf.call(object) == symbolValueOf.call(other);
  6351. }
  6352. }
  6353. return false;
  6354. }
  6355. /**
  6356. * A specialized version of `baseIsEqualDeep` for objects with support for
  6357. * partial deep comparisons.
  6358. *
  6359. * @private
  6360. * @param {Object} object The object to compare.
  6361. * @param {Object} other The other object to compare.
  6362. * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
  6363. * @param {Function} customizer The function to customize comparisons.
  6364. * @param {Function} equalFunc The function to determine equivalents of values.
  6365. * @param {Object} stack Tracks traversed `object` and `other` objects.
  6366. * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
  6367. */
  6368. function equalObjects(object, other, bitmask, customizer, equalFunc, stack) {
  6369. var isPartial = bitmask & COMPARE_PARTIAL_FLAG,
  6370. objProps = getAllKeys(object),
  6371. objLength = objProps.length,
  6372. othProps = getAllKeys(other),
  6373. othLength = othProps.length;
  6374. if (objLength != othLength && !isPartial) {
  6375. return false;
  6376. }
  6377. var index = objLength;
  6378. while (index--) {
  6379. var key = objProps[index];
  6380. if (!(isPartial ? key in other : hasOwnProperty.call(other, key))) {
  6381. return false;
  6382. }
  6383. }
  6384. // Check that cyclic values are equal.
  6385. var objStacked = stack.get(object);
  6386. var othStacked = stack.get(other);
  6387. if (objStacked && othStacked) {
  6388. return objStacked == other && othStacked == object;
  6389. }
  6390. var result = true;
  6391. stack.set(object, other);
  6392. stack.set(other, object);
  6393. var skipCtor = isPartial;
  6394. while (++index < objLength) {
  6395. key = objProps[index];
  6396. var objValue = object[key],
  6397. othValue = other[key];
  6398. if (customizer) {
  6399. var compared = isPartial
  6400. ? customizer(othValue, objValue, key, other, object, stack)
  6401. : customizer(objValue, othValue, key, object, other, stack);
  6402. }
  6403. // Recursively compare objects (susceptible to call stack limits).
  6404. if (!(compared === undefined
  6405. ? (objValue === othValue || equalFunc(objValue, othValue, bitmask, customizer, stack))
  6406. : compared
  6407. )) {
  6408. result = false;
  6409. break;
  6410. }
  6411. skipCtor || (skipCtor = key == 'constructor');
  6412. }
  6413. if (result && !skipCtor) {
  6414. var objCtor = object.constructor,
  6415. othCtor = other.constructor;
  6416. // Non `Object` object instances with different constructors are not equal.
  6417. if (objCtor != othCtor &&
  6418. ('constructor' in object && 'constructor' in other) &&
  6419. !(typeof objCtor == 'function' && objCtor instanceof objCtor &&
  6420. typeof othCtor == 'function' && othCtor instanceof othCtor)) {
  6421. result = false;
  6422. }
  6423. }
  6424. stack['delete'](object);
  6425. stack['delete'](other);
  6426. return result;
  6427. }
  6428. /**
  6429. * A specialized version of `baseRest` which flattens the rest array.
  6430. *
  6431. * @private
  6432. * @param {Function} func The function to apply a rest parameter to.
  6433. * @returns {Function} Returns the new function.
  6434. */
  6435. function flatRest(func) {
  6436. return setToString(overRest(func, undefined, flatten), func + '');
  6437. }
  6438. /**
  6439. * Creates an array of own enumerable property names and symbols of `object`.
  6440. *
  6441. * @private
  6442. * @param {Object} object The object to query.
  6443. * @returns {Array} Returns the array of property names and symbols.
  6444. */
  6445. function getAllKeys(object) {
  6446. return baseGetAllKeys(object, keys, getSymbols);
  6447. }
  6448. /**
  6449. * Creates an array of own and inherited enumerable property names and
  6450. * symbols of `object`.
  6451. *
  6452. * @private
  6453. * @param {Object} object The object to query.
  6454. * @returns {Array} Returns the array of property names and symbols.
  6455. */
  6456. function getAllKeysIn(object) {
  6457. return baseGetAllKeys(object, keysIn, getSymbolsIn);
  6458. }
  6459. /**
  6460. * Gets metadata for `func`.
  6461. *
  6462. * @private
  6463. * @param {Function} func The function to query.
  6464. * @returns {*} Returns the metadata for `func`.
  6465. */
  6466. var getData = !metaMap ? noop : function(func) {
  6467. return metaMap.get(func);
  6468. };
  6469. /**
  6470. * Gets the name of `func`.
  6471. *
  6472. * @private
  6473. * @param {Function} func The function to query.
  6474. * @returns {string} Returns the function name.
  6475. */
  6476. function getFuncName(func) {
  6477. var result = (func.name + ''),
  6478. array = realNames[result],
  6479. length = hasOwnProperty.call(realNames, result) ? array.length : 0;
  6480. while (length--) {
  6481. var data = array[length],
  6482. otherFunc = data.func;
  6483. if (otherFunc == null || otherFunc == func) {
  6484. return data.name;
  6485. }
  6486. }
  6487. return result;
  6488. }
  6489. /**
  6490. * Gets the argument placeholder value for `func`.
  6491. *
  6492. * @private
  6493. * @param {Function} func The function to inspect.
  6494. * @returns {*} Returns the placeholder value.
  6495. */
  6496. function getHolder(func) {
  6497. var object = hasOwnProperty.call(lodash, 'placeholder') ? lodash : func;
  6498. return object.placeholder;
  6499. }
  6500. /**
  6501. * Gets the appropriate "iteratee" function. If `_.iteratee` is customized,
  6502. * this function returns the custom method, otherwise it returns `baseIteratee`.
  6503. * If arguments are provided, the chosen function is invoked with them and
  6504. * its result is returned.
  6505. *
  6506. * @private
  6507. * @param {*} [value] The value to convert to an iteratee.
  6508. * @param {number} [arity] The arity of the created iteratee.
  6509. * @returns {Function} Returns the chosen function or its result.
  6510. */
  6511. function getIteratee() {
  6512. var result = lodash.iteratee || iteratee;
  6513. result = result === iteratee ? baseIteratee : result;
  6514. return arguments.length ? result(arguments[0], arguments[1]) : result;
  6515. }
  6516. /**
  6517. * Gets the data for `map`.
  6518. *
  6519. * @private
  6520. * @param {Object} map The map to query.
  6521. * @param {string} key The reference key.
  6522. * @returns {*} Returns the map data.
  6523. */
  6524. function getMapData(map, key) {
  6525. var data = map.__data__;
  6526. return isKeyable(key)
  6527. ? data[typeof key == 'string' ? 'string' : 'hash']
  6528. : data.map;
  6529. }
  6530. /**
  6531. * Gets the property names, values, and compare flags of `object`.
  6532. *
  6533. * @private
  6534. * @param {Object} object The object to query.
  6535. * @returns {Array} Returns the match data of `object`.
  6536. */
  6537. function getMatchData(object) {
  6538. var result = keys(object),
  6539. length = result.length;
  6540. while (length--) {
  6541. var key = result[length],
  6542. value = object[key];
  6543. result[length] = [key, value, isStrictComparable(value)];
  6544. }
  6545. return result;
  6546. }
  6547. /**
  6548. * Gets the native function at `key` of `object`.
  6549. *
  6550. * @private
  6551. * @param {Object} object The object to query.
  6552. * @param {string} key The key of the method to get.
  6553. * @returns {*} Returns the function if it's native, else `undefined`.
  6554. */
  6555. function getNative(object, key) {
  6556. var value = getValue(object, key);
  6557. return baseIsNative(value) ? value : undefined;
  6558. }
  6559. /**
  6560. * A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values.
  6561. *
  6562. * @private
  6563. * @param {*} value The value to query.
  6564. * @returns {string} Returns the raw `toStringTag`.
  6565. */
  6566. function getRawTag(value) {
  6567. var isOwn = hasOwnProperty.call(value, symToStringTag),
  6568. tag = value[symToStringTag];
  6569. try {
  6570. value[symToStringTag] = undefined;
  6571. var unmasked = true;
  6572. } catch (e) {}
  6573. var result = nativeObjectToString.call(value);
  6574. if (unmasked) {
  6575. if (isOwn) {
  6576. value[symToStringTag] = tag;
  6577. } else {
  6578. delete value[symToStringTag];
  6579. }
  6580. }
  6581. return result;
  6582. }
  6583. /**
  6584. * Creates an array of the own enumerable symbols of `object`.
  6585. *
  6586. * @private
  6587. * @param {Object} object The object to query.
  6588. * @returns {Array} Returns the array of symbols.
  6589. */
  6590. var getSymbols = !nativeGetSymbols ? stubArray : function(object) {
  6591. if (object == null) {
  6592. return [];
  6593. }
  6594. object = Object(object);
  6595. return arrayFilter(nativeGetSymbols(object), function(symbol) {
  6596. return propertyIsEnumerable.call(object, symbol);
  6597. });
  6598. };
  6599. /**
  6600. * Creates an array of the own and inherited enumerable symbols of `object`.
  6601. *
  6602. * @private
  6603. * @param {Object} object The object to query.
  6604. * @returns {Array} Returns the array of symbols.
  6605. */
  6606. var getSymbolsIn = !nativeGetSymbols ? stubArray : function(object) {
  6607. var result = [];
  6608. while (object) {
  6609. arrayPush(result, getSymbols(object));
  6610. object = getPrototype(object);
  6611. }
  6612. return result;
  6613. };
  6614. /**
  6615. * Gets the `toStringTag` of `value`.
  6616. *
  6617. * @private
  6618. * @param {*} value The value to query.
  6619. * @returns {string} Returns the `toStringTag`.
  6620. */
  6621. var getTag = baseGetTag;
  6622. // Fallback for data views, maps, sets, and weak maps in IE 11 and promises in Node.js < 6.
  6623. if ((DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag) ||
  6624. (Map && getTag(new Map) != mapTag) ||
  6625. (Promise && getTag(Promise.resolve()) != promiseTag) ||
  6626. (Set && getTag(new Set) != setTag) ||
  6627. (WeakMap && getTag(new WeakMap) != weakMapTag)) {
  6628. getTag = function(value) {
  6629. var result = baseGetTag(value),
  6630. Ctor = result == objectTag ? value.constructor : undefined,
  6631. ctorString = Ctor ? toSource(Ctor) : '';
  6632. if (ctorString) {
  6633. switch (ctorString) {
  6634. case dataViewCtorString: return dataViewTag;
  6635. case mapCtorString: return mapTag;
  6636. case promiseCtorString: return promiseTag;
  6637. case setCtorString: return setTag;
  6638. case weakMapCtorString: return weakMapTag;
  6639. }
  6640. }
  6641. return result;
  6642. };
  6643. }
  6644. /**
  6645. * Gets the view, applying any `transforms` to the `start` and `end` positions.
  6646. *
  6647. * @private
  6648. * @param {number} start The start of the view.
  6649. * @param {number} end The end of the view.
  6650. * @param {Array} transforms The transformations to apply to the view.
  6651. * @returns {Object} Returns an object containing the `start` and `end`
  6652. * positions of the view.
  6653. */
  6654. function getView(start, end, transforms) {
  6655. var index = -1,
  6656. length = transforms.length;
  6657. while (++index < length) {
  6658. var data = transforms[index],
  6659. size = data.size;
  6660. switch (data.type) {
  6661. case 'drop': start += size; break;
  6662. case 'dropRight': end -= size; break;
  6663. case 'take': end = nativeMin(end, start + size); break;
  6664. case 'takeRight': start = nativeMax(start, end - size); break;
  6665. }
  6666. }
  6667. return { 'start': start, 'end': end };
  6668. }
  6669. /**
  6670. * Extracts wrapper details from the `source` body comment.
  6671. *
  6672. * @private
  6673. * @param {string} source The source to inspect.
  6674. * @returns {Array} Returns the wrapper details.
  6675. */
  6676. function getWrapDetails(source) {
  6677. var match = source.match(reWrapDetails);
  6678. return match ? match[1].split(reSplitDetails) : [];
  6679. }
  6680. /**
  6681. * Checks if `path` exists on `object`.
  6682. *
  6683. * @private
  6684. * @param {Object} object The object to query.
  6685. * @param {Array|string} path The path to check.
  6686. * @param {Function} hasFunc The function to check properties.
  6687. * @returns {boolean} Returns `true` if `path` exists, else `false`.
  6688. */
  6689. function hasPath(object, path, hasFunc) {
  6690. path = castPath(path, object);
  6691. var index = -1,
  6692. length = path.length,
  6693. result = false;
  6694. while (++index < length) {
  6695. var key = toKey(path[index]);
  6696. if (!(result = object != null && hasFunc(object, key))) {
  6697. break;
  6698. }
  6699. object = object[key];
  6700. }
  6701. if (result || ++index != length) {
  6702. return result;
  6703. }
  6704. length = object == null ? 0 : object.length;
  6705. return !!length && isLength(length) && isIndex(key, length) &&
  6706. (isArray(object) || isArguments(object));
  6707. }
  6708. /**
  6709. * Initializes an array clone.
  6710. *
  6711. * @private
  6712. * @param {Array} array The array to clone.
  6713. * @returns {Array} Returns the initialized clone.
  6714. */
  6715. function initCloneArray(array) {
  6716. var length = array.length,
  6717. result = new array.constructor(length);
  6718. // Add properties assigned by `RegExp#exec`.
  6719. if (length && typeof array[0] == 'string' && hasOwnProperty.call(array, 'index')) {
  6720. result.index = array.index;
  6721. result.input = array.input;
  6722. }
  6723. return result;
  6724. }
  6725. /**
  6726. * Initializes an object clone.
  6727. *
  6728. * @private
  6729. * @param {Object} object The object to clone.
  6730. * @returns {Object} Returns the initialized clone.
  6731. */
  6732. function initCloneObject(object) {
  6733. return (typeof object.constructor == 'function' && !isPrototype(object))
  6734. ? baseCreate(getPrototype(object))
  6735. : {};
  6736. }
  6737. /**
  6738. * Initializes an object clone based on its `toStringTag`.
  6739. *
  6740. * **Note:** This function only supports cloning values with tags of
  6741. * `Boolean`, `Date`, `Error`, `Map`, `Number`, `RegExp`, `Set`, or `String`.
  6742. *
  6743. * @private
  6744. * @param {Object} object The object to clone.
  6745. * @param {string} tag The `toStringTag` of the object to clone.
  6746. * @param {boolean} [isDeep] Specify a deep clone.
  6747. * @returns {Object} Returns the initialized clone.
  6748. */
  6749. function initCloneByTag(object, tag, isDeep) {
  6750. var Ctor = object.constructor;
  6751. switch (tag) {
  6752. case arrayBufferTag:
  6753. return cloneArrayBuffer(object);
  6754. case boolTag:
  6755. case dateTag:
  6756. return new Ctor(+object);
  6757. case dataViewTag:
  6758. return cloneDataView(object, isDeep);
  6759. case float32Tag: case float64Tag:
  6760. case int8Tag: case int16Tag: case int32Tag:
  6761. case uint8Tag: case uint8ClampedTag: case uint16Tag: case uint32Tag:
  6762. return cloneTypedArray(object, isDeep);
  6763. case mapTag:
  6764. return new Ctor;
  6765. case numberTag:
  6766. case stringTag:
  6767. return new Ctor(object);
  6768. case regexpTag:
  6769. return cloneRegExp(object);
  6770. case setTag:
  6771. return new Ctor;
  6772. case symbolTag:
  6773. return cloneSymbol(object);
  6774. }
  6775. }
  6776. /**
  6777. * Inserts wrapper `details` in a comment at the top of the `source` body.
  6778. *
  6779. * @private
  6780. * @param {string} source The source to modify.
  6781. * @returns {Array} details The details to insert.
  6782. * @returns {string} Returns the modified source.
  6783. */
  6784. function insertWrapDetails(source, details) {
  6785. var length = details.length;
  6786. if (!length) {
  6787. return source;
  6788. }
  6789. var lastIndex = length - 1;
  6790. details[lastIndex] = (length > 1 ? '& ' : '') + details[lastIndex];
  6791. details = details.join(length > 2 ? ', ' : ' ');
  6792. return source.replace(reWrapComment, '{\n/* [wrapped with ' + details + '] */\n');
  6793. }
  6794. /**
  6795. * Checks if `value` is a flattenable `arguments` object or array.
  6796. *
  6797. * @private
  6798. * @param {*} value The value to check.
  6799. * @returns {boolean} Returns `true` if `value` is flattenable, else `false`.
  6800. */
  6801. function isFlattenable(value) {
  6802. return isArray(value) || isArguments(value) ||
  6803. !!(spreadableSymbol && value && value[spreadableSymbol]);
  6804. }
  6805. /**
  6806. * Checks if `value` is a valid array-like index.
  6807. *
  6808. * @private
  6809. * @param {*} value The value to check.
  6810. * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.
  6811. * @returns {boolean} Returns `true` if `value` is a valid index, else `false`.
  6812. */
  6813. function isIndex(value, length) {
  6814. var type = typeof value;
  6815. length = length == null ? MAX_SAFE_INTEGER : length;
  6816. return !!length &&
  6817. (type == 'number' ||
  6818. (type != 'symbol' && reIsUint.test(value))) &&
  6819. (value > -1 && value % 1 == 0 && value < length);
  6820. }
  6821. /**
  6822. * Checks if the given arguments are from an iteratee call.
  6823. *
  6824. * @private
  6825. * @param {*} value The potential iteratee value argument.
  6826. * @param {*} index The potential iteratee index or key argument.
  6827. * @param {*} object The potential iteratee object argument.
  6828. * @returns {boolean} Returns `true` if the arguments are from an iteratee call,
  6829. * else `false`.
  6830. */
  6831. function isIterateeCall(value, index, object) {
  6832. if (!isObject(object)) {
  6833. return false;
  6834. }
  6835. var type = typeof index;
  6836. if (type == 'number'
  6837. ? (isArrayLike(object) && isIndex(index, object.length))
  6838. : (type == 'string' && index in object)
  6839. ) {
  6840. return eq(object[index], value);
  6841. }
  6842. return false;
  6843. }
  6844. /**
  6845. * Checks if `value` is a property name and not a property path.
  6846. *
  6847. * @private
  6848. * @param {*} value The value to check.
  6849. * @param {Object} [object] The object to query keys on.
  6850. * @returns {boolean} Returns `true` if `value` is a property name, else `false`.
  6851. */
  6852. function isKey(value, object) {
  6853. if (isArray(value)) {
  6854. return false;
  6855. }
  6856. var type = typeof value;
  6857. if (type == 'number' || type == 'symbol' || type == 'boolean' ||
  6858. value == null || isSymbol(value)) {
  6859. return true;
  6860. }
  6861. return reIsPlainProp.test(value) || !reIsDeepProp.test(value) ||
  6862. (object != null && value in Object(object));
  6863. }
  6864. /**
  6865. * Checks if `value` is suitable for use as unique object key.
  6866. *
  6867. * @private
  6868. * @param {*} value The value to check.
  6869. * @returns {boolean} Returns `true` if `value` is suitable, else `false`.
  6870. */
  6871. function isKeyable(value) {
  6872. var type = typeof value;
  6873. return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean')
  6874. ? (value !== '__proto__')
  6875. : (value === null);
  6876. }
  6877. /**
  6878. * Checks if `func` has a lazy counterpart.
  6879. *
  6880. * @private
  6881. * @param {Function} func The function to check.
  6882. * @returns {boolean} Returns `true` if `func` has a lazy counterpart,
  6883. * else `false`.
  6884. */
  6885. function isLaziable(func) {
  6886. var funcName = getFuncName(func),
  6887. other = lodash[funcName];
  6888. if (typeof other != 'function' || !(funcName in LazyWrapper.prototype)) {
  6889. return false;
  6890. }
  6891. if (func === other) {
  6892. return true;
  6893. }
  6894. var data = getData(other);
  6895. return !!data && func === data[0];
  6896. }
  6897. /**
  6898. * Checks if `func` has its source masked.
  6899. *
  6900. * @private
  6901. * @param {Function} func The function to check.
  6902. * @returns {boolean} Returns `true` if `func` is masked, else `false`.
  6903. */
  6904. function isMasked(func) {
  6905. return !!maskSrcKey && (maskSrcKey in func);
  6906. }
  6907. /**
  6908. * Checks if `func` is capable of being masked.
  6909. *
  6910. * @private
  6911. * @param {*} value The value to check.
  6912. * @returns {boolean} Returns `true` if `func` is maskable, else `false`.
  6913. */
  6914. var isMaskable = coreJsData ? isFunction : stubFalse;
  6915. /**
  6916. * Checks if `value` is likely a prototype object.
  6917. *
  6918. * @private
  6919. * @param {*} value The value to check.
  6920. * @returns {boolean} Returns `true` if `value` is a prototype, else `false`.
  6921. */
  6922. function isPrototype(value) {
  6923. var Ctor = value && value.constructor,
  6924. proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto;
  6925. return value === proto;
  6926. }
  6927. /**
  6928. * Checks if `value` is suitable for strict equality comparisons, i.e. `===`.
  6929. *
  6930. * @private
  6931. * @param {*} value The value to check.
  6932. * @returns {boolean} Returns `true` if `value` if suitable for strict
  6933. * equality comparisons, else `false`.
  6934. */
  6935. function isStrictComparable(value) {
  6936. return value === value && !isObject(value);
  6937. }
  6938. /**
  6939. * A specialized version of `matchesProperty` for source values suitable
  6940. * for strict equality comparisons, i.e. `===`.
  6941. *
  6942. * @private
  6943. * @param {string} key The key of the property to get.
  6944. * @param {*} srcValue The value to match.
  6945. * @returns {Function} Returns the new spec function.
  6946. */
  6947. function matchesStrictComparable(key, srcValue) {
  6948. return function(object) {
  6949. if (object == null) {
  6950. return false;
  6951. }
  6952. return object[key] === srcValue &&
  6953. (srcValue !== undefined || (key in Object(object)));
  6954. };
  6955. }
  6956. /**
  6957. * A specialized version of `_.memoize` which clears the memoized function's
  6958. * cache when it exceeds `MAX_MEMOIZE_SIZE`.
  6959. *
  6960. * @private
  6961. * @param {Function} func The function to have its output memoized.
  6962. * @returns {Function} Returns the new memoized function.
  6963. */
  6964. function memoizeCapped(func) {
  6965. var result = memoize(func, function(key) {
  6966. if (cache.size === MAX_MEMOIZE_SIZE) {
  6967. cache.clear();
  6968. }
  6969. return key;
  6970. });
  6971. var cache = result.cache;
  6972. return result;
  6973. }
  6974. /**
  6975. * Merges the function metadata of `source` into `data`.
  6976. *
  6977. * Merging metadata reduces the number of wrappers used to invoke a function.
  6978. * This is possible because methods like `_.bind`, `_.curry`, and `_.partial`
  6979. * may be applied regardless of execution order. Methods like `_.ary` and
  6980. * `_.rearg` modify function arguments, making the order in which they are
  6981. * executed important, preventing the merging of metadata. However, we make
  6982. * an exception for a safe combined case where curried functions have `_.ary`
  6983. * and or `_.rearg` applied.
  6984. *
  6985. * @private
  6986. * @param {Array} data The destination metadata.
  6987. * @param {Array} source The source metadata.
  6988. * @returns {Array} Returns `data`.
  6989. */
  6990. function mergeData(data, source) {
  6991. var bitmask = data[1],
  6992. srcBitmask = source[1],
  6993. newBitmask = bitmask | srcBitmask,
  6994. isCommon = newBitmask < (WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG | WRAP_ARY_FLAG);
  6995. var isCombo =
  6996. ((srcBitmask == WRAP_ARY_FLAG) && (bitmask == WRAP_CURRY_FLAG)) ||
  6997. ((srcBitmask == WRAP_ARY_FLAG) && (bitmask == WRAP_REARG_FLAG) && (data[7].length <= source[8])) ||
  6998. ((srcBitmask == (WRAP_ARY_FLAG | WRAP_REARG_FLAG)) && (source[7].length <= source[8]) && (bitmask == WRAP_CURRY_FLAG));
  6999. // Exit early if metadata can't be merged.
  7000. if (!(isCommon || isCombo)) {
  7001. return data;
  7002. }
  7003. // Use source `thisArg` if available.
  7004. if (srcBitmask & WRAP_BIND_FLAG) {
  7005. data[2] = source[2];
  7006. // Set when currying a bound function.
  7007. newBitmask |= bitmask & WRAP_BIND_FLAG ? 0 : WRAP_CURRY_BOUND_FLAG;
  7008. }
  7009. // Compose partial arguments.
  7010. var value = source[3];
  7011. if (value) {
  7012. var partials = data[3];
  7013. data[3] = partials ? composeArgs(partials, value, source[4]) : value;
  7014. data[4] = partials ? replaceHolders(data[3], PLACEHOLDER) : source[4];
  7015. }
  7016. // Compose partial right arguments.
  7017. value = source[5];
  7018. if (value) {
  7019. partials = data[5];
  7020. data[5] = partials ? composeArgsRight(partials, value, source[6]) : value;
  7021. data[6] = partials ? replaceHolders(data[5], PLACEHOLDER) : source[6];
  7022. }
  7023. // Use source `argPos` if available.
  7024. value = source[7];
  7025. if (value) {
  7026. data[7] = value;
  7027. }
  7028. // Use source `ary` if it's smaller.
  7029. if (srcBitmask & WRAP_ARY_FLAG) {
  7030. data[8] = data[8] == null ? source[8] : nativeMin(data[8], source[8]);
  7031. }
  7032. // Use source `arity` if one is not provided.
  7033. if (data[9] == null) {
  7034. data[9] = source[9];
  7035. }
  7036. // Use source `func` and merge bitmasks.
  7037. data[0] = source[0];
  7038. data[1] = newBitmask;
  7039. return data;
  7040. }
  7041. /**
  7042. * This function is like
  7043. * [`Object.keys`](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)
  7044. * except that it includes inherited enumerable properties.
  7045. *
  7046. * @private
  7047. * @param {Object} object The object to query.
  7048. * @returns {Array} Returns the array of property names.
  7049. */
  7050. function nativeKeysIn(object) {
  7051. var result = [];
  7052. if (object != null) {
  7053. for (var key in Object(object)) {
  7054. result.push(key);
  7055. }
  7056. }
  7057. return result;
  7058. }
  7059. /**
  7060. * Converts `value` to a string using `Object.prototype.toString`.
  7061. *
  7062. * @private
  7063. * @param {*} value The value to convert.
  7064. * @returns {string} Returns the converted string.
  7065. */
  7066. function objectToString(value) {
  7067. return nativeObjectToString.call(value);
  7068. }
  7069. /**
  7070. * A specialized version of `baseRest` which transforms the rest array.
  7071. *
  7072. * @private
  7073. * @param {Function} func The function to apply a rest parameter to.
  7074. * @param {number} [start=func.length-1] The start position of the rest parameter.
  7075. * @param {Function} transform The rest array transform.
  7076. * @returns {Function} Returns the new function.
  7077. */
  7078. function overRest(func, start, transform) {
  7079. start = nativeMax(start === undefined ? (func.length - 1) : start, 0);
  7080. return function() {
  7081. var args = arguments,
  7082. index = -1,
  7083. length = nativeMax(args.length - start, 0),
  7084. array = Array(length);
  7085. while (++index < length) {
  7086. array[index] = args[start + index];
  7087. }
  7088. index = -1;
  7089. var otherArgs = Array(start + 1);
  7090. while (++index < start) {
  7091. otherArgs[index] = args[index];
  7092. }
  7093. otherArgs[start] = transform(array);
  7094. return apply(func, this, otherArgs);
  7095. };
  7096. }
  7097. /**
  7098. * Gets the parent value at `path` of `object`.
  7099. *
  7100. * @private
  7101. * @param {Object} object The object to query.
  7102. * @param {Array} path The path to get the parent value of.
  7103. * @returns {*} Returns the parent value.
  7104. */
  7105. function parent(object, path) {
  7106. return path.length < 2 ? object : baseGet(object, baseSlice(path, 0, -1));
  7107. }
  7108. /**
  7109. * Reorder `array` according to the specified indexes where the element at
  7110. * the first index is assigned as the first element, the element at
  7111. * the second index is assigned as the second element, and so on.
  7112. *
  7113. * @private
  7114. * @param {Array} array The array to reorder.
  7115. * @param {Array} indexes The arranged array indexes.
  7116. * @returns {Array} Returns `array`.
  7117. */
  7118. function reorder(array, indexes) {
  7119. var arrLength = array.length,
  7120. length = nativeMin(indexes.length, arrLength),
  7121. oldArray = copyArray(array);
  7122. while (length--) {
  7123. var index = indexes[length];
  7124. array[length] = isIndex(index, arrLength) ? oldArray[index] : undefined;
  7125. }
  7126. return array;
  7127. }
  7128. /**
  7129. * Gets the value at `key`, unless `key` is "__proto__" or "constructor".
  7130. *
  7131. * @private
  7132. * @param {Object} object The object to query.
  7133. * @param {string} key The key of the property to get.
  7134. * @returns {*} Returns the property value.
  7135. */
  7136. function safeGet(object, key) {
  7137. if (key === 'constructor' && typeof object[key] === 'function') {
  7138. return;
  7139. }
  7140. if (key == '__proto__') {
  7141. return;
  7142. }
  7143. return object[key];
  7144. }
  7145. /**
  7146. * Sets metadata for `func`.
  7147. *
  7148. * **Note:** If this function becomes hot, i.e. is invoked a lot in a short
  7149. * period of time, it will trip its breaker and transition to an identity
  7150. * function to avoid garbage collection pauses in V8. See
  7151. * [V8 issue 2070](https://bugs.chromium.org/p/v8/issues/detail?id=2070)
  7152. * for more details.
  7153. *
  7154. * @private
  7155. * @param {Function} func The function to associate metadata with.
  7156. * @param {*} data The metadata.
  7157. * @returns {Function} Returns `func`.
  7158. */
  7159. var setData = shortOut(baseSetData);
  7160. /**
  7161. * A simple wrapper around the global [`setTimeout`](https://mdn.io/setTimeout).
  7162. *
  7163. * @private
  7164. * @param {Function} func The function to delay.
  7165. * @param {number} wait The number of milliseconds to delay invocation.
  7166. * @returns {number|Object} Returns the timer id or timeout object.
  7167. */
  7168. var setTimeout = ctxSetTimeout || function(func, wait) {
  7169. return root.setTimeout(func, wait);
  7170. };
  7171. /**
  7172. * Sets the `toString` method of `func` to return `string`.
  7173. *
  7174. * @private
  7175. * @param {Function} func The function to modify.
  7176. * @param {Function} string The `toString` result.
  7177. * @returns {Function} Returns `func`.
  7178. */
  7179. var setToString = shortOut(baseSetToString);
  7180. /**
  7181. * Sets the `toString` method of `wrapper` to mimic the source of `reference`
  7182. * with wrapper details in a comment at the top of the source body.
  7183. *
  7184. * @private
  7185. * @param {Function} wrapper The function to modify.
  7186. * @param {Function} reference The reference function.
  7187. * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
  7188. * @returns {Function} Returns `wrapper`.
  7189. */
  7190. function setWrapToString(wrapper, reference, bitmask) {
  7191. var source = (reference + '');
  7192. return setToString(wrapper, insertWrapDetails(source, updateWrapDetails(getWrapDetails(source), bitmask)));
  7193. }
  7194. /**
  7195. * Creates a function that'll short out and invoke `identity` instead
  7196. * of `func` when it's called `HOT_COUNT` or more times in `HOT_SPAN`
  7197. * milliseconds.
  7198. *
  7199. * @private
  7200. * @param {Function} func The function to restrict.
  7201. * @returns {Function} Returns the new shortable function.
  7202. */
  7203. function shortOut(func) {
  7204. var count = 0,
  7205. lastCalled = 0;
  7206. return function() {
  7207. var stamp = nativeNow(),
  7208. remaining = HOT_SPAN - (stamp - lastCalled);
  7209. lastCalled = stamp;
  7210. if (remaining > 0) {
  7211. if (++count >= HOT_COUNT) {
  7212. return arguments[0];
  7213. }
  7214. } else {
  7215. count = 0;
  7216. }
  7217. return func.apply(undefined, arguments);
  7218. };
  7219. }
  7220. /**
  7221. * A specialized version of `_.shuffle` which mutates and sets the size of `array`.
  7222. *
  7223. * @private
  7224. * @param {Array} array The array to shuffle.
  7225. * @param {number} [size=array.length] The size of `array`.
  7226. * @returns {Array} Returns `array`.
  7227. */
  7228. function shuffleSelf(array, size) {
  7229. var index = -1,
  7230. length = array.length,
  7231. lastIndex = length - 1;
  7232. size = size === undefined ? length : size;
  7233. while (++index < size) {
  7234. var rand = baseRandom(index, lastIndex),
  7235. value = array[rand];
  7236. array[rand] = array[index];
  7237. array[index] = value;
  7238. }
  7239. array.length = size;
  7240. return array;
  7241. }
  7242. /**
  7243. * Converts `string` to a property path array.
  7244. *
  7245. * @private
  7246. * @param {string} string The string to convert.
  7247. * @returns {Array} Returns the property path array.
  7248. */
  7249. var stringToPath = memoizeCapped(function(string) {
  7250. var result = [];
  7251. if (string.charCodeAt(0) === 46 /* . */) {
  7252. result.push('');
  7253. }
  7254. string.replace(rePropName, function(match, number, quote, subString) {
  7255. result.push(quote ? subString.replace(reEscapeChar, '$1') : (number || match));
  7256. });
  7257. return result;
  7258. });
  7259. /**
  7260. * Converts `value` to a string key if it's not a string or symbol.
  7261. *
  7262. * @private
  7263. * @param {*} value The value to inspect.
  7264. * @returns {string|symbol} Returns the key.
  7265. */
  7266. function toKey(value) {
  7267. if (typeof value == 'string' || isSymbol(value)) {
  7268. return value;
  7269. }
  7270. var result = (value + '');
  7271. return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;
  7272. }
  7273. /**
  7274. * Converts `func` to its source code.
  7275. *
  7276. * @private
  7277. * @param {Function} func The function to convert.
  7278. * @returns {string} Returns the source code.
  7279. */
  7280. function toSource(func) {
  7281. if (func != null) {
  7282. try {
  7283. return funcToString.call(func);
  7284. } catch (e) {}
  7285. try {
  7286. return (func + '');
  7287. } catch (e) {}
  7288. }
  7289. return '';
  7290. }
  7291. /**
  7292. * Updates wrapper `details` based on `bitmask` flags.
  7293. *
  7294. * @private
  7295. * @returns {Array} details The details to modify.
  7296. * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
  7297. * @returns {Array} Returns `details`.
  7298. */
  7299. function updateWrapDetails(details, bitmask) {
  7300. arrayEach(wrapFlags, function(pair) {
  7301. var value = '_.' + pair[0];
  7302. if ((bitmask & pair[1]) && !arrayIncludes(details, value)) {
  7303. details.push(value);
  7304. }
  7305. });
  7306. return details.sort();
  7307. }
  7308. /**
  7309. * Creates a clone of `wrapper`.
  7310. *
  7311. * @private
  7312. * @param {Object} wrapper The wrapper to clone.
  7313. * @returns {Object} Returns the cloned wrapper.
  7314. */
  7315. function wrapperClone(wrapper) {
  7316. if (wrapper instanceof LazyWrapper) {
  7317. return wrapper.clone();
  7318. }
  7319. var result = new LodashWrapper(wrapper.__wrapped__, wrapper.__chain__);
  7320. result.__actions__ = copyArray(wrapper.__actions__);
  7321. result.__index__ = wrapper.__index__;
  7322. result.__values__ = wrapper.__values__;
  7323. return result;
  7324. }
  7325. /*------------------------------------------------------------------------*/
  7326. /**
  7327. * Creates an array of elements split into groups the length of `size`.
  7328. * If `array` can't be split evenly, the final chunk will be the remaining
  7329. * elements.
  7330. *
  7331. * @static
  7332. * @memberOf _
  7333. * @since 3.0.0
  7334. * @category Array
  7335. * @param {Array} array The array to process.
  7336. * @param {number} [size=1] The length of each chunk
  7337. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  7338. * @returns {Array} Returns the new array of chunks.
  7339. * @example
  7340. *
  7341. * _.chunk(['a', 'b', 'c', 'd'], 2);
  7342. * // => [['a', 'b'], ['c', 'd']]
  7343. *
  7344. * _.chunk(['a', 'b', 'c', 'd'], 3);
  7345. * // => [['a', 'b', 'c'], ['d']]
  7346. */
  7347. function chunk(array, size, guard) {
  7348. if ((guard ? isIterateeCall(array, size, guard) : size === undefined)) {
  7349. size = 1;
  7350. } else {
  7351. size = nativeMax(toInteger(size), 0);
  7352. }
  7353. var length = array == null ? 0 : array.length;
  7354. if (!length || size < 1) {
  7355. return [];
  7356. }
  7357. var index = 0,
  7358. resIndex = 0,
  7359. result = Array(nativeCeil(length / size));
  7360. while (index < length) {
  7361. result[resIndex++] = baseSlice(array, index, (index += size));
  7362. }
  7363. return result;
  7364. }
  7365. /**
  7366. * Creates an array with all falsey values removed. The values `false`, `null`,
  7367. * `0`, `""`, `undefined`, and `NaN` are falsey.
  7368. *
  7369. * @static
  7370. * @memberOf _
  7371. * @since 0.1.0
  7372. * @category Array
  7373. * @param {Array} array The array to compact.
  7374. * @returns {Array} Returns the new array of filtered values.
  7375. * @example
  7376. *
  7377. * _.compact([0, 1, false, 2, '', 3]);
  7378. * // => [1, 2, 3]
  7379. */
  7380. function compact(array) {
  7381. var index = -1,
  7382. length = array == null ? 0 : array.length,
  7383. resIndex = 0,
  7384. result = [];
  7385. while (++index < length) {
  7386. var value = array[index];
  7387. if (value) {
  7388. result[resIndex++] = value;
  7389. }
  7390. }
  7391. return result;
  7392. }
  7393. /**
  7394. * Creates a new array concatenating `array` with any additional arrays
  7395. * and/or values.
  7396. *
  7397. * @static
  7398. * @memberOf _
  7399. * @since 4.0.0
  7400. * @category Array
  7401. * @param {Array} array The array to concatenate.
  7402. * @param {...*} [values] The values to concatenate.
  7403. * @returns {Array} Returns the new concatenated array.
  7404. * @example
  7405. *
  7406. * var array = [1];
  7407. * var other = _.concat(array, 2, [3], [[4]]);
  7408. *
  7409. * console.log(other);
  7410. * // => [1, 2, 3, [4]]
  7411. *
  7412. * console.log(array);
  7413. * // => [1]
  7414. */
  7415. function concat() {
  7416. var length = arguments.length;
  7417. if (!length) {
  7418. return [];
  7419. }
  7420. var args = Array(length - 1),
  7421. array = arguments[0],
  7422. index = length;
  7423. while (index--) {
  7424. args[index - 1] = arguments[index];
  7425. }
  7426. return arrayPush(isArray(array) ? copyArray(array) : [array], baseFlatten(args, 1));
  7427. }
  7428. /**
  7429. * Creates an array of `array` values not included in the other given arrays
  7430. * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  7431. * for equality comparisons. The order and references of result values are
  7432. * determined by the first array.
  7433. *
  7434. * **Note:** Unlike `_.pullAll`, this method returns a new array.
  7435. *
  7436. * @static
  7437. * @memberOf _
  7438. * @since 0.1.0
  7439. * @category Array
  7440. * @param {Array} array The array to inspect.
  7441. * @param {...Array} [values] The values to exclude.
  7442. * @returns {Array} Returns the new array of filtered values.
  7443. * @see _.without, _.xor
  7444. * @example
  7445. *
  7446. * _.difference([2, 1], [2, 3]);
  7447. * // => [1]
  7448. */
  7449. var difference = baseRest(function(array, values) {
  7450. return isArrayLikeObject(array)
  7451. ? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true))
  7452. : [];
  7453. });
  7454. /**
  7455. * This method is like `_.difference` except that it accepts `iteratee` which
  7456. * is invoked for each element of `array` and `values` to generate the criterion
  7457. * by which they're compared. The order and references of result values are
  7458. * determined by the first array. The iteratee is invoked with one argument:
  7459. * (value).
  7460. *
  7461. * **Note:** Unlike `_.pullAllBy`, this method returns a new array.
  7462. *
  7463. * @static
  7464. * @memberOf _
  7465. * @since 4.0.0
  7466. * @category Array
  7467. * @param {Array} array The array to inspect.
  7468. * @param {...Array} [values] The values to exclude.
  7469. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  7470. * @returns {Array} Returns the new array of filtered values.
  7471. * @example
  7472. *
  7473. * _.differenceBy([2.1, 1.2], [2.3, 3.4], Math.floor);
  7474. * // => [1.2]
  7475. *
  7476. * // The `_.property` iteratee shorthand.
  7477. * _.differenceBy([{ 'x': 2 }, { 'x': 1 }], [{ 'x': 1 }], 'x');
  7478. * // => [{ 'x': 2 }]
  7479. */
  7480. var differenceBy = baseRest(function(array, values) {
  7481. var iteratee = last(values);
  7482. if (isArrayLikeObject(iteratee)) {
  7483. iteratee = undefined;
  7484. }
  7485. return isArrayLikeObject(array)
  7486. ? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true), getIteratee(iteratee, 2))
  7487. : [];
  7488. });
  7489. /**
  7490. * This method is like `_.difference` except that it accepts `comparator`
  7491. * which is invoked to compare elements of `array` to `values`. The order and
  7492. * references of result values are determined by the first array. The comparator
  7493. * is invoked with two arguments: (arrVal, othVal).
  7494. *
  7495. * **Note:** Unlike `_.pullAllWith`, this method returns a new array.
  7496. *
  7497. * @static
  7498. * @memberOf _
  7499. * @since 4.0.0
  7500. * @category Array
  7501. * @param {Array} array The array to inspect.
  7502. * @param {...Array} [values] The values to exclude.
  7503. * @param {Function} [comparator] The comparator invoked per element.
  7504. * @returns {Array} Returns the new array of filtered values.
  7505. * @example
  7506. *
  7507. * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }];
  7508. *
  7509. * _.differenceWith(objects, [{ 'x': 1, 'y': 2 }], _.isEqual);
  7510. * // => [{ 'x': 2, 'y': 1 }]
  7511. */
  7512. var differenceWith = baseRest(function(array, values) {
  7513. var comparator = last(values);
  7514. if (isArrayLikeObject(comparator)) {
  7515. comparator = undefined;
  7516. }
  7517. return isArrayLikeObject(array)
  7518. ? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true), undefined, comparator)
  7519. : [];
  7520. });
  7521. /**
  7522. * Creates a slice of `array` with `n` elements dropped from the beginning.
  7523. *
  7524. * @static
  7525. * @memberOf _
  7526. * @since 0.5.0
  7527. * @category Array
  7528. * @param {Array} array The array to query.
  7529. * @param {number} [n=1] The number of elements to drop.
  7530. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  7531. * @returns {Array} Returns the slice of `array`.
  7532. * @example
  7533. *
  7534. * _.drop([1, 2, 3]);
  7535. * // => [2, 3]
  7536. *
  7537. * _.drop([1, 2, 3], 2);
  7538. * // => [3]
  7539. *
  7540. * _.drop([1, 2, 3], 5);
  7541. * // => []
  7542. *
  7543. * _.drop([1, 2, 3], 0);
  7544. * // => [1, 2, 3]
  7545. */
  7546. function drop(array, n, guard) {
  7547. var length = array == null ? 0 : array.length;
  7548. if (!length) {
  7549. return [];
  7550. }
  7551. n = (guard || n === undefined) ? 1 : toInteger(n);
  7552. return baseSlice(array, n < 0 ? 0 : n, length);
  7553. }
  7554. /**
  7555. * Creates a slice of `array` with `n` elements dropped from the end.
  7556. *
  7557. * @static
  7558. * @memberOf _
  7559. * @since 3.0.0
  7560. * @category Array
  7561. * @param {Array} array The array to query.
  7562. * @param {number} [n=1] The number of elements to drop.
  7563. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  7564. * @returns {Array} Returns the slice of `array`.
  7565. * @example
  7566. *
  7567. * _.dropRight([1, 2, 3]);
  7568. * // => [1, 2]
  7569. *
  7570. * _.dropRight([1, 2, 3], 2);
  7571. * // => [1]
  7572. *
  7573. * _.dropRight([1, 2, 3], 5);
  7574. * // => []
  7575. *
  7576. * _.dropRight([1, 2, 3], 0);
  7577. * // => [1, 2, 3]
  7578. */
  7579. function dropRight(array, n, guard) {
  7580. var length = array == null ? 0 : array.length;
  7581. if (!length) {
  7582. return [];
  7583. }
  7584. n = (guard || n === undefined) ? 1 : toInteger(n);
  7585. n = length - n;
  7586. return baseSlice(array, 0, n < 0 ? 0 : n);
  7587. }
  7588. /**
  7589. * Creates a slice of `array` excluding elements dropped from the end.
  7590. * Elements are dropped until `predicate` returns falsey. The predicate is
  7591. * invoked with three arguments: (value, index, array).
  7592. *
  7593. * @static
  7594. * @memberOf _
  7595. * @since 3.0.0
  7596. * @category Array
  7597. * @param {Array} array The array to query.
  7598. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  7599. * @returns {Array} Returns the slice of `array`.
  7600. * @example
  7601. *
  7602. * var users = [
  7603. * { 'user': 'barney', 'active': true },
  7604. * { 'user': 'fred', 'active': false },
  7605. * { 'user': 'pebbles', 'active': false }
  7606. * ];
  7607. *
  7608. * _.dropRightWhile(users, function(o) { return !o.active; });
  7609. * // => objects for ['barney']
  7610. *
  7611. * // The `_.matches` iteratee shorthand.
  7612. * _.dropRightWhile(users, { 'user': 'pebbles', 'active': false });
  7613. * // => objects for ['barney', 'fred']
  7614. *
  7615. * // The `_.matchesProperty` iteratee shorthand.
  7616. * _.dropRightWhile(users, ['active', false]);
  7617. * // => objects for ['barney']
  7618. *
  7619. * // The `_.property` iteratee shorthand.
  7620. * _.dropRightWhile(users, 'active');
  7621. * // => objects for ['barney', 'fred', 'pebbles']
  7622. */
  7623. function dropRightWhile(array, predicate) {
  7624. return (array && array.length)
  7625. ? baseWhile(array, getIteratee(predicate, 3), true, true)
  7626. : [];
  7627. }
  7628. /**
  7629. * Creates a slice of `array` excluding elements dropped from the beginning.
  7630. * Elements are dropped until `predicate` returns falsey. The predicate is
  7631. * invoked with three arguments: (value, index, array).
  7632. *
  7633. * @static
  7634. * @memberOf _
  7635. * @since 3.0.0
  7636. * @category Array
  7637. * @param {Array} array The array to query.
  7638. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  7639. * @returns {Array} Returns the slice of `array`.
  7640. * @example
  7641. *
  7642. * var users = [
  7643. * { 'user': 'barney', 'active': false },
  7644. * { 'user': 'fred', 'active': false },
  7645. * { 'user': 'pebbles', 'active': true }
  7646. * ];
  7647. *
  7648. * _.dropWhile(users, function(o) { return !o.active; });
  7649. * // => objects for ['pebbles']
  7650. *
  7651. * // The `_.matches` iteratee shorthand.
  7652. * _.dropWhile(users, { 'user': 'barney', 'active': false });
  7653. * // => objects for ['fred', 'pebbles']
  7654. *
  7655. * // The `_.matchesProperty` iteratee shorthand.
  7656. * _.dropWhile(users, ['active', false]);
  7657. * // => objects for ['pebbles']
  7658. *
  7659. * // The `_.property` iteratee shorthand.
  7660. * _.dropWhile(users, 'active');
  7661. * // => objects for ['barney', 'fred', 'pebbles']
  7662. */
  7663. function dropWhile(array, predicate) {
  7664. return (array && array.length)
  7665. ? baseWhile(array, getIteratee(predicate, 3), true)
  7666. : [];
  7667. }
  7668. /**
  7669. * Fills elements of `array` with `value` from `start` up to, but not
  7670. * including, `end`.
  7671. *
  7672. * **Note:** This method mutates `array`.
  7673. *
  7674. * @static
  7675. * @memberOf _
  7676. * @since 3.2.0
  7677. * @category Array
  7678. * @param {Array} array The array to fill.
  7679. * @param {*} value The value to fill `array` with.
  7680. * @param {number} [start=0] The start position.
  7681. * @param {number} [end=array.length] The end position.
  7682. * @returns {Array} Returns `array`.
  7683. * @example
  7684. *
  7685. * var array = [1, 2, 3];
  7686. *
  7687. * _.fill(array, 'a');
  7688. * console.log(array);
  7689. * // => ['a', 'a', 'a']
  7690. *
  7691. * _.fill(Array(3), 2);
  7692. * // => [2, 2, 2]
  7693. *
  7694. * _.fill([4, 6, 8, 10], '*', 1, 3);
  7695. * // => [4, '*', '*', 10]
  7696. */
  7697. function fill(array, value, start, end) {
  7698. var length = array == null ? 0 : array.length;
  7699. if (!length) {
  7700. return [];
  7701. }
  7702. if (start && typeof start != 'number' && isIterateeCall(array, value, start)) {
  7703. start = 0;
  7704. end = length;
  7705. }
  7706. return baseFill(array, value, start, end);
  7707. }
  7708. /**
  7709. * This method is like `_.find` except that it returns the index of the first
  7710. * element `predicate` returns truthy for instead of the element itself.
  7711. *
  7712. * @static
  7713. * @memberOf _
  7714. * @since 1.1.0
  7715. * @category Array
  7716. * @param {Array} array The array to inspect.
  7717. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  7718. * @param {number} [fromIndex=0] The index to search from.
  7719. * @returns {number} Returns the index of the found element, else `-1`.
  7720. * @example
  7721. *
  7722. * var users = [
  7723. * { 'user': 'barney', 'active': false },
  7724. * { 'user': 'fred', 'active': false },
  7725. * { 'user': 'pebbles', 'active': true }
  7726. * ];
  7727. *
  7728. * _.findIndex(users, function(o) { return o.user == 'barney'; });
  7729. * // => 0
  7730. *
  7731. * // The `_.matches` iteratee shorthand.
  7732. * _.findIndex(users, { 'user': 'fred', 'active': false });
  7733. * // => 1
  7734. *
  7735. * // The `_.matchesProperty` iteratee shorthand.
  7736. * _.findIndex(users, ['active', false]);
  7737. * // => 0
  7738. *
  7739. * // The `_.property` iteratee shorthand.
  7740. * _.findIndex(users, 'active');
  7741. * // => 2
  7742. */
  7743. function findIndex(array, predicate, fromIndex) {
  7744. var length = array == null ? 0 : array.length;
  7745. if (!length) {
  7746. return -1;
  7747. }
  7748. var index = fromIndex == null ? 0 : toInteger(fromIndex);
  7749. if (index < 0) {
  7750. index = nativeMax(length + index, 0);
  7751. }
  7752. return baseFindIndex(array, getIteratee(predicate, 3), index);
  7753. }
  7754. /**
  7755. * This method is like `_.findIndex` except that it iterates over elements
  7756. * of `collection` from right to left.
  7757. *
  7758. * @static
  7759. * @memberOf _
  7760. * @since 2.0.0
  7761. * @category Array
  7762. * @param {Array} array The array to inspect.
  7763. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  7764. * @param {number} [fromIndex=array.length-1] The index to search from.
  7765. * @returns {number} Returns the index of the found element, else `-1`.
  7766. * @example
  7767. *
  7768. * var users = [
  7769. * { 'user': 'barney', 'active': true },
  7770. * { 'user': 'fred', 'active': false },
  7771. * { 'user': 'pebbles', 'active': false }
  7772. * ];
  7773. *
  7774. * _.findLastIndex(users, function(o) { return o.user == 'pebbles'; });
  7775. * // => 2
  7776. *
  7777. * // The `_.matches` iteratee shorthand.
  7778. * _.findLastIndex(users, { 'user': 'barney', 'active': true });
  7779. * // => 0
  7780. *
  7781. * // The `_.matchesProperty` iteratee shorthand.
  7782. * _.findLastIndex(users, ['active', false]);
  7783. * // => 2
  7784. *
  7785. * // The `_.property` iteratee shorthand.
  7786. * _.findLastIndex(users, 'active');
  7787. * // => 0
  7788. */
  7789. function findLastIndex(array, predicate, fromIndex) {
  7790. var length = array == null ? 0 : array.length;
  7791. if (!length) {
  7792. return -1;
  7793. }
  7794. var index = length - 1;
  7795. if (fromIndex !== undefined) {
  7796. index = toInteger(fromIndex);
  7797. index = fromIndex < 0
  7798. ? nativeMax(length + index, 0)
  7799. : nativeMin(index, length - 1);
  7800. }
  7801. return baseFindIndex(array, getIteratee(predicate, 3), index, true);
  7802. }
  7803. /**
  7804. * Flattens `array` a single level deep.
  7805. *
  7806. * @static
  7807. * @memberOf _
  7808. * @since 0.1.0
  7809. * @category Array
  7810. * @param {Array} array The array to flatten.
  7811. * @returns {Array} Returns the new flattened array.
  7812. * @example
  7813. *
  7814. * _.flatten([1, [2, [3, [4]], 5]]);
  7815. * // => [1, 2, [3, [4]], 5]
  7816. */
  7817. function flatten(array) {
  7818. var length = array == null ? 0 : array.length;
  7819. return length ? baseFlatten(array, 1) : [];
  7820. }
  7821. /**
  7822. * Recursively flattens `array`.
  7823. *
  7824. * @static
  7825. * @memberOf _
  7826. * @since 3.0.0
  7827. * @category Array
  7828. * @param {Array} array The array to flatten.
  7829. * @returns {Array} Returns the new flattened array.
  7830. * @example
  7831. *
  7832. * _.flattenDeep([1, [2, [3, [4]], 5]]);
  7833. * // => [1, 2, 3, 4, 5]
  7834. */
  7835. function flattenDeep(array) {
  7836. var length = array == null ? 0 : array.length;
  7837. return length ? baseFlatten(array, INFINITY) : [];
  7838. }
  7839. /**
  7840. * Recursively flatten `array` up to `depth` times.
  7841. *
  7842. * @static
  7843. * @memberOf _
  7844. * @since 4.4.0
  7845. * @category Array
  7846. * @param {Array} array The array to flatten.
  7847. * @param {number} [depth=1] The maximum recursion depth.
  7848. * @returns {Array} Returns the new flattened array.
  7849. * @example
  7850. *
  7851. * var array = [1, [2, [3, [4]], 5]];
  7852. *
  7853. * _.flattenDepth(array, 1);
  7854. * // => [1, 2, [3, [4]], 5]
  7855. *
  7856. * _.flattenDepth(array, 2);
  7857. * // => [1, 2, 3, [4], 5]
  7858. */
  7859. function flattenDepth(array, depth) {
  7860. var length = array == null ? 0 : array.length;
  7861. if (!length) {
  7862. return [];
  7863. }
  7864. depth = depth === undefined ? 1 : toInteger(depth);
  7865. return baseFlatten(array, depth);
  7866. }
  7867. /**
  7868. * The inverse of `_.toPairs`; this method returns an object composed
  7869. * from key-value `pairs`.
  7870. *
  7871. * @static
  7872. * @memberOf _
  7873. * @since 4.0.0
  7874. * @category Array
  7875. * @param {Array} pairs The key-value pairs.
  7876. * @returns {Object} Returns the new object.
  7877. * @example
  7878. *
  7879. * _.fromPairs([['a', 1], ['b', 2]]);
  7880. * // => { 'a': 1, 'b': 2 }
  7881. */
  7882. function fromPairs(pairs) {
  7883. var index = -1,
  7884. length = pairs == null ? 0 : pairs.length,
  7885. result = {};
  7886. while (++index < length) {
  7887. var pair = pairs[index];
  7888. result[pair[0]] = pair[1];
  7889. }
  7890. return result;
  7891. }
  7892. /**
  7893. * Gets the first element of `array`.
  7894. *
  7895. * @static
  7896. * @memberOf _
  7897. * @since 0.1.0
  7898. * @alias first
  7899. * @category Array
  7900. * @param {Array} array The array to query.
  7901. * @returns {*} Returns the first element of `array`.
  7902. * @example
  7903. *
  7904. * _.head([1, 2, 3]);
  7905. * // => 1
  7906. *
  7907. * _.head([]);
  7908. * // => undefined
  7909. */
  7910. function head(array) {
  7911. return (array && array.length) ? array[0] : undefined;
  7912. }
  7913. /**
  7914. * Gets the index at which the first occurrence of `value` is found in `array`
  7915. * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  7916. * for equality comparisons. If `fromIndex` is negative, it's used as the
  7917. * offset from the end of `array`.
  7918. *
  7919. * @static
  7920. * @memberOf _
  7921. * @since 0.1.0
  7922. * @category Array
  7923. * @param {Array} array The array to inspect.
  7924. * @param {*} value The value to search for.
  7925. * @param {number} [fromIndex=0] The index to search from.
  7926. * @returns {number} Returns the index of the matched value, else `-1`.
  7927. * @example
  7928. *
  7929. * _.indexOf([1, 2, 1, 2], 2);
  7930. * // => 1
  7931. *
  7932. * // Search from the `fromIndex`.
  7933. * _.indexOf([1, 2, 1, 2], 2, 2);
  7934. * // => 3
  7935. */
  7936. function indexOf(array, value, fromIndex) {
  7937. var length = array == null ? 0 : array.length;
  7938. if (!length) {
  7939. return -1;
  7940. }
  7941. var index = fromIndex == null ? 0 : toInteger(fromIndex);
  7942. if (index < 0) {
  7943. index = nativeMax(length + index, 0);
  7944. }
  7945. return baseIndexOf(array, value, index);
  7946. }
  7947. /**
  7948. * Gets all but the last element of `array`.
  7949. *
  7950. * @static
  7951. * @memberOf _
  7952. * @since 0.1.0
  7953. * @category Array
  7954. * @param {Array} array The array to query.
  7955. * @returns {Array} Returns the slice of `array`.
  7956. * @example
  7957. *
  7958. * _.initial([1, 2, 3]);
  7959. * // => [1, 2]
  7960. */
  7961. function initial(array) {
  7962. var length = array == null ? 0 : array.length;
  7963. return length ? baseSlice(array, 0, -1) : [];
  7964. }
  7965. /**
  7966. * Creates an array of unique values that are included in all given arrays
  7967. * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  7968. * for equality comparisons. The order and references of result values are
  7969. * determined by the first array.
  7970. *
  7971. * @static
  7972. * @memberOf _
  7973. * @since 0.1.0
  7974. * @category Array
  7975. * @param {...Array} [arrays] The arrays to inspect.
  7976. * @returns {Array} Returns the new array of intersecting values.
  7977. * @example
  7978. *
  7979. * _.intersection([2, 1], [2, 3]);
  7980. * // => [2]
  7981. */
  7982. var intersection = baseRest(function(arrays) {
  7983. var mapped = arrayMap(arrays, castArrayLikeObject);
  7984. return (mapped.length && mapped[0] === arrays[0])
  7985. ? baseIntersection(mapped)
  7986. : [];
  7987. });
  7988. /**
  7989. * This method is like `_.intersection` except that it accepts `iteratee`
  7990. * which is invoked for each element of each `arrays` to generate the criterion
  7991. * by which they're compared. The order and references of result values are
  7992. * determined by the first array. The iteratee is invoked with one argument:
  7993. * (value).
  7994. *
  7995. * @static
  7996. * @memberOf _
  7997. * @since 4.0.0
  7998. * @category Array
  7999. * @param {...Array} [arrays] The arrays to inspect.
  8000. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  8001. * @returns {Array} Returns the new array of intersecting values.
  8002. * @example
  8003. *
  8004. * _.intersectionBy([2.1, 1.2], [2.3, 3.4], Math.floor);
  8005. * // => [2.1]
  8006. *
  8007. * // The `_.property` iteratee shorthand.
  8008. * _.intersectionBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x');
  8009. * // => [{ 'x': 1 }]
  8010. */
  8011. var intersectionBy = baseRest(function(arrays) {
  8012. var iteratee = last(arrays),
  8013. mapped = arrayMap(arrays, castArrayLikeObject);
  8014. if (iteratee === last(mapped)) {
  8015. iteratee = undefined;
  8016. } else {
  8017. mapped.pop();
  8018. }
  8019. return (mapped.length && mapped[0] === arrays[0])
  8020. ? baseIntersection(mapped, getIteratee(iteratee, 2))
  8021. : [];
  8022. });
  8023. /**
  8024. * This method is like `_.intersection` except that it accepts `comparator`
  8025. * which is invoked to compare elements of `arrays`. The order and references
  8026. * of result values are determined by the first array. The comparator is
  8027. * invoked with two arguments: (arrVal, othVal).
  8028. *
  8029. * @static
  8030. * @memberOf _
  8031. * @since 4.0.0
  8032. * @category Array
  8033. * @param {...Array} [arrays] The arrays to inspect.
  8034. * @param {Function} [comparator] The comparator invoked per element.
  8035. * @returns {Array} Returns the new array of intersecting values.
  8036. * @example
  8037. *
  8038. * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }];
  8039. * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }];
  8040. *
  8041. * _.intersectionWith(objects, others, _.isEqual);
  8042. * // => [{ 'x': 1, 'y': 2 }]
  8043. */
  8044. var intersectionWith = baseRest(function(arrays) {
  8045. var comparator = last(arrays),
  8046. mapped = arrayMap(arrays, castArrayLikeObject);
  8047. comparator = typeof comparator == 'function' ? comparator : undefined;
  8048. if (comparator) {
  8049. mapped.pop();
  8050. }
  8051. return (mapped.length && mapped[0] === arrays[0])
  8052. ? baseIntersection(mapped, undefined, comparator)
  8053. : [];
  8054. });
  8055. /**
  8056. * Converts all elements in `array` into a string separated by `separator`.
  8057. *
  8058. * @static
  8059. * @memberOf _
  8060. * @since 4.0.0
  8061. * @category Array
  8062. * @param {Array} array The array to convert.
  8063. * @param {string} [separator=','] The element separator.
  8064. * @returns {string} Returns the joined string.
  8065. * @example
  8066. *
  8067. * _.join(['a', 'b', 'c'], '~');
  8068. * // => 'a~b~c'
  8069. */
  8070. function join(array, separator) {
  8071. return array == null ? '' : nativeJoin.call(array, separator);
  8072. }
  8073. /**
  8074. * Gets the last element of `array`.
  8075. *
  8076. * @static
  8077. * @memberOf _
  8078. * @since 0.1.0
  8079. * @category Array
  8080. * @param {Array} array The array to query.
  8081. * @returns {*} Returns the last element of `array`.
  8082. * @example
  8083. *
  8084. * _.last([1, 2, 3]);
  8085. * // => 3
  8086. */
  8087. function last(array) {
  8088. var length = array == null ? 0 : array.length;
  8089. return length ? array[length - 1] : undefined;
  8090. }
  8091. /**
  8092. * This method is like `_.indexOf` except that it iterates over elements of
  8093. * `array` from right to left.
  8094. *
  8095. * @static
  8096. * @memberOf _
  8097. * @since 0.1.0
  8098. * @category Array
  8099. * @param {Array} array The array to inspect.
  8100. * @param {*} value The value to search for.
  8101. * @param {number} [fromIndex=array.length-1] The index to search from.
  8102. * @returns {number} Returns the index of the matched value, else `-1`.
  8103. * @example
  8104. *
  8105. * _.lastIndexOf([1, 2, 1, 2], 2);
  8106. * // => 3
  8107. *
  8108. * // Search from the `fromIndex`.
  8109. * _.lastIndexOf([1, 2, 1, 2], 2, 2);
  8110. * // => 1
  8111. */
  8112. function lastIndexOf(array, value, fromIndex) {
  8113. var length = array == null ? 0 : array.length;
  8114. if (!length) {
  8115. return -1;
  8116. }
  8117. var index = length;
  8118. if (fromIndex !== undefined) {
  8119. index = toInteger(fromIndex);
  8120. index = index < 0 ? nativeMax(length + index, 0) : nativeMin(index, length - 1);
  8121. }
  8122. return value === value
  8123. ? strictLastIndexOf(array, value, index)
  8124. : baseFindIndex(array, baseIsNaN, index, true);
  8125. }
  8126. /**
  8127. * Gets the element at index `n` of `array`. If `n` is negative, the nth
  8128. * element from the end is returned.
  8129. *
  8130. * @static
  8131. * @memberOf _
  8132. * @since 4.11.0
  8133. * @category Array
  8134. * @param {Array} array The array to query.
  8135. * @param {number} [n=0] The index of the element to return.
  8136. * @returns {*} Returns the nth element of `array`.
  8137. * @example
  8138. *
  8139. * var array = ['a', 'b', 'c', 'd'];
  8140. *
  8141. * _.nth(array, 1);
  8142. * // => 'b'
  8143. *
  8144. * _.nth(array, -2);
  8145. * // => 'c';
  8146. */
  8147. function nth(array, n) {
  8148. return (array && array.length) ? baseNth(array, toInteger(n)) : undefined;
  8149. }
  8150. /**
  8151. * Removes all given values from `array` using
  8152. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  8153. * for equality comparisons.
  8154. *
  8155. * **Note:** Unlike `_.without`, this method mutates `array`. Use `_.remove`
  8156. * to remove elements from an array by predicate.
  8157. *
  8158. * @static
  8159. * @memberOf _
  8160. * @since 2.0.0
  8161. * @category Array
  8162. * @param {Array} array The array to modify.
  8163. * @param {...*} [values] The values to remove.
  8164. * @returns {Array} Returns `array`.
  8165. * @example
  8166. *
  8167. * var array = ['a', 'b', 'c', 'a', 'b', 'c'];
  8168. *
  8169. * _.pull(array, 'a', 'c');
  8170. * console.log(array);
  8171. * // => ['b', 'b']
  8172. */
  8173. var pull = baseRest(pullAll);
  8174. /**
  8175. * This method is like `_.pull` except that it accepts an array of values to remove.
  8176. *
  8177. * **Note:** Unlike `_.difference`, this method mutates `array`.
  8178. *
  8179. * @static
  8180. * @memberOf _
  8181. * @since 4.0.0
  8182. * @category Array
  8183. * @param {Array} array The array to modify.
  8184. * @param {Array} values The values to remove.
  8185. * @returns {Array} Returns `array`.
  8186. * @example
  8187. *
  8188. * var array = ['a', 'b', 'c', 'a', 'b', 'c'];
  8189. *
  8190. * _.pullAll(array, ['a', 'c']);
  8191. * console.log(array);
  8192. * // => ['b', 'b']
  8193. */
  8194. function pullAll(array, values) {
  8195. return (array && array.length && values && values.length)
  8196. ? basePullAll(array, values)
  8197. : array;
  8198. }
  8199. /**
  8200. * This method is like `_.pullAll` except that it accepts `iteratee` which is
  8201. * invoked for each element of `array` and `values` to generate the criterion
  8202. * by which they're compared. The iteratee is invoked with one argument: (value).
  8203. *
  8204. * **Note:** Unlike `_.differenceBy`, this method mutates `array`.
  8205. *
  8206. * @static
  8207. * @memberOf _
  8208. * @since 4.0.0
  8209. * @category Array
  8210. * @param {Array} array The array to modify.
  8211. * @param {Array} values The values to remove.
  8212. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  8213. * @returns {Array} Returns `array`.
  8214. * @example
  8215. *
  8216. * var array = [{ 'x': 1 }, { 'x': 2 }, { 'x': 3 }, { 'x': 1 }];
  8217. *
  8218. * _.pullAllBy(array, [{ 'x': 1 }, { 'x': 3 }], 'x');
  8219. * console.log(array);
  8220. * // => [{ 'x': 2 }]
  8221. */
  8222. function pullAllBy(array, values, iteratee) {
  8223. return (array && array.length && values && values.length)
  8224. ? basePullAll(array, values, getIteratee(iteratee, 2))
  8225. : array;
  8226. }
  8227. /**
  8228. * This method is like `_.pullAll` except that it accepts `comparator` which
  8229. * is invoked to compare elements of `array` to `values`. The comparator is
  8230. * invoked with two arguments: (arrVal, othVal).
  8231. *
  8232. * **Note:** Unlike `_.differenceWith`, this method mutates `array`.
  8233. *
  8234. * @static
  8235. * @memberOf _
  8236. * @since 4.6.0
  8237. * @category Array
  8238. * @param {Array} array The array to modify.
  8239. * @param {Array} values The values to remove.
  8240. * @param {Function} [comparator] The comparator invoked per element.
  8241. * @returns {Array} Returns `array`.
  8242. * @example
  8243. *
  8244. * var array = [{ 'x': 1, 'y': 2 }, { 'x': 3, 'y': 4 }, { 'x': 5, 'y': 6 }];
  8245. *
  8246. * _.pullAllWith(array, [{ 'x': 3, 'y': 4 }], _.isEqual);
  8247. * console.log(array);
  8248. * // => [{ 'x': 1, 'y': 2 }, { 'x': 5, 'y': 6 }]
  8249. */
  8250. function pullAllWith(array, values, comparator) {
  8251. return (array && array.length && values && values.length)
  8252. ? basePullAll(array, values, undefined, comparator)
  8253. : array;
  8254. }
  8255. /**
  8256. * Removes elements from `array` corresponding to `indexes` and returns an
  8257. * array of removed elements.
  8258. *
  8259. * **Note:** Unlike `_.at`, this method mutates `array`.
  8260. *
  8261. * @static
  8262. * @memberOf _
  8263. * @since 3.0.0
  8264. * @category Array
  8265. * @param {Array} array The array to modify.
  8266. * @param {...(number|number[])} [indexes] The indexes of elements to remove.
  8267. * @returns {Array} Returns the new array of removed elements.
  8268. * @example
  8269. *
  8270. * var array = ['a', 'b', 'c', 'd'];
  8271. * var pulled = _.pullAt(array, [1, 3]);
  8272. *
  8273. * console.log(array);
  8274. * // => ['a', 'c']
  8275. *
  8276. * console.log(pulled);
  8277. * // => ['b', 'd']
  8278. */
  8279. var pullAt = flatRest(function(array, indexes) {
  8280. var length = array == null ? 0 : array.length,
  8281. result = baseAt(array, indexes);
  8282. basePullAt(array, arrayMap(indexes, function(index) {
  8283. return isIndex(index, length) ? +index : index;
  8284. }).sort(compareAscending));
  8285. return result;
  8286. });
  8287. /**
  8288. * Removes all elements from `array` that `predicate` returns truthy for
  8289. * and returns an array of the removed elements. The predicate is invoked
  8290. * with three arguments: (value, index, array).
  8291. *
  8292. * **Note:** Unlike `_.filter`, this method mutates `array`. Use `_.pull`
  8293. * to pull elements from an array by value.
  8294. *
  8295. * @static
  8296. * @memberOf _
  8297. * @since 2.0.0
  8298. * @category Array
  8299. * @param {Array} array The array to modify.
  8300. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  8301. * @returns {Array} Returns the new array of removed elements.
  8302. * @example
  8303. *
  8304. * var array = [1, 2, 3, 4];
  8305. * var evens = _.remove(array, function(n) {
  8306. * return n % 2 == 0;
  8307. * });
  8308. *
  8309. * console.log(array);
  8310. * // => [1, 3]
  8311. *
  8312. * console.log(evens);
  8313. * // => [2, 4]
  8314. */
  8315. function remove(array, predicate) {
  8316. var result = [];
  8317. if (!(array && array.length)) {
  8318. return result;
  8319. }
  8320. var index = -1,
  8321. indexes = [],
  8322. length = array.length;
  8323. predicate = getIteratee(predicate, 3);
  8324. while (++index < length) {
  8325. var value = array[index];
  8326. if (predicate(value, index, array)) {
  8327. result.push(value);
  8328. indexes.push(index);
  8329. }
  8330. }
  8331. basePullAt(array, indexes);
  8332. return result;
  8333. }
  8334. /**
  8335. * Reverses `array` so that the first element becomes the last, the second
  8336. * element becomes the second to last, and so on.
  8337. *
  8338. * **Note:** This method mutates `array` and is based on
  8339. * [`Array#reverse`](https://mdn.io/Array/reverse).
  8340. *
  8341. * @static
  8342. * @memberOf _
  8343. * @since 4.0.0
  8344. * @category Array
  8345. * @param {Array} array The array to modify.
  8346. * @returns {Array} Returns `array`.
  8347. * @example
  8348. *
  8349. * var array = [1, 2, 3];
  8350. *
  8351. * _.reverse(array);
  8352. * // => [3, 2, 1]
  8353. *
  8354. * console.log(array);
  8355. * // => [3, 2, 1]
  8356. */
  8357. function reverse(array) {
  8358. return array == null ? array : nativeReverse.call(array);
  8359. }
  8360. /**
  8361. * Creates a slice of `array` from `start` up to, but not including, `end`.
  8362. *
  8363. * **Note:** This method is used instead of
  8364. * [`Array#slice`](https://mdn.io/Array/slice) to ensure dense arrays are
  8365. * returned.
  8366. *
  8367. * @static
  8368. * @memberOf _
  8369. * @since 3.0.0
  8370. * @category Array
  8371. * @param {Array} array The array to slice.
  8372. * @param {number} [start=0] The start position.
  8373. * @param {number} [end=array.length] The end position.
  8374. * @returns {Array} Returns the slice of `array`.
  8375. */
  8376. function slice(array, start, end) {
  8377. var length = array == null ? 0 : array.length;
  8378. if (!length) {
  8379. return [];
  8380. }
  8381. if (end && typeof end != 'number' && isIterateeCall(array, start, end)) {
  8382. start = 0;
  8383. end = length;
  8384. }
  8385. else {
  8386. start = start == null ? 0 : toInteger(start);
  8387. end = end === undefined ? length : toInteger(end);
  8388. }
  8389. return baseSlice(array, start, end);
  8390. }
  8391. /**
  8392. * Uses a binary search to determine the lowest index at which `value`
  8393. * should be inserted into `array` in order to maintain its sort order.
  8394. *
  8395. * @static
  8396. * @memberOf _
  8397. * @since 0.1.0
  8398. * @category Array
  8399. * @param {Array} array The sorted array to inspect.
  8400. * @param {*} value The value to evaluate.
  8401. * @returns {number} Returns the index at which `value` should be inserted
  8402. * into `array`.
  8403. * @example
  8404. *
  8405. * _.sortedIndex([30, 50], 40);
  8406. * // => 1
  8407. */
  8408. function sortedIndex(array, value) {
  8409. return baseSortedIndex(array, value);
  8410. }
  8411. /**
  8412. * This method is like `_.sortedIndex` except that it accepts `iteratee`
  8413. * which is invoked for `value` and each element of `array` to compute their
  8414. * sort ranking. The iteratee is invoked with one argument: (value).
  8415. *
  8416. * @static
  8417. * @memberOf _
  8418. * @since 4.0.0
  8419. * @category Array
  8420. * @param {Array} array The sorted array to inspect.
  8421. * @param {*} value The value to evaluate.
  8422. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  8423. * @returns {number} Returns the index at which `value` should be inserted
  8424. * into `array`.
  8425. * @example
  8426. *
  8427. * var objects = [{ 'x': 4 }, { 'x': 5 }];
  8428. *
  8429. * _.sortedIndexBy(objects, { 'x': 4 }, function(o) { return o.x; });
  8430. * // => 0
  8431. *
  8432. * // The `_.property` iteratee shorthand.
  8433. * _.sortedIndexBy(objects, { 'x': 4 }, 'x');
  8434. * // => 0
  8435. */
  8436. function sortedIndexBy(array, value, iteratee) {
  8437. return baseSortedIndexBy(array, value, getIteratee(iteratee, 2));
  8438. }
  8439. /**
  8440. * This method is like `_.indexOf` except that it performs a binary
  8441. * search on a sorted `array`.
  8442. *
  8443. * @static
  8444. * @memberOf _
  8445. * @since 4.0.0
  8446. * @category Array
  8447. * @param {Array} array The array to inspect.
  8448. * @param {*} value The value to search for.
  8449. * @returns {number} Returns the index of the matched value, else `-1`.
  8450. * @example
  8451. *
  8452. * _.sortedIndexOf([4, 5, 5, 5, 6], 5);
  8453. * // => 1
  8454. */
  8455. function sortedIndexOf(array, value) {
  8456. var length = array == null ? 0 : array.length;
  8457. if (length) {
  8458. var index = baseSortedIndex(array, value);
  8459. if (index < length && eq(array[index], value)) {
  8460. return index;
  8461. }
  8462. }
  8463. return -1;
  8464. }
  8465. /**
  8466. * This method is like `_.sortedIndex` except that it returns the highest
  8467. * index at which `value` should be inserted into `array` in order to
  8468. * maintain its sort order.
  8469. *
  8470. * @static
  8471. * @memberOf _
  8472. * @since 3.0.0
  8473. * @category Array
  8474. * @param {Array} array The sorted array to inspect.
  8475. * @param {*} value The value to evaluate.
  8476. * @returns {number} Returns the index at which `value` should be inserted
  8477. * into `array`.
  8478. * @example
  8479. *
  8480. * _.sortedLastIndex([4, 5, 5, 5, 6], 5);
  8481. * // => 4
  8482. */
  8483. function sortedLastIndex(array, value) {
  8484. return baseSortedIndex(array, value, true);
  8485. }
  8486. /**
  8487. * This method is like `_.sortedLastIndex` except that it accepts `iteratee`
  8488. * which is invoked for `value` and each element of `array` to compute their
  8489. * sort ranking. The iteratee is invoked with one argument: (value).
  8490. *
  8491. * @static
  8492. * @memberOf _
  8493. * @since 4.0.0
  8494. * @category Array
  8495. * @param {Array} array The sorted array to inspect.
  8496. * @param {*} value The value to evaluate.
  8497. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  8498. * @returns {number} Returns the index at which `value` should be inserted
  8499. * into `array`.
  8500. * @example
  8501. *
  8502. * var objects = [{ 'x': 4 }, { 'x': 5 }];
  8503. *
  8504. * _.sortedLastIndexBy(objects, { 'x': 4 }, function(o) { return o.x; });
  8505. * // => 1
  8506. *
  8507. * // The `_.property` iteratee shorthand.
  8508. * _.sortedLastIndexBy(objects, { 'x': 4 }, 'x');
  8509. * // => 1
  8510. */
  8511. function sortedLastIndexBy(array, value, iteratee) {
  8512. return baseSortedIndexBy(array, value, getIteratee(iteratee, 2), true);
  8513. }
  8514. /**
  8515. * This method is like `_.lastIndexOf` except that it performs a binary
  8516. * search on a sorted `array`.
  8517. *
  8518. * @static
  8519. * @memberOf _
  8520. * @since 4.0.0
  8521. * @category Array
  8522. * @param {Array} array The array to inspect.
  8523. * @param {*} value The value to search for.
  8524. * @returns {number} Returns the index of the matched value, else `-1`.
  8525. * @example
  8526. *
  8527. * _.sortedLastIndexOf([4, 5, 5, 5, 6], 5);
  8528. * // => 3
  8529. */
  8530. function sortedLastIndexOf(array, value) {
  8531. var length = array == null ? 0 : array.length;
  8532. if (length) {
  8533. var index = baseSortedIndex(array, value, true) - 1;
  8534. if (eq(array[index], value)) {
  8535. return index;
  8536. }
  8537. }
  8538. return -1;
  8539. }
  8540. /**
  8541. * This method is like `_.uniq` except that it's designed and optimized
  8542. * for sorted arrays.
  8543. *
  8544. * @static
  8545. * @memberOf _
  8546. * @since 4.0.0
  8547. * @category Array
  8548. * @param {Array} array The array to inspect.
  8549. * @returns {Array} Returns the new duplicate free array.
  8550. * @example
  8551. *
  8552. * _.sortedUniq([1, 1, 2]);
  8553. * // => [1, 2]
  8554. */
  8555. function sortedUniq(array) {
  8556. return (array && array.length)
  8557. ? baseSortedUniq(array)
  8558. : [];
  8559. }
  8560. /**
  8561. * This method is like `_.uniqBy` except that it's designed and optimized
  8562. * for sorted arrays.
  8563. *
  8564. * @static
  8565. * @memberOf _
  8566. * @since 4.0.0
  8567. * @category Array
  8568. * @param {Array} array The array to inspect.
  8569. * @param {Function} [iteratee] The iteratee invoked per element.
  8570. * @returns {Array} Returns the new duplicate free array.
  8571. * @example
  8572. *
  8573. * _.sortedUniqBy([1.1, 1.2, 2.3, 2.4], Math.floor);
  8574. * // => [1.1, 2.3]
  8575. */
  8576. function sortedUniqBy(array, iteratee) {
  8577. return (array && array.length)
  8578. ? baseSortedUniq(array, getIteratee(iteratee, 2))
  8579. : [];
  8580. }
  8581. /**
  8582. * Gets all but the first element of `array`.
  8583. *
  8584. * @static
  8585. * @memberOf _
  8586. * @since 4.0.0
  8587. * @category Array
  8588. * @param {Array} array The array to query.
  8589. * @returns {Array} Returns the slice of `array`.
  8590. * @example
  8591. *
  8592. * _.tail([1, 2, 3]);
  8593. * // => [2, 3]
  8594. */
  8595. function tail(array) {
  8596. var length = array == null ? 0 : array.length;
  8597. return length ? baseSlice(array, 1, length) : [];
  8598. }
  8599. /**
  8600. * Creates a slice of `array` with `n` elements taken from the beginning.
  8601. *
  8602. * @static
  8603. * @memberOf _
  8604. * @since 0.1.0
  8605. * @category Array
  8606. * @param {Array} array The array to query.
  8607. * @param {number} [n=1] The number of elements to take.
  8608. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  8609. * @returns {Array} Returns the slice of `array`.
  8610. * @example
  8611. *
  8612. * _.take([1, 2, 3]);
  8613. * // => [1]
  8614. *
  8615. * _.take([1, 2, 3], 2);
  8616. * // => [1, 2]
  8617. *
  8618. * _.take([1, 2, 3], 5);
  8619. * // => [1, 2, 3]
  8620. *
  8621. * _.take([1, 2, 3], 0);
  8622. * // => []
  8623. */
  8624. function take(array, n, guard) {
  8625. if (!(array && array.length)) {
  8626. return [];
  8627. }
  8628. n = (guard || n === undefined) ? 1 : toInteger(n);
  8629. return baseSlice(array, 0, n < 0 ? 0 : n);
  8630. }
  8631. /**
  8632. * Creates a slice of `array` with `n` elements taken from the end.
  8633. *
  8634. * @static
  8635. * @memberOf _
  8636. * @since 3.0.0
  8637. * @category Array
  8638. * @param {Array} array The array to query.
  8639. * @param {number} [n=1] The number of elements to take.
  8640. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  8641. * @returns {Array} Returns the slice of `array`.
  8642. * @example
  8643. *
  8644. * _.takeRight([1, 2, 3]);
  8645. * // => [3]
  8646. *
  8647. * _.takeRight([1, 2, 3], 2);
  8648. * // => [2, 3]
  8649. *
  8650. * _.takeRight([1, 2, 3], 5);
  8651. * // => [1, 2, 3]
  8652. *
  8653. * _.takeRight([1, 2, 3], 0);
  8654. * // => []
  8655. */
  8656. function takeRight(array, n, guard) {
  8657. var length = array == null ? 0 : array.length;
  8658. if (!length) {
  8659. return [];
  8660. }
  8661. n = (guard || n === undefined) ? 1 : toInteger(n);
  8662. n = length - n;
  8663. return baseSlice(array, n < 0 ? 0 : n, length);
  8664. }
  8665. /**
  8666. * Creates a slice of `array` with elements taken from the end. Elements are
  8667. * taken until `predicate` returns falsey. The predicate is invoked with
  8668. * three arguments: (value, index, array).
  8669. *
  8670. * @static
  8671. * @memberOf _
  8672. * @since 3.0.0
  8673. * @category Array
  8674. * @param {Array} array The array to query.
  8675. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  8676. * @returns {Array} Returns the slice of `array`.
  8677. * @example
  8678. *
  8679. * var users = [
  8680. * { 'user': 'barney', 'active': true },
  8681. * { 'user': 'fred', 'active': false },
  8682. * { 'user': 'pebbles', 'active': false }
  8683. * ];
  8684. *
  8685. * _.takeRightWhile(users, function(o) { return !o.active; });
  8686. * // => objects for ['fred', 'pebbles']
  8687. *
  8688. * // The `_.matches` iteratee shorthand.
  8689. * _.takeRightWhile(users, { 'user': 'pebbles', 'active': false });
  8690. * // => objects for ['pebbles']
  8691. *
  8692. * // The `_.matchesProperty` iteratee shorthand.
  8693. * _.takeRightWhile(users, ['active', false]);
  8694. * // => objects for ['fred', 'pebbles']
  8695. *
  8696. * // The `_.property` iteratee shorthand.
  8697. * _.takeRightWhile(users, 'active');
  8698. * // => []
  8699. */
  8700. function takeRightWhile(array, predicate) {
  8701. return (array && array.length)
  8702. ? baseWhile(array, getIteratee(predicate, 3), false, true)
  8703. : [];
  8704. }
  8705. /**
  8706. * Creates a slice of `array` with elements taken from the beginning. Elements
  8707. * are taken until `predicate` returns falsey. The predicate is invoked with
  8708. * three arguments: (value, index, array).
  8709. *
  8710. * @static
  8711. * @memberOf _
  8712. * @since 3.0.0
  8713. * @category Array
  8714. * @param {Array} array The array to query.
  8715. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  8716. * @returns {Array} Returns the slice of `array`.
  8717. * @example
  8718. *
  8719. * var users = [
  8720. * { 'user': 'barney', 'active': false },
  8721. * { 'user': 'fred', 'active': false },
  8722. * { 'user': 'pebbles', 'active': true }
  8723. * ];
  8724. *
  8725. * _.takeWhile(users, function(o) { return !o.active; });
  8726. * // => objects for ['barney', 'fred']
  8727. *
  8728. * // The `_.matches` iteratee shorthand.
  8729. * _.takeWhile(users, { 'user': 'barney', 'active': false });
  8730. * // => objects for ['barney']
  8731. *
  8732. * // The `_.matchesProperty` iteratee shorthand.
  8733. * _.takeWhile(users, ['active', false]);
  8734. * // => objects for ['barney', 'fred']
  8735. *
  8736. * // The `_.property` iteratee shorthand.
  8737. * _.takeWhile(users, 'active');
  8738. * // => []
  8739. */
  8740. function takeWhile(array, predicate) {
  8741. return (array && array.length)
  8742. ? baseWhile(array, getIteratee(predicate, 3))
  8743. : [];
  8744. }
  8745. /**
  8746. * Creates an array of unique values, in order, from all given arrays using
  8747. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  8748. * for equality comparisons.
  8749. *
  8750. * @static
  8751. * @memberOf _
  8752. * @since 0.1.0
  8753. * @category Array
  8754. * @param {...Array} [arrays] The arrays to inspect.
  8755. * @returns {Array} Returns the new array of combined values.
  8756. * @example
  8757. *
  8758. * _.union([2], [1, 2]);
  8759. * // => [2, 1]
  8760. */
  8761. var union = baseRest(function(arrays) {
  8762. return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true));
  8763. });
  8764. /**
  8765. * This method is like `_.union` except that it accepts `iteratee` which is
  8766. * invoked for each element of each `arrays` to generate the criterion by
  8767. * which uniqueness is computed. Result values are chosen from the first
  8768. * array in which the value occurs. The iteratee is invoked with one argument:
  8769. * (value).
  8770. *
  8771. * @static
  8772. * @memberOf _
  8773. * @since 4.0.0
  8774. * @category Array
  8775. * @param {...Array} [arrays] The arrays to inspect.
  8776. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  8777. * @returns {Array} Returns the new array of combined values.
  8778. * @example
  8779. *
  8780. * _.unionBy([2.1], [1.2, 2.3], Math.floor);
  8781. * // => [2.1, 1.2]
  8782. *
  8783. * // The `_.property` iteratee shorthand.
  8784. * _.unionBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x');
  8785. * // => [{ 'x': 1 }, { 'x': 2 }]
  8786. */
  8787. var unionBy = baseRest(function(arrays) {
  8788. var iteratee = last(arrays);
  8789. if (isArrayLikeObject(iteratee)) {
  8790. iteratee = undefined;
  8791. }
  8792. return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true), getIteratee(iteratee, 2));
  8793. });
  8794. /**
  8795. * This method is like `_.union` except that it accepts `comparator` which
  8796. * is invoked to compare elements of `arrays`. Result values are chosen from
  8797. * the first array in which the value occurs. The comparator is invoked
  8798. * with two arguments: (arrVal, othVal).
  8799. *
  8800. * @static
  8801. * @memberOf _
  8802. * @since 4.0.0
  8803. * @category Array
  8804. * @param {...Array} [arrays] The arrays to inspect.
  8805. * @param {Function} [comparator] The comparator invoked per element.
  8806. * @returns {Array} Returns the new array of combined values.
  8807. * @example
  8808. *
  8809. * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }];
  8810. * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }];
  8811. *
  8812. * _.unionWith(objects, others, _.isEqual);
  8813. * // => [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }, { 'x': 1, 'y': 1 }]
  8814. */
  8815. var unionWith = baseRest(function(arrays) {
  8816. var comparator = last(arrays);
  8817. comparator = typeof comparator == 'function' ? comparator : undefined;
  8818. return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true), undefined, comparator);
  8819. });
  8820. /**
  8821. * Creates a duplicate-free version of an array, using
  8822. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  8823. * for equality comparisons, in which only the first occurrence of each element
  8824. * is kept. The order of result values is determined by the order they occur
  8825. * in the array.
  8826. *
  8827. * @static
  8828. * @memberOf _
  8829. * @since 0.1.0
  8830. * @category Array
  8831. * @param {Array} array The array to inspect.
  8832. * @returns {Array} Returns the new duplicate free array.
  8833. * @example
  8834. *
  8835. * _.uniq([2, 1, 2]);
  8836. * // => [2, 1]
  8837. */
  8838. function uniq(array) {
  8839. return (array && array.length) ? baseUniq(array) : [];
  8840. }
  8841. /**
  8842. * This method is like `_.uniq` except that it accepts `iteratee` which is
  8843. * invoked for each element in `array` to generate the criterion by which
  8844. * uniqueness is computed. The order of result values is determined by the
  8845. * order they occur in the array. The iteratee is invoked with one argument:
  8846. * (value).
  8847. *
  8848. * @static
  8849. * @memberOf _
  8850. * @since 4.0.0
  8851. * @category Array
  8852. * @param {Array} array The array to inspect.
  8853. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  8854. * @returns {Array} Returns the new duplicate free array.
  8855. * @example
  8856. *
  8857. * _.uniqBy([2.1, 1.2, 2.3], Math.floor);
  8858. * // => [2.1, 1.2]
  8859. *
  8860. * // The `_.property` iteratee shorthand.
  8861. * _.uniqBy([{ 'x': 1 }, { 'x': 2 }, { 'x': 1 }], 'x');
  8862. * // => [{ 'x': 1 }, { 'x': 2 }]
  8863. */
  8864. function uniqBy(array, iteratee) {
  8865. return (array && array.length) ? baseUniq(array, getIteratee(iteratee, 2)) : [];
  8866. }
  8867. /**
  8868. * This method is like `_.uniq` except that it accepts `comparator` which
  8869. * is invoked to compare elements of `array`. The order of result values is
  8870. * determined by the order they occur in the array.The comparator is invoked
  8871. * with two arguments: (arrVal, othVal).
  8872. *
  8873. * @static
  8874. * @memberOf _
  8875. * @since 4.0.0
  8876. * @category Array
  8877. * @param {Array} array The array to inspect.
  8878. * @param {Function} [comparator] The comparator invoked per element.
  8879. * @returns {Array} Returns the new duplicate free array.
  8880. * @example
  8881. *
  8882. * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }, { 'x': 1, 'y': 2 }];
  8883. *
  8884. * _.uniqWith(objects, _.isEqual);
  8885. * // => [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }]
  8886. */
  8887. function uniqWith(array, comparator) {
  8888. comparator = typeof comparator == 'function' ? comparator : undefined;
  8889. return (array && array.length) ? baseUniq(array, undefined, comparator) : [];
  8890. }
  8891. /**
  8892. * This method is like `_.zip` except that it accepts an array of grouped
  8893. * elements and creates an array regrouping the elements to their pre-zip
  8894. * configuration.
  8895. *
  8896. * @static
  8897. * @memberOf _
  8898. * @since 1.2.0
  8899. * @category Array
  8900. * @param {Array} array The array of grouped elements to process.
  8901. * @returns {Array} Returns the new array of regrouped elements.
  8902. * @example
  8903. *
  8904. * var zipped = _.zip(['a', 'b'], [1, 2], [true, false]);
  8905. * // => [['a', 1, true], ['b', 2, false]]
  8906. *
  8907. * _.unzip(zipped);
  8908. * // => [['a', 'b'], [1, 2], [true, false]]
  8909. */
  8910. function unzip(array) {
  8911. if (!(array && array.length)) {
  8912. return [];
  8913. }
  8914. var length = 0;
  8915. array = arrayFilter(array, function(group) {
  8916. if (isArrayLikeObject(group)) {
  8917. length = nativeMax(group.length, length);
  8918. return true;
  8919. }
  8920. });
  8921. return baseTimes(length, function(index) {
  8922. return arrayMap(array, baseProperty(index));
  8923. });
  8924. }
  8925. /**
  8926. * This method is like `_.unzip` except that it accepts `iteratee` to specify
  8927. * how regrouped values should be combined. The iteratee is invoked with the
  8928. * elements of each group: (...group).
  8929. *
  8930. * @static
  8931. * @memberOf _
  8932. * @since 3.8.0
  8933. * @category Array
  8934. * @param {Array} array The array of grouped elements to process.
  8935. * @param {Function} [iteratee=_.identity] The function to combine
  8936. * regrouped values.
  8937. * @returns {Array} Returns the new array of regrouped elements.
  8938. * @example
  8939. *
  8940. * var zipped = _.zip([1, 2], [10, 20], [100, 200]);
  8941. * // => [[1, 10, 100], [2, 20, 200]]
  8942. *
  8943. * _.unzipWith(zipped, _.add);
  8944. * // => [3, 30, 300]
  8945. */
  8946. function unzipWith(array, iteratee) {
  8947. if (!(array && array.length)) {
  8948. return [];
  8949. }
  8950. var result = unzip(array);
  8951. if (iteratee == null) {
  8952. return result;
  8953. }
  8954. return arrayMap(result, function(group) {
  8955. return apply(iteratee, undefined, group);
  8956. });
  8957. }
  8958. /**
  8959. * Creates an array excluding all given values using
  8960. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  8961. * for equality comparisons.
  8962. *
  8963. * **Note:** Unlike `_.pull`, this method returns a new array.
  8964. *
  8965. * @static
  8966. * @memberOf _
  8967. * @since 0.1.0
  8968. * @category Array
  8969. * @param {Array} array The array to inspect.
  8970. * @param {...*} [values] The values to exclude.
  8971. * @returns {Array} Returns the new array of filtered values.
  8972. * @see _.difference, _.xor
  8973. * @example
  8974. *
  8975. * _.without([2, 1, 2, 3], 1, 2);
  8976. * // => [3]
  8977. */
  8978. var without = baseRest(function(array, values) {
  8979. return isArrayLikeObject(array)
  8980. ? baseDifference(array, values)
  8981. : [];
  8982. });
  8983. /**
  8984. * Creates an array of unique values that is the
  8985. * [symmetric difference](https://en.wikipedia.org/wiki/Symmetric_difference)
  8986. * of the given arrays. The order of result values is determined by the order
  8987. * they occur in the arrays.
  8988. *
  8989. * @static
  8990. * @memberOf _
  8991. * @since 2.4.0
  8992. * @category Array
  8993. * @param {...Array} [arrays] The arrays to inspect.
  8994. * @returns {Array} Returns the new array of filtered values.
  8995. * @see _.difference, _.without
  8996. * @example
  8997. *
  8998. * _.xor([2, 1], [2, 3]);
  8999. * // => [1, 3]
  9000. */
  9001. var xor = baseRest(function(arrays) {
  9002. return baseXor(arrayFilter(arrays, isArrayLikeObject));
  9003. });
  9004. /**
  9005. * This method is like `_.xor` except that it accepts `iteratee` which is
  9006. * invoked for each element of each `arrays` to generate the criterion by
  9007. * which by which they're compared. The order of result values is determined
  9008. * by the order they occur in the arrays. The iteratee is invoked with one
  9009. * argument: (value).
  9010. *
  9011. * @static
  9012. * @memberOf _
  9013. * @since 4.0.0
  9014. * @category Array
  9015. * @param {...Array} [arrays] The arrays to inspect.
  9016. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  9017. * @returns {Array} Returns the new array of filtered values.
  9018. * @example
  9019. *
  9020. * _.xorBy([2.1, 1.2], [2.3, 3.4], Math.floor);
  9021. * // => [1.2, 3.4]
  9022. *
  9023. * // The `_.property` iteratee shorthand.
  9024. * _.xorBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x');
  9025. * // => [{ 'x': 2 }]
  9026. */
  9027. var xorBy = baseRest(function(arrays) {
  9028. var iteratee = last(arrays);
  9029. if (isArrayLikeObject(iteratee)) {
  9030. iteratee = undefined;
  9031. }
  9032. return baseXor(arrayFilter(arrays, isArrayLikeObject), getIteratee(iteratee, 2));
  9033. });
  9034. /**
  9035. * This method is like `_.xor` except that it accepts `comparator` which is
  9036. * invoked to compare elements of `arrays`. The order of result values is
  9037. * determined by the order they occur in the arrays. The comparator is invoked
  9038. * with two arguments: (arrVal, othVal).
  9039. *
  9040. * @static
  9041. * @memberOf _
  9042. * @since 4.0.0
  9043. * @category Array
  9044. * @param {...Array} [arrays] The arrays to inspect.
  9045. * @param {Function} [comparator] The comparator invoked per element.
  9046. * @returns {Array} Returns the new array of filtered values.
  9047. * @example
  9048. *
  9049. * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }];
  9050. * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }];
  9051. *
  9052. * _.xorWith(objects, others, _.isEqual);
  9053. * // => [{ 'x': 2, 'y': 1 }, { 'x': 1, 'y': 1 }]
  9054. */
  9055. var xorWith = baseRest(function(arrays) {
  9056. var comparator = last(arrays);
  9057. comparator = typeof comparator == 'function' ? comparator : undefined;
  9058. return baseXor(arrayFilter(arrays, isArrayLikeObject), undefined, comparator);
  9059. });
  9060. /**
  9061. * Creates an array of grouped elements, the first of which contains the
  9062. * first elements of the given arrays, the second of which contains the
  9063. * second elements of the given arrays, and so on.
  9064. *
  9065. * @static
  9066. * @memberOf _
  9067. * @since 0.1.0
  9068. * @category Array
  9069. * @param {...Array} [arrays] The arrays to process.
  9070. * @returns {Array} Returns the new array of grouped elements.
  9071. * @example
  9072. *
  9073. * _.zip(['a', 'b'], [1, 2], [true, false]);
  9074. * // => [['a', 1, true], ['b', 2, false]]
  9075. */
  9076. var zip = baseRest(unzip);
  9077. /**
  9078. * This method is like `_.fromPairs` except that it accepts two arrays,
  9079. * one of property identifiers and one of corresponding values.
  9080. *
  9081. * @static
  9082. * @memberOf _
  9083. * @since 0.4.0
  9084. * @category Array
  9085. * @param {Array} [props=[]] The property identifiers.
  9086. * @param {Array} [values=[]] The property values.
  9087. * @returns {Object} Returns the new object.
  9088. * @example
  9089. *
  9090. * _.zipObject(['a', 'b'], [1, 2]);
  9091. * // => { 'a': 1, 'b': 2 }
  9092. */
  9093. function zipObject(props, values) {
  9094. return baseZipObject(props || [], values || [], assignValue);
  9095. }
  9096. /**
  9097. * This method is like `_.zipObject` except that it supports property paths.
  9098. *
  9099. * @static
  9100. * @memberOf _
  9101. * @since 4.1.0
  9102. * @category Array
  9103. * @param {Array} [props=[]] The property identifiers.
  9104. * @param {Array} [values=[]] The property values.
  9105. * @returns {Object} Returns the new object.
  9106. * @example
  9107. *
  9108. * _.zipObjectDeep(['a.b[0].c', 'a.b[1].d'], [1, 2]);
  9109. * // => { 'a': { 'b': [{ 'c': 1 }, { 'd': 2 }] } }
  9110. */
  9111. function zipObjectDeep(props, values) {
  9112. return baseZipObject(props || [], values || [], baseSet);
  9113. }
  9114. /**
  9115. * This method is like `_.zip` except that it accepts `iteratee` to specify
  9116. * how grouped values should be combined. The iteratee is invoked with the
  9117. * elements of each group: (...group).
  9118. *
  9119. * @static
  9120. * @memberOf _
  9121. * @since 3.8.0
  9122. * @category Array
  9123. * @param {...Array} [arrays] The arrays to process.
  9124. * @param {Function} [iteratee=_.identity] The function to combine
  9125. * grouped values.
  9126. * @returns {Array} Returns the new array of grouped elements.
  9127. * @example
  9128. *
  9129. * _.zipWith([1, 2], [10, 20], [100, 200], function(a, b, c) {
  9130. * return a + b + c;
  9131. * });
  9132. * // => [111, 222]
  9133. */
  9134. var zipWith = baseRest(function(arrays) {
  9135. var length = arrays.length,
  9136. iteratee = length > 1 ? arrays[length - 1] : undefined;
  9137. iteratee = typeof iteratee == 'function' ? (arrays.pop(), iteratee) : undefined;
  9138. return unzipWith(arrays, iteratee);
  9139. });
  9140. /*------------------------------------------------------------------------*/
  9141. /**
  9142. * Creates a `lodash` wrapper instance that wraps `value` with explicit method
  9143. * chain sequences enabled. The result of such sequences must be unwrapped
  9144. * with `_#value`.
  9145. *
  9146. * @static
  9147. * @memberOf _
  9148. * @since 1.3.0
  9149. * @category Seq
  9150. * @param {*} value The value to wrap.
  9151. * @returns {Object} Returns the new `lodash` wrapper instance.
  9152. * @example
  9153. *
  9154. * var users = [
  9155. * { 'user': 'barney', 'age': 36 },
  9156. * { 'user': 'fred', 'age': 40 },
  9157. * { 'user': 'pebbles', 'age': 1 }
  9158. * ];
  9159. *
  9160. * var youngest = _
  9161. * .chain(users)
  9162. * .sortBy('age')
  9163. * .map(function(o) {
  9164. * return o.user + ' is ' + o.age;
  9165. * })
  9166. * .head()
  9167. * .value();
  9168. * // => 'pebbles is 1'
  9169. */
  9170. function chain(value) {
  9171. var result = lodash(value);
  9172. result.__chain__ = true;
  9173. return result;
  9174. }
  9175. /**
  9176. * This method invokes `interceptor` and returns `value`. The interceptor
  9177. * is invoked with one argument; (value). The purpose of this method is to
  9178. * "tap into" a method chain sequence in order to modify intermediate results.
  9179. *
  9180. * @static
  9181. * @memberOf _
  9182. * @since 0.1.0
  9183. * @category Seq
  9184. * @param {*} value The value to provide to `interceptor`.
  9185. * @param {Function} interceptor The function to invoke.
  9186. * @returns {*} Returns `value`.
  9187. * @example
  9188. *
  9189. * _([1, 2, 3])
  9190. * .tap(function(array) {
  9191. * // Mutate input array.
  9192. * array.pop();
  9193. * })
  9194. * .reverse()
  9195. * .value();
  9196. * // => [2, 1]
  9197. */
  9198. function tap(value, interceptor) {
  9199. interceptor(value);
  9200. return value;
  9201. }
  9202. /**
  9203. * This method is like `_.tap` except that it returns the result of `interceptor`.
  9204. * The purpose of this method is to "pass thru" values replacing intermediate
  9205. * results in a method chain sequence.
  9206. *
  9207. * @static
  9208. * @memberOf _
  9209. * @since 3.0.0
  9210. * @category Seq
  9211. * @param {*} value The value to provide to `interceptor`.
  9212. * @param {Function} interceptor The function to invoke.
  9213. * @returns {*} Returns the result of `interceptor`.
  9214. * @example
  9215. *
  9216. * _(' abc ')
  9217. * .chain()
  9218. * .trim()
  9219. * .thru(function(value) {
  9220. * return [value];
  9221. * })
  9222. * .value();
  9223. * // => ['abc']
  9224. */
  9225. function thru(value, interceptor) {
  9226. return interceptor(value);
  9227. }
  9228. /**
  9229. * This method is the wrapper version of `_.at`.
  9230. *
  9231. * @name at
  9232. * @memberOf _
  9233. * @since 1.0.0
  9234. * @category Seq
  9235. * @param {...(string|string[])} [paths] The property paths to pick.
  9236. * @returns {Object} Returns the new `lodash` wrapper instance.
  9237. * @example
  9238. *
  9239. * var object = { 'a': [{ 'b': { 'c': 3 } }, 4] };
  9240. *
  9241. * _(object).at(['a[0].b.c', 'a[1]']).value();
  9242. * // => [3, 4]
  9243. */
  9244. var wrapperAt = flatRest(function(paths) {
  9245. var length = paths.length,
  9246. start = length ? paths[0] : 0,
  9247. value = this.__wrapped__,
  9248. interceptor = function(object) { return baseAt(object, paths); };
  9249. if (length > 1 || this.__actions__.length ||
  9250. !(value instanceof LazyWrapper) || !isIndex(start)) {
  9251. return this.thru(interceptor);
  9252. }
  9253. value = value.slice(start, +start + (length ? 1 : 0));
  9254. value.__actions__.push({
  9255. 'func': thru,
  9256. 'args': [interceptor],
  9257. 'thisArg': undefined
  9258. });
  9259. return new LodashWrapper(value, this.__chain__).thru(function(array) {
  9260. if (length && !array.length) {
  9261. array.push(undefined);
  9262. }
  9263. return array;
  9264. });
  9265. });
  9266. /**
  9267. * Creates a `lodash` wrapper instance with explicit method chain sequences enabled.
  9268. *
  9269. * @name chain
  9270. * @memberOf _
  9271. * @since 0.1.0
  9272. * @category Seq
  9273. * @returns {Object} Returns the new `lodash` wrapper instance.
  9274. * @example
  9275. *
  9276. * var users = [
  9277. * { 'user': 'barney', 'age': 36 },
  9278. * { 'user': 'fred', 'age': 40 }
  9279. * ];
  9280. *
  9281. * // A sequence without explicit chaining.
  9282. * _(users).head();
  9283. * // => { 'user': 'barney', 'age': 36 }
  9284. *
  9285. * // A sequence with explicit chaining.
  9286. * _(users)
  9287. * .chain()
  9288. * .head()
  9289. * .pick('user')
  9290. * .value();
  9291. * // => { 'user': 'barney' }
  9292. */
  9293. function wrapperChain() {
  9294. return chain(this);
  9295. }
  9296. /**
  9297. * Executes the chain sequence and returns the wrapped result.
  9298. *
  9299. * @name commit
  9300. * @memberOf _
  9301. * @since 3.2.0
  9302. * @category Seq
  9303. * @returns {Object} Returns the new `lodash` wrapper instance.
  9304. * @example
  9305. *
  9306. * var array = [1, 2];
  9307. * var wrapped = _(array).push(3);
  9308. *
  9309. * console.log(array);
  9310. * // => [1, 2]
  9311. *
  9312. * wrapped = wrapped.commit();
  9313. * console.log(array);
  9314. * // => [1, 2, 3]
  9315. *
  9316. * wrapped.last();
  9317. * // => 3
  9318. *
  9319. * console.log(array);
  9320. * // => [1, 2, 3]
  9321. */
  9322. function wrapperCommit() {
  9323. return new LodashWrapper(this.value(), this.__chain__);
  9324. }
  9325. /**
  9326. * Gets the next value on a wrapped object following the
  9327. * [iterator protocol](https://mdn.io/iteration_protocols#iterator).
  9328. *
  9329. * @name next
  9330. * @memberOf _
  9331. * @since 4.0.0
  9332. * @category Seq
  9333. * @returns {Object} Returns the next iterator value.
  9334. * @example
  9335. *
  9336. * var wrapped = _([1, 2]);
  9337. *
  9338. * wrapped.next();
  9339. * // => { 'done': false, 'value': 1 }
  9340. *
  9341. * wrapped.next();
  9342. * // => { 'done': false, 'value': 2 }
  9343. *
  9344. * wrapped.next();
  9345. * // => { 'done': true, 'value': undefined }
  9346. */
  9347. function wrapperNext() {
  9348. if (this.__values__ === undefined) {
  9349. this.__values__ = toArray(this.value());
  9350. }
  9351. var done = this.__index__ >= this.__values__.length,
  9352. value = done ? undefined : this.__values__[this.__index__++];
  9353. return { 'done': done, 'value': value };
  9354. }
  9355. /**
  9356. * Enables the wrapper to be iterable.
  9357. *
  9358. * @name Symbol.iterator
  9359. * @memberOf _
  9360. * @since 4.0.0
  9361. * @category Seq
  9362. * @returns {Object} Returns the wrapper object.
  9363. * @example
  9364. *
  9365. * var wrapped = _([1, 2]);
  9366. *
  9367. * wrapped[Symbol.iterator]() === wrapped;
  9368. * // => true
  9369. *
  9370. * Array.from(wrapped);
  9371. * // => [1, 2]
  9372. */
  9373. function wrapperToIterator() {
  9374. return this;
  9375. }
  9376. /**
  9377. * Creates a clone of the chain sequence planting `value` as the wrapped value.
  9378. *
  9379. * @name plant
  9380. * @memberOf _
  9381. * @since 3.2.0
  9382. * @category Seq
  9383. * @param {*} value The value to plant.
  9384. * @returns {Object} Returns the new `lodash` wrapper instance.
  9385. * @example
  9386. *
  9387. * function square(n) {
  9388. * return n * n;
  9389. * }
  9390. *
  9391. * var wrapped = _([1, 2]).map(square);
  9392. * var other = wrapped.plant([3, 4]);
  9393. *
  9394. * other.value();
  9395. * // => [9, 16]
  9396. *
  9397. * wrapped.value();
  9398. * // => [1, 4]
  9399. */
  9400. function wrapperPlant(value) {
  9401. var result,
  9402. parent = this;
  9403. while (parent instanceof baseLodash) {
  9404. var clone = wrapperClone(parent);
  9405. clone.__index__ = 0;
  9406. clone.__values__ = undefined;
  9407. if (result) {
  9408. previous.__wrapped__ = clone;
  9409. } else {
  9410. result = clone;
  9411. }
  9412. var previous = clone;
  9413. parent = parent.__wrapped__;
  9414. }
  9415. previous.__wrapped__ = value;
  9416. return result;
  9417. }
  9418. /**
  9419. * This method is the wrapper version of `_.reverse`.
  9420. *
  9421. * **Note:** This method mutates the wrapped array.
  9422. *
  9423. * @name reverse
  9424. * @memberOf _
  9425. * @since 0.1.0
  9426. * @category Seq
  9427. * @returns {Object} Returns the new `lodash` wrapper instance.
  9428. * @example
  9429. *
  9430. * var array = [1, 2, 3];
  9431. *
  9432. * _(array).reverse().value()
  9433. * // => [3, 2, 1]
  9434. *
  9435. * console.log(array);
  9436. * // => [3, 2, 1]
  9437. */
  9438. function wrapperReverse() {
  9439. var value = this.__wrapped__;
  9440. if (value instanceof LazyWrapper) {
  9441. var wrapped = value;
  9442. if (this.__actions__.length) {
  9443. wrapped = new LazyWrapper(this);
  9444. }
  9445. wrapped = wrapped.reverse();
  9446. wrapped.__actions__.push({
  9447. 'func': thru,
  9448. 'args': [reverse],
  9449. 'thisArg': undefined
  9450. });
  9451. return new LodashWrapper(wrapped, this.__chain__);
  9452. }
  9453. return this.thru(reverse);
  9454. }
  9455. /**
  9456. * Executes the chain sequence to resolve the unwrapped value.
  9457. *
  9458. * @name value
  9459. * @memberOf _
  9460. * @since 0.1.0
  9461. * @alias toJSON, valueOf
  9462. * @category Seq
  9463. * @returns {*} Returns the resolved unwrapped value.
  9464. * @example
  9465. *
  9466. * _([1, 2, 3]).value();
  9467. * // => [1, 2, 3]
  9468. */
  9469. function wrapperValue() {
  9470. return baseWrapperValue(this.__wrapped__, this.__actions__);
  9471. }
  9472. /*------------------------------------------------------------------------*/
  9473. /**
  9474. * Creates an object composed of keys generated from the results of running
  9475. * each element of `collection` thru `iteratee`. The corresponding value of
  9476. * each key is the number of times the key was returned by `iteratee`. The
  9477. * iteratee is invoked with one argument: (value).
  9478. *
  9479. * @static
  9480. * @memberOf _
  9481. * @since 0.5.0
  9482. * @category Collection
  9483. * @param {Array|Object} collection The collection to iterate over.
  9484. * @param {Function} [iteratee=_.identity] The iteratee to transform keys.
  9485. * @returns {Object} Returns the composed aggregate object.
  9486. * @example
  9487. *
  9488. * _.countBy([6.1, 4.2, 6.3], Math.floor);
  9489. * // => { '4': 1, '6': 2 }
  9490. *
  9491. * // The `_.property` iteratee shorthand.
  9492. * _.countBy(['one', 'two', 'three'], 'length');
  9493. * // => { '3': 2, '5': 1 }
  9494. */
  9495. var countBy = createAggregator(function(result, value, key) {
  9496. if (hasOwnProperty.call(result, key)) {
  9497. ++result[key];
  9498. } else {
  9499. baseAssignValue(result, key, 1);
  9500. }
  9501. });
  9502. /**
  9503. * Checks if `predicate` returns truthy for **all** elements of `collection`.
  9504. * Iteration is stopped once `predicate` returns falsey. The predicate is
  9505. * invoked with three arguments: (value, index|key, collection).
  9506. *
  9507. * **Note:** This method returns `true` for
  9508. * [empty collections](https://en.wikipedia.org/wiki/Empty_set) because
  9509. * [everything is true](https://en.wikipedia.org/wiki/Vacuous_truth) of
  9510. * elements of empty collections.
  9511. *
  9512. * @static
  9513. * @memberOf _
  9514. * @since 0.1.0
  9515. * @category Collection
  9516. * @param {Array|Object} collection The collection to iterate over.
  9517. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  9518. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  9519. * @returns {boolean} Returns `true` if all elements pass the predicate check,
  9520. * else `false`.
  9521. * @example
  9522. *
  9523. * _.every([true, 1, null, 'yes'], Boolean);
  9524. * // => false
  9525. *
  9526. * var users = [
  9527. * { 'user': 'barney', 'age': 36, 'active': false },
  9528. * { 'user': 'fred', 'age': 40, 'active': false }
  9529. * ];
  9530. *
  9531. * // The `_.matches` iteratee shorthand.
  9532. * _.every(users, { 'user': 'barney', 'active': false });
  9533. * // => false
  9534. *
  9535. * // The `_.matchesProperty` iteratee shorthand.
  9536. * _.every(users, ['active', false]);
  9537. * // => true
  9538. *
  9539. * // The `_.property` iteratee shorthand.
  9540. * _.every(users, 'active');
  9541. * // => false
  9542. */
  9543. function every(collection, predicate, guard) {
  9544. var func = isArray(collection) ? arrayEvery : baseEvery;
  9545. if (guard && isIterateeCall(collection, predicate, guard)) {
  9546. predicate = undefined;
  9547. }
  9548. return func(collection, getIteratee(predicate, 3));
  9549. }
  9550. /**
  9551. * Iterates over elements of `collection`, returning an array of all elements
  9552. * `predicate` returns truthy for. The predicate is invoked with three
  9553. * arguments: (value, index|key, collection).
  9554. *
  9555. * **Note:** Unlike `_.remove`, this method returns a new array.
  9556. *
  9557. * @static
  9558. * @memberOf _
  9559. * @since 0.1.0
  9560. * @category Collection
  9561. * @param {Array|Object} collection The collection to iterate over.
  9562. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  9563. * @returns {Array} Returns the new filtered array.
  9564. * @see _.reject
  9565. * @example
  9566. *
  9567. * var users = [
  9568. * { 'user': 'barney', 'age': 36, 'active': true },
  9569. * { 'user': 'fred', 'age': 40, 'active': false }
  9570. * ];
  9571. *
  9572. * _.filter(users, function(o) { return !o.active; });
  9573. * // => objects for ['fred']
  9574. *
  9575. * // The `_.matches` iteratee shorthand.
  9576. * _.filter(users, { 'age': 36, 'active': true });
  9577. * // => objects for ['barney']
  9578. *
  9579. * // The `_.matchesProperty` iteratee shorthand.
  9580. * _.filter(users, ['active', false]);
  9581. * // => objects for ['fred']
  9582. *
  9583. * // The `_.property` iteratee shorthand.
  9584. * _.filter(users, 'active');
  9585. * // => objects for ['barney']
  9586. *
  9587. * // Combining several predicates using `_.overEvery` or `_.overSome`.
  9588. * _.filter(users, _.overSome([{ 'age': 36 }, ['age', 40]]));
  9589. * // => objects for ['fred', 'barney']
  9590. */
  9591. function filter(collection, predicate) {
  9592. var func = isArray(collection) ? arrayFilter : baseFilter;
  9593. return func(collection, getIteratee(predicate, 3));
  9594. }
  9595. /**
  9596. * Iterates over elements of `collection`, returning the first element
  9597. * `predicate` returns truthy for. The predicate is invoked with three
  9598. * arguments: (value, index|key, collection).
  9599. *
  9600. * @static
  9601. * @memberOf _
  9602. * @since 0.1.0
  9603. * @category Collection
  9604. * @param {Array|Object} collection The collection to inspect.
  9605. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  9606. * @param {number} [fromIndex=0] The index to search from.
  9607. * @returns {*} Returns the matched element, else `undefined`.
  9608. * @example
  9609. *
  9610. * var users = [
  9611. * { 'user': 'barney', 'age': 36, 'active': true },
  9612. * { 'user': 'fred', 'age': 40, 'active': false },
  9613. * { 'user': 'pebbles', 'age': 1, 'active': true }
  9614. * ];
  9615. *
  9616. * _.find(users, function(o) { return o.age < 40; });
  9617. * // => object for 'barney'
  9618. *
  9619. * // The `_.matches` iteratee shorthand.
  9620. * _.find(users, { 'age': 1, 'active': true });
  9621. * // => object for 'pebbles'
  9622. *
  9623. * // The `_.matchesProperty` iteratee shorthand.
  9624. * _.find(users, ['active', false]);
  9625. * // => object for 'fred'
  9626. *
  9627. * // The `_.property` iteratee shorthand.
  9628. * _.find(users, 'active');
  9629. * // => object for 'barney'
  9630. */
  9631. var find = createFind(findIndex);
  9632. /**
  9633. * This method is like `_.find` except that it iterates over elements of
  9634. * `collection` from right to left.
  9635. *
  9636. * @static
  9637. * @memberOf _
  9638. * @since 2.0.0
  9639. * @category Collection
  9640. * @param {Array|Object} collection The collection to inspect.
  9641. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  9642. * @param {number} [fromIndex=collection.length-1] The index to search from.
  9643. * @returns {*} Returns the matched element, else `undefined`.
  9644. * @example
  9645. *
  9646. * _.findLast([1, 2, 3, 4], function(n) {
  9647. * return n % 2 == 1;
  9648. * });
  9649. * // => 3
  9650. */
  9651. var findLast = createFind(findLastIndex);
  9652. /**
  9653. * Creates a flattened array of values by running each element in `collection`
  9654. * thru `iteratee` and flattening the mapped results. The iteratee is invoked
  9655. * with three arguments: (value, index|key, collection).
  9656. *
  9657. * @static
  9658. * @memberOf _
  9659. * @since 4.0.0
  9660. * @category Collection
  9661. * @param {Array|Object} collection The collection to iterate over.
  9662. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  9663. * @returns {Array} Returns the new flattened array.
  9664. * @example
  9665. *
  9666. * function duplicate(n) {
  9667. * return [n, n];
  9668. * }
  9669. *
  9670. * _.flatMap([1, 2], duplicate);
  9671. * // => [1, 1, 2, 2]
  9672. */
  9673. function flatMap(collection, iteratee) {
  9674. return baseFlatten(map(collection, iteratee), 1);
  9675. }
  9676. /**
  9677. * This method is like `_.flatMap` except that it recursively flattens the
  9678. * mapped results.
  9679. *
  9680. * @static
  9681. * @memberOf _
  9682. * @since 4.7.0
  9683. * @category Collection
  9684. * @param {Array|Object} collection The collection to iterate over.
  9685. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  9686. * @returns {Array} Returns the new flattened array.
  9687. * @example
  9688. *
  9689. * function duplicate(n) {
  9690. * return [[[n, n]]];
  9691. * }
  9692. *
  9693. * _.flatMapDeep([1, 2], duplicate);
  9694. * // => [1, 1, 2, 2]
  9695. */
  9696. function flatMapDeep(collection, iteratee) {
  9697. return baseFlatten(map(collection, iteratee), INFINITY);
  9698. }
  9699. /**
  9700. * This method is like `_.flatMap` except that it recursively flattens the
  9701. * mapped results up to `depth` times.
  9702. *
  9703. * @static
  9704. * @memberOf _
  9705. * @since 4.7.0
  9706. * @category Collection
  9707. * @param {Array|Object} collection The collection to iterate over.
  9708. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  9709. * @param {number} [depth=1] The maximum recursion depth.
  9710. * @returns {Array} Returns the new flattened array.
  9711. * @example
  9712. *
  9713. * function duplicate(n) {
  9714. * return [[[n, n]]];
  9715. * }
  9716. *
  9717. * _.flatMapDepth([1, 2], duplicate, 2);
  9718. * // => [[1, 1], [2, 2]]
  9719. */
  9720. function flatMapDepth(collection, iteratee, depth) {
  9721. depth = depth === undefined ? 1 : toInteger(depth);
  9722. return baseFlatten(map(collection, iteratee), depth);
  9723. }
  9724. /**
  9725. * Iterates over elements of `collection` and invokes `iteratee` for each element.
  9726. * The iteratee is invoked with three arguments: (value, index|key, collection).
  9727. * Iteratee functions may exit iteration early by explicitly returning `false`.
  9728. *
  9729. * **Note:** As with other "Collections" methods, objects with a "length"
  9730. * property are iterated like arrays. To avoid this behavior use `_.forIn`
  9731. * or `_.forOwn` for object iteration.
  9732. *
  9733. * @static
  9734. * @memberOf _
  9735. * @since 0.1.0
  9736. * @alias each
  9737. * @category Collection
  9738. * @param {Array|Object} collection The collection to iterate over.
  9739. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  9740. * @returns {Array|Object} Returns `collection`.
  9741. * @see _.forEachRight
  9742. * @example
  9743. *
  9744. * _.forEach([1, 2], function(value) {
  9745. * console.log(value);
  9746. * });
  9747. * // => Logs `1` then `2`.
  9748. *
  9749. * _.forEach({ 'a': 1, 'b': 2 }, function(value, key) {
  9750. * console.log(key);
  9751. * });
  9752. * // => Logs 'a' then 'b' (iteration order is not guaranteed).
  9753. */
  9754. function forEach(collection, iteratee) {
  9755. var func = isArray(collection) ? arrayEach : baseEach;
  9756. return func(collection, getIteratee(iteratee, 3));
  9757. }
  9758. /**
  9759. * This method is like `_.forEach` except that it iterates over elements of
  9760. * `collection` from right to left.
  9761. *
  9762. * @static
  9763. * @memberOf _
  9764. * @since 2.0.0
  9765. * @alias eachRight
  9766. * @category Collection
  9767. * @param {Array|Object} collection The collection to iterate over.
  9768. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  9769. * @returns {Array|Object} Returns `collection`.
  9770. * @see _.forEach
  9771. * @example
  9772. *
  9773. * _.forEachRight([1, 2], function(value) {
  9774. * console.log(value);
  9775. * });
  9776. * // => Logs `2` then `1`.
  9777. */
  9778. function forEachRight(collection, iteratee) {
  9779. var func = isArray(collection) ? arrayEachRight : baseEachRight;
  9780. return func(collection, getIteratee(iteratee, 3));
  9781. }
  9782. /**
  9783. * Creates an object composed of keys generated from the results of running
  9784. * each element of `collection` thru `iteratee`. The order of grouped values
  9785. * is determined by the order they occur in `collection`. The corresponding
  9786. * value of each key is an array of elements responsible for generating the
  9787. * key. The iteratee is invoked with one argument: (value).
  9788. *
  9789. * @static
  9790. * @memberOf _
  9791. * @since 0.1.0
  9792. * @category Collection
  9793. * @param {Array|Object} collection The collection to iterate over.
  9794. * @param {Function} [iteratee=_.identity] The iteratee to transform keys.
  9795. * @returns {Object} Returns the composed aggregate object.
  9796. * @example
  9797. *
  9798. * _.groupBy([6.1, 4.2, 6.3], Math.floor);
  9799. * // => { '4': [4.2], '6': [6.1, 6.3] }
  9800. *
  9801. * // The `_.property` iteratee shorthand.
  9802. * _.groupBy(['one', 'two', 'three'], 'length');
  9803. * // => { '3': ['one', 'two'], '5': ['three'] }
  9804. */
  9805. var groupBy = createAggregator(function(result, value, key) {
  9806. if (hasOwnProperty.call(result, key)) {
  9807. result[key].push(value);
  9808. } else {
  9809. baseAssignValue(result, key, [value]);
  9810. }
  9811. });
  9812. /**
  9813. * Checks if `value` is in `collection`. If `collection` is a string, it's
  9814. * checked for a substring of `value`, otherwise
  9815. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  9816. * is used for equality comparisons. If `fromIndex` is negative, it's used as
  9817. * the offset from the end of `collection`.
  9818. *
  9819. * @static
  9820. * @memberOf _
  9821. * @since 0.1.0
  9822. * @category Collection
  9823. * @param {Array|Object|string} collection The collection to inspect.
  9824. * @param {*} value The value to search for.
  9825. * @param {number} [fromIndex=0] The index to search from.
  9826. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.reduce`.
  9827. * @returns {boolean} Returns `true` if `value` is found, else `false`.
  9828. * @example
  9829. *
  9830. * _.includes([1, 2, 3], 1);
  9831. * // => true
  9832. *
  9833. * _.includes([1, 2, 3], 1, 2);
  9834. * // => false
  9835. *
  9836. * _.includes({ 'a': 1, 'b': 2 }, 1);
  9837. * // => true
  9838. *
  9839. * _.includes('abcd', 'bc');
  9840. * // => true
  9841. */
  9842. function includes(collection, value, fromIndex, guard) {
  9843. collection = isArrayLike(collection) ? collection : values(collection);
  9844. fromIndex = (fromIndex && !guard) ? toInteger(fromIndex) : 0;
  9845. var length = collection.length;
  9846. if (fromIndex < 0) {
  9847. fromIndex = nativeMax(length + fromIndex, 0);
  9848. }
  9849. return isString(collection)
  9850. ? (fromIndex <= length && collection.indexOf(value, fromIndex) > -1)
  9851. : (!!length && baseIndexOf(collection, value, fromIndex) > -1);
  9852. }
  9853. /**
  9854. * Invokes the method at `path` of each element in `collection`, returning
  9855. * an array of the results of each invoked method. Any additional arguments
  9856. * are provided to each invoked method. If `path` is a function, it's invoked
  9857. * for, and `this` bound to, each element in `collection`.
  9858. *
  9859. * @static
  9860. * @memberOf _
  9861. * @since 4.0.0
  9862. * @category Collection
  9863. * @param {Array|Object} collection The collection to iterate over.
  9864. * @param {Array|Function|string} path The path of the method to invoke or
  9865. * the function invoked per iteration.
  9866. * @param {...*} [args] The arguments to invoke each method with.
  9867. * @returns {Array} Returns the array of results.
  9868. * @example
  9869. *
  9870. * _.invokeMap([[5, 1, 7], [3, 2, 1]], 'sort');
  9871. * // => [[1, 5, 7], [1, 2, 3]]
  9872. *
  9873. * _.invokeMap([123, 456], String.prototype.split, '');
  9874. * // => [['1', '2', '3'], ['4', '5', '6']]
  9875. */
  9876. var invokeMap = baseRest(function(collection, path, args) {
  9877. var index = -1,
  9878. isFunc = typeof path == 'function',
  9879. result = isArrayLike(collection) ? Array(collection.length) : [];
  9880. baseEach(collection, function(value) {
  9881. result[++index] = isFunc ? apply(path, value, args) : baseInvoke(value, path, args);
  9882. });
  9883. return result;
  9884. });
  9885. /**
  9886. * Creates an object composed of keys generated from the results of running
  9887. * each element of `collection` thru `iteratee`. The corresponding value of
  9888. * each key is the last element responsible for generating the key. The
  9889. * iteratee is invoked with one argument: (value).
  9890. *
  9891. * @static
  9892. * @memberOf _
  9893. * @since 4.0.0
  9894. * @category Collection
  9895. * @param {Array|Object} collection The collection to iterate over.
  9896. * @param {Function} [iteratee=_.identity] The iteratee to transform keys.
  9897. * @returns {Object} Returns the composed aggregate object.
  9898. * @example
  9899. *
  9900. * var array = [
  9901. * { 'dir': 'left', 'code': 97 },
  9902. * { 'dir': 'right', 'code': 100 }
  9903. * ];
  9904. *
  9905. * _.keyBy(array, function(o) {
  9906. * return String.fromCharCode(o.code);
  9907. * });
  9908. * // => { 'a': { 'dir': 'left', 'code': 97 }, 'd': { 'dir': 'right', 'code': 100 } }
  9909. *
  9910. * _.keyBy(array, 'dir');
  9911. * // => { 'left': { 'dir': 'left', 'code': 97 }, 'right': { 'dir': 'right', 'code': 100 } }
  9912. */
  9913. var keyBy = createAggregator(function(result, value, key) {
  9914. baseAssignValue(result, key, value);
  9915. });
  9916. /**
  9917. * Creates an array of values by running each element in `collection` thru
  9918. * `iteratee`. The iteratee is invoked with three arguments:
  9919. * (value, index|key, collection).
  9920. *
  9921. * Many lodash methods are guarded to work as iteratees for methods like
  9922. * `_.every`, `_.filter`, `_.map`, `_.mapValues`, `_.reject`, and `_.some`.
  9923. *
  9924. * The guarded methods are:
  9925. * `ary`, `chunk`, `curry`, `curryRight`, `drop`, `dropRight`, `every`,
  9926. * `fill`, `invert`, `parseInt`, `random`, `range`, `rangeRight`, `repeat`,
  9927. * `sampleSize`, `slice`, `some`, `sortBy`, `split`, `take`, `takeRight`,
  9928. * `template`, `trim`, `trimEnd`, `trimStart`, and `words`
  9929. *
  9930. * @static
  9931. * @memberOf _
  9932. * @since 0.1.0
  9933. * @category Collection
  9934. * @param {Array|Object} collection The collection to iterate over.
  9935. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  9936. * @returns {Array} Returns the new mapped array.
  9937. * @example
  9938. *
  9939. * function square(n) {
  9940. * return n * n;
  9941. * }
  9942. *
  9943. * _.map([4, 8], square);
  9944. * // => [16, 64]
  9945. *
  9946. * _.map({ 'a': 4, 'b': 8 }, square);
  9947. * // => [16, 64] (iteration order is not guaranteed)
  9948. *
  9949. * var users = [
  9950. * { 'user': 'barney' },
  9951. * { 'user': 'fred' }
  9952. * ];
  9953. *
  9954. * // The `_.property` iteratee shorthand.
  9955. * _.map(users, 'user');
  9956. * // => ['barney', 'fred']
  9957. */
  9958. function map(collection, iteratee) {
  9959. var func = isArray(collection) ? arrayMap : baseMap;
  9960. return func(collection, getIteratee(iteratee, 3));
  9961. }
  9962. /**
  9963. * This method is like `_.sortBy` except that it allows specifying the sort
  9964. * orders of the iteratees to sort by. If `orders` is unspecified, all values
  9965. * are sorted in ascending order. Otherwise, specify an order of "desc" for
  9966. * descending or "asc" for ascending sort order of corresponding values.
  9967. *
  9968. * @static
  9969. * @memberOf _
  9970. * @since 4.0.0
  9971. * @category Collection
  9972. * @param {Array|Object} collection The collection to iterate over.
  9973. * @param {Array[]|Function[]|Object[]|string[]} [iteratees=[_.identity]]
  9974. * The iteratees to sort by.
  9975. * @param {string[]} [orders] The sort orders of `iteratees`.
  9976. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.reduce`.
  9977. * @returns {Array} Returns the new sorted array.
  9978. * @example
  9979. *
  9980. * var users = [
  9981. * { 'user': 'fred', 'age': 48 },
  9982. * { 'user': 'barney', 'age': 34 },
  9983. * { 'user': 'fred', 'age': 40 },
  9984. * { 'user': 'barney', 'age': 36 }
  9985. * ];
  9986. *
  9987. * // Sort by `user` in ascending order and by `age` in descending order.
  9988. * _.orderBy(users, ['user', 'age'], ['asc', 'desc']);
  9989. * // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 40]]
  9990. */
  9991. function orderBy(collection, iteratees, orders, guard) {
  9992. if (collection == null) {
  9993. return [];
  9994. }
  9995. if (!isArray(iteratees)) {
  9996. iteratees = iteratees == null ? [] : [iteratees];
  9997. }
  9998. orders = guard ? undefined : orders;
  9999. if (!isArray(orders)) {
  10000. orders = orders == null ? [] : [orders];
  10001. }
  10002. return baseOrderBy(collection, iteratees, orders);
  10003. }
  10004. /**
  10005. * Creates an array of elements split into two groups, the first of which
  10006. * contains elements `predicate` returns truthy for, the second of which
  10007. * contains elements `predicate` returns falsey for. The predicate is
  10008. * invoked with one argument: (value).
  10009. *
  10010. * @static
  10011. * @memberOf _
  10012. * @since 3.0.0
  10013. * @category Collection
  10014. * @param {Array|Object} collection The collection to iterate over.
  10015. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  10016. * @returns {Array} Returns the array of grouped elements.
  10017. * @example
  10018. *
  10019. * var users = [
  10020. * { 'user': 'barney', 'age': 36, 'active': false },
  10021. * { 'user': 'fred', 'age': 40, 'active': true },
  10022. * { 'user': 'pebbles', 'age': 1, 'active': false }
  10023. * ];
  10024. *
  10025. * _.partition(users, function(o) { return o.active; });
  10026. * // => objects for [['fred'], ['barney', 'pebbles']]
  10027. *
  10028. * // The `_.matches` iteratee shorthand.
  10029. * _.partition(users, { 'age': 1, 'active': false });
  10030. * // => objects for [['pebbles'], ['barney', 'fred']]
  10031. *
  10032. * // The `_.matchesProperty` iteratee shorthand.
  10033. * _.partition(users, ['active', false]);
  10034. * // => objects for [['barney', 'pebbles'], ['fred']]
  10035. *
  10036. * // The `_.property` iteratee shorthand.
  10037. * _.partition(users, 'active');
  10038. * // => objects for [['fred'], ['barney', 'pebbles']]
  10039. */
  10040. var partition = createAggregator(function(result, value, key) {
  10041. result[key ? 0 : 1].push(value);
  10042. }, function() { return [[], []]; });
  10043. /**
  10044. * Reduces `collection` to a value which is the accumulated result of running
  10045. * each element in `collection` thru `iteratee`, where each successive
  10046. * invocation is supplied the return value of the previous. If `accumulator`
  10047. * is not given, the first element of `collection` is used as the initial
  10048. * value. The iteratee is invoked with four arguments:
  10049. * (accumulator, value, index|key, collection).
  10050. *
  10051. * Many lodash methods are guarded to work as iteratees for methods like
  10052. * `_.reduce`, `_.reduceRight`, and `_.transform`.
  10053. *
  10054. * The guarded methods are:
  10055. * `assign`, `defaults`, `defaultsDeep`, `includes`, `merge`, `orderBy`,
  10056. * and `sortBy`
  10057. *
  10058. * @static
  10059. * @memberOf _
  10060. * @since 0.1.0
  10061. * @category Collection
  10062. * @param {Array|Object} collection The collection to iterate over.
  10063. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  10064. * @param {*} [accumulator] The initial value.
  10065. * @returns {*} Returns the accumulated value.
  10066. * @see _.reduceRight
  10067. * @example
  10068. *
  10069. * _.reduce([1, 2], function(sum, n) {
  10070. * return sum + n;
  10071. * }, 0);
  10072. * // => 3
  10073. *
  10074. * _.reduce({ 'a': 1, 'b': 2, 'c': 1 }, function(result, value, key) {
  10075. * (result[value] || (result[value] = [])).push(key);
  10076. * return result;
  10077. * }, {});
  10078. * // => { '1': ['a', 'c'], '2': ['b'] } (iteration order is not guaranteed)
  10079. */
  10080. function reduce(collection, iteratee, accumulator) {
  10081. var func = isArray(collection) ? arrayReduce : baseReduce,
  10082. initAccum = arguments.length < 3;
  10083. return func(collection, getIteratee(iteratee, 4), accumulator, initAccum, baseEach);
  10084. }
  10085. /**
  10086. * This method is like `_.reduce` except that it iterates over elements of
  10087. * `collection` from right to left.
  10088. *
  10089. * @static
  10090. * @memberOf _
  10091. * @since 0.1.0
  10092. * @category Collection
  10093. * @param {Array|Object} collection The collection to iterate over.
  10094. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  10095. * @param {*} [accumulator] The initial value.
  10096. * @returns {*} Returns the accumulated value.
  10097. * @see _.reduce
  10098. * @example
  10099. *
  10100. * var array = [[0, 1], [2, 3], [4, 5]];
  10101. *
  10102. * _.reduceRight(array, function(flattened, other) {
  10103. * return flattened.concat(other);
  10104. * }, []);
  10105. * // => [4, 5, 2, 3, 0, 1]
  10106. */
  10107. function reduceRight(collection, iteratee, accumulator) {
  10108. var func = isArray(collection) ? arrayReduceRight : baseReduce,
  10109. initAccum = arguments.length < 3;
  10110. return func(collection, getIteratee(iteratee, 4), accumulator, initAccum, baseEachRight);
  10111. }
  10112. /**
  10113. * The opposite of `_.filter`; this method returns the elements of `collection`
  10114. * that `predicate` does **not** return truthy for.
  10115. *
  10116. * @static
  10117. * @memberOf _
  10118. * @since 0.1.0
  10119. * @category Collection
  10120. * @param {Array|Object} collection The collection to iterate over.
  10121. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  10122. * @returns {Array} Returns the new filtered array.
  10123. * @see _.filter
  10124. * @example
  10125. *
  10126. * var users = [
  10127. * { 'user': 'barney', 'age': 36, 'active': false },
  10128. * { 'user': 'fred', 'age': 40, 'active': true }
  10129. * ];
  10130. *
  10131. * _.reject(users, function(o) { return !o.active; });
  10132. * // => objects for ['fred']
  10133. *
  10134. * // The `_.matches` iteratee shorthand.
  10135. * _.reject(users, { 'age': 40, 'active': true });
  10136. * // => objects for ['barney']
  10137. *
  10138. * // The `_.matchesProperty` iteratee shorthand.
  10139. * _.reject(users, ['active', false]);
  10140. * // => objects for ['fred']
  10141. *
  10142. * // The `_.property` iteratee shorthand.
  10143. * _.reject(users, 'active');
  10144. * // => objects for ['barney']
  10145. */
  10146. function reject(collection, predicate) {
  10147. var func = isArray(collection) ? arrayFilter : baseFilter;
  10148. return func(collection, negate(getIteratee(predicate, 3)));
  10149. }
  10150. /**
  10151. * Gets a random element from `collection`.
  10152. *
  10153. * @static
  10154. * @memberOf _
  10155. * @since 2.0.0
  10156. * @category Collection
  10157. * @param {Array|Object} collection The collection to sample.
  10158. * @returns {*} Returns the random element.
  10159. * @example
  10160. *
  10161. * _.sample([1, 2, 3, 4]);
  10162. * // => 2
  10163. */
  10164. function sample(collection) {
  10165. var func = isArray(collection) ? arraySample : baseSample;
  10166. return func(collection);
  10167. }
  10168. /**
  10169. * Gets `n` random elements at unique keys from `collection` up to the
  10170. * size of `collection`.
  10171. *
  10172. * @static
  10173. * @memberOf _
  10174. * @since 4.0.0
  10175. * @category Collection
  10176. * @param {Array|Object} collection The collection to sample.
  10177. * @param {number} [n=1] The number of elements to sample.
  10178. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  10179. * @returns {Array} Returns the random elements.
  10180. * @example
  10181. *
  10182. * _.sampleSize([1, 2, 3], 2);
  10183. * // => [3, 1]
  10184. *
  10185. * _.sampleSize([1, 2, 3], 4);
  10186. * // => [2, 3, 1]
  10187. */
  10188. function sampleSize(collection, n, guard) {
  10189. if ((guard ? isIterateeCall(collection, n, guard) : n === undefined)) {
  10190. n = 1;
  10191. } else {
  10192. n = toInteger(n);
  10193. }
  10194. var func = isArray(collection) ? arraySampleSize : baseSampleSize;
  10195. return func(collection, n);
  10196. }
  10197. /**
  10198. * Creates an array of shuffled values, using a version of the
  10199. * [Fisher-Yates shuffle](https://en.wikipedia.org/wiki/Fisher-Yates_shuffle).
  10200. *
  10201. * @static
  10202. * @memberOf _
  10203. * @since 0.1.0
  10204. * @category Collection
  10205. * @param {Array|Object} collection The collection to shuffle.
  10206. * @returns {Array} Returns the new shuffled array.
  10207. * @example
  10208. *
  10209. * _.shuffle([1, 2, 3, 4]);
  10210. * // => [4, 1, 3, 2]
  10211. */
  10212. function shuffle(collection) {
  10213. var func = isArray(collection) ? arrayShuffle : baseShuffle;
  10214. return func(collection);
  10215. }
  10216. /**
  10217. * Gets the size of `collection` by returning its length for array-like
  10218. * values or the number of own enumerable string keyed properties for objects.
  10219. *
  10220. * @static
  10221. * @memberOf _
  10222. * @since 0.1.0
  10223. * @category Collection
  10224. * @param {Array|Object|string} collection The collection to inspect.
  10225. * @returns {number} Returns the collection size.
  10226. * @example
  10227. *
  10228. * _.size([1, 2, 3]);
  10229. * // => 3
  10230. *
  10231. * _.size({ 'a': 1, 'b': 2 });
  10232. * // => 2
  10233. *
  10234. * _.size('pebbles');
  10235. * // => 7
  10236. */
  10237. function size(collection) {
  10238. if (collection == null) {
  10239. return 0;
  10240. }
  10241. if (isArrayLike(collection)) {
  10242. return isString(collection) ? stringSize(collection) : collection.length;
  10243. }
  10244. var tag = getTag(collection);
  10245. if (tag == mapTag || tag == setTag) {
  10246. return collection.size;
  10247. }
  10248. return baseKeys(collection).length;
  10249. }
  10250. /**
  10251. * Checks if `predicate` returns truthy for **any** element of `collection`.
  10252. * Iteration is stopped once `predicate` returns truthy. The predicate is
  10253. * invoked with three arguments: (value, index|key, collection).
  10254. *
  10255. * @static
  10256. * @memberOf _
  10257. * @since 0.1.0
  10258. * @category Collection
  10259. * @param {Array|Object} collection The collection to iterate over.
  10260. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  10261. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  10262. * @returns {boolean} Returns `true` if any element passes the predicate check,
  10263. * else `false`.
  10264. * @example
  10265. *
  10266. * _.some([null, 0, 'yes', false], Boolean);
  10267. * // => true
  10268. *
  10269. * var users = [
  10270. * { 'user': 'barney', 'active': true },
  10271. * { 'user': 'fred', 'active': false }
  10272. * ];
  10273. *
  10274. * // The `_.matches` iteratee shorthand.
  10275. * _.some(users, { 'user': 'barney', 'active': false });
  10276. * // => false
  10277. *
  10278. * // The `_.matchesProperty` iteratee shorthand.
  10279. * _.some(users, ['active', false]);
  10280. * // => true
  10281. *
  10282. * // The `_.property` iteratee shorthand.
  10283. * _.some(users, 'active');
  10284. * // => true
  10285. */
  10286. function some(collection, predicate, guard) {
  10287. var func = isArray(collection) ? arraySome : baseSome;
  10288. if (guard && isIterateeCall(collection, predicate, guard)) {
  10289. predicate = undefined;
  10290. }
  10291. return func(collection, getIteratee(predicate, 3));
  10292. }
  10293. /**
  10294. * Creates an array of elements, sorted in ascending order by the results of
  10295. * running each element in a collection thru each iteratee. This method
  10296. * performs a stable sort, that is, it preserves the original sort order of
  10297. * equal elements. The iteratees are invoked with one argument: (value).
  10298. *
  10299. * @static
  10300. * @memberOf _
  10301. * @since 0.1.0
  10302. * @category Collection
  10303. * @param {Array|Object} collection The collection to iterate over.
  10304. * @param {...(Function|Function[])} [iteratees=[_.identity]]
  10305. * The iteratees to sort by.
  10306. * @returns {Array} Returns the new sorted array.
  10307. * @example
  10308. *
  10309. * var users = [
  10310. * { 'user': 'fred', 'age': 48 },
  10311. * { 'user': 'barney', 'age': 36 },
  10312. * { 'user': 'fred', 'age': 30 },
  10313. * { 'user': 'barney', 'age': 34 }
  10314. * ];
  10315. *
  10316. * _.sortBy(users, [function(o) { return o.user; }]);
  10317. * // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 30]]
  10318. *
  10319. * _.sortBy(users, ['user', 'age']);
  10320. * // => objects for [['barney', 34], ['barney', 36], ['fred', 30], ['fred', 48]]
  10321. */
  10322. var sortBy = baseRest(function(collection, iteratees) {
  10323. if (collection == null) {
  10324. return [];
  10325. }
  10326. var length = iteratees.length;
  10327. if (length > 1 && isIterateeCall(collection, iteratees[0], iteratees[1])) {
  10328. iteratees = [];
  10329. } else if (length > 2 && isIterateeCall(iteratees[0], iteratees[1], iteratees[2])) {
  10330. iteratees = [iteratees[0]];
  10331. }
  10332. return baseOrderBy(collection, baseFlatten(iteratees, 1), []);
  10333. });
  10334. /*------------------------------------------------------------------------*/
  10335. /**
  10336. * Gets the timestamp of the number of milliseconds that have elapsed since
  10337. * the Unix epoch (1 January 1970 00:00:00 UTC).
  10338. *
  10339. * @static
  10340. * @memberOf _
  10341. * @since 2.4.0
  10342. * @category Date
  10343. * @returns {number} Returns the timestamp.
  10344. * @example
  10345. *
  10346. * _.defer(function(stamp) {
  10347. * console.log(_.now() - stamp);
  10348. * }, _.now());
  10349. * // => Logs the number of milliseconds it took for the deferred invocation.
  10350. */
  10351. var now = ctxNow || function() {
  10352. return root.Date.now();
  10353. };
  10354. /*------------------------------------------------------------------------*/
  10355. /**
  10356. * The opposite of `_.before`; this method creates a function that invokes
  10357. * `func` once it's called `n` or more times.
  10358. *
  10359. * @static
  10360. * @memberOf _
  10361. * @since 0.1.0
  10362. * @category Function
  10363. * @param {number} n The number of calls before `func` is invoked.
  10364. * @param {Function} func The function to restrict.
  10365. * @returns {Function} Returns the new restricted function.
  10366. * @example
  10367. *
  10368. * var saves = ['profile', 'settings'];
  10369. *
  10370. * var done = _.after(saves.length, function() {
  10371. * console.log('done saving!');
  10372. * });
  10373. *
  10374. * _.forEach(saves, function(type) {
  10375. * asyncSave({ 'type': type, 'complete': done });
  10376. * });
  10377. * // => Logs 'done saving!' after the two async saves have completed.
  10378. */
  10379. function after(n, func) {
  10380. if (typeof func != 'function') {
  10381. throw new TypeError(FUNC_ERROR_TEXT);
  10382. }
  10383. n = toInteger(n);
  10384. return function() {
  10385. if (--n < 1) {
  10386. return func.apply(this, arguments);
  10387. }
  10388. };
  10389. }
  10390. /**
  10391. * Creates a function that invokes `func`, with up to `n` arguments,
  10392. * ignoring any additional arguments.
  10393. *
  10394. * @static
  10395. * @memberOf _
  10396. * @since 3.0.0
  10397. * @category Function
  10398. * @param {Function} func The function to cap arguments for.
  10399. * @param {number} [n=func.length] The arity cap.
  10400. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  10401. * @returns {Function} Returns the new capped function.
  10402. * @example
  10403. *
  10404. * _.map(['6', '8', '10'], _.ary(parseInt, 1));
  10405. * // => [6, 8, 10]
  10406. */
  10407. function ary(func, n, guard) {
  10408. n = guard ? undefined : n;
  10409. n = (func && n == null) ? func.length : n;
  10410. return createWrap(func, WRAP_ARY_FLAG, undefined, undefined, undefined, undefined, n);
  10411. }
  10412. /**
  10413. * Creates a function that invokes `func`, with the `this` binding and arguments
  10414. * of the created function, while it's called less than `n` times. Subsequent
  10415. * calls to the created function return the result of the last `func` invocation.
  10416. *
  10417. * @static
  10418. * @memberOf _
  10419. * @since 3.0.0
  10420. * @category Function
  10421. * @param {number} n The number of calls at which `func` is no longer invoked.
  10422. * @param {Function} func The function to restrict.
  10423. * @returns {Function} Returns the new restricted function.
  10424. * @example
  10425. *
  10426. * jQuery(element).on('click', _.before(5, addContactToList));
  10427. * // => Allows adding up to 4 contacts to the list.
  10428. */
  10429. function before(n, func) {
  10430. var result;
  10431. if (typeof func != 'function') {
  10432. throw new TypeError(FUNC_ERROR_TEXT);
  10433. }
  10434. n = toInteger(n);
  10435. return function() {
  10436. if (--n > 0) {
  10437. result = func.apply(this, arguments);
  10438. }
  10439. if (n <= 1) {
  10440. func = undefined;
  10441. }
  10442. return result;
  10443. };
  10444. }
  10445. /**
  10446. * Creates a function that invokes `func` with the `this` binding of `thisArg`
  10447. * and `partials` prepended to the arguments it receives.
  10448. *
  10449. * The `_.bind.placeholder` value, which defaults to `_` in monolithic builds,
  10450. * may be used as a placeholder for partially applied arguments.
  10451. *
  10452. * **Note:** Unlike native `Function#bind`, this method doesn't set the "length"
  10453. * property of bound functions.
  10454. *
  10455. * @static
  10456. * @memberOf _
  10457. * @since 0.1.0
  10458. * @category Function
  10459. * @param {Function} func The function to bind.
  10460. * @param {*} thisArg The `this` binding of `func`.
  10461. * @param {...*} [partials] The arguments to be partially applied.
  10462. * @returns {Function} Returns the new bound function.
  10463. * @example
  10464. *
  10465. * function greet(greeting, punctuation) {
  10466. * return greeting + ' ' + this.user + punctuation;
  10467. * }
  10468. *
  10469. * var object = { 'user': 'fred' };
  10470. *
  10471. * var bound = _.bind(greet, object, 'hi');
  10472. * bound('!');
  10473. * // => 'hi fred!'
  10474. *
  10475. * // Bound with placeholders.
  10476. * var bound = _.bind(greet, object, _, '!');
  10477. * bound('hi');
  10478. * // => 'hi fred!'
  10479. */
  10480. var bind = baseRest(function(func, thisArg, partials) {
  10481. var bitmask = WRAP_BIND_FLAG;
  10482. if (partials.length) {
  10483. var holders = replaceHolders(partials, getHolder(bind));
  10484. bitmask |= WRAP_PARTIAL_FLAG;
  10485. }
  10486. return createWrap(func, bitmask, thisArg, partials, holders);
  10487. });
  10488. /**
  10489. * Creates a function that invokes the method at `object[key]` with `partials`
  10490. * prepended to the arguments it receives.
  10491. *
  10492. * This method differs from `_.bind` by allowing bound functions to reference
  10493. * methods that may be redefined or don't yet exist. See
  10494. * [Peter Michaux's article](http://peter.michaux.ca/articles/lazy-function-definition-pattern)
  10495. * for more details.
  10496. *
  10497. * The `_.bindKey.placeholder` value, which defaults to `_` in monolithic
  10498. * builds, may be used as a placeholder for partially applied arguments.
  10499. *
  10500. * @static
  10501. * @memberOf _
  10502. * @since 0.10.0
  10503. * @category Function
  10504. * @param {Object} object The object to invoke the method on.
  10505. * @param {string} key The key of the method.
  10506. * @param {...*} [partials] The arguments to be partially applied.
  10507. * @returns {Function} Returns the new bound function.
  10508. * @example
  10509. *
  10510. * var object = {
  10511. * 'user': 'fred',
  10512. * 'greet': function(greeting, punctuation) {
  10513. * return greeting + ' ' + this.user + punctuation;
  10514. * }
  10515. * };
  10516. *
  10517. * var bound = _.bindKey(object, 'greet', 'hi');
  10518. * bound('!');
  10519. * // => 'hi fred!'
  10520. *
  10521. * object.greet = function(greeting, punctuation) {
  10522. * return greeting + 'ya ' + this.user + punctuation;
  10523. * };
  10524. *
  10525. * bound('!');
  10526. * // => 'hiya fred!'
  10527. *
  10528. * // Bound with placeholders.
  10529. * var bound = _.bindKey(object, 'greet', _, '!');
  10530. * bound('hi');
  10531. * // => 'hiya fred!'
  10532. */
  10533. var bindKey = baseRest(function(object, key, partials) {
  10534. var bitmask = WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG;
  10535. if (partials.length) {
  10536. var holders = replaceHolders(partials, getHolder(bindKey));
  10537. bitmask |= WRAP_PARTIAL_FLAG;
  10538. }
  10539. return createWrap(key, bitmask, object, partials, holders);
  10540. });
  10541. /**
  10542. * Creates a function that accepts arguments of `func` and either invokes
  10543. * `func` returning its result, if at least `arity` number of arguments have
  10544. * been provided, or returns a function that accepts the remaining `func`
  10545. * arguments, and so on. The arity of `func` may be specified if `func.length`
  10546. * is not sufficient.
  10547. *
  10548. * The `_.curry.placeholder` value, which defaults to `_` in monolithic builds,
  10549. * may be used as a placeholder for provided arguments.
  10550. *
  10551. * **Note:** This method doesn't set the "length" property of curried functions.
  10552. *
  10553. * @static
  10554. * @memberOf _
  10555. * @since 2.0.0
  10556. * @category Function
  10557. * @param {Function} func The function to curry.
  10558. * @param {number} [arity=func.length] The arity of `func`.
  10559. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  10560. * @returns {Function} Returns the new curried function.
  10561. * @example
  10562. *
  10563. * var abc = function(a, b, c) {
  10564. * return [a, b, c];
  10565. * };
  10566. *
  10567. * var curried = _.curry(abc);
  10568. *
  10569. * curried(1)(2)(3);
  10570. * // => [1, 2, 3]
  10571. *
  10572. * curried(1, 2)(3);
  10573. * // => [1, 2, 3]
  10574. *
  10575. * curried(1, 2, 3);
  10576. * // => [1, 2, 3]
  10577. *
  10578. * // Curried with placeholders.
  10579. * curried(1)(_, 3)(2);
  10580. * // => [1, 2, 3]
  10581. */
  10582. function curry(func, arity, guard) {
  10583. arity = guard ? undefined : arity;
  10584. var result = createWrap(func, WRAP_CURRY_FLAG, undefined, undefined, undefined, undefined, undefined, arity);
  10585. result.placeholder = curry.placeholder;
  10586. return result;
  10587. }
  10588. /**
  10589. * This method is like `_.curry` except that arguments are applied to `func`
  10590. * in the manner of `_.partialRight` instead of `_.partial`.
  10591. *
  10592. * The `_.curryRight.placeholder` value, which defaults to `_` in monolithic
  10593. * builds, may be used as a placeholder for provided arguments.
  10594. *
  10595. * **Note:** This method doesn't set the "length" property of curried functions.
  10596. *
  10597. * @static
  10598. * @memberOf _
  10599. * @since 3.0.0
  10600. * @category Function
  10601. * @param {Function} func The function to curry.
  10602. * @param {number} [arity=func.length] The arity of `func`.
  10603. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  10604. * @returns {Function} Returns the new curried function.
  10605. * @example
  10606. *
  10607. * var abc = function(a, b, c) {
  10608. * return [a, b, c];
  10609. * };
  10610. *
  10611. * var curried = _.curryRight(abc);
  10612. *
  10613. * curried(3)(2)(1);
  10614. * // => [1, 2, 3]
  10615. *
  10616. * curried(2, 3)(1);
  10617. * // => [1, 2, 3]
  10618. *
  10619. * curried(1, 2, 3);
  10620. * // => [1, 2, 3]
  10621. *
  10622. * // Curried with placeholders.
  10623. * curried(3)(1, _)(2);
  10624. * // => [1, 2, 3]
  10625. */
  10626. function curryRight(func, arity, guard) {
  10627. arity = guard ? undefined : arity;
  10628. var result = createWrap(func, WRAP_CURRY_RIGHT_FLAG, undefined, undefined, undefined, undefined, undefined, arity);
  10629. result.placeholder = curryRight.placeholder;
  10630. return result;
  10631. }
  10632. /**
  10633. * Creates a debounced function that delays invoking `func` until after `wait`
  10634. * milliseconds have elapsed since the last time the debounced function was
  10635. * invoked. The debounced function comes with a `cancel` method to cancel
  10636. * delayed `func` invocations and a `flush` method to immediately invoke them.
  10637. * Provide `options` to indicate whether `func` should be invoked on the
  10638. * leading and/or trailing edge of the `wait` timeout. The `func` is invoked
  10639. * with the last arguments provided to the debounced function. Subsequent
  10640. * calls to the debounced function return the result of the last `func`
  10641. * invocation.
  10642. *
  10643. * **Note:** If `leading` and `trailing` options are `true`, `func` is
  10644. * invoked on the trailing edge of the timeout only if the debounced function
  10645. * is invoked more than once during the `wait` timeout.
  10646. *
  10647. * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred
  10648. * until to the next tick, similar to `setTimeout` with a timeout of `0`.
  10649. *
  10650. * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/)
  10651. * for details over the differences between `_.debounce` and `_.throttle`.
  10652. *
  10653. * @static
  10654. * @memberOf _
  10655. * @since 0.1.0
  10656. * @category Function
  10657. * @param {Function} func The function to debounce.
  10658. * @param {number} [wait=0] The number of milliseconds to delay.
  10659. * @param {Object} [options={}] The options object.
  10660. * @param {boolean} [options.leading=false]
  10661. * Specify invoking on the leading edge of the timeout.
  10662. * @param {number} [options.maxWait]
  10663. * The maximum time `func` is allowed to be delayed before it's invoked.
  10664. * @param {boolean} [options.trailing=true]
  10665. * Specify invoking on the trailing edge of the timeout.
  10666. * @returns {Function} Returns the new debounced function.
  10667. * @example
  10668. *
  10669. * // Avoid costly calculations while the window size is in flux.
  10670. * jQuery(window).on('resize', _.debounce(calculateLayout, 150));
  10671. *
  10672. * // Invoke `sendMail` when clicked, debouncing subsequent calls.
  10673. * jQuery(element).on('click', _.debounce(sendMail, 300, {
  10674. * 'leading': true,
  10675. * 'trailing': false
  10676. * }));
  10677. *
  10678. * // Ensure `batchLog` is invoked once after 1 second of debounced calls.
  10679. * var debounced = _.debounce(batchLog, 250, { 'maxWait': 1000 });
  10680. * var source = new EventSource('/stream');
  10681. * jQuery(source).on('message', debounced);
  10682. *
  10683. * // Cancel the trailing debounced invocation.
  10684. * jQuery(window).on('popstate', debounced.cancel);
  10685. */
  10686. function debounce(func, wait, options) {
  10687. var lastArgs,
  10688. lastThis,
  10689. maxWait,
  10690. result,
  10691. timerId,
  10692. lastCallTime,
  10693. lastInvokeTime = 0,
  10694. leading = false,
  10695. maxing = false,
  10696. trailing = true;
  10697. if (typeof func != 'function') {
  10698. throw new TypeError(FUNC_ERROR_TEXT);
  10699. }
  10700. wait = toNumber(wait) || 0;
  10701. if (isObject(options)) {
  10702. leading = !!options.leading;
  10703. maxing = 'maxWait' in options;
  10704. maxWait = maxing ? nativeMax(toNumber(options.maxWait) || 0, wait) : maxWait;
  10705. trailing = 'trailing' in options ? !!options.trailing : trailing;
  10706. }
  10707. function invokeFunc(time) {
  10708. var args = lastArgs,
  10709. thisArg = lastThis;
  10710. lastArgs = lastThis = undefined;
  10711. lastInvokeTime = time;
  10712. result = func.apply(thisArg, args);
  10713. return result;
  10714. }
  10715. function leadingEdge(time) {
  10716. // Reset any `maxWait` timer.
  10717. lastInvokeTime = time;
  10718. // Start the timer for the trailing edge.
  10719. timerId = setTimeout(timerExpired, wait);
  10720. // Invoke the leading edge.
  10721. return leading ? invokeFunc(time) : result;
  10722. }
  10723. function remainingWait(time) {
  10724. var timeSinceLastCall = time - lastCallTime,
  10725. timeSinceLastInvoke = time - lastInvokeTime,
  10726. timeWaiting = wait - timeSinceLastCall;
  10727. return maxing
  10728. ? nativeMin(timeWaiting, maxWait - timeSinceLastInvoke)
  10729. : timeWaiting;
  10730. }
  10731. function shouldInvoke(time) {
  10732. var timeSinceLastCall = time - lastCallTime,
  10733. timeSinceLastInvoke = time - lastInvokeTime;
  10734. // Either this is the first call, activity has stopped and we're at the
  10735. // trailing edge, the system time has gone backwards and we're treating
  10736. // it as the trailing edge, or we've hit the `maxWait` limit.
  10737. return (lastCallTime === undefined || (timeSinceLastCall >= wait) ||
  10738. (timeSinceLastCall < 0) || (maxing && timeSinceLastInvoke >= maxWait));
  10739. }
  10740. function timerExpired() {
  10741. var time = now();
  10742. if (shouldInvoke(time)) {
  10743. return trailingEdge(time);
  10744. }
  10745. // Restart the timer.
  10746. timerId = setTimeout(timerExpired, remainingWait(time));
  10747. }
  10748. function trailingEdge(time) {
  10749. timerId = undefined;
  10750. // Only invoke if we have `lastArgs` which means `func` has been
  10751. // debounced at least once.
  10752. if (trailing && lastArgs) {
  10753. return invokeFunc(time);
  10754. }
  10755. lastArgs = lastThis = undefined;
  10756. return result;
  10757. }
  10758. function cancel() {
  10759. if (timerId !== undefined) {
  10760. clearTimeout(timerId);
  10761. }
  10762. lastInvokeTime = 0;
  10763. lastArgs = lastCallTime = lastThis = timerId = undefined;
  10764. }
  10765. function flush() {
  10766. return timerId === undefined ? result : trailingEdge(now());
  10767. }
  10768. function debounced() {
  10769. var time = now(),
  10770. isInvoking = shouldInvoke(time);
  10771. lastArgs = arguments;
  10772. lastThis = this;
  10773. lastCallTime = time;
  10774. if (isInvoking) {
  10775. if (timerId === undefined) {
  10776. return leadingEdge(lastCallTime);
  10777. }
  10778. if (maxing) {
  10779. // Handle invocations in a tight loop.
  10780. clearTimeout(timerId);
  10781. timerId = setTimeout(timerExpired, wait);
  10782. return invokeFunc(lastCallTime);
  10783. }
  10784. }
  10785. if (timerId === undefined) {
  10786. timerId = setTimeout(timerExpired, wait);
  10787. }
  10788. return result;
  10789. }
  10790. debounced.cancel = cancel;
  10791. debounced.flush = flush;
  10792. return debounced;
  10793. }
  10794. /**
  10795. * Defers invoking the `func` until the current call stack has cleared. Any
  10796. * additional arguments are provided to `func` when it's invoked.
  10797. *
  10798. * @static
  10799. * @memberOf _
  10800. * @since 0.1.0
  10801. * @category Function
  10802. * @param {Function} func The function to defer.
  10803. * @param {...*} [args] The arguments to invoke `func` with.
  10804. * @returns {number} Returns the timer id.
  10805. * @example
  10806. *
  10807. * _.defer(function(text) {
  10808. * console.log(text);
  10809. * }, 'deferred');
  10810. * // => Logs 'deferred' after one millisecond.
  10811. */
  10812. var defer = baseRest(function(func, args) {
  10813. return baseDelay(func, 1, args);
  10814. });
  10815. /**
  10816. * Invokes `func` after `wait` milliseconds. Any additional arguments are
  10817. * provided to `func` when it's invoked.
  10818. *
  10819. * @static
  10820. * @memberOf _
  10821. * @since 0.1.0
  10822. * @category Function
  10823. * @param {Function} func The function to delay.
  10824. * @param {number} wait The number of milliseconds to delay invocation.
  10825. * @param {...*} [args] The arguments to invoke `func` with.
  10826. * @returns {number} Returns the timer id.
  10827. * @example
  10828. *
  10829. * _.delay(function(text) {
  10830. * console.log(text);
  10831. * }, 1000, 'later');
  10832. * // => Logs 'later' after one second.
  10833. */
  10834. var delay = baseRest(function(func, wait, args) {
  10835. return baseDelay(func, toNumber(wait) || 0, args);
  10836. });
  10837. /**
  10838. * Creates a function that invokes `func` with arguments reversed.
  10839. *
  10840. * @static
  10841. * @memberOf _
  10842. * @since 4.0.0
  10843. * @category Function
  10844. * @param {Function} func The function to flip arguments for.
  10845. * @returns {Function} Returns the new flipped function.
  10846. * @example
  10847. *
  10848. * var flipped = _.flip(function() {
  10849. * return _.toArray(arguments);
  10850. * });
  10851. *
  10852. * flipped('a', 'b', 'c', 'd');
  10853. * // => ['d', 'c', 'b', 'a']
  10854. */
  10855. function flip(func) {
  10856. return createWrap(func, WRAP_FLIP_FLAG);
  10857. }
  10858. /**
  10859. * Creates a function that memoizes the result of `func`. If `resolver` is
  10860. * provided, it determines the cache key for storing the result based on the
  10861. * arguments provided to the memoized function. By default, the first argument
  10862. * provided to the memoized function is used as the map cache key. The `func`
  10863. * is invoked with the `this` binding of the memoized function.
  10864. *
  10865. * **Note:** The cache is exposed as the `cache` property on the memoized
  10866. * function. Its creation may be customized by replacing the `_.memoize.Cache`
  10867. * constructor with one whose instances implement the
  10868. * [`Map`](http://ecma-international.org/ecma-262/7.0/#sec-properties-of-the-map-prototype-object)
  10869. * method interface of `clear`, `delete`, `get`, `has`, and `set`.
  10870. *
  10871. * @static
  10872. * @memberOf _
  10873. * @since 0.1.0
  10874. * @category Function
  10875. * @param {Function} func The function to have its output memoized.
  10876. * @param {Function} [resolver] The function to resolve the cache key.
  10877. * @returns {Function} Returns the new memoized function.
  10878. * @example
  10879. *
  10880. * var object = { 'a': 1, 'b': 2 };
  10881. * var other = { 'c': 3, 'd': 4 };
  10882. *
  10883. * var values = _.memoize(_.values);
  10884. * values(object);
  10885. * // => [1, 2]
  10886. *
  10887. * values(other);
  10888. * // => [3, 4]
  10889. *
  10890. * object.a = 2;
  10891. * values(object);
  10892. * // => [1, 2]
  10893. *
  10894. * // Modify the result cache.
  10895. * values.cache.set(object, ['a', 'b']);
  10896. * values(object);
  10897. * // => ['a', 'b']
  10898. *
  10899. * // Replace `_.memoize.Cache`.
  10900. * _.memoize.Cache = WeakMap;
  10901. */
  10902. function memoize(func, resolver) {
  10903. if (typeof func != 'function' || (resolver != null && typeof resolver != 'function')) {
  10904. throw new TypeError(FUNC_ERROR_TEXT);
  10905. }
  10906. var memoized = function() {
  10907. var args = arguments,
  10908. key = resolver ? resolver.apply(this, args) : args[0],
  10909. cache = memoized.cache;
  10910. if (cache.has(key)) {
  10911. return cache.get(key);
  10912. }
  10913. var result = func.apply(this, args);
  10914. memoized.cache = cache.set(key, result) || cache;
  10915. return result;
  10916. };
  10917. memoized.cache = new (memoize.Cache || MapCache);
  10918. return memoized;
  10919. }
  10920. // Expose `MapCache`.
  10921. memoize.Cache = MapCache;
  10922. /**
  10923. * Creates a function that negates the result of the predicate `func`. The
  10924. * `func` predicate is invoked with the `this` binding and arguments of the
  10925. * created function.
  10926. *
  10927. * @static
  10928. * @memberOf _
  10929. * @since 3.0.0
  10930. * @category Function
  10931. * @param {Function} predicate The predicate to negate.
  10932. * @returns {Function} Returns the new negated function.
  10933. * @example
  10934. *
  10935. * function isEven(n) {
  10936. * return n % 2 == 0;
  10937. * }
  10938. *
  10939. * _.filter([1, 2, 3, 4, 5, 6], _.negate(isEven));
  10940. * // => [1, 3, 5]
  10941. */
  10942. function negate(predicate) {
  10943. if (typeof predicate != 'function') {
  10944. throw new TypeError(FUNC_ERROR_TEXT);
  10945. }
  10946. return function() {
  10947. var args = arguments;
  10948. switch (args.length) {
  10949. case 0: return !predicate.call(this);
  10950. case 1: return !predicate.call(this, args[0]);
  10951. case 2: return !predicate.call(this, args[0], args[1]);
  10952. case 3: return !predicate.call(this, args[0], args[1], args[2]);
  10953. }
  10954. return !predicate.apply(this, args);
  10955. };
  10956. }
  10957. /**
  10958. * Creates a function that is restricted to invoking `func` once. Repeat calls
  10959. * to the function return the value of the first invocation. The `func` is
  10960. * invoked with the `this` binding and arguments of the created function.
  10961. *
  10962. * @static
  10963. * @memberOf _
  10964. * @since 0.1.0
  10965. * @category Function
  10966. * @param {Function} func The function to restrict.
  10967. * @returns {Function} Returns the new restricted function.
  10968. * @example
  10969. *
  10970. * var initialize = _.once(createApplication);
  10971. * initialize();
  10972. * initialize();
  10973. * // => `createApplication` is invoked once
  10974. */
  10975. function once(func) {
  10976. return before(2, func);
  10977. }
  10978. /**
  10979. * Creates a function that invokes `func` with its arguments transformed.
  10980. *
  10981. * @static
  10982. * @since 4.0.0
  10983. * @memberOf _
  10984. * @category Function
  10985. * @param {Function} func The function to wrap.
  10986. * @param {...(Function|Function[])} [transforms=[_.identity]]
  10987. * The argument transforms.
  10988. * @returns {Function} Returns the new function.
  10989. * @example
  10990. *
  10991. * function doubled(n) {
  10992. * return n * 2;
  10993. * }
  10994. *
  10995. * function square(n) {
  10996. * return n * n;
  10997. * }
  10998. *
  10999. * var func = _.overArgs(function(x, y) {
  11000. * return [x, y];
  11001. * }, [square, doubled]);
  11002. *
  11003. * func(9, 3);
  11004. * // => [81, 6]
  11005. *
  11006. * func(10, 5);
  11007. * // => [100, 10]
  11008. */
  11009. var overArgs = castRest(function(func, transforms) {
  11010. transforms = (transforms.length == 1 && isArray(transforms[0]))
  11011. ? arrayMap(transforms[0], baseUnary(getIteratee()))
  11012. : arrayMap(baseFlatten(transforms, 1), baseUnary(getIteratee()));
  11013. var funcsLength = transforms.length;
  11014. return baseRest(function(args) {
  11015. var index = -1,
  11016. length = nativeMin(args.length, funcsLength);
  11017. while (++index < length) {
  11018. args[index] = transforms[index].call(this, args[index]);
  11019. }
  11020. return apply(func, this, args);
  11021. });
  11022. });
  11023. /**
  11024. * Creates a function that invokes `func` with `partials` prepended to the
  11025. * arguments it receives. This method is like `_.bind` except it does **not**
  11026. * alter the `this` binding.
  11027. *
  11028. * The `_.partial.placeholder` value, which defaults to `_` in monolithic
  11029. * builds, may be used as a placeholder for partially applied arguments.
  11030. *
  11031. * **Note:** This method doesn't set the "length" property of partially
  11032. * applied functions.
  11033. *
  11034. * @static
  11035. * @memberOf _
  11036. * @since 0.2.0
  11037. * @category Function
  11038. * @param {Function} func The function to partially apply arguments to.
  11039. * @param {...*} [partials] The arguments to be partially applied.
  11040. * @returns {Function} Returns the new partially applied function.
  11041. * @example
  11042. *
  11043. * function greet(greeting, name) {
  11044. * return greeting + ' ' + name;
  11045. * }
  11046. *
  11047. * var sayHelloTo = _.partial(greet, 'hello');
  11048. * sayHelloTo('fred');
  11049. * // => 'hello fred'
  11050. *
  11051. * // Partially applied with placeholders.
  11052. * var greetFred = _.partial(greet, _, 'fred');
  11053. * greetFred('hi');
  11054. * // => 'hi fred'
  11055. */
  11056. var partial = baseRest(function(func, partials) {
  11057. var holders = replaceHolders(partials, getHolder(partial));
  11058. return createWrap(func, WRAP_PARTIAL_FLAG, undefined, partials, holders);
  11059. });
  11060. /**
  11061. * This method is like `_.partial` except that partially applied arguments
  11062. * are appended to the arguments it receives.
  11063. *
  11064. * The `_.partialRight.placeholder` value, which defaults to `_` in monolithic
  11065. * builds, may be used as a placeholder for partially applied arguments.
  11066. *
  11067. * **Note:** This method doesn't set the "length" property of partially
  11068. * applied functions.
  11069. *
  11070. * @static
  11071. * @memberOf _
  11072. * @since 1.0.0
  11073. * @category Function
  11074. * @param {Function} func The function to partially apply arguments to.
  11075. * @param {...*} [partials] The arguments to be partially applied.
  11076. * @returns {Function} Returns the new partially applied function.
  11077. * @example
  11078. *
  11079. * function greet(greeting, name) {
  11080. * return greeting + ' ' + name;
  11081. * }
  11082. *
  11083. * var greetFred = _.partialRight(greet, 'fred');
  11084. * greetFred('hi');
  11085. * // => 'hi fred'
  11086. *
  11087. * // Partially applied with placeholders.
  11088. * var sayHelloTo = _.partialRight(greet, 'hello', _);
  11089. * sayHelloTo('fred');
  11090. * // => 'hello fred'
  11091. */
  11092. var partialRight = baseRest(function(func, partials) {
  11093. var holders = replaceHolders(partials, getHolder(partialRight));
  11094. return createWrap(func, WRAP_PARTIAL_RIGHT_FLAG, undefined, partials, holders);
  11095. });
  11096. /**
  11097. * Creates a function that invokes `func` with arguments arranged according
  11098. * to the specified `indexes` where the argument value at the first index is
  11099. * provided as the first argument, the argument value at the second index is
  11100. * provided as the second argument, and so on.
  11101. *
  11102. * @static
  11103. * @memberOf _
  11104. * @since 3.0.0
  11105. * @category Function
  11106. * @param {Function} func The function to rearrange arguments for.
  11107. * @param {...(number|number[])} indexes The arranged argument indexes.
  11108. * @returns {Function} Returns the new function.
  11109. * @example
  11110. *
  11111. * var rearged = _.rearg(function(a, b, c) {
  11112. * return [a, b, c];
  11113. * }, [2, 0, 1]);
  11114. *
  11115. * rearged('b', 'c', 'a')
  11116. * // => ['a', 'b', 'c']
  11117. */
  11118. var rearg = flatRest(function(func, indexes) {
  11119. return createWrap(func, WRAP_REARG_FLAG, undefined, undefined, undefined, indexes);
  11120. });
  11121. /**
  11122. * Creates a function that invokes `func` with the `this` binding of the
  11123. * created function and arguments from `start` and beyond provided as
  11124. * an array.
  11125. *
  11126. * **Note:** This method is based on the
  11127. * [rest parameter](https://mdn.io/rest_parameters).
  11128. *
  11129. * @static
  11130. * @memberOf _
  11131. * @since 4.0.0
  11132. * @category Function
  11133. * @param {Function} func The function to apply a rest parameter to.
  11134. * @param {number} [start=func.length-1] The start position of the rest parameter.
  11135. * @returns {Function} Returns the new function.
  11136. * @example
  11137. *
  11138. * var say = _.rest(function(what, names) {
  11139. * return what + ' ' + _.initial(names).join(', ') +
  11140. * (_.size(names) > 1 ? ', & ' : '') + _.last(names);
  11141. * });
  11142. *
  11143. * say('hello', 'fred', 'barney', 'pebbles');
  11144. * // => 'hello fred, barney, & pebbles'
  11145. */
  11146. function rest(func, start) {
  11147. if (typeof func != 'function') {
  11148. throw new TypeError(FUNC_ERROR_TEXT);
  11149. }
  11150. start = start === undefined ? start : toInteger(start);
  11151. return baseRest(func, start);
  11152. }
  11153. /**
  11154. * Creates a function that invokes `func` with the `this` binding of the
  11155. * create function and an array of arguments much like
  11156. * [`Function#apply`](http://www.ecma-international.org/ecma-262/7.0/#sec-function.prototype.apply).
  11157. *
  11158. * **Note:** This method is based on the
  11159. * [spread operator](https://mdn.io/spread_operator).
  11160. *
  11161. * @static
  11162. * @memberOf _
  11163. * @since 3.2.0
  11164. * @category Function
  11165. * @param {Function} func The function to spread arguments over.
  11166. * @param {number} [start=0] The start position of the spread.
  11167. * @returns {Function} Returns the new function.
  11168. * @example
  11169. *
  11170. * var say = _.spread(function(who, what) {
  11171. * return who + ' says ' + what;
  11172. * });
  11173. *
  11174. * say(['fred', 'hello']);
  11175. * // => 'fred says hello'
  11176. *
  11177. * var numbers = Promise.all([
  11178. * Promise.resolve(40),
  11179. * Promise.resolve(36)
  11180. * ]);
  11181. *
  11182. * numbers.then(_.spread(function(x, y) {
  11183. * return x + y;
  11184. * }));
  11185. * // => a Promise of 76
  11186. */
  11187. function spread(func, start) {
  11188. if (typeof func != 'function') {
  11189. throw new TypeError(FUNC_ERROR_TEXT);
  11190. }
  11191. start = start == null ? 0 : nativeMax(toInteger(start), 0);
  11192. return baseRest(function(args) {
  11193. var array = args[start],
  11194. otherArgs = castSlice(args, 0, start);
  11195. if (array) {
  11196. arrayPush(otherArgs, array);
  11197. }
  11198. return apply(func, this, otherArgs);
  11199. });
  11200. }
  11201. /**
  11202. * Creates a throttled function that only invokes `func` at most once per
  11203. * every `wait` milliseconds. The throttled function comes with a `cancel`
  11204. * method to cancel delayed `func` invocations and a `flush` method to
  11205. * immediately invoke them. Provide `options` to indicate whether `func`
  11206. * should be invoked on the leading and/or trailing edge of the `wait`
  11207. * timeout. The `func` is invoked with the last arguments provided to the
  11208. * throttled function. Subsequent calls to the throttled function return the
  11209. * result of the last `func` invocation.
  11210. *
  11211. * **Note:** If `leading` and `trailing` options are `true`, `func` is
  11212. * invoked on the trailing edge of the timeout only if the throttled function
  11213. * is invoked more than once during the `wait` timeout.
  11214. *
  11215. * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred
  11216. * until to the next tick, similar to `setTimeout` with a timeout of `0`.
  11217. *
  11218. * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/)
  11219. * for details over the differences between `_.throttle` and `_.debounce`.
  11220. *
  11221. * @static
  11222. * @memberOf _
  11223. * @since 0.1.0
  11224. * @category Function
  11225. * @param {Function} func The function to throttle.
  11226. * @param {number} [wait=0] The number of milliseconds to throttle invocations to.
  11227. * @param {Object} [options={}] The options object.
  11228. * @param {boolean} [options.leading=true]
  11229. * Specify invoking on the leading edge of the timeout.
  11230. * @param {boolean} [options.trailing=true]
  11231. * Specify invoking on the trailing edge of the timeout.
  11232. * @returns {Function} Returns the new throttled function.
  11233. * @example
  11234. *
  11235. * // Avoid excessively updating the position while scrolling.
  11236. * jQuery(window).on('scroll', _.throttle(updatePosition, 100));
  11237. *
  11238. * // Invoke `renewToken` when the click event is fired, but not more than once every 5 minutes.
  11239. * var throttled = _.throttle(renewToken, 300000, { 'trailing': false });
  11240. * jQuery(element).on('click', throttled);
  11241. *
  11242. * // Cancel the trailing throttled invocation.
  11243. * jQuery(window).on('popstate', throttled.cancel);
  11244. */
  11245. function throttle(func, wait, options) {
  11246. var leading = true,
  11247. trailing = true;
  11248. if (typeof func != 'function') {
  11249. throw new TypeError(FUNC_ERROR_TEXT);
  11250. }
  11251. if (isObject(options)) {
  11252. leading = 'leading' in options ? !!options.leading : leading;
  11253. trailing = 'trailing' in options ? !!options.trailing : trailing;
  11254. }
  11255. return debounce(func, wait, {
  11256. 'leading': leading,
  11257. 'maxWait': wait,
  11258. 'trailing': trailing
  11259. });
  11260. }
  11261. /**
  11262. * Creates a function that accepts up to one argument, ignoring any
  11263. * additional arguments.
  11264. *
  11265. * @static
  11266. * @memberOf _
  11267. * @since 4.0.0
  11268. * @category Function
  11269. * @param {Function} func The function to cap arguments for.
  11270. * @returns {Function} Returns the new capped function.
  11271. * @example
  11272. *
  11273. * _.map(['6', '8', '10'], _.unary(parseInt));
  11274. * // => [6, 8, 10]
  11275. */
  11276. function unary(func) {
  11277. return ary(func, 1);
  11278. }
  11279. /**
  11280. * Creates a function that provides `value` to `wrapper` as its first
  11281. * argument. Any additional arguments provided to the function are appended
  11282. * to those provided to the `wrapper`. The wrapper is invoked with the `this`
  11283. * binding of the created function.
  11284. *
  11285. * @static
  11286. * @memberOf _
  11287. * @since 0.1.0
  11288. * @category Function
  11289. * @param {*} value The value to wrap.
  11290. * @param {Function} [wrapper=identity] The wrapper function.
  11291. * @returns {Function} Returns the new function.
  11292. * @example
  11293. *
  11294. * var p = _.wrap(_.escape, function(func, text) {
  11295. * return '<p>' + func(text) + '</p>';
  11296. * });
  11297. *
  11298. * p('fred, barney, & pebbles');
  11299. * // => '<p>fred, barney, &amp; pebbles</p>'
  11300. */
  11301. function wrap(value, wrapper) {
  11302. return partial(castFunction(wrapper), value);
  11303. }
  11304. /*------------------------------------------------------------------------*/
  11305. /**
  11306. * Casts `value` as an array if it's not one.
  11307. *
  11308. * @static
  11309. * @memberOf _
  11310. * @since 4.4.0
  11311. * @category Lang
  11312. * @param {*} value The value to inspect.
  11313. * @returns {Array} Returns the cast array.
  11314. * @example
  11315. *
  11316. * _.castArray(1);
  11317. * // => [1]
  11318. *
  11319. * _.castArray({ 'a': 1 });
  11320. * // => [{ 'a': 1 }]
  11321. *
  11322. * _.castArray('abc');
  11323. * // => ['abc']
  11324. *
  11325. * _.castArray(null);
  11326. * // => [null]
  11327. *
  11328. * _.castArray(undefined);
  11329. * // => [undefined]
  11330. *
  11331. * _.castArray();
  11332. * // => []
  11333. *
  11334. * var array = [1, 2, 3];
  11335. * console.log(_.castArray(array) === array);
  11336. * // => true
  11337. */
  11338. function castArray() {
  11339. if (!arguments.length) {
  11340. return [];
  11341. }
  11342. var value = arguments[0];
  11343. return isArray(value) ? value : [value];
  11344. }
  11345. /**
  11346. * Creates a shallow clone of `value`.
  11347. *
  11348. * **Note:** This method is loosely based on the
  11349. * [structured clone algorithm](https://mdn.io/Structured_clone_algorithm)
  11350. * and supports cloning arrays, array buffers, booleans, date objects, maps,
  11351. * numbers, `Object` objects, regexes, sets, strings, symbols, and typed
  11352. * arrays. The own enumerable properties of `arguments` objects are cloned
  11353. * as plain objects. An empty object is returned for uncloneable values such
  11354. * as error objects, functions, DOM nodes, and WeakMaps.
  11355. *
  11356. * @static
  11357. * @memberOf _
  11358. * @since 0.1.0
  11359. * @category Lang
  11360. * @param {*} value The value to clone.
  11361. * @returns {*} Returns the cloned value.
  11362. * @see _.cloneDeep
  11363. * @example
  11364. *
  11365. * var objects = [{ 'a': 1 }, { 'b': 2 }];
  11366. *
  11367. * var shallow = _.clone(objects);
  11368. * console.log(shallow[0] === objects[0]);
  11369. * // => true
  11370. */
  11371. function clone(value) {
  11372. return baseClone(value, CLONE_SYMBOLS_FLAG);
  11373. }
  11374. /**
  11375. * This method is like `_.clone` except that it accepts `customizer` which
  11376. * is invoked to produce the cloned value. If `customizer` returns `undefined`,
  11377. * cloning is handled by the method instead. The `customizer` is invoked with
  11378. * up to four arguments; (value [, index|key, object, stack]).
  11379. *
  11380. * @static
  11381. * @memberOf _
  11382. * @since 4.0.0
  11383. * @category Lang
  11384. * @param {*} value The value to clone.
  11385. * @param {Function} [customizer] The function to customize cloning.
  11386. * @returns {*} Returns the cloned value.
  11387. * @see _.cloneDeepWith
  11388. * @example
  11389. *
  11390. * function customizer(value) {
  11391. * if (_.isElement(value)) {
  11392. * return value.cloneNode(false);
  11393. * }
  11394. * }
  11395. *
  11396. * var el = _.cloneWith(document.body, customizer);
  11397. *
  11398. * console.log(el === document.body);
  11399. * // => false
  11400. * console.log(el.nodeName);
  11401. * // => 'BODY'
  11402. * console.log(el.childNodes.length);
  11403. * // => 0
  11404. */
  11405. function cloneWith(value, customizer) {
  11406. customizer = typeof customizer == 'function' ? customizer : undefined;
  11407. return baseClone(value, CLONE_SYMBOLS_FLAG, customizer);
  11408. }
  11409. /**
  11410. * This method is like `_.clone` except that it recursively clones `value`.
  11411. *
  11412. * @static
  11413. * @memberOf _
  11414. * @since 1.0.0
  11415. * @category Lang
  11416. * @param {*} value The value to recursively clone.
  11417. * @returns {*} Returns the deep cloned value.
  11418. * @see _.clone
  11419. * @example
  11420. *
  11421. * var objects = [{ 'a': 1 }, { 'b': 2 }];
  11422. *
  11423. * var deep = _.cloneDeep(objects);
  11424. * console.log(deep[0] === objects[0]);
  11425. * // => false
  11426. */
  11427. function cloneDeep(value) {
  11428. return baseClone(value, CLONE_DEEP_FLAG | CLONE_SYMBOLS_FLAG);
  11429. }
  11430. /**
  11431. * This method is like `_.cloneWith` except that it recursively clones `value`.
  11432. *
  11433. * @static
  11434. * @memberOf _
  11435. * @since 4.0.0
  11436. * @category Lang
  11437. * @param {*} value The value to recursively clone.
  11438. * @param {Function} [customizer] The function to customize cloning.
  11439. * @returns {*} Returns the deep cloned value.
  11440. * @see _.cloneWith
  11441. * @example
  11442. *
  11443. * function customizer(value) {
  11444. * if (_.isElement(value)) {
  11445. * return value.cloneNode(true);
  11446. * }
  11447. * }
  11448. *
  11449. * var el = _.cloneDeepWith(document.body, customizer);
  11450. *
  11451. * console.log(el === document.body);
  11452. * // => false
  11453. * console.log(el.nodeName);
  11454. * // => 'BODY'
  11455. * console.log(el.childNodes.length);
  11456. * // => 20
  11457. */
  11458. function cloneDeepWith(value, customizer) {
  11459. customizer = typeof customizer == 'function' ? customizer : undefined;
  11460. return baseClone(value, CLONE_DEEP_FLAG | CLONE_SYMBOLS_FLAG, customizer);
  11461. }
  11462. /**
  11463. * Checks if `object` conforms to `source` by invoking the predicate
  11464. * properties of `source` with the corresponding property values of `object`.
  11465. *
  11466. * **Note:** This method is equivalent to `_.conforms` when `source` is
  11467. * partially applied.
  11468. *
  11469. * @static
  11470. * @memberOf _
  11471. * @since 4.14.0
  11472. * @category Lang
  11473. * @param {Object} object The object to inspect.
  11474. * @param {Object} source The object of property predicates to conform to.
  11475. * @returns {boolean} Returns `true` if `object` conforms, else `false`.
  11476. * @example
  11477. *
  11478. * var object = { 'a': 1, 'b': 2 };
  11479. *
  11480. * _.conformsTo(object, { 'b': function(n) { return n > 1; } });
  11481. * // => true
  11482. *
  11483. * _.conformsTo(object, { 'b': function(n) { return n > 2; } });
  11484. * // => false
  11485. */
  11486. function conformsTo(object, source) {
  11487. return source == null || baseConformsTo(object, source, keys(source));
  11488. }
  11489. /**
  11490. * Performs a
  11491. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  11492. * comparison between two values to determine if they are equivalent.
  11493. *
  11494. * @static
  11495. * @memberOf _
  11496. * @since 4.0.0
  11497. * @category Lang
  11498. * @param {*} value The value to compare.
  11499. * @param {*} other The other value to compare.
  11500. * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
  11501. * @example
  11502. *
  11503. * var object = { 'a': 1 };
  11504. * var other = { 'a': 1 };
  11505. *
  11506. * _.eq(object, object);
  11507. * // => true
  11508. *
  11509. * _.eq(object, other);
  11510. * // => false
  11511. *
  11512. * _.eq('a', 'a');
  11513. * // => true
  11514. *
  11515. * _.eq('a', Object('a'));
  11516. * // => false
  11517. *
  11518. * _.eq(NaN, NaN);
  11519. * // => true
  11520. */
  11521. function eq(value, other) {
  11522. return value === other || (value !== value && other !== other);
  11523. }
  11524. /**
  11525. * Checks if `value` is greater than `other`.
  11526. *
  11527. * @static
  11528. * @memberOf _
  11529. * @since 3.9.0
  11530. * @category Lang
  11531. * @param {*} value The value to compare.
  11532. * @param {*} other The other value to compare.
  11533. * @returns {boolean} Returns `true` if `value` is greater than `other`,
  11534. * else `false`.
  11535. * @see _.lt
  11536. * @example
  11537. *
  11538. * _.gt(3, 1);
  11539. * // => true
  11540. *
  11541. * _.gt(3, 3);
  11542. * // => false
  11543. *
  11544. * _.gt(1, 3);
  11545. * // => false
  11546. */
  11547. var gt = createRelationalOperation(baseGt);
  11548. /**
  11549. * Checks if `value` is greater than or equal to `other`.
  11550. *
  11551. * @static
  11552. * @memberOf _
  11553. * @since 3.9.0
  11554. * @category Lang
  11555. * @param {*} value The value to compare.
  11556. * @param {*} other The other value to compare.
  11557. * @returns {boolean} Returns `true` if `value` is greater than or equal to
  11558. * `other`, else `false`.
  11559. * @see _.lte
  11560. * @example
  11561. *
  11562. * _.gte(3, 1);
  11563. * // => true
  11564. *
  11565. * _.gte(3, 3);
  11566. * // => true
  11567. *
  11568. * _.gte(1, 3);
  11569. * // => false
  11570. */
  11571. var gte = createRelationalOperation(function(value, other) {
  11572. return value >= other;
  11573. });
  11574. /**
  11575. * Checks if `value` is likely an `arguments` object.
  11576. *
  11577. * @static
  11578. * @memberOf _
  11579. * @since 0.1.0
  11580. * @category Lang
  11581. * @param {*} value The value to check.
  11582. * @returns {boolean} Returns `true` if `value` is an `arguments` object,
  11583. * else `false`.
  11584. * @example
  11585. *
  11586. * _.isArguments(function() { return arguments; }());
  11587. * // => true
  11588. *
  11589. * _.isArguments([1, 2, 3]);
  11590. * // => false
  11591. */
  11592. var isArguments = baseIsArguments(function() { return arguments; }()) ? baseIsArguments : function(value) {
  11593. return isObjectLike(value) && hasOwnProperty.call(value, 'callee') &&
  11594. !propertyIsEnumerable.call(value, 'callee');
  11595. };
  11596. /**
  11597. * Checks if `value` is classified as an `Array` object.
  11598. *
  11599. * @static
  11600. * @memberOf _
  11601. * @since 0.1.0
  11602. * @category Lang
  11603. * @param {*} value The value to check.
  11604. * @returns {boolean} Returns `true` if `value` is an array, else `false`.
  11605. * @example
  11606. *
  11607. * _.isArray([1, 2, 3]);
  11608. * // => true
  11609. *
  11610. * _.isArray(document.body.children);
  11611. * // => false
  11612. *
  11613. * _.isArray('abc');
  11614. * // => false
  11615. *
  11616. * _.isArray(_.noop);
  11617. * // => false
  11618. */
  11619. var isArray = Array.isArray;
  11620. /**
  11621. * Checks if `value` is classified as an `ArrayBuffer` object.
  11622. *
  11623. * @static
  11624. * @memberOf _
  11625. * @since 4.3.0
  11626. * @category Lang
  11627. * @param {*} value The value to check.
  11628. * @returns {boolean} Returns `true` if `value` is an array buffer, else `false`.
  11629. * @example
  11630. *
  11631. * _.isArrayBuffer(new ArrayBuffer(2));
  11632. * // => true
  11633. *
  11634. * _.isArrayBuffer(new Array(2));
  11635. * // => false
  11636. */
  11637. var isArrayBuffer = nodeIsArrayBuffer ? baseUnary(nodeIsArrayBuffer) : baseIsArrayBuffer;
  11638. /**
  11639. * Checks if `value` is array-like. A value is considered array-like if it's
  11640. * not a function and has a `value.length` that's an integer greater than or
  11641. * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`.
  11642. *
  11643. * @static
  11644. * @memberOf _
  11645. * @since 4.0.0
  11646. * @category Lang
  11647. * @param {*} value The value to check.
  11648. * @returns {boolean} Returns `true` if `value` is array-like, else `false`.
  11649. * @example
  11650. *
  11651. * _.isArrayLike([1, 2, 3]);
  11652. * // => true
  11653. *
  11654. * _.isArrayLike(document.body.children);
  11655. * // => true
  11656. *
  11657. * _.isArrayLike('abc');
  11658. * // => true
  11659. *
  11660. * _.isArrayLike(_.noop);
  11661. * // => false
  11662. */
  11663. function isArrayLike(value) {
  11664. return value != null && isLength(value.length) && !isFunction(value);
  11665. }
  11666. /**
  11667. * This method is like `_.isArrayLike` except that it also checks if `value`
  11668. * is an object.
  11669. *
  11670. * @static
  11671. * @memberOf _
  11672. * @since 4.0.0
  11673. * @category Lang
  11674. * @param {*} value The value to check.
  11675. * @returns {boolean} Returns `true` if `value` is an array-like object,
  11676. * else `false`.
  11677. * @example
  11678. *
  11679. * _.isArrayLikeObject([1, 2, 3]);
  11680. * // => true
  11681. *
  11682. * _.isArrayLikeObject(document.body.children);
  11683. * // => true
  11684. *
  11685. * _.isArrayLikeObject('abc');
  11686. * // => false
  11687. *
  11688. * _.isArrayLikeObject(_.noop);
  11689. * // => false
  11690. */
  11691. function isArrayLikeObject(value) {
  11692. return isObjectLike(value) && isArrayLike(value);
  11693. }
  11694. /**
  11695. * Checks if `value` is classified as a boolean primitive or object.
  11696. *
  11697. * @static
  11698. * @memberOf _
  11699. * @since 0.1.0
  11700. * @category Lang
  11701. * @param {*} value The value to check.
  11702. * @returns {boolean} Returns `true` if `value` is a boolean, else `false`.
  11703. * @example
  11704. *
  11705. * _.isBoolean(false);
  11706. * // => true
  11707. *
  11708. * _.isBoolean(null);
  11709. * // => false
  11710. */
  11711. function isBoolean(value) {
  11712. return value === true || value === false ||
  11713. (isObjectLike(value) && baseGetTag(value) == boolTag);
  11714. }
  11715. /**
  11716. * Checks if `value` is a buffer.
  11717. *
  11718. * @static
  11719. * @memberOf _
  11720. * @since 4.3.0
  11721. * @category Lang
  11722. * @param {*} value The value to check.
  11723. * @returns {boolean} Returns `true` if `value` is a buffer, else `false`.
  11724. * @example
  11725. *
  11726. * _.isBuffer(new Buffer(2));
  11727. * // => true
  11728. *
  11729. * _.isBuffer(new Uint8Array(2));
  11730. * // => false
  11731. */
  11732. var isBuffer = nativeIsBuffer || stubFalse;
  11733. /**
  11734. * Checks if `value` is classified as a `Date` object.
  11735. *
  11736. * @static
  11737. * @memberOf _
  11738. * @since 0.1.0
  11739. * @category Lang
  11740. * @param {*} value The value to check.
  11741. * @returns {boolean} Returns `true` if `value` is a date object, else `false`.
  11742. * @example
  11743. *
  11744. * _.isDate(new Date);
  11745. * // => true
  11746. *
  11747. * _.isDate('Mon April 23 2012');
  11748. * // => false
  11749. */
  11750. var isDate = nodeIsDate ? baseUnary(nodeIsDate) : baseIsDate;
  11751. /**
  11752. * Checks if `value` is likely a DOM element.
  11753. *
  11754. * @static
  11755. * @memberOf _
  11756. * @since 0.1.0
  11757. * @category Lang
  11758. * @param {*} value The value to check.
  11759. * @returns {boolean} Returns `true` if `value` is a DOM element, else `false`.
  11760. * @example
  11761. *
  11762. * _.isElement(document.body);
  11763. * // => true
  11764. *
  11765. * _.isElement('<body>');
  11766. * // => false
  11767. */
  11768. function isElement(value) {
  11769. return isObjectLike(value) && value.nodeType === 1 && !isPlainObject(value);
  11770. }
  11771. /**
  11772. * Checks if `value` is an empty object, collection, map, or set.
  11773. *
  11774. * Objects are considered empty if they have no own enumerable string keyed
  11775. * properties.
  11776. *
  11777. * Array-like values such as `arguments` objects, arrays, buffers, strings, or
  11778. * jQuery-like collections are considered empty if they have a `length` of `0`.
  11779. * Similarly, maps and sets are considered empty if they have a `size` of `0`.
  11780. *
  11781. * @static
  11782. * @memberOf _
  11783. * @since 0.1.0
  11784. * @category Lang
  11785. * @param {*} value The value to check.
  11786. * @returns {boolean} Returns `true` if `value` is empty, else `false`.
  11787. * @example
  11788. *
  11789. * _.isEmpty(null);
  11790. * // => true
  11791. *
  11792. * _.isEmpty(true);
  11793. * // => true
  11794. *
  11795. * _.isEmpty(1);
  11796. * // => true
  11797. *
  11798. * _.isEmpty([1, 2, 3]);
  11799. * // => false
  11800. *
  11801. * _.isEmpty({ 'a': 1 });
  11802. * // => false
  11803. */
  11804. function isEmpty(value) {
  11805. if (value == null) {
  11806. return true;
  11807. }
  11808. if (isArrayLike(value) &&
  11809. (isArray(value) || typeof value == 'string' || typeof value.splice == 'function' ||
  11810. isBuffer(value) || isTypedArray(value) || isArguments(value))) {
  11811. return !value.length;
  11812. }
  11813. var tag = getTag(value);
  11814. if (tag == mapTag || tag == setTag) {
  11815. return !value.size;
  11816. }
  11817. if (isPrototype(value)) {
  11818. return !baseKeys(value).length;
  11819. }
  11820. for (var key in value) {
  11821. if (hasOwnProperty.call(value, key)) {
  11822. return false;
  11823. }
  11824. }
  11825. return true;
  11826. }
  11827. /**
  11828. * Performs a deep comparison between two values to determine if they are
  11829. * equivalent.
  11830. *
  11831. * **Note:** This method supports comparing arrays, array buffers, booleans,
  11832. * date objects, error objects, maps, numbers, `Object` objects, regexes,
  11833. * sets, strings, symbols, and typed arrays. `Object` objects are compared
  11834. * by their own, not inherited, enumerable properties. Functions and DOM
  11835. * nodes are compared by strict equality, i.e. `===`.
  11836. *
  11837. * @static
  11838. * @memberOf _
  11839. * @since 0.1.0
  11840. * @category Lang
  11841. * @param {*} value The value to compare.
  11842. * @param {*} other The other value to compare.
  11843. * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
  11844. * @example
  11845. *
  11846. * var object = { 'a': 1 };
  11847. * var other = { 'a': 1 };
  11848. *
  11849. * _.isEqual(object, other);
  11850. * // => true
  11851. *
  11852. * object === other;
  11853. * // => false
  11854. */
  11855. function isEqual(value, other) {
  11856. return baseIsEqual(value, other);
  11857. }
  11858. /**
  11859. * This method is like `_.isEqual` except that it accepts `customizer` which
  11860. * is invoked to compare values. If `customizer` returns `undefined`, comparisons
  11861. * are handled by the method instead. The `customizer` is invoked with up to
  11862. * six arguments: (objValue, othValue [, index|key, object, other, stack]).
  11863. *
  11864. * @static
  11865. * @memberOf _
  11866. * @since 4.0.0
  11867. * @category Lang
  11868. * @param {*} value The value to compare.
  11869. * @param {*} other The other value to compare.
  11870. * @param {Function} [customizer] The function to customize comparisons.
  11871. * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
  11872. * @example
  11873. *
  11874. * function isGreeting(value) {
  11875. * return /^h(?:i|ello)$/.test(value);
  11876. * }
  11877. *
  11878. * function customizer(objValue, othValue) {
  11879. * if (isGreeting(objValue) && isGreeting(othValue)) {
  11880. * return true;
  11881. * }
  11882. * }
  11883. *
  11884. * var array = ['hello', 'goodbye'];
  11885. * var other = ['hi', 'goodbye'];
  11886. *
  11887. * _.isEqualWith(array, other, customizer);
  11888. * // => true
  11889. */
  11890. function isEqualWith(value, other, customizer) {
  11891. customizer = typeof customizer == 'function' ? customizer : undefined;
  11892. var result = customizer ? customizer(value, other) : undefined;
  11893. return result === undefined ? baseIsEqual(value, other, undefined, customizer) : !!result;
  11894. }
  11895. /**
  11896. * Checks if `value` is an `Error`, `EvalError`, `RangeError`, `ReferenceError`,
  11897. * `SyntaxError`, `TypeError`, or `URIError` object.
  11898. *
  11899. * @static
  11900. * @memberOf _
  11901. * @since 3.0.0
  11902. * @category Lang
  11903. * @param {*} value The value to check.
  11904. * @returns {boolean} Returns `true` if `value` is an error object, else `false`.
  11905. * @example
  11906. *
  11907. * _.isError(new Error);
  11908. * // => true
  11909. *
  11910. * _.isError(Error);
  11911. * // => false
  11912. */
  11913. function isError(value) {
  11914. if (!isObjectLike(value)) {
  11915. return false;
  11916. }
  11917. var tag = baseGetTag(value);
  11918. return tag == errorTag || tag == domExcTag ||
  11919. (typeof value.message == 'string' && typeof value.name == 'string' && !isPlainObject(value));
  11920. }
  11921. /**
  11922. * Checks if `value` is a finite primitive number.
  11923. *
  11924. * **Note:** This method is based on
  11925. * [`Number.isFinite`](https://mdn.io/Number/isFinite).
  11926. *
  11927. * @static
  11928. * @memberOf _
  11929. * @since 0.1.0
  11930. * @category Lang
  11931. * @param {*} value The value to check.
  11932. * @returns {boolean} Returns `true` if `value` is a finite number, else `false`.
  11933. * @example
  11934. *
  11935. * _.isFinite(3);
  11936. * // => true
  11937. *
  11938. * _.isFinite(Number.MIN_VALUE);
  11939. * // => true
  11940. *
  11941. * _.isFinite(Infinity);
  11942. * // => false
  11943. *
  11944. * _.isFinite('3');
  11945. * // => false
  11946. */
  11947. function isFinite(value) {
  11948. return typeof value == 'number' && nativeIsFinite(value);
  11949. }
  11950. /**
  11951. * Checks if `value` is classified as a `Function` object.
  11952. *
  11953. * @static
  11954. * @memberOf _
  11955. * @since 0.1.0
  11956. * @category Lang
  11957. * @param {*} value The value to check.
  11958. * @returns {boolean} Returns `true` if `value` is a function, else `false`.
  11959. * @example
  11960. *
  11961. * _.isFunction(_);
  11962. * // => true
  11963. *
  11964. * _.isFunction(/abc/);
  11965. * // => false
  11966. */
  11967. function isFunction(value) {
  11968. if (!isObject(value)) {
  11969. return false;
  11970. }
  11971. // The use of `Object#toString` avoids issues with the `typeof` operator
  11972. // in Safari 9 which returns 'object' for typed arrays and other constructors.
  11973. var tag = baseGetTag(value);
  11974. return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag;
  11975. }
  11976. /**
  11977. * Checks if `value` is an integer.
  11978. *
  11979. * **Note:** This method is based on
  11980. * [`Number.isInteger`](https://mdn.io/Number/isInteger).
  11981. *
  11982. * @static
  11983. * @memberOf _
  11984. * @since 4.0.0
  11985. * @category Lang
  11986. * @param {*} value The value to check.
  11987. * @returns {boolean} Returns `true` if `value` is an integer, else `false`.
  11988. * @example
  11989. *
  11990. * _.isInteger(3);
  11991. * // => true
  11992. *
  11993. * _.isInteger(Number.MIN_VALUE);
  11994. * // => false
  11995. *
  11996. * _.isInteger(Infinity);
  11997. * // => false
  11998. *
  11999. * _.isInteger('3');
  12000. * // => false
  12001. */
  12002. function isInteger(value) {
  12003. return typeof value == 'number' && value == toInteger(value);
  12004. }
  12005. /**
  12006. * Checks if `value` is a valid array-like length.
  12007. *
  12008. * **Note:** This method is loosely based on
  12009. * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).
  12010. *
  12011. * @static
  12012. * @memberOf _
  12013. * @since 4.0.0
  12014. * @category Lang
  12015. * @param {*} value The value to check.
  12016. * @returns {boolean} Returns `true` if `value` is a valid length, else `false`.
  12017. * @example
  12018. *
  12019. * _.isLength(3);
  12020. * // => true
  12021. *
  12022. * _.isLength(Number.MIN_VALUE);
  12023. * // => false
  12024. *
  12025. * _.isLength(Infinity);
  12026. * // => false
  12027. *
  12028. * _.isLength('3');
  12029. * // => false
  12030. */
  12031. function isLength(value) {
  12032. return typeof value == 'number' &&
  12033. value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;
  12034. }
  12035. /**
  12036. * Checks if `value` is the
  12037. * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)
  12038. * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
  12039. *
  12040. * @static
  12041. * @memberOf _
  12042. * @since 0.1.0
  12043. * @category Lang
  12044. * @param {*} value The value to check.
  12045. * @returns {boolean} Returns `true` if `value` is an object, else `false`.
  12046. * @example
  12047. *
  12048. * _.isObject({});
  12049. * // => true
  12050. *
  12051. * _.isObject([1, 2, 3]);
  12052. * // => true
  12053. *
  12054. * _.isObject(_.noop);
  12055. * // => true
  12056. *
  12057. * _.isObject(null);
  12058. * // => false
  12059. */
  12060. function isObject(value) {
  12061. var type = typeof value;
  12062. return value != null && (type == 'object' || type == 'function');
  12063. }
  12064. /**
  12065. * Checks if `value` is object-like. A value is object-like if it's not `null`
  12066. * and has a `typeof` result of "object".
  12067. *
  12068. * @static
  12069. * @memberOf _
  12070. * @since 4.0.0
  12071. * @category Lang
  12072. * @param {*} value The value to check.
  12073. * @returns {boolean} Returns `true` if `value` is object-like, else `false`.
  12074. * @example
  12075. *
  12076. * _.isObjectLike({});
  12077. * // => true
  12078. *
  12079. * _.isObjectLike([1, 2, 3]);
  12080. * // => true
  12081. *
  12082. * _.isObjectLike(_.noop);
  12083. * // => false
  12084. *
  12085. * _.isObjectLike(null);
  12086. * // => false
  12087. */
  12088. function isObjectLike(value) {
  12089. return value != null && typeof value == 'object';
  12090. }
  12091. /**
  12092. * Checks if `value` is classified as a `Map` object.
  12093. *
  12094. * @static
  12095. * @memberOf _
  12096. * @since 4.3.0
  12097. * @category Lang
  12098. * @param {*} value The value to check.
  12099. * @returns {boolean} Returns `true` if `value` is a map, else `false`.
  12100. * @example
  12101. *
  12102. * _.isMap(new Map);
  12103. * // => true
  12104. *
  12105. * _.isMap(new WeakMap);
  12106. * // => false
  12107. */
  12108. var isMap = nodeIsMap ? baseUnary(nodeIsMap) : baseIsMap;
  12109. /**
  12110. * Performs a partial deep comparison between `object` and `source` to
  12111. * determine if `object` contains equivalent property values.
  12112. *
  12113. * **Note:** This method is equivalent to `_.matches` when `source` is
  12114. * partially applied.
  12115. *
  12116. * Partial comparisons will match empty array and empty object `source`
  12117. * values against any array or object value, respectively. See `_.isEqual`
  12118. * for a list of supported value comparisons.
  12119. *
  12120. * @static
  12121. * @memberOf _
  12122. * @since 3.0.0
  12123. * @category Lang
  12124. * @param {Object} object The object to inspect.
  12125. * @param {Object} source The object of property values to match.
  12126. * @returns {boolean} Returns `true` if `object` is a match, else `false`.
  12127. * @example
  12128. *
  12129. * var object = { 'a': 1, 'b': 2 };
  12130. *
  12131. * _.isMatch(object, { 'b': 2 });
  12132. * // => true
  12133. *
  12134. * _.isMatch(object, { 'b': 1 });
  12135. * // => false
  12136. */
  12137. function isMatch(object, source) {
  12138. return object === source || baseIsMatch(object, source, getMatchData(source));
  12139. }
  12140. /**
  12141. * This method is like `_.isMatch` except that it accepts `customizer` which
  12142. * is invoked to compare values. If `customizer` returns `undefined`, comparisons
  12143. * are handled by the method instead. The `customizer` is invoked with five
  12144. * arguments: (objValue, srcValue, index|key, object, source).
  12145. *
  12146. * @static
  12147. * @memberOf _
  12148. * @since 4.0.0
  12149. * @category Lang
  12150. * @param {Object} object The object to inspect.
  12151. * @param {Object} source The object of property values to match.
  12152. * @param {Function} [customizer] The function to customize comparisons.
  12153. * @returns {boolean} Returns `true` if `object` is a match, else `false`.
  12154. * @example
  12155. *
  12156. * function isGreeting(value) {
  12157. * return /^h(?:i|ello)$/.test(value);
  12158. * }
  12159. *
  12160. * function customizer(objValue, srcValue) {
  12161. * if (isGreeting(objValue) && isGreeting(srcValue)) {
  12162. * return true;
  12163. * }
  12164. * }
  12165. *
  12166. * var object = { 'greeting': 'hello' };
  12167. * var source = { 'greeting': 'hi' };
  12168. *
  12169. * _.isMatchWith(object, source, customizer);
  12170. * // => true
  12171. */
  12172. function isMatchWith(object, source, customizer) {
  12173. customizer = typeof customizer == 'function' ? customizer : undefined;
  12174. return baseIsMatch(object, source, getMatchData(source), customizer);
  12175. }
  12176. /**
  12177. * Checks if `value` is `NaN`.
  12178. *
  12179. * **Note:** This method is based on
  12180. * [`Number.isNaN`](https://mdn.io/Number/isNaN) and is not the same as
  12181. * global [`isNaN`](https://mdn.io/isNaN) which returns `true` for
  12182. * `undefined` and other non-number values.
  12183. *
  12184. * @static
  12185. * @memberOf _
  12186. * @since 0.1.0
  12187. * @category Lang
  12188. * @param {*} value The value to check.
  12189. * @returns {boolean} Returns `true` if `value` is `NaN`, else `false`.
  12190. * @example
  12191. *
  12192. * _.isNaN(NaN);
  12193. * // => true
  12194. *
  12195. * _.isNaN(new Number(NaN));
  12196. * // => true
  12197. *
  12198. * isNaN(undefined);
  12199. * // => true
  12200. *
  12201. * _.isNaN(undefined);
  12202. * // => false
  12203. */
  12204. function isNaN(value) {
  12205. // An `NaN` primitive is the only value that is not equal to itself.
  12206. // Perform the `toStringTag` check first to avoid errors with some
  12207. // ActiveX objects in IE.
  12208. return isNumber(value) && value != +value;
  12209. }
  12210. /**
  12211. * Checks if `value` is a pristine native function.
  12212. *
  12213. * **Note:** This method can't reliably detect native functions in the presence
  12214. * of the core-js package because core-js circumvents this kind of detection.
  12215. * Despite multiple requests, the core-js maintainer has made it clear: any
  12216. * attempt to fix the detection will be obstructed. As a result, we're left
  12217. * with little choice but to throw an error. Unfortunately, this also affects
  12218. * packages, like [babel-polyfill](https://www.npmjs.com/package/babel-polyfill),
  12219. * which rely on core-js.
  12220. *
  12221. * @static
  12222. * @memberOf _
  12223. * @since 3.0.0
  12224. * @category Lang
  12225. * @param {*} value The value to check.
  12226. * @returns {boolean} Returns `true` if `value` is a native function,
  12227. * else `false`.
  12228. * @example
  12229. *
  12230. * _.isNative(Array.prototype.push);
  12231. * // => true
  12232. *
  12233. * _.isNative(_);
  12234. * // => false
  12235. */
  12236. function isNative(value) {
  12237. if (isMaskable(value)) {
  12238. throw new Error(CORE_ERROR_TEXT);
  12239. }
  12240. return baseIsNative(value);
  12241. }
  12242. /**
  12243. * Checks if `value` is `null`.
  12244. *
  12245. * @static
  12246. * @memberOf _
  12247. * @since 0.1.0
  12248. * @category Lang
  12249. * @param {*} value The value to check.
  12250. * @returns {boolean} Returns `true` if `value` is `null`, else `false`.
  12251. * @example
  12252. *
  12253. * _.isNull(null);
  12254. * // => true
  12255. *
  12256. * _.isNull(void 0);
  12257. * // => false
  12258. */
  12259. function isNull(value) {
  12260. return value === null;
  12261. }
  12262. /**
  12263. * Checks if `value` is `null` or `undefined`.
  12264. *
  12265. * @static
  12266. * @memberOf _
  12267. * @since 4.0.0
  12268. * @category Lang
  12269. * @param {*} value The value to check.
  12270. * @returns {boolean} Returns `true` if `value` is nullish, else `false`.
  12271. * @example
  12272. *
  12273. * _.isNil(null);
  12274. * // => true
  12275. *
  12276. * _.isNil(void 0);
  12277. * // => true
  12278. *
  12279. * _.isNil(NaN);
  12280. * // => false
  12281. */
  12282. function isNil(value) {
  12283. return value == null;
  12284. }
  12285. /**
  12286. * Checks if `value` is classified as a `Number` primitive or object.
  12287. *
  12288. * **Note:** To exclude `Infinity`, `-Infinity`, and `NaN`, which are
  12289. * classified as numbers, use the `_.isFinite` method.
  12290. *
  12291. * @static
  12292. * @memberOf _
  12293. * @since 0.1.0
  12294. * @category Lang
  12295. * @param {*} value The value to check.
  12296. * @returns {boolean} Returns `true` if `value` is a number, else `false`.
  12297. * @example
  12298. *
  12299. * _.isNumber(3);
  12300. * // => true
  12301. *
  12302. * _.isNumber(Number.MIN_VALUE);
  12303. * // => true
  12304. *
  12305. * _.isNumber(Infinity);
  12306. * // => true
  12307. *
  12308. * _.isNumber('3');
  12309. * // => false
  12310. */
  12311. function isNumber(value) {
  12312. return typeof value == 'number' ||
  12313. (isObjectLike(value) && baseGetTag(value) == numberTag);
  12314. }
  12315. /**
  12316. * Checks if `value` is a plain object, that is, an object created by the
  12317. * `Object` constructor or one with a `[[Prototype]]` of `null`.
  12318. *
  12319. * @static
  12320. * @memberOf _
  12321. * @since 0.8.0
  12322. * @category Lang
  12323. * @param {*} value The value to check.
  12324. * @returns {boolean} Returns `true` if `value` is a plain object, else `false`.
  12325. * @example
  12326. *
  12327. * function Foo() {
  12328. * this.a = 1;
  12329. * }
  12330. *
  12331. * _.isPlainObject(new Foo);
  12332. * // => false
  12333. *
  12334. * _.isPlainObject([1, 2, 3]);
  12335. * // => false
  12336. *
  12337. * _.isPlainObject({ 'x': 0, 'y': 0 });
  12338. * // => true
  12339. *
  12340. * _.isPlainObject(Object.create(null));
  12341. * // => true
  12342. */
  12343. function isPlainObject(value) {
  12344. if (!isObjectLike(value) || baseGetTag(value) != objectTag) {
  12345. return false;
  12346. }
  12347. var proto = getPrototype(value);
  12348. if (proto === null) {
  12349. return true;
  12350. }
  12351. var Ctor = hasOwnProperty.call(proto, 'constructor') && proto.constructor;
  12352. return typeof Ctor == 'function' && Ctor instanceof Ctor &&
  12353. funcToString.call(Ctor) == objectCtorString;
  12354. }
  12355. /**
  12356. * Checks if `value` is classified as a `RegExp` object.
  12357. *
  12358. * @static
  12359. * @memberOf _
  12360. * @since 0.1.0
  12361. * @category Lang
  12362. * @param {*} value The value to check.
  12363. * @returns {boolean} Returns `true` if `value` is a regexp, else `false`.
  12364. * @example
  12365. *
  12366. * _.isRegExp(/abc/);
  12367. * // => true
  12368. *
  12369. * _.isRegExp('/abc/');
  12370. * // => false
  12371. */
  12372. var isRegExp = nodeIsRegExp ? baseUnary(nodeIsRegExp) : baseIsRegExp;
  12373. /**
  12374. * Checks if `value` is a safe integer. An integer is safe if it's an IEEE-754
  12375. * double precision number which isn't the result of a rounded unsafe integer.
  12376. *
  12377. * **Note:** This method is based on
  12378. * [`Number.isSafeInteger`](https://mdn.io/Number/isSafeInteger).
  12379. *
  12380. * @static
  12381. * @memberOf _
  12382. * @since 4.0.0
  12383. * @category Lang
  12384. * @param {*} value The value to check.
  12385. * @returns {boolean} Returns `true` if `value` is a safe integer, else `false`.
  12386. * @example
  12387. *
  12388. * _.isSafeInteger(3);
  12389. * // => true
  12390. *
  12391. * _.isSafeInteger(Number.MIN_VALUE);
  12392. * // => false
  12393. *
  12394. * _.isSafeInteger(Infinity);
  12395. * // => false
  12396. *
  12397. * _.isSafeInteger('3');
  12398. * // => false
  12399. */
  12400. function isSafeInteger(value) {
  12401. return isInteger(value) && value >= -MAX_SAFE_INTEGER && value <= MAX_SAFE_INTEGER;
  12402. }
  12403. /**
  12404. * Checks if `value` is classified as a `Set` object.
  12405. *
  12406. * @static
  12407. * @memberOf _
  12408. * @since 4.3.0
  12409. * @category Lang
  12410. * @param {*} value The value to check.
  12411. * @returns {boolean} Returns `true` if `value` is a set, else `false`.
  12412. * @example
  12413. *
  12414. * _.isSet(new Set);
  12415. * // => true
  12416. *
  12417. * _.isSet(new WeakSet);
  12418. * // => false
  12419. */
  12420. var isSet = nodeIsSet ? baseUnary(nodeIsSet) : baseIsSet;
  12421. /**
  12422. * Checks if `value` is classified as a `String` primitive or object.
  12423. *
  12424. * @static
  12425. * @since 0.1.0
  12426. * @memberOf _
  12427. * @category Lang
  12428. * @param {*} value The value to check.
  12429. * @returns {boolean} Returns `true` if `value` is a string, else `false`.
  12430. * @example
  12431. *
  12432. * _.isString('abc');
  12433. * // => true
  12434. *
  12435. * _.isString(1);
  12436. * // => false
  12437. */
  12438. function isString(value) {
  12439. return typeof value == 'string' ||
  12440. (!isArray(value) && isObjectLike(value) && baseGetTag(value) == stringTag);
  12441. }
  12442. /**
  12443. * Checks if `value` is classified as a `Symbol` primitive or object.
  12444. *
  12445. * @static
  12446. * @memberOf _
  12447. * @since 4.0.0
  12448. * @category Lang
  12449. * @param {*} value The value to check.
  12450. * @returns {boolean} Returns `true` if `value` is a symbol, else `false`.
  12451. * @example
  12452. *
  12453. * _.isSymbol(Symbol.iterator);
  12454. * // => true
  12455. *
  12456. * _.isSymbol('abc');
  12457. * // => false
  12458. */
  12459. function isSymbol(value) {
  12460. return typeof value == 'symbol' ||
  12461. (isObjectLike(value) && baseGetTag(value) == symbolTag);
  12462. }
  12463. /**
  12464. * Checks if `value` is classified as a typed array.
  12465. *
  12466. * @static
  12467. * @memberOf _
  12468. * @since 3.0.0
  12469. * @category Lang
  12470. * @param {*} value The value to check.
  12471. * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.
  12472. * @example
  12473. *
  12474. * _.isTypedArray(new Uint8Array);
  12475. * // => true
  12476. *
  12477. * _.isTypedArray([]);
  12478. * // => false
  12479. */
  12480. var isTypedArray = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray;
  12481. /**
  12482. * Checks if `value` is `undefined`.
  12483. *
  12484. * @static
  12485. * @since 0.1.0
  12486. * @memberOf _
  12487. * @category Lang
  12488. * @param {*} value The value to check.
  12489. * @returns {boolean} Returns `true` if `value` is `undefined`, else `false`.
  12490. * @example
  12491. *
  12492. * _.isUndefined(void 0);
  12493. * // => true
  12494. *
  12495. * _.isUndefined(null);
  12496. * // => false
  12497. */
  12498. function isUndefined(value) {
  12499. return value === undefined;
  12500. }
  12501. /**
  12502. * Checks if `value` is classified as a `WeakMap` object.
  12503. *
  12504. * @static
  12505. * @memberOf _
  12506. * @since 4.3.0
  12507. * @category Lang
  12508. * @param {*} value The value to check.
  12509. * @returns {boolean} Returns `true` if `value` is a weak map, else `false`.
  12510. * @example
  12511. *
  12512. * _.isWeakMap(new WeakMap);
  12513. * // => true
  12514. *
  12515. * _.isWeakMap(new Map);
  12516. * // => false
  12517. */
  12518. function isWeakMap(value) {
  12519. return isObjectLike(value) && getTag(value) == weakMapTag;
  12520. }
  12521. /**
  12522. * Checks if `value` is classified as a `WeakSet` object.
  12523. *
  12524. * @static
  12525. * @memberOf _
  12526. * @since 4.3.0
  12527. * @category Lang
  12528. * @param {*} value The value to check.
  12529. * @returns {boolean} Returns `true` if `value` is a weak set, else `false`.
  12530. * @example
  12531. *
  12532. * _.isWeakSet(new WeakSet);
  12533. * // => true
  12534. *
  12535. * _.isWeakSet(new Set);
  12536. * // => false
  12537. */
  12538. function isWeakSet(value) {
  12539. return isObjectLike(value) && baseGetTag(value) == weakSetTag;
  12540. }
  12541. /**
  12542. * Checks if `value` is less than `other`.
  12543. *
  12544. * @static
  12545. * @memberOf _
  12546. * @since 3.9.0
  12547. * @category Lang
  12548. * @param {*} value The value to compare.
  12549. * @param {*} other The other value to compare.
  12550. * @returns {boolean} Returns `true` if `value` is less than `other`,
  12551. * else `false`.
  12552. * @see _.gt
  12553. * @example
  12554. *
  12555. * _.lt(1, 3);
  12556. * // => true
  12557. *
  12558. * _.lt(3, 3);
  12559. * // => false
  12560. *
  12561. * _.lt(3, 1);
  12562. * // => false
  12563. */
  12564. var lt = createRelationalOperation(baseLt);
  12565. /**
  12566. * Checks if `value` is less than or equal to `other`.
  12567. *
  12568. * @static
  12569. * @memberOf _
  12570. * @since 3.9.0
  12571. * @category Lang
  12572. * @param {*} value The value to compare.
  12573. * @param {*} other The other value to compare.
  12574. * @returns {boolean} Returns `true` if `value` is less than or equal to
  12575. * `other`, else `false`.
  12576. * @see _.gte
  12577. * @example
  12578. *
  12579. * _.lte(1, 3);
  12580. * // => true
  12581. *
  12582. * _.lte(3, 3);
  12583. * // => true
  12584. *
  12585. * _.lte(3, 1);
  12586. * // => false
  12587. */
  12588. var lte = createRelationalOperation(function(value, other) {
  12589. return value <= other;
  12590. });
  12591. /**
  12592. * Converts `value` to an array.
  12593. *
  12594. * @static
  12595. * @since 0.1.0
  12596. * @memberOf _
  12597. * @category Lang
  12598. * @param {*} value The value to convert.
  12599. * @returns {Array} Returns the converted array.
  12600. * @example
  12601. *
  12602. * _.toArray({ 'a': 1, 'b': 2 });
  12603. * // => [1, 2]
  12604. *
  12605. * _.toArray('abc');
  12606. * // => ['a', 'b', 'c']
  12607. *
  12608. * _.toArray(1);
  12609. * // => []
  12610. *
  12611. * _.toArray(null);
  12612. * // => []
  12613. */
  12614. function toArray(value) {
  12615. if (!value) {
  12616. return [];
  12617. }
  12618. if (isArrayLike(value)) {
  12619. return isString(value) ? stringToArray(value) : copyArray(value);
  12620. }
  12621. if (symIterator && value[symIterator]) {
  12622. return iteratorToArray(value[symIterator]());
  12623. }
  12624. var tag = getTag(value),
  12625. func = tag == mapTag ? mapToArray : (tag == setTag ? setToArray : values);
  12626. return func(value);
  12627. }
  12628. /**
  12629. * Converts `value` to a finite number.
  12630. *
  12631. * @static
  12632. * @memberOf _
  12633. * @since 4.12.0
  12634. * @category Lang
  12635. * @param {*} value The value to convert.
  12636. * @returns {number} Returns the converted number.
  12637. * @example
  12638. *
  12639. * _.toFinite(3.2);
  12640. * // => 3.2
  12641. *
  12642. * _.toFinite(Number.MIN_VALUE);
  12643. * // => 5e-324
  12644. *
  12645. * _.toFinite(Infinity);
  12646. * // => 1.7976931348623157e+308
  12647. *
  12648. * _.toFinite('3.2');
  12649. * // => 3.2
  12650. */
  12651. function toFinite(value) {
  12652. if (!value) {
  12653. return value === 0 ? value : 0;
  12654. }
  12655. value = toNumber(value);
  12656. if (value === INFINITY || value === -INFINITY) {
  12657. var sign = (value < 0 ? -1 : 1);
  12658. return sign * MAX_INTEGER;
  12659. }
  12660. return value === value ? value : 0;
  12661. }
  12662. /**
  12663. * Converts `value` to an integer.
  12664. *
  12665. * **Note:** This method is loosely based on
  12666. * [`ToInteger`](http://www.ecma-international.org/ecma-262/7.0/#sec-tointeger).
  12667. *
  12668. * @static
  12669. * @memberOf _
  12670. * @since 4.0.0
  12671. * @category Lang
  12672. * @param {*} value The value to convert.
  12673. * @returns {number} Returns the converted integer.
  12674. * @example
  12675. *
  12676. * _.toInteger(3.2);
  12677. * // => 3
  12678. *
  12679. * _.toInteger(Number.MIN_VALUE);
  12680. * // => 0
  12681. *
  12682. * _.toInteger(Infinity);
  12683. * // => 1.7976931348623157e+308
  12684. *
  12685. * _.toInteger('3.2');
  12686. * // => 3
  12687. */
  12688. function toInteger(value) {
  12689. var result = toFinite(value),
  12690. remainder = result % 1;
  12691. return result === result ? (remainder ? result - remainder : result) : 0;
  12692. }
  12693. /**
  12694. * Converts `value` to an integer suitable for use as the length of an
  12695. * array-like object.
  12696. *
  12697. * **Note:** This method is based on
  12698. * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).
  12699. *
  12700. * @static
  12701. * @memberOf _
  12702. * @since 4.0.0
  12703. * @category Lang
  12704. * @param {*} value The value to convert.
  12705. * @returns {number} Returns the converted integer.
  12706. * @example
  12707. *
  12708. * _.toLength(3.2);
  12709. * // => 3
  12710. *
  12711. * _.toLength(Number.MIN_VALUE);
  12712. * // => 0
  12713. *
  12714. * _.toLength(Infinity);
  12715. * // => 4294967295
  12716. *
  12717. * _.toLength('3.2');
  12718. * // => 3
  12719. */
  12720. function toLength(value) {
  12721. return value ? baseClamp(toInteger(value), 0, MAX_ARRAY_LENGTH) : 0;
  12722. }
  12723. /**
  12724. * Converts `value` to a number.
  12725. *
  12726. * @static
  12727. * @memberOf _
  12728. * @since 4.0.0
  12729. * @category Lang
  12730. * @param {*} value The value to process.
  12731. * @returns {number} Returns the number.
  12732. * @example
  12733. *
  12734. * _.toNumber(3.2);
  12735. * // => 3.2
  12736. *
  12737. * _.toNumber(Number.MIN_VALUE);
  12738. * // => 5e-324
  12739. *
  12740. * _.toNumber(Infinity);
  12741. * // => Infinity
  12742. *
  12743. * _.toNumber('3.2');
  12744. * // => 3.2
  12745. */
  12746. function toNumber(value) {
  12747. if (typeof value == 'number') {
  12748. return value;
  12749. }
  12750. if (isSymbol(value)) {
  12751. return NAN;
  12752. }
  12753. if (isObject(value)) {
  12754. var other = typeof value.valueOf == 'function' ? value.valueOf() : value;
  12755. value = isObject(other) ? (other + '') : other;
  12756. }
  12757. if (typeof value != 'string') {
  12758. return value === 0 ? value : +value;
  12759. }
  12760. value = baseTrim(value);
  12761. var isBinary = reIsBinary.test(value);
  12762. return (isBinary || reIsOctal.test(value))
  12763. ? freeParseInt(value.slice(2), isBinary ? 2 : 8)
  12764. : (reIsBadHex.test(value) ? NAN : +value);
  12765. }
  12766. /**
  12767. * Converts `value` to a plain object flattening inherited enumerable string
  12768. * keyed properties of `value` to own properties of the plain object.
  12769. *
  12770. * @static
  12771. * @memberOf _
  12772. * @since 3.0.0
  12773. * @category Lang
  12774. * @param {*} value The value to convert.
  12775. * @returns {Object} Returns the converted plain object.
  12776. * @example
  12777. *
  12778. * function Foo() {
  12779. * this.b = 2;
  12780. * }
  12781. *
  12782. * Foo.prototype.c = 3;
  12783. *
  12784. * _.assign({ 'a': 1 }, new Foo);
  12785. * // => { 'a': 1, 'b': 2 }
  12786. *
  12787. * _.assign({ 'a': 1 }, _.toPlainObject(new Foo));
  12788. * // => { 'a': 1, 'b': 2, 'c': 3 }
  12789. */
  12790. function toPlainObject(value) {
  12791. return copyObject(value, keysIn(value));
  12792. }
  12793. /**
  12794. * Converts `value` to a safe integer. A safe integer can be compared and
  12795. * represented correctly.
  12796. *
  12797. * @static
  12798. * @memberOf _
  12799. * @since 4.0.0
  12800. * @category Lang
  12801. * @param {*} value The value to convert.
  12802. * @returns {number} Returns the converted integer.
  12803. * @example
  12804. *
  12805. * _.toSafeInteger(3.2);
  12806. * // => 3
  12807. *
  12808. * _.toSafeInteger(Number.MIN_VALUE);
  12809. * // => 0
  12810. *
  12811. * _.toSafeInteger(Infinity);
  12812. * // => 9007199254740991
  12813. *
  12814. * _.toSafeInteger('3.2');
  12815. * // => 3
  12816. */
  12817. function toSafeInteger(value) {
  12818. return value
  12819. ? baseClamp(toInteger(value), -MAX_SAFE_INTEGER, MAX_SAFE_INTEGER)
  12820. : (value === 0 ? value : 0);
  12821. }
  12822. /**
  12823. * Converts `value` to a string. An empty string is returned for `null`
  12824. * and `undefined` values. The sign of `-0` is preserved.
  12825. *
  12826. * @static
  12827. * @memberOf _
  12828. * @since 4.0.0
  12829. * @category Lang
  12830. * @param {*} value The value to convert.
  12831. * @returns {string} Returns the converted string.
  12832. * @example
  12833. *
  12834. * _.toString(null);
  12835. * // => ''
  12836. *
  12837. * _.toString(-0);
  12838. * // => '-0'
  12839. *
  12840. * _.toString([1, 2, 3]);
  12841. * // => '1,2,3'
  12842. */
  12843. function toString(value) {
  12844. return value == null ? '' : baseToString(value);
  12845. }
  12846. /*------------------------------------------------------------------------*/
  12847. /**
  12848. * Assigns own enumerable string keyed properties of source objects to the
  12849. * destination object. Source objects are applied from left to right.
  12850. * Subsequent sources overwrite property assignments of previous sources.
  12851. *
  12852. * **Note:** This method mutates `object` and is loosely based on
  12853. * [`Object.assign`](https://mdn.io/Object/assign).
  12854. *
  12855. * @static
  12856. * @memberOf _
  12857. * @since 0.10.0
  12858. * @category Object
  12859. * @param {Object} object The destination object.
  12860. * @param {...Object} [sources] The source objects.
  12861. * @returns {Object} Returns `object`.
  12862. * @see _.assignIn
  12863. * @example
  12864. *
  12865. * function Foo() {
  12866. * this.a = 1;
  12867. * }
  12868. *
  12869. * function Bar() {
  12870. * this.c = 3;
  12871. * }
  12872. *
  12873. * Foo.prototype.b = 2;
  12874. * Bar.prototype.d = 4;
  12875. *
  12876. * _.assign({ 'a': 0 }, new Foo, new Bar);
  12877. * // => { 'a': 1, 'c': 3 }
  12878. */
  12879. var assign = createAssigner(function(object, source) {
  12880. if (isPrototype(source) || isArrayLike(source)) {
  12881. copyObject(source, keys(source), object);
  12882. return;
  12883. }
  12884. for (var key in source) {
  12885. if (hasOwnProperty.call(source, key)) {
  12886. assignValue(object, key, source[key]);
  12887. }
  12888. }
  12889. });
  12890. /**
  12891. * This method is like `_.assign` except that it iterates over own and
  12892. * inherited source properties.
  12893. *
  12894. * **Note:** This method mutates `object`.
  12895. *
  12896. * @static
  12897. * @memberOf _
  12898. * @since 4.0.0
  12899. * @alias extend
  12900. * @category Object
  12901. * @param {Object} object The destination object.
  12902. * @param {...Object} [sources] The source objects.
  12903. * @returns {Object} Returns `object`.
  12904. * @see _.assign
  12905. * @example
  12906. *
  12907. * function Foo() {
  12908. * this.a = 1;
  12909. * }
  12910. *
  12911. * function Bar() {
  12912. * this.c = 3;
  12913. * }
  12914. *
  12915. * Foo.prototype.b = 2;
  12916. * Bar.prototype.d = 4;
  12917. *
  12918. * _.assignIn({ 'a': 0 }, new Foo, new Bar);
  12919. * // => { 'a': 1, 'b': 2, 'c': 3, 'd': 4 }
  12920. */
  12921. var assignIn = createAssigner(function(object, source) {
  12922. copyObject(source, keysIn(source), object);
  12923. });
  12924. /**
  12925. * This method is like `_.assignIn` except that it accepts `customizer`
  12926. * which is invoked to produce the assigned values. If `customizer` returns
  12927. * `undefined`, assignment is handled by the method instead. The `customizer`
  12928. * is invoked with five arguments: (objValue, srcValue, key, object, source).
  12929. *
  12930. * **Note:** This method mutates `object`.
  12931. *
  12932. * @static
  12933. * @memberOf _
  12934. * @since 4.0.0
  12935. * @alias extendWith
  12936. * @category Object
  12937. * @param {Object} object The destination object.
  12938. * @param {...Object} sources The source objects.
  12939. * @param {Function} [customizer] The function to customize assigned values.
  12940. * @returns {Object} Returns `object`.
  12941. * @see _.assignWith
  12942. * @example
  12943. *
  12944. * function customizer(objValue, srcValue) {
  12945. * return _.isUndefined(objValue) ? srcValue : objValue;
  12946. * }
  12947. *
  12948. * var defaults = _.partialRight(_.assignInWith, customizer);
  12949. *
  12950. * defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 });
  12951. * // => { 'a': 1, 'b': 2 }
  12952. */
  12953. var assignInWith = createAssigner(function(object, source, srcIndex, customizer) {
  12954. copyObject(source, keysIn(source), object, customizer);
  12955. });
  12956. /**
  12957. * This method is like `_.assign` except that it accepts `customizer`
  12958. * which is invoked to produce the assigned values. If `customizer` returns
  12959. * `undefined`, assignment is handled by the method instead. The `customizer`
  12960. * is invoked with five arguments: (objValue, srcValue, key, object, source).
  12961. *
  12962. * **Note:** This method mutates `object`.
  12963. *
  12964. * @static
  12965. * @memberOf _
  12966. * @since 4.0.0
  12967. * @category Object
  12968. * @param {Object} object The destination object.
  12969. * @param {...Object} sources The source objects.
  12970. * @param {Function} [customizer] The function to customize assigned values.
  12971. * @returns {Object} Returns `object`.
  12972. * @see _.assignInWith
  12973. * @example
  12974. *
  12975. * function customizer(objValue, srcValue) {
  12976. * return _.isUndefined(objValue) ? srcValue : objValue;
  12977. * }
  12978. *
  12979. * var defaults = _.partialRight(_.assignWith, customizer);
  12980. *
  12981. * defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 });
  12982. * // => { 'a': 1, 'b': 2 }
  12983. */
  12984. var assignWith = createAssigner(function(object, source, srcIndex, customizer) {
  12985. copyObject(source, keys(source), object, customizer);
  12986. });
  12987. /**
  12988. * Creates an array of values corresponding to `paths` of `object`.
  12989. *
  12990. * @static
  12991. * @memberOf _
  12992. * @since 1.0.0
  12993. * @category Object
  12994. * @param {Object} object The object to iterate over.
  12995. * @param {...(string|string[])} [paths] The property paths to pick.
  12996. * @returns {Array} Returns the picked values.
  12997. * @example
  12998. *
  12999. * var object = { 'a': [{ 'b': { 'c': 3 } }, 4] };
  13000. *
  13001. * _.at(object, ['a[0].b.c', 'a[1]']);
  13002. * // => [3, 4]
  13003. */
  13004. var at = flatRest(baseAt);
  13005. /**
  13006. * Creates an object that inherits from the `prototype` object. If a
  13007. * `properties` object is given, its own enumerable string keyed properties
  13008. * are assigned to the created object.
  13009. *
  13010. * @static
  13011. * @memberOf _
  13012. * @since 2.3.0
  13013. * @category Object
  13014. * @param {Object} prototype The object to inherit from.
  13015. * @param {Object} [properties] The properties to assign to the object.
  13016. * @returns {Object} Returns the new object.
  13017. * @example
  13018. *
  13019. * function Shape() {
  13020. * this.x = 0;
  13021. * this.y = 0;
  13022. * }
  13023. *
  13024. * function Circle() {
  13025. * Shape.call(this);
  13026. * }
  13027. *
  13028. * Circle.prototype = _.create(Shape.prototype, {
  13029. * 'constructor': Circle
  13030. * });
  13031. *
  13032. * var circle = new Circle;
  13033. * circle instanceof Circle;
  13034. * // => true
  13035. *
  13036. * circle instanceof Shape;
  13037. * // => true
  13038. */
  13039. function create(prototype, properties) {
  13040. var result = baseCreate(prototype);
  13041. return properties == null ? result : baseAssign(result, properties);
  13042. }
  13043. /**
  13044. * Assigns own and inherited enumerable string keyed properties of source
  13045. * objects to the destination object for all destination properties that
  13046. * resolve to `undefined`. Source objects are applied from left to right.
  13047. * Once a property is set, additional values of the same property are ignored.
  13048. *
  13049. * **Note:** This method mutates `object`.
  13050. *
  13051. * @static
  13052. * @since 0.1.0
  13053. * @memberOf _
  13054. * @category Object
  13055. * @param {Object} object The destination object.
  13056. * @param {...Object} [sources] The source objects.
  13057. * @returns {Object} Returns `object`.
  13058. * @see _.defaultsDeep
  13059. * @example
  13060. *
  13061. * _.defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 });
  13062. * // => { 'a': 1, 'b': 2 }
  13063. */
  13064. var defaults = baseRest(function(object, sources) {
  13065. object = Object(object);
  13066. var index = -1;
  13067. var length = sources.length;
  13068. var guard = length > 2 ? sources[2] : undefined;
  13069. if (guard && isIterateeCall(sources[0], sources[1], guard)) {
  13070. length = 1;
  13071. }
  13072. while (++index < length) {
  13073. var source = sources[index];
  13074. var props = keysIn(source);
  13075. var propsIndex = -1;
  13076. var propsLength = props.length;
  13077. while (++propsIndex < propsLength) {
  13078. var key = props[propsIndex];
  13079. var value = object[key];
  13080. if (value === undefined ||
  13081. (eq(value, objectProto[key]) && !hasOwnProperty.call(object, key))) {
  13082. object[key] = source[key];
  13083. }
  13084. }
  13085. }
  13086. return object;
  13087. });
  13088. /**
  13089. * This method is like `_.defaults` except that it recursively assigns
  13090. * default properties.
  13091. *
  13092. * **Note:** This method mutates `object`.
  13093. *
  13094. * @static
  13095. * @memberOf _
  13096. * @since 3.10.0
  13097. * @category Object
  13098. * @param {Object} object The destination object.
  13099. * @param {...Object} [sources] The source objects.
  13100. * @returns {Object} Returns `object`.
  13101. * @see _.defaults
  13102. * @example
  13103. *
  13104. * _.defaultsDeep({ 'a': { 'b': 2 } }, { 'a': { 'b': 1, 'c': 3 } });
  13105. * // => { 'a': { 'b': 2, 'c': 3 } }
  13106. */
  13107. var defaultsDeep = baseRest(function(args) {
  13108. args.push(undefined, customDefaultsMerge);
  13109. return apply(mergeWith, undefined, args);
  13110. });
  13111. /**
  13112. * This method is like `_.find` except that it returns the key of the first
  13113. * element `predicate` returns truthy for instead of the element itself.
  13114. *
  13115. * @static
  13116. * @memberOf _
  13117. * @since 1.1.0
  13118. * @category Object
  13119. * @param {Object} object The object to inspect.
  13120. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  13121. * @returns {string|undefined} Returns the key of the matched element,
  13122. * else `undefined`.
  13123. * @example
  13124. *
  13125. * var users = {
  13126. * 'barney': { 'age': 36, 'active': true },
  13127. * 'fred': { 'age': 40, 'active': false },
  13128. * 'pebbles': { 'age': 1, 'active': true }
  13129. * };
  13130. *
  13131. * _.findKey(users, function(o) { return o.age < 40; });
  13132. * // => 'barney' (iteration order is not guaranteed)
  13133. *
  13134. * // The `_.matches` iteratee shorthand.
  13135. * _.findKey(users, { 'age': 1, 'active': true });
  13136. * // => 'pebbles'
  13137. *
  13138. * // The `_.matchesProperty` iteratee shorthand.
  13139. * _.findKey(users, ['active', false]);
  13140. * // => 'fred'
  13141. *
  13142. * // The `_.property` iteratee shorthand.
  13143. * _.findKey(users, 'active');
  13144. * // => 'barney'
  13145. */
  13146. function findKey(object, predicate) {
  13147. return baseFindKey(object, getIteratee(predicate, 3), baseForOwn);
  13148. }
  13149. /**
  13150. * This method is like `_.findKey` except that it iterates over elements of
  13151. * a collection in the opposite order.
  13152. *
  13153. * @static
  13154. * @memberOf _
  13155. * @since 2.0.0
  13156. * @category Object
  13157. * @param {Object} object The object to inspect.
  13158. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  13159. * @returns {string|undefined} Returns the key of the matched element,
  13160. * else `undefined`.
  13161. * @example
  13162. *
  13163. * var users = {
  13164. * 'barney': { 'age': 36, 'active': true },
  13165. * 'fred': { 'age': 40, 'active': false },
  13166. * 'pebbles': { 'age': 1, 'active': true }
  13167. * };
  13168. *
  13169. * _.findLastKey(users, function(o) { return o.age < 40; });
  13170. * // => returns 'pebbles' assuming `_.findKey` returns 'barney'
  13171. *
  13172. * // The `_.matches` iteratee shorthand.
  13173. * _.findLastKey(users, { 'age': 36, 'active': true });
  13174. * // => 'barney'
  13175. *
  13176. * // The `_.matchesProperty` iteratee shorthand.
  13177. * _.findLastKey(users, ['active', false]);
  13178. * // => 'fred'
  13179. *
  13180. * // The `_.property` iteratee shorthand.
  13181. * _.findLastKey(users, 'active');
  13182. * // => 'pebbles'
  13183. */
  13184. function findLastKey(object, predicate) {
  13185. return baseFindKey(object, getIteratee(predicate, 3), baseForOwnRight);
  13186. }
  13187. /**
  13188. * Iterates over own and inherited enumerable string keyed properties of an
  13189. * object and invokes `iteratee` for each property. The iteratee is invoked
  13190. * with three arguments: (value, key, object). Iteratee functions may exit
  13191. * iteration early by explicitly returning `false`.
  13192. *
  13193. * @static
  13194. * @memberOf _
  13195. * @since 0.3.0
  13196. * @category Object
  13197. * @param {Object} object The object to iterate over.
  13198. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  13199. * @returns {Object} Returns `object`.
  13200. * @see _.forInRight
  13201. * @example
  13202. *
  13203. * function Foo() {
  13204. * this.a = 1;
  13205. * this.b = 2;
  13206. * }
  13207. *
  13208. * Foo.prototype.c = 3;
  13209. *
  13210. * _.forIn(new Foo, function(value, key) {
  13211. * console.log(key);
  13212. * });
  13213. * // => Logs 'a', 'b', then 'c' (iteration order is not guaranteed).
  13214. */
  13215. function forIn(object, iteratee) {
  13216. return object == null
  13217. ? object
  13218. : baseFor(object, getIteratee(iteratee, 3), keysIn);
  13219. }
  13220. /**
  13221. * This method is like `_.forIn` except that it iterates over properties of
  13222. * `object` in the opposite order.
  13223. *
  13224. * @static
  13225. * @memberOf _
  13226. * @since 2.0.0
  13227. * @category Object
  13228. * @param {Object} object The object to iterate over.
  13229. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  13230. * @returns {Object} Returns `object`.
  13231. * @see _.forIn
  13232. * @example
  13233. *
  13234. * function Foo() {
  13235. * this.a = 1;
  13236. * this.b = 2;
  13237. * }
  13238. *
  13239. * Foo.prototype.c = 3;
  13240. *
  13241. * _.forInRight(new Foo, function(value, key) {
  13242. * console.log(key);
  13243. * });
  13244. * // => Logs 'c', 'b', then 'a' assuming `_.forIn` logs 'a', 'b', then 'c'.
  13245. */
  13246. function forInRight(object, iteratee) {
  13247. return object == null
  13248. ? object
  13249. : baseForRight(object, getIteratee(iteratee, 3), keysIn);
  13250. }
  13251. /**
  13252. * Iterates over own enumerable string keyed properties of an object and
  13253. * invokes `iteratee` for each property. The iteratee is invoked with three
  13254. * arguments: (value, key, object). Iteratee functions may exit iteration
  13255. * early by explicitly returning `false`.
  13256. *
  13257. * @static
  13258. * @memberOf _
  13259. * @since 0.3.0
  13260. * @category Object
  13261. * @param {Object} object The object to iterate over.
  13262. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  13263. * @returns {Object} Returns `object`.
  13264. * @see _.forOwnRight
  13265. * @example
  13266. *
  13267. * function Foo() {
  13268. * this.a = 1;
  13269. * this.b = 2;
  13270. * }
  13271. *
  13272. * Foo.prototype.c = 3;
  13273. *
  13274. * _.forOwn(new Foo, function(value, key) {
  13275. * console.log(key);
  13276. * });
  13277. * // => Logs 'a' then 'b' (iteration order is not guaranteed).
  13278. */
  13279. function forOwn(object, iteratee) {
  13280. return object && baseForOwn(object, getIteratee(iteratee, 3));
  13281. }
  13282. /**
  13283. * This method is like `_.forOwn` except that it iterates over properties of
  13284. * `object` in the opposite order.
  13285. *
  13286. * @static
  13287. * @memberOf _
  13288. * @since 2.0.0
  13289. * @category Object
  13290. * @param {Object} object The object to iterate over.
  13291. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  13292. * @returns {Object} Returns `object`.
  13293. * @see _.forOwn
  13294. * @example
  13295. *
  13296. * function Foo() {
  13297. * this.a = 1;
  13298. * this.b = 2;
  13299. * }
  13300. *
  13301. * Foo.prototype.c = 3;
  13302. *
  13303. * _.forOwnRight(new Foo, function(value, key) {
  13304. * console.log(key);
  13305. * });
  13306. * // => Logs 'b' then 'a' assuming `_.forOwn` logs 'a' then 'b'.
  13307. */
  13308. function forOwnRight(object, iteratee) {
  13309. return object && baseForOwnRight(object, getIteratee(iteratee, 3));
  13310. }
  13311. /**
  13312. * Creates an array of function property names from own enumerable properties
  13313. * of `object`.
  13314. *
  13315. * @static
  13316. * @since 0.1.0
  13317. * @memberOf _
  13318. * @category Object
  13319. * @param {Object} object The object to inspect.
  13320. * @returns {Array} Returns the function names.
  13321. * @see _.functionsIn
  13322. * @example
  13323. *
  13324. * function Foo() {
  13325. * this.a = _.constant('a');
  13326. * this.b = _.constant('b');
  13327. * }
  13328. *
  13329. * Foo.prototype.c = _.constant('c');
  13330. *
  13331. * _.functions(new Foo);
  13332. * // => ['a', 'b']
  13333. */
  13334. function functions(object) {
  13335. return object == null ? [] : baseFunctions(object, keys(object));
  13336. }
  13337. /**
  13338. * Creates an array of function property names from own and inherited
  13339. * enumerable properties of `object`.
  13340. *
  13341. * @static
  13342. * @memberOf _
  13343. * @since 4.0.0
  13344. * @category Object
  13345. * @param {Object} object The object to inspect.
  13346. * @returns {Array} Returns the function names.
  13347. * @see _.functions
  13348. * @example
  13349. *
  13350. * function Foo() {
  13351. * this.a = _.constant('a');
  13352. * this.b = _.constant('b');
  13353. * }
  13354. *
  13355. * Foo.prototype.c = _.constant('c');
  13356. *
  13357. * _.functionsIn(new Foo);
  13358. * // => ['a', 'b', 'c']
  13359. */
  13360. function functionsIn(object) {
  13361. return object == null ? [] : baseFunctions(object, keysIn(object));
  13362. }
  13363. /**
  13364. * Gets the value at `path` of `object`. If the resolved value is
  13365. * `undefined`, the `defaultValue` is returned in its place.
  13366. *
  13367. * @static
  13368. * @memberOf _
  13369. * @since 3.7.0
  13370. * @category Object
  13371. * @param {Object} object The object to query.
  13372. * @param {Array|string} path The path of the property to get.
  13373. * @param {*} [defaultValue] The value returned for `undefined` resolved values.
  13374. * @returns {*} Returns the resolved value.
  13375. * @example
  13376. *
  13377. * var object = { 'a': [{ 'b': { 'c': 3 } }] };
  13378. *
  13379. * _.get(object, 'a[0].b.c');
  13380. * // => 3
  13381. *
  13382. * _.get(object, ['a', '0', 'b', 'c']);
  13383. * // => 3
  13384. *
  13385. * _.get(object, 'a.b.c', 'default');
  13386. * // => 'default'
  13387. */
  13388. function get(object, path, defaultValue) {
  13389. var result = object == null ? undefined : baseGet(object, path);
  13390. return result === undefined ? defaultValue : result;
  13391. }
  13392. /**
  13393. * Checks if `path` is a direct property of `object`.
  13394. *
  13395. * @static
  13396. * @since 0.1.0
  13397. * @memberOf _
  13398. * @category Object
  13399. * @param {Object} object The object to query.
  13400. * @param {Array|string} path The path to check.
  13401. * @returns {boolean} Returns `true` if `path` exists, else `false`.
  13402. * @example
  13403. *
  13404. * var object = { 'a': { 'b': 2 } };
  13405. * var other = _.create({ 'a': _.create({ 'b': 2 }) });
  13406. *
  13407. * _.has(object, 'a');
  13408. * // => true
  13409. *
  13410. * _.has(object, 'a.b');
  13411. * // => true
  13412. *
  13413. * _.has(object, ['a', 'b']);
  13414. * // => true
  13415. *
  13416. * _.has(other, 'a');
  13417. * // => false
  13418. */
  13419. function has(object, path) {
  13420. return object != null && hasPath(object, path, baseHas);
  13421. }
  13422. /**
  13423. * Checks if `path` is a direct or inherited property of `object`.
  13424. *
  13425. * @static
  13426. * @memberOf _
  13427. * @since 4.0.0
  13428. * @category Object
  13429. * @param {Object} object The object to query.
  13430. * @param {Array|string} path The path to check.
  13431. * @returns {boolean} Returns `true` if `path` exists, else `false`.
  13432. * @example
  13433. *
  13434. * var object = _.create({ 'a': _.create({ 'b': 2 }) });
  13435. *
  13436. * _.hasIn(object, 'a');
  13437. * // => true
  13438. *
  13439. * _.hasIn(object, 'a.b');
  13440. * // => true
  13441. *
  13442. * _.hasIn(object, ['a', 'b']);
  13443. * // => true
  13444. *
  13445. * _.hasIn(object, 'b');
  13446. * // => false
  13447. */
  13448. function hasIn(object, path) {
  13449. return object != null && hasPath(object, path, baseHasIn);
  13450. }
  13451. /**
  13452. * Creates an object composed of the inverted keys and values of `object`.
  13453. * If `object` contains duplicate values, subsequent values overwrite
  13454. * property assignments of previous values.
  13455. *
  13456. * @static
  13457. * @memberOf _
  13458. * @since 0.7.0
  13459. * @category Object
  13460. * @param {Object} object The object to invert.
  13461. * @returns {Object} Returns the new inverted object.
  13462. * @example
  13463. *
  13464. * var object = { 'a': 1, 'b': 2, 'c': 1 };
  13465. *
  13466. * _.invert(object);
  13467. * // => { '1': 'c', '2': 'b' }
  13468. */
  13469. var invert = createInverter(function(result, value, key) {
  13470. if (value != null &&
  13471. typeof value.toString != 'function') {
  13472. value = nativeObjectToString.call(value);
  13473. }
  13474. result[value] = key;
  13475. }, constant(identity));
  13476. /**
  13477. * This method is like `_.invert` except that the inverted object is generated
  13478. * from the results of running each element of `object` thru `iteratee`. The
  13479. * corresponding inverted value of each inverted key is an array of keys
  13480. * responsible for generating the inverted value. The iteratee is invoked
  13481. * with one argument: (value).
  13482. *
  13483. * @static
  13484. * @memberOf _
  13485. * @since 4.1.0
  13486. * @category Object
  13487. * @param {Object} object The object to invert.
  13488. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  13489. * @returns {Object} Returns the new inverted object.
  13490. * @example
  13491. *
  13492. * var object = { 'a': 1, 'b': 2, 'c': 1 };
  13493. *
  13494. * _.invertBy(object);
  13495. * // => { '1': ['a', 'c'], '2': ['b'] }
  13496. *
  13497. * _.invertBy(object, function(value) {
  13498. * return 'group' + value;
  13499. * });
  13500. * // => { 'group1': ['a', 'c'], 'group2': ['b'] }
  13501. */
  13502. var invertBy = createInverter(function(result, value, key) {
  13503. if (value != null &&
  13504. typeof value.toString != 'function') {
  13505. value = nativeObjectToString.call(value);
  13506. }
  13507. if (hasOwnProperty.call(result, value)) {
  13508. result[value].push(key);
  13509. } else {
  13510. result[value] = [key];
  13511. }
  13512. }, getIteratee);
  13513. /**
  13514. * Invokes the method at `path` of `object`.
  13515. *
  13516. * @static
  13517. * @memberOf _
  13518. * @since 4.0.0
  13519. * @category Object
  13520. * @param {Object} object The object to query.
  13521. * @param {Array|string} path The path of the method to invoke.
  13522. * @param {...*} [args] The arguments to invoke the method with.
  13523. * @returns {*} Returns the result of the invoked method.
  13524. * @example
  13525. *
  13526. * var object = { 'a': [{ 'b': { 'c': [1, 2, 3, 4] } }] };
  13527. *
  13528. * _.invoke(object, 'a[0].b.c.slice', 1, 3);
  13529. * // => [2, 3]
  13530. */
  13531. var invoke = baseRest(baseInvoke);
  13532. /**
  13533. * Creates an array of the own enumerable property names of `object`.
  13534. *
  13535. * **Note:** Non-object values are coerced to objects. See the
  13536. * [ES spec](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)
  13537. * for more details.
  13538. *
  13539. * @static
  13540. * @since 0.1.0
  13541. * @memberOf _
  13542. * @category Object
  13543. * @param {Object} object The object to query.
  13544. * @returns {Array} Returns the array of property names.
  13545. * @example
  13546. *
  13547. * function Foo() {
  13548. * this.a = 1;
  13549. * this.b = 2;
  13550. * }
  13551. *
  13552. * Foo.prototype.c = 3;
  13553. *
  13554. * _.keys(new Foo);
  13555. * // => ['a', 'b'] (iteration order is not guaranteed)
  13556. *
  13557. * _.keys('hi');
  13558. * // => ['0', '1']
  13559. */
  13560. function keys(object) {
  13561. return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object);
  13562. }
  13563. /**
  13564. * Creates an array of the own and inherited enumerable property names of `object`.
  13565. *
  13566. * **Note:** Non-object values are coerced to objects.
  13567. *
  13568. * @static
  13569. * @memberOf _
  13570. * @since 3.0.0
  13571. * @category Object
  13572. * @param {Object} object The object to query.
  13573. * @returns {Array} Returns the array of property names.
  13574. * @example
  13575. *
  13576. * function Foo() {
  13577. * this.a = 1;
  13578. * this.b = 2;
  13579. * }
  13580. *
  13581. * Foo.prototype.c = 3;
  13582. *
  13583. * _.keysIn(new Foo);
  13584. * // => ['a', 'b', 'c'] (iteration order is not guaranteed)
  13585. */
  13586. function keysIn(object) {
  13587. return isArrayLike(object) ? arrayLikeKeys(object, true) : baseKeysIn(object);
  13588. }
  13589. /**
  13590. * The opposite of `_.mapValues`; this method creates an object with the
  13591. * same values as `object` and keys generated by running each own enumerable
  13592. * string keyed property of `object` thru `iteratee`. The iteratee is invoked
  13593. * with three arguments: (value, key, object).
  13594. *
  13595. * @static
  13596. * @memberOf _
  13597. * @since 3.8.0
  13598. * @category Object
  13599. * @param {Object} object The object to iterate over.
  13600. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  13601. * @returns {Object} Returns the new mapped object.
  13602. * @see _.mapValues
  13603. * @example
  13604. *
  13605. * _.mapKeys({ 'a': 1, 'b': 2 }, function(value, key) {
  13606. * return key + value;
  13607. * });
  13608. * // => { 'a1': 1, 'b2': 2 }
  13609. */
  13610. function mapKeys(object, iteratee) {
  13611. var result = {};
  13612. iteratee = getIteratee(iteratee, 3);
  13613. baseForOwn(object, function(value, key, object) {
  13614. baseAssignValue(result, iteratee(value, key, object), value);
  13615. });
  13616. return result;
  13617. }
  13618. /**
  13619. * Creates an object with the same keys as `object` and values generated
  13620. * by running each own enumerable string keyed property of `object` thru
  13621. * `iteratee`. The iteratee is invoked with three arguments:
  13622. * (value, key, object).
  13623. *
  13624. * @static
  13625. * @memberOf _
  13626. * @since 2.4.0
  13627. * @category Object
  13628. * @param {Object} object The object to iterate over.
  13629. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  13630. * @returns {Object} Returns the new mapped object.
  13631. * @see _.mapKeys
  13632. * @example
  13633. *
  13634. * var users = {
  13635. * 'fred': { 'user': 'fred', 'age': 40 },
  13636. * 'pebbles': { 'user': 'pebbles', 'age': 1 }
  13637. * };
  13638. *
  13639. * _.mapValues(users, function(o) { return o.age; });
  13640. * // => { 'fred': 40, 'pebbles': 1 } (iteration order is not guaranteed)
  13641. *
  13642. * // The `_.property` iteratee shorthand.
  13643. * _.mapValues(users, 'age');
  13644. * // => { 'fred': 40, 'pebbles': 1 } (iteration order is not guaranteed)
  13645. */
  13646. function mapValues(object, iteratee) {
  13647. var result = {};
  13648. iteratee = getIteratee(iteratee, 3);
  13649. baseForOwn(object, function(value, key, object) {
  13650. baseAssignValue(result, key, iteratee(value, key, object));
  13651. });
  13652. return result;
  13653. }
  13654. /**
  13655. * This method is like `_.assign` except that it recursively merges own and
  13656. * inherited enumerable string keyed properties of source objects into the
  13657. * destination object. Source properties that resolve to `undefined` are
  13658. * skipped if a destination value exists. Array and plain object properties
  13659. * are merged recursively. Other objects and value types are overridden by
  13660. * assignment. Source objects are applied from left to right. Subsequent
  13661. * sources overwrite property assignments of previous sources.
  13662. *
  13663. * **Note:** This method mutates `object`.
  13664. *
  13665. * @static
  13666. * @memberOf _
  13667. * @since 0.5.0
  13668. * @category Object
  13669. * @param {Object} object The destination object.
  13670. * @param {...Object} [sources] The source objects.
  13671. * @returns {Object} Returns `object`.
  13672. * @example
  13673. *
  13674. * var object = {
  13675. * 'a': [{ 'b': 2 }, { 'd': 4 }]
  13676. * };
  13677. *
  13678. * var other = {
  13679. * 'a': [{ 'c': 3 }, { 'e': 5 }]
  13680. * };
  13681. *
  13682. * _.merge(object, other);
  13683. * // => { 'a': [{ 'b': 2, 'c': 3 }, { 'd': 4, 'e': 5 }] }
  13684. */
  13685. var merge = createAssigner(function(object, source, srcIndex) {
  13686. baseMerge(object, source, srcIndex);
  13687. });
  13688. /**
  13689. * This method is like `_.merge` except that it accepts `customizer` which
  13690. * is invoked to produce the merged values of the destination and source
  13691. * properties. If `customizer` returns `undefined`, merging is handled by the
  13692. * method instead. The `customizer` is invoked with six arguments:
  13693. * (objValue, srcValue, key, object, source, stack).
  13694. *
  13695. * **Note:** This method mutates `object`.
  13696. *
  13697. * @static
  13698. * @memberOf _
  13699. * @since 4.0.0
  13700. * @category Object
  13701. * @param {Object} object The destination object.
  13702. * @param {...Object} sources The source objects.
  13703. * @param {Function} customizer The function to customize assigned values.
  13704. * @returns {Object} Returns `object`.
  13705. * @example
  13706. *
  13707. * function customizer(objValue, srcValue) {
  13708. * if (_.isArray(objValue)) {
  13709. * return objValue.concat(srcValue);
  13710. * }
  13711. * }
  13712. *
  13713. * var object = { 'a': [1], 'b': [2] };
  13714. * var other = { 'a': [3], 'b': [4] };
  13715. *
  13716. * _.mergeWith(object, other, customizer);
  13717. * // => { 'a': [1, 3], 'b': [2, 4] }
  13718. */
  13719. var mergeWith = createAssigner(function(object, source, srcIndex, customizer) {
  13720. baseMerge(object, source, srcIndex, customizer);
  13721. });
  13722. /**
  13723. * The opposite of `_.pick`; this method creates an object composed of the
  13724. * own and inherited enumerable property paths of `object` that are not omitted.
  13725. *
  13726. * **Note:** This method is considerably slower than `_.pick`.
  13727. *
  13728. * @static
  13729. * @since 0.1.0
  13730. * @memberOf _
  13731. * @category Object
  13732. * @param {Object} object The source object.
  13733. * @param {...(string|string[])} [paths] The property paths to omit.
  13734. * @returns {Object} Returns the new object.
  13735. * @example
  13736. *
  13737. * var object = { 'a': 1, 'b': '2', 'c': 3 };
  13738. *
  13739. * _.omit(object, ['a', 'c']);
  13740. * // => { 'b': '2' }
  13741. */
  13742. var omit = flatRest(function(object, paths) {
  13743. var result = {};
  13744. if (object == null) {
  13745. return result;
  13746. }
  13747. var isDeep = false;
  13748. paths = arrayMap(paths, function(path) {
  13749. path = castPath(path, object);
  13750. isDeep || (isDeep = path.length > 1);
  13751. return path;
  13752. });
  13753. copyObject(object, getAllKeysIn(object), result);
  13754. if (isDeep) {
  13755. result = baseClone(result, CLONE_DEEP_FLAG | CLONE_FLAT_FLAG | CLONE_SYMBOLS_FLAG, customOmitClone);
  13756. }
  13757. var length = paths.length;
  13758. while (length--) {
  13759. baseUnset(result, paths[length]);
  13760. }
  13761. return result;
  13762. });
  13763. /**
  13764. * The opposite of `_.pickBy`; this method creates an object composed of
  13765. * the own and inherited enumerable string keyed properties of `object` that
  13766. * `predicate` doesn't return truthy for. The predicate is invoked with two
  13767. * arguments: (value, key).
  13768. *
  13769. * @static
  13770. * @memberOf _
  13771. * @since 4.0.0
  13772. * @category Object
  13773. * @param {Object} object The source object.
  13774. * @param {Function} [predicate=_.identity] The function invoked per property.
  13775. * @returns {Object} Returns the new object.
  13776. * @example
  13777. *
  13778. * var object = { 'a': 1, 'b': '2', 'c': 3 };
  13779. *
  13780. * _.omitBy(object, _.isNumber);
  13781. * // => { 'b': '2' }
  13782. */
  13783. function omitBy(object, predicate) {
  13784. return pickBy(object, negate(getIteratee(predicate)));
  13785. }
  13786. /**
  13787. * Creates an object composed of the picked `object` properties.
  13788. *
  13789. * @static
  13790. * @since 0.1.0
  13791. * @memberOf _
  13792. * @category Object
  13793. * @param {Object} object The source object.
  13794. * @param {...(string|string[])} [paths] The property paths to pick.
  13795. * @returns {Object} Returns the new object.
  13796. * @example
  13797. *
  13798. * var object = { 'a': 1, 'b': '2', 'c': 3 };
  13799. *
  13800. * _.pick(object, ['a', 'c']);
  13801. * // => { 'a': 1, 'c': 3 }
  13802. */
  13803. var pick = flatRest(function(object, paths) {
  13804. return object == null ? {} : basePick(object, paths);
  13805. });
  13806. /**
  13807. * Creates an object composed of the `object` properties `predicate` returns
  13808. * truthy for. The predicate is invoked with two arguments: (value, key).
  13809. *
  13810. * @static
  13811. * @memberOf _
  13812. * @since 4.0.0
  13813. * @category Object
  13814. * @param {Object} object The source object.
  13815. * @param {Function} [predicate=_.identity] The function invoked per property.
  13816. * @returns {Object} Returns the new object.
  13817. * @example
  13818. *
  13819. * var object = { 'a': 1, 'b': '2', 'c': 3 };
  13820. *
  13821. * _.pickBy(object, _.isNumber);
  13822. * // => { 'a': 1, 'c': 3 }
  13823. */
  13824. function pickBy(object, predicate) {
  13825. if (object == null) {
  13826. return {};
  13827. }
  13828. var props = arrayMap(getAllKeysIn(object), function(prop) {
  13829. return [prop];
  13830. });
  13831. predicate = getIteratee(predicate);
  13832. return basePickBy(object, props, function(value, path) {
  13833. return predicate(value, path[0]);
  13834. });
  13835. }
  13836. /**
  13837. * This method is like `_.get` except that if the resolved value is a
  13838. * function it's invoked with the `this` binding of its parent object and
  13839. * its result is returned.
  13840. *
  13841. * @static
  13842. * @since 0.1.0
  13843. * @memberOf _
  13844. * @category Object
  13845. * @param {Object} object The object to query.
  13846. * @param {Array|string} path The path of the property to resolve.
  13847. * @param {*} [defaultValue] The value returned for `undefined` resolved values.
  13848. * @returns {*} Returns the resolved value.
  13849. * @example
  13850. *
  13851. * var object = { 'a': [{ 'b': { 'c1': 3, 'c2': _.constant(4) } }] };
  13852. *
  13853. * _.result(object, 'a[0].b.c1');
  13854. * // => 3
  13855. *
  13856. * _.result(object, 'a[0].b.c2');
  13857. * // => 4
  13858. *
  13859. * _.result(object, 'a[0].b.c3', 'default');
  13860. * // => 'default'
  13861. *
  13862. * _.result(object, 'a[0].b.c3', _.constant('default'));
  13863. * // => 'default'
  13864. */
  13865. function result(object, path, defaultValue) {
  13866. path = castPath(path, object);
  13867. var index = -1,
  13868. length = path.length;
  13869. // Ensure the loop is entered when path is empty.
  13870. if (!length) {
  13871. length = 1;
  13872. object = undefined;
  13873. }
  13874. while (++index < length) {
  13875. var value = object == null ? undefined : object[toKey(path[index])];
  13876. if (value === undefined) {
  13877. index = length;
  13878. value = defaultValue;
  13879. }
  13880. object = isFunction(value) ? value.call(object) : value;
  13881. }
  13882. return object;
  13883. }
  13884. /**
  13885. * Sets the value at `path` of `object`. If a portion of `path` doesn't exist,
  13886. * it's created. Arrays are created for missing index properties while objects
  13887. * are created for all other missing properties. Use `_.setWith` to customize
  13888. * `path` creation.
  13889. *
  13890. * **Note:** This method mutates `object`.
  13891. *
  13892. * @static
  13893. * @memberOf _
  13894. * @since 3.7.0
  13895. * @category Object
  13896. * @param {Object} object The object to modify.
  13897. * @param {Array|string} path The path of the property to set.
  13898. * @param {*} value The value to set.
  13899. * @returns {Object} Returns `object`.
  13900. * @example
  13901. *
  13902. * var object = { 'a': [{ 'b': { 'c': 3 } }] };
  13903. *
  13904. * _.set(object, 'a[0].b.c', 4);
  13905. * console.log(object.a[0].b.c);
  13906. * // => 4
  13907. *
  13908. * _.set(object, ['x', '0', 'y', 'z'], 5);
  13909. * console.log(object.x[0].y.z);
  13910. * // => 5
  13911. */
  13912. function set(object, path, value) {
  13913. return object == null ? object : baseSet(object, path, value);
  13914. }
  13915. /**
  13916. * This method is like `_.set` except that it accepts `customizer` which is
  13917. * invoked to produce the objects of `path`. If `customizer` returns `undefined`
  13918. * path creation is handled by the method instead. The `customizer` is invoked
  13919. * with three arguments: (nsValue, key, nsObject).
  13920. *
  13921. * **Note:** This method mutates `object`.
  13922. *
  13923. * @static
  13924. * @memberOf _
  13925. * @since 4.0.0
  13926. * @category Object
  13927. * @param {Object} object The object to modify.
  13928. * @param {Array|string} path The path of the property to set.
  13929. * @param {*} value The value to set.
  13930. * @param {Function} [customizer] The function to customize assigned values.
  13931. * @returns {Object} Returns `object`.
  13932. * @example
  13933. *
  13934. * var object = {};
  13935. *
  13936. * _.setWith(object, '[0][1]', 'a', Object);
  13937. * // => { '0': { '1': 'a' } }
  13938. */
  13939. function setWith(object, path, value, customizer) {
  13940. customizer = typeof customizer == 'function' ? customizer : undefined;
  13941. return object == null ? object : baseSet(object, path, value, customizer);
  13942. }
  13943. /**
  13944. * Creates an array of own enumerable string keyed-value pairs for `object`
  13945. * which can be consumed by `_.fromPairs`. If `object` is a map or set, its
  13946. * entries are returned.
  13947. *
  13948. * @static
  13949. * @memberOf _
  13950. * @since 4.0.0
  13951. * @alias entries
  13952. * @category Object
  13953. * @param {Object} object The object to query.
  13954. * @returns {Array} Returns the key-value pairs.
  13955. * @example
  13956. *
  13957. * function Foo() {
  13958. * this.a = 1;
  13959. * this.b = 2;
  13960. * }
  13961. *
  13962. * Foo.prototype.c = 3;
  13963. *
  13964. * _.toPairs(new Foo);
  13965. * // => [['a', 1], ['b', 2]] (iteration order is not guaranteed)
  13966. */
  13967. var toPairs = createToPairs(keys);
  13968. /**
  13969. * Creates an array of own and inherited enumerable string keyed-value pairs
  13970. * for `object` which can be consumed by `_.fromPairs`. If `object` is a map
  13971. * or set, its entries are returned.
  13972. *
  13973. * @static
  13974. * @memberOf _
  13975. * @since 4.0.0
  13976. * @alias entriesIn
  13977. * @category Object
  13978. * @param {Object} object The object to query.
  13979. * @returns {Array} Returns the key-value pairs.
  13980. * @example
  13981. *
  13982. * function Foo() {
  13983. * this.a = 1;
  13984. * this.b = 2;
  13985. * }
  13986. *
  13987. * Foo.prototype.c = 3;
  13988. *
  13989. * _.toPairsIn(new Foo);
  13990. * // => [['a', 1], ['b', 2], ['c', 3]] (iteration order is not guaranteed)
  13991. */
  13992. var toPairsIn = createToPairs(keysIn);
  13993. /**
  13994. * An alternative to `_.reduce`; this method transforms `object` to a new
  13995. * `accumulator` object which is the result of running each of its own
  13996. * enumerable string keyed properties thru `iteratee`, with each invocation
  13997. * potentially mutating the `accumulator` object. If `accumulator` is not
  13998. * provided, a new object with the same `[[Prototype]]` will be used. The
  13999. * iteratee is invoked with four arguments: (accumulator, value, key, object).
  14000. * Iteratee functions may exit iteration early by explicitly returning `false`.
  14001. *
  14002. * @static
  14003. * @memberOf _
  14004. * @since 1.3.0
  14005. * @category Object
  14006. * @param {Object} object The object to iterate over.
  14007. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  14008. * @param {*} [accumulator] The custom accumulator value.
  14009. * @returns {*} Returns the accumulated value.
  14010. * @example
  14011. *
  14012. * _.transform([2, 3, 4], function(result, n) {
  14013. * result.push(n *= n);
  14014. * return n % 2 == 0;
  14015. * }, []);
  14016. * // => [4, 9]
  14017. *
  14018. * _.transform({ 'a': 1, 'b': 2, 'c': 1 }, function(result, value, key) {
  14019. * (result[value] || (result[value] = [])).push(key);
  14020. * }, {});
  14021. * // => { '1': ['a', 'c'], '2': ['b'] }
  14022. */
  14023. function transform(object, iteratee, accumulator) {
  14024. var isArr = isArray(object),
  14025. isArrLike = isArr || isBuffer(object) || isTypedArray(object);
  14026. iteratee = getIteratee(iteratee, 4);
  14027. if (accumulator == null) {
  14028. var Ctor = object && object.constructor;
  14029. if (isArrLike) {
  14030. accumulator = isArr ? new Ctor : [];
  14031. }
  14032. else if (isObject(object)) {
  14033. accumulator = isFunction(Ctor) ? baseCreate(getPrototype(object)) : {};
  14034. }
  14035. else {
  14036. accumulator = {};
  14037. }
  14038. }
  14039. (isArrLike ? arrayEach : baseForOwn)(object, function(value, index, object) {
  14040. return iteratee(accumulator, value, index, object);
  14041. });
  14042. return accumulator;
  14043. }
  14044. /**
  14045. * Removes the property at `path` of `object`.
  14046. *
  14047. * **Note:** This method mutates `object`.
  14048. *
  14049. * @static
  14050. * @memberOf _
  14051. * @since 4.0.0
  14052. * @category Object
  14053. * @param {Object} object The object to modify.
  14054. * @param {Array|string} path The path of the property to unset.
  14055. * @returns {boolean} Returns `true` if the property is deleted, else `false`.
  14056. * @example
  14057. *
  14058. * var object = { 'a': [{ 'b': { 'c': 7 } }] };
  14059. * _.unset(object, 'a[0].b.c');
  14060. * // => true
  14061. *
  14062. * console.log(object);
  14063. * // => { 'a': [{ 'b': {} }] };
  14064. *
  14065. * _.unset(object, ['a', '0', 'b', 'c']);
  14066. * // => true
  14067. *
  14068. * console.log(object);
  14069. * // => { 'a': [{ 'b': {} }] };
  14070. */
  14071. function unset(object, path) {
  14072. return object == null ? true : baseUnset(object, path);
  14073. }
  14074. /**
  14075. * This method is like `_.set` except that accepts `updater` to produce the
  14076. * value to set. Use `_.updateWith` to customize `path` creation. The `updater`
  14077. * is invoked with one argument: (value).
  14078. *
  14079. * **Note:** This method mutates `object`.
  14080. *
  14081. * @static
  14082. * @memberOf _
  14083. * @since 4.6.0
  14084. * @category Object
  14085. * @param {Object} object The object to modify.
  14086. * @param {Array|string} path The path of the property to set.
  14087. * @param {Function} updater The function to produce the updated value.
  14088. * @returns {Object} Returns `object`.
  14089. * @example
  14090. *
  14091. * var object = { 'a': [{ 'b': { 'c': 3 } }] };
  14092. *
  14093. * _.update(object, 'a[0].b.c', function(n) { return n * n; });
  14094. * console.log(object.a[0].b.c);
  14095. * // => 9
  14096. *
  14097. * _.update(object, 'x[0].y.z', function(n) { return n ? n + 1 : 0; });
  14098. * console.log(object.x[0].y.z);
  14099. * // => 0
  14100. */
  14101. function update(object, path, updater) {
  14102. return object == null ? object : baseUpdate(object, path, castFunction(updater));
  14103. }
  14104. /**
  14105. * This method is like `_.update` except that it accepts `customizer` which is
  14106. * invoked to produce the objects of `path`. If `customizer` returns `undefined`
  14107. * path creation is handled by the method instead. The `customizer` is invoked
  14108. * with three arguments: (nsValue, key, nsObject).
  14109. *
  14110. * **Note:** This method mutates `object`.
  14111. *
  14112. * @static
  14113. * @memberOf _
  14114. * @since 4.6.0
  14115. * @category Object
  14116. * @param {Object} object The object to modify.
  14117. * @param {Array|string} path The path of the property to set.
  14118. * @param {Function} updater The function to produce the updated value.
  14119. * @param {Function} [customizer] The function to customize assigned values.
  14120. * @returns {Object} Returns `object`.
  14121. * @example
  14122. *
  14123. * var object = {};
  14124. *
  14125. * _.updateWith(object, '[0][1]', _.constant('a'), Object);
  14126. * // => { '0': { '1': 'a' } }
  14127. */
  14128. function updateWith(object, path, updater, customizer) {
  14129. customizer = typeof customizer == 'function' ? customizer : undefined;
  14130. return object == null ? object : baseUpdate(object, path, castFunction(updater), customizer);
  14131. }
  14132. /**
  14133. * Creates an array of the own enumerable string keyed property values of `object`.
  14134. *
  14135. * **Note:** Non-object values are coerced to objects.
  14136. *
  14137. * @static
  14138. * @since 0.1.0
  14139. * @memberOf _
  14140. * @category Object
  14141. * @param {Object} object The object to query.
  14142. * @returns {Array} Returns the array of property values.
  14143. * @example
  14144. *
  14145. * function Foo() {
  14146. * this.a = 1;
  14147. * this.b = 2;
  14148. * }
  14149. *
  14150. * Foo.prototype.c = 3;
  14151. *
  14152. * _.values(new Foo);
  14153. * // => [1, 2] (iteration order is not guaranteed)
  14154. *
  14155. * _.values('hi');
  14156. * // => ['h', 'i']
  14157. */
  14158. function values(object) {
  14159. return object == null ? [] : baseValues(object, keys(object));
  14160. }
  14161. /**
  14162. * Creates an array of the own and inherited enumerable string keyed property
  14163. * values of `object`.
  14164. *
  14165. * **Note:** Non-object values are coerced to objects.
  14166. *
  14167. * @static
  14168. * @memberOf _
  14169. * @since 3.0.0
  14170. * @category Object
  14171. * @param {Object} object The object to query.
  14172. * @returns {Array} Returns the array of property values.
  14173. * @example
  14174. *
  14175. * function Foo() {
  14176. * this.a = 1;
  14177. * this.b = 2;
  14178. * }
  14179. *
  14180. * Foo.prototype.c = 3;
  14181. *
  14182. * _.valuesIn(new Foo);
  14183. * // => [1, 2, 3] (iteration order is not guaranteed)
  14184. */
  14185. function valuesIn(object) {
  14186. return object == null ? [] : baseValues(object, keysIn(object));
  14187. }
  14188. /*------------------------------------------------------------------------*/
  14189. /**
  14190. * Clamps `number` within the inclusive `lower` and `upper` bounds.
  14191. *
  14192. * @static
  14193. * @memberOf _
  14194. * @since 4.0.0
  14195. * @category Number
  14196. * @param {number} number The number to clamp.
  14197. * @param {number} [lower] The lower bound.
  14198. * @param {number} upper The upper bound.
  14199. * @returns {number} Returns the clamped number.
  14200. * @example
  14201. *
  14202. * _.clamp(-10, -5, 5);
  14203. * // => -5
  14204. *
  14205. * _.clamp(10, -5, 5);
  14206. * // => 5
  14207. */
  14208. function clamp(number, lower, upper) {
  14209. if (upper === undefined) {
  14210. upper = lower;
  14211. lower = undefined;
  14212. }
  14213. if (upper !== undefined) {
  14214. upper = toNumber(upper);
  14215. upper = upper === upper ? upper : 0;
  14216. }
  14217. if (lower !== undefined) {
  14218. lower = toNumber(lower);
  14219. lower = lower === lower ? lower : 0;
  14220. }
  14221. return baseClamp(toNumber(number), lower, upper);
  14222. }
  14223. /**
  14224. * Checks if `n` is between `start` and up to, but not including, `end`. If
  14225. * `end` is not specified, it's set to `start` with `start` then set to `0`.
  14226. * If `start` is greater than `end` the params are swapped to support
  14227. * negative ranges.
  14228. *
  14229. * @static
  14230. * @memberOf _
  14231. * @since 3.3.0
  14232. * @category Number
  14233. * @param {number} number The number to check.
  14234. * @param {number} [start=0] The start of the range.
  14235. * @param {number} end The end of the range.
  14236. * @returns {boolean} Returns `true` if `number` is in the range, else `false`.
  14237. * @see _.range, _.rangeRight
  14238. * @example
  14239. *
  14240. * _.inRange(3, 2, 4);
  14241. * // => true
  14242. *
  14243. * _.inRange(4, 8);
  14244. * // => true
  14245. *
  14246. * _.inRange(4, 2);
  14247. * // => false
  14248. *
  14249. * _.inRange(2, 2);
  14250. * // => false
  14251. *
  14252. * _.inRange(1.2, 2);
  14253. * // => true
  14254. *
  14255. * _.inRange(5.2, 4);
  14256. * // => false
  14257. *
  14258. * _.inRange(-3, -2, -6);
  14259. * // => true
  14260. */
  14261. function inRange(number, start, end) {
  14262. start = toFinite(start);
  14263. if (end === undefined) {
  14264. end = start;
  14265. start = 0;
  14266. } else {
  14267. end = toFinite(end);
  14268. }
  14269. number = toNumber(number);
  14270. return baseInRange(number, start, end);
  14271. }
  14272. /**
  14273. * Produces a random number between the inclusive `lower` and `upper` bounds.
  14274. * If only one argument is provided a number between `0` and the given number
  14275. * is returned. If `floating` is `true`, or either `lower` or `upper` are
  14276. * floats, a floating-point number is returned instead of an integer.
  14277. *
  14278. * **Note:** JavaScript follows the IEEE-754 standard for resolving
  14279. * floating-point values which can produce unexpected results.
  14280. *
  14281. * @static
  14282. * @memberOf _
  14283. * @since 0.7.0
  14284. * @category Number
  14285. * @param {number} [lower=0] The lower bound.
  14286. * @param {number} [upper=1] The upper bound.
  14287. * @param {boolean} [floating] Specify returning a floating-point number.
  14288. * @returns {number} Returns the random number.
  14289. * @example
  14290. *
  14291. * _.random(0, 5);
  14292. * // => an integer between 0 and 5
  14293. *
  14294. * _.random(5);
  14295. * // => also an integer between 0 and 5
  14296. *
  14297. * _.random(5, true);
  14298. * // => a floating-point number between 0 and 5
  14299. *
  14300. * _.random(1.2, 5.2);
  14301. * // => a floating-point number between 1.2 and 5.2
  14302. */
  14303. function random(lower, upper, floating) {
  14304. if (floating && typeof floating != 'boolean' && isIterateeCall(lower, upper, floating)) {
  14305. upper = floating = undefined;
  14306. }
  14307. if (floating === undefined) {
  14308. if (typeof upper == 'boolean') {
  14309. floating = upper;
  14310. upper = undefined;
  14311. }
  14312. else if (typeof lower == 'boolean') {
  14313. floating = lower;
  14314. lower = undefined;
  14315. }
  14316. }
  14317. if (lower === undefined && upper === undefined) {
  14318. lower = 0;
  14319. upper = 1;
  14320. }
  14321. else {
  14322. lower = toFinite(lower);
  14323. if (upper === undefined) {
  14324. upper = lower;
  14325. lower = 0;
  14326. } else {
  14327. upper = toFinite(upper);
  14328. }
  14329. }
  14330. if (lower > upper) {
  14331. var temp = lower;
  14332. lower = upper;
  14333. upper = temp;
  14334. }
  14335. if (floating || lower % 1 || upper % 1) {
  14336. var rand = nativeRandom();
  14337. return nativeMin(lower + (rand * (upper - lower + freeParseFloat('1e-' + ((rand + '').length - 1)))), upper);
  14338. }
  14339. return baseRandom(lower, upper);
  14340. }
  14341. /*------------------------------------------------------------------------*/
  14342. /**
  14343. * Converts `string` to [camel case](https://en.wikipedia.org/wiki/CamelCase).
  14344. *
  14345. * @static
  14346. * @memberOf _
  14347. * @since 3.0.0
  14348. * @category String
  14349. * @param {string} [string=''] The string to convert.
  14350. * @returns {string} Returns the camel cased string.
  14351. * @example
  14352. *
  14353. * _.camelCase('Foo Bar');
  14354. * // => 'fooBar'
  14355. *
  14356. * _.camelCase('--foo-bar--');
  14357. * // => 'fooBar'
  14358. *
  14359. * _.camelCase('__FOO_BAR__');
  14360. * // => 'fooBar'
  14361. */
  14362. var camelCase = createCompounder(function(result, word, index) {
  14363. word = word.toLowerCase();
  14364. return result + (index ? capitalize(word) : word);
  14365. });
  14366. /**
  14367. * Converts the first character of `string` to upper case and the remaining
  14368. * to lower case.
  14369. *
  14370. * @static
  14371. * @memberOf _
  14372. * @since 3.0.0
  14373. * @category String
  14374. * @param {string} [string=''] The string to capitalize.
  14375. * @returns {string} Returns the capitalized string.
  14376. * @example
  14377. *
  14378. * _.capitalize('FRED');
  14379. * // => 'Fred'
  14380. */
  14381. function capitalize(string) {
  14382. return upperFirst(toString(string).toLowerCase());
  14383. }
  14384. /**
  14385. * Deburrs `string` by converting
  14386. * [Latin-1 Supplement](https://en.wikipedia.org/wiki/Latin-1_Supplement_(Unicode_block)#Character_table)
  14387. * and [Latin Extended-A](https://en.wikipedia.org/wiki/Latin_Extended-A)
  14388. * letters to basic Latin letters and removing
  14389. * [combining diacritical marks](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks).
  14390. *
  14391. * @static
  14392. * @memberOf _
  14393. * @since 3.0.0
  14394. * @category String
  14395. * @param {string} [string=''] The string to deburr.
  14396. * @returns {string} Returns the deburred string.
  14397. * @example
  14398. *
  14399. * _.deburr('déjà vu');
  14400. * // => 'deja vu'
  14401. */
  14402. function deburr(string) {
  14403. string = toString(string);
  14404. return string && string.replace(reLatin, deburrLetter).replace(reComboMark, '');
  14405. }
  14406. /**
  14407. * Checks if `string` ends with the given target string.
  14408. *
  14409. * @static
  14410. * @memberOf _
  14411. * @since 3.0.0
  14412. * @category String
  14413. * @param {string} [string=''] The string to inspect.
  14414. * @param {string} [target] The string to search for.
  14415. * @param {number} [position=string.length] The position to search up to.
  14416. * @returns {boolean} Returns `true` if `string` ends with `target`,
  14417. * else `false`.
  14418. * @example
  14419. *
  14420. * _.endsWith('abc', 'c');
  14421. * // => true
  14422. *
  14423. * _.endsWith('abc', 'b');
  14424. * // => false
  14425. *
  14426. * _.endsWith('abc', 'b', 2);
  14427. * // => true
  14428. */
  14429. function endsWith(string, target, position) {
  14430. string = toString(string);
  14431. target = baseToString(target);
  14432. var length = string.length;
  14433. position = position === undefined
  14434. ? length
  14435. : baseClamp(toInteger(position), 0, length);
  14436. var end = position;
  14437. position -= target.length;
  14438. return position >= 0 && string.slice(position, end) == target;
  14439. }
  14440. /**
  14441. * Converts the characters "&", "<", ">", '"', and "'" in `string` to their
  14442. * corresponding HTML entities.
  14443. *
  14444. * **Note:** No other characters are escaped. To escape additional
  14445. * characters use a third-party library like [_he_](https://mths.be/he).
  14446. *
  14447. * Though the ">" character is escaped for symmetry, characters like
  14448. * ">" and "/" don't need escaping in HTML and have no special meaning
  14449. * unless they're part of a tag or unquoted attribute value. See
  14450. * [Mathias Bynens's article](https://mathiasbynens.be/notes/ambiguous-ampersands)
  14451. * (under "semi-related fun fact") for more details.
  14452. *
  14453. * When working with HTML you should always
  14454. * [quote attribute values](http://wonko.com/post/html-escaping) to reduce
  14455. * XSS vectors.
  14456. *
  14457. * @static
  14458. * @since 0.1.0
  14459. * @memberOf _
  14460. * @category String
  14461. * @param {string} [string=''] The string to escape.
  14462. * @returns {string} Returns the escaped string.
  14463. * @example
  14464. *
  14465. * _.escape('fred, barney, & pebbles');
  14466. * // => 'fred, barney, &amp; pebbles'
  14467. */
  14468. function escape(string) {
  14469. string = toString(string);
  14470. return (string && reHasUnescapedHtml.test(string))
  14471. ? string.replace(reUnescapedHtml, escapeHtmlChar)
  14472. : string;
  14473. }
  14474. /**
  14475. * Escapes the `RegExp` special characters "^", "$", "\", ".", "*", "+",
  14476. * "?", "(", ")", "[", "]", "{", "}", and "|" in `string`.
  14477. *
  14478. * @static
  14479. * @memberOf _
  14480. * @since 3.0.0
  14481. * @category String
  14482. * @param {string} [string=''] The string to escape.
  14483. * @returns {string} Returns the escaped string.
  14484. * @example
  14485. *
  14486. * _.escapeRegExp('[lodash](https://lodash.com/)');
  14487. * // => '\[lodash\]\(https://lodash\.com/\)'
  14488. */
  14489. function escapeRegExp(string) {
  14490. string = toString(string);
  14491. return (string && reHasRegExpChar.test(string))
  14492. ? string.replace(reRegExpChar, '\\$&')
  14493. : string;
  14494. }
  14495. /**
  14496. * Converts `string` to
  14497. * [kebab case](https://en.wikipedia.org/wiki/Letter_case#Special_case_styles).
  14498. *
  14499. * @static
  14500. * @memberOf _
  14501. * @since 3.0.0
  14502. * @category String
  14503. * @param {string} [string=''] The string to convert.
  14504. * @returns {string} Returns the kebab cased string.
  14505. * @example
  14506. *
  14507. * _.kebabCase('Foo Bar');
  14508. * // => 'foo-bar'
  14509. *
  14510. * _.kebabCase('fooBar');
  14511. * // => 'foo-bar'
  14512. *
  14513. * _.kebabCase('__FOO_BAR__');
  14514. * // => 'foo-bar'
  14515. */
  14516. var kebabCase = createCompounder(function(result, word, index) {
  14517. return result + (index ? '-' : '') + word.toLowerCase();
  14518. });
  14519. /**
  14520. * Converts `string`, as space separated words, to lower case.
  14521. *
  14522. * @static
  14523. * @memberOf _
  14524. * @since 4.0.0
  14525. * @category String
  14526. * @param {string} [string=''] The string to convert.
  14527. * @returns {string} Returns the lower cased string.
  14528. * @example
  14529. *
  14530. * _.lowerCase('--Foo-Bar--');
  14531. * // => 'foo bar'
  14532. *
  14533. * _.lowerCase('fooBar');
  14534. * // => 'foo bar'
  14535. *
  14536. * _.lowerCase('__FOO_BAR__');
  14537. * // => 'foo bar'
  14538. */
  14539. var lowerCase = createCompounder(function(result, word, index) {
  14540. return result + (index ? ' ' : '') + word.toLowerCase();
  14541. });
  14542. /**
  14543. * Converts the first character of `string` to lower case.
  14544. *
  14545. * @static
  14546. * @memberOf _
  14547. * @since 4.0.0
  14548. * @category String
  14549. * @param {string} [string=''] The string to convert.
  14550. * @returns {string} Returns the converted string.
  14551. * @example
  14552. *
  14553. * _.lowerFirst('Fred');
  14554. * // => 'fred'
  14555. *
  14556. * _.lowerFirst('FRED');
  14557. * // => 'fRED'
  14558. */
  14559. var lowerFirst = createCaseFirst('toLowerCase');
  14560. /**
  14561. * Pads `string` on the left and right sides if it's shorter than `length`.
  14562. * Padding characters are truncated if they can't be evenly divided by `length`.
  14563. *
  14564. * @static
  14565. * @memberOf _
  14566. * @since 3.0.0
  14567. * @category String
  14568. * @param {string} [string=''] The string to pad.
  14569. * @param {number} [length=0] The padding length.
  14570. * @param {string} [chars=' '] The string used as padding.
  14571. * @returns {string} Returns the padded string.
  14572. * @example
  14573. *
  14574. * _.pad('abc', 8);
  14575. * // => ' abc '
  14576. *
  14577. * _.pad('abc', 8, '_-');
  14578. * // => '_-abc_-_'
  14579. *
  14580. * _.pad('abc', 3);
  14581. * // => 'abc'
  14582. */
  14583. function pad(string, length, chars) {
  14584. string = toString(string);
  14585. length = toInteger(length);
  14586. var strLength = length ? stringSize(string) : 0;
  14587. if (!length || strLength >= length) {
  14588. return string;
  14589. }
  14590. var mid = (length - strLength) / 2;
  14591. return (
  14592. createPadding(nativeFloor(mid), chars) +
  14593. string +
  14594. createPadding(nativeCeil(mid), chars)
  14595. );
  14596. }
  14597. /**
  14598. * Pads `string` on the right side if it's shorter than `length`. Padding
  14599. * characters are truncated if they exceed `length`.
  14600. *
  14601. * @static
  14602. * @memberOf _
  14603. * @since 4.0.0
  14604. * @category String
  14605. * @param {string} [string=''] The string to pad.
  14606. * @param {number} [length=0] The padding length.
  14607. * @param {string} [chars=' '] The string used as padding.
  14608. * @returns {string} Returns the padded string.
  14609. * @example
  14610. *
  14611. * _.padEnd('abc', 6);
  14612. * // => 'abc '
  14613. *
  14614. * _.padEnd('abc', 6, '_-');
  14615. * // => 'abc_-_'
  14616. *
  14617. * _.padEnd('abc', 3);
  14618. * // => 'abc'
  14619. */
  14620. function padEnd(string, length, chars) {
  14621. string = toString(string);
  14622. length = toInteger(length);
  14623. var strLength = length ? stringSize(string) : 0;
  14624. return (length && strLength < length)
  14625. ? (string + createPadding(length - strLength, chars))
  14626. : string;
  14627. }
  14628. /**
  14629. * Pads `string` on the left side if it's shorter than `length`. Padding
  14630. * characters are truncated if they exceed `length`.
  14631. *
  14632. * @static
  14633. * @memberOf _
  14634. * @since 4.0.0
  14635. * @category String
  14636. * @param {string} [string=''] The string to pad.
  14637. * @param {number} [length=0] The padding length.
  14638. * @param {string} [chars=' '] The string used as padding.
  14639. * @returns {string} Returns the padded string.
  14640. * @example
  14641. *
  14642. * _.padStart('abc', 6);
  14643. * // => ' abc'
  14644. *
  14645. * _.padStart('abc', 6, '_-');
  14646. * // => '_-_abc'
  14647. *
  14648. * _.padStart('abc', 3);
  14649. * // => 'abc'
  14650. */
  14651. function padStart(string, length, chars) {
  14652. string = toString(string);
  14653. length = toInteger(length);
  14654. var strLength = length ? stringSize(string) : 0;
  14655. return (length && strLength < length)
  14656. ? (createPadding(length - strLength, chars) + string)
  14657. : string;
  14658. }
  14659. /**
  14660. * Converts `string` to an integer of the specified radix. If `radix` is
  14661. * `undefined` or `0`, a `radix` of `10` is used unless `value` is a
  14662. * hexadecimal, in which case a `radix` of `16` is used.
  14663. *
  14664. * **Note:** This method aligns with the
  14665. * [ES5 implementation](https://es5.github.io/#x15.1.2.2) of `parseInt`.
  14666. *
  14667. * @static
  14668. * @memberOf _
  14669. * @since 1.1.0
  14670. * @category String
  14671. * @param {string} string The string to convert.
  14672. * @param {number} [radix=10] The radix to interpret `value` by.
  14673. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  14674. * @returns {number} Returns the converted integer.
  14675. * @example
  14676. *
  14677. * _.parseInt('08');
  14678. * // => 8
  14679. *
  14680. * _.map(['6', '08', '10'], _.parseInt);
  14681. * // => [6, 8, 10]
  14682. */
  14683. function parseInt(string, radix, guard) {
  14684. if (guard || radix == null) {
  14685. radix = 0;
  14686. } else if (radix) {
  14687. radix = +radix;
  14688. }
  14689. return nativeParseInt(toString(string).replace(reTrimStart, ''), radix || 0);
  14690. }
  14691. /**
  14692. * Repeats the given string `n` times.
  14693. *
  14694. * @static
  14695. * @memberOf _
  14696. * @since 3.0.0
  14697. * @category String
  14698. * @param {string} [string=''] The string to repeat.
  14699. * @param {number} [n=1] The number of times to repeat the string.
  14700. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  14701. * @returns {string} Returns the repeated string.
  14702. * @example
  14703. *
  14704. * _.repeat('*', 3);
  14705. * // => '***'
  14706. *
  14707. * _.repeat('abc', 2);
  14708. * // => 'abcabc'
  14709. *
  14710. * _.repeat('abc', 0);
  14711. * // => ''
  14712. */
  14713. function repeat(string, n, guard) {
  14714. if ((guard ? isIterateeCall(string, n, guard) : n === undefined)) {
  14715. n = 1;
  14716. } else {
  14717. n = toInteger(n);
  14718. }
  14719. return baseRepeat(toString(string), n);
  14720. }
  14721. /**
  14722. * Replaces matches for `pattern` in `string` with `replacement`.
  14723. *
  14724. * **Note:** This method is based on
  14725. * [`String#replace`](https://mdn.io/String/replace).
  14726. *
  14727. * @static
  14728. * @memberOf _
  14729. * @since 4.0.0
  14730. * @category String
  14731. * @param {string} [string=''] The string to modify.
  14732. * @param {RegExp|string} pattern The pattern to replace.
  14733. * @param {Function|string} replacement The match replacement.
  14734. * @returns {string} Returns the modified string.
  14735. * @example
  14736. *
  14737. * _.replace('Hi Fred', 'Fred', 'Barney');
  14738. * // => 'Hi Barney'
  14739. */
  14740. function replace() {
  14741. var args = arguments,
  14742. string = toString(args[0]);
  14743. return args.length < 3 ? string : string.replace(args[1], args[2]);
  14744. }
  14745. /**
  14746. * Converts `string` to
  14747. * [snake case](https://en.wikipedia.org/wiki/Snake_case).
  14748. *
  14749. * @static
  14750. * @memberOf _
  14751. * @since 3.0.0
  14752. * @category String
  14753. * @param {string} [string=''] The string to convert.
  14754. * @returns {string} Returns the snake cased string.
  14755. * @example
  14756. *
  14757. * _.snakeCase('Foo Bar');
  14758. * // => 'foo_bar'
  14759. *
  14760. * _.snakeCase('fooBar');
  14761. * // => 'foo_bar'
  14762. *
  14763. * _.snakeCase('--FOO-BAR--');
  14764. * // => 'foo_bar'
  14765. */
  14766. var snakeCase = createCompounder(function(result, word, index) {
  14767. return result + (index ? '_' : '') + word.toLowerCase();
  14768. });
  14769. /**
  14770. * Splits `string` by `separator`.
  14771. *
  14772. * **Note:** This method is based on
  14773. * [`String#split`](https://mdn.io/String/split).
  14774. *
  14775. * @static
  14776. * @memberOf _
  14777. * @since 4.0.0
  14778. * @category String
  14779. * @param {string} [string=''] The string to split.
  14780. * @param {RegExp|string} separator The separator pattern to split by.
  14781. * @param {number} [limit] The length to truncate results to.
  14782. * @returns {Array} Returns the string segments.
  14783. * @example
  14784. *
  14785. * _.split('a-b-c', '-', 2);
  14786. * // => ['a', 'b']
  14787. */
  14788. function split(string, separator, limit) {
  14789. if (limit && typeof limit != 'number' && isIterateeCall(string, separator, limit)) {
  14790. separator = limit = undefined;
  14791. }
  14792. limit = limit === undefined ? MAX_ARRAY_LENGTH : limit >>> 0;
  14793. if (!limit) {
  14794. return [];
  14795. }
  14796. string = toString(string);
  14797. if (string && (
  14798. typeof separator == 'string' ||
  14799. (separator != null && !isRegExp(separator))
  14800. )) {
  14801. separator = baseToString(separator);
  14802. if (!separator && hasUnicode(string)) {
  14803. return castSlice(stringToArray(string), 0, limit);
  14804. }
  14805. }
  14806. return string.split(separator, limit);
  14807. }
  14808. /**
  14809. * Converts `string` to
  14810. * [start case](https://en.wikipedia.org/wiki/Letter_case#Stylistic_or_specialised_usage).
  14811. *
  14812. * @static
  14813. * @memberOf _
  14814. * @since 3.1.0
  14815. * @category String
  14816. * @param {string} [string=''] The string to convert.
  14817. * @returns {string} Returns the start cased string.
  14818. * @example
  14819. *
  14820. * _.startCase('--foo-bar--');
  14821. * // => 'Foo Bar'
  14822. *
  14823. * _.startCase('fooBar');
  14824. * // => 'Foo Bar'
  14825. *
  14826. * _.startCase('__FOO_BAR__');
  14827. * // => 'FOO BAR'
  14828. */
  14829. var startCase = createCompounder(function(result, word, index) {
  14830. return result + (index ? ' ' : '') + upperFirst(word);
  14831. });
  14832. /**
  14833. * Checks if `string` starts with the given target string.
  14834. *
  14835. * @static
  14836. * @memberOf _
  14837. * @since 3.0.0
  14838. * @category String
  14839. * @param {string} [string=''] The string to inspect.
  14840. * @param {string} [target] The string to search for.
  14841. * @param {number} [position=0] The position to search from.
  14842. * @returns {boolean} Returns `true` if `string` starts with `target`,
  14843. * else `false`.
  14844. * @example
  14845. *
  14846. * _.startsWith('abc', 'a');
  14847. * // => true
  14848. *
  14849. * _.startsWith('abc', 'b');
  14850. * // => false
  14851. *
  14852. * _.startsWith('abc', 'b', 1);
  14853. * // => true
  14854. */
  14855. function startsWith(string, target, position) {
  14856. string = toString(string);
  14857. position = position == null
  14858. ? 0
  14859. : baseClamp(toInteger(position), 0, string.length);
  14860. target = baseToString(target);
  14861. return string.slice(position, position + target.length) == target;
  14862. }
  14863. /**
  14864. * Creates a compiled template function that can interpolate data properties
  14865. * in "interpolate" delimiters, HTML-escape interpolated data properties in
  14866. * "escape" delimiters, and execute JavaScript in "evaluate" delimiters. Data
  14867. * properties may be accessed as free variables in the template. If a setting
  14868. * object is given, it takes precedence over `_.templateSettings` values.
  14869. *
  14870. * **Note:** In the development build `_.template` utilizes
  14871. * [sourceURLs](http://www.html5rocks.com/en/tutorials/developertools/sourcemaps/#toc-sourceurl)
  14872. * for easier debugging.
  14873. *
  14874. * For more information on precompiling templates see
  14875. * [lodash's custom builds documentation](https://lodash.com/custom-builds).
  14876. *
  14877. * For more information on Chrome extension sandboxes see
  14878. * [Chrome's extensions documentation](https://developer.chrome.com/extensions/sandboxingEval).
  14879. *
  14880. * @static
  14881. * @since 0.1.0
  14882. * @memberOf _
  14883. * @category String
  14884. * @param {string} [string=''] The template string.
  14885. * @param {Object} [options={}] The options object.
  14886. * @param {RegExp} [options.escape=_.templateSettings.escape]
  14887. * The HTML "escape" delimiter.
  14888. * @param {RegExp} [options.evaluate=_.templateSettings.evaluate]
  14889. * The "evaluate" delimiter.
  14890. * @param {Object} [options.imports=_.templateSettings.imports]
  14891. * An object to import into the template as free variables.
  14892. * @param {RegExp} [options.interpolate=_.templateSettings.interpolate]
  14893. * The "interpolate" delimiter.
  14894. * @param {string} [options.sourceURL='lodash.templateSources[n]']
  14895. * The sourceURL of the compiled template.
  14896. * @param {string} [options.variable='obj']
  14897. * The data object variable name.
  14898. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  14899. * @returns {Function} Returns the compiled template function.
  14900. * @example
  14901. *
  14902. * // Use the "interpolate" delimiter to create a compiled template.
  14903. * var compiled = _.template('hello <%= user %>!');
  14904. * compiled({ 'user': 'fred' });
  14905. * // => 'hello fred!'
  14906. *
  14907. * // Use the HTML "escape" delimiter to escape data property values.
  14908. * var compiled = _.template('<b><%- value %></b>');
  14909. * compiled({ 'value': '<script>' });
  14910. * // => '<b>&lt;script&gt;</b>'
  14911. *
  14912. * // Use the "evaluate" delimiter to execute JavaScript and generate HTML.
  14913. * var compiled = _.template('<% _.forEach(users, function(user) { %><li><%- user %></li><% }); %>');
  14914. * compiled({ 'users': ['fred', 'barney'] });
  14915. * // => '<li>fred</li><li>barney</li>'
  14916. *
  14917. * // Use the internal `print` function in "evaluate" delimiters.
  14918. * var compiled = _.template('<% print("hello " + user); %>!');
  14919. * compiled({ 'user': 'barney' });
  14920. * // => 'hello barney!'
  14921. *
  14922. * // Use the ES template literal delimiter as an "interpolate" delimiter.
  14923. * // Disable support by replacing the "interpolate" delimiter.
  14924. * var compiled = _.template('hello ${ user }!');
  14925. * compiled({ 'user': 'pebbles' });
  14926. * // => 'hello pebbles!'
  14927. *
  14928. * // Use backslashes to treat delimiters as plain text.
  14929. * var compiled = _.template('<%= "\\<%- value %\\>" %>');
  14930. * compiled({ 'value': 'ignored' });
  14931. * // => '<%- value %>'
  14932. *
  14933. * // Use the `imports` option to import `jQuery` as `jq`.
  14934. * var text = '<% jq.each(users, function(user) { %><li><%- user %></li><% }); %>';
  14935. * var compiled = _.template(text, { 'imports': { 'jq': jQuery } });
  14936. * compiled({ 'users': ['fred', 'barney'] });
  14937. * // => '<li>fred</li><li>barney</li>'
  14938. *
  14939. * // Use the `sourceURL` option to specify a custom sourceURL for the template.
  14940. * var compiled = _.template('hello <%= user %>!', { 'sourceURL': '/basic/greeting.jst' });
  14941. * compiled(data);
  14942. * // => Find the source of "greeting.jst" under the Sources tab or Resources panel of the web inspector.
  14943. *
  14944. * // Use the `variable` option to ensure a with-statement isn't used in the compiled template.
  14945. * var compiled = _.template('hi <%= data.user %>!', { 'variable': 'data' });
  14946. * compiled.source;
  14947. * // => function(data) {
  14948. * // var __t, __p = '';
  14949. * // __p += 'hi ' + ((__t = ( data.user )) == null ? '' : __t) + '!';
  14950. * // return __p;
  14951. * // }
  14952. *
  14953. * // Use custom template delimiters.
  14954. * _.templateSettings.interpolate = /{{([\s\S]+?)}}/g;
  14955. * var compiled = _.template('hello {{ user }}!');
  14956. * compiled({ 'user': 'mustache' });
  14957. * // => 'hello mustache!'
  14958. *
  14959. * // Use the `source` property to inline compiled templates for meaningful
  14960. * // line numbers in error messages and stack traces.
  14961. * fs.writeFileSync(path.join(process.cwd(), 'jst.js'), '\
  14962. * var JST = {\
  14963. * "main": ' + _.template(mainText).source + '\
  14964. * };\
  14965. * ');
  14966. */
  14967. function template(string, options, guard) {
  14968. // Based on John Resig's `tmpl` implementation
  14969. // (http://ejohn.org/blog/javascript-micro-templating/)
  14970. // and Laura Doktorova's doT.js (https://github.com/olado/doT).
  14971. var settings = lodash.templateSettings;
  14972. if (guard && isIterateeCall(string, options, guard)) {
  14973. options = undefined;
  14974. }
  14975. string = toString(string);
  14976. options = assignInWith({}, options, settings, customDefaultsAssignIn);
  14977. var imports = assignInWith({}, options.imports, settings.imports, customDefaultsAssignIn),
  14978. importsKeys = keys(imports),
  14979. importsValues = baseValues(imports, importsKeys);
  14980. var isEscaping,
  14981. isEvaluating,
  14982. index = 0,
  14983. interpolate = options.interpolate || reNoMatch,
  14984. source = "__p += '";
  14985. // Compile the regexp to match each delimiter.
  14986. var reDelimiters = RegExp(
  14987. (options.escape || reNoMatch).source + '|' +
  14988. interpolate.source + '|' +
  14989. (interpolate === reInterpolate ? reEsTemplate : reNoMatch).source + '|' +
  14990. (options.evaluate || reNoMatch).source + '|$'
  14991. , 'g');
  14992. // Use a sourceURL for easier debugging.
  14993. // The sourceURL gets injected into the source that's eval-ed, so be careful
  14994. // to normalize all kinds of whitespace, so e.g. newlines (and unicode versions of it) can't sneak in
  14995. // and escape the comment, thus injecting code that gets evaled.
  14996. var sourceURL = '//# sourceURL=' +
  14997. (hasOwnProperty.call(options, 'sourceURL')
  14998. ? (options.sourceURL + '').replace(/\s/g, ' ')
  14999. : ('lodash.templateSources[' + (++templateCounter) + ']')
  15000. ) + '\n';
  15001. string.replace(reDelimiters, function(match, escapeValue, interpolateValue, esTemplateValue, evaluateValue, offset) {
  15002. interpolateValue || (interpolateValue = esTemplateValue);
  15003. // Escape characters that can't be included in string literals.
  15004. source += string.slice(index, offset).replace(reUnescapedString, escapeStringChar);
  15005. // Replace delimiters with snippets.
  15006. if (escapeValue) {
  15007. isEscaping = true;
  15008. source += "' +\n__e(" + escapeValue + ") +\n'";
  15009. }
  15010. if (evaluateValue) {
  15011. isEvaluating = true;
  15012. source += "';\n" + evaluateValue + ";\n__p += '";
  15013. }
  15014. if (interpolateValue) {
  15015. source += "' +\n((__t = (" + interpolateValue + ")) == null ? '' : __t) +\n'";
  15016. }
  15017. index = offset + match.length;
  15018. // The JS engine embedded in Adobe products needs `match` returned in
  15019. // order to produce the correct `offset` value.
  15020. return match;
  15021. });
  15022. source += "';\n";
  15023. // If `variable` is not specified wrap a with-statement around the generated
  15024. // code to add the data object to the top of the scope chain.
  15025. var variable = hasOwnProperty.call(options, 'variable') && options.variable;
  15026. if (!variable) {
  15027. source = 'with (obj) {\n' + source + '\n}\n';
  15028. }
  15029. // Throw an error if a forbidden character was found in `variable`, to prevent
  15030. // potential command injection attacks.
  15031. else if (reForbiddenIdentifierChars.test(variable)) {
  15032. throw new Error(INVALID_TEMPL_VAR_ERROR_TEXT);
  15033. }
  15034. // Cleanup code by stripping empty strings.
  15035. source = (isEvaluating ? source.replace(reEmptyStringLeading, '') : source)
  15036. .replace(reEmptyStringMiddle, '$1')
  15037. .replace(reEmptyStringTrailing, '$1;');
  15038. // Frame code as the function body.
  15039. source = 'function(' + (variable || 'obj') + ') {\n' +
  15040. (variable
  15041. ? ''
  15042. : 'obj || (obj = {});\n'
  15043. ) +
  15044. "var __t, __p = ''" +
  15045. (isEscaping
  15046. ? ', __e = _.escape'
  15047. : ''
  15048. ) +
  15049. (isEvaluating
  15050. ? ', __j = Array.prototype.join;\n' +
  15051. "function print() { __p += __j.call(arguments, '') }\n"
  15052. : ';\n'
  15053. ) +
  15054. source +
  15055. 'return __p\n}';
  15056. var result = attempt(function() {
  15057. return Function(importsKeys, sourceURL + 'return ' + source)
  15058. .apply(undefined, importsValues);
  15059. });
  15060. // Provide the compiled function's source by its `toString` method or
  15061. // the `source` property as a convenience for inlining compiled templates.
  15062. result.source = source;
  15063. if (isError(result)) {
  15064. throw result;
  15065. }
  15066. return result;
  15067. }
  15068. /**
  15069. * Converts `string`, as a whole, to lower case just like
  15070. * [String#toLowerCase](https://mdn.io/toLowerCase).
  15071. *
  15072. * @static
  15073. * @memberOf _
  15074. * @since 4.0.0
  15075. * @category String
  15076. * @param {string} [string=''] The string to convert.
  15077. * @returns {string} Returns the lower cased string.
  15078. * @example
  15079. *
  15080. * _.toLower('--Foo-Bar--');
  15081. * // => '--foo-bar--'
  15082. *
  15083. * _.toLower('fooBar');
  15084. * // => 'foobar'
  15085. *
  15086. * _.toLower('__FOO_BAR__');
  15087. * // => '__foo_bar__'
  15088. */
  15089. function toLower(value) {
  15090. return toString(value).toLowerCase();
  15091. }
  15092. /**
  15093. * Converts `string`, as a whole, to upper case just like
  15094. * [String#toUpperCase](https://mdn.io/toUpperCase).
  15095. *
  15096. * @static
  15097. * @memberOf _
  15098. * @since 4.0.0
  15099. * @category String
  15100. * @param {string} [string=''] The string to convert.
  15101. * @returns {string} Returns the upper cased string.
  15102. * @example
  15103. *
  15104. * _.toUpper('--foo-bar--');
  15105. * // => '--FOO-BAR--'
  15106. *
  15107. * _.toUpper('fooBar');
  15108. * // => 'FOOBAR'
  15109. *
  15110. * _.toUpper('__foo_bar__');
  15111. * // => '__FOO_BAR__'
  15112. */
  15113. function toUpper(value) {
  15114. return toString(value).toUpperCase();
  15115. }
  15116. /**
  15117. * Removes leading and trailing whitespace or specified characters from `string`.
  15118. *
  15119. * @static
  15120. * @memberOf _
  15121. * @since 3.0.0
  15122. * @category String
  15123. * @param {string} [string=''] The string to trim.
  15124. * @param {string} [chars=whitespace] The characters to trim.
  15125. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  15126. * @returns {string} Returns the trimmed string.
  15127. * @example
  15128. *
  15129. * _.trim(' abc ');
  15130. * // => 'abc'
  15131. *
  15132. * _.trim('-_-abc-_-', '_-');
  15133. * // => 'abc'
  15134. *
  15135. * _.map([' foo ', ' bar '], _.trim);
  15136. * // => ['foo', 'bar']
  15137. */
  15138. function trim(string, chars, guard) {
  15139. string = toString(string);
  15140. if (string && (guard || chars === undefined)) {
  15141. return baseTrim(string);
  15142. }
  15143. if (!string || !(chars = baseToString(chars))) {
  15144. return string;
  15145. }
  15146. var strSymbols = stringToArray(string),
  15147. chrSymbols = stringToArray(chars),
  15148. start = charsStartIndex(strSymbols, chrSymbols),
  15149. end = charsEndIndex(strSymbols, chrSymbols) + 1;
  15150. return castSlice(strSymbols, start, end).join('');
  15151. }
  15152. /**
  15153. * Removes trailing whitespace or specified characters from `string`.
  15154. *
  15155. * @static
  15156. * @memberOf _
  15157. * @since 4.0.0
  15158. * @category String
  15159. * @param {string} [string=''] The string to trim.
  15160. * @param {string} [chars=whitespace] The characters to trim.
  15161. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  15162. * @returns {string} Returns the trimmed string.
  15163. * @example
  15164. *
  15165. * _.trimEnd(' abc ');
  15166. * // => ' abc'
  15167. *
  15168. * _.trimEnd('-_-abc-_-', '_-');
  15169. * // => '-_-abc'
  15170. */
  15171. function trimEnd(string, chars, guard) {
  15172. string = toString(string);
  15173. if (string && (guard || chars === undefined)) {
  15174. return string.slice(0, trimmedEndIndex(string) + 1);
  15175. }
  15176. if (!string || !(chars = baseToString(chars))) {
  15177. return string;
  15178. }
  15179. var strSymbols = stringToArray(string),
  15180. end = charsEndIndex(strSymbols, stringToArray(chars)) + 1;
  15181. return castSlice(strSymbols, 0, end).join('');
  15182. }
  15183. /**
  15184. * Removes leading whitespace or specified characters from `string`.
  15185. *
  15186. * @static
  15187. * @memberOf _
  15188. * @since 4.0.0
  15189. * @category String
  15190. * @param {string} [string=''] The string to trim.
  15191. * @param {string} [chars=whitespace] The characters to trim.
  15192. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  15193. * @returns {string} Returns the trimmed string.
  15194. * @example
  15195. *
  15196. * _.trimStart(' abc ');
  15197. * // => 'abc '
  15198. *
  15199. * _.trimStart('-_-abc-_-', '_-');
  15200. * // => 'abc-_-'
  15201. */
  15202. function trimStart(string, chars, guard) {
  15203. string = toString(string);
  15204. if (string && (guard || chars === undefined)) {
  15205. return string.replace(reTrimStart, '');
  15206. }
  15207. if (!string || !(chars = baseToString(chars))) {
  15208. return string;
  15209. }
  15210. var strSymbols = stringToArray(string),
  15211. start = charsStartIndex(strSymbols, stringToArray(chars));
  15212. return castSlice(strSymbols, start).join('');
  15213. }
  15214. /**
  15215. * Truncates `string` if it's longer than the given maximum string length.
  15216. * The last characters of the truncated string are replaced with the omission
  15217. * string which defaults to "...".
  15218. *
  15219. * @static
  15220. * @memberOf _
  15221. * @since 4.0.0
  15222. * @category String
  15223. * @param {string} [string=''] The string to truncate.
  15224. * @param {Object} [options={}] The options object.
  15225. * @param {number} [options.length=30] The maximum string length.
  15226. * @param {string} [options.omission='...'] The string to indicate text is omitted.
  15227. * @param {RegExp|string} [options.separator] The separator pattern to truncate to.
  15228. * @returns {string} Returns the truncated string.
  15229. * @example
  15230. *
  15231. * _.truncate('hi-diddly-ho there, neighborino');
  15232. * // => 'hi-diddly-ho there, neighbo...'
  15233. *
  15234. * _.truncate('hi-diddly-ho there, neighborino', {
  15235. * 'length': 24,
  15236. * 'separator': ' '
  15237. * });
  15238. * // => 'hi-diddly-ho there,...'
  15239. *
  15240. * _.truncate('hi-diddly-ho there, neighborino', {
  15241. * 'length': 24,
  15242. * 'separator': /,? +/
  15243. * });
  15244. * // => 'hi-diddly-ho there...'
  15245. *
  15246. * _.truncate('hi-diddly-ho there, neighborino', {
  15247. * 'omission': ' [...]'
  15248. * });
  15249. * // => 'hi-diddly-ho there, neig [...]'
  15250. */
  15251. function truncate(string, options) {
  15252. var length = DEFAULT_TRUNC_LENGTH,
  15253. omission = DEFAULT_TRUNC_OMISSION;
  15254. if (isObject(options)) {
  15255. var separator = 'separator' in options ? options.separator : separator;
  15256. length = 'length' in options ? toInteger(options.length) : length;
  15257. omission = 'omission' in options ? baseToString(options.omission) : omission;
  15258. }
  15259. string = toString(string);
  15260. var strLength = string.length;
  15261. if (hasUnicode(string)) {
  15262. var strSymbols = stringToArray(string);
  15263. strLength = strSymbols.length;
  15264. }
  15265. if (length >= strLength) {
  15266. return string;
  15267. }
  15268. var end = length - stringSize(omission);
  15269. if (end < 1) {
  15270. return omission;
  15271. }
  15272. var result = strSymbols
  15273. ? castSlice(strSymbols, 0, end).join('')
  15274. : string.slice(0, end);
  15275. if (separator === undefined) {
  15276. return result + omission;
  15277. }
  15278. if (strSymbols) {
  15279. end += (result.length - end);
  15280. }
  15281. if (isRegExp(separator)) {
  15282. if (string.slice(end).search(separator)) {
  15283. var match,
  15284. substring = result;
  15285. if (!separator.global) {
  15286. separator = RegExp(separator.source, toString(reFlags.exec(separator)) + 'g');
  15287. }
  15288. separator.lastIndex = 0;
  15289. while ((match = separator.exec(substring))) {
  15290. var newEnd = match.index;
  15291. }
  15292. result = result.slice(0, newEnd === undefined ? end : newEnd);
  15293. }
  15294. } else if (string.indexOf(baseToString(separator), end) != end) {
  15295. var index = result.lastIndexOf(separator);
  15296. if (index > -1) {
  15297. result = result.slice(0, index);
  15298. }
  15299. }
  15300. return result + omission;
  15301. }
  15302. /**
  15303. * The inverse of `_.escape`; this method converts the HTML entities
  15304. * `&amp;`, `&lt;`, `&gt;`, `&quot;`, and `&#39;` in `string` to
  15305. * their corresponding characters.
  15306. *
  15307. * **Note:** No other HTML entities are unescaped. To unescape additional
  15308. * HTML entities use a third-party library like [_he_](https://mths.be/he).
  15309. *
  15310. * @static
  15311. * @memberOf _
  15312. * @since 0.6.0
  15313. * @category String
  15314. * @param {string} [string=''] The string to unescape.
  15315. * @returns {string} Returns the unescaped string.
  15316. * @example
  15317. *
  15318. * _.unescape('fred, barney, &amp; pebbles');
  15319. * // => 'fred, barney, & pebbles'
  15320. */
  15321. function unescape(string) {
  15322. string = toString(string);
  15323. return (string && reHasEscapedHtml.test(string))
  15324. ? string.replace(reEscapedHtml, unescapeHtmlChar)
  15325. : string;
  15326. }
  15327. /**
  15328. * Converts `string`, as space separated words, to upper case.
  15329. *
  15330. * @static
  15331. * @memberOf _
  15332. * @since 4.0.0
  15333. * @category String
  15334. * @param {string} [string=''] The string to convert.
  15335. * @returns {string} Returns the upper cased string.
  15336. * @example
  15337. *
  15338. * _.upperCase('--foo-bar');
  15339. * // => 'FOO BAR'
  15340. *
  15341. * _.upperCase('fooBar');
  15342. * // => 'FOO BAR'
  15343. *
  15344. * _.upperCase('__foo_bar__');
  15345. * // => 'FOO BAR'
  15346. */
  15347. var upperCase = createCompounder(function(result, word, index) {
  15348. return result + (index ? ' ' : '') + word.toUpperCase();
  15349. });
  15350. /**
  15351. * Converts the first character of `string` to upper case.
  15352. *
  15353. * @static
  15354. * @memberOf _
  15355. * @since 4.0.0
  15356. * @category String
  15357. * @param {string} [string=''] The string to convert.
  15358. * @returns {string} Returns the converted string.
  15359. * @example
  15360. *
  15361. * _.upperFirst('fred');
  15362. * // => 'Fred'
  15363. *
  15364. * _.upperFirst('FRED');
  15365. * // => 'FRED'
  15366. */
  15367. var upperFirst = createCaseFirst('toUpperCase');
  15368. /**
  15369. * Splits `string` into an array of its words.
  15370. *
  15371. * @static
  15372. * @memberOf _
  15373. * @since 3.0.0
  15374. * @category String
  15375. * @param {string} [string=''] The string to inspect.
  15376. * @param {RegExp|string} [pattern] The pattern to match words.
  15377. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  15378. * @returns {Array} Returns the words of `string`.
  15379. * @example
  15380. *
  15381. * _.words('fred, barney, & pebbles');
  15382. * // => ['fred', 'barney', 'pebbles']
  15383. *
  15384. * _.words('fred, barney, & pebbles', /[^, ]+/g);
  15385. * // => ['fred', 'barney', '&', 'pebbles']
  15386. */
  15387. function words(string, pattern, guard) {
  15388. string = toString(string);
  15389. pattern = guard ? undefined : pattern;
  15390. if (pattern === undefined) {
  15391. return hasUnicodeWord(string) ? unicodeWords(string) : asciiWords(string);
  15392. }
  15393. return string.match(pattern) || [];
  15394. }
  15395. /*------------------------------------------------------------------------*/
  15396. /**
  15397. * Attempts to invoke `func`, returning either the result or the caught error
  15398. * object. Any additional arguments are provided to `func` when it's invoked.
  15399. *
  15400. * @static
  15401. * @memberOf _
  15402. * @since 3.0.0
  15403. * @category Util
  15404. * @param {Function} func The function to attempt.
  15405. * @param {...*} [args] The arguments to invoke `func` with.
  15406. * @returns {*} Returns the `func` result or error object.
  15407. * @example
  15408. *
  15409. * // Avoid throwing errors for invalid selectors.
  15410. * var elements = _.attempt(function(selector) {
  15411. * return document.querySelectorAll(selector);
  15412. * }, '>_>');
  15413. *
  15414. * if (_.isError(elements)) {
  15415. * elements = [];
  15416. * }
  15417. */
  15418. var attempt = baseRest(function(func, args) {
  15419. try {
  15420. return apply(func, undefined, args);
  15421. } catch (e) {
  15422. return isError(e) ? e : new Error(e);
  15423. }
  15424. });
  15425. /**
  15426. * Binds methods of an object to the object itself, overwriting the existing
  15427. * method.
  15428. *
  15429. * **Note:** This method doesn't set the "length" property of bound functions.
  15430. *
  15431. * @static
  15432. * @since 0.1.0
  15433. * @memberOf _
  15434. * @category Util
  15435. * @param {Object} object The object to bind and assign the bound methods to.
  15436. * @param {...(string|string[])} methodNames The object method names to bind.
  15437. * @returns {Object} Returns `object`.
  15438. * @example
  15439. *
  15440. * var view = {
  15441. * 'label': 'docs',
  15442. * 'click': function() {
  15443. * console.log('clicked ' + this.label);
  15444. * }
  15445. * };
  15446. *
  15447. * _.bindAll(view, ['click']);
  15448. * jQuery(element).on('click', view.click);
  15449. * // => Logs 'clicked docs' when clicked.
  15450. */
  15451. var bindAll = flatRest(function(object, methodNames) {
  15452. arrayEach(methodNames, function(key) {
  15453. key = toKey(key);
  15454. baseAssignValue(object, key, bind(object[key], object));
  15455. });
  15456. return object;
  15457. });
  15458. /**
  15459. * Creates a function that iterates over `pairs` and invokes the corresponding
  15460. * function of the first predicate to return truthy. The predicate-function
  15461. * pairs are invoked with the `this` binding and arguments of the created
  15462. * function.
  15463. *
  15464. * @static
  15465. * @memberOf _
  15466. * @since 4.0.0
  15467. * @category Util
  15468. * @param {Array} pairs The predicate-function pairs.
  15469. * @returns {Function} Returns the new composite function.
  15470. * @example
  15471. *
  15472. * var func = _.cond([
  15473. * [_.matches({ 'a': 1 }), _.constant('matches A')],
  15474. * [_.conforms({ 'b': _.isNumber }), _.constant('matches B')],
  15475. * [_.stubTrue, _.constant('no match')]
  15476. * ]);
  15477. *
  15478. * func({ 'a': 1, 'b': 2 });
  15479. * // => 'matches A'
  15480. *
  15481. * func({ 'a': 0, 'b': 1 });
  15482. * // => 'matches B'
  15483. *
  15484. * func({ 'a': '1', 'b': '2' });
  15485. * // => 'no match'
  15486. */
  15487. function cond(pairs) {
  15488. var length = pairs == null ? 0 : pairs.length,
  15489. toIteratee = getIteratee();
  15490. pairs = !length ? [] : arrayMap(pairs, function(pair) {
  15491. if (typeof pair[1] != 'function') {
  15492. throw new TypeError(FUNC_ERROR_TEXT);
  15493. }
  15494. return [toIteratee(pair[0]), pair[1]];
  15495. });
  15496. return baseRest(function(args) {
  15497. var index = -1;
  15498. while (++index < length) {
  15499. var pair = pairs[index];
  15500. if (apply(pair[0], this, args)) {
  15501. return apply(pair[1], this, args);
  15502. }
  15503. }
  15504. });
  15505. }
  15506. /**
  15507. * Creates a function that invokes the predicate properties of `source` with
  15508. * the corresponding property values of a given object, returning `true` if
  15509. * all predicates return truthy, else `false`.
  15510. *
  15511. * **Note:** The created function is equivalent to `_.conformsTo` with
  15512. * `source` partially applied.
  15513. *
  15514. * @static
  15515. * @memberOf _
  15516. * @since 4.0.0
  15517. * @category Util
  15518. * @param {Object} source The object of property predicates to conform to.
  15519. * @returns {Function} Returns the new spec function.
  15520. * @example
  15521. *
  15522. * var objects = [
  15523. * { 'a': 2, 'b': 1 },
  15524. * { 'a': 1, 'b': 2 }
  15525. * ];
  15526. *
  15527. * _.filter(objects, _.conforms({ 'b': function(n) { return n > 1; } }));
  15528. * // => [{ 'a': 1, 'b': 2 }]
  15529. */
  15530. function conforms(source) {
  15531. return baseConforms(baseClone(source, CLONE_DEEP_FLAG));
  15532. }
  15533. /**
  15534. * Creates a function that returns `value`.
  15535. *
  15536. * @static
  15537. * @memberOf _
  15538. * @since 2.4.0
  15539. * @category Util
  15540. * @param {*} value The value to return from the new function.
  15541. * @returns {Function} Returns the new constant function.
  15542. * @example
  15543. *
  15544. * var objects = _.times(2, _.constant({ 'a': 1 }));
  15545. *
  15546. * console.log(objects);
  15547. * // => [{ 'a': 1 }, { 'a': 1 }]
  15548. *
  15549. * console.log(objects[0] === objects[1]);
  15550. * // => true
  15551. */
  15552. function constant(value) {
  15553. return function() {
  15554. return value;
  15555. };
  15556. }
  15557. /**
  15558. * Checks `value` to determine whether a default value should be returned in
  15559. * its place. The `defaultValue` is returned if `value` is `NaN`, `null`,
  15560. * or `undefined`.
  15561. *
  15562. * @static
  15563. * @memberOf _
  15564. * @since 4.14.0
  15565. * @category Util
  15566. * @param {*} value The value to check.
  15567. * @param {*} defaultValue The default value.
  15568. * @returns {*} Returns the resolved value.
  15569. * @example
  15570. *
  15571. * _.defaultTo(1, 10);
  15572. * // => 1
  15573. *
  15574. * _.defaultTo(undefined, 10);
  15575. * // => 10
  15576. */
  15577. function defaultTo(value, defaultValue) {
  15578. return (value == null || value !== value) ? defaultValue : value;
  15579. }
  15580. /**
  15581. * Creates a function that returns the result of invoking the given functions
  15582. * with the `this` binding of the created function, where each successive
  15583. * invocation is supplied the return value of the previous.
  15584. *
  15585. * @static
  15586. * @memberOf _
  15587. * @since 3.0.0
  15588. * @category Util
  15589. * @param {...(Function|Function[])} [funcs] The functions to invoke.
  15590. * @returns {Function} Returns the new composite function.
  15591. * @see _.flowRight
  15592. * @example
  15593. *
  15594. * function square(n) {
  15595. * return n * n;
  15596. * }
  15597. *
  15598. * var addSquare = _.flow([_.add, square]);
  15599. * addSquare(1, 2);
  15600. * // => 9
  15601. */
  15602. var flow = createFlow();
  15603. /**
  15604. * This method is like `_.flow` except that it creates a function that
  15605. * invokes the given functions from right to left.
  15606. *
  15607. * @static
  15608. * @since 3.0.0
  15609. * @memberOf _
  15610. * @category Util
  15611. * @param {...(Function|Function[])} [funcs] The functions to invoke.
  15612. * @returns {Function} Returns the new composite function.
  15613. * @see _.flow
  15614. * @example
  15615. *
  15616. * function square(n) {
  15617. * return n * n;
  15618. * }
  15619. *
  15620. * var addSquare = _.flowRight([square, _.add]);
  15621. * addSquare(1, 2);
  15622. * // => 9
  15623. */
  15624. var flowRight = createFlow(true);
  15625. /**
  15626. * This method returns the first argument it receives.
  15627. *
  15628. * @static
  15629. * @since 0.1.0
  15630. * @memberOf _
  15631. * @category Util
  15632. * @param {*} value Any value.
  15633. * @returns {*} Returns `value`.
  15634. * @example
  15635. *
  15636. * var object = { 'a': 1 };
  15637. *
  15638. * console.log(_.identity(object) === object);
  15639. * // => true
  15640. */
  15641. function identity(value) {
  15642. return value;
  15643. }
  15644. /**
  15645. * Creates a function that invokes `func` with the arguments of the created
  15646. * function. If `func` is a property name, the created function returns the
  15647. * property value for a given element. If `func` is an array or object, the
  15648. * created function returns `true` for elements that contain the equivalent
  15649. * source properties, otherwise it returns `false`.
  15650. *
  15651. * @static
  15652. * @since 4.0.0
  15653. * @memberOf _
  15654. * @category Util
  15655. * @param {*} [func=_.identity] The value to convert to a callback.
  15656. * @returns {Function} Returns the callback.
  15657. * @example
  15658. *
  15659. * var users = [
  15660. * { 'user': 'barney', 'age': 36, 'active': true },
  15661. * { 'user': 'fred', 'age': 40, 'active': false }
  15662. * ];
  15663. *
  15664. * // The `_.matches` iteratee shorthand.
  15665. * _.filter(users, _.iteratee({ 'user': 'barney', 'active': true }));
  15666. * // => [{ 'user': 'barney', 'age': 36, 'active': true }]
  15667. *
  15668. * // The `_.matchesProperty` iteratee shorthand.
  15669. * _.filter(users, _.iteratee(['user', 'fred']));
  15670. * // => [{ 'user': 'fred', 'age': 40 }]
  15671. *
  15672. * // The `_.property` iteratee shorthand.
  15673. * _.map(users, _.iteratee('user'));
  15674. * // => ['barney', 'fred']
  15675. *
  15676. * // Create custom iteratee shorthands.
  15677. * _.iteratee = _.wrap(_.iteratee, function(iteratee, func) {
  15678. * return !_.isRegExp(func) ? iteratee(func) : function(string) {
  15679. * return func.test(string);
  15680. * };
  15681. * });
  15682. *
  15683. * _.filter(['abc', 'def'], /ef/);
  15684. * // => ['def']
  15685. */
  15686. function iteratee(func) {
  15687. return baseIteratee(typeof func == 'function' ? func : baseClone(func, CLONE_DEEP_FLAG));
  15688. }
  15689. /**
  15690. * Creates a function that performs a partial deep comparison between a given
  15691. * object and `source`, returning `true` if the given object has equivalent
  15692. * property values, else `false`.
  15693. *
  15694. * **Note:** The created function is equivalent to `_.isMatch` with `source`
  15695. * partially applied.
  15696. *
  15697. * Partial comparisons will match empty array and empty object `source`
  15698. * values against any array or object value, respectively. See `_.isEqual`
  15699. * for a list of supported value comparisons.
  15700. *
  15701. * **Note:** Multiple values can be checked by combining several matchers
  15702. * using `_.overSome`
  15703. *
  15704. * @static
  15705. * @memberOf _
  15706. * @since 3.0.0
  15707. * @category Util
  15708. * @param {Object} source The object of property values to match.
  15709. * @returns {Function} Returns the new spec function.
  15710. * @example
  15711. *
  15712. * var objects = [
  15713. * { 'a': 1, 'b': 2, 'c': 3 },
  15714. * { 'a': 4, 'b': 5, 'c': 6 }
  15715. * ];
  15716. *
  15717. * _.filter(objects, _.matches({ 'a': 4, 'c': 6 }));
  15718. * // => [{ 'a': 4, 'b': 5, 'c': 6 }]
  15719. *
  15720. * // Checking for several possible values
  15721. * _.filter(objects, _.overSome([_.matches({ 'a': 1 }), _.matches({ 'a': 4 })]));
  15722. * // => [{ 'a': 1, 'b': 2, 'c': 3 }, { 'a': 4, 'b': 5, 'c': 6 }]
  15723. */
  15724. function matches(source) {
  15725. return baseMatches(baseClone(source, CLONE_DEEP_FLAG));
  15726. }
  15727. /**
  15728. * Creates a function that performs a partial deep comparison between the
  15729. * value at `path` of a given object to `srcValue`, returning `true` if the
  15730. * object value is equivalent, else `false`.
  15731. *
  15732. * **Note:** Partial comparisons will match empty array and empty object
  15733. * `srcValue` values against any array or object value, respectively. See
  15734. * `_.isEqual` for a list of supported value comparisons.
  15735. *
  15736. * **Note:** Multiple values can be checked by combining several matchers
  15737. * using `_.overSome`
  15738. *
  15739. * @static
  15740. * @memberOf _
  15741. * @since 3.2.0
  15742. * @category Util
  15743. * @param {Array|string} path The path of the property to get.
  15744. * @param {*} srcValue The value to match.
  15745. * @returns {Function} Returns the new spec function.
  15746. * @example
  15747. *
  15748. * var objects = [
  15749. * { 'a': 1, 'b': 2, 'c': 3 },
  15750. * { 'a': 4, 'b': 5, 'c': 6 }
  15751. * ];
  15752. *
  15753. * _.find(objects, _.matchesProperty('a', 4));
  15754. * // => { 'a': 4, 'b': 5, 'c': 6 }
  15755. *
  15756. * // Checking for several possible values
  15757. * _.filter(objects, _.overSome([_.matchesProperty('a', 1), _.matchesProperty('a', 4)]));
  15758. * // => [{ 'a': 1, 'b': 2, 'c': 3 }, { 'a': 4, 'b': 5, 'c': 6 }]
  15759. */
  15760. function matchesProperty(path, srcValue) {
  15761. return baseMatchesProperty(path, baseClone(srcValue, CLONE_DEEP_FLAG));
  15762. }
  15763. /**
  15764. * Creates a function that invokes the method at `path` of a given object.
  15765. * Any additional arguments are provided to the invoked method.
  15766. *
  15767. * @static
  15768. * @memberOf _
  15769. * @since 3.7.0
  15770. * @category Util
  15771. * @param {Array|string} path The path of the method to invoke.
  15772. * @param {...*} [args] The arguments to invoke the method with.
  15773. * @returns {Function} Returns the new invoker function.
  15774. * @example
  15775. *
  15776. * var objects = [
  15777. * { 'a': { 'b': _.constant(2) } },
  15778. * { 'a': { 'b': _.constant(1) } }
  15779. * ];
  15780. *
  15781. * _.map(objects, _.method('a.b'));
  15782. * // => [2, 1]
  15783. *
  15784. * _.map(objects, _.method(['a', 'b']));
  15785. * // => [2, 1]
  15786. */
  15787. var method = baseRest(function(path, args) {
  15788. return function(object) {
  15789. return baseInvoke(object, path, args);
  15790. };
  15791. });
  15792. /**
  15793. * The opposite of `_.method`; this method creates a function that invokes
  15794. * the method at a given path of `object`. Any additional arguments are
  15795. * provided to the invoked method.
  15796. *
  15797. * @static
  15798. * @memberOf _
  15799. * @since 3.7.0
  15800. * @category Util
  15801. * @param {Object} object The object to query.
  15802. * @param {...*} [args] The arguments to invoke the method with.
  15803. * @returns {Function} Returns the new invoker function.
  15804. * @example
  15805. *
  15806. * var array = _.times(3, _.constant),
  15807. * object = { 'a': array, 'b': array, 'c': array };
  15808. *
  15809. * _.map(['a[2]', 'c[0]'], _.methodOf(object));
  15810. * // => [2, 0]
  15811. *
  15812. * _.map([['a', '2'], ['c', '0']], _.methodOf(object));
  15813. * // => [2, 0]
  15814. */
  15815. var methodOf = baseRest(function(object, args) {
  15816. return function(path) {
  15817. return baseInvoke(object, path, args);
  15818. };
  15819. });
  15820. /**
  15821. * Adds all own enumerable string keyed function properties of a source
  15822. * object to the destination object. If `object` is a function, then methods
  15823. * are added to its prototype as well.
  15824. *
  15825. * **Note:** Use `_.runInContext` to create a pristine `lodash` function to
  15826. * avoid conflicts caused by modifying the original.
  15827. *
  15828. * @static
  15829. * @since 0.1.0
  15830. * @memberOf _
  15831. * @category Util
  15832. * @param {Function|Object} [object=lodash] The destination object.
  15833. * @param {Object} source The object of functions to add.
  15834. * @param {Object} [options={}] The options object.
  15835. * @param {boolean} [options.chain=true] Specify whether mixins are chainable.
  15836. * @returns {Function|Object} Returns `object`.
  15837. * @example
  15838. *
  15839. * function vowels(string) {
  15840. * return _.filter(string, function(v) {
  15841. * return /[aeiou]/i.test(v);
  15842. * });
  15843. * }
  15844. *
  15845. * _.mixin({ 'vowels': vowels });
  15846. * _.vowels('fred');
  15847. * // => ['e']
  15848. *
  15849. * _('fred').vowels().value();
  15850. * // => ['e']
  15851. *
  15852. * _.mixin({ 'vowels': vowels }, { 'chain': false });
  15853. * _('fred').vowels();
  15854. * // => ['e']
  15855. */
  15856. function mixin(object, source, options) {
  15857. var props = keys(source),
  15858. methodNames = baseFunctions(source, props);
  15859. if (options == null &&
  15860. !(isObject(source) && (methodNames.length || !props.length))) {
  15861. options = source;
  15862. source = object;
  15863. object = this;
  15864. methodNames = baseFunctions(source, keys(source));
  15865. }
  15866. var chain = !(isObject(options) && 'chain' in options) || !!options.chain,
  15867. isFunc = isFunction(object);
  15868. arrayEach(methodNames, function(methodName) {
  15869. var func = source[methodName];
  15870. object[methodName] = func;
  15871. if (isFunc) {
  15872. object.prototype[methodName] = function() {
  15873. var chainAll = this.__chain__;
  15874. if (chain || chainAll) {
  15875. var result = object(this.__wrapped__),
  15876. actions = result.__actions__ = copyArray(this.__actions__);
  15877. actions.push({ 'func': func, 'args': arguments, 'thisArg': object });
  15878. result.__chain__ = chainAll;
  15879. return result;
  15880. }
  15881. return func.apply(object, arrayPush([this.value()], arguments));
  15882. };
  15883. }
  15884. });
  15885. return object;
  15886. }
  15887. /**
  15888. * Reverts the `_` variable to its previous value and returns a reference to
  15889. * the `lodash` function.
  15890. *
  15891. * @static
  15892. * @since 0.1.0
  15893. * @memberOf _
  15894. * @category Util
  15895. * @returns {Function} Returns the `lodash` function.
  15896. * @example
  15897. *
  15898. * var lodash = _.noConflict();
  15899. */
  15900. function noConflict() {
  15901. if (root._ === this) {
  15902. root._ = oldDash;
  15903. }
  15904. return this;
  15905. }
  15906. /**
  15907. * This method returns `undefined`.
  15908. *
  15909. * @static
  15910. * @memberOf _
  15911. * @since 2.3.0
  15912. * @category Util
  15913. * @example
  15914. *
  15915. * _.times(2, _.noop);
  15916. * // => [undefined, undefined]
  15917. */
  15918. function noop() {
  15919. // No operation performed.
  15920. }
  15921. /**
  15922. * Creates a function that gets the argument at index `n`. If `n` is negative,
  15923. * the nth argument from the end is returned.
  15924. *
  15925. * @static
  15926. * @memberOf _
  15927. * @since 4.0.0
  15928. * @category Util
  15929. * @param {number} [n=0] The index of the argument to return.
  15930. * @returns {Function} Returns the new pass-thru function.
  15931. * @example
  15932. *
  15933. * var func = _.nthArg(1);
  15934. * func('a', 'b', 'c', 'd');
  15935. * // => 'b'
  15936. *
  15937. * var func = _.nthArg(-2);
  15938. * func('a', 'b', 'c', 'd');
  15939. * // => 'c'
  15940. */
  15941. function nthArg(n) {
  15942. n = toInteger(n);
  15943. return baseRest(function(args) {
  15944. return baseNth(args, n);
  15945. });
  15946. }
  15947. /**
  15948. * Creates a function that invokes `iteratees` with the arguments it receives
  15949. * and returns their results.
  15950. *
  15951. * @static
  15952. * @memberOf _
  15953. * @since 4.0.0
  15954. * @category Util
  15955. * @param {...(Function|Function[])} [iteratees=[_.identity]]
  15956. * The iteratees to invoke.
  15957. * @returns {Function} Returns the new function.
  15958. * @example
  15959. *
  15960. * var func = _.over([Math.max, Math.min]);
  15961. *
  15962. * func(1, 2, 3, 4);
  15963. * // => [4, 1]
  15964. */
  15965. var over = createOver(arrayMap);
  15966. /**
  15967. * Creates a function that checks if **all** of the `predicates` return
  15968. * truthy when invoked with the arguments it receives.
  15969. *
  15970. * Following shorthands are possible for providing predicates.
  15971. * Pass an `Object` and it will be used as an parameter for `_.matches` to create the predicate.
  15972. * Pass an `Array` of parameters for `_.matchesProperty` and the predicate will be created using them.
  15973. *
  15974. * @static
  15975. * @memberOf _
  15976. * @since 4.0.0
  15977. * @category Util
  15978. * @param {...(Function|Function[])} [predicates=[_.identity]]
  15979. * The predicates to check.
  15980. * @returns {Function} Returns the new function.
  15981. * @example
  15982. *
  15983. * var func = _.overEvery([Boolean, isFinite]);
  15984. *
  15985. * func('1');
  15986. * // => true
  15987. *
  15988. * func(null);
  15989. * // => false
  15990. *
  15991. * func(NaN);
  15992. * // => false
  15993. */
  15994. var overEvery = createOver(arrayEvery);
  15995. /**
  15996. * Creates a function that checks if **any** of the `predicates` return
  15997. * truthy when invoked with the arguments it receives.
  15998. *
  15999. * Following shorthands are possible for providing predicates.
  16000. * Pass an `Object` and it will be used as an parameter for `_.matches` to create the predicate.
  16001. * Pass an `Array` of parameters for `_.matchesProperty` and the predicate will be created using them.
  16002. *
  16003. * @static
  16004. * @memberOf _
  16005. * @since 4.0.0
  16006. * @category Util
  16007. * @param {...(Function|Function[])} [predicates=[_.identity]]
  16008. * The predicates to check.
  16009. * @returns {Function} Returns the new function.
  16010. * @example
  16011. *
  16012. * var func = _.overSome([Boolean, isFinite]);
  16013. *
  16014. * func('1');
  16015. * // => true
  16016. *
  16017. * func(null);
  16018. * // => true
  16019. *
  16020. * func(NaN);
  16021. * // => false
  16022. *
  16023. * var matchesFunc = _.overSome([{ 'a': 1 }, { 'a': 2 }])
  16024. * var matchesPropertyFunc = _.overSome([['a', 1], ['a', 2]])
  16025. */
  16026. var overSome = createOver(arraySome);
  16027. /**
  16028. * Creates a function that returns the value at `path` of a given object.
  16029. *
  16030. * @static
  16031. * @memberOf _
  16032. * @since 2.4.0
  16033. * @category Util
  16034. * @param {Array|string} path The path of the property to get.
  16035. * @returns {Function} Returns the new accessor function.
  16036. * @example
  16037. *
  16038. * var objects = [
  16039. * { 'a': { 'b': 2 } },
  16040. * { 'a': { 'b': 1 } }
  16041. * ];
  16042. *
  16043. * _.map(objects, _.property('a.b'));
  16044. * // => [2, 1]
  16045. *
  16046. * _.map(_.sortBy(objects, _.property(['a', 'b'])), 'a.b');
  16047. * // => [1, 2]
  16048. */
  16049. function property(path) {
  16050. return isKey(path) ? baseProperty(toKey(path)) : basePropertyDeep(path);
  16051. }
  16052. /**
  16053. * The opposite of `_.property`; this method creates a function that returns
  16054. * the value at a given path of `object`.
  16055. *
  16056. * @static
  16057. * @memberOf _
  16058. * @since 3.0.0
  16059. * @category Util
  16060. * @param {Object} object The object to query.
  16061. * @returns {Function} Returns the new accessor function.
  16062. * @example
  16063. *
  16064. * var array = [0, 1, 2],
  16065. * object = { 'a': array, 'b': array, 'c': array };
  16066. *
  16067. * _.map(['a[2]', 'c[0]'], _.propertyOf(object));
  16068. * // => [2, 0]
  16069. *
  16070. * _.map([['a', '2'], ['c', '0']], _.propertyOf(object));
  16071. * // => [2, 0]
  16072. */
  16073. function propertyOf(object) {
  16074. return function(path) {
  16075. return object == null ? undefined : baseGet(object, path);
  16076. };
  16077. }
  16078. /**
  16079. * Creates an array of numbers (positive and/or negative) progressing from
  16080. * `start` up to, but not including, `end`. A step of `-1` is used if a negative
  16081. * `start` is specified without an `end` or `step`. If `end` is not specified,
  16082. * it's set to `start` with `start` then set to `0`.
  16083. *
  16084. * **Note:** JavaScript follows the IEEE-754 standard for resolving
  16085. * floating-point values which can produce unexpected results.
  16086. *
  16087. * @static
  16088. * @since 0.1.0
  16089. * @memberOf _
  16090. * @category Util
  16091. * @param {number} [start=0] The start of the range.
  16092. * @param {number} end The end of the range.
  16093. * @param {number} [step=1] The value to increment or decrement by.
  16094. * @returns {Array} Returns the range of numbers.
  16095. * @see _.inRange, _.rangeRight
  16096. * @example
  16097. *
  16098. * _.range(4);
  16099. * // => [0, 1, 2, 3]
  16100. *
  16101. * _.range(-4);
  16102. * // => [0, -1, -2, -3]
  16103. *
  16104. * _.range(1, 5);
  16105. * // => [1, 2, 3, 4]
  16106. *
  16107. * _.range(0, 20, 5);
  16108. * // => [0, 5, 10, 15]
  16109. *
  16110. * _.range(0, -4, -1);
  16111. * // => [0, -1, -2, -3]
  16112. *
  16113. * _.range(1, 4, 0);
  16114. * // => [1, 1, 1]
  16115. *
  16116. * _.range(0);
  16117. * // => []
  16118. */
  16119. var range = createRange();
  16120. /**
  16121. * This method is like `_.range` except that it populates values in
  16122. * descending order.
  16123. *
  16124. * @static
  16125. * @memberOf _
  16126. * @since 4.0.0
  16127. * @category Util
  16128. * @param {number} [start=0] The start of the range.
  16129. * @param {number} end The end of the range.
  16130. * @param {number} [step=1] The value to increment or decrement by.
  16131. * @returns {Array} Returns the range of numbers.
  16132. * @see _.inRange, _.range
  16133. * @example
  16134. *
  16135. * _.rangeRight(4);
  16136. * // => [3, 2, 1, 0]
  16137. *
  16138. * _.rangeRight(-4);
  16139. * // => [-3, -2, -1, 0]
  16140. *
  16141. * _.rangeRight(1, 5);
  16142. * // => [4, 3, 2, 1]
  16143. *
  16144. * _.rangeRight(0, 20, 5);
  16145. * // => [15, 10, 5, 0]
  16146. *
  16147. * _.rangeRight(0, -4, -1);
  16148. * // => [-3, -2, -1, 0]
  16149. *
  16150. * _.rangeRight(1, 4, 0);
  16151. * // => [1, 1, 1]
  16152. *
  16153. * _.rangeRight(0);
  16154. * // => []
  16155. */
  16156. var rangeRight = createRange(true);
  16157. /**
  16158. * This method returns a new empty array.
  16159. *
  16160. * @static
  16161. * @memberOf _
  16162. * @since 4.13.0
  16163. * @category Util
  16164. * @returns {Array} Returns the new empty array.
  16165. * @example
  16166. *
  16167. * var arrays = _.times(2, _.stubArray);
  16168. *
  16169. * console.log(arrays);
  16170. * // => [[], []]
  16171. *
  16172. * console.log(arrays[0] === arrays[1]);
  16173. * // => false
  16174. */
  16175. function stubArray() {
  16176. return [];
  16177. }
  16178. /**
  16179. * This method returns `false`.
  16180. *
  16181. * @static
  16182. * @memberOf _
  16183. * @since 4.13.0
  16184. * @category Util
  16185. * @returns {boolean} Returns `false`.
  16186. * @example
  16187. *
  16188. * _.times(2, _.stubFalse);
  16189. * // => [false, false]
  16190. */
  16191. function stubFalse() {
  16192. return false;
  16193. }
  16194. /**
  16195. * This method returns a new empty object.
  16196. *
  16197. * @static
  16198. * @memberOf _
  16199. * @since 4.13.0
  16200. * @category Util
  16201. * @returns {Object} Returns the new empty object.
  16202. * @example
  16203. *
  16204. * var objects = _.times(2, _.stubObject);
  16205. *
  16206. * console.log(objects);
  16207. * // => [{}, {}]
  16208. *
  16209. * console.log(objects[0] === objects[1]);
  16210. * // => false
  16211. */
  16212. function stubObject() {
  16213. return {};
  16214. }
  16215. /**
  16216. * This method returns an empty string.
  16217. *
  16218. * @static
  16219. * @memberOf _
  16220. * @since 4.13.0
  16221. * @category Util
  16222. * @returns {string} Returns the empty string.
  16223. * @example
  16224. *
  16225. * _.times(2, _.stubString);
  16226. * // => ['', '']
  16227. */
  16228. function stubString() {
  16229. return '';
  16230. }
  16231. /**
  16232. * This method returns `true`.
  16233. *
  16234. * @static
  16235. * @memberOf _
  16236. * @since 4.13.0
  16237. * @category Util
  16238. * @returns {boolean} Returns `true`.
  16239. * @example
  16240. *
  16241. * _.times(2, _.stubTrue);
  16242. * // => [true, true]
  16243. */
  16244. function stubTrue() {
  16245. return true;
  16246. }
  16247. /**
  16248. * Invokes the iteratee `n` times, returning an array of the results of
  16249. * each invocation. The iteratee is invoked with one argument; (index).
  16250. *
  16251. * @static
  16252. * @since 0.1.0
  16253. * @memberOf _
  16254. * @category Util
  16255. * @param {number} n The number of times to invoke `iteratee`.
  16256. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  16257. * @returns {Array} Returns the array of results.
  16258. * @example
  16259. *
  16260. * _.times(3, String);
  16261. * // => ['0', '1', '2']
  16262. *
  16263. * _.times(4, _.constant(0));
  16264. * // => [0, 0, 0, 0]
  16265. */
  16266. function times(n, iteratee) {
  16267. n = toInteger(n);
  16268. if (n < 1 || n > MAX_SAFE_INTEGER) {
  16269. return [];
  16270. }
  16271. var index = MAX_ARRAY_LENGTH,
  16272. length = nativeMin(n, MAX_ARRAY_LENGTH);
  16273. iteratee = getIteratee(iteratee);
  16274. n -= MAX_ARRAY_LENGTH;
  16275. var result = baseTimes(length, iteratee);
  16276. while (++index < n) {
  16277. iteratee(index);
  16278. }
  16279. return result;
  16280. }
  16281. /**
  16282. * Converts `value` to a property path array.
  16283. *
  16284. * @static
  16285. * @memberOf _
  16286. * @since 4.0.0
  16287. * @category Util
  16288. * @param {*} value The value to convert.
  16289. * @returns {Array} Returns the new property path array.
  16290. * @example
  16291. *
  16292. * _.toPath('a.b.c');
  16293. * // => ['a', 'b', 'c']
  16294. *
  16295. * _.toPath('a[0].b.c');
  16296. * // => ['a', '0', 'b', 'c']
  16297. */
  16298. function toPath(value) {
  16299. if (isArray(value)) {
  16300. return arrayMap(value, toKey);
  16301. }
  16302. return isSymbol(value) ? [value] : copyArray(stringToPath(toString(value)));
  16303. }
  16304. /**
  16305. * Generates a unique ID. If `prefix` is given, the ID is appended to it.
  16306. *
  16307. * @static
  16308. * @since 0.1.0
  16309. * @memberOf _
  16310. * @category Util
  16311. * @param {string} [prefix=''] The value to prefix the ID with.
  16312. * @returns {string} Returns the unique ID.
  16313. * @example
  16314. *
  16315. * _.uniqueId('contact_');
  16316. * // => 'contact_104'
  16317. *
  16318. * _.uniqueId();
  16319. * // => '105'
  16320. */
  16321. function uniqueId(prefix) {
  16322. var id = ++idCounter;
  16323. return toString(prefix) + id;
  16324. }
  16325. /*------------------------------------------------------------------------*/
  16326. /**
  16327. * Adds two numbers.
  16328. *
  16329. * @static
  16330. * @memberOf _
  16331. * @since 3.4.0
  16332. * @category Math
  16333. * @param {number} augend The first number in an addition.
  16334. * @param {number} addend The second number in an addition.
  16335. * @returns {number} Returns the total.
  16336. * @example
  16337. *
  16338. * _.add(6, 4);
  16339. * // => 10
  16340. */
  16341. var add = createMathOperation(function(augend, addend) {
  16342. return augend + addend;
  16343. }, 0);
  16344. /**
  16345. * Computes `number` rounded up to `precision`.
  16346. *
  16347. * @static
  16348. * @memberOf _
  16349. * @since 3.10.0
  16350. * @category Math
  16351. * @param {number} number The number to round up.
  16352. * @param {number} [precision=0] The precision to round up to.
  16353. * @returns {number} Returns the rounded up number.
  16354. * @example
  16355. *
  16356. * _.ceil(4.006);
  16357. * // => 5
  16358. *
  16359. * _.ceil(6.004, 2);
  16360. * // => 6.01
  16361. *
  16362. * _.ceil(6040, -2);
  16363. * // => 6100
  16364. */
  16365. var ceil = createRound('ceil');
  16366. /**
  16367. * Divide two numbers.
  16368. *
  16369. * @static
  16370. * @memberOf _
  16371. * @since 4.7.0
  16372. * @category Math
  16373. * @param {number} dividend The first number in a division.
  16374. * @param {number} divisor The second number in a division.
  16375. * @returns {number} Returns the quotient.
  16376. * @example
  16377. *
  16378. * _.divide(6, 4);
  16379. * // => 1.5
  16380. */
  16381. var divide = createMathOperation(function(dividend, divisor) {
  16382. return dividend / divisor;
  16383. }, 1);
  16384. /**
  16385. * Computes `number` rounded down to `precision`.
  16386. *
  16387. * @static
  16388. * @memberOf _
  16389. * @since 3.10.0
  16390. * @category Math
  16391. * @param {number} number The number to round down.
  16392. * @param {number} [precision=0] The precision to round down to.
  16393. * @returns {number} Returns the rounded down number.
  16394. * @example
  16395. *
  16396. * _.floor(4.006);
  16397. * // => 4
  16398. *
  16399. * _.floor(0.046, 2);
  16400. * // => 0.04
  16401. *
  16402. * _.floor(4060, -2);
  16403. * // => 4000
  16404. */
  16405. var floor = createRound('floor');
  16406. /**
  16407. * Computes the maximum value of `array`. If `array` is empty or falsey,
  16408. * `undefined` is returned.
  16409. *
  16410. * @static
  16411. * @since 0.1.0
  16412. * @memberOf _
  16413. * @category Math
  16414. * @param {Array} array The array to iterate over.
  16415. * @returns {*} Returns the maximum value.
  16416. * @example
  16417. *
  16418. * _.max([4, 2, 8, 6]);
  16419. * // => 8
  16420. *
  16421. * _.max([]);
  16422. * // => undefined
  16423. */
  16424. function max(array) {
  16425. return (array && array.length)
  16426. ? baseExtremum(array, identity, baseGt)
  16427. : undefined;
  16428. }
  16429. /**
  16430. * This method is like `_.max` except that it accepts `iteratee` which is
  16431. * invoked for each element in `array` to generate the criterion by which
  16432. * the value is ranked. The iteratee is invoked with one argument: (value).
  16433. *
  16434. * @static
  16435. * @memberOf _
  16436. * @since 4.0.0
  16437. * @category Math
  16438. * @param {Array} array The array to iterate over.
  16439. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  16440. * @returns {*} Returns the maximum value.
  16441. * @example
  16442. *
  16443. * var objects = [{ 'n': 1 }, { 'n': 2 }];
  16444. *
  16445. * _.maxBy(objects, function(o) { return o.n; });
  16446. * // => { 'n': 2 }
  16447. *
  16448. * // The `_.property` iteratee shorthand.
  16449. * _.maxBy(objects, 'n');
  16450. * // => { 'n': 2 }
  16451. */
  16452. function maxBy(array, iteratee) {
  16453. return (array && array.length)
  16454. ? baseExtremum(array, getIteratee(iteratee, 2), baseGt)
  16455. : undefined;
  16456. }
  16457. /**
  16458. * Computes the mean of the values in `array`.
  16459. *
  16460. * @static
  16461. * @memberOf _
  16462. * @since 4.0.0
  16463. * @category Math
  16464. * @param {Array} array The array to iterate over.
  16465. * @returns {number} Returns the mean.
  16466. * @example
  16467. *
  16468. * _.mean([4, 2, 8, 6]);
  16469. * // => 5
  16470. */
  16471. function mean(array) {
  16472. return baseMean(array, identity);
  16473. }
  16474. /**
  16475. * This method is like `_.mean` except that it accepts `iteratee` which is
  16476. * invoked for each element in `array` to generate the value to be averaged.
  16477. * The iteratee is invoked with one argument: (value).
  16478. *
  16479. * @static
  16480. * @memberOf _
  16481. * @since 4.7.0
  16482. * @category Math
  16483. * @param {Array} array The array to iterate over.
  16484. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  16485. * @returns {number} Returns the mean.
  16486. * @example
  16487. *
  16488. * var objects = [{ 'n': 4 }, { 'n': 2 }, { 'n': 8 }, { 'n': 6 }];
  16489. *
  16490. * _.meanBy(objects, function(o) { return o.n; });
  16491. * // => 5
  16492. *
  16493. * // The `_.property` iteratee shorthand.
  16494. * _.meanBy(objects, 'n');
  16495. * // => 5
  16496. */
  16497. function meanBy(array, iteratee) {
  16498. return baseMean(array, getIteratee(iteratee, 2));
  16499. }
  16500. /**
  16501. * Computes the minimum value of `array`. If `array` is empty or falsey,
  16502. * `undefined` is returned.
  16503. *
  16504. * @static
  16505. * @since 0.1.0
  16506. * @memberOf _
  16507. * @category Math
  16508. * @param {Array} array The array to iterate over.
  16509. * @returns {*} Returns the minimum value.
  16510. * @example
  16511. *
  16512. * _.min([4, 2, 8, 6]);
  16513. * // => 2
  16514. *
  16515. * _.min([]);
  16516. * // => undefined
  16517. */
  16518. function min(array) {
  16519. return (array && array.length)
  16520. ? baseExtremum(array, identity, baseLt)
  16521. : undefined;
  16522. }
  16523. /**
  16524. * This method is like `_.min` except that it accepts `iteratee` which is
  16525. * invoked for each element in `array` to generate the criterion by which
  16526. * the value is ranked. The iteratee is invoked with one argument: (value).
  16527. *
  16528. * @static
  16529. * @memberOf _
  16530. * @since 4.0.0
  16531. * @category Math
  16532. * @param {Array} array The array to iterate over.
  16533. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  16534. * @returns {*} Returns the minimum value.
  16535. * @example
  16536. *
  16537. * var objects = [{ 'n': 1 }, { 'n': 2 }];
  16538. *
  16539. * _.minBy(objects, function(o) { return o.n; });
  16540. * // => { 'n': 1 }
  16541. *
  16542. * // The `_.property` iteratee shorthand.
  16543. * _.minBy(objects, 'n');
  16544. * // => { 'n': 1 }
  16545. */
  16546. function minBy(array, iteratee) {
  16547. return (array && array.length)
  16548. ? baseExtremum(array, getIteratee(iteratee, 2), baseLt)
  16549. : undefined;
  16550. }
  16551. /**
  16552. * Multiply two numbers.
  16553. *
  16554. * @static
  16555. * @memberOf _
  16556. * @since 4.7.0
  16557. * @category Math
  16558. * @param {number} multiplier The first number in a multiplication.
  16559. * @param {number} multiplicand The second number in a multiplication.
  16560. * @returns {number} Returns the product.
  16561. * @example
  16562. *
  16563. * _.multiply(6, 4);
  16564. * // => 24
  16565. */
  16566. var multiply = createMathOperation(function(multiplier, multiplicand) {
  16567. return multiplier * multiplicand;
  16568. }, 1);
  16569. /**
  16570. * Computes `number` rounded to `precision`.
  16571. *
  16572. * @static
  16573. * @memberOf _
  16574. * @since 3.10.0
  16575. * @category Math
  16576. * @param {number} number The number to round.
  16577. * @param {number} [precision=0] The precision to round to.
  16578. * @returns {number} Returns the rounded number.
  16579. * @example
  16580. *
  16581. * _.round(4.006);
  16582. * // => 4
  16583. *
  16584. * _.round(4.006, 2);
  16585. * // => 4.01
  16586. *
  16587. * _.round(4060, -2);
  16588. * // => 4100
  16589. */
  16590. var round = createRound('round');
  16591. /**
  16592. * Subtract two numbers.
  16593. *
  16594. * @static
  16595. * @memberOf _
  16596. * @since 4.0.0
  16597. * @category Math
  16598. * @param {number} minuend The first number in a subtraction.
  16599. * @param {number} subtrahend The second number in a subtraction.
  16600. * @returns {number} Returns the difference.
  16601. * @example
  16602. *
  16603. * _.subtract(6, 4);
  16604. * // => 2
  16605. */
  16606. var subtract = createMathOperation(function(minuend, subtrahend) {
  16607. return minuend - subtrahend;
  16608. }, 0);
  16609. /**
  16610. * Computes the sum of the values in `array`.
  16611. *
  16612. * @static
  16613. * @memberOf _
  16614. * @since 3.4.0
  16615. * @category Math
  16616. * @param {Array} array The array to iterate over.
  16617. * @returns {number} Returns the sum.
  16618. * @example
  16619. *
  16620. * _.sum([4, 2, 8, 6]);
  16621. * // => 20
  16622. */
  16623. function sum(array) {
  16624. return (array && array.length)
  16625. ? baseSum(array, identity)
  16626. : 0;
  16627. }
  16628. /**
  16629. * This method is like `_.sum` except that it accepts `iteratee` which is
  16630. * invoked for each element in `array` to generate the value to be summed.
  16631. * The iteratee is invoked with one argument: (value).
  16632. *
  16633. * @static
  16634. * @memberOf _
  16635. * @since 4.0.0
  16636. * @category Math
  16637. * @param {Array} array The array to iterate over.
  16638. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  16639. * @returns {number} Returns the sum.
  16640. * @example
  16641. *
  16642. * var objects = [{ 'n': 4 }, { 'n': 2 }, { 'n': 8 }, { 'n': 6 }];
  16643. *
  16644. * _.sumBy(objects, function(o) { return o.n; });
  16645. * // => 20
  16646. *
  16647. * // The `_.property` iteratee shorthand.
  16648. * _.sumBy(objects, 'n');
  16649. * // => 20
  16650. */
  16651. function sumBy(array, iteratee) {
  16652. return (array && array.length)
  16653. ? baseSum(array, getIteratee(iteratee, 2))
  16654. : 0;
  16655. }
  16656. /*------------------------------------------------------------------------*/
  16657. // Add methods that return wrapped values in chain sequences.
  16658. lodash.after = after;
  16659. lodash.ary = ary;
  16660. lodash.assign = assign;
  16661. lodash.assignIn = assignIn;
  16662. lodash.assignInWith = assignInWith;
  16663. lodash.assignWith = assignWith;
  16664. lodash.at = at;
  16665. lodash.before = before;
  16666. lodash.bind = bind;
  16667. lodash.bindAll = bindAll;
  16668. lodash.bindKey = bindKey;
  16669. lodash.castArray = castArray;
  16670. lodash.chain = chain;
  16671. lodash.chunk = chunk;
  16672. lodash.compact = compact;
  16673. lodash.concat = concat;
  16674. lodash.cond = cond;
  16675. lodash.conforms = conforms;
  16676. lodash.constant = constant;
  16677. lodash.countBy = countBy;
  16678. lodash.create = create;
  16679. lodash.curry = curry;
  16680. lodash.curryRight = curryRight;
  16681. lodash.debounce = debounce;
  16682. lodash.defaults = defaults;
  16683. lodash.defaultsDeep = defaultsDeep;
  16684. lodash.defer = defer;
  16685. lodash.delay = delay;
  16686. lodash.difference = difference;
  16687. lodash.differenceBy = differenceBy;
  16688. lodash.differenceWith = differenceWith;
  16689. lodash.drop = drop;
  16690. lodash.dropRight = dropRight;
  16691. lodash.dropRightWhile = dropRightWhile;
  16692. lodash.dropWhile = dropWhile;
  16693. lodash.fill = fill;
  16694. lodash.filter = filter;
  16695. lodash.flatMap = flatMap;
  16696. lodash.flatMapDeep = flatMapDeep;
  16697. lodash.flatMapDepth = flatMapDepth;
  16698. lodash.flatten = flatten;
  16699. lodash.flattenDeep = flattenDeep;
  16700. lodash.flattenDepth = flattenDepth;
  16701. lodash.flip = flip;
  16702. lodash.flow = flow;
  16703. lodash.flowRight = flowRight;
  16704. lodash.fromPairs = fromPairs;
  16705. lodash.functions = functions;
  16706. lodash.functionsIn = functionsIn;
  16707. lodash.groupBy = groupBy;
  16708. lodash.initial = initial;
  16709. lodash.intersection = intersection;
  16710. lodash.intersectionBy = intersectionBy;
  16711. lodash.intersectionWith = intersectionWith;
  16712. lodash.invert = invert;
  16713. lodash.invertBy = invertBy;
  16714. lodash.invokeMap = invokeMap;
  16715. lodash.iteratee = iteratee;
  16716. lodash.keyBy = keyBy;
  16717. lodash.keys = keys;
  16718. lodash.keysIn = keysIn;
  16719. lodash.map = map;
  16720. lodash.mapKeys = mapKeys;
  16721. lodash.mapValues = mapValues;
  16722. lodash.matches = matches;
  16723. lodash.matchesProperty = matchesProperty;
  16724. lodash.memoize = memoize;
  16725. lodash.merge = merge;
  16726. lodash.mergeWith = mergeWith;
  16727. lodash.method = method;
  16728. lodash.methodOf = methodOf;
  16729. lodash.mixin = mixin;
  16730. lodash.negate = negate;
  16731. lodash.nthArg = nthArg;
  16732. lodash.omit = omit;
  16733. lodash.omitBy = omitBy;
  16734. lodash.once = once;
  16735. lodash.orderBy = orderBy;
  16736. lodash.over = over;
  16737. lodash.overArgs = overArgs;
  16738. lodash.overEvery = overEvery;
  16739. lodash.overSome = overSome;
  16740. lodash.partial = partial;
  16741. lodash.partialRight = partialRight;
  16742. lodash.partition = partition;
  16743. lodash.pick = pick;
  16744. lodash.pickBy = pickBy;
  16745. lodash.property = property;
  16746. lodash.propertyOf = propertyOf;
  16747. lodash.pull = pull;
  16748. lodash.pullAll = pullAll;
  16749. lodash.pullAllBy = pullAllBy;
  16750. lodash.pullAllWith = pullAllWith;
  16751. lodash.pullAt = pullAt;
  16752. lodash.range = range;
  16753. lodash.rangeRight = rangeRight;
  16754. lodash.rearg = rearg;
  16755. lodash.reject = reject;
  16756. lodash.remove = remove;
  16757. lodash.rest = rest;
  16758. lodash.reverse = reverse;
  16759. lodash.sampleSize = sampleSize;
  16760. lodash.set = set;
  16761. lodash.setWith = setWith;
  16762. lodash.shuffle = shuffle;
  16763. lodash.slice = slice;
  16764. lodash.sortBy = sortBy;
  16765. lodash.sortedUniq = sortedUniq;
  16766. lodash.sortedUniqBy = sortedUniqBy;
  16767. lodash.split = split;
  16768. lodash.spread = spread;
  16769. lodash.tail = tail;
  16770. lodash.take = take;
  16771. lodash.takeRight = takeRight;
  16772. lodash.takeRightWhile = takeRightWhile;
  16773. lodash.takeWhile = takeWhile;
  16774. lodash.tap = tap;
  16775. lodash.throttle = throttle;
  16776. lodash.thru = thru;
  16777. lodash.toArray = toArray;
  16778. lodash.toPairs = toPairs;
  16779. lodash.toPairsIn = toPairsIn;
  16780. lodash.toPath = toPath;
  16781. lodash.toPlainObject = toPlainObject;
  16782. lodash.transform = transform;
  16783. lodash.unary = unary;
  16784. lodash.union = union;
  16785. lodash.unionBy = unionBy;
  16786. lodash.unionWith = unionWith;
  16787. lodash.uniq = uniq;
  16788. lodash.uniqBy = uniqBy;
  16789. lodash.uniqWith = uniqWith;
  16790. lodash.unset = unset;
  16791. lodash.unzip = unzip;
  16792. lodash.unzipWith = unzipWith;
  16793. lodash.update = update;
  16794. lodash.updateWith = updateWith;
  16795. lodash.values = values;
  16796. lodash.valuesIn = valuesIn;
  16797. lodash.without = without;
  16798. lodash.words = words;
  16799. lodash.wrap = wrap;
  16800. lodash.xor = xor;
  16801. lodash.xorBy = xorBy;
  16802. lodash.xorWith = xorWith;
  16803. lodash.zip = zip;
  16804. lodash.zipObject = zipObject;
  16805. lodash.zipObjectDeep = zipObjectDeep;
  16806. lodash.zipWith = zipWith;
  16807. // Add aliases.
  16808. lodash.entries = toPairs;
  16809. lodash.entriesIn = toPairsIn;
  16810. lodash.extend = assignIn;
  16811. lodash.extendWith = assignInWith;
  16812. // Add methods to `lodash.prototype`.
  16813. mixin(lodash, lodash);
  16814. /*------------------------------------------------------------------------*/
  16815. // Add methods that return unwrapped values in chain sequences.
  16816. lodash.add = add;
  16817. lodash.attempt = attempt;
  16818. lodash.camelCase = camelCase;
  16819. lodash.capitalize = capitalize;
  16820. lodash.ceil = ceil;
  16821. lodash.clamp = clamp;
  16822. lodash.clone = clone;
  16823. lodash.cloneDeep = cloneDeep;
  16824. lodash.cloneDeepWith = cloneDeepWith;
  16825. lodash.cloneWith = cloneWith;
  16826. lodash.conformsTo = conformsTo;
  16827. lodash.deburr = deburr;
  16828. lodash.defaultTo = defaultTo;
  16829. lodash.divide = divide;
  16830. lodash.endsWith = endsWith;
  16831. lodash.eq = eq;
  16832. lodash.escape = escape;
  16833. lodash.escapeRegExp = escapeRegExp;
  16834. lodash.every = every;
  16835. lodash.find = find;
  16836. lodash.findIndex = findIndex;
  16837. lodash.findKey = findKey;
  16838. lodash.findLast = findLast;
  16839. lodash.findLastIndex = findLastIndex;
  16840. lodash.findLastKey = findLastKey;
  16841. lodash.floor = floor;
  16842. lodash.forEach = forEach;
  16843. lodash.forEachRight = forEachRight;
  16844. lodash.forIn = forIn;
  16845. lodash.forInRight = forInRight;
  16846. lodash.forOwn = forOwn;
  16847. lodash.forOwnRight = forOwnRight;
  16848. lodash.get = get;
  16849. lodash.gt = gt;
  16850. lodash.gte = gte;
  16851. lodash.has = has;
  16852. lodash.hasIn = hasIn;
  16853. lodash.head = head;
  16854. lodash.identity = identity;
  16855. lodash.includes = includes;
  16856. lodash.indexOf = indexOf;
  16857. lodash.inRange = inRange;
  16858. lodash.invoke = invoke;
  16859. lodash.isArguments = isArguments;
  16860. lodash.isArray = isArray;
  16861. lodash.isArrayBuffer = isArrayBuffer;
  16862. lodash.isArrayLike = isArrayLike;
  16863. lodash.isArrayLikeObject = isArrayLikeObject;
  16864. lodash.isBoolean = isBoolean;
  16865. lodash.isBuffer = isBuffer;
  16866. lodash.isDate = isDate;
  16867. lodash.isElement = isElement;
  16868. lodash.isEmpty = isEmpty;
  16869. lodash.isEqual = isEqual;
  16870. lodash.isEqualWith = isEqualWith;
  16871. lodash.isError = isError;
  16872. lodash.isFinite = isFinite;
  16873. lodash.isFunction = isFunction;
  16874. lodash.isInteger = isInteger;
  16875. lodash.isLength = isLength;
  16876. lodash.isMap = isMap;
  16877. lodash.isMatch = isMatch;
  16878. lodash.isMatchWith = isMatchWith;
  16879. lodash.isNaN = isNaN;
  16880. lodash.isNative = isNative;
  16881. lodash.isNil = isNil;
  16882. lodash.isNull = isNull;
  16883. lodash.isNumber = isNumber;
  16884. lodash.isObject = isObject;
  16885. lodash.isObjectLike = isObjectLike;
  16886. lodash.isPlainObject = isPlainObject;
  16887. lodash.isRegExp = isRegExp;
  16888. lodash.isSafeInteger = isSafeInteger;
  16889. lodash.isSet = isSet;
  16890. lodash.isString = isString;
  16891. lodash.isSymbol = isSymbol;
  16892. lodash.isTypedArray = isTypedArray;
  16893. lodash.isUndefined = isUndefined;
  16894. lodash.isWeakMap = isWeakMap;
  16895. lodash.isWeakSet = isWeakSet;
  16896. lodash.join = join;
  16897. lodash.kebabCase = kebabCase;
  16898. lodash.last = last;
  16899. lodash.lastIndexOf = lastIndexOf;
  16900. lodash.lowerCase = lowerCase;
  16901. lodash.lowerFirst = lowerFirst;
  16902. lodash.lt = lt;
  16903. lodash.lte = lte;
  16904. lodash.max = max;
  16905. lodash.maxBy = maxBy;
  16906. lodash.mean = mean;
  16907. lodash.meanBy = meanBy;
  16908. lodash.min = min;
  16909. lodash.minBy = minBy;
  16910. lodash.stubArray = stubArray;
  16911. lodash.stubFalse = stubFalse;
  16912. lodash.stubObject = stubObject;
  16913. lodash.stubString = stubString;
  16914. lodash.stubTrue = stubTrue;
  16915. lodash.multiply = multiply;
  16916. lodash.nth = nth;
  16917. lodash.noConflict = noConflict;
  16918. lodash.noop = noop;
  16919. lodash.now = now;
  16920. lodash.pad = pad;
  16921. lodash.padEnd = padEnd;
  16922. lodash.padStart = padStart;
  16923. lodash.parseInt = parseInt;
  16924. lodash.random = random;
  16925. lodash.reduce = reduce;
  16926. lodash.reduceRight = reduceRight;
  16927. lodash.repeat = repeat;
  16928. lodash.replace = replace;
  16929. lodash.result = result;
  16930. lodash.round = round;
  16931. lodash.runInContext = runInContext;
  16932. lodash.sample = sample;
  16933. lodash.size = size;
  16934. lodash.snakeCase = snakeCase;
  16935. lodash.some = some;
  16936. lodash.sortedIndex = sortedIndex;
  16937. lodash.sortedIndexBy = sortedIndexBy;
  16938. lodash.sortedIndexOf = sortedIndexOf;
  16939. lodash.sortedLastIndex = sortedLastIndex;
  16940. lodash.sortedLastIndexBy = sortedLastIndexBy;
  16941. lodash.sortedLastIndexOf = sortedLastIndexOf;
  16942. lodash.startCase = startCase;
  16943. lodash.startsWith = startsWith;
  16944. lodash.subtract = subtract;
  16945. lodash.sum = sum;
  16946. lodash.sumBy = sumBy;
  16947. lodash.template = template;
  16948. lodash.times = times;
  16949. lodash.toFinite = toFinite;
  16950. lodash.toInteger = toInteger;
  16951. lodash.toLength = toLength;
  16952. lodash.toLower = toLower;
  16953. lodash.toNumber = toNumber;
  16954. lodash.toSafeInteger = toSafeInteger;
  16955. lodash.toString = toString;
  16956. lodash.toUpper = toUpper;
  16957. lodash.trim = trim;
  16958. lodash.trimEnd = trimEnd;
  16959. lodash.trimStart = trimStart;
  16960. lodash.truncate = truncate;
  16961. lodash.unescape = unescape;
  16962. lodash.uniqueId = uniqueId;
  16963. lodash.upperCase = upperCase;
  16964. lodash.upperFirst = upperFirst;
  16965. // Add aliases.
  16966. lodash.each = forEach;
  16967. lodash.eachRight = forEachRight;
  16968. lodash.first = head;
  16969. mixin(lodash, (function() {
  16970. var source = {};
  16971. baseForOwn(lodash, function(func, methodName) {
  16972. if (!hasOwnProperty.call(lodash.prototype, methodName)) {
  16973. source[methodName] = func;
  16974. }
  16975. });
  16976. return source;
  16977. }()), { 'chain': false });
  16978. /*------------------------------------------------------------------------*/
  16979. /**
  16980. * The semantic version number.
  16981. *
  16982. * @static
  16983. * @memberOf _
  16984. * @type {string}
  16985. */
  16986. lodash.VERSION = VERSION;
  16987. // Assign default placeholders.
  16988. arrayEach(['bind', 'bindKey', 'curry', 'curryRight', 'partial', 'partialRight'], function(methodName) {
  16989. lodash[methodName].placeholder = lodash;
  16990. });
  16991. // Add `LazyWrapper` methods for `_.drop` and `_.take` variants.
  16992. arrayEach(['drop', 'take'], function(methodName, index) {
  16993. LazyWrapper.prototype[methodName] = function(n) {
  16994. n = n === undefined ? 1 : nativeMax(toInteger(n), 0);
  16995. var result = (this.__filtered__ && !index)
  16996. ? new LazyWrapper(this)
  16997. : this.clone();
  16998. if (result.__filtered__) {
  16999. result.__takeCount__ = nativeMin(n, result.__takeCount__);
  17000. } else {
  17001. result.__views__.push({
  17002. 'size': nativeMin(n, MAX_ARRAY_LENGTH),
  17003. 'type': methodName + (result.__dir__ < 0 ? 'Right' : '')
  17004. });
  17005. }
  17006. return result;
  17007. };
  17008. LazyWrapper.prototype[methodName + 'Right'] = function(n) {
  17009. return this.reverse()[methodName](n).reverse();
  17010. };
  17011. });
  17012. // Add `LazyWrapper` methods that accept an `iteratee` value.
  17013. arrayEach(['filter', 'map', 'takeWhile'], function(methodName, index) {
  17014. var type = index + 1,
  17015. isFilter = type == LAZY_FILTER_FLAG || type == LAZY_WHILE_FLAG;
  17016. LazyWrapper.prototype[methodName] = function(iteratee) {
  17017. var result = this.clone();
  17018. result.__iteratees__.push({
  17019. 'iteratee': getIteratee(iteratee, 3),
  17020. 'type': type
  17021. });
  17022. result.__filtered__ = result.__filtered__ || isFilter;
  17023. return result;
  17024. };
  17025. });
  17026. // Add `LazyWrapper` methods for `_.head` and `_.last`.
  17027. arrayEach(['head', 'last'], function(methodName, index) {
  17028. var takeName = 'take' + (index ? 'Right' : '');
  17029. LazyWrapper.prototype[methodName] = function() {
  17030. return this[takeName](1).value()[0];
  17031. };
  17032. });
  17033. // Add `LazyWrapper` methods for `_.initial` and `_.tail`.
  17034. arrayEach(['initial', 'tail'], function(methodName, index) {
  17035. var dropName = 'drop' + (index ? '' : 'Right');
  17036. LazyWrapper.prototype[methodName] = function() {
  17037. return this.__filtered__ ? new LazyWrapper(this) : this[dropName](1);
  17038. };
  17039. });
  17040. LazyWrapper.prototype.compact = function() {
  17041. return this.filter(identity);
  17042. };
  17043. LazyWrapper.prototype.find = function(predicate) {
  17044. return this.filter(predicate).head();
  17045. };
  17046. LazyWrapper.prototype.findLast = function(predicate) {
  17047. return this.reverse().find(predicate);
  17048. };
  17049. LazyWrapper.prototype.invokeMap = baseRest(function(path, args) {
  17050. if (typeof path == 'function') {
  17051. return new LazyWrapper(this);
  17052. }
  17053. return this.map(function(value) {
  17054. return baseInvoke(value, path, args);
  17055. });
  17056. });
  17057. LazyWrapper.prototype.reject = function(predicate) {
  17058. return this.filter(negate(getIteratee(predicate)));
  17059. };
  17060. LazyWrapper.prototype.slice = function(start, end) {
  17061. start = toInteger(start);
  17062. var result = this;
  17063. if (result.__filtered__ && (start > 0 || end < 0)) {
  17064. return new LazyWrapper(result);
  17065. }
  17066. if (start < 0) {
  17067. result = result.takeRight(-start);
  17068. } else if (start) {
  17069. result = result.drop(start);
  17070. }
  17071. if (end !== undefined) {
  17072. end = toInteger(end);
  17073. result = end < 0 ? result.dropRight(-end) : result.take(end - start);
  17074. }
  17075. return result;
  17076. };
  17077. LazyWrapper.prototype.takeRightWhile = function(predicate) {
  17078. return this.reverse().takeWhile(predicate).reverse();
  17079. };
  17080. LazyWrapper.prototype.toArray = function() {
  17081. return this.take(MAX_ARRAY_LENGTH);
  17082. };
  17083. // Add `LazyWrapper` methods to `lodash.prototype`.
  17084. baseForOwn(LazyWrapper.prototype, function(func, methodName) {
  17085. var checkIteratee = /^(?:filter|find|map|reject)|While$/.test(methodName),
  17086. isTaker = /^(?:head|last)$/.test(methodName),
  17087. lodashFunc = lodash[isTaker ? ('take' + (methodName == 'last' ? 'Right' : '')) : methodName],
  17088. retUnwrapped = isTaker || /^find/.test(methodName);
  17089. if (!lodashFunc) {
  17090. return;
  17091. }
  17092. lodash.prototype[methodName] = function() {
  17093. var value = this.__wrapped__,
  17094. args = isTaker ? [1] : arguments,
  17095. isLazy = value instanceof LazyWrapper,
  17096. iteratee = args[0],
  17097. useLazy = isLazy || isArray(value);
  17098. var interceptor = function(value) {
  17099. var result = lodashFunc.apply(lodash, arrayPush([value], args));
  17100. return (isTaker && chainAll) ? result[0] : result;
  17101. };
  17102. if (useLazy && checkIteratee && typeof iteratee == 'function' && iteratee.length != 1) {
  17103. // Avoid lazy use if the iteratee has a "length" value other than `1`.
  17104. isLazy = useLazy = false;
  17105. }
  17106. var chainAll = this.__chain__,
  17107. isHybrid = !!this.__actions__.length,
  17108. isUnwrapped = retUnwrapped && !chainAll,
  17109. onlyLazy = isLazy && !isHybrid;
  17110. if (!retUnwrapped && useLazy) {
  17111. value = onlyLazy ? value : new LazyWrapper(this);
  17112. var result = func.apply(value, args);
  17113. result.__actions__.push({ 'func': thru, 'args': [interceptor], 'thisArg': undefined });
  17114. return new LodashWrapper(result, chainAll);
  17115. }
  17116. if (isUnwrapped && onlyLazy) {
  17117. return func.apply(this, args);
  17118. }
  17119. result = this.thru(interceptor);
  17120. return isUnwrapped ? (isTaker ? result.value()[0] : result.value()) : result;
  17121. };
  17122. });
  17123. // Add `Array` methods to `lodash.prototype`.
  17124. arrayEach(['pop', 'push', 'shift', 'sort', 'splice', 'unshift'], function(methodName) {
  17125. var func = arrayProto[methodName],
  17126. chainName = /^(?:push|sort|unshift)$/.test(methodName) ? 'tap' : 'thru',
  17127. retUnwrapped = /^(?:pop|shift)$/.test(methodName);
  17128. lodash.prototype[methodName] = function() {
  17129. var args = arguments;
  17130. if (retUnwrapped && !this.__chain__) {
  17131. var value = this.value();
  17132. return func.apply(isArray(value) ? value : [], args);
  17133. }
  17134. return this[chainName](function(value) {
  17135. return func.apply(isArray(value) ? value : [], args);
  17136. });
  17137. };
  17138. });
  17139. // Map minified method names to their real names.
  17140. baseForOwn(LazyWrapper.prototype, function(func, methodName) {
  17141. var lodashFunc = lodash[methodName];
  17142. if (lodashFunc) {
  17143. var key = lodashFunc.name + '';
  17144. if (!hasOwnProperty.call(realNames, key)) {
  17145. realNames[key] = [];
  17146. }
  17147. realNames[key].push({ 'name': methodName, 'func': lodashFunc });
  17148. }
  17149. });
  17150. realNames[createHybrid(undefined, WRAP_BIND_KEY_FLAG).name] = [{
  17151. 'name': 'wrapper',
  17152. 'func': undefined
  17153. }];
  17154. // Add methods to `LazyWrapper`.
  17155. LazyWrapper.prototype.clone = lazyClone;
  17156. LazyWrapper.prototype.reverse = lazyReverse;
  17157. LazyWrapper.prototype.value = lazyValue;
  17158. // Add chain sequence methods to the `lodash` wrapper.
  17159. lodash.prototype.at = wrapperAt;
  17160. lodash.prototype.chain = wrapperChain;
  17161. lodash.prototype.commit = wrapperCommit;
  17162. lodash.prototype.next = wrapperNext;
  17163. lodash.prototype.plant = wrapperPlant;
  17164. lodash.prototype.reverse = wrapperReverse;
  17165. lodash.prototype.toJSON = lodash.prototype.valueOf = lodash.prototype.value = wrapperValue;
  17166. // Add lazy aliases.
  17167. lodash.prototype.first = lodash.prototype.head;
  17168. if (symIterator) {
  17169. lodash.prototype[symIterator] = wrapperToIterator;
  17170. }
  17171. return lodash;
  17172. });
  17173. /*--------------------------------------------------------------------------*/
  17174. // Export lodash.
  17175. var _ = runInContext();
  17176. // Some AMD build optimizers, like r.js, check for condition patterns like:
  17177. if (true) {
  17178. // Expose Lodash on the global object to prevent errors when Lodash is
  17179. // loaded by a script tag in the presence of an AMD loader.
  17180. // See http://requirejs.org/docs/errors.html#mismatch for more details.
  17181. // Use `_.noConflict` to remove Lodash from the global object.
  17182. root._ = _;
  17183. // Define as an anonymous module so, through path mapping, it can be
  17184. // referenced as the "underscore" module.
  17185. !(__WEBPACK_AMD_DEFINE_RESULT__ = (function() {
  17186. return _;
  17187. }).call(exports, __webpack_require__, exports, module),
  17188. __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
  17189. }
  17190. // Check for `exports` after `define` in case a build optimizer adds it.
  17191. else {}
  17192. }.call(this));
  17193. /***/ }),
  17194. /***/ "./node_modules/style-loader/dist/cjs.js!./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppFooter.vue?vue&type=style&index=0&id=4ab6097e&lang=scss&scoped=true":
  17195. /*!***************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  17196. !*** ./node_modules/style-loader/dist/cjs.js!./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppFooter.vue?vue&type=style&index=0&id=4ab6097e&lang=scss&scoped=true ***!
  17197. \***************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  17198. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17199. "use strict";
  17200. __webpack_require__.r(__webpack_exports__);
  17201. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17202. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17203. /* harmony export */ });
  17204. /* harmony import */ var _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! !../../../node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js */ "./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js");
  17205. /* harmony import */ var _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__);
  17206. /* harmony import */ var _node_modules_css_loader_dist_cjs_js_clonedRuleSet_11_use_1_node_modules_vue_loader_dist_stylePostLoader_js_node_modules_postcss_loader_dist_cjs_js_clonedRuleSet_11_use_2_node_modules_sass_loader_dist_cjs_js_clonedRuleSet_11_use_3_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_AppFooter_vue_vue_type_style_index_0_id_4ab6097e_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! !!../../../node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!../../../node_modules/vue-loader/dist/stylePostLoader.js!../../../node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!../../../node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!../../../node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./AppFooter.vue?vue&type=style&index=0&id=4ab6097e&lang=scss&scoped=true */ "./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppFooter.vue?vue&type=style&index=0&id=4ab6097e&lang=scss&scoped=true");
  17207. var options = {};
  17208. options.insert = "head";
  17209. options.singleton = false;
  17210. var update = _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default()(_node_modules_css_loader_dist_cjs_js_clonedRuleSet_11_use_1_node_modules_vue_loader_dist_stylePostLoader_js_node_modules_postcss_loader_dist_cjs_js_clonedRuleSet_11_use_2_node_modules_sass_loader_dist_cjs_js_clonedRuleSet_11_use_3_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_AppFooter_vue_vue_type_style_index_0_id_4ab6097e_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_1__["default"], options);
  17211. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (_node_modules_css_loader_dist_cjs_js_clonedRuleSet_11_use_1_node_modules_vue_loader_dist_stylePostLoader_js_node_modules_postcss_loader_dist_cjs_js_clonedRuleSet_11_use_2_node_modules_sass_loader_dist_cjs_js_clonedRuleSet_11_use_3_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_AppFooter_vue_vue_type_style_index_0_id_4ab6097e_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_1__["default"].locals || {});
  17212. /***/ }),
  17213. /***/ "./node_modules/style-loader/dist/cjs.js!./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppSidebar.vue?vue&type=style&index=0&id=22a4e926&lang=scss&scoped=true":
  17214. /*!****************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  17215. !*** ./node_modules/style-loader/dist/cjs.js!./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppSidebar.vue?vue&type=style&index=0&id=22a4e926&lang=scss&scoped=true ***!
  17216. \****************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  17217. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17218. "use strict";
  17219. __webpack_require__.r(__webpack_exports__);
  17220. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17221. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17222. /* harmony export */ });
  17223. /* harmony import */ var _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! !../../../node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js */ "./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js");
  17224. /* harmony import */ var _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__);
  17225. /* harmony import */ var _node_modules_css_loader_dist_cjs_js_clonedRuleSet_11_use_1_node_modules_vue_loader_dist_stylePostLoader_js_node_modules_postcss_loader_dist_cjs_js_clonedRuleSet_11_use_2_node_modules_sass_loader_dist_cjs_js_clonedRuleSet_11_use_3_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_AppSidebar_vue_vue_type_style_index_0_id_22a4e926_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! !!../../../node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!../../../node_modules/vue-loader/dist/stylePostLoader.js!../../../node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!../../../node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!../../../node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./AppSidebar.vue?vue&type=style&index=0&id=22a4e926&lang=scss&scoped=true */ "./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppSidebar.vue?vue&type=style&index=0&id=22a4e926&lang=scss&scoped=true");
  17226. var options = {};
  17227. options.insert = "head";
  17228. options.singleton = false;
  17229. var update = _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default()(_node_modules_css_loader_dist_cjs_js_clonedRuleSet_11_use_1_node_modules_vue_loader_dist_stylePostLoader_js_node_modules_postcss_loader_dist_cjs_js_clonedRuleSet_11_use_2_node_modules_sass_loader_dist_cjs_js_clonedRuleSet_11_use_3_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_AppSidebar_vue_vue_type_style_index_0_id_22a4e926_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_1__["default"], options);
  17230. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (_node_modules_css_loader_dist_cjs_js_clonedRuleSet_11_use_1_node_modules_vue_loader_dist_stylePostLoader_js_node_modules_postcss_loader_dist_cjs_js_clonedRuleSet_11_use_2_node_modules_sass_loader_dist_cjs_js_clonedRuleSet_11_use_3_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_AppSidebar_vue_vue_type_style_index_0_id_22a4e926_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_1__["default"].locals || {});
  17231. /***/ }),
  17232. /***/ "./node_modules/style-loader/dist/cjs.js!./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppSubSidebar.vue?vue&type=style&index=0&id=0addd9bc&lang=scss&scoped=true":
  17233. /*!*******************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  17234. !*** ./node_modules/style-loader/dist/cjs.js!./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppSubSidebar.vue?vue&type=style&index=0&id=0addd9bc&lang=scss&scoped=true ***!
  17235. \*******************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  17236. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17237. "use strict";
  17238. __webpack_require__.r(__webpack_exports__);
  17239. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17240. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17241. /* harmony export */ });
  17242. /* harmony import */ var _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! !../../../node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js */ "./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js");
  17243. /* harmony import */ var _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__);
  17244. /* harmony import */ var _node_modules_css_loader_dist_cjs_js_clonedRuleSet_11_use_1_node_modules_vue_loader_dist_stylePostLoader_js_node_modules_postcss_loader_dist_cjs_js_clonedRuleSet_11_use_2_node_modules_sass_loader_dist_cjs_js_clonedRuleSet_11_use_3_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_AppSubSidebar_vue_vue_type_style_index_0_id_0addd9bc_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! !!../../../node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!../../../node_modules/vue-loader/dist/stylePostLoader.js!../../../node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!../../../node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!../../../node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./AppSubSidebar.vue?vue&type=style&index=0&id=0addd9bc&lang=scss&scoped=true */ "./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppSubSidebar.vue?vue&type=style&index=0&id=0addd9bc&lang=scss&scoped=true");
  17245. var options = {};
  17246. options.insert = "head";
  17247. options.singleton = false;
  17248. var update = _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default()(_node_modules_css_loader_dist_cjs_js_clonedRuleSet_11_use_1_node_modules_vue_loader_dist_stylePostLoader_js_node_modules_postcss_loader_dist_cjs_js_clonedRuleSet_11_use_2_node_modules_sass_loader_dist_cjs_js_clonedRuleSet_11_use_3_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_AppSubSidebar_vue_vue_type_style_index_0_id_0addd9bc_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_1__["default"], options);
  17249. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (_node_modules_css_loader_dist_cjs_js_clonedRuleSet_11_use_1_node_modules_vue_loader_dist_stylePostLoader_js_node_modules_postcss_loader_dist_cjs_js_clonedRuleSet_11_use_2_node_modules_sass_loader_dist_cjs_js_clonedRuleSet_11_use_3_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_AppSubSidebar_vue_vue_type_style_index_0_id_0addd9bc_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_1__["default"].locals || {});
  17250. /***/ }),
  17251. /***/ "./node_modules/style-loader/dist/cjs.js!./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppTopBar.vue?vue&type=style&index=0&id=42bf62a4&lang=scss&scoped=true":
  17252. /*!***************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  17253. !*** ./node_modules/style-loader/dist/cjs.js!./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppTopBar.vue?vue&type=style&index=0&id=42bf62a4&lang=scss&scoped=true ***!
  17254. \***************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  17255. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17256. "use strict";
  17257. __webpack_require__.r(__webpack_exports__);
  17258. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17259. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17260. /* harmony export */ });
  17261. /* harmony import */ var _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! !../../../node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js */ "./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js");
  17262. /* harmony import */ var _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__);
  17263. /* harmony import */ var _node_modules_css_loader_dist_cjs_js_clonedRuleSet_11_use_1_node_modules_vue_loader_dist_stylePostLoader_js_node_modules_postcss_loader_dist_cjs_js_clonedRuleSet_11_use_2_node_modules_sass_loader_dist_cjs_js_clonedRuleSet_11_use_3_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_AppTopBar_vue_vue_type_style_index_0_id_42bf62a4_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! !!../../../node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!../../../node_modules/vue-loader/dist/stylePostLoader.js!../../../node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!../../../node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!../../../node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./AppTopBar.vue?vue&type=style&index=0&id=42bf62a4&lang=scss&scoped=true */ "./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppTopBar.vue?vue&type=style&index=0&id=42bf62a4&lang=scss&scoped=true");
  17264. var options = {};
  17265. options.insert = "head";
  17266. options.singleton = false;
  17267. var update = _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default()(_node_modules_css_loader_dist_cjs_js_clonedRuleSet_11_use_1_node_modules_vue_loader_dist_stylePostLoader_js_node_modules_postcss_loader_dist_cjs_js_clonedRuleSet_11_use_2_node_modules_sass_loader_dist_cjs_js_clonedRuleSet_11_use_3_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_AppTopBar_vue_vue_type_style_index_0_id_42bf62a4_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_1__["default"], options);
  17268. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (_node_modules_css_loader_dist_cjs_js_clonedRuleSet_11_use_1_node_modules_vue_loader_dist_stylePostLoader_js_node_modules_postcss_loader_dist_cjs_js_clonedRuleSet_11_use_2_node_modules_sass_loader_dist_cjs_js_clonedRuleSet_11_use_3_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_AppTopBar_vue_vue_type_style_index_0_id_42bf62a4_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_1__["default"].locals || {});
  17269. /***/ }),
  17270. /***/ "./node_modules/style-loader/dist/cjs.js!./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/layouts/DashboardLayout.vue?vue&type=style&index=0&id=549bf5ac&lang=scss&scoped=true":
  17271. /*!******************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  17272. !*** ./node_modules/style-loader/dist/cjs.js!./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/layouts/DashboardLayout.vue?vue&type=style&index=0&id=549bf5ac&lang=scss&scoped=true ***!
  17273. \******************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  17274. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17275. "use strict";
  17276. __webpack_require__.r(__webpack_exports__);
  17277. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17278. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17279. /* harmony export */ });
  17280. /* harmony import */ var _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! !../../../node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js */ "./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js");
  17281. /* harmony import */ var _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__);
  17282. /* harmony import */ var _node_modules_css_loader_dist_cjs_js_clonedRuleSet_11_use_1_node_modules_vue_loader_dist_stylePostLoader_js_node_modules_postcss_loader_dist_cjs_js_clonedRuleSet_11_use_2_node_modules_sass_loader_dist_cjs_js_clonedRuleSet_11_use_3_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_DashboardLayout_vue_vue_type_style_index_0_id_549bf5ac_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! !!../../../node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!../../../node_modules/vue-loader/dist/stylePostLoader.js!../../../node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!../../../node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!../../../node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./DashboardLayout.vue?vue&type=style&index=0&id=549bf5ac&lang=scss&scoped=true */ "./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/layouts/DashboardLayout.vue?vue&type=style&index=0&id=549bf5ac&lang=scss&scoped=true");
  17283. var options = {};
  17284. options.insert = "head";
  17285. options.singleton = false;
  17286. var update = _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default()(_node_modules_css_loader_dist_cjs_js_clonedRuleSet_11_use_1_node_modules_vue_loader_dist_stylePostLoader_js_node_modules_postcss_loader_dist_cjs_js_clonedRuleSet_11_use_2_node_modules_sass_loader_dist_cjs_js_clonedRuleSet_11_use_3_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_DashboardLayout_vue_vue_type_style_index_0_id_549bf5ac_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_1__["default"], options);
  17287. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (_node_modules_css_loader_dist_cjs_js_clonedRuleSet_11_use_1_node_modules_vue_loader_dist_stylePostLoader_js_node_modules_postcss_loader_dist_cjs_js_clonedRuleSet_11_use_2_node_modules_sass_loader_dist_cjs_js_clonedRuleSet_11_use_3_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_DashboardLayout_vue_vue_type_style_index_0_id_549bf5ac_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_1__["default"].locals || {});
  17288. /***/ }),
  17289. /***/ "./node_modules/vue-loader/dist/exportHelper.js":
  17290. /*!******************************************************!*\
  17291. !*** ./node_modules/vue-loader/dist/exportHelper.js ***!
  17292. \******************************************************/
  17293. /***/ ((__unused_webpack_module, exports) => {
  17294. "use strict";
  17295. Object.defineProperty(exports, "__esModule", ({ value: true }));
  17296. // runtime helper for setting properties on components
  17297. // in a tree-shakable way
  17298. exports["default"] = (sfc, props) => {
  17299. const target = sfc.__vccOpts || sfc;
  17300. for (const [key, val] of props) {
  17301. target[key] = val;
  17302. }
  17303. return target;
  17304. };
  17305. /***/ }),
  17306. /***/ "./resources/js/components/AppFooter.vue":
  17307. /*!***********************************************!*\
  17308. !*** ./resources/js/components/AppFooter.vue ***!
  17309. \***********************************************/
  17310. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17311. "use strict";
  17312. __webpack_require__.r(__webpack_exports__);
  17313. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17314. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17315. /* harmony export */ });
  17316. /* harmony import */ var _AppFooter_vue_vue_type_template_id_4ab6097e_scoped_true__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./AppFooter.vue?vue&type=template&id=4ab6097e&scoped=true */ "./resources/js/components/AppFooter.vue?vue&type=template&id=4ab6097e&scoped=true");
  17317. /* harmony import */ var _AppFooter_vue_vue_type_style_index_0_id_4ab6097e_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./AppFooter.vue?vue&type=style&index=0&id=4ab6097e&lang=scss&scoped=true */ "./resources/js/components/AppFooter.vue?vue&type=style&index=0&id=4ab6097e&lang=scss&scoped=true");
  17318. /* harmony import */ var _media_dijitalcode_3ad9c6e0_4296_4a57_b136_144df49e7bb8_Projects_parkirin_node_modules_vue_loader_dist_exportHelper_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./node_modules/vue-loader/dist/exportHelper.js */ "./node_modules/vue-loader/dist/exportHelper.js");
  17319. const script = {}
  17320. ;
  17321. const __exports__ = /*#__PURE__*/(0,_media_dijitalcode_3ad9c6e0_4296_4a57_b136_144df49e7bb8_Projects_parkirin_node_modules_vue_loader_dist_exportHelper_js__WEBPACK_IMPORTED_MODULE_2__["default"])(script, [['render',_AppFooter_vue_vue_type_template_id_4ab6097e_scoped_true__WEBPACK_IMPORTED_MODULE_0__.render],['__scopeId',"data-v-4ab6097e"],['__file',"resources/js/components/AppFooter.vue"]])
  17322. /* hot reload */
  17323. if (false) {}
  17324. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__);
  17325. /***/ }),
  17326. /***/ "./resources/js/components/AppMessage.vue":
  17327. /*!************************************************!*\
  17328. !*** ./resources/js/components/AppMessage.vue ***!
  17329. \************************************************/
  17330. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17331. "use strict";
  17332. __webpack_require__.r(__webpack_exports__);
  17333. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17334. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17335. /* harmony export */ });
  17336. /* harmony import */ var _AppMessage_vue_vue_type_template_id_07159051__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./AppMessage.vue?vue&type=template&id=07159051 */ "./resources/js/components/AppMessage.vue?vue&type=template&id=07159051");
  17337. /* harmony import */ var _AppMessage_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./AppMessage.vue?vue&type=script&setup=true&lang=js */ "./resources/js/components/AppMessage.vue?vue&type=script&setup=true&lang=js");
  17338. /* harmony import */ var _media_dijitalcode_3ad9c6e0_4296_4a57_b136_144df49e7bb8_Projects_parkirin_node_modules_vue_loader_dist_exportHelper_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./node_modules/vue-loader/dist/exportHelper.js */ "./node_modules/vue-loader/dist/exportHelper.js");
  17339. ;
  17340. const __exports__ = /*#__PURE__*/(0,_media_dijitalcode_3ad9c6e0_4296_4a57_b136_144df49e7bb8_Projects_parkirin_node_modules_vue_loader_dist_exportHelper_js__WEBPACK_IMPORTED_MODULE_2__["default"])(_AppMessage_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_1__["default"], [['render',_AppMessage_vue_vue_type_template_id_07159051__WEBPACK_IMPORTED_MODULE_0__.render],['__file',"resources/js/components/AppMessage.vue"]])
  17341. /* hot reload */
  17342. if (false) {}
  17343. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__);
  17344. /***/ }),
  17345. /***/ "./resources/js/components/AppSidebar.vue":
  17346. /*!************************************************!*\
  17347. !*** ./resources/js/components/AppSidebar.vue ***!
  17348. \************************************************/
  17349. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17350. "use strict";
  17351. __webpack_require__.r(__webpack_exports__);
  17352. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17353. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17354. /* harmony export */ });
  17355. /* harmony import */ var _AppSidebar_vue_vue_type_template_id_22a4e926_scoped_true__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./AppSidebar.vue?vue&type=template&id=22a4e926&scoped=true */ "./resources/js/components/AppSidebar.vue?vue&type=template&id=22a4e926&scoped=true");
  17356. /* harmony import */ var _AppSidebar_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./AppSidebar.vue?vue&type=script&setup=true&lang=js */ "./resources/js/components/AppSidebar.vue?vue&type=script&setup=true&lang=js");
  17357. /* harmony import */ var _AppSidebar_vue_vue_type_style_index_0_id_22a4e926_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./AppSidebar.vue?vue&type=style&index=0&id=22a4e926&lang=scss&scoped=true */ "./resources/js/components/AppSidebar.vue?vue&type=style&index=0&id=22a4e926&lang=scss&scoped=true");
  17358. /* harmony import */ var _media_dijitalcode_3ad9c6e0_4296_4a57_b136_144df49e7bb8_Projects_parkirin_node_modules_vue_loader_dist_exportHelper_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./node_modules/vue-loader/dist/exportHelper.js */ "./node_modules/vue-loader/dist/exportHelper.js");
  17359. ;
  17360. const __exports__ = /*#__PURE__*/(0,_media_dijitalcode_3ad9c6e0_4296_4a57_b136_144df49e7bb8_Projects_parkirin_node_modules_vue_loader_dist_exportHelper_js__WEBPACK_IMPORTED_MODULE_3__["default"])(_AppSidebar_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_1__["default"], [['render',_AppSidebar_vue_vue_type_template_id_22a4e926_scoped_true__WEBPACK_IMPORTED_MODULE_0__.render],['__scopeId',"data-v-22a4e926"],['__file',"resources/js/components/AppSidebar.vue"]])
  17361. /* hot reload */
  17362. if (false) {}
  17363. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__);
  17364. /***/ }),
  17365. /***/ "./resources/js/components/AppSubSidebar.vue":
  17366. /*!***************************************************!*\
  17367. !*** ./resources/js/components/AppSubSidebar.vue ***!
  17368. \***************************************************/
  17369. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17370. "use strict";
  17371. __webpack_require__.r(__webpack_exports__);
  17372. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17373. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17374. /* harmony export */ });
  17375. /* harmony import */ var _AppSubSidebar_vue_vue_type_template_id_0addd9bc_scoped_true__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./AppSubSidebar.vue?vue&type=template&id=0addd9bc&scoped=true */ "./resources/js/components/AppSubSidebar.vue?vue&type=template&id=0addd9bc&scoped=true");
  17376. /* harmony import */ var _AppSubSidebar_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./AppSubSidebar.vue?vue&type=script&setup=true&lang=js */ "./resources/js/components/AppSubSidebar.vue?vue&type=script&setup=true&lang=js");
  17377. /* harmony import */ var _AppSubSidebar_vue_vue_type_style_index_0_id_0addd9bc_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./AppSubSidebar.vue?vue&type=style&index=0&id=0addd9bc&lang=scss&scoped=true */ "./resources/js/components/AppSubSidebar.vue?vue&type=style&index=0&id=0addd9bc&lang=scss&scoped=true");
  17378. /* harmony import */ var _media_dijitalcode_3ad9c6e0_4296_4a57_b136_144df49e7bb8_Projects_parkirin_node_modules_vue_loader_dist_exportHelper_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./node_modules/vue-loader/dist/exportHelper.js */ "./node_modules/vue-loader/dist/exportHelper.js");
  17379. ;
  17380. const __exports__ = /*#__PURE__*/(0,_media_dijitalcode_3ad9c6e0_4296_4a57_b136_144df49e7bb8_Projects_parkirin_node_modules_vue_loader_dist_exportHelper_js__WEBPACK_IMPORTED_MODULE_3__["default"])(_AppSubSidebar_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_1__["default"], [['render',_AppSubSidebar_vue_vue_type_template_id_0addd9bc_scoped_true__WEBPACK_IMPORTED_MODULE_0__.render],['__scopeId',"data-v-0addd9bc"],['__file',"resources/js/components/AppSubSidebar.vue"]])
  17381. /* hot reload */
  17382. if (false) {}
  17383. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__);
  17384. /***/ }),
  17385. /***/ "./resources/js/components/AppTopBar.vue":
  17386. /*!***********************************************!*\
  17387. !*** ./resources/js/components/AppTopBar.vue ***!
  17388. \***********************************************/
  17389. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17390. "use strict";
  17391. __webpack_require__.r(__webpack_exports__);
  17392. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17393. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17394. /* harmony export */ });
  17395. /* harmony import */ var _AppTopBar_vue_vue_type_template_id_42bf62a4_scoped_true__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./AppTopBar.vue?vue&type=template&id=42bf62a4&scoped=true */ "./resources/js/components/AppTopBar.vue?vue&type=template&id=42bf62a4&scoped=true");
  17396. /* harmony import */ var _AppTopBar_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./AppTopBar.vue?vue&type=script&setup=true&lang=js */ "./resources/js/components/AppTopBar.vue?vue&type=script&setup=true&lang=js");
  17397. /* harmony import */ var _AppTopBar_vue_vue_type_style_index_0_id_42bf62a4_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./AppTopBar.vue?vue&type=style&index=0&id=42bf62a4&lang=scss&scoped=true */ "./resources/js/components/AppTopBar.vue?vue&type=style&index=0&id=42bf62a4&lang=scss&scoped=true");
  17398. /* harmony import */ var _media_dijitalcode_3ad9c6e0_4296_4a57_b136_144df49e7bb8_Projects_parkirin_node_modules_vue_loader_dist_exportHelper_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./node_modules/vue-loader/dist/exportHelper.js */ "./node_modules/vue-loader/dist/exportHelper.js");
  17399. ;
  17400. const __exports__ = /*#__PURE__*/(0,_media_dijitalcode_3ad9c6e0_4296_4a57_b136_144df49e7bb8_Projects_parkirin_node_modules_vue_loader_dist_exportHelper_js__WEBPACK_IMPORTED_MODULE_3__["default"])(_AppTopBar_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_1__["default"], [['render',_AppTopBar_vue_vue_type_template_id_42bf62a4_scoped_true__WEBPACK_IMPORTED_MODULE_0__.render],['__scopeId',"data-v-42bf62a4"],['__file',"resources/js/components/AppTopBar.vue"]])
  17401. /* hot reload */
  17402. if (false) {}
  17403. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__);
  17404. /***/ }),
  17405. /***/ "./resources/js/layouts/DashboardLayout.vue":
  17406. /*!**************************************************!*\
  17407. !*** ./resources/js/layouts/DashboardLayout.vue ***!
  17408. \**************************************************/
  17409. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17410. "use strict";
  17411. __webpack_require__.r(__webpack_exports__);
  17412. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17413. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17414. /* harmony export */ });
  17415. /* harmony import */ var _DashboardLayout_vue_vue_type_template_id_549bf5ac_scoped_true__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./DashboardLayout.vue?vue&type=template&id=549bf5ac&scoped=true */ "./resources/js/layouts/DashboardLayout.vue?vue&type=template&id=549bf5ac&scoped=true");
  17416. /* harmony import */ var _DashboardLayout_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./DashboardLayout.vue?vue&type=script&setup=true&lang=js */ "./resources/js/layouts/DashboardLayout.vue?vue&type=script&setup=true&lang=js");
  17417. /* harmony import */ var _DashboardLayout_vue_vue_type_style_index_0_id_549bf5ac_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./DashboardLayout.vue?vue&type=style&index=0&id=549bf5ac&lang=scss&scoped=true */ "./resources/js/layouts/DashboardLayout.vue?vue&type=style&index=0&id=549bf5ac&lang=scss&scoped=true");
  17418. /* harmony import */ var _media_dijitalcode_3ad9c6e0_4296_4a57_b136_144df49e7bb8_Projects_parkirin_node_modules_vue_loader_dist_exportHelper_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./node_modules/vue-loader/dist/exportHelper.js */ "./node_modules/vue-loader/dist/exportHelper.js");
  17419. ;
  17420. const __exports__ = /*#__PURE__*/(0,_media_dijitalcode_3ad9c6e0_4296_4a57_b136_144df49e7bb8_Projects_parkirin_node_modules_vue_loader_dist_exportHelper_js__WEBPACK_IMPORTED_MODULE_3__["default"])(_DashboardLayout_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_1__["default"], [['render',_DashboardLayout_vue_vue_type_template_id_549bf5ac_scoped_true__WEBPACK_IMPORTED_MODULE_0__.render],['__scopeId',"data-v-549bf5ac"],['__file',"resources/js/layouts/DashboardLayout.vue"]])
  17421. /* hot reload */
  17422. if (false) {}
  17423. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__);
  17424. /***/ }),
  17425. /***/ "./resources/js/pages/home/Index.vue":
  17426. /*!*******************************************!*\
  17427. !*** ./resources/js/pages/home/Index.vue ***!
  17428. \*******************************************/
  17429. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17430. "use strict";
  17431. __webpack_require__.r(__webpack_exports__);
  17432. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17433. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17434. /* harmony export */ });
  17435. /* harmony import */ var _Index_vue_vue_type_template_id_9329f6aa__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./Index.vue?vue&type=template&id=9329f6aa */ "./resources/js/pages/home/Index.vue?vue&type=template&id=9329f6aa");
  17436. /* harmony import */ var _Index_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./Index.vue?vue&type=script&setup=true&lang=js */ "./resources/js/pages/home/Index.vue?vue&type=script&setup=true&lang=js");
  17437. /* harmony import */ var _media_dijitalcode_3ad9c6e0_4296_4a57_b136_144df49e7bb8_Projects_parkirin_node_modules_vue_loader_dist_exportHelper_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./node_modules/vue-loader/dist/exportHelper.js */ "./node_modules/vue-loader/dist/exportHelper.js");
  17438. ;
  17439. const __exports__ = /*#__PURE__*/(0,_media_dijitalcode_3ad9c6e0_4296_4a57_b136_144df49e7bb8_Projects_parkirin_node_modules_vue_loader_dist_exportHelper_js__WEBPACK_IMPORTED_MODULE_2__["default"])(_Index_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_1__["default"], [['render',_Index_vue_vue_type_template_id_9329f6aa__WEBPACK_IMPORTED_MODULE_0__.render],['__file',"resources/js/pages/home/Index.vue"]])
  17440. /* hot reload */
  17441. if (false) {}
  17442. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__);
  17443. /***/ }),
  17444. /***/ "./resources/js/components/AppMessage.vue?vue&type=script&setup=true&lang=js":
  17445. /*!***********************************************************************************!*\
  17446. !*** ./resources/js/components/AppMessage.vue?vue&type=script&setup=true&lang=js ***!
  17447. \***********************************************************************************/
  17448. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17449. "use strict";
  17450. __webpack_require__.r(__webpack_exports__);
  17451. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17452. /* harmony export */ "default": () => (/* reexport safe */ _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_AppMessage_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_0__["default"])
  17453. /* harmony export */ });
  17454. /* harmony import */ var _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_AppMessage_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!../../../node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./AppMessage.vue?vue&type=script&setup=true&lang=js */ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppMessage.vue?vue&type=script&setup=true&lang=js");
  17455. /***/ }),
  17456. /***/ "./resources/js/components/AppSidebar.vue?vue&type=script&setup=true&lang=js":
  17457. /*!***********************************************************************************!*\
  17458. !*** ./resources/js/components/AppSidebar.vue?vue&type=script&setup=true&lang=js ***!
  17459. \***********************************************************************************/
  17460. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17461. "use strict";
  17462. __webpack_require__.r(__webpack_exports__);
  17463. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17464. /* harmony export */ "default": () => (/* reexport safe */ _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_AppSidebar_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_0__["default"])
  17465. /* harmony export */ });
  17466. /* harmony import */ var _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_AppSidebar_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!../../../node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./AppSidebar.vue?vue&type=script&setup=true&lang=js */ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppSidebar.vue?vue&type=script&setup=true&lang=js");
  17467. /***/ }),
  17468. /***/ "./resources/js/components/AppSubSidebar.vue?vue&type=script&setup=true&lang=js":
  17469. /*!**************************************************************************************!*\
  17470. !*** ./resources/js/components/AppSubSidebar.vue?vue&type=script&setup=true&lang=js ***!
  17471. \**************************************************************************************/
  17472. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17473. "use strict";
  17474. __webpack_require__.r(__webpack_exports__);
  17475. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17476. /* harmony export */ "default": () => (/* reexport safe */ _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_AppSubSidebar_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_0__["default"])
  17477. /* harmony export */ });
  17478. /* harmony import */ var _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_AppSubSidebar_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!../../../node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./AppSubSidebar.vue?vue&type=script&setup=true&lang=js */ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppSubSidebar.vue?vue&type=script&setup=true&lang=js");
  17479. /***/ }),
  17480. /***/ "./resources/js/components/AppTopBar.vue?vue&type=script&setup=true&lang=js":
  17481. /*!**********************************************************************************!*\
  17482. !*** ./resources/js/components/AppTopBar.vue?vue&type=script&setup=true&lang=js ***!
  17483. \**********************************************************************************/
  17484. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17485. "use strict";
  17486. __webpack_require__.r(__webpack_exports__);
  17487. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17488. /* harmony export */ "default": () => (/* reexport safe */ _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_AppTopBar_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_0__["default"])
  17489. /* harmony export */ });
  17490. /* harmony import */ var _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_AppTopBar_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!../../../node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./AppTopBar.vue?vue&type=script&setup=true&lang=js */ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppTopBar.vue?vue&type=script&setup=true&lang=js");
  17491. /***/ }),
  17492. /***/ "./resources/js/layouts/DashboardLayout.vue?vue&type=script&setup=true&lang=js":
  17493. /*!*************************************************************************************!*\
  17494. !*** ./resources/js/layouts/DashboardLayout.vue?vue&type=script&setup=true&lang=js ***!
  17495. \*************************************************************************************/
  17496. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17497. "use strict";
  17498. __webpack_require__.r(__webpack_exports__);
  17499. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17500. /* harmony export */ "default": () => (/* reexport safe */ _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_DashboardLayout_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_0__["default"])
  17501. /* harmony export */ });
  17502. /* harmony import */ var _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_DashboardLayout_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!../../../node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./DashboardLayout.vue?vue&type=script&setup=true&lang=js */ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/layouts/DashboardLayout.vue?vue&type=script&setup=true&lang=js");
  17503. /***/ }),
  17504. /***/ "./resources/js/pages/home/Index.vue?vue&type=script&setup=true&lang=js":
  17505. /*!******************************************************************************!*\
  17506. !*** ./resources/js/pages/home/Index.vue?vue&type=script&setup=true&lang=js ***!
  17507. \******************************************************************************/
  17508. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17509. "use strict";
  17510. __webpack_require__.r(__webpack_exports__);
  17511. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17512. /* harmony export */ "default": () => (/* reexport safe */ _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_Index_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_0__["default"])
  17513. /* harmony export */ });
  17514. /* harmony import */ var _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_Index_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../../node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!../../../../node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./Index.vue?vue&type=script&setup=true&lang=js */ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/pages/home/Index.vue?vue&type=script&setup=true&lang=js");
  17515. /***/ }),
  17516. /***/ "./resources/js/components/AppFooter.vue?vue&type=template&id=4ab6097e&scoped=true":
  17517. /*!*****************************************************************************************!*\
  17518. !*** ./resources/js/components/AppFooter.vue?vue&type=template&id=4ab6097e&scoped=true ***!
  17519. \*****************************************************************************************/
  17520. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17521. "use strict";
  17522. __webpack_require__.r(__webpack_exports__);
  17523. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17524. /* harmony export */ "render": () => (/* reexport safe */ _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_templateLoader_js_ruleSet_1_rules_2_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_AppFooter_vue_vue_type_template_id_4ab6097e_scoped_true__WEBPACK_IMPORTED_MODULE_0__.render)
  17525. /* harmony export */ });
  17526. /* harmony import */ var _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_templateLoader_js_ruleSet_1_rules_2_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_AppFooter_vue_vue_type_template_id_4ab6097e_scoped_true__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!../../../node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!../../../node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./AppFooter.vue?vue&type=template&id=4ab6097e&scoped=true */ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppFooter.vue?vue&type=template&id=4ab6097e&scoped=true");
  17527. /***/ }),
  17528. /***/ "./resources/js/components/AppMessage.vue?vue&type=template&id=07159051":
  17529. /*!******************************************************************************!*\
  17530. !*** ./resources/js/components/AppMessage.vue?vue&type=template&id=07159051 ***!
  17531. \******************************************************************************/
  17532. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17533. "use strict";
  17534. __webpack_require__.r(__webpack_exports__);
  17535. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17536. /* harmony export */ "render": () => (/* reexport safe */ _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_templateLoader_js_ruleSet_1_rules_2_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_AppMessage_vue_vue_type_template_id_07159051__WEBPACK_IMPORTED_MODULE_0__.render)
  17537. /* harmony export */ });
  17538. /* harmony import */ var _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_templateLoader_js_ruleSet_1_rules_2_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_AppMessage_vue_vue_type_template_id_07159051__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!../../../node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!../../../node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./AppMessage.vue?vue&type=template&id=07159051 */ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppMessage.vue?vue&type=template&id=07159051");
  17539. /***/ }),
  17540. /***/ "./resources/js/components/AppSidebar.vue?vue&type=template&id=22a4e926&scoped=true":
  17541. /*!******************************************************************************************!*\
  17542. !*** ./resources/js/components/AppSidebar.vue?vue&type=template&id=22a4e926&scoped=true ***!
  17543. \******************************************************************************************/
  17544. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17545. "use strict";
  17546. __webpack_require__.r(__webpack_exports__);
  17547. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17548. /* harmony export */ "render": () => (/* reexport safe */ _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_templateLoader_js_ruleSet_1_rules_2_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_AppSidebar_vue_vue_type_template_id_22a4e926_scoped_true__WEBPACK_IMPORTED_MODULE_0__.render)
  17549. /* harmony export */ });
  17550. /* harmony import */ var _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_templateLoader_js_ruleSet_1_rules_2_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_AppSidebar_vue_vue_type_template_id_22a4e926_scoped_true__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!../../../node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!../../../node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./AppSidebar.vue?vue&type=template&id=22a4e926&scoped=true */ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppSidebar.vue?vue&type=template&id=22a4e926&scoped=true");
  17551. /***/ }),
  17552. /***/ "./resources/js/components/AppSubSidebar.vue?vue&type=template&id=0addd9bc&scoped=true":
  17553. /*!*********************************************************************************************!*\
  17554. !*** ./resources/js/components/AppSubSidebar.vue?vue&type=template&id=0addd9bc&scoped=true ***!
  17555. \*********************************************************************************************/
  17556. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17557. "use strict";
  17558. __webpack_require__.r(__webpack_exports__);
  17559. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17560. /* harmony export */ "render": () => (/* reexport safe */ _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_templateLoader_js_ruleSet_1_rules_2_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_AppSubSidebar_vue_vue_type_template_id_0addd9bc_scoped_true__WEBPACK_IMPORTED_MODULE_0__.render)
  17561. /* harmony export */ });
  17562. /* harmony import */ var _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_templateLoader_js_ruleSet_1_rules_2_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_AppSubSidebar_vue_vue_type_template_id_0addd9bc_scoped_true__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!../../../node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!../../../node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./AppSubSidebar.vue?vue&type=template&id=0addd9bc&scoped=true */ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppSubSidebar.vue?vue&type=template&id=0addd9bc&scoped=true");
  17563. /***/ }),
  17564. /***/ "./resources/js/components/AppTopBar.vue?vue&type=template&id=42bf62a4&scoped=true":
  17565. /*!*****************************************************************************************!*\
  17566. !*** ./resources/js/components/AppTopBar.vue?vue&type=template&id=42bf62a4&scoped=true ***!
  17567. \*****************************************************************************************/
  17568. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17569. "use strict";
  17570. __webpack_require__.r(__webpack_exports__);
  17571. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17572. /* harmony export */ "render": () => (/* reexport safe */ _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_templateLoader_js_ruleSet_1_rules_2_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_AppTopBar_vue_vue_type_template_id_42bf62a4_scoped_true__WEBPACK_IMPORTED_MODULE_0__.render)
  17573. /* harmony export */ });
  17574. /* harmony import */ var _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_templateLoader_js_ruleSet_1_rules_2_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_AppTopBar_vue_vue_type_template_id_42bf62a4_scoped_true__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!../../../node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!../../../node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./AppTopBar.vue?vue&type=template&id=42bf62a4&scoped=true */ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppTopBar.vue?vue&type=template&id=42bf62a4&scoped=true");
  17575. /***/ }),
  17576. /***/ "./resources/js/layouts/DashboardLayout.vue?vue&type=template&id=549bf5ac&scoped=true":
  17577. /*!********************************************************************************************!*\
  17578. !*** ./resources/js/layouts/DashboardLayout.vue?vue&type=template&id=549bf5ac&scoped=true ***!
  17579. \********************************************************************************************/
  17580. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17581. "use strict";
  17582. __webpack_require__.r(__webpack_exports__);
  17583. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17584. /* harmony export */ "render": () => (/* reexport safe */ _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_templateLoader_js_ruleSet_1_rules_2_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_DashboardLayout_vue_vue_type_template_id_549bf5ac_scoped_true__WEBPACK_IMPORTED_MODULE_0__.render)
  17585. /* harmony export */ });
  17586. /* harmony import */ var _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_templateLoader_js_ruleSet_1_rules_2_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_DashboardLayout_vue_vue_type_template_id_549bf5ac_scoped_true__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!../../../node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!../../../node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./DashboardLayout.vue?vue&type=template&id=549bf5ac&scoped=true */ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/layouts/DashboardLayout.vue?vue&type=template&id=549bf5ac&scoped=true");
  17587. /***/ }),
  17588. /***/ "./resources/js/pages/home/Index.vue?vue&type=template&id=9329f6aa":
  17589. /*!*************************************************************************!*\
  17590. !*** ./resources/js/pages/home/Index.vue?vue&type=template&id=9329f6aa ***!
  17591. \*************************************************************************/
  17592. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17593. "use strict";
  17594. __webpack_require__.r(__webpack_exports__);
  17595. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17596. /* harmony export */ "render": () => (/* reexport safe */ _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_templateLoader_js_ruleSet_1_rules_2_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_Index_vue_vue_type_template_id_9329f6aa__WEBPACK_IMPORTED_MODULE_0__.render)
  17597. /* harmony export */ });
  17598. /* harmony import */ var _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_templateLoader_js_ruleSet_1_rules_2_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_Index_vue_vue_type_template_id_9329f6aa__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../../node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!../../../../node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!../../../../node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./Index.vue?vue&type=template&id=9329f6aa */ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/pages/home/Index.vue?vue&type=template&id=9329f6aa");
  17599. /***/ }),
  17600. /***/ "./resources/js/components/AppFooter.vue?vue&type=style&index=0&id=4ab6097e&lang=scss&scoped=true":
  17601. /*!********************************************************************************************************!*\
  17602. !*** ./resources/js/components/AppFooter.vue?vue&type=style&index=0&id=4ab6097e&lang=scss&scoped=true ***!
  17603. \********************************************************************************************************/
  17604. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17605. "use strict";
  17606. __webpack_require__.r(__webpack_exports__);
  17607. /* harmony import */ var _node_modules_style_loader_dist_cjs_js_node_modules_css_loader_dist_cjs_js_clonedRuleSet_11_use_1_node_modules_vue_loader_dist_stylePostLoader_js_node_modules_postcss_loader_dist_cjs_js_clonedRuleSet_11_use_2_node_modules_sass_loader_dist_cjs_js_clonedRuleSet_11_use_3_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_AppFooter_vue_vue_type_style_index_0_id_4ab6097e_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../node_modules/style-loader/dist/cjs.js!../../../node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!../../../node_modules/vue-loader/dist/stylePostLoader.js!../../../node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!../../../node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!../../../node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./AppFooter.vue?vue&type=style&index=0&id=4ab6097e&lang=scss&scoped=true */ "./node_modules/style-loader/dist/cjs.js!./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppFooter.vue?vue&type=style&index=0&id=4ab6097e&lang=scss&scoped=true");
  17608. /***/ }),
  17609. /***/ "./resources/js/components/AppSidebar.vue?vue&type=style&index=0&id=22a4e926&lang=scss&scoped=true":
  17610. /*!*********************************************************************************************************!*\
  17611. !*** ./resources/js/components/AppSidebar.vue?vue&type=style&index=0&id=22a4e926&lang=scss&scoped=true ***!
  17612. \*********************************************************************************************************/
  17613. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17614. "use strict";
  17615. __webpack_require__.r(__webpack_exports__);
  17616. /* harmony import */ var _node_modules_style_loader_dist_cjs_js_node_modules_css_loader_dist_cjs_js_clonedRuleSet_11_use_1_node_modules_vue_loader_dist_stylePostLoader_js_node_modules_postcss_loader_dist_cjs_js_clonedRuleSet_11_use_2_node_modules_sass_loader_dist_cjs_js_clonedRuleSet_11_use_3_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_AppSidebar_vue_vue_type_style_index_0_id_22a4e926_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../node_modules/style-loader/dist/cjs.js!../../../node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!../../../node_modules/vue-loader/dist/stylePostLoader.js!../../../node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!../../../node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!../../../node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./AppSidebar.vue?vue&type=style&index=0&id=22a4e926&lang=scss&scoped=true */ "./node_modules/style-loader/dist/cjs.js!./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppSidebar.vue?vue&type=style&index=0&id=22a4e926&lang=scss&scoped=true");
  17617. /***/ }),
  17618. /***/ "./resources/js/components/AppSubSidebar.vue?vue&type=style&index=0&id=0addd9bc&lang=scss&scoped=true":
  17619. /*!************************************************************************************************************!*\
  17620. !*** ./resources/js/components/AppSubSidebar.vue?vue&type=style&index=0&id=0addd9bc&lang=scss&scoped=true ***!
  17621. \************************************************************************************************************/
  17622. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17623. "use strict";
  17624. __webpack_require__.r(__webpack_exports__);
  17625. /* harmony import */ var _node_modules_style_loader_dist_cjs_js_node_modules_css_loader_dist_cjs_js_clonedRuleSet_11_use_1_node_modules_vue_loader_dist_stylePostLoader_js_node_modules_postcss_loader_dist_cjs_js_clonedRuleSet_11_use_2_node_modules_sass_loader_dist_cjs_js_clonedRuleSet_11_use_3_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_AppSubSidebar_vue_vue_type_style_index_0_id_0addd9bc_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../node_modules/style-loader/dist/cjs.js!../../../node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!../../../node_modules/vue-loader/dist/stylePostLoader.js!../../../node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!../../../node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!../../../node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./AppSubSidebar.vue?vue&type=style&index=0&id=0addd9bc&lang=scss&scoped=true */ "./node_modules/style-loader/dist/cjs.js!./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppSubSidebar.vue?vue&type=style&index=0&id=0addd9bc&lang=scss&scoped=true");
  17626. /***/ }),
  17627. /***/ "./resources/js/components/AppTopBar.vue?vue&type=style&index=0&id=42bf62a4&lang=scss&scoped=true":
  17628. /*!********************************************************************************************************!*\
  17629. !*** ./resources/js/components/AppTopBar.vue?vue&type=style&index=0&id=42bf62a4&lang=scss&scoped=true ***!
  17630. \********************************************************************************************************/
  17631. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17632. "use strict";
  17633. __webpack_require__.r(__webpack_exports__);
  17634. /* harmony import */ var _node_modules_style_loader_dist_cjs_js_node_modules_css_loader_dist_cjs_js_clonedRuleSet_11_use_1_node_modules_vue_loader_dist_stylePostLoader_js_node_modules_postcss_loader_dist_cjs_js_clonedRuleSet_11_use_2_node_modules_sass_loader_dist_cjs_js_clonedRuleSet_11_use_3_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_AppTopBar_vue_vue_type_style_index_0_id_42bf62a4_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../node_modules/style-loader/dist/cjs.js!../../../node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!../../../node_modules/vue-loader/dist/stylePostLoader.js!../../../node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!../../../node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!../../../node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./AppTopBar.vue?vue&type=style&index=0&id=42bf62a4&lang=scss&scoped=true */ "./node_modules/style-loader/dist/cjs.js!./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppTopBar.vue?vue&type=style&index=0&id=42bf62a4&lang=scss&scoped=true");
  17635. /***/ }),
  17636. /***/ "./resources/js/layouts/DashboardLayout.vue?vue&type=style&index=0&id=549bf5ac&lang=scss&scoped=true":
  17637. /*!***********************************************************************************************************!*\
  17638. !*** ./resources/js/layouts/DashboardLayout.vue?vue&type=style&index=0&id=549bf5ac&lang=scss&scoped=true ***!
  17639. \***********************************************************************************************************/
  17640. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17641. "use strict";
  17642. __webpack_require__.r(__webpack_exports__);
  17643. /* harmony import */ var _node_modules_style_loader_dist_cjs_js_node_modules_css_loader_dist_cjs_js_clonedRuleSet_11_use_1_node_modules_vue_loader_dist_stylePostLoader_js_node_modules_postcss_loader_dist_cjs_js_clonedRuleSet_11_use_2_node_modules_sass_loader_dist_cjs_js_clonedRuleSet_11_use_3_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_DashboardLayout_vue_vue_type_style_index_0_id_549bf5ac_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../node_modules/style-loader/dist/cjs.js!../../../node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!../../../node_modules/vue-loader/dist/stylePostLoader.js!../../../node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!../../../node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!../../../node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./DashboardLayout.vue?vue&type=style&index=0&id=549bf5ac&lang=scss&scoped=true */ "./node_modules/style-loader/dist/cjs.js!./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/layouts/DashboardLayout.vue?vue&type=style&index=0&id=549bf5ac&lang=scss&scoped=true");
  17644. /***/ })
  17645. }]);