resources_js_pages_home_Index_vue.js 677KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418441944204421442244234424442544264427442844294430443144324433443444354436443744384439444044414442444344444445444644474448444944504451445244534454445544564457445844594460446144624463446444654466446744684469447044714472447344744475447644774478447944804481448244834484448544864487448844894490449144924493449444954496449744984499450045014502450345044505450645074508450945104511451245134514451545164517451845194520452145224523452445254526452745284529453045314532453345344535453645374538453945404541454245434544454545464547454845494550455145524553455445554556455745584559456045614562456345644565456645674568456945704571457245734574457545764577457845794580458145824583458445854586458745884589459045914592459345944595459645974598459946004601460246034604460546064607460846094610461146124613461446154616461746184619462046214622462346244625462646274628462946304631463246334634463546364637463846394640464146424643464446454646464746484649465046514652465346544655465646574658465946604661466246634664466546664667466846694670467146724673467446754676467746784679468046814682468346844685468646874688468946904691469246934694469546964697469846994700470147024703470447054706470747084709471047114712471347144715471647174718471947204721472247234724472547264727472847294730473147324733473447354736473747384739474047414742474347444745474647474748474947504751475247534754475547564757475847594760476147624763476447654766476747684769477047714772477347744775477647774778477947804781478247834784478547864787478847894790479147924793479447954796479747984799480048014802480348044805480648074808480948104811481248134814481548164817481848194820482148224823482448254826482748284829483048314832483348344835483648374838483948404841484248434844484548464847484848494850485148524853485448554856485748584859486048614862486348644865486648674868486948704871487248734874487548764877487848794880488148824883488448854886488748884889489048914892489348944895489648974898489949004901490249034904490549064907490849094910491149124913491449154916491749184919492049214922492349244925492649274928492949304931493249334934493549364937493849394940494149424943494449454946494749484949495049514952495349544955495649574958495949604961496249634964496549664967496849694970497149724973497449754976497749784979498049814982498349844985498649874988498949904991499249934994499549964997499849995000500150025003500450055006500750085009501050115012501350145015501650175018501950205021502250235024502550265027502850295030503150325033503450355036503750385039504050415042504350445045504650475048504950505051505250535054505550565057505850595060506150625063506450655066506750685069507050715072507350745075507650775078507950805081508250835084508550865087508850895090509150925093509450955096509750985099510051015102510351045105510651075108510951105111511251135114511551165117511851195120512151225123512451255126512751285129513051315132513351345135513651375138513951405141514251435144514551465147514851495150515151525153515451555156515751585159516051615162516351645165516651675168516951705171517251735174517551765177517851795180518151825183518451855186518751885189519051915192519351945195519651975198519952005201520252035204520552065207520852095210521152125213521452155216521752185219522052215222522352245225522652275228522952305231523252335234523552365237523852395240524152425243524452455246524752485249525052515252525352545255525652575258525952605261526252635264526552665267526852695270527152725273527452755276527752785279528052815282528352845285528652875288528952905291529252935294529552965297529852995300530153025303530453055306530753085309531053115312531353145315531653175318531953205321532253235324532553265327532853295330533153325333533453355336533753385339534053415342534353445345534653475348534953505351535253535354535553565357535853595360536153625363536453655366536753685369537053715372537353745375537653775378537953805381538253835384538553865387538853895390539153925393539453955396539753985399540054015402540354045405540654075408540954105411541254135414541554165417541854195420542154225423542454255426542754285429543054315432543354345435543654375438543954405441544254435444544554465447544854495450545154525453545454555456545754585459546054615462546354645465546654675468546954705471547254735474547554765477547854795480548154825483548454855486548754885489549054915492549354945495549654975498549955005501550255035504550555065507550855095510551155125513551455155516551755185519552055215522552355245525552655275528552955305531553255335534553555365537553855395540554155425543554455455546554755485549555055515552555355545555555655575558555955605561556255635564556555665567556855695570557155725573557455755576557755785579558055815582558355845585558655875588558955905591559255935594559555965597559855995600560156025603560456055606560756085609561056115612561356145615561656175618561956205621562256235624562556265627562856295630563156325633563456355636563756385639564056415642564356445645564656475648564956505651565256535654565556565657565856595660566156625663566456655666566756685669567056715672567356745675567656775678567956805681568256835684568556865687568856895690569156925693569456955696569756985699570057015702570357045705570657075708570957105711571257135714571557165717571857195720572157225723572457255726572757285729573057315732573357345735573657375738573957405741574257435744574557465747574857495750575157525753575457555756575757585759576057615762576357645765576657675768576957705771577257735774577557765777577857795780578157825783578457855786578757885789579057915792579357945795579657975798579958005801580258035804580558065807580858095810581158125813581458155816581758185819582058215822582358245825582658275828582958305831583258335834583558365837583858395840584158425843584458455846584758485849585058515852585358545855585658575858585958605861586258635864586558665867586858695870587158725873587458755876587758785879588058815882588358845885588658875888588958905891589258935894589558965897589858995900590159025903590459055906590759085909591059115912591359145915591659175918591959205921592259235924592559265927592859295930593159325933593459355936593759385939594059415942594359445945594659475948594959505951595259535954595559565957595859595960596159625963596459655966596759685969597059715972597359745975597659775978597959805981598259835984598559865987598859895990599159925993599459955996599759985999600060016002600360046005600660076008600960106011601260136014601560166017601860196020602160226023602460256026602760286029603060316032603360346035603660376038603960406041604260436044604560466047604860496050605160526053605460556056605760586059606060616062606360646065606660676068606960706071607260736074607560766077607860796080608160826083608460856086608760886089609060916092609360946095609660976098609961006101610261036104610561066107610861096110611161126113611461156116611761186119612061216122612361246125612661276128612961306131613261336134613561366137613861396140614161426143614461456146614761486149615061516152615361546155615661576158615961606161616261636164616561666167616861696170617161726173617461756176617761786179618061816182618361846185618661876188618961906191619261936194619561966197619861996200620162026203620462056206620762086209621062116212621362146215621662176218621962206221622262236224622562266227622862296230623162326233623462356236623762386239624062416242624362446245624662476248624962506251625262536254625562566257625862596260626162626263626462656266626762686269627062716272627362746275627662776278627962806281628262836284628562866287628862896290629162926293629462956296629762986299630063016302630363046305630663076308630963106311631263136314631563166317631863196320632163226323632463256326632763286329633063316332633363346335633663376338633963406341634263436344634563466347634863496350635163526353635463556356635763586359636063616362636363646365636663676368636963706371637263736374637563766377637863796380638163826383638463856386638763886389639063916392639363946395639663976398639964006401640264036404640564066407640864096410641164126413641464156416641764186419642064216422642364246425642664276428642964306431643264336434643564366437643864396440644164426443644464456446644764486449645064516452645364546455645664576458645964606461646264636464646564666467646864696470647164726473647464756476647764786479648064816482648364846485648664876488648964906491649264936494649564966497649864996500650165026503650465056506650765086509651065116512651365146515651665176518651965206521652265236524652565266527652865296530653165326533653465356536653765386539654065416542654365446545654665476548654965506551655265536554655565566557655865596560656165626563656465656566656765686569657065716572657365746575657665776578657965806581658265836584658565866587658865896590659165926593659465956596659765986599660066016602660366046605660666076608660966106611661266136614661566166617661866196620662166226623662466256626662766286629663066316632663366346635663666376638663966406641664266436644664566466647664866496650665166526653665466556656665766586659666066616662666366646665666666676668666966706671667266736674667566766677667866796680668166826683668466856686668766886689669066916692669366946695669666976698669967006701670267036704670567066707670867096710671167126713671467156716671767186719672067216722672367246725672667276728672967306731673267336734673567366737673867396740674167426743674467456746674767486749675067516752675367546755675667576758675967606761676267636764676567666767676867696770677167726773677467756776677767786779678067816782678367846785678667876788678967906791679267936794679567966797679867996800680168026803680468056806680768086809681068116812681368146815681668176818681968206821682268236824682568266827682868296830683168326833683468356836683768386839684068416842684368446845684668476848684968506851685268536854685568566857685868596860686168626863686468656866686768686869687068716872687368746875687668776878687968806881688268836884688568866887688868896890689168926893689468956896689768986899690069016902690369046905690669076908690969106911691269136914691569166917691869196920692169226923692469256926692769286929693069316932693369346935693669376938693969406941694269436944694569466947694869496950695169526953695469556956695769586959696069616962696369646965696669676968696969706971697269736974697569766977697869796980698169826983698469856986698769886989699069916992699369946995699669976998699970007001700270037004700570067007700870097010701170127013701470157016701770187019702070217022702370247025702670277028702970307031703270337034703570367037703870397040704170427043704470457046704770487049705070517052705370547055705670577058705970607061706270637064706570667067706870697070707170727073707470757076707770787079708070817082708370847085708670877088708970907091709270937094709570967097709870997100710171027103710471057106710771087109711071117112711371147115711671177118711971207121712271237124712571267127712871297130713171327133713471357136713771387139714071417142714371447145714671477148714971507151715271537154715571567157715871597160716171627163716471657166716771687169717071717172717371747175717671777178717971807181718271837184718571867187718871897190719171927193719471957196719771987199720072017202720372047205720672077208720972107211721272137214721572167217721872197220722172227223722472257226722772287229723072317232723372347235723672377238723972407241724272437244724572467247724872497250725172527253725472557256725772587259726072617262726372647265726672677268726972707271727272737274727572767277727872797280728172827283728472857286728772887289729072917292729372947295729672977298729973007301730273037304730573067307730873097310731173127313731473157316731773187319732073217322732373247325732673277328732973307331733273337334733573367337733873397340734173427343734473457346734773487349735073517352735373547355735673577358735973607361736273637364736573667367736873697370737173727373737473757376737773787379738073817382738373847385738673877388738973907391739273937394739573967397739873997400740174027403740474057406740774087409741074117412741374147415741674177418741974207421742274237424742574267427742874297430743174327433743474357436743774387439744074417442744374447445744674477448744974507451745274537454745574567457745874597460746174627463746474657466746774687469747074717472747374747475747674777478747974807481748274837484748574867487748874897490749174927493749474957496749774987499750075017502750375047505750675077508750975107511751275137514751575167517751875197520752175227523752475257526752775287529753075317532753375347535753675377538753975407541754275437544754575467547754875497550755175527553755475557556755775587559756075617562756375647565756675677568756975707571757275737574757575767577757875797580758175827583758475857586758775887589759075917592759375947595759675977598759976007601760276037604760576067607760876097610761176127613761476157616761776187619762076217622762376247625762676277628762976307631763276337634763576367637763876397640764176427643764476457646764776487649765076517652765376547655765676577658765976607661766276637664766576667667766876697670767176727673767476757676767776787679768076817682768376847685768676877688768976907691769276937694769576967697769876997700770177027703770477057706770777087709771077117712771377147715771677177718771977207721772277237724772577267727772877297730773177327733773477357736773777387739774077417742774377447745774677477748774977507751775277537754775577567757775877597760776177627763776477657766776777687769777077717772777377747775777677777778777977807781778277837784778577867787778877897790779177927793779477957796779777987799780078017802780378047805780678077808780978107811781278137814781578167817781878197820782178227823782478257826782778287829783078317832783378347835783678377838783978407841784278437844784578467847784878497850785178527853785478557856785778587859786078617862786378647865786678677868786978707871787278737874787578767877787878797880788178827883788478857886788778887889789078917892789378947895789678977898789979007901790279037904790579067907790879097910791179127913791479157916791779187919792079217922792379247925792679277928792979307931793279337934793579367937793879397940794179427943794479457946794779487949795079517952795379547955795679577958795979607961796279637964796579667967796879697970797179727973797479757976797779787979798079817982798379847985798679877988798979907991799279937994799579967997799879998000800180028003800480058006800780088009801080118012801380148015801680178018801980208021802280238024802580268027802880298030803180328033803480358036803780388039804080418042804380448045804680478048804980508051805280538054805580568057805880598060806180628063806480658066806780688069807080718072807380748075807680778078807980808081808280838084808580868087808880898090809180928093809480958096809780988099810081018102810381048105810681078108810981108111811281138114811581168117811881198120812181228123812481258126812781288129813081318132813381348135813681378138813981408141814281438144814581468147814881498150815181528153815481558156815781588159816081618162816381648165816681678168816981708171817281738174817581768177817881798180818181828183818481858186818781888189819081918192819381948195819681978198819982008201820282038204820582068207820882098210821182128213821482158216821782188219822082218222822382248225822682278228822982308231823282338234823582368237823882398240824182428243824482458246824782488249825082518252825382548255825682578258825982608261826282638264826582668267826882698270827182728273827482758276827782788279828082818282828382848285828682878288828982908291829282938294829582968297829882998300830183028303830483058306830783088309831083118312831383148315831683178318831983208321832283238324832583268327832883298330833183328333833483358336833783388339834083418342834383448345834683478348834983508351835283538354835583568357835883598360836183628363836483658366836783688369837083718372837383748375837683778378837983808381838283838384838583868387838883898390839183928393839483958396839783988399840084018402840384048405840684078408840984108411841284138414841584168417841884198420842184228423842484258426842784288429843084318432843384348435843684378438843984408441844284438444844584468447844884498450845184528453845484558456845784588459846084618462846384648465846684678468846984708471847284738474847584768477847884798480848184828483848484858486848784888489849084918492849384948495849684978498849985008501850285038504850585068507850885098510851185128513851485158516851785188519852085218522852385248525852685278528852985308531853285338534853585368537853885398540854185428543854485458546854785488549855085518552855385548555855685578558855985608561856285638564856585668567856885698570857185728573857485758576857785788579858085818582858385848585858685878588858985908591859285938594859585968597859885998600860186028603860486058606860786088609861086118612861386148615861686178618861986208621862286238624862586268627862886298630863186328633863486358636863786388639864086418642864386448645864686478648864986508651865286538654865586568657865886598660866186628663866486658666866786688669867086718672867386748675867686778678867986808681868286838684868586868687868886898690869186928693869486958696869786988699870087018702870387048705870687078708870987108711871287138714871587168717871887198720872187228723872487258726872787288729873087318732873387348735873687378738873987408741874287438744874587468747874887498750875187528753875487558756875787588759876087618762876387648765876687678768876987708771877287738774877587768777877887798780878187828783878487858786878787888789879087918792879387948795879687978798879988008801880288038804880588068807880888098810881188128813881488158816881788188819882088218822882388248825882688278828882988308831883288338834883588368837883888398840884188428843884488458846884788488849885088518852885388548855885688578858885988608861886288638864886588668867886888698870887188728873887488758876887788788879888088818882888388848885888688878888888988908891889288938894889588968897889888998900890189028903890489058906890789088909891089118912891389148915891689178918891989208921892289238924892589268927892889298930893189328933893489358936893789388939894089418942894389448945894689478948894989508951895289538954895589568957895889598960896189628963896489658966896789688969897089718972897389748975897689778978897989808981898289838984898589868987898889898990899189928993899489958996899789988999900090019002900390049005900690079008900990109011901290139014901590169017901890199020902190229023902490259026902790289029903090319032903390349035903690379038903990409041904290439044904590469047904890499050905190529053905490559056905790589059906090619062906390649065906690679068906990709071907290739074907590769077907890799080908190829083908490859086908790889089909090919092909390949095909690979098909991009101910291039104910591069107910891099110911191129113911491159116911791189119912091219122912391249125912691279128912991309131913291339134913591369137913891399140914191429143914491459146914791489149915091519152915391549155915691579158915991609161916291639164916591669167916891699170917191729173917491759176917791789179918091819182918391849185918691879188918991909191919291939194919591969197919891999200920192029203920492059206920792089209921092119212921392149215921692179218921992209221922292239224922592269227922892299230923192329233923492359236923792389239924092419242924392449245924692479248924992509251925292539254925592569257925892599260926192629263926492659266926792689269927092719272927392749275927692779278927992809281928292839284928592869287928892899290929192929293929492959296929792989299930093019302930393049305930693079308930993109311931293139314931593169317931893199320932193229323932493259326932793289329933093319332933393349335933693379338933993409341934293439344934593469347934893499350935193529353935493559356935793589359936093619362936393649365936693679368936993709371937293739374937593769377937893799380938193829383938493859386938793889389939093919392939393949395939693979398939994009401940294039404940594069407940894099410941194129413941494159416941794189419942094219422942394249425942694279428942994309431943294339434943594369437943894399440944194429443944494459446944794489449945094519452945394549455945694579458945994609461946294639464946594669467946894699470947194729473947494759476947794789479948094819482948394849485948694879488948994909491949294939494949594969497949894999500950195029503950495059506950795089509951095119512951395149515951695179518951995209521952295239524952595269527952895299530953195329533953495359536953795389539954095419542954395449545954695479548954995509551955295539554955595569557955895599560956195629563956495659566956795689569957095719572957395749575957695779578957995809581958295839584958595869587958895899590959195929593959495959596959795989599960096019602960396049605960696079608960996109611961296139614961596169617961896199620962196229623962496259626962796289629963096319632963396349635963696379638963996409641964296439644964596469647964896499650965196529653965496559656965796589659966096619662966396649665966696679668966996709671967296739674967596769677967896799680968196829683968496859686968796889689969096919692969396949695969696979698969997009701970297039704970597069707970897099710971197129713971497159716971797189719972097219722972397249725972697279728972997309731973297339734973597369737973897399740974197429743974497459746974797489749975097519752975397549755975697579758975997609761976297639764976597669767976897699770977197729773977497759776977797789779978097819782978397849785978697879788978997909791979297939794979597969797979897999800980198029803980498059806980798089809981098119812981398149815981698179818981998209821982298239824982598269827982898299830983198329833983498359836983798389839984098419842984398449845984698479848984998509851985298539854985598569857985898599860986198629863986498659866986798689869987098719872987398749875987698779878987998809881988298839884988598869887988898899890989198929893989498959896989798989899990099019902990399049905990699079908990999109911991299139914991599169917991899199920992199229923992499259926992799289929993099319932993399349935993699379938993999409941994299439944994599469947994899499950995199529953995499559956995799589959996099619962996399649965996699679968996999709971997299739974997599769977997899799980998199829983998499859986998799889989999099919992999399949995999699979998999910000100011000210003100041000510006100071000810009100101001110012100131001410015100161001710018100191002010021100221002310024100251002610027100281002910030100311003210033100341003510036100371003810039100401004110042100431004410045100461004710048100491005010051100521005310054100551005610057100581005910060100611006210063100641006510066100671006810069100701007110072100731007410075100761007710078100791008010081100821008310084100851008610087100881008910090100911009210093100941009510096100971009810099101001010110102101031010410105101061010710108101091011010111101121011310114101151011610117101181011910120101211012210123101241012510126101271012810129101301013110132101331013410135101361013710138101391014010141101421014310144101451014610147101481014910150101511015210153101541015510156101571015810159101601016110162101631016410165101661016710168101691017010171101721017310174101751017610177101781017910180101811018210183101841018510186101871018810189101901019110192101931019410195101961019710198101991020010201102021020310204102051020610207102081020910210102111021210213102141021510216102171021810219102201022110222102231022410225102261022710228102291023010231102321023310234102351023610237102381023910240102411024210243102441024510246102471024810249102501025110252102531025410255102561025710258102591026010261102621026310264102651026610267102681026910270102711027210273102741027510276102771027810279102801028110282102831028410285102861028710288102891029010291102921029310294102951029610297102981029910300103011030210303103041030510306103071030810309103101031110312103131031410315103161031710318103191032010321103221032310324103251032610327103281032910330103311033210333103341033510336103371033810339103401034110342103431034410345103461034710348103491035010351103521035310354103551035610357103581035910360103611036210363103641036510366103671036810369103701037110372103731037410375103761037710378103791038010381103821038310384103851038610387103881038910390103911039210393103941039510396103971039810399104001040110402104031040410405104061040710408104091041010411104121041310414104151041610417104181041910420104211042210423104241042510426104271042810429104301043110432104331043410435104361043710438104391044010441104421044310444104451044610447104481044910450104511045210453104541045510456104571045810459104601046110462104631046410465104661046710468104691047010471104721047310474104751047610477104781047910480104811048210483104841048510486104871048810489104901049110492104931049410495104961049710498104991050010501105021050310504105051050610507105081050910510105111051210513105141051510516105171051810519105201052110522105231052410525105261052710528105291053010531105321053310534105351053610537105381053910540105411054210543105441054510546105471054810549105501055110552105531055410555105561055710558105591056010561105621056310564105651056610567105681056910570105711057210573105741057510576105771057810579105801058110582105831058410585105861058710588105891059010591105921059310594105951059610597105981059910600106011060210603106041060510606106071060810609106101061110612106131061410615106161061710618106191062010621106221062310624106251062610627106281062910630106311063210633106341063510636106371063810639106401064110642106431064410645106461064710648106491065010651106521065310654106551065610657106581065910660106611066210663106641066510666106671066810669106701067110672106731067410675106761067710678106791068010681106821068310684106851068610687106881068910690106911069210693106941069510696106971069810699107001070110702107031070410705107061070710708107091071010711107121071310714107151071610717107181071910720107211072210723107241072510726107271072810729107301073110732107331073410735107361073710738107391074010741107421074310744107451074610747107481074910750107511075210753107541075510756107571075810759107601076110762107631076410765107661076710768107691077010771107721077310774107751077610777107781077910780107811078210783107841078510786107871078810789107901079110792107931079410795107961079710798107991080010801108021080310804108051080610807108081080910810108111081210813108141081510816108171081810819108201082110822108231082410825108261082710828108291083010831108321083310834108351083610837108381083910840108411084210843108441084510846108471084810849108501085110852108531085410855108561085710858108591086010861108621086310864108651086610867108681086910870108711087210873108741087510876108771087810879108801088110882108831088410885108861088710888108891089010891108921089310894108951089610897108981089910900109011090210903109041090510906109071090810909109101091110912109131091410915109161091710918109191092010921109221092310924109251092610927109281092910930109311093210933109341093510936109371093810939109401094110942109431094410945109461094710948109491095010951109521095310954109551095610957109581095910960109611096210963109641096510966109671096810969109701097110972109731097410975109761097710978109791098010981109821098310984109851098610987109881098910990109911099210993109941099510996109971099810999110001100111002110031100411005110061100711008110091101011011110121101311014110151101611017110181101911020110211102211023110241102511026110271102811029110301103111032110331103411035110361103711038110391104011041110421104311044110451104611047110481104911050110511105211053110541105511056110571105811059110601106111062110631106411065110661106711068110691107011071110721107311074110751107611077110781107911080110811108211083110841108511086110871108811089110901109111092110931109411095110961109711098110991110011101111021110311104111051110611107111081110911110111111111211113111141111511116111171111811119111201112111122111231112411125111261112711128111291113011131111321113311134111351113611137111381113911140111411114211143111441114511146111471114811149111501115111152111531115411155111561115711158111591116011161111621116311164111651116611167111681116911170111711117211173111741117511176111771117811179111801118111182111831118411185111861118711188111891119011191111921119311194111951119611197111981119911200112011120211203112041120511206112071120811209112101121111212112131121411215112161121711218112191122011221112221122311224112251122611227112281122911230112311123211233112341123511236112371123811239112401124111242112431124411245112461124711248112491125011251112521125311254112551125611257112581125911260112611126211263112641126511266112671126811269112701127111272112731127411275112761127711278112791128011281112821128311284112851128611287112881128911290112911129211293112941129511296112971129811299113001130111302113031130411305113061130711308113091131011311113121131311314113151131611317113181131911320113211132211323113241132511326113271132811329113301133111332113331133411335113361133711338113391134011341113421134311344113451134611347113481134911350113511135211353113541135511356113571135811359113601136111362113631136411365113661136711368113691137011371113721137311374113751137611377113781137911380113811138211383113841138511386113871138811389113901139111392113931139411395113961139711398113991140011401114021140311404114051140611407114081140911410114111141211413114141141511416114171141811419114201142111422114231142411425114261142711428114291143011431114321143311434114351143611437114381143911440114411144211443114441144511446114471144811449114501145111452114531145411455114561145711458114591146011461114621146311464114651146611467114681146911470114711147211473114741147511476114771147811479114801148111482114831148411485114861148711488114891149011491114921149311494114951149611497114981149911500115011150211503115041150511506115071150811509115101151111512115131151411515115161151711518115191152011521115221152311524115251152611527115281152911530115311153211533115341153511536115371153811539115401154111542115431154411545115461154711548115491155011551115521155311554115551155611557115581155911560115611156211563115641156511566115671156811569115701157111572115731157411575115761157711578115791158011581115821158311584115851158611587115881158911590115911159211593115941159511596115971159811599116001160111602116031160411605116061160711608116091161011611116121161311614116151161611617116181161911620116211162211623116241162511626116271162811629116301163111632116331163411635116361163711638116391164011641116421164311644116451164611647116481164911650116511165211653116541165511656116571165811659116601166111662116631166411665116661166711668116691167011671116721167311674116751167611677116781167911680116811168211683116841168511686116871168811689116901169111692116931169411695116961169711698116991170011701117021170311704117051170611707117081170911710117111171211713117141171511716117171171811719117201172111722117231172411725117261172711728117291173011731117321173311734117351173611737117381173911740117411174211743117441174511746117471174811749117501175111752117531175411755117561175711758117591176011761117621176311764117651176611767117681176911770117711177211773117741177511776117771177811779117801178111782117831178411785117861178711788117891179011791117921179311794117951179611797117981179911800118011180211803118041180511806118071180811809118101181111812118131181411815118161181711818118191182011821118221182311824118251182611827118281182911830118311183211833118341183511836118371183811839118401184111842118431184411845118461184711848118491185011851118521185311854118551185611857118581185911860118611186211863118641186511866118671186811869118701187111872118731187411875118761187711878118791188011881118821188311884118851188611887118881188911890118911189211893118941189511896118971189811899119001190111902119031190411905119061190711908119091191011911119121191311914119151191611917119181191911920119211192211923119241192511926119271192811929119301193111932119331193411935119361193711938119391194011941119421194311944119451194611947119481194911950119511195211953119541195511956119571195811959119601196111962119631196411965119661196711968119691197011971119721197311974119751197611977119781197911980119811198211983119841198511986119871198811989119901199111992119931199411995119961199711998119991200012001120021200312004120051200612007120081200912010120111201212013120141201512016120171201812019120201202112022120231202412025120261202712028120291203012031120321203312034120351203612037120381203912040120411204212043120441204512046120471204812049120501205112052120531205412055120561205712058120591206012061120621206312064120651206612067120681206912070120711207212073120741207512076120771207812079120801208112082120831208412085120861208712088120891209012091120921209312094120951209612097120981209912100121011210212103121041210512106121071210812109121101211112112121131211412115121161211712118121191212012121121221212312124121251212612127121281212912130121311213212133121341213512136121371213812139121401214112142121431214412145121461214712148121491215012151121521215312154121551215612157121581215912160121611216212163121641216512166121671216812169121701217112172121731217412175121761217712178121791218012181121821218312184121851218612187121881218912190121911219212193121941219512196121971219812199122001220112202122031220412205122061220712208122091221012211122121221312214122151221612217122181221912220122211222212223122241222512226122271222812229122301223112232122331223412235122361223712238122391224012241122421224312244122451224612247122481224912250122511225212253122541225512256122571225812259122601226112262122631226412265122661226712268122691227012271122721227312274122751227612277122781227912280122811228212283122841228512286122871228812289122901229112292122931229412295122961229712298122991230012301123021230312304123051230612307123081230912310123111231212313123141231512316123171231812319123201232112322123231232412325123261232712328123291233012331123321233312334123351233612337123381233912340123411234212343123441234512346123471234812349123501235112352123531235412355123561235712358123591236012361123621236312364123651236612367123681236912370123711237212373123741237512376123771237812379123801238112382123831238412385123861238712388123891239012391123921239312394123951239612397123981239912400124011240212403124041240512406124071240812409124101241112412124131241412415124161241712418124191242012421124221242312424124251242612427124281242912430124311243212433124341243512436124371243812439124401244112442124431244412445124461244712448124491245012451124521245312454124551245612457124581245912460124611246212463124641246512466124671246812469124701247112472124731247412475124761247712478124791248012481124821248312484124851248612487124881248912490124911249212493124941249512496124971249812499125001250112502125031250412505125061250712508125091251012511125121251312514125151251612517125181251912520125211252212523125241252512526125271252812529125301253112532125331253412535125361253712538125391254012541125421254312544125451254612547125481254912550125511255212553125541255512556125571255812559125601256112562125631256412565125661256712568125691257012571125721257312574125751257612577125781257912580125811258212583125841258512586125871258812589125901259112592125931259412595125961259712598125991260012601126021260312604126051260612607126081260912610126111261212613126141261512616126171261812619126201262112622126231262412625126261262712628126291263012631126321263312634126351263612637126381263912640126411264212643126441264512646126471264812649126501265112652126531265412655126561265712658126591266012661126621266312664126651266612667126681266912670126711267212673126741267512676126771267812679126801268112682126831268412685126861268712688126891269012691126921269312694126951269612697126981269912700127011270212703127041270512706127071270812709127101271112712127131271412715127161271712718127191272012721127221272312724127251272612727127281272912730127311273212733127341273512736127371273812739127401274112742127431274412745127461274712748127491275012751127521275312754127551275612757127581275912760127611276212763127641276512766127671276812769127701277112772127731277412775127761277712778127791278012781127821278312784127851278612787127881278912790127911279212793127941279512796127971279812799128001280112802128031280412805128061280712808128091281012811128121281312814128151281612817128181281912820128211282212823128241282512826128271282812829128301283112832128331283412835128361283712838128391284012841128421284312844128451284612847128481284912850128511285212853128541285512856128571285812859128601286112862128631286412865128661286712868128691287012871128721287312874128751287612877128781287912880128811288212883128841288512886128871288812889128901289112892128931289412895128961289712898128991290012901129021290312904129051290612907129081290912910129111291212913129141291512916129171291812919129201292112922129231292412925129261292712928129291293012931129321293312934129351293612937129381293912940129411294212943129441294512946129471294812949129501295112952129531295412955129561295712958129591296012961129621296312964129651296612967129681296912970129711297212973129741297512976129771297812979129801298112982129831298412985129861298712988129891299012991129921299312994129951299612997129981299913000130011300213003130041300513006130071300813009130101301113012130131301413015130161301713018130191302013021130221302313024130251302613027130281302913030130311303213033130341303513036130371303813039130401304113042130431304413045130461304713048130491305013051130521305313054130551305613057130581305913060130611306213063130641306513066130671306813069130701307113072130731307413075130761307713078130791308013081130821308313084130851308613087130881308913090130911309213093130941309513096130971309813099131001310113102131031310413105131061310713108131091311013111131121311313114131151311613117131181311913120131211312213123131241312513126131271312813129131301313113132131331313413135131361313713138131391314013141131421314313144131451314613147131481314913150131511315213153131541315513156131571315813159131601316113162131631316413165131661316713168131691317013171131721317313174131751317613177131781317913180131811318213183131841318513186131871318813189131901319113192131931319413195131961319713198131991320013201132021320313204132051320613207132081320913210132111321213213132141321513216132171321813219132201322113222132231322413225132261322713228132291323013231132321323313234132351323613237132381323913240132411324213243132441324513246132471324813249132501325113252132531325413255132561325713258132591326013261132621326313264132651326613267132681326913270132711327213273132741327513276132771327813279132801328113282132831328413285132861328713288132891329013291132921329313294132951329613297132981329913300133011330213303133041330513306133071330813309133101331113312133131331413315133161331713318133191332013321133221332313324133251332613327133281332913330133311333213333133341333513336133371333813339133401334113342133431334413345133461334713348133491335013351133521335313354133551335613357133581335913360133611336213363133641336513366133671336813369133701337113372133731337413375133761337713378133791338013381133821338313384133851338613387133881338913390133911339213393133941339513396133971339813399134001340113402134031340413405134061340713408134091341013411134121341313414134151341613417134181341913420134211342213423134241342513426134271342813429134301343113432134331343413435134361343713438134391344013441134421344313444134451344613447134481344913450134511345213453134541345513456134571345813459134601346113462134631346413465134661346713468134691347013471134721347313474134751347613477134781347913480134811348213483134841348513486134871348813489134901349113492134931349413495134961349713498134991350013501135021350313504135051350613507135081350913510135111351213513135141351513516135171351813519135201352113522135231352413525135261352713528135291353013531135321353313534135351353613537135381353913540135411354213543135441354513546135471354813549135501355113552135531355413555135561355713558135591356013561135621356313564135651356613567135681356913570135711357213573135741357513576135771357813579135801358113582135831358413585135861358713588135891359013591135921359313594135951359613597135981359913600136011360213603136041360513606136071360813609136101361113612136131361413615136161361713618136191362013621136221362313624136251362613627136281362913630136311363213633136341363513636136371363813639136401364113642136431364413645136461364713648136491365013651136521365313654136551365613657136581365913660136611366213663136641366513666136671366813669136701367113672136731367413675136761367713678136791368013681136821368313684136851368613687136881368913690136911369213693136941369513696136971369813699137001370113702137031370413705137061370713708137091371013711137121371313714137151371613717137181371913720137211372213723137241372513726137271372813729137301373113732137331373413735137361373713738137391374013741137421374313744137451374613747137481374913750137511375213753137541375513756137571375813759137601376113762137631376413765137661376713768137691377013771137721377313774137751377613777137781377913780137811378213783137841378513786137871378813789137901379113792137931379413795137961379713798137991380013801138021380313804138051380613807138081380913810138111381213813138141381513816138171381813819138201382113822138231382413825138261382713828138291383013831138321383313834138351383613837138381383913840138411384213843138441384513846138471384813849138501385113852138531385413855138561385713858138591386013861138621386313864138651386613867138681386913870138711387213873138741387513876138771387813879138801388113882138831388413885138861388713888138891389013891138921389313894138951389613897138981389913900139011390213903139041390513906139071390813909139101391113912139131391413915139161391713918139191392013921139221392313924139251392613927139281392913930139311393213933139341393513936139371393813939139401394113942139431394413945139461394713948139491395013951139521395313954139551395613957139581395913960139611396213963139641396513966139671396813969139701397113972139731397413975139761397713978139791398013981139821398313984139851398613987139881398913990139911399213993139941399513996139971399813999140001400114002140031400414005140061400714008140091401014011140121401314014140151401614017140181401914020140211402214023140241402514026140271402814029140301403114032140331403414035140361403714038140391404014041140421404314044140451404614047140481404914050140511405214053140541405514056140571405814059140601406114062140631406414065140661406714068140691407014071140721407314074140751407614077140781407914080140811408214083140841408514086140871408814089140901409114092140931409414095140961409714098140991410014101141021410314104141051410614107141081410914110141111411214113141141411514116141171411814119141201412114122141231412414125141261412714128141291413014131141321413314134141351413614137141381413914140141411414214143141441414514146141471414814149141501415114152141531415414155141561415714158141591416014161141621416314164141651416614167141681416914170141711417214173141741417514176141771417814179141801418114182141831418414185141861418714188141891419014191141921419314194141951419614197141981419914200142011420214203142041420514206142071420814209142101421114212142131421414215142161421714218142191422014221142221422314224142251422614227142281422914230142311423214233142341423514236142371423814239142401424114242142431424414245142461424714248142491425014251142521425314254142551425614257142581425914260142611426214263142641426514266142671426814269142701427114272142731427414275142761427714278142791428014281142821428314284142851428614287142881428914290142911429214293142941429514296142971429814299143001430114302143031430414305143061430714308143091431014311143121431314314143151431614317143181431914320143211432214323143241432514326143271432814329143301433114332143331433414335143361433714338143391434014341143421434314344143451434614347143481434914350143511435214353143541435514356143571435814359143601436114362143631436414365143661436714368143691437014371143721437314374143751437614377143781437914380143811438214383143841438514386143871438814389143901439114392143931439414395143961439714398143991440014401144021440314404144051440614407144081440914410144111441214413144141441514416144171441814419144201442114422144231442414425144261442714428144291443014431144321443314434144351443614437144381443914440144411444214443144441444514446144471444814449144501445114452144531445414455144561445714458144591446014461144621446314464144651446614467144681446914470144711447214473144741447514476144771447814479144801448114482144831448414485144861448714488144891449014491144921449314494144951449614497144981449914500145011450214503145041450514506145071450814509145101451114512145131451414515145161451714518145191452014521145221452314524145251452614527145281452914530145311453214533145341453514536145371453814539145401454114542145431454414545145461454714548145491455014551145521455314554145551455614557145581455914560145611456214563145641456514566145671456814569145701457114572145731457414575145761457714578145791458014581145821458314584145851458614587145881458914590145911459214593145941459514596145971459814599146001460114602146031460414605146061460714608146091461014611146121461314614146151461614617146181461914620146211462214623146241462514626146271462814629146301463114632146331463414635146361463714638146391464014641146421464314644146451464614647146481464914650146511465214653146541465514656146571465814659146601466114662146631466414665146661466714668146691467014671146721467314674146751467614677146781467914680146811468214683146841468514686146871468814689146901469114692146931469414695146961469714698146991470014701147021470314704147051470614707147081470914710147111471214713147141471514716147171471814719147201472114722147231472414725147261472714728147291473014731147321473314734147351473614737147381473914740147411474214743147441474514746147471474814749147501475114752147531475414755147561475714758147591476014761147621476314764147651476614767147681476914770147711477214773147741477514776147771477814779147801478114782147831478414785147861478714788147891479014791147921479314794147951479614797147981479914800148011480214803148041480514806148071480814809148101481114812148131481414815148161481714818148191482014821148221482314824148251482614827148281482914830148311483214833148341483514836148371483814839148401484114842148431484414845148461484714848148491485014851148521485314854148551485614857148581485914860148611486214863148641486514866148671486814869148701487114872148731487414875148761487714878148791488014881148821488314884148851488614887148881488914890148911489214893148941489514896148971489814899149001490114902149031490414905149061490714908149091491014911149121491314914149151491614917149181491914920149211492214923149241492514926149271492814929149301493114932149331493414935149361493714938149391494014941149421494314944149451494614947149481494914950149511495214953149541495514956149571495814959149601496114962149631496414965149661496714968149691497014971149721497314974149751497614977149781497914980149811498214983149841498514986149871498814989149901499114992149931499414995149961499714998149991500015001150021500315004150051500615007150081500915010150111501215013150141501515016150171501815019150201502115022150231502415025150261502715028150291503015031150321503315034150351503615037150381503915040150411504215043150441504515046150471504815049150501505115052150531505415055150561505715058150591506015061150621506315064150651506615067150681506915070150711507215073150741507515076150771507815079150801508115082150831508415085150861508715088150891509015091150921509315094150951509615097150981509915100151011510215103151041510515106151071510815109151101511115112151131511415115151161511715118151191512015121151221512315124151251512615127151281512915130151311513215133151341513515136151371513815139151401514115142151431514415145151461514715148151491515015151151521515315154151551515615157151581515915160151611516215163151641516515166151671516815169151701517115172151731517415175151761517715178151791518015181151821518315184151851518615187151881518915190151911519215193151941519515196151971519815199152001520115202152031520415205152061520715208152091521015211152121521315214152151521615217152181521915220152211522215223152241522515226152271522815229152301523115232152331523415235152361523715238152391524015241152421524315244152451524615247152481524915250152511525215253152541525515256152571525815259152601526115262152631526415265152661526715268152691527015271152721527315274152751527615277152781527915280152811528215283152841528515286152871528815289152901529115292152931529415295152961529715298152991530015301153021530315304153051530615307153081530915310153111531215313153141531515316153171531815319153201532115322153231532415325153261532715328153291533015331153321533315334153351533615337153381533915340153411534215343153441534515346153471534815349153501535115352153531535415355153561535715358153591536015361153621536315364153651536615367153681536915370153711537215373153741537515376153771537815379153801538115382153831538415385153861538715388153891539015391153921539315394153951539615397153981539915400154011540215403154041540515406154071540815409154101541115412154131541415415154161541715418154191542015421154221542315424154251542615427154281542915430154311543215433154341543515436154371543815439154401544115442154431544415445154461544715448154491545015451154521545315454154551545615457154581545915460154611546215463154641546515466154671546815469154701547115472154731547415475154761547715478154791548015481154821548315484154851548615487154881548915490154911549215493154941549515496154971549815499155001550115502155031550415505155061550715508155091551015511155121551315514155151551615517155181551915520155211552215523155241552515526155271552815529155301553115532155331553415535155361553715538155391554015541155421554315544155451554615547155481554915550155511555215553155541555515556155571555815559155601556115562155631556415565155661556715568155691557015571155721557315574155751557615577155781557915580155811558215583155841558515586155871558815589155901559115592155931559415595155961559715598155991560015601156021560315604156051560615607156081560915610156111561215613156141561515616156171561815619156201562115622156231562415625156261562715628156291563015631156321563315634156351563615637156381563915640156411564215643156441564515646156471564815649156501565115652156531565415655156561565715658156591566015661156621566315664156651566615667156681566915670156711567215673156741567515676156771567815679156801568115682156831568415685156861568715688156891569015691156921569315694156951569615697156981569915700157011570215703157041570515706157071570815709157101571115712157131571415715157161571715718157191572015721157221572315724157251572615727157281572915730157311573215733157341573515736157371573815739157401574115742157431574415745157461574715748157491575015751157521575315754157551575615757157581575915760157611576215763157641576515766157671576815769157701577115772157731577415775157761577715778157791578015781157821578315784157851578615787157881578915790157911579215793157941579515796157971579815799158001580115802158031580415805158061580715808158091581015811158121581315814158151581615817158181581915820158211582215823158241582515826158271582815829158301583115832158331583415835158361583715838158391584015841158421584315844158451584615847158481584915850158511585215853158541585515856158571585815859158601586115862158631586415865158661586715868158691587015871158721587315874158751587615877158781587915880158811588215883158841588515886158871588815889158901589115892158931589415895158961589715898158991590015901159021590315904159051590615907159081590915910159111591215913159141591515916159171591815919159201592115922159231592415925159261592715928159291593015931159321593315934159351593615937159381593915940159411594215943159441594515946159471594815949159501595115952159531595415955159561595715958159591596015961159621596315964159651596615967159681596915970159711597215973159741597515976159771597815979159801598115982159831598415985159861598715988159891599015991159921599315994159951599615997159981599916000160011600216003160041600516006160071600816009160101601116012160131601416015160161601716018160191602016021160221602316024160251602616027160281602916030160311603216033160341603516036160371603816039160401604116042160431604416045160461604716048160491605016051160521605316054160551605616057160581605916060160611606216063160641606516066160671606816069160701607116072160731607416075160761607716078160791608016081160821608316084160851608616087160881608916090160911609216093160941609516096160971609816099161001610116102161031610416105161061610716108161091611016111161121611316114161151611616117161181611916120161211612216123161241612516126161271612816129161301613116132161331613416135161361613716138161391614016141161421614316144161451614616147161481614916150161511615216153161541615516156161571615816159161601616116162161631616416165161661616716168161691617016171161721617316174161751617616177161781617916180161811618216183161841618516186161871618816189161901619116192161931619416195161961619716198161991620016201162021620316204162051620616207162081620916210162111621216213162141621516216162171621816219162201622116222162231622416225162261622716228162291623016231162321623316234162351623616237162381623916240162411624216243162441624516246162471624816249162501625116252162531625416255162561625716258162591626016261162621626316264162651626616267162681626916270162711627216273162741627516276162771627816279162801628116282162831628416285162861628716288162891629016291162921629316294162951629616297162981629916300163011630216303163041630516306163071630816309163101631116312163131631416315163161631716318163191632016321163221632316324163251632616327163281632916330163311633216333163341633516336163371633816339163401634116342163431634416345163461634716348163491635016351163521635316354163551635616357163581635916360163611636216363163641636516366163671636816369163701637116372163731637416375163761637716378163791638016381163821638316384163851638616387163881638916390163911639216393163941639516396163971639816399164001640116402164031640416405164061640716408164091641016411164121641316414164151641616417164181641916420164211642216423164241642516426164271642816429164301643116432164331643416435164361643716438164391644016441164421644316444164451644616447164481644916450164511645216453164541645516456164571645816459164601646116462164631646416465164661646716468164691647016471164721647316474164751647616477164781647916480164811648216483164841648516486164871648816489164901649116492164931649416495164961649716498164991650016501165021650316504165051650616507165081650916510165111651216513165141651516516165171651816519165201652116522165231652416525165261652716528165291653016531165321653316534165351653616537165381653916540165411654216543165441654516546165471654816549165501655116552165531655416555165561655716558165591656016561165621656316564165651656616567165681656916570165711657216573165741657516576165771657816579165801658116582165831658416585165861658716588165891659016591165921659316594165951659616597165981659916600166011660216603166041660516606166071660816609166101661116612166131661416615166161661716618166191662016621166221662316624166251662616627166281662916630166311663216633166341663516636166371663816639166401664116642166431664416645166461664716648166491665016651166521665316654166551665616657166581665916660166611666216663166641666516666166671666816669166701667116672166731667416675166761667716678166791668016681166821668316684166851668616687166881668916690166911669216693166941669516696166971669816699167001670116702167031670416705167061670716708167091671016711167121671316714167151671616717167181671916720167211672216723167241672516726167271672816729167301673116732167331673416735167361673716738167391674016741167421674316744167451674616747167481674916750167511675216753167541675516756167571675816759167601676116762167631676416765167661676716768167691677016771167721677316774167751677616777167781677916780167811678216783167841678516786167871678816789167901679116792167931679416795167961679716798167991680016801168021680316804168051680616807168081680916810168111681216813168141681516816168171681816819168201682116822168231682416825168261682716828168291683016831168321683316834168351683616837168381683916840168411684216843168441684516846168471684816849168501685116852168531685416855168561685716858168591686016861168621686316864168651686616867168681686916870168711687216873168741687516876168771687816879168801688116882168831688416885168861688716888168891689016891168921689316894168951689616897168981689916900169011690216903169041690516906169071690816909169101691116912169131691416915169161691716918169191692016921169221692316924169251692616927169281692916930169311693216933169341693516936169371693816939169401694116942169431694416945169461694716948169491695016951169521695316954169551695616957169581695916960169611696216963169641696516966169671696816969169701697116972169731697416975169761697716978169791698016981169821698316984169851698616987169881698916990169911699216993169941699516996169971699816999170001700117002170031700417005170061700717008170091701017011170121701317014170151701617017170181701917020170211702217023170241702517026170271702817029170301703117032170331703417035170361703717038170391704017041170421704317044170451704617047170481704917050170511705217053170541705517056170571705817059170601706117062170631706417065170661706717068170691707017071170721707317074170751707617077170781707917080170811708217083170841708517086170871708817089170901709117092170931709417095170961709717098170991710017101171021710317104171051710617107171081710917110171111711217113171141711517116171171711817119171201712117122171231712417125171261712717128171291713017131171321713317134171351713617137171381713917140171411714217143171441714517146171471714817149171501715117152171531715417155171561715717158171591716017161171621716317164171651716617167171681716917170171711717217173171741717517176171771717817179171801718117182171831718417185171861718717188171891719017191171921719317194171951719617197171981719917200172011720217203172041720517206172071720817209172101721117212172131721417215172161721717218172191722017221172221722317224172251722617227172281722917230172311723217233172341723517236172371723817239172401724117242172431724417245172461724717248172491725017251172521725317254172551725617257172581725917260172611726217263172641726517266172671726817269172701727117272172731727417275172761727717278172791728017281172821728317284172851728617287172881728917290172911729217293172941729517296172971729817299173001730117302173031730417305173061730717308173091731017311173121731317314173151731617317173181731917320173211732217323173241732517326173271732817329173301733117332173331733417335173361733717338173391734017341173421734317344173451734617347173481734917350173511735217353173541735517356173571735817359173601736117362173631736417365173661736717368173691737017371173721737317374173751737617377173781737917380173811738217383173841738517386173871738817389173901739117392173931739417395173961739717398173991740017401174021740317404174051740617407174081740917410174111741217413174141741517416174171741817419174201742117422174231742417425174261742717428174291743017431174321743317434174351743617437174381743917440174411744217443174441744517446174471744817449174501745117452174531745417455174561745717458174591746017461174621746317464174651746617467174681746917470174711747217473174741747517476174771747817479174801748117482174831748417485174861748717488174891749017491174921749317494174951749617497174981749917500175011750217503175041750517506175071750817509175101751117512175131751417515175161751717518175191752017521175221752317524175251752617527175281752917530175311753217533175341753517536175371753817539175401754117542175431754417545175461754717548175491755017551175521755317554175551755617557175581755917560175611756217563175641756517566175671756817569175701757117572175731757417575175761757717578175791758017581175821758317584175851758617587175881758917590175911759217593175941759517596175971759817599176001760117602176031760417605176061760717608176091761017611176121761317614176151761617617176181761917620176211762217623176241762517626176271762817629176301763117632176331763417635176361763717638176391764017641176421764317644176451764617647176481764917650176511765217653176541765517656176571765817659176601766117662176631766417665176661766717668176691767017671176721767317674176751767617677176781767917680176811768217683176841768517686176871768817689176901769117692176931769417695176961769717698176991770017701177021770317704177051770617707177081770917710177111771217713177141771517716177171771817719177201772117722177231772417725177261772717728177291773017731177321773317734177351773617737177381773917740177411774217743177441774517746177471774817749177501775117752177531775417755177561775717758177591776017761177621776317764177651776617767177681776917770177711777217773177741777517776177771777817779177801778117782177831778417785177861778717788177891779017791177921779317794177951779617797177981779917800178011780217803178041780517806178071780817809178101781117812178131781417815178161781717818178191782017821178221782317824178251782617827178281782917830178311783217833178341783517836178371783817839178401784117842178431784417845178461784717848178491785017851178521785317854178551785617857178581785917860178611786217863178641786517866178671786817869178701787117872178731787417875178761787717878178791788017881178821788317884178851788617887178881788917890178911789217893178941789517896178971789817899179001790117902179031790417905179061790717908179091791017911179121791317914179151791617917179181791917920179211792217923179241792517926179271792817929179301793117932179331793417935179361793717938179391794017941179421794317944179451794617947179481794917950179511795217953179541795517956179571795817959179601796117962179631796417965179661796717968179691797017971179721797317974179751797617977179781797917980179811798217983179841798517986179871798817989179901799117992179931799417995179961799717998179991800018001180021800318004180051800618007180081800918010180111801218013180141801518016180171801818019180201802118022180231802418025180261802718028180291803018031180321803318034180351803618037180381803918040180411804218043180441804518046180471804818049180501805118052180531805418055180561805718058180591806018061180621806318064180651806618067180681806918070180711807218073180741807518076180771807818079180801808118082180831808418085180861808718088180891809018091180921809318094180951809618097180981809918100181011810218103181041810518106181071810818109181101811118112181131811418115181161811718118181191812018121181221812318124181251812618127181281812918130181311813218133181341813518136181371813818139181401814118142181431814418145181461814718148181491815018151181521815318154181551815618157181581815918160181611816218163181641816518166181671816818169181701817118172181731817418175181761817718178181791818018181181821818318184181851818618187181881818918190181911819218193181941819518196181971819818199182001820118202182031820418205182061820718208182091821018211182121821318214182151821618217182181821918220182211822218223182241822518226182271822818229182301823118232182331823418235182361823718238182391824018241182421824318244182451824618247182481824918250182511825218253182541825518256182571825818259182601826118262182631826418265182661826718268182691827018271182721827318274182751827618277182781827918280182811828218283182841828518286182871828818289182901829118292182931829418295182961829718298182991830018301183021830318304183051830618307183081830918310183111831218313183141831518316183171831818319183201832118322183231832418325183261832718328183291833018331183321833318334183351833618337183381833918340183411834218343183441834518346183471834818349183501835118352183531835418355183561835718358183591836018361183621836318364183651836618367183681836918370183711837218373183741837518376183771837818379183801838118382183831838418385183861838718388183891839018391183921839318394183951839618397183981839918400184011840218403184041840518406184071840818409184101841118412184131841418415184161841718418184191842018421184221842318424184251842618427184281842918430184311843218433184341843518436184371843818439184401844118442184431844418445184461844718448184491845018451184521845318454184551845618457184581845918460184611846218463184641846518466184671846818469184701847118472184731847418475184761847718478184791848018481184821848318484184851848618487184881848918490184911849218493184941849518496184971849818499185001850118502185031850418505185061850718508185091851018511185121851318514185151851618517185181851918520185211852218523185241852518526185271852818529185301853118532185331853418535185361853718538185391854018541185421854318544185451854618547185481854918550185511855218553185541855518556185571855818559185601856118562185631856418565185661856718568185691857018571185721857318574185751857618577185781857918580185811858218583185841858518586185871858818589185901859118592185931859418595185961859718598185991860018601186021860318604186051860618607186081860918610186111861218613186141861518616186171861818619186201862118622186231862418625186261862718628186291863018631186321863318634186351863618637186381863918640186411864218643186441864518646186471864818649186501865118652186531865418655186561865718658186591866018661186621866318664186651866618667186681866918670186711867218673186741867518676186771867818679186801868118682186831868418685186861868718688186891869018691186921869318694186951869618697186981869918700187011870218703187041870518706187071870818709187101871118712187131871418715187161871718718187191872018721187221872318724187251872618727187281872918730187311873218733187341873518736187371873818739187401874118742187431874418745187461874718748187491875018751187521875318754187551875618757187581875918760187611876218763187641876518766187671876818769187701877118772187731877418775187761877718778187791878018781187821878318784187851878618787187881878918790187911879218793187941879518796187971879818799188001880118802188031880418805188061880718808188091881018811188121881318814188151881618817188181881918820188211882218823188241882518826188271882818829188301883118832188331883418835188361883718838188391884018841188421884318844188451884618847188481884918850188511885218853188541885518856188571885818859188601886118862188631886418865188661886718868188691887018871188721887318874188751887618877188781887918880188811888218883188841888518886188871888818889188901889118892188931889418895188961889718898188991890018901189021890318904189051890618907189081890918910189111891218913189141891518916189171891818919189201892118922189231892418925189261892718928189291893018931189321893318934189351893618937189381893918940189411894218943189441894518946189471894818949189501895118952189531895418955189561895718958189591896018961189621896318964189651896618967189681896918970189711897218973189741897518976189771897818979189801898118982189831898418985189861898718988189891899018991189921899318994189951899618997189981899919000190011900219003190041900519006190071900819009190101901119012190131901419015190161901719018190191902019021190221902319024190251902619027190281902919030190311903219033190341903519036190371903819039190401904119042190431904419045190461904719048190491905019051190521905319054190551905619057190581905919060190611906219063190641906519066190671906819069190701907119072190731907419075
  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. key: 0
  359. };
  360. var _hoisted_2 = {
  361. key: 1
  362. };
  363. function render(_ctx, _cache, $props, $setup, $data, $options) {
  364. var _component_Message = (0,vue__WEBPACK_IMPORTED_MODULE_0__.resolveComponent)("Message");
  365. return (0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)(vue__WEBPACK_IMPORTED_MODULE_0__.Fragment, null, [_ctx.$page.props.flash.success ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createBlock)(_component_Message, {
  366. key: 0,
  367. severity: "success",
  368. onClose: $setup.onClose
  369. }, {
  370. "default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  371. return [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createTextVNode)((0,vue__WEBPACK_IMPORTED_MODULE_0__.toDisplayString)(_ctx.$page.props.flash.success), 1
  372. /* TEXT */
  373. )];
  374. }),
  375. _: 1
  376. /* STABLE */
  377. })) : (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, {
  378. key: 1,
  379. severity: "error",
  380. onClose: $setup.onClose
  381. }, {
  382. "default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  383. return [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createTextVNode)((0,vue__WEBPACK_IMPORTED_MODULE_0__.toDisplayString)(_ctx.$page.props.flash.error), 1
  384. /* TEXT */
  385. )];
  386. }),
  387. _: 1
  388. /* STABLE */
  389. })) : (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, {
  390. key: 2,
  391. severity: "error",
  392. onClose: $setup.onClose
  393. }, {
  394. "default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  395. 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_1, " Ditemukan satu error pada form ")) : ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)("div", _hoisted_2, " Ditemukan " + (0,vue__WEBPACK_IMPORTED_MODULE_0__.toDisplayString)(Object.keys(_ctx.$page.props.errors).length) + " error pada form ", 1
  396. /* TEXT */
  397. ))];
  398. }),
  399. _: 1
  400. /* STABLE */
  401. })) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true)], 64
  402. /* STABLE_FRAGMENT */
  403. );
  404. }
  405. /***/ }),
  406. /***/ "./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":
  407. /*!********************************************************************************************************************************************************************************************************************************************************************************************!*\
  408. !*** ./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 ***!
  409. \********************************************************************************************************************************************************************************************************************************************************************************************/
  410. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  411. "use strict";
  412. __webpack_require__.r(__webpack_exports__);
  413. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  414. /* harmony export */ "render": () => (/* binding */ render)
  415. /* harmony export */ });
  416. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  417. function render(_ctx, _cache, $props, $setup, $data, $options) {
  418. 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"], {
  419. "class": "layout-menu",
  420. items: $props.menu,
  421. root: true
  422. }, null, 8
  423. /* PROPS */
  424. , ["items"])]);
  425. }
  426. /***/ }),
  427. /***/ "./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":
  428. /*!***********************************************************************************************************************************************************************************************************************************************************************************************!*\
  429. !*** ./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 ***!
  430. \***********************************************************************************************************************************************************************************************************************************************************************************************/
  431. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  432. "use strict";
  433. __webpack_require__.r(__webpack_exports__);
  434. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  435. /* harmony export */ "render": () => (/* binding */ render)
  436. /* harmony export */ });
  437. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  438. var _withScopeId = function _withScopeId(n) {
  439. return (0,vue__WEBPACK_IMPORTED_MODULE_0__.pushScopeId)("data-v-0addd9bc"), n = n(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.popScopeId)(), n;
  440. };
  441. var _hoisted_1 = {
  442. key: 0
  443. };
  444. var _hoisted_2 = ["aria-label"];
  445. var _hoisted_3 = ["aria-label"];
  446. function render(_ctx, _cache, $props, $setup, $data, $options) {
  447. var _component_AppSubSidebar = (0,vue__WEBPACK_IMPORTED_MODULE_0__.resolveComponent)("AppSubSidebar", true);
  448. 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) {
  449. 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", {
  450. key: i,
  451. "class": (0,vue__WEBPACK_IMPORTED_MODULE_0__.normalizeClass)([{
  452. 'layout-menuitem-category': $props.root
  453. }]),
  454. role: "none"
  455. }, [$props.root ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)(vue__WEBPACK_IMPORTED_MODULE_0__.Fragment, {
  456. key: 0
  457. }, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("div", {
  458. "class": "layout-menuitem-root-text",
  459. "aria-label": item.label
  460. }, (0,vue__WEBPACK_IMPORTED_MODULE_0__.toDisplayString)(item.label), 9
  461. /* TEXT, PROPS */
  462. , _hoisted_2), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(_component_AppSubSidebar, {
  463. items: item.items
  464. }, null, 8
  465. /* PROPS */
  466. , ["items"])], 64
  467. /* STABLE_FRAGMENT */
  468. )) : ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)(vue__WEBPACK_IMPORTED_MODULE_0__.Fragment, {
  469. key: 1
  470. }, [item.to ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createBlock)($setup["Link"], {
  471. key: 0,
  472. role: "menuitem",
  473. href: item.to,
  474. "class": (0,vue__WEBPACK_IMPORTED_MODULE_0__.normalizeClass)([{
  475. 'router-link-active': _ctx.$page.component.startsWith(item.component) || _ctx.$page.url.startsWith(item.to),
  476. 'router-link-exact-active': _ctx.$page.component.startsWith(item.component) || _ctx.$page.url.startsWith(item.to)
  477. }]),
  478. "aria-label": item.label
  479. }, {
  480. "default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  481. return [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("i", {
  482. "class": (0,vue__WEBPACK_IMPORTED_MODULE_0__.normalizeClass)(item.icon)
  483. }, null, 2
  484. /* CLASS */
  485. ), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("span", null, (0,vue__WEBPACK_IMPORTED_MODULE_0__.toDisplayString)(item.label), 1
  486. /* TEXT */
  487. )];
  488. }),
  489. _: 2
  490. /* DYNAMIC */
  491. }, 1032
  492. /* PROPS, DYNAMIC_SLOTS */
  493. , ["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", {
  494. key: 1,
  495. href: "#",
  496. role: "menuitem",
  497. "aria-label": item.label
  498. }, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("i", {
  499. "class": (0,vue__WEBPACK_IMPORTED_MODULE_0__.normalizeClass)(item.icon)
  500. }, null, 2
  501. /* CLASS */
  502. ), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("span", null, (0,vue__WEBPACK_IMPORTED_MODULE_0__.toDisplayString)(item.label), 1
  503. /* TEXT */
  504. )], 8
  505. /* PROPS */
  506. , _hoisted_3)) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(_component_AppSubSidebar, {
  507. items: item.items
  508. }, null, 8
  509. /* PROPS */
  510. , ["items"])], 64
  511. /* STABLE_FRAGMENT */
  512. ))], 2
  513. /* CLASS */
  514. )) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true)], 64
  515. /* STABLE_FRAGMENT */
  516. );
  517. }), 256
  518. /* UNKEYED_FRAGMENT */
  519. ))])) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true);
  520. }
  521. /***/ }),
  522. /***/ "./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":
  523. /*!*******************************************************************************************************************************************************************************************************************************************************************************************!*\
  524. !*** ./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 ***!
  525. \*******************************************************************************************************************************************************************************************************************************************************************************************/
  526. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  527. "use strict";
  528. __webpack_require__.r(__webpack_exports__);
  529. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  530. /* harmony export */ "render": () => (/* binding */ render)
  531. /* harmony export */ });
  532. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  533. var _withScopeId = function _withScopeId(n) {
  534. return (0,vue__WEBPACK_IMPORTED_MODULE_0__.pushScopeId)("data-v-42bf62a4"), n = n(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.popScopeId)(), n;
  535. };
  536. var _hoisted_1 = {
  537. "class": "layout-topbar"
  538. };
  539. var _hoisted_2 = /*#__PURE__*/_withScopeId(function () {
  540. return /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("img", {
  541. alt: "Logo",
  542. src: "/images/logo.svg",
  543. "class": "md:mr-3"
  544. }, null, -1
  545. /* HOISTED */
  546. );
  547. });
  548. var _hoisted_3 = /*#__PURE__*/_withScopeId(function () {
  549. return /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("span", null, "Parkirin", -1
  550. /* HOISTED */
  551. );
  552. });
  553. var _hoisted_4 = /*#__PURE__*/_withScopeId(function () {
  554. return /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("i", {
  555. "class": "pi pi-bars"
  556. }, null, -1
  557. /* HOISTED */
  558. );
  559. });
  560. var _hoisted_5 = [_hoisted_4];
  561. var _hoisted_6 = {
  562. "class": "p-link layout-topbar-menu-button layout-topbar-button"
  563. };
  564. var _hoisted_7 = /*#__PURE__*/_withScopeId(function () {
  565. return /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("i", {
  566. "class": "pi pi-ellipsis-v"
  567. }, null, -1
  568. /* HOISTED */
  569. );
  570. });
  571. var _hoisted_8 = [_hoisted_7];
  572. var _hoisted_9 = {
  573. "class": "layout-topbar-menu hidden lg:flex origin-top"
  574. };
  575. var _hoisted_10 = {
  576. "class": "align-self-center"
  577. };
  578. var _hoisted_11 = {
  579. "class": "hidden lg:inline"
  580. };
  581. var _hoisted_12 = /*#__PURE__*/_withScopeId(function () {
  582. return /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("i", {
  583. "class": "pi pi-user"
  584. }, null, -1
  585. /* HOISTED */
  586. );
  587. });
  588. var _hoisted_13 = /*#__PURE__*/_withScopeId(function () {
  589. return /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("span", null, "Ubah Profil", -1
  590. /* HOISTED */
  591. );
  592. });
  593. var _hoisted_14 = /*#__PURE__*/_withScopeId(function () {
  594. return /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("i", {
  595. "class": "pi pi-sign-out"
  596. }, null, -1
  597. /* HOISTED */
  598. );
  599. });
  600. var _hoisted_15 = /*#__PURE__*/_withScopeId(function () {
  601. return /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("span", null, "Keluar", -1
  602. /* HOISTED */
  603. );
  604. });
  605. function render(_ctx, _cache, $props, $setup, $data, $options) {
  606. var _directive_styleclass = (0,vue__WEBPACK_IMPORTED_MODULE_0__.resolveDirective)("styleclass");
  607. var _directive_tooltip = (0,vue__WEBPACK_IMPORTED_MODULE_0__.resolveDirective)("tooltip");
  608. 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"], {
  609. href: "/",
  610. "class": "layout-topbar-logo"
  611. }, {
  612. "default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  613. return [_hoisted_2, _hoisted_3];
  614. }),
  615. _: 1
  616. /* STABLE */
  617. }), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("button", {
  618. "class": "p-link layout-menu-button layout-topbar-button",
  619. onClick: _cache[0] || (_cache[0] = function ($event) {
  620. return _ctx.$emit('menu-toggle', $event);
  621. })
  622. }, _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, {
  623. selector: '@next',
  624. enterClass: 'hidden',
  625. enterActiveClass: 'scalein',
  626. leaveToClass: 'hidden',
  627. leaveActiveClass: 'fadeout',
  628. hideOnOutsideClick: true
  629. }]]), (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
  630. /* TEXT */
  631. )]), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("li", null, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.withDirectives)(((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createBlock)($setup["Link"], {
  632. href: _ctx.route('users.show', _ctx.$page.props.auth.user.id),
  633. "class": "p-link layout-topbar-button"
  634. }, {
  635. "default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  636. return [_hoisted_12, _hoisted_13];
  637. }),
  638. _: 1
  639. /* STABLE */
  640. }, 8
  641. /* PROPS */
  642. , ["href"])), [[_directive_tooltip, {
  643. value: 'Ubah Profil',
  644. "class": 'layout-topbar-menu-tooltip'
  645. }, void 0, {
  646. bottom: true
  647. }]])]), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("li", null, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.withDirectives)(((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createBlock)($setup["Link"], {
  648. href: _ctx.route('logout'),
  649. as: "button",
  650. method: "post",
  651. "class": "p-link layout-topbar-button"
  652. }, {
  653. "default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  654. return [_hoisted_14, _hoisted_15];
  655. }),
  656. _: 1
  657. /* STABLE */
  658. }, 8
  659. /* PROPS */
  660. , ["href"])), [[_directive_tooltip, {
  661. value: 'Keluar',
  662. "class": 'layout-topbar-menu-tooltip'
  663. }, void 0, {
  664. bottom: true
  665. }]])])])]);
  666. }
  667. /***/ }),
  668. /***/ "./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":
  669. /*!**********************************************************************************************************************************************************************************************************************************************************************************************!*\
  670. !*** ./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 ***!
  671. \**********************************************************************************************************************************************************************************************************************************************************************************************/
  672. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  673. "use strict";
  674. __webpack_require__.r(__webpack_exports__);
  675. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  676. /* harmony export */ "render": () => (/* binding */ render)
  677. /* harmony export */ });
  678. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  679. var _withScopeId = function _withScopeId(n) {
  680. return (0,vue__WEBPACK_IMPORTED_MODULE_0__.pushScopeId)("data-v-549bf5ac"), n = n(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.popScopeId)(), n;
  681. };
  682. var _hoisted_1 = {
  683. "class": "layout-sidebar"
  684. };
  685. var _hoisted_2 = {
  686. "class": "layout-main-container"
  687. };
  688. var _hoisted_3 = {
  689. "class": "layout-main"
  690. };
  691. var _hoisted_4 = {
  692. key: 0,
  693. "class": "layout-mask p-component-overlay"
  694. };
  695. function render(_ctx, _cache, $props, $setup, $data, $options) {
  696. return (0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)("div", {
  697. "class": (0,vue__WEBPACK_IMPORTED_MODULE_0__.normalizeClass)($setup.containerClass),
  698. onClick: $setup.onWrapperClick
  699. }, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)($setup["AppTopBar"], {
  700. onMenuToggle: $setup.onMenuToggle
  701. }), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("div", _hoisted_1, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)($setup["AppSidebar"], {
  702. menu: $setup.menu[_ctx.$page.props.auth.user.role_id]
  703. }, null, 8
  704. /* PROPS */
  705. , ["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, {
  706. name: "layout-mask"
  707. }, {
  708. "default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  709. 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)];
  710. }),
  711. _: 1
  712. /* STABLE */
  713. })], 2
  714. /* CLASS */
  715. );
  716. }
  717. /***/ }),
  718. /***/ "./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":
  719. /*!***************************************************************************************************************************************************************************************************************************************************************************!*\
  720. !*** ./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 ***!
  721. \***************************************************************************************************************************************************************************************************************************************************************************/
  722. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  723. "use strict";
  724. __webpack_require__.r(__webpack_exports__);
  725. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  726. /* harmony export */ "render": () => (/* binding */ render)
  727. /* harmony export */ });
  728. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  729. var _hoisted_1 = {
  730. "class": "grid"
  731. };
  732. var _hoisted_2 = {
  733. key: 0,
  734. "class": "col-12 md:col-4 xl:col-3"
  735. };
  736. var _hoisted_3 = {
  737. "class": "flex justify-content-between mb-3"
  738. };
  739. var _hoisted_4 = {
  740. "class": "block text-500 font-medium mb-3"
  741. };
  742. var _hoisted_5 = {
  743. key: 0,
  744. "class": "text-900 font-medium text-xl"
  745. };
  746. var _hoisted_6 = {
  747. "class": "flex align-items-center justify-content-center bg-orange-100 border-round",
  748. style: {
  749. "width": "2.5rem",
  750. "height": "2.5rem"
  751. }
  752. };
  753. var _hoisted_7 = {
  754. "class": "text-green-500 font-medium"
  755. };
  756. var _hoisted_8 = {
  757. "class": "text-500"
  758. };
  759. var _hoisted_9 = {
  760. "class": "grid"
  761. };
  762. var _hoisted_10 = {
  763. key: 0,
  764. "class": "col-12 md:col-6"
  765. };
  766. var _hoisted_11 = {
  767. "class": "flex flex-column"
  768. };
  769. var _hoisted_12 = {
  770. key: 0,
  771. "class": "text-base font-normal"
  772. };
  773. function render(_ctx, _cache, $props, $setup, $data, $options) {
  774. var _component_Card = (0,vue__WEBPACK_IMPORTED_MODULE_0__.resolveComponent)("Card");
  775. var _component_Chart = (0,vue__WEBPACK_IMPORTED_MODULE_0__.resolveComponent)("Chart");
  776. return (0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createBlock)($setup["DashboardLayout"], null, {
  777. "default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  778. return [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)($setup["Head"], {
  779. title: "Dashboard"
  780. }), (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) {
  781. 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, {
  782. "class": "h-full"
  783. }, {
  784. content: (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  785. 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
  786. /* TEXT */
  787. ), 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
  788. /* TEXT */
  789. )) : (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", {
  790. "class": (0,vue__WEBPACK_IMPORTED_MODULE_0__.normalizeClass)(["text-orange-500 text-xl", cardStatistic.icon])
  791. }, null, 2
  792. /* CLASS */
  793. )])]), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("span", _hoisted_7, (0,vue__WEBPACK_IMPORTED_MODULE_0__.toDisplayString)(cardStatistic.amount), 1
  794. /* TEXT */
  795. ), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("span", _hoisted_8, (0,vue__WEBPACK_IMPORTED_MODULE_0__.toDisplayString)(' ' + cardStatistic.amountLabel), 1
  796. /* TEXT */
  797. )];
  798. }),
  799. _: 2
  800. /* DYNAMIC */
  801. }, 1024
  802. /* DYNAMIC_SLOTS */
  803. )])) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true)], 64
  804. /* STABLE_FRAGMENT */
  805. );
  806. }), 256
  807. /* UNKEYED_FRAGMENT */
  808. ))]), (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) {
  809. 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)({
  810. title: (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  811. 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
  812. /* TEXT */
  813. ), 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
  814. /* TEXT */
  815. )) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true)])];
  816. }),
  817. _: 2
  818. /* DYNAMIC */
  819. }, [Object.keys(barStatistic.data).length ? {
  820. name: "content",
  821. fn: (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  822. return [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(_component_Chart, {
  823. type: "bar",
  824. width: 600,
  825. height: 300,
  826. data: $setup.barChart(barStatistic.data),
  827. options: $setup.barChartOption
  828. }, null, 8
  829. /* PROPS */
  830. , ["data"])];
  831. })
  832. } : undefined]), 1024
  833. /* DYNAMIC_SLOTS */
  834. )])) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true)], 64
  835. /* STABLE_FRAGMENT */
  836. );
  837. }), 256
  838. /* UNKEYED_FRAGMENT */
  839. )), (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> ")])];
  840. }),
  841. _: 1
  842. /* STABLE */
  843. });
  844. }
  845. /***/ }),
  846. /***/ "./resources/js/utils/menu.js":
  847. /*!************************************!*\
  848. !*** ./resources/js/utils/menu.js ***!
  849. \************************************/
  850. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  851. "use strict";
  852. __webpack_require__.r(__webpack_exports__);
  853. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  854. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  855. /* harmony export */ });
  856. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
  857. // Admin
  858. 1: [{
  859. label: 'Home',
  860. items: [{
  861. label: 'Dashboard',
  862. icon: 'pi pi-home',
  863. to: '/dashboards',
  864. component: 'home/Index'
  865. }]
  866. }, {
  867. label: 'Master',
  868. items: [{
  869. label: 'User',
  870. icon: 'pi pi-user',
  871. to: '/users',
  872. component: 'user/Index'
  873. }]
  874. }],
  875. // Supervisor
  876. 2: [{
  877. label: 'Home',
  878. items: [{
  879. label: 'Dashboard',
  880. icon: 'pi pi-home',
  881. to: '/dashboards',
  882. component: 'home/Index'
  883. }]
  884. }, {
  885. label: 'Menu',
  886. items: [{
  887. label: 'Pengeluaran',
  888. icon: 'pi pi-wallet',
  889. to: '/expenses',
  890. component: 'expense/Index'
  891. }, {
  892. label: 'Laporan',
  893. icon: 'pi pi-book',
  894. items: [{
  895. label: 'Mutasi',
  896. icon: 'pi pi-circle',
  897. to: '/reports/mutations',
  898. component: 'mutation/Report'
  899. }]
  900. }]
  901. }, {
  902. label: 'Master',
  903. items: [{
  904. label: 'Jenis Kendaraan',
  905. icon: 'pi pi-car',
  906. to: '/type-vehicles',
  907. component: 'typevehicle/Index'
  908. }, {
  909. label: 'Jenis Member',
  910. icon: 'pi pi-id-card',
  911. to: '/type-members',
  912. component: 'typemember/Index'
  913. }]
  914. }, {
  915. label: 'Pengaturan',
  916. items: [{
  917. label: 'Tarif Parkir',
  918. icon: 'pi pi-car',
  919. to: '/parking-fees/create',
  920. component: 'parkingfee/Create'
  921. }]
  922. }],
  923. // Operator
  924. 3: [{
  925. label: 'Home',
  926. items: [{
  927. label: 'Dashboard',
  928. icon: 'pi pi-home',
  929. to: '/dashboards',
  930. component: 'home/Index'
  931. }]
  932. }, {
  933. label: 'Transaksi',
  934. items: [{
  935. label: 'Transaksi Keluar',
  936. icon: 'pi pi-car',
  937. to: '/transactions/create',
  938. component: 'transaction/Create'
  939. }]
  940. }, {
  941. label: 'Menu',
  942. items: [{
  943. label: 'Pengeluaran',
  944. icon: 'pi pi-wallet',
  945. to: '/expenses',
  946. component: 'expense/Index'
  947. }, {
  948. label: 'Member',
  949. icon: 'pi pi-id-card',
  950. to: '/members',
  951. component: 'member/Index'
  952. }, {
  953. label: 'Top Up',
  954. icon: 'pi pi-car',
  955. to: '/top-ups',
  956. component: 'topup/Index'
  957. }]
  958. }]
  959. });
  960. /***/ }),
  961. /***/ "./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":
  962. /*!***********************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  963. !*** ./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 ***!
  964. \***********************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  965. /***/ ((module, __webpack_exports__, __webpack_require__) => {
  966. "use strict";
  967. __webpack_require__.r(__webpack_exports__);
  968. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  969. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  970. /* harmony export */ });
  971. /* 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");
  972. /* 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__);
  973. // Imports
  974. var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_0___default()(function(i){return i[1]});
  975. // Module
  976. ___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}", ""]);
  977. // Exports
  978. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);
  979. /***/ }),
  980. /***/ "./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":
  981. /*!************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  982. !*** ./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 ***!
  983. \************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  984. /***/ ((module, __webpack_exports__, __webpack_require__) => {
  985. "use strict";
  986. __webpack_require__.r(__webpack_exports__);
  987. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  988. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  989. /* harmony export */ });
  990. /* 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");
  991. /* 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__);
  992. // Imports
  993. var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_0___default()(function(i){return i[1]});
  994. // Module
  995. ___CSS_LOADER_EXPORT___.push([module.id, ".layout-menu[data-v-22a4e926] {\n list-style-type: none;\n margin: 0;\n padding: 0;\n}", ""]);
  996. // Exports
  997. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);
  998. /***/ }),
  999. /***/ "./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":
  1000. /*!***************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  1001. !*** ./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 ***!
  1002. \***************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  1003. /***/ ((module, __webpack_exports__, __webpack_require__) => {
  1004. "use strict";
  1005. __webpack_require__.r(__webpack_exports__);
  1006. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  1007. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  1008. /* harmony export */ });
  1009. /* 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");
  1010. /* 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__);
  1011. // Imports
  1012. var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_0___default()(function(i){return i[1]});
  1013. // Module
  1014. ___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}", ""]);
  1015. // Exports
  1016. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);
  1017. /***/ }),
  1018. /***/ "./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":
  1019. /*!***********************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  1020. !*** ./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 ***!
  1021. \***********************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  1022. /***/ ((module, __webpack_exports__, __webpack_require__) => {
  1023. "use strict";
  1024. __webpack_require__.r(__webpack_exports__);
  1025. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  1026. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  1027. /* harmony export */ });
  1028. /* 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");
  1029. /* 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__);
  1030. // Imports
  1031. var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_0___default()(function(i){return i[1]});
  1032. // Module
  1033. ___CSS_LOADER_EXPORT___.push([module.id, ".layout-topbar[data-v-42bf62a4] {\n position: fixed;\n height: 5rem;\n z-index: 994;\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: 4px;\n padding: 1rem;\n right: 2rem;\n top: 5.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}", ""]);
  1034. // Exports
  1035. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);
  1036. /***/ }),
  1037. /***/ "./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":
  1038. /*!**************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  1039. !*** ./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 ***!
  1040. \**************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  1041. /***/ ((module, __webpack_exports__, __webpack_require__) => {
  1042. "use strict";
  1043. __webpack_require__.r(__webpack_exports__);
  1044. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  1045. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  1046. /* harmony export */ });
  1047. /* 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");
  1048. /* 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__);
  1049. // Imports
  1050. var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_0___default()(function(i){return i[1]});
  1051. // Module
  1052. ___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: 996;\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: 995;\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}", ""]);
  1053. // Exports
  1054. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);
  1055. /***/ }),
  1056. /***/ "./node_modules/lodash/lodash.js":
  1057. /*!***************************************!*\
  1058. !*** ./node_modules/lodash/lodash.js ***!
  1059. \***************************************/
  1060. /***/ (function(module, exports, __webpack_require__) {
  1061. /* module decorator */ module = __webpack_require__.nmd(module);
  1062. var __WEBPACK_AMD_DEFINE_RESULT__;/**
  1063. * @license
  1064. * Lodash <https://lodash.com/>
  1065. * Copyright OpenJS Foundation and other contributors <https://openjsf.org/>
  1066. * Released under MIT license <https://lodash.com/license>
  1067. * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
  1068. * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
  1069. */
  1070. ;(function() {
  1071. /** Used as a safe reference for `undefined` in pre-ES5 environments. */
  1072. var undefined;
  1073. /** Used as the semantic version number. */
  1074. var VERSION = '4.17.21';
  1075. /** Used as the size to enable large array optimizations. */
  1076. var LARGE_ARRAY_SIZE = 200;
  1077. /** Error message constants. */
  1078. var CORE_ERROR_TEXT = 'Unsupported core-js use. Try https://npms.io/search?q=ponyfill.',
  1079. FUNC_ERROR_TEXT = 'Expected a function',
  1080. INVALID_TEMPL_VAR_ERROR_TEXT = 'Invalid `variable` option passed into `_.template`';
  1081. /** Used to stand-in for `undefined` hash values. */
  1082. var HASH_UNDEFINED = '__lodash_hash_undefined__';
  1083. /** Used as the maximum memoize cache size. */
  1084. var MAX_MEMOIZE_SIZE = 500;
  1085. /** Used as the internal argument placeholder. */
  1086. var PLACEHOLDER = '__lodash_placeholder__';
  1087. /** Used to compose bitmasks for cloning. */
  1088. var CLONE_DEEP_FLAG = 1,
  1089. CLONE_FLAT_FLAG = 2,
  1090. CLONE_SYMBOLS_FLAG = 4;
  1091. /** Used to compose bitmasks for value comparisons. */
  1092. var COMPARE_PARTIAL_FLAG = 1,
  1093. COMPARE_UNORDERED_FLAG = 2;
  1094. /** Used to compose bitmasks for function metadata. */
  1095. var WRAP_BIND_FLAG = 1,
  1096. WRAP_BIND_KEY_FLAG = 2,
  1097. WRAP_CURRY_BOUND_FLAG = 4,
  1098. WRAP_CURRY_FLAG = 8,
  1099. WRAP_CURRY_RIGHT_FLAG = 16,
  1100. WRAP_PARTIAL_FLAG = 32,
  1101. WRAP_PARTIAL_RIGHT_FLAG = 64,
  1102. WRAP_ARY_FLAG = 128,
  1103. WRAP_REARG_FLAG = 256,
  1104. WRAP_FLIP_FLAG = 512;
  1105. /** Used as default options for `_.truncate`. */
  1106. var DEFAULT_TRUNC_LENGTH = 30,
  1107. DEFAULT_TRUNC_OMISSION = '...';
  1108. /** Used to detect hot functions by number of calls within a span of milliseconds. */
  1109. var HOT_COUNT = 800,
  1110. HOT_SPAN = 16;
  1111. /** Used to indicate the type of lazy iteratees. */
  1112. var LAZY_FILTER_FLAG = 1,
  1113. LAZY_MAP_FLAG = 2,
  1114. LAZY_WHILE_FLAG = 3;
  1115. /** Used as references for various `Number` constants. */
  1116. var INFINITY = 1 / 0,
  1117. MAX_SAFE_INTEGER = 9007199254740991,
  1118. MAX_INTEGER = 1.7976931348623157e+308,
  1119. NAN = 0 / 0;
  1120. /** Used as references for the maximum length and index of an array. */
  1121. var MAX_ARRAY_LENGTH = 4294967295,
  1122. MAX_ARRAY_INDEX = MAX_ARRAY_LENGTH - 1,
  1123. HALF_MAX_ARRAY_LENGTH = MAX_ARRAY_LENGTH >>> 1;
  1124. /** Used to associate wrap methods with their bit flags. */
  1125. var wrapFlags = [
  1126. ['ary', WRAP_ARY_FLAG],
  1127. ['bind', WRAP_BIND_FLAG],
  1128. ['bindKey', WRAP_BIND_KEY_FLAG],
  1129. ['curry', WRAP_CURRY_FLAG],
  1130. ['curryRight', WRAP_CURRY_RIGHT_FLAG],
  1131. ['flip', WRAP_FLIP_FLAG],
  1132. ['partial', WRAP_PARTIAL_FLAG],
  1133. ['partialRight', WRAP_PARTIAL_RIGHT_FLAG],
  1134. ['rearg', WRAP_REARG_FLAG]
  1135. ];
  1136. /** `Object#toString` result references. */
  1137. var argsTag = '[object Arguments]',
  1138. arrayTag = '[object Array]',
  1139. asyncTag = '[object AsyncFunction]',
  1140. boolTag = '[object Boolean]',
  1141. dateTag = '[object Date]',
  1142. domExcTag = '[object DOMException]',
  1143. errorTag = '[object Error]',
  1144. funcTag = '[object Function]',
  1145. genTag = '[object GeneratorFunction]',
  1146. mapTag = '[object Map]',
  1147. numberTag = '[object Number]',
  1148. nullTag = '[object Null]',
  1149. objectTag = '[object Object]',
  1150. promiseTag = '[object Promise]',
  1151. proxyTag = '[object Proxy]',
  1152. regexpTag = '[object RegExp]',
  1153. setTag = '[object Set]',
  1154. stringTag = '[object String]',
  1155. symbolTag = '[object Symbol]',
  1156. undefinedTag = '[object Undefined]',
  1157. weakMapTag = '[object WeakMap]',
  1158. weakSetTag = '[object WeakSet]';
  1159. var arrayBufferTag = '[object ArrayBuffer]',
  1160. dataViewTag = '[object DataView]',
  1161. float32Tag = '[object Float32Array]',
  1162. float64Tag = '[object Float64Array]',
  1163. int8Tag = '[object Int8Array]',
  1164. int16Tag = '[object Int16Array]',
  1165. int32Tag = '[object Int32Array]',
  1166. uint8Tag = '[object Uint8Array]',
  1167. uint8ClampedTag = '[object Uint8ClampedArray]',
  1168. uint16Tag = '[object Uint16Array]',
  1169. uint32Tag = '[object Uint32Array]';
  1170. /** Used to match empty string literals in compiled template source. */
  1171. var reEmptyStringLeading = /\b__p \+= '';/g,
  1172. reEmptyStringMiddle = /\b(__p \+=) '' \+/g,
  1173. reEmptyStringTrailing = /(__e\(.*?\)|\b__t\)) \+\n'';/g;
  1174. /** Used to match HTML entities and HTML characters. */
  1175. var reEscapedHtml = /&(?:amp|lt|gt|quot|#39);/g,
  1176. reUnescapedHtml = /[&<>"']/g,
  1177. reHasEscapedHtml = RegExp(reEscapedHtml.source),
  1178. reHasUnescapedHtml = RegExp(reUnescapedHtml.source);
  1179. /** Used to match template delimiters. */
  1180. var reEscape = /<%-([\s\S]+?)%>/g,
  1181. reEvaluate = /<%([\s\S]+?)%>/g,
  1182. reInterpolate = /<%=([\s\S]+?)%>/g;
  1183. /** Used to match property names within property paths. */
  1184. var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,
  1185. reIsPlainProp = /^\w*$/,
  1186. rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g;
  1187. /**
  1188. * Used to match `RegExp`
  1189. * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).
  1190. */
  1191. var reRegExpChar = /[\\^$.*+?()[\]{}|]/g,
  1192. reHasRegExpChar = RegExp(reRegExpChar.source);
  1193. /** Used to match leading whitespace. */
  1194. var reTrimStart = /^\s+/;
  1195. /** Used to match a single whitespace character. */
  1196. var reWhitespace = /\s/;
  1197. /** Used to match wrap detail comments. */
  1198. var reWrapComment = /\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,
  1199. reWrapDetails = /\{\n\/\* \[wrapped with (.+)\] \*/,
  1200. reSplitDetails = /,? & /;
  1201. /** Used to match words composed of alphanumeric characters. */
  1202. var reAsciiWord = /[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;
  1203. /**
  1204. * Used to validate the `validate` option in `_.template` variable.
  1205. *
  1206. * Forbids characters which could potentially change the meaning of the function argument definition:
  1207. * - "()," (modification of function parameters)
  1208. * - "=" (default value)
  1209. * - "[]{}" (destructuring of function parameters)
  1210. * - "/" (beginning of a comment)
  1211. * - whitespace
  1212. */
  1213. var reForbiddenIdentifierChars = /[()=,{}\[\]\/\s]/;
  1214. /** Used to match backslashes in property paths. */
  1215. var reEscapeChar = /\\(\\)?/g;
  1216. /**
  1217. * Used to match
  1218. * [ES template delimiters](http://ecma-international.org/ecma-262/7.0/#sec-template-literal-lexical-components).
  1219. */
  1220. var reEsTemplate = /\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g;
  1221. /** Used to match `RegExp` flags from their coerced string values. */
  1222. var reFlags = /\w*$/;
  1223. /** Used to detect bad signed hexadecimal string values. */
  1224. var reIsBadHex = /^[-+]0x[0-9a-f]+$/i;
  1225. /** Used to detect binary string values. */
  1226. var reIsBinary = /^0b[01]+$/i;
  1227. /** Used to detect host constructors (Safari). */
  1228. var reIsHostCtor = /^\[object .+?Constructor\]$/;
  1229. /** Used to detect octal string values. */
  1230. var reIsOctal = /^0o[0-7]+$/i;
  1231. /** Used to detect unsigned integer values. */
  1232. var reIsUint = /^(?:0|[1-9]\d*)$/;
  1233. /** Used to match Latin Unicode letters (excluding mathematical operators). */
  1234. var reLatin = /[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g;
  1235. /** Used to ensure capturing order of template delimiters. */
  1236. var reNoMatch = /($^)/;
  1237. /** Used to match unescaped characters in compiled string literals. */
  1238. var reUnescapedString = /['\n\r\u2028\u2029\\]/g;
  1239. /** Used to compose unicode character classes. */
  1240. var rsAstralRange = '\\ud800-\\udfff',
  1241. rsComboMarksRange = '\\u0300-\\u036f',
  1242. reComboHalfMarksRange = '\\ufe20-\\ufe2f',
  1243. rsComboSymbolsRange = '\\u20d0-\\u20ff',
  1244. rsComboRange = rsComboMarksRange + reComboHalfMarksRange + rsComboSymbolsRange,
  1245. rsDingbatRange = '\\u2700-\\u27bf',
  1246. rsLowerRange = 'a-z\\xdf-\\xf6\\xf8-\\xff',
  1247. rsMathOpRange = '\\xac\\xb1\\xd7\\xf7',
  1248. rsNonCharRange = '\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf',
  1249. rsPunctuationRange = '\\u2000-\\u206f',
  1250. 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',
  1251. rsUpperRange = 'A-Z\\xc0-\\xd6\\xd8-\\xde',
  1252. rsVarRange = '\\ufe0e\\ufe0f',
  1253. rsBreakRange = rsMathOpRange + rsNonCharRange + rsPunctuationRange + rsSpaceRange;
  1254. /** Used to compose unicode capture groups. */
  1255. var rsApos = "['\u2019]",
  1256. rsAstral = '[' + rsAstralRange + ']',
  1257. rsBreak = '[' + rsBreakRange + ']',
  1258. rsCombo = '[' + rsComboRange + ']',
  1259. rsDigits = '\\d+',
  1260. rsDingbat = '[' + rsDingbatRange + ']',
  1261. rsLower = '[' + rsLowerRange + ']',
  1262. rsMisc = '[^' + rsAstralRange + rsBreakRange + rsDigits + rsDingbatRange + rsLowerRange + rsUpperRange + ']',
  1263. rsFitz = '\\ud83c[\\udffb-\\udfff]',
  1264. rsModifier = '(?:' + rsCombo + '|' + rsFitz + ')',
  1265. rsNonAstral = '[^' + rsAstralRange + ']',
  1266. rsRegional = '(?:\\ud83c[\\udde6-\\uddff]){2}',
  1267. rsSurrPair = '[\\ud800-\\udbff][\\udc00-\\udfff]',
  1268. rsUpper = '[' + rsUpperRange + ']',
  1269. rsZWJ = '\\u200d';
  1270. /** Used to compose unicode regexes. */
  1271. var rsMiscLower = '(?:' + rsLower + '|' + rsMisc + ')',
  1272. rsMiscUpper = '(?:' + rsUpper + '|' + rsMisc + ')',
  1273. rsOptContrLower = '(?:' + rsApos + '(?:d|ll|m|re|s|t|ve))?',
  1274. rsOptContrUpper = '(?:' + rsApos + '(?:D|LL|M|RE|S|T|VE))?',
  1275. reOptMod = rsModifier + '?',
  1276. rsOptVar = '[' + rsVarRange + ']?',
  1277. rsOptJoin = '(?:' + rsZWJ + '(?:' + [rsNonAstral, rsRegional, rsSurrPair].join('|') + ')' + rsOptVar + reOptMod + ')*',
  1278. rsOrdLower = '\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])',
  1279. rsOrdUpper = '\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])',
  1280. rsSeq = rsOptVar + reOptMod + rsOptJoin,
  1281. rsEmoji = '(?:' + [rsDingbat, rsRegional, rsSurrPair].join('|') + ')' + rsSeq,
  1282. rsSymbol = '(?:' + [rsNonAstral + rsCombo + '?', rsCombo, rsRegional, rsSurrPair, rsAstral].join('|') + ')';
  1283. /** Used to match apostrophes. */
  1284. var reApos = RegExp(rsApos, 'g');
  1285. /**
  1286. * Used to match [combining diacritical marks](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks) and
  1287. * [combining diacritical marks for symbols](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks_for_Symbols).
  1288. */
  1289. var reComboMark = RegExp(rsCombo, 'g');
  1290. /** Used to match [string symbols](https://mathiasbynens.be/notes/javascript-unicode). */
  1291. var reUnicode = RegExp(rsFitz + '(?=' + rsFitz + ')|' + rsSymbol + rsSeq, 'g');
  1292. /** Used to match complex or compound words. */
  1293. var reUnicodeWord = RegExp([
  1294. rsUpper + '?' + rsLower + '+' + rsOptContrLower + '(?=' + [rsBreak, rsUpper, '$'].join('|') + ')',
  1295. rsMiscUpper + '+' + rsOptContrUpper + '(?=' + [rsBreak, rsUpper + rsMiscLower, '$'].join('|') + ')',
  1296. rsUpper + '?' + rsMiscLower + '+' + rsOptContrLower,
  1297. rsUpper + '+' + rsOptContrUpper,
  1298. rsOrdUpper,
  1299. rsOrdLower,
  1300. rsDigits,
  1301. rsEmoji
  1302. ].join('|'), 'g');
  1303. /** 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/). */
  1304. var reHasUnicode = RegExp('[' + rsZWJ + rsAstralRange + rsComboRange + rsVarRange + ']');
  1305. /** Used to detect strings that need a more robust regexp to match words. */
  1306. 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 ]/;
  1307. /** Used to assign default `context` object properties. */
  1308. var contextProps = [
  1309. 'Array', 'Buffer', 'DataView', 'Date', 'Error', 'Float32Array', 'Float64Array',
  1310. 'Function', 'Int8Array', 'Int16Array', 'Int32Array', 'Map', 'Math', 'Object',
  1311. 'Promise', 'RegExp', 'Set', 'String', 'Symbol', 'TypeError', 'Uint8Array',
  1312. 'Uint8ClampedArray', 'Uint16Array', 'Uint32Array', 'WeakMap',
  1313. '_', 'clearTimeout', 'isFinite', 'parseInt', 'setTimeout'
  1314. ];
  1315. /** Used to make template sourceURLs easier to identify. */
  1316. var templateCounter = -1;
  1317. /** Used to identify `toStringTag` values of typed arrays. */
  1318. var typedArrayTags = {};
  1319. typedArrayTags[float32Tag] = typedArrayTags[float64Tag] =
  1320. typedArrayTags[int8Tag] = typedArrayTags[int16Tag] =
  1321. typedArrayTags[int32Tag] = typedArrayTags[uint8Tag] =
  1322. typedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] =
  1323. typedArrayTags[uint32Tag] = true;
  1324. typedArrayTags[argsTag] = typedArrayTags[arrayTag] =
  1325. typedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] =
  1326. typedArrayTags[dataViewTag] = typedArrayTags[dateTag] =
  1327. typedArrayTags[errorTag] = typedArrayTags[funcTag] =
  1328. typedArrayTags[mapTag] = typedArrayTags[numberTag] =
  1329. typedArrayTags[objectTag] = typedArrayTags[regexpTag] =
  1330. typedArrayTags[setTag] = typedArrayTags[stringTag] =
  1331. typedArrayTags[weakMapTag] = false;
  1332. /** Used to identify `toStringTag` values supported by `_.clone`. */
  1333. var cloneableTags = {};
  1334. cloneableTags[argsTag] = cloneableTags[arrayTag] =
  1335. cloneableTags[arrayBufferTag] = cloneableTags[dataViewTag] =
  1336. cloneableTags[boolTag] = cloneableTags[dateTag] =
  1337. cloneableTags[float32Tag] = cloneableTags[float64Tag] =
  1338. cloneableTags[int8Tag] = cloneableTags[int16Tag] =
  1339. cloneableTags[int32Tag] = cloneableTags[mapTag] =
  1340. cloneableTags[numberTag] = cloneableTags[objectTag] =
  1341. cloneableTags[regexpTag] = cloneableTags[setTag] =
  1342. cloneableTags[stringTag] = cloneableTags[symbolTag] =
  1343. cloneableTags[uint8Tag] = cloneableTags[uint8ClampedTag] =
  1344. cloneableTags[uint16Tag] = cloneableTags[uint32Tag] = true;
  1345. cloneableTags[errorTag] = cloneableTags[funcTag] =
  1346. cloneableTags[weakMapTag] = false;
  1347. /** Used to map Latin Unicode letters to basic Latin letters. */
  1348. var deburredLetters = {
  1349. // Latin-1 Supplement block.
  1350. '\xc0': 'A', '\xc1': 'A', '\xc2': 'A', '\xc3': 'A', '\xc4': 'A', '\xc5': 'A',
  1351. '\xe0': 'a', '\xe1': 'a', '\xe2': 'a', '\xe3': 'a', '\xe4': 'a', '\xe5': 'a',
  1352. '\xc7': 'C', '\xe7': 'c',
  1353. '\xd0': 'D', '\xf0': 'd',
  1354. '\xc8': 'E', '\xc9': 'E', '\xca': 'E', '\xcb': 'E',
  1355. '\xe8': 'e', '\xe9': 'e', '\xea': 'e', '\xeb': 'e',
  1356. '\xcc': 'I', '\xcd': 'I', '\xce': 'I', '\xcf': 'I',
  1357. '\xec': 'i', '\xed': 'i', '\xee': 'i', '\xef': 'i',
  1358. '\xd1': 'N', '\xf1': 'n',
  1359. '\xd2': 'O', '\xd3': 'O', '\xd4': 'O', '\xd5': 'O', '\xd6': 'O', '\xd8': 'O',
  1360. '\xf2': 'o', '\xf3': 'o', '\xf4': 'o', '\xf5': 'o', '\xf6': 'o', '\xf8': 'o',
  1361. '\xd9': 'U', '\xda': 'U', '\xdb': 'U', '\xdc': 'U',
  1362. '\xf9': 'u', '\xfa': 'u', '\xfb': 'u', '\xfc': 'u',
  1363. '\xdd': 'Y', '\xfd': 'y', '\xff': 'y',
  1364. '\xc6': 'Ae', '\xe6': 'ae',
  1365. '\xde': 'Th', '\xfe': 'th',
  1366. '\xdf': 'ss',
  1367. // Latin Extended-A block.
  1368. '\u0100': 'A', '\u0102': 'A', '\u0104': 'A',
  1369. '\u0101': 'a', '\u0103': 'a', '\u0105': 'a',
  1370. '\u0106': 'C', '\u0108': 'C', '\u010a': 'C', '\u010c': 'C',
  1371. '\u0107': 'c', '\u0109': 'c', '\u010b': 'c', '\u010d': 'c',
  1372. '\u010e': 'D', '\u0110': 'D', '\u010f': 'd', '\u0111': 'd',
  1373. '\u0112': 'E', '\u0114': 'E', '\u0116': 'E', '\u0118': 'E', '\u011a': 'E',
  1374. '\u0113': 'e', '\u0115': 'e', '\u0117': 'e', '\u0119': 'e', '\u011b': 'e',
  1375. '\u011c': 'G', '\u011e': 'G', '\u0120': 'G', '\u0122': 'G',
  1376. '\u011d': 'g', '\u011f': 'g', '\u0121': 'g', '\u0123': 'g',
  1377. '\u0124': 'H', '\u0126': 'H', '\u0125': 'h', '\u0127': 'h',
  1378. '\u0128': 'I', '\u012a': 'I', '\u012c': 'I', '\u012e': 'I', '\u0130': 'I',
  1379. '\u0129': 'i', '\u012b': 'i', '\u012d': 'i', '\u012f': 'i', '\u0131': 'i',
  1380. '\u0134': 'J', '\u0135': 'j',
  1381. '\u0136': 'K', '\u0137': 'k', '\u0138': 'k',
  1382. '\u0139': 'L', '\u013b': 'L', '\u013d': 'L', '\u013f': 'L', '\u0141': 'L',
  1383. '\u013a': 'l', '\u013c': 'l', '\u013e': 'l', '\u0140': 'l', '\u0142': 'l',
  1384. '\u0143': 'N', '\u0145': 'N', '\u0147': 'N', '\u014a': 'N',
  1385. '\u0144': 'n', '\u0146': 'n', '\u0148': 'n', '\u014b': 'n',
  1386. '\u014c': 'O', '\u014e': 'O', '\u0150': 'O',
  1387. '\u014d': 'o', '\u014f': 'o', '\u0151': 'o',
  1388. '\u0154': 'R', '\u0156': 'R', '\u0158': 'R',
  1389. '\u0155': 'r', '\u0157': 'r', '\u0159': 'r',
  1390. '\u015a': 'S', '\u015c': 'S', '\u015e': 'S', '\u0160': 'S',
  1391. '\u015b': 's', '\u015d': 's', '\u015f': 's', '\u0161': 's',
  1392. '\u0162': 'T', '\u0164': 'T', '\u0166': 'T',
  1393. '\u0163': 't', '\u0165': 't', '\u0167': 't',
  1394. '\u0168': 'U', '\u016a': 'U', '\u016c': 'U', '\u016e': 'U', '\u0170': 'U', '\u0172': 'U',
  1395. '\u0169': 'u', '\u016b': 'u', '\u016d': 'u', '\u016f': 'u', '\u0171': 'u', '\u0173': 'u',
  1396. '\u0174': 'W', '\u0175': 'w',
  1397. '\u0176': 'Y', '\u0177': 'y', '\u0178': 'Y',
  1398. '\u0179': 'Z', '\u017b': 'Z', '\u017d': 'Z',
  1399. '\u017a': 'z', '\u017c': 'z', '\u017e': 'z',
  1400. '\u0132': 'IJ', '\u0133': 'ij',
  1401. '\u0152': 'Oe', '\u0153': 'oe',
  1402. '\u0149': "'n", '\u017f': 's'
  1403. };
  1404. /** Used to map characters to HTML entities. */
  1405. var htmlEscapes = {
  1406. '&': '&amp;',
  1407. '<': '&lt;',
  1408. '>': '&gt;',
  1409. '"': '&quot;',
  1410. "'": '&#39;'
  1411. };
  1412. /** Used to map HTML entities to characters. */
  1413. var htmlUnescapes = {
  1414. '&amp;': '&',
  1415. '&lt;': '<',
  1416. '&gt;': '>',
  1417. '&quot;': '"',
  1418. '&#39;': "'"
  1419. };
  1420. /** Used to escape characters for inclusion in compiled string literals. */
  1421. var stringEscapes = {
  1422. '\\': '\\',
  1423. "'": "'",
  1424. '\n': 'n',
  1425. '\r': 'r',
  1426. '\u2028': 'u2028',
  1427. '\u2029': 'u2029'
  1428. };
  1429. /** Built-in method references without a dependency on `root`. */
  1430. var freeParseFloat = parseFloat,
  1431. freeParseInt = parseInt;
  1432. /** Detect free variable `global` from Node.js. */
  1433. var freeGlobal = typeof __webpack_require__.g == 'object' && __webpack_require__.g && __webpack_require__.g.Object === Object && __webpack_require__.g;
  1434. /** Detect free variable `self`. */
  1435. var freeSelf = typeof self == 'object' && self && self.Object === Object && self;
  1436. /** Used as a reference to the global object. */
  1437. var root = freeGlobal || freeSelf || Function('return this')();
  1438. /** Detect free variable `exports`. */
  1439. var freeExports = true && exports && !exports.nodeType && exports;
  1440. /** Detect free variable `module`. */
  1441. var freeModule = freeExports && "object" == 'object' && module && !module.nodeType && module;
  1442. /** Detect the popular CommonJS extension `module.exports`. */
  1443. var moduleExports = freeModule && freeModule.exports === freeExports;
  1444. /** Detect free variable `process` from Node.js. */
  1445. var freeProcess = moduleExports && freeGlobal.process;
  1446. /** Used to access faster Node.js helpers. */
  1447. var nodeUtil = (function() {
  1448. try {
  1449. // Use `util.types` for Node.js 10+.
  1450. var types = freeModule && freeModule.require && freeModule.require('util').types;
  1451. if (types) {
  1452. return types;
  1453. }
  1454. // Legacy `process.binding('util')` for Node.js < 10.
  1455. return freeProcess && freeProcess.binding && freeProcess.binding('util');
  1456. } catch (e) {}
  1457. }());
  1458. /* Node.js helper references. */
  1459. var nodeIsArrayBuffer = nodeUtil && nodeUtil.isArrayBuffer,
  1460. nodeIsDate = nodeUtil && nodeUtil.isDate,
  1461. nodeIsMap = nodeUtil && nodeUtil.isMap,
  1462. nodeIsRegExp = nodeUtil && nodeUtil.isRegExp,
  1463. nodeIsSet = nodeUtil && nodeUtil.isSet,
  1464. nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray;
  1465. /*--------------------------------------------------------------------------*/
  1466. /**
  1467. * A faster alternative to `Function#apply`, this function invokes `func`
  1468. * with the `this` binding of `thisArg` and the arguments of `args`.
  1469. *
  1470. * @private
  1471. * @param {Function} func The function to invoke.
  1472. * @param {*} thisArg The `this` binding of `func`.
  1473. * @param {Array} args The arguments to invoke `func` with.
  1474. * @returns {*} Returns the result of `func`.
  1475. */
  1476. function apply(func, thisArg, args) {
  1477. switch (args.length) {
  1478. case 0: return func.call(thisArg);
  1479. case 1: return func.call(thisArg, args[0]);
  1480. case 2: return func.call(thisArg, args[0], args[1]);
  1481. case 3: return func.call(thisArg, args[0], args[1], args[2]);
  1482. }
  1483. return func.apply(thisArg, args);
  1484. }
  1485. /**
  1486. * A specialized version of `baseAggregator` for arrays.
  1487. *
  1488. * @private
  1489. * @param {Array} [array] The array to iterate over.
  1490. * @param {Function} setter The function to set `accumulator` values.
  1491. * @param {Function} iteratee The iteratee to transform keys.
  1492. * @param {Object} accumulator The initial aggregated object.
  1493. * @returns {Function} Returns `accumulator`.
  1494. */
  1495. function arrayAggregator(array, setter, iteratee, accumulator) {
  1496. var index = -1,
  1497. length = array == null ? 0 : array.length;
  1498. while (++index < length) {
  1499. var value = array[index];
  1500. setter(accumulator, value, iteratee(value), array);
  1501. }
  1502. return accumulator;
  1503. }
  1504. /**
  1505. * A specialized version of `_.forEach` for arrays without support for
  1506. * iteratee shorthands.
  1507. *
  1508. * @private
  1509. * @param {Array} [array] The array to iterate over.
  1510. * @param {Function} iteratee The function invoked per iteration.
  1511. * @returns {Array} Returns `array`.
  1512. */
  1513. function arrayEach(array, iteratee) {
  1514. var index = -1,
  1515. length = array == null ? 0 : array.length;
  1516. while (++index < length) {
  1517. if (iteratee(array[index], index, array) === false) {
  1518. break;
  1519. }
  1520. }
  1521. return array;
  1522. }
  1523. /**
  1524. * A specialized version of `_.forEachRight` for arrays without support for
  1525. * iteratee shorthands.
  1526. *
  1527. * @private
  1528. * @param {Array} [array] The array to iterate over.
  1529. * @param {Function} iteratee The function invoked per iteration.
  1530. * @returns {Array} Returns `array`.
  1531. */
  1532. function arrayEachRight(array, iteratee) {
  1533. var length = array == null ? 0 : array.length;
  1534. while (length--) {
  1535. if (iteratee(array[length], length, array) === false) {
  1536. break;
  1537. }
  1538. }
  1539. return array;
  1540. }
  1541. /**
  1542. * A specialized version of `_.every` for arrays without support for
  1543. * iteratee shorthands.
  1544. *
  1545. * @private
  1546. * @param {Array} [array] The array to iterate over.
  1547. * @param {Function} predicate The function invoked per iteration.
  1548. * @returns {boolean} Returns `true` if all elements pass the predicate check,
  1549. * else `false`.
  1550. */
  1551. function arrayEvery(array, predicate) {
  1552. var index = -1,
  1553. length = array == null ? 0 : array.length;
  1554. while (++index < length) {
  1555. if (!predicate(array[index], index, array)) {
  1556. return false;
  1557. }
  1558. }
  1559. return true;
  1560. }
  1561. /**
  1562. * A specialized version of `_.filter` for arrays without support for
  1563. * iteratee shorthands.
  1564. *
  1565. * @private
  1566. * @param {Array} [array] The array to iterate over.
  1567. * @param {Function} predicate The function invoked per iteration.
  1568. * @returns {Array} Returns the new filtered array.
  1569. */
  1570. function arrayFilter(array, predicate) {
  1571. var index = -1,
  1572. length = array == null ? 0 : array.length,
  1573. resIndex = 0,
  1574. result = [];
  1575. while (++index < length) {
  1576. var value = array[index];
  1577. if (predicate(value, index, array)) {
  1578. result[resIndex++] = value;
  1579. }
  1580. }
  1581. return result;
  1582. }
  1583. /**
  1584. * A specialized version of `_.includes` for arrays without support for
  1585. * specifying an index to search from.
  1586. *
  1587. * @private
  1588. * @param {Array} [array] The array to inspect.
  1589. * @param {*} target The value to search for.
  1590. * @returns {boolean} Returns `true` if `target` is found, else `false`.
  1591. */
  1592. function arrayIncludes(array, value) {
  1593. var length = array == null ? 0 : array.length;
  1594. return !!length && baseIndexOf(array, value, 0) > -1;
  1595. }
  1596. /**
  1597. * This function is like `arrayIncludes` except that it accepts a comparator.
  1598. *
  1599. * @private
  1600. * @param {Array} [array] The array to inspect.
  1601. * @param {*} target The value to search for.
  1602. * @param {Function} comparator The comparator invoked per element.
  1603. * @returns {boolean} Returns `true` if `target` is found, else `false`.
  1604. */
  1605. function arrayIncludesWith(array, value, comparator) {
  1606. var index = -1,
  1607. length = array == null ? 0 : array.length;
  1608. while (++index < length) {
  1609. if (comparator(value, array[index])) {
  1610. return true;
  1611. }
  1612. }
  1613. return false;
  1614. }
  1615. /**
  1616. * A specialized version of `_.map` for arrays without support for iteratee
  1617. * shorthands.
  1618. *
  1619. * @private
  1620. * @param {Array} [array] The array to iterate over.
  1621. * @param {Function} iteratee The function invoked per iteration.
  1622. * @returns {Array} Returns the new mapped array.
  1623. */
  1624. function arrayMap(array, iteratee) {
  1625. var index = -1,
  1626. length = array == null ? 0 : array.length,
  1627. result = Array(length);
  1628. while (++index < length) {
  1629. result[index] = iteratee(array[index], index, array);
  1630. }
  1631. return result;
  1632. }
  1633. /**
  1634. * Appends the elements of `values` to `array`.
  1635. *
  1636. * @private
  1637. * @param {Array} array The array to modify.
  1638. * @param {Array} values The values to append.
  1639. * @returns {Array} Returns `array`.
  1640. */
  1641. function arrayPush(array, values) {
  1642. var index = -1,
  1643. length = values.length,
  1644. offset = array.length;
  1645. while (++index < length) {
  1646. array[offset + index] = values[index];
  1647. }
  1648. return array;
  1649. }
  1650. /**
  1651. * A specialized version of `_.reduce` for arrays without support for
  1652. * iteratee shorthands.
  1653. *
  1654. * @private
  1655. * @param {Array} [array] The array to iterate over.
  1656. * @param {Function} iteratee The function invoked per iteration.
  1657. * @param {*} [accumulator] The initial value.
  1658. * @param {boolean} [initAccum] Specify using the first element of `array` as
  1659. * the initial value.
  1660. * @returns {*} Returns the accumulated value.
  1661. */
  1662. function arrayReduce(array, iteratee, accumulator, initAccum) {
  1663. var index = -1,
  1664. length = array == null ? 0 : array.length;
  1665. if (initAccum && length) {
  1666. accumulator = array[++index];
  1667. }
  1668. while (++index < length) {
  1669. accumulator = iteratee(accumulator, array[index], index, array);
  1670. }
  1671. return accumulator;
  1672. }
  1673. /**
  1674. * A specialized version of `_.reduceRight` for arrays without support for
  1675. * iteratee shorthands.
  1676. *
  1677. * @private
  1678. * @param {Array} [array] The array to iterate over.
  1679. * @param {Function} iteratee The function invoked per iteration.
  1680. * @param {*} [accumulator] The initial value.
  1681. * @param {boolean} [initAccum] Specify using the last element of `array` as
  1682. * the initial value.
  1683. * @returns {*} Returns the accumulated value.
  1684. */
  1685. function arrayReduceRight(array, iteratee, accumulator, initAccum) {
  1686. var length = array == null ? 0 : array.length;
  1687. if (initAccum && length) {
  1688. accumulator = array[--length];
  1689. }
  1690. while (length--) {
  1691. accumulator = iteratee(accumulator, array[length], length, array);
  1692. }
  1693. return accumulator;
  1694. }
  1695. /**
  1696. * A specialized version of `_.some` for arrays without support for iteratee
  1697. * shorthands.
  1698. *
  1699. * @private
  1700. * @param {Array} [array] The array to iterate over.
  1701. * @param {Function} predicate The function invoked per iteration.
  1702. * @returns {boolean} Returns `true` if any element passes the predicate check,
  1703. * else `false`.
  1704. */
  1705. function arraySome(array, predicate) {
  1706. var index = -1,
  1707. length = array == null ? 0 : array.length;
  1708. while (++index < length) {
  1709. if (predicate(array[index], index, array)) {
  1710. return true;
  1711. }
  1712. }
  1713. return false;
  1714. }
  1715. /**
  1716. * Gets the size of an ASCII `string`.
  1717. *
  1718. * @private
  1719. * @param {string} string The string inspect.
  1720. * @returns {number} Returns the string size.
  1721. */
  1722. var asciiSize = baseProperty('length');
  1723. /**
  1724. * Converts an ASCII `string` to an array.
  1725. *
  1726. * @private
  1727. * @param {string} string The string to convert.
  1728. * @returns {Array} Returns the converted array.
  1729. */
  1730. function asciiToArray(string) {
  1731. return string.split('');
  1732. }
  1733. /**
  1734. * Splits an ASCII `string` into an array of its words.
  1735. *
  1736. * @private
  1737. * @param {string} The string to inspect.
  1738. * @returns {Array} Returns the words of `string`.
  1739. */
  1740. function asciiWords(string) {
  1741. return string.match(reAsciiWord) || [];
  1742. }
  1743. /**
  1744. * The base implementation of methods like `_.findKey` and `_.findLastKey`,
  1745. * without support for iteratee shorthands, which iterates over `collection`
  1746. * using `eachFunc`.
  1747. *
  1748. * @private
  1749. * @param {Array|Object} collection The collection to inspect.
  1750. * @param {Function} predicate The function invoked per iteration.
  1751. * @param {Function} eachFunc The function to iterate over `collection`.
  1752. * @returns {*} Returns the found element or its key, else `undefined`.
  1753. */
  1754. function baseFindKey(collection, predicate, eachFunc) {
  1755. var result;
  1756. eachFunc(collection, function(value, key, collection) {
  1757. if (predicate(value, key, collection)) {
  1758. result = key;
  1759. return false;
  1760. }
  1761. });
  1762. return result;
  1763. }
  1764. /**
  1765. * The base implementation of `_.findIndex` and `_.findLastIndex` without
  1766. * support for iteratee shorthands.
  1767. *
  1768. * @private
  1769. * @param {Array} array The array to inspect.
  1770. * @param {Function} predicate The function invoked per iteration.
  1771. * @param {number} fromIndex The index to search from.
  1772. * @param {boolean} [fromRight] Specify iterating from right to left.
  1773. * @returns {number} Returns the index of the matched value, else `-1`.
  1774. */
  1775. function baseFindIndex(array, predicate, fromIndex, fromRight) {
  1776. var length = array.length,
  1777. index = fromIndex + (fromRight ? 1 : -1);
  1778. while ((fromRight ? index-- : ++index < length)) {
  1779. if (predicate(array[index], index, array)) {
  1780. return index;
  1781. }
  1782. }
  1783. return -1;
  1784. }
  1785. /**
  1786. * The base implementation of `_.indexOf` without `fromIndex` bounds checks.
  1787. *
  1788. * @private
  1789. * @param {Array} array The array to inspect.
  1790. * @param {*} value The value to search for.
  1791. * @param {number} fromIndex The index to search from.
  1792. * @returns {number} Returns the index of the matched value, else `-1`.
  1793. */
  1794. function baseIndexOf(array, value, fromIndex) {
  1795. return value === value
  1796. ? strictIndexOf(array, value, fromIndex)
  1797. : baseFindIndex(array, baseIsNaN, fromIndex);
  1798. }
  1799. /**
  1800. * This function is like `baseIndexOf` except that it accepts a comparator.
  1801. *
  1802. * @private
  1803. * @param {Array} array The array to inspect.
  1804. * @param {*} value The value to search for.
  1805. * @param {number} fromIndex The index to search from.
  1806. * @param {Function} comparator The comparator invoked per element.
  1807. * @returns {number} Returns the index of the matched value, else `-1`.
  1808. */
  1809. function baseIndexOfWith(array, value, fromIndex, comparator) {
  1810. var index = fromIndex - 1,
  1811. length = array.length;
  1812. while (++index < length) {
  1813. if (comparator(array[index], value)) {
  1814. return index;
  1815. }
  1816. }
  1817. return -1;
  1818. }
  1819. /**
  1820. * The base implementation of `_.isNaN` without support for number objects.
  1821. *
  1822. * @private
  1823. * @param {*} value The value to check.
  1824. * @returns {boolean} Returns `true` if `value` is `NaN`, else `false`.
  1825. */
  1826. function baseIsNaN(value) {
  1827. return value !== value;
  1828. }
  1829. /**
  1830. * The base implementation of `_.mean` and `_.meanBy` without support for
  1831. * iteratee shorthands.
  1832. *
  1833. * @private
  1834. * @param {Array} array The array to iterate over.
  1835. * @param {Function} iteratee The function invoked per iteration.
  1836. * @returns {number} Returns the mean.
  1837. */
  1838. function baseMean(array, iteratee) {
  1839. var length = array == null ? 0 : array.length;
  1840. return length ? (baseSum(array, iteratee) / length) : NAN;
  1841. }
  1842. /**
  1843. * The base implementation of `_.property` without support for deep paths.
  1844. *
  1845. * @private
  1846. * @param {string} key The key of the property to get.
  1847. * @returns {Function} Returns the new accessor function.
  1848. */
  1849. function baseProperty(key) {
  1850. return function(object) {
  1851. return object == null ? undefined : object[key];
  1852. };
  1853. }
  1854. /**
  1855. * The base implementation of `_.propertyOf` without support for deep paths.
  1856. *
  1857. * @private
  1858. * @param {Object} object The object to query.
  1859. * @returns {Function} Returns the new accessor function.
  1860. */
  1861. function basePropertyOf(object) {
  1862. return function(key) {
  1863. return object == null ? undefined : object[key];
  1864. };
  1865. }
  1866. /**
  1867. * The base implementation of `_.reduce` and `_.reduceRight`, without support
  1868. * for iteratee shorthands, which iterates over `collection` using `eachFunc`.
  1869. *
  1870. * @private
  1871. * @param {Array|Object} collection The collection to iterate over.
  1872. * @param {Function} iteratee The function invoked per iteration.
  1873. * @param {*} accumulator The initial value.
  1874. * @param {boolean} initAccum Specify using the first or last element of
  1875. * `collection` as the initial value.
  1876. * @param {Function} eachFunc The function to iterate over `collection`.
  1877. * @returns {*} Returns the accumulated value.
  1878. */
  1879. function baseReduce(collection, iteratee, accumulator, initAccum, eachFunc) {
  1880. eachFunc(collection, function(value, index, collection) {
  1881. accumulator = initAccum
  1882. ? (initAccum = false, value)
  1883. : iteratee(accumulator, value, index, collection);
  1884. });
  1885. return accumulator;
  1886. }
  1887. /**
  1888. * The base implementation of `_.sortBy` which uses `comparer` to define the
  1889. * sort order of `array` and replaces criteria objects with their corresponding
  1890. * values.
  1891. *
  1892. * @private
  1893. * @param {Array} array The array to sort.
  1894. * @param {Function} comparer The function to define sort order.
  1895. * @returns {Array} Returns `array`.
  1896. */
  1897. function baseSortBy(array, comparer) {
  1898. var length = array.length;
  1899. array.sort(comparer);
  1900. while (length--) {
  1901. array[length] = array[length].value;
  1902. }
  1903. return array;
  1904. }
  1905. /**
  1906. * The base implementation of `_.sum` and `_.sumBy` without support for
  1907. * iteratee shorthands.
  1908. *
  1909. * @private
  1910. * @param {Array} array The array to iterate over.
  1911. * @param {Function} iteratee The function invoked per iteration.
  1912. * @returns {number} Returns the sum.
  1913. */
  1914. function baseSum(array, iteratee) {
  1915. var result,
  1916. index = -1,
  1917. length = array.length;
  1918. while (++index < length) {
  1919. var current = iteratee(array[index]);
  1920. if (current !== undefined) {
  1921. result = result === undefined ? current : (result + current);
  1922. }
  1923. }
  1924. return result;
  1925. }
  1926. /**
  1927. * The base implementation of `_.times` without support for iteratee shorthands
  1928. * or max array length checks.
  1929. *
  1930. * @private
  1931. * @param {number} n The number of times to invoke `iteratee`.
  1932. * @param {Function} iteratee The function invoked per iteration.
  1933. * @returns {Array} Returns the array of results.
  1934. */
  1935. function baseTimes(n, iteratee) {
  1936. var index = -1,
  1937. result = Array(n);
  1938. while (++index < n) {
  1939. result[index] = iteratee(index);
  1940. }
  1941. return result;
  1942. }
  1943. /**
  1944. * The base implementation of `_.toPairs` and `_.toPairsIn` which creates an array
  1945. * of key-value pairs for `object` corresponding to the property names of `props`.
  1946. *
  1947. * @private
  1948. * @param {Object} object The object to query.
  1949. * @param {Array} props The property names to get values for.
  1950. * @returns {Object} Returns the key-value pairs.
  1951. */
  1952. function baseToPairs(object, props) {
  1953. return arrayMap(props, function(key) {
  1954. return [key, object[key]];
  1955. });
  1956. }
  1957. /**
  1958. * The base implementation of `_.trim`.
  1959. *
  1960. * @private
  1961. * @param {string} string The string to trim.
  1962. * @returns {string} Returns the trimmed string.
  1963. */
  1964. function baseTrim(string) {
  1965. return string
  1966. ? string.slice(0, trimmedEndIndex(string) + 1).replace(reTrimStart, '')
  1967. : string;
  1968. }
  1969. /**
  1970. * The base implementation of `_.unary` without support for storing metadata.
  1971. *
  1972. * @private
  1973. * @param {Function} func The function to cap arguments for.
  1974. * @returns {Function} Returns the new capped function.
  1975. */
  1976. function baseUnary(func) {
  1977. return function(value) {
  1978. return func(value);
  1979. };
  1980. }
  1981. /**
  1982. * The base implementation of `_.values` and `_.valuesIn` which creates an
  1983. * array of `object` property values corresponding to the property names
  1984. * of `props`.
  1985. *
  1986. * @private
  1987. * @param {Object} object The object to query.
  1988. * @param {Array} props The property names to get values for.
  1989. * @returns {Object} Returns the array of property values.
  1990. */
  1991. function baseValues(object, props) {
  1992. return arrayMap(props, function(key) {
  1993. return object[key];
  1994. });
  1995. }
  1996. /**
  1997. * Checks if a `cache` value for `key` exists.
  1998. *
  1999. * @private
  2000. * @param {Object} cache The cache to query.
  2001. * @param {string} key The key of the entry to check.
  2002. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  2003. */
  2004. function cacheHas(cache, key) {
  2005. return cache.has(key);
  2006. }
  2007. /**
  2008. * Used by `_.trim` and `_.trimStart` to get the index of the first 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 first unmatched string symbol.
  2015. */
  2016. function charsStartIndex(strSymbols, chrSymbols) {
  2017. var index = -1,
  2018. length = strSymbols.length;
  2019. while (++index < length && baseIndexOf(chrSymbols, strSymbols[index], 0) > -1) {}
  2020. return index;
  2021. }
  2022. /**
  2023. * Used by `_.trim` and `_.trimEnd` to get the index of the last string symbol
  2024. * that is not found in the character symbols.
  2025. *
  2026. * @private
  2027. * @param {Array} strSymbols The string symbols to inspect.
  2028. * @param {Array} chrSymbols The character symbols to find.
  2029. * @returns {number} Returns the index of the last unmatched string symbol.
  2030. */
  2031. function charsEndIndex(strSymbols, chrSymbols) {
  2032. var index = strSymbols.length;
  2033. while (index-- && baseIndexOf(chrSymbols, strSymbols[index], 0) > -1) {}
  2034. return index;
  2035. }
  2036. /**
  2037. * Gets the number of `placeholder` occurrences in `array`.
  2038. *
  2039. * @private
  2040. * @param {Array} array The array to inspect.
  2041. * @param {*} placeholder The placeholder to search for.
  2042. * @returns {number} Returns the placeholder count.
  2043. */
  2044. function countHolders(array, placeholder) {
  2045. var length = array.length,
  2046. result = 0;
  2047. while (length--) {
  2048. if (array[length] === placeholder) {
  2049. ++result;
  2050. }
  2051. }
  2052. return result;
  2053. }
  2054. /**
  2055. * Used by `_.deburr` to convert Latin-1 Supplement and Latin Extended-A
  2056. * letters to basic Latin letters.
  2057. *
  2058. * @private
  2059. * @param {string} letter The matched letter to deburr.
  2060. * @returns {string} Returns the deburred letter.
  2061. */
  2062. var deburrLetter = basePropertyOf(deburredLetters);
  2063. /**
  2064. * Used by `_.escape` to convert characters to HTML entities.
  2065. *
  2066. * @private
  2067. * @param {string} chr The matched character to escape.
  2068. * @returns {string} Returns the escaped character.
  2069. */
  2070. var escapeHtmlChar = basePropertyOf(htmlEscapes);
  2071. /**
  2072. * Used by `_.template` to escape characters for inclusion in compiled string literals.
  2073. *
  2074. * @private
  2075. * @param {string} chr The matched character to escape.
  2076. * @returns {string} Returns the escaped character.
  2077. */
  2078. function escapeStringChar(chr) {
  2079. return '\\' + stringEscapes[chr];
  2080. }
  2081. /**
  2082. * Gets the value at `key` of `object`.
  2083. *
  2084. * @private
  2085. * @param {Object} [object] The object to query.
  2086. * @param {string} key The key of the property to get.
  2087. * @returns {*} Returns the property value.
  2088. */
  2089. function getValue(object, key) {
  2090. return object == null ? undefined : object[key];
  2091. }
  2092. /**
  2093. * Checks if `string` contains Unicode symbols.
  2094. *
  2095. * @private
  2096. * @param {string} string The string to inspect.
  2097. * @returns {boolean} Returns `true` if a symbol is found, else `false`.
  2098. */
  2099. function hasUnicode(string) {
  2100. return reHasUnicode.test(string);
  2101. }
  2102. /**
  2103. * Checks if `string` contains a word composed of Unicode symbols.
  2104. *
  2105. * @private
  2106. * @param {string} string The string to inspect.
  2107. * @returns {boolean} Returns `true` if a word is found, else `false`.
  2108. */
  2109. function hasUnicodeWord(string) {
  2110. return reHasUnicodeWord.test(string);
  2111. }
  2112. /**
  2113. * Converts `iterator` to an array.
  2114. *
  2115. * @private
  2116. * @param {Object} iterator The iterator to convert.
  2117. * @returns {Array} Returns the converted array.
  2118. */
  2119. function iteratorToArray(iterator) {
  2120. var data,
  2121. result = [];
  2122. while (!(data = iterator.next()).done) {
  2123. result.push(data.value);
  2124. }
  2125. return result;
  2126. }
  2127. /**
  2128. * Converts `map` to its key-value pairs.
  2129. *
  2130. * @private
  2131. * @param {Object} map The map to convert.
  2132. * @returns {Array} Returns the key-value pairs.
  2133. */
  2134. function mapToArray(map) {
  2135. var index = -1,
  2136. result = Array(map.size);
  2137. map.forEach(function(value, key) {
  2138. result[++index] = [key, value];
  2139. });
  2140. return result;
  2141. }
  2142. /**
  2143. * Creates a unary function that invokes `func` with its argument transformed.
  2144. *
  2145. * @private
  2146. * @param {Function} func The function to wrap.
  2147. * @param {Function} transform The argument transform.
  2148. * @returns {Function} Returns the new function.
  2149. */
  2150. function overArg(func, transform) {
  2151. return function(arg) {
  2152. return func(transform(arg));
  2153. };
  2154. }
  2155. /**
  2156. * Replaces all `placeholder` elements in `array` with an internal placeholder
  2157. * and returns an array of their indexes.
  2158. *
  2159. * @private
  2160. * @param {Array} array The array to modify.
  2161. * @param {*} placeholder The placeholder to replace.
  2162. * @returns {Array} Returns the new array of placeholder indexes.
  2163. */
  2164. function replaceHolders(array, placeholder) {
  2165. var index = -1,
  2166. length = array.length,
  2167. resIndex = 0,
  2168. result = [];
  2169. while (++index < length) {
  2170. var value = array[index];
  2171. if (value === placeholder || value === PLACEHOLDER) {
  2172. array[index] = PLACEHOLDER;
  2173. result[resIndex++] = index;
  2174. }
  2175. }
  2176. return result;
  2177. }
  2178. /**
  2179. * Converts `set` to an array of its values.
  2180. *
  2181. * @private
  2182. * @param {Object} set The set to convert.
  2183. * @returns {Array} Returns the values.
  2184. */
  2185. function setToArray(set) {
  2186. var index = -1,
  2187. result = Array(set.size);
  2188. set.forEach(function(value) {
  2189. result[++index] = value;
  2190. });
  2191. return result;
  2192. }
  2193. /**
  2194. * Converts `set` to its value-value pairs.
  2195. *
  2196. * @private
  2197. * @param {Object} set The set to convert.
  2198. * @returns {Array} Returns the value-value pairs.
  2199. */
  2200. function setToPairs(set) {
  2201. var index = -1,
  2202. result = Array(set.size);
  2203. set.forEach(function(value) {
  2204. result[++index] = [value, value];
  2205. });
  2206. return result;
  2207. }
  2208. /**
  2209. * A specialized version of `_.indexOf` which performs strict equality
  2210. * comparisons of values, i.e. `===`.
  2211. *
  2212. * @private
  2213. * @param {Array} array The array to inspect.
  2214. * @param {*} value The value to search for.
  2215. * @param {number} fromIndex The index to search from.
  2216. * @returns {number} Returns the index of the matched value, else `-1`.
  2217. */
  2218. function strictIndexOf(array, value, fromIndex) {
  2219. var index = fromIndex - 1,
  2220. length = array.length;
  2221. while (++index < length) {
  2222. if (array[index] === value) {
  2223. return index;
  2224. }
  2225. }
  2226. return -1;
  2227. }
  2228. /**
  2229. * A specialized version of `_.lastIndexOf` which performs strict equality
  2230. * comparisons of values, i.e. `===`.
  2231. *
  2232. * @private
  2233. * @param {Array} array The array to inspect.
  2234. * @param {*} value The value to search for.
  2235. * @param {number} fromIndex The index to search from.
  2236. * @returns {number} Returns the index of the matched value, else `-1`.
  2237. */
  2238. function strictLastIndexOf(array, value, fromIndex) {
  2239. var index = fromIndex + 1;
  2240. while (index--) {
  2241. if (array[index] === value) {
  2242. return index;
  2243. }
  2244. }
  2245. return index;
  2246. }
  2247. /**
  2248. * Gets the number of symbols in `string`.
  2249. *
  2250. * @private
  2251. * @param {string} string The string to inspect.
  2252. * @returns {number} Returns the string size.
  2253. */
  2254. function stringSize(string) {
  2255. return hasUnicode(string)
  2256. ? unicodeSize(string)
  2257. : asciiSize(string);
  2258. }
  2259. /**
  2260. * Converts `string` to an array.
  2261. *
  2262. * @private
  2263. * @param {string} string The string to convert.
  2264. * @returns {Array} Returns the converted array.
  2265. */
  2266. function stringToArray(string) {
  2267. return hasUnicode(string)
  2268. ? unicodeToArray(string)
  2269. : asciiToArray(string);
  2270. }
  2271. /**
  2272. * Used by `_.trim` and `_.trimEnd` to get the index of the last non-whitespace
  2273. * character of `string`.
  2274. *
  2275. * @private
  2276. * @param {string} string The string to inspect.
  2277. * @returns {number} Returns the index of the last non-whitespace character.
  2278. */
  2279. function trimmedEndIndex(string) {
  2280. var index = string.length;
  2281. while (index-- && reWhitespace.test(string.charAt(index))) {}
  2282. return index;
  2283. }
  2284. /**
  2285. * Used by `_.unescape` to convert HTML entities to characters.
  2286. *
  2287. * @private
  2288. * @param {string} chr The matched character to unescape.
  2289. * @returns {string} Returns the unescaped character.
  2290. */
  2291. var unescapeHtmlChar = basePropertyOf(htmlUnescapes);
  2292. /**
  2293. * Gets the size of a Unicode `string`.
  2294. *
  2295. * @private
  2296. * @param {string} string The string inspect.
  2297. * @returns {number} Returns the string size.
  2298. */
  2299. function unicodeSize(string) {
  2300. var result = reUnicode.lastIndex = 0;
  2301. while (reUnicode.test(string)) {
  2302. ++result;
  2303. }
  2304. return result;
  2305. }
  2306. /**
  2307. * Converts a Unicode `string` to an array.
  2308. *
  2309. * @private
  2310. * @param {string} string The string to convert.
  2311. * @returns {Array} Returns the converted array.
  2312. */
  2313. function unicodeToArray(string) {
  2314. return string.match(reUnicode) || [];
  2315. }
  2316. /**
  2317. * Splits a Unicode `string` into an array of its words.
  2318. *
  2319. * @private
  2320. * @param {string} The string to inspect.
  2321. * @returns {Array} Returns the words of `string`.
  2322. */
  2323. function unicodeWords(string) {
  2324. return string.match(reUnicodeWord) || [];
  2325. }
  2326. /*--------------------------------------------------------------------------*/
  2327. /**
  2328. * Create a new pristine `lodash` function using the `context` object.
  2329. *
  2330. * @static
  2331. * @memberOf _
  2332. * @since 1.1.0
  2333. * @category Util
  2334. * @param {Object} [context=root] The context object.
  2335. * @returns {Function} Returns a new `lodash` function.
  2336. * @example
  2337. *
  2338. * _.mixin({ 'foo': _.constant('foo') });
  2339. *
  2340. * var lodash = _.runInContext();
  2341. * lodash.mixin({ 'bar': lodash.constant('bar') });
  2342. *
  2343. * _.isFunction(_.foo);
  2344. * // => true
  2345. * _.isFunction(_.bar);
  2346. * // => false
  2347. *
  2348. * lodash.isFunction(lodash.foo);
  2349. * // => false
  2350. * lodash.isFunction(lodash.bar);
  2351. * // => true
  2352. *
  2353. * // Create a suped-up `defer` in Node.js.
  2354. * var defer = _.runInContext({ 'setTimeout': setImmediate }).defer;
  2355. */
  2356. var runInContext = (function runInContext(context) {
  2357. context = context == null ? root : _.defaults(root.Object(), context, _.pick(root, contextProps));
  2358. /** Built-in constructor references. */
  2359. var Array = context.Array,
  2360. Date = context.Date,
  2361. Error = context.Error,
  2362. Function = context.Function,
  2363. Math = context.Math,
  2364. Object = context.Object,
  2365. RegExp = context.RegExp,
  2366. String = context.String,
  2367. TypeError = context.TypeError;
  2368. /** Used for built-in method references. */
  2369. var arrayProto = Array.prototype,
  2370. funcProto = Function.prototype,
  2371. objectProto = Object.prototype;
  2372. /** Used to detect overreaching core-js shims. */
  2373. var coreJsData = context['__core-js_shared__'];
  2374. /** Used to resolve the decompiled source of functions. */
  2375. var funcToString = funcProto.toString;
  2376. /** Used to check objects for own properties. */
  2377. var hasOwnProperty = objectProto.hasOwnProperty;
  2378. /** Used to generate unique IDs. */
  2379. var idCounter = 0;
  2380. /** Used to detect methods masquerading as native. */
  2381. var maskSrcKey = (function() {
  2382. var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || '');
  2383. return uid ? ('Symbol(src)_1.' + uid) : '';
  2384. }());
  2385. /**
  2386. * Used to resolve the
  2387. * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
  2388. * of values.
  2389. */
  2390. var nativeObjectToString = objectProto.toString;
  2391. /** Used to infer the `Object` constructor. */
  2392. var objectCtorString = funcToString.call(Object);
  2393. /** Used to restore the original `_` reference in `_.noConflict`. */
  2394. var oldDash = root._;
  2395. /** Used to detect if a method is native. */
  2396. var reIsNative = RegExp('^' +
  2397. funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\$&')
  2398. .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$'
  2399. );
  2400. /** Built-in value references. */
  2401. var Buffer = moduleExports ? context.Buffer : undefined,
  2402. Symbol = context.Symbol,
  2403. Uint8Array = context.Uint8Array,
  2404. allocUnsafe = Buffer ? Buffer.allocUnsafe : undefined,
  2405. getPrototype = overArg(Object.getPrototypeOf, Object),
  2406. objectCreate = Object.create,
  2407. propertyIsEnumerable = objectProto.propertyIsEnumerable,
  2408. splice = arrayProto.splice,
  2409. spreadableSymbol = Symbol ? Symbol.isConcatSpreadable : undefined,
  2410. symIterator = Symbol ? Symbol.iterator : undefined,
  2411. symToStringTag = Symbol ? Symbol.toStringTag : undefined;
  2412. var defineProperty = (function() {
  2413. try {
  2414. var func = getNative(Object, 'defineProperty');
  2415. func({}, '', {});
  2416. return func;
  2417. } catch (e) {}
  2418. }());
  2419. /** Mocked built-ins. */
  2420. var ctxClearTimeout = context.clearTimeout !== root.clearTimeout && context.clearTimeout,
  2421. ctxNow = Date && Date.now !== root.Date.now && Date.now,
  2422. ctxSetTimeout = context.setTimeout !== root.setTimeout && context.setTimeout;
  2423. /* Built-in method references for those with the same name as other `lodash` methods. */
  2424. var nativeCeil = Math.ceil,
  2425. nativeFloor = Math.floor,
  2426. nativeGetSymbols = Object.getOwnPropertySymbols,
  2427. nativeIsBuffer = Buffer ? Buffer.isBuffer : undefined,
  2428. nativeIsFinite = context.isFinite,
  2429. nativeJoin = arrayProto.join,
  2430. nativeKeys = overArg(Object.keys, Object),
  2431. nativeMax = Math.max,
  2432. nativeMin = Math.min,
  2433. nativeNow = Date.now,
  2434. nativeParseInt = context.parseInt,
  2435. nativeRandom = Math.random,
  2436. nativeReverse = arrayProto.reverse;
  2437. /* Built-in method references that are verified to be native. */
  2438. var DataView = getNative(context, 'DataView'),
  2439. Map = getNative(context, 'Map'),
  2440. Promise = getNative(context, 'Promise'),
  2441. Set = getNative(context, 'Set'),
  2442. WeakMap = getNative(context, 'WeakMap'),
  2443. nativeCreate = getNative(Object, 'create');
  2444. /** Used to store function metadata. */
  2445. var metaMap = WeakMap && new WeakMap;
  2446. /** Used to lookup unminified function names. */
  2447. var realNames = {};
  2448. /** Used to detect maps, sets, and weakmaps. */
  2449. var dataViewCtorString = toSource(DataView),
  2450. mapCtorString = toSource(Map),
  2451. promiseCtorString = toSource(Promise),
  2452. setCtorString = toSource(Set),
  2453. weakMapCtorString = toSource(WeakMap);
  2454. /** Used to convert symbols to primitives and strings. */
  2455. var symbolProto = Symbol ? Symbol.prototype : undefined,
  2456. symbolValueOf = symbolProto ? symbolProto.valueOf : undefined,
  2457. symbolToString = symbolProto ? symbolProto.toString : undefined;
  2458. /*------------------------------------------------------------------------*/
  2459. /**
  2460. * Creates a `lodash` object which wraps `value` to enable implicit method
  2461. * chain sequences. Methods that operate on and return arrays, collections,
  2462. * and functions can be chained together. Methods that retrieve a single value
  2463. * or may return a primitive value will automatically end the chain sequence
  2464. * and return the unwrapped value. Otherwise, the value must be unwrapped
  2465. * with `_#value`.
  2466. *
  2467. * Explicit chain sequences, which must be unwrapped with `_#value`, may be
  2468. * enabled using `_.chain`.
  2469. *
  2470. * The execution of chained methods is lazy, that is, it's deferred until
  2471. * `_#value` is implicitly or explicitly called.
  2472. *
  2473. * Lazy evaluation allows several methods to support shortcut fusion.
  2474. * Shortcut fusion is an optimization to merge iteratee calls; this avoids
  2475. * the creation of intermediate arrays and can greatly reduce the number of
  2476. * iteratee executions. Sections of a chain sequence qualify for shortcut
  2477. * fusion if the section is applied to an array and iteratees accept only
  2478. * one argument. The heuristic for whether a section qualifies for shortcut
  2479. * fusion is subject to change.
  2480. *
  2481. * Chaining is supported in custom builds as long as the `_#value` method is
  2482. * directly or indirectly included in the build.
  2483. *
  2484. * In addition to lodash methods, wrappers have `Array` and `String` methods.
  2485. *
  2486. * The wrapper `Array` methods are:
  2487. * `concat`, `join`, `pop`, `push`, `shift`, `sort`, `splice`, and `unshift`
  2488. *
  2489. * The wrapper `String` methods are:
  2490. * `replace` and `split`
  2491. *
  2492. * The wrapper methods that support shortcut fusion are:
  2493. * `at`, `compact`, `drop`, `dropRight`, `dropWhile`, `filter`, `find`,
  2494. * `findLast`, `head`, `initial`, `last`, `map`, `reject`, `reverse`, `slice`,
  2495. * `tail`, `take`, `takeRight`, `takeRightWhile`, `takeWhile`, and `toArray`
  2496. *
  2497. * The chainable wrapper methods are:
  2498. * `after`, `ary`, `assign`, `assignIn`, `assignInWith`, `assignWith`, `at`,
  2499. * `before`, `bind`, `bindAll`, `bindKey`, `castArray`, `chain`, `chunk`,
  2500. * `commit`, `compact`, `concat`, `conforms`, `constant`, `countBy`, `create`,
  2501. * `curry`, `debounce`, `defaults`, `defaultsDeep`, `defer`, `delay`,
  2502. * `difference`, `differenceBy`, `differenceWith`, `drop`, `dropRight`,
  2503. * `dropRightWhile`, `dropWhile`, `extend`, `extendWith`, `fill`, `filter`,
  2504. * `flatMap`, `flatMapDeep`, `flatMapDepth`, `flatten`, `flattenDeep`,
  2505. * `flattenDepth`, `flip`, `flow`, `flowRight`, `fromPairs`, `functions`,
  2506. * `functionsIn`, `groupBy`, `initial`, `intersection`, `intersectionBy`,
  2507. * `intersectionWith`, `invert`, `invertBy`, `invokeMap`, `iteratee`, `keyBy`,
  2508. * `keys`, `keysIn`, `map`, `mapKeys`, `mapValues`, `matches`, `matchesProperty`,
  2509. * `memoize`, `merge`, `mergeWith`, `method`, `methodOf`, `mixin`, `negate`,
  2510. * `nthArg`, `omit`, `omitBy`, `once`, `orderBy`, `over`, `overArgs`,
  2511. * `overEvery`, `overSome`, `partial`, `partialRight`, `partition`, `pick`,
  2512. * `pickBy`, `plant`, `property`, `propertyOf`, `pull`, `pullAll`, `pullAllBy`,
  2513. * `pullAllWith`, `pullAt`, `push`, `range`, `rangeRight`, `rearg`, `reject`,
  2514. * `remove`, `rest`, `reverse`, `sampleSize`, `set`, `setWith`, `shuffle`,
  2515. * `slice`, `sort`, `sortBy`, `splice`, `spread`, `tail`, `take`, `takeRight`,
  2516. * `takeRightWhile`, `takeWhile`, `tap`, `throttle`, `thru`, `toArray`,
  2517. * `toPairs`, `toPairsIn`, `toPath`, `toPlainObject`, `transform`, `unary`,
  2518. * `union`, `unionBy`, `unionWith`, `uniq`, `uniqBy`, `uniqWith`, `unset`,
  2519. * `unshift`, `unzip`, `unzipWith`, `update`, `updateWith`, `values`,
  2520. * `valuesIn`, `without`, `wrap`, `xor`, `xorBy`, `xorWith`, `zip`,
  2521. * `zipObject`, `zipObjectDeep`, and `zipWith`
  2522. *
  2523. * The wrapper methods that are **not** chainable by default are:
  2524. * `add`, `attempt`, `camelCase`, `capitalize`, `ceil`, `clamp`, `clone`,
  2525. * `cloneDeep`, `cloneDeepWith`, `cloneWith`, `conformsTo`, `deburr`,
  2526. * `defaultTo`, `divide`, `each`, `eachRight`, `endsWith`, `eq`, `escape`,
  2527. * `escapeRegExp`, `every`, `find`, `findIndex`, `findKey`, `findLast`,
  2528. * `findLastIndex`, `findLastKey`, `first`, `floor`, `forEach`, `forEachRight`,
  2529. * `forIn`, `forInRight`, `forOwn`, `forOwnRight`, `get`, `gt`, `gte`, `has`,
  2530. * `hasIn`, `head`, `identity`, `includes`, `indexOf`, `inRange`, `invoke`,
  2531. * `isArguments`, `isArray`, `isArrayBuffer`, `isArrayLike`, `isArrayLikeObject`,
  2532. * `isBoolean`, `isBuffer`, `isDate`, `isElement`, `isEmpty`, `isEqual`,
  2533. * `isEqualWith`, `isError`, `isFinite`, `isFunction`, `isInteger`, `isLength`,
  2534. * `isMap`, `isMatch`, `isMatchWith`, `isNaN`, `isNative`, `isNil`, `isNull`,
  2535. * `isNumber`, `isObject`, `isObjectLike`, `isPlainObject`, `isRegExp`,
  2536. * `isSafeInteger`, `isSet`, `isString`, `isUndefined`, `isTypedArray`,
  2537. * `isWeakMap`, `isWeakSet`, `join`, `kebabCase`, `last`, `lastIndexOf`,
  2538. * `lowerCase`, `lowerFirst`, `lt`, `lte`, `max`, `maxBy`, `mean`, `meanBy`,
  2539. * `min`, `minBy`, `multiply`, `noConflict`, `noop`, `now`, `nth`, `pad`,
  2540. * `padEnd`, `padStart`, `parseInt`, `pop`, `random`, `reduce`, `reduceRight`,
  2541. * `repeat`, `result`, `round`, `runInContext`, `sample`, `shift`, `size`,
  2542. * `snakeCase`, `some`, `sortedIndex`, `sortedIndexBy`, `sortedLastIndex`,
  2543. * `sortedLastIndexBy`, `startCase`, `startsWith`, `stubArray`, `stubFalse`,
  2544. * `stubObject`, `stubString`, `stubTrue`, `subtract`, `sum`, `sumBy`,
  2545. * `template`, `times`, `toFinite`, `toInteger`, `toJSON`, `toLength`,
  2546. * `toLower`, `toNumber`, `toSafeInteger`, `toString`, `toUpper`, `trim`,
  2547. * `trimEnd`, `trimStart`, `truncate`, `unescape`, `uniqueId`, `upperCase`,
  2548. * `upperFirst`, `value`, and `words`
  2549. *
  2550. * @name _
  2551. * @constructor
  2552. * @category Seq
  2553. * @param {*} value The value to wrap in a `lodash` instance.
  2554. * @returns {Object} Returns the new `lodash` wrapper instance.
  2555. * @example
  2556. *
  2557. * function square(n) {
  2558. * return n * n;
  2559. * }
  2560. *
  2561. * var wrapped = _([1, 2, 3]);
  2562. *
  2563. * // Returns an unwrapped value.
  2564. * wrapped.reduce(_.add);
  2565. * // => 6
  2566. *
  2567. * // Returns a wrapped value.
  2568. * var squares = wrapped.map(square);
  2569. *
  2570. * _.isArray(squares);
  2571. * // => false
  2572. *
  2573. * _.isArray(squares.value());
  2574. * // => true
  2575. */
  2576. function lodash(value) {
  2577. if (isObjectLike(value) && !isArray(value) && !(value instanceof LazyWrapper)) {
  2578. if (value instanceof LodashWrapper) {
  2579. return value;
  2580. }
  2581. if (hasOwnProperty.call(value, '__wrapped__')) {
  2582. return wrapperClone(value);
  2583. }
  2584. }
  2585. return new LodashWrapper(value);
  2586. }
  2587. /**
  2588. * The base implementation of `_.create` without support for assigning
  2589. * properties to the created object.
  2590. *
  2591. * @private
  2592. * @param {Object} proto The object to inherit from.
  2593. * @returns {Object} Returns the new object.
  2594. */
  2595. var baseCreate = (function() {
  2596. function object() {}
  2597. return function(proto) {
  2598. if (!isObject(proto)) {
  2599. return {};
  2600. }
  2601. if (objectCreate) {
  2602. return objectCreate(proto);
  2603. }
  2604. object.prototype = proto;
  2605. var result = new object;
  2606. object.prototype = undefined;
  2607. return result;
  2608. };
  2609. }());
  2610. /**
  2611. * The function whose prototype chain sequence wrappers inherit from.
  2612. *
  2613. * @private
  2614. */
  2615. function baseLodash() {
  2616. // No operation performed.
  2617. }
  2618. /**
  2619. * The base constructor for creating `lodash` wrapper objects.
  2620. *
  2621. * @private
  2622. * @param {*} value The value to wrap.
  2623. * @param {boolean} [chainAll] Enable explicit method chain sequences.
  2624. */
  2625. function LodashWrapper(value, chainAll) {
  2626. this.__wrapped__ = value;
  2627. this.__actions__ = [];
  2628. this.__chain__ = !!chainAll;
  2629. this.__index__ = 0;
  2630. this.__values__ = undefined;
  2631. }
  2632. /**
  2633. * By default, the template delimiters used by lodash are like those in
  2634. * embedded Ruby (ERB) as well as ES2015 template strings. Change the
  2635. * following template settings to use alternative delimiters.
  2636. *
  2637. * @static
  2638. * @memberOf _
  2639. * @type {Object}
  2640. */
  2641. lodash.templateSettings = {
  2642. /**
  2643. * Used to detect `data` property values to be HTML-escaped.
  2644. *
  2645. * @memberOf _.templateSettings
  2646. * @type {RegExp}
  2647. */
  2648. 'escape': reEscape,
  2649. /**
  2650. * Used to detect code to be evaluated.
  2651. *
  2652. * @memberOf _.templateSettings
  2653. * @type {RegExp}
  2654. */
  2655. 'evaluate': reEvaluate,
  2656. /**
  2657. * Used to detect `data` property values to inject.
  2658. *
  2659. * @memberOf _.templateSettings
  2660. * @type {RegExp}
  2661. */
  2662. 'interpolate': reInterpolate,
  2663. /**
  2664. * Used to reference the data object in the template text.
  2665. *
  2666. * @memberOf _.templateSettings
  2667. * @type {string}
  2668. */
  2669. 'variable': '',
  2670. /**
  2671. * Used to import variables into the compiled template.
  2672. *
  2673. * @memberOf _.templateSettings
  2674. * @type {Object}
  2675. */
  2676. 'imports': {
  2677. /**
  2678. * A reference to the `lodash` function.
  2679. *
  2680. * @memberOf _.templateSettings.imports
  2681. * @type {Function}
  2682. */
  2683. '_': lodash
  2684. }
  2685. };
  2686. // Ensure wrappers are instances of `baseLodash`.
  2687. lodash.prototype = baseLodash.prototype;
  2688. lodash.prototype.constructor = lodash;
  2689. LodashWrapper.prototype = baseCreate(baseLodash.prototype);
  2690. LodashWrapper.prototype.constructor = LodashWrapper;
  2691. /*------------------------------------------------------------------------*/
  2692. /**
  2693. * Creates a lazy wrapper object which wraps `value` to enable lazy evaluation.
  2694. *
  2695. * @private
  2696. * @constructor
  2697. * @param {*} value The value to wrap.
  2698. */
  2699. function LazyWrapper(value) {
  2700. this.__wrapped__ = value;
  2701. this.__actions__ = [];
  2702. this.__dir__ = 1;
  2703. this.__filtered__ = false;
  2704. this.__iteratees__ = [];
  2705. this.__takeCount__ = MAX_ARRAY_LENGTH;
  2706. this.__views__ = [];
  2707. }
  2708. /**
  2709. * Creates a clone of the lazy wrapper object.
  2710. *
  2711. * @private
  2712. * @name clone
  2713. * @memberOf LazyWrapper
  2714. * @returns {Object} Returns the cloned `LazyWrapper` object.
  2715. */
  2716. function lazyClone() {
  2717. var result = new LazyWrapper(this.__wrapped__);
  2718. result.__actions__ = copyArray(this.__actions__);
  2719. result.__dir__ = this.__dir__;
  2720. result.__filtered__ = this.__filtered__;
  2721. result.__iteratees__ = copyArray(this.__iteratees__);
  2722. result.__takeCount__ = this.__takeCount__;
  2723. result.__views__ = copyArray(this.__views__);
  2724. return result;
  2725. }
  2726. /**
  2727. * Reverses the direction of lazy iteration.
  2728. *
  2729. * @private
  2730. * @name reverse
  2731. * @memberOf LazyWrapper
  2732. * @returns {Object} Returns the new reversed `LazyWrapper` object.
  2733. */
  2734. function lazyReverse() {
  2735. if (this.__filtered__) {
  2736. var result = new LazyWrapper(this);
  2737. result.__dir__ = -1;
  2738. result.__filtered__ = true;
  2739. } else {
  2740. result = this.clone();
  2741. result.__dir__ *= -1;
  2742. }
  2743. return result;
  2744. }
  2745. /**
  2746. * Extracts the unwrapped value from its lazy wrapper.
  2747. *
  2748. * @private
  2749. * @name value
  2750. * @memberOf LazyWrapper
  2751. * @returns {*} Returns the unwrapped value.
  2752. */
  2753. function lazyValue() {
  2754. var array = this.__wrapped__.value(),
  2755. dir = this.__dir__,
  2756. isArr = isArray(array),
  2757. isRight = dir < 0,
  2758. arrLength = isArr ? array.length : 0,
  2759. view = getView(0, arrLength, this.__views__),
  2760. start = view.start,
  2761. end = view.end,
  2762. length = end - start,
  2763. index = isRight ? end : (start - 1),
  2764. iteratees = this.__iteratees__,
  2765. iterLength = iteratees.length,
  2766. resIndex = 0,
  2767. takeCount = nativeMin(length, this.__takeCount__);
  2768. if (!isArr || (!isRight && arrLength == length && takeCount == length)) {
  2769. return baseWrapperValue(array, this.__actions__);
  2770. }
  2771. var result = [];
  2772. outer:
  2773. while (length-- && resIndex < takeCount) {
  2774. index += dir;
  2775. var iterIndex = -1,
  2776. value = array[index];
  2777. while (++iterIndex < iterLength) {
  2778. var data = iteratees[iterIndex],
  2779. iteratee = data.iteratee,
  2780. type = data.type,
  2781. computed = iteratee(value);
  2782. if (type == LAZY_MAP_FLAG) {
  2783. value = computed;
  2784. } else if (!computed) {
  2785. if (type == LAZY_FILTER_FLAG) {
  2786. continue outer;
  2787. } else {
  2788. break outer;
  2789. }
  2790. }
  2791. }
  2792. result[resIndex++] = value;
  2793. }
  2794. return result;
  2795. }
  2796. // Ensure `LazyWrapper` is an instance of `baseLodash`.
  2797. LazyWrapper.prototype = baseCreate(baseLodash.prototype);
  2798. LazyWrapper.prototype.constructor = LazyWrapper;
  2799. /*------------------------------------------------------------------------*/
  2800. /**
  2801. * Creates a hash object.
  2802. *
  2803. * @private
  2804. * @constructor
  2805. * @param {Array} [entries] The key-value pairs to cache.
  2806. */
  2807. function Hash(entries) {
  2808. var index = -1,
  2809. length = entries == null ? 0 : entries.length;
  2810. this.clear();
  2811. while (++index < length) {
  2812. var entry = entries[index];
  2813. this.set(entry[0], entry[1]);
  2814. }
  2815. }
  2816. /**
  2817. * Removes all key-value entries from the hash.
  2818. *
  2819. * @private
  2820. * @name clear
  2821. * @memberOf Hash
  2822. */
  2823. function hashClear() {
  2824. this.__data__ = nativeCreate ? nativeCreate(null) : {};
  2825. this.size = 0;
  2826. }
  2827. /**
  2828. * Removes `key` and its value from the hash.
  2829. *
  2830. * @private
  2831. * @name delete
  2832. * @memberOf Hash
  2833. * @param {Object} hash The hash to modify.
  2834. * @param {string} key The key of the value to remove.
  2835. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  2836. */
  2837. function hashDelete(key) {
  2838. var result = this.has(key) && delete this.__data__[key];
  2839. this.size -= result ? 1 : 0;
  2840. return result;
  2841. }
  2842. /**
  2843. * Gets the hash value for `key`.
  2844. *
  2845. * @private
  2846. * @name get
  2847. * @memberOf Hash
  2848. * @param {string} key The key of the value to get.
  2849. * @returns {*} Returns the entry value.
  2850. */
  2851. function hashGet(key) {
  2852. var data = this.__data__;
  2853. if (nativeCreate) {
  2854. var result = data[key];
  2855. return result === HASH_UNDEFINED ? undefined : result;
  2856. }
  2857. return hasOwnProperty.call(data, key) ? data[key] : undefined;
  2858. }
  2859. /**
  2860. * Checks if a hash value for `key` exists.
  2861. *
  2862. * @private
  2863. * @name has
  2864. * @memberOf Hash
  2865. * @param {string} key The key of the entry to check.
  2866. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  2867. */
  2868. function hashHas(key) {
  2869. var data = this.__data__;
  2870. return nativeCreate ? (data[key] !== undefined) : hasOwnProperty.call(data, key);
  2871. }
  2872. /**
  2873. * Sets the hash `key` to `value`.
  2874. *
  2875. * @private
  2876. * @name set
  2877. * @memberOf Hash
  2878. * @param {string} key The key of the value to set.
  2879. * @param {*} value The value to set.
  2880. * @returns {Object} Returns the hash instance.
  2881. */
  2882. function hashSet(key, value) {
  2883. var data = this.__data__;
  2884. this.size += this.has(key) ? 0 : 1;
  2885. data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value;
  2886. return this;
  2887. }
  2888. // Add methods to `Hash`.
  2889. Hash.prototype.clear = hashClear;
  2890. Hash.prototype['delete'] = hashDelete;
  2891. Hash.prototype.get = hashGet;
  2892. Hash.prototype.has = hashHas;
  2893. Hash.prototype.set = hashSet;
  2894. /*------------------------------------------------------------------------*/
  2895. /**
  2896. * Creates an list cache object.
  2897. *
  2898. * @private
  2899. * @constructor
  2900. * @param {Array} [entries] The key-value pairs to cache.
  2901. */
  2902. function ListCache(entries) {
  2903. var index = -1,
  2904. length = entries == null ? 0 : entries.length;
  2905. this.clear();
  2906. while (++index < length) {
  2907. var entry = entries[index];
  2908. this.set(entry[0], entry[1]);
  2909. }
  2910. }
  2911. /**
  2912. * Removes all key-value entries from the list cache.
  2913. *
  2914. * @private
  2915. * @name clear
  2916. * @memberOf ListCache
  2917. */
  2918. function listCacheClear() {
  2919. this.__data__ = [];
  2920. this.size = 0;
  2921. }
  2922. /**
  2923. * Removes `key` and its value from the list cache.
  2924. *
  2925. * @private
  2926. * @name delete
  2927. * @memberOf ListCache
  2928. * @param {string} key The key of the value to remove.
  2929. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  2930. */
  2931. function listCacheDelete(key) {
  2932. var data = this.__data__,
  2933. index = assocIndexOf(data, key);
  2934. if (index < 0) {
  2935. return false;
  2936. }
  2937. var lastIndex = data.length - 1;
  2938. if (index == lastIndex) {
  2939. data.pop();
  2940. } else {
  2941. splice.call(data, index, 1);
  2942. }
  2943. --this.size;
  2944. return true;
  2945. }
  2946. /**
  2947. * Gets the list cache value for `key`.
  2948. *
  2949. * @private
  2950. * @name get
  2951. * @memberOf ListCache
  2952. * @param {string} key The key of the value to get.
  2953. * @returns {*} Returns the entry value.
  2954. */
  2955. function listCacheGet(key) {
  2956. var data = this.__data__,
  2957. index = assocIndexOf(data, key);
  2958. return index < 0 ? undefined : data[index][1];
  2959. }
  2960. /**
  2961. * Checks if a list cache value for `key` exists.
  2962. *
  2963. * @private
  2964. * @name has
  2965. * @memberOf ListCache
  2966. * @param {string} key The key of the entry to check.
  2967. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  2968. */
  2969. function listCacheHas(key) {
  2970. return assocIndexOf(this.__data__, key) > -1;
  2971. }
  2972. /**
  2973. * Sets the list cache `key` to `value`.
  2974. *
  2975. * @private
  2976. * @name set
  2977. * @memberOf ListCache
  2978. * @param {string} key The key of the value to set.
  2979. * @param {*} value The value to set.
  2980. * @returns {Object} Returns the list cache instance.
  2981. */
  2982. function listCacheSet(key, value) {
  2983. var data = this.__data__,
  2984. index = assocIndexOf(data, key);
  2985. if (index < 0) {
  2986. ++this.size;
  2987. data.push([key, value]);
  2988. } else {
  2989. data[index][1] = value;
  2990. }
  2991. return this;
  2992. }
  2993. // Add methods to `ListCache`.
  2994. ListCache.prototype.clear = listCacheClear;
  2995. ListCache.prototype['delete'] = listCacheDelete;
  2996. ListCache.prototype.get = listCacheGet;
  2997. ListCache.prototype.has = listCacheHas;
  2998. ListCache.prototype.set = listCacheSet;
  2999. /*------------------------------------------------------------------------*/
  3000. /**
  3001. * Creates a map cache object to store key-value pairs.
  3002. *
  3003. * @private
  3004. * @constructor
  3005. * @param {Array} [entries] The key-value pairs to cache.
  3006. */
  3007. function MapCache(entries) {
  3008. var index = -1,
  3009. length = entries == null ? 0 : entries.length;
  3010. this.clear();
  3011. while (++index < length) {
  3012. var entry = entries[index];
  3013. this.set(entry[0], entry[1]);
  3014. }
  3015. }
  3016. /**
  3017. * Removes all key-value entries from the map.
  3018. *
  3019. * @private
  3020. * @name clear
  3021. * @memberOf MapCache
  3022. */
  3023. function mapCacheClear() {
  3024. this.size = 0;
  3025. this.__data__ = {
  3026. 'hash': new Hash,
  3027. 'map': new (Map || ListCache),
  3028. 'string': new Hash
  3029. };
  3030. }
  3031. /**
  3032. * Removes `key` and its value from the map.
  3033. *
  3034. * @private
  3035. * @name delete
  3036. * @memberOf MapCache
  3037. * @param {string} key The key of the value to remove.
  3038. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  3039. */
  3040. function mapCacheDelete(key) {
  3041. var result = getMapData(this, key)['delete'](key);
  3042. this.size -= result ? 1 : 0;
  3043. return result;
  3044. }
  3045. /**
  3046. * Gets the map value for `key`.
  3047. *
  3048. * @private
  3049. * @name get
  3050. * @memberOf MapCache
  3051. * @param {string} key The key of the value to get.
  3052. * @returns {*} Returns the entry value.
  3053. */
  3054. function mapCacheGet(key) {
  3055. return getMapData(this, key).get(key);
  3056. }
  3057. /**
  3058. * Checks if a map value for `key` exists.
  3059. *
  3060. * @private
  3061. * @name has
  3062. * @memberOf MapCache
  3063. * @param {string} key The key of the entry to check.
  3064. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  3065. */
  3066. function mapCacheHas(key) {
  3067. return getMapData(this, key).has(key);
  3068. }
  3069. /**
  3070. * Sets the map `key` to `value`.
  3071. *
  3072. * @private
  3073. * @name set
  3074. * @memberOf MapCache
  3075. * @param {string} key The key of the value to set.
  3076. * @param {*} value The value to set.
  3077. * @returns {Object} Returns the map cache instance.
  3078. */
  3079. function mapCacheSet(key, value) {
  3080. var data = getMapData(this, key),
  3081. size = data.size;
  3082. data.set(key, value);
  3083. this.size += data.size == size ? 0 : 1;
  3084. return this;
  3085. }
  3086. // Add methods to `MapCache`.
  3087. MapCache.prototype.clear = mapCacheClear;
  3088. MapCache.prototype['delete'] = mapCacheDelete;
  3089. MapCache.prototype.get = mapCacheGet;
  3090. MapCache.prototype.has = mapCacheHas;
  3091. MapCache.prototype.set = mapCacheSet;
  3092. /*------------------------------------------------------------------------*/
  3093. /**
  3094. *
  3095. * Creates an array cache object to store unique values.
  3096. *
  3097. * @private
  3098. * @constructor
  3099. * @param {Array} [values] The values to cache.
  3100. */
  3101. function SetCache(values) {
  3102. var index = -1,
  3103. length = values == null ? 0 : values.length;
  3104. this.__data__ = new MapCache;
  3105. while (++index < length) {
  3106. this.add(values[index]);
  3107. }
  3108. }
  3109. /**
  3110. * Adds `value` to the array cache.
  3111. *
  3112. * @private
  3113. * @name add
  3114. * @memberOf SetCache
  3115. * @alias push
  3116. * @param {*} value The value to cache.
  3117. * @returns {Object} Returns the cache instance.
  3118. */
  3119. function setCacheAdd(value) {
  3120. this.__data__.set(value, HASH_UNDEFINED);
  3121. return this;
  3122. }
  3123. /**
  3124. * Checks if `value` is in the array cache.
  3125. *
  3126. * @private
  3127. * @name has
  3128. * @memberOf SetCache
  3129. * @param {*} value The value to search for.
  3130. * @returns {number} Returns `true` if `value` is found, else `false`.
  3131. */
  3132. function setCacheHas(value) {
  3133. return this.__data__.has(value);
  3134. }
  3135. // Add methods to `SetCache`.
  3136. SetCache.prototype.add = SetCache.prototype.push = setCacheAdd;
  3137. SetCache.prototype.has = setCacheHas;
  3138. /*------------------------------------------------------------------------*/
  3139. /**
  3140. * Creates a stack cache object to store key-value pairs.
  3141. *
  3142. * @private
  3143. * @constructor
  3144. * @param {Array} [entries] The key-value pairs to cache.
  3145. */
  3146. function Stack(entries) {
  3147. var data = this.__data__ = new ListCache(entries);
  3148. this.size = data.size;
  3149. }
  3150. /**
  3151. * Removes all key-value entries from the stack.
  3152. *
  3153. * @private
  3154. * @name clear
  3155. * @memberOf Stack
  3156. */
  3157. function stackClear() {
  3158. this.__data__ = new ListCache;
  3159. this.size = 0;
  3160. }
  3161. /**
  3162. * Removes `key` and its value from the stack.
  3163. *
  3164. * @private
  3165. * @name delete
  3166. * @memberOf Stack
  3167. * @param {string} key The key of the value to remove.
  3168. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  3169. */
  3170. function stackDelete(key) {
  3171. var data = this.__data__,
  3172. result = data['delete'](key);
  3173. this.size = data.size;
  3174. return result;
  3175. }
  3176. /**
  3177. * Gets the stack value for `key`.
  3178. *
  3179. * @private
  3180. * @name get
  3181. * @memberOf Stack
  3182. * @param {string} key The key of the value to get.
  3183. * @returns {*} Returns the entry value.
  3184. */
  3185. function stackGet(key) {
  3186. return this.__data__.get(key);
  3187. }
  3188. /**
  3189. * Checks if a stack value for `key` exists.
  3190. *
  3191. * @private
  3192. * @name has
  3193. * @memberOf Stack
  3194. * @param {string} key The key of the entry to check.
  3195. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  3196. */
  3197. function stackHas(key) {
  3198. return this.__data__.has(key);
  3199. }
  3200. /**
  3201. * Sets the stack `key` to `value`.
  3202. *
  3203. * @private
  3204. * @name set
  3205. * @memberOf Stack
  3206. * @param {string} key The key of the value to set.
  3207. * @param {*} value The value to set.
  3208. * @returns {Object} Returns the stack cache instance.
  3209. */
  3210. function stackSet(key, value) {
  3211. var data = this.__data__;
  3212. if (data instanceof ListCache) {
  3213. var pairs = data.__data__;
  3214. if (!Map || (pairs.length < LARGE_ARRAY_SIZE - 1)) {
  3215. pairs.push([key, value]);
  3216. this.size = ++data.size;
  3217. return this;
  3218. }
  3219. data = this.__data__ = new MapCache(pairs);
  3220. }
  3221. data.set(key, value);
  3222. this.size = data.size;
  3223. return this;
  3224. }
  3225. // Add methods to `Stack`.
  3226. Stack.prototype.clear = stackClear;
  3227. Stack.prototype['delete'] = stackDelete;
  3228. Stack.prototype.get = stackGet;
  3229. Stack.prototype.has = stackHas;
  3230. Stack.prototype.set = stackSet;
  3231. /*------------------------------------------------------------------------*/
  3232. /**
  3233. * Creates an array of the enumerable property names of the array-like `value`.
  3234. *
  3235. * @private
  3236. * @param {*} value The value to query.
  3237. * @param {boolean} inherited Specify returning inherited property names.
  3238. * @returns {Array} Returns the array of property names.
  3239. */
  3240. function arrayLikeKeys(value, inherited) {
  3241. var isArr = isArray(value),
  3242. isArg = !isArr && isArguments(value),
  3243. isBuff = !isArr && !isArg && isBuffer(value),
  3244. isType = !isArr && !isArg && !isBuff && isTypedArray(value),
  3245. skipIndexes = isArr || isArg || isBuff || isType,
  3246. result = skipIndexes ? baseTimes(value.length, String) : [],
  3247. length = result.length;
  3248. for (var key in value) {
  3249. if ((inherited || hasOwnProperty.call(value, key)) &&
  3250. !(skipIndexes && (
  3251. // Safari 9 has enumerable `arguments.length` in strict mode.
  3252. key == 'length' ||
  3253. // Node.js 0.10 has enumerable non-index properties on buffers.
  3254. (isBuff && (key == 'offset' || key == 'parent')) ||
  3255. // PhantomJS 2 has enumerable non-index properties on typed arrays.
  3256. (isType && (key == 'buffer' || key == 'byteLength' || key == 'byteOffset')) ||
  3257. // Skip index properties.
  3258. isIndex(key, length)
  3259. ))) {
  3260. result.push(key);
  3261. }
  3262. }
  3263. return result;
  3264. }
  3265. /**
  3266. * A specialized version of `_.sample` for arrays.
  3267. *
  3268. * @private
  3269. * @param {Array} array The array to sample.
  3270. * @returns {*} Returns the random element.
  3271. */
  3272. function arraySample(array) {
  3273. var length = array.length;
  3274. return length ? array[baseRandom(0, length - 1)] : undefined;
  3275. }
  3276. /**
  3277. * A specialized version of `_.sampleSize` for arrays.
  3278. *
  3279. * @private
  3280. * @param {Array} array The array to sample.
  3281. * @param {number} n The number of elements to sample.
  3282. * @returns {Array} Returns the random elements.
  3283. */
  3284. function arraySampleSize(array, n) {
  3285. return shuffleSelf(copyArray(array), baseClamp(n, 0, array.length));
  3286. }
  3287. /**
  3288. * A specialized version of `_.shuffle` for arrays.
  3289. *
  3290. * @private
  3291. * @param {Array} array The array to shuffle.
  3292. * @returns {Array} Returns the new shuffled array.
  3293. */
  3294. function arrayShuffle(array) {
  3295. return shuffleSelf(copyArray(array));
  3296. }
  3297. /**
  3298. * This function is like `assignValue` except that it doesn't assign
  3299. * `undefined` values.
  3300. *
  3301. * @private
  3302. * @param {Object} object The object to modify.
  3303. * @param {string} key The key of the property to assign.
  3304. * @param {*} value The value to assign.
  3305. */
  3306. function assignMergeValue(object, key, value) {
  3307. if ((value !== undefined && !eq(object[key], value)) ||
  3308. (value === undefined && !(key in object))) {
  3309. baseAssignValue(object, key, value);
  3310. }
  3311. }
  3312. /**
  3313. * Assigns `value` to `key` of `object` if the existing value is not equivalent
  3314. * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  3315. * for equality comparisons.
  3316. *
  3317. * @private
  3318. * @param {Object} object The object to modify.
  3319. * @param {string} key The key of the property to assign.
  3320. * @param {*} value The value to assign.
  3321. */
  3322. function assignValue(object, key, value) {
  3323. var objValue = object[key];
  3324. if (!(hasOwnProperty.call(object, key) && eq(objValue, value)) ||
  3325. (value === undefined && !(key in object))) {
  3326. baseAssignValue(object, key, value);
  3327. }
  3328. }
  3329. /**
  3330. * Gets the index at which the `key` is found in `array` of key-value pairs.
  3331. *
  3332. * @private
  3333. * @param {Array} array The array to inspect.
  3334. * @param {*} key The key to search for.
  3335. * @returns {number} Returns the index of the matched value, else `-1`.
  3336. */
  3337. function assocIndexOf(array, key) {
  3338. var length = array.length;
  3339. while (length--) {
  3340. if (eq(array[length][0], key)) {
  3341. return length;
  3342. }
  3343. }
  3344. return -1;
  3345. }
  3346. /**
  3347. * Aggregates elements of `collection` on `accumulator` with keys transformed
  3348. * by `iteratee` and values set by `setter`.
  3349. *
  3350. * @private
  3351. * @param {Array|Object} collection The collection to iterate over.
  3352. * @param {Function} setter The function to set `accumulator` values.
  3353. * @param {Function} iteratee The iteratee to transform keys.
  3354. * @param {Object} accumulator The initial aggregated object.
  3355. * @returns {Function} Returns `accumulator`.
  3356. */
  3357. function baseAggregator(collection, setter, iteratee, accumulator) {
  3358. baseEach(collection, function(value, key, collection) {
  3359. setter(accumulator, value, iteratee(value), collection);
  3360. });
  3361. return accumulator;
  3362. }
  3363. /**
  3364. * The base implementation of `_.assign` without support for multiple sources
  3365. * or `customizer` functions.
  3366. *
  3367. * @private
  3368. * @param {Object} object The destination object.
  3369. * @param {Object} source The source object.
  3370. * @returns {Object} Returns `object`.
  3371. */
  3372. function baseAssign(object, source) {
  3373. return object && copyObject(source, keys(source), object);
  3374. }
  3375. /**
  3376. * The base implementation of `_.assignIn` without support for multiple sources
  3377. * or `customizer` functions.
  3378. *
  3379. * @private
  3380. * @param {Object} object The destination object.
  3381. * @param {Object} source The source object.
  3382. * @returns {Object} Returns `object`.
  3383. */
  3384. function baseAssignIn(object, source) {
  3385. return object && copyObject(source, keysIn(source), object);
  3386. }
  3387. /**
  3388. * The base implementation of `assignValue` and `assignMergeValue` without
  3389. * value checks.
  3390. *
  3391. * @private
  3392. * @param {Object} object The object to modify.
  3393. * @param {string} key The key of the property to assign.
  3394. * @param {*} value The value to assign.
  3395. */
  3396. function baseAssignValue(object, key, value) {
  3397. if (key == '__proto__' && defineProperty) {
  3398. defineProperty(object, key, {
  3399. 'configurable': true,
  3400. 'enumerable': true,
  3401. 'value': value,
  3402. 'writable': true
  3403. });
  3404. } else {
  3405. object[key] = value;
  3406. }
  3407. }
  3408. /**
  3409. * The base implementation of `_.at` without support for individual paths.
  3410. *
  3411. * @private
  3412. * @param {Object} object The object to iterate over.
  3413. * @param {string[]} paths The property paths to pick.
  3414. * @returns {Array} Returns the picked elements.
  3415. */
  3416. function baseAt(object, paths) {
  3417. var index = -1,
  3418. length = paths.length,
  3419. result = Array(length),
  3420. skip = object == null;
  3421. while (++index < length) {
  3422. result[index] = skip ? undefined : get(object, paths[index]);
  3423. }
  3424. return result;
  3425. }
  3426. /**
  3427. * The base implementation of `_.clamp` which doesn't coerce arguments.
  3428. *
  3429. * @private
  3430. * @param {number} number The number to clamp.
  3431. * @param {number} [lower] The lower bound.
  3432. * @param {number} upper The upper bound.
  3433. * @returns {number} Returns the clamped number.
  3434. */
  3435. function baseClamp(number, lower, upper) {
  3436. if (number === number) {
  3437. if (upper !== undefined) {
  3438. number = number <= upper ? number : upper;
  3439. }
  3440. if (lower !== undefined) {
  3441. number = number >= lower ? number : lower;
  3442. }
  3443. }
  3444. return number;
  3445. }
  3446. /**
  3447. * The base implementation of `_.clone` and `_.cloneDeep` which tracks
  3448. * traversed objects.
  3449. *
  3450. * @private
  3451. * @param {*} value The value to clone.
  3452. * @param {boolean} bitmask The bitmask flags.
  3453. * 1 - Deep clone
  3454. * 2 - Flatten inherited properties
  3455. * 4 - Clone symbols
  3456. * @param {Function} [customizer] The function to customize cloning.
  3457. * @param {string} [key] The key of `value`.
  3458. * @param {Object} [object] The parent object of `value`.
  3459. * @param {Object} [stack] Tracks traversed objects and their clone counterparts.
  3460. * @returns {*} Returns the cloned value.
  3461. */
  3462. function baseClone(value, bitmask, customizer, key, object, stack) {
  3463. var result,
  3464. isDeep = bitmask & CLONE_DEEP_FLAG,
  3465. isFlat = bitmask & CLONE_FLAT_FLAG,
  3466. isFull = bitmask & CLONE_SYMBOLS_FLAG;
  3467. if (customizer) {
  3468. result = object ? customizer(value, key, object, stack) : customizer(value);
  3469. }
  3470. if (result !== undefined) {
  3471. return result;
  3472. }
  3473. if (!isObject(value)) {
  3474. return value;
  3475. }
  3476. var isArr = isArray(value);
  3477. if (isArr) {
  3478. result = initCloneArray(value);
  3479. if (!isDeep) {
  3480. return copyArray(value, result);
  3481. }
  3482. } else {
  3483. var tag = getTag(value),
  3484. isFunc = tag == funcTag || tag == genTag;
  3485. if (isBuffer(value)) {
  3486. return cloneBuffer(value, isDeep);
  3487. }
  3488. if (tag == objectTag || tag == argsTag || (isFunc && !object)) {
  3489. result = (isFlat || isFunc) ? {} : initCloneObject(value);
  3490. if (!isDeep) {
  3491. return isFlat
  3492. ? copySymbolsIn(value, baseAssignIn(result, value))
  3493. : copySymbols(value, baseAssign(result, value));
  3494. }
  3495. } else {
  3496. if (!cloneableTags[tag]) {
  3497. return object ? value : {};
  3498. }
  3499. result = initCloneByTag(value, tag, isDeep);
  3500. }
  3501. }
  3502. // Check for circular references and return its corresponding clone.
  3503. stack || (stack = new Stack);
  3504. var stacked = stack.get(value);
  3505. if (stacked) {
  3506. return stacked;
  3507. }
  3508. stack.set(value, result);
  3509. if (isSet(value)) {
  3510. value.forEach(function(subValue) {
  3511. result.add(baseClone(subValue, bitmask, customizer, subValue, value, stack));
  3512. });
  3513. } else if (isMap(value)) {
  3514. value.forEach(function(subValue, key) {
  3515. result.set(key, baseClone(subValue, bitmask, customizer, key, value, stack));
  3516. });
  3517. }
  3518. var keysFunc = isFull
  3519. ? (isFlat ? getAllKeysIn : getAllKeys)
  3520. : (isFlat ? keysIn : keys);
  3521. var props = isArr ? undefined : keysFunc(value);
  3522. arrayEach(props || value, function(subValue, key) {
  3523. if (props) {
  3524. key = subValue;
  3525. subValue = value[key];
  3526. }
  3527. // Recursively populate clone (susceptible to call stack limits).
  3528. assignValue(result, key, baseClone(subValue, bitmask, customizer, key, value, stack));
  3529. });
  3530. return result;
  3531. }
  3532. /**
  3533. * The base implementation of `_.conforms` which doesn't clone `source`.
  3534. *
  3535. * @private
  3536. * @param {Object} source The object of property predicates to conform to.
  3537. * @returns {Function} Returns the new spec function.
  3538. */
  3539. function baseConforms(source) {
  3540. var props = keys(source);
  3541. return function(object) {
  3542. return baseConformsTo(object, source, props);
  3543. };
  3544. }
  3545. /**
  3546. * The base implementation of `_.conformsTo` which accepts `props` to check.
  3547. *
  3548. * @private
  3549. * @param {Object} object The object to inspect.
  3550. * @param {Object} source The object of property predicates to conform to.
  3551. * @returns {boolean} Returns `true` if `object` conforms, else `false`.
  3552. */
  3553. function baseConformsTo(object, source, props) {
  3554. var length = props.length;
  3555. if (object == null) {
  3556. return !length;
  3557. }
  3558. object = Object(object);
  3559. while (length--) {
  3560. var key = props[length],
  3561. predicate = source[key],
  3562. value = object[key];
  3563. if ((value === undefined && !(key in object)) || !predicate(value)) {
  3564. return false;
  3565. }
  3566. }
  3567. return true;
  3568. }
  3569. /**
  3570. * The base implementation of `_.delay` and `_.defer` which accepts `args`
  3571. * to provide to `func`.
  3572. *
  3573. * @private
  3574. * @param {Function} func The function to delay.
  3575. * @param {number} wait The number of milliseconds to delay invocation.
  3576. * @param {Array} args The arguments to provide to `func`.
  3577. * @returns {number|Object} Returns the timer id or timeout object.
  3578. */
  3579. function baseDelay(func, wait, args) {
  3580. if (typeof func != 'function') {
  3581. throw new TypeError(FUNC_ERROR_TEXT);
  3582. }
  3583. return setTimeout(function() { func.apply(undefined, args); }, wait);
  3584. }
  3585. /**
  3586. * The base implementation of methods like `_.difference` without support
  3587. * for excluding multiple arrays or iteratee shorthands.
  3588. *
  3589. * @private
  3590. * @param {Array} array The array to inspect.
  3591. * @param {Array} values The values to exclude.
  3592. * @param {Function} [iteratee] The iteratee invoked per element.
  3593. * @param {Function} [comparator] The comparator invoked per element.
  3594. * @returns {Array} Returns the new array of filtered values.
  3595. */
  3596. function baseDifference(array, values, iteratee, comparator) {
  3597. var index = -1,
  3598. includes = arrayIncludes,
  3599. isCommon = true,
  3600. length = array.length,
  3601. result = [],
  3602. valuesLength = values.length;
  3603. if (!length) {
  3604. return result;
  3605. }
  3606. if (iteratee) {
  3607. values = arrayMap(values, baseUnary(iteratee));
  3608. }
  3609. if (comparator) {
  3610. includes = arrayIncludesWith;
  3611. isCommon = false;
  3612. }
  3613. else if (values.length >= LARGE_ARRAY_SIZE) {
  3614. includes = cacheHas;
  3615. isCommon = false;
  3616. values = new SetCache(values);
  3617. }
  3618. outer:
  3619. while (++index < length) {
  3620. var value = array[index],
  3621. computed = iteratee == null ? value : iteratee(value);
  3622. value = (comparator || value !== 0) ? value : 0;
  3623. if (isCommon && computed === computed) {
  3624. var valuesIndex = valuesLength;
  3625. while (valuesIndex--) {
  3626. if (values[valuesIndex] === computed) {
  3627. continue outer;
  3628. }
  3629. }
  3630. result.push(value);
  3631. }
  3632. else if (!includes(values, computed, comparator)) {
  3633. result.push(value);
  3634. }
  3635. }
  3636. return result;
  3637. }
  3638. /**
  3639. * The base implementation of `_.forEach` without support for iteratee shorthands.
  3640. *
  3641. * @private
  3642. * @param {Array|Object} collection The collection to iterate over.
  3643. * @param {Function} iteratee The function invoked per iteration.
  3644. * @returns {Array|Object} Returns `collection`.
  3645. */
  3646. var baseEach = createBaseEach(baseForOwn);
  3647. /**
  3648. * The base implementation of `_.forEachRight` without support for iteratee shorthands.
  3649. *
  3650. * @private
  3651. * @param {Array|Object} collection The collection to iterate over.
  3652. * @param {Function} iteratee The function invoked per iteration.
  3653. * @returns {Array|Object} Returns `collection`.
  3654. */
  3655. var baseEachRight = createBaseEach(baseForOwnRight, true);
  3656. /**
  3657. * The base implementation of `_.every` without support for iteratee shorthands.
  3658. *
  3659. * @private
  3660. * @param {Array|Object} collection The collection to iterate over.
  3661. * @param {Function} predicate The function invoked per iteration.
  3662. * @returns {boolean} Returns `true` if all elements pass the predicate check,
  3663. * else `false`
  3664. */
  3665. function baseEvery(collection, predicate) {
  3666. var result = true;
  3667. baseEach(collection, function(value, index, collection) {
  3668. result = !!predicate(value, index, collection);
  3669. return result;
  3670. });
  3671. return result;
  3672. }
  3673. /**
  3674. * The base implementation of methods like `_.max` and `_.min` which accepts a
  3675. * `comparator` to determine the extremum value.
  3676. *
  3677. * @private
  3678. * @param {Array} array The array to iterate over.
  3679. * @param {Function} iteratee The iteratee invoked per iteration.
  3680. * @param {Function} comparator The comparator used to compare values.
  3681. * @returns {*} Returns the extremum value.
  3682. */
  3683. function baseExtremum(array, iteratee, comparator) {
  3684. var index = -1,
  3685. length = array.length;
  3686. while (++index < length) {
  3687. var value = array[index],
  3688. current = iteratee(value);
  3689. if (current != null && (computed === undefined
  3690. ? (current === current && !isSymbol(current))
  3691. : comparator(current, computed)
  3692. )) {
  3693. var computed = current,
  3694. result = value;
  3695. }
  3696. }
  3697. return result;
  3698. }
  3699. /**
  3700. * The base implementation of `_.fill` without an iteratee call guard.
  3701. *
  3702. * @private
  3703. * @param {Array} array The array to fill.
  3704. * @param {*} value The value to fill `array` with.
  3705. * @param {number} [start=0] The start position.
  3706. * @param {number} [end=array.length] The end position.
  3707. * @returns {Array} Returns `array`.
  3708. */
  3709. function baseFill(array, value, start, end) {
  3710. var length = array.length;
  3711. start = toInteger(start);
  3712. if (start < 0) {
  3713. start = -start > length ? 0 : (length + start);
  3714. }
  3715. end = (end === undefined || end > length) ? length : toInteger(end);
  3716. if (end < 0) {
  3717. end += length;
  3718. }
  3719. end = start > end ? 0 : toLength(end);
  3720. while (start < end) {
  3721. array[start++] = value;
  3722. }
  3723. return array;
  3724. }
  3725. /**
  3726. * The base implementation of `_.filter` without support for iteratee shorthands.
  3727. *
  3728. * @private
  3729. * @param {Array|Object} collection The collection to iterate over.
  3730. * @param {Function} predicate The function invoked per iteration.
  3731. * @returns {Array} Returns the new filtered array.
  3732. */
  3733. function baseFilter(collection, predicate) {
  3734. var result = [];
  3735. baseEach(collection, function(value, index, collection) {
  3736. if (predicate(value, index, collection)) {
  3737. result.push(value);
  3738. }
  3739. });
  3740. return result;
  3741. }
  3742. /**
  3743. * The base implementation of `_.flatten` with support for restricting flattening.
  3744. *
  3745. * @private
  3746. * @param {Array} array The array to flatten.
  3747. * @param {number} depth The maximum recursion depth.
  3748. * @param {boolean} [predicate=isFlattenable] The function invoked per iteration.
  3749. * @param {boolean} [isStrict] Restrict to values that pass `predicate` checks.
  3750. * @param {Array} [result=[]] The initial result value.
  3751. * @returns {Array} Returns the new flattened array.
  3752. */
  3753. function baseFlatten(array, depth, predicate, isStrict, result) {
  3754. var index = -1,
  3755. length = array.length;
  3756. predicate || (predicate = isFlattenable);
  3757. result || (result = []);
  3758. while (++index < length) {
  3759. var value = array[index];
  3760. if (depth > 0 && predicate(value)) {
  3761. if (depth > 1) {
  3762. // Recursively flatten arrays (susceptible to call stack limits).
  3763. baseFlatten(value, depth - 1, predicate, isStrict, result);
  3764. } else {
  3765. arrayPush(result, value);
  3766. }
  3767. } else if (!isStrict) {
  3768. result[result.length] = value;
  3769. }
  3770. }
  3771. return result;
  3772. }
  3773. /**
  3774. * The base implementation of `baseForOwn` which iterates over `object`
  3775. * properties returned by `keysFunc` and invokes `iteratee` for each property.
  3776. * Iteratee functions may exit iteration early by explicitly returning `false`.
  3777. *
  3778. * @private
  3779. * @param {Object} object The object to iterate over.
  3780. * @param {Function} iteratee The function invoked per iteration.
  3781. * @param {Function} keysFunc The function to get the keys of `object`.
  3782. * @returns {Object} Returns `object`.
  3783. */
  3784. var baseFor = createBaseFor();
  3785. /**
  3786. * This function is like `baseFor` except that it iterates over properties
  3787. * in the opposite order.
  3788. *
  3789. * @private
  3790. * @param {Object} object The object to iterate over.
  3791. * @param {Function} iteratee The function invoked per iteration.
  3792. * @param {Function} keysFunc The function to get the keys of `object`.
  3793. * @returns {Object} Returns `object`.
  3794. */
  3795. var baseForRight = createBaseFor(true);
  3796. /**
  3797. * The base implementation of `_.forOwn` without support for iteratee shorthands.
  3798. *
  3799. * @private
  3800. * @param {Object} object The object to iterate over.
  3801. * @param {Function} iteratee The function invoked per iteration.
  3802. * @returns {Object} Returns `object`.
  3803. */
  3804. function baseForOwn(object, iteratee) {
  3805. return object && baseFor(object, iteratee, keys);
  3806. }
  3807. /**
  3808. * The base implementation of `_.forOwnRight` without support for iteratee shorthands.
  3809. *
  3810. * @private
  3811. * @param {Object} object The object to iterate over.
  3812. * @param {Function} iteratee The function invoked per iteration.
  3813. * @returns {Object} Returns `object`.
  3814. */
  3815. function baseForOwnRight(object, iteratee) {
  3816. return object && baseForRight(object, iteratee, keys);
  3817. }
  3818. /**
  3819. * The base implementation of `_.functions` which creates an array of
  3820. * `object` function property names filtered from `props`.
  3821. *
  3822. * @private
  3823. * @param {Object} object The object to inspect.
  3824. * @param {Array} props The property names to filter.
  3825. * @returns {Array} Returns the function names.
  3826. */
  3827. function baseFunctions(object, props) {
  3828. return arrayFilter(props, function(key) {
  3829. return isFunction(object[key]);
  3830. });
  3831. }
  3832. /**
  3833. * The base implementation of `_.get` without support for default values.
  3834. *
  3835. * @private
  3836. * @param {Object} object The object to query.
  3837. * @param {Array|string} path The path of the property to get.
  3838. * @returns {*} Returns the resolved value.
  3839. */
  3840. function baseGet(object, path) {
  3841. path = castPath(path, object);
  3842. var index = 0,
  3843. length = path.length;
  3844. while (object != null && index < length) {
  3845. object = object[toKey(path[index++])];
  3846. }
  3847. return (index && index == length) ? object : undefined;
  3848. }
  3849. /**
  3850. * The base implementation of `getAllKeys` and `getAllKeysIn` which uses
  3851. * `keysFunc` and `symbolsFunc` to get the enumerable property names and
  3852. * symbols of `object`.
  3853. *
  3854. * @private
  3855. * @param {Object} object The object to query.
  3856. * @param {Function} keysFunc The function to get the keys of `object`.
  3857. * @param {Function} symbolsFunc The function to get the symbols of `object`.
  3858. * @returns {Array} Returns the array of property names and symbols.
  3859. */
  3860. function baseGetAllKeys(object, keysFunc, symbolsFunc) {
  3861. var result = keysFunc(object);
  3862. return isArray(object) ? result : arrayPush(result, symbolsFunc(object));
  3863. }
  3864. /**
  3865. * The base implementation of `getTag` without fallbacks for buggy environments.
  3866. *
  3867. * @private
  3868. * @param {*} value The value to query.
  3869. * @returns {string} Returns the `toStringTag`.
  3870. */
  3871. function baseGetTag(value) {
  3872. if (value == null) {
  3873. return value === undefined ? undefinedTag : nullTag;
  3874. }
  3875. return (symToStringTag && symToStringTag in Object(value))
  3876. ? getRawTag(value)
  3877. : objectToString(value);
  3878. }
  3879. /**
  3880. * The base implementation of `_.gt` which doesn't coerce arguments.
  3881. *
  3882. * @private
  3883. * @param {*} value The value to compare.
  3884. * @param {*} other The other value to compare.
  3885. * @returns {boolean} Returns `true` if `value` is greater than `other`,
  3886. * else `false`.
  3887. */
  3888. function baseGt(value, other) {
  3889. return value > other;
  3890. }
  3891. /**
  3892. * The base implementation of `_.has` without support for deep paths.
  3893. *
  3894. * @private
  3895. * @param {Object} [object] The object to query.
  3896. * @param {Array|string} key The key to check.
  3897. * @returns {boolean} Returns `true` if `key` exists, else `false`.
  3898. */
  3899. function baseHas(object, key) {
  3900. return object != null && hasOwnProperty.call(object, key);
  3901. }
  3902. /**
  3903. * The base implementation of `_.hasIn` without support for deep paths.
  3904. *
  3905. * @private
  3906. * @param {Object} [object] The object to query.
  3907. * @param {Array|string} key The key to check.
  3908. * @returns {boolean} Returns `true` if `key` exists, else `false`.
  3909. */
  3910. function baseHasIn(object, key) {
  3911. return object != null && key in Object(object);
  3912. }
  3913. /**
  3914. * The base implementation of `_.inRange` which doesn't coerce arguments.
  3915. *
  3916. * @private
  3917. * @param {number} number The number to check.
  3918. * @param {number} start The start of the range.
  3919. * @param {number} end The end of the range.
  3920. * @returns {boolean} Returns `true` if `number` is in the range, else `false`.
  3921. */
  3922. function baseInRange(number, start, end) {
  3923. return number >= nativeMin(start, end) && number < nativeMax(start, end);
  3924. }
  3925. /**
  3926. * The base implementation of methods like `_.intersection`, without support
  3927. * for iteratee shorthands, that accepts an array of arrays to inspect.
  3928. *
  3929. * @private
  3930. * @param {Array} arrays The arrays to inspect.
  3931. * @param {Function} [iteratee] The iteratee invoked per element.
  3932. * @param {Function} [comparator] The comparator invoked per element.
  3933. * @returns {Array} Returns the new array of shared values.
  3934. */
  3935. function baseIntersection(arrays, iteratee, comparator) {
  3936. var includes = comparator ? arrayIncludesWith : arrayIncludes,
  3937. length = arrays[0].length,
  3938. othLength = arrays.length,
  3939. othIndex = othLength,
  3940. caches = Array(othLength),
  3941. maxLength = Infinity,
  3942. result = [];
  3943. while (othIndex--) {
  3944. var array = arrays[othIndex];
  3945. if (othIndex && iteratee) {
  3946. array = arrayMap(array, baseUnary(iteratee));
  3947. }
  3948. maxLength = nativeMin(array.length, maxLength);
  3949. caches[othIndex] = !comparator && (iteratee || (length >= 120 && array.length >= 120))
  3950. ? new SetCache(othIndex && array)
  3951. : undefined;
  3952. }
  3953. array = arrays[0];
  3954. var index = -1,
  3955. seen = caches[0];
  3956. outer:
  3957. while (++index < length && result.length < maxLength) {
  3958. var value = array[index],
  3959. computed = iteratee ? iteratee(value) : value;
  3960. value = (comparator || value !== 0) ? value : 0;
  3961. if (!(seen
  3962. ? cacheHas(seen, computed)
  3963. : includes(result, computed, comparator)
  3964. )) {
  3965. othIndex = othLength;
  3966. while (--othIndex) {
  3967. var cache = caches[othIndex];
  3968. if (!(cache
  3969. ? cacheHas(cache, computed)
  3970. : includes(arrays[othIndex], computed, comparator))
  3971. ) {
  3972. continue outer;
  3973. }
  3974. }
  3975. if (seen) {
  3976. seen.push(computed);
  3977. }
  3978. result.push(value);
  3979. }
  3980. }
  3981. return result;
  3982. }
  3983. /**
  3984. * The base implementation of `_.invert` and `_.invertBy` which inverts
  3985. * `object` with values transformed by `iteratee` and set by `setter`.
  3986. *
  3987. * @private
  3988. * @param {Object} object The object to iterate over.
  3989. * @param {Function} setter The function to set `accumulator` values.
  3990. * @param {Function} iteratee The iteratee to transform values.
  3991. * @param {Object} accumulator The initial inverted object.
  3992. * @returns {Function} Returns `accumulator`.
  3993. */
  3994. function baseInverter(object, setter, iteratee, accumulator) {
  3995. baseForOwn(object, function(value, key, object) {
  3996. setter(accumulator, iteratee(value), key, object);
  3997. });
  3998. return accumulator;
  3999. }
  4000. /**
  4001. * The base implementation of `_.invoke` without support for individual
  4002. * method arguments.
  4003. *
  4004. * @private
  4005. * @param {Object} object The object to query.
  4006. * @param {Array|string} path The path of the method to invoke.
  4007. * @param {Array} args The arguments to invoke the method with.
  4008. * @returns {*} Returns the result of the invoked method.
  4009. */
  4010. function baseInvoke(object, path, args) {
  4011. path = castPath(path, object);
  4012. object = parent(object, path);
  4013. var func = object == null ? object : object[toKey(last(path))];
  4014. return func == null ? undefined : apply(func, object, args);
  4015. }
  4016. /**
  4017. * The base implementation of `_.isArguments`.
  4018. *
  4019. * @private
  4020. * @param {*} value The value to check.
  4021. * @returns {boolean} Returns `true` if `value` is an `arguments` object,
  4022. */
  4023. function baseIsArguments(value) {
  4024. return isObjectLike(value) && baseGetTag(value) == argsTag;
  4025. }
  4026. /**
  4027. * The base implementation of `_.isArrayBuffer` without Node.js optimizations.
  4028. *
  4029. * @private
  4030. * @param {*} value The value to check.
  4031. * @returns {boolean} Returns `true` if `value` is an array buffer, else `false`.
  4032. */
  4033. function baseIsArrayBuffer(value) {
  4034. return isObjectLike(value) && baseGetTag(value) == arrayBufferTag;
  4035. }
  4036. /**
  4037. * The base implementation of `_.isDate` without Node.js optimizations.
  4038. *
  4039. * @private
  4040. * @param {*} value The value to check.
  4041. * @returns {boolean} Returns `true` if `value` is a date object, else `false`.
  4042. */
  4043. function baseIsDate(value) {
  4044. return isObjectLike(value) && baseGetTag(value) == dateTag;
  4045. }
  4046. /**
  4047. * The base implementation of `_.isEqual` which supports partial comparisons
  4048. * and tracks traversed objects.
  4049. *
  4050. * @private
  4051. * @param {*} value The value to compare.
  4052. * @param {*} other The other value to compare.
  4053. * @param {boolean} bitmask The bitmask flags.
  4054. * 1 - Unordered comparison
  4055. * 2 - Partial comparison
  4056. * @param {Function} [customizer] The function to customize comparisons.
  4057. * @param {Object} [stack] Tracks traversed `value` and `other` objects.
  4058. * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
  4059. */
  4060. function baseIsEqual(value, other, bitmask, customizer, stack) {
  4061. if (value === other) {
  4062. return true;
  4063. }
  4064. if (value == null || other == null || (!isObjectLike(value) && !isObjectLike(other))) {
  4065. return value !== value && other !== other;
  4066. }
  4067. return baseIsEqualDeep(value, other, bitmask, customizer, baseIsEqual, stack);
  4068. }
  4069. /**
  4070. * A specialized version of `baseIsEqual` for arrays and objects which performs
  4071. * deep comparisons and tracks traversed objects enabling objects with circular
  4072. * references to be compared.
  4073. *
  4074. * @private
  4075. * @param {Object} object The object to compare.
  4076. * @param {Object} other The other object to compare.
  4077. * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
  4078. * @param {Function} customizer The function to customize comparisons.
  4079. * @param {Function} equalFunc The function to determine equivalents of values.
  4080. * @param {Object} [stack] Tracks traversed `object` and `other` objects.
  4081. * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
  4082. */
  4083. function baseIsEqualDeep(object, other, bitmask, customizer, equalFunc, stack) {
  4084. var objIsArr = isArray(object),
  4085. othIsArr = isArray(other),
  4086. objTag = objIsArr ? arrayTag : getTag(object),
  4087. othTag = othIsArr ? arrayTag : getTag(other);
  4088. objTag = objTag == argsTag ? objectTag : objTag;
  4089. othTag = othTag == argsTag ? objectTag : othTag;
  4090. var objIsObj = objTag == objectTag,
  4091. othIsObj = othTag == objectTag,
  4092. isSameTag = objTag == othTag;
  4093. if (isSameTag && isBuffer(object)) {
  4094. if (!isBuffer(other)) {
  4095. return false;
  4096. }
  4097. objIsArr = true;
  4098. objIsObj = false;
  4099. }
  4100. if (isSameTag && !objIsObj) {
  4101. stack || (stack = new Stack);
  4102. return (objIsArr || isTypedArray(object))
  4103. ? equalArrays(object, other, bitmask, customizer, equalFunc, stack)
  4104. : equalByTag(object, other, objTag, bitmask, customizer, equalFunc, stack);
  4105. }
  4106. if (!(bitmask & COMPARE_PARTIAL_FLAG)) {
  4107. var objIsWrapped = objIsObj && hasOwnProperty.call(object, '__wrapped__'),
  4108. othIsWrapped = othIsObj && hasOwnProperty.call(other, '__wrapped__');
  4109. if (objIsWrapped || othIsWrapped) {
  4110. var objUnwrapped = objIsWrapped ? object.value() : object,
  4111. othUnwrapped = othIsWrapped ? other.value() : other;
  4112. stack || (stack = new Stack);
  4113. return equalFunc(objUnwrapped, othUnwrapped, bitmask, customizer, stack);
  4114. }
  4115. }
  4116. if (!isSameTag) {
  4117. return false;
  4118. }
  4119. stack || (stack = new Stack);
  4120. return equalObjects(object, other, bitmask, customizer, equalFunc, stack);
  4121. }
  4122. /**
  4123. * The base implementation of `_.isMap` without Node.js optimizations.
  4124. *
  4125. * @private
  4126. * @param {*} value The value to check.
  4127. * @returns {boolean} Returns `true` if `value` is a map, else `false`.
  4128. */
  4129. function baseIsMap(value) {
  4130. return isObjectLike(value) && getTag(value) == mapTag;
  4131. }
  4132. /**
  4133. * The base implementation of `_.isMatch` without support for iteratee shorthands.
  4134. *
  4135. * @private
  4136. * @param {Object} object The object to inspect.
  4137. * @param {Object} source The object of property values to match.
  4138. * @param {Array} matchData The property names, values, and compare flags to match.
  4139. * @param {Function} [customizer] The function to customize comparisons.
  4140. * @returns {boolean} Returns `true` if `object` is a match, else `false`.
  4141. */
  4142. function baseIsMatch(object, source, matchData, customizer) {
  4143. var index = matchData.length,
  4144. length = index,
  4145. noCustomizer = !customizer;
  4146. if (object == null) {
  4147. return !length;
  4148. }
  4149. object = Object(object);
  4150. while (index--) {
  4151. var data = matchData[index];
  4152. if ((noCustomizer && data[2])
  4153. ? data[1] !== object[data[0]]
  4154. : !(data[0] in object)
  4155. ) {
  4156. return false;
  4157. }
  4158. }
  4159. while (++index < length) {
  4160. data = matchData[index];
  4161. var key = data[0],
  4162. objValue = object[key],
  4163. srcValue = data[1];
  4164. if (noCustomizer && data[2]) {
  4165. if (objValue === undefined && !(key in object)) {
  4166. return false;
  4167. }
  4168. } else {
  4169. var stack = new Stack;
  4170. if (customizer) {
  4171. var result = customizer(objValue, srcValue, key, object, source, stack);
  4172. }
  4173. if (!(result === undefined
  4174. ? baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG, customizer, stack)
  4175. : result
  4176. )) {
  4177. return false;
  4178. }
  4179. }
  4180. }
  4181. return true;
  4182. }
  4183. /**
  4184. * The base implementation of `_.isNative` without bad shim checks.
  4185. *
  4186. * @private
  4187. * @param {*} value The value to check.
  4188. * @returns {boolean} Returns `true` if `value` is a native function,
  4189. * else `false`.
  4190. */
  4191. function baseIsNative(value) {
  4192. if (!isObject(value) || isMasked(value)) {
  4193. return false;
  4194. }
  4195. var pattern = isFunction(value) ? reIsNative : reIsHostCtor;
  4196. return pattern.test(toSource(value));
  4197. }
  4198. /**
  4199. * The base implementation of `_.isRegExp` without Node.js optimizations.
  4200. *
  4201. * @private
  4202. * @param {*} value The value to check.
  4203. * @returns {boolean} Returns `true` if `value` is a regexp, else `false`.
  4204. */
  4205. function baseIsRegExp(value) {
  4206. return isObjectLike(value) && baseGetTag(value) == regexpTag;
  4207. }
  4208. /**
  4209. * The base implementation of `_.isSet` without Node.js optimizations.
  4210. *
  4211. * @private
  4212. * @param {*} value The value to check.
  4213. * @returns {boolean} Returns `true` if `value` is a set, else `false`.
  4214. */
  4215. function baseIsSet(value) {
  4216. return isObjectLike(value) && getTag(value) == setTag;
  4217. }
  4218. /**
  4219. * The base implementation of `_.isTypedArray` without Node.js optimizations.
  4220. *
  4221. * @private
  4222. * @param {*} value The value to check.
  4223. * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.
  4224. */
  4225. function baseIsTypedArray(value) {
  4226. return isObjectLike(value) &&
  4227. isLength(value.length) && !!typedArrayTags[baseGetTag(value)];
  4228. }
  4229. /**
  4230. * The base implementation of `_.iteratee`.
  4231. *
  4232. * @private
  4233. * @param {*} [value=_.identity] The value to convert to an iteratee.
  4234. * @returns {Function} Returns the iteratee.
  4235. */
  4236. function baseIteratee(value) {
  4237. // Don't store the `typeof` result in a variable to avoid a JIT bug in Safari 9.
  4238. // See https://bugs.webkit.org/show_bug.cgi?id=156034 for more details.
  4239. if (typeof value == 'function') {
  4240. return value;
  4241. }
  4242. if (value == null) {
  4243. return identity;
  4244. }
  4245. if (typeof value == 'object') {
  4246. return isArray(value)
  4247. ? baseMatchesProperty(value[0], value[1])
  4248. : baseMatches(value);
  4249. }
  4250. return property(value);
  4251. }
  4252. /**
  4253. * The base implementation of `_.keys` which doesn't treat sparse arrays as dense.
  4254. *
  4255. * @private
  4256. * @param {Object} object The object to query.
  4257. * @returns {Array} Returns the array of property names.
  4258. */
  4259. function baseKeys(object) {
  4260. if (!isPrototype(object)) {
  4261. return nativeKeys(object);
  4262. }
  4263. var result = [];
  4264. for (var key in Object(object)) {
  4265. if (hasOwnProperty.call(object, key) && key != 'constructor') {
  4266. result.push(key);
  4267. }
  4268. }
  4269. return result;
  4270. }
  4271. /**
  4272. * The base implementation of `_.keysIn` which doesn't treat sparse arrays as dense.
  4273. *
  4274. * @private
  4275. * @param {Object} object The object to query.
  4276. * @returns {Array} Returns the array of property names.
  4277. */
  4278. function baseKeysIn(object) {
  4279. if (!isObject(object)) {
  4280. return nativeKeysIn(object);
  4281. }
  4282. var isProto = isPrototype(object),
  4283. result = [];
  4284. for (var key in object) {
  4285. if (!(key == 'constructor' && (isProto || !hasOwnProperty.call(object, key)))) {
  4286. result.push(key);
  4287. }
  4288. }
  4289. return result;
  4290. }
  4291. /**
  4292. * The base implementation of `_.lt` which doesn't coerce arguments.
  4293. *
  4294. * @private
  4295. * @param {*} value The value to compare.
  4296. * @param {*} other The other value to compare.
  4297. * @returns {boolean} Returns `true` if `value` is less than `other`,
  4298. * else `false`.
  4299. */
  4300. function baseLt(value, other) {
  4301. return value < other;
  4302. }
  4303. /**
  4304. * The base implementation of `_.map` without support for iteratee shorthands.
  4305. *
  4306. * @private
  4307. * @param {Array|Object} collection The collection to iterate over.
  4308. * @param {Function} iteratee The function invoked per iteration.
  4309. * @returns {Array} Returns the new mapped array.
  4310. */
  4311. function baseMap(collection, iteratee) {
  4312. var index = -1,
  4313. result = isArrayLike(collection) ? Array(collection.length) : [];
  4314. baseEach(collection, function(value, key, collection) {
  4315. result[++index] = iteratee(value, key, collection);
  4316. });
  4317. return result;
  4318. }
  4319. /**
  4320. * The base implementation of `_.matches` which doesn't clone `source`.
  4321. *
  4322. * @private
  4323. * @param {Object} source The object of property values to match.
  4324. * @returns {Function} Returns the new spec function.
  4325. */
  4326. function baseMatches(source) {
  4327. var matchData = getMatchData(source);
  4328. if (matchData.length == 1 && matchData[0][2]) {
  4329. return matchesStrictComparable(matchData[0][0], matchData[0][1]);
  4330. }
  4331. return function(object) {
  4332. return object === source || baseIsMatch(object, source, matchData);
  4333. };
  4334. }
  4335. /**
  4336. * The base implementation of `_.matchesProperty` which doesn't clone `srcValue`.
  4337. *
  4338. * @private
  4339. * @param {string} path The path of the property to get.
  4340. * @param {*} srcValue The value to match.
  4341. * @returns {Function} Returns the new spec function.
  4342. */
  4343. function baseMatchesProperty(path, srcValue) {
  4344. if (isKey(path) && isStrictComparable(srcValue)) {
  4345. return matchesStrictComparable(toKey(path), srcValue);
  4346. }
  4347. return function(object) {
  4348. var objValue = get(object, path);
  4349. return (objValue === undefined && objValue === srcValue)
  4350. ? hasIn(object, path)
  4351. : baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG);
  4352. };
  4353. }
  4354. /**
  4355. * The base implementation of `_.merge` without support for multiple sources.
  4356. *
  4357. * @private
  4358. * @param {Object} object The destination object.
  4359. * @param {Object} source The source object.
  4360. * @param {number} srcIndex The index of `source`.
  4361. * @param {Function} [customizer] The function to customize merged values.
  4362. * @param {Object} [stack] Tracks traversed source values and their merged
  4363. * counterparts.
  4364. */
  4365. function baseMerge(object, source, srcIndex, customizer, stack) {
  4366. if (object === source) {
  4367. return;
  4368. }
  4369. baseFor(source, function(srcValue, key) {
  4370. stack || (stack = new Stack);
  4371. if (isObject(srcValue)) {
  4372. baseMergeDeep(object, source, key, srcIndex, baseMerge, customizer, stack);
  4373. }
  4374. else {
  4375. var newValue = customizer
  4376. ? customizer(safeGet(object, key), srcValue, (key + ''), object, source, stack)
  4377. : undefined;
  4378. if (newValue === undefined) {
  4379. newValue = srcValue;
  4380. }
  4381. assignMergeValue(object, key, newValue);
  4382. }
  4383. }, keysIn);
  4384. }
  4385. /**
  4386. * A specialized version of `baseMerge` for arrays and objects which performs
  4387. * deep merges and tracks traversed objects enabling objects with circular
  4388. * references to be merged.
  4389. *
  4390. * @private
  4391. * @param {Object} object The destination object.
  4392. * @param {Object} source The source object.
  4393. * @param {string} key The key of the value to merge.
  4394. * @param {number} srcIndex The index of `source`.
  4395. * @param {Function} mergeFunc The function to merge values.
  4396. * @param {Function} [customizer] The function to customize assigned values.
  4397. * @param {Object} [stack] Tracks traversed source values and their merged
  4398. * counterparts.
  4399. */
  4400. function baseMergeDeep(object, source, key, srcIndex, mergeFunc, customizer, stack) {
  4401. var objValue = safeGet(object, key),
  4402. srcValue = safeGet(source, key),
  4403. stacked = stack.get(srcValue);
  4404. if (stacked) {
  4405. assignMergeValue(object, key, stacked);
  4406. return;
  4407. }
  4408. var newValue = customizer
  4409. ? customizer(objValue, srcValue, (key + ''), object, source, stack)
  4410. : undefined;
  4411. var isCommon = newValue === undefined;
  4412. if (isCommon) {
  4413. var isArr = isArray(srcValue),
  4414. isBuff = !isArr && isBuffer(srcValue),
  4415. isTyped = !isArr && !isBuff && isTypedArray(srcValue);
  4416. newValue = srcValue;
  4417. if (isArr || isBuff || isTyped) {
  4418. if (isArray(objValue)) {
  4419. newValue = objValue;
  4420. }
  4421. else if (isArrayLikeObject(objValue)) {
  4422. newValue = copyArray(objValue);
  4423. }
  4424. else if (isBuff) {
  4425. isCommon = false;
  4426. newValue = cloneBuffer(srcValue, true);
  4427. }
  4428. else if (isTyped) {
  4429. isCommon = false;
  4430. newValue = cloneTypedArray(srcValue, true);
  4431. }
  4432. else {
  4433. newValue = [];
  4434. }
  4435. }
  4436. else if (isPlainObject(srcValue) || isArguments(srcValue)) {
  4437. newValue = objValue;
  4438. if (isArguments(objValue)) {
  4439. newValue = toPlainObject(objValue);
  4440. }
  4441. else if (!isObject(objValue) || isFunction(objValue)) {
  4442. newValue = initCloneObject(srcValue);
  4443. }
  4444. }
  4445. else {
  4446. isCommon = false;
  4447. }
  4448. }
  4449. if (isCommon) {
  4450. // Recursively merge objects and arrays (susceptible to call stack limits).
  4451. stack.set(srcValue, newValue);
  4452. mergeFunc(newValue, srcValue, srcIndex, customizer, stack);
  4453. stack['delete'](srcValue);
  4454. }
  4455. assignMergeValue(object, key, newValue);
  4456. }
  4457. /**
  4458. * The base implementation of `_.nth` which doesn't coerce arguments.
  4459. *
  4460. * @private
  4461. * @param {Array} array The array to query.
  4462. * @param {number} n The index of the element to return.
  4463. * @returns {*} Returns the nth element of `array`.
  4464. */
  4465. function baseNth(array, n) {
  4466. var length = array.length;
  4467. if (!length) {
  4468. return;
  4469. }
  4470. n += n < 0 ? length : 0;
  4471. return isIndex(n, length) ? array[n] : undefined;
  4472. }
  4473. /**
  4474. * The base implementation of `_.orderBy` without param guards.
  4475. *
  4476. * @private
  4477. * @param {Array|Object} collection The collection to iterate over.
  4478. * @param {Function[]|Object[]|string[]} iteratees The iteratees to sort by.
  4479. * @param {string[]} orders The sort orders of `iteratees`.
  4480. * @returns {Array} Returns the new sorted array.
  4481. */
  4482. function baseOrderBy(collection, iteratees, orders) {
  4483. if (iteratees.length) {
  4484. iteratees = arrayMap(iteratees, function(iteratee) {
  4485. if (isArray(iteratee)) {
  4486. return function(value) {
  4487. return baseGet(value, iteratee.length === 1 ? iteratee[0] : iteratee);
  4488. }
  4489. }
  4490. return iteratee;
  4491. });
  4492. } else {
  4493. iteratees = [identity];
  4494. }
  4495. var index = -1;
  4496. iteratees = arrayMap(iteratees, baseUnary(getIteratee()));
  4497. var result = baseMap(collection, function(value, key, collection) {
  4498. var criteria = arrayMap(iteratees, function(iteratee) {
  4499. return iteratee(value);
  4500. });
  4501. return { 'criteria': criteria, 'index': ++index, 'value': value };
  4502. });
  4503. return baseSortBy(result, function(object, other) {
  4504. return compareMultiple(object, other, orders);
  4505. });
  4506. }
  4507. /**
  4508. * The base implementation of `_.pick` without support for individual
  4509. * property identifiers.
  4510. *
  4511. * @private
  4512. * @param {Object} object The source object.
  4513. * @param {string[]} paths The property paths to pick.
  4514. * @returns {Object} Returns the new object.
  4515. */
  4516. function basePick(object, paths) {
  4517. return basePickBy(object, paths, function(value, path) {
  4518. return hasIn(object, path);
  4519. });
  4520. }
  4521. /**
  4522. * The base implementation of `_.pickBy` without support for iteratee shorthands.
  4523. *
  4524. * @private
  4525. * @param {Object} object The source object.
  4526. * @param {string[]} paths The property paths to pick.
  4527. * @param {Function} predicate The function invoked per property.
  4528. * @returns {Object} Returns the new object.
  4529. */
  4530. function basePickBy(object, paths, predicate) {
  4531. var index = -1,
  4532. length = paths.length,
  4533. result = {};
  4534. while (++index < length) {
  4535. var path = paths[index],
  4536. value = baseGet(object, path);
  4537. if (predicate(value, path)) {
  4538. baseSet(result, castPath(path, object), value);
  4539. }
  4540. }
  4541. return result;
  4542. }
  4543. /**
  4544. * A specialized version of `baseProperty` which supports deep paths.
  4545. *
  4546. * @private
  4547. * @param {Array|string} path The path of the property to get.
  4548. * @returns {Function} Returns the new accessor function.
  4549. */
  4550. function basePropertyDeep(path) {
  4551. return function(object) {
  4552. return baseGet(object, path);
  4553. };
  4554. }
  4555. /**
  4556. * The base implementation of `_.pullAllBy` without support for iteratee
  4557. * shorthands.
  4558. *
  4559. * @private
  4560. * @param {Array} array The array to modify.
  4561. * @param {Array} values The values to remove.
  4562. * @param {Function} [iteratee] The iteratee invoked per element.
  4563. * @param {Function} [comparator] The comparator invoked per element.
  4564. * @returns {Array} Returns `array`.
  4565. */
  4566. function basePullAll(array, values, iteratee, comparator) {
  4567. var indexOf = comparator ? baseIndexOfWith : baseIndexOf,
  4568. index = -1,
  4569. length = values.length,
  4570. seen = array;
  4571. if (array === values) {
  4572. values = copyArray(values);
  4573. }
  4574. if (iteratee) {
  4575. seen = arrayMap(array, baseUnary(iteratee));
  4576. }
  4577. while (++index < length) {
  4578. var fromIndex = 0,
  4579. value = values[index],
  4580. computed = iteratee ? iteratee(value) : value;
  4581. while ((fromIndex = indexOf(seen, computed, fromIndex, comparator)) > -1) {
  4582. if (seen !== array) {
  4583. splice.call(seen, fromIndex, 1);
  4584. }
  4585. splice.call(array, fromIndex, 1);
  4586. }
  4587. }
  4588. return array;
  4589. }
  4590. /**
  4591. * The base implementation of `_.pullAt` without support for individual
  4592. * indexes or capturing the removed elements.
  4593. *
  4594. * @private
  4595. * @param {Array} array The array to modify.
  4596. * @param {number[]} indexes The indexes of elements to remove.
  4597. * @returns {Array} Returns `array`.
  4598. */
  4599. function basePullAt(array, indexes) {
  4600. var length = array ? indexes.length : 0,
  4601. lastIndex = length - 1;
  4602. while (length--) {
  4603. var index = indexes[length];
  4604. if (length == lastIndex || index !== previous) {
  4605. var previous = index;
  4606. if (isIndex(index)) {
  4607. splice.call(array, index, 1);
  4608. } else {
  4609. baseUnset(array, index);
  4610. }
  4611. }
  4612. }
  4613. return array;
  4614. }
  4615. /**
  4616. * The base implementation of `_.random` without support for returning
  4617. * floating-point numbers.
  4618. *
  4619. * @private
  4620. * @param {number} lower The lower bound.
  4621. * @param {number} upper The upper bound.
  4622. * @returns {number} Returns the random number.
  4623. */
  4624. function baseRandom(lower, upper) {
  4625. return lower + nativeFloor(nativeRandom() * (upper - lower + 1));
  4626. }
  4627. /**
  4628. * The base implementation of `_.range` and `_.rangeRight` which doesn't
  4629. * coerce arguments.
  4630. *
  4631. * @private
  4632. * @param {number} start The start of the range.
  4633. * @param {number} end The end of the range.
  4634. * @param {number} step The value to increment or decrement by.
  4635. * @param {boolean} [fromRight] Specify iterating from right to left.
  4636. * @returns {Array} Returns the range of numbers.
  4637. */
  4638. function baseRange(start, end, step, fromRight) {
  4639. var index = -1,
  4640. length = nativeMax(nativeCeil((end - start) / (step || 1)), 0),
  4641. result = Array(length);
  4642. while (length--) {
  4643. result[fromRight ? length : ++index] = start;
  4644. start += step;
  4645. }
  4646. return result;
  4647. }
  4648. /**
  4649. * The base implementation of `_.repeat` which doesn't coerce arguments.
  4650. *
  4651. * @private
  4652. * @param {string} string The string to repeat.
  4653. * @param {number} n The number of times to repeat the string.
  4654. * @returns {string} Returns the repeated string.
  4655. */
  4656. function baseRepeat(string, n) {
  4657. var result = '';
  4658. if (!string || n < 1 || n > MAX_SAFE_INTEGER) {
  4659. return result;
  4660. }
  4661. // Leverage the exponentiation by squaring algorithm for a faster repeat.
  4662. // See https://en.wikipedia.org/wiki/Exponentiation_by_squaring for more details.
  4663. do {
  4664. if (n % 2) {
  4665. result += string;
  4666. }
  4667. n = nativeFloor(n / 2);
  4668. if (n) {
  4669. string += string;
  4670. }
  4671. } while (n);
  4672. return result;
  4673. }
  4674. /**
  4675. * The base implementation of `_.rest` which doesn't validate or coerce arguments.
  4676. *
  4677. * @private
  4678. * @param {Function} func The function to apply a rest parameter to.
  4679. * @param {number} [start=func.length-1] The start position of the rest parameter.
  4680. * @returns {Function} Returns the new function.
  4681. */
  4682. function baseRest(func, start) {
  4683. return setToString(overRest(func, start, identity), func + '');
  4684. }
  4685. /**
  4686. * The base implementation of `_.sample`.
  4687. *
  4688. * @private
  4689. * @param {Array|Object} collection The collection to sample.
  4690. * @returns {*} Returns the random element.
  4691. */
  4692. function baseSample(collection) {
  4693. return arraySample(values(collection));
  4694. }
  4695. /**
  4696. * The base implementation of `_.sampleSize` without param guards.
  4697. *
  4698. * @private
  4699. * @param {Array|Object} collection The collection to sample.
  4700. * @param {number} n The number of elements to sample.
  4701. * @returns {Array} Returns the random elements.
  4702. */
  4703. function baseSampleSize(collection, n) {
  4704. var array = values(collection);
  4705. return shuffleSelf(array, baseClamp(n, 0, array.length));
  4706. }
  4707. /**
  4708. * The base implementation of `_.set`.
  4709. *
  4710. * @private
  4711. * @param {Object} object The object to modify.
  4712. * @param {Array|string} path The path of the property to set.
  4713. * @param {*} value The value to set.
  4714. * @param {Function} [customizer] The function to customize path creation.
  4715. * @returns {Object} Returns `object`.
  4716. */
  4717. function baseSet(object, path, value, customizer) {
  4718. if (!isObject(object)) {
  4719. return object;
  4720. }
  4721. path = castPath(path, object);
  4722. var index = -1,
  4723. length = path.length,
  4724. lastIndex = length - 1,
  4725. nested = object;
  4726. while (nested != null && ++index < length) {
  4727. var key = toKey(path[index]),
  4728. newValue = value;
  4729. if (key === '__proto__' || key === 'constructor' || key === 'prototype') {
  4730. return object;
  4731. }
  4732. if (index != lastIndex) {
  4733. var objValue = nested[key];
  4734. newValue = customizer ? customizer(objValue, key, nested) : undefined;
  4735. if (newValue === undefined) {
  4736. newValue = isObject(objValue)
  4737. ? objValue
  4738. : (isIndex(path[index + 1]) ? [] : {});
  4739. }
  4740. }
  4741. assignValue(nested, key, newValue);
  4742. nested = nested[key];
  4743. }
  4744. return object;
  4745. }
  4746. /**
  4747. * The base implementation of `setData` without support for hot loop shorting.
  4748. *
  4749. * @private
  4750. * @param {Function} func The function to associate metadata with.
  4751. * @param {*} data The metadata.
  4752. * @returns {Function} Returns `func`.
  4753. */
  4754. var baseSetData = !metaMap ? identity : function(func, data) {
  4755. metaMap.set(func, data);
  4756. return func;
  4757. };
  4758. /**
  4759. * The base implementation of `setToString` without support for hot loop shorting.
  4760. *
  4761. * @private
  4762. * @param {Function} func The function to modify.
  4763. * @param {Function} string The `toString` result.
  4764. * @returns {Function} Returns `func`.
  4765. */
  4766. var baseSetToString = !defineProperty ? identity : function(func, string) {
  4767. return defineProperty(func, 'toString', {
  4768. 'configurable': true,
  4769. 'enumerable': false,
  4770. 'value': constant(string),
  4771. 'writable': true
  4772. });
  4773. };
  4774. /**
  4775. * The base implementation of `_.shuffle`.
  4776. *
  4777. * @private
  4778. * @param {Array|Object} collection The collection to shuffle.
  4779. * @returns {Array} Returns the new shuffled array.
  4780. */
  4781. function baseShuffle(collection) {
  4782. return shuffleSelf(values(collection));
  4783. }
  4784. /**
  4785. * The base implementation of `_.slice` without an iteratee call guard.
  4786. *
  4787. * @private
  4788. * @param {Array} array The array to slice.
  4789. * @param {number} [start=0] The start position.
  4790. * @param {number} [end=array.length] The end position.
  4791. * @returns {Array} Returns the slice of `array`.
  4792. */
  4793. function baseSlice(array, start, end) {
  4794. var index = -1,
  4795. length = array.length;
  4796. if (start < 0) {
  4797. start = -start > length ? 0 : (length + start);
  4798. }
  4799. end = end > length ? length : end;
  4800. if (end < 0) {
  4801. end += length;
  4802. }
  4803. length = start > end ? 0 : ((end - start) >>> 0);
  4804. start >>>= 0;
  4805. var result = Array(length);
  4806. while (++index < length) {
  4807. result[index] = array[index + start];
  4808. }
  4809. return result;
  4810. }
  4811. /**
  4812. * The base implementation of `_.some` without support for iteratee shorthands.
  4813. *
  4814. * @private
  4815. * @param {Array|Object} collection The collection to iterate over.
  4816. * @param {Function} predicate The function invoked per iteration.
  4817. * @returns {boolean} Returns `true` if any element passes the predicate check,
  4818. * else `false`.
  4819. */
  4820. function baseSome(collection, predicate) {
  4821. var result;
  4822. baseEach(collection, function(value, index, collection) {
  4823. result = predicate(value, index, collection);
  4824. return !result;
  4825. });
  4826. return !!result;
  4827. }
  4828. /**
  4829. * The base implementation of `_.sortedIndex` and `_.sortedLastIndex` which
  4830. * performs a binary search of `array` to determine the index at which `value`
  4831. * should be inserted into `array` in order to maintain its sort order.
  4832. *
  4833. * @private
  4834. * @param {Array} array The sorted array to inspect.
  4835. * @param {*} value The value to evaluate.
  4836. * @param {boolean} [retHighest] Specify returning the highest qualified index.
  4837. * @returns {number} Returns the index at which `value` should be inserted
  4838. * into `array`.
  4839. */
  4840. function baseSortedIndex(array, value, retHighest) {
  4841. var low = 0,
  4842. high = array == null ? low : array.length;
  4843. if (typeof value == 'number' && value === value && high <= HALF_MAX_ARRAY_LENGTH) {
  4844. while (low < high) {
  4845. var mid = (low + high) >>> 1,
  4846. computed = array[mid];
  4847. if (computed !== null && !isSymbol(computed) &&
  4848. (retHighest ? (computed <= value) : (computed < value))) {
  4849. low = mid + 1;
  4850. } else {
  4851. high = mid;
  4852. }
  4853. }
  4854. return high;
  4855. }
  4856. return baseSortedIndexBy(array, value, identity, retHighest);
  4857. }
  4858. /**
  4859. * The base implementation of `_.sortedIndexBy` and `_.sortedLastIndexBy`
  4860. * which invokes `iteratee` for `value` and each element of `array` to compute
  4861. * their sort ranking. The iteratee is invoked with one argument; (value).
  4862. *
  4863. * @private
  4864. * @param {Array} array The sorted array to inspect.
  4865. * @param {*} value The value to evaluate.
  4866. * @param {Function} iteratee The iteratee invoked per element.
  4867. * @param {boolean} [retHighest] Specify returning the highest qualified index.
  4868. * @returns {number} Returns the index at which `value` should be inserted
  4869. * into `array`.
  4870. */
  4871. function baseSortedIndexBy(array, value, iteratee, retHighest) {
  4872. var low = 0,
  4873. high = array == null ? 0 : array.length;
  4874. if (high === 0) {
  4875. return 0;
  4876. }
  4877. value = iteratee(value);
  4878. var valIsNaN = value !== value,
  4879. valIsNull = value === null,
  4880. valIsSymbol = isSymbol(value),
  4881. valIsUndefined = value === undefined;
  4882. while (low < high) {
  4883. var mid = nativeFloor((low + high) / 2),
  4884. computed = iteratee(array[mid]),
  4885. othIsDefined = computed !== undefined,
  4886. othIsNull = computed === null,
  4887. othIsReflexive = computed === computed,
  4888. othIsSymbol = isSymbol(computed);
  4889. if (valIsNaN) {
  4890. var setLow = retHighest || othIsReflexive;
  4891. } else if (valIsUndefined) {
  4892. setLow = othIsReflexive && (retHighest || othIsDefined);
  4893. } else if (valIsNull) {
  4894. setLow = othIsReflexive && othIsDefined && (retHighest || !othIsNull);
  4895. } else if (valIsSymbol) {
  4896. setLow = othIsReflexive && othIsDefined && !othIsNull && (retHighest || !othIsSymbol);
  4897. } else if (othIsNull || othIsSymbol) {
  4898. setLow = false;
  4899. } else {
  4900. setLow = retHighest ? (computed <= value) : (computed < value);
  4901. }
  4902. if (setLow) {
  4903. low = mid + 1;
  4904. } else {
  4905. high = mid;
  4906. }
  4907. }
  4908. return nativeMin(high, MAX_ARRAY_INDEX);
  4909. }
  4910. /**
  4911. * The base implementation of `_.sortedUniq` and `_.sortedUniqBy` without
  4912. * support for iteratee shorthands.
  4913. *
  4914. * @private
  4915. * @param {Array} array The array to inspect.
  4916. * @param {Function} [iteratee] The iteratee invoked per element.
  4917. * @returns {Array} Returns the new duplicate free array.
  4918. */
  4919. function baseSortedUniq(array, iteratee) {
  4920. var index = -1,
  4921. length = array.length,
  4922. resIndex = 0,
  4923. result = [];
  4924. while (++index < length) {
  4925. var value = array[index],
  4926. computed = iteratee ? iteratee(value) : value;
  4927. if (!index || !eq(computed, seen)) {
  4928. var seen = computed;
  4929. result[resIndex++] = value === 0 ? 0 : value;
  4930. }
  4931. }
  4932. return result;
  4933. }
  4934. /**
  4935. * The base implementation of `_.toNumber` which doesn't ensure correct
  4936. * conversions of binary, hexadecimal, or octal string values.
  4937. *
  4938. * @private
  4939. * @param {*} value The value to process.
  4940. * @returns {number} Returns the number.
  4941. */
  4942. function baseToNumber(value) {
  4943. if (typeof value == 'number') {
  4944. return value;
  4945. }
  4946. if (isSymbol(value)) {
  4947. return NAN;
  4948. }
  4949. return +value;
  4950. }
  4951. /**
  4952. * The base implementation of `_.toString` which doesn't convert nullish
  4953. * values to empty strings.
  4954. *
  4955. * @private
  4956. * @param {*} value The value to process.
  4957. * @returns {string} Returns the string.
  4958. */
  4959. function baseToString(value) {
  4960. // Exit early for strings to avoid a performance hit in some environments.
  4961. if (typeof value == 'string') {
  4962. return value;
  4963. }
  4964. if (isArray(value)) {
  4965. // Recursively convert values (susceptible to call stack limits).
  4966. return arrayMap(value, baseToString) + '';
  4967. }
  4968. if (isSymbol(value)) {
  4969. return symbolToString ? symbolToString.call(value) : '';
  4970. }
  4971. var result = (value + '');
  4972. return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;
  4973. }
  4974. /**
  4975. * The base implementation of `_.uniqBy` without support for iteratee shorthands.
  4976. *
  4977. * @private
  4978. * @param {Array} array The array to inspect.
  4979. * @param {Function} [iteratee] The iteratee invoked per element.
  4980. * @param {Function} [comparator] The comparator invoked per element.
  4981. * @returns {Array} Returns the new duplicate free array.
  4982. */
  4983. function baseUniq(array, iteratee, comparator) {
  4984. var index = -1,
  4985. includes = arrayIncludes,
  4986. length = array.length,
  4987. isCommon = true,
  4988. result = [],
  4989. seen = result;
  4990. if (comparator) {
  4991. isCommon = false;
  4992. includes = arrayIncludesWith;
  4993. }
  4994. else if (length >= LARGE_ARRAY_SIZE) {
  4995. var set = iteratee ? null : createSet(array);
  4996. if (set) {
  4997. return setToArray(set);
  4998. }
  4999. isCommon = false;
  5000. includes = cacheHas;
  5001. seen = new SetCache;
  5002. }
  5003. else {
  5004. seen = iteratee ? [] : result;
  5005. }
  5006. outer:
  5007. while (++index < length) {
  5008. var value = array[index],
  5009. computed = iteratee ? iteratee(value) : value;
  5010. value = (comparator || value !== 0) ? value : 0;
  5011. if (isCommon && computed === computed) {
  5012. var seenIndex = seen.length;
  5013. while (seenIndex--) {
  5014. if (seen[seenIndex] === computed) {
  5015. continue outer;
  5016. }
  5017. }
  5018. if (iteratee) {
  5019. seen.push(computed);
  5020. }
  5021. result.push(value);
  5022. }
  5023. else if (!includes(seen, computed, comparator)) {
  5024. if (seen !== result) {
  5025. seen.push(computed);
  5026. }
  5027. result.push(value);
  5028. }
  5029. }
  5030. return result;
  5031. }
  5032. /**
  5033. * The base implementation of `_.unset`.
  5034. *
  5035. * @private
  5036. * @param {Object} object The object to modify.
  5037. * @param {Array|string} path The property path to unset.
  5038. * @returns {boolean} Returns `true` if the property is deleted, else `false`.
  5039. */
  5040. function baseUnset(object, path) {
  5041. path = castPath(path, object);
  5042. object = parent(object, path);
  5043. return object == null || delete object[toKey(last(path))];
  5044. }
  5045. /**
  5046. * The base implementation of `_.update`.
  5047. *
  5048. * @private
  5049. * @param {Object} object The object to modify.
  5050. * @param {Array|string} path The path of the property to update.
  5051. * @param {Function} updater The function to produce the updated value.
  5052. * @param {Function} [customizer] The function to customize path creation.
  5053. * @returns {Object} Returns `object`.
  5054. */
  5055. function baseUpdate(object, path, updater, customizer) {
  5056. return baseSet(object, path, updater(baseGet(object, path)), customizer);
  5057. }
  5058. /**
  5059. * The base implementation of methods like `_.dropWhile` and `_.takeWhile`
  5060. * without support for iteratee shorthands.
  5061. *
  5062. * @private
  5063. * @param {Array} array The array to query.
  5064. * @param {Function} predicate The function invoked per iteration.
  5065. * @param {boolean} [isDrop] Specify dropping elements instead of taking them.
  5066. * @param {boolean} [fromRight] Specify iterating from right to left.
  5067. * @returns {Array} Returns the slice of `array`.
  5068. */
  5069. function baseWhile(array, predicate, isDrop, fromRight) {
  5070. var length = array.length,
  5071. index = fromRight ? length : -1;
  5072. while ((fromRight ? index-- : ++index < length) &&
  5073. predicate(array[index], index, array)) {}
  5074. return isDrop
  5075. ? baseSlice(array, (fromRight ? 0 : index), (fromRight ? index + 1 : length))
  5076. : baseSlice(array, (fromRight ? index + 1 : 0), (fromRight ? length : index));
  5077. }
  5078. /**
  5079. * The base implementation of `wrapperValue` which returns the result of
  5080. * performing a sequence of actions on the unwrapped `value`, where each
  5081. * successive action is supplied the return value of the previous.
  5082. *
  5083. * @private
  5084. * @param {*} value The unwrapped value.
  5085. * @param {Array} actions Actions to perform to resolve the unwrapped value.
  5086. * @returns {*} Returns the resolved value.
  5087. */
  5088. function baseWrapperValue(value, actions) {
  5089. var result = value;
  5090. if (result instanceof LazyWrapper) {
  5091. result = result.value();
  5092. }
  5093. return arrayReduce(actions, function(result, action) {
  5094. return action.func.apply(action.thisArg, arrayPush([result], action.args));
  5095. }, result);
  5096. }
  5097. /**
  5098. * The base implementation of methods like `_.xor`, without support for
  5099. * iteratee shorthands, that accepts an array of arrays to inspect.
  5100. *
  5101. * @private
  5102. * @param {Array} arrays The arrays to inspect.
  5103. * @param {Function} [iteratee] The iteratee invoked per element.
  5104. * @param {Function} [comparator] The comparator invoked per element.
  5105. * @returns {Array} Returns the new array of values.
  5106. */
  5107. function baseXor(arrays, iteratee, comparator) {
  5108. var length = arrays.length;
  5109. if (length < 2) {
  5110. return length ? baseUniq(arrays[0]) : [];
  5111. }
  5112. var index = -1,
  5113. result = Array(length);
  5114. while (++index < length) {
  5115. var array = arrays[index],
  5116. othIndex = -1;
  5117. while (++othIndex < length) {
  5118. if (othIndex != index) {
  5119. result[index] = baseDifference(result[index] || array, arrays[othIndex], iteratee, comparator);
  5120. }
  5121. }
  5122. }
  5123. return baseUniq(baseFlatten(result, 1), iteratee, comparator);
  5124. }
  5125. /**
  5126. * This base implementation of `_.zipObject` which assigns values using `assignFunc`.
  5127. *
  5128. * @private
  5129. * @param {Array} props The property identifiers.
  5130. * @param {Array} values The property values.
  5131. * @param {Function} assignFunc The function to assign values.
  5132. * @returns {Object} Returns the new object.
  5133. */
  5134. function baseZipObject(props, values, assignFunc) {
  5135. var index = -1,
  5136. length = props.length,
  5137. valsLength = values.length,
  5138. result = {};
  5139. while (++index < length) {
  5140. var value = index < valsLength ? values[index] : undefined;
  5141. assignFunc(result, props[index], value);
  5142. }
  5143. return result;
  5144. }
  5145. /**
  5146. * Casts `value` to an empty array if it's not an array like object.
  5147. *
  5148. * @private
  5149. * @param {*} value The value to inspect.
  5150. * @returns {Array|Object} Returns the cast array-like object.
  5151. */
  5152. function castArrayLikeObject(value) {
  5153. return isArrayLikeObject(value) ? value : [];
  5154. }
  5155. /**
  5156. * Casts `value` to `identity` if it's not a function.
  5157. *
  5158. * @private
  5159. * @param {*} value The value to inspect.
  5160. * @returns {Function} Returns cast function.
  5161. */
  5162. function castFunction(value) {
  5163. return typeof value == 'function' ? value : identity;
  5164. }
  5165. /**
  5166. * Casts `value` to a path array if it's not one.
  5167. *
  5168. * @private
  5169. * @param {*} value The value to inspect.
  5170. * @param {Object} [object] The object to query keys on.
  5171. * @returns {Array} Returns the cast property path array.
  5172. */
  5173. function castPath(value, object) {
  5174. if (isArray(value)) {
  5175. return value;
  5176. }
  5177. return isKey(value, object) ? [value] : stringToPath(toString(value));
  5178. }
  5179. /**
  5180. * A `baseRest` alias which can be replaced with `identity` by module
  5181. * replacement plugins.
  5182. *
  5183. * @private
  5184. * @type {Function}
  5185. * @param {Function} func The function to apply a rest parameter to.
  5186. * @returns {Function} Returns the new function.
  5187. */
  5188. var castRest = baseRest;
  5189. /**
  5190. * Casts `array` to a slice if it's needed.
  5191. *
  5192. * @private
  5193. * @param {Array} array The array to inspect.
  5194. * @param {number} start The start position.
  5195. * @param {number} [end=array.length] The end position.
  5196. * @returns {Array} Returns the cast slice.
  5197. */
  5198. function castSlice(array, start, end) {
  5199. var length = array.length;
  5200. end = end === undefined ? length : end;
  5201. return (!start && end >= length) ? array : baseSlice(array, start, end);
  5202. }
  5203. /**
  5204. * A simple wrapper around the global [`clearTimeout`](https://mdn.io/clearTimeout).
  5205. *
  5206. * @private
  5207. * @param {number|Object} id The timer id or timeout object of the timer to clear.
  5208. */
  5209. var clearTimeout = ctxClearTimeout || function(id) {
  5210. return root.clearTimeout(id);
  5211. };
  5212. /**
  5213. * Creates a clone of `buffer`.
  5214. *
  5215. * @private
  5216. * @param {Buffer} buffer The buffer to clone.
  5217. * @param {boolean} [isDeep] Specify a deep clone.
  5218. * @returns {Buffer} Returns the cloned buffer.
  5219. */
  5220. function cloneBuffer(buffer, isDeep) {
  5221. if (isDeep) {
  5222. return buffer.slice();
  5223. }
  5224. var length = buffer.length,
  5225. result = allocUnsafe ? allocUnsafe(length) : new buffer.constructor(length);
  5226. buffer.copy(result);
  5227. return result;
  5228. }
  5229. /**
  5230. * Creates a clone of `arrayBuffer`.
  5231. *
  5232. * @private
  5233. * @param {ArrayBuffer} arrayBuffer The array buffer to clone.
  5234. * @returns {ArrayBuffer} Returns the cloned array buffer.
  5235. */
  5236. function cloneArrayBuffer(arrayBuffer) {
  5237. var result = new arrayBuffer.constructor(arrayBuffer.byteLength);
  5238. new Uint8Array(result).set(new Uint8Array(arrayBuffer));
  5239. return result;
  5240. }
  5241. /**
  5242. * Creates a clone of `dataView`.
  5243. *
  5244. * @private
  5245. * @param {Object} dataView The data view to clone.
  5246. * @param {boolean} [isDeep] Specify a deep clone.
  5247. * @returns {Object} Returns the cloned data view.
  5248. */
  5249. function cloneDataView(dataView, isDeep) {
  5250. var buffer = isDeep ? cloneArrayBuffer(dataView.buffer) : dataView.buffer;
  5251. return new dataView.constructor(buffer, dataView.byteOffset, dataView.byteLength);
  5252. }
  5253. /**
  5254. * Creates a clone of `regexp`.
  5255. *
  5256. * @private
  5257. * @param {Object} regexp The regexp to clone.
  5258. * @returns {Object} Returns the cloned regexp.
  5259. */
  5260. function cloneRegExp(regexp) {
  5261. var result = new regexp.constructor(regexp.source, reFlags.exec(regexp));
  5262. result.lastIndex = regexp.lastIndex;
  5263. return result;
  5264. }
  5265. /**
  5266. * Creates a clone of the `symbol` object.
  5267. *
  5268. * @private
  5269. * @param {Object} symbol The symbol object to clone.
  5270. * @returns {Object} Returns the cloned symbol object.
  5271. */
  5272. function cloneSymbol(symbol) {
  5273. return symbolValueOf ? Object(symbolValueOf.call(symbol)) : {};
  5274. }
  5275. /**
  5276. * Creates a clone of `typedArray`.
  5277. *
  5278. * @private
  5279. * @param {Object} typedArray The typed array to clone.
  5280. * @param {boolean} [isDeep] Specify a deep clone.
  5281. * @returns {Object} Returns the cloned typed array.
  5282. */
  5283. function cloneTypedArray(typedArray, isDeep) {
  5284. var buffer = isDeep ? cloneArrayBuffer(typedArray.buffer) : typedArray.buffer;
  5285. return new typedArray.constructor(buffer, typedArray.byteOffset, typedArray.length);
  5286. }
  5287. /**
  5288. * Compares values to sort them in ascending order.
  5289. *
  5290. * @private
  5291. * @param {*} value The value to compare.
  5292. * @param {*} other The other value to compare.
  5293. * @returns {number} Returns the sort order indicator for `value`.
  5294. */
  5295. function compareAscending(value, other) {
  5296. if (value !== other) {
  5297. var valIsDefined = value !== undefined,
  5298. valIsNull = value === null,
  5299. valIsReflexive = value === value,
  5300. valIsSymbol = isSymbol(value);
  5301. var othIsDefined = other !== undefined,
  5302. othIsNull = other === null,
  5303. othIsReflexive = other === other,
  5304. othIsSymbol = isSymbol(other);
  5305. if ((!othIsNull && !othIsSymbol && !valIsSymbol && value > other) ||
  5306. (valIsSymbol && othIsDefined && othIsReflexive && !othIsNull && !othIsSymbol) ||
  5307. (valIsNull && othIsDefined && othIsReflexive) ||
  5308. (!valIsDefined && othIsReflexive) ||
  5309. !valIsReflexive) {
  5310. return 1;
  5311. }
  5312. if ((!valIsNull && !valIsSymbol && !othIsSymbol && value < other) ||
  5313. (othIsSymbol && valIsDefined && valIsReflexive && !valIsNull && !valIsSymbol) ||
  5314. (othIsNull && valIsDefined && valIsReflexive) ||
  5315. (!othIsDefined && valIsReflexive) ||
  5316. !othIsReflexive) {
  5317. return -1;
  5318. }
  5319. }
  5320. return 0;
  5321. }
  5322. /**
  5323. * Used by `_.orderBy` to compare multiple properties of a value to another
  5324. * and stable sort them.
  5325. *
  5326. * If `orders` is unspecified, all values are sorted in ascending order. Otherwise,
  5327. * specify an order of "desc" for descending or "asc" for ascending sort order
  5328. * of corresponding values.
  5329. *
  5330. * @private
  5331. * @param {Object} object The object to compare.
  5332. * @param {Object} other The other object to compare.
  5333. * @param {boolean[]|string[]} orders The order to sort by for each property.
  5334. * @returns {number} Returns the sort order indicator for `object`.
  5335. */
  5336. function compareMultiple(object, other, orders) {
  5337. var index = -1,
  5338. objCriteria = object.criteria,
  5339. othCriteria = other.criteria,
  5340. length = objCriteria.length,
  5341. ordersLength = orders.length;
  5342. while (++index < length) {
  5343. var result = compareAscending(objCriteria[index], othCriteria[index]);
  5344. if (result) {
  5345. if (index >= ordersLength) {
  5346. return result;
  5347. }
  5348. var order = orders[index];
  5349. return result * (order == 'desc' ? -1 : 1);
  5350. }
  5351. }
  5352. // Fixes an `Array#sort` bug in the JS engine embedded in Adobe applications
  5353. // that causes it, under certain circumstances, to provide the same value for
  5354. // `object` and `other`. See https://github.com/jashkenas/underscore/pull/1247
  5355. // for more details.
  5356. //
  5357. // This also ensures a stable sort in V8 and other engines.
  5358. // See https://bugs.chromium.org/p/v8/issues/detail?id=90 for more details.
  5359. return object.index - other.index;
  5360. }
  5361. /**
  5362. * Creates an array that is the composition of partially applied arguments,
  5363. * placeholders, and provided arguments into a single array of arguments.
  5364. *
  5365. * @private
  5366. * @param {Array} args The provided arguments.
  5367. * @param {Array} partials The arguments to prepend to those provided.
  5368. * @param {Array} holders The `partials` placeholder indexes.
  5369. * @params {boolean} [isCurried] Specify composing for a curried function.
  5370. * @returns {Array} Returns the new array of composed arguments.
  5371. */
  5372. function composeArgs(args, partials, holders, isCurried) {
  5373. var argsIndex = -1,
  5374. argsLength = args.length,
  5375. holdersLength = holders.length,
  5376. leftIndex = -1,
  5377. leftLength = partials.length,
  5378. rangeLength = nativeMax(argsLength - holdersLength, 0),
  5379. result = Array(leftLength + rangeLength),
  5380. isUncurried = !isCurried;
  5381. while (++leftIndex < leftLength) {
  5382. result[leftIndex] = partials[leftIndex];
  5383. }
  5384. while (++argsIndex < holdersLength) {
  5385. if (isUncurried || argsIndex < argsLength) {
  5386. result[holders[argsIndex]] = args[argsIndex];
  5387. }
  5388. }
  5389. while (rangeLength--) {
  5390. result[leftIndex++] = args[argsIndex++];
  5391. }
  5392. return result;
  5393. }
  5394. /**
  5395. * This function is like `composeArgs` except that the arguments composition
  5396. * is tailored for `_.partialRight`.
  5397. *
  5398. * @private
  5399. * @param {Array} args The provided arguments.
  5400. * @param {Array} partials The arguments to append to those provided.
  5401. * @param {Array} holders The `partials` placeholder indexes.
  5402. * @params {boolean} [isCurried] Specify composing for a curried function.
  5403. * @returns {Array} Returns the new array of composed arguments.
  5404. */
  5405. function composeArgsRight(args, partials, holders, isCurried) {
  5406. var argsIndex = -1,
  5407. argsLength = args.length,
  5408. holdersIndex = -1,
  5409. holdersLength = holders.length,
  5410. rightIndex = -1,
  5411. rightLength = partials.length,
  5412. rangeLength = nativeMax(argsLength - holdersLength, 0),
  5413. result = Array(rangeLength + rightLength),
  5414. isUncurried = !isCurried;
  5415. while (++argsIndex < rangeLength) {
  5416. result[argsIndex] = args[argsIndex];
  5417. }
  5418. var offset = argsIndex;
  5419. while (++rightIndex < rightLength) {
  5420. result[offset + rightIndex] = partials[rightIndex];
  5421. }
  5422. while (++holdersIndex < holdersLength) {
  5423. if (isUncurried || argsIndex < argsLength) {
  5424. result[offset + holders[holdersIndex]] = args[argsIndex++];
  5425. }
  5426. }
  5427. return result;
  5428. }
  5429. /**
  5430. * Copies the values of `source` to `array`.
  5431. *
  5432. * @private
  5433. * @param {Array} source The array to copy values from.
  5434. * @param {Array} [array=[]] The array to copy values to.
  5435. * @returns {Array} Returns `array`.
  5436. */
  5437. function copyArray(source, array) {
  5438. var index = -1,
  5439. length = source.length;
  5440. array || (array = Array(length));
  5441. while (++index < length) {
  5442. array[index] = source[index];
  5443. }
  5444. return array;
  5445. }
  5446. /**
  5447. * Copies properties of `source` to `object`.
  5448. *
  5449. * @private
  5450. * @param {Object} source The object to copy properties from.
  5451. * @param {Array} props The property identifiers to copy.
  5452. * @param {Object} [object={}] The object to copy properties to.
  5453. * @param {Function} [customizer] The function to customize copied values.
  5454. * @returns {Object} Returns `object`.
  5455. */
  5456. function copyObject(source, props, object, customizer) {
  5457. var isNew = !object;
  5458. object || (object = {});
  5459. var index = -1,
  5460. length = props.length;
  5461. while (++index < length) {
  5462. var key = props[index];
  5463. var newValue = customizer
  5464. ? customizer(object[key], source[key], key, object, source)
  5465. : undefined;
  5466. if (newValue === undefined) {
  5467. newValue = source[key];
  5468. }
  5469. if (isNew) {
  5470. baseAssignValue(object, key, newValue);
  5471. } else {
  5472. assignValue(object, key, newValue);
  5473. }
  5474. }
  5475. return object;
  5476. }
  5477. /**
  5478. * Copies own symbols of `source` to `object`.
  5479. *
  5480. * @private
  5481. * @param {Object} source The object to copy symbols from.
  5482. * @param {Object} [object={}] The object to copy symbols to.
  5483. * @returns {Object} Returns `object`.
  5484. */
  5485. function copySymbols(source, object) {
  5486. return copyObject(source, getSymbols(source), object);
  5487. }
  5488. /**
  5489. * Copies own and inherited symbols of `source` to `object`.
  5490. *
  5491. * @private
  5492. * @param {Object} source The object to copy symbols from.
  5493. * @param {Object} [object={}] The object to copy symbols to.
  5494. * @returns {Object} Returns `object`.
  5495. */
  5496. function copySymbolsIn(source, object) {
  5497. return copyObject(source, getSymbolsIn(source), object);
  5498. }
  5499. /**
  5500. * Creates a function like `_.groupBy`.
  5501. *
  5502. * @private
  5503. * @param {Function} setter The function to set accumulator values.
  5504. * @param {Function} [initializer] The accumulator object initializer.
  5505. * @returns {Function} Returns the new aggregator function.
  5506. */
  5507. function createAggregator(setter, initializer) {
  5508. return function(collection, iteratee) {
  5509. var func = isArray(collection) ? arrayAggregator : baseAggregator,
  5510. accumulator = initializer ? initializer() : {};
  5511. return func(collection, setter, getIteratee(iteratee, 2), accumulator);
  5512. };
  5513. }
  5514. /**
  5515. * Creates a function like `_.assign`.
  5516. *
  5517. * @private
  5518. * @param {Function} assigner The function to assign values.
  5519. * @returns {Function} Returns the new assigner function.
  5520. */
  5521. function createAssigner(assigner) {
  5522. return baseRest(function(object, sources) {
  5523. var index = -1,
  5524. length = sources.length,
  5525. customizer = length > 1 ? sources[length - 1] : undefined,
  5526. guard = length > 2 ? sources[2] : undefined;
  5527. customizer = (assigner.length > 3 && typeof customizer == 'function')
  5528. ? (length--, customizer)
  5529. : undefined;
  5530. if (guard && isIterateeCall(sources[0], sources[1], guard)) {
  5531. customizer = length < 3 ? undefined : customizer;
  5532. length = 1;
  5533. }
  5534. object = Object(object);
  5535. while (++index < length) {
  5536. var source = sources[index];
  5537. if (source) {
  5538. assigner(object, source, index, customizer);
  5539. }
  5540. }
  5541. return object;
  5542. });
  5543. }
  5544. /**
  5545. * Creates a `baseEach` or `baseEachRight` function.
  5546. *
  5547. * @private
  5548. * @param {Function} eachFunc The function to iterate over a collection.
  5549. * @param {boolean} [fromRight] Specify iterating from right to left.
  5550. * @returns {Function} Returns the new base function.
  5551. */
  5552. function createBaseEach(eachFunc, fromRight) {
  5553. return function(collection, iteratee) {
  5554. if (collection == null) {
  5555. return collection;
  5556. }
  5557. if (!isArrayLike(collection)) {
  5558. return eachFunc(collection, iteratee);
  5559. }
  5560. var length = collection.length,
  5561. index = fromRight ? length : -1,
  5562. iterable = Object(collection);
  5563. while ((fromRight ? index-- : ++index < length)) {
  5564. if (iteratee(iterable[index], index, iterable) === false) {
  5565. break;
  5566. }
  5567. }
  5568. return collection;
  5569. };
  5570. }
  5571. /**
  5572. * Creates a base function for methods like `_.forIn` and `_.forOwn`.
  5573. *
  5574. * @private
  5575. * @param {boolean} [fromRight] Specify iterating from right to left.
  5576. * @returns {Function} Returns the new base function.
  5577. */
  5578. function createBaseFor(fromRight) {
  5579. return function(object, iteratee, keysFunc) {
  5580. var index = -1,
  5581. iterable = Object(object),
  5582. props = keysFunc(object),
  5583. length = props.length;
  5584. while (length--) {
  5585. var key = props[fromRight ? length : ++index];
  5586. if (iteratee(iterable[key], key, iterable) === false) {
  5587. break;
  5588. }
  5589. }
  5590. return object;
  5591. };
  5592. }
  5593. /**
  5594. * Creates a function that wraps `func` to invoke it with the optional `this`
  5595. * binding of `thisArg`.
  5596. *
  5597. * @private
  5598. * @param {Function} func The function to wrap.
  5599. * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
  5600. * @param {*} [thisArg] The `this` binding of `func`.
  5601. * @returns {Function} Returns the new wrapped function.
  5602. */
  5603. function createBind(func, bitmask, thisArg) {
  5604. var isBind = bitmask & WRAP_BIND_FLAG,
  5605. Ctor = createCtor(func);
  5606. function wrapper() {
  5607. var fn = (this && this !== root && this instanceof wrapper) ? Ctor : func;
  5608. return fn.apply(isBind ? thisArg : this, arguments);
  5609. }
  5610. return wrapper;
  5611. }
  5612. /**
  5613. * Creates a function like `_.lowerFirst`.
  5614. *
  5615. * @private
  5616. * @param {string} methodName The name of the `String` case method to use.
  5617. * @returns {Function} Returns the new case function.
  5618. */
  5619. function createCaseFirst(methodName) {
  5620. return function(string) {
  5621. string = toString(string);
  5622. var strSymbols = hasUnicode(string)
  5623. ? stringToArray(string)
  5624. : undefined;
  5625. var chr = strSymbols
  5626. ? strSymbols[0]
  5627. : string.charAt(0);
  5628. var trailing = strSymbols
  5629. ? castSlice(strSymbols, 1).join('')
  5630. : string.slice(1);
  5631. return chr[methodName]() + trailing;
  5632. };
  5633. }
  5634. /**
  5635. * Creates a function like `_.camelCase`.
  5636. *
  5637. * @private
  5638. * @param {Function} callback The function to combine each word.
  5639. * @returns {Function} Returns the new compounder function.
  5640. */
  5641. function createCompounder(callback) {
  5642. return function(string) {
  5643. return arrayReduce(words(deburr(string).replace(reApos, '')), callback, '');
  5644. };
  5645. }
  5646. /**
  5647. * Creates a function that produces an instance of `Ctor` regardless of
  5648. * whether it was invoked as part of a `new` expression or by `call` or `apply`.
  5649. *
  5650. * @private
  5651. * @param {Function} Ctor The constructor to wrap.
  5652. * @returns {Function} Returns the new wrapped function.
  5653. */
  5654. function createCtor(Ctor) {
  5655. return function() {
  5656. // Use a `switch` statement to work with class constructors. See
  5657. // http://ecma-international.org/ecma-262/7.0/#sec-ecmascript-function-objects-call-thisargument-argumentslist
  5658. // for more details.
  5659. var args = arguments;
  5660. switch (args.length) {
  5661. case 0: return new Ctor;
  5662. case 1: return new Ctor(args[0]);
  5663. case 2: return new Ctor(args[0], args[1]);
  5664. case 3: return new Ctor(args[0], args[1], args[2]);
  5665. case 4: return new Ctor(args[0], args[1], args[2], args[3]);
  5666. case 5: return new Ctor(args[0], args[1], args[2], args[3], args[4]);
  5667. case 6: return new Ctor(args[0], args[1], args[2], args[3], args[4], args[5]);
  5668. case 7: return new Ctor(args[0], args[1], args[2], args[3], args[4], args[5], args[6]);
  5669. }
  5670. var thisBinding = baseCreate(Ctor.prototype),
  5671. result = Ctor.apply(thisBinding, args);
  5672. // Mimic the constructor's `return` behavior.
  5673. // See https://es5.github.io/#x13.2.2 for more details.
  5674. return isObject(result) ? result : thisBinding;
  5675. };
  5676. }
  5677. /**
  5678. * Creates a function that wraps `func` to enable currying.
  5679. *
  5680. * @private
  5681. * @param {Function} func The function to wrap.
  5682. * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
  5683. * @param {number} arity The arity of `func`.
  5684. * @returns {Function} Returns the new wrapped function.
  5685. */
  5686. function createCurry(func, bitmask, arity) {
  5687. var Ctor = createCtor(func);
  5688. function wrapper() {
  5689. var length = arguments.length,
  5690. args = Array(length),
  5691. index = length,
  5692. placeholder = getHolder(wrapper);
  5693. while (index--) {
  5694. args[index] = arguments[index];
  5695. }
  5696. var holders = (length < 3 && args[0] !== placeholder && args[length - 1] !== placeholder)
  5697. ? []
  5698. : replaceHolders(args, placeholder);
  5699. length -= holders.length;
  5700. if (length < arity) {
  5701. return createRecurry(
  5702. func, bitmask, createHybrid, wrapper.placeholder, undefined,
  5703. args, holders, undefined, undefined, arity - length);
  5704. }
  5705. var fn = (this && this !== root && this instanceof wrapper) ? Ctor : func;
  5706. return apply(fn, this, args);
  5707. }
  5708. return wrapper;
  5709. }
  5710. /**
  5711. * Creates a `_.find` or `_.findLast` function.
  5712. *
  5713. * @private
  5714. * @param {Function} findIndexFunc The function to find the collection index.
  5715. * @returns {Function} Returns the new find function.
  5716. */
  5717. function createFind(findIndexFunc) {
  5718. return function(collection, predicate, fromIndex) {
  5719. var iterable = Object(collection);
  5720. if (!isArrayLike(collection)) {
  5721. var iteratee = getIteratee(predicate, 3);
  5722. collection = keys(collection);
  5723. predicate = function(key) { return iteratee(iterable[key], key, iterable); };
  5724. }
  5725. var index = findIndexFunc(collection, predicate, fromIndex);
  5726. return index > -1 ? iterable[iteratee ? collection[index] : index] : undefined;
  5727. };
  5728. }
  5729. /**
  5730. * Creates a `_.flow` or `_.flowRight` function.
  5731. *
  5732. * @private
  5733. * @param {boolean} [fromRight] Specify iterating from right to left.
  5734. * @returns {Function} Returns the new flow function.
  5735. */
  5736. function createFlow(fromRight) {
  5737. return flatRest(function(funcs) {
  5738. var length = funcs.length,
  5739. index = length,
  5740. prereq = LodashWrapper.prototype.thru;
  5741. if (fromRight) {
  5742. funcs.reverse();
  5743. }
  5744. while (index--) {
  5745. var func = funcs[index];
  5746. if (typeof func != 'function') {
  5747. throw new TypeError(FUNC_ERROR_TEXT);
  5748. }
  5749. if (prereq && !wrapper && getFuncName(func) == 'wrapper') {
  5750. var wrapper = new LodashWrapper([], true);
  5751. }
  5752. }
  5753. index = wrapper ? index : length;
  5754. while (++index < length) {
  5755. func = funcs[index];
  5756. var funcName = getFuncName(func),
  5757. data = funcName == 'wrapper' ? getData(func) : undefined;
  5758. if (data && isLaziable(data[0]) &&
  5759. data[1] == (WRAP_ARY_FLAG | WRAP_CURRY_FLAG | WRAP_PARTIAL_FLAG | WRAP_REARG_FLAG) &&
  5760. !data[4].length && data[9] == 1
  5761. ) {
  5762. wrapper = wrapper[getFuncName(data[0])].apply(wrapper, data[3]);
  5763. } else {
  5764. wrapper = (func.length == 1 && isLaziable(func))
  5765. ? wrapper[funcName]()
  5766. : wrapper.thru(func);
  5767. }
  5768. }
  5769. return function() {
  5770. var args = arguments,
  5771. value = args[0];
  5772. if (wrapper && args.length == 1 && isArray(value)) {
  5773. return wrapper.plant(value).value();
  5774. }
  5775. var index = 0,
  5776. result = length ? funcs[index].apply(this, args) : value;
  5777. while (++index < length) {
  5778. result = funcs[index].call(this, result);
  5779. }
  5780. return result;
  5781. };
  5782. });
  5783. }
  5784. /**
  5785. * Creates a function that wraps `func` to invoke it with optional `this`
  5786. * binding of `thisArg`, partial application, and currying.
  5787. *
  5788. * @private
  5789. * @param {Function|string} func The function or method name to wrap.
  5790. * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
  5791. * @param {*} [thisArg] The `this` binding of `func`.
  5792. * @param {Array} [partials] The arguments to prepend to those provided to
  5793. * the new function.
  5794. * @param {Array} [holders] The `partials` placeholder indexes.
  5795. * @param {Array} [partialsRight] The arguments to append to those provided
  5796. * to the new function.
  5797. * @param {Array} [holdersRight] The `partialsRight` placeholder indexes.
  5798. * @param {Array} [argPos] The argument positions of the new function.
  5799. * @param {number} [ary] The arity cap of `func`.
  5800. * @param {number} [arity] The arity of `func`.
  5801. * @returns {Function} Returns the new wrapped function.
  5802. */
  5803. function createHybrid(func, bitmask, thisArg, partials, holders, partialsRight, holdersRight, argPos, ary, arity) {
  5804. var isAry = bitmask & WRAP_ARY_FLAG,
  5805. isBind = bitmask & WRAP_BIND_FLAG,
  5806. isBindKey = bitmask & WRAP_BIND_KEY_FLAG,
  5807. isCurried = bitmask & (WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG),
  5808. isFlip = bitmask & WRAP_FLIP_FLAG,
  5809. Ctor = isBindKey ? undefined : createCtor(func);
  5810. function wrapper() {
  5811. var length = arguments.length,
  5812. args = Array(length),
  5813. index = length;
  5814. while (index--) {
  5815. args[index] = arguments[index];
  5816. }
  5817. if (isCurried) {
  5818. var placeholder = getHolder(wrapper),
  5819. holdersCount = countHolders(args, placeholder);
  5820. }
  5821. if (partials) {
  5822. args = composeArgs(args, partials, holders, isCurried);
  5823. }
  5824. if (partialsRight) {
  5825. args = composeArgsRight(args, partialsRight, holdersRight, isCurried);
  5826. }
  5827. length -= holdersCount;
  5828. if (isCurried && length < arity) {
  5829. var newHolders = replaceHolders(args, placeholder);
  5830. return createRecurry(
  5831. func, bitmask, createHybrid, wrapper.placeholder, thisArg,
  5832. args, newHolders, argPos, ary, arity - length
  5833. );
  5834. }
  5835. var thisBinding = isBind ? thisArg : this,
  5836. fn = isBindKey ? thisBinding[func] : func;
  5837. length = args.length;
  5838. if (argPos) {
  5839. args = reorder(args, argPos);
  5840. } else if (isFlip && length > 1) {
  5841. args.reverse();
  5842. }
  5843. if (isAry && ary < length) {
  5844. args.length = ary;
  5845. }
  5846. if (this && this !== root && this instanceof wrapper) {
  5847. fn = Ctor || createCtor(fn);
  5848. }
  5849. return fn.apply(thisBinding, args);
  5850. }
  5851. return wrapper;
  5852. }
  5853. /**
  5854. * Creates a function like `_.invertBy`.
  5855. *
  5856. * @private
  5857. * @param {Function} setter The function to set accumulator values.
  5858. * @param {Function} toIteratee The function to resolve iteratees.
  5859. * @returns {Function} Returns the new inverter function.
  5860. */
  5861. function createInverter(setter, toIteratee) {
  5862. return function(object, iteratee) {
  5863. return baseInverter(object, setter, toIteratee(iteratee), {});
  5864. };
  5865. }
  5866. /**
  5867. * Creates a function that performs a mathematical operation on two values.
  5868. *
  5869. * @private
  5870. * @param {Function} operator The function to perform the operation.
  5871. * @param {number} [defaultValue] The value used for `undefined` arguments.
  5872. * @returns {Function} Returns the new mathematical operation function.
  5873. */
  5874. function createMathOperation(operator, defaultValue) {
  5875. return function(value, other) {
  5876. var result;
  5877. if (value === undefined && other === undefined) {
  5878. return defaultValue;
  5879. }
  5880. if (value !== undefined) {
  5881. result = value;
  5882. }
  5883. if (other !== undefined) {
  5884. if (result === undefined) {
  5885. return other;
  5886. }
  5887. if (typeof value == 'string' || typeof other == 'string') {
  5888. value = baseToString(value);
  5889. other = baseToString(other);
  5890. } else {
  5891. value = baseToNumber(value);
  5892. other = baseToNumber(other);
  5893. }
  5894. result = operator(value, other);
  5895. }
  5896. return result;
  5897. };
  5898. }
  5899. /**
  5900. * Creates a function like `_.over`.
  5901. *
  5902. * @private
  5903. * @param {Function} arrayFunc The function to iterate over iteratees.
  5904. * @returns {Function} Returns the new over function.
  5905. */
  5906. function createOver(arrayFunc) {
  5907. return flatRest(function(iteratees) {
  5908. iteratees = arrayMap(iteratees, baseUnary(getIteratee()));
  5909. return baseRest(function(args) {
  5910. var thisArg = this;
  5911. return arrayFunc(iteratees, function(iteratee) {
  5912. return apply(iteratee, thisArg, args);
  5913. });
  5914. });
  5915. });
  5916. }
  5917. /**
  5918. * Creates the padding for `string` based on `length`. The `chars` string
  5919. * is truncated if the number of characters exceeds `length`.
  5920. *
  5921. * @private
  5922. * @param {number} length The padding length.
  5923. * @param {string} [chars=' '] The string used as padding.
  5924. * @returns {string} Returns the padding for `string`.
  5925. */
  5926. function createPadding(length, chars) {
  5927. chars = chars === undefined ? ' ' : baseToString(chars);
  5928. var charsLength = chars.length;
  5929. if (charsLength < 2) {
  5930. return charsLength ? baseRepeat(chars, length) : chars;
  5931. }
  5932. var result = baseRepeat(chars, nativeCeil(length / stringSize(chars)));
  5933. return hasUnicode(chars)
  5934. ? castSlice(stringToArray(result), 0, length).join('')
  5935. : result.slice(0, length);
  5936. }
  5937. /**
  5938. * Creates a function that wraps `func` to invoke it with the `this` binding
  5939. * of `thisArg` and `partials` prepended to the arguments it receives.
  5940. *
  5941. * @private
  5942. * @param {Function} func The function to wrap.
  5943. * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
  5944. * @param {*} thisArg The `this` binding of `func`.
  5945. * @param {Array} partials The arguments to prepend to those provided to
  5946. * the new function.
  5947. * @returns {Function} Returns the new wrapped function.
  5948. */
  5949. function createPartial(func, bitmask, thisArg, partials) {
  5950. var isBind = bitmask & WRAP_BIND_FLAG,
  5951. Ctor = createCtor(func);
  5952. function wrapper() {
  5953. var argsIndex = -1,
  5954. argsLength = arguments.length,
  5955. leftIndex = -1,
  5956. leftLength = partials.length,
  5957. args = Array(leftLength + argsLength),
  5958. fn = (this && this !== root && this instanceof wrapper) ? Ctor : func;
  5959. while (++leftIndex < leftLength) {
  5960. args[leftIndex] = partials[leftIndex];
  5961. }
  5962. while (argsLength--) {
  5963. args[leftIndex++] = arguments[++argsIndex];
  5964. }
  5965. return apply(fn, isBind ? thisArg : this, args);
  5966. }
  5967. return wrapper;
  5968. }
  5969. /**
  5970. * Creates a `_.range` or `_.rangeRight` function.
  5971. *
  5972. * @private
  5973. * @param {boolean} [fromRight] Specify iterating from right to left.
  5974. * @returns {Function} Returns the new range function.
  5975. */
  5976. function createRange(fromRight) {
  5977. return function(start, end, step) {
  5978. if (step && typeof step != 'number' && isIterateeCall(start, end, step)) {
  5979. end = step = undefined;
  5980. }
  5981. // Ensure the sign of `-0` is preserved.
  5982. start = toFinite(start);
  5983. if (end === undefined) {
  5984. end = start;
  5985. start = 0;
  5986. } else {
  5987. end = toFinite(end);
  5988. }
  5989. step = step === undefined ? (start < end ? 1 : -1) : toFinite(step);
  5990. return baseRange(start, end, step, fromRight);
  5991. };
  5992. }
  5993. /**
  5994. * Creates a function that performs a relational operation on two values.
  5995. *
  5996. * @private
  5997. * @param {Function} operator The function to perform the operation.
  5998. * @returns {Function} Returns the new relational operation function.
  5999. */
  6000. function createRelationalOperation(operator) {
  6001. return function(value, other) {
  6002. if (!(typeof value == 'string' && typeof other == 'string')) {
  6003. value = toNumber(value);
  6004. other = toNumber(other);
  6005. }
  6006. return operator(value, other);
  6007. };
  6008. }
  6009. /**
  6010. * Creates a function that wraps `func` to continue currying.
  6011. *
  6012. * @private
  6013. * @param {Function} func The function to wrap.
  6014. * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
  6015. * @param {Function} wrapFunc The function to create the `func` wrapper.
  6016. * @param {*} placeholder The placeholder value.
  6017. * @param {*} [thisArg] The `this` binding of `func`.
  6018. * @param {Array} [partials] The arguments to prepend to those provided to
  6019. * the new function.
  6020. * @param {Array} [holders] The `partials` placeholder indexes.
  6021. * @param {Array} [argPos] The argument positions of the new function.
  6022. * @param {number} [ary] The arity cap of `func`.
  6023. * @param {number} [arity] The arity of `func`.
  6024. * @returns {Function} Returns the new wrapped function.
  6025. */
  6026. function createRecurry(func, bitmask, wrapFunc, placeholder, thisArg, partials, holders, argPos, ary, arity) {
  6027. var isCurry = bitmask & WRAP_CURRY_FLAG,
  6028. newHolders = isCurry ? holders : undefined,
  6029. newHoldersRight = isCurry ? undefined : holders,
  6030. newPartials = isCurry ? partials : undefined,
  6031. newPartialsRight = isCurry ? undefined : partials;
  6032. bitmask |= (isCurry ? WRAP_PARTIAL_FLAG : WRAP_PARTIAL_RIGHT_FLAG);
  6033. bitmask &= ~(isCurry ? WRAP_PARTIAL_RIGHT_FLAG : WRAP_PARTIAL_FLAG);
  6034. if (!(bitmask & WRAP_CURRY_BOUND_FLAG)) {
  6035. bitmask &= ~(WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG);
  6036. }
  6037. var newData = [
  6038. func, bitmask, thisArg, newPartials, newHolders, newPartialsRight,
  6039. newHoldersRight, argPos, ary, arity
  6040. ];
  6041. var result = wrapFunc.apply(undefined, newData);
  6042. if (isLaziable(func)) {
  6043. setData(result, newData);
  6044. }
  6045. result.placeholder = placeholder;
  6046. return setWrapToString(result, func, bitmask);
  6047. }
  6048. /**
  6049. * Creates a function like `_.round`.
  6050. *
  6051. * @private
  6052. * @param {string} methodName The name of the `Math` method to use when rounding.
  6053. * @returns {Function} Returns the new round function.
  6054. */
  6055. function createRound(methodName) {
  6056. var func = Math[methodName];
  6057. return function(number, precision) {
  6058. number = toNumber(number);
  6059. precision = precision == null ? 0 : nativeMin(toInteger(precision), 292);
  6060. if (precision && nativeIsFinite(number)) {
  6061. // Shift with exponential notation to avoid floating-point issues.
  6062. // See [MDN](https://mdn.io/round#Examples) for more details.
  6063. var pair = (toString(number) + 'e').split('e'),
  6064. value = func(pair[0] + 'e' + (+pair[1] + precision));
  6065. pair = (toString(value) + 'e').split('e');
  6066. return +(pair[0] + 'e' + (+pair[1] - precision));
  6067. }
  6068. return func(number);
  6069. };
  6070. }
  6071. /**
  6072. * Creates a set object of `values`.
  6073. *
  6074. * @private
  6075. * @param {Array} values The values to add to the set.
  6076. * @returns {Object} Returns the new set.
  6077. */
  6078. var createSet = !(Set && (1 / setToArray(new Set([,-0]))[1]) == INFINITY) ? noop : function(values) {
  6079. return new Set(values);
  6080. };
  6081. /**
  6082. * Creates a `_.toPairs` or `_.toPairsIn` function.
  6083. *
  6084. * @private
  6085. * @param {Function} keysFunc The function to get the keys of a given object.
  6086. * @returns {Function} Returns the new pairs function.
  6087. */
  6088. function createToPairs(keysFunc) {
  6089. return function(object) {
  6090. var tag = getTag(object);
  6091. if (tag == mapTag) {
  6092. return mapToArray(object);
  6093. }
  6094. if (tag == setTag) {
  6095. return setToPairs(object);
  6096. }
  6097. return baseToPairs(object, keysFunc(object));
  6098. };
  6099. }
  6100. /**
  6101. * Creates a function that either curries or invokes `func` with optional
  6102. * `this` binding and partially applied arguments.
  6103. *
  6104. * @private
  6105. * @param {Function|string} func The function or method name to wrap.
  6106. * @param {number} bitmask The bitmask flags.
  6107. * 1 - `_.bind`
  6108. * 2 - `_.bindKey`
  6109. * 4 - `_.curry` or `_.curryRight` of a bound function
  6110. * 8 - `_.curry`
  6111. * 16 - `_.curryRight`
  6112. * 32 - `_.partial`
  6113. * 64 - `_.partialRight`
  6114. * 128 - `_.rearg`
  6115. * 256 - `_.ary`
  6116. * 512 - `_.flip`
  6117. * @param {*} [thisArg] The `this` binding of `func`.
  6118. * @param {Array} [partials] The arguments to be partially applied.
  6119. * @param {Array} [holders] The `partials` placeholder indexes.
  6120. * @param {Array} [argPos] The argument positions of the new function.
  6121. * @param {number} [ary] The arity cap of `func`.
  6122. * @param {number} [arity] The arity of `func`.
  6123. * @returns {Function} Returns the new wrapped function.
  6124. */
  6125. function createWrap(func, bitmask, thisArg, partials, holders, argPos, ary, arity) {
  6126. var isBindKey = bitmask & WRAP_BIND_KEY_FLAG;
  6127. if (!isBindKey && typeof func != 'function') {
  6128. throw new TypeError(FUNC_ERROR_TEXT);
  6129. }
  6130. var length = partials ? partials.length : 0;
  6131. if (!length) {
  6132. bitmask &= ~(WRAP_PARTIAL_FLAG | WRAP_PARTIAL_RIGHT_FLAG);
  6133. partials = holders = undefined;
  6134. }
  6135. ary = ary === undefined ? ary : nativeMax(toInteger(ary), 0);
  6136. arity = arity === undefined ? arity : toInteger(arity);
  6137. length -= holders ? holders.length : 0;
  6138. if (bitmask & WRAP_PARTIAL_RIGHT_FLAG) {
  6139. var partialsRight = partials,
  6140. holdersRight = holders;
  6141. partials = holders = undefined;
  6142. }
  6143. var data = isBindKey ? undefined : getData(func);
  6144. var newData = [
  6145. func, bitmask, thisArg, partials, holders, partialsRight, holdersRight,
  6146. argPos, ary, arity
  6147. ];
  6148. if (data) {
  6149. mergeData(newData, data);
  6150. }
  6151. func = newData[0];
  6152. bitmask = newData[1];
  6153. thisArg = newData[2];
  6154. partials = newData[3];
  6155. holders = newData[4];
  6156. arity = newData[9] = newData[9] === undefined
  6157. ? (isBindKey ? 0 : func.length)
  6158. : nativeMax(newData[9] - length, 0);
  6159. if (!arity && bitmask & (WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG)) {
  6160. bitmask &= ~(WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG);
  6161. }
  6162. if (!bitmask || bitmask == WRAP_BIND_FLAG) {
  6163. var result = createBind(func, bitmask, thisArg);
  6164. } else if (bitmask == WRAP_CURRY_FLAG || bitmask == WRAP_CURRY_RIGHT_FLAG) {
  6165. result = createCurry(func, bitmask, arity);
  6166. } else if ((bitmask == WRAP_PARTIAL_FLAG || bitmask == (WRAP_BIND_FLAG | WRAP_PARTIAL_FLAG)) && !holders.length) {
  6167. result = createPartial(func, bitmask, thisArg, partials);
  6168. } else {
  6169. result = createHybrid.apply(undefined, newData);
  6170. }
  6171. var setter = data ? baseSetData : setData;
  6172. return setWrapToString(setter(result, newData), func, bitmask);
  6173. }
  6174. /**
  6175. * Used by `_.defaults` to customize its `_.assignIn` use to assign properties
  6176. * of source objects to the destination object for all destination properties
  6177. * that resolve to `undefined`.
  6178. *
  6179. * @private
  6180. * @param {*} objValue The destination value.
  6181. * @param {*} srcValue The source value.
  6182. * @param {string} key The key of the property to assign.
  6183. * @param {Object} object The parent object of `objValue`.
  6184. * @returns {*} Returns the value to assign.
  6185. */
  6186. function customDefaultsAssignIn(objValue, srcValue, key, object) {
  6187. if (objValue === undefined ||
  6188. (eq(objValue, objectProto[key]) && !hasOwnProperty.call(object, key))) {
  6189. return srcValue;
  6190. }
  6191. return objValue;
  6192. }
  6193. /**
  6194. * Used by `_.defaultsDeep` to customize its `_.merge` use to merge source
  6195. * objects into destination objects that are passed thru.
  6196. *
  6197. * @private
  6198. * @param {*} objValue The destination value.
  6199. * @param {*} srcValue The source value.
  6200. * @param {string} key The key of the property to merge.
  6201. * @param {Object} object The parent object of `objValue`.
  6202. * @param {Object} source The parent object of `srcValue`.
  6203. * @param {Object} [stack] Tracks traversed source values and their merged
  6204. * counterparts.
  6205. * @returns {*} Returns the value to assign.
  6206. */
  6207. function customDefaultsMerge(objValue, srcValue, key, object, source, stack) {
  6208. if (isObject(objValue) && isObject(srcValue)) {
  6209. // Recursively merge objects and arrays (susceptible to call stack limits).
  6210. stack.set(srcValue, objValue);
  6211. baseMerge(objValue, srcValue, undefined, customDefaultsMerge, stack);
  6212. stack['delete'](srcValue);
  6213. }
  6214. return objValue;
  6215. }
  6216. /**
  6217. * Used by `_.omit` to customize its `_.cloneDeep` use to only clone plain
  6218. * objects.
  6219. *
  6220. * @private
  6221. * @param {*} value The value to inspect.
  6222. * @param {string} key The key of the property to inspect.
  6223. * @returns {*} Returns the uncloned value or `undefined` to defer cloning to `_.cloneDeep`.
  6224. */
  6225. function customOmitClone(value) {
  6226. return isPlainObject(value) ? undefined : value;
  6227. }
  6228. /**
  6229. * A specialized version of `baseIsEqualDeep` for arrays with support for
  6230. * partial deep comparisons.
  6231. *
  6232. * @private
  6233. * @param {Array} array The array to compare.
  6234. * @param {Array} other The other array to compare.
  6235. * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
  6236. * @param {Function} customizer The function to customize comparisons.
  6237. * @param {Function} equalFunc The function to determine equivalents of values.
  6238. * @param {Object} stack Tracks traversed `array` and `other` objects.
  6239. * @returns {boolean} Returns `true` if the arrays are equivalent, else `false`.
  6240. */
  6241. function equalArrays(array, other, bitmask, customizer, equalFunc, stack) {
  6242. var isPartial = bitmask & COMPARE_PARTIAL_FLAG,
  6243. arrLength = array.length,
  6244. othLength = other.length;
  6245. if (arrLength != othLength && !(isPartial && othLength > arrLength)) {
  6246. return false;
  6247. }
  6248. // Check that cyclic values are equal.
  6249. var arrStacked = stack.get(array);
  6250. var othStacked = stack.get(other);
  6251. if (arrStacked && othStacked) {
  6252. return arrStacked == other && othStacked == array;
  6253. }
  6254. var index = -1,
  6255. result = true,
  6256. seen = (bitmask & COMPARE_UNORDERED_FLAG) ? new SetCache : undefined;
  6257. stack.set(array, other);
  6258. stack.set(other, array);
  6259. // Ignore non-index properties.
  6260. while (++index < arrLength) {
  6261. var arrValue = array[index],
  6262. othValue = other[index];
  6263. if (customizer) {
  6264. var compared = isPartial
  6265. ? customizer(othValue, arrValue, index, other, array, stack)
  6266. : customizer(arrValue, othValue, index, array, other, stack);
  6267. }
  6268. if (compared !== undefined) {
  6269. if (compared) {
  6270. continue;
  6271. }
  6272. result = false;
  6273. break;
  6274. }
  6275. // Recursively compare arrays (susceptible to call stack limits).
  6276. if (seen) {
  6277. if (!arraySome(other, function(othValue, othIndex) {
  6278. if (!cacheHas(seen, othIndex) &&
  6279. (arrValue === othValue || equalFunc(arrValue, othValue, bitmask, customizer, stack))) {
  6280. return seen.push(othIndex);
  6281. }
  6282. })) {
  6283. result = false;
  6284. break;
  6285. }
  6286. } else if (!(
  6287. arrValue === othValue ||
  6288. equalFunc(arrValue, othValue, bitmask, customizer, stack)
  6289. )) {
  6290. result = false;
  6291. break;
  6292. }
  6293. }
  6294. stack['delete'](array);
  6295. stack['delete'](other);
  6296. return result;
  6297. }
  6298. /**
  6299. * A specialized version of `baseIsEqualDeep` for comparing objects of
  6300. * the same `toStringTag`.
  6301. *
  6302. * **Note:** This function only supports comparing values with tags of
  6303. * `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`.
  6304. *
  6305. * @private
  6306. * @param {Object} object The object to compare.
  6307. * @param {Object} other The other object to compare.
  6308. * @param {string} tag The `toStringTag` of the objects to compare.
  6309. * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
  6310. * @param {Function} customizer The function to customize comparisons.
  6311. * @param {Function} equalFunc The function to determine equivalents of values.
  6312. * @param {Object} stack Tracks traversed `object` and `other` objects.
  6313. * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
  6314. */
  6315. function equalByTag(object, other, tag, bitmask, customizer, equalFunc, stack) {
  6316. switch (tag) {
  6317. case dataViewTag:
  6318. if ((object.byteLength != other.byteLength) ||
  6319. (object.byteOffset != other.byteOffset)) {
  6320. return false;
  6321. }
  6322. object = object.buffer;
  6323. other = other.buffer;
  6324. case arrayBufferTag:
  6325. if ((object.byteLength != other.byteLength) ||
  6326. !equalFunc(new Uint8Array(object), new Uint8Array(other))) {
  6327. return false;
  6328. }
  6329. return true;
  6330. case boolTag:
  6331. case dateTag:
  6332. case numberTag:
  6333. // Coerce booleans to `1` or `0` and dates to milliseconds.
  6334. // Invalid dates are coerced to `NaN`.
  6335. return eq(+object, +other);
  6336. case errorTag:
  6337. return object.name == other.name && object.message == other.message;
  6338. case regexpTag:
  6339. case stringTag:
  6340. // Coerce regexes to strings and treat strings, primitives and objects,
  6341. // as equal. See http://www.ecma-international.org/ecma-262/7.0/#sec-regexp.prototype.tostring
  6342. // for more details.
  6343. return object == (other + '');
  6344. case mapTag:
  6345. var convert = mapToArray;
  6346. case setTag:
  6347. var isPartial = bitmask & COMPARE_PARTIAL_FLAG;
  6348. convert || (convert = setToArray);
  6349. if (object.size != other.size && !isPartial) {
  6350. return false;
  6351. }
  6352. // Assume cyclic values are equal.
  6353. var stacked = stack.get(object);
  6354. if (stacked) {
  6355. return stacked == other;
  6356. }
  6357. bitmask |= COMPARE_UNORDERED_FLAG;
  6358. // Recursively compare objects (susceptible to call stack limits).
  6359. stack.set(object, other);
  6360. var result = equalArrays(convert(object), convert(other), bitmask, customizer, equalFunc, stack);
  6361. stack['delete'](object);
  6362. return result;
  6363. case symbolTag:
  6364. if (symbolValueOf) {
  6365. return symbolValueOf.call(object) == symbolValueOf.call(other);
  6366. }
  6367. }
  6368. return false;
  6369. }
  6370. /**
  6371. * A specialized version of `baseIsEqualDeep` for objects with support for
  6372. * partial deep comparisons.
  6373. *
  6374. * @private
  6375. * @param {Object} object The object to compare.
  6376. * @param {Object} other The other object to compare.
  6377. * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
  6378. * @param {Function} customizer The function to customize comparisons.
  6379. * @param {Function} equalFunc The function to determine equivalents of values.
  6380. * @param {Object} stack Tracks traversed `object` and `other` objects.
  6381. * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
  6382. */
  6383. function equalObjects(object, other, bitmask, customizer, equalFunc, stack) {
  6384. var isPartial = bitmask & COMPARE_PARTIAL_FLAG,
  6385. objProps = getAllKeys(object),
  6386. objLength = objProps.length,
  6387. othProps = getAllKeys(other),
  6388. othLength = othProps.length;
  6389. if (objLength != othLength && !isPartial) {
  6390. return false;
  6391. }
  6392. var index = objLength;
  6393. while (index--) {
  6394. var key = objProps[index];
  6395. if (!(isPartial ? key in other : hasOwnProperty.call(other, key))) {
  6396. return false;
  6397. }
  6398. }
  6399. // Check that cyclic values are equal.
  6400. var objStacked = stack.get(object);
  6401. var othStacked = stack.get(other);
  6402. if (objStacked && othStacked) {
  6403. return objStacked == other && othStacked == object;
  6404. }
  6405. var result = true;
  6406. stack.set(object, other);
  6407. stack.set(other, object);
  6408. var skipCtor = isPartial;
  6409. while (++index < objLength) {
  6410. key = objProps[index];
  6411. var objValue = object[key],
  6412. othValue = other[key];
  6413. if (customizer) {
  6414. var compared = isPartial
  6415. ? customizer(othValue, objValue, key, other, object, stack)
  6416. : customizer(objValue, othValue, key, object, other, stack);
  6417. }
  6418. // Recursively compare objects (susceptible to call stack limits).
  6419. if (!(compared === undefined
  6420. ? (objValue === othValue || equalFunc(objValue, othValue, bitmask, customizer, stack))
  6421. : compared
  6422. )) {
  6423. result = false;
  6424. break;
  6425. }
  6426. skipCtor || (skipCtor = key == 'constructor');
  6427. }
  6428. if (result && !skipCtor) {
  6429. var objCtor = object.constructor,
  6430. othCtor = other.constructor;
  6431. // Non `Object` object instances with different constructors are not equal.
  6432. if (objCtor != othCtor &&
  6433. ('constructor' in object && 'constructor' in other) &&
  6434. !(typeof objCtor == 'function' && objCtor instanceof objCtor &&
  6435. typeof othCtor == 'function' && othCtor instanceof othCtor)) {
  6436. result = false;
  6437. }
  6438. }
  6439. stack['delete'](object);
  6440. stack['delete'](other);
  6441. return result;
  6442. }
  6443. /**
  6444. * A specialized version of `baseRest` which flattens the rest array.
  6445. *
  6446. * @private
  6447. * @param {Function} func The function to apply a rest parameter to.
  6448. * @returns {Function} Returns the new function.
  6449. */
  6450. function flatRest(func) {
  6451. return setToString(overRest(func, undefined, flatten), func + '');
  6452. }
  6453. /**
  6454. * Creates an array of own enumerable property names and symbols of `object`.
  6455. *
  6456. * @private
  6457. * @param {Object} object The object to query.
  6458. * @returns {Array} Returns the array of property names and symbols.
  6459. */
  6460. function getAllKeys(object) {
  6461. return baseGetAllKeys(object, keys, getSymbols);
  6462. }
  6463. /**
  6464. * Creates an array of own and inherited enumerable property names and
  6465. * symbols of `object`.
  6466. *
  6467. * @private
  6468. * @param {Object} object The object to query.
  6469. * @returns {Array} Returns the array of property names and symbols.
  6470. */
  6471. function getAllKeysIn(object) {
  6472. return baseGetAllKeys(object, keysIn, getSymbolsIn);
  6473. }
  6474. /**
  6475. * Gets metadata for `func`.
  6476. *
  6477. * @private
  6478. * @param {Function} func The function to query.
  6479. * @returns {*} Returns the metadata for `func`.
  6480. */
  6481. var getData = !metaMap ? noop : function(func) {
  6482. return metaMap.get(func);
  6483. };
  6484. /**
  6485. * Gets the name of `func`.
  6486. *
  6487. * @private
  6488. * @param {Function} func The function to query.
  6489. * @returns {string} Returns the function name.
  6490. */
  6491. function getFuncName(func) {
  6492. var result = (func.name + ''),
  6493. array = realNames[result],
  6494. length = hasOwnProperty.call(realNames, result) ? array.length : 0;
  6495. while (length--) {
  6496. var data = array[length],
  6497. otherFunc = data.func;
  6498. if (otherFunc == null || otherFunc == func) {
  6499. return data.name;
  6500. }
  6501. }
  6502. return result;
  6503. }
  6504. /**
  6505. * Gets the argument placeholder value for `func`.
  6506. *
  6507. * @private
  6508. * @param {Function} func The function to inspect.
  6509. * @returns {*} Returns the placeholder value.
  6510. */
  6511. function getHolder(func) {
  6512. var object = hasOwnProperty.call(lodash, 'placeholder') ? lodash : func;
  6513. return object.placeholder;
  6514. }
  6515. /**
  6516. * Gets the appropriate "iteratee" function. If `_.iteratee` is customized,
  6517. * this function returns the custom method, otherwise it returns `baseIteratee`.
  6518. * If arguments are provided, the chosen function is invoked with them and
  6519. * its result is returned.
  6520. *
  6521. * @private
  6522. * @param {*} [value] The value to convert to an iteratee.
  6523. * @param {number} [arity] The arity of the created iteratee.
  6524. * @returns {Function} Returns the chosen function or its result.
  6525. */
  6526. function getIteratee() {
  6527. var result = lodash.iteratee || iteratee;
  6528. result = result === iteratee ? baseIteratee : result;
  6529. return arguments.length ? result(arguments[0], arguments[1]) : result;
  6530. }
  6531. /**
  6532. * Gets the data for `map`.
  6533. *
  6534. * @private
  6535. * @param {Object} map The map to query.
  6536. * @param {string} key The reference key.
  6537. * @returns {*} Returns the map data.
  6538. */
  6539. function getMapData(map, key) {
  6540. var data = map.__data__;
  6541. return isKeyable(key)
  6542. ? data[typeof key == 'string' ? 'string' : 'hash']
  6543. : data.map;
  6544. }
  6545. /**
  6546. * Gets the property names, values, and compare flags of `object`.
  6547. *
  6548. * @private
  6549. * @param {Object} object The object to query.
  6550. * @returns {Array} Returns the match data of `object`.
  6551. */
  6552. function getMatchData(object) {
  6553. var result = keys(object),
  6554. length = result.length;
  6555. while (length--) {
  6556. var key = result[length],
  6557. value = object[key];
  6558. result[length] = [key, value, isStrictComparable(value)];
  6559. }
  6560. return result;
  6561. }
  6562. /**
  6563. * Gets the native function at `key` of `object`.
  6564. *
  6565. * @private
  6566. * @param {Object} object The object to query.
  6567. * @param {string} key The key of the method to get.
  6568. * @returns {*} Returns the function if it's native, else `undefined`.
  6569. */
  6570. function getNative(object, key) {
  6571. var value = getValue(object, key);
  6572. return baseIsNative(value) ? value : undefined;
  6573. }
  6574. /**
  6575. * A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values.
  6576. *
  6577. * @private
  6578. * @param {*} value The value to query.
  6579. * @returns {string} Returns the raw `toStringTag`.
  6580. */
  6581. function getRawTag(value) {
  6582. var isOwn = hasOwnProperty.call(value, symToStringTag),
  6583. tag = value[symToStringTag];
  6584. try {
  6585. value[symToStringTag] = undefined;
  6586. var unmasked = true;
  6587. } catch (e) {}
  6588. var result = nativeObjectToString.call(value);
  6589. if (unmasked) {
  6590. if (isOwn) {
  6591. value[symToStringTag] = tag;
  6592. } else {
  6593. delete value[symToStringTag];
  6594. }
  6595. }
  6596. return result;
  6597. }
  6598. /**
  6599. * Creates an array of the own enumerable symbols of `object`.
  6600. *
  6601. * @private
  6602. * @param {Object} object The object to query.
  6603. * @returns {Array} Returns the array of symbols.
  6604. */
  6605. var getSymbols = !nativeGetSymbols ? stubArray : function(object) {
  6606. if (object == null) {
  6607. return [];
  6608. }
  6609. object = Object(object);
  6610. return arrayFilter(nativeGetSymbols(object), function(symbol) {
  6611. return propertyIsEnumerable.call(object, symbol);
  6612. });
  6613. };
  6614. /**
  6615. * Creates an array of the own and inherited enumerable symbols of `object`.
  6616. *
  6617. * @private
  6618. * @param {Object} object The object to query.
  6619. * @returns {Array} Returns the array of symbols.
  6620. */
  6621. var getSymbolsIn = !nativeGetSymbols ? stubArray : function(object) {
  6622. var result = [];
  6623. while (object) {
  6624. arrayPush(result, getSymbols(object));
  6625. object = getPrototype(object);
  6626. }
  6627. return result;
  6628. };
  6629. /**
  6630. * Gets the `toStringTag` of `value`.
  6631. *
  6632. * @private
  6633. * @param {*} value The value to query.
  6634. * @returns {string} Returns the `toStringTag`.
  6635. */
  6636. var getTag = baseGetTag;
  6637. // Fallback for data views, maps, sets, and weak maps in IE 11 and promises in Node.js < 6.
  6638. if ((DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag) ||
  6639. (Map && getTag(new Map) != mapTag) ||
  6640. (Promise && getTag(Promise.resolve()) != promiseTag) ||
  6641. (Set && getTag(new Set) != setTag) ||
  6642. (WeakMap && getTag(new WeakMap) != weakMapTag)) {
  6643. getTag = function(value) {
  6644. var result = baseGetTag(value),
  6645. Ctor = result == objectTag ? value.constructor : undefined,
  6646. ctorString = Ctor ? toSource(Ctor) : '';
  6647. if (ctorString) {
  6648. switch (ctorString) {
  6649. case dataViewCtorString: return dataViewTag;
  6650. case mapCtorString: return mapTag;
  6651. case promiseCtorString: return promiseTag;
  6652. case setCtorString: return setTag;
  6653. case weakMapCtorString: return weakMapTag;
  6654. }
  6655. }
  6656. return result;
  6657. };
  6658. }
  6659. /**
  6660. * Gets the view, applying any `transforms` to the `start` and `end` positions.
  6661. *
  6662. * @private
  6663. * @param {number} start The start of the view.
  6664. * @param {number} end The end of the view.
  6665. * @param {Array} transforms The transformations to apply to the view.
  6666. * @returns {Object} Returns an object containing the `start` and `end`
  6667. * positions of the view.
  6668. */
  6669. function getView(start, end, transforms) {
  6670. var index = -1,
  6671. length = transforms.length;
  6672. while (++index < length) {
  6673. var data = transforms[index],
  6674. size = data.size;
  6675. switch (data.type) {
  6676. case 'drop': start += size; break;
  6677. case 'dropRight': end -= size; break;
  6678. case 'take': end = nativeMin(end, start + size); break;
  6679. case 'takeRight': start = nativeMax(start, end - size); break;
  6680. }
  6681. }
  6682. return { 'start': start, 'end': end };
  6683. }
  6684. /**
  6685. * Extracts wrapper details from the `source` body comment.
  6686. *
  6687. * @private
  6688. * @param {string} source The source to inspect.
  6689. * @returns {Array} Returns the wrapper details.
  6690. */
  6691. function getWrapDetails(source) {
  6692. var match = source.match(reWrapDetails);
  6693. return match ? match[1].split(reSplitDetails) : [];
  6694. }
  6695. /**
  6696. * Checks if `path` exists on `object`.
  6697. *
  6698. * @private
  6699. * @param {Object} object The object to query.
  6700. * @param {Array|string} path The path to check.
  6701. * @param {Function} hasFunc The function to check properties.
  6702. * @returns {boolean} Returns `true` if `path` exists, else `false`.
  6703. */
  6704. function hasPath(object, path, hasFunc) {
  6705. path = castPath(path, object);
  6706. var index = -1,
  6707. length = path.length,
  6708. result = false;
  6709. while (++index < length) {
  6710. var key = toKey(path[index]);
  6711. if (!(result = object != null && hasFunc(object, key))) {
  6712. break;
  6713. }
  6714. object = object[key];
  6715. }
  6716. if (result || ++index != length) {
  6717. return result;
  6718. }
  6719. length = object == null ? 0 : object.length;
  6720. return !!length && isLength(length) && isIndex(key, length) &&
  6721. (isArray(object) || isArguments(object));
  6722. }
  6723. /**
  6724. * Initializes an array clone.
  6725. *
  6726. * @private
  6727. * @param {Array} array The array to clone.
  6728. * @returns {Array} Returns the initialized clone.
  6729. */
  6730. function initCloneArray(array) {
  6731. var length = array.length,
  6732. result = new array.constructor(length);
  6733. // Add properties assigned by `RegExp#exec`.
  6734. if (length && typeof array[0] == 'string' && hasOwnProperty.call(array, 'index')) {
  6735. result.index = array.index;
  6736. result.input = array.input;
  6737. }
  6738. return result;
  6739. }
  6740. /**
  6741. * Initializes an object clone.
  6742. *
  6743. * @private
  6744. * @param {Object} object The object to clone.
  6745. * @returns {Object} Returns the initialized clone.
  6746. */
  6747. function initCloneObject(object) {
  6748. return (typeof object.constructor == 'function' && !isPrototype(object))
  6749. ? baseCreate(getPrototype(object))
  6750. : {};
  6751. }
  6752. /**
  6753. * Initializes an object clone based on its `toStringTag`.
  6754. *
  6755. * **Note:** This function only supports cloning values with tags of
  6756. * `Boolean`, `Date`, `Error`, `Map`, `Number`, `RegExp`, `Set`, or `String`.
  6757. *
  6758. * @private
  6759. * @param {Object} object The object to clone.
  6760. * @param {string} tag The `toStringTag` of the object to clone.
  6761. * @param {boolean} [isDeep] Specify a deep clone.
  6762. * @returns {Object} Returns the initialized clone.
  6763. */
  6764. function initCloneByTag(object, tag, isDeep) {
  6765. var Ctor = object.constructor;
  6766. switch (tag) {
  6767. case arrayBufferTag:
  6768. return cloneArrayBuffer(object);
  6769. case boolTag:
  6770. case dateTag:
  6771. return new Ctor(+object);
  6772. case dataViewTag:
  6773. return cloneDataView(object, isDeep);
  6774. case float32Tag: case float64Tag:
  6775. case int8Tag: case int16Tag: case int32Tag:
  6776. case uint8Tag: case uint8ClampedTag: case uint16Tag: case uint32Tag:
  6777. return cloneTypedArray(object, isDeep);
  6778. case mapTag:
  6779. return new Ctor;
  6780. case numberTag:
  6781. case stringTag:
  6782. return new Ctor(object);
  6783. case regexpTag:
  6784. return cloneRegExp(object);
  6785. case setTag:
  6786. return new Ctor;
  6787. case symbolTag:
  6788. return cloneSymbol(object);
  6789. }
  6790. }
  6791. /**
  6792. * Inserts wrapper `details` in a comment at the top of the `source` body.
  6793. *
  6794. * @private
  6795. * @param {string} source The source to modify.
  6796. * @returns {Array} details The details to insert.
  6797. * @returns {string} Returns the modified source.
  6798. */
  6799. function insertWrapDetails(source, details) {
  6800. var length = details.length;
  6801. if (!length) {
  6802. return source;
  6803. }
  6804. var lastIndex = length - 1;
  6805. details[lastIndex] = (length > 1 ? '& ' : '') + details[lastIndex];
  6806. details = details.join(length > 2 ? ', ' : ' ');
  6807. return source.replace(reWrapComment, '{\n/* [wrapped with ' + details + '] */\n');
  6808. }
  6809. /**
  6810. * Checks if `value` is a flattenable `arguments` object or array.
  6811. *
  6812. * @private
  6813. * @param {*} value The value to check.
  6814. * @returns {boolean} Returns `true` if `value` is flattenable, else `false`.
  6815. */
  6816. function isFlattenable(value) {
  6817. return isArray(value) || isArguments(value) ||
  6818. !!(spreadableSymbol && value && value[spreadableSymbol]);
  6819. }
  6820. /**
  6821. * Checks if `value` is a valid array-like index.
  6822. *
  6823. * @private
  6824. * @param {*} value The value to check.
  6825. * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.
  6826. * @returns {boolean} Returns `true` if `value` is a valid index, else `false`.
  6827. */
  6828. function isIndex(value, length) {
  6829. var type = typeof value;
  6830. length = length == null ? MAX_SAFE_INTEGER : length;
  6831. return !!length &&
  6832. (type == 'number' ||
  6833. (type != 'symbol' && reIsUint.test(value))) &&
  6834. (value > -1 && value % 1 == 0 && value < length);
  6835. }
  6836. /**
  6837. * Checks if the given arguments are from an iteratee call.
  6838. *
  6839. * @private
  6840. * @param {*} value The potential iteratee value argument.
  6841. * @param {*} index The potential iteratee index or key argument.
  6842. * @param {*} object The potential iteratee object argument.
  6843. * @returns {boolean} Returns `true` if the arguments are from an iteratee call,
  6844. * else `false`.
  6845. */
  6846. function isIterateeCall(value, index, object) {
  6847. if (!isObject(object)) {
  6848. return false;
  6849. }
  6850. var type = typeof index;
  6851. if (type == 'number'
  6852. ? (isArrayLike(object) && isIndex(index, object.length))
  6853. : (type == 'string' && index in object)
  6854. ) {
  6855. return eq(object[index], value);
  6856. }
  6857. return false;
  6858. }
  6859. /**
  6860. * Checks if `value` is a property name and not a property path.
  6861. *
  6862. * @private
  6863. * @param {*} value The value to check.
  6864. * @param {Object} [object] The object to query keys on.
  6865. * @returns {boolean} Returns `true` if `value` is a property name, else `false`.
  6866. */
  6867. function isKey(value, object) {
  6868. if (isArray(value)) {
  6869. return false;
  6870. }
  6871. var type = typeof value;
  6872. if (type == 'number' || type == 'symbol' || type == 'boolean' ||
  6873. value == null || isSymbol(value)) {
  6874. return true;
  6875. }
  6876. return reIsPlainProp.test(value) || !reIsDeepProp.test(value) ||
  6877. (object != null && value in Object(object));
  6878. }
  6879. /**
  6880. * Checks if `value` is suitable for use as unique object key.
  6881. *
  6882. * @private
  6883. * @param {*} value The value to check.
  6884. * @returns {boolean} Returns `true` if `value` is suitable, else `false`.
  6885. */
  6886. function isKeyable(value) {
  6887. var type = typeof value;
  6888. return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean')
  6889. ? (value !== '__proto__')
  6890. : (value === null);
  6891. }
  6892. /**
  6893. * Checks if `func` has a lazy counterpart.
  6894. *
  6895. * @private
  6896. * @param {Function} func The function to check.
  6897. * @returns {boolean} Returns `true` if `func` has a lazy counterpart,
  6898. * else `false`.
  6899. */
  6900. function isLaziable(func) {
  6901. var funcName = getFuncName(func),
  6902. other = lodash[funcName];
  6903. if (typeof other != 'function' || !(funcName in LazyWrapper.prototype)) {
  6904. return false;
  6905. }
  6906. if (func === other) {
  6907. return true;
  6908. }
  6909. var data = getData(other);
  6910. return !!data && func === data[0];
  6911. }
  6912. /**
  6913. * Checks if `func` has its source masked.
  6914. *
  6915. * @private
  6916. * @param {Function} func The function to check.
  6917. * @returns {boolean} Returns `true` if `func` is masked, else `false`.
  6918. */
  6919. function isMasked(func) {
  6920. return !!maskSrcKey && (maskSrcKey in func);
  6921. }
  6922. /**
  6923. * Checks if `func` is capable of being masked.
  6924. *
  6925. * @private
  6926. * @param {*} value The value to check.
  6927. * @returns {boolean} Returns `true` if `func` is maskable, else `false`.
  6928. */
  6929. var isMaskable = coreJsData ? isFunction : stubFalse;
  6930. /**
  6931. * Checks if `value` is likely a prototype object.
  6932. *
  6933. * @private
  6934. * @param {*} value The value to check.
  6935. * @returns {boolean} Returns `true` if `value` is a prototype, else `false`.
  6936. */
  6937. function isPrototype(value) {
  6938. var Ctor = value && value.constructor,
  6939. proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto;
  6940. return value === proto;
  6941. }
  6942. /**
  6943. * Checks if `value` is suitable for strict equality comparisons, i.e. `===`.
  6944. *
  6945. * @private
  6946. * @param {*} value The value to check.
  6947. * @returns {boolean} Returns `true` if `value` if suitable for strict
  6948. * equality comparisons, else `false`.
  6949. */
  6950. function isStrictComparable(value) {
  6951. return value === value && !isObject(value);
  6952. }
  6953. /**
  6954. * A specialized version of `matchesProperty` for source values suitable
  6955. * for strict equality comparisons, i.e. `===`.
  6956. *
  6957. * @private
  6958. * @param {string} key The key of the property to get.
  6959. * @param {*} srcValue The value to match.
  6960. * @returns {Function} Returns the new spec function.
  6961. */
  6962. function matchesStrictComparable(key, srcValue) {
  6963. return function(object) {
  6964. if (object == null) {
  6965. return false;
  6966. }
  6967. return object[key] === srcValue &&
  6968. (srcValue !== undefined || (key in Object(object)));
  6969. };
  6970. }
  6971. /**
  6972. * A specialized version of `_.memoize` which clears the memoized function's
  6973. * cache when it exceeds `MAX_MEMOIZE_SIZE`.
  6974. *
  6975. * @private
  6976. * @param {Function} func The function to have its output memoized.
  6977. * @returns {Function} Returns the new memoized function.
  6978. */
  6979. function memoizeCapped(func) {
  6980. var result = memoize(func, function(key) {
  6981. if (cache.size === MAX_MEMOIZE_SIZE) {
  6982. cache.clear();
  6983. }
  6984. return key;
  6985. });
  6986. var cache = result.cache;
  6987. return result;
  6988. }
  6989. /**
  6990. * Merges the function metadata of `source` into `data`.
  6991. *
  6992. * Merging metadata reduces the number of wrappers used to invoke a function.
  6993. * This is possible because methods like `_.bind`, `_.curry`, and `_.partial`
  6994. * may be applied regardless of execution order. Methods like `_.ary` and
  6995. * `_.rearg` modify function arguments, making the order in which they are
  6996. * executed important, preventing the merging of metadata. However, we make
  6997. * an exception for a safe combined case where curried functions have `_.ary`
  6998. * and or `_.rearg` applied.
  6999. *
  7000. * @private
  7001. * @param {Array} data The destination metadata.
  7002. * @param {Array} source The source metadata.
  7003. * @returns {Array} Returns `data`.
  7004. */
  7005. function mergeData(data, source) {
  7006. var bitmask = data[1],
  7007. srcBitmask = source[1],
  7008. newBitmask = bitmask | srcBitmask,
  7009. isCommon = newBitmask < (WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG | WRAP_ARY_FLAG);
  7010. var isCombo =
  7011. ((srcBitmask == WRAP_ARY_FLAG) && (bitmask == WRAP_CURRY_FLAG)) ||
  7012. ((srcBitmask == WRAP_ARY_FLAG) && (bitmask == WRAP_REARG_FLAG) && (data[7].length <= source[8])) ||
  7013. ((srcBitmask == (WRAP_ARY_FLAG | WRAP_REARG_FLAG)) && (source[7].length <= source[8]) && (bitmask == WRAP_CURRY_FLAG));
  7014. // Exit early if metadata can't be merged.
  7015. if (!(isCommon || isCombo)) {
  7016. return data;
  7017. }
  7018. // Use source `thisArg` if available.
  7019. if (srcBitmask & WRAP_BIND_FLAG) {
  7020. data[2] = source[2];
  7021. // Set when currying a bound function.
  7022. newBitmask |= bitmask & WRAP_BIND_FLAG ? 0 : WRAP_CURRY_BOUND_FLAG;
  7023. }
  7024. // Compose partial arguments.
  7025. var value = source[3];
  7026. if (value) {
  7027. var partials = data[3];
  7028. data[3] = partials ? composeArgs(partials, value, source[4]) : value;
  7029. data[4] = partials ? replaceHolders(data[3], PLACEHOLDER) : source[4];
  7030. }
  7031. // Compose partial right arguments.
  7032. value = source[5];
  7033. if (value) {
  7034. partials = data[5];
  7035. data[5] = partials ? composeArgsRight(partials, value, source[6]) : value;
  7036. data[6] = partials ? replaceHolders(data[5], PLACEHOLDER) : source[6];
  7037. }
  7038. // Use source `argPos` if available.
  7039. value = source[7];
  7040. if (value) {
  7041. data[7] = value;
  7042. }
  7043. // Use source `ary` if it's smaller.
  7044. if (srcBitmask & WRAP_ARY_FLAG) {
  7045. data[8] = data[8] == null ? source[8] : nativeMin(data[8], source[8]);
  7046. }
  7047. // Use source `arity` if one is not provided.
  7048. if (data[9] == null) {
  7049. data[9] = source[9];
  7050. }
  7051. // Use source `func` and merge bitmasks.
  7052. data[0] = source[0];
  7053. data[1] = newBitmask;
  7054. return data;
  7055. }
  7056. /**
  7057. * This function is like
  7058. * [`Object.keys`](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)
  7059. * except that it includes inherited enumerable properties.
  7060. *
  7061. * @private
  7062. * @param {Object} object The object to query.
  7063. * @returns {Array} Returns the array of property names.
  7064. */
  7065. function nativeKeysIn(object) {
  7066. var result = [];
  7067. if (object != null) {
  7068. for (var key in Object(object)) {
  7069. result.push(key);
  7070. }
  7071. }
  7072. return result;
  7073. }
  7074. /**
  7075. * Converts `value` to a string using `Object.prototype.toString`.
  7076. *
  7077. * @private
  7078. * @param {*} value The value to convert.
  7079. * @returns {string} Returns the converted string.
  7080. */
  7081. function objectToString(value) {
  7082. return nativeObjectToString.call(value);
  7083. }
  7084. /**
  7085. * A specialized version of `baseRest` which transforms the rest array.
  7086. *
  7087. * @private
  7088. * @param {Function} func The function to apply a rest parameter to.
  7089. * @param {number} [start=func.length-1] The start position of the rest parameter.
  7090. * @param {Function} transform The rest array transform.
  7091. * @returns {Function} Returns the new function.
  7092. */
  7093. function overRest(func, start, transform) {
  7094. start = nativeMax(start === undefined ? (func.length - 1) : start, 0);
  7095. return function() {
  7096. var args = arguments,
  7097. index = -1,
  7098. length = nativeMax(args.length - start, 0),
  7099. array = Array(length);
  7100. while (++index < length) {
  7101. array[index] = args[start + index];
  7102. }
  7103. index = -1;
  7104. var otherArgs = Array(start + 1);
  7105. while (++index < start) {
  7106. otherArgs[index] = args[index];
  7107. }
  7108. otherArgs[start] = transform(array);
  7109. return apply(func, this, otherArgs);
  7110. };
  7111. }
  7112. /**
  7113. * Gets the parent value at `path` of `object`.
  7114. *
  7115. * @private
  7116. * @param {Object} object The object to query.
  7117. * @param {Array} path The path to get the parent value of.
  7118. * @returns {*} Returns the parent value.
  7119. */
  7120. function parent(object, path) {
  7121. return path.length < 2 ? object : baseGet(object, baseSlice(path, 0, -1));
  7122. }
  7123. /**
  7124. * Reorder `array` according to the specified indexes where the element at
  7125. * the first index is assigned as the first element, the element at
  7126. * the second index is assigned as the second element, and so on.
  7127. *
  7128. * @private
  7129. * @param {Array} array The array to reorder.
  7130. * @param {Array} indexes The arranged array indexes.
  7131. * @returns {Array} Returns `array`.
  7132. */
  7133. function reorder(array, indexes) {
  7134. var arrLength = array.length,
  7135. length = nativeMin(indexes.length, arrLength),
  7136. oldArray = copyArray(array);
  7137. while (length--) {
  7138. var index = indexes[length];
  7139. array[length] = isIndex(index, arrLength) ? oldArray[index] : undefined;
  7140. }
  7141. return array;
  7142. }
  7143. /**
  7144. * Gets the value at `key`, unless `key` is "__proto__" or "constructor".
  7145. *
  7146. * @private
  7147. * @param {Object} object The object to query.
  7148. * @param {string} key The key of the property to get.
  7149. * @returns {*} Returns the property value.
  7150. */
  7151. function safeGet(object, key) {
  7152. if (key === 'constructor' && typeof object[key] === 'function') {
  7153. return;
  7154. }
  7155. if (key == '__proto__') {
  7156. return;
  7157. }
  7158. return object[key];
  7159. }
  7160. /**
  7161. * Sets metadata for `func`.
  7162. *
  7163. * **Note:** If this function becomes hot, i.e. is invoked a lot in a short
  7164. * period of time, it will trip its breaker and transition to an identity
  7165. * function to avoid garbage collection pauses in V8. See
  7166. * [V8 issue 2070](https://bugs.chromium.org/p/v8/issues/detail?id=2070)
  7167. * for more details.
  7168. *
  7169. * @private
  7170. * @param {Function} func The function to associate metadata with.
  7171. * @param {*} data The metadata.
  7172. * @returns {Function} Returns `func`.
  7173. */
  7174. var setData = shortOut(baseSetData);
  7175. /**
  7176. * A simple wrapper around the global [`setTimeout`](https://mdn.io/setTimeout).
  7177. *
  7178. * @private
  7179. * @param {Function} func The function to delay.
  7180. * @param {number} wait The number of milliseconds to delay invocation.
  7181. * @returns {number|Object} Returns the timer id or timeout object.
  7182. */
  7183. var setTimeout = ctxSetTimeout || function(func, wait) {
  7184. return root.setTimeout(func, wait);
  7185. };
  7186. /**
  7187. * Sets the `toString` method of `func` to return `string`.
  7188. *
  7189. * @private
  7190. * @param {Function} func The function to modify.
  7191. * @param {Function} string The `toString` result.
  7192. * @returns {Function} Returns `func`.
  7193. */
  7194. var setToString = shortOut(baseSetToString);
  7195. /**
  7196. * Sets the `toString` method of `wrapper` to mimic the source of `reference`
  7197. * with wrapper details in a comment at the top of the source body.
  7198. *
  7199. * @private
  7200. * @param {Function} wrapper The function to modify.
  7201. * @param {Function} reference The reference function.
  7202. * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
  7203. * @returns {Function} Returns `wrapper`.
  7204. */
  7205. function setWrapToString(wrapper, reference, bitmask) {
  7206. var source = (reference + '');
  7207. return setToString(wrapper, insertWrapDetails(source, updateWrapDetails(getWrapDetails(source), bitmask)));
  7208. }
  7209. /**
  7210. * Creates a function that'll short out and invoke `identity` instead
  7211. * of `func` when it's called `HOT_COUNT` or more times in `HOT_SPAN`
  7212. * milliseconds.
  7213. *
  7214. * @private
  7215. * @param {Function} func The function to restrict.
  7216. * @returns {Function} Returns the new shortable function.
  7217. */
  7218. function shortOut(func) {
  7219. var count = 0,
  7220. lastCalled = 0;
  7221. return function() {
  7222. var stamp = nativeNow(),
  7223. remaining = HOT_SPAN - (stamp - lastCalled);
  7224. lastCalled = stamp;
  7225. if (remaining > 0) {
  7226. if (++count >= HOT_COUNT) {
  7227. return arguments[0];
  7228. }
  7229. } else {
  7230. count = 0;
  7231. }
  7232. return func.apply(undefined, arguments);
  7233. };
  7234. }
  7235. /**
  7236. * A specialized version of `_.shuffle` which mutates and sets the size of `array`.
  7237. *
  7238. * @private
  7239. * @param {Array} array The array to shuffle.
  7240. * @param {number} [size=array.length] The size of `array`.
  7241. * @returns {Array} Returns `array`.
  7242. */
  7243. function shuffleSelf(array, size) {
  7244. var index = -1,
  7245. length = array.length,
  7246. lastIndex = length - 1;
  7247. size = size === undefined ? length : size;
  7248. while (++index < size) {
  7249. var rand = baseRandom(index, lastIndex),
  7250. value = array[rand];
  7251. array[rand] = array[index];
  7252. array[index] = value;
  7253. }
  7254. array.length = size;
  7255. return array;
  7256. }
  7257. /**
  7258. * Converts `string` to a property path array.
  7259. *
  7260. * @private
  7261. * @param {string} string The string to convert.
  7262. * @returns {Array} Returns the property path array.
  7263. */
  7264. var stringToPath = memoizeCapped(function(string) {
  7265. var result = [];
  7266. if (string.charCodeAt(0) === 46 /* . */) {
  7267. result.push('');
  7268. }
  7269. string.replace(rePropName, function(match, number, quote, subString) {
  7270. result.push(quote ? subString.replace(reEscapeChar, '$1') : (number || match));
  7271. });
  7272. return result;
  7273. });
  7274. /**
  7275. * Converts `value` to a string key if it's not a string or symbol.
  7276. *
  7277. * @private
  7278. * @param {*} value The value to inspect.
  7279. * @returns {string|symbol} Returns the key.
  7280. */
  7281. function toKey(value) {
  7282. if (typeof value == 'string' || isSymbol(value)) {
  7283. return value;
  7284. }
  7285. var result = (value + '');
  7286. return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;
  7287. }
  7288. /**
  7289. * Converts `func` to its source code.
  7290. *
  7291. * @private
  7292. * @param {Function} func The function to convert.
  7293. * @returns {string} Returns the source code.
  7294. */
  7295. function toSource(func) {
  7296. if (func != null) {
  7297. try {
  7298. return funcToString.call(func);
  7299. } catch (e) {}
  7300. try {
  7301. return (func + '');
  7302. } catch (e) {}
  7303. }
  7304. return '';
  7305. }
  7306. /**
  7307. * Updates wrapper `details` based on `bitmask` flags.
  7308. *
  7309. * @private
  7310. * @returns {Array} details The details to modify.
  7311. * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
  7312. * @returns {Array} Returns `details`.
  7313. */
  7314. function updateWrapDetails(details, bitmask) {
  7315. arrayEach(wrapFlags, function(pair) {
  7316. var value = '_.' + pair[0];
  7317. if ((bitmask & pair[1]) && !arrayIncludes(details, value)) {
  7318. details.push(value);
  7319. }
  7320. });
  7321. return details.sort();
  7322. }
  7323. /**
  7324. * Creates a clone of `wrapper`.
  7325. *
  7326. * @private
  7327. * @param {Object} wrapper The wrapper to clone.
  7328. * @returns {Object} Returns the cloned wrapper.
  7329. */
  7330. function wrapperClone(wrapper) {
  7331. if (wrapper instanceof LazyWrapper) {
  7332. return wrapper.clone();
  7333. }
  7334. var result = new LodashWrapper(wrapper.__wrapped__, wrapper.__chain__);
  7335. result.__actions__ = copyArray(wrapper.__actions__);
  7336. result.__index__ = wrapper.__index__;
  7337. result.__values__ = wrapper.__values__;
  7338. return result;
  7339. }
  7340. /*------------------------------------------------------------------------*/
  7341. /**
  7342. * Creates an array of elements split into groups the length of `size`.
  7343. * If `array` can't be split evenly, the final chunk will be the remaining
  7344. * elements.
  7345. *
  7346. * @static
  7347. * @memberOf _
  7348. * @since 3.0.0
  7349. * @category Array
  7350. * @param {Array} array The array to process.
  7351. * @param {number} [size=1] The length of each chunk
  7352. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  7353. * @returns {Array} Returns the new array of chunks.
  7354. * @example
  7355. *
  7356. * _.chunk(['a', 'b', 'c', 'd'], 2);
  7357. * // => [['a', 'b'], ['c', 'd']]
  7358. *
  7359. * _.chunk(['a', 'b', 'c', 'd'], 3);
  7360. * // => [['a', 'b', 'c'], ['d']]
  7361. */
  7362. function chunk(array, size, guard) {
  7363. if ((guard ? isIterateeCall(array, size, guard) : size === undefined)) {
  7364. size = 1;
  7365. } else {
  7366. size = nativeMax(toInteger(size), 0);
  7367. }
  7368. var length = array == null ? 0 : array.length;
  7369. if (!length || size < 1) {
  7370. return [];
  7371. }
  7372. var index = 0,
  7373. resIndex = 0,
  7374. result = Array(nativeCeil(length / size));
  7375. while (index < length) {
  7376. result[resIndex++] = baseSlice(array, index, (index += size));
  7377. }
  7378. return result;
  7379. }
  7380. /**
  7381. * Creates an array with all falsey values removed. The values `false`, `null`,
  7382. * `0`, `""`, `undefined`, and `NaN` are falsey.
  7383. *
  7384. * @static
  7385. * @memberOf _
  7386. * @since 0.1.0
  7387. * @category Array
  7388. * @param {Array} array The array to compact.
  7389. * @returns {Array} Returns the new array of filtered values.
  7390. * @example
  7391. *
  7392. * _.compact([0, 1, false, 2, '', 3]);
  7393. * // => [1, 2, 3]
  7394. */
  7395. function compact(array) {
  7396. var index = -1,
  7397. length = array == null ? 0 : array.length,
  7398. resIndex = 0,
  7399. result = [];
  7400. while (++index < length) {
  7401. var value = array[index];
  7402. if (value) {
  7403. result[resIndex++] = value;
  7404. }
  7405. }
  7406. return result;
  7407. }
  7408. /**
  7409. * Creates a new array concatenating `array` with any additional arrays
  7410. * and/or values.
  7411. *
  7412. * @static
  7413. * @memberOf _
  7414. * @since 4.0.0
  7415. * @category Array
  7416. * @param {Array} array The array to concatenate.
  7417. * @param {...*} [values] The values to concatenate.
  7418. * @returns {Array} Returns the new concatenated array.
  7419. * @example
  7420. *
  7421. * var array = [1];
  7422. * var other = _.concat(array, 2, [3], [[4]]);
  7423. *
  7424. * console.log(other);
  7425. * // => [1, 2, 3, [4]]
  7426. *
  7427. * console.log(array);
  7428. * // => [1]
  7429. */
  7430. function concat() {
  7431. var length = arguments.length;
  7432. if (!length) {
  7433. return [];
  7434. }
  7435. var args = Array(length - 1),
  7436. array = arguments[0],
  7437. index = length;
  7438. while (index--) {
  7439. args[index - 1] = arguments[index];
  7440. }
  7441. return arrayPush(isArray(array) ? copyArray(array) : [array], baseFlatten(args, 1));
  7442. }
  7443. /**
  7444. * Creates an array of `array` values not included in the other given arrays
  7445. * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  7446. * for equality comparisons. The order and references of result values are
  7447. * determined by the first array.
  7448. *
  7449. * **Note:** Unlike `_.pullAll`, this method returns a new array.
  7450. *
  7451. * @static
  7452. * @memberOf _
  7453. * @since 0.1.0
  7454. * @category Array
  7455. * @param {Array} array The array to inspect.
  7456. * @param {...Array} [values] The values to exclude.
  7457. * @returns {Array} Returns the new array of filtered values.
  7458. * @see _.without, _.xor
  7459. * @example
  7460. *
  7461. * _.difference([2, 1], [2, 3]);
  7462. * // => [1]
  7463. */
  7464. var difference = baseRest(function(array, values) {
  7465. return isArrayLikeObject(array)
  7466. ? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true))
  7467. : [];
  7468. });
  7469. /**
  7470. * This method is like `_.difference` except that it accepts `iteratee` which
  7471. * is invoked for each element of `array` and `values` to generate the criterion
  7472. * by which they're compared. The order and references of result values are
  7473. * determined by the first array. The iteratee is invoked with one argument:
  7474. * (value).
  7475. *
  7476. * **Note:** Unlike `_.pullAllBy`, this method returns a new array.
  7477. *
  7478. * @static
  7479. * @memberOf _
  7480. * @since 4.0.0
  7481. * @category Array
  7482. * @param {Array} array The array to inspect.
  7483. * @param {...Array} [values] The values to exclude.
  7484. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  7485. * @returns {Array} Returns the new array of filtered values.
  7486. * @example
  7487. *
  7488. * _.differenceBy([2.1, 1.2], [2.3, 3.4], Math.floor);
  7489. * // => [1.2]
  7490. *
  7491. * // The `_.property` iteratee shorthand.
  7492. * _.differenceBy([{ 'x': 2 }, { 'x': 1 }], [{ 'x': 1 }], 'x');
  7493. * // => [{ 'x': 2 }]
  7494. */
  7495. var differenceBy = baseRest(function(array, values) {
  7496. var iteratee = last(values);
  7497. if (isArrayLikeObject(iteratee)) {
  7498. iteratee = undefined;
  7499. }
  7500. return isArrayLikeObject(array)
  7501. ? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true), getIteratee(iteratee, 2))
  7502. : [];
  7503. });
  7504. /**
  7505. * This method is like `_.difference` except that it accepts `comparator`
  7506. * which is invoked to compare elements of `array` to `values`. The order and
  7507. * references of result values are determined by the first array. The comparator
  7508. * is invoked with two arguments: (arrVal, othVal).
  7509. *
  7510. * **Note:** Unlike `_.pullAllWith`, this method returns a new array.
  7511. *
  7512. * @static
  7513. * @memberOf _
  7514. * @since 4.0.0
  7515. * @category Array
  7516. * @param {Array} array The array to inspect.
  7517. * @param {...Array} [values] The values to exclude.
  7518. * @param {Function} [comparator] The comparator invoked per element.
  7519. * @returns {Array} Returns the new array of filtered values.
  7520. * @example
  7521. *
  7522. * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }];
  7523. *
  7524. * _.differenceWith(objects, [{ 'x': 1, 'y': 2 }], _.isEqual);
  7525. * // => [{ 'x': 2, 'y': 1 }]
  7526. */
  7527. var differenceWith = baseRest(function(array, values) {
  7528. var comparator = last(values);
  7529. if (isArrayLikeObject(comparator)) {
  7530. comparator = undefined;
  7531. }
  7532. return isArrayLikeObject(array)
  7533. ? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true), undefined, comparator)
  7534. : [];
  7535. });
  7536. /**
  7537. * Creates a slice of `array` with `n` elements dropped from the beginning.
  7538. *
  7539. * @static
  7540. * @memberOf _
  7541. * @since 0.5.0
  7542. * @category Array
  7543. * @param {Array} array The array to query.
  7544. * @param {number} [n=1] The number of elements to drop.
  7545. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  7546. * @returns {Array} Returns the slice of `array`.
  7547. * @example
  7548. *
  7549. * _.drop([1, 2, 3]);
  7550. * // => [2, 3]
  7551. *
  7552. * _.drop([1, 2, 3], 2);
  7553. * // => [3]
  7554. *
  7555. * _.drop([1, 2, 3], 5);
  7556. * // => []
  7557. *
  7558. * _.drop([1, 2, 3], 0);
  7559. * // => [1, 2, 3]
  7560. */
  7561. function drop(array, n, guard) {
  7562. var length = array == null ? 0 : array.length;
  7563. if (!length) {
  7564. return [];
  7565. }
  7566. n = (guard || n === undefined) ? 1 : toInteger(n);
  7567. return baseSlice(array, n < 0 ? 0 : n, length);
  7568. }
  7569. /**
  7570. * Creates a slice of `array` with `n` elements dropped from the end.
  7571. *
  7572. * @static
  7573. * @memberOf _
  7574. * @since 3.0.0
  7575. * @category Array
  7576. * @param {Array} array The array to query.
  7577. * @param {number} [n=1] The number of elements to drop.
  7578. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  7579. * @returns {Array} Returns the slice of `array`.
  7580. * @example
  7581. *
  7582. * _.dropRight([1, 2, 3]);
  7583. * // => [1, 2]
  7584. *
  7585. * _.dropRight([1, 2, 3], 2);
  7586. * // => [1]
  7587. *
  7588. * _.dropRight([1, 2, 3], 5);
  7589. * // => []
  7590. *
  7591. * _.dropRight([1, 2, 3], 0);
  7592. * // => [1, 2, 3]
  7593. */
  7594. function dropRight(array, n, guard) {
  7595. var length = array == null ? 0 : array.length;
  7596. if (!length) {
  7597. return [];
  7598. }
  7599. n = (guard || n === undefined) ? 1 : toInteger(n);
  7600. n = length - n;
  7601. return baseSlice(array, 0, n < 0 ? 0 : n);
  7602. }
  7603. /**
  7604. * Creates a slice of `array` excluding elements dropped from the end.
  7605. * Elements are dropped until `predicate` returns falsey. The predicate is
  7606. * invoked with three arguments: (value, index, array).
  7607. *
  7608. * @static
  7609. * @memberOf _
  7610. * @since 3.0.0
  7611. * @category Array
  7612. * @param {Array} array The array to query.
  7613. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  7614. * @returns {Array} Returns the slice of `array`.
  7615. * @example
  7616. *
  7617. * var users = [
  7618. * { 'user': 'barney', 'active': true },
  7619. * { 'user': 'fred', 'active': false },
  7620. * { 'user': 'pebbles', 'active': false }
  7621. * ];
  7622. *
  7623. * _.dropRightWhile(users, function(o) { return !o.active; });
  7624. * // => objects for ['barney']
  7625. *
  7626. * // The `_.matches` iteratee shorthand.
  7627. * _.dropRightWhile(users, { 'user': 'pebbles', 'active': false });
  7628. * // => objects for ['barney', 'fred']
  7629. *
  7630. * // The `_.matchesProperty` iteratee shorthand.
  7631. * _.dropRightWhile(users, ['active', false]);
  7632. * // => objects for ['barney']
  7633. *
  7634. * // The `_.property` iteratee shorthand.
  7635. * _.dropRightWhile(users, 'active');
  7636. * // => objects for ['barney', 'fred', 'pebbles']
  7637. */
  7638. function dropRightWhile(array, predicate) {
  7639. return (array && array.length)
  7640. ? baseWhile(array, getIteratee(predicate, 3), true, true)
  7641. : [];
  7642. }
  7643. /**
  7644. * Creates a slice of `array` excluding elements dropped from the beginning.
  7645. * Elements are dropped until `predicate` returns falsey. The predicate is
  7646. * invoked with three arguments: (value, index, array).
  7647. *
  7648. * @static
  7649. * @memberOf _
  7650. * @since 3.0.0
  7651. * @category Array
  7652. * @param {Array} array The array to query.
  7653. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  7654. * @returns {Array} Returns the slice of `array`.
  7655. * @example
  7656. *
  7657. * var users = [
  7658. * { 'user': 'barney', 'active': false },
  7659. * { 'user': 'fred', 'active': false },
  7660. * { 'user': 'pebbles', 'active': true }
  7661. * ];
  7662. *
  7663. * _.dropWhile(users, function(o) { return !o.active; });
  7664. * // => objects for ['pebbles']
  7665. *
  7666. * // The `_.matches` iteratee shorthand.
  7667. * _.dropWhile(users, { 'user': 'barney', 'active': false });
  7668. * // => objects for ['fred', 'pebbles']
  7669. *
  7670. * // The `_.matchesProperty` iteratee shorthand.
  7671. * _.dropWhile(users, ['active', false]);
  7672. * // => objects for ['pebbles']
  7673. *
  7674. * // The `_.property` iteratee shorthand.
  7675. * _.dropWhile(users, 'active');
  7676. * // => objects for ['barney', 'fred', 'pebbles']
  7677. */
  7678. function dropWhile(array, predicate) {
  7679. return (array && array.length)
  7680. ? baseWhile(array, getIteratee(predicate, 3), true)
  7681. : [];
  7682. }
  7683. /**
  7684. * Fills elements of `array` with `value` from `start` up to, but not
  7685. * including, `end`.
  7686. *
  7687. * **Note:** This method mutates `array`.
  7688. *
  7689. * @static
  7690. * @memberOf _
  7691. * @since 3.2.0
  7692. * @category Array
  7693. * @param {Array} array The array to fill.
  7694. * @param {*} value The value to fill `array` with.
  7695. * @param {number} [start=0] The start position.
  7696. * @param {number} [end=array.length] The end position.
  7697. * @returns {Array} Returns `array`.
  7698. * @example
  7699. *
  7700. * var array = [1, 2, 3];
  7701. *
  7702. * _.fill(array, 'a');
  7703. * console.log(array);
  7704. * // => ['a', 'a', 'a']
  7705. *
  7706. * _.fill(Array(3), 2);
  7707. * // => [2, 2, 2]
  7708. *
  7709. * _.fill([4, 6, 8, 10], '*', 1, 3);
  7710. * // => [4, '*', '*', 10]
  7711. */
  7712. function fill(array, value, start, end) {
  7713. var length = array == null ? 0 : array.length;
  7714. if (!length) {
  7715. return [];
  7716. }
  7717. if (start && typeof start != 'number' && isIterateeCall(array, value, start)) {
  7718. start = 0;
  7719. end = length;
  7720. }
  7721. return baseFill(array, value, start, end);
  7722. }
  7723. /**
  7724. * This method is like `_.find` except that it returns the index of the first
  7725. * element `predicate` returns truthy for instead of the element itself.
  7726. *
  7727. * @static
  7728. * @memberOf _
  7729. * @since 1.1.0
  7730. * @category Array
  7731. * @param {Array} array The array to inspect.
  7732. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  7733. * @param {number} [fromIndex=0] The index to search from.
  7734. * @returns {number} Returns the index of the found element, else `-1`.
  7735. * @example
  7736. *
  7737. * var users = [
  7738. * { 'user': 'barney', 'active': false },
  7739. * { 'user': 'fred', 'active': false },
  7740. * { 'user': 'pebbles', 'active': true }
  7741. * ];
  7742. *
  7743. * _.findIndex(users, function(o) { return o.user == 'barney'; });
  7744. * // => 0
  7745. *
  7746. * // The `_.matches` iteratee shorthand.
  7747. * _.findIndex(users, { 'user': 'fred', 'active': false });
  7748. * // => 1
  7749. *
  7750. * // The `_.matchesProperty` iteratee shorthand.
  7751. * _.findIndex(users, ['active', false]);
  7752. * // => 0
  7753. *
  7754. * // The `_.property` iteratee shorthand.
  7755. * _.findIndex(users, 'active');
  7756. * // => 2
  7757. */
  7758. function findIndex(array, predicate, fromIndex) {
  7759. var length = array == null ? 0 : array.length;
  7760. if (!length) {
  7761. return -1;
  7762. }
  7763. var index = fromIndex == null ? 0 : toInteger(fromIndex);
  7764. if (index < 0) {
  7765. index = nativeMax(length + index, 0);
  7766. }
  7767. return baseFindIndex(array, getIteratee(predicate, 3), index);
  7768. }
  7769. /**
  7770. * This method is like `_.findIndex` except that it iterates over elements
  7771. * of `collection` from right to left.
  7772. *
  7773. * @static
  7774. * @memberOf _
  7775. * @since 2.0.0
  7776. * @category Array
  7777. * @param {Array} array The array to inspect.
  7778. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  7779. * @param {number} [fromIndex=array.length-1] The index to search from.
  7780. * @returns {number} Returns the index of the found element, else `-1`.
  7781. * @example
  7782. *
  7783. * var users = [
  7784. * { 'user': 'barney', 'active': true },
  7785. * { 'user': 'fred', 'active': false },
  7786. * { 'user': 'pebbles', 'active': false }
  7787. * ];
  7788. *
  7789. * _.findLastIndex(users, function(o) { return o.user == 'pebbles'; });
  7790. * // => 2
  7791. *
  7792. * // The `_.matches` iteratee shorthand.
  7793. * _.findLastIndex(users, { 'user': 'barney', 'active': true });
  7794. * // => 0
  7795. *
  7796. * // The `_.matchesProperty` iteratee shorthand.
  7797. * _.findLastIndex(users, ['active', false]);
  7798. * // => 2
  7799. *
  7800. * // The `_.property` iteratee shorthand.
  7801. * _.findLastIndex(users, 'active');
  7802. * // => 0
  7803. */
  7804. function findLastIndex(array, predicate, fromIndex) {
  7805. var length = array == null ? 0 : array.length;
  7806. if (!length) {
  7807. return -1;
  7808. }
  7809. var index = length - 1;
  7810. if (fromIndex !== undefined) {
  7811. index = toInteger(fromIndex);
  7812. index = fromIndex < 0
  7813. ? nativeMax(length + index, 0)
  7814. : nativeMin(index, length - 1);
  7815. }
  7816. return baseFindIndex(array, getIteratee(predicate, 3), index, true);
  7817. }
  7818. /**
  7819. * Flattens `array` a single level deep.
  7820. *
  7821. * @static
  7822. * @memberOf _
  7823. * @since 0.1.0
  7824. * @category Array
  7825. * @param {Array} array The array to flatten.
  7826. * @returns {Array} Returns the new flattened array.
  7827. * @example
  7828. *
  7829. * _.flatten([1, [2, [3, [4]], 5]]);
  7830. * // => [1, 2, [3, [4]], 5]
  7831. */
  7832. function flatten(array) {
  7833. var length = array == null ? 0 : array.length;
  7834. return length ? baseFlatten(array, 1) : [];
  7835. }
  7836. /**
  7837. * Recursively flattens `array`.
  7838. *
  7839. * @static
  7840. * @memberOf _
  7841. * @since 3.0.0
  7842. * @category Array
  7843. * @param {Array} array The array to flatten.
  7844. * @returns {Array} Returns the new flattened array.
  7845. * @example
  7846. *
  7847. * _.flattenDeep([1, [2, [3, [4]], 5]]);
  7848. * // => [1, 2, 3, 4, 5]
  7849. */
  7850. function flattenDeep(array) {
  7851. var length = array == null ? 0 : array.length;
  7852. return length ? baseFlatten(array, INFINITY) : [];
  7853. }
  7854. /**
  7855. * Recursively flatten `array` up to `depth` times.
  7856. *
  7857. * @static
  7858. * @memberOf _
  7859. * @since 4.4.0
  7860. * @category Array
  7861. * @param {Array} array The array to flatten.
  7862. * @param {number} [depth=1] The maximum recursion depth.
  7863. * @returns {Array} Returns the new flattened array.
  7864. * @example
  7865. *
  7866. * var array = [1, [2, [3, [4]], 5]];
  7867. *
  7868. * _.flattenDepth(array, 1);
  7869. * // => [1, 2, [3, [4]], 5]
  7870. *
  7871. * _.flattenDepth(array, 2);
  7872. * // => [1, 2, 3, [4], 5]
  7873. */
  7874. function flattenDepth(array, depth) {
  7875. var length = array == null ? 0 : array.length;
  7876. if (!length) {
  7877. return [];
  7878. }
  7879. depth = depth === undefined ? 1 : toInteger(depth);
  7880. return baseFlatten(array, depth);
  7881. }
  7882. /**
  7883. * The inverse of `_.toPairs`; this method returns an object composed
  7884. * from key-value `pairs`.
  7885. *
  7886. * @static
  7887. * @memberOf _
  7888. * @since 4.0.0
  7889. * @category Array
  7890. * @param {Array} pairs The key-value pairs.
  7891. * @returns {Object} Returns the new object.
  7892. * @example
  7893. *
  7894. * _.fromPairs([['a', 1], ['b', 2]]);
  7895. * // => { 'a': 1, 'b': 2 }
  7896. */
  7897. function fromPairs(pairs) {
  7898. var index = -1,
  7899. length = pairs == null ? 0 : pairs.length,
  7900. result = {};
  7901. while (++index < length) {
  7902. var pair = pairs[index];
  7903. result[pair[0]] = pair[1];
  7904. }
  7905. return result;
  7906. }
  7907. /**
  7908. * Gets the first element of `array`.
  7909. *
  7910. * @static
  7911. * @memberOf _
  7912. * @since 0.1.0
  7913. * @alias first
  7914. * @category Array
  7915. * @param {Array} array The array to query.
  7916. * @returns {*} Returns the first element of `array`.
  7917. * @example
  7918. *
  7919. * _.head([1, 2, 3]);
  7920. * // => 1
  7921. *
  7922. * _.head([]);
  7923. * // => undefined
  7924. */
  7925. function head(array) {
  7926. return (array && array.length) ? array[0] : undefined;
  7927. }
  7928. /**
  7929. * Gets the index at which the first occurrence of `value` is found in `array`
  7930. * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  7931. * for equality comparisons. If `fromIndex` is negative, it's used as the
  7932. * offset from the end of `array`.
  7933. *
  7934. * @static
  7935. * @memberOf _
  7936. * @since 0.1.0
  7937. * @category Array
  7938. * @param {Array} array The array to inspect.
  7939. * @param {*} value The value to search for.
  7940. * @param {number} [fromIndex=0] The index to search from.
  7941. * @returns {number} Returns the index of the matched value, else `-1`.
  7942. * @example
  7943. *
  7944. * _.indexOf([1, 2, 1, 2], 2);
  7945. * // => 1
  7946. *
  7947. * // Search from the `fromIndex`.
  7948. * _.indexOf([1, 2, 1, 2], 2, 2);
  7949. * // => 3
  7950. */
  7951. function indexOf(array, value, fromIndex) {
  7952. var length = array == null ? 0 : array.length;
  7953. if (!length) {
  7954. return -1;
  7955. }
  7956. var index = fromIndex == null ? 0 : toInteger(fromIndex);
  7957. if (index < 0) {
  7958. index = nativeMax(length + index, 0);
  7959. }
  7960. return baseIndexOf(array, value, index);
  7961. }
  7962. /**
  7963. * Gets all but the last element of `array`.
  7964. *
  7965. * @static
  7966. * @memberOf _
  7967. * @since 0.1.0
  7968. * @category Array
  7969. * @param {Array} array The array to query.
  7970. * @returns {Array} Returns the slice of `array`.
  7971. * @example
  7972. *
  7973. * _.initial([1, 2, 3]);
  7974. * // => [1, 2]
  7975. */
  7976. function initial(array) {
  7977. var length = array == null ? 0 : array.length;
  7978. return length ? baseSlice(array, 0, -1) : [];
  7979. }
  7980. /**
  7981. * Creates an array of unique values that are included in all given arrays
  7982. * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  7983. * for equality comparisons. The order and references of result values are
  7984. * determined by the first array.
  7985. *
  7986. * @static
  7987. * @memberOf _
  7988. * @since 0.1.0
  7989. * @category Array
  7990. * @param {...Array} [arrays] The arrays to inspect.
  7991. * @returns {Array} Returns the new array of intersecting values.
  7992. * @example
  7993. *
  7994. * _.intersection([2, 1], [2, 3]);
  7995. * // => [2]
  7996. */
  7997. var intersection = baseRest(function(arrays) {
  7998. var mapped = arrayMap(arrays, castArrayLikeObject);
  7999. return (mapped.length && mapped[0] === arrays[0])
  8000. ? baseIntersection(mapped)
  8001. : [];
  8002. });
  8003. /**
  8004. * This method is like `_.intersection` except that it accepts `iteratee`
  8005. * which is invoked for each element of each `arrays` to generate the criterion
  8006. * by which they're compared. The order and references of result values are
  8007. * determined by the first array. The iteratee is invoked with one argument:
  8008. * (value).
  8009. *
  8010. * @static
  8011. * @memberOf _
  8012. * @since 4.0.0
  8013. * @category Array
  8014. * @param {...Array} [arrays] The arrays to inspect.
  8015. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  8016. * @returns {Array} Returns the new array of intersecting values.
  8017. * @example
  8018. *
  8019. * _.intersectionBy([2.1, 1.2], [2.3, 3.4], Math.floor);
  8020. * // => [2.1]
  8021. *
  8022. * // The `_.property` iteratee shorthand.
  8023. * _.intersectionBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x');
  8024. * // => [{ 'x': 1 }]
  8025. */
  8026. var intersectionBy = baseRest(function(arrays) {
  8027. var iteratee = last(arrays),
  8028. mapped = arrayMap(arrays, castArrayLikeObject);
  8029. if (iteratee === last(mapped)) {
  8030. iteratee = undefined;
  8031. } else {
  8032. mapped.pop();
  8033. }
  8034. return (mapped.length && mapped[0] === arrays[0])
  8035. ? baseIntersection(mapped, getIteratee(iteratee, 2))
  8036. : [];
  8037. });
  8038. /**
  8039. * This method is like `_.intersection` except that it accepts `comparator`
  8040. * which is invoked to compare elements of `arrays`. The order and references
  8041. * of result values are determined by the first array. The comparator is
  8042. * invoked with two arguments: (arrVal, othVal).
  8043. *
  8044. * @static
  8045. * @memberOf _
  8046. * @since 4.0.0
  8047. * @category Array
  8048. * @param {...Array} [arrays] The arrays to inspect.
  8049. * @param {Function} [comparator] The comparator invoked per element.
  8050. * @returns {Array} Returns the new array of intersecting values.
  8051. * @example
  8052. *
  8053. * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }];
  8054. * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }];
  8055. *
  8056. * _.intersectionWith(objects, others, _.isEqual);
  8057. * // => [{ 'x': 1, 'y': 2 }]
  8058. */
  8059. var intersectionWith = baseRest(function(arrays) {
  8060. var comparator = last(arrays),
  8061. mapped = arrayMap(arrays, castArrayLikeObject);
  8062. comparator = typeof comparator == 'function' ? comparator : undefined;
  8063. if (comparator) {
  8064. mapped.pop();
  8065. }
  8066. return (mapped.length && mapped[0] === arrays[0])
  8067. ? baseIntersection(mapped, undefined, comparator)
  8068. : [];
  8069. });
  8070. /**
  8071. * Converts all elements in `array` into a string separated by `separator`.
  8072. *
  8073. * @static
  8074. * @memberOf _
  8075. * @since 4.0.0
  8076. * @category Array
  8077. * @param {Array} array The array to convert.
  8078. * @param {string} [separator=','] The element separator.
  8079. * @returns {string} Returns the joined string.
  8080. * @example
  8081. *
  8082. * _.join(['a', 'b', 'c'], '~');
  8083. * // => 'a~b~c'
  8084. */
  8085. function join(array, separator) {
  8086. return array == null ? '' : nativeJoin.call(array, separator);
  8087. }
  8088. /**
  8089. * Gets the last element of `array`.
  8090. *
  8091. * @static
  8092. * @memberOf _
  8093. * @since 0.1.0
  8094. * @category Array
  8095. * @param {Array} array The array to query.
  8096. * @returns {*} Returns the last element of `array`.
  8097. * @example
  8098. *
  8099. * _.last([1, 2, 3]);
  8100. * // => 3
  8101. */
  8102. function last(array) {
  8103. var length = array == null ? 0 : array.length;
  8104. return length ? array[length - 1] : undefined;
  8105. }
  8106. /**
  8107. * This method is like `_.indexOf` except that it iterates over elements of
  8108. * `array` from right to left.
  8109. *
  8110. * @static
  8111. * @memberOf _
  8112. * @since 0.1.0
  8113. * @category Array
  8114. * @param {Array} array The array to inspect.
  8115. * @param {*} value The value to search for.
  8116. * @param {number} [fromIndex=array.length-1] The index to search from.
  8117. * @returns {number} Returns the index of the matched value, else `-1`.
  8118. * @example
  8119. *
  8120. * _.lastIndexOf([1, 2, 1, 2], 2);
  8121. * // => 3
  8122. *
  8123. * // Search from the `fromIndex`.
  8124. * _.lastIndexOf([1, 2, 1, 2], 2, 2);
  8125. * // => 1
  8126. */
  8127. function lastIndexOf(array, value, fromIndex) {
  8128. var length = array == null ? 0 : array.length;
  8129. if (!length) {
  8130. return -1;
  8131. }
  8132. var index = length;
  8133. if (fromIndex !== undefined) {
  8134. index = toInteger(fromIndex);
  8135. index = index < 0 ? nativeMax(length + index, 0) : nativeMin(index, length - 1);
  8136. }
  8137. return value === value
  8138. ? strictLastIndexOf(array, value, index)
  8139. : baseFindIndex(array, baseIsNaN, index, true);
  8140. }
  8141. /**
  8142. * Gets the element at index `n` of `array`. If `n` is negative, the nth
  8143. * element from the end is returned.
  8144. *
  8145. * @static
  8146. * @memberOf _
  8147. * @since 4.11.0
  8148. * @category Array
  8149. * @param {Array} array The array to query.
  8150. * @param {number} [n=0] The index of the element to return.
  8151. * @returns {*} Returns the nth element of `array`.
  8152. * @example
  8153. *
  8154. * var array = ['a', 'b', 'c', 'd'];
  8155. *
  8156. * _.nth(array, 1);
  8157. * // => 'b'
  8158. *
  8159. * _.nth(array, -2);
  8160. * // => 'c';
  8161. */
  8162. function nth(array, n) {
  8163. return (array && array.length) ? baseNth(array, toInteger(n)) : undefined;
  8164. }
  8165. /**
  8166. * Removes all given values from `array` using
  8167. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  8168. * for equality comparisons.
  8169. *
  8170. * **Note:** Unlike `_.without`, this method mutates `array`. Use `_.remove`
  8171. * to remove elements from an array by predicate.
  8172. *
  8173. * @static
  8174. * @memberOf _
  8175. * @since 2.0.0
  8176. * @category Array
  8177. * @param {Array} array The array to modify.
  8178. * @param {...*} [values] The values to remove.
  8179. * @returns {Array} Returns `array`.
  8180. * @example
  8181. *
  8182. * var array = ['a', 'b', 'c', 'a', 'b', 'c'];
  8183. *
  8184. * _.pull(array, 'a', 'c');
  8185. * console.log(array);
  8186. * // => ['b', 'b']
  8187. */
  8188. var pull = baseRest(pullAll);
  8189. /**
  8190. * This method is like `_.pull` except that it accepts an array of values to remove.
  8191. *
  8192. * **Note:** Unlike `_.difference`, this method mutates `array`.
  8193. *
  8194. * @static
  8195. * @memberOf _
  8196. * @since 4.0.0
  8197. * @category Array
  8198. * @param {Array} array The array to modify.
  8199. * @param {Array} values The values to remove.
  8200. * @returns {Array} Returns `array`.
  8201. * @example
  8202. *
  8203. * var array = ['a', 'b', 'c', 'a', 'b', 'c'];
  8204. *
  8205. * _.pullAll(array, ['a', 'c']);
  8206. * console.log(array);
  8207. * // => ['b', 'b']
  8208. */
  8209. function pullAll(array, values) {
  8210. return (array && array.length && values && values.length)
  8211. ? basePullAll(array, values)
  8212. : array;
  8213. }
  8214. /**
  8215. * This method is like `_.pullAll` except that it accepts `iteratee` which is
  8216. * invoked for each element of `array` and `values` to generate the criterion
  8217. * by which they're compared. The iteratee is invoked with one argument: (value).
  8218. *
  8219. * **Note:** Unlike `_.differenceBy`, this method mutates `array`.
  8220. *
  8221. * @static
  8222. * @memberOf _
  8223. * @since 4.0.0
  8224. * @category Array
  8225. * @param {Array} array The array to modify.
  8226. * @param {Array} values The values to remove.
  8227. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  8228. * @returns {Array} Returns `array`.
  8229. * @example
  8230. *
  8231. * var array = [{ 'x': 1 }, { 'x': 2 }, { 'x': 3 }, { 'x': 1 }];
  8232. *
  8233. * _.pullAllBy(array, [{ 'x': 1 }, { 'x': 3 }], 'x');
  8234. * console.log(array);
  8235. * // => [{ 'x': 2 }]
  8236. */
  8237. function pullAllBy(array, values, iteratee) {
  8238. return (array && array.length && values && values.length)
  8239. ? basePullAll(array, values, getIteratee(iteratee, 2))
  8240. : array;
  8241. }
  8242. /**
  8243. * This method is like `_.pullAll` except that it accepts `comparator` which
  8244. * is invoked to compare elements of `array` to `values`. The comparator is
  8245. * invoked with two arguments: (arrVal, othVal).
  8246. *
  8247. * **Note:** Unlike `_.differenceWith`, this method mutates `array`.
  8248. *
  8249. * @static
  8250. * @memberOf _
  8251. * @since 4.6.0
  8252. * @category Array
  8253. * @param {Array} array The array to modify.
  8254. * @param {Array} values The values to remove.
  8255. * @param {Function} [comparator] The comparator invoked per element.
  8256. * @returns {Array} Returns `array`.
  8257. * @example
  8258. *
  8259. * var array = [{ 'x': 1, 'y': 2 }, { 'x': 3, 'y': 4 }, { 'x': 5, 'y': 6 }];
  8260. *
  8261. * _.pullAllWith(array, [{ 'x': 3, 'y': 4 }], _.isEqual);
  8262. * console.log(array);
  8263. * // => [{ 'x': 1, 'y': 2 }, { 'x': 5, 'y': 6 }]
  8264. */
  8265. function pullAllWith(array, values, comparator) {
  8266. return (array && array.length && values && values.length)
  8267. ? basePullAll(array, values, undefined, comparator)
  8268. : array;
  8269. }
  8270. /**
  8271. * Removes elements from `array` corresponding to `indexes` and returns an
  8272. * array of removed elements.
  8273. *
  8274. * **Note:** Unlike `_.at`, this method mutates `array`.
  8275. *
  8276. * @static
  8277. * @memberOf _
  8278. * @since 3.0.0
  8279. * @category Array
  8280. * @param {Array} array The array to modify.
  8281. * @param {...(number|number[])} [indexes] The indexes of elements to remove.
  8282. * @returns {Array} Returns the new array of removed elements.
  8283. * @example
  8284. *
  8285. * var array = ['a', 'b', 'c', 'd'];
  8286. * var pulled = _.pullAt(array, [1, 3]);
  8287. *
  8288. * console.log(array);
  8289. * // => ['a', 'c']
  8290. *
  8291. * console.log(pulled);
  8292. * // => ['b', 'd']
  8293. */
  8294. var pullAt = flatRest(function(array, indexes) {
  8295. var length = array == null ? 0 : array.length,
  8296. result = baseAt(array, indexes);
  8297. basePullAt(array, arrayMap(indexes, function(index) {
  8298. return isIndex(index, length) ? +index : index;
  8299. }).sort(compareAscending));
  8300. return result;
  8301. });
  8302. /**
  8303. * Removes all elements from `array` that `predicate` returns truthy for
  8304. * and returns an array of the removed elements. The predicate is invoked
  8305. * with three arguments: (value, index, array).
  8306. *
  8307. * **Note:** Unlike `_.filter`, this method mutates `array`. Use `_.pull`
  8308. * to pull elements from an array by value.
  8309. *
  8310. * @static
  8311. * @memberOf _
  8312. * @since 2.0.0
  8313. * @category Array
  8314. * @param {Array} array The array to modify.
  8315. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  8316. * @returns {Array} Returns the new array of removed elements.
  8317. * @example
  8318. *
  8319. * var array = [1, 2, 3, 4];
  8320. * var evens = _.remove(array, function(n) {
  8321. * return n % 2 == 0;
  8322. * });
  8323. *
  8324. * console.log(array);
  8325. * // => [1, 3]
  8326. *
  8327. * console.log(evens);
  8328. * // => [2, 4]
  8329. */
  8330. function remove(array, predicate) {
  8331. var result = [];
  8332. if (!(array && array.length)) {
  8333. return result;
  8334. }
  8335. var index = -1,
  8336. indexes = [],
  8337. length = array.length;
  8338. predicate = getIteratee(predicate, 3);
  8339. while (++index < length) {
  8340. var value = array[index];
  8341. if (predicate(value, index, array)) {
  8342. result.push(value);
  8343. indexes.push(index);
  8344. }
  8345. }
  8346. basePullAt(array, indexes);
  8347. return result;
  8348. }
  8349. /**
  8350. * Reverses `array` so that the first element becomes the last, the second
  8351. * element becomes the second to last, and so on.
  8352. *
  8353. * **Note:** This method mutates `array` and is based on
  8354. * [`Array#reverse`](https://mdn.io/Array/reverse).
  8355. *
  8356. * @static
  8357. * @memberOf _
  8358. * @since 4.0.0
  8359. * @category Array
  8360. * @param {Array} array The array to modify.
  8361. * @returns {Array} Returns `array`.
  8362. * @example
  8363. *
  8364. * var array = [1, 2, 3];
  8365. *
  8366. * _.reverse(array);
  8367. * // => [3, 2, 1]
  8368. *
  8369. * console.log(array);
  8370. * // => [3, 2, 1]
  8371. */
  8372. function reverse(array) {
  8373. return array == null ? array : nativeReverse.call(array);
  8374. }
  8375. /**
  8376. * Creates a slice of `array` from `start` up to, but not including, `end`.
  8377. *
  8378. * **Note:** This method is used instead of
  8379. * [`Array#slice`](https://mdn.io/Array/slice) to ensure dense arrays are
  8380. * returned.
  8381. *
  8382. * @static
  8383. * @memberOf _
  8384. * @since 3.0.0
  8385. * @category Array
  8386. * @param {Array} array The array to slice.
  8387. * @param {number} [start=0] The start position.
  8388. * @param {number} [end=array.length] The end position.
  8389. * @returns {Array} Returns the slice of `array`.
  8390. */
  8391. function slice(array, start, end) {
  8392. var length = array == null ? 0 : array.length;
  8393. if (!length) {
  8394. return [];
  8395. }
  8396. if (end && typeof end != 'number' && isIterateeCall(array, start, end)) {
  8397. start = 0;
  8398. end = length;
  8399. }
  8400. else {
  8401. start = start == null ? 0 : toInteger(start);
  8402. end = end === undefined ? length : toInteger(end);
  8403. }
  8404. return baseSlice(array, start, end);
  8405. }
  8406. /**
  8407. * Uses a binary search to determine the lowest index at which `value`
  8408. * should be inserted into `array` in order to maintain its sort order.
  8409. *
  8410. * @static
  8411. * @memberOf _
  8412. * @since 0.1.0
  8413. * @category Array
  8414. * @param {Array} array The sorted array to inspect.
  8415. * @param {*} value The value to evaluate.
  8416. * @returns {number} Returns the index at which `value` should be inserted
  8417. * into `array`.
  8418. * @example
  8419. *
  8420. * _.sortedIndex([30, 50], 40);
  8421. * // => 1
  8422. */
  8423. function sortedIndex(array, value) {
  8424. return baseSortedIndex(array, value);
  8425. }
  8426. /**
  8427. * This method is like `_.sortedIndex` except that it accepts `iteratee`
  8428. * which is invoked for `value` and each element of `array` to compute their
  8429. * sort ranking. The iteratee is invoked with one argument: (value).
  8430. *
  8431. * @static
  8432. * @memberOf _
  8433. * @since 4.0.0
  8434. * @category Array
  8435. * @param {Array} array The sorted array to inspect.
  8436. * @param {*} value The value to evaluate.
  8437. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  8438. * @returns {number} Returns the index at which `value` should be inserted
  8439. * into `array`.
  8440. * @example
  8441. *
  8442. * var objects = [{ 'x': 4 }, { 'x': 5 }];
  8443. *
  8444. * _.sortedIndexBy(objects, { 'x': 4 }, function(o) { return o.x; });
  8445. * // => 0
  8446. *
  8447. * // The `_.property` iteratee shorthand.
  8448. * _.sortedIndexBy(objects, { 'x': 4 }, 'x');
  8449. * // => 0
  8450. */
  8451. function sortedIndexBy(array, value, iteratee) {
  8452. return baseSortedIndexBy(array, value, getIteratee(iteratee, 2));
  8453. }
  8454. /**
  8455. * This method is like `_.indexOf` except that it performs a binary
  8456. * search on a sorted `array`.
  8457. *
  8458. * @static
  8459. * @memberOf _
  8460. * @since 4.0.0
  8461. * @category Array
  8462. * @param {Array} array The array to inspect.
  8463. * @param {*} value The value to search for.
  8464. * @returns {number} Returns the index of the matched value, else `-1`.
  8465. * @example
  8466. *
  8467. * _.sortedIndexOf([4, 5, 5, 5, 6], 5);
  8468. * // => 1
  8469. */
  8470. function sortedIndexOf(array, value) {
  8471. var length = array == null ? 0 : array.length;
  8472. if (length) {
  8473. var index = baseSortedIndex(array, value);
  8474. if (index < length && eq(array[index], value)) {
  8475. return index;
  8476. }
  8477. }
  8478. return -1;
  8479. }
  8480. /**
  8481. * This method is like `_.sortedIndex` except that it returns the highest
  8482. * index at which `value` should be inserted into `array` in order to
  8483. * maintain its sort order.
  8484. *
  8485. * @static
  8486. * @memberOf _
  8487. * @since 3.0.0
  8488. * @category Array
  8489. * @param {Array} array The sorted array to inspect.
  8490. * @param {*} value The value to evaluate.
  8491. * @returns {number} Returns the index at which `value` should be inserted
  8492. * into `array`.
  8493. * @example
  8494. *
  8495. * _.sortedLastIndex([4, 5, 5, 5, 6], 5);
  8496. * // => 4
  8497. */
  8498. function sortedLastIndex(array, value) {
  8499. return baseSortedIndex(array, value, true);
  8500. }
  8501. /**
  8502. * This method is like `_.sortedLastIndex` except that it accepts `iteratee`
  8503. * which is invoked for `value` and each element of `array` to compute their
  8504. * sort ranking. The iteratee is invoked with one argument: (value).
  8505. *
  8506. * @static
  8507. * @memberOf _
  8508. * @since 4.0.0
  8509. * @category Array
  8510. * @param {Array} array The sorted array to inspect.
  8511. * @param {*} value The value to evaluate.
  8512. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  8513. * @returns {number} Returns the index at which `value` should be inserted
  8514. * into `array`.
  8515. * @example
  8516. *
  8517. * var objects = [{ 'x': 4 }, { 'x': 5 }];
  8518. *
  8519. * _.sortedLastIndexBy(objects, { 'x': 4 }, function(o) { return o.x; });
  8520. * // => 1
  8521. *
  8522. * // The `_.property` iteratee shorthand.
  8523. * _.sortedLastIndexBy(objects, { 'x': 4 }, 'x');
  8524. * // => 1
  8525. */
  8526. function sortedLastIndexBy(array, value, iteratee) {
  8527. return baseSortedIndexBy(array, value, getIteratee(iteratee, 2), true);
  8528. }
  8529. /**
  8530. * This method is like `_.lastIndexOf` except that it performs a binary
  8531. * search on a sorted `array`.
  8532. *
  8533. * @static
  8534. * @memberOf _
  8535. * @since 4.0.0
  8536. * @category Array
  8537. * @param {Array} array The array to inspect.
  8538. * @param {*} value The value to search for.
  8539. * @returns {number} Returns the index of the matched value, else `-1`.
  8540. * @example
  8541. *
  8542. * _.sortedLastIndexOf([4, 5, 5, 5, 6], 5);
  8543. * // => 3
  8544. */
  8545. function sortedLastIndexOf(array, value) {
  8546. var length = array == null ? 0 : array.length;
  8547. if (length) {
  8548. var index = baseSortedIndex(array, value, true) - 1;
  8549. if (eq(array[index], value)) {
  8550. return index;
  8551. }
  8552. }
  8553. return -1;
  8554. }
  8555. /**
  8556. * This method is like `_.uniq` except that it's designed and optimized
  8557. * for sorted arrays.
  8558. *
  8559. * @static
  8560. * @memberOf _
  8561. * @since 4.0.0
  8562. * @category Array
  8563. * @param {Array} array The array to inspect.
  8564. * @returns {Array} Returns the new duplicate free array.
  8565. * @example
  8566. *
  8567. * _.sortedUniq([1, 1, 2]);
  8568. * // => [1, 2]
  8569. */
  8570. function sortedUniq(array) {
  8571. return (array && array.length)
  8572. ? baseSortedUniq(array)
  8573. : [];
  8574. }
  8575. /**
  8576. * This method is like `_.uniqBy` except that it's designed and optimized
  8577. * for sorted arrays.
  8578. *
  8579. * @static
  8580. * @memberOf _
  8581. * @since 4.0.0
  8582. * @category Array
  8583. * @param {Array} array The array to inspect.
  8584. * @param {Function} [iteratee] The iteratee invoked per element.
  8585. * @returns {Array} Returns the new duplicate free array.
  8586. * @example
  8587. *
  8588. * _.sortedUniqBy([1.1, 1.2, 2.3, 2.4], Math.floor);
  8589. * // => [1.1, 2.3]
  8590. */
  8591. function sortedUniqBy(array, iteratee) {
  8592. return (array && array.length)
  8593. ? baseSortedUniq(array, getIteratee(iteratee, 2))
  8594. : [];
  8595. }
  8596. /**
  8597. * Gets all but the first element of `array`.
  8598. *
  8599. * @static
  8600. * @memberOf _
  8601. * @since 4.0.0
  8602. * @category Array
  8603. * @param {Array} array The array to query.
  8604. * @returns {Array} Returns the slice of `array`.
  8605. * @example
  8606. *
  8607. * _.tail([1, 2, 3]);
  8608. * // => [2, 3]
  8609. */
  8610. function tail(array) {
  8611. var length = array == null ? 0 : array.length;
  8612. return length ? baseSlice(array, 1, length) : [];
  8613. }
  8614. /**
  8615. * Creates a slice of `array` with `n` elements taken from the beginning.
  8616. *
  8617. * @static
  8618. * @memberOf _
  8619. * @since 0.1.0
  8620. * @category Array
  8621. * @param {Array} array The array to query.
  8622. * @param {number} [n=1] The number of elements to take.
  8623. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  8624. * @returns {Array} Returns the slice of `array`.
  8625. * @example
  8626. *
  8627. * _.take([1, 2, 3]);
  8628. * // => [1]
  8629. *
  8630. * _.take([1, 2, 3], 2);
  8631. * // => [1, 2]
  8632. *
  8633. * _.take([1, 2, 3], 5);
  8634. * // => [1, 2, 3]
  8635. *
  8636. * _.take([1, 2, 3], 0);
  8637. * // => []
  8638. */
  8639. function take(array, n, guard) {
  8640. if (!(array && array.length)) {
  8641. return [];
  8642. }
  8643. n = (guard || n === undefined) ? 1 : toInteger(n);
  8644. return baseSlice(array, 0, n < 0 ? 0 : n);
  8645. }
  8646. /**
  8647. * Creates a slice of `array` with `n` elements taken from the end.
  8648. *
  8649. * @static
  8650. * @memberOf _
  8651. * @since 3.0.0
  8652. * @category Array
  8653. * @param {Array} array The array to query.
  8654. * @param {number} [n=1] The number of elements to take.
  8655. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  8656. * @returns {Array} Returns the slice of `array`.
  8657. * @example
  8658. *
  8659. * _.takeRight([1, 2, 3]);
  8660. * // => [3]
  8661. *
  8662. * _.takeRight([1, 2, 3], 2);
  8663. * // => [2, 3]
  8664. *
  8665. * _.takeRight([1, 2, 3], 5);
  8666. * // => [1, 2, 3]
  8667. *
  8668. * _.takeRight([1, 2, 3], 0);
  8669. * // => []
  8670. */
  8671. function takeRight(array, n, guard) {
  8672. var length = array == null ? 0 : array.length;
  8673. if (!length) {
  8674. return [];
  8675. }
  8676. n = (guard || n === undefined) ? 1 : toInteger(n);
  8677. n = length - n;
  8678. return baseSlice(array, n < 0 ? 0 : n, length);
  8679. }
  8680. /**
  8681. * Creates a slice of `array` with elements taken from the end. Elements are
  8682. * taken until `predicate` returns falsey. The predicate is invoked with
  8683. * three arguments: (value, index, array).
  8684. *
  8685. * @static
  8686. * @memberOf _
  8687. * @since 3.0.0
  8688. * @category Array
  8689. * @param {Array} array The array to query.
  8690. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  8691. * @returns {Array} Returns the slice of `array`.
  8692. * @example
  8693. *
  8694. * var users = [
  8695. * { 'user': 'barney', 'active': true },
  8696. * { 'user': 'fred', 'active': false },
  8697. * { 'user': 'pebbles', 'active': false }
  8698. * ];
  8699. *
  8700. * _.takeRightWhile(users, function(o) { return !o.active; });
  8701. * // => objects for ['fred', 'pebbles']
  8702. *
  8703. * // The `_.matches` iteratee shorthand.
  8704. * _.takeRightWhile(users, { 'user': 'pebbles', 'active': false });
  8705. * // => objects for ['pebbles']
  8706. *
  8707. * // The `_.matchesProperty` iteratee shorthand.
  8708. * _.takeRightWhile(users, ['active', false]);
  8709. * // => objects for ['fred', 'pebbles']
  8710. *
  8711. * // The `_.property` iteratee shorthand.
  8712. * _.takeRightWhile(users, 'active');
  8713. * // => []
  8714. */
  8715. function takeRightWhile(array, predicate) {
  8716. return (array && array.length)
  8717. ? baseWhile(array, getIteratee(predicate, 3), false, true)
  8718. : [];
  8719. }
  8720. /**
  8721. * Creates a slice of `array` with elements taken from the beginning. Elements
  8722. * are taken until `predicate` returns falsey. The predicate is invoked with
  8723. * three arguments: (value, index, array).
  8724. *
  8725. * @static
  8726. * @memberOf _
  8727. * @since 3.0.0
  8728. * @category Array
  8729. * @param {Array} array The array to query.
  8730. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  8731. * @returns {Array} Returns the slice of `array`.
  8732. * @example
  8733. *
  8734. * var users = [
  8735. * { 'user': 'barney', 'active': false },
  8736. * { 'user': 'fred', 'active': false },
  8737. * { 'user': 'pebbles', 'active': true }
  8738. * ];
  8739. *
  8740. * _.takeWhile(users, function(o) { return !o.active; });
  8741. * // => objects for ['barney', 'fred']
  8742. *
  8743. * // The `_.matches` iteratee shorthand.
  8744. * _.takeWhile(users, { 'user': 'barney', 'active': false });
  8745. * // => objects for ['barney']
  8746. *
  8747. * // The `_.matchesProperty` iteratee shorthand.
  8748. * _.takeWhile(users, ['active', false]);
  8749. * // => objects for ['barney', 'fred']
  8750. *
  8751. * // The `_.property` iteratee shorthand.
  8752. * _.takeWhile(users, 'active');
  8753. * // => []
  8754. */
  8755. function takeWhile(array, predicate) {
  8756. return (array && array.length)
  8757. ? baseWhile(array, getIteratee(predicate, 3))
  8758. : [];
  8759. }
  8760. /**
  8761. * Creates an array of unique values, in order, from all given arrays using
  8762. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  8763. * for equality comparisons.
  8764. *
  8765. * @static
  8766. * @memberOf _
  8767. * @since 0.1.0
  8768. * @category Array
  8769. * @param {...Array} [arrays] The arrays to inspect.
  8770. * @returns {Array} Returns the new array of combined values.
  8771. * @example
  8772. *
  8773. * _.union([2], [1, 2]);
  8774. * // => [2, 1]
  8775. */
  8776. var union = baseRest(function(arrays) {
  8777. return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true));
  8778. });
  8779. /**
  8780. * This method is like `_.union` except that it accepts `iteratee` which is
  8781. * invoked for each element of each `arrays` to generate the criterion by
  8782. * which uniqueness is computed. Result values are chosen from the first
  8783. * array in which the value occurs. The iteratee is invoked with one argument:
  8784. * (value).
  8785. *
  8786. * @static
  8787. * @memberOf _
  8788. * @since 4.0.0
  8789. * @category Array
  8790. * @param {...Array} [arrays] The arrays to inspect.
  8791. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  8792. * @returns {Array} Returns the new array of combined values.
  8793. * @example
  8794. *
  8795. * _.unionBy([2.1], [1.2, 2.3], Math.floor);
  8796. * // => [2.1, 1.2]
  8797. *
  8798. * // The `_.property` iteratee shorthand.
  8799. * _.unionBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x');
  8800. * // => [{ 'x': 1 }, { 'x': 2 }]
  8801. */
  8802. var unionBy = baseRest(function(arrays) {
  8803. var iteratee = last(arrays);
  8804. if (isArrayLikeObject(iteratee)) {
  8805. iteratee = undefined;
  8806. }
  8807. return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true), getIteratee(iteratee, 2));
  8808. });
  8809. /**
  8810. * This method is like `_.union` except that it accepts `comparator` which
  8811. * is invoked to compare elements of `arrays`. Result values are chosen from
  8812. * the first array in which the value occurs. The comparator is invoked
  8813. * with two arguments: (arrVal, othVal).
  8814. *
  8815. * @static
  8816. * @memberOf _
  8817. * @since 4.0.0
  8818. * @category Array
  8819. * @param {...Array} [arrays] The arrays to inspect.
  8820. * @param {Function} [comparator] The comparator invoked per element.
  8821. * @returns {Array} Returns the new array of combined values.
  8822. * @example
  8823. *
  8824. * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }];
  8825. * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }];
  8826. *
  8827. * _.unionWith(objects, others, _.isEqual);
  8828. * // => [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }, { 'x': 1, 'y': 1 }]
  8829. */
  8830. var unionWith = baseRest(function(arrays) {
  8831. var comparator = last(arrays);
  8832. comparator = typeof comparator == 'function' ? comparator : undefined;
  8833. return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true), undefined, comparator);
  8834. });
  8835. /**
  8836. * Creates a duplicate-free version of an array, using
  8837. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  8838. * for equality comparisons, in which only the first occurrence of each element
  8839. * is kept. The order of result values is determined by the order they occur
  8840. * in the array.
  8841. *
  8842. * @static
  8843. * @memberOf _
  8844. * @since 0.1.0
  8845. * @category Array
  8846. * @param {Array} array The array to inspect.
  8847. * @returns {Array} Returns the new duplicate free array.
  8848. * @example
  8849. *
  8850. * _.uniq([2, 1, 2]);
  8851. * // => [2, 1]
  8852. */
  8853. function uniq(array) {
  8854. return (array && array.length) ? baseUniq(array) : [];
  8855. }
  8856. /**
  8857. * This method is like `_.uniq` except that it accepts `iteratee` which is
  8858. * invoked for each element in `array` to generate the criterion by which
  8859. * uniqueness is computed. The order of result values is determined by the
  8860. * order they occur in the array. The iteratee is invoked with one argument:
  8861. * (value).
  8862. *
  8863. * @static
  8864. * @memberOf _
  8865. * @since 4.0.0
  8866. * @category Array
  8867. * @param {Array} array The array to inspect.
  8868. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  8869. * @returns {Array} Returns the new duplicate free array.
  8870. * @example
  8871. *
  8872. * _.uniqBy([2.1, 1.2, 2.3], Math.floor);
  8873. * // => [2.1, 1.2]
  8874. *
  8875. * // The `_.property` iteratee shorthand.
  8876. * _.uniqBy([{ 'x': 1 }, { 'x': 2 }, { 'x': 1 }], 'x');
  8877. * // => [{ 'x': 1 }, { 'x': 2 }]
  8878. */
  8879. function uniqBy(array, iteratee) {
  8880. return (array && array.length) ? baseUniq(array, getIteratee(iteratee, 2)) : [];
  8881. }
  8882. /**
  8883. * This method is like `_.uniq` except that it accepts `comparator` which
  8884. * is invoked to compare elements of `array`. The order of result values is
  8885. * determined by the order they occur in the array.The comparator is invoked
  8886. * with two arguments: (arrVal, othVal).
  8887. *
  8888. * @static
  8889. * @memberOf _
  8890. * @since 4.0.0
  8891. * @category Array
  8892. * @param {Array} array The array to inspect.
  8893. * @param {Function} [comparator] The comparator invoked per element.
  8894. * @returns {Array} Returns the new duplicate free array.
  8895. * @example
  8896. *
  8897. * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }, { 'x': 1, 'y': 2 }];
  8898. *
  8899. * _.uniqWith(objects, _.isEqual);
  8900. * // => [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }]
  8901. */
  8902. function uniqWith(array, comparator) {
  8903. comparator = typeof comparator == 'function' ? comparator : undefined;
  8904. return (array && array.length) ? baseUniq(array, undefined, comparator) : [];
  8905. }
  8906. /**
  8907. * This method is like `_.zip` except that it accepts an array of grouped
  8908. * elements and creates an array regrouping the elements to their pre-zip
  8909. * configuration.
  8910. *
  8911. * @static
  8912. * @memberOf _
  8913. * @since 1.2.0
  8914. * @category Array
  8915. * @param {Array} array The array of grouped elements to process.
  8916. * @returns {Array} Returns the new array of regrouped elements.
  8917. * @example
  8918. *
  8919. * var zipped = _.zip(['a', 'b'], [1, 2], [true, false]);
  8920. * // => [['a', 1, true], ['b', 2, false]]
  8921. *
  8922. * _.unzip(zipped);
  8923. * // => [['a', 'b'], [1, 2], [true, false]]
  8924. */
  8925. function unzip(array) {
  8926. if (!(array && array.length)) {
  8927. return [];
  8928. }
  8929. var length = 0;
  8930. array = arrayFilter(array, function(group) {
  8931. if (isArrayLikeObject(group)) {
  8932. length = nativeMax(group.length, length);
  8933. return true;
  8934. }
  8935. });
  8936. return baseTimes(length, function(index) {
  8937. return arrayMap(array, baseProperty(index));
  8938. });
  8939. }
  8940. /**
  8941. * This method is like `_.unzip` except that it accepts `iteratee` to specify
  8942. * how regrouped values should be combined. The iteratee is invoked with the
  8943. * elements of each group: (...group).
  8944. *
  8945. * @static
  8946. * @memberOf _
  8947. * @since 3.8.0
  8948. * @category Array
  8949. * @param {Array} array The array of grouped elements to process.
  8950. * @param {Function} [iteratee=_.identity] The function to combine
  8951. * regrouped values.
  8952. * @returns {Array} Returns the new array of regrouped elements.
  8953. * @example
  8954. *
  8955. * var zipped = _.zip([1, 2], [10, 20], [100, 200]);
  8956. * // => [[1, 10, 100], [2, 20, 200]]
  8957. *
  8958. * _.unzipWith(zipped, _.add);
  8959. * // => [3, 30, 300]
  8960. */
  8961. function unzipWith(array, iteratee) {
  8962. if (!(array && array.length)) {
  8963. return [];
  8964. }
  8965. var result = unzip(array);
  8966. if (iteratee == null) {
  8967. return result;
  8968. }
  8969. return arrayMap(result, function(group) {
  8970. return apply(iteratee, undefined, group);
  8971. });
  8972. }
  8973. /**
  8974. * Creates an array excluding all given values using
  8975. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  8976. * for equality comparisons.
  8977. *
  8978. * **Note:** Unlike `_.pull`, this method returns a new array.
  8979. *
  8980. * @static
  8981. * @memberOf _
  8982. * @since 0.1.0
  8983. * @category Array
  8984. * @param {Array} array The array to inspect.
  8985. * @param {...*} [values] The values to exclude.
  8986. * @returns {Array} Returns the new array of filtered values.
  8987. * @see _.difference, _.xor
  8988. * @example
  8989. *
  8990. * _.without([2, 1, 2, 3], 1, 2);
  8991. * // => [3]
  8992. */
  8993. var without = baseRest(function(array, values) {
  8994. return isArrayLikeObject(array)
  8995. ? baseDifference(array, values)
  8996. : [];
  8997. });
  8998. /**
  8999. * Creates an array of unique values that is the
  9000. * [symmetric difference](https://en.wikipedia.org/wiki/Symmetric_difference)
  9001. * of the given arrays. The order of result values is determined by the order
  9002. * they occur in the arrays.
  9003. *
  9004. * @static
  9005. * @memberOf _
  9006. * @since 2.4.0
  9007. * @category Array
  9008. * @param {...Array} [arrays] The arrays to inspect.
  9009. * @returns {Array} Returns the new array of filtered values.
  9010. * @see _.difference, _.without
  9011. * @example
  9012. *
  9013. * _.xor([2, 1], [2, 3]);
  9014. * // => [1, 3]
  9015. */
  9016. var xor = baseRest(function(arrays) {
  9017. return baseXor(arrayFilter(arrays, isArrayLikeObject));
  9018. });
  9019. /**
  9020. * This method is like `_.xor` except that it accepts `iteratee` which is
  9021. * invoked for each element of each `arrays` to generate the criterion by
  9022. * which by which they're compared. The order of result values is determined
  9023. * by the order they occur in the arrays. The iteratee is invoked with one
  9024. * argument: (value).
  9025. *
  9026. * @static
  9027. * @memberOf _
  9028. * @since 4.0.0
  9029. * @category Array
  9030. * @param {...Array} [arrays] The arrays to inspect.
  9031. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  9032. * @returns {Array} Returns the new array of filtered values.
  9033. * @example
  9034. *
  9035. * _.xorBy([2.1, 1.2], [2.3, 3.4], Math.floor);
  9036. * // => [1.2, 3.4]
  9037. *
  9038. * // The `_.property` iteratee shorthand.
  9039. * _.xorBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x');
  9040. * // => [{ 'x': 2 }]
  9041. */
  9042. var xorBy = baseRest(function(arrays) {
  9043. var iteratee = last(arrays);
  9044. if (isArrayLikeObject(iteratee)) {
  9045. iteratee = undefined;
  9046. }
  9047. return baseXor(arrayFilter(arrays, isArrayLikeObject), getIteratee(iteratee, 2));
  9048. });
  9049. /**
  9050. * This method is like `_.xor` except that it accepts `comparator` which is
  9051. * invoked to compare elements of `arrays`. The order of result values is
  9052. * determined by the order they occur in the arrays. The comparator is invoked
  9053. * with two arguments: (arrVal, othVal).
  9054. *
  9055. * @static
  9056. * @memberOf _
  9057. * @since 4.0.0
  9058. * @category Array
  9059. * @param {...Array} [arrays] The arrays to inspect.
  9060. * @param {Function} [comparator] The comparator invoked per element.
  9061. * @returns {Array} Returns the new array of filtered values.
  9062. * @example
  9063. *
  9064. * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }];
  9065. * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }];
  9066. *
  9067. * _.xorWith(objects, others, _.isEqual);
  9068. * // => [{ 'x': 2, 'y': 1 }, { 'x': 1, 'y': 1 }]
  9069. */
  9070. var xorWith = baseRest(function(arrays) {
  9071. var comparator = last(arrays);
  9072. comparator = typeof comparator == 'function' ? comparator : undefined;
  9073. return baseXor(arrayFilter(arrays, isArrayLikeObject), undefined, comparator);
  9074. });
  9075. /**
  9076. * Creates an array of grouped elements, the first of which contains the
  9077. * first elements of the given arrays, the second of which contains the
  9078. * second elements of the given arrays, and so on.
  9079. *
  9080. * @static
  9081. * @memberOf _
  9082. * @since 0.1.0
  9083. * @category Array
  9084. * @param {...Array} [arrays] The arrays to process.
  9085. * @returns {Array} Returns the new array of grouped elements.
  9086. * @example
  9087. *
  9088. * _.zip(['a', 'b'], [1, 2], [true, false]);
  9089. * // => [['a', 1, true], ['b', 2, false]]
  9090. */
  9091. var zip = baseRest(unzip);
  9092. /**
  9093. * This method is like `_.fromPairs` except that it accepts two arrays,
  9094. * one of property identifiers and one of corresponding values.
  9095. *
  9096. * @static
  9097. * @memberOf _
  9098. * @since 0.4.0
  9099. * @category Array
  9100. * @param {Array} [props=[]] The property identifiers.
  9101. * @param {Array} [values=[]] The property values.
  9102. * @returns {Object} Returns the new object.
  9103. * @example
  9104. *
  9105. * _.zipObject(['a', 'b'], [1, 2]);
  9106. * // => { 'a': 1, 'b': 2 }
  9107. */
  9108. function zipObject(props, values) {
  9109. return baseZipObject(props || [], values || [], assignValue);
  9110. }
  9111. /**
  9112. * This method is like `_.zipObject` except that it supports property paths.
  9113. *
  9114. * @static
  9115. * @memberOf _
  9116. * @since 4.1.0
  9117. * @category Array
  9118. * @param {Array} [props=[]] The property identifiers.
  9119. * @param {Array} [values=[]] The property values.
  9120. * @returns {Object} Returns the new object.
  9121. * @example
  9122. *
  9123. * _.zipObjectDeep(['a.b[0].c', 'a.b[1].d'], [1, 2]);
  9124. * // => { 'a': { 'b': [{ 'c': 1 }, { 'd': 2 }] } }
  9125. */
  9126. function zipObjectDeep(props, values) {
  9127. return baseZipObject(props || [], values || [], baseSet);
  9128. }
  9129. /**
  9130. * This method is like `_.zip` except that it accepts `iteratee` to specify
  9131. * how grouped values should be combined. The iteratee is invoked with the
  9132. * elements of each group: (...group).
  9133. *
  9134. * @static
  9135. * @memberOf _
  9136. * @since 3.8.0
  9137. * @category Array
  9138. * @param {...Array} [arrays] The arrays to process.
  9139. * @param {Function} [iteratee=_.identity] The function to combine
  9140. * grouped values.
  9141. * @returns {Array} Returns the new array of grouped elements.
  9142. * @example
  9143. *
  9144. * _.zipWith([1, 2], [10, 20], [100, 200], function(a, b, c) {
  9145. * return a + b + c;
  9146. * });
  9147. * // => [111, 222]
  9148. */
  9149. var zipWith = baseRest(function(arrays) {
  9150. var length = arrays.length,
  9151. iteratee = length > 1 ? arrays[length - 1] : undefined;
  9152. iteratee = typeof iteratee == 'function' ? (arrays.pop(), iteratee) : undefined;
  9153. return unzipWith(arrays, iteratee);
  9154. });
  9155. /*------------------------------------------------------------------------*/
  9156. /**
  9157. * Creates a `lodash` wrapper instance that wraps `value` with explicit method
  9158. * chain sequences enabled. The result of such sequences must be unwrapped
  9159. * with `_#value`.
  9160. *
  9161. * @static
  9162. * @memberOf _
  9163. * @since 1.3.0
  9164. * @category Seq
  9165. * @param {*} value The value to wrap.
  9166. * @returns {Object} Returns the new `lodash` wrapper instance.
  9167. * @example
  9168. *
  9169. * var users = [
  9170. * { 'user': 'barney', 'age': 36 },
  9171. * { 'user': 'fred', 'age': 40 },
  9172. * { 'user': 'pebbles', 'age': 1 }
  9173. * ];
  9174. *
  9175. * var youngest = _
  9176. * .chain(users)
  9177. * .sortBy('age')
  9178. * .map(function(o) {
  9179. * return o.user + ' is ' + o.age;
  9180. * })
  9181. * .head()
  9182. * .value();
  9183. * // => 'pebbles is 1'
  9184. */
  9185. function chain(value) {
  9186. var result = lodash(value);
  9187. result.__chain__ = true;
  9188. return result;
  9189. }
  9190. /**
  9191. * This method invokes `interceptor` and returns `value`. The interceptor
  9192. * is invoked with one argument; (value). The purpose of this method is to
  9193. * "tap into" a method chain sequence in order to modify intermediate results.
  9194. *
  9195. * @static
  9196. * @memberOf _
  9197. * @since 0.1.0
  9198. * @category Seq
  9199. * @param {*} value The value to provide to `interceptor`.
  9200. * @param {Function} interceptor The function to invoke.
  9201. * @returns {*} Returns `value`.
  9202. * @example
  9203. *
  9204. * _([1, 2, 3])
  9205. * .tap(function(array) {
  9206. * // Mutate input array.
  9207. * array.pop();
  9208. * })
  9209. * .reverse()
  9210. * .value();
  9211. * // => [2, 1]
  9212. */
  9213. function tap(value, interceptor) {
  9214. interceptor(value);
  9215. return value;
  9216. }
  9217. /**
  9218. * This method is like `_.tap` except that it returns the result of `interceptor`.
  9219. * The purpose of this method is to "pass thru" values replacing intermediate
  9220. * results in a method chain sequence.
  9221. *
  9222. * @static
  9223. * @memberOf _
  9224. * @since 3.0.0
  9225. * @category Seq
  9226. * @param {*} value The value to provide to `interceptor`.
  9227. * @param {Function} interceptor The function to invoke.
  9228. * @returns {*} Returns the result of `interceptor`.
  9229. * @example
  9230. *
  9231. * _(' abc ')
  9232. * .chain()
  9233. * .trim()
  9234. * .thru(function(value) {
  9235. * return [value];
  9236. * })
  9237. * .value();
  9238. * // => ['abc']
  9239. */
  9240. function thru(value, interceptor) {
  9241. return interceptor(value);
  9242. }
  9243. /**
  9244. * This method is the wrapper version of `_.at`.
  9245. *
  9246. * @name at
  9247. * @memberOf _
  9248. * @since 1.0.0
  9249. * @category Seq
  9250. * @param {...(string|string[])} [paths] The property paths to pick.
  9251. * @returns {Object} Returns the new `lodash` wrapper instance.
  9252. * @example
  9253. *
  9254. * var object = { 'a': [{ 'b': { 'c': 3 } }, 4] };
  9255. *
  9256. * _(object).at(['a[0].b.c', 'a[1]']).value();
  9257. * // => [3, 4]
  9258. */
  9259. var wrapperAt = flatRest(function(paths) {
  9260. var length = paths.length,
  9261. start = length ? paths[0] : 0,
  9262. value = this.__wrapped__,
  9263. interceptor = function(object) { return baseAt(object, paths); };
  9264. if (length > 1 || this.__actions__.length ||
  9265. !(value instanceof LazyWrapper) || !isIndex(start)) {
  9266. return this.thru(interceptor);
  9267. }
  9268. value = value.slice(start, +start + (length ? 1 : 0));
  9269. value.__actions__.push({
  9270. 'func': thru,
  9271. 'args': [interceptor],
  9272. 'thisArg': undefined
  9273. });
  9274. return new LodashWrapper(value, this.__chain__).thru(function(array) {
  9275. if (length && !array.length) {
  9276. array.push(undefined);
  9277. }
  9278. return array;
  9279. });
  9280. });
  9281. /**
  9282. * Creates a `lodash` wrapper instance with explicit method chain sequences enabled.
  9283. *
  9284. * @name chain
  9285. * @memberOf _
  9286. * @since 0.1.0
  9287. * @category Seq
  9288. * @returns {Object} Returns the new `lodash` wrapper instance.
  9289. * @example
  9290. *
  9291. * var users = [
  9292. * { 'user': 'barney', 'age': 36 },
  9293. * { 'user': 'fred', 'age': 40 }
  9294. * ];
  9295. *
  9296. * // A sequence without explicit chaining.
  9297. * _(users).head();
  9298. * // => { 'user': 'barney', 'age': 36 }
  9299. *
  9300. * // A sequence with explicit chaining.
  9301. * _(users)
  9302. * .chain()
  9303. * .head()
  9304. * .pick('user')
  9305. * .value();
  9306. * // => { 'user': 'barney' }
  9307. */
  9308. function wrapperChain() {
  9309. return chain(this);
  9310. }
  9311. /**
  9312. * Executes the chain sequence and returns the wrapped result.
  9313. *
  9314. * @name commit
  9315. * @memberOf _
  9316. * @since 3.2.0
  9317. * @category Seq
  9318. * @returns {Object} Returns the new `lodash` wrapper instance.
  9319. * @example
  9320. *
  9321. * var array = [1, 2];
  9322. * var wrapped = _(array).push(3);
  9323. *
  9324. * console.log(array);
  9325. * // => [1, 2]
  9326. *
  9327. * wrapped = wrapped.commit();
  9328. * console.log(array);
  9329. * // => [1, 2, 3]
  9330. *
  9331. * wrapped.last();
  9332. * // => 3
  9333. *
  9334. * console.log(array);
  9335. * // => [1, 2, 3]
  9336. */
  9337. function wrapperCommit() {
  9338. return new LodashWrapper(this.value(), this.__chain__);
  9339. }
  9340. /**
  9341. * Gets the next value on a wrapped object following the
  9342. * [iterator protocol](https://mdn.io/iteration_protocols#iterator).
  9343. *
  9344. * @name next
  9345. * @memberOf _
  9346. * @since 4.0.0
  9347. * @category Seq
  9348. * @returns {Object} Returns the next iterator value.
  9349. * @example
  9350. *
  9351. * var wrapped = _([1, 2]);
  9352. *
  9353. * wrapped.next();
  9354. * // => { 'done': false, 'value': 1 }
  9355. *
  9356. * wrapped.next();
  9357. * // => { 'done': false, 'value': 2 }
  9358. *
  9359. * wrapped.next();
  9360. * // => { 'done': true, 'value': undefined }
  9361. */
  9362. function wrapperNext() {
  9363. if (this.__values__ === undefined) {
  9364. this.__values__ = toArray(this.value());
  9365. }
  9366. var done = this.__index__ >= this.__values__.length,
  9367. value = done ? undefined : this.__values__[this.__index__++];
  9368. return { 'done': done, 'value': value };
  9369. }
  9370. /**
  9371. * Enables the wrapper to be iterable.
  9372. *
  9373. * @name Symbol.iterator
  9374. * @memberOf _
  9375. * @since 4.0.0
  9376. * @category Seq
  9377. * @returns {Object} Returns the wrapper object.
  9378. * @example
  9379. *
  9380. * var wrapped = _([1, 2]);
  9381. *
  9382. * wrapped[Symbol.iterator]() === wrapped;
  9383. * // => true
  9384. *
  9385. * Array.from(wrapped);
  9386. * // => [1, 2]
  9387. */
  9388. function wrapperToIterator() {
  9389. return this;
  9390. }
  9391. /**
  9392. * Creates a clone of the chain sequence planting `value` as the wrapped value.
  9393. *
  9394. * @name plant
  9395. * @memberOf _
  9396. * @since 3.2.0
  9397. * @category Seq
  9398. * @param {*} value The value to plant.
  9399. * @returns {Object} Returns the new `lodash` wrapper instance.
  9400. * @example
  9401. *
  9402. * function square(n) {
  9403. * return n * n;
  9404. * }
  9405. *
  9406. * var wrapped = _([1, 2]).map(square);
  9407. * var other = wrapped.plant([3, 4]);
  9408. *
  9409. * other.value();
  9410. * // => [9, 16]
  9411. *
  9412. * wrapped.value();
  9413. * // => [1, 4]
  9414. */
  9415. function wrapperPlant(value) {
  9416. var result,
  9417. parent = this;
  9418. while (parent instanceof baseLodash) {
  9419. var clone = wrapperClone(parent);
  9420. clone.__index__ = 0;
  9421. clone.__values__ = undefined;
  9422. if (result) {
  9423. previous.__wrapped__ = clone;
  9424. } else {
  9425. result = clone;
  9426. }
  9427. var previous = clone;
  9428. parent = parent.__wrapped__;
  9429. }
  9430. previous.__wrapped__ = value;
  9431. return result;
  9432. }
  9433. /**
  9434. * This method is the wrapper version of `_.reverse`.
  9435. *
  9436. * **Note:** This method mutates the wrapped array.
  9437. *
  9438. * @name reverse
  9439. * @memberOf _
  9440. * @since 0.1.0
  9441. * @category Seq
  9442. * @returns {Object} Returns the new `lodash` wrapper instance.
  9443. * @example
  9444. *
  9445. * var array = [1, 2, 3];
  9446. *
  9447. * _(array).reverse().value()
  9448. * // => [3, 2, 1]
  9449. *
  9450. * console.log(array);
  9451. * // => [3, 2, 1]
  9452. */
  9453. function wrapperReverse() {
  9454. var value = this.__wrapped__;
  9455. if (value instanceof LazyWrapper) {
  9456. var wrapped = value;
  9457. if (this.__actions__.length) {
  9458. wrapped = new LazyWrapper(this);
  9459. }
  9460. wrapped = wrapped.reverse();
  9461. wrapped.__actions__.push({
  9462. 'func': thru,
  9463. 'args': [reverse],
  9464. 'thisArg': undefined
  9465. });
  9466. return new LodashWrapper(wrapped, this.__chain__);
  9467. }
  9468. return this.thru(reverse);
  9469. }
  9470. /**
  9471. * Executes the chain sequence to resolve the unwrapped value.
  9472. *
  9473. * @name value
  9474. * @memberOf _
  9475. * @since 0.1.0
  9476. * @alias toJSON, valueOf
  9477. * @category Seq
  9478. * @returns {*} Returns the resolved unwrapped value.
  9479. * @example
  9480. *
  9481. * _([1, 2, 3]).value();
  9482. * // => [1, 2, 3]
  9483. */
  9484. function wrapperValue() {
  9485. return baseWrapperValue(this.__wrapped__, this.__actions__);
  9486. }
  9487. /*------------------------------------------------------------------------*/
  9488. /**
  9489. * Creates an object composed of keys generated from the results of running
  9490. * each element of `collection` thru `iteratee`. The corresponding value of
  9491. * each key is the number of times the key was returned by `iteratee`. The
  9492. * iteratee is invoked with one argument: (value).
  9493. *
  9494. * @static
  9495. * @memberOf _
  9496. * @since 0.5.0
  9497. * @category Collection
  9498. * @param {Array|Object} collection The collection to iterate over.
  9499. * @param {Function} [iteratee=_.identity] The iteratee to transform keys.
  9500. * @returns {Object} Returns the composed aggregate object.
  9501. * @example
  9502. *
  9503. * _.countBy([6.1, 4.2, 6.3], Math.floor);
  9504. * // => { '4': 1, '6': 2 }
  9505. *
  9506. * // The `_.property` iteratee shorthand.
  9507. * _.countBy(['one', 'two', 'three'], 'length');
  9508. * // => { '3': 2, '5': 1 }
  9509. */
  9510. var countBy = createAggregator(function(result, value, key) {
  9511. if (hasOwnProperty.call(result, key)) {
  9512. ++result[key];
  9513. } else {
  9514. baseAssignValue(result, key, 1);
  9515. }
  9516. });
  9517. /**
  9518. * Checks if `predicate` returns truthy for **all** elements of `collection`.
  9519. * Iteration is stopped once `predicate` returns falsey. The predicate is
  9520. * invoked with three arguments: (value, index|key, collection).
  9521. *
  9522. * **Note:** This method returns `true` for
  9523. * [empty collections](https://en.wikipedia.org/wiki/Empty_set) because
  9524. * [everything is true](https://en.wikipedia.org/wiki/Vacuous_truth) of
  9525. * elements of empty collections.
  9526. *
  9527. * @static
  9528. * @memberOf _
  9529. * @since 0.1.0
  9530. * @category Collection
  9531. * @param {Array|Object} collection The collection to iterate over.
  9532. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  9533. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  9534. * @returns {boolean} Returns `true` if all elements pass the predicate check,
  9535. * else `false`.
  9536. * @example
  9537. *
  9538. * _.every([true, 1, null, 'yes'], Boolean);
  9539. * // => false
  9540. *
  9541. * var users = [
  9542. * { 'user': 'barney', 'age': 36, 'active': false },
  9543. * { 'user': 'fred', 'age': 40, 'active': false }
  9544. * ];
  9545. *
  9546. * // The `_.matches` iteratee shorthand.
  9547. * _.every(users, { 'user': 'barney', 'active': false });
  9548. * // => false
  9549. *
  9550. * // The `_.matchesProperty` iteratee shorthand.
  9551. * _.every(users, ['active', false]);
  9552. * // => true
  9553. *
  9554. * // The `_.property` iteratee shorthand.
  9555. * _.every(users, 'active');
  9556. * // => false
  9557. */
  9558. function every(collection, predicate, guard) {
  9559. var func = isArray(collection) ? arrayEvery : baseEvery;
  9560. if (guard && isIterateeCall(collection, predicate, guard)) {
  9561. predicate = undefined;
  9562. }
  9563. return func(collection, getIteratee(predicate, 3));
  9564. }
  9565. /**
  9566. * Iterates over elements of `collection`, returning an array of all elements
  9567. * `predicate` returns truthy for. The predicate is invoked with three
  9568. * arguments: (value, index|key, collection).
  9569. *
  9570. * **Note:** Unlike `_.remove`, this method returns a new array.
  9571. *
  9572. * @static
  9573. * @memberOf _
  9574. * @since 0.1.0
  9575. * @category Collection
  9576. * @param {Array|Object} collection The collection to iterate over.
  9577. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  9578. * @returns {Array} Returns the new filtered array.
  9579. * @see _.reject
  9580. * @example
  9581. *
  9582. * var users = [
  9583. * { 'user': 'barney', 'age': 36, 'active': true },
  9584. * { 'user': 'fred', 'age': 40, 'active': false }
  9585. * ];
  9586. *
  9587. * _.filter(users, function(o) { return !o.active; });
  9588. * // => objects for ['fred']
  9589. *
  9590. * // The `_.matches` iteratee shorthand.
  9591. * _.filter(users, { 'age': 36, 'active': true });
  9592. * // => objects for ['barney']
  9593. *
  9594. * // The `_.matchesProperty` iteratee shorthand.
  9595. * _.filter(users, ['active', false]);
  9596. * // => objects for ['fred']
  9597. *
  9598. * // The `_.property` iteratee shorthand.
  9599. * _.filter(users, 'active');
  9600. * // => objects for ['barney']
  9601. *
  9602. * // Combining several predicates using `_.overEvery` or `_.overSome`.
  9603. * _.filter(users, _.overSome([{ 'age': 36 }, ['age', 40]]));
  9604. * // => objects for ['fred', 'barney']
  9605. */
  9606. function filter(collection, predicate) {
  9607. var func = isArray(collection) ? arrayFilter : baseFilter;
  9608. return func(collection, getIteratee(predicate, 3));
  9609. }
  9610. /**
  9611. * Iterates over elements of `collection`, returning the first element
  9612. * `predicate` returns truthy for. The predicate is invoked with three
  9613. * arguments: (value, index|key, collection).
  9614. *
  9615. * @static
  9616. * @memberOf _
  9617. * @since 0.1.0
  9618. * @category Collection
  9619. * @param {Array|Object} collection The collection to inspect.
  9620. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  9621. * @param {number} [fromIndex=0] The index to search from.
  9622. * @returns {*} Returns the matched element, else `undefined`.
  9623. * @example
  9624. *
  9625. * var users = [
  9626. * { 'user': 'barney', 'age': 36, 'active': true },
  9627. * { 'user': 'fred', 'age': 40, 'active': false },
  9628. * { 'user': 'pebbles', 'age': 1, 'active': true }
  9629. * ];
  9630. *
  9631. * _.find(users, function(o) { return o.age < 40; });
  9632. * // => object for 'barney'
  9633. *
  9634. * // The `_.matches` iteratee shorthand.
  9635. * _.find(users, { 'age': 1, 'active': true });
  9636. * // => object for 'pebbles'
  9637. *
  9638. * // The `_.matchesProperty` iteratee shorthand.
  9639. * _.find(users, ['active', false]);
  9640. * // => object for 'fred'
  9641. *
  9642. * // The `_.property` iteratee shorthand.
  9643. * _.find(users, 'active');
  9644. * // => object for 'barney'
  9645. */
  9646. var find = createFind(findIndex);
  9647. /**
  9648. * This method is like `_.find` except that it iterates over elements of
  9649. * `collection` from right to left.
  9650. *
  9651. * @static
  9652. * @memberOf _
  9653. * @since 2.0.0
  9654. * @category Collection
  9655. * @param {Array|Object} collection The collection to inspect.
  9656. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  9657. * @param {number} [fromIndex=collection.length-1] The index to search from.
  9658. * @returns {*} Returns the matched element, else `undefined`.
  9659. * @example
  9660. *
  9661. * _.findLast([1, 2, 3, 4], function(n) {
  9662. * return n % 2 == 1;
  9663. * });
  9664. * // => 3
  9665. */
  9666. var findLast = createFind(findLastIndex);
  9667. /**
  9668. * Creates a flattened array of values by running each element in `collection`
  9669. * thru `iteratee` and flattening the mapped results. The iteratee is invoked
  9670. * with three arguments: (value, index|key, collection).
  9671. *
  9672. * @static
  9673. * @memberOf _
  9674. * @since 4.0.0
  9675. * @category Collection
  9676. * @param {Array|Object} collection The collection to iterate over.
  9677. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  9678. * @returns {Array} Returns the new flattened array.
  9679. * @example
  9680. *
  9681. * function duplicate(n) {
  9682. * return [n, n];
  9683. * }
  9684. *
  9685. * _.flatMap([1, 2], duplicate);
  9686. * // => [1, 1, 2, 2]
  9687. */
  9688. function flatMap(collection, iteratee) {
  9689. return baseFlatten(map(collection, iteratee), 1);
  9690. }
  9691. /**
  9692. * This method is like `_.flatMap` except that it recursively flattens the
  9693. * mapped results.
  9694. *
  9695. * @static
  9696. * @memberOf _
  9697. * @since 4.7.0
  9698. * @category Collection
  9699. * @param {Array|Object} collection The collection to iterate over.
  9700. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  9701. * @returns {Array} Returns the new flattened array.
  9702. * @example
  9703. *
  9704. * function duplicate(n) {
  9705. * return [[[n, n]]];
  9706. * }
  9707. *
  9708. * _.flatMapDeep([1, 2], duplicate);
  9709. * // => [1, 1, 2, 2]
  9710. */
  9711. function flatMapDeep(collection, iteratee) {
  9712. return baseFlatten(map(collection, iteratee), INFINITY);
  9713. }
  9714. /**
  9715. * This method is like `_.flatMap` except that it recursively flattens the
  9716. * mapped results up to `depth` times.
  9717. *
  9718. * @static
  9719. * @memberOf _
  9720. * @since 4.7.0
  9721. * @category Collection
  9722. * @param {Array|Object} collection The collection to iterate over.
  9723. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  9724. * @param {number} [depth=1] The maximum recursion depth.
  9725. * @returns {Array} Returns the new flattened array.
  9726. * @example
  9727. *
  9728. * function duplicate(n) {
  9729. * return [[[n, n]]];
  9730. * }
  9731. *
  9732. * _.flatMapDepth([1, 2], duplicate, 2);
  9733. * // => [[1, 1], [2, 2]]
  9734. */
  9735. function flatMapDepth(collection, iteratee, depth) {
  9736. depth = depth === undefined ? 1 : toInteger(depth);
  9737. return baseFlatten(map(collection, iteratee), depth);
  9738. }
  9739. /**
  9740. * Iterates over elements of `collection` and invokes `iteratee` for each element.
  9741. * The iteratee is invoked with three arguments: (value, index|key, collection).
  9742. * Iteratee functions may exit iteration early by explicitly returning `false`.
  9743. *
  9744. * **Note:** As with other "Collections" methods, objects with a "length"
  9745. * property are iterated like arrays. To avoid this behavior use `_.forIn`
  9746. * or `_.forOwn` for object iteration.
  9747. *
  9748. * @static
  9749. * @memberOf _
  9750. * @since 0.1.0
  9751. * @alias each
  9752. * @category Collection
  9753. * @param {Array|Object} collection The collection to iterate over.
  9754. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  9755. * @returns {Array|Object} Returns `collection`.
  9756. * @see _.forEachRight
  9757. * @example
  9758. *
  9759. * _.forEach([1, 2], function(value) {
  9760. * console.log(value);
  9761. * });
  9762. * // => Logs `1` then `2`.
  9763. *
  9764. * _.forEach({ 'a': 1, 'b': 2 }, function(value, key) {
  9765. * console.log(key);
  9766. * });
  9767. * // => Logs 'a' then 'b' (iteration order is not guaranteed).
  9768. */
  9769. function forEach(collection, iteratee) {
  9770. var func = isArray(collection) ? arrayEach : baseEach;
  9771. return func(collection, getIteratee(iteratee, 3));
  9772. }
  9773. /**
  9774. * This method is like `_.forEach` except that it iterates over elements of
  9775. * `collection` from right to left.
  9776. *
  9777. * @static
  9778. * @memberOf _
  9779. * @since 2.0.0
  9780. * @alias eachRight
  9781. * @category Collection
  9782. * @param {Array|Object} collection The collection to iterate over.
  9783. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  9784. * @returns {Array|Object} Returns `collection`.
  9785. * @see _.forEach
  9786. * @example
  9787. *
  9788. * _.forEachRight([1, 2], function(value) {
  9789. * console.log(value);
  9790. * });
  9791. * // => Logs `2` then `1`.
  9792. */
  9793. function forEachRight(collection, iteratee) {
  9794. var func = isArray(collection) ? arrayEachRight : baseEachRight;
  9795. return func(collection, getIteratee(iteratee, 3));
  9796. }
  9797. /**
  9798. * Creates an object composed of keys generated from the results of running
  9799. * each element of `collection` thru `iteratee`. The order of grouped values
  9800. * is determined by the order they occur in `collection`. The corresponding
  9801. * value of each key is an array of elements responsible for generating the
  9802. * key. The iteratee is invoked with one argument: (value).
  9803. *
  9804. * @static
  9805. * @memberOf _
  9806. * @since 0.1.0
  9807. * @category Collection
  9808. * @param {Array|Object} collection The collection to iterate over.
  9809. * @param {Function} [iteratee=_.identity] The iteratee to transform keys.
  9810. * @returns {Object} Returns the composed aggregate object.
  9811. * @example
  9812. *
  9813. * _.groupBy([6.1, 4.2, 6.3], Math.floor);
  9814. * // => { '4': [4.2], '6': [6.1, 6.3] }
  9815. *
  9816. * // The `_.property` iteratee shorthand.
  9817. * _.groupBy(['one', 'two', 'three'], 'length');
  9818. * // => { '3': ['one', 'two'], '5': ['three'] }
  9819. */
  9820. var groupBy = createAggregator(function(result, value, key) {
  9821. if (hasOwnProperty.call(result, key)) {
  9822. result[key].push(value);
  9823. } else {
  9824. baseAssignValue(result, key, [value]);
  9825. }
  9826. });
  9827. /**
  9828. * Checks if `value` is in `collection`. If `collection` is a string, it's
  9829. * checked for a substring of `value`, otherwise
  9830. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  9831. * is used for equality comparisons. If `fromIndex` is negative, it's used as
  9832. * the offset from the end of `collection`.
  9833. *
  9834. * @static
  9835. * @memberOf _
  9836. * @since 0.1.0
  9837. * @category Collection
  9838. * @param {Array|Object|string} collection The collection to inspect.
  9839. * @param {*} value The value to search for.
  9840. * @param {number} [fromIndex=0] The index to search from.
  9841. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.reduce`.
  9842. * @returns {boolean} Returns `true` if `value` is found, else `false`.
  9843. * @example
  9844. *
  9845. * _.includes([1, 2, 3], 1);
  9846. * // => true
  9847. *
  9848. * _.includes([1, 2, 3], 1, 2);
  9849. * // => false
  9850. *
  9851. * _.includes({ 'a': 1, 'b': 2 }, 1);
  9852. * // => true
  9853. *
  9854. * _.includes('abcd', 'bc');
  9855. * // => true
  9856. */
  9857. function includes(collection, value, fromIndex, guard) {
  9858. collection = isArrayLike(collection) ? collection : values(collection);
  9859. fromIndex = (fromIndex && !guard) ? toInteger(fromIndex) : 0;
  9860. var length = collection.length;
  9861. if (fromIndex < 0) {
  9862. fromIndex = nativeMax(length + fromIndex, 0);
  9863. }
  9864. return isString(collection)
  9865. ? (fromIndex <= length && collection.indexOf(value, fromIndex) > -1)
  9866. : (!!length && baseIndexOf(collection, value, fromIndex) > -1);
  9867. }
  9868. /**
  9869. * Invokes the method at `path` of each element in `collection`, returning
  9870. * an array of the results of each invoked method. Any additional arguments
  9871. * are provided to each invoked method. If `path` is a function, it's invoked
  9872. * for, and `this` bound to, each element in `collection`.
  9873. *
  9874. * @static
  9875. * @memberOf _
  9876. * @since 4.0.0
  9877. * @category Collection
  9878. * @param {Array|Object} collection The collection to iterate over.
  9879. * @param {Array|Function|string} path The path of the method to invoke or
  9880. * the function invoked per iteration.
  9881. * @param {...*} [args] The arguments to invoke each method with.
  9882. * @returns {Array} Returns the array of results.
  9883. * @example
  9884. *
  9885. * _.invokeMap([[5, 1, 7], [3, 2, 1]], 'sort');
  9886. * // => [[1, 5, 7], [1, 2, 3]]
  9887. *
  9888. * _.invokeMap([123, 456], String.prototype.split, '');
  9889. * // => [['1', '2', '3'], ['4', '5', '6']]
  9890. */
  9891. var invokeMap = baseRest(function(collection, path, args) {
  9892. var index = -1,
  9893. isFunc = typeof path == 'function',
  9894. result = isArrayLike(collection) ? Array(collection.length) : [];
  9895. baseEach(collection, function(value) {
  9896. result[++index] = isFunc ? apply(path, value, args) : baseInvoke(value, path, args);
  9897. });
  9898. return result;
  9899. });
  9900. /**
  9901. * Creates an object composed of keys generated from the results of running
  9902. * each element of `collection` thru `iteratee`. The corresponding value of
  9903. * each key is the last element responsible for generating the key. The
  9904. * iteratee is invoked with one argument: (value).
  9905. *
  9906. * @static
  9907. * @memberOf _
  9908. * @since 4.0.0
  9909. * @category Collection
  9910. * @param {Array|Object} collection The collection to iterate over.
  9911. * @param {Function} [iteratee=_.identity] The iteratee to transform keys.
  9912. * @returns {Object} Returns the composed aggregate object.
  9913. * @example
  9914. *
  9915. * var array = [
  9916. * { 'dir': 'left', 'code': 97 },
  9917. * { 'dir': 'right', 'code': 100 }
  9918. * ];
  9919. *
  9920. * _.keyBy(array, function(o) {
  9921. * return String.fromCharCode(o.code);
  9922. * });
  9923. * // => { 'a': { 'dir': 'left', 'code': 97 }, 'd': { 'dir': 'right', 'code': 100 } }
  9924. *
  9925. * _.keyBy(array, 'dir');
  9926. * // => { 'left': { 'dir': 'left', 'code': 97 }, 'right': { 'dir': 'right', 'code': 100 } }
  9927. */
  9928. var keyBy = createAggregator(function(result, value, key) {
  9929. baseAssignValue(result, key, value);
  9930. });
  9931. /**
  9932. * Creates an array of values by running each element in `collection` thru
  9933. * `iteratee`. The iteratee is invoked with three arguments:
  9934. * (value, index|key, collection).
  9935. *
  9936. * Many lodash methods are guarded to work as iteratees for methods like
  9937. * `_.every`, `_.filter`, `_.map`, `_.mapValues`, `_.reject`, and `_.some`.
  9938. *
  9939. * The guarded methods are:
  9940. * `ary`, `chunk`, `curry`, `curryRight`, `drop`, `dropRight`, `every`,
  9941. * `fill`, `invert`, `parseInt`, `random`, `range`, `rangeRight`, `repeat`,
  9942. * `sampleSize`, `slice`, `some`, `sortBy`, `split`, `take`, `takeRight`,
  9943. * `template`, `trim`, `trimEnd`, `trimStart`, and `words`
  9944. *
  9945. * @static
  9946. * @memberOf _
  9947. * @since 0.1.0
  9948. * @category Collection
  9949. * @param {Array|Object} collection The collection to iterate over.
  9950. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  9951. * @returns {Array} Returns the new mapped array.
  9952. * @example
  9953. *
  9954. * function square(n) {
  9955. * return n * n;
  9956. * }
  9957. *
  9958. * _.map([4, 8], square);
  9959. * // => [16, 64]
  9960. *
  9961. * _.map({ 'a': 4, 'b': 8 }, square);
  9962. * // => [16, 64] (iteration order is not guaranteed)
  9963. *
  9964. * var users = [
  9965. * { 'user': 'barney' },
  9966. * { 'user': 'fred' }
  9967. * ];
  9968. *
  9969. * // The `_.property` iteratee shorthand.
  9970. * _.map(users, 'user');
  9971. * // => ['barney', 'fred']
  9972. */
  9973. function map(collection, iteratee) {
  9974. var func = isArray(collection) ? arrayMap : baseMap;
  9975. return func(collection, getIteratee(iteratee, 3));
  9976. }
  9977. /**
  9978. * This method is like `_.sortBy` except that it allows specifying the sort
  9979. * orders of the iteratees to sort by. If `orders` is unspecified, all values
  9980. * are sorted in ascending order. Otherwise, specify an order of "desc" for
  9981. * descending or "asc" for ascending sort order of corresponding values.
  9982. *
  9983. * @static
  9984. * @memberOf _
  9985. * @since 4.0.0
  9986. * @category Collection
  9987. * @param {Array|Object} collection The collection to iterate over.
  9988. * @param {Array[]|Function[]|Object[]|string[]} [iteratees=[_.identity]]
  9989. * The iteratees to sort by.
  9990. * @param {string[]} [orders] The sort orders of `iteratees`.
  9991. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.reduce`.
  9992. * @returns {Array} Returns the new sorted array.
  9993. * @example
  9994. *
  9995. * var users = [
  9996. * { 'user': 'fred', 'age': 48 },
  9997. * { 'user': 'barney', 'age': 34 },
  9998. * { 'user': 'fred', 'age': 40 },
  9999. * { 'user': 'barney', 'age': 36 }
  10000. * ];
  10001. *
  10002. * // Sort by `user` in ascending order and by `age` in descending order.
  10003. * _.orderBy(users, ['user', 'age'], ['asc', 'desc']);
  10004. * // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 40]]
  10005. */
  10006. function orderBy(collection, iteratees, orders, guard) {
  10007. if (collection == null) {
  10008. return [];
  10009. }
  10010. if (!isArray(iteratees)) {
  10011. iteratees = iteratees == null ? [] : [iteratees];
  10012. }
  10013. orders = guard ? undefined : orders;
  10014. if (!isArray(orders)) {
  10015. orders = orders == null ? [] : [orders];
  10016. }
  10017. return baseOrderBy(collection, iteratees, orders);
  10018. }
  10019. /**
  10020. * Creates an array of elements split into two groups, the first of which
  10021. * contains elements `predicate` returns truthy for, the second of which
  10022. * contains elements `predicate` returns falsey for. The predicate is
  10023. * invoked with one argument: (value).
  10024. *
  10025. * @static
  10026. * @memberOf _
  10027. * @since 3.0.0
  10028. * @category Collection
  10029. * @param {Array|Object} collection The collection to iterate over.
  10030. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  10031. * @returns {Array} Returns the array of grouped elements.
  10032. * @example
  10033. *
  10034. * var users = [
  10035. * { 'user': 'barney', 'age': 36, 'active': false },
  10036. * { 'user': 'fred', 'age': 40, 'active': true },
  10037. * { 'user': 'pebbles', 'age': 1, 'active': false }
  10038. * ];
  10039. *
  10040. * _.partition(users, function(o) { return o.active; });
  10041. * // => objects for [['fred'], ['barney', 'pebbles']]
  10042. *
  10043. * // The `_.matches` iteratee shorthand.
  10044. * _.partition(users, { 'age': 1, 'active': false });
  10045. * // => objects for [['pebbles'], ['barney', 'fred']]
  10046. *
  10047. * // The `_.matchesProperty` iteratee shorthand.
  10048. * _.partition(users, ['active', false]);
  10049. * // => objects for [['barney', 'pebbles'], ['fred']]
  10050. *
  10051. * // The `_.property` iteratee shorthand.
  10052. * _.partition(users, 'active');
  10053. * // => objects for [['fred'], ['barney', 'pebbles']]
  10054. */
  10055. var partition = createAggregator(function(result, value, key) {
  10056. result[key ? 0 : 1].push(value);
  10057. }, function() { return [[], []]; });
  10058. /**
  10059. * Reduces `collection` to a value which is the accumulated result of running
  10060. * each element in `collection` thru `iteratee`, where each successive
  10061. * invocation is supplied the return value of the previous. If `accumulator`
  10062. * is not given, the first element of `collection` is used as the initial
  10063. * value. The iteratee is invoked with four arguments:
  10064. * (accumulator, value, index|key, collection).
  10065. *
  10066. * Many lodash methods are guarded to work as iteratees for methods like
  10067. * `_.reduce`, `_.reduceRight`, and `_.transform`.
  10068. *
  10069. * The guarded methods are:
  10070. * `assign`, `defaults`, `defaultsDeep`, `includes`, `merge`, `orderBy`,
  10071. * and `sortBy`
  10072. *
  10073. * @static
  10074. * @memberOf _
  10075. * @since 0.1.0
  10076. * @category Collection
  10077. * @param {Array|Object} collection The collection to iterate over.
  10078. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  10079. * @param {*} [accumulator] The initial value.
  10080. * @returns {*} Returns the accumulated value.
  10081. * @see _.reduceRight
  10082. * @example
  10083. *
  10084. * _.reduce([1, 2], function(sum, n) {
  10085. * return sum + n;
  10086. * }, 0);
  10087. * // => 3
  10088. *
  10089. * _.reduce({ 'a': 1, 'b': 2, 'c': 1 }, function(result, value, key) {
  10090. * (result[value] || (result[value] = [])).push(key);
  10091. * return result;
  10092. * }, {});
  10093. * // => { '1': ['a', 'c'], '2': ['b'] } (iteration order is not guaranteed)
  10094. */
  10095. function reduce(collection, iteratee, accumulator) {
  10096. var func = isArray(collection) ? arrayReduce : baseReduce,
  10097. initAccum = arguments.length < 3;
  10098. return func(collection, getIteratee(iteratee, 4), accumulator, initAccum, baseEach);
  10099. }
  10100. /**
  10101. * This method is like `_.reduce` except that it iterates over elements of
  10102. * `collection` from right to left.
  10103. *
  10104. * @static
  10105. * @memberOf _
  10106. * @since 0.1.0
  10107. * @category Collection
  10108. * @param {Array|Object} collection The collection to iterate over.
  10109. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  10110. * @param {*} [accumulator] The initial value.
  10111. * @returns {*} Returns the accumulated value.
  10112. * @see _.reduce
  10113. * @example
  10114. *
  10115. * var array = [[0, 1], [2, 3], [4, 5]];
  10116. *
  10117. * _.reduceRight(array, function(flattened, other) {
  10118. * return flattened.concat(other);
  10119. * }, []);
  10120. * // => [4, 5, 2, 3, 0, 1]
  10121. */
  10122. function reduceRight(collection, iteratee, accumulator) {
  10123. var func = isArray(collection) ? arrayReduceRight : baseReduce,
  10124. initAccum = arguments.length < 3;
  10125. return func(collection, getIteratee(iteratee, 4), accumulator, initAccum, baseEachRight);
  10126. }
  10127. /**
  10128. * The opposite of `_.filter`; this method returns the elements of `collection`
  10129. * that `predicate` does **not** return truthy for.
  10130. *
  10131. * @static
  10132. * @memberOf _
  10133. * @since 0.1.0
  10134. * @category Collection
  10135. * @param {Array|Object} collection The collection to iterate over.
  10136. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  10137. * @returns {Array} Returns the new filtered array.
  10138. * @see _.filter
  10139. * @example
  10140. *
  10141. * var users = [
  10142. * { 'user': 'barney', 'age': 36, 'active': false },
  10143. * { 'user': 'fred', 'age': 40, 'active': true }
  10144. * ];
  10145. *
  10146. * _.reject(users, function(o) { return !o.active; });
  10147. * // => objects for ['fred']
  10148. *
  10149. * // The `_.matches` iteratee shorthand.
  10150. * _.reject(users, { 'age': 40, 'active': true });
  10151. * // => objects for ['barney']
  10152. *
  10153. * // The `_.matchesProperty` iteratee shorthand.
  10154. * _.reject(users, ['active', false]);
  10155. * // => objects for ['fred']
  10156. *
  10157. * // The `_.property` iteratee shorthand.
  10158. * _.reject(users, 'active');
  10159. * // => objects for ['barney']
  10160. */
  10161. function reject(collection, predicate) {
  10162. var func = isArray(collection) ? arrayFilter : baseFilter;
  10163. return func(collection, negate(getIteratee(predicate, 3)));
  10164. }
  10165. /**
  10166. * Gets a random element from `collection`.
  10167. *
  10168. * @static
  10169. * @memberOf _
  10170. * @since 2.0.0
  10171. * @category Collection
  10172. * @param {Array|Object} collection The collection to sample.
  10173. * @returns {*} Returns the random element.
  10174. * @example
  10175. *
  10176. * _.sample([1, 2, 3, 4]);
  10177. * // => 2
  10178. */
  10179. function sample(collection) {
  10180. var func = isArray(collection) ? arraySample : baseSample;
  10181. return func(collection);
  10182. }
  10183. /**
  10184. * Gets `n` random elements at unique keys from `collection` up to the
  10185. * size of `collection`.
  10186. *
  10187. * @static
  10188. * @memberOf _
  10189. * @since 4.0.0
  10190. * @category Collection
  10191. * @param {Array|Object} collection The collection to sample.
  10192. * @param {number} [n=1] The number of elements to sample.
  10193. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  10194. * @returns {Array} Returns the random elements.
  10195. * @example
  10196. *
  10197. * _.sampleSize([1, 2, 3], 2);
  10198. * // => [3, 1]
  10199. *
  10200. * _.sampleSize([1, 2, 3], 4);
  10201. * // => [2, 3, 1]
  10202. */
  10203. function sampleSize(collection, n, guard) {
  10204. if ((guard ? isIterateeCall(collection, n, guard) : n === undefined)) {
  10205. n = 1;
  10206. } else {
  10207. n = toInteger(n);
  10208. }
  10209. var func = isArray(collection) ? arraySampleSize : baseSampleSize;
  10210. return func(collection, n);
  10211. }
  10212. /**
  10213. * Creates an array of shuffled values, using a version of the
  10214. * [Fisher-Yates shuffle](https://en.wikipedia.org/wiki/Fisher-Yates_shuffle).
  10215. *
  10216. * @static
  10217. * @memberOf _
  10218. * @since 0.1.0
  10219. * @category Collection
  10220. * @param {Array|Object} collection The collection to shuffle.
  10221. * @returns {Array} Returns the new shuffled array.
  10222. * @example
  10223. *
  10224. * _.shuffle([1, 2, 3, 4]);
  10225. * // => [4, 1, 3, 2]
  10226. */
  10227. function shuffle(collection) {
  10228. var func = isArray(collection) ? arrayShuffle : baseShuffle;
  10229. return func(collection);
  10230. }
  10231. /**
  10232. * Gets the size of `collection` by returning its length for array-like
  10233. * values or the number of own enumerable string keyed properties for objects.
  10234. *
  10235. * @static
  10236. * @memberOf _
  10237. * @since 0.1.0
  10238. * @category Collection
  10239. * @param {Array|Object|string} collection The collection to inspect.
  10240. * @returns {number} Returns the collection size.
  10241. * @example
  10242. *
  10243. * _.size([1, 2, 3]);
  10244. * // => 3
  10245. *
  10246. * _.size({ 'a': 1, 'b': 2 });
  10247. * // => 2
  10248. *
  10249. * _.size('pebbles');
  10250. * // => 7
  10251. */
  10252. function size(collection) {
  10253. if (collection == null) {
  10254. return 0;
  10255. }
  10256. if (isArrayLike(collection)) {
  10257. return isString(collection) ? stringSize(collection) : collection.length;
  10258. }
  10259. var tag = getTag(collection);
  10260. if (tag == mapTag || tag == setTag) {
  10261. return collection.size;
  10262. }
  10263. return baseKeys(collection).length;
  10264. }
  10265. /**
  10266. * Checks if `predicate` returns truthy for **any** element of `collection`.
  10267. * Iteration is stopped once `predicate` returns truthy. The predicate is
  10268. * invoked with three arguments: (value, index|key, collection).
  10269. *
  10270. * @static
  10271. * @memberOf _
  10272. * @since 0.1.0
  10273. * @category Collection
  10274. * @param {Array|Object} collection The collection to iterate over.
  10275. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  10276. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  10277. * @returns {boolean} Returns `true` if any element passes the predicate check,
  10278. * else `false`.
  10279. * @example
  10280. *
  10281. * _.some([null, 0, 'yes', false], Boolean);
  10282. * // => true
  10283. *
  10284. * var users = [
  10285. * { 'user': 'barney', 'active': true },
  10286. * { 'user': 'fred', 'active': false }
  10287. * ];
  10288. *
  10289. * // The `_.matches` iteratee shorthand.
  10290. * _.some(users, { 'user': 'barney', 'active': false });
  10291. * // => false
  10292. *
  10293. * // The `_.matchesProperty` iteratee shorthand.
  10294. * _.some(users, ['active', false]);
  10295. * // => true
  10296. *
  10297. * // The `_.property` iteratee shorthand.
  10298. * _.some(users, 'active');
  10299. * // => true
  10300. */
  10301. function some(collection, predicate, guard) {
  10302. var func = isArray(collection) ? arraySome : baseSome;
  10303. if (guard && isIterateeCall(collection, predicate, guard)) {
  10304. predicate = undefined;
  10305. }
  10306. return func(collection, getIteratee(predicate, 3));
  10307. }
  10308. /**
  10309. * Creates an array of elements, sorted in ascending order by the results of
  10310. * running each element in a collection thru each iteratee. This method
  10311. * performs a stable sort, that is, it preserves the original sort order of
  10312. * equal elements. The iteratees are invoked with one argument: (value).
  10313. *
  10314. * @static
  10315. * @memberOf _
  10316. * @since 0.1.0
  10317. * @category Collection
  10318. * @param {Array|Object} collection The collection to iterate over.
  10319. * @param {...(Function|Function[])} [iteratees=[_.identity]]
  10320. * The iteratees to sort by.
  10321. * @returns {Array} Returns the new sorted array.
  10322. * @example
  10323. *
  10324. * var users = [
  10325. * { 'user': 'fred', 'age': 48 },
  10326. * { 'user': 'barney', 'age': 36 },
  10327. * { 'user': 'fred', 'age': 30 },
  10328. * { 'user': 'barney', 'age': 34 }
  10329. * ];
  10330. *
  10331. * _.sortBy(users, [function(o) { return o.user; }]);
  10332. * // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 30]]
  10333. *
  10334. * _.sortBy(users, ['user', 'age']);
  10335. * // => objects for [['barney', 34], ['barney', 36], ['fred', 30], ['fred', 48]]
  10336. */
  10337. var sortBy = baseRest(function(collection, iteratees) {
  10338. if (collection == null) {
  10339. return [];
  10340. }
  10341. var length = iteratees.length;
  10342. if (length > 1 && isIterateeCall(collection, iteratees[0], iteratees[1])) {
  10343. iteratees = [];
  10344. } else if (length > 2 && isIterateeCall(iteratees[0], iteratees[1], iteratees[2])) {
  10345. iteratees = [iteratees[0]];
  10346. }
  10347. return baseOrderBy(collection, baseFlatten(iteratees, 1), []);
  10348. });
  10349. /*------------------------------------------------------------------------*/
  10350. /**
  10351. * Gets the timestamp of the number of milliseconds that have elapsed since
  10352. * the Unix epoch (1 January 1970 00:00:00 UTC).
  10353. *
  10354. * @static
  10355. * @memberOf _
  10356. * @since 2.4.0
  10357. * @category Date
  10358. * @returns {number} Returns the timestamp.
  10359. * @example
  10360. *
  10361. * _.defer(function(stamp) {
  10362. * console.log(_.now() - stamp);
  10363. * }, _.now());
  10364. * // => Logs the number of milliseconds it took for the deferred invocation.
  10365. */
  10366. var now = ctxNow || function() {
  10367. return root.Date.now();
  10368. };
  10369. /*------------------------------------------------------------------------*/
  10370. /**
  10371. * The opposite of `_.before`; this method creates a function that invokes
  10372. * `func` once it's called `n` or more times.
  10373. *
  10374. * @static
  10375. * @memberOf _
  10376. * @since 0.1.0
  10377. * @category Function
  10378. * @param {number} n The number of calls before `func` is invoked.
  10379. * @param {Function} func The function to restrict.
  10380. * @returns {Function} Returns the new restricted function.
  10381. * @example
  10382. *
  10383. * var saves = ['profile', 'settings'];
  10384. *
  10385. * var done = _.after(saves.length, function() {
  10386. * console.log('done saving!');
  10387. * });
  10388. *
  10389. * _.forEach(saves, function(type) {
  10390. * asyncSave({ 'type': type, 'complete': done });
  10391. * });
  10392. * // => Logs 'done saving!' after the two async saves have completed.
  10393. */
  10394. function after(n, func) {
  10395. if (typeof func != 'function') {
  10396. throw new TypeError(FUNC_ERROR_TEXT);
  10397. }
  10398. n = toInteger(n);
  10399. return function() {
  10400. if (--n < 1) {
  10401. return func.apply(this, arguments);
  10402. }
  10403. };
  10404. }
  10405. /**
  10406. * Creates a function that invokes `func`, with up to `n` arguments,
  10407. * ignoring any additional arguments.
  10408. *
  10409. * @static
  10410. * @memberOf _
  10411. * @since 3.0.0
  10412. * @category Function
  10413. * @param {Function} func The function to cap arguments for.
  10414. * @param {number} [n=func.length] The arity cap.
  10415. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  10416. * @returns {Function} Returns the new capped function.
  10417. * @example
  10418. *
  10419. * _.map(['6', '8', '10'], _.ary(parseInt, 1));
  10420. * // => [6, 8, 10]
  10421. */
  10422. function ary(func, n, guard) {
  10423. n = guard ? undefined : n;
  10424. n = (func && n == null) ? func.length : n;
  10425. return createWrap(func, WRAP_ARY_FLAG, undefined, undefined, undefined, undefined, n);
  10426. }
  10427. /**
  10428. * Creates a function that invokes `func`, with the `this` binding and arguments
  10429. * of the created function, while it's called less than `n` times. Subsequent
  10430. * calls to the created function return the result of the last `func` invocation.
  10431. *
  10432. * @static
  10433. * @memberOf _
  10434. * @since 3.0.0
  10435. * @category Function
  10436. * @param {number} n The number of calls at which `func` is no longer invoked.
  10437. * @param {Function} func The function to restrict.
  10438. * @returns {Function} Returns the new restricted function.
  10439. * @example
  10440. *
  10441. * jQuery(element).on('click', _.before(5, addContactToList));
  10442. * // => Allows adding up to 4 contacts to the list.
  10443. */
  10444. function before(n, func) {
  10445. var result;
  10446. if (typeof func != 'function') {
  10447. throw new TypeError(FUNC_ERROR_TEXT);
  10448. }
  10449. n = toInteger(n);
  10450. return function() {
  10451. if (--n > 0) {
  10452. result = func.apply(this, arguments);
  10453. }
  10454. if (n <= 1) {
  10455. func = undefined;
  10456. }
  10457. return result;
  10458. };
  10459. }
  10460. /**
  10461. * Creates a function that invokes `func` with the `this` binding of `thisArg`
  10462. * and `partials` prepended to the arguments it receives.
  10463. *
  10464. * The `_.bind.placeholder` value, which defaults to `_` in monolithic builds,
  10465. * may be used as a placeholder for partially applied arguments.
  10466. *
  10467. * **Note:** Unlike native `Function#bind`, this method doesn't set the "length"
  10468. * property of bound functions.
  10469. *
  10470. * @static
  10471. * @memberOf _
  10472. * @since 0.1.0
  10473. * @category Function
  10474. * @param {Function} func The function to bind.
  10475. * @param {*} thisArg The `this` binding of `func`.
  10476. * @param {...*} [partials] The arguments to be partially applied.
  10477. * @returns {Function} Returns the new bound function.
  10478. * @example
  10479. *
  10480. * function greet(greeting, punctuation) {
  10481. * return greeting + ' ' + this.user + punctuation;
  10482. * }
  10483. *
  10484. * var object = { 'user': 'fred' };
  10485. *
  10486. * var bound = _.bind(greet, object, 'hi');
  10487. * bound('!');
  10488. * // => 'hi fred!'
  10489. *
  10490. * // Bound with placeholders.
  10491. * var bound = _.bind(greet, object, _, '!');
  10492. * bound('hi');
  10493. * // => 'hi fred!'
  10494. */
  10495. var bind = baseRest(function(func, thisArg, partials) {
  10496. var bitmask = WRAP_BIND_FLAG;
  10497. if (partials.length) {
  10498. var holders = replaceHolders(partials, getHolder(bind));
  10499. bitmask |= WRAP_PARTIAL_FLAG;
  10500. }
  10501. return createWrap(func, bitmask, thisArg, partials, holders);
  10502. });
  10503. /**
  10504. * Creates a function that invokes the method at `object[key]` with `partials`
  10505. * prepended to the arguments it receives.
  10506. *
  10507. * This method differs from `_.bind` by allowing bound functions to reference
  10508. * methods that may be redefined or don't yet exist. See
  10509. * [Peter Michaux's article](http://peter.michaux.ca/articles/lazy-function-definition-pattern)
  10510. * for more details.
  10511. *
  10512. * The `_.bindKey.placeholder` value, which defaults to `_` in monolithic
  10513. * builds, may be used as a placeholder for partially applied arguments.
  10514. *
  10515. * @static
  10516. * @memberOf _
  10517. * @since 0.10.0
  10518. * @category Function
  10519. * @param {Object} object The object to invoke the method on.
  10520. * @param {string} key The key of the method.
  10521. * @param {...*} [partials] The arguments to be partially applied.
  10522. * @returns {Function} Returns the new bound function.
  10523. * @example
  10524. *
  10525. * var object = {
  10526. * 'user': 'fred',
  10527. * 'greet': function(greeting, punctuation) {
  10528. * return greeting + ' ' + this.user + punctuation;
  10529. * }
  10530. * };
  10531. *
  10532. * var bound = _.bindKey(object, 'greet', 'hi');
  10533. * bound('!');
  10534. * // => 'hi fred!'
  10535. *
  10536. * object.greet = function(greeting, punctuation) {
  10537. * return greeting + 'ya ' + this.user + punctuation;
  10538. * };
  10539. *
  10540. * bound('!');
  10541. * // => 'hiya fred!'
  10542. *
  10543. * // Bound with placeholders.
  10544. * var bound = _.bindKey(object, 'greet', _, '!');
  10545. * bound('hi');
  10546. * // => 'hiya fred!'
  10547. */
  10548. var bindKey = baseRest(function(object, key, partials) {
  10549. var bitmask = WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG;
  10550. if (partials.length) {
  10551. var holders = replaceHolders(partials, getHolder(bindKey));
  10552. bitmask |= WRAP_PARTIAL_FLAG;
  10553. }
  10554. return createWrap(key, bitmask, object, partials, holders);
  10555. });
  10556. /**
  10557. * Creates a function that accepts arguments of `func` and either invokes
  10558. * `func` returning its result, if at least `arity` number of arguments have
  10559. * been provided, or returns a function that accepts the remaining `func`
  10560. * arguments, and so on. The arity of `func` may be specified if `func.length`
  10561. * is not sufficient.
  10562. *
  10563. * The `_.curry.placeholder` value, which defaults to `_` in monolithic builds,
  10564. * may be used as a placeholder for provided arguments.
  10565. *
  10566. * **Note:** This method doesn't set the "length" property of curried functions.
  10567. *
  10568. * @static
  10569. * @memberOf _
  10570. * @since 2.0.0
  10571. * @category Function
  10572. * @param {Function} func The function to curry.
  10573. * @param {number} [arity=func.length] The arity of `func`.
  10574. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  10575. * @returns {Function} Returns the new curried function.
  10576. * @example
  10577. *
  10578. * var abc = function(a, b, c) {
  10579. * return [a, b, c];
  10580. * };
  10581. *
  10582. * var curried = _.curry(abc);
  10583. *
  10584. * curried(1)(2)(3);
  10585. * // => [1, 2, 3]
  10586. *
  10587. * curried(1, 2)(3);
  10588. * // => [1, 2, 3]
  10589. *
  10590. * curried(1, 2, 3);
  10591. * // => [1, 2, 3]
  10592. *
  10593. * // Curried with placeholders.
  10594. * curried(1)(_, 3)(2);
  10595. * // => [1, 2, 3]
  10596. */
  10597. function curry(func, arity, guard) {
  10598. arity = guard ? undefined : arity;
  10599. var result = createWrap(func, WRAP_CURRY_FLAG, undefined, undefined, undefined, undefined, undefined, arity);
  10600. result.placeholder = curry.placeholder;
  10601. return result;
  10602. }
  10603. /**
  10604. * This method is like `_.curry` except that arguments are applied to `func`
  10605. * in the manner of `_.partialRight` instead of `_.partial`.
  10606. *
  10607. * The `_.curryRight.placeholder` value, which defaults to `_` in monolithic
  10608. * builds, may be used as a placeholder for provided arguments.
  10609. *
  10610. * **Note:** This method doesn't set the "length" property of curried functions.
  10611. *
  10612. * @static
  10613. * @memberOf _
  10614. * @since 3.0.0
  10615. * @category Function
  10616. * @param {Function} func The function to curry.
  10617. * @param {number} [arity=func.length] The arity of `func`.
  10618. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  10619. * @returns {Function} Returns the new curried function.
  10620. * @example
  10621. *
  10622. * var abc = function(a, b, c) {
  10623. * return [a, b, c];
  10624. * };
  10625. *
  10626. * var curried = _.curryRight(abc);
  10627. *
  10628. * curried(3)(2)(1);
  10629. * // => [1, 2, 3]
  10630. *
  10631. * curried(2, 3)(1);
  10632. * // => [1, 2, 3]
  10633. *
  10634. * curried(1, 2, 3);
  10635. * // => [1, 2, 3]
  10636. *
  10637. * // Curried with placeholders.
  10638. * curried(3)(1, _)(2);
  10639. * // => [1, 2, 3]
  10640. */
  10641. function curryRight(func, arity, guard) {
  10642. arity = guard ? undefined : arity;
  10643. var result = createWrap(func, WRAP_CURRY_RIGHT_FLAG, undefined, undefined, undefined, undefined, undefined, arity);
  10644. result.placeholder = curryRight.placeholder;
  10645. return result;
  10646. }
  10647. /**
  10648. * Creates a debounced function that delays invoking `func` until after `wait`
  10649. * milliseconds have elapsed since the last time the debounced function was
  10650. * invoked. The debounced function comes with a `cancel` method to cancel
  10651. * delayed `func` invocations and a `flush` method to immediately invoke them.
  10652. * Provide `options` to indicate whether `func` should be invoked on the
  10653. * leading and/or trailing edge of the `wait` timeout. The `func` is invoked
  10654. * with the last arguments provided to the debounced function. Subsequent
  10655. * calls to the debounced function return the result of the last `func`
  10656. * invocation.
  10657. *
  10658. * **Note:** If `leading` and `trailing` options are `true`, `func` is
  10659. * invoked on the trailing edge of the timeout only if the debounced function
  10660. * is invoked more than once during the `wait` timeout.
  10661. *
  10662. * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred
  10663. * until to the next tick, similar to `setTimeout` with a timeout of `0`.
  10664. *
  10665. * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/)
  10666. * for details over the differences between `_.debounce` and `_.throttle`.
  10667. *
  10668. * @static
  10669. * @memberOf _
  10670. * @since 0.1.0
  10671. * @category Function
  10672. * @param {Function} func The function to debounce.
  10673. * @param {number} [wait=0] The number of milliseconds to delay.
  10674. * @param {Object} [options={}] The options object.
  10675. * @param {boolean} [options.leading=false]
  10676. * Specify invoking on the leading edge of the timeout.
  10677. * @param {number} [options.maxWait]
  10678. * The maximum time `func` is allowed to be delayed before it's invoked.
  10679. * @param {boolean} [options.trailing=true]
  10680. * Specify invoking on the trailing edge of the timeout.
  10681. * @returns {Function} Returns the new debounced function.
  10682. * @example
  10683. *
  10684. * // Avoid costly calculations while the window size is in flux.
  10685. * jQuery(window).on('resize', _.debounce(calculateLayout, 150));
  10686. *
  10687. * // Invoke `sendMail` when clicked, debouncing subsequent calls.
  10688. * jQuery(element).on('click', _.debounce(sendMail, 300, {
  10689. * 'leading': true,
  10690. * 'trailing': false
  10691. * }));
  10692. *
  10693. * // Ensure `batchLog` is invoked once after 1 second of debounced calls.
  10694. * var debounced = _.debounce(batchLog, 250, { 'maxWait': 1000 });
  10695. * var source = new EventSource('/stream');
  10696. * jQuery(source).on('message', debounced);
  10697. *
  10698. * // Cancel the trailing debounced invocation.
  10699. * jQuery(window).on('popstate', debounced.cancel);
  10700. */
  10701. function debounce(func, wait, options) {
  10702. var lastArgs,
  10703. lastThis,
  10704. maxWait,
  10705. result,
  10706. timerId,
  10707. lastCallTime,
  10708. lastInvokeTime = 0,
  10709. leading = false,
  10710. maxing = false,
  10711. trailing = true;
  10712. if (typeof func != 'function') {
  10713. throw new TypeError(FUNC_ERROR_TEXT);
  10714. }
  10715. wait = toNumber(wait) || 0;
  10716. if (isObject(options)) {
  10717. leading = !!options.leading;
  10718. maxing = 'maxWait' in options;
  10719. maxWait = maxing ? nativeMax(toNumber(options.maxWait) || 0, wait) : maxWait;
  10720. trailing = 'trailing' in options ? !!options.trailing : trailing;
  10721. }
  10722. function invokeFunc(time) {
  10723. var args = lastArgs,
  10724. thisArg = lastThis;
  10725. lastArgs = lastThis = undefined;
  10726. lastInvokeTime = time;
  10727. result = func.apply(thisArg, args);
  10728. return result;
  10729. }
  10730. function leadingEdge(time) {
  10731. // Reset any `maxWait` timer.
  10732. lastInvokeTime = time;
  10733. // Start the timer for the trailing edge.
  10734. timerId = setTimeout(timerExpired, wait);
  10735. // Invoke the leading edge.
  10736. return leading ? invokeFunc(time) : result;
  10737. }
  10738. function remainingWait(time) {
  10739. var timeSinceLastCall = time - lastCallTime,
  10740. timeSinceLastInvoke = time - lastInvokeTime,
  10741. timeWaiting = wait - timeSinceLastCall;
  10742. return maxing
  10743. ? nativeMin(timeWaiting, maxWait - timeSinceLastInvoke)
  10744. : timeWaiting;
  10745. }
  10746. function shouldInvoke(time) {
  10747. var timeSinceLastCall = time - lastCallTime,
  10748. timeSinceLastInvoke = time - lastInvokeTime;
  10749. // Either this is the first call, activity has stopped and we're at the
  10750. // trailing edge, the system time has gone backwards and we're treating
  10751. // it as the trailing edge, or we've hit the `maxWait` limit.
  10752. return (lastCallTime === undefined || (timeSinceLastCall >= wait) ||
  10753. (timeSinceLastCall < 0) || (maxing && timeSinceLastInvoke >= maxWait));
  10754. }
  10755. function timerExpired() {
  10756. var time = now();
  10757. if (shouldInvoke(time)) {
  10758. return trailingEdge(time);
  10759. }
  10760. // Restart the timer.
  10761. timerId = setTimeout(timerExpired, remainingWait(time));
  10762. }
  10763. function trailingEdge(time) {
  10764. timerId = undefined;
  10765. // Only invoke if we have `lastArgs` which means `func` has been
  10766. // debounced at least once.
  10767. if (trailing && lastArgs) {
  10768. return invokeFunc(time);
  10769. }
  10770. lastArgs = lastThis = undefined;
  10771. return result;
  10772. }
  10773. function cancel() {
  10774. if (timerId !== undefined) {
  10775. clearTimeout(timerId);
  10776. }
  10777. lastInvokeTime = 0;
  10778. lastArgs = lastCallTime = lastThis = timerId = undefined;
  10779. }
  10780. function flush() {
  10781. return timerId === undefined ? result : trailingEdge(now());
  10782. }
  10783. function debounced() {
  10784. var time = now(),
  10785. isInvoking = shouldInvoke(time);
  10786. lastArgs = arguments;
  10787. lastThis = this;
  10788. lastCallTime = time;
  10789. if (isInvoking) {
  10790. if (timerId === undefined) {
  10791. return leadingEdge(lastCallTime);
  10792. }
  10793. if (maxing) {
  10794. // Handle invocations in a tight loop.
  10795. clearTimeout(timerId);
  10796. timerId = setTimeout(timerExpired, wait);
  10797. return invokeFunc(lastCallTime);
  10798. }
  10799. }
  10800. if (timerId === undefined) {
  10801. timerId = setTimeout(timerExpired, wait);
  10802. }
  10803. return result;
  10804. }
  10805. debounced.cancel = cancel;
  10806. debounced.flush = flush;
  10807. return debounced;
  10808. }
  10809. /**
  10810. * Defers invoking the `func` until the current call stack has cleared. Any
  10811. * additional arguments are provided to `func` when it's invoked.
  10812. *
  10813. * @static
  10814. * @memberOf _
  10815. * @since 0.1.0
  10816. * @category Function
  10817. * @param {Function} func The function to defer.
  10818. * @param {...*} [args] The arguments to invoke `func` with.
  10819. * @returns {number} Returns the timer id.
  10820. * @example
  10821. *
  10822. * _.defer(function(text) {
  10823. * console.log(text);
  10824. * }, 'deferred');
  10825. * // => Logs 'deferred' after one millisecond.
  10826. */
  10827. var defer = baseRest(function(func, args) {
  10828. return baseDelay(func, 1, args);
  10829. });
  10830. /**
  10831. * Invokes `func` after `wait` milliseconds. Any additional arguments are
  10832. * provided to `func` when it's invoked.
  10833. *
  10834. * @static
  10835. * @memberOf _
  10836. * @since 0.1.0
  10837. * @category Function
  10838. * @param {Function} func The function to delay.
  10839. * @param {number} wait The number of milliseconds to delay invocation.
  10840. * @param {...*} [args] The arguments to invoke `func` with.
  10841. * @returns {number} Returns the timer id.
  10842. * @example
  10843. *
  10844. * _.delay(function(text) {
  10845. * console.log(text);
  10846. * }, 1000, 'later');
  10847. * // => Logs 'later' after one second.
  10848. */
  10849. var delay = baseRest(function(func, wait, args) {
  10850. return baseDelay(func, toNumber(wait) || 0, args);
  10851. });
  10852. /**
  10853. * Creates a function that invokes `func` with arguments reversed.
  10854. *
  10855. * @static
  10856. * @memberOf _
  10857. * @since 4.0.0
  10858. * @category Function
  10859. * @param {Function} func The function to flip arguments for.
  10860. * @returns {Function} Returns the new flipped function.
  10861. * @example
  10862. *
  10863. * var flipped = _.flip(function() {
  10864. * return _.toArray(arguments);
  10865. * });
  10866. *
  10867. * flipped('a', 'b', 'c', 'd');
  10868. * // => ['d', 'c', 'b', 'a']
  10869. */
  10870. function flip(func) {
  10871. return createWrap(func, WRAP_FLIP_FLAG);
  10872. }
  10873. /**
  10874. * Creates a function that memoizes the result of `func`. If `resolver` is
  10875. * provided, it determines the cache key for storing the result based on the
  10876. * arguments provided to the memoized function. By default, the first argument
  10877. * provided to the memoized function is used as the map cache key. The `func`
  10878. * is invoked with the `this` binding of the memoized function.
  10879. *
  10880. * **Note:** The cache is exposed as the `cache` property on the memoized
  10881. * function. Its creation may be customized by replacing the `_.memoize.Cache`
  10882. * constructor with one whose instances implement the
  10883. * [`Map`](http://ecma-international.org/ecma-262/7.0/#sec-properties-of-the-map-prototype-object)
  10884. * method interface of `clear`, `delete`, `get`, `has`, and `set`.
  10885. *
  10886. * @static
  10887. * @memberOf _
  10888. * @since 0.1.0
  10889. * @category Function
  10890. * @param {Function} func The function to have its output memoized.
  10891. * @param {Function} [resolver] The function to resolve the cache key.
  10892. * @returns {Function} Returns the new memoized function.
  10893. * @example
  10894. *
  10895. * var object = { 'a': 1, 'b': 2 };
  10896. * var other = { 'c': 3, 'd': 4 };
  10897. *
  10898. * var values = _.memoize(_.values);
  10899. * values(object);
  10900. * // => [1, 2]
  10901. *
  10902. * values(other);
  10903. * // => [3, 4]
  10904. *
  10905. * object.a = 2;
  10906. * values(object);
  10907. * // => [1, 2]
  10908. *
  10909. * // Modify the result cache.
  10910. * values.cache.set(object, ['a', 'b']);
  10911. * values(object);
  10912. * // => ['a', 'b']
  10913. *
  10914. * // Replace `_.memoize.Cache`.
  10915. * _.memoize.Cache = WeakMap;
  10916. */
  10917. function memoize(func, resolver) {
  10918. if (typeof func != 'function' || (resolver != null && typeof resolver != 'function')) {
  10919. throw new TypeError(FUNC_ERROR_TEXT);
  10920. }
  10921. var memoized = function() {
  10922. var args = arguments,
  10923. key = resolver ? resolver.apply(this, args) : args[0],
  10924. cache = memoized.cache;
  10925. if (cache.has(key)) {
  10926. return cache.get(key);
  10927. }
  10928. var result = func.apply(this, args);
  10929. memoized.cache = cache.set(key, result) || cache;
  10930. return result;
  10931. };
  10932. memoized.cache = new (memoize.Cache || MapCache);
  10933. return memoized;
  10934. }
  10935. // Expose `MapCache`.
  10936. memoize.Cache = MapCache;
  10937. /**
  10938. * Creates a function that negates the result of the predicate `func`. The
  10939. * `func` predicate is invoked with the `this` binding and arguments of the
  10940. * created function.
  10941. *
  10942. * @static
  10943. * @memberOf _
  10944. * @since 3.0.0
  10945. * @category Function
  10946. * @param {Function} predicate The predicate to negate.
  10947. * @returns {Function} Returns the new negated function.
  10948. * @example
  10949. *
  10950. * function isEven(n) {
  10951. * return n % 2 == 0;
  10952. * }
  10953. *
  10954. * _.filter([1, 2, 3, 4, 5, 6], _.negate(isEven));
  10955. * // => [1, 3, 5]
  10956. */
  10957. function negate(predicate) {
  10958. if (typeof predicate != 'function') {
  10959. throw new TypeError(FUNC_ERROR_TEXT);
  10960. }
  10961. return function() {
  10962. var args = arguments;
  10963. switch (args.length) {
  10964. case 0: return !predicate.call(this);
  10965. case 1: return !predicate.call(this, args[0]);
  10966. case 2: return !predicate.call(this, args[0], args[1]);
  10967. case 3: return !predicate.call(this, args[0], args[1], args[2]);
  10968. }
  10969. return !predicate.apply(this, args);
  10970. };
  10971. }
  10972. /**
  10973. * Creates a function that is restricted to invoking `func` once. Repeat calls
  10974. * to the function return the value of the first invocation. The `func` is
  10975. * invoked with the `this` binding and arguments of the created function.
  10976. *
  10977. * @static
  10978. * @memberOf _
  10979. * @since 0.1.0
  10980. * @category Function
  10981. * @param {Function} func The function to restrict.
  10982. * @returns {Function} Returns the new restricted function.
  10983. * @example
  10984. *
  10985. * var initialize = _.once(createApplication);
  10986. * initialize();
  10987. * initialize();
  10988. * // => `createApplication` is invoked once
  10989. */
  10990. function once(func) {
  10991. return before(2, func);
  10992. }
  10993. /**
  10994. * Creates a function that invokes `func` with its arguments transformed.
  10995. *
  10996. * @static
  10997. * @since 4.0.0
  10998. * @memberOf _
  10999. * @category Function
  11000. * @param {Function} func The function to wrap.
  11001. * @param {...(Function|Function[])} [transforms=[_.identity]]
  11002. * The argument transforms.
  11003. * @returns {Function} Returns the new function.
  11004. * @example
  11005. *
  11006. * function doubled(n) {
  11007. * return n * 2;
  11008. * }
  11009. *
  11010. * function square(n) {
  11011. * return n * n;
  11012. * }
  11013. *
  11014. * var func = _.overArgs(function(x, y) {
  11015. * return [x, y];
  11016. * }, [square, doubled]);
  11017. *
  11018. * func(9, 3);
  11019. * // => [81, 6]
  11020. *
  11021. * func(10, 5);
  11022. * // => [100, 10]
  11023. */
  11024. var overArgs = castRest(function(func, transforms) {
  11025. transforms = (transforms.length == 1 && isArray(transforms[0]))
  11026. ? arrayMap(transforms[0], baseUnary(getIteratee()))
  11027. : arrayMap(baseFlatten(transforms, 1), baseUnary(getIteratee()));
  11028. var funcsLength = transforms.length;
  11029. return baseRest(function(args) {
  11030. var index = -1,
  11031. length = nativeMin(args.length, funcsLength);
  11032. while (++index < length) {
  11033. args[index] = transforms[index].call(this, args[index]);
  11034. }
  11035. return apply(func, this, args);
  11036. });
  11037. });
  11038. /**
  11039. * Creates a function that invokes `func` with `partials` prepended to the
  11040. * arguments it receives. This method is like `_.bind` except it does **not**
  11041. * alter the `this` binding.
  11042. *
  11043. * The `_.partial.placeholder` value, which defaults to `_` in monolithic
  11044. * builds, may be used as a placeholder for partially applied arguments.
  11045. *
  11046. * **Note:** This method doesn't set the "length" property of partially
  11047. * applied functions.
  11048. *
  11049. * @static
  11050. * @memberOf _
  11051. * @since 0.2.0
  11052. * @category Function
  11053. * @param {Function} func The function to partially apply arguments to.
  11054. * @param {...*} [partials] The arguments to be partially applied.
  11055. * @returns {Function} Returns the new partially applied function.
  11056. * @example
  11057. *
  11058. * function greet(greeting, name) {
  11059. * return greeting + ' ' + name;
  11060. * }
  11061. *
  11062. * var sayHelloTo = _.partial(greet, 'hello');
  11063. * sayHelloTo('fred');
  11064. * // => 'hello fred'
  11065. *
  11066. * // Partially applied with placeholders.
  11067. * var greetFred = _.partial(greet, _, 'fred');
  11068. * greetFred('hi');
  11069. * // => 'hi fred'
  11070. */
  11071. var partial = baseRest(function(func, partials) {
  11072. var holders = replaceHolders(partials, getHolder(partial));
  11073. return createWrap(func, WRAP_PARTIAL_FLAG, undefined, partials, holders);
  11074. });
  11075. /**
  11076. * This method is like `_.partial` except that partially applied arguments
  11077. * are appended to the arguments it receives.
  11078. *
  11079. * The `_.partialRight.placeholder` value, which defaults to `_` in monolithic
  11080. * builds, may be used as a placeholder for partially applied arguments.
  11081. *
  11082. * **Note:** This method doesn't set the "length" property of partially
  11083. * applied functions.
  11084. *
  11085. * @static
  11086. * @memberOf _
  11087. * @since 1.0.0
  11088. * @category Function
  11089. * @param {Function} func The function to partially apply arguments to.
  11090. * @param {...*} [partials] The arguments to be partially applied.
  11091. * @returns {Function} Returns the new partially applied function.
  11092. * @example
  11093. *
  11094. * function greet(greeting, name) {
  11095. * return greeting + ' ' + name;
  11096. * }
  11097. *
  11098. * var greetFred = _.partialRight(greet, 'fred');
  11099. * greetFred('hi');
  11100. * // => 'hi fred'
  11101. *
  11102. * // Partially applied with placeholders.
  11103. * var sayHelloTo = _.partialRight(greet, 'hello', _);
  11104. * sayHelloTo('fred');
  11105. * // => 'hello fred'
  11106. */
  11107. var partialRight = baseRest(function(func, partials) {
  11108. var holders = replaceHolders(partials, getHolder(partialRight));
  11109. return createWrap(func, WRAP_PARTIAL_RIGHT_FLAG, undefined, partials, holders);
  11110. });
  11111. /**
  11112. * Creates a function that invokes `func` with arguments arranged according
  11113. * to the specified `indexes` where the argument value at the first index is
  11114. * provided as the first argument, the argument value at the second index is
  11115. * provided as the second argument, and so on.
  11116. *
  11117. * @static
  11118. * @memberOf _
  11119. * @since 3.0.0
  11120. * @category Function
  11121. * @param {Function} func The function to rearrange arguments for.
  11122. * @param {...(number|number[])} indexes The arranged argument indexes.
  11123. * @returns {Function} Returns the new function.
  11124. * @example
  11125. *
  11126. * var rearged = _.rearg(function(a, b, c) {
  11127. * return [a, b, c];
  11128. * }, [2, 0, 1]);
  11129. *
  11130. * rearged('b', 'c', 'a')
  11131. * // => ['a', 'b', 'c']
  11132. */
  11133. var rearg = flatRest(function(func, indexes) {
  11134. return createWrap(func, WRAP_REARG_FLAG, undefined, undefined, undefined, indexes);
  11135. });
  11136. /**
  11137. * Creates a function that invokes `func` with the `this` binding of the
  11138. * created function and arguments from `start` and beyond provided as
  11139. * an array.
  11140. *
  11141. * **Note:** This method is based on the
  11142. * [rest parameter](https://mdn.io/rest_parameters).
  11143. *
  11144. * @static
  11145. * @memberOf _
  11146. * @since 4.0.0
  11147. * @category Function
  11148. * @param {Function} func The function to apply a rest parameter to.
  11149. * @param {number} [start=func.length-1] The start position of the rest parameter.
  11150. * @returns {Function} Returns the new function.
  11151. * @example
  11152. *
  11153. * var say = _.rest(function(what, names) {
  11154. * return what + ' ' + _.initial(names).join(', ') +
  11155. * (_.size(names) > 1 ? ', & ' : '') + _.last(names);
  11156. * });
  11157. *
  11158. * say('hello', 'fred', 'barney', 'pebbles');
  11159. * // => 'hello fred, barney, & pebbles'
  11160. */
  11161. function rest(func, start) {
  11162. if (typeof func != 'function') {
  11163. throw new TypeError(FUNC_ERROR_TEXT);
  11164. }
  11165. start = start === undefined ? start : toInteger(start);
  11166. return baseRest(func, start);
  11167. }
  11168. /**
  11169. * Creates a function that invokes `func` with the `this` binding of the
  11170. * create function and an array of arguments much like
  11171. * [`Function#apply`](http://www.ecma-international.org/ecma-262/7.0/#sec-function.prototype.apply).
  11172. *
  11173. * **Note:** This method is based on the
  11174. * [spread operator](https://mdn.io/spread_operator).
  11175. *
  11176. * @static
  11177. * @memberOf _
  11178. * @since 3.2.0
  11179. * @category Function
  11180. * @param {Function} func The function to spread arguments over.
  11181. * @param {number} [start=0] The start position of the spread.
  11182. * @returns {Function} Returns the new function.
  11183. * @example
  11184. *
  11185. * var say = _.spread(function(who, what) {
  11186. * return who + ' says ' + what;
  11187. * });
  11188. *
  11189. * say(['fred', 'hello']);
  11190. * // => 'fred says hello'
  11191. *
  11192. * var numbers = Promise.all([
  11193. * Promise.resolve(40),
  11194. * Promise.resolve(36)
  11195. * ]);
  11196. *
  11197. * numbers.then(_.spread(function(x, y) {
  11198. * return x + y;
  11199. * }));
  11200. * // => a Promise of 76
  11201. */
  11202. function spread(func, start) {
  11203. if (typeof func != 'function') {
  11204. throw new TypeError(FUNC_ERROR_TEXT);
  11205. }
  11206. start = start == null ? 0 : nativeMax(toInteger(start), 0);
  11207. return baseRest(function(args) {
  11208. var array = args[start],
  11209. otherArgs = castSlice(args, 0, start);
  11210. if (array) {
  11211. arrayPush(otherArgs, array);
  11212. }
  11213. return apply(func, this, otherArgs);
  11214. });
  11215. }
  11216. /**
  11217. * Creates a throttled function that only invokes `func` at most once per
  11218. * every `wait` milliseconds. The throttled function comes with a `cancel`
  11219. * method to cancel delayed `func` invocations and a `flush` method to
  11220. * immediately invoke them. Provide `options` to indicate whether `func`
  11221. * should be invoked on the leading and/or trailing edge of the `wait`
  11222. * timeout. The `func` is invoked with the last arguments provided to the
  11223. * throttled function. Subsequent calls to the throttled function return the
  11224. * result of the last `func` invocation.
  11225. *
  11226. * **Note:** If `leading` and `trailing` options are `true`, `func` is
  11227. * invoked on the trailing edge of the timeout only if the throttled function
  11228. * is invoked more than once during the `wait` timeout.
  11229. *
  11230. * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred
  11231. * until to the next tick, similar to `setTimeout` with a timeout of `0`.
  11232. *
  11233. * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/)
  11234. * for details over the differences between `_.throttle` and `_.debounce`.
  11235. *
  11236. * @static
  11237. * @memberOf _
  11238. * @since 0.1.0
  11239. * @category Function
  11240. * @param {Function} func The function to throttle.
  11241. * @param {number} [wait=0] The number of milliseconds to throttle invocations to.
  11242. * @param {Object} [options={}] The options object.
  11243. * @param {boolean} [options.leading=true]
  11244. * Specify invoking on the leading edge of the timeout.
  11245. * @param {boolean} [options.trailing=true]
  11246. * Specify invoking on the trailing edge of the timeout.
  11247. * @returns {Function} Returns the new throttled function.
  11248. * @example
  11249. *
  11250. * // Avoid excessively updating the position while scrolling.
  11251. * jQuery(window).on('scroll', _.throttle(updatePosition, 100));
  11252. *
  11253. * // Invoke `renewToken` when the click event is fired, but not more than once every 5 minutes.
  11254. * var throttled = _.throttle(renewToken, 300000, { 'trailing': false });
  11255. * jQuery(element).on('click', throttled);
  11256. *
  11257. * // Cancel the trailing throttled invocation.
  11258. * jQuery(window).on('popstate', throttled.cancel);
  11259. */
  11260. function throttle(func, wait, options) {
  11261. var leading = true,
  11262. trailing = true;
  11263. if (typeof func != 'function') {
  11264. throw new TypeError(FUNC_ERROR_TEXT);
  11265. }
  11266. if (isObject(options)) {
  11267. leading = 'leading' in options ? !!options.leading : leading;
  11268. trailing = 'trailing' in options ? !!options.trailing : trailing;
  11269. }
  11270. return debounce(func, wait, {
  11271. 'leading': leading,
  11272. 'maxWait': wait,
  11273. 'trailing': trailing
  11274. });
  11275. }
  11276. /**
  11277. * Creates a function that accepts up to one argument, ignoring any
  11278. * additional arguments.
  11279. *
  11280. * @static
  11281. * @memberOf _
  11282. * @since 4.0.0
  11283. * @category Function
  11284. * @param {Function} func The function to cap arguments for.
  11285. * @returns {Function} Returns the new capped function.
  11286. * @example
  11287. *
  11288. * _.map(['6', '8', '10'], _.unary(parseInt));
  11289. * // => [6, 8, 10]
  11290. */
  11291. function unary(func) {
  11292. return ary(func, 1);
  11293. }
  11294. /**
  11295. * Creates a function that provides `value` to `wrapper` as its first
  11296. * argument. Any additional arguments provided to the function are appended
  11297. * to those provided to the `wrapper`. The wrapper is invoked with the `this`
  11298. * binding of the created function.
  11299. *
  11300. * @static
  11301. * @memberOf _
  11302. * @since 0.1.0
  11303. * @category Function
  11304. * @param {*} value The value to wrap.
  11305. * @param {Function} [wrapper=identity] The wrapper function.
  11306. * @returns {Function} Returns the new function.
  11307. * @example
  11308. *
  11309. * var p = _.wrap(_.escape, function(func, text) {
  11310. * return '<p>' + func(text) + '</p>';
  11311. * });
  11312. *
  11313. * p('fred, barney, & pebbles');
  11314. * // => '<p>fred, barney, &amp; pebbles</p>'
  11315. */
  11316. function wrap(value, wrapper) {
  11317. return partial(castFunction(wrapper), value);
  11318. }
  11319. /*------------------------------------------------------------------------*/
  11320. /**
  11321. * Casts `value` as an array if it's not one.
  11322. *
  11323. * @static
  11324. * @memberOf _
  11325. * @since 4.4.0
  11326. * @category Lang
  11327. * @param {*} value The value to inspect.
  11328. * @returns {Array} Returns the cast array.
  11329. * @example
  11330. *
  11331. * _.castArray(1);
  11332. * // => [1]
  11333. *
  11334. * _.castArray({ 'a': 1 });
  11335. * // => [{ 'a': 1 }]
  11336. *
  11337. * _.castArray('abc');
  11338. * // => ['abc']
  11339. *
  11340. * _.castArray(null);
  11341. * // => [null]
  11342. *
  11343. * _.castArray(undefined);
  11344. * // => [undefined]
  11345. *
  11346. * _.castArray();
  11347. * // => []
  11348. *
  11349. * var array = [1, 2, 3];
  11350. * console.log(_.castArray(array) === array);
  11351. * // => true
  11352. */
  11353. function castArray() {
  11354. if (!arguments.length) {
  11355. return [];
  11356. }
  11357. var value = arguments[0];
  11358. return isArray(value) ? value : [value];
  11359. }
  11360. /**
  11361. * Creates a shallow clone of `value`.
  11362. *
  11363. * **Note:** This method is loosely based on the
  11364. * [structured clone algorithm](https://mdn.io/Structured_clone_algorithm)
  11365. * and supports cloning arrays, array buffers, booleans, date objects, maps,
  11366. * numbers, `Object` objects, regexes, sets, strings, symbols, and typed
  11367. * arrays. The own enumerable properties of `arguments` objects are cloned
  11368. * as plain objects. An empty object is returned for uncloneable values such
  11369. * as error objects, functions, DOM nodes, and WeakMaps.
  11370. *
  11371. * @static
  11372. * @memberOf _
  11373. * @since 0.1.0
  11374. * @category Lang
  11375. * @param {*} value The value to clone.
  11376. * @returns {*} Returns the cloned value.
  11377. * @see _.cloneDeep
  11378. * @example
  11379. *
  11380. * var objects = [{ 'a': 1 }, { 'b': 2 }];
  11381. *
  11382. * var shallow = _.clone(objects);
  11383. * console.log(shallow[0] === objects[0]);
  11384. * // => true
  11385. */
  11386. function clone(value) {
  11387. return baseClone(value, CLONE_SYMBOLS_FLAG);
  11388. }
  11389. /**
  11390. * This method is like `_.clone` except that it accepts `customizer` which
  11391. * is invoked to produce the cloned value. If `customizer` returns `undefined`,
  11392. * cloning is handled by the method instead. The `customizer` is invoked with
  11393. * up to four arguments; (value [, index|key, object, stack]).
  11394. *
  11395. * @static
  11396. * @memberOf _
  11397. * @since 4.0.0
  11398. * @category Lang
  11399. * @param {*} value The value to clone.
  11400. * @param {Function} [customizer] The function to customize cloning.
  11401. * @returns {*} Returns the cloned value.
  11402. * @see _.cloneDeepWith
  11403. * @example
  11404. *
  11405. * function customizer(value) {
  11406. * if (_.isElement(value)) {
  11407. * return value.cloneNode(false);
  11408. * }
  11409. * }
  11410. *
  11411. * var el = _.cloneWith(document.body, customizer);
  11412. *
  11413. * console.log(el === document.body);
  11414. * // => false
  11415. * console.log(el.nodeName);
  11416. * // => 'BODY'
  11417. * console.log(el.childNodes.length);
  11418. * // => 0
  11419. */
  11420. function cloneWith(value, customizer) {
  11421. customizer = typeof customizer == 'function' ? customizer : undefined;
  11422. return baseClone(value, CLONE_SYMBOLS_FLAG, customizer);
  11423. }
  11424. /**
  11425. * This method is like `_.clone` except that it recursively clones `value`.
  11426. *
  11427. * @static
  11428. * @memberOf _
  11429. * @since 1.0.0
  11430. * @category Lang
  11431. * @param {*} value The value to recursively clone.
  11432. * @returns {*} Returns the deep cloned value.
  11433. * @see _.clone
  11434. * @example
  11435. *
  11436. * var objects = [{ 'a': 1 }, { 'b': 2 }];
  11437. *
  11438. * var deep = _.cloneDeep(objects);
  11439. * console.log(deep[0] === objects[0]);
  11440. * // => false
  11441. */
  11442. function cloneDeep(value) {
  11443. return baseClone(value, CLONE_DEEP_FLAG | CLONE_SYMBOLS_FLAG);
  11444. }
  11445. /**
  11446. * This method is like `_.cloneWith` except that it recursively clones `value`.
  11447. *
  11448. * @static
  11449. * @memberOf _
  11450. * @since 4.0.0
  11451. * @category Lang
  11452. * @param {*} value The value to recursively clone.
  11453. * @param {Function} [customizer] The function to customize cloning.
  11454. * @returns {*} Returns the deep cloned value.
  11455. * @see _.cloneWith
  11456. * @example
  11457. *
  11458. * function customizer(value) {
  11459. * if (_.isElement(value)) {
  11460. * return value.cloneNode(true);
  11461. * }
  11462. * }
  11463. *
  11464. * var el = _.cloneDeepWith(document.body, customizer);
  11465. *
  11466. * console.log(el === document.body);
  11467. * // => false
  11468. * console.log(el.nodeName);
  11469. * // => 'BODY'
  11470. * console.log(el.childNodes.length);
  11471. * // => 20
  11472. */
  11473. function cloneDeepWith(value, customizer) {
  11474. customizer = typeof customizer == 'function' ? customizer : undefined;
  11475. return baseClone(value, CLONE_DEEP_FLAG | CLONE_SYMBOLS_FLAG, customizer);
  11476. }
  11477. /**
  11478. * Checks if `object` conforms to `source` by invoking the predicate
  11479. * properties of `source` with the corresponding property values of `object`.
  11480. *
  11481. * **Note:** This method is equivalent to `_.conforms` when `source` is
  11482. * partially applied.
  11483. *
  11484. * @static
  11485. * @memberOf _
  11486. * @since 4.14.0
  11487. * @category Lang
  11488. * @param {Object} object The object to inspect.
  11489. * @param {Object} source The object of property predicates to conform to.
  11490. * @returns {boolean} Returns `true` if `object` conforms, else `false`.
  11491. * @example
  11492. *
  11493. * var object = { 'a': 1, 'b': 2 };
  11494. *
  11495. * _.conformsTo(object, { 'b': function(n) { return n > 1; } });
  11496. * // => true
  11497. *
  11498. * _.conformsTo(object, { 'b': function(n) { return n > 2; } });
  11499. * // => false
  11500. */
  11501. function conformsTo(object, source) {
  11502. return source == null || baseConformsTo(object, source, keys(source));
  11503. }
  11504. /**
  11505. * Performs a
  11506. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  11507. * comparison between two values to determine if they are equivalent.
  11508. *
  11509. * @static
  11510. * @memberOf _
  11511. * @since 4.0.0
  11512. * @category Lang
  11513. * @param {*} value The value to compare.
  11514. * @param {*} other The other value to compare.
  11515. * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
  11516. * @example
  11517. *
  11518. * var object = { 'a': 1 };
  11519. * var other = { 'a': 1 };
  11520. *
  11521. * _.eq(object, object);
  11522. * // => true
  11523. *
  11524. * _.eq(object, other);
  11525. * // => false
  11526. *
  11527. * _.eq('a', 'a');
  11528. * // => true
  11529. *
  11530. * _.eq('a', Object('a'));
  11531. * // => false
  11532. *
  11533. * _.eq(NaN, NaN);
  11534. * // => true
  11535. */
  11536. function eq(value, other) {
  11537. return value === other || (value !== value && other !== other);
  11538. }
  11539. /**
  11540. * Checks if `value` is greater than `other`.
  11541. *
  11542. * @static
  11543. * @memberOf _
  11544. * @since 3.9.0
  11545. * @category Lang
  11546. * @param {*} value The value to compare.
  11547. * @param {*} other The other value to compare.
  11548. * @returns {boolean} Returns `true` if `value` is greater than `other`,
  11549. * else `false`.
  11550. * @see _.lt
  11551. * @example
  11552. *
  11553. * _.gt(3, 1);
  11554. * // => true
  11555. *
  11556. * _.gt(3, 3);
  11557. * // => false
  11558. *
  11559. * _.gt(1, 3);
  11560. * // => false
  11561. */
  11562. var gt = createRelationalOperation(baseGt);
  11563. /**
  11564. * Checks if `value` is greater than or equal to `other`.
  11565. *
  11566. * @static
  11567. * @memberOf _
  11568. * @since 3.9.0
  11569. * @category Lang
  11570. * @param {*} value The value to compare.
  11571. * @param {*} other The other value to compare.
  11572. * @returns {boolean} Returns `true` if `value` is greater than or equal to
  11573. * `other`, else `false`.
  11574. * @see _.lte
  11575. * @example
  11576. *
  11577. * _.gte(3, 1);
  11578. * // => true
  11579. *
  11580. * _.gte(3, 3);
  11581. * // => true
  11582. *
  11583. * _.gte(1, 3);
  11584. * // => false
  11585. */
  11586. var gte = createRelationalOperation(function(value, other) {
  11587. return value >= other;
  11588. });
  11589. /**
  11590. * Checks if `value` is likely an `arguments` object.
  11591. *
  11592. * @static
  11593. * @memberOf _
  11594. * @since 0.1.0
  11595. * @category Lang
  11596. * @param {*} value The value to check.
  11597. * @returns {boolean} Returns `true` if `value` is an `arguments` object,
  11598. * else `false`.
  11599. * @example
  11600. *
  11601. * _.isArguments(function() { return arguments; }());
  11602. * // => true
  11603. *
  11604. * _.isArguments([1, 2, 3]);
  11605. * // => false
  11606. */
  11607. var isArguments = baseIsArguments(function() { return arguments; }()) ? baseIsArguments : function(value) {
  11608. return isObjectLike(value) && hasOwnProperty.call(value, 'callee') &&
  11609. !propertyIsEnumerable.call(value, 'callee');
  11610. };
  11611. /**
  11612. * Checks if `value` is classified as an `Array` object.
  11613. *
  11614. * @static
  11615. * @memberOf _
  11616. * @since 0.1.0
  11617. * @category Lang
  11618. * @param {*} value The value to check.
  11619. * @returns {boolean} Returns `true` if `value` is an array, else `false`.
  11620. * @example
  11621. *
  11622. * _.isArray([1, 2, 3]);
  11623. * // => true
  11624. *
  11625. * _.isArray(document.body.children);
  11626. * // => false
  11627. *
  11628. * _.isArray('abc');
  11629. * // => false
  11630. *
  11631. * _.isArray(_.noop);
  11632. * // => false
  11633. */
  11634. var isArray = Array.isArray;
  11635. /**
  11636. * Checks if `value` is classified as an `ArrayBuffer` object.
  11637. *
  11638. * @static
  11639. * @memberOf _
  11640. * @since 4.3.0
  11641. * @category Lang
  11642. * @param {*} value The value to check.
  11643. * @returns {boolean} Returns `true` if `value` is an array buffer, else `false`.
  11644. * @example
  11645. *
  11646. * _.isArrayBuffer(new ArrayBuffer(2));
  11647. * // => true
  11648. *
  11649. * _.isArrayBuffer(new Array(2));
  11650. * // => false
  11651. */
  11652. var isArrayBuffer = nodeIsArrayBuffer ? baseUnary(nodeIsArrayBuffer) : baseIsArrayBuffer;
  11653. /**
  11654. * Checks if `value` is array-like. A value is considered array-like if it's
  11655. * not a function and has a `value.length` that's an integer greater than or
  11656. * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`.
  11657. *
  11658. * @static
  11659. * @memberOf _
  11660. * @since 4.0.0
  11661. * @category Lang
  11662. * @param {*} value The value to check.
  11663. * @returns {boolean} Returns `true` if `value` is array-like, else `false`.
  11664. * @example
  11665. *
  11666. * _.isArrayLike([1, 2, 3]);
  11667. * // => true
  11668. *
  11669. * _.isArrayLike(document.body.children);
  11670. * // => true
  11671. *
  11672. * _.isArrayLike('abc');
  11673. * // => true
  11674. *
  11675. * _.isArrayLike(_.noop);
  11676. * // => false
  11677. */
  11678. function isArrayLike(value) {
  11679. return value != null && isLength(value.length) && !isFunction(value);
  11680. }
  11681. /**
  11682. * This method is like `_.isArrayLike` except that it also checks if `value`
  11683. * is an object.
  11684. *
  11685. * @static
  11686. * @memberOf _
  11687. * @since 4.0.0
  11688. * @category Lang
  11689. * @param {*} value The value to check.
  11690. * @returns {boolean} Returns `true` if `value` is an array-like object,
  11691. * else `false`.
  11692. * @example
  11693. *
  11694. * _.isArrayLikeObject([1, 2, 3]);
  11695. * // => true
  11696. *
  11697. * _.isArrayLikeObject(document.body.children);
  11698. * // => true
  11699. *
  11700. * _.isArrayLikeObject('abc');
  11701. * // => false
  11702. *
  11703. * _.isArrayLikeObject(_.noop);
  11704. * // => false
  11705. */
  11706. function isArrayLikeObject(value) {
  11707. return isObjectLike(value) && isArrayLike(value);
  11708. }
  11709. /**
  11710. * Checks if `value` is classified as a boolean primitive or object.
  11711. *
  11712. * @static
  11713. * @memberOf _
  11714. * @since 0.1.0
  11715. * @category Lang
  11716. * @param {*} value The value to check.
  11717. * @returns {boolean} Returns `true` if `value` is a boolean, else `false`.
  11718. * @example
  11719. *
  11720. * _.isBoolean(false);
  11721. * // => true
  11722. *
  11723. * _.isBoolean(null);
  11724. * // => false
  11725. */
  11726. function isBoolean(value) {
  11727. return value === true || value === false ||
  11728. (isObjectLike(value) && baseGetTag(value) == boolTag);
  11729. }
  11730. /**
  11731. * Checks if `value` is a buffer.
  11732. *
  11733. * @static
  11734. * @memberOf _
  11735. * @since 4.3.0
  11736. * @category Lang
  11737. * @param {*} value The value to check.
  11738. * @returns {boolean} Returns `true` if `value` is a buffer, else `false`.
  11739. * @example
  11740. *
  11741. * _.isBuffer(new Buffer(2));
  11742. * // => true
  11743. *
  11744. * _.isBuffer(new Uint8Array(2));
  11745. * // => false
  11746. */
  11747. var isBuffer = nativeIsBuffer || stubFalse;
  11748. /**
  11749. * Checks if `value` is classified as a `Date` object.
  11750. *
  11751. * @static
  11752. * @memberOf _
  11753. * @since 0.1.0
  11754. * @category Lang
  11755. * @param {*} value The value to check.
  11756. * @returns {boolean} Returns `true` if `value` is a date object, else `false`.
  11757. * @example
  11758. *
  11759. * _.isDate(new Date);
  11760. * // => true
  11761. *
  11762. * _.isDate('Mon April 23 2012');
  11763. * // => false
  11764. */
  11765. var isDate = nodeIsDate ? baseUnary(nodeIsDate) : baseIsDate;
  11766. /**
  11767. * Checks if `value` is likely a DOM element.
  11768. *
  11769. * @static
  11770. * @memberOf _
  11771. * @since 0.1.0
  11772. * @category Lang
  11773. * @param {*} value The value to check.
  11774. * @returns {boolean} Returns `true` if `value` is a DOM element, else `false`.
  11775. * @example
  11776. *
  11777. * _.isElement(document.body);
  11778. * // => true
  11779. *
  11780. * _.isElement('<body>');
  11781. * // => false
  11782. */
  11783. function isElement(value) {
  11784. return isObjectLike(value) && value.nodeType === 1 && !isPlainObject(value);
  11785. }
  11786. /**
  11787. * Checks if `value` is an empty object, collection, map, or set.
  11788. *
  11789. * Objects are considered empty if they have no own enumerable string keyed
  11790. * properties.
  11791. *
  11792. * Array-like values such as `arguments` objects, arrays, buffers, strings, or
  11793. * jQuery-like collections are considered empty if they have a `length` of `0`.
  11794. * Similarly, maps and sets are considered empty if they have a `size` of `0`.
  11795. *
  11796. * @static
  11797. * @memberOf _
  11798. * @since 0.1.0
  11799. * @category Lang
  11800. * @param {*} value The value to check.
  11801. * @returns {boolean} Returns `true` if `value` is empty, else `false`.
  11802. * @example
  11803. *
  11804. * _.isEmpty(null);
  11805. * // => true
  11806. *
  11807. * _.isEmpty(true);
  11808. * // => true
  11809. *
  11810. * _.isEmpty(1);
  11811. * // => true
  11812. *
  11813. * _.isEmpty([1, 2, 3]);
  11814. * // => false
  11815. *
  11816. * _.isEmpty({ 'a': 1 });
  11817. * // => false
  11818. */
  11819. function isEmpty(value) {
  11820. if (value == null) {
  11821. return true;
  11822. }
  11823. if (isArrayLike(value) &&
  11824. (isArray(value) || typeof value == 'string' || typeof value.splice == 'function' ||
  11825. isBuffer(value) || isTypedArray(value) || isArguments(value))) {
  11826. return !value.length;
  11827. }
  11828. var tag = getTag(value);
  11829. if (tag == mapTag || tag == setTag) {
  11830. return !value.size;
  11831. }
  11832. if (isPrototype(value)) {
  11833. return !baseKeys(value).length;
  11834. }
  11835. for (var key in value) {
  11836. if (hasOwnProperty.call(value, key)) {
  11837. return false;
  11838. }
  11839. }
  11840. return true;
  11841. }
  11842. /**
  11843. * Performs a deep comparison between two values to determine if they are
  11844. * equivalent.
  11845. *
  11846. * **Note:** This method supports comparing arrays, array buffers, booleans,
  11847. * date objects, error objects, maps, numbers, `Object` objects, regexes,
  11848. * sets, strings, symbols, and typed arrays. `Object` objects are compared
  11849. * by their own, not inherited, enumerable properties. Functions and DOM
  11850. * nodes are compared by strict equality, i.e. `===`.
  11851. *
  11852. * @static
  11853. * @memberOf _
  11854. * @since 0.1.0
  11855. * @category Lang
  11856. * @param {*} value The value to compare.
  11857. * @param {*} other The other value to compare.
  11858. * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
  11859. * @example
  11860. *
  11861. * var object = { 'a': 1 };
  11862. * var other = { 'a': 1 };
  11863. *
  11864. * _.isEqual(object, other);
  11865. * // => true
  11866. *
  11867. * object === other;
  11868. * // => false
  11869. */
  11870. function isEqual(value, other) {
  11871. return baseIsEqual(value, other);
  11872. }
  11873. /**
  11874. * This method is like `_.isEqual` except that it accepts `customizer` which
  11875. * is invoked to compare values. If `customizer` returns `undefined`, comparisons
  11876. * are handled by the method instead. The `customizer` is invoked with up to
  11877. * six arguments: (objValue, othValue [, index|key, object, other, stack]).
  11878. *
  11879. * @static
  11880. * @memberOf _
  11881. * @since 4.0.0
  11882. * @category Lang
  11883. * @param {*} value The value to compare.
  11884. * @param {*} other The other value to compare.
  11885. * @param {Function} [customizer] The function to customize comparisons.
  11886. * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
  11887. * @example
  11888. *
  11889. * function isGreeting(value) {
  11890. * return /^h(?:i|ello)$/.test(value);
  11891. * }
  11892. *
  11893. * function customizer(objValue, othValue) {
  11894. * if (isGreeting(objValue) && isGreeting(othValue)) {
  11895. * return true;
  11896. * }
  11897. * }
  11898. *
  11899. * var array = ['hello', 'goodbye'];
  11900. * var other = ['hi', 'goodbye'];
  11901. *
  11902. * _.isEqualWith(array, other, customizer);
  11903. * // => true
  11904. */
  11905. function isEqualWith(value, other, customizer) {
  11906. customizer = typeof customizer == 'function' ? customizer : undefined;
  11907. var result = customizer ? customizer(value, other) : undefined;
  11908. return result === undefined ? baseIsEqual(value, other, undefined, customizer) : !!result;
  11909. }
  11910. /**
  11911. * Checks if `value` is an `Error`, `EvalError`, `RangeError`, `ReferenceError`,
  11912. * `SyntaxError`, `TypeError`, or `URIError` object.
  11913. *
  11914. * @static
  11915. * @memberOf _
  11916. * @since 3.0.0
  11917. * @category Lang
  11918. * @param {*} value The value to check.
  11919. * @returns {boolean} Returns `true` if `value` is an error object, else `false`.
  11920. * @example
  11921. *
  11922. * _.isError(new Error);
  11923. * // => true
  11924. *
  11925. * _.isError(Error);
  11926. * // => false
  11927. */
  11928. function isError(value) {
  11929. if (!isObjectLike(value)) {
  11930. return false;
  11931. }
  11932. var tag = baseGetTag(value);
  11933. return tag == errorTag || tag == domExcTag ||
  11934. (typeof value.message == 'string' && typeof value.name == 'string' && !isPlainObject(value));
  11935. }
  11936. /**
  11937. * Checks if `value` is a finite primitive number.
  11938. *
  11939. * **Note:** This method is based on
  11940. * [`Number.isFinite`](https://mdn.io/Number/isFinite).
  11941. *
  11942. * @static
  11943. * @memberOf _
  11944. * @since 0.1.0
  11945. * @category Lang
  11946. * @param {*} value The value to check.
  11947. * @returns {boolean} Returns `true` if `value` is a finite number, else `false`.
  11948. * @example
  11949. *
  11950. * _.isFinite(3);
  11951. * // => true
  11952. *
  11953. * _.isFinite(Number.MIN_VALUE);
  11954. * // => true
  11955. *
  11956. * _.isFinite(Infinity);
  11957. * // => false
  11958. *
  11959. * _.isFinite('3');
  11960. * // => false
  11961. */
  11962. function isFinite(value) {
  11963. return typeof value == 'number' && nativeIsFinite(value);
  11964. }
  11965. /**
  11966. * Checks if `value` is classified as a `Function` object.
  11967. *
  11968. * @static
  11969. * @memberOf _
  11970. * @since 0.1.0
  11971. * @category Lang
  11972. * @param {*} value The value to check.
  11973. * @returns {boolean} Returns `true` if `value` is a function, else `false`.
  11974. * @example
  11975. *
  11976. * _.isFunction(_);
  11977. * // => true
  11978. *
  11979. * _.isFunction(/abc/);
  11980. * // => false
  11981. */
  11982. function isFunction(value) {
  11983. if (!isObject(value)) {
  11984. return false;
  11985. }
  11986. // The use of `Object#toString` avoids issues with the `typeof` operator
  11987. // in Safari 9 which returns 'object' for typed arrays and other constructors.
  11988. var tag = baseGetTag(value);
  11989. return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag;
  11990. }
  11991. /**
  11992. * Checks if `value` is an integer.
  11993. *
  11994. * **Note:** This method is based on
  11995. * [`Number.isInteger`](https://mdn.io/Number/isInteger).
  11996. *
  11997. * @static
  11998. * @memberOf _
  11999. * @since 4.0.0
  12000. * @category Lang
  12001. * @param {*} value The value to check.
  12002. * @returns {boolean} Returns `true` if `value` is an integer, else `false`.
  12003. * @example
  12004. *
  12005. * _.isInteger(3);
  12006. * // => true
  12007. *
  12008. * _.isInteger(Number.MIN_VALUE);
  12009. * // => false
  12010. *
  12011. * _.isInteger(Infinity);
  12012. * // => false
  12013. *
  12014. * _.isInteger('3');
  12015. * // => false
  12016. */
  12017. function isInteger(value) {
  12018. return typeof value == 'number' && value == toInteger(value);
  12019. }
  12020. /**
  12021. * Checks if `value` is a valid array-like length.
  12022. *
  12023. * **Note:** This method is loosely based on
  12024. * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).
  12025. *
  12026. * @static
  12027. * @memberOf _
  12028. * @since 4.0.0
  12029. * @category Lang
  12030. * @param {*} value The value to check.
  12031. * @returns {boolean} Returns `true` if `value` is a valid length, else `false`.
  12032. * @example
  12033. *
  12034. * _.isLength(3);
  12035. * // => true
  12036. *
  12037. * _.isLength(Number.MIN_VALUE);
  12038. * // => false
  12039. *
  12040. * _.isLength(Infinity);
  12041. * // => false
  12042. *
  12043. * _.isLength('3');
  12044. * // => false
  12045. */
  12046. function isLength(value) {
  12047. return typeof value == 'number' &&
  12048. value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;
  12049. }
  12050. /**
  12051. * Checks if `value` is the
  12052. * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)
  12053. * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
  12054. *
  12055. * @static
  12056. * @memberOf _
  12057. * @since 0.1.0
  12058. * @category Lang
  12059. * @param {*} value The value to check.
  12060. * @returns {boolean} Returns `true` if `value` is an object, else `false`.
  12061. * @example
  12062. *
  12063. * _.isObject({});
  12064. * // => true
  12065. *
  12066. * _.isObject([1, 2, 3]);
  12067. * // => true
  12068. *
  12069. * _.isObject(_.noop);
  12070. * // => true
  12071. *
  12072. * _.isObject(null);
  12073. * // => false
  12074. */
  12075. function isObject(value) {
  12076. var type = typeof value;
  12077. return value != null && (type == 'object' || type == 'function');
  12078. }
  12079. /**
  12080. * Checks if `value` is object-like. A value is object-like if it's not `null`
  12081. * and has a `typeof` result of "object".
  12082. *
  12083. * @static
  12084. * @memberOf _
  12085. * @since 4.0.0
  12086. * @category Lang
  12087. * @param {*} value The value to check.
  12088. * @returns {boolean} Returns `true` if `value` is object-like, else `false`.
  12089. * @example
  12090. *
  12091. * _.isObjectLike({});
  12092. * // => true
  12093. *
  12094. * _.isObjectLike([1, 2, 3]);
  12095. * // => true
  12096. *
  12097. * _.isObjectLike(_.noop);
  12098. * // => false
  12099. *
  12100. * _.isObjectLike(null);
  12101. * // => false
  12102. */
  12103. function isObjectLike(value) {
  12104. return value != null && typeof value == 'object';
  12105. }
  12106. /**
  12107. * Checks if `value` is classified as a `Map` object.
  12108. *
  12109. * @static
  12110. * @memberOf _
  12111. * @since 4.3.0
  12112. * @category Lang
  12113. * @param {*} value The value to check.
  12114. * @returns {boolean} Returns `true` if `value` is a map, else `false`.
  12115. * @example
  12116. *
  12117. * _.isMap(new Map);
  12118. * // => true
  12119. *
  12120. * _.isMap(new WeakMap);
  12121. * // => false
  12122. */
  12123. var isMap = nodeIsMap ? baseUnary(nodeIsMap) : baseIsMap;
  12124. /**
  12125. * Performs a partial deep comparison between `object` and `source` to
  12126. * determine if `object` contains equivalent property values.
  12127. *
  12128. * **Note:** This method is equivalent to `_.matches` when `source` is
  12129. * partially applied.
  12130. *
  12131. * Partial comparisons will match empty array and empty object `source`
  12132. * values against any array or object value, respectively. See `_.isEqual`
  12133. * for a list of supported value comparisons.
  12134. *
  12135. * @static
  12136. * @memberOf _
  12137. * @since 3.0.0
  12138. * @category Lang
  12139. * @param {Object} object The object to inspect.
  12140. * @param {Object} source The object of property values to match.
  12141. * @returns {boolean} Returns `true` if `object` is a match, else `false`.
  12142. * @example
  12143. *
  12144. * var object = { 'a': 1, 'b': 2 };
  12145. *
  12146. * _.isMatch(object, { 'b': 2 });
  12147. * // => true
  12148. *
  12149. * _.isMatch(object, { 'b': 1 });
  12150. * // => false
  12151. */
  12152. function isMatch(object, source) {
  12153. return object === source || baseIsMatch(object, source, getMatchData(source));
  12154. }
  12155. /**
  12156. * This method is like `_.isMatch` except that it accepts `customizer` which
  12157. * is invoked to compare values. If `customizer` returns `undefined`, comparisons
  12158. * are handled by the method instead. The `customizer` is invoked with five
  12159. * arguments: (objValue, srcValue, index|key, object, source).
  12160. *
  12161. * @static
  12162. * @memberOf _
  12163. * @since 4.0.0
  12164. * @category Lang
  12165. * @param {Object} object The object to inspect.
  12166. * @param {Object} source The object of property values to match.
  12167. * @param {Function} [customizer] The function to customize comparisons.
  12168. * @returns {boolean} Returns `true` if `object` is a match, else `false`.
  12169. * @example
  12170. *
  12171. * function isGreeting(value) {
  12172. * return /^h(?:i|ello)$/.test(value);
  12173. * }
  12174. *
  12175. * function customizer(objValue, srcValue) {
  12176. * if (isGreeting(objValue) && isGreeting(srcValue)) {
  12177. * return true;
  12178. * }
  12179. * }
  12180. *
  12181. * var object = { 'greeting': 'hello' };
  12182. * var source = { 'greeting': 'hi' };
  12183. *
  12184. * _.isMatchWith(object, source, customizer);
  12185. * // => true
  12186. */
  12187. function isMatchWith(object, source, customizer) {
  12188. customizer = typeof customizer == 'function' ? customizer : undefined;
  12189. return baseIsMatch(object, source, getMatchData(source), customizer);
  12190. }
  12191. /**
  12192. * Checks if `value` is `NaN`.
  12193. *
  12194. * **Note:** This method is based on
  12195. * [`Number.isNaN`](https://mdn.io/Number/isNaN) and is not the same as
  12196. * global [`isNaN`](https://mdn.io/isNaN) which returns `true` for
  12197. * `undefined` and other non-number values.
  12198. *
  12199. * @static
  12200. * @memberOf _
  12201. * @since 0.1.0
  12202. * @category Lang
  12203. * @param {*} value The value to check.
  12204. * @returns {boolean} Returns `true` if `value` is `NaN`, else `false`.
  12205. * @example
  12206. *
  12207. * _.isNaN(NaN);
  12208. * // => true
  12209. *
  12210. * _.isNaN(new Number(NaN));
  12211. * // => true
  12212. *
  12213. * isNaN(undefined);
  12214. * // => true
  12215. *
  12216. * _.isNaN(undefined);
  12217. * // => false
  12218. */
  12219. function isNaN(value) {
  12220. // An `NaN` primitive is the only value that is not equal to itself.
  12221. // Perform the `toStringTag` check first to avoid errors with some
  12222. // ActiveX objects in IE.
  12223. return isNumber(value) && value != +value;
  12224. }
  12225. /**
  12226. * Checks if `value` is a pristine native function.
  12227. *
  12228. * **Note:** This method can't reliably detect native functions in the presence
  12229. * of the core-js package because core-js circumvents this kind of detection.
  12230. * Despite multiple requests, the core-js maintainer has made it clear: any
  12231. * attempt to fix the detection will be obstructed. As a result, we're left
  12232. * with little choice but to throw an error. Unfortunately, this also affects
  12233. * packages, like [babel-polyfill](https://www.npmjs.com/package/babel-polyfill),
  12234. * which rely on core-js.
  12235. *
  12236. * @static
  12237. * @memberOf _
  12238. * @since 3.0.0
  12239. * @category Lang
  12240. * @param {*} value The value to check.
  12241. * @returns {boolean} Returns `true` if `value` is a native function,
  12242. * else `false`.
  12243. * @example
  12244. *
  12245. * _.isNative(Array.prototype.push);
  12246. * // => true
  12247. *
  12248. * _.isNative(_);
  12249. * // => false
  12250. */
  12251. function isNative(value) {
  12252. if (isMaskable(value)) {
  12253. throw new Error(CORE_ERROR_TEXT);
  12254. }
  12255. return baseIsNative(value);
  12256. }
  12257. /**
  12258. * Checks if `value` is `null`.
  12259. *
  12260. * @static
  12261. * @memberOf _
  12262. * @since 0.1.0
  12263. * @category Lang
  12264. * @param {*} value The value to check.
  12265. * @returns {boolean} Returns `true` if `value` is `null`, else `false`.
  12266. * @example
  12267. *
  12268. * _.isNull(null);
  12269. * // => true
  12270. *
  12271. * _.isNull(void 0);
  12272. * // => false
  12273. */
  12274. function isNull(value) {
  12275. return value === null;
  12276. }
  12277. /**
  12278. * Checks if `value` is `null` or `undefined`.
  12279. *
  12280. * @static
  12281. * @memberOf _
  12282. * @since 4.0.0
  12283. * @category Lang
  12284. * @param {*} value The value to check.
  12285. * @returns {boolean} Returns `true` if `value` is nullish, else `false`.
  12286. * @example
  12287. *
  12288. * _.isNil(null);
  12289. * // => true
  12290. *
  12291. * _.isNil(void 0);
  12292. * // => true
  12293. *
  12294. * _.isNil(NaN);
  12295. * // => false
  12296. */
  12297. function isNil(value) {
  12298. return value == null;
  12299. }
  12300. /**
  12301. * Checks if `value` is classified as a `Number` primitive or object.
  12302. *
  12303. * **Note:** To exclude `Infinity`, `-Infinity`, and `NaN`, which are
  12304. * classified as numbers, use the `_.isFinite` method.
  12305. *
  12306. * @static
  12307. * @memberOf _
  12308. * @since 0.1.0
  12309. * @category Lang
  12310. * @param {*} value The value to check.
  12311. * @returns {boolean} Returns `true` if `value` is a number, else `false`.
  12312. * @example
  12313. *
  12314. * _.isNumber(3);
  12315. * // => true
  12316. *
  12317. * _.isNumber(Number.MIN_VALUE);
  12318. * // => true
  12319. *
  12320. * _.isNumber(Infinity);
  12321. * // => true
  12322. *
  12323. * _.isNumber('3');
  12324. * // => false
  12325. */
  12326. function isNumber(value) {
  12327. return typeof value == 'number' ||
  12328. (isObjectLike(value) && baseGetTag(value) == numberTag);
  12329. }
  12330. /**
  12331. * Checks if `value` is a plain object, that is, an object created by the
  12332. * `Object` constructor or one with a `[[Prototype]]` of `null`.
  12333. *
  12334. * @static
  12335. * @memberOf _
  12336. * @since 0.8.0
  12337. * @category Lang
  12338. * @param {*} value The value to check.
  12339. * @returns {boolean} Returns `true` if `value` is a plain object, else `false`.
  12340. * @example
  12341. *
  12342. * function Foo() {
  12343. * this.a = 1;
  12344. * }
  12345. *
  12346. * _.isPlainObject(new Foo);
  12347. * // => false
  12348. *
  12349. * _.isPlainObject([1, 2, 3]);
  12350. * // => false
  12351. *
  12352. * _.isPlainObject({ 'x': 0, 'y': 0 });
  12353. * // => true
  12354. *
  12355. * _.isPlainObject(Object.create(null));
  12356. * // => true
  12357. */
  12358. function isPlainObject(value) {
  12359. if (!isObjectLike(value) || baseGetTag(value) != objectTag) {
  12360. return false;
  12361. }
  12362. var proto = getPrototype(value);
  12363. if (proto === null) {
  12364. return true;
  12365. }
  12366. var Ctor = hasOwnProperty.call(proto, 'constructor') && proto.constructor;
  12367. return typeof Ctor == 'function' && Ctor instanceof Ctor &&
  12368. funcToString.call(Ctor) == objectCtorString;
  12369. }
  12370. /**
  12371. * Checks if `value` is classified as a `RegExp` object.
  12372. *
  12373. * @static
  12374. * @memberOf _
  12375. * @since 0.1.0
  12376. * @category Lang
  12377. * @param {*} value The value to check.
  12378. * @returns {boolean} Returns `true` if `value` is a regexp, else `false`.
  12379. * @example
  12380. *
  12381. * _.isRegExp(/abc/);
  12382. * // => true
  12383. *
  12384. * _.isRegExp('/abc/');
  12385. * // => false
  12386. */
  12387. var isRegExp = nodeIsRegExp ? baseUnary(nodeIsRegExp) : baseIsRegExp;
  12388. /**
  12389. * Checks if `value` is a safe integer. An integer is safe if it's an IEEE-754
  12390. * double precision number which isn't the result of a rounded unsafe integer.
  12391. *
  12392. * **Note:** This method is based on
  12393. * [`Number.isSafeInteger`](https://mdn.io/Number/isSafeInteger).
  12394. *
  12395. * @static
  12396. * @memberOf _
  12397. * @since 4.0.0
  12398. * @category Lang
  12399. * @param {*} value The value to check.
  12400. * @returns {boolean} Returns `true` if `value` is a safe integer, else `false`.
  12401. * @example
  12402. *
  12403. * _.isSafeInteger(3);
  12404. * // => true
  12405. *
  12406. * _.isSafeInteger(Number.MIN_VALUE);
  12407. * // => false
  12408. *
  12409. * _.isSafeInteger(Infinity);
  12410. * // => false
  12411. *
  12412. * _.isSafeInteger('3');
  12413. * // => false
  12414. */
  12415. function isSafeInteger(value) {
  12416. return isInteger(value) && value >= -MAX_SAFE_INTEGER && value <= MAX_SAFE_INTEGER;
  12417. }
  12418. /**
  12419. * Checks if `value` is classified as a `Set` object.
  12420. *
  12421. * @static
  12422. * @memberOf _
  12423. * @since 4.3.0
  12424. * @category Lang
  12425. * @param {*} value The value to check.
  12426. * @returns {boolean} Returns `true` if `value` is a set, else `false`.
  12427. * @example
  12428. *
  12429. * _.isSet(new Set);
  12430. * // => true
  12431. *
  12432. * _.isSet(new WeakSet);
  12433. * // => false
  12434. */
  12435. var isSet = nodeIsSet ? baseUnary(nodeIsSet) : baseIsSet;
  12436. /**
  12437. * Checks if `value` is classified as a `String` primitive or object.
  12438. *
  12439. * @static
  12440. * @since 0.1.0
  12441. * @memberOf _
  12442. * @category Lang
  12443. * @param {*} value The value to check.
  12444. * @returns {boolean} Returns `true` if `value` is a string, else `false`.
  12445. * @example
  12446. *
  12447. * _.isString('abc');
  12448. * // => true
  12449. *
  12450. * _.isString(1);
  12451. * // => false
  12452. */
  12453. function isString(value) {
  12454. return typeof value == 'string' ||
  12455. (!isArray(value) && isObjectLike(value) && baseGetTag(value) == stringTag);
  12456. }
  12457. /**
  12458. * Checks if `value` is classified as a `Symbol` primitive or object.
  12459. *
  12460. * @static
  12461. * @memberOf _
  12462. * @since 4.0.0
  12463. * @category Lang
  12464. * @param {*} value The value to check.
  12465. * @returns {boolean} Returns `true` if `value` is a symbol, else `false`.
  12466. * @example
  12467. *
  12468. * _.isSymbol(Symbol.iterator);
  12469. * // => true
  12470. *
  12471. * _.isSymbol('abc');
  12472. * // => false
  12473. */
  12474. function isSymbol(value) {
  12475. return typeof value == 'symbol' ||
  12476. (isObjectLike(value) && baseGetTag(value) == symbolTag);
  12477. }
  12478. /**
  12479. * Checks if `value` is classified as a typed array.
  12480. *
  12481. * @static
  12482. * @memberOf _
  12483. * @since 3.0.0
  12484. * @category Lang
  12485. * @param {*} value The value to check.
  12486. * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.
  12487. * @example
  12488. *
  12489. * _.isTypedArray(new Uint8Array);
  12490. * // => true
  12491. *
  12492. * _.isTypedArray([]);
  12493. * // => false
  12494. */
  12495. var isTypedArray = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray;
  12496. /**
  12497. * Checks if `value` is `undefined`.
  12498. *
  12499. * @static
  12500. * @since 0.1.0
  12501. * @memberOf _
  12502. * @category Lang
  12503. * @param {*} value The value to check.
  12504. * @returns {boolean} Returns `true` if `value` is `undefined`, else `false`.
  12505. * @example
  12506. *
  12507. * _.isUndefined(void 0);
  12508. * // => true
  12509. *
  12510. * _.isUndefined(null);
  12511. * // => false
  12512. */
  12513. function isUndefined(value) {
  12514. return value === undefined;
  12515. }
  12516. /**
  12517. * Checks if `value` is classified as a `WeakMap` object.
  12518. *
  12519. * @static
  12520. * @memberOf _
  12521. * @since 4.3.0
  12522. * @category Lang
  12523. * @param {*} value The value to check.
  12524. * @returns {boolean} Returns `true` if `value` is a weak map, else `false`.
  12525. * @example
  12526. *
  12527. * _.isWeakMap(new WeakMap);
  12528. * // => true
  12529. *
  12530. * _.isWeakMap(new Map);
  12531. * // => false
  12532. */
  12533. function isWeakMap(value) {
  12534. return isObjectLike(value) && getTag(value) == weakMapTag;
  12535. }
  12536. /**
  12537. * Checks if `value` is classified as a `WeakSet` object.
  12538. *
  12539. * @static
  12540. * @memberOf _
  12541. * @since 4.3.0
  12542. * @category Lang
  12543. * @param {*} value The value to check.
  12544. * @returns {boolean} Returns `true` if `value` is a weak set, else `false`.
  12545. * @example
  12546. *
  12547. * _.isWeakSet(new WeakSet);
  12548. * // => true
  12549. *
  12550. * _.isWeakSet(new Set);
  12551. * // => false
  12552. */
  12553. function isWeakSet(value) {
  12554. return isObjectLike(value) && baseGetTag(value) == weakSetTag;
  12555. }
  12556. /**
  12557. * Checks if `value` is less than `other`.
  12558. *
  12559. * @static
  12560. * @memberOf _
  12561. * @since 3.9.0
  12562. * @category Lang
  12563. * @param {*} value The value to compare.
  12564. * @param {*} other The other value to compare.
  12565. * @returns {boolean} Returns `true` if `value` is less than `other`,
  12566. * else `false`.
  12567. * @see _.gt
  12568. * @example
  12569. *
  12570. * _.lt(1, 3);
  12571. * // => true
  12572. *
  12573. * _.lt(3, 3);
  12574. * // => false
  12575. *
  12576. * _.lt(3, 1);
  12577. * // => false
  12578. */
  12579. var lt = createRelationalOperation(baseLt);
  12580. /**
  12581. * Checks if `value` is less than or equal to `other`.
  12582. *
  12583. * @static
  12584. * @memberOf _
  12585. * @since 3.9.0
  12586. * @category Lang
  12587. * @param {*} value The value to compare.
  12588. * @param {*} other The other value to compare.
  12589. * @returns {boolean} Returns `true` if `value` is less than or equal to
  12590. * `other`, else `false`.
  12591. * @see _.gte
  12592. * @example
  12593. *
  12594. * _.lte(1, 3);
  12595. * // => true
  12596. *
  12597. * _.lte(3, 3);
  12598. * // => true
  12599. *
  12600. * _.lte(3, 1);
  12601. * // => false
  12602. */
  12603. var lte = createRelationalOperation(function(value, other) {
  12604. return value <= other;
  12605. });
  12606. /**
  12607. * Converts `value` to an array.
  12608. *
  12609. * @static
  12610. * @since 0.1.0
  12611. * @memberOf _
  12612. * @category Lang
  12613. * @param {*} value The value to convert.
  12614. * @returns {Array} Returns the converted array.
  12615. * @example
  12616. *
  12617. * _.toArray({ 'a': 1, 'b': 2 });
  12618. * // => [1, 2]
  12619. *
  12620. * _.toArray('abc');
  12621. * // => ['a', 'b', 'c']
  12622. *
  12623. * _.toArray(1);
  12624. * // => []
  12625. *
  12626. * _.toArray(null);
  12627. * // => []
  12628. */
  12629. function toArray(value) {
  12630. if (!value) {
  12631. return [];
  12632. }
  12633. if (isArrayLike(value)) {
  12634. return isString(value) ? stringToArray(value) : copyArray(value);
  12635. }
  12636. if (symIterator && value[symIterator]) {
  12637. return iteratorToArray(value[symIterator]());
  12638. }
  12639. var tag = getTag(value),
  12640. func = tag == mapTag ? mapToArray : (tag == setTag ? setToArray : values);
  12641. return func(value);
  12642. }
  12643. /**
  12644. * Converts `value` to a finite number.
  12645. *
  12646. * @static
  12647. * @memberOf _
  12648. * @since 4.12.0
  12649. * @category Lang
  12650. * @param {*} value The value to convert.
  12651. * @returns {number} Returns the converted number.
  12652. * @example
  12653. *
  12654. * _.toFinite(3.2);
  12655. * // => 3.2
  12656. *
  12657. * _.toFinite(Number.MIN_VALUE);
  12658. * // => 5e-324
  12659. *
  12660. * _.toFinite(Infinity);
  12661. * // => 1.7976931348623157e+308
  12662. *
  12663. * _.toFinite('3.2');
  12664. * // => 3.2
  12665. */
  12666. function toFinite(value) {
  12667. if (!value) {
  12668. return value === 0 ? value : 0;
  12669. }
  12670. value = toNumber(value);
  12671. if (value === INFINITY || value === -INFINITY) {
  12672. var sign = (value < 0 ? -1 : 1);
  12673. return sign * MAX_INTEGER;
  12674. }
  12675. return value === value ? value : 0;
  12676. }
  12677. /**
  12678. * Converts `value` to an integer.
  12679. *
  12680. * **Note:** This method is loosely based on
  12681. * [`ToInteger`](http://www.ecma-international.org/ecma-262/7.0/#sec-tointeger).
  12682. *
  12683. * @static
  12684. * @memberOf _
  12685. * @since 4.0.0
  12686. * @category Lang
  12687. * @param {*} value The value to convert.
  12688. * @returns {number} Returns the converted integer.
  12689. * @example
  12690. *
  12691. * _.toInteger(3.2);
  12692. * // => 3
  12693. *
  12694. * _.toInteger(Number.MIN_VALUE);
  12695. * // => 0
  12696. *
  12697. * _.toInteger(Infinity);
  12698. * // => 1.7976931348623157e+308
  12699. *
  12700. * _.toInteger('3.2');
  12701. * // => 3
  12702. */
  12703. function toInteger(value) {
  12704. var result = toFinite(value),
  12705. remainder = result % 1;
  12706. return result === result ? (remainder ? result - remainder : result) : 0;
  12707. }
  12708. /**
  12709. * Converts `value` to an integer suitable for use as the length of an
  12710. * array-like object.
  12711. *
  12712. * **Note:** This method is based on
  12713. * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).
  12714. *
  12715. * @static
  12716. * @memberOf _
  12717. * @since 4.0.0
  12718. * @category Lang
  12719. * @param {*} value The value to convert.
  12720. * @returns {number} Returns the converted integer.
  12721. * @example
  12722. *
  12723. * _.toLength(3.2);
  12724. * // => 3
  12725. *
  12726. * _.toLength(Number.MIN_VALUE);
  12727. * // => 0
  12728. *
  12729. * _.toLength(Infinity);
  12730. * // => 4294967295
  12731. *
  12732. * _.toLength('3.2');
  12733. * // => 3
  12734. */
  12735. function toLength(value) {
  12736. return value ? baseClamp(toInteger(value), 0, MAX_ARRAY_LENGTH) : 0;
  12737. }
  12738. /**
  12739. * Converts `value` to a number.
  12740. *
  12741. * @static
  12742. * @memberOf _
  12743. * @since 4.0.0
  12744. * @category Lang
  12745. * @param {*} value The value to process.
  12746. * @returns {number} Returns the number.
  12747. * @example
  12748. *
  12749. * _.toNumber(3.2);
  12750. * // => 3.2
  12751. *
  12752. * _.toNumber(Number.MIN_VALUE);
  12753. * // => 5e-324
  12754. *
  12755. * _.toNumber(Infinity);
  12756. * // => Infinity
  12757. *
  12758. * _.toNumber('3.2');
  12759. * // => 3.2
  12760. */
  12761. function toNumber(value) {
  12762. if (typeof value == 'number') {
  12763. return value;
  12764. }
  12765. if (isSymbol(value)) {
  12766. return NAN;
  12767. }
  12768. if (isObject(value)) {
  12769. var other = typeof value.valueOf == 'function' ? value.valueOf() : value;
  12770. value = isObject(other) ? (other + '') : other;
  12771. }
  12772. if (typeof value != 'string') {
  12773. return value === 0 ? value : +value;
  12774. }
  12775. value = baseTrim(value);
  12776. var isBinary = reIsBinary.test(value);
  12777. return (isBinary || reIsOctal.test(value))
  12778. ? freeParseInt(value.slice(2), isBinary ? 2 : 8)
  12779. : (reIsBadHex.test(value) ? NAN : +value);
  12780. }
  12781. /**
  12782. * Converts `value` to a plain object flattening inherited enumerable string
  12783. * keyed properties of `value` to own properties of the plain object.
  12784. *
  12785. * @static
  12786. * @memberOf _
  12787. * @since 3.0.0
  12788. * @category Lang
  12789. * @param {*} value The value to convert.
  12790. * @returns {Object} Returns the converted plain object.
  12791. * @example
  12792. *
  12793. * function Foo() {
  12794. * this.b = 2;
  12795. * }
  12796. *
  12797. * Foo.prototype.c = 3;
  12798. *
  12799. * _.assign({ 'a': 1 }, new Foo);
  12800. * // => { 'a': 1, 'b': 2 }
  12801. *
  12802. * _.assign({ 'a': 1 }, _.toPlainObject(new Foo));
  12803. * // => { 'a': 1, 'b': 2, 'c': 3 }
  12804. */
  12805. function toPlainObject(value) {
  12806. return copyObject(value, keysIn(value));
  12807. }
  12808. /**
  12809. * Converts `value` to a safe integer. A safe integer can be compared and
  12810. * represented correctly.
  12811. *
  12812. * @static
  12813. * @memberOf _
  12814. * @since 4.0.0
  12815. * @category Lang
  12816. * @param {*} value The value to convert.
  12817. * @returns {number} Returns the converted integer.
  12818. * @example
  12819. *
  12820. * _.toSafeInteger(3.2);
  12821. * // => 3
  12822. *
  12823. * _.toSafeInteger(Number.MIN_VALUE);
  12824. * // => 0
  12825. *
  12826. * _.toSafeInteger(Infinity);
  12827. * // => 9007199254740991
  12828. *
  12829. * _.toSafeInteger('3.2');
  12830. * // => 3
  12831. */
  12832. function toSafeInteger(value) {
  12833. return value
  12834. ? baseClamp(toInteger(value), -MAX_SAFE_INTEGER, MAX_SAFE_INTEGER)
  12835. : (value === 0 ? value : 0);
  12836. }
  12837. /**
  12838. * Converts `value` to a string. An empty string is returned for `null`
  12839. * and `undefined` values. The sign of `-0` is preserved.
  12840. *
  12841. * @static
  12842. * @memberOf _
  12843. * @since 4.0.0
  12844. * @category Lang
  12845. * @param {*} value The value to convert.
  12846. * @returns {string} Returns the converted string.
  12847. * @example
  12848. *
  12849. * _.toString(null);
  12850. * // => ''
  12851. *
  12852. * _.toString(-0);
  12853. * // => '-0'
  12854. *
  12855. * _.toString([1, 2, 3]);
  12856. * // => '1,2,3'
  12857. */
  12858. function toString(value) {
  12859. return value == null ? '' : baseToString(value);
  12860. }
  12861. /*------------------------------------------------------------------------*/
  12862. /**
  12863. * Assigns own enumerable string keyed properties of source objects to the
  12864. * destination object. Source objects are applied from left to right.
  12865. * Subsequent sources overwrite property assignments of previous sources.
  12866. *
  12867. * **Note:** This method mutates `object` and is loosely based on
  12868. * [`Object.assign`](https://mdn.io/Object/assign).
  12869. *
  12870. * @static
  12871. * @memberOf _
  12872. * @since 0.10.0
  12873. * @category Object
  12874. * @param {Object} object The destination object.
  12875. * @param {...Object} [sources] The source objects.
  12876. * @returns {Object} Returns `object`.
  12877. * @see _.assignIn
  12878. * @example
  12879. *
  12880. * function Foo() {
  12881. * this.a = 1;
  12882. * }
  12883. *
  12884. * function Bar() {
  12885. * this.c = 3;
  12886. * }
  12887. *
  12888. * Foo.prototype.b = 2;
  12889. * Bar.prototype.d = 4;
  12890. *
  12891. * _.assign({ 'a': 0 }, new Foo, new Bar);
  12892. * // => { 'a': 1, 'c': 3 }
  12893. */
  12894. var assign = createAssigner(function(object, source) {
  12895. if (isPrototype(source) || isArrayLike(source)) {
  12896. copyObject(source, keys(source), object);
  12897. return;
  12898. }
  12899. for (var key in source) {
  12900. if (hasOwnProperty.call(source, key)) {
  12901. assignValue(object, key, source[key]);
  12902. }
  12903. }
  12904. });
  12905. /**
  12906. * This method is like `_.assign` except that it iterates over own and
  12907. * inherited source properties.
  12908. *
  12909. * **Note:** This method mutates `object`.
  12910. *
  12911. * @static
  12912. * @memberOf _
  12913. * @since 4.0.0
  12914. * @alias extend
  12915. * @category Object
  12916. * @param {Object} object The destination object.
  12917. * @param {...Object} [sources] The source objects.
  12918. * @returns {Object} Returns `object`.
  12919. * @see _.assign
  12920. * @example
  12921. *
  12922. * function Foo() {
  12923. * this.a = 1;
  12924. * }
  12925. *
  12926. * function Bar() {
  12927. * this.c = 3;
  12928. * }
  12929. *
  12930. * Foo.prototype.b = 2;
  12931. * Bar.prototype.d = 4;
  12932. *
  12933. * _.assignIn({ 'a': 0 }, new Foo, new Bar);
  12934. * // => { 'a': 1, 'b': 2, 'c': 3, 'd': 4 }
  12935. */
  12936. var assignIn = createAssigner(function(object, source) {
  12937. copyObject(source, keysIn(source), object);
  12938. });
  12939. /**
  12940. * This method is like `_.assignIn` except that it accepts `customizer`
  12941. * which is invoked to produce the assigned values. If `customizer` returns
  12942. * `undefined`, assignment is handled by the method instead. The `customizer`
  12943. * is invoked with five arguments: (objValue, srcValue, key, object, source).
  12944. *
  12945. * **Note:** This method mutates `object`.
  12946. *
  12947. * @static
  12948. * @memberOf _
  12949. * @since 4.0.0
  12950. * @alias extendWith
  12951. * @category Object
  12952. * @param {Object} object The destination object.
  12953. * @param {...Object} sources The source objects.
  12954. * @param {Function} [customizer] The function to customize assigned values.
  12955. * @returns {Object} Returns `object`.
  12956. * @see _.assignWith
  12957. * @example
  12958. *
  12959. * function customizer(objValue, srcValue) {
  12960. * return _.isUndefined(objValue) ? srcValue : objValue;
  12961. * }
  12962. *
  12963. * var defaults = _.partialRight(_.assignInWith, customizer);
  12964. *
  12965. * defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 });
  12966. * // => { 'a': 1, 'b': 2 }
  12967. */
  12968. var assignInWith = createAssigner(function(object, source, srcIndex, customizer) {
  12969. copyObject(source, keysIn(source), object, customizer);
  12970. });
  12971. /**
  12972. * This method is like `_.assign` except that it accepts `customizer`
  12973. * which is invoked to produce the assigned values. If `customizer` returns
  12974. * `undefined`, assignment is handled by the method instead. The `customizer`
  12975. * is invoked with five arguments: (objValue, srcValue, key, object, source).
  12976. *
  12977. * **Note:** This method mutates `object`.
  12978. *
  12979. * @static
  12980. * @memberOf _
  12981. * @since 4.0.0
  12982. * @category Object
  12983. * @param {Object} object The destination object.
  12984. * @param {...Object} sources The source objects.
  12985. * @param {Function} [customizer] The function to customize assigned values.
  12986. * @returns {Object} Returns `object`.
  12987. * @see _.assignInWith
  12988. * @example
  12989. *
  12990. * function customizer(objValue, srcValue) {
  12991. * return _.isUndefined(objValue) ? srcValue : objValue;
  12992. * }
  12993. *
  12994. * var defaults = _.partialRight(_.assignWith, customizer);
  12995. *
  12996. * defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 });
  12997. * // => { 'a': 1, 'b': 2 }
  12998. */
  12999. var assignWith = createAssigner(function(object, source, srcIndex, customizer) {
  13000. copyObject(source, keys(source), object, customizer);
  13001. });
  13002. /**
  13003. * Creates an array of values corresponding to `paths` of `object`.
  13004. *
  13005. * @static
  13006. * @memberOf _
  13007. * @since 1.0.0
  13008. * @category Object
  13009. * @param {Object} object The object to iterate over.
  13010. * @param {...(string|string[])} [paths] The property paths to pick.
  13011. * @returns {Array} Returns the picked values.
  13012. * @example
  13013. *
  13014. * var object = { 'a': [{ 'b': { 'c': 3 } }, 4] };
  13015. *
  13016. * _.at(object, ['a[0].b.c', 'a[1]']);
  13017. * // => [3, 4]
  13018. */
  13019. var at = flatRest(baseAt);
  13020. /**
  13021. * Creates an object that inherits from the `prototype` object. If a
  13022. * `properties` object is given, its own enumerable string keyed properties
  13023. * are assigned to the created object.
  13024. *
  13025. * @static
  13026. * @memberOf _
  13027. * @since 2.3.0
  13028. * @category Object
  13029. * @param {Object} prototype The object to inherit from.
  13030. * @param {Object} [properties] The properties to assign to the object.
  13031. * @returns {Object} Returns the new object.
  13032. * @example
  13033. *
  13034. * function Shape() {
  13035. * this.x = 0;
  13036. * this.y = 0;
  13037. * }
  13038. *
  13039. * function Circle() {
  13040. * Shape.call(this);
  13041. * }
  13042. *
  13043. * Circle.prototype = _.create(Shape.prototype, {
  13044. * 'constructor': Circle
  13045. * });
  13046. *
  13047. * var circle = new Circle;
  13048. * circle instanceof Circle;
  13049. * // => true
  13050. *
  13051. * circle instanceof Shape;
  13052. * // => true
  13053. */
  13054. function create(prototype, properties) {
  13055. var result = baseCreate(prototype);
  13056. return properties == null ? result : baseAssign(result, properties);
  13057. }
  13058. /**
  13059. * Assigns own and inherited enumerable string keyed properties of source
  13060. * objects to the destination object for all destination properties that
  13061. * resolve to `undefined`. Source objects are applied from left to right.
  13062. * Once a property is set, additional values of the same property are ignored.
  13063. *
  13064. * **Note:** This method mutates `object`.
  13065. *
  13066. * @static
  13067. * @since 0.1.0
  13068. * @memberOf _
  13069. * @category Object
  13070. * @param {Object} object The destination object.
  13071. * @param {...Object} [sources] The source objects.
  13072. * @returns {Object} Returns `object`.
  13073. * @see _.defaultsDeep
  13074. * @example
  13075. *
  13076. * _.defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 });
  13077. * // => { 'a': 1, 'b': 2 }
  13078. */
  13079. var defaults = baseRest(function(object, sources) {
  13080. object = Object(object);
  13081. var index = -1;
  13082. var length = sources.length;
  13083. var guard = length > 2 ? sources[2] : undefined;
  13084. if (guard && isIterateeCall(sources[0], sources[1], guard)) {
  13085. length = 1;
  13086. }
  13087. while (++index < length) {
  13088. var source = sources[index];
  13089. var props = keysIn(source);
  13090. var propsIndex = -1;
  13091. var propsLength = props.length;
  13092. while (++propsIndex < propsLength) {
  13093. var key = props[propsIndex];
  13094. var value = object[key];
  13095. if (value === undefined ||
  13096. (eq(value, objectProto[key]) && !hasOwnProperty.call(object, key))) {
  13097. object[key] = source[key];
  13098. }
  13099. }
  13100. }
  13101. return object;
  13102. });
  13103. /**
  13104. * This method is like `_.defaults` except that it recursively assigns
  13105. * default properties.
  13106. *
  13107. * **Note:** This method mutates `object`.
  13108. *
  13109. * @static
  13110. * @memberOf _
  13111. * @since 3.10.0
  13112. * @category Object
  13113. * @param {Object} object The destination object.
  13114. * @param {...Object} [sources] The source objects.
  13115. * @returns {Object} Returns `object`.
  13116. * @see _.defaults
  13117. * @example
  13118. *
  13119. * _.defaultsDeep({ 'a': { 'b': 2 } }, { 'a': { 'b': 1, 'c': 3 } });
  13120. * // => { 'a': { 'b': 2, 'c': 3 } }
  13121. */
  13122. var defaultsDeep = baseRest(function(args) {
  13123. args.push(undefined, customDefaultsMerge);
  13124. return apply(mergeWith, undefined, args);
  13125. });
  13126. /**
  13127. * This method is like `_.find` except that it returns the key of the first
  13128. * element `predicate` returns truthy for instead of the element itself.
  13129. *
  13130. * @static
  13131. * @memberOf _
  13132. * @since 1.1.0
  13133. * @category Object
  13134. * @param {Object} object The object to inspect.
  13135. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  13136. * @returns {string|undefined} Returns the key of the matched element,
  13137. * else `undefined`.
  13138. * @example
  13139. *
  13140. * var users = {
  13141. * 'barney': { 'age': 36, 'active': true },
  13142. * 'fred': { 'age': 40, 'active': false },
  13143. * 'pebbles': { 'age': 1, 'active': true }
  13144. * };
  13145. *
  13146. * _.findKey(users, function(o) { return o.age < 40; });
  13147. * // => 'barney' (iteration order is not guaranteed)
  13148. *
  13149. * // The `_.matches` iteratee shorthand.
  13150. * _.findKey(users, { 'age': 1, 'active': true });
  13151. * // => 'pebbles'
  13152. *
  13153. * // The `_.matchesProperty` iteratee shorthand.
  13154. * _.findKey(users, ['active', false]);
  13155. * // => 'fred'
  13156. *
  13157. * // The `_.property` iteratee shorthand.
  13158. * _.findKey(users, 'active');
  13159. * // => 'barney'
  13160. */
  13161. function findKey(object, predicate) {
  13162. return baseFindKey(object, getIteratee(predicate, 3), baseForOwn);
  13163. }
  13164. /**
  13165. * This method is like `_.findKey` except that it iterates over elements of
  13166. * a collection in the opposite order.
  13167. *
  13168. * @static
  13169. * @memberOf _
  13170. * @since 2.0.0
  13171. * @category Object
  13172. * @param {Object} object The object to inspect.
  13173. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  13174. * @returns {string|undefined} Returns the key of the matched element,
  13175. * else `undefined`.
  13176. * @example
  13177. *
  13178. * var users = {
  13179. * 'barney': { 'age': 36, 'active': true },
  13180. * 'fred': { 'age': 40, 'active': false },
  13181. * 'pebbles': { 'age': 1, 'active': true }
  13182. * };
  13183. *
  13184. * _.findLastKey(users, function(o) { return o.age < 40; });
  13185. * // => returns 'pebbles' assuming `_.findKey` returns 'barney'
  13186. *
  13187. * // The `_.matches` iteratee shorthand.
  13188. * _.findLastKey(users, { 'age': 36, 'active': true });
  13189. * // => 'barney'
  13190. *
  13191. * // The `_.matchesProperty` iteratee shorthand.
  13192. * _.findLastKey(users, ['active', false]);
  13193. * // => 'fred'
  13194. *
  13195. * // The `_.property` iteratee shorthand.
  13196. * _.findLastKey(users, 'active');
  13197. * // => 'pebbles'
  13198. */
  13199. function findLastKey(object, predicate) {
  13200. return baseFindKey(object, getIteratee(predicate, 3), baseForOwnRight);
  13201. }
  13202. /**
  13203. * Iterates over own and inherited enumerable string keyed properties of an
  13204. * object and invokes `iteratee` for each property. The iteratee is invoked
  13205. * with three arguments: (value, key, object). Iteratee functions may exit
  13206. * iteration early by explicitly returning `false`.
  13207. *
  13208. * @static
  13209. * @memberOf _
  13210. * @since 0.3.0
  13211. * @category Object
  13212. * @param {Object} object The object to iterate over.
  13213. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  13214. * @returns {Object} Returns `object`.
  13215. * @see _.forInRight
  13216. * @example
  13217. *
  13218. * function Foo() {
  13219. * this.a = 1;
  13220. * this.b = 2;
  13221. * }
  13222. *
  13223. * Foo.prototype.c = 3;
  13224. *
  13225. * _.forIn(new Foo, function(value, key) {
  13226. * console.log(key);
  13227. * });
  13228. * // => Logs 'a', 'b', then 'c' (iteration order is not guaranteed).
  13229. */
  13230. function forIn(object, iteratee) {
  13231. return object == null
  13232. ? object
  13233. : baseFor(object, getIteratee(iteratee, 3), keysIn);
  13234. }
  13235. /**
  13236. * This method is like `_.forIn` except that it iterates over properties of
  13237. * `object` in the opposite order.
  13238. *
  13239. * @static
  13240. * @memberOf _
  13241. * @since 2.0.0
  13242. * @category Object
  13243. * @param {Object} object The object to iterate over.
  13244. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  13245. * @returns {Object} Returns `object`.
  13246. * @see _.forIn
  13247. * @example
  13248. *
  13249. * function Foo() {
  13250. * this.a = 1;
  13251. * this.b = 2;
  13252. * }
  13253. *
  13254. * Foo.prototype.c = 3;
  13255. *
  13256. * _.forInRight(new Foo, function(value, key) {
  13257. * console.log(key);
  13258. * });
  13259. * // => Logs 'c', 'b', then 'a' assuming `_.forIn` logs 'a', 'b', then 'c'.
  13260. */
  13261. function forInRight(object, iteratee) {
  13262. return object == null
  13263. ? object
  13264. : baseForRight(object, getIteratee(iteratee, 3), keysIn);
  13265. }
  13266. /**
  13267. * Iterates over own enumerable string keyed properties of an object and
  13268. * invokes `iteratee` for each property. The iteratee is invoked with three
  13269. * arguments: (value, key, object). Iteratee functions may exit iteration
  13270. * early by explicitly returning `false`.
  13271. *
  13272. * @static
  13273. * @memberOf _
  13274. * @since 0.3.0
  13275. * @category Object
  13276. * @param {Object} object The object to iterate over.
  13277. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  13278. * @returns {Object} Returns `object`.
  13279. * @see _.forOwnRight
  13280. * @example
  13281. *
  13282. * function Foo() {
  13283. * this.a = 1;
  13284. * this.b = 2;
  13285. * }
  13286. *
  13287. * Foo.prototype.c = 3;
  13288. *
  13289. * _.forOwn(new Foo, function(value, key) {
  13290. * console.log(key);
  13291. * });
  13292. * // => Logs 'a' then 'b' (iteration order is not guaranteed).
  13293. */
  13294. function forOwn(object, iteratee) {
  13295. return object && baseForOwn(object, getIteratee(iteratee, 3));
  13296. }
  13297. /**
  13298. * This method is like `_.forOwn` except that it iterates over properties of
  13299. * `object` in the opposite order.
  13300. *
  13301. * @static
  13302. * @memberOf _
  13303. * @since 2.0.0
  13304. * @category Object
  13305. * @param {Object} object The object to iterate over.
  13306. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  13307. * @returns {Object} Returns `object`.
  13308. * @see _.forOwn
  13309. * @example
  13310. *
  13311. * function Foo() {
  13312. * this.a = 1;
  13313. * this.b = 2;
  13314. * }
  13315. *
  13316. * Foo.prototype.c = 3;
  13317. *
  13318. * _.forOwnRight(new Foo, function(value, key) {
  13319. * console.log(key);
  13320. * });
  13321. * // => Logs 'b' then 'a' assuming `_.forOwn` logs 'a' then 'b'.
  13322. */
  13323. function forOwnRight(object, iteratee) {
  13324. return object && baseForOwnRight(object, getIteratee(iteratee, 3));
  13325. }
  13326. /**
  13327. * Creates an array of function property names from own enumerable properties
  13328. * of `object`.
  13329. *
  13330. * @static
  13331. * @since 0.1.0
  13332. * @memberOf _
  13333. * @category Object
  13334. * @param {Object} object The object to inspect.
  13335. * @returns {Array} Returns the function names.
  13336. * @see _.functionsIn
  13337. * @example
  13338. *
  13339. * function Foo() {
  13340. * this.a = _.constant('a');
  13341. * this.b = _.constant('b');
  13342. * }
  13343. *
  13344. * Foo.prototype.c = _.constant('c');
  13345. *
  13346. * _.functions(new Foo);
  13347. * // => ['a', 'b']
  13348. */
  13349. function functions(object) {
  13350. return object == null ? [] : baseFunctions(object, keys(object));
  13351. }
  13352. /**
  13353. * Creates an array of function property names from own and inherited
  13354. * enumerable properties of `object`.
  13355. *
  13356. * @static
  13357. * @memberOf _
  13358. * @since 4.0.0
  13359. * @category Object
  13360. * @param {Object} object The object to inspect.
  13361. * @returns {Array} Returns the function names.
  13362. * @see _.functions
  13363. * @example
  13364. *
  13365. * function Foo() {
  13366. * this.a = _.constant('a');
  13367. * this.b = _.constant('b');
  13368. * }
  13369. *
  13370. * Foo.prototype.c = _.constant('c');
  13371. *
  13372. * _.functionsIn(new Foo);
  13373. * // => ['a', 'b', 'c']
  13374. */
  13375. function functionsIn(object) {
  13376. return object == null ? [] : baseFunctions(object, keysIn(object));
  13377. }
  13378. /**
  13379. * Gets the value at `path` of `object`. If the resolved value is
  13380. * `undefined`, the `defaultValue` is returned in its place.
  13381. *
  13382. * @static
  13383. * @memberOf _
  13384. * @since 3.7.0
  13385. * @category Object
  13386. * @param {Object} object The object to query.
  13387. * @param {Array|string} path The path of the property to get.
  13388. * @param {*} [defaultValue] The value returned for `undefined` resolved values.
  13389. * @returns {*} Returns the resolved value.
  13390. * @example
  13391. *
  13392. * var object = { 'a': [{ 'b': { 'c': 3 } }] };
  13393. *
  13394. * _.get(object, 'a[0].b.c');
  13395. * // => 3
  13396. *
  13397. * _.get(object, ['a', '0', 'b', 'c']);
  13398. * // => 3
  13399. *
  13400. * _.get(object, 'a.b.c', 'default');
  13401. * // => 'default'
  13402. */
  13403. function get(object, path, defaultValue) {
  13404. var result = object == null ? undefined : baseGet(object, path);
  13405. return result === undefined ? defaultValue : result;
  13406. }
  13407. /**
  13408. * Checks if `path` is a direct property of `object`.
  13409. *
  13410. * @static
  13411. * @since 0.1.0
  13412. * @memberOf _
  13413. * @category Object
  13414. * @param {Object} object The object to query.
  13415. * @param {Array|string} path The path to check.
  13416. * @returns {boolean} Returns `true` if `path` exists, else `false`.
  13417. * @example
  13418. *
  13419. * var object = { 'a': { 'b': 2 } };
  13420. * var other = _.create({ 'a': _.create({ 'b': 2 }) });
  13421. *
  13422. * _.has(object, 'a');
  13423. * // => true
  13424. *
  13425. * _.has(object, 'a.b');
  13426. * // => true
  13427. *
  13428. * _.has(object, ['a', 'b']);
  13429. * // => true
  13430. *
  13431. * _.has(other, 'a');
  13432. * // => false
  13433. */
  13434. function has(object, path) {
  13435. return object != null && hasPath(object, path, baseHas);
  13436. }
  13437. /**
  13438. * Checks if `path` is a direct or inherited property of `object`.
  13439. *
  13440. * @static
  13441. * @memberOf _
  13442. * @since 4.0.0
  13443. * @category Object
  13444. * @param {Object} object The object to query.
  13445. * @param {Array|string} path The path to check.
  13446. * @returns {boolean} Returns `true` if `path` exists, else `false`.
  13447. * @example
  13448. *
  13449. * var object = _.create({ 'a': _.create({ 'b': 2 }) });
  13450. *
  13451. * _.hasIn(object, 'a');
  13452. * // => true
  13453. *
  13454. * _.hasIn(object, 'a.b');
  13455. * // => true
  13456. *
  13457. * _.hasIn(object, ['a', 'b']);
  13458. * // => true
  13459. *
  13460. * _.hasIn(object, 'b');
  13461. * // => false
  13462. */
  13463. function hasIn(object, path) {
  13464. return object != null && hasPath(object, path, baseHasIn);
  13465. }
  13466. /**
  13467. * Creates an object composed of the inverted keys and values of `object`.
  13468. * If `object` contains duplicate values, subsequent values overwrite
  13469. * property assignments of previous values.
  13470. *
  13471. * @static
  13472. * @memberOf _
  13473. * @since 0.7.0
  13474. * @category Object
  13475. * @param {Object} object The object to invert.
  13476. * @returns {Object} Returns the new inverted object.
  13477. * @example
  13478. *
  13479. * var object = { 'a': 1, 'b': 2, 'c': 1 };
  13480. *
  13481. * _.invert(object);
  13482. * // => { '1': 'c', '2': 'b' }
  13483. */
  13484. var invert = createInverter(function(result, value, key) {
  13485. if (value != null &&
  13486. typeof value.toString != 'function') {
  13487. value = nativeObjectToString.call(value);
  13488. }
  13489. result[value] = key;
  13490. }, constant(identity));
  13491. /**
  13492. * This method is like `_.invert` except that the inverted object is generated
  13493. * from the results of running each element of `object` thru `iteratee`. The
  13494. * corresponding inverted value of each inverted key is an array of keys
  13495. * responsible for generating the inverted value. The iteratee is invoked
  13496. * with one argument: (value).
  13497. *
  13498. * @static
  13499. * @memberOf _
  13500. * @since 4.1.0
  13501. * @category Object
  13502. * @param {Object} object The object to invert.
  13503. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  13504. * @returns {Object} Returns the new inverted object.
  13505. * @example
  13506. *
  13507. * var object = { 'a': 1, 'b': 2, 'c': 1 };
  13508. *
  13509. * _.invertBy(object);
  13510. * // => { '1': ['a', 'c'], '2': ['b'] }
  13511. *
  13512. * _.invertBy(object, function(value) {
  13513. * return 'group' + value;
  13514. * });
  13515. * // => { 'group1': ['a', 'c'], 'group2': ['b'] }
  13516. */
  13517. var invertBy = createInverter(function(result, value, key) {
  13518. if (value != null &&
  13519. typeof value.toString != 'function') {
  13520. value = nativeObjectToString.call(value);
  13521. }
  13522. if (hasOwnProperty.call(result, value)) {
  13523. result[value].push(key);
  13524. } else {
  13525. result[value] = [key];
  13526. }
  13527. }, getIteratee);
  13528. /**
  13529. * Invokes the method at `path` of `object`.
  13530. *
  13531. * @static
  13532. * @memberOf _
  13533. * @since 4.0.0
  13534. * @category Object
  13535. * @param {Object} object The object to query.
  13536. * @param {Array|string} path The path of the method to invoke.
  13537. * @param {...*} [args] The arguments to invoke the method with.
  13538. * @returns {*} Returns the result of the invoked method.
  13539. * @example
  13540. *
  13541. * var object = { 'a': [{ 'b': { 'c': [1, 2, 3, 4] } }] };
  13542. *
  13543. * _.invoke(object, 'a[0].b.c.slice', 1, 3);
  13544. * // => [2, 3]
  13545. */
  13546. var invoke = baseRest(baseInvoke);
  13547. /**
  13548. * Creates an array of the own enumerable property names of `object`.
  13549. *
  13550. * **Note:** Non-object values are coerced to objects. See the
  13551. * [ES spec](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)
  13552. * for more details.
  13553. *
  13554. * @static
  13555. * @since 0.1.0
  13556. * @memberOf _
  13557. * @category Object
  13558. * @param {Object} object The object to query.
  13559. * @returns {Array} Returns the array of property names.
  13560. * @example
  13561. *
  13562. * function Foo() {
  13563. * this.a = 1;
  13564. * this.b = 2;
  13565. * }
  13566. *
  13567. * Foo.prototype.c = 3;
  13568. *
  13569. * _.keys(new Foo);
  13570. * // => ['a', 'b'] (iteration order is not guaranteed)
  13571. *
  13572. * _.keys('hi');
  13573. * // => ['0', '1']
  13574. */
  13575. function keys(object) {
  13576. return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object);
  13577. }
  13578. /**
  13579. * Creates an array of the own and inherited enumerable property names of `object`.
  13580. *
  13581. * **Note:** Non-object values are coerced to objects.
  13582. *
  13583. * @static
  13584. * @memberOf _
  13585. * @since 3.0.0
  13586. * @category Object
  13587. * @param {Object} object The object to query.
  13588. * @returns {Array} Returns the array of property names.
  13589. * @example
  13590. *
  13591. * function Foo() {
  13592. * this.a = 1;
  13593. * this.b = 2;
  13594. * }
  13595. *
  13596. * Foo.prototype.c = 3;
  13597. *
  13598. * _.keysIn(new Foo);
  13599. * // => ['a', 'b', 'c'] (iteration order is not guaranteed)
  13600. */
  13601. function keysIn(object) {
  13602. return isArrayLike(object) ? arrayLikeKeys(object, true) : baseKeysIn(object);
  13603. }
  13604. /**
  13605. * The opposite of `_.mapValues`; this method creates an object with the
  13606. * same values as `object` and keys generated by running each own enumerable
  13607. * string keyed property of `object` thru `iteratee`. The iteratee is invoked
  13608. * with three arguments: (value, key, object).
  13609. *
  13610. * @static
  13611. * @memberOf _
  13612. * @since 3.8.0
  13613. * @category Object
  13614. * @param {Object} object The object to iterate over.
  13615. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  13616. * @returns {Object} Returns the new mapped object.
  13617. * @see _.mapValues
  13618. * @example
  13619. *
  13620. * _.mapKeys({ 'a': 1, 'b': 2 }, function(value, key) {
  13621. * return key + value;
  13622. * });
  13623. * // => { 'a1': 1, 'b2': 2 }
  13624. */
  13625. function mapKeys(object, iteratee) {
  13626. var result = {};
  13627. iteratee = getIteratee(iteratee, 3);
  13628. baseForOwn(object, function(value, key, object) {
  13629. baseAssignValue(result, iteratee(value, key, object), value);
  13630. });
  13631. return result;
  13632. }
  13633. /**
  13634. * Creates an object with the same keys as `object` and values generated
  13635. * by running each own enumerable string keyed property of `object` thru
  13636. * `iteratee`. The iteratee is invoked with three arguments:
  13637. * (value, key, object).
  13638. *
  13639. * @static
  13640. * @memberOf _
  13641. * @since 2.4.0
  13642. * @category Object
  13643. * @param {Object} object The object to iterate over.
  13644. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  13645. * @returns {Object} Returns the new mapped object.
  13646. * @see _.mapKeys
  13647. * @example
  13648. *
  13649. * var users = {
  13650. * 'fred': { 'user': 'fred', 'age': 40 },
  13651. * 'pebbles': { 'user': 'pebbles', 'age': 1 }
  13652. * };
  13653. *
  13654. * _.mapValues(users, function(o) { return o.age; });
  13655. * // => { 'fred': 40, 'pebbles': 1 } (iteration order is not guaranteed)
  13656. *
  13657. * // The `_.property` iteratee shorthand.
  13658. * _.mapValues(users, 'age');
  13659. * // => { 'fred': 40, 'pebbles': 1 } (iteration order is not guaranteed)
  13660. */
  13661. function mapValues(object, iteratee) {
  13662. var result = {};
  13663. iteratee = getIteratee(iteratee, 3);
  13664. baseForOwn(object, function(value, key, object) {
  13665. baseAssignValue(result, key, iteratee(value, key, object));
  13666. });
  13667. return result;
  13668. }
  13669. /**
  13670. * This method is like `_.assign` except that it recursively merges own and
  13671. * inherited enumerable string keyed properties of source objects into the
  13672. * destination object. Source properties that resolve to `undefined` are
  13673. * skipped if a destination value exists. Array and plain object properties
  13674. * are merged recursively. Other objects and value types are overridden by
  13675. * assignment. Source objects are applied from left to right. Subsequent
  13676. * sources overwrite property assignments of previous sources.
  13677. *
  13678. * **Note:** This method mutates `object`.
  13679. *
  13680. * @static
  13681. * @memberOf _
  13682. * @since 0.5.0
  13683. * @category Object
  13684. * @param {Object} object The destination object.
  13685. * @param {...Object} [sources] The source objects.
  13686. * @returns {Object} Returns `object`.
  13687. * @example
  13688. *
  13689. * var object = {
  13690. * 'a': [{ 'b': 2 }, { 'd': 4 }]
  13691. * };
  13692. *
  13693. * var other = {
  13694. * 'a': [{ 'c': 3 }, { 'e': 5 }]
  13695. * };
  13696. *
  13697. * _.merge(object, other);
  13698. * // => { 'a': [{ 'b': 2, 'c': 3 }, { 'd': 4, 'e': 5 }] }
  13699. */
  13700. var merge = createAssigner(function(object, source, srcIndex) {
  13701. baseMerge(object, source, srcIndex);
  13702. });
  13703. /**
  13704. * This method is like `_.merge` except that it accepts `customizer` which
  13705. * is invoked to produce the merged values of the destination and source
  13706. * properties. If `customizer` returns `undefined`, merging is handled by the
  13707. * method instead. The `customizer` is invoked with six arguments:
  13708. * (objValue, srcValue, key, object, source, stack).
  13709. *
  13710. * **Note:** This method mutates `object`.
  13711. *
  13712. * @static
  13713. * @memberOf _
  13714. * @since 4.0.0
  13715. * @category Object
  13716. * @param {Object} object The destination object.
  13717. * @param {...Object} sources The source objects.
  13718. * @param {Function} customizer The function to customize assigned values.
  13719. * @returns {Object} Returns `object`.
  13720. * @example
  13721. *
  13722. * function customizer(objValue, srcValue) {
  13723. * if (_.isArray(objValue)) {
  13724. * return objValue.concat(srcValue);
  13725. * }
  13726. * }
  13727. *
  13728. * var object = { 'a': [1], 'b': [2] };
  13729. * var other = { 'a': [3], 'b': [4] };
  13730. *
  13731. * _.mergeWith(object, other, customizer);
  13732. * // => { 'a': [1, 3], 'b': [2, 4] }
  13733. */
  13734. var mergeWith = createAssigner(function(object, source, srcIndex, customizer) {
  13735. baseMerge(object, source, srcIndex, customizer);
  13736. });
  13737. /**
  13738. * The opposite of `_.pick`; this method creates an object composed of the
  13739. * own and inherited enumerable property paths of `object` that are not omitted.
  13740. *
  13741. * **Note:** This method is considerably slower than `_.pick`.
  13742. *
  13743. * @static
  13744. * @since 0.1.0
  13745. * @memberOf _
  13746. * @category Object
  13747. * @param {Object} object The source object.
  13748. * @param {...(string|string[])} [paths] The property paths to omit.
  13749. * @returns {Object} Returns the new object.
  13750. * @example
  13751. *
  13752. * var object = { 'a': 1, 'b': '2', 'c': 3 };
  13753. *
  13754. * _.omit(object, ['a', 'c']);
  13755. * // => { 'b': '2' }
  13756. */
  13757. var omit = flatRest(function(object, paths) {
  13758. var result = {};
  13759. if (object == null) {
  13760. return result;
  13761. }
  13762. var isDeep = false;
  13763. paths = arrayMap(paths, function(path) {
  13764. path = castPath(path, object);
  13765. isDeep || (isDeep = path.length > 1);
  13766. return path;
  13767. });
  13768. copyObject(object, getAllKeysIn(object), result);
  13769. if (isDeep) {
  13770. result = baseClone(result, CLONE_DEEP_FLAG | CLONE_FLAT_FLAG | CLONE_SYMBOLS_FLAG, customOmitClone);
  13771. }
  13772. var length = paths.length;
  13773. while (length--) {
  13774. baseUnset(result, paths[length]);
  13775. }
  13776. return result;
  13777. });
  13778. /**
  13779. * The opposite of `_.pickBy`; this method creates an object composed of
  13780. * the own and inherited enumerable string keyed properties of `object` that
  13781. * `predicate` doesn't return truthy for. The predicate is invoked with two
  13782. * arguments: (value, key).
  13783. *
  13784. * @static
  13785. * @memberOf _
  13786. * @since 4.0.0
  13787. * @category Object
  13788. * @param {Object} object The source object.
  13789. * @param {Function} [predicate=_.identity] The function invoked per property.
  13790. * @returns {Object} Returns the new object.
  13791. * @example
  13792. *
  13793. * var object = { 'a': 1, 'b': '2', 'c': 3 };
  13794. *
  13795. * _.omitBy(object, _.isNumber);
  13796. * // => { 'b': '2' }
  13797. */
  13798. function omitBy(object, predicate) {
  13799. return pickBy(object, negate(getIteratee(predicate)));
  13800. }
  13801. /**
  13802. * Creates an object composed of the picked `object` properties.
  13803. *
  13804. * @static
  13805. * @since 0.1.0
  13806. * @memberOf _
  13807. * @category Object
  13808. * @param {Object} object The source object.
  13809. * @param {...(string|string[])} [paths] The property paths to pick.
  13810. * @returns {Object} Returns the new object.
  13811. * @example
  13812. *
  13813. * var object = { 'a': 1, 'b': '2', 'c': 3 };
  13814. *
  13815. * _.pick(object, ['a', 'c']);
  13816. * // => { 'a': 1, 'c': 3 }
  13817. */
  13818. var pick = flatRest(function(object, paths) {
  13819. return object == null ? {} : basePick(object, paths);
  13820. });
  13821. /**
  13822. * Creates an object composed of the `object` properties `predicate` returns
  13823. * truthy for. The predicate is invoked with two arguments: (value, key).
  13824. *
  13825. * @static
  13826. * @memberOf _
  13827. * @since 4.0.0
  13828. * @category Object
  13829. * @param {Object} object The source object.
  13830. * @param {Function} [predicate=_.identity] The function invoked per property.
  13831. * @returns {Object} Returns the new object.
  13832. * @example
  13833. *
  13834. * var object = { 'a': 1, 'b': '2', 'c': 3 };
  13835. *
  13836. * _.pickBy(object, _.isNumber);
  13837. * // => { 'a': 1, 'c': 3 }
  13838. */
  13839. function pickBy(object, predicate) {
  13840. if (object == null) {
  13841. return {};
  13842. }
  13843. var props = arrayMap(getAllKeysIn(object), function(prop) {
  13844. return [prop];
  13845. });
  13846. predicate = getIteratee(predicate);
  13847. return basePickBy(object, props, function(value, path) {
  13848. return predicate(value, path[0]);
  13849. });
  13850. }
  13851. /**
  13852. * This method is like `_.get` except that if the resolved value is a
  13853. * function it's invoked with the `this` binding of its parent object and
  13854. * its result is returned.
  13855. *
  13856. * @static
  13857. * @since 0.1.0
  13858. * @memberOf _
  13859. * @category Object
  13860. * @param {Object} object The object to query.
  13861. * @param {Array|string} path The path of the property to resolve.
  13862. * @param {*} [defaultValue] The value returned for `undefined` resolved values.
  13863. * @returns {*} Returns the resolved value.
  13864. * @example
  13865. *
  13866. * var object = { 'a': [{ 'b': { 'c1': 3, 'c2': _.constant(4) } }] };
  13867. *
  13868. * _.result(object, 'a[0].b.c1');
  13869. * // => 3
  13870. *
  13871. * _.result(object, 'a[0].b.c2');
  13872. * // => 4
  13873. *
  13874. * _.result(object, 'a[0].b.c3', 'default');
  13875. * // => 'default'
  13876. *
  13877. * _.result(object, 'a[0].b.c3', _.constant('default'));
  13878. * // => 'default'
  13879. */
  13880. function result(object, path, defaultValue) {
  13881. path = castPath(path, object);
  13882. var index = -1,
  13883. length = path.length;
  13884. // Ensure the loop is entered when path is empty.
  13885. if (!length) {
  13886. length = 1;
  13887. object = undefined;
  13888. }
  13889. while (++index < length) {
  13890. var value = object == null ? undefined : object[toKey(path[index])];
  13891. if (value === undefined) {
  13892. index = length;
  13893. value = defaultValue;
  13894. }
  13895. object = isFunction(value) ? value.call(object) : value;
  13896. }
  13897. return object;
  13898. }
  13899. /**
  13900. * Sets the value at `path` of `object`. If a portion of `path` doesn't exist,
  13901. * it's created. Arrays are created for missing index properties while objects
  13902. * are created for all other missing properties. Use `_.setWith` to customize
  13903. * `path` creation.
  13904. *
  13905. * **Note:** This method mutates `object`.
  13906. *
  13907. * @static
  13908. * @memberOf _
  13909. * @since 3.7.0
  13910. * @category Object
  13911. * @param {Object} object The object to modify.
  13912. * @param {Array|string} path The path of the property to set.
  13913. * @param {*} value The value to set.
  13914. * @returns {Object} Returns `object`.
  13915. * @example
  13916. *
  13917. * var object = { 'a': [{ 'b': { 'c': 3 } }] };
  13918. *
  13919. * _.set(object, 'a[0].b.c', 4);
  13920. * console.log(object.a[0].b.c);
  13921. * // => 4
  13922. *
  13923. * _.set(object, ['x', '0', 'y', 'z'], 5);
  13924. * console.log(object.x[0].y.z);
  13925. * // => 5
  13926. */
  13927. function set(object, path, value) {
  13928. return object == null ? object : baseSet(object, path, value);
  13929. }
  13930. /**
  13931. * This method is like `_.set` except that it accepts `customizer` which is
  13932. * invoked to produce the objects of `path`. If `customizer` returns `undefined`
  13933. * path creation is handled by the method instead. The `customizer` is invoked
  13934. * with three arguments: (nsValue, key, nsObject).
  13935. *
  13936. * **Note:** This method mutates `object`.
  13937. *
  13938. * @static
  13939. * @memberOf _
  13940. * @since 4.0.0
  13941. * @category Object
  13942. * @param {Object} object The object to modify.
  13943. * @param {Array|string} path The path of the property to set.
  13944. * @param {*} value The value to set.
  13945. * @param {Function} [customizer] The function to customize assigned values.
  13946. * @returns {Object} Returns `object`.
  13947. * @example
  13948. *
  13949. * var object = {};
  13950. *
  13951. * _.setWith(object, '[0][1]', 'a', Object);
  13952. * // => { '0': { '1': 'a' } }
  13953. */
  13954. function setWith(object, path, value, customizer) {
  13955. customizer = typeof customizer == 'function' ? customizer : undefined;
  13956. return object == null ? object : baseSet(object, path, value, customizer);
  13957. }
  13958. /**
  13959. * Creates an array of own enumerable string keyed-value pairs for `object`
  13960. * which can be consumed by `_.fromPairs`. If `object` is a map or set, its
  13961. * entries are returned.
  13962. *
  13963. * @static
  13964. * @memberOf _
  13965. * @since 4.0.0
  13966. * @alias entries
  13967. * @category Object
  13968. * @param {Object} object The object to query.
  13969. * @returns {Array} Returns the key-value pairs.
  13970. * @example
  13971. *
  13972. * function Foo() {
  13973. * this.a = 1;
  13974. * this.b = 2;
  13975. * }
  13976. *
  13977. * Foo.prototype.c = 3;
  13978. *
  13979. * _.toPairs(new Foo);
  13980. * // => [['a', 1], ['b', 2]] (iteration order is not guaranteed)
  13981. */
  13982. var toPairs = createToPairs(keys);
  13983. /**
  13984. * Creates an array of own and inherited enumerable string keyed-value pairs
  13985. * for `object` which can be consumed by `_.fromPairs`. If `object` is a map
  13986. * or set, its entries are returned.
  13987. *
  13988. * @static
  13989. * @memberOf _
  13990. * @since 4.0.0
  13991. * @alias entriesIn
  13992. * @category Object
  13993. * @param {Object} object The object to query.
  13994. * @returns {Array} Returns the key-value pairs.
  13995. * @example
  13996. *
  13997. * function Foo() {
  13998. * this.a = 1;
  13999. * this.b = 2;
  14000. * }
  14001. *
  14002. * Foo.prototype.c = 3;
  14003. *
  14004. * _.toPairsIn(new Foo);
  14005. * // => [['a', 1], ['b', 2], ['c', 3]] (iteration order is not guaranteed)
  14006. */
  14007. var toPairsIn = createToPairs(keysIn);
  14008. /**
  14009. * An alternative to `_.reduce`; this method transforms `object` to a new
  14010. * `accumulator` object which is the result of running each of its own
  14011. * enumerable string keyed properties thru `iteratee`, with each invocation
  14012. * potentially mutating the `accumulator` object. If `accumulator` is not
  14013. * provided, a new object with the same `[[Prototype]]` will be used. The
  14014. * iteratee is invoked with four arguments: (accumulator, value, key, object).
  14015. * Iteratee functions may exit iteration early by explicitly returning `false`.
  14016. *
  14017. * @static
  14018. * @memberOf _
  14019. * @since 1.3.0
  14020. * @category Object
  14021. * @param {Object} object The object to iterate over.
  14022. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  14023. * @param {*} [accumulator] The custom accumulator value.
  14024. * @returns {*} Returns the accumulated value.
  14025. * @example
  14026. *
  14027. * _.transform([2, 3, 4], function(result, n) {
  14028. * result.push(n *= n);
  14029. * return n % 2 == 0;
  14030. * }, []);
  14031. * // => [4, 9]
  14032. *
  14033. * _.transform({ 'a': 1, 'b': 2, 'c': 1 }, function(result, value, key) {
  14034. * (result[value] || (result[value] = [])).push(key);
  14035. * }, {});
  14036. * // => { '1': ['a', 'c'], '2': ['b'] }
  14037. */
  14038. function transform(object, iteratee, accumulator) {
  14039. var isArr = isArray(object),
  14040. isArrLike = isArr || isBuffer(object) || isTypedArray(object);
  14041. iteratee = getIteratee(iteratee, 4);
  14042. if (accumulator == null) {
  14043. var Ctor = object && object.constructor;
  14044. if (isArrLike) {
  14045. accumulator = isArr ? new Ctor : [];
  14046. }
  14047. else if (isObject(object)) {
  14048. accumulator = isFunction(Ctor) ? baseCreate(getPrototype(object)) : {};
  14049. }
  14050. else {
  14051. accumulator = {};
  14052. }
  14053. }
  14054. (isArrLike ? arrayEach : baseForOwn)(object, function(value, index, object) {
  14055. return iteratee(accumulator, value, index, object);
  14056. });
  14057. return accumulator;
  14058. }
  14059. /**
  14060. * Removes the property at `path` of `object`.
  14061. *
  14062. * **Note:** This method mutates `object`.
  14063. *
  14064. * @static
  14065. * @memberOf _
  14066. * @since 4.0.0
  14067. * @category Object
  14068. * @param {Object} object The object to modify.
  14069. * @param {Array|string} path The path of the property to unset.
  14070. * @returns {boolean} Returns `true` if the property is deleted, else `false`.
  14071. * @example
  14072. *
  14073. * var object = { 'a': [{ 'b': { 'c': 7 } }] };
  14074. * _.unset(object, 'a[0].b.c');
  14075. * // => true
  14076. *
  14077. * console.log(object);
  14078. * // => { 'a': [{ 'b': {} }] };
  14079. *
  14080. * _.unset(object, ['a', '0', 'b', 'c']);
  14081. * // => true
  14082. *
  14083. * console.log(object);
  14084. * // => { 'a': [{ 'b': {} }] };
  14085. */
  14086. function unset(object, path) {
  14087. return object == null ? true : baseUnset(object, path);
  14088. }
  14089. /**
  14090. * This method is like `_.set` except that accepts `updater` to produce the
  14091. * value to set. Use `_.updateWith` to customize `path` creation. The `updater`
  14092. * is invoked with one argument: (value).
  14093. *
  14094. * **Note:** This method mutates `object`.
  14095. *
  14096. * @static
  14097. * @memberOf _
  14098. * @since 4.6.0
  14099. * @category Object
  14100. * @param {Object} object The object to modify.
  14101. * @param {Array|string} path The path of the property to set.
  14102. * @param {Function} updater The function to produce the updated value.
  14103. * @returns {Object} Returns `object`.
  14104. * @example
  14105. *
  14106. * var object = { 'a': [{ 'b': { 'c': 3 } }] };
  14107. *
  14108. * _.update(object, 'a[0].b.c', function(n) { return n * n; });
  14109. * console.log(object.a[0].b.c);
  14110. * // => 9
  14111. *
  14112. * _.update(object, 'x[0].y.z', function(n) { return n ? n + 1 : 0; });
  14113. * console.log(object.x[0].y.z);
  14114. * // => 0
  14115. */
  14116. function update(object, path, updater) {
  14117. return object == null ? object : baseUpdate(object, path, castFunction(updater));
  14118. }
  14119. /**
  14120. * This method is like `_.update` except that it accepts `customizer` which is
  14121. * invoked to produce the objects of `path`. If `customizer` returns `undefined`
  14122. * path creation is handled by the method instead. The `customizer` is invoked
  14123. * with three arguments: (nsValue, key, nsObject).
  14124. *
  14125. * **Note:** This method mutates `object`.
  14126. *
  14127. * @static
  14128. * @memberOf _
  14129. * @since 4.6.0
  14130. * @category Object
  14131. * @param {Object} object The object to modify.
  14132. * @param {Array|string} path The path of the property to set.
  14133. * @param {Function} updater The function to produce the updated value.
  14134. * @param {Function} [customizer] The function to customize assigned values.
  14135. * @returns {Object} Returns `object`.
  14136. * @example
  14137. *
  14138. * var object = {};
  14139. *
  14140. * _.updateWith(object, '[0][1]', _.constant('a'), Object);
  14141. * // => { '0': { '1': 'a' } }
  14142. */
  14143. function updateWith(object, path, updater, customizer) {
  14144. customizer = typeof customizer == 'function' ? customizer : undefined;
  14145. return object == null ? object : baseUpdate(object, path, castFunction(updater), customizer);
  14146. }
  14147. /**
  14148. * Creates an array of the own enumerable string keyed property values of `object`.
  14149. *
  14150. * **Note:** Non-object values are coerced to objects.
  14151. *
  14152. * @static
  14153. * @since 0.1.0
  14154. * @memberOf _
  14155. * @category Object
  14156. * @param {Object} object The object to query.
  14157. * @returns {Array} Returns the array of property values.
  14158. * @example
  14159. *
  14160. * function Foo() {
  14161. * this.a = 1;
  14162. * this.b = 2;
  14163. * }
  14164. *
  14165. * Foo.prototype.c = 3;
  14166. *
  14167. * _.values(new Foo);
  14168. * // => [1, 2] (iteration order is not guaranteed)
  14169. *
  14170. * _.values('hi');
  14171. * // => ['h', 'i']
  14172. */
  14173. function values(object) {
  14174. return object == null ? [] : baseValues(object, keys(object));
  14175. }
  14176. /**
  14177. * Creates an array of the own and inherited enumerable string keyed property
  14178. * values of `object`.
  14179. *
  14180. * **Note:** Non-object values are coerced to objects.
  14181. *
  14182. * @static
  14183. * @memberOf _
  14184. * @since 3.0.0
  14185. * @category Object
  14186. * @param {Object} object The object to query.
  14187. * @returns {Array} Returns the array of property values.
  14188. * @example
  14189. *
  14190. * function Foo() {
  14191. * this.a = 1;
  14192. * this.b = 2;
  14193. * }
  14194. *
  14195. * Foo.prototype.c = 3;
  14196. *
  14197. * _.valuesIn(new Foo);
  14198. * // => [1, 2, 3] (iteration order is not guaranteed)
  14199. */
  14200. function valuesIn(object) {
  14201. return object == null ? [] : baseValues(object, keysIn(object));
  14202. }
  14203. /*------------------------------------------------------------------------*/
  14204. /**
  14205. * Clamps `number` within the inclusive `lower` and `upper` bounds.
  14206. *
  14207. * @static
  14208. * @memberOf _
  14209. * @since 4.0.0
  14210. * @category Number
  14211. * @param {number} number The number to clamp.
  14212. * @param {number} [lower] The lower bound.
  14213. * @param {number} upper The upper bound.
  14214. * @returns {number} Returns the clamped number.
  14215. * @example
  14216. *
  14217. * _.clamp(-10, -5, 5);
  14218. * // => -5
  14219. *
  14220. * _.clamp(10, -5, 5);
  14221. * // => 5
  14222. */
  14223. function clamp(number, lower, upper) {
  14224. if (upper === undefined) {
  14225. upper = lower;
  14226. lower = undefined;
  14227. }
  14228. if (upper !== undefined) {
  14229. upper = toNumber(upper);
  14230. upper = upper === upper ? upper : 0;
  14231. }
  14232. if (lower !== undefined) {
  14233. lower = toNumber(lower);
  14234. lower = lower === lower ? lower : 0;
  14235. }
  14236. return baseClamp(toNumber(number), lower, upper);
  14237. }
  14238. /**
  14239. * Checks if `n` is between `start` and up to, but not including, `end`. If
  14240. * `end` is not specified, it's set to `start` with `start` then set to `0`.
  14241. * If `start` is greater than `end` the params are swapped to support
  14242. * negative ranges.
  14243. *
  14244. * @static
  14245. * @memberOf _
  14246. * @since 3.3.0
  14247. * @category Number
  14248. * @param {number} number The number to check.
  14249. * @param {number} [start=0] The start of the range.
  14250. * @param {number} end The end of the range.
  14251. * @returns {boolean} Returns `true` if `number` is in the range, else `false`.
  14252. * @see _.range, _.rangeRight
  14253. * @example
  14254. *
  14255. * _.inRange(3, 2, 4);
  14256. * // => true
  14257. *
  14258. * _.inRange(4, 8);
  14259. * // => true
  14260. *
  14261. * _.inRange(4, 2);
  14262. * // => false
  14263. *
  14264. * _.inRange(2, 2);
  14265. * // => false
  14266. *
  14267. * _.inRange(1.2, 2);
  14268. * // => true
  14269. *
  14270. * _.inRange(5.2, 4);
  14271. * // => false
  14272. *
  14273. * _.inRange(-3, -2, -6);
  14274. * // => true
  14275. */
  14276. function inRange(number, start, end) {
  14277. start = toFinite(start);
  14278. if (end === undefined) {
  14279. end = start;
  14280. start = 0;
  14281. } else {
  14282. end = toFinite(end);
  14283. }
  14284. number = toNumber(number);
  14285. return baseInRange(number, start, end);
  14286. }
  14287. /**
  14288. * Produces a random number between the inclusive `lower` and `upper` bounds.
  14289. * If only one argument is provided a number between `0` and the given number
  14290. * is returned. If `floating` is `true`, or either `lower` or `upper` are
  14291. * floats, a floating-point number is returned instead of an integer.
  14292. *
  14293. * **Note:** JavaScript follows the IEEE-754 standard for resolving
  14294. * floating-point values which can produce unexpected results.
  14295. *
  14296. * @static
  14297. * @memberOf _
  14298. * @since 0.7.0
  14299. * @category Number
  14300. * @param {number} [lower=0] The lower bound.
  14301. * @param {number} [upper=1] The upper bound.
  14302. * @param {boolean} [floating] Specify returning a floating-point number.
  14303. * @returns {number} Returns the random number.
  14304. * @example
  14305. *
  14306. * _.random(0, 5);
  14307. * // => an integer between 0 and 5
  14308. *
  14309. * _.random(5);
  14310. * // => also an integer between 0 and 5
  14311. *
  14312. * _.random(5, true);
  14313. * // => a floating-point number between 0 and 5
  14314. *
  14315. * _.random(1.2, 5.2);
  14316. * // => a floating-point number between 1.2 and 5.2
  14317. */
  14318. function random(lower, upper, floating) {
  14319. if (floating && typeof floating != 'boolean' && isIterateeCall(lower, upper, floating)) {
  14320. upper = floating = undefined;
  14321. }
  14322. if (floating === undefined) {
  14323. if (typeof upper == 'boolean') {
  14324. floating = upper;
  14325. upper = undefined;
  14326. }
  14327. else if (typeof lower == 'boolean') {
  14328. floating = lower;
  14329. lower = undefined;
  14330. }
  14331. }
  14332. if (lower === undefined && upper === undefined) {
  14333. lower = 0;
  14334. upper = 1;
  14335. }
  14336. else {
  14337. lower = toFinite(lower);
  14338. if (upper === undefined) {
  14339. upper = lower;
  14340. lower = 0;
  14341. } else {
  14342. upper = toFinite(upper);
  14343. }
  14344. }
  14345. if (lower > upper) {
  14346. var temp = lower;
  14347. lower = upper;
  14348. upper = temp;
  14349. }
  14350. if (floating || lower % 1 || upper % 1) {
  14351. var rand = nativeRandom();
  14352. return nativeMin(lower + (rand * (upper - lower + freeParseFloat('1e-' + ((rand + '').length - 1)))), upper);
  14353. }
  14354. return baseRandom(lower, upper);
  14355. }
  14356. /*------------------------------------------------------------------------*/
  14357. /**
  14358. * Converts `string` to [camel case](https://en.wikipedia.org/wiki/CamelCase).
  14359. *
  14360. * @static
  14361. * @memberOf _
  14362. * @since 3.0.0
  14363. * @category String
  14364. * @param {string} [string=''] The string to convert.
  14365. * @returns {string} Returns the camel cased string.
  14366. * @example
  14367. *
  14368. * _.camelCase('Foo Bar');
  14369. * // => 'fooBar'
  14370. *
  14371. * _.camelCase('--foo-bar--');
  14372. * // => 'fooBar'
  14373. *
  14374. * _.camelCase('__FOO_BAR__');
  14375. * // => 'fooBar'
  14376. */
  14377. var camelCase = createCompounder(function(result, word, index) {
  14378. word = word.toLowerCase();
  14379. return result + (index ? capitalize(word) : word);
  14380. });
  14381. /**
  14382. * Converts the first character of `string` to upper case and the remaining
  14383. * to lower case.
  14384. *
  14385. * @static
  14386. * @memberOf _
  14387. * @since 3.0.0
  14388. * @category String
  14389. * @param {string} [string=''] The string to capitalize.
  14390. * @returns {string} Returns the capitalized string.
  14391. * @example
  14392. *
  14393. * _.capitalize('FRED');
  14394. * // => 'Fred'
  14395. */
  14396. function capitalize(string) {
  14397. return upperFirst(toString(string).toLowerCase());
  14398. }
  14399. /**
  14400. * Deburrs `string` by converting
  14401. * [Latin-1 Supplement](https://en.wikipedia.org/wiki/Latin-1_Supplement_(Unicode_block)#Character_table)
  14402. * and [Latin Extended-A](https://en.wikipedia.org/wiki/Latin_Extended-A)
  14403. * letters to basic Latin letters and removing
  14404. * [combining diacritical marks](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks).
  14405. *
  14406. * @static
  14407. * @memberOf _
  14408. * @since 3.0.0
  14409. * @category String
  14410. * @param {string} [string=''] The string to deburr.
  14411. * @returns {string} Returns the deburred string.
  14412. * @example
  14413. *
  14414. * _.deburr('déjà vu');
  14415. * // => 'deja vu'
  14416. */
  14417. function deburr(string) {
  14418. string = toString(string);
  14419. return string && string.replace(reLatin, deburrLetter).replace(reComboMark, '');
  14420. }
  14421. /**
  14422. * Checks if `string` ends with the given target string.
  14423. *
  14424. * @static
  14425. * @memberOf _
  14426. * @since 3.0.0
  14427. * @category String
  14428. * @param {string} [string=''] The string to inspect.
  14429. * @param {string} [target] The string to search for.
  14430. * @param {number} [position=string.length] The position to search up to.
  14431. * @returns {boolean} Returns `true` if `string` ends with `target`,
  14432. * else `false`.
  14433. * @example
  14434. *
  14435. * _.endsWith('abc', 'c');
  14436. * // => true
  14437. *
  14438. * _.endsWith('abc', 'b');
  14439. * // => false
  14440. *
  14441. * _.endsWith('abc', 'b', 2);
  14442. * // => true
  14443. */
  14444. function endsWith(string, target, position) {
  14445. string = toString(string);
  14446. target = baseToString(target);
  14447. var length = string.length;
  14448. position = position === undefined
  14449. ? length
  14450. : baseClamp(toInteger(position), 0, length);
  14451. var end = position;
  14452. position -= target.length;
  14453. return position >= 0 && string.slice(position, end) == target;
  14454. }
  14455. /**
  14456. * Converts the characters "&", "<", ">", '"', and "'" in `string` to their
  14457. * corresponding HTML entities.
  14458. *
  14459. * **Note:** No other characters are escaped. To escape additional
  14460. * characters use a third-party library like [_he_](https://mths.be/he).
  14461. *
  14462. * Though the ">" character is escaped for symmetry, characters like
  14463. * ">" and "/" don't need escaping in HTML and have no special meaning
  14464. * unless they're part of a tag or unquoted attribute value. See
  14465. * [Mathias Bynens's article](https://mathiasbynens.be/notes/ambiguous-ampersands)
  14466. * (under "semi-related fun fact") for more details.
  14467. *
  14468. * When working with HTML you should always
  14469. * [quote attribute values](http://wonko.com/post/html-escaping) to reduce
  14470. * XSS vectors.
  14471. *
  14472. * @static
  14473. * @since 0.1.0
  14474. * @memberOf _
  14475. * @category String
  14476. * @param {string} [string=''] The string to escape.
  14477. * @returns {string} Returns the escaped string.
  14478. * @example
  14479. *
  14480. * _.escape('fred, barney, & pebbles');
  14481. * // => 'fred, barney, &amp; pebbles'
  14482. */
  14483. function escape(string) {
  14484. string = toString(string);
  14485. return (string && reHasUnescapedHtml.test(string))
  14486. ? string.replace(reUnescapedHtml, escapeHtmlChar)
  14487. : string;
  14488. }
  14489. /**
  14490. * Escapes the `RegExp` special characters "^", "$", "\", ".", "*", "+",
  14491. * "?", "(", ")", "[", "]", "{", "}", and "|" in `string`.
  14492. *
  14493. * @static
  14494. * @memberOf _
  14495. * @since 3.0.0
  14496. * @category String
  14497. * @param {string} [string=''] The string to escape.
  14498. * @returns {string} Returns the escaped string.
  14499. * @example
  14500. *
  14501. * _.escapeRegExp('[lodash](https://lodash.com/)');
  14502. * // => '\[lodash\]\(https://lodash\.com/\)'
  14503. */
  14504. function escapeRegExp(string) {
  14505. string = toString(string);
  14506. return (string && reHasRegExpChar.test(string))
  14507. ? string.replace(reRegExpChar, '\\$&')
  14508. : string;
  14509. }
  14510. /**
  14511. * Converts `string` to
  14512. * [kebab case](https://en.wikipedia.org/wiki/Letter_case#Special_case_styles).
  14513. *
  14514. * @static
  14515. * @memberOf _
  14516. * @since 3.0.0
  14517. * @category String
  14518. * @param {string} [string=''] The string to convert.
  14519. * @returns {string} Returns the kebab cased string.
  14520. * @example
  14521. *
  14522. * _.kebabCase('Foo Bar');
  14523. * // => 'foo-bar'
  14524. *
  14525. * _.kebabCase('fooBar');
  14526. * // => 'foo-bar'
  14527. *
  14528. * _.kebabCase('__FOO_BAR__');
  14529. * // => 'foo-bar'
  14530. */
  14531. var kebabCase = createCompounder(function(result, word, index) {
  14532. return result + (index ? '-' : '') + word.toLowerCase();
  14533. });
  14534. /**
  14535. * Converts `string`, as space separated words, to lower case.
  14536. *
  14537. * @static
  14538. * @memberOf _
  14539. * @since 4.0.0
  14540. * @category String
  14541. * @param {string} [string=''] The string to convert.
  14542. * @returns {string} Returns the lower cased string.
  14543. * @example
  14544. *
  14545. * _.lowerCase('--Foo-Bar--');
  14546. * // => 'foo bar'
  14547. *
  14548. * _.lowerCase('fooBar');
  14549. * // => 'foo bar'
  14550. *
  14551. * _.lowerCase('__FOO_BAR__');
  14552. * // => 'foo bar'
  14553. */
  14554. var lowerCase = createCompounder(function(result, word, index) {
  14555. return result + (index ? ' ' : '') + word.toLowerCase();
  14556. });
  14557. /**
  14558. * Converts the first character of `string` to lower case.
  14559. *
  14560. * @static
  14561. * @memberOf _
  14562. * @since 4.0.0
  14563. * @category String
  14564. * @param {string} [string=''] The string to convert.
  14565. * @returns {string} Returns the converted string.
  14566. * @example
  14567. *
  14568. * _.lowerFirst('Fred');
  14569. * // => 'fred'
  14570. *
  14571. * _.lowerFirst('FRED');
  14572. * // => 'fRED'
  14573. */
  14574. var lowerFirst = createCaseFirst('toLowerCase');
  14575. /**
  14576. * Pads `string` on the left and right sides if it's shorter than `length`.
  14577. * Padding characters are truncated if they can't be evenly divided by `length`.
  14578. *
  14579. * @static
  14580. * @memberOf _
  14581. * @since 3.0.0
  14582. * @category String
  14583. * @param {string} [string=''] The string to pad.
  14584. * @param {number} [length=0] The padding length.
  14585. * @param {string} [chars=' '] The string used as padding.
  14586. * @returns {string} Returns the padded string.
  14587. * @example
  14588. *
  14589. * _.pad('abc', 8);
  14590. * // => ' abc '
  14591. *
  14592. * _.pad('abc', 8, '_-');
  14593. * // => '_-abc_-_'
  14594. *
  14595. * _.pad('abc', 3);
  14596. * // => 'abc'
  14597. */
  14598. function pad(string, length, chars) {
  14599. string = toString(string);
  14600. length = toInteger(length);
  14601. var strLength = length ? stringSize(string) : 0;
  14602. if (!length || strLength >= length) {
  14603. return string;
  14604. }
  14605. var mid = (length - strLength) / 2;
  14606. return (
  14607. createPadding(nativeFloor(mid), chars) +
  14608. string +
  14609. createPadding(nativeCeil(mid), chars)
  14610. );
  14611. }
  14612. /**
  14613. * Pads `string` on the right side if it's shorter than `length`. Padding
  14614. * characters are truncated if they exceed `length`.
  14615. *
  14616. * @static
  14617. * @memberOf _
  14618. * @since 4.0.0
  14619. * @category String
  14620. * @param {string} [string=''] The string to pad.
  14621. * @param {number} [length=0] The padding length.
  14622. * @param {string} [chars=' '] The string used as padding.
  14623. * @returns {string} Returns the padded string.
  14624. * @example
  14625. *
  14626. * _.padEnd('abc', 6);
  14627. * // => 'abc '
  14628. *
  14629. * _.padEnd('abc', 6, '_-');
  14630. * // => 'abc_-_'
  14631. *
  14632. * _.padEnd('abc', 3);
  14633. * // => 'abc'
  14634. */
  14635. function padEnd(string, length, chars) {
  14636. string = toString(string);
  14637. length = toInteger(length);
  14638. var strLength = length ? stringSize(string) : 0;
  14639. return (length && strLength < length)
  14640. ? (string + createPadding(length - strLength, chars))
  14641. : string;
  14642. }
  14643. /**
  14644. * Pads `string` on the left side if it's shorter than `length`. Padding
  14645. * characters are truncated if they exceed `length`.
  14646. *
  14647. * @static
  14648. * @memberOf _
  14649. * @since 4.0.0
  14650. * @category String
  14651. * @param {string} [string=''] The string to pad.
  14652. * @param {number} [length=0] The padding length.
  14653. * @param {string} [chars=' '] The string used as padding.
  14654. * @returns {string} Returns the padded string.
  14655. * @example
  14656. *
  14657. * _.padStart('abc', 6);
  14658. * // => ' abc'
  14659. *
  14660. * _.padStart('abc', 6, '_-');
  14661. * // => '_-_abc'
  14662. *
  14663. * _.padStart('abc', 3);
  14664. * // => 'abc'
  14665. */
  14666. function padStart(string, length, chars) {
  14667. string = toString(string);
  14668. length = toInteger(length);
  14669. var strLength = length ? stringSize(string) : 0;
  14670. return (length && strLength < length)
  14671. ? (createPadding(length - strLength, chars) + string)
  14672. : string;
  14673. }
  14674. /**
  14675. * Converts `string` to an integer of the specified radix. If `radix` is
  14676. * `undefined` or `0`, a `radix` of `10` is used unless `value` is a
  14677. * hexadecimal, in which case a `radix` of `16` is used.
  14678. *
  14679. * **Note:** This method aligns with the
  14680. * [ES5 implementation](https://es5.github.io/#x15.1.2.2) of `parseInt`.
  14681. *
  14682. * @static
  14683. * @memberOf _
  14684. * @since 1.1.0
  14685. * @category String
  14686. * @param {string} string The string to convert.
  14687. * @param {number} [radix=10] The radix to interpret `value` by.
  14688. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  14689. * @returns {number} Returns the converted integer.
  14690. * @example
  14691. *
  14692. * _.parseInt('08');
  14693. * // => 8
  14694. *
  14695. * _.map(['6', '08', '10'], _.parseInt);
  14696. * // => [6, 8, 10]
  14697. */
  14698. function parseInt(string, radix, guard) {
  14699. if (guard || radix == null) {
  14700. radix = 0;
  14701. } else if (radix) {
  14702. radix = +radix;
  14703. }
  14704. return nativeParseInt(toString(string).replace(reTrimStart, ''), radix || 0);
  14705. }
  14706. /**
  14707. * Repeats the given string `n` times.
  14708. *
  14709. * @static
  14710. * @memberOf _
  14711. * @since 3.0.0
  14712. * @category String
  14713. * @param {string} [string=''] The string to repeat.
  14714. * @param {number} [n=1] The number of times to repeat the string.
  14715. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  14716. * @returns {string} Returns the repeated string.
  14717. * @example
  14718. *
  14719. * _.repeat('*', 3);
  14720. * // => '***'
  14721. *
  14722. * _.repeat('abc', 2);
  14723. * // => 'abcabc'
  14724. *
  14725. * _.repeat('abc', 0);
  14726. * // => ''
  14727. */
  14728. function repeat(string, n, guard) {
  14729. if ((guard ? isIterateeCall(string, n, guard) : n === undefined)) {
  14730. n = 1;
  14731. } else {
  14732. n = toInteger(n);
  14733. }
  14734. return baseRepeat(toString(string), n);
  14735. }
  14736. /**
  14737. * Replaces matches for `pattern` in `string` with `replacement`.
  14738. *
  14739. * **Note:** This method is based on
  14740. * [`String#replace`](https://mdn.io/String/replace).
  14741. *
  14742. * @static
  14743. * @memberOf _
  14744. * @since 4.0.0
  14745. * @category String
  14746. * @param {string} [string=''] The string to modify.
  14747. * @param {RegExp|string} pattern The pattern to replace.
  14748. * @param {Function|string} replacement The match replacement.
  14749. * @returns {string} Returns the modified string.
  14750. * @example
  14751. *
  14752. * _.replace('Hi Fred', 'Fred', 'Barney');
  14753. * // => 'Hi Barney'
  14754. */
  14755. function replace() {
  14756. var args = arguments,
  14757. string = toString(args[0]);
  14758. return args.length < 3 ? string : string.replace(args[1], args[2]);
  14759. }
  14760. /**
  14761. * Converts `string` to
  14762. * [snake case](https://en.wikipedia.org/wiki/Snake_case).
  14763. *
  14764. * @static
  14765. * @memberOf _
  14766. * @since 3.0.0
  14767. * @category String
  14768. * @param {string} [string=''] The string to convert.
  14769. * @returns {string} Returns the snake cased string.
  14770. * @example
  14771. *
  14772. * _.snakeCase('Foo Bar');
  14773. * // => 'foo_bar'
  14774. *
  14775. * _.snakeCase('fooBar');
  14776. * // => 'foo_bar'
  14777. *
  14778. * _.snakeCase('--FOO-BAR--');
  14779. * // => 'foo_bar'
  14780. */
  14781. var snakeCase = createCompounder(function(result, word, index) {
  14782. return result + (index ? '_' : '') + word.toLowerCase();
  14783. });
  14784. /**
  14785. * Splits `string` by `separator`.
  14786. *
  14787. * **Note:** This method is based on
  14788. * [`String#split`](https://mdn.io/String/split).
  14789. *
  14790. * @static
  14791. * @memberOf _
  14792. * @since 4.0.0
  14793. * @category String
  14794. * @param {string} [string=''] The string to split.
  14795. * @param {RegExp|string} separator The separator pattern to split by.
  14796. * @param {number} [limit] The length to truncate results to.
  14797. * @returns {Array} Returns the string segments.
  14798. * @example
  14799. *
  14800. * _.split('a-b-c', '-', 2);
  14801. * // => ['a', 'b']
  14802. */
  14803. function split(string, separator, limit) {
  14804. if (limit && typeof limit != 'number' && isIterateeCall(string, separator, limit)) {
  14805. separator = limit = undefined;
  14806. }
  14807. limit = limit === undefined ? MAX_ARRAY_LENGTH : limit >>> 0;
  14808. if (!limit) {
  14809. return [];
  14810. }
  14811. string = toString(string);
  14812. if (string && (
  14813. typeof separator == 'string' ||
  14814. (separator != null && !isRegExp(separator))
  14815. )) {
  14816. separator = baseToString(separator);
  14817. if (!separator && hasUnicode(string)) {
  14818. return castSlice(stringToArray(string), 0, limit);
  14819. }
  14820. }
  14821. return string.split(separator, limit);
  14822. }
  14823. /**
  14824. * Converts `string` to
  14825. * [start case](https://en.wikipedia.org/wiki/Letter_case#Stylistic_or_specialised_usage).
  14826. *
  14827. * @static
  14828. * @memberOf _
  14829. * @since 3.1.0
  14830. * @category String
  14831. * @param {string} [string=''] The string to convert.
  14832. * @returns {string} Returns the start cased string.
  14833. * @example
  14834. *
  14835. * _.startCase('--foo-bar--');
  14836. * // => 'Foo Bar'
  14837. *
  14838. * _.startCase('fooBar');
  14839. * // => 'Foo Bar'
  14840. *
  14841. * _.startCase('__FOO_BAR__');
  14842. * // => 'FOO BAR'
  14843. */
  14844. var startCase = createCompounder(function(result, word, index) {
  14845. return result + (index ? ' ' : '') + upperFirst(word);
  14846. });
  14847. /**
  14848. * Checks if `string` starts with the given target string.
  14849. *
  14850. * @static
  14851. * @memberOf _
  14852. * @since 3.0.0
  14853. * @category String
  14854. * @param {string} [string=''] The string to inspect.
  14855. * @param {string} [target] The string to search for.
  14856. * @param {number} [position=0] The position to search from.
  14857. * @returns {boolean} Returns `true` if `string` starts with `target`,
  14858. * else `false`.
  14859. * @example
  14860. *
  14861. * _.startsWith('abc', 'a');
  14862. * // => true
  14863. *
  14864. * _.startsWith('abc', 'b');
  14865. * // => false
  14866. *
  14867. * _.startsWith('abc', 'b', 1);
  14868. * // => true
  14869. */
  14870. function startsWith(string, target, position) {
  14871. string = toString(string);
  14872. position = position == null
  14873. ? 0
  14874. : baseClamp(toInteger(position), 0, string.length);
  14875. target = baseToString(target);
  14876. return string.slice(position, position + target.length) == target;
  14877. }
  14878. /**
  14879. * Creates a compiled template function that can interpolate data properties
  14880. * in "interpolate" delimiters, HTML-escape interpolated data properties in
  14881. * "escape" delimiters, and execute JavaScript in "evaluate" delimiters. Data
  14882. * properties may be accessed as free variables in the template. If a setting
  14883. * object is given, it takes precedence over `_.templateSettings` values.
  14884. *
  14885. * **Note:** In the development build `_.template` utilizes
  14886. * [sourceURLs](http://www.html5rocks.com/en/tutorials/developertools/sourcemaps/#toc-sourceurl)
  14887. * for easier debugging.
  14888. *
  14889. * For more information on precompiling templates see
  14890. * [lodash's custom builds documentation](https://lodash.com/custom-builds).
  14891. *
  14892. * For more information on Chrome extension sandboxes see
  14893. * [Chrome's extensions documentation](https://developer.chrome.com/extensions/sandboxingEval).
  14894. *
  14895. * @static
  14896. * @since 0.1.0
  14897. * @memberOf _
  14898. * @category String
  14899. * @param {string} [string=''] The template string.
  14900. * @param {Object} [options={}] The options object.
  14901. * @param {RegExp} [options.escape=_.templateSettings.escape]
  14902. * The HTML "escape" delimiter.
  14903. * @param {RegExp} [options.evaluate=_.templateSettings.evaluate]
  14904. * The "evaluate" delimiter.
  14905. * @param {Object} [options.imports=_.templateSettings.imports]
  14906. * An object to import into the template as free variables.
  14907. * @param {RegExp} [options.interpolate=_.templateSettings.interpolate]
  14908. * The "interpolate" delimiter.
  14909. * @param {string} [options.sourceURL='lodash.templateSources[n]']
  14910. * The sourceURL of the compiled template.
  14911. * @param {string} [options.variable='obj']
  14912. * The data object variable name.
  14913. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  14914. * @returns {Function} Returns the compiled template function.
  14915. * @example
  14916. *
  14917. * // Use the "interpolate" delimiter to create a compiled template.
  14918. * var compiled = _.template('hello <%= user %>!');
  14919. * compiled({ 'user': 'fred' });
  14920. * // => 'hello fred!'
  14921. *
  14922. * // Use the HTML "escape" delimiter to escape data property values.
  14923. * var compiled = _.template('<b><%- value %></b>');
  14924. * compiled({ 'value': '<script>' });
  14925. * // => '<b>&lt;script&gt;</b>'
  14926. *
  14927. * // Use the "evaluate" delimiter to execute JavaScript and generate HTML.
  14928. * var compiled = _.template('<% _.forEach(users, function(user) { %><li><%- user %></li><% }); %>');
  14929. * compiled({ 'users': ['fred', 'barney'] });
  14930. * // => '<li>fred</li><li>barney</li>'
  14931. *
  14932. * // Use the internal `print` function in "evaluate" delimiters.
  14933. * var compiled = _.template('<% print("hello " + user); %>!');
  14934. * compiled({ 'user': 'barney' });
  14935. * // => 'hello barney!'
  14936. *
  14937. * // Use the ES template literal delimiter as an "interpolate" delimiter.
  14938. * // Disable support by replacing the "interpolate" delimiter.
  14939. * var compiled = _.template('hello ${ user }!');
  14940. * compiled({ 'user': 'pebbles' });
  14941. * // => 'hello pebbles!'
  14942. *
  14943. * // Use backslashes to treat delimiters as plain text.
  14944. * var compiled = _.template('<%= "\\<%- value %\\>" %>');
  14945. * compiled({ 'value': 'ignored' });
  14946. * // => '<%- value %>'
  14947. *
  14948. * // Use the `imports` option to import `jQuery` as `jq`.
  14949. * var text = '<% jq.each(users, function(user) { %><li><%- user %></li><% }); %>';
  14950. * var compiled = _.template(text, { 'imports': { 'jq': jQuery } });
  14951. * compiled({ 'users': ['fred', 'barney'] });
  14952. * // => '<li>fred</li><li>barney</li>'
  14953. *
  14954. * // Use the `sourceURL` option to specify a custom sourceURL for the template.
  14955. * var compiled = _.template('hello <%= user %>!', { 'sourceURL': '/basic/greeting.jst' });
  14956. * compiled(data);
  14957. * // => Find the source of "greeting.jst" under the Sources tab or Resources panel of the web inspector.
  14958. *
  14959. * // Use the `variable` option to ensure a with-statement isn't used in the compiled template.
  14960. * var compiled = _.template('hi <%= data.user %>!', { 'variable': 'data' });
  14961. * compiled.source;
  14962. * // => function(data) {
  14963. * // var __t, __p = '';
  14964. * // __p += 'hi ' + ((__t = ( data.user )) == null ? '' : __t) + '!';
  14965. * // return __p;
  14966. * // }
  14967. *
  14968. * // Use custom template delimiters.
  14969. * _.templateSettings.interpolate = /{{([\s\S]+?)}}/g;
  14970. * var compiled = _.template('hello {{ user }}!');
  14971. * compiled({ 'user': 'mustache' });
  14972. * // => 'hello mustache!'
  14973. *
  14974. * // Use the `source` property to inline compiled templates for meaningful
  14975. * // line numbers in error messages and stack traces.
  14976. * fs.writeFileSync(path.join(process.cwd(), 'jst.js'), '\
  14977. * var JST = {\
  14978. * "main": ' + _.template(mainText).source + '\
  14979. * };\
  14980. * ');
  14981. */
  14982. function template(string, options, guard) {
  14983. // Based on John Resig's `tmpl` implementation
  14984. // (http://ejohn.org/blog/javascript-micro-templating/)
  14985. // and Laura Doktorova's doT.js (https://github.com/olado/doT).
  14986. var settings = lodash.templateSettings;
  14987. if (guard && isIterateeCall(string, options, guard)) {
  14988. options = undefined;
  14989. }
  14990. string = toString(string);
  14991. options = assignInWith({}, options, settings, customDefaultsAssignIn);
  14992. var imports = assignInWith({}, options.imports, settings.imports, customDefaultsAssignIn),
  14993. importsKeys = keys(imports),
  14994. importsValues = baseValues(imports, importsKeys);
  14995. var isEscaping,
  14996. isEvaluating,
  14997. index = 0,
  14998. interpolate = options.interpolate || reNoMatch,
  14999. source = "__p += '";
  15000. // Compile the regexp to match each delimiter.
  15001. var reDelimiters = RegExp(
  15002. (options.escape || reNoMatch).source + '|' +
  15003. interpolate.source + '|' +
  15004. (interpolate === reInterpolate ? reEsTemplate : reNoMatch).source + '|' +
  15005. (options.evaluate || reNoMatch).source + '|$'
  15006. , 'g');
  15007. // Use a sourceURL for easier debugging.
  15008. // The sourceURL gets injected into the source that's eval-ed, so be careful
  15009. // to normalize all kinds of whitespace, so e.g. newlines (and unicode versions of it) can't sneak in
  15010. // and escape the comment, thus injecting code that gets evaled.
  15011. var sourceURL = '//# sourceURL=' +
  15012. (hasOwnProperty.call(options, 'sourceURL')
  15013. ? (options.sourceURL + '').replace(/\s/g, ' ')
  15014. : ('lodash.templateSources[' + (++templateCounter) + ']')
  15015. ) + '\n';
  15016. string.replace(reDelimiters, function(match, escapeValue, interpolateValue, esTemplateValue, evaluateValue, offset) {
  15017. interpolateValue || (interpolateValue = esTemplateValue);
  15018. // Escape characters that can't be included in string literals.
  15019. source += string.slice(index, offset).replace(reUnescapedString, escapeStringChar);
  15020. // Replace delimiters with snippets.
  15021. if (escapeValue) {
  15022. isEscaping = true;
  15023. source += "' +\n__e(" + escapeValue + ") +\n'";
  15024. }
  15025. if (evaluateValue) {
  15026. isEvaluating = true;
  15027. source += "';\n" + evaluateValue + ";\n__p += '";
  15028. }
  15029. if (interpolateValue) {
  15030. source += "' +\n((__t = (" + interpolateValue + ")) == null ? '' : __t) +\n'";
  15031. }
  15032. index = offset + match.length;
  15033. // The JS engine embedded in Adobe products needs `match` returned in
  15034. // order to produce the correct `offset` value.
  15035. return match;
  15036. });
  15037. source += "';\n";
  15038. // If `variable` is not specified wrap a with-statement around the generated
  15039. // code to add the data object to the top of the scope chain.
  15040. var variable = hasOwnProperty.call(options, 'variable') && options.variable;
  15041. if (!variable) {
  15042. source = 'with (obj) {\n' + source + '\n}\n';
  15043. }
  15044. // Throw an error if a forbidden character was found in `variable`, to prevent
  15045. // potential command injection attacks.
  15046. else if (reForbiddenIdentifierChars.test(variable)) {
  15047. throw new Error(INVALID_TEMPL_VAR_ERROR_TEXT);
  15048. }
  15049. // Cleanup code by stripping empty strings.
  15050. source = (isEvaluating ? source.replace(reEmptyStringLeading, '') : source)
  15051. .replace(reEmptyStringMiddle, '$1')
  15052. .replace(reEmptyStringTrailing, '$1;');
  15053. // Frame code as the function body.
  15054. source = 'function(' + (variable || 'obj') + ') {\n' +
  15055. (variable
  15056. ? ''
  15057. : 'obj || (obj = {});\n'
  15058. ) +
  15059. "var __t, __p = ''" +
  15060. (isEscaping
  15061. ? ', __e = _.escape'
  15062. : ''
  15063. ) +
  15064. (isEvaluating
  15065. ? ', __j = Array.prototype.join;\n' +
  15066. "function print() { __p += __j.call(arguments, '') }\n"
  15067. : ';\n'
  15068. ) +
  15069. source +
  15070. 'return __p\n}';
  15071. var result = attempt(function() {
  15072. return Function(importsKeys, sourceURL + 'return ' + source)
  15073. .apply(undefined, importsValues);
  15074. });
  15075. // Provide the compiled function's source by its `toString` method or
  15076. // the `source` property as a convenience for inlining compiled templates.
  15077. result.source = source;
  15078. if (isError(result)) {
  15079. throw result;
  15080. }
  15081. return result;
  15082. }
  15083. /**
  15084. * Converts `string`, as a whole, to lower case just like
  15085. * [String#toLowerCase](https://mdn.io/toLowerCase).
  15086. *
  15087. * @static
  15088. * @memberOf _
  15089. * @since 4.0.0
  15090. * @category String
  15091. * @param {string} [string=''] The string to convert.
  15092. * @returns {string} Returns the lower cased string.
  15093. * @example
  15094. *
  15095. * _.toLower('--Foo-Bar--');
  15096. * // => '--foo-bar--'
  15097. *
  15098. * _.toLower('fooBar');
  15099. * // => 'foobar'
  15100. *
  15101. * _.toLower('__FOO_BAR__');
  15102. * // => '__foo_bar__'
  15103. */
  15104. function toLower(value) {
  15105. return toString(value).toLowerCase();
  15106. }
  15107. /**
  15108. * Converts `string`, as a whole, to upper case just like
  15109. * [String#toUpperCase](https://mdn.io/toUpperCase).
  15110. *
  15111. * @static
  15112. * @memberOf _
  15113. * @since 4.0.0
  15114. * @category String
  15115. * @param {string} [string=''] The string to convert.
  15116. * @returns {string} Returns the upper cased string.
  15117. * @example
  15118. *
  15119. * _.toUpper('--foo-bar--');
  15120. * // => '--FOO-BAR--'
  15121. *
  15122. * _.toUpper('fooBar');
  15123. * // => 'FOOBAR'
  15124. *
  15125. * _.toUpper('__foo_bar__');
  15126. * // => '__FOO_BAR__'
  15127. */
  15128. function toUpper(value) {
  15129. return toString(value).toUpperCase();
  15130. }
  15131. /**
  15132. * Removes leading and trailing whitespace or specified characters from `string`.
  15133. *
  15134. * @static
  15135. * @memberOf _
  15136. * @since 3.0.0
  15137. * @category String
  15138. * @param {string} [string=''] The string to trim.
  15139. * @param {string} [chars=whitespace] The characters to trim.
  15140. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  15141. * @returns {string} Returns the trimmed string.
  15142. * @example
  15143. *
  15144. * _.trim(' abc ');
  15145. * // => 'abc'
  15146. *
  15147. * _.trim('-_-abc-_-', '_-');
  15148. * // => 'abc'
  15149. *
  15150. * _.map([' foo ', ' bar '], _.trim);
  15151. * // => ['foo', 'bar']
  15152. */
  15153. function trim(string, chars, guard) {
  15154. string = toString(string);
  15155. if (string && (guard || chars === undefined)) {
  15156. return baseTrim(string);
  15157. }
  15158. if (!string || !(chars = baseToString(chars))) {
  15159. return string;
  15160. }
  15161. var strSymbols = stringToArray(string),
  15162. chrSymbols = stringToArray(chars),
  15163. start = charsStartIndex(strSymbols, chrSymbols),
  15164. end = charsEndIndex(strSymbols, chrSymbols) + 1;
  15165. return castSlice(strSymbols, start, end).join('');
  15166. }
  15167. /**
  15168. * Removes trailing whitespace or specified characters from `string`.
  15169. *
  15170. * @static
  15171. * @memberOf _
  15172. * @since 4.0.0
  15173. * @category String
  15174. * @param {string} [string=''] The string to trim.
  15175. * @param {string} [chars=whitespace] The characters to trim.
  15176. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  15177. * @returns {string} Returns the trimmed string.
  15178. * @example
  15179. *
  15180. * _.trimEnd(' abc ');
  15181. * // => ' abc'
  15182. *
  15183. * _.trimEnd('-_-abc-_-', '_-');
  15184. * // => '-_-abc'
  15185. */
  15186. function trimEnd(string, chars, guard) {
  15187. string = toString(string);
  15188. if (string && (guard || chars === undefined)) {
  15189. return string.slice(0, trimmedEndIndex(string) + 1);
  15190. }
  15191. if (!string || !(chars = baseToString(chars))) {
  15192. return string;
  15193. }
  15194. var strSymbols = stringToArray(string),
  15195. end = charsEndIndex(strSymbols, stringToArray(chars)) + 1;
  15196. return castSlice(strSymbols, 0, end).join('');
  15197. }
  15198. /**
  15199. * Removes leading whitespace or specified characters from `string`.
  15200. *
  15201. * @static
  15202. * @memberOf _
  15203. * @since 4.0.0
  15204. * @category String
  15205. * @param {string} [string=''] The string to trim.
  15206. * @param {string} [chars=whitespace] The characters to trim.
  15207. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  15208. * @returns {string} Returns the trimmed string.
  15209. * @example
  15210. *
  15211. * _.trimStart(' abc ');
  15212. * // => 'abc '
  15213. *
  15214. * _.trimStart('-_-abc-_-', '_-');
  15215. * // => 'abc-_-'
  15216. */
  15217. function trimStart(string, chars, guard) {
  15218. string = toString(string);
  15219. if (string && (guard || chars === undefined)) {
  15220. return string.replace(reTrimStart, '');
  15221. }
  15222. if (!string || !(chars = baseToString(chars))) {
  15223. return string;
  15224. }
  15225. var strSymbols = stringToArray(string),
  15226. start = charsStartIndex(strSymbols, stringToArray(chars));
  15227. return castSlice(strSymbols, start).join('');
  15228. }
  15229. /**
  15230. * Truncates `string` if it's longer than the given maximum string length.
  15231. * The last characters of the truncated string are replaced with the omission
  15232. * string which defaults to "...".
  15233. *
  15234. * @static
  15235. * @memberOf _
  15236. * @since 4.0.0
  15237. * @category String
  15238. * @param {string} [string=''] The string to truncate.
  15239. * @param {Object} [options={}] The options object.
  15240. * @param {number} [options.length=30] The maximum string length.
  15241. * @param {string} [options.omission='...'] The string to indicate text is omitted.
  15242. * @param {RegExp|string} [options.separator] The separator pattern to truncate to.
  15243. * @returns {string} Returns the truncated string.
  15244. * @example
  15245. *
  15246. * _.truncate('hi-diddly-ho there, neighborino');
  15247. * // => 'hi-diddly-ho there, neighbo...'
  15248. *
  15249. * _.truncate('hi-diddly-ho there, neighborino', {
  15250. * 'length': 24,
  15251. * 'separator': ' '
  15252. * });
  15253. * // => 'hi-diddly-ho there,...'
  15254. *
  15255. * _.truncate('hi-diddly-ho there, neighborino', {
  15256. * 'length': 24,
  15257. * 'separator': /,? +/
  15258. * });
  15259. * // => 'hi-diddly-ho there...'
  15260. *
  15261. * _.truncate('hi-diddly-ho there, neighborino', {
  15262. * 'omission': ' [...]'
  15263. * });
  15264. * // => 'hi-diddly-ho there, neig [...]'
  15265. */
  15266. function truncate(string, options) {
  15267. var length = DEFAULT_TRUNC_LENGTH,
  15268. omission = DEFAULT_TRUNC_OMISSION;
  15269. if (isObject(options)) {
  15270. var separator = 'separator' in options ? options.separator : separator;
  15271. length = 'length' in options ? toInteger(options.length) : length;
  15272. omission = 'omission' in options ? baseToString(options.omission) : omission;
  15273. }
  15274. string = toString(string);
  15275. var strLength = string.length;
  15276. if (hasUnicode(string)) {
  15277. var strSymbols = stringToArray(string);
  15278. strLength = strSymbols.length;
  15279. }
  15280. if (length >= strLength) {
  15281. return string;
  15282. }
  15283. var end = length - stringSize(omission);
  15284. if (end < 1) {
  15285. return omission;
  15286. }
  15287. var result = strSymbols
  15288. ? castSlice(strSymbols, 0, end).join('')
  15289. : string.slice(0, end);
  15290. if (separator === undefined) {
  15291. return result + omission;
  15292. }
  15293. if (strSymbols) {
  15294. end += (result.length - end);
  15295. }
  15296. if (isRegExp(separator)) {
  15297. if (string.slice(end).search(separator)) {
  15298. var match,
  15299. substring = result;
  15300. if (!separator.global) {
  15301. separator = RegExp(separator.source, toString(reFlags.exec(separator)) + 'g');
  15302. }
  15303. separator.lastIndex = 0;
  15304. while ((match = separator.exec(substring))) {
  15305. var newEnd = match.index;
  15306. }
  15307. result = result.slice(0, newEnd === undefined ? end : newEnd);
  15308. }
  15309. } else if (string.indexOf(baseToString(separator), end) != end) {
  15310. var index = result.lastIndexOf(separator);
  15311. if (index > -1) {
  15312. result = result.slice(0, index);
  15313. }
  15314. }
  15315. return result + omission;
  15316. }
  15317. /**
  15318. * The inverse of `_.escape`; this method converts the HTML entities
  15319. * `&amp;`, `&lt;`, `&gt;`, `&quot;`, and `&#39;` in `string` to
  15320. * their corresponding characters.
  15321. *
  15322. * **Note:** No other HTML entities are unescaped. To unescape additional
  15323. * HTML entities use a third-party library like [_he_](https://mths.be/he).
  15324. *
  15325. * @static
  15326. * @memberOf _
  15327. * @since 0.6.0
  15328. * @category String
  15329. * @param {string} [string=''] The string to unescape.
  15330. * @returns {string} Returns the unescaped string.
  15331. * @example
  15332. *
  15333. * _.unescape('fred, barney, &amp; pebbles');
  15334. * // => 'fred, barney, & pebbles'
  15335. */
  15336. function unescape(string) {
  15337. string = toString(string);
  15338. return (string && reHasEscapedHtml.test(string))
  15339. ? string.replace(reEscapedHtml, unescapeHtmlChar)
  15340. : string;
  15341. }
  15342. /**
  15343. * Converts `string`, as space separated words, to upper case.
  15344. *
  15345. * @static
  15346. * @memberOf _
  15347. * @since 4.0.0
  15348. * @category String
  15349. * @param {string} [string=''] The string to convert.
  15350. * @returns {string} Returns the upper cased string.
  15351. * @example
  15352. *
  15353. * _.upperCase('--foo-bar');
  15354. * // => 'FOO BAR'
  15355. *
  15356. * _.upperCase('fooBar');
  15357. * // => 'FOO BAR'
  15358. *
  15359. * _.upperCase('__foo_bar__');
  15360. * // => 'FOO BAR'
  15361. */
  15362. var upperCase = createCompounder(function(result, word, index) {
  15363. return result + (index ? ' ' : '') + word.toUpperCase();
  15364. });
  15365. /**
  15366. * Converts the first character of `string` to upper case.
  15367. *
  15368. * @static
  15369. * @memberOf _
  15370. * @since 4.0.0
  15371. * @category String
  15372. * @param {string} [string=''] The string to convert.
  15373. * @returns {string} Returns the converted string.
  15374. * @example
  15375. *
  15376. * _.upperFirst('fred');
  15377. * // => 'Fred'
  15378. *
  15379. * _.upperFirst('FRED');
  15380. * // => 'FRED'
  15381. */
  15382. var upperFirst = createCaseFirst('toUpperCase');
  15383. /**
  15384. * Splits `string` into an array of its words.
  15385. *
  15386. * @static
  15387. * @memberOf _
  15388. * @since 3.0.0
  15389. * @category String
  15390. * @param {string} [string=''] The string to inspect.
  15391. * @param {RegExp|string} [pattern] The pattern to match words.
  15392. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  15393. * @returns {Array} Returns the words of `string`.
  15394. * @example
  15395. *
  15396. * _.words('fred, barney, & pebbles');
  15397. * // => ['fred', 'barney', 'pebbles']
  15398. *
  15399. * _.words('fred, barney, & pebbles', /[^, ]+/g);
  15400. * // => ['fred', 'barney', '&', 'pebbles']
  15401. */
  15402. function words(string, pattern, guard) {
  15403. string = toString(string);
  15404. pattern = guard ? undefined : pattern;
  15405. if (pattern === undefined) {
  15406. return hasUnicodeWord(string) ? unicodeWords(string) : asciiWords(string);
  15407. }
  15408. return string.match(pattern) || [];
  15409. }
  15410. /*------------------------------------------------------------------------*/
  15411. /**
  15412. * Attempts to invoke `func`, returning either the result or the caught error
  15413. * object. Any additional arguments are provided to `func` when it's invoked.
  15414. *
  15415. * @static
  15416. * @memberOf _
  15417. * @since 3.0.0
  15418. * @category Util
  15419. * @param {Function} func The function to attempt.
  15420. * @param {...*} [args] The arguments to invoke `func` with.
  15421. * @returns {*} Returns the `func` result or error object.
  15422. * @example
  15423. *
  15424. * // Avoid throwing errors for invalid selectors.
  15425. * var elements = _.attempt(function(selector) {
  15426. * return document.querySelectorAll(selector);
  15427. * }, '>_>');
  15428. *
  15429. * if (_.isError(elements)) {
  15430. * elements = [];
  15431. * }
  15432. */
  15433. var attempt = baseRest(function(func, args) {
  15434. try {
  15435. return apply(func, undefined, args);
  15436. } catch (e) {
  15437. return isError(e) ? e : new Error(e);
  15438. }
  15439. });
  15440. /**
  15441. * Binds methods of an object to the object itself, overwriting the existing
  15442. * method.
  15443. *
  15444. * **Note:** This method doesn't set the "length" property of bound functions.
  15445. *
  15446. * @static
  15447. * @since 0.1.0
  15448. * @memberOf _
  15449. * @category Util
  15450. * @param {Object} object The object to bind and assign the bound methods to.
  15451. * @param {...(string|string[])} methodNames The object method names to bind.
  15452. * @returns {Object} Returns `object`.
  15453. * @example
  15454. *
  15455. * var view = {
  15456. * 'label': 'docs',
  15457. * 'click': function() {
  15458. * console.log('clicked ' + this.label);
  15459. * }
  15460. * };
  15461. *
  15462. * _.bindAll(view, ['click']);
  15463. * jQuery(element).on('click', view.click);
  15464. * // => Logs 'clicked docs' when clicked.
  15465. */
  15466. var bindAll = flatRest(function(object, methodNames) {
  15467. arrayEach(methodNames, function(key) {
  15468. key = toKey(key);
  15469. baseAssignValue(object, key, bind(object[key], object));
  15470. });
  15471. return object;
  15472. });
  15473. /**
  15474. * Creates a function that iterates over `pairs` and invokes the corresponding
  15475. * function of the first predicate to return truthy. The predicate-function
  15476. * pairs are invoked with the `this` binding and arguments of the created
  15477. * function.
  15478. *
  15479. * @static
  15480. * @memberOf _
  15481. * @since 4.0.0
  15482. * @category Util
  15483. * @param {Array} pairs The predicate-function pairs.
  15484. * @returns {Function} Returns the new composite function.
  15485. * @example
  15486. *
  15487. * var func = _.cond([
  15488. * [_.matches({ 'a': 1 }), _.constant('matches A')],
  15489. * [_.conforms({ 'b': _.isNumber }), _.constant('matches B')],
  15490. * [_.stubTrue, _.constant('no match')]
  15491. * ]);
  15492. *
  15493. * func({ 'a': 1, 'b': 2 });
  15494. * // => 'matches A'
  15495. *
  15496. * func({ 'a': 0, 'b': 1 });
  15497. * // => 'matches B'
  15498. *
  15499. * func({ 'a': '1', 'b': '2' });
  15500. * // => 'no match'
  15501. */
  15502. function cond(pairs) {
  15503. var length = pairs == null ? 0 : pairs.length,
  15504. toIteratee = getIteratee();
  15505. pairs = !length ? [] : arrayMap(pairs, function(pair) {
  15506. if (typeof pair[1] != 'function') {
  15507. throw new TypeError(FUNC_ERROR_TEXT);
  15508. }
  15509. return [toIteratee(pair[0]), pair[1]];
  15510. });
  15511. return baseRest(function(args) {
  15512. var index = -1;
  15513. while (++index < length) {
  15514. var pair = pairs[index];
  15515. if (apply(pair[0], this, args)) {
  15516. return apply(pair[1], this, args);
  15517. }
  15518. }
  15519. });
  15520. }
  15521. /**
  15522. * Creates a function that invokes the predicate properties of `source` with
  15523. * the corresponding property values of a given object, returning `true` if
  15524. * all predicates return truthy, else `false`.
  15525. *
  15526. * **Note:** The created function is equivalent to `_.conformsTo` with
  15527. * `source` partially applied.
  15528. *
  15529. * @static
  15530. * @memberOf _
  15531. * @since 4.0.0
  15532. * @category Util
  15533. * @param {Object} source The object of property predicates to conform to.
  15534. * @returns {Function} Returns the new spec function.
  15535. * @example
  15536. *
  15537. * var objects = [
  15538. * { 'a': 2, 'b': 1 },
  15539. * { 'a': 1, 'b': 2 }
  15540. * ];
  15541. *
  15542. * _.filter(objects, _.conforms({ 'b': function(n) { return n > 1; } }));
  15543. * // => [{ 'a': 1, 'b': 2 }]
  15544. */
  15545. function conforms(source) {
  15546. return baseConforms(baseClone(source, CLONE_DEEP_FLAG));
  15547. }
  15548. /**
  15549. * Creates a function that returns `value`.
  15550. *
  15551. * @static
  15552. * @memberOf _
  15553. * @since 2.4.0
  15554. * @category Util
  15555. * @param {*} value The value to return from the new function.
  15556. * @returns {Function} Returns the new constant function.
  15557. * @example
  15558. *
  15559. * var objects = _.times(2, _.constant({ 'a': 1 }));
  15560. *
  15561. * console.log(objects);
  15562. * // => [{ 'a': 1 }, { 'a': 1 }]
  15563. *
  15564. * console.log(objects[0] === objects[1]);
  15565. * // => true
  15566. */
  15567. function constant(value) {
  15568. return function() {
  15569. return value;
  15570. };
  15571. }
  15572. /**
  15573. * Checks `value` to determine whether a default value should be returned in
  15574. * its place. The `defaultValue` is returned if `value` is `NaN`, `null`,
  15575. * or `undefined`.
  15576. *
  15577. * @static
  15578. * @memberOf _
  15579. * @since 4.14.0
  15580. * @category Util
  15581. * @param {*} value The value to check.
  15582. * @param {*} defaultValue The default value.
  15583. * @returns {*} Returns the resolved value.
  15584. * @example
  15585. *
  15586. * _.defaultTo(1, 10);
  15587. * // => 1
  15588. *
  15589. * _.defaultTo(undefined, 10);
  15590. * // => 10
  15591. */
  15592. function defaultTo(value, defaultValue) {
  15593. return (value == null || value !== value) ? defaultValue : value;
  15594. }
  15595. /**
  15596. * Creates a function that returns the result of invoking the given functions
  15597. * with the `this` binding of the created function, where each successive
  15598. * invocation is supplied the return value of the previous.
  15599. *
  15600. * @static
  15601. * @memberOf _
  15602. * @since 3.0.0
  15603. * @category Util
  15604. * @param {...(Function|Function[])} [funcs] The functions to invoke.
  15605. * @returns {Function} Returns the new composite function.
  15606. * @see _.flowRight
  15607. * @example
  15608. *
  15609. * function square(n) {
  15610. * return n * n;
  15611. * }
  15612. *
  15613. * var addSquare = _.flow([_.add, square]);
  15614. * addSquare(1, 2);
  15615. * // => 9
  15616. */
  15617. var flow = createFlow();
  15618. /**
  15619. * This method is like `_.flow` except that it creates a function that
  15620. * invokes the given functions from right to left.
  15621. *
  15622. * @static
  15623. * @since 3.0.0
  15624. * @memberOf _
  15625. * @category Util
  15626. * @param {...(Function|Function[])} [funcs] The functions to invoke.
  15627. * @returns {Function} Returns the new composite function.
  15628. * @see _.flow
  15629. * @example
  15630. *
  15631. * function square(n) {
  15632. * return n * n;
  15633. * }
  15634. *
  15635. * var addSquare = _.flowRight([square, _.add]);
  15636. * addSquare(1, 2);
  15637. * // => 9
  15638. */
  15639. var flowRight = createFlow(true);
  15640. /**
  15641. * This method returns the first argument it receives.
  15642. *
  15643. * @static
  15644. * @since 0.1.0
  15645. * @memberOf _
  15646. * @category Util
  15647. * @param {*} value Any value.
  15648. * @returns {*} Returns `value`.
  15649. * @example
  15650. *
  15651. * var object = { 'a': 1 };
  15652. *
  15653. * console.log(_.identity(object) === object);
  15654. * // => true
  15655. */
  15656. function identity(value) {
  15657. return value;
  15658. }
  15659. /**
  15660. * Creates a function that invokes `func` with the arguments of the created
  15661. * function. If `func` is a property name, the created function returns the
  15662. * property value for a given element. If `func` is an array or object, the
  15663. * created function returns `true` for elements that contain the equivalent
  15664. * source properties, otherwise it returns `false`.
  15665. *
  15666. * @static
  15667. * @since 4.0.0
  15668. * @memberOf _
  15669. * @category Util
  15670. * @param {*} [func=_.identity] The value to convert to a callback.
  15671. * @returns {Function} Returns the callback.
  15672. * @example
  15673. *
  15674. * var users = [
  15675. * { 'user': 'barney', 'age': 36, 'active': true },
  15676. * { 'user': 'fred', 'age': 40, 'active': false }
  15677. * ];
  15678. *
  15679. * // The `_.matches` iteratee shorthand.
  15680. * _.filter(users, _.iteratee({ 'user': 'barney', 'active': true }));
  15681. * // => [{ 'user': 'barney', 'age': 36, 'active': true }]
  15682. *
  15683. * // The `_.matchesProperty` iteratee shorthand.
  15684. * _.filter(users, _.iteratee(['user', 'fred']));
  15685. * // => [{ 'user': 'fred', 'age': 40 }]
  15686. *
  15687. * // The `_.property` iteratee shorthand.
  15688. * _.map(users, _.iteratee('user'));
  15689. * // => ['barney', 'fred']
  15690. *
  15691. * // Create custom iteratee shorthands.
  15692. * _.iteratee = _.wrap(_.iteratee, function(iteratee, func) {
  15693. * return !_.isRegExp(func) ? iteratee(func) : function(string) {
  15694. * return func.test(string);
  15695. * };
  15696. * });
  15697. *
  15698. * _.filter(['abc', 'def'], /ef/);
  15699. * // => ['def']
  15700. */
  15701. function iteratee(func) {
  15702. return baseIteratee(typeof func == 'function' ? func : baseClone(func, CLONE_DEEP_FLAG));
  15703. }
  15704. /**
  15705. * Creates a function that performs a partial deep comparison between a given
  15706. * object and `source`, returning `true` if the given object has equivalent
  15707. * property values, else `false`.
  15708. *
  15709. * **Note:** The created function is equivalent to `_.isMatch` with `source`
  15710. * partially applied.
  15711. *
  15712. * Partial comparisons will match empty array and empty object `source`
  15713. * values against any array or object value, respectively. See `_.isEqual`
  15714. * for a list of supported value comparisons.
  15715. *
  15716. * **Note:** Multiple values can be checked by combining several matchers
  15717. * using `_.overSome`
  15718. *
  15719. * @static
  15720. * @memberOf _
  15721. * @since 3.0.0
  15722. * @category Util
  15723. * @param {Object} source The object of property values to match.
  15724. * @returns {Function} Returns the new spec function.
  15725. * @example
  15726. *
  15727. * var objects = [
  15728. * { 'a': 1, 'b': 2, 'c': 3 },
  15729. * { 'a': 4, 'b': 5, 'c': 6 }
  15730. * ];
  15731. *
  15732. * _.filter(objects, _.matches({ 'a': 4, 'c': 6 }));
  15733. * // => [{ 'a': 4, 'b': 5, 'c': 6 }]
  15734. *
  15735. * // Checking for several possible values
  15736. * _.filter(objects, _.overSome([_.matches({ 'a': 1 }), _.matches({ 'a': 4 })]));
  15737. * // => [{ 'a': 1, 'b': 2, 'c': 3 }, { 'a': 4, 'b': 5, 'c': 6 }]
  15738. */
  15739. function matches(source) {
  15740. return baseMatches(baseClone(source, CLONE_DEEP_FLAG));
  15741. }
  15742. /**
  15743. * Creates a function that performs a partial deep comparison between the
  15744. * value at `path` of a given object to `srcValue`, returning `true` if the
  15745. * object value is equivalent, else `false`.
  15746. *
  15747. * **Note:** Partial comparisons will match empty array and empty object
  15748. * `srcValue` values against any array or object value, respectively. See
  15749. * `_.isEqual` for a list of supported value comparisons.
  15750. *
  15751. * **Note:** Multiple values can be checked by combining several matchers
  15752. * using `_.overSome`
  15753. *
  15754. * @static
  15755. * @memberOf _
  15756. * @since 3.2.0
  15757. * @category Util
  15758. * @param {Array|string} path The path of the property to get.
  15759. * @param {*} srcValue The value to match.
  15760. * @returns {Function} Returns the new spec function.
  15761. * @example
  15762. *
  15763. * var objects = [
  15764. * { 'a': 1, 'b': 2, 'c': 3 },
  15765. * { 'a': 4, 'b': 5, 'c': 6 }
  15766. * ];
  15767. *
  15768. * _.find(objects, _.matchesProperty('a', 4));
  15769. * // => { 'a': 4, 'b': 5, 'c': 6 }
  15770. *
  15771. * // Checking for several possible values
  15772. * _.filter(objects, _.overSome([_.matchesProperty('a', 1), _.matchesProperty('a', 4)]));
  15773. * // => [{ 'a': 1, 'b': 2, 'c': 3 }, { 'a': 4, 'b': 5, 'c': 6 }]
  15774. */
  15775. function matchesProperty(path, srcValue) {
  15776. return baseMatchesProperty(path, baseClone(srcValue, CLONE_DEEP_FLAG));
  15777. }
  15778. /**
  15779. * Creates a function that invokes the method at `path` of a given object.
  15780. * Any additional arguments are provided to the invoked method.
  15781. *
  15782. * @static
  15783. * @memberOf _
  15784. * @since 3.7.0
  15785. * @category Util
  15786. * @param {Array|string} path The path of the method to invoke.
  15787. * @param {...*} [args] The arguments to invoke the method with.
  15788. * @returns {Function} Returns the new invoker function.
  15789. * @example
  15790. *
  15791. * var objects = [
  15792. * { 'a': { 'b': _.constant(2) } },
  15793. * { 'a': { 'b': _.constant(1) } }
  15794. * ];
  15795. *
  15796. * _.map(objects, _.method('a.b'));
  15797. * // => [2, 1]
  15798. *
  15799. * _.map(objects, _.method(['a', 'b']));
  15800. * // => [2, 1]
  15801. */
  15802. var method = baseRest(function(path, args) {
  15803. return function(object) {
  15804. return baseInvoke(object, path, args);
  15805. };
  15806. });
  15807. /**
  15808. * The opposite of `_.method`; this method creates a function that invokes
  15809. * the method at a given path of `object`. Any additional arguments are
  15810. * provided to the invoked method.
  15811. *
  15812. * @static
  15813. * @memberOf _
  15814. * @since 3.7.0
  15815. * @category Util
  15816. * @param {Object} object The object to query.
  15817. * @param {...*} [args] The arguments to invoke the method with.
  15818. * @returns {Function} Returns the new invoker function.
  15819. * @example
  15820. *
  15821. * var array = _.times(3, _.constant),
  15822. * object = { 'a': array, 'b': array, 'c': array };
  15823. *
  15824. * _.map(['a[2]', 'c[0]'], _.methodOf(object));
  15825. * // => [2, 0]
  15826. *
  15827. * _.map([['a', '2'], ['c', '0']], _.methodOf(object));
  15828. * // => [2, 0]
  15829. */
  15830. var methodOf = baseRest(function(object, args) {
  15831. return function(path) {
  15832. return baseInvoke(object, path, args);
  15833. };
  15834. });
  15835. /**
  15836. * Adds all own enumerable string keyed function properties of a source
  15837. * object to the destination object. If `object` is a function, then methods
  15838. * are added to its prototype as well.
  15839. *
  15840. * **Note:** Use `_.runInContext` to create a pristine `lodash` function to
  15841. * avoid conflicts caused by modifying the original.
  15842. *
  15843. * @static
  15844. * @since 0.1.0
  15845. * @memberOf _
  15846. * @category Util
  15847. * @param {Function|Object} [object=lodash] The destination object.
  15848. * @param {Object} source The object of functions to add.
  15849. * @param {Object} [options={}] The options object.
  15850. * @param {boolean} [options.chain=true] Specify whether mixins are chainable.
  15851. * @returns {Function|Object} Returns `object`.
  15852. * @example
  15853. *
  15854. * function vowels(string) {
  15855. * return _.filter(string, function(v) {
  15856. * return /[aeiou]/i.test(v);
  15857. * });
  15858. * }
  15859. *
  15860. * _.mixin({ 'vowels': vowels });
  15861. * _.vowels('fred');
  15862. * // => ['e']
  15863. *
  15864. * _('fred').vowels().value();
  15865. * // => ['e']
  15866. *
  15867. * _.mixin({ 'vowels': vowels }, { 'chain': false });
  15868. * _('fred').vowels();
  15869. * // => ['e']
  15870. */
  15871. function mixin(object, source, options) {
  15872. var props = keys(source),
  15873. methodNames = baseFunctions(source, props);
  15874. if (options == null &&
  15875. !(isObject(source) && (methodNames.length || !props.length))) {
  15876. options = source;
  15877. source = object;
  15878. object = this;
  15879. methodNames = baseFunctions(source, keys(source));
  15880. }
  15881. var chain = !(isObject(options) && 'chain' in options) || !!options.chain,
  15882. isFunc = isFunction(object);
  15883. arrayEach(methodNames, function(methodName) {
  15884. var func = source[methodName];
  15885. object[methodName] = func;
  15886. if (isFunc) {
  15887. object.prototype[methodName] = function() {
  15888. var chainAll = this.__chain__;
  15889. if (chain || chainAll) {
  15890. var result = object(this.__wrapped__),
  15891. actions = result.__actions__ = copyArray(this.__actions__);
  15892. actions.push({ 'func': func, 'args': arguments, 'thisArg': object });
  15893. result.__chain__ = chainAll;
  15894. return result;
  15895. }
  15896. return func.apply(object, arrayPush([this.value()], arguments));
  15897. };
  15898. }
  15899. });
  15900. return object;
  15901. }
  15902. /**
  15903. * Reverts the `_` variable to its previous value and returns a reference to
  15904. * the `lodash` function.
  15905. *
  15906. * @static
  15907. * @since 0.1.0
  15908. * @memberOf _
  15909. * @category Util
  15910. * @returns {Function} Returns the `lodash` function.
  15911. * @example
  15912. *
  15913. * var lodash = _.noConflict();
  15914. */
  15915. function noConflict() {
  15916. if (root._ === this) {
  15917. root._ = oldDash;
  15918. }
  15919. return this;
  15920. }
  15921. /**
  15922. * This method returns `undefined`.
  15923. *
  15924. * @static
  15925. * @memberOf _
  15926. * @since 2.3.0
  15927. * @category Util
  15928. * @example
  15929. *
  15930. * _.times(2, _.noop);
  15931. * // => [undefined, undefined]
  15932. */
  15933. function noop() {
  15934. // No operation performed.
  15935. }
  15936. /**
  15937. * Creates a function that gets the argument at index `n`. If `n` is negative,
  15938. * the nth argument from the end is returned.
  15939. *
  15940. * @static
  15941. * @memberOf _
  15942. * @since 4.0.0
  15943. * @category Util
  15944. * @param {number} [n=0] The index of the argument to return.
  15945. * @returns {Function} Returns the new pass-thru function.
  15946. * @example
  15947. *
  15948. * var func = _.nthArg(1);
  15949. * func('a', 'b', 'c', 'd');
  15950. * // => 'b'
  15951. *
  15952. * var func = _.nthArg(-2);
  15953. * func('a', 'b', 'c', 'd');
  15954. * // => 'c'
  15955. */
  15956. function nthArg(n) {
  15957. n = toInteger(n);
  15958. return baseRest(function(args) {
  15959. return baseNth(args, n);
  15960. });
  15961. }
  15962. /**
  15963. * Creates a function that invokes `iteratees` with the arguments it receives
  15964. * and returns their results.
  15965. *
  15966. * @static
  15967. * @memberOf _
  15968. * @since 4.0.0
  15969. * @category Util
  15970. * @param {...(Function|Function[])} [iteratees=[_.identity]]
  15971. * The iteratees to invoke.
  15972. * @returns {Function} Returns the new function.
  15973. * @example
  15974. *
  15975. * var func = _.over([Math.max, Math.min]);
  15976. *
  15977. * func(1, 2, 3, 4);
  15978. * // => [4, 1]
  15979. */
  15980. var over = createOver(arrayMap);
  15981. /**
  15982. * Creates a function that checks if **all** of the `predicates` return
  15983. * truthy when invoked with the arguments it receives.
  15984. *
  15985. * Following shorthands are possible for providing predicates.
  15986. * Pass an `Object` and it will be used as an parameter for `_.matches` to create the predicate.
  15987. * Pass an `Array` of parameters for `_.matchesProperty` and the predicate will be created using them.
  15988. *
  15989. * @static
  15990. * @memberOf _
  15991. * @since 4.0.0
  15992. * @category Util
  15993. * @param {...(Function|Function[])} [predicates=[_.identity]]
  15994. * The predicates to check.
  15995. * @returns {Function} Returns the new function.
  15996. * @example
  15997. *
  15998. * var func = _.overEvery([Boolean, isFinite]);
  15999. *
  16000. * func('1');
  16001. * // => true
  16002. *
  16003. * func(null);
  16004. * // => false
  16005. *
  16006. * func(NaN);
  16007. * // => false
  16008. */
  16009. var overEvery = createOver(arrayEvery);
  16010. /**
  16011. * Creates a function that checks if **any** of the `predicates` return
  16012. * truthy when invoked with the arguments it receives.
  16013. *
  16014. * Following shorthands are possible for providing predicates.
  16015. * Pass an `Object` and it will be used as an parameter for `_.matches` to create the predicate.
  16016. * Pass an `Array` of parameters for `_.matchesProperty` and the predicate will be created using them.
  16017. *
  16018. * @static
  16019. * @memberOf _
  16020. * @since 4.0.0
  16021. * @category Util
  16022. * @param {...(Function|Function[])} [predicates=[_.identity]]
  16023. * The predicates to check.
  16024. * @returns {Function} Returns the new function.
  16025. * @example
  16026. *
  16027. * var func = _.overSome([Boolean, isFinite]);
  16028. *
  16029. * func('1');
  16030. * // => true
  16031. *
  16032. * func(null);
  16033. * // => true
  16034. *
  16035. * func(NaN);
  16036. * // => false
  16037. *
  16038. * var matchesFunc = _.overSome([{ 'a': 1 }, { 'a': 2 }])
  16039. * var matchesPropertyFunc = _.overSome([['a', 1], ['a', 2]])
  16040. */
  16041. var overSome = createOver(arraySome);
  16042. /**
  16043. * Creates a function that returns the value at `path` of a given object.
  16044. *
  16045. * @static
  16046. * @memberOf _
  16047. * @since 2.4.0
  16048. * @category Util
  16049. * @param {Array|string} path The path of the property to get.
  16050. * @returns {Function} Returns the new accessor function.
  16051. * @example
  16052. *
  16053. * var objects = [
  16054. * { 'a': { 'b': 2 } },
  16055. * { 'a': { 'b': 1 } }
  16056. * ];
  16057. *
  16058. * _.map(objects, _.property('a.b'));
  16059. * // => [2, 1]
  16060. *
  16061. * _.map(_.sortBy(objects, _.property(['a', 'b'])), 'a.b');
  16062. * // => [1, 2]
  16063. */
  16064. function property(path) {
  16065. return isKey(path) ? baseProperty(toKey(path)) : basePropertyDeep(path);
  16066. }
  16067. /**
  16068. * The opposite of `_.property`; this method creates a function that returns
  16069. * the value at a given path of `object`.
  16070. *
  16071. * @static
  16072. * @memberOf _
  16073. * @since 3.0.0
  16074. * @category Util
  16075. * @param {Object} object The object to query.
  16076. * @returns {Function} Returns the new accessor function.
  16077. * @example
  16078. *
  16079. * var array = [0, 1, 2],
  16080. * object = { 'a': array, 'b': array, 'c': array };
  16081. *
  16082. * _.map(['a[2]', 'c[0]'], _.propertyOf(object));
  16083. * // => [2, 0]
  16084. *
  16085. * _.map([['a', '2'], ['c', '0']], _.propertyOf(object));
  16086. * // => [2, 0]
  16087. */
  16088. function propertyOf(object) {
  16089. return function(path) {
  16090. return object == null ? undefined : baseGet(object, path);
  16091. };
  16092. }
  16093. /**
  16094. * Creates an array of numbers (positive and/or negative) progressing from
  16095. * `start` up to, but not including, `end`. A step of `-1` is used if a negative
  16096. * `start` is specified without an `end` or `step`. If `end` is not specified,
  16097. * it's set to `start` with `start` then set to `0`.
  16098. *
  16099. * **Note:** JavaScript follows the IEEE-754 standard for resolving
  16100. * floating-point values which can produce unexpected results.
  16101. *
  16102. * @static
  16103. * @since 0.1.0
  16104. * @memberOf _
  16105. * @category Util
  16106. * @param {number} [start=0] The start of the range.
  16107. * @param {number} end The end of the range.
  16108. * @param {number} [step=1] The value to increment or decrement by.
  16109. * @returns {Array} Returns the range of numbers.
  16110. * @see _.inRange, _.rangeRight
  16111. * @example
  16112. *
  16113. * _.range(4);
  16114. * // => [0, 1, 2, 3]
  16115. *
  16116. * _.range(-4);
  16117. * // => [0, -1, -2, -3]
  16118. *
  16119. * _.range(1, 5);
  16120. * // => [1, 2, 3, 4]
  16121. *
  16122. * _.range(0, 20, 5);
  16123. * // => [0, 5, 10, 15]
  16124. *
  16125. * _.range(0, -4, -1);
  16126. * // => [0, -1, -2, -3]
  16127. *
  16128. * _.range(1, 4, 0);
  16129. * // => [1, 1, 1]
  16130. *
  16131. * _.range(0);
  16132. * // => []
  16133. */
  16134. var range = createRange();
  16135. /**
  16136. * This method is like `_.range` except that it populates values in
  16137. * descending order.
  16138. *
  16139. * @static
  16140. * @memberOf _
  16141. * @since 4.0.0
  16142. * @category Util
  16143. * @param {number} [start=0] The start of the range.
  16144. * @param {number} end The end of the range.
  16145. * @param {number} [step=1] The value to increment or decrement by.
  16146. * @returns {Array} Returns the range of numbers.
  16147. * @see _.inRange, _.range
  16148. * @example
  16149. *
  16150. * _.rangeRight(4);
  16151. * // => [3, 2, 1, 0]
  16152. *
  16153. * _.rangeRight(-4);
  16154. * // => [-3, -2, -1, 0]
  16155. *
  16156. * _.rangeRight(1, 5);
  16157. * // => [4, 3, 2, 1]
  16158. *
  16159. * _.rangeRight(0, 20, 5);
  16160. * // => [15, 10, 5, 0]
  16161. *
  16162. * _.rangeRight(0, -4, -1);
  16163. * // => [-3, -2, -1, 0]
  16164. *
  16165. * _.rangeRight(1, 4, 0);
  16166. * // => [1, 1, 1]
  16167. *
  16168. * _.rangeRight(0);
  16169. * // => []
  16170. */
  16171. var rangeRight = createRange(true);
  16172. /**
  16173. * This method returns a new empty array.
  16174. *
  16175. * @static
  16176. * @memberOf _
  16177. * @since 4.13.0
  16178. * @category Util
  16179. * @returns {Array} Returns the new empty array.
  16180. * @example
  16181. *
  16182. * var arrays = _.times(2, _.stubArray);
  16183. *
  16184. * console.log(arrays);
  16185. * // => [[], []]
  16186. *
  16187. * console.log(arrays[0] === arrays[1]);
  16188. * // => false
  16189. */
  16190. function stubArray() {
  16191. return [];
  16192. }
  16193. /**
  16194. * This method returns `false`.
  16195. *
  16196. * @static
  16197. * @memberOf _
  16198. * @since 4.13.0
  16199. * @category Util
  16200. * @returns {boolean} Returns `false`.
  16201. * @example
  16202. *
  16203. * _.times(2, _.stubFalse);
  16204. * // => [false, false]
  16205. */
  16206. function stubFalse() {
  16207. return false;
  16208. }
  16209. /**
  16210. * This method returns a new empty object.
  16211. *
  16212. * @static
  16213. * @memberOf _
  16214. * @since 4.13.0
  16215. * @category Util
  16216. * @returns {Object} Returns the new empty object.
  16217. * @example
  16218. *
  16219. * var objects = _.times(2, _.stubObject);
  16220. *
  16221. * console.log(objects);
  16222. * // => [{}, {}]
  16223. *
  16224. * console.log(objects[0] === objects[1]);
  16225. * // => false
  16226. */
  16227. function stubObject() {
  16228. return {};
  16229. }
  16230. /**
  16231. * This method returns an empty string.
  16232. *
  16233. * @static
  16234. * @memberOf _
  16235. * @since 4.13.0
  16236. * @category Util
  16237. * @returns {string} Returns the empty string.
  16238. * @example
  16239. *
  16240. * _.times(2, _.stubString);
  16241. * // => ['', '']
  16242. */
  16243. function stubString() {
  16244. return '';
  16245. }
  16246. /**
  16247. * This method returns `true`.
  16248. *
  16249. * @static
  16250. * @memberOf _
  16251. * @since 4.13.0
  16252. * @category Util
  16253. * @returns {boolean} Returns `true`.
  16254. * @example
  16255. *
  16256. * _.times(2, _.stubTrue);
  16257. * // => [true, true]
  16258. */
  16259. function stubTrue() {
  16260. return true;
  16261. }
  16262. /**
  16263. * Invokes the iteratee `n` times, returning an array of the results of
  16264. * each invocation. The iteratee is invoked with one argument; (index).
  16265. *
  16266. * @static
  16267. * @since 0.1.0
  16268. * @memberOf _
  16269. * @category Util
  16270. * @param {number} n The number of times to invoke `iteratee`.
  16271. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  16272. * @returns {Array} Returns the array of results.
  16273. * @example
  16274. *
  16275. * _.times(3, String);
  16276. * // => ['0', '1', '2']
  16277. *
  16278. * _.times(4, _.constant(0));
  16279. * // => [0, 0, 0, 0]
  16280. */
  16281. function times(n, iteratee) {
  16282. n = toInteger(n);
  16283. if (n < 1 || n > MAX_SAFE_INTEGER) {
  16284. return [];
  16285. }
  16286. var index = MAX_ARRAY_LENGTH,
  16287. length = nativeMin(n, MAX_ARRAY_LENGTH);
  16288. iteratee = getIteratee(iteratee);
  16289. n -= MAX_ARRAY_LENGTH;
  16290. var result = baseTimes(length, iteratee);
  16291. while (++index < n) {
  16292. iteratee(index);
  16293. }
  16294. return result;
  16295. }
  16296. /**
  16297. * Converts `value` to a property path array.
  16298. *
  16299. * @static
  16300. * @memberOf _
  16301. * @since 4.0.0
  16302. * @category Util
  16303. * @param {*} value The value to convert.
  16304. * @returns {Array} Returns the new property path array.
  16305. * @example
  16306. *
  16307. * _.toPath('a.b.c');
  16308. * // => ['a', 'b', 'c']
  16309. *
  16310. * _.toPath('a[0].b.c');
  16311. * // => ['a', '0', 'b', 'c']
  16312. */
  16313. function toPath(value) {
  16314. if (isArray(value)) {
  16315. return arrayMap(value, toKey);
  16316. }
  16317. return isSymbol(value) ? [value] : copyArray(stringToPath(toString(value)));
  16318. }
  16319. /**
  16320. * Generates a unique ID. If `prefix` is given, the ID is appended to it.
  16321. *
  16322. * @static
  16323. * @since 0.1.0
  16324. * @memberOf _
  16325. * @category Util
  16326. * @param {string} [prefix=''] The value to prefix the ID with.
  16327. * @returns {string} Returns the unique ID.
  16328. * @example
  16329. *
  16330. * _.uniqueId('contact_');
  16331. * // => 'contact_104'
  16332. *
  16333. * _.uniqueId();
  16334. * // => '105'
  16335. */
  16336. function uniqueId(prefix) {
  16337. var id = ++idCounter;
  16338. return toString(prefix) + id;
  16339. }
  16340. /*------------------------------------------------------------------------*/
  16341. /**
  16342. * Adds two numbers.
  16343. *
  16344. * @static
  16345. * @memberOf _
  16346. * @since 3.4.0
  16347. * @category Math
  16348. * @param {number} augend The first number in an addition.
  16349. * @param {number} addend The second number in an addition.
  16350. * @returns {number} Returns the total.
  16351. * @example
  16352. *
  16353. * _.add(6, 4);
  16354. * // => 10
  16355. */
  16356. var add = createMathOperation(function(augend, addend) {
  16357. return augend + addend;
  16358. }, 0);
  16359. /**
  16360. * Computes `number` rounded up to `precision`.
  16361. *
  16362. * @static
  16363. * @memberOf _
  16364. * @since 3.10.0
  16365. * @category Math
  16366. * @param {number} number The number to round up.
  16367. * @param {number} [precision=0] The precision to round up to.
  16368. * @returns {number} Returns the rounded up number.
  16369. * @example
  16370. *
  16371. * _.ceil(4.006);
  16372. * // => 5
  16373. *
  16374. * _.ceil(6.004, 2);
  16375. * // => 6.01
  16376. *
  16377. * _.ceil(6040, -2);
  16378. * // => 6100
  16379. */
  16380. var ceil = createRound('ceil');
  16381. /**
  16382. * Divide two numbers.
  16383. *
  16384. * @static
  16385. * @memberOf _
  16386. * @since 4.7.0
  16387. * @category Math
  16388. * @param {number} dividend The first number in a division.
  16389. * @param {number} divisor The second number in a division.
  16390. * @returns {number} Returns the quotient.
  16391. * @example
  16392. *
  16393. * _.divide(6, 4);
  16394. * // => 1.5
  16395. */
  16396. var divide = createMathOperation(function(dividend, divisor) {
  16397. return dividend / divisor;
  16398. }, 1);
  16399. /**
  16400. * Computes `number` rounded down to `precision`.
  16401. *
  16402. * @static
  16403. * @memberOf _
  16404. * @since 3.10.0
  16405. * @category Math
  16406. * @param {number} number The number to round down.
  16407. * @param {number} [precision=0] The precision to round down to.
  16408. * @returns {number} Returns the rounded down number.
  16409. * @example
  16410. *
  16411. * _.floor(4.006);
  16412. * // => 4
  16413. *
  16414. * _.floor(0.046, 2);
  16415. * // => 0.04
  16416. *
  16417. * _.floor(4060, -2);
  16418. * // => 4000
  16419. */
  16420. var floor = createRound('floor');
  16421. /**
  16422. * Computes the maximum value of `array`. If `array` is empty or falsey,
  16423. * `undefined` is returned.
  16424. *
  16425. * @static
  16426. * @since 0.1.0
  16427. * @memberOf _
  16428. * @category Math
  16429. * @param {Array} array The array to iterate over.
  16430. * @returns {*} Returns the maximum value.
  16431. * @example
  16432. *
  16433. * _.max([4, 2, 8, 6]);
  16434. * // => 8
  16435. *
  16436. * _.max([]);
  16437. * // => undefined
  16438. */
  16439. function max(array) {
  16440. return (array && array.length)
  16441. ? baseExtremum(array, identity, baseGt)
  16442. : undefined;
  16443. }
  16444. /**
  16445. * This method is like `_.max` except that it accepts `iteratee` which is
  16446. * invoked for each element in `array` to generate the criterion by which
  16447. * the value is ranked. The iteratee is invoked with one argument: (value).
  16448. *
  16449. * @static
  16450. * @memberOf _
  16451. * @since 4.0.0
  16452. * @category Math
  16453. * @param {Array} array The array to iterate over.
  16454. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  16455. * @returns {*} Returns the maximum value.
  16456. * @example
  16457. *
  16458. * var objects = [{ 'n': 1 }, { 'n': 2 }];
  16459. *
  16460. * _.maxBy(objects, function(o) { return o.n; });
  16461. * // => { 'n': 2 }
  16462. *
  16463. * // The `_.property` iteratee shorthand.
  16464. * _.maxBy(objects, 'n');
  16465. * // => { 'n': 2 }
  16466. */
  16467. function maxBy(array, iteratee) {
  16468. return (array && array.length)
  16469. ? baseExtremum(array, getIteratee(iteratee, 2), baseGt)
  16470. : undefined;
  16471. }
  16472. /**
  16473. * Computes the mean of the values in `array`.
  16474. *
  16475. * @static
  16476. * @memberOf _
  16477. * @since 4.0.0
  16478. * @category Math
  16479. * @param {Array} array The array to iterate over.
  16480. * @returns {number} Returns the mean.
  16481. * @example
  16482. *
  16483. * _.mean([4, 2, 8, 6]);
  16484. * // => 5
  16485. */
  16486. function mean(array) {
  16487. return baseMean(array, identity);
  16488. }
  16489. /**
  16490. * This method is like `_.mean` except that it accepts `iteratee` which is
  16491. * invoked for each element in `array` to generate the value to be averaged.
  16492. * The iteratee is invoked with one argument: (value).
  16493. *
  16494. * @static
  16495. * @memberOf _
  16496. * @since 4.7.0
  16497. * @category Math
  16498. * @param {Array} array The array to iterate over.
  16499. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  16500. * @returns {number} Returns the mean.
  16501. * @example
  16502. *
  16503. * var objects = [{ 'n': 4 }, { 'n': 2 }, { 'n': 8 }, { 'n': 6 }];
  16504. *
  16505. * _.meanBy(objects, function(o) { return o.n; });
  16506. * // => 5
  16507. *
  16508. * // The `_.property` iteratee shorthand.
  16509. * _.meanBy(objects, 'n');
  16510. * // => 5
  16511. */
  16512. function meanBy(array, iteratee) {
  16513. return baseMean(array, getIteratee(iteratee, 2));
  16514. }
  16515. /**
  16516. * Computes the minimum value of `array`. If `array` is empty or falsey,
  16517. * `undefined` is returned.
  16518. *
  16519. * @static
  16520. * @since 0.1.0
  16521. * @memberOf _
  16522. * @category Math
  16523. * @param {Array} array The array to iterate over.
  16524. * @returns {*} Returns the minimum value.
  16525. * @example
  16526. *
  16527. * _.min([4, 2, 8, 6]);
  16528. * // => 2
  16529. *
  16530. * _.min([]);
  16531. * // => undefined
  16532. */
  16533. function min(array) {
  16534. return (array && array.length)
  16535. ? baseExtremum(array, identity, baseLt)
  16536. : undefined;
  16537. }
  16538. /**
  16539. * This method is like `_.min` except that it accepts `iteratee` which is
  16540. * invoked for each element in `array` to generate the criterion by which
  16541. * the value is ranked. The iteratee is invoked with one argument: (value).
  16542. *
  16543. * @static
  16544. * @memberOf _
  16545. * @since 4.0.0
  16546. * @category Math
  16547. * @param {Array} array The array to iterate over.
  16548. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  16549. * @returns {*} Returns the minimum value.
  16550. * @example
  16551. *
  16552. * var objects = [{ 'n': 1 }, { 'n': 2 }];
  16553. *
  16554. * _.minBy(objects, function(o) { return o.n; });
  16555. * // => { 'n': 1 }
  16556. *
  16557. * // The `_.property` iteratee shorthand.
  16558. * _.minBy(objects, 'n');
  16559. * // => { 'n': 1 }
  16560. */
  16561. function minBy(array, iteratee) {
  16562. return (array && array.length)
  16563. ? baseExtremum(array, getIteratee(iteratee, 2), baseLt)
  16564. : undefined;
  16565. }
  16566. /**
  16567. * Multiply two numbers.
  16568. *
  16569. * @static
  16570. * @memberOf _
  16571. * @since 4.7.0
  16572. * @category Math
  16573. * @param {number} multiplier The first number in a multiplication.
  16574. * @param {number} multiplicand The second number in a multiplication.
  16575. * @returns {number} Returns the product.
  16576. * @example
  16577. *
  16578. * _.multiply(6, 4);
  16579. * // => 24
  16580. */
  16581. var multiply = createMathOperation(function(multiplier, multiplicand) {
  16582. return multiplier * multiplicand;
  16583. }, 1);
  16584. /**
  16585. * Computes `number` rounded to `precision`.
  16586. *
  16587. * @static
  16588. * @memberOf _
  16589. * @since 3.10.0
  16590. * @category Math
  16591. * @param {number} number The number to round.
  16592. * @param {number} [precision=0] The precision to round to.
  16593. * @returns {number} Returns the rounded number.
  16594. * @example
  16595. *
  16596. * _.round(4.006);
  16597. * // => 4
  16598. *
  16599. * _.round(4.006, 2);
  16600. * // => 4.01
  16601. *
  16602. * _.round(4060, -2);
  16603. * // => 4100
  16604. */
  16605. var round = createRound('round');
  16606. /**
  16607. * Subtract two numbers.
  16608. *
  16609. * @static
  16610. * @memberOf _
  16611. * @since 4.0.0
  16612. * @category Math
  16613. * @param {number} minuend The first number in a subtraction.
  16614. * @param {number} subtrahend The second number in a subtraction.
  16615. * @returns {number} Returns the difference.
  16616. * @example
  16617. *
  16618. * _.subtract(6, 4);
  16619. * // => 2
  16620. */
  16621. var subtract = createMathOperation(function(minuend, subtrahend) {
  16622. return minuend - subtrahend;
  16623. }, 0);
  16624. /**
  16625. * Computes the sum of the values in `array`.
  16626. *
  16627. * @static
  16628. * @memberOf _
  16629. * @since 3.4.0
  16630. * @category Math
  16631. * @param {Array} array The array to iterate over.
  16632. * @returns {number} Returns the sum.
  16633. * @example
  16634. *
  16635. * _.sum([4, 2, 8, 6]);
  16636. * // => 20
  16637. */
  16638. function sum(array) {
  16639. return (array && array.length)
  16640. ? baseSum(array, identity)
  16641. : 0;
  16642. }
  16643. /**
  16644. * This method is like `_.sum` except that it accepts `iteratee` which is
  16645. * invoked for each element in `array` to generate the value to be summed.
  16646. * The iteratee is invoked with one argument: (value).
  16647. *
  16648. * @static
  16649. * @memberOf _
  16650. * @since 4.0.0
  16651. * @category Math
  16652. * @param {Array} array The array to iterate over.
  16653. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  16654. * @returns {number} Returns the sum.
  16655. * @example
  16656. *
  16657. * var objects = [{ 'n': 4 }, { 'n': 2 }, { 'n': 8 }, { 'n': 6 }];
  16658. *
  16659. * _.sumBy(objects, function(o) { return o.n; });
  16660. * // => 20
  16661. *
  16662. * // The `_.property` iteratee shorthand.
  16663. * _.sumBy(objects, 'n');
  16664. * // => 20
  16665. */
  16666. function sumBy(array, iteratee) {
  16667. return (array && array.length)
  16668. ? baseSum(array, getIteratee(iteratee, 2))
  16669. : 0;
  16670. }
  16671. /*------------------------------------------------------------------------*/
  16672. // Add methods that return wrapped values in chain sequences.
  16673. lodash.after = after;
  16674. lodash.ary = ary;
  16675. lodash.assign = assign;
  16676. lodash.assignIn = assignIn;
  16677. lodash.assignInWith = assignInWith;
  16678. lodash.assignWith = assignWith;
  16679. lodash.at = at;
  16680. lodash.before = before;
  16681. lodash.bind = bind;
  16682. lodash.bindAll = bindAll;
  16683. lodash.bindKey = bindKey;
  16684. lodash.castArray = castArray;
  16685. lodash.chain = chain;
  16686. lodash.chunk = chunk;
  16687. lodash.compact = compact;
  16688. lodash.concat = concat;
  16689. lodash.cond = cond;
  16690. lodash.conforms = conforms;
  16691. lodash.constant = constant;
  16692. lodash.countBy = countBy;
  16693. lodash.create = create;
  16694. lodash.curry = curry;
  16695. lodash.curryRight = curryRight;
  16696. lodash.debounce = debounce;
  16697. lodash.defaults = defaults;
  16698. lodash.defaultsDeep = defaultsDeep;
  16699. lodash.defer = defer;
  16700. lodash.delay = delay;
  16701. lodash.difference = difference;
  16702. lodash.differenceBy = differenceBy;
  16703. lodash.differenceWith = differenceWith;
  16704. lodash.drop = drop;
  16705. lodash.dropRight = dropRight;
  16706. lodash.dropRightWhile = dropRightWhile;
  16707. lodash.dropWhile = dropWhile;
  16708. lodash.fill = fill;
  16709. lodash.filter = filter;
  16710. lodash.flatMap = flatMap;
  16711. lodash.flatMapDeep = flatMapDeep;
  16712. lodash.flatMapDepth = flatMapDepth;
  16713. lodash.flatten = flatten;
  16714. lodash.flattenDeep = flattenDeep;
  16715. lodash.flattenDepth = flattenDepth;
  16716. lodash.flip = flip;
  16717. lodash.flow = flow;
  16718. lodash.flowRight = flowRight;
  16719. lodash.fromPairs = fromPairs;
  16720. lodash.functions = functions;
  16721. lodash.functionsIn = functionsIn;
  16722. lodash.groupBy = groupBy;
  16723. lodash.initial = initial;
  16724. lodash.intersection = intersection;
  16725. lodash.intersectionBy = intersectionBy;
  16726. lodash.intersectionWith = intersectionWith;
  16727. lodash.invert = invert;
  16728. lodash.invertBy = invertBy;
  16729. lodash.invokeMap = invokeMap;
  16730. lodash.iteratee = iteratee;
  16731. lodash.keyBy = keyBy;
  16732. lodash.keys = keys;
  16733. lodash.keysIn = keysIn;
  16734. lodash.map = map;
  16735. lodash.mapKeys = mapKeys;
  16736. lodash.mapValues = mapValues;
  16737. lodash.matches = matches;
  16738. lodash.matchesProperty = matchesProperty;
  16739. lodash.memoize = memoize;
  16740. lodash.merge = merge;
  16741. lodash.mergeWith = mergeWith;
  16742. lodash.method = method;
  16743. lodash.methodOf = methodOf;
  16744. lodash.mixin = mixin;
  16745. lodash.negate = negate;
  16746. lodash.nthArg = nthArg;
  16747. lodash.omit = omit;
  16748. lodash.omitBy = omitBy;
  16749. lodash.once = once;
  16750. lodash.orderBy = orderBy;
  16751. lodash.over = over;
  16752. lodash.overArgs = overArgs;
  16753. lodash.overEvery = overEvery;
  16754. lodash.overSome = overSome;
  16755. lodash.partial = partial;
  16756. lodash.partialRight = partialRight;
  16757. lodash.partition = partition;
  16758. lodash.pick = pick;
  16759. lodash.pickBy = pickBy;
  16760. lodash.property = property;
  16761. lodash.propertyOf = propertyOf;
  16762. lodash.pull = pull;
  16763. lodash.pullAll = pullAll;
  16764. lodash.pullAllBy = pullAllBy;
  16765. lodash.pullAllWith = pullAllWith;
  16766. lodash.pullAt = pullAt;
  16767. lodash.range = range;
  16768. lodash.rangeRight = rangeRight;
  16769. lodash.rearg = rearg;
  16770. lodash.reject = reject;
  16771. lodash.remove = remove;
  16772. lodash.rest = rest;
  16773. lodash.reverse = reverse;
  16774. lodash.sampleSize = sampleSize;
  16775. lodash.set = set;
  16776. lodash.setWith = setWith;
  16777. lodash.shuffle = shuffle;
  16778. lodash.slice = slice;
  16779. lodash.sortBy = sortBy;
  16780. lodash.sortedUniq = sortedUniq;
  16781. lodash.sortedUniqBy = sortedUniqBy;
  16782. lodash.split = split;
  16783. lodash.spread = spread;
  16784. lodash.tail = tail;
  16785. lodash.take = take;
  16786. lodash.takeRight = takeRight;
  16787. lodash.takeRightWhile = takeRightWhile;
  16788. lodash.takeWhile = takeWhile;
  16789. lodash.tap = tap;
  16790. lodash.throttle = throttle;
  16791. lodash.thru = thru;
  16792. lodash.toArray = toArray;
  16793. lodash.toPairs = toPairs;
  16794. lodash.toPairsIn = toPairsIn;
  16795. lodash.toPath = toPath;
  16796. lodash.toPlainObject = toPlainObject;
  16797. lodash.transform = transform;
  16798. lodash.unary = unary;
  16799. lodash.union = union;
  16800. lodash.unionBy = unionBy;
  16801. lodash.unionWith = unionWith;
  16802. lodash.uniq = uniq;
  16803. lodash.uniqBy = uniqBy;
  16804. lodash.uniqWith = uniqWith;
  16805. lodash.unset = unset;
  16806. lodash.unzip = unzip;
  16807. lodash.unzipWith = unzipWith;
  16808. lodash.update = update;
  16809. lodash.updateWith = updateWith;
  16810. lodash.values = values;
  16811. lodash.valuesIn = valuesIn;
  16812. lodash.without = without;
  16813. lodash.words = words;
  16814. lodash.wrap = wrap;
  16815. lodash.xor = xor;
  16816. lodash.xorBy = xorBy;
  16817. lodash.xorWith = xorWith;
  16818. lodash.zip = zip;
  16819. lodash.zipObject = zipObject;
  16820. lodash.zipObjectDeep = zipObjectDeep;
  16821. lodash.zipWith = zipWith;
  16822. // Add aliases.
  16823. lodash.entries = toPairs;
  16824. lodash.entriesIn = toPairsIn;
  16825. lodash.extend = assignIn;
  16826. lodash.extendWith = assignInWith;
  16827. // Add methods to `lodash.prototype`.
  16828. mixin(lodash, lodash);
  16829. /*------------------------------------------------------------------------*/
  16830. // Add methods that return unwrapped values in chain sequences.
  16831. lodash.add = add;
  16832. lodash.attempt = attempt;
  16833. lodash.camelCase = camelCase;
  16834. lodash.capitalize = capitalize;
  16835. lodash.ceil = ceil;
  16836. lodash.clamp = clamp;
  16837. lodash.clone = clone;
  16838. lodash.cloneDeep = cloneDeep;
  16839. lodash.cloneDeepWith = cloneDeepWith;
  16840. lodash.cloneWith = cloneWith;
  16841. lodash.conformsTo = conformsTo;
  16842. lodash.deburr = deburr;
  16843. lodash.defaultTo = defaultTo;
  16844. lodash.divide = divide;
  16845. lodash.endsWith = endsWith;
  16846. lodash.eq = eq;
  16847. lodash.escape = escape;
  16848. lodash.escapeRegExp = escapeRegExp;
  16849. lodash.every = every;
  16850. lodash.find = find;
  16851. lodash.findIndex = findIndex;
  16852. lodash.findKey = findKey;
  16853. lodash.findLast = findLast;
  16854. lodash.findLastIndex = findLastIndex;
  16855. lodash.findLastKey = findLastKey;
  16856. lodash.floor = floor;
  16857. lodash.forEach = forEach;
  16858. lodash.forEachRight = forEachRight;
  16859. lodash.forIn = forIn;
  16860. lodash.forInRight = forInRight;
  16861. lodash.forOwn = forOwn;
  16862. lodash.forOwnRight = forOwnRight;
  16863. lodash.get = get;
  16864. lodash.gt = gt;
  16865. lodash.gte = gte;
  16866. lodash.has = has;
  16867. lodash.hasIn = hasIn;
  16868. lodash.head = head;
  16869. lodash.identity = identity;
  16870. lodash.includes = includes;
  16871. lodash.indexOf = indexOf;
  16872. lodash.inRange = inRange;
  16873. lodash.invoke = invoke;
  16874. lodash.isArguments = isArguments;
  16875. lodash.isArray = isArray;
  16876. lodash.isArrayBuffer = isArrayBuffer;
  16877. lodash.isArrayLike = isArrayLike;
  16878. lodash.isArrayLikeObject = isArrayLikeObject;
  16879. lodash.isBoolean = isBoolean;
  16880. lodash.isBuffer = isBuffer;
  16881. lodash.isDate = isDate;
  16882. lodash.isElement = isElement;
  16883. lodash.isEmpty = isEmpty;
  16884. lodash.isEqual = isEqual;
  16885. lodash.isEqualWith = isEqualWith;
  16886. lodash.isError = isError;
  16887. lodash.isFinite = isFinite;
  16888. lodash.isFunction = isFunction;
  16889. lodash.isInteger = isInteger;
  16890. lodash.isLength = isLength;
  16891. lodash.isMap = isMap;
  16892. lodash.isMatch = isMatch;
  16893. lodash.isMatchWith = isMatchWith;
  16894. lodash.isNaN = isNaN;
  16895. lodash.isNative = isNative;
  16896. lodash.isNil = isNil;
  16897. lodash.isNull = isNull;
  16898. lodash.isNumber = isNumber;
  16899. lodash.isObject = isObject;
  16900. lodash.isObjectLike = isObjectLike;
  16901. lodash.isPlainObject = isPlainObject;
  16902. lodash.isRegExp = isRegExp;
  16903. lodash.isSafeInteger = isSafeInteger;
  16904. lodash.isSet = isSet;
  16905. lodash.isString = isString;
  16906. lodash.isSymbol = isSymbol;
  16907. lodash.isTypedArray = isTypedArray;
  16908. lodash.isUndefined = isUndefined;
  16909. lodash.isWeakMap = isWeakMap;
  16910. lodash.isWeakSet = isWeakSet;
  16911. lodash.join = join;
  16912. lodash.kebabCase = kebabCase;
  16913. lodash.last = last;
  16914. lodash.lastIndexOf = lastIndexOf;
  16915. lodash.lowerCase = lowerCase;
  16916. lodash.lowerFirst = lowerFirst;
  16917. lodash.lt = lt;
  16918. lodash.lte = lte;
  16919. lodash.max = max;
  16920. lodash.maxBy = maxBy;
  16921. lodash.mean = mean;
  16922. lodash.meanBy = meanBy;
  16923. lodash.min = min;
  16924. lodash.minBy = minBy;
  16925. lodash.stubArray = stubArray;
  16926. lodash.stubFalse = stubFalse;
  16927. lodash.stubObject = stubObject;
  16928. lodash.stubString = stubString;
  16929. lodash.stubTrue = stubTrue;
  16930. lodash.multiply = multiply;
  16931. lodash.nth = nth;
  16932. lodash.noConflict = noConflict;
  16933. lodash.noop = noop;
  16934. lodash.now = now;
  16935. lodash.pad = pad;
  16936. lodash.padEnd = padEnd;
  16937. lodash.padStart = padStart;
  16938. lodash.parseInt = parseInt;
  16939. lodash.random = random;
  16940. lodash.reduce = reduce;
  16941. lodash.reduceRight = reduceRight;
  16942. lodash.repeat = repeat;
  16943. lodash.replace = replace;
  16944. lodash.result = result;
  16945. lodash.round = round;
  16946. lodash.runInContext = runInContext;
  16947. lodash.sample = sample;
  16948. lodash.size = size;
  16949. lodash.snakeCase = snakeCase;
  16950. lodash.some = some;
  16951. lodash.sortedIndex = sortedIndex;
  16952. lodash.sortedIndexBy = sortedIndexBy;
  16953. lodash.sortedIndexOf = sortedIndexOf;
  16954. lodash.sortedLastIndex = sortedLastIndex;
  16955. lodash.sortedLastIndexBy = sortedLastIndexBy;
  16956. lodash.sortedLastIndexOf = sortedLastIndexOf;
  16957. lodash.startCase = startCase;
  16958. lodash.startsWith = startsWith;
  16959. lodash.subtract = subtract;
  16960. lodash.sum = sum;
  16961. lodash.sumBy = sumBy;
  16962. lodash.template = template;
  16963. lodash.times = times;
  16964. lodash.toFinite = toFinite;
  16965. lodash.toInteger = toInteger;
  16966. lodash.toLength = toLength;
  16967. lodash.toLower = toLower;
  16968. lodash.toNumber = toNumber;
  16969. lodash.toSafeInteger = toSafeInteger;
  16970. lodash.toString = toString;
  16971. lodash.toUpper = toUpper;
  16972. lodash.trim = trim;
  16973. lodash.trimEnd = trimEnd;
  16974. lodash.trimStart = trimStart;
  16975. lodash.truncate = truncate;
  16976. lodash.unescape = unescape;
  16977. lodash.uniqueId = uniqueId;
  16978. lodash.upperCase = upperCase;
  16979. lodash.upperFirst = upperFirst;
  16980. // Add aliases.
  16981. lodash.each = forEach;
  16982. lodash.eachRight = forEachRight;
  16983. lodash.first = head;
  16984. mixin(lodash, (function() {
  16985. var source = {};
  16986. baseForOwn(lodash, function(func, methodName) {
  16987. if (!hasOwnProperty.call(lodash.prototype, methodName)) {
  16988. source[methodName] = func;
  16989. }
  16990. });
  16991. return source;
  16992. }()), { 'chain': false });
  16993. /*------------------------------------------------------------------------*/
  16994. /**
  16995. * The semantic version number.
  16996. *
  16997. * @static
  16998. * @memberOf _
  16999. * @type {string}
  17000. */
  17001. lodash.VERSION = VERSION;
  17002. // Assign default placeholders.
  17003. arrayEach(['bind', 'bindKey', 'curry', 'curryRight', 'partial', 'partialRight'], function(methodName) {
  17004. lodash[methodName].placeholder = lodash;
  17005. });
  17006. // Add `LazyWrapper` methods for `_.drop` and `_.take` variants.
  17007. arrayEach(['drop', 'take'], function(methodName, index) {
  17008. LazyWrapper.prototype[methodName] = function(n) {
  17009. n = n === undefined ? 1 : nativeMax(toInteger(n), 0);
  17010. var result = (this.__filtered__ && !index)
  17011. ? new LazyWrapper(this)
  17012. : this.clone();
  17013. if (result.__filtered__) {
  17014. result.__takeCount__ = nativeMin(n, result.__takeCount__);
  17015. } else {
  17016. result.__views__.push({
  17017. 'size': nativeMin(n, MAX_ARRAY_LENGTH),
  17018. 'type': methodName + (result.__dir__ < 0 ? 'Right' : '')
  17019. });
  17020. }
  17021. return result;
  17022. };
  17023. LazyWrapper.prototype[methodName + 'Right'] = function(n) {
  17024. return this.reverse()[methodName](n).reverse();
  17025. };
  17026. });
  17027. // Add `LazyWrapper` methods that accept an `iteratee` value.
  17028. arrayEach(['filter', 'map', 'takeWhile'], function(methodName, index) {
  17029. var type = index + 1,
  17030. isFilter = type == LAZY_FILTER_FLAG || type == LAZY_WHILE_FLAG;
  17031. LazyWrapper.prototype[methodName] = function(iteratee) {
  17032. var result = this.clone();
  17033. result.__iteratees__.push({
  17034. 'iteratee': getIteratee(iteratee, 3),
  17035. 'type': type
  17036. });
  17037. result.__filtered__ = result.__filtered__ || isFilter;
  17038. return result;
  17039. };
  17040. });
  17041. // Add `LazyWrapper` methods for `_.head` and `_.last`.
  17042. arrayEach(['head', 'last'], function(methodName, index) {
  17043. var takeName = 'take' + (index ? 'Right' : '');
  17044. LazyWrapper.prototype[methodName] = function() {
  17045. return this[takeName](1).value()[0];
  17046. };
  17047. });
  17048. // Add `LazyWrapper` methods for `_.initial` and `_.tail`.
  17049. arrayEach(['initial', 'tail'], function(methodName, index) {
  17050. var dropName = 'drop' + (index ? '' : 'Right');
  17051. LazyWrapper.prototype[methodName] = function() {
  17052. return this.__filtered__ ? new LazyWrapper(this) : this[dropName](1);
  17053. };
  17054. });
  17055. LazyWrapper.prototype.compact = function() {
  17056. return this.filter(identity);
  17057. };
  17058. LazyWrapper.prototype.find = function(predicate) {
  17059. return this.filter(predicate).head();
  17060. };
  17061. LazyWrapper.prototype.findLast = function(predicate) {
  17062. return this.reverse().find(predicate);
  17063. };
  17064. LazyWrapper.prototype.invokeMap = baseRest(function(path, args) {
  17065. if (typeof path == 'function') {
  17066. return new LazyWrapper(this);
  17067. }
  17068. return this.map(function(value) {
  17069. return baseInvoke(value, path, args);
  17070. });
  17071. });
  17072. LazyWrapper.prototype.reject = function(predicate) {
  17073. return this.filter(negate(getIteratee(predicate)));
  17074. };
  17075. LazyWrapper.prototype.slice = function(start, end) {
  17076. start = toInteger(start);
  17077. var result = this;
  17078. if (result.__filtered__ && (start > 0 || end < 0)) {
  17079. return new LazyWrapper(result);
  17080. }
  17081. if (start < 0) {
  17082. result = result.takeRight(-start);
  17083. } else if (start) {
  17084. result = result.drop(start);
  17085. }
  17086. if (end !== undefined) {
  17087. end = toInteger(end);
  17088. result = end < 0 ? result.dropRight(-end) : result.take(end - start);
  17089. }
  17090. return result;
  17091. };
  17092. LazyWrapper.prototype.takeRightWhile = function(predicate) {
  17093. return this.reverse().takeWhile(predicate).reverse();
  17094. };
  17095. LazyWrapper.prototype.toArray = function() {
  17096. return this.take(MAX_ARRAY_LENGTH);
  17097. };
  17098. // Add `LazyWrapper` methods to `lodash.prototype`.
  17099. baseForOwn(LazyWrapper.prototype, function(func, methodName) {
  17100. var checkIteratee = /^(?:filter|find|map|reject)|While$/.test(methodName),
  17101. isTaker = /^(?:head|last)$/.test(methodName),
  17102. lodashFunc = lodash[isTaker ? ('take' + (methodName == 'last' ? 'Right' : '')) : methodName],
  17103. retUnwrapped = isTaker || /^find/.test(methodName);
  17104. if (!lodashFunc) {
  17105. return;
  17106. }
  17107. lodash.prototype[methodName] = function() {
  17108. var value = this.__wrapped__,
  17109. args = isTaker ? [1] : arguments,
  17110. isLazy = value instanceof LazyWrapper,
  17111. iteratee = args[0],
  17112. useLazy = isLazy || isArray(value);
  17113. var interceptor = function(value) {
  17114. var result = lodashFunc.apply(lodash, arrayPush([value], args));
  17115. return (isTaker && chainAll) ? result[0] : result;
  17116. };
  17117. if (useLazy && checkIteratee && typeof iteratee == 'function' && iteratee.length != 1) {
  17118. // Avoid lazy use if the iteratee has a "length" value other than `1`.
  17119. isLazy = useLazy = false;
  17120. }
  17121. var chainAll = this.__chain__,
  17122. isHybrid = !!this.__actions__.length,
  17123. isUnwrapped = retUnwrapped && !chainAll,
  17124. onlyLazy = isLazy && !isHybrid;
  17125. if (!retUnwrapped && useLazy) {
  17126. value = onlyLazy ? value : new LazyWrapper(this);
  17127. var result = func.apply(value, args);
  17128. result.__actions__.push({ 'func': thru, 'args': [interceptor], 'thisArg': undefined });
  17129. return new LodashWrapper(result, chainAll);
  17130. }
  17131. if (isUnwrapped && onlyLazy) {
  17132. return func.apply(this, args);
  17133. }
  17134. result = this.thru(interceptor);
  17135. return isUnwrapped ? (isTaker ? result.value()[0] : result.value()) : result;
  17136. };
  17137. });
  17138. // Add `Array` methods to `lodash.prototype`.
  17139. arrayEach(['pop', 'push', 'shift', 'sort', 'splice', 'unshift'], function(methodName) {
  17140. var func = arrayProto[methodName],
  17141. chainName = /^(?:push|sort|unshift)$/.test(methodName) ? 'tap' : 'thru',
  17142. retUnwrapped = /^(?:pop|shift)$/.test(methodName);
  17143. lodash.prototype[methodName] = function() {
  17144. var args = arguments;
  17145. if (retUnwrapped && !this.__chain__) {
  17146. var value = this.value();
  17147. return func.apply(isArray(value) ? value : [], args);
  17148. }
  17149. return this[chainName](function(value) {
  17150. return func.apply(isArray(value) ? value : [], args);
  17151. });
  17152. };
  17153. });
  17154. // Map minified method names to their real names.
  17155. baseForOwn(LazyWrapper.prototype, function(func, methodName) {
  17156. var lodashFunc = lodash[methodName];
  17157. if (lodashFunc) {
  17158. var key = lodashFunc.name + '';
  17159. if (!hasOwnProperty.call(realNames, key)) {
  17160. realNames[key] = [];
  17161. }
  17162. realNames[key].push({ 'name': methodName, 'func': lodashFunc });
  17163. }
  17164. });
  17165. realNames[createHybrid(undefined, WRAP_BIND_KEY_FLAG).name] = [{
  17166. 'name': 'wrapper',
  17167. 'func': undefined
  17168. }];
  17169. // Add methods to `LazyWrapper`.
  17170. LazyWrapper.prototype.clone = lazyClone;
  17171. LazyWrapper.prototype.reverse = lazyReverse;
  17172. LazyWrapper.prototype.value = lazyValue;
  17173. // Add chain sequence methods to the `lodash` wrapper.
  17174. lodash.prototype.at = wrapperAt;
  17175. lodash.prototype.chain = wrapperChain;
  17176. lodash.prototype.commit = wrapperCommit;
  17177. lodash.prototype.next = wrapperNext;
  17178. lodash.prototype.plant = wrapperPlant;
  17179. lodash.prototype.reverse = wrapperReverse;
  17180. lodash.prototype.toJSON = lodash.prototype.valueOf = lodash.prototype.value = wrapperValue;
  17181. // Add lazy aliases.
  17182. lodash.prototype.first = lodash.prototype.head;
  17183. if (symIterator) {
  17184. lodash.prototype[symIterator] = wrapperToIterator;
  17185. }
  17186. return lodash;
  17187. });
  17188. /*--------------------------------------------------------------------------*/
  17189. // Export lodash.
  17190. var _ = runInContext();
  17191. // Some AMD build optimizers, like r.js, check for condition patterns like:
  17192. if (true) {
  17193. // Expose Lodash on the global object to prevent errors when Lodash is
  17194. // loaded by a script tag in the presence of an AMD loader.
  17195. // See http://requirejs.org/docs/errors.html#mismatch for more details.
  17196. // Use `_.noConflict` to remove Lodash from the global object.
  17197. root._ = _;
  17198. // Define as an anonymous module so, through path mapping, it can be
  17199. // referenced as the "underscore" module.
  17200. !(__WEBPACK_AMD_DEFINE_RESULT__ = (function() {
  17201. return _;
  17202. }).call(exports, __webpack_require__, exports, module),
  17203. __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
  17204. }
  17205. // Check for `exports` after `define` in case a build optimizer adds it.
  17206. else {}
  17207. }.call(this));
  17208. /***/ }),
  17209. /***/ "./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":
  17210. /*!***************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  17211. !*** ./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 ***!
  17212. \***************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  17213. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17214. "use strict";
  17215. __webpack_require__.r(__webpack_exports__);
  17216. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17217. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17218. /* harmony export */ });
  17219. /* 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");
  17220. /* 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__);
  17221. /* 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");
  17222. var options = {};
  17223. options.insert = "head";
  17224. options.singleton = false;
  17225. 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);
  17226. /* 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 || {});
  17227. /***/ }),
  17228. /***/ "./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":
  17229. /*!****************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  17230. !*** ./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 ***!
  17231. \****************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  17232. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17233. "use strict";
  17234. __webpack_require__.r(__webpack_exports__);
  17235. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17236. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17237. /* harmony export */ });
  17238. /* 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");
  17239. /* 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__);
  17240. /* 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");
  17241. var options = {};
  17242. options.insert = "head";
  17243. options.singleton = false;
  17244. 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);
  17245. /* 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 || {});
  17246. /***/ }),
  17247. /***/ "./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":
  17248. /*!*******************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  17249. !*** ./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 ***!
  17250. \*******************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  17251. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17252. "use strict";
  17253. __webpack_require__.r(__webpack_exports__);
  17254. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17255. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17256. /* harmony export */ });
  17257. /* 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");
  17258. /* 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__);
  17259. /* 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");
  17260. var options = {};
  17261. options.insert = "head";
  17262. options.singleton = false;
  17263. 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);
  17264. /* 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 || {});
  17265. /***/ }),
  17266. /***/ "./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":
  17267. /*!***************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  17268. !*** ./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 ***!
  17269. \***************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  17270. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17271. "use strict";
  17272. __webpack_require__.r(__webpack_exports__);
  17273. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17274. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17275. /* harmony export */ });
  17276. /* 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");
  17277. /* 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__);
  17278. /* 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");
  17279. var options = {};
  17280. options.insert = "head";
  17281. options.singleton = false;
  17282. 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);
  17283. /* 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 || {});
  17284. /***/ }),
  17285. /***/ "./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":
  17286. /*!******************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  17287. !*** ./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 ***!
  17288. \******************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  17289. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17290. "use strict";
  17291. __webpack_require__.r(__webpack_exports__);
  17292. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17293. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17294. /* harmony export */ });
  17295. /* 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");
  17296. /* 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__);
  17297. /* 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");
  17298. var options = {};
  17299. options.insert = "head";
  17300. options.singleton = false;
  17301. 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);
  17302. /* 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 || {});
  17303. /***/ }),
  17304. /***/ "./node_modules/vue-loader/dist/exportHelper.js":
  17305. /*!******************************************************!*\
  17306. !*** ./node_modules/vue-loader/dist/exportHelper.js ***!
  17307. \******************************************************/
  17308. /***/ ((__unused_webpack_module, exports) => {
  17309. "use strict";
  17310. Object.defineProperty(exports, "__esModule", ({ value: true }));
  17311. // runtime helper for setting properties on components
  17312. // in a tree-shakable way
  17313. exports["default"] = (sfc, props) => {
  17314. const target = sfc.__vccOpts || sfc;
  17315. for (const [key, val] of props) {
  17316. target[key] = val;
  17317. }
  17318. return target;
  17319. };
  17320. /***/ }),
  17321. /***/ "./resources/js/components/AppFooter.vue":
  17322. /*!***********************************************!*\
  17323. !*** ./resources/js/components/AppFooter.vue ***!
  17324. \***********************************************/
  17325. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17326. "use strict";
  17327. __webpack_require__.r(__webpack_exports__);
  17328. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17329. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17330. /* harmony export */ });
  17331. /* 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");
  17332. /* 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");
  17333. /* 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");
  17334. const script = {}
  17335. ;
  17336. 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"]])
  17337. /* hot reload */
  17338. if (false) {}
  17339. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__);
  17340. /***/ }),
  17341. /***/ "./resources/js/components/AppMessage.vue":
  17342. /*!************************************************!*\
  17343. !*** ./resources/js/components/AppMessage.vue ***!
  17344. \************************************************/
  17345. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17346. "use strict";
  17347. __webpack_require__.r(__webpack_exports__);
  17348. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17349. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17350. /* harmony export */ });
  17351. /* 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");
  17352. /* 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");
  17353. /* 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");
  17354. ;
  17355. 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"]])
  17356. /* hot reload */
  17357. if (false) {}
  17358. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__);
  17359. /***/ }),
  17360. /***/ "./resources/js/components/AppSidebar.vue":
  17361. /*!************************************************!*\
  17362. !*** ./resources/js/components/AppSidebar.vue ***!
  17363. \************************************************/
  17364. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17365. "use strict";
  17366. __webpack_require__.r(__webpack_exports__);
  17367. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17368. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17369. /* harmony export */ });
  17370. /* 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");
  17371. /* 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");
  17372. /* 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");
  17373. /* 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");
  17374. ;
  17375. 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"]])
  17376. /* hot reload */
  17377. if (false) {}
  17378. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__);
  17379. /***/ }),
  17380. /***/ "./resources/js/components/AppSubSidebar.vue":
  17381. /*!***************************************************!*\
  17382. !*** ./resources/js/components/AppSubSidebar.vue ***!
  17383. \***************************************************/
  17384. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17385. "use strict";
  17386. __webpack_require__.r(__webpack_exports__);
  17387. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17388. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17389. /* harmony export */ });
  17390. /* 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");
  17391. /* 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");
  17392. /* 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");
  17393. /* 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");
  17394. ;
  17395. 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"]])
  17396. /* hot reload */
  17397. if (false) {}
  17398. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__);
  17399. /***/ }),
  17400. /***/ "./resources/js/components/AppTopBar.vue":
  17401. /*!***********************************************!*\
  17402. !*** ./resources/js/components/AppTopBar.vue ***!
  17403. \***********************************************/
  17404. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17405. "use strict";
  17406. __webpack_require__.r(__webpack_exports__);
  17407. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17408. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17409. /* harmony export */ });
  17410. /* 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");
  17411. /* 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");
  17412. /* 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");
  17413. /* 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");
  17414. ;
  17415. 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"]])
  17416. /* hot reload */
  17417. if (false) {}
  17418. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__);
  17419. /***/ }),
  17420. /***/ "./resources/js/layouts/DashboardLayout.vue":
  17421. /*!**************************************************!*\
  17422. !*** ./resources/js/layouts/DashboardLayout.vue ***!
  17423. \**************************************************/
  17424. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17425. "use strict";
  17426. __webpack_require__.r(__webpack_exports__);
  17427. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17428. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17429. /* harmony export */ });
  17430. /* 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");
  17431. /* 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");
  17432. /* 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");
  17433. /* 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");
  17434. ;
  17435. 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"]])
  17436. /* hot reload */
  17437. if (false) {}
  17438. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__);
  17439. /***/ }),
  17440. /***/ "./resources/js/pages/home/Index.vue":
  17441. /*!*******************************************!*\
  17442. !*** ./resources/js/pages/home/Index.vue ***!
  17443. \*******************************************/
  17444. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17445. "use strict";
  17446. __webpack_require__.r(__webpack_exports__);
  17447. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17448. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17449. /* harmony export */ });
  17450. /* 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");
  17451. /* 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");
  17452. /* 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");
  17453. ;
  17454. 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"]])
  17455. /* hot reload */
  17456. if (false) {}
  17457. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__);
  17458. /***/ }),
  17459. /***/ "./resources/js/components/AppMessage.vue?vue&type=script&setup=true&lang=js":
  17460. /*!***********************************************************************************!*\
  17461. !*** ./resources/js/components/AppMessage.vue?vue&type=script&setup=true&lang=js ***!
  17462. \***********************************************************************************/
  17463. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17464. "use strict";
  17465. __webpack_require__.r(__webpack_exports__);
  17466. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17467. /* 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"])
  17468. /* harmony export */ });
  17469. /* 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");
  17470. /***/ }),
  17471. /***/ "./resources/js/components/AppSidebar.vue?vue&type=script&setup=true&lang=js":
  17472. /*!***********************************************************************************!*\
  17473. !*** ./resources/js/components/AppSidebar.vue?vue&type=script&setup=true&lang=js ***!
  17474. \***********************************************************************************/
  17475. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17476. "use strict";
  17477. __webpack_require__.r(__webpack_exports__);
  17478. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17479. /* 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"])
  17480. /* harmony export */ });
  17481. /* 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");
  17482. /***/ }),
  17483. /***/ "./resources/js/components/AppSubSidebar.vue?vue&type=script&setup=true&lang=js":
  17484. /*!**************************************************************************************!*\
  17485. !*** ./resources/js/components/AppSubSidebar.vue?vue&type=script&setup=true&lang=js ***!
  17486. \**************************************************************************************/
  17487. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17488. "use strict";
  17489. __webpack_require__.r(__webpack_exports__);
  17490. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17491. /* 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"])
  17492. /* harmony export */ });
  17493. /* 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");
  17494. /***/ }),
  17495. /***/ "./resources/js/components/AppTopBar.vue?vue&type=script&setup=true&lang=js":
  17496. /*!**********************************************************************************!*\
  17497. !*** ./resources/js/components/AppTopBar.vue?vue&type=script&setup=true&lang=js ***!
  17498. \**********************************************************************************/
  17499. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17500. "use strict";
  17501. __webpack_require__.r(__webpack_exports__);
  17502. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17503. /* 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"])
  17504. /* harmony export */ });
  17505. /* 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");
  17506. /***/ }),
  17507. /***/ "./resources/js/layouts/DashboardLayout.vue?vue&type=script&setup=true&lang=js":
  17508. /*!*************************************************************************************!*\
  17509. !*** ./resources/js/layouts/DashboardLayout.vue?vue&type=script&setup=true&lang=js ***!
  17510. \*************************************************************************************/
  17511. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17512. "use strict";
  17513. __webpack_require__.r(__webpack_exports__);
  17514. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17515. /* 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"])
  17516. /* harmony export */ });
  17517. /* 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");
  17518. /***/ }),
  17519. /***/ "./resources/js/pages/home/Index.vue?vue&type=script&setup=true&lang=js":
  17520. /*!******************************************************************************!*\
  17521. !*** ./resources/js/pages/home/Index.vue?vue&type=script&setup=true&lang=js ***!
  17522. \******************************************************************************/
  17523. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17524. "use strict";
  17525. __webpack_require__.r(__webpack_exports__);
  17526. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17527. /* 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"])
  17528. /* harmony export */ });
  17529. /* 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");
  17530. /***/ }),
  17531. /***/ "./resources/js/components/AppFooter.vue?vue&type=template&id=4ab6097e&scoped=true":
  17532. /*!*****************************************************************************************!*\
  17533. !*** ./resources/js/components/AppFooter.vue?vue&type=template&id=4ab6097e&scoped=true ***!
  17534. \*****************************************************************************************/
  17535. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17536. "use strict";
  17537. __webpack_require__.r(__webpack_exports__);
  17538. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17539. /* 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)
  17540. /* harmony export */ });
  17541. /* 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");
  17542. /***/ }),
  17543. /***/ "./resources/js/components/AppMessage.vue?vue&type=template&id=07159051":
  17544. /*!******************************************************************************!*\
  17545. !*** ./resources/js/components/AppMessage.vue?vue&type=template&id=07159051 ***!
  17546. \******************************************************************************/
  17547. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17548. "use strict";
  17549. __webpack_require__.r(__webpack_exports__);
  17550. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17551. /* 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)
  17552. /* harmony export */ });
  17553. /* 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");
  17554. /***/ }),
  17555. /***/ "./resources/js/components/AppSidebar.vue?vue&type=template&id=22a4e926&scoped=true":
  17556. /*!******************************************************************************************!*\
  17557. !*** ./resources/js/components/AppSidebar.vue?vue&type=template&id=22a4e926&scoped=true ***!
  17558. \******************************************************************************************/
  17559. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17560. "use strict";
  17561. __webpack_require__.r(__webpack_exports__);
  17562. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17563. /* 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)
  17564. /* harmony export */ });
  17565. /* 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");
  17566. /***/ }),
  17567. /***/ "./resources/js/components/AppSubSidebar.vue?vue&type=template&id=0addd9bc&scoped=true":
  17568. /*!*********************************************************************************************!*\
  17569. !*** ./resources/js/components/AppSubSidebar.vue?vue&type=template&id=0addd9bc&scoped=true ***!
  17570. \*********************************************************************************************/
  17571. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17572. "use strict";
  17573. __webpack_require__.r(__webpack_exports__);
  17574. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17575. /* 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)
  17576. /* harmony export */ });
  17577. /* 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");
  17578. /***/ }),
  17579. /***/ "./resources/js/components/AppTopBar.vue?vue&type=template&id=42bf62a4&scoped=true":
  17580. /*!*****************************************************************************************!*\
  17581. !*** ./resources/js/components/AppTopBar.vue?vue&type=template&id=42bf62a4&scoped=true ***!
  17582. \*****************************************************************************************/
  17583. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17584. "use strict";
  17585. __webpack_require__.r(__webpack_exports__);
  17586. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17587. /* 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)
  17588. /* harmony export */ });
  17589. /* 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");
  17590. /***/ }),
  17591. /***/ "./resources/js/layouts/DashboardLayout.vue?vue&type=template&id=549bf5ac&scoped=true":
  17592. /*!********************************************************************************************!*\
  17593. !*** ./resources/js/layouts/DashboardLayout.vue?vue&type=template&id=549bf5ac&scoped=true ***!
  17594. \********************************************************************************************/
  17595. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17596. "use strict";
  17597. __webpack_require__.r(__webpack_exports__);
  17598. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17599. /* 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)
  17600. /* harmony export */ });
  17601. /* 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");
  17602. /***/ }),
  17603. /***/ "./resources/js/pages/home/Index.vue?vue&type=template&id=9329f6aa":
  17604. /*!*************************************************************************!*\
  17605. !*** ./resources/js/pages/home/Index.vue?vue&type=template&id=9329f6aa ***!
  17606. \*************************************************************************/
  17607. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17608. "use strict";
  17609. __webpack_require__.r(__webpack_exports__);
  17610. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17611. /* 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)
  17612. /* harmony export */ });
  17613. /* 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");
  17614. /***/ }),
  17615. /***/ "./resources/js/components/AppFooter.vue?vue&type=style&index=0&id=4ab6097e&lang=scss&scoped=true":
  17616. /*!********************************************************************************************************!*\
  17617. !*** ./resources/js/components/AppFooter.vue?vue&type=style&index=0&id=4ab6097e&lang=scss&scoped=true ***!
  17618. \********************************************************************************************************/
  17619. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17620. "use strict";
  17621. __webpack_require__.r(__webpack_exports__);
  17622. /* 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");
  17623. /***/ }),
  17624. /***/ "./resources/js/components/AppSidebar.vue?vue&type=style&index=0&id=22a4e926&lang=scss&scoped=true":
  17625. /*!*********************************************************************************************************!*\
  17626. !*** ./resources/js/components/AppSidebar.vue?vue&type=style&index=0&id=22a4e926&lang=scss&scoped=true ***!
  17627. \*********************************************************************************************************/
  17628. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17629. "use strict";
  17630. __webpack_require__.r(__webpack_exports__);
  17631. /* 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");
  17632. /***/ }),
  17633. /***/ "./resources/js/components/AppSubSidebar.vue?vue&type=style&index=0&id=0addd9bc&lang=scss&scoped=true":
  17634. /*!************************************************************************************************************!*\
  17635. !*** ./resources/js/components/AppSubSidebar.vue?vue&type=style&index=0&id=0addd9bc&lang=scss&scoped=true ***!
  17636. \************************************************************************************************************/
  17637. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17638. "use strict";
  17639. __webpack_require__.r(__webpack_exports__);
  17640. /* 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");
  17641. /***/ }),
  17642. /***/ "./resources/js/components/AppTopBar.vue?vue&type=style&index=0&id=42bf62a4&lang=scss&scoped=true":
  17643. /*!********************************************************************************************************!*\
  17644. !*** ./resources/js/components/AppTopBar.vue?vue&type=style&index=0&id=42bf62a4&lang=scss&scoped=true ***!
  17645. \********************************************************************************************************/
  17646. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17647. "use strict";
  17648. __webpack_require__.r(__webpack_exports__);
  17649. /* 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");
  17650. /***/ }),
  17651. /***/ "./resources/js/layouts/DashboardLayout.vue?vue&type=style&index=0&id=549bf5ac&lang=scss&scoped=true":
  17652. /*!***********************************************************************************************************!*\
  17653. !*** ./resources/js/layouts/DashboardLayout.vue?vue&type=style&index=0&id=549bf5ac&lang=scss&scoped=true ***!
  17654. \***********************************************************************************************************/
  17655. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17656. "use strict";
  17657. __webpack_require__.r(__webpack_exports__);
  17658. /* 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");
  17659. /***/ })
  17660. }]);