resources_js_pages_Suppliers_Index_vue.js 697KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316531753185319532053215322532353245325532653275328532953305331533253335334533553365337533853395340534153425343534453455346534753485349535053515352535353545355535653575358535953605361536253635364536553665367536853695370537153725373537453755376537753785379538053815382538353845385538653875388538953905391539253935394539553965397539853995400540154025403540454055406540754085409541054115412541354145415541654175418541954205421542254235424542554265427542854295430543154325433543454355436543754385439544054415442544354445445544654475448544954505451545254535454545554565457545854595460546154625463546454655466546754685469547054715472547354745475547654775478547954805481548254835484548554865487548854895490549154925493549454955496549754985499550055015502550355045505550655075508550955105511551255135514551555165517551855195520552155225523552455255526552755285529553055315532553355345535553655375538553955405541554255435544554555465547554855495550555155525553555455555556555755585559556055615562556355645565556655675568556955705571557255735574557555765577557855795580558155825583558455855586558755885589559055915592559355945595559655975598559956005601560256035604560556065607560856095610561156125613561456155616561756185619562056215622562356245625562656275628562956305631563256335634563556365637563856395640564156425643564456455646564756485649565056515652565356545655565656575658565956605661566256635664566556665667566856695670567156725673567456755676567756785679568056815682568356845685568656875688568956905691569256935694569556965697569856995700570157025703570457055706570757085709571057115712571357145715571657175718571957205721572257235724572557265727572857295730573157325733573457355736573757385739574057415742574357445745574657475748574957505751575257535754575557565757575857595760576157625763576457655766576757685769577057715772577357745775577657775778577957805781578257835784578557865787578857895790579157925793579457955796579757985799580058015802580358045805580658075808580958105811581258135814581558165817581858195820582158225823582458255826582758285829583058315832583358345835583658375838583958405841584258435844584558465847584858495850585158525853585458555856585758585859586058615862586358645865586658675868586958705871587258735874587558765877587858795880588158825883588458855886588758885889589058915892589358945895589658975898589959005901590259035904590559065907590859095910591159125913591459155916591759185919592059215922592359245925592659275928592959305931593259335934593559365937593859395940594159425943594459455946594759485949595059515952595359545955595659575958595959605961596259635964596559665967596859695970597159725973597459755976597759785979598059815982598359845985598659875988598959905991599259935994599559965997599859996000600160026003600460056006600760086009601060116012601360146015601660176018601960206021602260236024602560266027602860296030603160326033603460356036603760386039604060416042604360446045604660476048604960506051605260536054605560566057605860596060606160626063606460656066606760686069607060716072607360746075607660776078607960806081608260836084608560866087608860896090609160926093609460956096609760986099610061016102610361046105610661076108610961106111611261136114611561166117611861196120612161226123612461256126612761286129613061316132613361346135613661376138613961406141614261436144614561466147614861496150615161526153615461556156615761586159616061616162616361646165616661676168616961706171617261736174617561766177617861796180618161826183618461856186618761886189619061916192619361946195619661976198619962006201620262036204620562066207620862096210621162126213621462156216621762186219622062216222622362246225622662276228622962306231623262336234623562366237623862396240624162426243624462456246624762486249625062516252625362546255625662576258625962606261626262636264626562666267626862696270627162726273627462756276627762786279628062816282628362846285628662876288628962906291629262936294629562966297629862996300630163026303630463056306630763086309631063116312631363146315631663176318631963206321632263236324632563266327632863296330633163326333633463356336633763386339634063416342634363446345634663476348634963506351635263536354635563566357635863596360636163626363636463656366636763686369637063716372637363746375637663776378637963806381638263836384638563866387638863896390639163926393639463956396639763986399640064016402640364046405640664076408640964106411641264136414641564166417641864196420642164226423642464256426642764286429643064316432643364346435643664376438643964406441644264436444644564466447644864496450645164526453645464556456645764586459646064616462646364646465646664676468646964706471647264736474647564766477647864796480648164826483648464856486648764886489649064916492649364946495649664976498649965006501650265036504650565066507650865096510651165126513651465156516651765186519652065216522652365246525652665276528652965306531653265336534653565366537653865396540654165426543654465456546654765486549655065516552655365546555655665576558655965606561656265636564656565666567656865696570657165726573657465756576657765786579658065816582658365846585658665876588658965906591659265936594659565966597659865996600660166026603660466056606660766086609661066116612661366146615661666176618661966206621662266236624662566266627662866296630663166326633663466356636663766386639664066416642664366446645664666476648664966506651665266536654665566566657665866596660666166626663666466656666666766686669667066716672667366746675667666776678667966806681668266836684668566866687668866896690669166926693669466956696669766986699670067016702670367046705670667076708670967106711671267136714671567166717671867196720672167226723672467256726672767286729673067316732673367346735673667376738673967406741674267436744674567466747674867496750675167526753675467556756675767586759676067616762676367646765676667676768676967706771677267736774677567766777677867796780678167826783678467856786678767886789679067916792679367946795679667976798679968006801680268036804680568066807680868096810681168126813681468156816681768186819682068216822682368246825682668276828682968306831683268336834683568366837683868396840684168426843684468456846684768486849685068516852685368546855685668576858685968606861686268636864686568666867686868696870687168726873687468756876687768786879688068816882688368846885688668876888688968906891689268936894689568966897689868996900690169026903690469056906690769086909691069116912691369146915691669176918691969206921692269236924692569266927692869296930693169326933693469356936693769386939694069416942694369446945694669476948694969506951695269536954695569566957695869596960696169626963696469656966696769686969697069716972697369746975697669776978697969806981698269836984698569866987698869896990699169926993699469956996699769986999700070017002700370047005700670077008700970107011701270137014701570167017701870197020702170227023702470257026702770287029703070317032703370347035703670377038703970407041704270437044704570467047704870497050705170527053705470557056705770587059706070617062706370647065706670677068706970707071707270737074707570767077707870797080708170827083708470857086708770887089709070917092709370947095709670977098709971007101710271037104710571067107710871097110711171127113711471157116711771187119712071217122712371247125712671277128712971307131713271337134713571367137713871397140714171427143714471457146714771487149715071517152715371547155715671577158715971607161716271637164716571667167716871697170717171727173717471757176717771787179718071817182718371847185718671877188718971907191719271937194719571967197719871997200720172027203720472057206720772087209721072117212721372147215721672177218721972207221722272237224722572267227722872297230723172327233723472357236723772387239724072417242724372447245724672477248724972507251725272537254725572567257725872597260726172627263726472657266726772687269727072717272727372747275727672777278727972807281728272837284728572867287728872897290729172927293729472957296729772987299730073017302730373047305730673077308730973107311731273137314731573167317731873197320732173227323732473257326732773287329733073317332733373347335733673377338733973407341734273437344734573467347734873497350735173527353735473557356735773587359736073617362736373647365736673677368736973707371737273737374737573767377737873797380738173827383738473857386738773887389739073917392739373947395739673977398739974007401740274037404740574067407740874097410741174127413741474157416741774187419742074217422742374247425742674277428742974307431743274337434743574367437743874397440744174427443744474457446744774487449745074517452745374547455745674577458745974607461746274637464746574667467746874697470747174727473747474757476747774787479748074817482748374847485748674877488748974907491749274937494749574967497749874997500750175027503750475057506750775087509751075117512751375147515751675177518751975207521752275237524752575267527752875297530753175327533753475357536753775387539754075417542754375447545754675477548754975507551755275537554755575567557755875597560756175627563756475657566756775687569757075717572757375747575757675777578757975807581758275837584758575867587758875897590759175927593759475957596759775987599760076017602760376047605760676077608760976107611761276137614761576167617761876197620762176227623762476257626762776287629763076317632763376347635763676377638763976407641764276437644764576467647764876497650765176527653765476557656765776587659766076617662766376647665766676677668766976707671767276737674767576767677767876797680768176827683768476857686768776887689769076917692769376947695769676977698769977007701770277037704770577067707770877097710771177127713771477157716771777187719772077217722772377247725772677277728772977307731773277337734773577367737773877397740774177427743774477457746774777487749775077517752775377547755775677577758775977607761776277637764776577667767776877697770777177727773777477757776777777787779778077817782778377847785778677877788778977907791779277937794779577967797779877997800780178027803780478057806780778087809781078117812781378147815781678177818781978207821782278237824782578267827782878297830783178327833783478357836783778387839784078417842784378447845784678477848784978507851785278537854785578567857785878597860786178627863786478657866786778687869787078717872787378747875787678777878787978807881788278837884788578867887788878897890789178927893789478957896789778987899790079017902790379047905790679077908790979107911791279137914791579167917791879197920792179227923792479257926792779287929793079317932793379347935793679377938793979407941794279437944794579467947794879497950795179527953795479557956795779587959796079617962796379647965796679677968796979707971797279737974797579767977797879797980798179827983798479857986798779887989799079917992799379947995799679977998799980008001800280038004800580068007800880098010801180128013801480158016801780188019802080218022802380248025802680278028802980308031803280338034803580368037803880398040804180428043804480458046804780488049805080518052805380548055805680578058805980608061806280638064806580668067806880698070807180728073807480758076807780788079808080818082808380848085808680878088808980908091809280938094809580968097809880998100810181028103810481058106810781088109811081118112811381148115811681178118811981208121812281238124812581268127812881298130813181328133813481358136813781388139814081418142814381448145814681478148814981508151815281538154815581568157815881598160816181628163816481658166816781688169817081718172817381748175817681778178817981808181818281838184818581868187818881898190819181928193819481958196819781988199820082018202820382048205820682078208820982108211821282138214821582168217821882198220822182228223822482258226822782288229823082318232823382348235823682378238823982408241824282438244824582468247824882498250825182528253825482558256825782588259826082618262826382648265826682678268826982708271827282738274827582768277827882798280828182828283828482858286828782888289829082918292829382948295829682978298829983008301830283038304830583068307830883098310831183128313831483158316831783188319832083218322832383248325832683278328832983308331833283338334833583368337833883398340834183428343834483458346834783488349835083518352835383548355835683578358835983608361836283638364836583668367836883698370837183728373837483758376837783788379838083818382838383848385838683878388838983908391839283938394839583968397839883998400840184028403840484058406840784088409841084118412841384148415841684178418841984208421842284238424842584268427842884298430843184328433843484358436843784388439844084418442844384448445844684478448844984508451845284538454845584568457845884598460846184628463846484658466846784688469847084718472847384748475847684778478847984808481848284838484848584868487848884898490849184928493849484958496849784988499850085018502850385048505850685078508850985108511851285138514851585168517851885198520852185228523852485258526852785288529853085318532853385348535853685378538853985408541854285438544854585468547854885498550855185528553855485558556855785588559856085618562856385648565856685678568856985708571857285738574857585768577857885798580858185828583858485858586858785888589859085918592859385948595859685978598859986008601860286038604860586068607860886098610861186128613861486158616861786188619862086218622862386248625862686278628862986308631863286338634863586368637863886398640864186428643864486458646864786488649865086518652865386548655865686578658865986608661866286638664866586668667866886698670867186728673867486758676867786788679868086818682868386848685868686878688868986908691869286938694869586968697869886998700870187028703870487058706870787088709871087118712871387148715871687178718871987208721872287238724872587268727872887298730873187328733873487358736873787388739874087418742874387448745874687478748874987508751875287538754875587568757875887598760876187628763876487658766876787688769877087718772877387748775877687778778877987808781878287838784878587868787878887898790879187928793879487958796879787988799880088018802880388048805880688078808880988108811881288138814881588168817881888198820882188228823882488258826882788288829883088318832883388348835883688378838883988408841884288438844884588468847884888498850885188528853885488558856885788588859886088618862886388648865886688678868886988708871887288738874887588768877887888798880888188828883888488858886888788888889889088918892889388948895889688978898889989008901890289038904890589068907890889098910891189128913891489158916891789188919892089218922892389248925892689278928892989308931893289338934893589368937893889398940894189428943894489458946894789488949895089518952895389548955895689578958895989608961896289638964896589668967896889698970897189728973897489758976897789788979898089818982898389848985898689878988898989908991899289938994899589968997899889999000900190029003900490059006900790089009901090119012901390149015901690179018901990209021902290239024902590269027902890299030903190329033903490359036903790389039904090419042904390449045904690479048904990509051905290539054905590569057905890599060906190629063906490659066906790689069907090719072907390749075907690779078907990809081908290839084908590869087908890899090909190929093909490959096909790989099910091019102910391049105910691079108910991109111911291139114911591169117911891199120912191229123912491259126912791289129913091319132913391349135913691379138913991409141914291439144914591469147914891499150915191529153915491559156915791589159916091619162916391649165916691679168916991709171917291739174917591769177917891799180918191829183918491859186918791889189919091919192919391949195919691979198919992009201920292039204920592069207920892099210921192129213921492159216921792189219922092219222922392249225922692279228922992309231923292339234923592369237923892399240924192429243924492459246924792489249925092519252925392549255925692579258925992609261926292639264926592669267926892699270927192729273927492759276927792789279928092819282928392849285928692879288928992909291929292939294929592969297929892999300930193029303930493059306930793089309931093119312931393149315931693179318931993209321932293239324932593269327932893299330933193329333933493359336933793389339934093419342934393449345934693479348934993509351935293539354935593569357935893599360936193629363936493659366936793689369937093719372937393749375937693779378937993809381938293839384938593869387938893899390939193929393939493959396939793989399940094019402940394049405940694079408940994109411941294139414941594169417941894199420942194229423942494259426942794289429943094319432943394349435943694379438943994409441944294439444944594469447944894499450945194529453945494559456945794589459946094619462946394649465946694679468946994709471947294739474947594769477947894799480948194829483948494859486948794889489949094919492949394949495949694979498949995009501950295039504950595069507950895099510951195129513951495159516951795189519952095219522952395249525952695279528952995309531953295339534953595369537953895399540954195429543954495459546954795489549955095519552955395549555955695579558955995609561956295639564956595669567956895699570957195729573957495759576957795789579958095819582958395849585958695879588958995909591959295939594959595969597959895999600960196029603960496059606960796089609961096119612961396149615961696179618961996209621962296239624962596269627962896299630963196329633963496359636963796389639964096419642964396449645964696479648964996509651965296539654965596569657965896599660966196629663966496659666966796689669967096719672967396749675967696779678967996809681968296839684968596869687968896899690969196929693969496959696969796989699970097019702970397049705970697079708970997109711971297139714971597169717971897199720972197229723972497259726972797289729973097319732973397349735973697379738973997409741974297439744974597469747974897499750975197529753975497559756975797589759976097619762976397649765976697679768976997709771977297739774977597769777977897799780978197829783978497859786978797889789979097919792979397949795979697979798979998009801980298039804980598069807980898099810981198129813981498159816981798189819982098219822982398249825982698279828982998309831983298339834983598369837983898399840984198429843984498459846984798489849985098519852985398549855985698579858985998609861986298639864986598669867986898699870987198729873987498759876987798789879988098819882988398849885988698879888988998909891989298939894989598969897989898999900990199029903990499059906990799089909991099119912991399149915991699179918991999209921992299239924992599269927992899299930993199329933993499359936993799389939994099419942994399449945994699479948994999509951995299539954995599569957995899599960996199629963996499659966996799689969997099719972997399749975997699779978997999809981998299839984998599869987998899899990999199929993999499959996999799989999100001000110002100031000410005100061000710008100091001010011100121001310014100151001610017100181001910020100211002210023100241002510026100271002810029100301003110032100331003410035100361003710038100391004010041100421004310044100451004610047100481004910050100511005210053100541005510056100571005810059100601006110062100631006410065100661006710068100691007010071100721007310074100751007610077100781007910080100811008210083100841008510086100871008810089100901009110092100931009410095100961009710098100991010010101101021010310104101051010610107101081010910110101111011210113101141011510116101171011810119101201012110122101231012410125101261012710128101291013010131101321013310134101351013610137101381013910140101411014210143101441014510146101471014810149101501015110152101531015410155101561015710158101591016010161101621016310164101651016610167101681016910170101711017210173101741017510176101771017810179101801018110182101831018410185101861018710188101891019010191101921019310194101951019610197101981019910200102011020210203102041020510206102071020810209102101021110212102131021410215102161021710218102191022010221102221022310224102251022610227102281022910230102311023210233102341023510236102371023810239102401024110242102431024410245102461024710248102491025010251102521025310254102551025610257102581025910260102611026210263102641026510266102671026810269102701027110272102731027410275102761027710278102791028010281102821028310284102851028610287102881028910290102911029210293102941029510296102971029810299103001030110302103031030410305103061030710308103091031010311103121031310314103151031610317103181031910320103211032210323103241032510326103271032810329103301033110332103331033410335103361033710338103391034010341103421034310344103451034610347103481034910350103511035210353103541035510356103571035810359103601036110362103631036410365103661036710368103691037010371103721037310374103751037610377103781037910380103811038210383103841038510386103871038810389103901039110392103931039410395103961039710398103991040010401104021040310404104051040610407104081040910410104111041210413104141041510416104171041810419104201042110422104231042410425104261042710428104291043010431104321043310434104351043610437104381043910440104411044210443104441044510446104471044810449104501045110452104531045410455104561045710458104591046010461104621046310464104651046610467104681046910470104711047210473104741047510476104771047810479104801048110482104831048410485104861048710488104891049010491104921049310494104951049610497104981049910500105011050210503105041050510506105071050810509105101051110512105131051410515105161051710518105191052010521105221052310524105251052610527105281052910530105311053210533105341053510536105371053810539105401054110542105431054410545105461054710548105491055010551105521055310554105551055610557105581055910560105611056210563105641056510566105671056810569105701057110572105731057410575105761057710578105791058010581105821058310584105851058610587105881058910590105911059210593105941059510596105971059810599106001060110602106031060410605106061060710608106091061010611106121061310614106151061610617106181061910620106211062210623106241062510626106271062810629106301063110632106331063410635106361063710638106391064010641106421064310644106451064610647106481064910650106511065210653106541065510656106571065810659106601066110662106631066410665106661066710668106691067010671106721067310674106751067610677106781067910680106811068210683106841068510686106871068810689106901069110692106931069410695106961069710698106991070010701107021070310704107051070610707107081070910710107111071210713107141071510716107171071810719107201072110722107231072410725107261072710728107291073010731107321073310734107351073610737107381073910740107411074210743107441074510746107471074810749107501075110752107531075410755107561075710758107591076010761107621076310764107651076610767107681076910770107711077210773107741077510776107771077810779107801078110782107831078410785107861078710788107891079010791107921079310794107951079610797107981079910800108011080210803108041080510806108071080810809108101081110812108131081410815108161081710818108191082010821108221082310824108251082610827108281082910830108311083210833108341083510836108371083810839108401084110842108431084410845108461084710848108491085010851108521085310854108551085610857108581085910860108611086210863108641086510866108671086810869108701087110872108731087410875108761087710878108791088010881108821088310884108851088610887108881088910890108911089210893108941089510896108971089810899109001090110902109031090410905109061090710908109091091010911109121091310914109151091610917109181091910920109211092210923109241092510926109271092810929109301093110932109331093410935109361093710938109391094010941109421094310944109451094610947109481094910950109511095210953109541095510956109571095810959109601096110962109631096410965109661096710968109691097010971109721097310974109751097610977109781097910980109811098210983109841098510986109871098810989109901099110992109931099410995109961099710998109991100011001110021100311004110051100611007110081100911010110111101211013110141101511016110171101811019110201102111022110231102411025110261102711028110291103011031110321103311034110351103611037110381103911040110411104211043110441104511046110471104811049110501105111052110531105411055110561105711058110591106011061110621106311064110651106611067110681106911070110711107211073110741107511076110771107811079110801108111082110831108411085110861108711088110891109011091110921109311094110951109611097110981109911100111011110211103111041110511106111071110811109111101111111112111131111411115111161111711118111191112011121111221112311124111251112611127111281112911130111311113211133111341113511136111371113811139111401114111142111431114411145111461114711148111491115011151111521115311154111551115611157111581115911160111611116211163111641116511166111671116811169111701117111172111731117411175111761117711178111791118011181111821118311184111851118611187111881118911190111911119211193111941119511196111971119811199112001120111202112031120411205112061120711208112091121011211112121121311214112151121611217112181121911220112211122211223112241122511226112271122811229112301123111232112331123411235112361123711238112391124011241112421124311244112451124611247112481124911250112511125211253112541125511256112571125811259112601126111262112631126411265112661126711268112691127011271112721127311274112751127611277112781127911280112811128211283112841128511286112871128811289112901129111292112931129411295112961129711298112991130011301113021130311304113051130611307113081130911310113111131211313113141131511316113171131811319113201132111322113231132411325113261132711328113291133011331113321133311334113351133611337113381133911340113411134211343113441134511346113471134811349113501135111352113531135411355113561135711358113591136011361113621136311364113651136611367113681136911370113711137211373113741137511376113771137811379113801138111382113831138411385113861138711388113891139011391113921139311394113951139611397113981139911400114011140211403114041140511406114071140811409114101141111412114131141411415114161141711418114191142011421114221142311424114251142611427114281142911430114311143211433114341143511436114371143811439114401144111442114431144411445114461144711448114491145011451114521145311454114551145611457114581145911460114611146211463114641146511466114671146811469114701147111472114731147411475114761147711478114791148011481114821148311484114851148611487114881148911490114911149211493114941149511496114971149811499115001150111502115031150411505115061150711508115091151011511115121151311514115151151611517115181151911520115211152211523115241152511526115271152811529115301153111532115331153411535115361153711538115391154011541115421154311544115451154611547115481154911550115511155211553115541155511556115571155811559115601156111562115631156411565115661156711568115691157011571115721157311574115751157611577115781157911580115811158211583115841158511586115871158811589115901159111592115931159411595115961159711598115991160011601116021160311604116051160611607116081160911610116111161211613116141161511616116171161811619116201162111622116231162411625116261162711628116291163011631116321163311634116351163611637116381163911640116411164211643116441164511646116471164811649116501165111652116531165411655116561165711658116591166011661116621166311664116651166611667116681166911670116711167211673116741167511676116771167811679116801168111682116831168411685116861168711688116891169011691116921169311694116951169611697116981169911700117011170211703117041170511706117071170811709117101171111712117131171411715117161171711718117191172011721117221172311724117251172611727117281172911730117311173211733117341173511736117371173811739117401174111742117431174411745117461174711748117491175011751117521175311754117551175611757117581175911760117611176211763117641176511766117671176811769117701177111772117731177411775117761177711778117791178011781117821178311784117851178611787117881178911790117911179211793117941179511796117971179811799118001180111802118031180411805118061180711808118091181011811118121181311814118151181611817118181181911820118211182211823118241182511826118271182811829118301183111832118331183411835118361183711838118391184011841118421184311844118451184611847118481184911850118511185211853118541185511856118571185811859118601186111862118631186411865118661186711868118691187011871118721187311874118751187611877118781187911880118811188211883118841188511886118871188811889118901189111892118931189411895118961189711898118991190011901119021190311904119051190611907119081190911910119111191211913119141191511916119171191811919119201192111922119231192411925119261192711928119291193011931119321193311934119351193611937119381193911940119411194211943119441194511946119471194811949119501195111952119531195411955119561195711958119591196011961119621196311964119651196611967119681196911970119711197211973119741197511976119771197811979119801198111982119831198411985119861198711988119891199011991119921199311994119951199611997119981199912000120011200212003120041200512006120071200812009120101201112012120131201412015120161201712018120191202012021120221202312024120251202612027120281202912030120311203212033120341203512036120371203812039120401204112042120431204412045120461204712048120491205012051120521205312054120551205612057120581205912060120611206212063120641206512066120671206812069120701207112072120731207412075120761207712078120791208012081120821208312084120851208612087120881208912090120911209212093120941209512096120971209812099121001210112102121031210412105121061210712108121091211012111121121211312114121151211612117121181211912120121211212212123121241212512126121271212812129121301213112132121331213412135121361213712138121391214012141121421214312144121451214612147121481214912150121511215212153121541215512156121571215812159121601216112162121631216412165121661216712168121691217012171121721217312174121751217612177121781217912180121811218212183121841218512186121871218812189121901219112192121931219412195121961219712198121991220012201122021220312204122051220612207122081220912210122111221212213122141221512216122171221812219122201222112222122231222412225122261222712228122291223012231122321223312234122351223612237122381223912240122411224212243122441224512246122471224812249122501225112252122531225412255122561225712258122591226012261122621226312264122651226612267122681226912270122711227212273122741227512276122771227812279122801228112282122831228412285122861228712288122891229012291122921229312294122951229612297122981229912300123011230212303123041230512306123071230812309123101231112312123131231412315123161231712318123191232012321123221232312324123251232612327123281232912330123311233212333123341233512336123371233812339123401234112342123431234412345123461234712348123491235012351123521235312354123551235612357123581235912360123611236212363123641236512366123671236812369123701237112372123731237412375123761237712378123791238012381123821238312384123851238612387123881238912390123911239212393123941239512396123971239812399124001240112402124031240412405124061240712408124091241012411124121241312414124151241612417124181241912420124211242212423124241242512426124271242812429124301243112432124331243412435124361243712438124391244012441124421244312444124451244612447124481244912450124511245212453124541245512456124571245812459124601246112462124631246412465124661246712468124691247012471124721247312474124751247612477124781247912480124811248212483124841248512486124871248812489124901249112492124931249412495124961249712498124991250012501125021250312504125051250612507125081250912510125111251212513125141251512516125171251812519125201252112522125231252412525125261252712528125291253012531125321253312534125351253612537125381253912540125411254212543125441254512546125471254812549125501255112552125531255412555125561255712558125591256012561125621256312564125651256612567125681256912570125711257212573125741257512576125771257812579125801258112582125831258412585125861258712588125891259012591125921259312594125951259612597125981259912600126011260212603126041260512606126071260812609126101261112612126131261412615126161261712618126191262012621126221262312624126251262612627126281262912630126311263212633126341263512636126371263812639126401264112642126431264412645126461264712648126491265012651126521265312654126551265612657126581265912660126611266212663126641266512666126671266812669126701267112672126731267412675126761267712678126791268012681126821268312684126851268612687126881268912690126911269212693126941269512696126971269812699127001270112702127031270412705127061270712708127091271012711127121271312714127151271612717127181271912720127211272212723127241272512726127271272812729127301273112732127331273412735127361273712738127391274012741127421274312744127451274612747127481274912750127511275212753127541275512756127571275812759127601276112762127631276412765127661276712768127691277012771127721277312774127751277612777127781277912780127811278212783127841278512786127871278812789127901279112792127931279412795127961279712798127991280012801128021280312804128051280612807128081280912810128111281212813128141281512816128171281812819128201282112822128231282412825128261282712828128291283012831128321283312834128351283612837128381283912840128411284212843128441284512846128471284812849128501285112852128531285412855128561285712858128591286012861128621286312864128651286612867128681286912870128711287212873128741287512876128771287812879128801288112882128831288412885128861288712888128891289012891128921289312894128951289612897128981289912900129011290212903129041290512906129071290812909129101291112912129131291412915129161291712918129191292012921129221292312924129251292612927129281292912930129311293212933129341293512936129371293812939129401294112942129431294412945129461294712948129491295012951129521295312954129551295612957129581295912960129611296212963129641296512966129671296812969129701297112972129731297412975129761297712978129791298012981129821298312984129851298612987129881298912990129911299212993129941299512996129971299812999130001300113002130031300413005130061300713008130091301013011130121301313014130151301613017130181301913020130211302213023130241302513026130271302813029130301303113032130331303413035130361303713038130391304013041130421304313044130451304613047130481304913050130511305213053130541305513056130571305813059130601306113062130631306413065130661306713068130691307013071130721307313074130751307613077130781307913080130811308213083130841308513086130871308813089130901309113092130931309413095130961309713098130991310013101131021310313104131051310613107131081310913110131111311213113131141311513116131171311813119131201312113122131231312413125131261312713128131291313013131131321313313134131351313613137131381313913140131411314213143131441314513146131471314813149131501315113152131531315413155131561315713158131591316013161131621316313164131651316613167131681316913170131711317213173131741317513176131771317813179131801318113182131831318413185131861318713188131891319013191131921319313194131951319613197131981319913200132011320213203132041320513206132071320813209132101321113212132131321413215132161321713218132191322013221132221322313224132251322613227132281322913230132311323213233132341323513236132371323813239132401324113242132431324413245132461324713248132491325013251132521325313254132551325613257132581325913260132611326213263132641326513266132671326813269132701327113272132731327413275132761327713278132791328013281132821328313284132851328613287132881328913290132911329213293132941329513296132971329813299133001330113302133031330413305133061330713308133091331013311133121331313314133151331613317133181331913320133211332213323133241332513326133271332813329133301333113332133331333413335133361333713338133391334013341133421334313344133451334613347133481334913350133511335213353133541335513356133571335813359133601336113362133631336413365133661336713368133691337013371133721337313374133751337613377133781337913380133811338213383133841338513386133871338813389133901339113392133931339413395133961339713398133991340013401134021340313404134051340613407134081340913410134111341213413134141341513416134171341813419134201342113422134231342413425134261342713428134291343013431134321343313434134351343613437134381343913440134411344213443134441344513446134471344813449134501345113452134531345413455134561345713458134591346013461134621346313464134651346613467134681346913470134711347213473134741347513476134771347813479134801348113482134831348413485134861348713488134891349013491134921349313494134951349613497134981349913500135011350213503135041350513506135071350813509135101351113512135131351413515135161351713518135191352013521135221352313524135251352613527135281352913530135311353213533135341353513536135371353813539135401354113542135431354413545135461354713548135491355013551135521355313554135551355613557135581355913560135611356213563135641356513566135671356813569135701357113572135731357413575135761357713578135791358013581135821358313584135851358613587135881358913590135911359213593135941359513596135971359813599136001360113602136031360413605136061360713608136091361013611136121361313614136151361613617136181361913620136211362213623136241362513626136271362813629136301363113632136331363413635136361363713638136391364013641136421364313644136451364613647136481364913650136511365213653136541365513656136571365813659136601366113662136631366413665136661366713668136691367013671136721367313674136751367613677136781367913680136811368213683136841368513686136871368813689136901369113692136931369413695136961369713698136991370013701137021370313704137051370613707137081370913710137111371213713137141371513716137171371813719137201372113722137231372413725137261372713728137291373013731137321373313734137351373613737137381373913740137411374213743137441374513746137471374813749137501375113752137531375413755137561375713758137591376013761137621376313764137651376613767137681376913770137711377213773137741377513776137771377813779137801378113782137831378413785137861378713788137891379013791137921379313794137951379613797137981379913800138011380213803138041380513806138071380813809138101381113812138131381413815138161381713818138191382013821138221382313824138251382613827138281382913830138311383213833138341383513836138371383813839138401384113842138431384413845138461384713848138491385013851138521385313854138551385613857138581385913860138611386213863138641386513866138671386813869138701387113872138731387413875138761387713878138791388013881138821388313884138851388613887138881388913890138911389213893138941389513896138971389813899139001390113902139031390413905139061390713908139091391013911139121391313914139151391613917139181391913920139211392213923139241392513926139271392813929139301393113932139331393413935139361393713938139391394013941139421394313944139451394613947139481394913950139511395213953139541395513956139571395813959139601396113962139631396413965139661396713968139691397013971139721397313974139751397613977139781397913980139811398213983139841398513986139871398813989139901399113992139931399413995139961399713998139991400014001140021400314004140051400614007140081400914010140111401214013140141401514016140171401814019140201402114022140231402414025140261402714028140291403014031140321403314034140351403614037140381403914040140411404214043140441404514046140471404814049140501405114052140531405414055140561405714058140591406014061140621406314064140651406614067140681406914070140711407214073140741407514076140771407814079140801408114082140831408414085140861408714088140891409014091140921409314094140951409614097140981409914100141011410214103141041410514106141071410814109141101411114112141131411414115141161411714118141191412014121141221412314124141251412614127141281412914130141311413214133141341413514136141371413814139141401414114142141431414414145141461414714148141491415014151141521415314154141551415614157141581415914160141611416214163141641416514166141671416814169141701417114172141731417414175141761417714178141791418014181141821418314184141851418614187141881418914190141911419214193141941419514196141971419814199142001420114202142031420414205142061420714208142091421014211142121421314214142151421614217142181421914220142211422214223142241422514226142271422814229142301423114232142331423414235142361423714238142391424014241142421424314244142451424614247142481424914250142511425214253142541425514256142571425814259142601426114262142631426414265142661426714268142691427014271142721427314274142751427614277142781427914280142811428214283142841428514286142871428814289142901429114292142931429414295142961429714298142991430014301143021430314304143051430614307143081430914310143111431214313143141431514316143171431814319143201432114322143231432414325143261432714328143291433014331143321433314334143351433614337143381433914340143411434214343143441434514346143471434814349143501435114352143531435414355143561435714358143591436014361143621436314364143651436614367143681436914370143711437214373143741437514376143771437814379143801438114382143831438414385143861438714388143891439014391143921439314394143951439614397143981439914400144011440214403144041440514406144071440814409144101441114412144131441414415144161441714418144191442014421144221442314424144251442614427144281442914430144311443214433144341443514436144371443814439144401444114442144431444414445144461444714448144491445014451144521445314454144551445614457144581445914460144611446214463144641446514466144671446814469144701447114472144731447414475144761447714478144791448014481144821448314484144851448614487144881448914490144911449214493144941449514496144971449814499145001450114502145031450414505145061450714508145091451014511145121451314514145151451614517145181451914520145211452214523145241452514526145271452814529145301453114532145331453414535145361453714538145391454014541145421454314544145451454614547145481454914550145511455214553145541455514556145571455814559145601456114562145631456414565145661456714568145691457014571145721457314574145751457614577145781457914580145811458214583145841458514586145871458814589145901459114592145931459414595145961459714598145991460014601146021460314604146051460614607146081460914610146111461214613146141461514616146171461814619146201462114622146231462414625146261462714628146291463014631146321463314634146351463614637146381463914640146411464214643146441464514646146471464814649146501465114652146531465414655146561465714658146591466014661146621466314664146651466614667146681466914670146711467214673146741467514676146771467814679146801468114682146831468414685146861468714688146891469014691146921469314694146951469614697146981469914700147011470214703147041470514706147071470814709147101471114712147131471414715147161471714718147191472014721147221472314724147251472614727147281472914730147311473214733147341473514736147371473814739147401474114742147431474414745147461474714748147491475014751147521475314754147551475614757147581475914760147611476214763147641476514766147671476814769147701477114772147731477414775147761477714778147791478014781147821478314784147851478614787147881478914790147911479214793147941479514796147971479814799148001480114802148031480414805148061480714808148091481014811148121481314814148151481614817148181481914820148211482214823148241482514826148271482814829148301483114832148331483414835148361483714838148391484014841148421484314844148451484614847148481484914850148511485214853148541485514856148571485814859148601486114862148631486414865148661486714868148691487014871148721487314874148751487614877148781487914880148811488214883148841488514886148871488814889148901489114892148931489414895148961489714898148991490014901149021490314904149051490614907149081490914910149111491214913149141491514916149171491814919149201492114922149231492414925149261492714928149291493014931149321493314934149351493614937149381493914940149411494214943149441494514946149471494814949149501495114952149531495414955149561495714958149591496014961149621496314964149651496614967149681496914970149711497214973149741497514976149771497814979149801498114982149831498414985149861498714988149891499014991149921499314994149951499614997149981499915000150011500215003150041500515006150071500815009150101501115012150131501415015150161501715018150191502015021150221502315024150251502615027150281502915030150311503215033150341503515036150371503815039150401504115042150431504415045150461504715048150491505015051150521505315054150551505615057150581505915060150611506215063150641506515066150671506815069150701507115072150731507415075150761507715078150791508015081150821508315084150851508615087150881508915090150911509215093150941509515096150971509815099151001510115102151031510415105151061510715108151091511015111151121511315114151151511615117151181511915120151211512215123151241512515126151271512815129151301513115132151331513415135151361513715138151391514015141151421514315144151451514615147151481514915150151511515215153151541515515156151571515815159151601516115162151631516415165151661516715168151691517015171151721517315174151751517615177151781517915180151811518215183151841518515186151871518815189151901519115192151931519415195151961519715198151991520015201152021520315204152051520615207152081520915210152111521215213152141521515216152171521815219152201522115222152231522415225152261522715228152291523015231152321523315234152351523615237152381523915240152411524215243152441524515246152471524815249152501525115252152531525415255152561525715258152591526015261152621526315264152651526615267152681526915270152711527215273152741527515276152771527815279152801528115282152831528415285152861528715288152891529015291152921529315294152951529615297152981529915300153011530215303153041530515306153071530815309153101531115312153131531415315153161531715318153191532015321153221532315324153251532615327153281532915330153311533215333153341533515336153371533815339153401534115342153431534415345153461534715348153491535015351153521535315354153551535615357153581535915360153611536215363153641536515366153671536815369153701537115372153731537415375153761537715378153791538015381153821538315384153851538615387153881538915390153911539215393153941539515396153971539815399154001540115402154031540415405154061540715408154091541015411154121541315414154151541615417154181541915420154211542215423154241542515426154271542815429154301543115432154331543415435154361543715438154391544015441154421544315444154451544615447154481544915450154511545215453154541545515456154571545815459154601546115462154631546415465154661546715468154691547015471154721547315474154751547615477154781547915480154811548215483154841548515486154871548815489154901549115492154931549415495154961549715498154991550015501155021550315504155051550615507155081550915510155111551215513155141551515516155171551815519155201552115522155231552415525155261552715528155291553015531155321553315534155351553615537155381553915540155411554215543155441554515546155471554815549155501555115552155531555415555155561555715558155591556015561155621556315564155651556615567155681556915570155711557215573155741557515576155771557815579155801558115582155831558415585155861558715588155891559015591155921559315594155951559615597155981559915600156011560215603156041560515606156071560815609156101561115612156131561415615156161561715618156191562015621156221562315624156251562615627156281562915630156311563215633156341563515636156371563815639156401564115642156431564415645156461564715648156491565015651156521565315654156551565615657156581565915660156611566215663156641566515666156671566815669156701567115672156731567415675156761567715678156791568015681156821568315684156851568615687156881568915690156911569215693156941569515696156971569815699157001570115702157031570415705157061570715708157091571015711157121571315714157151571615717157181571915720157211572215723157241572515726157271572815729157301573115732157331573415735157361573715738157391574015741157421574315744157451574615747157481574915750157511575215753157541575515756157571575815759157601576115762157631576415765157661576715768157691577015771157721577315774157751577615777157781577915780157811578215783157841578515786157871578815789157901579115792157931579415795157961579715798157991580015801158021580315804158051580615807158081580915810158111581215813158141581515816158171581815819158201582115822158231582415825158261582715828158291583015831158321583315834158351583615837158381583915840158411584215843158441584515846158471584815849158501585115852158531585415855158561585715858158591586015861158621586315864158651586615867158681586915870158711587215873158741587515876158771587815879158801588115882158831588415885158861588715888158891589015891158921589315894158951589615897158981589915900159011590215903159041590515906159071590815909159101591115912159131591415915159161591715918159191592015921159221592315924159251592615927159281592915930159311593215933159341593515936159371593815939159401594115942159431594415945159461594715948159491595015951159521595315954159551595615957159581595915960159611596215963159641596515966159671596815969159701597115972159731597415975159761597715978159791598015981159821598315984159851598615987159881598915990159911599215993159941599515996159971599815999160001600116002160031600416005160061600716008160091601016011160121601316014160151601616017160181601916020160211602216023160241602516026160271602816029160301603116032160331603416035160361603716038160391604016041160421604316044160451604616047160481604916050160511605216053160541605516056160571605816059160601606116062160631606416065160661606716068160691607016071160721607316074160751607616077160781607916080160811608216083160841608516086160871608816089160901609116092160931609416095160961609716098160991610016101161021610316104161051610616107161081610916110161111611216113161141611516116161171611816119161201612116122161231612416125161261612716128161291613016131161321613316134161351613616137161381613916140161411614216143161441614516146161471614816149161501615116152161531615416155161561615716158161591616016161161621616316164161651616616167161681616916170161711617216173161741617516176161771617816179161801618116182161831618416185161861618716188161891619016191161921619316194161951619616197161981619916200162011620216203162041620516206162071620816209162101621116212162131621416215162161621716218162191622016221162221622316224162251622616227162281622916230162311623216233162341623516236162371623816239162401624116242162431624416245162461624716248162491625016251162521625316254162551625616257162581625916260162611626216263162641626516266162671626816269162701627116272162731627416275162761627716278162791628016281162821628316284162851628616287162881628916290162911629216293162941629516296162971629816299163001630116302163031630416305163061630716308163091631016311163121631316314163151631616317163181631916320163211632216323163241632516326163271632816329163301633116332163331633416335163361633716338163391634016341163421634316344163451634616347163481634916350163511635216353163541635516356163571635816359163601636116362163631636416365163661636716368163691637016371163721637316374163751637616377163781637916380163811638216383163841638516386163871638816389163901639116392163931639416395163961639716398163991640016401164021640316404164051640616407164081640916410164111641216413164141641516416164171641816419164201642116422164231642416425164261642716428164291643016431164321643316434164351643616437164381643916440164411644216443164441644516446164471644816449164501645116452164531645416455164561645716458164591646016461164621646316464164651646616467164681646916470164711647216473164741647516476164771647816479164801648116482164831648416485164861648716488164891649016491164921649316494164951649616497164981649916500165011650216503165041650516506165071650816509165101651116512165131651416515165161651716518165191652016521165221652316524165251652616527165281652916530165311653216533165341653516536165371653816539165401654116542165431654416545165461654716548165491655016551165521655316554165551655616557165581655916560165611656216563165641656516566165671656816569165701657116572165731657416575165761657716578165791658016581165821658316584165851658616587165881658916590165911659216593165941659516596165971659816599166001660116602166031660416605166061660716608166091661016611166121661316614166151661616617166181661916620166211662216623166241662516626166271662816629166301663116632166331663416635166361663716638166391664016641166421664316644166451664616647166481664916650166511665216653166541665516656166571665816659166601666116662166631666416665166661666716668166691667016671166721667316674166751667616677166781667916680166811668216683166841668516686166871668816689166901669116692166931669416695166961669716698166991670016701167021670316704167051670616707167081670916710167111671216713167141671516716167171671816719167201672116722167231672416725167261672716728167291673016731167321673316734167351673616737167381673916740167411674216743167441674516746167471674816749167501675116752167531675416755167561675716758167591676016761167621676316764167651676616767167681676916770167711677216773167741677516776167771677816779167801678116782167831678416785167861678716788167891679016791167921679316794167951679616797167981679916800168011680216803168041680516806168071680816809168101681116812168131681416815168161681716818168191682016821168221682316824168251682616827168281682916830168311683216833168341683516836168371683816839168401684116842168431684416845168461684716848168491685016851168521685316854168551685616857168581685916860168611686216863168641686516866168671686816869168701687116872168731687416875168761687716878168791688016881168821688316884168851688616887168881688916890168911689216893168941689516896168971689816899169001690116902169031690416905169061690716908169091691016911169121691316914169151691616917169181691916920169211692216923169241692516926169271692816929169301693116932169331693416935169361693716938169391694016941169421694316944169451694616947169481694916950169511695216953169541695516956169571695816959169601696116962169631696416965169661696716968169691697016971169721697316974169751697616977169781697916980169811698216983169841698516986169871698816989169901699116992169931699416995169961699716998169991700017001170021700317004170051700617007170081700917010170111701217013170141701517016170171701817019170201702117022170231702417025170261702717028170291703017031170321703317034170351703617037170381703917040170411704217043170441704517046170471704817049170501705117052170531705417055170561705717058170591706017061170621706317064170651706617067170681706917070170711707217073170741707517076170771707817079170801708117082170831708417085170861708717088170891709017091170921709317094170951709617097170981709917100171011710217103171041710517106171071710817109171101711117112171131711417115171161711717118171191712017121171221712317124171251712617127171281712917130171311713217133171341713517136171371713817139171401714117142171431714417145171461714717148171491715017151171521715317154171551715617157171581715917160171611716217163171641716517166171671716817169171701717117172171731717417175171761717717178171791718017181171821718317184171851718617187171881718917190171911719217193171941719517196171971719817199172001720117202172031720417205172061720717208172091721017211172121721317214172151721617217172181721917220172211722217223172241722517226172271722817229172301723117232172331723417235172361723717238172391724017241172421724317244172451724617247172481724917250172511725217253172541725517256172571725817259172601726117262172631726417265172661726717268172691727017271172721727317274172751727617277172781727917280172811728217283172841728517286172871728817289172901729117292172931729417295172961729717298172991730017301173021730317304173051730617307173081730917310173111731217313173141731517316173171731817319173201732117322173231732417325173261732717328173291733017331173321733317334173351733617337173381733917340173411734217343173441734517346173471734817349173501735117352173531735417355173561735717358173591736017361173621736317364173651736617367173681736917370173711737217373173741737517376173771737817379173801738117382173831738417385173861738717388173891739017391173921739317394173951739617397173981739917400174011740217403174041740517406174071740817409174101741117412174131741417415174161741717418174191742017421174221742317424174251742617427174281742917430174311743217433174341743517436174371743817439174401744117442174431744417445174461744717448174491745017451174521745317454174551745617457174581745917460174611746217463174641746517466174671746817469174701747117472174731747417475174761747717478174791748017481174821748317484174851748617487174881748917490174911749217493174941749517496174971749817499175001750117502175031750417505175061750717508175091751017511175121751317514175151751617517175181751917520175211752217523175241752517526175271752817529175301753117532175331753417535175361753717538175391754017541175421754317544175451754617547175481754917550175511755217553175541755517556175571755817559175601756117562175631756417565175661756717568175691757017571175721757317574175751757617577175781757917580175811758217583175841758517586175871758817589175901759117592175931759417595175961759717598175991760017601176021760317604176051760617607176081760917610176111761217613176141761517616176171761817619176201762117622176231762417625176261762717628176291763017631176321763317634176351763617637176381763917640176411764217643176441764517646176471764817649176501765117652176531765417655176561765717658176591766017661176621766317664176651766617667176681766917670176711767217673176741767517676176771767817679176801768117682176831768417685176861768717688176891769017691176921769317694176951769617697176981769917700177011770217703177041770517706177071770817709177101771117712177131771417715177161771717718177191772017721177221772317724177251772617727177281772917730177311773217733177341773517736177371773817739177401774117742177431774417745177461774717748177491775017751177521775317754177551775617757177581775917760177611776217763177641776517766177671776817769177701777117772177731777417775177761777717778177791778017781177821778317784177851778617787177881778917790177911779217793177941779517796177971779817799178001780117802178031780417805178061780717808178091781017811178121781317814178151781617817178181781917820178211782217823178241782517826178271782817829178301783117832178331783417835178361783717838178391784017841178421784317844178451784617847178481784917850178511785217853178541785517856178571785817859178601786117862178631786417865178661786717868178691787017871178721787317874178751787617877178781787917880178811788217883178841788517886178871788817889178901789117892178931789417895178961789717898178991790017901179021790317904179051790617907179081790917910179111791217913179141791517916179171791817919179201792117922179231792417925179261792717928179291793017931179321793317934179351793617937179381793917940179411794217943179441794517946179471794817949179501795117952179531795417955179561795717958179591796017961179621796317964179651796617967179681796917970179711797217973179741797517976179771797817979179801798117982179831798417985179861798717988179891799017991179921799317994179951799617997179981799918000180011800218003180041800518006180071800818009180101801118012180131801418015180161801718018180191802018021180221802318024180251802618027180281802918030180311803218033180341803518036180371803818039180401804118042180431804418045180461804718048180491805018051180521805318054180551805618057180581805918060180611806218063180641806518066180671806818069180701807118072180731807418075180761807718078180791808018081180821808318084180851808618087180881808918090180911809218093180941809518096180971809818099181001810118102181031810418105181061810718108181091811018111181121811318114181151811618117181181811918120181211812218123181241812518126181271812818129181301813118132181331813418135181361813718138181391814018141181421814318144181451814618147181481814918150181511815218153181541815518156181571815818159181601816118162181631816418165181661816718168181691817018171181721817318174181751817618177181781817918180181811818218183181841818518186181871818818189181901819118192181931819418195181961819718198181991820018201182021820318204182051820618207182081820918210182111821218213182141821518216182171821818219182201822118222182231822418225182261822718228182291823018231182321823318234182351823618237182381823918240182411824218243182441824518246182471824818249182501825118252182531825418255182561825718258182591826018261182621826318264182651826618267182681826918270182711827218273182741827518276182771827818279182801828118282182831828418285182861828718288182891829018291182921829318294182951829618297182981829918300183011830218303183041830518306183071830818309183101831118312183131831418315183161831718318183191832018321183221832318324183251832618327183281832918330183311833218333183341833518336183371833818339183401834118342183431834418345183461834718348183491835018351183521835318354183551835618357183581835918360183611836218363183641836518366183671836818369183701837118372183731837418375183761837718378183791838018381183821838318384183851838618387183881838918390183911839218393183941839518396183971839818399184001840118402184031840418405184061840718408184091841018411184121841318414184151841618417184181841918420184211842218423184241842518426184271842818429184301843118432184331843418435184361843718438184391844018441184421844318444184451844618447184481844918450184511845218453184541845518456184571845818459184601846118462184631846418465184661846718468184691847018471184721847318474184751847618477184781847918480184811848218483184841848518486184871848818489184901849118492184931849418495184961849718498184991850018501185021850318504185051850618507185081850918510185111851218513185141851518516185171851818519185201852118522185231852418525185261852718528185291853018531185321853318534185351853618537185381853918540185411854218543185441854518546185471854818549185501855118552185531855418555185561855718558185591856018561185621856318564185651856618567185681856918570185711857218573185741857518576185771857818579185801858118582185831858418585185861858718588185891859018591185921859318594185951859618597185981859918600186011860218603186041860518606186071860818609186101861118612186131861418615186161861718618186191862018621186221862318624186251862618627186281862918630186311863218633186341863518636186371863818639186401864118642186431864418645186461864718648186491865018651186521865318654186551865618657186581865918660186611866218663186641866518666186671866818669186701867118672186731867418675186761867718678186791868018681186821868318684186851868618687186881868918690186911869218693186941869518696186971869818699187001870118702187031870418705187061870718708187091871018711187121871318714187151871618717187181871918720187211872218723187241872518726187271872818729187301873118732187331873418735187361873718738187391874018741187421874318744187451874618747187481874918750187511875218753187541875518756187571875818759187601876118762187631876418765187661876718768187691877018771187721877318774187751877618777187781877918780187811878218783187841878518786187871878818789187901879118792187931879418795187961879718798187991880018801188021880318804188051880618807188081880918810188111881218813188141881518816188171881818819188201882118822188231882418825188261882718828188291883018831188321883318834188351883618837188381883918840188411884218843188441884518846188471884818849188501885118852188531885418855188561885718858188591886018861188621886318864188651886618867188681886918870188711887218873188741887518876188771887818879188801888118882188831888418885188861888718888188891889018891188921889318894188951889618897188981889918900189011890218903189041890518906189071890818909189101891118912189131891418915189161891718918189191892018921189221892318924189251892618927189281892918930189311893218933189341893518936189371893818939189401894118942189431894418945189461894718948189491895018951189521895318954189551895618957189581895918960189611896218963189641896518966189671896818969189701897118972189731897418975189761897718978189791898018981189821898318984189851898618987189881898918990189911899218993189941899518996189971899818999190001900119002190031900419005190061900719008190091901019011190121901319014190151901619017190181901919020190211902219023190241902519026190271902819029190301903119032190331903419035190361903719038190391904019041190421904319044190451904619047190481904919050190511905219053190541905519056190571905819059190601906119062190631906419065190661906719068190691907019071190721907319074190751907619077190781907919080190811908219083190841908519086190871908819089190901909119092190931909419095190961909719098190991910019101191021910319104191051910619107191081910919110191111911219113191141911519116191171911819119191201912119122191231912419125191261912719128191291913019131191321913319134191351913619137191381913919140191411914219143191441914519146191471914819149191501915119152191531915419155191561915719158191591916019161191621916319164191651916619167191681916919170191711917219173191741917519176191771917819179191801918119182191831918419185191861918719188191891919019191191921919319194191951919619197191981919919200192011920219203192041920519206192071920819209192101921119212192131921419215192161921719218192191922019221192221922319224192251922619227192281922919230192311923219233192341923519236192371923819239192401924119242192431924419245192461924719248192491925019251192521925319254192551925619257192581925919260192611926219263192641926519266192671926819269192701927119272192731927419275192761927719278192791928019281192821928319284192851928619287192881928919290192911929219293192941929519296192971929819299193001930119302193031930419305193061930719308193091931019311193121931319314193151931619317193181931919320193211932219323193241932519326193271932819329193301933119332193331933419335193361933719338193391934019341193421934319344193451934619347193481934919350193511935219353193541935519356193571935819359193601936119362193631936419365193661936719368193691937019371193721937319374193751937619377193781937919380193811938219383193841938519386193871938819389193901939119392193931939419395193961939719398193991940019401194021940319404194051940619407194081940919410194111941219413
  1. (self["webpackChunk"] = self["webpackChunk"] || []).push([["resources_js_pages_Suppliers_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/AppButtonLink.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/AppButtonLink.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. __name: 'AppButtonLink',
  15. props: {
  16. inertiaLink: {
  17. type: Boolean,
  18. "default": true
  19. },
  20. icon: {
  21. type: String,
  22. required: true
  23. },
  24. label: String
  25. },
  26. setup: function setup(__props, _ref) {
  27. var expose = _ref.expose;
  28. expose();
  29. var __returned__ = {
  30. Link: _inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_0__.Link
  31. };
  32. Object.defineProperty(__returned__, '__isScriptSetup', {
  33. enumerable: false,
  34. value: true
  35. });
  36. return __returned__;
  37. }
  38. });
  39. /***/ }),
  40. /***/ "./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":
  41. /*!***************************************************************************************************************************************************************************************************************!*\
  42. !*** ./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 ***!
  43. \***************************************************************************************************************************************************************************************************************/
  44. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  45. "use strict";
  46. __webpack_require__.r(__webpack_exports__);
  47. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  48. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  49. /* harmony export */ });
  50. /* harmony import */ var _inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @inertiajs/inertia-vue3 */ "./node_modules/@inertiajs/inertia-vue3/dist/index.js");
  51. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
  52. __name: 'AppMessage',
  53. setup: function setup(__props, _ref) {
  54. var expose = _ref.expose;
  55. expose();
  56. var onClose = function onClose() {
  57. (0,_inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_0__.usePage)().props.value.errors = {};
  58. (0,_inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_0__.usePage)().props.value.flash.success = null;
  59. (0,_inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_0__.usePage)().props.value.flash.error = null;
  60. };
  61. var __returned__ = {
  62. onClose: onClose,
  63. usePage: _inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_0__.usePage
  64. };
  65. Object.defineProperty(__returned__, '__isScriptSetup', {
  66. enumerable: false,
  67. value: true
  68. });
  69. return __returned__;
  70. }
  71. });
  72. /***/ }),
  73. /***/ "./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/AppPagination.vue?vue&type=script&setup=true&lang=js":
  74. /*!******************************************************************************************************************************************************************************************************************!*\
  75. !*** ./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/AppPagination.vue?vue&type=script&setup=true&lang=js ***!
  76. \******************************************************************************************************************************************************************************************************************/
  77. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  78. "use strict";
  79. __webpack_require__.r(__webpack_exports__);
  80. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  81. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  82. /* harmony export */ });
  83. /* harmony import */ var _inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @inertiajs/inertia-vue3 */ "./node_modules/@inertiajs/inertia-vue3/dist/index.js");
  84. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
  85. __name: 'AppPagination',
  86. props: {
  87. links: Array
  88. },
  89. setup: function setup(__props, _ref) {
  90. var expose = _ref.expose;
  91. expose();
  92. var __returned__ = {
  93. Link: _inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_0__.Link
  94. };
  95. Object.defineProperty(__returned__, '__isScriptSetup', {
  96. enumerable: false,
  97. value: true
  98. });
  99. return __returned__;
  100. }
  101. });
  102. /***/ }),
  103. /***/ "./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/AppSearch.vue?vue&type=script&setup=true&lang=js":
  104. /*!**************************************************************************************************************************************************************************************************************!*\
  105. !*** ./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/AppSearch.vue?vue&type=script&setup=true&lang=js ***!
  106. \**************************************************************************************************************************************************************************************************************/
  107. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  108. "use strict";
  109. __webpack_require__.r(__webpack_exports__);
  110. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  111. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  112. /* harmony export */ });
  113. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  114. /* harmony import */ var _inertiajs_inertia__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @inertiajs/inertia */ "./node_modules/@inertiajs/inertia/dist/index.js");
  115. /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! lodash */ "./node_modules/lodash/lodash.js");
  116. /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_2__);
  117. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
  118. __name: 'AppSearch',
  119. props: {
  120. url: {
  121. type: String,
  122. required: true
  123. },
  124. initialSearch: {
  125. required: true
  126. }
  127. },
  128. setup: function setup(__props, _ref) {
  129. var expose = _ref.expose;
  130. expose();
  131. var props = __props;
  132. var search = (0,vue__WEBPACK_IMPORTED_MODULE_0__.ref)(props.initialSearch);
  133. (0,vue__WEBPACK_IMPORTED_MODULE_0__.watch)(search, function () {
  134. _inertiajs_inertia__WEBPACK_IMPORTED_MODULE_1__.Inertia.get(props.url, (0,lodash__WEBPACK_IMPORTED_MODULE_2__.pickBy)({
  135. search: search.value
  136. }), {
  137. preserveState: true
  138. });
  139. });
  140. var __returned__ = {
  141. props: props,
  142. search: search,
  143. ref: vue__WEBPACK_IMPORTED_MODULE_0__.ref,
  144. watch: vue__WEBPACK_IMPORTED_MODULE_0__.watch,
  145. Inertia: _inertiajs_inertia__WEBPACK_IMPORTED_MODULE_1__.Inertia,
  146. pickBy: lodash__WEBPACK_IMPORTED_MODULE_2__.pickBy
  147. };
  148. Object.defineProperty(__returned__, '__isScriptSetup', {
  149. enumerable: false,
  150. value: true
  151. });
  152. return __returned__;
  153. }
  154. });
  155. /***/ }),
  156. /***/ "./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/Dashboard/Components/Sidebar.vue?vue&type=script&setup=true&lang=js":
  157. /*!******************************************************************************************************************************************************************************************************************************!*\
  158. !*** ./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/Dashboard/Components/Sidebar.vue?vue&type=script&setup=true&lang=js ***!
  159. \******************************************************************************************************************************************************************************************************************************/
  160. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  161. "use strict";
  162. __webpack_require__.r(__webpack_exports__);
  163. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  164. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  165. /* harmony export */ });
  166. /* harmony import */ var _SubSidebar_vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./SubSidebar.vue */ "./resources/js/layouts/Dashboard/Components/SubSidebar.vue");
  167. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
  168. __name: 'Sidebar',
  169. props: {
  170. menu: Array
  171. },
  172. setup: function setup(__props, _ref) {
  173. var expose = _ref.expose;
  174. expose();
  175. var __returned__ = {
  176. SubSidebar: _SubSidebar_vue__WEBPACK_IMPORTED_MODULE_0__["default"]
  177. };
  178. Object.defineProperty(__returned__, '__isScriptSetup', {
  179. enumerable: false,
  180. value: true
  181. });
  182. return __returned__;
  183. }
  184. });
  185. /***/ }),
  186. /***/ "./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/Dashboard/Components/SubSidebar.vue?vue&type=script&setup=true&lang=js":
  187. /*!*********************************************************************************************************************************************************************************************************************************!*\
  188. !*** ./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/Dashboard/Components/SubSidebar.vue?vue&type=script&setup=true&lang=js ***!
  189. \*********************************************************************************************************************************************************************************************************************************/
  190. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  191. "use strict";
  192. __webpack_require__.r(__webpack_exports__);
  193. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  194. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  195. /* harmony export */ });
  196. /* harmony import */ var _inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @inertiajs/inertia-vue3 */ "./node_modules/@inertiajs/inertia-vue3/dist/index.js");
  197. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
  198. __name: 'SubSidebar',
  199. props: {
  200. items: Array,
  201. root: {
  202. type: Boolean,
  203. "default": false
  204. }
  205. },
  206. setup: function setup(__props, _ref) {
  207. var expose = _ref.expose;
  208. expose();
  209. var __returned__ = {
  210. Link: _inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_0__.Link
  211. };
  212. Object.defineProperty(__returned__, '__isScriptSetup', {
  213. enumerable: false,
  214. value: true
  215. });
  216. return __returned__;
  217. }
  218. });
  219. /***/ }),
  220. /***/ "./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/Dashboard/Components/TopBar.vue?vue&type=script&setup=true&lang=js":
  221. /*!*****************************************************************************************************************************************************************************************************************************!*\
  222. !*** ./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/Dashboard/Components/TopBar.vue?vue&type=script&setup=true&lang=js ***!
  223. \*****************************************************************************************************************************************************************************************************************************/
  224. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  225. "use strict";
  226. __webpack_require__.r(__webpack_exports__);
  227. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  228. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  229. /* harmony export */ });
  230. /* harmony import */ var _inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @inertiajs/inertia-vue3 */ "./node_modules/@inertiajs/inertia-vue3/dist/index.js");
  231. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
  232. __name: 'TopBar',
  233. setup: function setup(__props, _ref) {
  234. var expose = _ref.expose;
  235. expose();
  236. var __returned__ = {
  237. Link: _inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_0__.Link
  238. };
  239. Object.defineProperty(__returned__, '__isScriptSetup', {
  240. enumerable: false,
  241. value: true
  242. });
  243. return __returned__;
  244. }
  245. });
  246. /***/ }),
  247. /***/ "./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/Dashboard/DashboardLayout.vue?vue&type=script&setup=true&lang=js":
  248. /*!***************************************************************************************************************************************************************************************************************************!*\
  249. !*** ./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/Dashboard/DashboardLayout.vue?vue&type=script&setup=true&lang=js ***!
  250. \***************************************************************************************************************************************************************************************************************************/
  251. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  252. "use strict";
  253. __webpack_require__.r(__webpack_exports__);
  254. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  255. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  256. /* harmony export */ });
  257. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  258. /* harmony import */ var _inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @inertiajs/inertia-vue3 */ "./node_modules/@inertiajs/inertia-vue3/dist/index.js");
  259. /* harmony import */ var _utils_menu__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @/utils/menu */ "./resources/js/utils/menu.js");
  260. /* harmony import */ var _components_AppMessage_vue__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @/components/AppMessage.vue */ "./resources/js/components/AppMessage.vue");
  261. /* harmony import */ var _Components_TopBar_vue__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./Components/TopBar.vue */ "./resources/js/layouts/Dashboard/Components/TopBar.vue");
  262. /* harmony import */ var _Components_Sidebar_vue__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./Components/Sidebar.vue */ "./resources/js/layouts/Dashboard/Components/Sidebar.vue");
  263. /* harmony import */ var _Components_Footer_vue__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./Components/Footer.vue */ "./resources/js/layouts/Dashboard/Components/Footer.vue");
  264. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
  265. __name: 'DashboardLayout',
  266. props: {
  267. title: String
  268. },
  269. setup: function setup(__props, _ref) {
  270. var expose = _ref.expose;
  271. expose();
  272. var mobileMenuActive = (0,vue__WEBPACK_IMPORTED_MODULE_0__.ref)(false);
  273. var staticMenuInactive = (0,vue__WEBPACK_IMPORTED_MODULE_0__.ref)(false);
  274. var menuClick = (0,vue__WEBPACK_IMPORTED_MODULE_0__.ref)(false);
  275. var isDesktop = function isDesktop() {
  276. return window.innerWidth >= 992;
  277. };
  278. var containerClass = (0,vue__WEBPACK_IMPORTED_MODULE_0__.computed)(function () {
  279. return ['layout-wrapper', {
  280. 'layout-static-sidebar-inactive': staticMenuInactive.value,
  281. 'layout-mobile-sidebar-active': mobileMenuActive.value
  282. }];
  283. });
  284. var onWrapperClick = function onWrapperClick() {
  285. if (!menuClick.value) {
  286. mobileMenuActive.value = false;
  287. }
  288. menuClick.value = false;
  289. };
  290. var onMenuToggle = function onMenuToggle(event) {
  291. menuClick.value = true;
  292. if (isDesktop()) {
  293. staticMenuInactive.value = !staticMenuInactive.value;
  294. } else {
  295. mobileMenuActive.value = !mobileMenuActive.value;
  296. }
  297. event.preventDefault();
  298. };
  299. var __returned__ = {
  300. mobileMenuActive: mobileMenuActive,
  301. staticMenuInactive: staticMenuInactive,
  302. menuClick: menuClick,
  303. isDesktop: isDesktop,
  304. containerClass: containerClass,
  305. onWrapperClick: onWrapperClick,
  306. onMenuToggle: onMenuToggle,
  307. ref: vue__WEBPACK_IMPORTED_MODULE_0__.ref,
  308. computed: vue__WEBPACK_IMPORTED_MODULE_0__.computed,
  309. Head: _inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_1__.Head,
  310. menu: _utils_menu__WEBPACK_IMPORTED_MODULE_2__["default"],
  311. AppMessage: _components_AppMessage_vue__WEBPACK_IMPORTED_MODULE_3__["default"],
  312. TopBar: _Components_TopBar_vue__WEBPACK_IMPORTED_MODULE_4__["default"],
  313. Sidebar: _Components_Sidebar_vue__WEBPACK_IMPORTED_MODULE_5__["default"],
  314. Footer: _Components_Footer_vue__WEBPACK_IMPORTED_MODULE_6__["default"]
  315. };
  316. Object.defineProperty(__returned__, '__isScriptSetup', {
  317. enumerable: false,
  318. value: true
  319. });
  320. return __returned__;
  321. }
  322. });
  323. /***/ }),
  324. /***/ "./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/Suppliers/Index.vue?vue&type=script&setup=true&lang=js":
  325. /*!***************************************************************************************************************************************************************************************************************!*\
  326. !*** ./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/Suppliers/Index.vue?vue&type=script&setup=true&lang=js ***!
  327. \***************************************************************************************************************************************************************************************************************/
  328. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  329. "use strict";
  330. __webpack_require__.r(__webpack_exports__);
  331. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  332. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  333. /* harmony export */ });
  334. /* harmony import */ var _inertiajs_inertia__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @inertiajs/inertia */ "./node_modules/@inertiajs/inertia/dist/index.js");
  335. /* harmony import */ var primevue_useconfirm__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! primevue/useconfirm */ "./node_modules/primevue/useconfirm/useconfirm.esm.js");
  336. /* harmony import */ var _config__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./config */ "./resources/js/pages/Suppliers/config.js");
  337. /* harmony import */ var _components_AppSearch_vue__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @/components/AppSearch.vue */ "./resources/js/components/AppSearch.vue");
  338. /* harmony import */ var _components_AppButtonLink_vue__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @/components/AppButtonLink.vue */ "./resources/js/components/AppButtonLink.vue");
  339. /* harmony import */ var _components_AppPagination_vue__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @/components/AppPagination.vue */ "./resources/js/components/AppPagination.vue");
  340. /* harmony import */ var _layouts_Dashboard_DashboardLayout_vue__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @/layouts/Dashboard/DashboardLayout.vue */ "./resources/js/layouts/Dashboard/DashboardLayout.vue");
  341. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
  342. __name: 'Index',
  343. props: {
  344. suppliers: Object,
  345. initialSearch: String
  346. },
  347. setup: function setup(__props, _ref) {
  348. var expose = _ref.expose;
  349. expose();
  350. var deleteConfirm = (0,primevue_useconfirm__WEBPACK_IMPORTED_MODULE_1__.useConfirm)();
  351. var onDelete = function onDelete(data) {
  352. deleteConfirm.require({
  353. message: "Yakin akan menghapus data (".concat(data.name, ") ?"),
  354. header: 'Hapus Supplier',
  355. acceptLabel: 'Iya',
  356. rejectLabel: 'Tidak',
  357. accept: function accept() {
  358. _inertiajs_inertia__WEBPACK_IMPORTED_MODULE_0__.Inertia["delete"](route('suppliers.destroy', data.id));
  359. },
  360. reject: function reject() {
  361. deleteConfirm.close();
  362. }
  363. });
  364. };
  365. var __returned__ = {
  366. deleteConfirm: deleteConfirm,
  367. onDelete: onDelete,
  368. Inertia: _inertiajs_inertia__WEBPACK_IMPORTED_MODULE_0__.Inertia,
  369. useConfirm: primevue_useconfirm__WEBPACK_IMPORTED_MODULE_1__.useConfirm,
  370. indexTable: _config__WEBPACK_IMPORTED_MODULE_2__.indexTable,
  371. AppSearch: _components_AppSearch_vue__WEBPACK_IMPORTED_MODULE_3__["default"],
  372. AppButtonLink: _components_AppButtonLink_vue__WEBPACK_IMPORTED_MODULE_4__["default"],
  373. AppPagination: _components_AppPagination_vue__WEBPACK_IMPORTED_MODULE_5__["default"],
  374. DashboardLayout: _layouts_Dashboard_DashboardLayout_vue__WEBPACK_IMPORTED_MODULE_6__["default"]
  375. };
  376. Object.defineProperty(__returned__, '__isScriptSetup', {
  377. enumerable: false,
  378. value: true
  379. });
  380. return __returned__;
  381. }
  382. });
  383. /***/ }),
  384. /***/ "./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/AppButtonLink.vue?vue&type=template&id=c3621f1c":
  385. /*!***********************************************************************************************************************************************************************************************************************************************************************************!*\
  386. !*** ./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/AppButtonLink.vue?vue&type=template&id=c3621f1c ***!
  387. \***********************************************************************************************************************************************************************************************************************************************************************************/
  388. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  389. "use strict";
  390. __webpack_require__.r(__webpack_exports__);
  391. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  392. /* harmony export */ "render": () => (/* binding */ render)
  393. /* harmony export */ });
  394. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  395. var _hoisted_1 = {
  396. key: 1,
  397. "class": "p-button-label"
  398. };
  399. var _hoisted_2 = {
  400. key: 1,
  401. "class": "p-button p-component"
  402. };
  403. var _hoisted_3 = {
  404. key: 1,
  405. "class": "p-button-label"
  406. };
  407. function render(_ctx, _cache, $props, $setup, $data, $options) {
  408. return $props.inertiaLink ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createBlock)($setup["Link"], {
  409. key: 0,
  410. "class": "p-button p-component",
  411. as: "button",
  412. type: "button"
  413. }, {
  414. "default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  415. return [$props.icon ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)("span", {
  416. key: 0,
  417. "class": (0,vue__WEBPACK_IMPORTED_MODULE_0__.normalizeClass)(["p-button-icon p-button-icon-left", $props.icon])
  418. }, null, 2
  419. /* CLASS */
  420. )) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true), $props.label ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)("span", _hoisted_1, (0,vue__WEBPACK_IMPORTED_MODULE_0__.toDisplayString)($props.label), 1
  421. /* TEXT */
  422. )) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true)];
  423. }),
  424. _: 1
  425. /* STABLE */
  426. })) : ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)("a", _hoisted_2, [$props.icon ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)("span", {
  427. key: 0,
  428. "class": (0,vue__WEBPACK_IMPORTED_MODULE_0__.normalizeClass)(["p-button-icon p-button-icon-left", $props.icon])
  429. }, null, 2
  430. /* CLASS */
  431. )) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true), $props.label ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)("span", _hoisted_3, (0,vue__WEBPACK_IMPORTED_MODULE_0__.toDisplayString)($props.label), 1
  432. /* TEXT */
  433. )) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true)]));
  434. }
  435. /***/ }),
  436. /***/ "./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":
  437. /*!********************************************************************************************************************************************************************************************************************************************************************************!*\
  438. !*** ./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 ***!
  439. \********************************************************************************************************************************************************************************************************************************************************************************/
  440. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  441. "use strict";
  442. __webpack_require__.r(__webpack_exports__);
  443. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  444. /* harmony export */ "render": () => (/* binding */ render)
  445. /* harmony export */ });
  446. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  447. var _hoisted_1 = {
  448. key: 0
  449. };
  450. var _hoisted_2 = {
  451. key: 1
  452. };
  453. function render(_ctx, _cache, $props, $setup, $data, $options) {
  454. var _component_Message = (0,vue__WEBPACK_IMPORTED_MODULE_0__.resolveComponent)("Message");
  455. 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, {
  456. key: 0,
  457. severity: "success",
  458. onClose: $setup.onClose
  459. }, {
  460. "default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  461. return [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createTextVNode)((0,vue__WEBPACK_IMPORTED_MODULE_0__.toDisplayString)(_ctx.$page.props.flash.success), 1
  462. /* TEXT */
  463. )];
  464. }),
  465. _: 1
  466. /* STABLE */
  467. })) : (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, {
  468. key: 1,
  469. severity: "error",
  470. onClose: $setup.onClose
  471. }, {
  472. "default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  473. return [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createTextVNode)((0,vue__WEBPACK_IMPORTED_MODULE_0__.toDisplayString)(_ctx.$page.props.flash.error), 1
  474. /* TEXT */
  475. )];
  476. }),
  477. _: 1
  478. /* STABLE */
  479. })) : (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, {
  480. key: 2,
  481. severity: "error",
  482. onClose: $setup.onClose
  483. }, {
  484. "default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  485. 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
  486. /* TEXT */
  487. ))];
  488. }),
  489. _: 1
  490. /* STABLE */
  491. })) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true)], 64
  492. /* STABLE_FRAGMENT */
  493. );
  494. }
  495. /***/ }),
  496. /***/ "./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/AppPagination.vue?vue&type=template&id=4da56ec0":
  497. /*!***********************************************************************************************************************************************************************************************************************************************************************************!*\
  498. !*** ./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/AppPagination.vue?vue&type=template&id=4da56ec0 ***!
  499. \***********************************************************************************************************************************************************************************************************************************************************************************/
  500. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  501. "use strict";
  502. __webpack_require__.r(__webpack_exports__);
  503. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  504. /* harmony export */ "render": () => (/* binding */ render)
  505. /* harmony export */ });
  506. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  507. var _hoisted_1 = {
  508. key: 0,
  509. "class": "p-paginator p-component flex justify-content-start"
  510. };
  511. var _hoisted_2 = {
  512. "class": "p-paginator-pages"
  513. };
  514. var _hoisted_3 = ["innerHTML"];
  515. function render(_ctx, _cache, $props, $setup, $data, $options) {
  516. return $props.links.length > 3 ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)("nav", _hoisted_1, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("div", _hoisted_2, [((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.links, function (link, key) {
  517. return (0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)(vue__WEBPACK_IMPORTED_MODULE_0__.Fragment, null, [link.url === null ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)("div", {
  518. key: "link-".concat(key),
  519. "class": (0,vue__WEBPACK_IMPORTED_MODULE_0__.normalizeClass)(["p-paginator-page p-paginator-element p-link", {
  520. 'p-disabled': link
  521. }]),
  522. innerHTML: link.label
  523. }, null, 10
  524. /* CLASS, PROPS */
  525. , _hoisted_3)) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true), link.url !== null ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createBlock)($setup["Link"], {
  526. key: "link-".concat(key),
  527. href: link.url,
  528. "class": (0,vue__WEBPACK_IMPORTED_MODULE_0__.normalizeClass)([{
  529. 'p-highlight': link.active
  530. }, "p-paginator-page p-paginator-element p-link"]),
  531. innerHTML: link.label
  532. }, null, 8
  533. /* PROPS */
  534. , ["href", "class", "innerHTML"])) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true)], 64
  535. /* STABLE_FRAGMENT */
  536. );
  537. }), 256
  538. /* UNKEYED_FRAGMENT */
  539. ))])])) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true);
  540. }
  541. /***/ }),
  542. /***/ "./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/AppSearch.vue?vue&type=template&id=5b9fdcce":
  543. /*!*******************************************************************************************************************************************************************************************************************************************************************************!*\
  544. !*** ./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/AppSearch.vue?vue&type=template&id=5b9fdcce ***!
  545. \*******************************************************************************************************************************************************************************************************************************************************************************/
  546. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  547. "use strict";
  548. __webpack_require__.r(__webpack_exports__);
  549. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  550. /* harmony export */ "render": () => (/* binding */ render)
  551. /* harmony export */ });
  552. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  553. function render(_ctx, _cache, $props, $setup, $data, $options) {
  554. var _component_InputText = (0,vue__WEBPACK_IMPORTED_MODULE_0__.resolveComponent)("InputText");
  555. return (0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createBlock)(_component_InputText, {
  556. modelValue: $setup.search,
  557. "onUpdate:modelValue": _cache[0] || (_cache[0] = function ($event) {
  558. return $setup.search = $event;
  559. })
  560. }, null, 8
  561. /* PROPS */
  562. , ["modelValue"]);
  563. }
  564. /***/ }),
  565. /***/ "./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/Dashboard/Components/Footer.vue?vue&type=template&id=dbb3aa76":
  566. /*!**********************************************************************************************************************************************************************************************************************************************************************************************!*\
  567. !*** ./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/Dashboard/Components/Footer.vue?vue&type=template&id=dbb3aa76 ***!
  568. \**********************************************************************************************************************************************************************************************************************************************************************************************/
  569. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  570. "use strict";
  571. __webpack_require__.r(__webpack_exports__);
  572. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  573. /* harmony export */ "render": () => (/* binding */ render)
  574. /* harmony export */ });
  575. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  576. var _hoisted_1 = {
  577. "class": "layout-footer"
  578. };
  579. var _hoisted_2 = /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createTextVNode)(" Developed by ");
  580. var _hoisted_3 = /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("a", {
  581. href: "https://dijitalcode.com",
  582. target: "_blank",
  583. "class": "font-medium ml-2"
  584. }, " DijitalCODE ", -1
  585. /* HOISTED */
  586. );
  587. var _hoisted_4 = [_hoisted_2, _hoisted_3];
  588. function render(_ctx, _cache) {
  589. return (0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)("footer", _hoisted_1, _hoisted_4);
  590. }
  591. /***/ }),
  592. /***/ "./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/Dashboard/Components/Sidebar.vue?vue&type=template&id=5b49aa22&scoped=true":
  593. /*!***********************************************************************************************************************************************************************************************************************************************************************************************************!*\
  594. !*** ./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/Dashboard/Components/Sidebar.vue?vue&type=template&id=5b49aa22&scoped=true ***!
  595. \***********************************************************************************************************************************************************************************************************************************************************************************************************/
  596. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  597. "use strict";
  598. __webpack_require__.r(__webpack_exports__);
  599. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  600. /* harmony export */ "render": () => (/* binding */ render)
  601. /* harmony export */ });
  602. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  603. function render(_ctx, _cache, $props, $setup, $data, $options) {
  604. 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["SubSidebar"], {
  605. "class": "layout-menu",
  606. items: $props.menu,
  607. root: true
  608. }, null, 8
  609. /* PROPS */
  610. , ["items"])]);
  611. }
  612. /***/ }),
  613. /***/ "./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/Dashboard/Components/SubSidebar.vue?vue&type=template&id=b1b23eb4&scoped=true":
  614. /*!**************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  615. !*** ./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/Dashboard/Components/SubSidebar.vue?vue&type=template&id=b1b23eb4&scoped=true ***!
  616. \**************************************************************************************************************************************************************************************************************************************************************************************************************/
  617. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  618. "use strict";
  619. __webpack_require__.r(__webpack_exports__);
  620. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  621. /* harmony export */ "render": () => (/* binding */ render)
  622. /* harmony export */ });
  623. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  624. var _withScopeId = function _withScopeId(n) {
  625. return (0,vue__WEBPACK_IMPORTED_MODULE_0__.pushScopeId)("data-v-b1b23eb4"), n = n(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.popScopeId)(), n;
  626. };
  627. var _hoisted_1 = {
  628. key: 0
  629. };
  630. var _hoisted_2 = ["aria-label"];
  631. var _hoisted_3 = ["aria-label"];
  632. function render(_ctx, _cache, $props, $setup, $data, $options) {
  633. var _component_SubSidebar = (0,vue__WEBPACK_IMPORTED_MODULE_0__.resolveComponent)("SubSidebar", true);
  634. 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) {
  635. 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", {
  636. key: i,
  637. "class": (0,vue__WEBPACK_IMPORTED_MODULE_0__.normalizeClass)([{
  638. 'layout-menuitem-category': $props.root
  639. }]),
  640. role: "none"
  641. }, [$props.root ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)(vue__WEBPACK_IMPORTED_MODULE_0__.Fragment, {
  642. key: 0
  643. }, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("div", {
  644. "class": "layout-menuitem-root-text",
  645. "aria-label": item.label
  646. }, (0,vue__WEBPACK_IMPORTED_MODULE_0__.toDisplayString)(item.label), 9
  647. /* TEXT, PROPS */
  648. , _hoisted_2), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(_component_SubSidebar, {
  649. items: item.items
  650. }, null, 8
  651. /* PROPS */
  652. , ["items"])], 64
  653. /* STABLE_FRAGMENT */
  654. )) : ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)(vue__WEBPACK_IMPORTED_MODULE_0__.Fragment, {
  655. key: 1
  656. }, [item.to ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createBlock)($setup["Link"], {
  657. key: 0,
  658. role: "menuitem",
  659. href: item.to,
  660. "class": (0,vue__WEBPACK_IMPORTED_MODULE_0__.normalizeClass)([{
  661. 'router-link-active': _ctx.$page.component.startsWith(item.component) || _ctx.$page.url.startsWith(item.to),
  662. 'router-link-exact-active': _ctx.$page.component.startsWith(item.component) || _ctx.$page.url.startsWith(item.to)
  663. }]),
  664. "aria-label": item.label
  665. }, {
  666. "default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  667. return [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("i", {
  668. "class": (0,vue__WEBPACK_IMPORTED_MODULE_0__.normalizeClass)(item.icon)
  669. }, null, 2
  670. /* CLASS */
  671. ), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("span", null, (0,vue__WEBPACK_IMPORTED_MODULE_0__.toDisplayString)(item.label), 1
  672. /* TEXT */
  673. )];
  674. }),
  675. _: 2
  676. /* DYNAMIC */
  677. }, 1032
  678. /* PROPS, DYNAMIC_SLOTS */
  679. , ["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", {
  680. key: 1,
  681. href: "#",
  682. role: "menuitem",
  683. "aria-label": item.label
  684. }, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("i", {
  685. "class": (0,vue__WEBPACK_IMPORTED_MODULE_0__.normalizeClass)(item.icon)
  686. }, null, 2
  687. /* CLASS */
  688. ), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("span", null, (0,vue__WEBPACK_IMPORTED_MODULE_0__.toDisplayString)(item.label), 1
  689. /* TEXT */
  690. )], 8
  691. /* PROPS */
  692. , _hoisted_3)) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(_component_SubSidebar, {
  693. items: item.items
  694. }, null, 8
  695. /* PROPS */
  696. , ["items"])], 64
  697. /* STABLE_FRAGMENT */
  698. ))], 2
  699. /* CLASS */
  700. )) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true)], 64
  701. /* STABLE_FRAGMENT */
  702. );
  703. }), 256
  704. /* UNKEYED_FRAGMENT */
  705. ))])) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true);
  706. }
  707. /***/ }),
  708. /***/ "./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/Dashboard/Components/TopBar.vue?vue&type=template&id=0b7edbb0&scoped=true":
  709. /*!**********************************************************************************************************************************************************************************************************************************************************************************************************!*\
  710. !*** ./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/Dashboard/Components/TopBar.vue?vue&type=template&id=0b7edbb0&scoped=true ***!
  711. \**********************************************************************************************************************************************************************************************************************************************************************************************************/
  712. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  713. "use strict";
  714. __webpack_require__.r(__webpack_exports__);
  715. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  716. /* harmony export */ "render": () => (/* binding */ render)
  717. /* harmony export */ });
  718. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  719. var _withScopeId = function _withScopeId(n) {
  720. return (0,vue__WEBPACK_IMPORTED_MODULE_0__.pushScopeId)("data-v-0b7edbb0"), n = n(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.popScopeId)(), n;
  721. };
  722. var _hoisted_1 = {
  723. "class": "layout-topbar"
  724. };
  725. var _hoisted_2 = /*#__PURE__*/_withScopeId(function () {
  726. return /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("img", {
  727. alt: "Brand Logo",
  728. src: "/images/logo.svg",
  729. "class": "md:mr-3"
  730. }, null, -1
  731. /* HOISTED */
  732. );
  733. });
  734. var _hoisted_3 = /*#__PURE__*/_withScopeId(function () {
  735. return /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("span", null, "Cahaya Agung", -1
  736. /* HOISTED */
  737. );
  738. });
  739. var _hoisted_4 = /*#__PURE__*/_withScopeId(function () {
  740. return /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("i", {
  741. "class": "pi pi-bars"
  742. }, null, -1
  743. /* HOISTED */
  744. );
  745. });
  746. var _hoisted_5 = [_hoisted_4];
  747. var _hoisted_6 = {
  748. "class": "p-link layout-topbar-menu-button layout-topbar-button"
  749. };
  750. var _hoisted_7 = /*#__PURE__*/_withScopeId(function () {
  751. return /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("i", {
  752. "class": "pi pi-ellipsis-v"
  753. }, null, -1
  754. /* HOISTED */
  755. );
  756. });
  757. var _hoisted_8 = [_hoisted_7];
  758. var _hoisted_9 = {
  759. "class": "layout-topbar-menu hidden lg:flex origin-top"
  760. };
  761. var _hoisted_10 = {
  762. "class": "align-self-center"
  763. };
  764. var _hoisted_11 = {
  765. "class": "hidden lg:inline"
  766. };
  767. var _hoisted_12 = /*#__PURE__*/_withScopeId(function () {
  768. return /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("i", {
  769. "class": "pi pi-user"
  770. }, null, -1
  771. /* HOISTED */
  772. );
  773. });
  774. var _hoisted_13 = /*#__PURE__*/_withScopeId(function () {
  775. return /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("span", null, "Ubah Profil", -1
  776. /* HOISTED */
  777. );
  778. });
  779. var _hoisted_14 = /*#__PURE__*/_withScopeId(function () {
  780. return /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("i", {
  781. "class": "pi pi-sign-out"
  782. }, null, -1
  783. /* HOISTED */
  784. );
  785. });
  786. var _hoisted_15 = /*#__PURE__*/_withScopeId(function () {
  787. return /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("span", null, "Keluar", -1
  788. /* HOISTED */
  789. );
  790. });
  791. function render(_ctx, _cache, $props, $setup, $data, $options) {
  792. var _directive_styleclass = (0,vue__WEBPACK_IMPORTED_MODULE_0__.resolveDirective)("styleclass");
  793. var _directive_tooltip = (0,vue__WEBPACK_IMPORTED_MODULE_0__.resolveDirective)("tooltip");
  794. 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"], {
  795. href: "/",
  796. "class": "layout-topbar-logo"
  797. }, {
  798. "default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  799. return [_hoisted_2, _hoisted_3];
  800. }),
  801. _: 1
  802. /* STABLE */
  803. }), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("button", {
  804. "class": "p-link layout-menu-button layout-topbar-button",
  805. onClick: _cache[0] || (_cache[0] = function ($event) {
  806. return _ctx.$emit('menu-toggle', $event);
  807. })
  808. }, _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, {
  809. selector: '@next',
  810. enterClass: 'hidden',
  811. enterActiveClass: 'scalein',
  812. leaveToClass: 'hidden',
  813. leaveActiveClass: 'fadeout',
  814. hideOnOutsideClick: true
  815. }]]), (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
  816. /* TEXT */
  817. )]), (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"], {
  818. href: _ctx.route('users.show', _ctx.$page.props.auth.user.id),
  819. "class": "p-link layout-topbar-button"
  820. }, {
  821. "default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  822. return [_hoisted_12, _hoisted_13];
  823. }),
  824. _: 1
  825. /* STABLE */
  826. }, 8
  827. /* PROPS */
  828. , ["href"])), [[_directive_tooltip, {
  829. value: 'Ubah Profil',
  830. "class": 'layout-topbar-menu-tooltip'
  831. }, void 0, {
  832. bottom: true
  833. }]])]), (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"], {
  834. href: _ctx.route('logout'),
  835. as: "button",
  836. method: "post",
  837. "class": "p-link layout-topbar-button"
  838. }, {
  839. "default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  840. return [_hoisted_14, _hoisted_15];
  841. }),
  842. _: 1
  843. /* STABLE */
  844. }, 8
  845. /* PROPS */
  846. , ["href"])), [[_directive_tooltip, {
  847. value: 'Keluar',
  848. "class": 'layout-topbar-menu-tooltip'
  849. }, void 0, {
  850. bottom: true
  851. }]])])])]);
  852. }
  853. /***/ }),
  854. /***/ "./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/Dashboard/DashboardLayout.vue?vue&type=template&id=1d279fe2&scoped=true":
  855. /*!********************************************************************************************************************************************************************************************************************************************************************************************************!*\
  856. !*** ./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/Dashboard/DashboardLayout.vue?vue&type=template&id=1d279fe2&scoped=true ***!
  857. \********************************************************************************************************************************************************************************************************************************************************************************************************/
  858. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  859. "use strict";
  860. __webpack_require__.r(__webpack_exports__);
  861. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  862. /* harmony export */ "render": () => (/* binding */ render)
  863. /* harmony export */ });
  864. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  865. var _withScopeId = function _withScopeId(n) {
  866. return (0,vue__WEBPACK_IMPORTED_MODULE_0__.pushScopeId)("data-v-1d279fe2"), n = n(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.popScopeId)(), n;
  867. };
  868. var _hoisted_1 = {
  869. "class": "layout-sidebar"
  870. };
  871. var _hoisted_2 = {
  872. "class": "layout-main-container"
  873. };
  874. var _hoisted_3 = {
  875. "class": "layout-main"
  876. };
  877. var _hoisted_4 = {
  878. key: 0,
  879. "class": "layout-mask p-component-overlay"
  880. };
  881. function render(_ctx, _cache, $props, $setup, $data, $options) {
  882. return (0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)(vue__WEBPACK_IMPORTED_MODULE_0__.Fragment, null, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)($setup["Head"], {
  883. title: $props.title
  884. }, null, 8
  885. /* PROPS */
  886. , ["title"]), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("div", {
  887. "class": (0,vue__WEBPACK_IMPORTED_MODULE_0__.normalizeClass)($setup.containerClass),
  888. onClick: $setup.onWrapperClick
  889. }, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)($setup["TopBar"], {
  890. onMenuToggle: $setup.onMenuToggle
  891. }), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("nav", _hoisted_1, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)($setup["Sidebar"], {
  892. menu: $setup.menu[_ctx.$page.props.auth.user.role_id]
  893. }, null, 8
  894. /* PROPS */
  895. , ["menu"])]), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("div", _hoisted_2, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("main", _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["Footer"])]), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(vue__WEBPACK_IMPORTED_MODULE_0__.Transition, {
  896. name: "layout-mask"
  897. }, {
  898. "default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  899. 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)];
  900. }),
  901. _: 1
  902. /* STABLE */
  903. })], 2
  904. /* CLASS */
  905. )], 64
  906. /* STABLE_FRAGMENT */
  907. );
  908. }
  909. /***/ }),
  910. /***/ "./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/Suppliers/Index.vue?vue&type=template&id=06c8ed5e":
  911. /*!********************************************************************************************************************************************************************************************************************************************************************************!*\
  912. !*** ./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/Suppliers/Index.vue?vue&type=template&id=06c8ed5e ***!
  913. \********************************************************************************************************************************************************************************************************************************************************************************/
  914. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  915. "use strict";
  916. __webpack_require__.r(__webpack_exports__);
  917. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  918. /* harmony export */ "render": () => (/* binding */ render)
  919. /* harmony export */ });
  920. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  921. var _hoisted_1 = /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("h1", null, "Supplier", -1
  922. /* HOISTED */
  923. );
  924. var _hoisted_2 = {
  925. "class": "grid"
  926. };
  927. var _hoisted_3 = {
  928. "class": "col-12 md:col-8"
  929. };
  930. var _hoisted_4 = {
  931. "class": "flex align-items-center"
  932. };
  933. var _hoisted_5 = {
  934. "class": "col-12 md:col-4 flex flex-column md:flex-row justify-content-end"
  935. };
  936. function render(_ctx, _cache, $props, $setup, $data, $options) {
  937. var _component_ConfirmDialog = (0,vue__WEBPACK_IMPORTED_MODULE_0__.resolveComponent)("ConfirmDialog");
  938. var _component_Column = (0,vue__WEBPACK_IMPORTED_MODULE_0__.resolveComponent)("Column");
  939. var _component_Button = (0,vue__WEBPACK_IMPORTED_MODULE_0__.resolveComponent)("Button");
  940. var _component_DataTable = (0,vue__WEBPACK_IMPORTED_MODULE_0__.resolveComponent)("DataTable");
  941. var _directive_tooltip = (0,vue__WEBPACK_IMPORTED_MODULE_0__.resolveDirective)("tooltip");
  942. return (0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)(vue__WEBPACK_IMPORTED_MODULE_0__.Fragment, null, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(_component_ConfirmDialog), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)($setup["DashboardLayout"], {
  943. title: "Daftar Supplier"
  944. }, {
  945. "default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  946. return [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(_component_DataTable, {
  947. responsiveLayout: "scroll",
  948. columnResizeMode: "expand",
  949. value: $props.suppliers.data,
  950. rowHover: true,
  951. stripedRows: true
  952. }, {
  953. header: (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  954. return [_hoisted_1, (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__.createElementVNode)("div", _hoisted_4, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)($setup["AppSearch"], {
  955. "class": "w-full md:w-27rem",
  956. placeholder: "cari, contoh: tina, 08xx, 0x",
  957. url: "/suppliers",
  958. "initial-search": $props.initialSearch
  959. }, null, 8
  960. /* PROPS */
  961. , ["initial-search"])])]), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("div", _hoisted_5, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)($setup["AppButtonLink"], {
  962. label: "Tambah Supplier",
  963. icon: "pi pi-pencil",
  964. "class": "p-button-outlined",
  965. href: _ctx.route('suppliers.create')
  966. }, null, 8
  967. /* PROPS */
  968. , ["href"])])])];
  969. }),
  970. "default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  971. return [((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)($setup.indexTable, function (value) {
  972. return (0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createBlock)(_component_Column, {
  973. field: value.field,
  974. header: value.header,
  975. key: value.field
  976. }, null, 8
  977. /* PROPS */
  978. , ["field", "header"]);
  979. }), 128
  980. /* KEYED_FRAGMENT */
  981. )), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(_component_Column, null, {
  982. body: (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function (_ref) {
  983. var data = _ref.data;
  984. return [(0,vue__WEBPACK_IMPORTED_MODULE_0__.withDirectives)((0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)($setup["AppButtonLink"], {
  985. icon: "pi pi-pencil",
  986. "class": "p-button-icon-only p-button-rounded p-button-text",
  987. href: _ctx.route('suppliers.edit', data.id)
  988. }, null, 8
  989. /* PROPS */
  990. , ["href"]), [[_directive_tooltip, 'Ubah Supplier', void 0, {
  991. bottom: true
  992. }]])];
  993. }),
  994. _: 1
  995. /* STABLE */
  996. }), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(_component_Column, null, {
  997. body: (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function (_ref2) {
  998. var data = _ref2.data;
  999. return [!data.isUsed ? (0,vue__WEBPACK_IMPORTED_MODULE_0__.withDirectives)(((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createBlock)(_component_Button, {
  1000. key: 0,
  1001. icon: "pi pi-trash",
  1002. "class": "p-button-icon-only p-button-rounded p-button-text",
  1003. onClick: function onClick($event) {
  1004. return $setup.onDelete(data);
  1005. }
  1006. }, null, 8
  1007. /* PROPS */
  1008. , ["onClick"])), [[_directive_tooltip, 'Hapus Supplier', void 0, {
  1009. bottom: true
  1010. }]]) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true)];
  1011. }),
  1012. _: 1
  1013. /* STABLE */
  1014. })];
  1015. }),
  1016. _: 1
  1017. /* STABLE */
  1018. }, 8
  1019. /* PROPS */
  1020. , ["value"]), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)($setup["AppPagination"], {
  1021. links: $props.suppliers.links
  1022. }, null, 8
  1023. /* PROPS */
  1024. , ["links"])];
  1025. }),
  1026. _: 1
  1027. /* STABLE */
  1028. })], 64
  1029. /* STABLE_FRAGMENT */
  1030. );
  1031. }
  1032. /***/ }),
  1033. /***/ "./resources/js/pages/Suppliers/config.js":
  1034. /*!************************************************!*\
  1035. !*** ./resources/js/pages/Suppliers/config.js ***!
  1036. \************************************************/
  1037. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  1038. "use strict";
  1039. __webpack_require__.r(__webpack_exports__);
  1040. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  1041. /* harmony export */ "indexTable": () => (/* binding */ indexTable)
  1042. /* harmony export */ });
  1043. var indexTable = [{
  1044. field: 'name',
  1045. header: 'Nama'
  1046. }, {
  1047. field: 'address',
  1048. header: 'Alamat'
  1049. }, {
  1050. field: 'email',
  1051. header: 'Surel'
  1052. }, {
  1053. field: 'phone',
  1054. header: 'No HP'
  1055. }, {
  1056. field: 'npwp',
  1057. header: 'NPWP'
  1058. }];
  1059. /***/ }),
  1060. /***/ "./resources/js/utils/menu.js":
  1061. /*!************************************!*\
  1062. !*** ./resources/js/utils/menu.js ***!
  1063. \************************************/
  1064. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  1065. "use strict";
  1066. __webpack_require__.r(__webpack_exports__);
  1067. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  1068. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  1069. /* harmony export */ });
  1070. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
  1071. // Admin
  1072. 1: [{
  1073. label: 'Home',
  1074. items: [{
  1075. label: 'Dashboard',
  1076. icon: 'pi pi-chart-bar',
  1077. to: '/dashboards',
  1078. component: 'Dashboards/Index'
  1079. }]
  1080. }, {
  1081. label: 'Laporan',
  1082. items: []
  1083. }, {
  1084. label: 'Master',
  1085. items: [{
  1086. label: 'User',
  1087. icon: 'pi pi-user',
  1088. to: '/users',
  1089. component: 'Users/Index'
  1090. }]
  1091. }, {
  1092. label: 'Pengaturan',
  1093. items: [{
  1094. label: 'PPN',
  1095. icon: 'pi pi-percentage',
  1096. to: '/ppn',
  1097. component: 'PPN/Index'
  1098. }]
  1099. }],
  1100. // Supervisor
  1101. 2: [{
  1102. label: 'Home',
  1103. items: [{
  1104. label: 'Dashboard',
  1105. icon: 'pi pi-chart-bar',
  1106. to: '/dashboards',
  1107. component: 'Dashboards/Index'
  1108. }]
  1109. }, {
  1110. label: 'Master',
  1111. items: [{
  1112. label: 'Pelanggan',
  1113. icon: 'pi pi-users',
  1114. to: '/customers',
  1115. component: 'Customers/Index'
  1116. }, {
  1117. label: 'Penjualan',
  1118. icon: 'pi pi-tag',
  1119. to: '/sales',
  1120. component: 'Sales/Index'
  1121. }, {
  1122. label: 'Stok Barang',
  1123. icon: 'pi pi-box',
  1124. to: '/stock-products',
  1125. component: 'StockProducts/Index'
  1126. }]
  1127. }],
  1128. // Operator
  1129. 3: [{
  1130. label: 'Home',
  1131. items: [{
  1132. label: 'Dashboard',
  1133. icon: 'pi pi-chart-bar',
  1134. to: '/dashboards',
  1135. component: 'Dashboards/Index'
  1136. }]
  1137. }, {
  1138. label: 'Master',
  1139. items: [{
  1140. label: 'Supplier',
  1141. icon: 'pi pi-shopping-cart',
  1142. to: '/suppliers',
  1143. component: 'Suppliers/Index'
  1144. }, {
  1145. label: 'Produk',
  1146. icon: 'pi pi-th-large',
  1147. to: '/products',
  1148. component: 'Products/Index'
  1149. }, {
  1150. label: 'Pembelian',
  1151. icon: 'pi pi-shopping-cart',
  1152. to: '/purchases',
  1153. component: 'Purchases/Index'
  1154. }, {
  1155. label: 'Stok Barang',
  1156. icon: 'pi pi-box',
  1157. to: '/stock-products',
  1158. component: 'StockProducts/Index'
  1159. }]
  1160. }]
  1161. });
  1162. /***/ }),
  1163. /***/ "./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/Dashboard/Components/Sidebar.vue?vue&type=style&index=0&id=5b49aa22&lang=scss&scoped=true":
  1164. /*!***************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  1165. !*** ./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/Dashboard/Components/Sidebar.vue?vue&type=style&index=0&id=5b49aa22&lang=scss&scoped=true ***!
  1166. \***************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  1167. /***/ ((module, __webpack_exports__, __webpack_require__) => {
  1168. "use strict";
  1169. __webpack_require__.r(__webpack_exports__);
  1170. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  1171. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  1172. /* harmony export */ });
  1173. /* 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");
  1174. /* 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__);
  1175. // Imports
  1176. var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_0___default()(function(i){return i[1]});
  1177. // Module
  1178. ___CSS_LOADER_EXPORT___.push([module.id, ".layout-menu[data-v-5b49aa22] {\n list-style-type: none;\n margin: 0;\n padding: 0;\n}", ""]);
  1179. // Exports
  1180. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);
  1181. /***/ }),
  1182. /***/ "./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/Dashboard/Components/SubSidebar.vue?vue&type=style&index=0&id=b1b23eb4&lang=scss&scoped=true":
  1183. /*!******************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  1184. !*** ./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/Dashboard/Components/SubSidebar.vue?vue&type=style&index=0&id=b1b23eb4&lang=scss&scoped=true ***!
  1185. \******************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  1186. /***/ ((module, __webpack_exports__, __webpack_require__) => {
  1187. "use strict";
  1188. __webpack_require__.r(__webpack_exports__);
  1189. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  1190. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  1191. /* harmony export */ });
  1192. /* 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");
  1193. /* 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__);
  1194. // Imports
  1195. var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_0___default()(function(i){return i[1]});
  1196. // Module
  1197. ___CSS_LOADER_EXPORT___.push([module.id, "li.layout-menuitem-category[data-v-b1b23eb4] {\n margin-top: 0.75rem;\n}\nli.layout-menuitem-category[data-v-b1b23eb4]:first-child {\n margin-top: 0;\n}\nli .layout-menuitem-root-text[data-v-b1b23eb4] {\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-b1b23eb4] {\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-b1b23eb4] {\n margin-left: 0.5rem;\n}\nli a .menuitem-toggle-icon[data-v-b1b23eb4] {\n margin-left: auto;\n}\nli a[data-v-b1b23eb4]: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-b1b23eb4]:hover {\n background-color: var(--surface-hover);\n}\nli a.router-link-exact-active[data-v-b1b23eb4] {\n font-weight: 700;\n color: var(--primary-color);\n}\nli ul[data-v-b1b23eb4] {\n list-style-type: none;\n margin: 0;\n padding: 0;\n}\nli ul ul[data-v-b1b23eb4] {\n padding-left: 1rem;\n}", ""]);
  1198. // Exports
  1199. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);
  1200. /***/ }),
  1201. /***/ "./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/Dashboard/Components/TopBar.vue?vue&type=style&index=0&id=0b7edbb0&lang=scss&scoped=true":
  1202. /*!**************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  1203. !*** ./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/Dashboard/Components/TopBar.vue?vue&type=style&index=0&id=0b7edbb0&lang=scss&scoped=true ***!
  1204. \**************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  1205. /***/ ((module, __webpack_exports__, __webpack_require__) => {
  1206. "use strict";
  1207. __webpack_require__.r(__webpack_exports__);
  1208. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  1209. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  1210. /* harmony export */ });
  1211. /* 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");
  1212. /* 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__);
  1213. // Imports
  1214. var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_0___default()(function(i){return i[1]});
  1215. // Module
  1216. ___CSS_LOADER_EXPORT___.push([module.id, ".layout-topbar[data-v-0b7edbb0] {\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-0b7edbb0] {\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-0b7edbb0] {\n height: 2.5rem;\n margin-right: 0.5rem;\n}\n.layout-topbar .layout-topbar-logo[data-v-0b7edbb0]: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-0b7edbb0] {\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-0b7edbb0]:hover {\n color: var(--text-color);\n background-color: var(--surface-hover);\n}\n.layout-topbar .layout-topbar-button[data-v-0b7edbb0]: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-0b7edbb0] {\n font-size: 1.5rem;\n}\n.layout-topbar .layout-topbar-button span[data-v-0b7edbb0] {\n font-size: 1rem;\n display: none;\n}\n.layout-topbar .layout-menu-button[data-v-0b7edbb0] {\n margin-left: 2rem;\n}\n.layout-topbar .layout-topbar-menu-button[data-v-0b7edbb0] {\n display: none;\n}\n.layout-topbar .layout-topbar-menu-button i[data-v-0b7edbb0] {\n font-size: 1.25rem;\n}\n.layout-topbar .layout-topbar-menu[data-v-0b7edbb0] {\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-0b7edbb0] {\n margin-left: 1rem;\n}\n@media (max-width: 991px) {\n.layout-topbar[data-v-0b7edbb0] {\n justify-content: space-between;\n}\n.layout-topbar .layout-topbar-logo[data-v-0b7edbb0] {\n width: auto;\n order: 2;\n}\n.layout-topbar .layout-menu-button[data-v-0b7edbb0] {\n margin-left: 0;\n order: 1;\n}\n.layout-topbar .layout-topbar-menu-button[data-v-0b7edbb0] {\n display: inline-flex;\n margin-left: 0;\n order: 3;\n}\n.layout-topbar .layout-topbar-menu[data-v-0b7edbb0] {\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-0b7edbb0] {\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-0b7edbb0] {\n font-size: 1rem;\n margin-right: 0.5rem;\n}\n.layout-topbar .layout-topbar-menu .layout-topbar-button span[data-v-0b7edbb0] {\n font-weight: medium;\n display: block;\n}\n}", ""]);
  1217. // Exports
  1218. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);
  1219. /***/ }),
  1220. /***/ "./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/Dashboard/DashboardLayout.vue?vue&type=style&index=0&id=1d279fe2&lang=scss&scoped=true":
  1221. /*!************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  1222. !*** ./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/Dashboard/DashboardLayout.vue?vue&type=style&index=0&id=1d279fe2&lang=scss&scoped=true ***!
  1223. \************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  1224. /***/ ((module, __webpack_exports__, __webpack_require__) => {
  1225. "use strict";
  1226. __webpack_require__.r(__webpack_exports__);
  1227. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  1228. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  1229. /* harmony export */ });
  1230. /* 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");
  1231. /* 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__);
  1232. // Imports
  1233. var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_0___default()(function(i){return i[1]});
  1234. // Module
  1235. ___CSS_LOADER_EXPORT___.push([module.id, ".layout-sidebar[data-v-1d279fe2] {\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-1d279fe2] {\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-1d279fe2] {\n flex: 1 1 auto;\n}\n.layout-footer[data-v-1d279fe2] {\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}\n@media (min-width: 992px) {\n.layout-wrapper .layout-main-container[data-v-1d279fe2] {\n margin-left: 300px;\n}\n.layout-wrapper.layout-static-sidebar-inactive .layout-sidebar[data-v-1d279fe2] {\n transform: translateX(-100%);\n left: 0;\n}\n.layout-wrapper.layout-static-sidebar-inactive .layout-main-container[data-v-1d279fe2] {\n margin-left: 0;\n padding-left: 2rem;\n}\n.layout-wrapper .layout-mask[data-v-1d279fe2] {\n display: none;\n}\n}\n@media (max-width: 991px) {\n.layout-wrapper .layout-main-container[data-v-1d279fe2] {\n margin-left: 0;\n padding-left: 2rem;\n}\n.layout-wrapper .layout-sidebar[data-v-1d279fe2] {\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-1d279fe2] {\n z-index: 995;\n background-color: var(--maskbg);\n}\n.layout-wrapper .layout-mask.layout-mask-enter-from[data-v-1d279fe2], .layout-wrapper .layout-mask.layout-mask-leave-to[data-v-1d279fe2] {\n background-color: transparent;\n}\n.layout-wrapper.layout-mobile-sidebar-active .layout-sidebar[data-v-1d279fe2] {\n transform: translateX(0);\n}\n.layout-wrapper.layout-mobile-sidebar-active .layout-mask[data-v-1d279fe2] {\n display: block;\n}\n}", ""]);
  1236. // Exports
  1237. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);
  1238. /***/ }),
  1239. /***/ "./node_modules/lodash/lodash.js":
  1240. /*!***************************************!*\
  1241. !*** ./node_modules/lodash/lodash.js ***!
  1242. \***************************************/
  1243. /***/ (function(module, exports, __webpack_require__) {
  1244. /* module decorator */ module = __webpack_require__.nmd(module);
  1245. var __WEBPACK_AMD_DEFINE_RESULT__;/**
  1246. * @license
  1247. * Lodash <https://lodash.com/>
  1248. * Copyright OpenJS Foundation and other contributors <https://openjsf.org/>
  1249. * Released under MIT license <https://lodash.com/license>
  1250. * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
  1251. * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
  1252. */
  1253. ;(function() {
  1254. /** Used as a safe reference for `undefined` in pre-ES5 environments. */
  1255. var undefined;
  1256. /** Used as the semantic version number. */
  1257. var VERSION = '4.17.21';
  1258. /** Used as the size to enable large array optimizations. */
  1259. var LARGE_ARRAY_SIZE = 200;
  1260. /** Error message constants. */
  1261. var CORE_ERROR_TEXT = 'Unsupported core-js use. Try https://npms.io/search?q=ponyfill.',
  1262. FUNC_ERROR_TEXT = 'Expected a function',
  1263. INVALID_TEMPL_VAR_ERROR_TEXT = 'Invalid `variable` option passed into `_.template`';
  1264. /** Used to stand-in for `undefined` hash values. */
  1265. var HASH_UNDEFINED = '__lodash_hash_undefined__';
  1266. /** Used as the maximum memoize cache size. */
  1267. var MAX_MEMOIZE_SIZE = 500;
  1268. /** Used as the internal argument placeholder. */
  1269. var PLACEHOLDER = '__lodash_placeholder__';
  1270. /** Used to compose bitmasks for cloning. */
  1271. var CLONE_DEEP_FLAG = 1,
  1272. CLONE_FLAT_FLAG = 2,
  1273. CLONE_SYMBOLS_FLAG = 4;
  1274. /** Used to compose bitmasks for value comparisons. */
  1275. var COMPARE_PARTIAL_FLAG = 1,
  1276. COMPARE_UNORDERED_FLAG = 2;
  1277. /** Used to compose bitmasks for function metadata. */
  1278. var WRAP_BIND_FLAG = 1,
  1279. WRAP_BIND_KEY_FLAG = 2,
  1280. WRAP_CURRY_BOUND_FLAG = 4,
  1281. WRAP_CURRY_FLAG = 8,
  1282. WRAP_CURRY_RIGHT_FLAG = 16,
  1283. WRAP_PARTIAL_FLAG = 32,
  1284. WRAP_PARTIAL_RIGHT_FLAG = 64,
  1285. WRAP_ARY_FLAG = 128,
  1286. WRAP_REARG_FLAG = 256,
  1287. WRAP_FLIP_FLAG = 512;
  1288. /** Used as default options for `_.truncate`. */
  1289. var DEFAULT_TRUNC_LENGTH = 30,
  1290. DEFAULT_TRUNC_OMISSION = '...';
  1291. /** Used to detect hot functions by number of calls within a span of milliseconds. */
  1292. var HOT_COUNT = 800,
  1293. HOT_SPAN = 16;
  1294. /** Used to indicate the type of lazy iteratees. */
  1295. var LAZY_FILTER_FLAG = 1,
  1296. LAZY_MAP_FLAG = 2,
  1297. LAZY_WHILE_FLAG = 3;
  1298. /** Used as references for various `Number` constants. */
  1299. var INFINITY = 1 / 0,
  1300. MAX_SAFE_INTEGER = 9007199254740991,
  1301. MAX_INTEGER = 1.7976931348623157e+308,
  1302. NAN = 0 / 0;
  1303. /** Used as references for the maximum length and index of an array. */
  1304. var MAX_ARRAY_LENGTH = 4294967295,
  1305. MAX_ARRAY_INDEX = MAX_ARRAY_LENGTH - 1,
  1306. HALF_MAX_ARRAY_LENGTH = MAX_ARRAY_LENGTH >>> 1;
  1307. /** Used to associate wrap methods with their bit flags. */
  1308. var wrapFlags = [
  1309. ['ary', WRAP_ARY_FLAG],
  1310. ['bind', WRAP_BIND_FLAG],
  1311. ['bindKey', WRAP_BIND_KEY_FLAG],
  1312. ['curry', WRAP_CURRY_FLAG],
  1313. ['curryRight', WRAP_CURRY_RIGHT_FLAG],
  1314. ['flip', WRAP_FLIP_FLAG],
  1315. ['partial', WRAP_PARTIAL_FLAG],
  1316. ['partialRight', WRAP_PARTIAL_RIGHT_FLAG],
  1317. ['rearg', WRAP_REARG_FLAG]
  1318. ];
  1319. /** `Object#toString` result references. */
  1320. var argsTag = '[object Arguments]',
  1321. arrayTag = '[object Array]',
  1322. asyncTag = '[object AsyncFunction]',
  1323. boolTag = '[object Boolean]',
  1324. dateTag = '[object Date]',
  1325. domExcTag = '[object DOMException]',
  1326. errorTag = '[object Error]',
  1327. funcTag = '[object Function]',
  1328. genTag = '[object GeneratorFunction]',
  1329. mapTag = '[object Map]',
  1330. numberTag = '[object Number]',
  1331. nullTag = '[object Null]',
  1332. objectTag = '[object Object]',
  1333. promiseTag = '[object Promise]',
  1334. proxyTag = '[object Proxy]',
  1335. regexpTag = '[object RegExp]',
  1336. setTag = '[object Set]',
  1337. stringTag = '[object String]',
  1338. symbolTag = '[object Symbol]',
  1339. undefinedTag = '[object Undefined]',
  1340. weakMapTag = '[object WeakMap]',
  1341. weakSetTag = '[object WeakSet]';
  1342. var arrayBufferTag = '[object ArrayBuffer]',
  1343. dataViewTag = '[object DataView]',
  1344. float32Tag = '[object Float32Array]',
  1345. float64Tag = '[object Float64Array]',
  1346. int8Tag = '[object Int8Array]',
  1347. int16Tag = '[object Int16Array]',
  1348. int32Tag = '[object Int32Array]',
  1349. uint8Tag = '[object Uint8Array]',
  1350. uint8ClampedTag = '[object Uint8ClampedArray]',
  1351. uint16Tag = '[object Uint16Array]',
  1352. uint32Tag = '[object Uint32Array]';
  1353. /** Used to match empty string literals in compiled template source. */
  1354. var reEmptyStringLeading = /\b__p \+= '';/g,
  1355. reEmptyStringMiddle = /\b(__p \+=) '' \+/g,
  1356. reEmptyStringTrailing = /(__e\(.*?\)|\b__t\)) \+\n'';/g;
  1357. /** Used to match HTML entities and HTML characters. */
  1358. var reEscapedHtml = /&(?:amp|lt|gt|quot|#39);/g,
  1359. reUnescapedHtml = /[&<>"']/g,
  1360. reHasEscapedHtml = RegExp(reEscapedHtml.source),
  1361. reHasUnescapedHtml = RegExp(reUnescapedHtml.source);
  1362. /** Used to match template delimiters. */
  1363. var reEscape = /<%-([\s\S]+?)%>/g,
  1364. reEvaluate = /<%([\s\S]+?)%>/g,
  1365. reInterpolate = /<%=([\s\S]+?)%>/g;
  1366. /** Used to match property names within property paths. */
  1367. var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,
  1368. reIsPlainProp = /^\w*$/,
  1369. rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g;
  1370. /**
  1371. * Used to match `RegExp`
  1372. * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).
  1373. */
  1374. var reRegExpChar = /[\\^$.*+?()[\]{}|]/g,
  1375. reHasRegExpChar = RegExp(reRegExpChar.source);
  1376. /** Used to match leading whitespace. */
  1377. var reTrimStart = /^\s+/;
  1378. /** Used to match a single whitespace character. */
  1379. var reWhitespace = /\s/;
  1380. /** Used to match wrap detail comments. */
  1381. var reWrapComment = /\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,
  1382. reWrapDetails = /\{\n\/\* \[wrapped with (.+)\] \*/,
  1383. reSplitDetails = /,? & /;
  1384. /** Used to match words composed of alphanumeric characters. */
  1385. var reAsciiWord = /[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;
  1386. /**
  1387. * Used to validate the `validate` option in `_.template` variable.
  1388. *
  1389. * Forbids characters which could potentially change the meaning of the function argument definition:
  1390. * - "()," (modification of function parameters)
  1391. * - "=" (default value)
  1392. * - "[]{}" (destructuring of function parameters)
  1393. * - "/" (beginning of a comment)
  1394. * - whitespace
  1395. */
  1396. var reForbiddenIdentifierChars = /[()=,{}\[\]\/\s]/;
  1397. /** Used to match backslashes in property paths. */
  1398. var reEscapeChar = /\\(\\)?/g;
  1399. /**
  1400. * Used to match
  1401. * [ES template delimiters](http://ecma-international.org/ecma-262/7.0/#sec-template-literal-lexical-components).
  1402. */
  1403. var reEsTemplate = /\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g;
  1404. /** Used to match `RegExp` flags from their coerced string values. */
  1405. var reFlags = /\w*$/;
  1406. /** Used to detect bad signed hexadecimal string values. */
  1407. var reIsBadHex = /^[-+]0x[0-9a-f]+$/i;
  1408. /** Used to detect binary string values. */
  1409. var reIsBinary = /^0b[01]+$/i;
  1410. /** Used to detect host constructors (Safari). */
  1411. var reIsHostCtor = /^\[object .+?Constructor\]$/;
  1412. /** Used to detect octal string values. */
  1413. var reIsOctal = /^0o[0-7]+$/i;
  1414. /** Used to detect unsigned integer values. */
  1415. var reIsUint = /^(?:0|[1-9]\d*)$/;
  1416. /** Used to match Latin Unicode letters (excluding mathematical operators). */
  1417. var reLatin = /[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g;
  1418. /** Used to ensure capturing order of template delimiters. */
  1419. var reNoMatch = /($^)/;
  1420. /** Used to match unescaped characters in compiled string literals. */
  1421. var reUnescapedString = /['\n\r\u2028\u2029\\]/g;
  1422. /** Used to compose unicode character classes. */
  1423. var rsAstralRange = '\\ud800-\\udfff',
  1424. rsComboMarksRange = '\\u0300-\\u036f',
  1425. reComboHalfMarksRange = '\\ufe20-\\ufe2f',
  1426. rsComboSymbolsRange = '\\u20d0-\\u20ff',
  1427. rsComboRange = rsComboMarksRange + reComboHalfMarksRange + rsComboSymbolsRange,
  1428. rsDingbatRange = '\\u2700-\\u27bf',
  1429. rsLowerRange = 'a-z\\xdf-\\xf6\\xf8-\\xff',
  1430. rsMathOpRange = '\\xac\\xb1\\xd7\\xf7',
  1431. rsNonCharRange = '\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf',
  1432. rsPunctuationRange = '\\u2000-\\u206f',
  1433. 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',
  1434. rsUpperRange = 'A-Z\\xc0-\\xd6\\xd8-\\xde',
  1435. rsVarRange = '\\ufe0e\\ufe0f',
  1436. rsBreakRange = rsMathOpRange + rsNonCharRange + rsPunctuationRange + rsSpaceRange;
  1437. /** Used to compose unicode capture groups. */
  1438. var rsApos = "['\u2019]",
  1439. rsAstral = '[' + rsAstralRange + ']',
  1440. rsBreak = '[' + rsBreakRange + ']',
  1441. rsCombo = '[' + rsComboRange + ']',
  1442. rsDigits = '\\d+',
  1443. rsDingbat = '[' + rsDingbatRange + ']',
  1444. rsLower = '[' + rsLowerRange + ']',
  1445. rsMisc = '[^' + rsAstralRange + rsBreakRange + rsDigits + rsDingbatRange + rsLowerRange + rsUpperRange + ']',
  1446. rsFitz = '\\ud83c[\\udffb-\\udfff]',
  1447. rsModifier = '(?:' + rsCombo + '|' + rsFitz + ')',
  1448. rsNonAstral = '[^' + rsAstralRange + ']',
  1449. rsRegional = '(?:\\ud83c[\\udde6-\\uddff]){2}',
  1450. rsSurrPair = '[\\ud800-\\udbff][\\udc00-\\udfff]',
  1451. rsUpper = '[' + rsUpperRange + ']',
  1452. rsZWJ = '\\u200d';
  1453. /** Used to compose unicode regexes. */
  1454. var rsMiscLower = '(?:' + rsLower + '|' + rsMisc + ')',
  1455. rsMiscUpper = '(?:' + rsUpper + '|' + rsMisc + ')',
  1456. rsOptContrLower = '(?:' + rsApos + '(?:d|ll|m|re|s|t|ve))?',
  1457. rsOptContrUpper = '(?:' + rsApos + '(?:D|LL|M|RE|S|T|VE))?',
  1458. reOptMod = rsModifier + '?',
  1459. rsOptVar = '[' + rsVarRange + ']?',
  1460. rsOptJoin = '(?:' + rsZWJ + '(?:' + [rsNonAstral, rsRegional, rsSurrPair].join('|') + ')' + rsOptVar + reOptMod + ')*',
  1461. rsOrdLower = '\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])',
  1462. rsOrdUpper = '\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])',
  1463. rsSeq = rsOptVar + reOptMod + rsOptJoin,
  1464. rsEmoji = '(?:' + [rsDingbat, rsRegional, rsSurrPair].join('|') + ')' + rsSeq,
  1465. rsSymbol = '(?:' + [rsNonAstral + rsCombo + '?', rsCombo, rsRegional, rsSurrPair, rsAstral].join('|') + ')';
  1466. /** Used to match apostrophes. */
  1467. var reApos = RegExp(rsApos, 'g');
  1468. /**
  1469. * Used to match [combining diacritical marks](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks) and
  1470. * [combining diacritical marks for symbols](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks_for_Symbols).
  1471. */
  1472. var reComboMark = RegExp(rsCombo, 'g');
  1473. /** Used to match [string symbols](https://mathiasbynens.be/notes/javascript-unicode). */
  1474. var reUnicode = RegExp(rsFitz + '(?=' + rsFitz + ')|' + rsSymbol + rsSeq, 'g');
  1475. /** Used to match complex or compound words. */
  1476. var reUnicodeWord = RegExp([
  1477. rsUpper + '?' + rsLower + '+' + rsOptContrLower + '(?=' + [rsBreak, rsUpper, '$'].join('|') + ')',
  1478. rsMiscUpper + '+' + rsOptContrUpper + '(?=' + [rsBreak, rsUpper + rsMiscLower, '$'].join('|') + ')',
  1479. rsUpper + '?' + rsMiscLower + '+' + rsOptContrLower,
  1480. rsUpper + '+' + rsOptContrUpper,
  1481. rsOrdUpper,
  1482. rsOrdLower,
  1483. rsDigits,
  1484. rsEmoji
  1485. ].join('|'), 'g');
  1486. /** 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/). */
  1487. var reHasUnicode = RegExp('[' + rsZWJ + rsAstralRange + rsComboRange + rsVarRange + ']');
  1488. /** Used to detect strings that need a more robust regexp to match words. */
  1489. 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 ]/;
  1490. /** Used to assign default `context` object properties. */
  1491. var contextProps = [
  1492. 'Array', 'Buffer', 'DataView', 'Date', 'Error', 'Float32Array', 'Float64Array',
  1493. 'Function', 'Int8Array', 'Int16Array', 'Int32Array', 'Map', 'Math', 'Object',
  1494. 'Promise', 'RegExp', 'Set', 'String', 'Symbol', 'TypeError', 'Uint8Array',
  1495. 'Uint8ClampedArray', 'Uint16Array', 'Uint32Array', 'WeakMap',
  1496. '_', 'clearTimeout', 'isFinite', 'parseInt', 'setTimeout'
  1497. ];
  1498. /** Used to make template sourceURLs easier to identify. */
  1499. var templateCounter = -1;
  1500. /** Used to identify `toStringTag` values of typed arrays. */
  1501. var typedArrayTags = {};
  1502. typedArrayTags[float32Tag] = typedArrayTags[float64Tag] =
  1503. typedArrayTags[int8Tag] = typedArrayTags[int16Tag] =
  1504. typedArrayTags[int32Tag] = typedArrayTags[uint8Tag] =
  1505. typedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] =
  1506. typedArrayTags[uint32Tag] = true;
  1507. typedArrayTags[argsTag] = typedArrayTags[arrayTag] =
  1508. typedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] =
  1509. typedArrayTags[dataViewTag] = typedArrayTags[dateTag] =
  1510. typedArrayTags[errorTag] = typedArrayTags[funcTag] =
  1511. typedArrayTags[mapTag] = typedArrayTags[numberTag] =
  1512. typedArrayTags[objectTag] = typedArrayTags[regexpTag] =
  1513. typedArrayTags[setTag] = typedArrayTags[stringTag] =
  1514. typedArrayTags[weakMapTag] = false;
  1515. /** Used to identify `toStringTag` values supported by `_.clone`. */
  1516. var cloneableTags = {};
  1517. cloneableTags[argsTag] = cloneableTags[arrayTag] =
  1518. cloneableTags[arrayBufferTag] = cloneableTags[dataViewTag] =
  1519. cloneableTags[boolTag] = cloneableTags[dateTag] =
  1520. cloneableTags[float32Tag] = cloneableTags[float64Tag] =
  1521. cloneableTags[int8Tag] = cloneableTags[int16Tag] =
  1522. cloneableTags[int32Tag] = cloneableTags[mapTag] =
  1523. cloneableTags[numberTag] = cloneableTags[objectTag] =
  1524. cloneableTags[regexpTag] = cloneableTags[setTag] =
  1525. cloneableTags[stringTag] = cloneableTags[symbolTag] =
  1526. cloneableTags[uint8Tag] = cloneableTags[uint8ClampedTag] =
  1527. cloneableTags[uint16Tag] = cloneableTags[uint32Tag] = true;
  1528. cloneableTags[errorTag] = cloneableTags[funcTag] =
  1529. cloneableTags[weakMapTag] = false;
  1530. /** Used to map Latin Unicode letters to basic Latin letters. */
  1531. var deburredLetters = {
  1532. // Latin-1 Supplement block.
  1533. '\xc0': 'A', '\xc1': 'A', '\xc2': 'A', '\xc3': 'A', '\xc4': 'A', '\xc5': 'A',
  1534. '\xe0': 'a', '\xe1': 'a', '\xe2': 'a', '\xe3': 'a', '\xe4': 'a', '\xe5': 'a',
  1535. '\xc7': 'C', '\xe7': 'c',
  1536. '\xd0': 'D', '\xf0': 'd',
  1537. '\xc8': 'E', '\xc9': 'E', '\xca': 'E', '\xcb': 'E',
  1538. '\xe8': 'e', '\xe9': 'e', '\xea': 'e', '\xeb': 'e',
  1539. '\xcc': 'I', '\xcd': 'I', '\xce': 'I', '\xcf': 'I',
  1540. '\xec': 'i', '\xed': 'i', '\xee': 'i', '\xef': 'i',
  1541. '\xd1': 'N', '\xf1': 'n',
  1542. '\xd2': 'O', '\xd3': 'O', '\xd4': 'O', '\xd5': 'O', '\xd6': 'O', '\xd8': 'O',
  1543. '\xf2': 'o', '\xf3': 'o', '\xf4': 'o', '\xf5': 'o', '\xf6': 'o', '\xf8': 'o',
  1544. '\xd9': 'U', '\xda': 'U', '\xdb': 'U', '\xdc': 'U',
  1545. '\xf9': 'u', '\xfa': 'u', '\xfb': 'u', '\xfc': 'u',
  1546. '\xdd': 'Y', '\xfd': 'y', '\xff': 'y',
  1547. '\xc6': 'Ae', '\xe6': 'ae',
  1548. '\xde': 'Th', '\xfe': 'th',
  1549. '\xdf': 'ss',
  1550. // Latin Extended-A block.
  1551. '\u0100': 'A', '\u0102': 'A', '\u0104': 'A',
  1552. '\u0101': 'a', '\u0103': 'a', '\u0105': 'a',
  1553. '\u0106': 'C', '\u0108': 'C', '\u010a': 'C', '\u010c': 'C',
  1554. '\u0107': 'c', '\u0109': 'c', '\u010b': 'c', '\u010d': 'c',
  1555. '\u010e': 'D', '\u0110': 'D', '\u010f': 'd', '\u0111': 'd',
  1556. '\u0112': 'E', '\u0114': 'E', '\u0116': 'E', '\u0118': 'E', '\u011a': 'E',
  1557. '\u0113': 'e', '\u0115': 'e', '\u0117': 'e', '\u0119': 'e', '\u011b': 'e',
  1558. '\u011c': 'G', '\u011e': 'G', '\u0120': 'G', '\u0122': 'G',
  1559. '\u011d': 'g', '\u011f': 'g', '\u0121': 'g', '\u0123': 'g',
  1560. '\u0124': 'H', '\u0126': 'H', '\u0125': 'h', '\u0127': 'h',
  1561. '\u0128': 'I', '\u012a': 'I', '\u012c': 'I', '\u012e': 'I', '\u0130': 'I',
  1562. '\u0129': 'i', '\u012b': 'i', '\u012d': 'i', '\u012f': 'i', '\u0131': 'i',
  1563. '\u0134': 'J', '\u0135': 'j',
  1564. '\u0136': 'K', '\u0137': 'k', '\u0138': 'k',
  1565. '\u0139': 'L', '\u013b': 'L', '\u013d': 'L', '\u013f': 'L', '\u0141': 'L',
  1566. '\u013a': 'l', '\u013c': 'l', '\u013e': 'l', '\u0140': 'l', '\u0142': 'l',
  1567. '\u0143': 'N', '\u0145': 'N', '\u0147': 'N', '\u014a': 'N',
  1568. '\u0144': 'n', '\u0146': 'n', '\u0148': 'n', '\u014b': 'n',
  1569. '\u014c': 'O', '\u014e': 'O', '\u0150': 'O',
  1570. '\u014d': 'o', '\u014f': 'o', '\u0151': 'o',
  1571. '\u0154': 'R', '\u0156': 'R', '\u0158': 'R',
  1572. '\u0155': 'r', '\u0157': 'r', '\u0159': 'r',
  1573. '\u015a': 'S', '\u015c': 'S', '\u015e': 'S', '\u0160': 'S',
  1574. '\u015b': 's', '\u015d': 's', '\u015f': 's', '\u0161': 's',
  1575. '\u0162': 'T', '\u0164': 'T', '\u0166': 'T',
  1576. '\u0163': 't', '\u0165': 't', '\u0167': 't',
  1577. '\u0168': 'U', '\u016a': 'U', '\u016c': 'U', '\u016e': 'U', '\u0170': 'U', '\u0172': 'U',
  1578. '\u0169': 'u', '\u016b': 'u', '\u016d': 'u', '\u016f': 'u', '\u0171': 'u', '\u0173': 'u',
  1579. '\u0174': 'W', '\u0175': 'w',
  1580. '\u0176': 'Y', '\u0177': 'y', '\u0178': 'Y',
  1581. '\u0179': 'Z', '\u017b': 'Z', '\u017d': 'Z',
  1582. '\u017a': 'z', '\u017c': 'z', '\u017e': 'z',
  1583. '\u0132': 'IJ', '\u0133': 'ij',
  1584. '\u0152': 'Oe', '\u0153': 'oe',
  1585. '\u0149': "'n", '\u017f': 's'
  1586. };
  1587. /** Used to map characters to HTML entities. */
  1588. var htmlEscapes = {
  1589. '&': '&amp;',
  1590. '<': '&lt;',
  1591. '>': '&gt;',
  1592. '"': '&quot;',
  1593. "'": '&#39;'
  1594. };
  1595. /** Used to map HTML entities to characters. */
  1596. var htmlUnescapes = {
  1597. '&amp;': '&',
  1598. '&lt;': '<',
  1599. '&gt;': '>',
  1600. '&quot;': '"',
  1601. '&#39;': "'"
  1602. };
  1603. /** Used to escape characters for inclusion in compiled string literals. */
  1604. var stringEscapes = {
  1605. '\\': '\\',
  1606. "'": "'",
  1607. '\n': 'n',
  1608. '\r': 'r',
  1609. '\u2028': 'u2028',
  1610. '\u2029': 'u2029'
  1611. };
  1612. /** Built-in method references without a dependency on `root`. */
  1613. var freeParseFloat = parseFloat,
  1614. freeParseInt = parseInt;
  1615. /** Detect free variable `global` from Node.js. */
  1616. var freeGlobal = typeof __webpack_require__.g == 'object' && __webpack_require__.g && __webpack_require__.g.Object === Object && __webpack_require__.g;
  1617. /** Detect free variable `self`. */
  1618. var freeSelf = typeof self == 'object' && self && self.Object === Object && self;
  1619. /** Used as a reference to the global object. */
  1620. var root = freeGlobal || freeSelf || Function('return this')();
  1621. /** Detect free variable `exports`. */
  1622. var freeExports = true && exports && !exports.nodeType && exports;
  1623. /** Detect free variable `module`. */
  1624. var freeModule = freeExports && "object" == 'object' && module && !module.nodeType && module;
  1625. /** Detect the popular CommonJS extension `module.exports`. */
  1626. var moduleExports = freeModule && freeModule.exports === freeExports;
  1627. /** Detect free variable `process` from Node.js. */
  1628. var freeProcess = moduleExports && freeGlobal.process;
  1629. /** Used to access faster Node.js helpers. */
  1630. var nodeUtil = (function() {
  1631. try {
  1632. // Use `util.types` for Node.js 10+.
  1633. var types = freeModule && freeModule.require && freeModule.require('util').types;
  1634. if (types) {
  1635. return types;
  1636. }
  1637. // Legacy `process.binding('util')` for Node.js < 10.
  1638. return freeProcess && freeProcess.binding && freeProcess.binding('util');
  1639. } catch (e) {}
  1640. }());
  1641. /* Node.js helper references. */
  1642. var nodeIsArrayBuffer = nodeUtil && nodeUtil.isArrayBuffer,
  1643. nodeIsDate = nodeUtil && nodeUtil.isDate,
  1644. nodeIsMap = nodeUtil && nodeUtil.isMap,
  1645. nodeIsRegExp = nodeUtil && nodeUtil.isRegExp,
  1646. nodeIsSet = nodeUtil && nodeUtil.isSet,
  1647. nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray;
  1648. /*--------------------------------------------------------------------------*/
  1649. /**
  1650. * A faster alternative to `Function#apply`, this function invokes `func`
  1651. * with the `this` binding of `thisArg` and the arguments of `args`.
  1652. *
  1653. * @private
  1654. * @param {Function} func The function to invoke.
  1655. * @param {*} thisArg The `this` binding of `func`.
  1656. * @param {Array} args The arguments to invoke `func` with.
  1657. * @returns {*} Returns the result of `func`.
  1658. */
  1659. function apply(func, thisArg, args) {
  1660. switch (args.length) {
  1661. case 0: return func.call(thisArg);
  1662. case 1: return func.call(thisArg, args[0]);
  1663. case 2: return func.call(thisArg, args[0], args[1]);
  1664. case 3: return func.call(thisArg, args[0], args[1], args[2]);
  1665. }
  1666. return func.apply(thisArg, args);
  1667. }
  1668. /**
  1669. * A specialized version of `baseAggregator` for arrays.
  1670. *
  1671. * @private
  1672. * @param {Array} [array] The array to iterate over.
  1673. * @param {Function} setter The function to set `accumulator` values.
  1674. * @param {Function} iteratee The iteratee to transform keys.
  1675. * @param {Object} accumulator The initial aggregated object.
  1676. * @returns {Function} Returns `accumulator`.
  1677. */
  1678. function arrayAggregator(array, setter, iteratee, accumulator) {
  1679. var index = -1,
  1680. length = array == null ? 0 : array.length;
  1681. while (++index < length) {
  1682. var value = array[index];
  1683. setter(accumulator, value, iteratee(value), array);
  1684. }
  1685. return accumulator;
  1686. }
  1687. /**
  1688. * A specialized version of `_.forEach` for arrays without support for
  1689. * iteratee shorthands.
  1690. *
  1691. * @private
  1692. * @param {Array} [array] The array to iterate over.
  1693. * @param {Function} iteratee The function invoked per iteration.
  1694. * @returns {Array} Returns `array`.
  1695. */
  1696. function arrayEach(array, iteratee) {
  1697. var index = -1,
  1698. length = array == null ? 0 : array.length;
  1699. while (++index < length) {
  1700. if (iteratee(array[index], index, array) === false) {
  1701. break;
  1702. }
  1703. }
  1704. return array;
  1705. }
  1706. /**
  1707. * A specialized version of `_.forEachRight` for arrays without support for
  1708. * iteratee shorthands.
  1709. *
  1710. * @private
  1711. * @param {Array} [array] The array to iterate over.
  1712. * @param {Function} iteratee The function invoked per iteration.
  1713. * @returns {Array} Returns `array`.
  1714. */
  1715. function arrayEachRight(array, iteratee) {
  1716. var length = array == null ? 0 : array.length;
  1717. while (length--) {
  1718. if (iteratee(array[length], length, array) === false) {
  1719. break;
  1720. }
  1721. }
  1722. return array;
  1723. }
  1724. /**
  1725. * A specialized version of `_.every` for arrays without support for
  1726. * iteratee shorthands.
  1727. *
  1728. * @private
  1729. * @param {Array} [array] The array to iterate over.
  1730. * @param {Function} predicate The function invoked per iteration.
  1731. * @returns {boolean} Returns `true` if all elements pass the predicate check,
  1732. * else `false`.
  1733. */
  1734. function arrayEvery(array, predicate) {
  1735. var index = -1,
  1736. length = array == null ? 0 : array.length;
  1737. while (++index < length) {
  1738. if (!predicate(array[index], index, array)) {
  1739. return false;
  1740. }
  1741. }
  1742. return true;
  1743. }
  1744. /**
  1745. * A specialized version of `_.filter` for arrays without support for
  1746. * iteratee shorthands.
  1747. *
  1748. * @private
  1749. * @param {Array} [array] The array to iterate over.
  1750. * @param {Function} predicate The function invoked per iteration.
  1751. * @returns {Array} Returns the new filtered array.
  1752. */
  1753. function arrayFilter(array, predicate) {
  1754. var index = -1,
  1755. length = array == null ? 0 : array.length,
  1756. resIndex = 0,
  1757. result = [];
  1758. while (++index < length) {
  1759. var value = array[index];
  1760. if (predicate(value, index, array)) {
  1761. result[resIndex++] = value;
  1762. }
  1763. }
  1764. return result;
  1765. }
  1766. /**
  1767. * A specialized version of `_.includes` for arrays without support for
  1768. * specifying an index to search from.
  1769. *
  1770. * @private
  1771. * @param {Array} [array] The array to inspect.
  1772. * @param {*} target The value to search for.
  1773. * @returns {boolean} Returns `true` if `target` is found, else `false`.
  1774. */
  1775. function arrayIncludes(array, value) {
  1776. var length = array == null ? 0 : array.length;
  1777. return !!length && baseIndexOf(array, value, 0) > -1;
  1778. }
  1779. /**
  1780. * This function is like `arrayIncludes` except that it accepts a comparator.
  1781. *
  1782. * @private
  1783. * @param {Array} [array] The array to inspect.
  1784. * @param {*} target The value to search for.
  1785. * @param {Function} comparator The comparator invoked per element.
  1786. * @returns {boolean} Returns `true` if `target` is found, else `false`.
  1787. */
  1788. function arrayIncludesWith(array, value, comparator) {
  1789. var index = -1,
  1790. length = array == null ? 0 : array.length;
  1791. while (++index < length) {
  1792. if (comparator(value, array[index])) {
  1793. return true;
  1794. }
  1795. }
  1796. return false;
  1797. }
  1798. /**
  1799. * A specialized version of `_.map` for arrays without support for iteratee
  1800. * shorthands.
  1801. *
  1802. * @private
  1803. * @param {Array} [array] The array to iterate over.
  1804. * @param {Function} iteratee The function invoked per iteration.
  1805. * @returns {Array} Returns the new mapped array.
  1806. */
  1807. function arrayMap(array, iteratee) {
  1808. var index = -1,
  1809. length = array == null ? 0 : array.length,
  1810. result = Array(length);
  1811. while (++index < length) {
  1812. result[index] = iteratee(array[index], index, array);
  1813. }
  1814. return result;
  1815. }
  1816. /**
  1817. * Appends the elements of `values` to `array`.
  1818. *
  1819. * @private
  1820. * @param {Array} array The array to modify.
  1821. * @param {Array} values The values to append.
  1822. * @returns {Array} Returns `array`.
  1823. */
  1824. function arrayPush(array, values) {
  1825. var index = -1,
  1826. length = values.length,
  1827. offset = array.length;
  1828. while (++index < length) {
  1829. array[offset + index] = values[index];
  1830. }
  1831. return array;
  1832. }
  1833. /**
  1834. * A specialized version of `_.reduce` for arrays without support for
  1835. * iteratee shorthands.
  1836. *
  1837. * @private
  1838. * @param {Array} [array] The array to iterate over.
  1839. * @param {Function} iteratee The function invoked per iteration.
  1840. * @param {*} [accumulator] The initial value.
  1841. * @param {boolean} [initAccum] Specify using the first element of `array` as
  1842. * the initial value.
  1843. * @returns {*} Returns the accumulated value.
  1844. */
  1845. function arrayReduce(array, iteratee, accumulator, initAccum) {
  1846. var index = -1,
  1847. length = array == null ? 0 : array.length;
  1848. if (initAccum && length) {
  1849. accumulator = array[++index];
  1850. }
  1851. while (++index < length) {
  1852. accumulator = iteratee(accumulator, array[index], index, array);
  1853. }
  1854. return accumulator;
  1855. }
  1856. /**
  1857. * A specialized version of `_.reduceRight` for arrays without support for
  1858. * iteratee shorthands.
  1859. *
  1860. * @private
  1861. * @param {Array} [array] The array to iterate over.
  1862. * @param {Function} iteratee The function invoked per iteration.
  1863. * @param {*} [accumulator] The initial value.
  1864. * @param {boolean} [initAccum] Specify using the last element of `array` as
  1865. * the initial value.
  1866. * @returns {*} Returns the accumulated value.
  1867. */
  1868. function arrayReduceRight(array, iteratee, accumulator, initAccum) {
  1869. var length = array == null ? 0 : array.length;
  1870. if (initAccum && length) {
  1871. accumulator = array[--length];
  1872. }
  1873. while (length--) {
  1874. accumulator = iteratee(accumulator, array[length], length, array);
  1875. }
  1876. return accumulator;
  1877. }
  1878. /**
  1879. * A specialized version of `_.some` for arrays without support for iteratee
  1880. * shorthands.
  1881. *
  1882. * @private
  1883. * @param {Array} [array] The array to iterate over.
  1884. * @param {Function} predicate The function invoked per iteration.
  1885. * @returns {boolean} Returns `true` if any element passes the predicate check,
  1886. * else `false`.
  1887. */
  1888. function arraySome(array, predicate) {
  1889. var index = -1,
  1890. length = array == null ? 0 : array.length;
  1891. while (++index < length) {
  1892. if (predicate(array[index], index, array)) {
  1893. return true;
  1894. }
  1895. }
  1896. return false;
  1897. }
  1898. /**
  1899. * Gets the size of an ASCII `string`.
  1900. *
  1901. * @private
  1902. * @param {string} string The string inspect.
  1903. * @returns {number} Returns the string size.
  1904. */
  1905. var asciiSize = baseProperty('length');
  1906. /**
  1907. * Converts an ASCII `string` to an array.
  1908. *
  1909. * @private
  1910. * @param {string} string The string to convert.
  1911. * @returns {Array} Returns the converted array.
  1912. */
  1913. function asciiToArray(string) {
  1914. return string.split('');
  1915. }
  1916. /**
  1917. * Splits an ASCII `string` into an array of its words.
  1918. *
  1919. * @private
  1920. * @param {string} The string to inspect.
  1921. * @returns {Array} Returns the words of `string`.
  1922. */
  1923. function asciiWords(string) {
  1924. return string.match(reAsciiWord) || [];
  1925. }
  1926. /**
  1927. * The base implementation of methods like `_.findKey` and `_.findLastKey`,
  1928. * without support for iteratee shorthands, which iterates over `collection`
  1929. * using `eachFunc`.
  1930. *
  1931. * @private
  1932. * @param {Array|Object} collection The collection to inspect.
  1933. * @param {Function} predicate The function invoked per iteration.
  1934. * @param {Function} eachFunc The function to iterate over `collection`.
  1935. * @returns {*} Returns the found element or its key, else `undefined`.
  1936. */
  1937. function baseFindKey(collection, predicate, eachFunc) {
  1938. var result;
  1939. eachFunc(collection, function(value, key, collection) {
  1940. if (predicate(value, key, collection)) {
  1941. result = key;
  1942. return false;
  1943. }
  1944. });
  1945. return result;
  1946. }
  1947. /**
  1948. * The base implementation of `_.findIndex` and `_.findLastIndex` without
  1949. * support for iteratee shorthands.
  1950. *
  1951. * @private
  1952. * @param {Array} array The array to inspect.
  1953. * @param {Function} predicate The function invoked per iteration.
  1954. * @param {number} fromIndex The index to search from.
  1955. * @param {boolean} [fromRight] Specify iterating from right to left.
  1956. * @returns {number} Returns the index of the matched value, else `-1`.
  1957. */
  1958. function baseFindIndex(array, predicate, fromIndex, fromRight) {
  1959. var length = array.length,
  1960. index = fromIndex + (fromRight ? 1 : -1);
  1961. while ((fromRight ? index-- : ++index < length)) {
  1962. if (predicate(array[index], index, array)) {
  1963. return index;
  1964. }
  1965. }
  1966. return -1;
  1967. }
  1968. /**
  1969. * The base implementation of `_.indexOf` without `fromIndex` bounds checks.
  1970. *
  1971. * @private
  1972. * @param {Array} array The array to inspect.
  1973. * @param {*} value The value to search for.
  1974. * @param {number} fromIndex The index to search from.
  1975. * @returns {number} Returns the index of the matched value, else `-1`.
  1976. */
  1977. function baseIndexOf(array, value, fromIndex) {
  1978. return value === value
  1979. ? strictIndexOf(array, value, fromIndex)
  1980. : baseFindIndex(array, baseIsNaN, fromIndex);
  1981. }
  1982. /**
  1983. * This function is like `baseIndexOf` except that it accepts a comparator.
  1984. *
  1985. * @private
  1986. * @param {Array} array The array to inspect.
  1987. * @param {*} value The value to search for.
  1988. * @param {number} fromIndex The index to search from.
  1989. * @param {Function} comparator The comparator invoked per element.
  1990. * @returns {number} Returns the index of the matched value, else `-1`.
  1991. */
  1992. function baseIndexOfWith(array, value, fromIndex, comparator) {
  1993. var index = fromIndex - 1,
  1994. length = array.length;
  1995. while (++index < length) {
  1996. if (comparator(array[index], value)) {
  1997. return index;
  1998. }
  1999. }
  2000. return -1;
  2001. }
  2002. /**
  2003. * The base implementation of `_.isNaN` without support for number objects.
  2004. *
  2005. * @private
  2006. * @param {*} value The value to check.
  2007. * @returns {boolean} Returns `true` if `value` is `NaN`, else `false`.
  2008. */
  2009. function baseIsNaN(value) {
  2010. return value !== value;
  2011. }
  2012. /**
  2013. * The base implementation of `_.mean` and `_.meanBy` without support for
  2014. * iteratee shorthands.
  2015. *
  2016. * @private
  2017. * @param {Array} array The array to iterate over.
  2018. * @param {Function} iteratee The function invoked per iteration.
  2019. * @returns {number} Returns the mean.
  2020. */
  2021. function baseMean(array, iteratee) {
  2022. var length = array == null ? 0 : array.length;
  2023. return length ? (baseSum(array, iteratee) / length) : NAN;
  2024. }
  2025. /**
  2026. * The base implementation of `_.property` without support for deep paths.
  2027. *
  2028. * @private
  2029. * @param {string} key The key of the property to get.
  2030. * @returns {Function} Returns the new accessor function.
  2031. */
  2032. function baseProperty(key) {
  2033. return function(object) {
  2034. return object == null ? undefined : object[key];
  2035. };
  2036. }
  2037. /**
  2038. * The base implementation of `_.propertyOf` without support for deep paths.
  2039. *
  2040. * @private
  2041. * @param {Object} object The object to query.
  2042. * @returns {Function} Returns the new accessor function.
  2043. */
  2044. function basePropertyOf(object) {
  2045. return function(key) {
  2046. return object == null ? undefined : object[key];
  2047. };
  2048. }
  2049. /**
  2050. * The base implementation of `_.reduce` and `_.reduceRight`, without support
  2051. * for iteratee shorthands, which iterates over `collection` using `eachFunc`.
  2052. *
  2053. * @private
  2054. * @param {Array|Object} collection The collection to iterate over.
  2055. * @param {Function} iteratee The function invoked per iteration.
  2056. * @param {*} accumulator The initial value.
  2057. * @param {boolean} initAccum Specify using the first or last element of
  2058. * `collection` as the initial value.
  2059. * @param {Function} eachFunc The function to iterate over `collection`.
  2060. * @returns {*} Returns the accumulated value.
  2061. */
  2062. function baseReduce(collection, iteratee, accumulator, initAccum, eachFunc) {
  2063. eachFunc(collection, function(value, index, collection) {
  2064. accumulator = initAccum
  2065. ? (initAccum = false, value)
  2066. : iteratee(accumulator, value, index, collection);
  2067. });
  2068. return accumulator;
  2069. }
  2070. /**
  2071. * The base implementation of `_.sortBy` which uses `comparer` to define the
  2072. * sort order of `array` and replaces criteria objects with their corresponding
  2073. * values.
  2074. *
  2075. * @private
  2076. * @param {Array} array The array to sort.
  2077. * @param {Function} comparer The function to define sort order.
  2078. * @returns {Array} Returns `array`.
  2079. */
  2080. function baseSortBy(array, comparer) {
  2081. var length = array.length;
  2082. array.sort(comparer);
  2083. while (length--) {
  2084. array[length] = array[length].value;
  2085. }
  2086. return array;
  2087. }
  2088. /**
  2089. * The base implementation of `_.sum` and `_.sumBy` without support for
  2090. * iteratee shorthands.
  2091. *
  2092. * @private
  2093. * @param {Array} array The array to iterate over.
  2094. * @param {Function} iteratee The function invoked per iteration.
  2095. * @returns {number} Returns the sum.
  2096. */
  2097. function baseSum(array, iteratee) {
  2098. var result,
  2099. index = -1,
  2100. length = array.length;
  2101. while (++index < length) {
  2102. var current = iteratee(array[index]);
  2103. if (current !== undefined) {
  2104. result = result === undefined ? current : (result + current);
  2105. }
  2106. }
  2107. return result;
  2108. }
  2109. /**
  2110. * The base implementation of `_.times` without support for iteratee shorthands
  2111. * or max array length checks.
  2112. *
  2113. * @private
  2114. * @param {number} n The number of times to invoke `iteratee`.
  2115. * @param {Function} iteratee The function invoked per iteration.
  2116. * @returns {Array} Returns the array of results.
  2117. */
  2118. function baseTimes(n, iteratee) {
  2119. var index = -1,
  2120. result = Array(n);
  2121. while (++index < n) {
  2122. result[index] = iteratee(index);
  2123. }
  2124. return result;
  2125. }
  2126. /**
  2127. * The base implementation of `_.toPairs` and `_.toPairsIn` which creates an array
  2128. * of key-value pairs for `object` corresponding to the property names of `props`.
  2129. *
  2130. * @private
  2131. * @param {Object} object The object to query.
  2132. * @param {Array} props The property names to get values for.
  2133. * @returns {Object} Returns the key-value pairs.
  2134. */
  2135. function baseToPairs(object, props) {
  2136. return arrayMap(props, function(key) {
  2137. return [key, object[key]];
  2138. });
  2139. }
  2140. /**
  2141. * The base implementation of `_.trim`.
  2142. *
  2143. * @private
  2144. * @param {string} string The string to trim.
  2145. * @returns {string} Returns the trimmed string.
  2146. */
  2147. function baseTrim(string) {
  2148. return string
  2149. ? string.slice(0, trimmedEndIndex(string) + 1).replace(reTrimStart, '')
  2150. : string;
  2151. }
  2152. /**
  2153. * The base implementation of `_.unary` without support for storing metadata.
  2154. *
  2155. * @private
  2156. * @param {Function} func The function to cap arguments for.
  2157. * @returns {Function} Returns the new capped function.
  2158. */
  2159. function baseUnary(func) {
  2160. return function(value) {
  2161. return func(value);
  2162. };
  2163. }
  2164. /**
  2165. * The base implementation of `_.values` and `_.valuesIn` which creates an
  2166. * array of `object` property values corresponding to the property names
  2167. * of `props`.
  2168. *
  2169. * @private
  2170. * @param {Object} object The object to query.
  2171. * @param {Array} props The property names to get values for.
  2172. * @returns {Object} Returns the array of property values.
  2173. */
  2174. function baseValues(object, props) {
  2175. return arrayMap(props, function(key) {
  2176. return object[key];
  2177. });
  2178. }
  2179. /**
  2180. * Checks if a `cache` value for `key` exists.
  2181. *
  2182. * @private
  2183. * @param {Object} cache The cache to query.
  2184. * @param {string} key The key of the entry to check.
  2185. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  2186. */
  2187. function cacheHas(cache, key) {
  2188. return cache.has(key);
  2189. }
  2190. /**
  2191. * Used by `_.trim` and `_.trimStart` to get the index of the first string symbol
  2192. * that is not found in the character symbols.
  2193. *
  2194. * @private
  2195. * @param {Array} strSymbols The string symbols to inspect.
  2196. * @param {Array} chrSymbols The character symbols to find.
  2197. * @returns {number} Returns the index of the first unmatched string symbol.
  2198. */
  2199. function charsStartIndex(strSymbols, chrSymbols) {
  2200. var index = -1,
  2201. length = strSymbols.length;
  2202. while (++index < length && baseIndexOf(chrSymbols, strSymbols[index], 0) > -1) {}
  2203. return index;
  2204. }
  2205. /**
  2206. * Used by `_.trim` and `_.trimEnd` to get the index of the last string symbol
  2207. * that is not found in the character symbols.
  2208. *
  2209. * @private
  2210. * @param {Array} strSymbols The string symbols to inspect.
  2211. * @param {Array} chrSymbols The character symbols to find.
  2212. * @returns {number} Returns the index of the last unmatched string symbol.
  2213. */
  2214. function charsEndIndex(strSymbols, chrSymbols) {
  2215. var index = strSymbols.length;
  2216. while (index-- && baseIndexOf(chrSymbols, strSymbols[index], 0) > -1) {}
  2217. return index;
  2218. }
  2219. /**
  2220. * Gets the number of `placeholder` occurrences in `array`.
  2221. *
  2222. * @private
  2223. * @param {Array} array The array to inspect.
  2224. * @param {*} placeholder The placeholder to search for.
  2225. * @returns {number} Returns the placeholder count.
  2226. */
  2227. function countHolders(array, placeholder) {
  2228. var length = array.length,
  2229. result = 0;
  2230. while (length--) {
  2231. if (array[length] === placeholder) {
  2232. ++result;
  2233. }
  2234. }
  2235. return result;
  2236. }
  2237. /**
  2238. * Used by `_.deburr` to convert Latin-1 Supplement and Latin Extended-A
  2239. * letters to basic Latin letters.
  2240. *
  2241. * @private
  2242. * @param {string} letter The matched letter to deburr.
  2243. * @returns {string} Returns the deburred letter.
  2244. */
  2245. var deburrLetter = basePropertyOf(deburredLetters);
  2246. /**
  2247. * Used by `_.escape` to convert characters to HTML entities.
  2248. *
  2249. * @private
  2250. * @param {string} chr The matched character to escape.
  2251. * @returns {string} Returns the escaped character.
  2252. */
  2253. var escapeHtmlChar = basePropertyOf(htmlEscapes);
  2254. /**
  2255. * Used by `_.template` to escape characters for inclusion in compiled string literals.
  2256. *
  2257. * @private
  2258. * @param {string} chr The matched character to escape.
  2259. * @returns {string} Returns the escaped character.
  2260. */
  2261. function escapeStringChar(chr) {
  2262. return '\\' + stringEscapes[chr];
  2263. }
  2264. /**
  2265. * Gets the value at `key` of `object`.
  2266. *
  2267. * @private
  2268. * @param {Object} [object] The object to query.
  2269. * @param {string} key The key of the property to get.
  2270. * @returns {*} Returns the property value.
  2271. */
  2272. function getValue(object, key) {
  2273. return object == null ? undefined : object[key];
  2274. }
  2275. /**
  2276. * Checks if `string` contains Unicode symbols.
  2277. *
  2278. * @private
  2279. * @param {string} string The string to inspect.
  2280. * @returns {boolean} Returns `true` if a symbol is found, else `false`.
  2281. */
  2282. function hasUnicode(string) {
  2283. return reHasUnicode.test(string);
  2284. }
  2285. /**
  2286. * Checks if `string` contains a word composed of Unicode symbols.
  2287. *
  2288. * @private
  2289. * @param {string} string The string to inspect.
  2290. * @returns {boolean} Returns `true` if a word is found, else `false`.
  2291. */
  2292. function hasUnicodeWord(string) {
  2293. return reHasUnicodeWord.test(string);
  2294. }
  2295. /**
  2296. * Converts `iterator` to an array.
  2297. *
  2298. * @private
  2299. * @param {Object} iterator The iterator to convert.
  2300. * @returns {Array} Returns the converted array.
  2301. */
  2302. function iteratorToArray(iterator) {
  2303. var data,
  2304. result = [];
  2305. while (!(data = iterator.next()).done) {
  2306. result.push(data.value);
  2307. }
  2308. return result;
  2309. }
  2310. /**
  2311. * Converts `map` to its key-value pairs.
  2312. *
  2313. * @private
  2314. * @param {Object} map The map to convert.
  2315. * @returns {Array} Returns the key-value pairs.
  2316. */
  2317. function mapToArray(map) {
  2318. var index = -1,
  2319. result = Array(map.size);
  2320. map.forEach(function(value, key) {
  2321. result[++index] = [key, value];
  2322. });
  2323. return result;
  2324. }
  2325. /**
  2326. * Creates a unary function that invokes `func` with its argument transformed.
  2327. *
  2328. * @private
  2329. * @param {Function} func The function to wrap.
  2330. * @param {Function} transform The argument transform.
  2331. * @returns {Function} Returns the new function.
  2332. */
  2333. function overArg(func, transform) {
  2334. return function(arg) {
  2335. return func(transform(arg));
  2336. };
  2337. }
  2338. /**
  2339. * Replaces all `placeholder` elements in `array` with an internal placeholder
  2340. * and returns an array of their indexes.
  2341. *
  2342. * @private
  2343. * @param {Array} array The array to modify.
  2344. * @param {*} placeholder The placeholder to replace.
  2345. * @returns {Array} Returns the new array of placeholder indexes.
  2346. */
  2347. function replaceHolders(array, placeholder) {
  2348. var index = -1,
  2349. length = array.length,
  2350. resIndex = 0,
  2351. result = [];
  2352. while (++index < length) {
  2353. var value = array[index];
  2354. if (value === placeholder || value === PLACEHOLDER) {
  2355. array[index] = PLACEHOLDER;
  2356. result[resIndex++] = index;
  2357. }
  2358. }
  2359. return result;
  2360. }
  2361. /**
  2362. * Converts `set` to an array of its values.
  2363. *
  2364. * @private
  2365. * @param {Object} set The set to convert.
  2366. * @returns {Array} Returns the values.
  2367. */
  2368. function setToArray(set) {
  2369. var index = -1,
  2370. result = Array(set.size);
  2371. set.forEach(function(value) {
  2372. result[++index] = value;
  2373. });
  2374. return result;
  2375. }
  2376. /**
  2377. * Converts `set` to its value-value pairs.
  2378. *
  2379. * @private
  2380. * @param {Object} set The set to convert.
  2381. * @returns {Array} Returns the value-value pairs.
  2382. */
  2383. function setToPairs(set) {
  2384. var index = -1,
  2385. result = Array(set.size);
  2386. set.forEach(function(value) {
  2387. result[++index] = [value, value];
  2388. });
  2389. return result;
  2390. }
  2391. /**
  2392. * A specialized version of `_.indexOf` which performs strict equality
  2393. * comparisons of values, i.e. `===`.
  2394. *
  2395. * @private
  2396. * @param {Array} array The array to inspect.
  2397. * @param {*} value The value to search for.
  2398. * @param {number} fromIndex The index to search from.
  2399. * @returns {number} Returns the index of the matched value, else `-1`.
  2400. */
  2401. function strictIndexOf(array, value, fromIndex) {
  2402. var index = fromIndex - 1,
  2403. length = array.length;
  2404. while (++index < length) {
  2405. if (array[index] === value) {
  2406. return index;
  2407. }
  2408. }
  2409. return -1;
  2410. }
  2411. /**
  2412. * A specialized version of `_.lastIndexOf` which performs strict equality
  2413. * comparisons of values, i.e. `===`.
  2414. *
  2415. * @private
  2416. * @param {Array} array The array to inspect.
  2417. * @param {*} value The value to search for.
  2418. * @param {number} fromIndex The index to search from.
  2419. * @returns {number} Returns the index of the matched value, else `-1`.
  2420. */
  2421. function strictLastIndexOf(array, value, fromIndex) {
  2422. var index = fromIndex + 1;
  2423. while (index--) {
  2424. if (array[index] === value) {
  2425. return index;
  2426. }
  2427. }
  2428. return index;
  2429. }
  2430. /**
  2431. * Gets the number of symbols in `string`.
  2432. *
  2433. * @private
  2434. * @param {string} string The string to inspect.
  2435. * @returns {number} Returns the string size.
  2436. */
  2437. function stringSize(string) {
  2438. return hasUnicode(string)
  2439. ? unicodeSize(string)
  2440. : asciiSize(string);
  2441. }
  2442. /**
  2443. * Converts `string` to an array.
  2444. *
  2445. * @private
  2446. * @param {string} string The string to convert.
  2447. * @returns {Array} Returns the converted array.
  2448. */
  2449. function stringToArray(string) {
  2450. return hasUnicode(string)
  2451. ? unicodeToArray(string)
  2452. : asciiToArray(string);
  2453. }
  2454. /**
  2455. * Used by `_.trim` and `_.trimEnd` to get the index of the last non-whitespace
  2456. * character of `string`.
  2457. *
  2458. * @private
  2459. * @param {string} string The string to inspect.
  2460. * @returns {number} Returns the index of the last non-whitespace character.
  2461. */
  2462. function trimmedEndIndex(string) {
  2463. var index = string.length;
  2464. while (index-- && reWhitespace.test(string.charAt(index))) {}
  2465. return index;
  2466. }
  2467. /**
  2468. * Used by `_.unescape` to convert HTML entities to characters.
  2469. *
  2470. * @private
  2471. * @param {string} chr The matched character to unescape.
  2472. * @returns {string} Returns the unescaped character.
  2473. */
  2474. var unescapeHtmlChar = basePropertyOf(htmlUnescapes);
  2475. /**
  2476. * Gets the size of a Unicode `string`.
  2477. *
  2478. * @private
  2479. * @param {string} string The string inspect.
  2480. * @returns {number} Returns the string size.
  2481. */
  2482. function unicodeSize(string) {
  2483. var result = reUnicode.lastIndex = 0;
  2484. while (reUnicode.test(string)) {
  2485. ++result;
  2486. }
  2487. return result;
  2488. }
  2489. /**
  2490. * Converts a Unicode `string` to an array.
  2491. *
  2492. * @private
  2493. * @param {string} string The string to convert.
  2494. * @returns {Array} Returns the converted array.
  2495. */
  2496. function unicodeToArray(string) {
  2497. return string.match(reUnicode) || [];
  2498. }
  2499. /**
  2500. * Splits a Unicode `string` into an array of its words.
  2501. *
  2502. * @private
  2503. * @param {string} The string to inspect.
  2504. * @returns {Array} Returns the words of `string`.
  2505. */
  2506. function unicodeWords(string) {
  2507. return string.match(reUnicodeWord) || [];
  2508. }
  2509. /*--------------------------------------------------------------------------*/
  2510. /**
  2511. * Create a new pristine `lodash` function using the `context` object.
  2512. *
  2513. * @static
  2514. * @memberOf _
  2515. * @since 1.1.0
  2516. * @category Util
  2517. * @param {Object} [context=root] The context object.
  2518. * @returns {Function} Returns a new `lodash` function.
  2519. * @example
  2520. *
  2521. * _.mixin({ 'foo': _.constant('foo') });
  2522. *
  2523. * var lodash = _.runInContext();
  2524. * lodash.mixin({ 'bar': lodash.constant('bar') });
  2525. *
  2526. * _.isFunction(_.foo);
  2527. * // => true
  2528. * _.isFunction(_.bar);
  2529. * // => false
  2530. *
  2531. * lodash.isFunction(lodash.foo);
  2532. * // => false
  2533. * lodash.isFunction(lodash.bar);
  2534. * // => true
  2535. *
  2536. * // Create a suped-up `defer` in Node.js.
  2537. * var defer = _.runInContext({ 'setTimeout': setImmediate }).defer;
  2538. */
  2539. var runInContext = (function runInContext(context) {
  2540. context = context == null ? root : _.defaults(root.Object(), context, _.pick(root, contextProps));
  2541. /** Built-in constructor references. */
  2542. var Array = context.Array,
  2543. Date = context.Date,
  2544. Error = context.Error,
  2545. Function = context.Function,
  2546. Math = context.Math,
  2547. Object = context.Object,
  2548. RegExp = context.RegExp,
  2549. String = context.String,
  2550. TypeError = context.TypeError;
  2551. /** Used for built-in method references. */
  2552. var arrayProto = Array.prototype,
  2553. funcProto = Function.prototype,
  2554. objectProto = Object.prototype;
  2555. /** Used to detect overreaching core-js shims. */
  2556. var coreJsData = context['__core-js_shared__'];
  2557. /** Used to resolve the decompiled source of functions. */
  2558. var funcToString = funcProto.toString;
  2559. /** Used to check objects for own properties. */
  2560. var hasOwnProperty = objectProto.hasOwnProperty;
  2561. /** Used to generate unique IDs. */
  2562. var idCounter = 0;
  2563. /** Used to detect methods masquerading as native. */
  2564. var maskSrcKey = (function() {
  2565. var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || '');
  2566. return uid ? ('Symbol(src)_1.' + uid) : '';
  2567. }());
  2568. /**
  2569. * Used to resolve the
  2570. * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
  2571. * of values.
  2572. */
  2573. var nativeObjectToString = objectProto.toString;
  2574. /** Used to infer the `Object` constructor. */
  2575. var objectCtorString = funcToString.call(Object);
  2576. /** Used to restore the original `_` reference in `_.noConflict`. */
  2577. var oldDash = root._;
  2578. /** Used to detect if a method is native. */
  2579. var reIsNative = RegExp('^' +
  2580. funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\$&')
  2581. .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$'
  2582. );
  2583. /** Built-in value references. */
  2584. var Buffer = moduleExports ? context.Buffer : undefined,
  2585. Symbol = context.Symbol,
  2586. Uint8Array = context.Uint8Array,
  2587. allocUnsafe = Buffer ? Buffer.allocUnsafe : undefined,
  2588. getPrototype = overArg(Object.getPrototypeOf, Object),
  2589. objectCreate = Object.create,
  2590. propertyIsEnumerable = objectProto.propertyIsEnumerable,
  2591. splice = arrayProto.splice,
  2592. spreadableSymbol = Symbol ? Symbol.isConcatSpreadable : undefined,
  2593. symIterator = Symbol ? Symbol.iterator : undefined,
  2594. symToStringTag = Symbol ? Symbol.toStringTag : undefined;
  2595. var defineProperty = (function() {
  2596. try {
  2597. var func = getNative(Object, 'defineProperty');
  2598. func({}, '', {});
  2599. return func;
  2600. } catch (e) {}
  2601. }());
  2602. /** Mocked built-ins. */
  2603. var ctxClearTimeout = context.clearTimeout !== root.clearTimeout && context.clearTimeout,
  2604. ctxNow = Date && Date.now !== root.Date.now && Date.now,
  2605. ctxSetTimeout = context.setTimeout !== root.setTimeout && context.setTimeout;
  2606. /* Built-in method references for those with the same name as other `lodash` methods. */
  2607. var nativeCeil = Math.ceil,
  2608. nativeFloor = Math.floor,
  2609. nativeGetSymbols = Object.getOwnPropertySymbols,
  2610. nativeIsBuffer = Buffer ? Buffer.isBuffer : undefined,
  2611. nativeIsFinite = context.isFinite,
  2612. nativeJoin = arrayProto.join,
  2613. nativeKeys = overArg(Object.keys, Object),
  2614. nativeMax = Math.max,
  2615. nativeMin = Math.min,
  2616. nativeNow = Date.now,
  2617. nativeParseInt = context.parseInt,
  2618. nativeRandom = Math.random,
  2619. nativeReverse = arrayProto.reverse;
  2620. /* Built-in method references that are verified to be native. */
  2621. var DataView = getNative(context, 'DataView'),
  2622. Map = getNative(context, 'Map'),
  2623. Promise = getNative(context, 'Promise'),
  2624. Set = getNative(context, 'Set'),
  2625. WeakMap = getNative(context, 'WeakMap'),
  2626. nativeCreate = getNative(Object, 'create');
  2627. /** Used to store function metadata. */
  2628. var metaMap = WeakMap && new WeakMap;
  2629. /** Used to lookup unminified function names. */
  2630. var realNames = {};
  2631. /** Used to detect maps, sets, and weakmaps. */
  2632. var dataViewCtorString = toSource(DataView),
  2633. mapCtorString = toSource(Map),
  2634. promiseCtorString = toSource(Promise),
  2635. setCtorString = toSource(Set),
  2636. weakMapCtorString = toSource(WeakMap);
  2637. /** Used to convert symbols to primitives and strings. */
  2638. var symbolProto = Symbol ? Symbol.prototype : undefined,
  2639. symbolValueOf = symbolProto ? symbolProto.valueOf : undefined,
  2640. symbolToString = symbolProto ? symbolProto.toString : undefined;
  2641. /*------------------------------------------------------------------------*/
  2642. /**
  2643. * Creates a `lodash` object which wraps `value` to enable implicit method
  2644. * chain sequences. Methods that operate on and return arrays, collections,
  2645. * and functions can be chained together. Methods that retrieve a single value
  2646. * or may return a primitive value will automatically end the chain sequence
  2647. * and return the unwrapped value. Otherwise, the value must be unwrapped
  2648. * with `_#value`.
  2649. *
  2650. * Explicit chain sequences, which must be unwrapped with `_#value`, may be
  2651. * enabled using `_.chain`.
  2652. *
  2653. * The execution of chained methods is lazy, that is, it's deferred until
  2654. * `_#value` is implicitly or explicitly called.
  2655. *
  2656. * Lazy evaluation allows several methods to support shortcut fusion.
  2657. * Shortcut fusion is an optimization to merge iteratee calls; this avoids
  2658. * the creation of intermediate arrays and can greatly reduce the number of
  2659. * iteratee executions. Sections of a chain sequence qualify for shortcut
  2660. * fusion if the section is applied to an array and iteratees accept only
  2661. * one argument. The heuristic for whether a section qualifies for shortcut
  2662. * fusion is subject to change.
  2663. *
  2664. * Chaining is supported in custom builds as long as the `_#value` method is
  2665. * directly or indirectly included in the build.
  2666. *
  2667. * In addition to lodash methods, wrappers have `Array` and `String` methods.
  2668. *
  2669. * The wrapper `Array` methods are:
  2670. * `concat`, `join`, `pop`, `push`, `shift`, `sort`, `splice`, and `unshift`
  2671. *
  2672. * The wrapper `String` methods are:
  2673. * `replace` and `split`
  2674. *
  2675. * The wrapper methods that support shortcut fusion are:
  2676. * `at`, `compact`, `drop`, `dropRight`, `dropWhile`, `filter`, `find`,
  2677. * `findLast`, `head`, `initial`, `last`, `map`, `reject`, `reverse`, `slice`,
  2678. * `tail`, `take`, `takeRight`, `takeRightWhile`, `takeWhile`, and `toArray`
  2679. *
  2680. * The chainable wrapper methods are:
  2681. * `after`, `ary`, `assign`, `assignIn`, `assignInWith`, `assignWith`, `at`,
  2682. * `before`, `bind`, `bindAll`, `bindKey`, `castArray`, `chain`, `chunk`,
  2683. * `commit`, `compact`, `concat`, `conforms`, `constant`, `countBy`, `create`,
  2684. * `curry`, `debounce`, `defaults`, `defaultsDeep`, `defer`, `delay`,
  2685. * `difference`, `differenceBy`, `differenceWith`, `drop`, `dropRight`,
  2686. * `dropRightWhile`, `dropWhile`, `extend`, `extendWith`, `fill`, `filter`,
  2687. * `flatMap`, `flatMapDeep`, `flatMapDepth`, `flatten`, `flattenDeep`,
  2688. * `flattenDepth`, `flip`, `flow`, `flowRight`, `fromPairs`, `functions`,
  2689. * `functionsIn`, `groupBy`, `initial`, `intersection`, `intersectionBy`,
  2690. * `intersectionWith`, `invert`, `invertBy`, `invokeMap`, `iteratee`, `keyBy`,
  2691. * `keys`, `keysIn`, `map`, `mapKeys`, `mapValues`, `matches`, `matchesProperty`,
  2692. * `memoize`, `merge`, `mergeWith`, `method`, `methodOf`, `mixin`, `negate`,
  2693. * `nthArg`, `omit`, `omitBy`, `once`, `orderBy`, `over`, `overArgs`,
  2694. * `overEvery`, `overSome`, `partial`, `partialRight`, `partition`, `pick`,
  2695. * `pickBy`, `plant`, `property`, `propertyOf`, `pull`, `pullAll`, `pullAllBy`,
  2696. * `pullAllWith`, `pullAt`, `push`, `range`, `rangeRight`, `rearg`, `reject`,
  2697. * `remove`, `rest`, `reverse`, `sampleSize`, `set`, `setWith`, `shuffle`,
  2698. * `slice`, `sort`, `sortBy`, `splice`, `spread`, `tail`, `take`, `takeRight`,
  2699. * `takeRightWhile`, `takeWhile`, `tap`, `throttle`, `thru`, `toArray`,
  2700. * `toPairs`, `toPairsIn`, `toPath`, `toPlainObject`, `transform`, `unary`,
  2701. * `union`, `unionBy`, `unionWith`, `uniq`, `uniqBy`, `uniqWith`, `unset`,
  2702. * `unshift`, `unzip`, `unzipWith`, `update`, `updateWith`, `values`,
  2703. * `valuesIn`, `without`, `wrap`, `xor`, `xorBy`, `xorWith`, `zip`,
  2704. * `zipObject`, `zipObjectDeep`, and `zipWith`
  2705. *
  2706. * The wrapper methods that are **not** chainable by default are:
  2707. * `add`, `attempt`, `camelCase`, `capitalize`, `ceil`, `clamp`, `clone`,
  2708. * `cloneDeep`, `cloneDeepWith`, `cloneWith`, `conformsTo`, `deburr`,
  2709. * `defaultTo`, `divide`, `each`, `eachRight`, `endsWith`, `eq`, `escape`,
  2710. * `escapeRegExp`, `every`, `find`, `findIndex`, `findKey`, `findLast`,
  2711. * `findLastIndex`, `findLastKey`, `first`, `floor`, `forEach`, `forEachRight`,
  2712. * `forIn`, `forInRight`, `forOwn`, `forOwnRight`, `get`, `gt`, `gte`, `has`,
  2713. * `hasIn`, `head`, `identity`, `includes`, `indexOf`, `inRange`, `invoke`,
  2714. * `isArguments`, `isArray`, `isArrayBuffer`, `isArrayLike`, `isArrayLikeObject`,
  2715. * `isBoolean`, `isBuffer`, `isDate`, `isElement`, `isEmpty`, `isEqual`,
  2716. * `isEqualWith`, `isError`, `isFinite`, `isFunction`, `isInteger`, `isLength`,
  2717. * `isMap`, `isMatch`, `isMatchWith`, `isNaN`, `isNative`, `isNil`, `isNull`,
  2718. * `isNumber`, `isObject`, `isObjectLike`, `isPlainObject`, `isRegExp`,
  2719. * `isSafeInteger`, `isSet`, `isString`, `isUndefined`, `isTypedArray`,
  2720. * `isWeakMap`, `isWeakSet`, `join`, `kebabCase`, `last`, `lastIndexOf`,
  2721. * `lowerCase`, `lowerFirst`, `lt`, `lte`, `max`, `maxBy`, `mean`, `meanBy`,
  2722. * `min`, `minBy`, `multiply`, `noConflict`, `noop`, `now`, `nth`, `pad`,
  2723. * `padEnd`, `padStart`, `parseInt`, `pop`, `random`, `reduce`, `reduceRight`,
  2724. * `repeat`, `result`, `round`, `runInContext`, `sample`, `shift`, `size`,
  2725. * `snakeCase`, `some`, `sortedIndex`, `sortedIndexBy`, `sortedLastIndex`,
  2726. * `sortedLastIndexBy`, `startCase`, `startsWith`, `stubArray`, `stubFalse`,
  2727. * `stubObject`, `stubString`, `stubTrue`, `subtract`, `sum`, `sumBy`,
  2728. * `template`, `times`, `toFinite`, `toInteger`, `toJSON`, `toLength`,
  2729. * `toLower`, `toNumber`, `toSafeInteger`, `toString`, `toUpper`, `trim`,
  2730. * `trimEnd`, `trimStart`, `truncate`, `unescape`, `uniqueId`, `upperCase`,
  2731. * `upperFirst`, `value`, and `words`
  2732. *
  2733. * @name _
  2734. * @constructor
  2735. * @category Seq
  2736. * @param {*} value The value to wrap in a `lodash` instance.
  2737. * @returns {Object} Returns the new `lodash` wrapper instance.
  2738. * @example
  2739. *
  2740. * function square(n) {
  2741. * return n * n;
  2742. * }
  2743. *
  2744. * var wrapped = _([1, 2, 3]);
  2745. *
  2746. * // Returns an unwrapped value.
  2747. * wrapped.reduce(_.add);
  2748. * // => 6
  2749. *
  2750. * // Returns a wrapped value.
  2751. * var squares = wrapped.map(square);
  2752. *
  2753. * _.isArray(squares);
  2754. * // => false
  2755. *
  2756. * _.isArray(squares.value());
  2757. * // => true
  2758. */
  2759. function lodash(value) {
  2760. if (isObjectLike(value) && !isArray(value) && !(value instanceof LazyWrapper)) {
  2761. if (value instanceof LodashWrapper) {
  2762. return value;
  2763. }
  2764. if (hasOwnProperty.call(value, '__wrapped__')) {
  2765. return wrapperClone(value);
  2766. }
  2767. }
  2768. return new LodashWrapper(value);
  2769. }
  2770. /**
  2771. * The base implementation of `_.create` without support for assigning
  2772. * properties to the created object.
  2773. *
  2774. * @private
  2775. * @param {Object} proto The object to inherit from.
  2776. * @returns {Object} Returns the new object.
  2777. */
  2778. var baseCreate = (function() {
  2779. function object() {}
  2780. return function(proto) {
  2781. if (!isObject(proto)) {
  2782. return {};
  2783. }
  2784. if (objectCreate) {
  2785. return objectCreate(proto);
  2786. }
  2787. object.prototype = proto;
  2788. var result = new object;
  2789. object.prototype = undefined;
  2790. return result;
  2791. };
  2792. }());
  2793. /**
  2794. * The function whose prototype chain sequence wrappers inherit from.
  2795. *
  2796. * @private
  2797. */
  2798. function baseLodash() {
  2799. // No operation performed.
  2800. }
  2801. /**
  2802. * The base constructor for creating `lodash` wrapper objects.
  2803. *
  2804. * @private
  2805. * @param {*} value The value to wrap.
  2806. * @param {boolean} [chainAll] Enable explicit method chain sequences.
  2807. */
  2808. function LodashWrapper(value, chainAll) {
  2809. this.__wrapped__ = value;
  2810. this.__actions__ = [];
  2811. this.__chain__ = !!chainAll;
  2812. this.__index__ = 0;
  2813. this.__values__ = undefined;
  2814. }
  2815. /**
  2816. * By default, the template delimiters used by lodash are like those in
  2817. * embedded Ruby (ERB) as well as ES2015 template strings. Change the
  2818. * following template settings to use alternative delimiters.
  2819. *
  2820. * @static
  2821. * @memberOf _
  2822. * @type {Object}
  2823. */
  2824. lodash.templateSettings = {
  2825. /**
  2826. * Used to detect `data` property values to be HTML-escaped.
  2827. *
  2828. * @memberOf _.templateSettings
  2829. * @type {RegExp}
  2830. */
  2831. 'escape': reEscape,
  2832. /**
  2833. * Used to detect code to be evaluated.
  2834. *
  2835. * @memberOf _.templateSettings
  2836. * @type {RegExp}
  2837. */
  2838. 'evaluate': reEvaluate,
  2839. /**
  2840. * Used to detect `data` property values to inject.
  2841. *
  2842. * @memberOf _.templateSettings
  2843. * @type {RegExp}
  2844. */
  2845. 'interpolate': reInterpolate,
  2846. /**
  2847. * Used to reference the data object in the template text.
  2848. *
  2849. * @memberOf _.templateSettings
  2850. * @type {string}
  2851. */
  2852. 'variable': '',
  2853. /**
  2854. * Used to import variables into the compiled template.
  2855. *
  2856. * @memberOf _.templateSettings
  2857. * @type {Object}
  2858. */
  2859. 'imports': {
  2860. /**
  2861. * A reference to the `lodash` function.
  2862. *
  2863. * @memberOf _.templateSettings.imports
  2864. * @type {Function}
  2865. */
  2866. '_': lodash
  2867. }
  2868. };
  2869. // Ensure wrappers are instances of `baseLodash`.
  2870. lodash.prototype = baseLodash.prototype;
  2871. lodash.prototype.constructor = lodash;
  2872. LodashWrapper.prototype = baseCreate(baseLodash.prototype);
  2873. LodashWrapper.prototype.constructor = LodashWrapper;
  2874. /*------------------------------------------------------------------------*/
  2875. /**
  2876. * Creates a lazy wrapper object which wraps `value` to enable lazy evaluation.
  2877. *
  2878. * @private
  2879. * @constructor
  2880. * @param {*} value The value to wrap.
  2881. */
  2882. function LazyWrapper(value) {
  2883. this.__wrapped__ = value;
  2884. this.__actions__ = [];
  2885. this.__dir__ = 1;
  2886. this.__filtered__ = false;
  2887. this.__iteratees__ = [];
  2888. this.__takeCount__ = MAX_ARRAY_LENGTH;
  2889. this.__views__ = [];
  2890. }
  2891. /**
  2892. * Creates a clone of the lazy wrapper object.
  2893. *
  2894. * @private
  2895. * @name clone
  2896. * @memberOf LazyWrapper
  2897. * @returns {Object} Returns the cloned `LazyWrapper` object.
  2898. */
  2899. function lazyClone() {
  2900. var result = new LazyWrapper(this.__wrapped__);
  2901. result.__actions__ = copyArray(this.__actions__);
  2902. result.__dir__ = this.__dir__;
  2903. result.__filtered__ = this.__filtered__;
  2904. result.__iteratees__ = copyArray(this.__iteratees__);
  2905. result.__takeCount__ = this.__takeCount__;
  2906. result.__views__ = copyArray(this.__views__);
  2907. return result;
  2908. }
  2909. /**
  2910. * Reverses the direction of lazy iteration.
  2911. *
  2912. * @private
  2913. * @name reverse
  2914. * @memberOf LazyWrapper
  2915. * @returns {Object} Returns the new reversed `LazyWrapper` object.
  2916. */
  2917. function lazyReverse() {
  2918. if (this.__filtered__) {
  2919. var result = new LazyWrapper(this);
  2920. result.__dir__ = -1;
  2921. result.__filtered__ = true;
  2922. } else {
  2923. result = this.clone();
  2924. result.__dir__ *= -1;
  2925. }
  2926. return result;
  2927. }
  2928. /**
  2929. * Extracts the unwrapped value from its lazy wrapper.
  2930. *
  2931. * @private
  2932. * @name value
  2933. * @memberOf LazyWrapper
  2934. * @returns {*} Returns the unwrapped value.
  2935. */
  2936. function lazyValue() {
  2937. var array = this.__wrapped__.value(),
  2938. dir = this.__dir__,
  2939. isArr = isArray(array),
  2940. isRight = dir < 0,
  2941. arrLength = isArr ? array.length : 0,
  2942. view = getView(0, arrLength, this.__views__),
  2943. start = view.start,
  2944. end = view.end,
  2945. length = end - start,
  2946. index = isRight ? end : (start - 1),
  2947. iteratees = this.__iteratees__,
  2948. iterLength = iteratees.length,
  2949. resIndex = 0,
  2950. takeCount = nativeMin(length, this.__takeCount__);
  2951. if (!isArr || (!isRight && arrLength == length && takeCount == length)) {
  2952. return baseWrapperValue(array, this.__actions__);
  2953. }
  2954. var result = [];
  2955. outer:
  2956. while (length-- && resIndex < takeCount) {
  2957. index += dir;
  2958. var iterIndex = -1,
  2959. value = array[index];
  2960. while (++iterIndex < iterLength) {
  2961. var data = iteratees[iterIndex],
  2962. iteratee = data.iteratee,
  2963. type = data.type,
  2964. computed = iteratee(value);
  2965. if (type == LAZY_MAP_FLAG) {
  2966. value = computed;
  2967. } else if (!computed) {
  2968. if (type == LAZY_FILTER_FLAG) {
  2969. continue outer;
  2970. } else {
  2971. break outer;
  2972. }
  2973. }
  2974. }
  2975. result[resIndex++] = value;
  2976. }
  2977. return result;
  2978. }
  2979. // Ensure `LazyWrapper` is an instance of `baseLodash`.
  2980. LazyWrapper.prototype = baseCreate(baseLodash.prototype);
  2981. LazyWrapper.prototype.constructor = LazyWrapper;
  2982. /*------------------------------------------------------------------------*/
  2983. /**
  2984. * Creates a hash object.
  2985. *
  2986. * @private
  2987. * @constructor
  2988. * @param {Array} [entries] The key-value pairs to cache.
  2989. */
  2990. function Hash(entries) {
  2991. var index = -1,
  2992. length = entries == null ? 0 : entries.length;
  2993. this.clear();
  2994. while (++index < length) {
  2995. var entry = entries[index];
  2996. this.set(entry[0], entry[1]);
  2997. }
  2998. }
  2999. /**
  3000. * Removes all key-value entries from the hash.
  3001. *
  3002. * @private
  3003. * @name clear
  3004. * @memberOf Hash
  3005. */
  3006. function hashClear() {
  3007. this.__data__ = nativeCreate ? nativeCreate(null) : {};
  3008. this.size = 0;
  3009. }
  3010. /**
  3011. * Removes `key` and its value from the hash.
  3012. *
  3013. * @private
  3014. * @name delete
  3015. * @memberOf Hash
  3016. * @param {Object} hash The hash to modify.
  3017. * @param {string} key The key of the value to remove.
  3018. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  3019. */
  3020. function hashDelete(key) {
  3021. var result = this.has(key) && delete this.__data__[key];
  3022. this.size -= result ? 1 : 0;
  3023. return result;
  3024. }
  3025. /**
  3026. * Gets the hash value for `key`.
  3027. *
  3028. * @private
  3029. * @name get
  3030. * @memberOf Hash
  3031. * @param {string} key The key of the value to get.
  3032. * @returns {*} Returns the entry value.
  3033. */
  3034. function hashGet(key) {
  3035. var data = this.__data__;
  3036. if (nativeCreate) {
  3037. var result = data[key];
  3038. return result === HASH_UNDEFINED ? undefined : result;
  3039. }
  3040. return hasOwnProperty.call(data, key) ? data[key] : undefined;
  3041. }
  3042. /**
  3043. * Checks if a hash value for `key` exists.
  3044. *
  3045. * @private
  3046. * @name has
  3047. * @memberOf Hash
  3048. * @param {string} key The key of the entry to check.
  3049. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  3050. */
  3051. function hashHas(key) {
  3052. var data = this.__data__;
  3053. return nativeCreate ? (data[key] !== undefined) : hasOwnProperty.call(data, key);
  3054. }
  3055. /**
  3056. * Sets the hash `key` to `value`.
  3057. *
  3058. * @private
  3059. * @name set
  3060. * @memberOf Hash
  3061. * @param {string} key The key of the value to set.
  3062. * @param {*} value The value to set.
  3063. * @returns {Object} Returns the hash instance.
  3064. */
  3065. function hashSet(key, value) {
  3066. var data = this.__data__;
  3067. this.size += this.has(key) ? 0 : 1;
  3068. data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value;
  3069. return this;
  3070. }
  3071. // Add methods to `Hash`.
  3072. Hash.prototype.clear = hashClear;
  3073. Hash.prototype['delete'] = hashDelete;
  3074. Hash.prototype.get = hashGet;
  3075. Hash.prototype.has = hashHas;
  3076. Hash.prototype.set = hashSet;
  3077. /*------------------------------------------------------------------------*/
  3078. /**
  3079. * Creates an list cache object.
  3080. *
  3081. * @private
  3082. * @constructor
  3083. * @param {Array} [entries] The key-value pairs to cache.
  3084. */
  3085. function ListCache(entries) {
  3086. var index = -1,
  3087. length = entries == null ? 0 : entries.length;
  3088. this.clear();
  3089. while (++index < length) {
  3090. var entry = entries[index];
  3091. this.set(entry[0], entry[1]);
  3092. }
  3093. }
  3094. /**
  3095. * Removes all key-value entries from the list cache.
  3096. *
  3097. * @private
  3098. * @name clear
  3099. * @memberOf ListCache
  3100. */
  3101. function listCacheClear() {
  3102. this.__data__ = [];
  3103. this.size = 0;
  3104. }
  3105. /**
  3106. * Removes `key` and its value from the list cache.
  3107. *
  3108. * @private
  3109. * @name delete
  3110. * @memberOf ListCache
  3111. * @param {string} key The key of the value to remove.
  3112. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  3113. */
  3114. function listCacheDelete(key) {
  3115. var data = this.__data__,
  3116. index = assocIndexOf(data, key);
  3117. if (index < 0) {
  3118. return false;
  3119. }
  3120. var lastIndex = data.length - 1;
  3121. if (index == lastIndex) {
  3122. data.pop();
  3123. } else {
  3124. splice.call(data, index, 1);
  3125. }
  3126. --this.size;
  3127. return true;
  3128. }
  3129. /**
  3130. * Gets the list cache value for `key`.
  3131. *
  3132. * @private
  3133. * @name get
  3134. * @memberOf ListCache
  3135. * @param {string} key The key of the value to get.
  3136. * @returns {*} Returns the entry value.
  3137. */
  3138. function listCacheGet(key) {
  3139. var data = this.__data__,
  3140. index = assocIndexOf(data, key);
  3141. return index < 0 ? undefined : data[index][1];
  3142. }
  3143. /**
  3144. * Checks if a list cache value for `key` exists.
  3145. *
  3146. * @private
  3147. * @name has
  3148. * @memberOf ListCache
  3149. * @param {string} key The key of the entry to check.
  3150. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  3151. */
  3152. function listCacheHas(key) {
  3153. return assocIndexOf(this.__data__, key) > -1;
  3154. }
  3155. /**
  3156. * Sets the list cache `key` to `value`.
  3157. *
  3158. * @private
  3159. * @name set
  3160. * @memberOf ListCache
  3161. * @param {string} key The key of the value to set.
  3162. * @param {*} value The value to set.
  3163. * @returns {Object} Returns the list cache instance.
  3164. */
  3165. function listCacheSet(key, value) {
  3166. var data = this.__data__,
  3167. index = assocIndexOf(data, key);
  3168. if (index < 0) {
  3169. ++this.size;
  3170. data.push([key, value]);
  3171. } else {
  3172. data[index][1] = value;
  3173. }
  3174. return this;
  3175. }
  3176. // Add methods to `ListCache`.
  3177. ListCache.prototype.clear = listCacheClear;
  3178. ListCache.prototype['delete'] = listCacheDelete;
  3179. ListCache.prototype.get = listCacheGet;
  3180. ListCache.prototype.has = listCacheHas;
  3181. ListCache.prototype.set = listCacheSet;
  3182. /*------------------------------------------------------------------------*/
  3183. /**
  3184. * Creates a map cache object to store key-value pairs.
  3185. *
  3186. * @private
  3187. * @constructor
  3188. * @param {Array} [entries] The key-value pairs to cache.
  3189. */
  3190. function MapCache(entries) {
  3191. var index = -1,
  3192. length = entries == null ? 0 : entries.length;
  3193. this.clear();
  3194. while (++index < length) {
  3195. var entry = entries[index];
  3196. this.set(entry[0], entry[1]);
  3197. }
  3198. }
  3199. /**
  3200. * Removes all key-value entries from the map.
  3201. *
  3202. * @private
  3203. * @name clear
  3204. * @memberOf MapCache
  3205. */
  3206. function mapCacheClear() {
  3207. this.size = 0;
  3208. this.__data__ = {
  3209. 'hash': new Hash,
  3210. 'map': new (Map || ListCache),
  3211. 'string': new Hash
  3212. };
  3213. }
  3214. /**
  3215. * Removes `key` and its value from the map.
  3216. *
  3217. * @private
  3218. * @name delete
  3219. * @memberOf MapCache
  3220. * @param {string} key The key of the value to remove.
  3221. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  3222. */
  3223. function mapCacheDelete(key) {
  3224. var result = getMapData(this, key)['delete'](key);
  3225. this.size -= result ? 1 : 0;
  3226. return result;
  3227. }
  3228. /**
  3229. * Gets the map value for `key`.
  3230. *
  3231. * @private
  3232. * @name get
  3233. * @memberOf MapCache
  3234. * @param {string} key The key of the value to get.
  3235. * @returns {*} Returns the entry value.
  3236. */
  3237. function mapCacheGet(key) {
  3238. return getMapData(this, key).get(key);
  3239. }
  3240. /**
  3241. * Checks if a map value for `key` exists.
  3242. *
  3243. * @private
  3244. * @name has
  3245. * @memberOf MapCache
  3246. * @param {string} key The key of the entry to check.
  3247. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  3248. */
  3249. function mapCacheHas(key) {
  3250. return getMapData(this, key).has(key);
  3251. }
  3252. /**
  3253. * Sets the map `key` to `value`.
  3254. *
  3255. * @private
  3256. * @name set
  3257. * @memberOf MapCache
  3258. * @param {string} key The key of the value to set.
  3259. * @param {*} value The value to set.
  3260. * @returns {Object} Returns the map cache instance.
  3261. */
  3262. function mapCacheSet(key, value) {
  3263. var data = getMapData(this, key),
  3264. size = data.size;
  3265. data.set(key, value);
  3266. this.size += data.size == size ? 0 : 1;
  3267. return this;
  3268. }
  3269. // Add methods to `MapCache`.
  3270. MapCache.prototype.clear = mapCacheClear;
  3271. MapCache.prototype['delete'] = mapCacheDelete;
  3272. MapCache.prototype.get = mapCacheGet;
  3273. MapCache.prototype.has = mapCacheHas;
  3274. MapCache.prototype.set = mapCacheSet;
  3275. /*------------------------------------------------------------------------*/
  3276. /**
  3277. *
  3278. * Creates an array cache object to store unique values.
  3279. *
  3280. * @private
  3281. * @constructor
  3282. * @param {Array} [values] The values to cache.
  3283. */
  3284. function SetCache(values) {
  3285. var index = -1,
  3286. length = values == null ? 0 : values.length;
  3287. this.__data__ = new MapCache;
  3288. while (++index < length) {
  3289. this.add(values[index]);
  3290. }
  3291. }
  3292. /**
  3293. * Adds `value` to the array cache.
  3294. *
  3295. * @private
  3296. * @name add
  3297. * @memberOf SetCache
  3298. * @alias push
  3299. * @param {*} value The value to cache.
  3300. * @returns {Object} Returns the cache instance.
  3301. */
  3302. function setCacheAdd(value) {
  3303. this.__data__.set(value, HASH_UNDEFINED);
  3304. return this;
  3305. }
  3306. /**
  3307. * Checks if `value` is in the array cache.
  3308. *
  3309. * @private
  3310. * @name has
  3311. * @memberOf SetCache
  3312. * @param {*} value The value to search for.
  3313. * @returns {number} Returns `true` if `value` is found, else `false`.
  3314. */
  3315. function setCacheHas(value) {
  3316. return this.__data__.has(value);
  3317. }
  3318. // Add methods to `SetCache`.
  3319. SetCache.prototype.add = SetCache.prototype.push = setCacheAdd;
  3320. SetCache.prototype.has = setCacheHas;
  3321. /*------------------------------------------------------------------------*/
  3322. /**
  3323. * Creates a stack cache object to store key-value pairs.
  3324. *
  3325. * @private
  3326. * @constructor
  3327. * @param {Array} [entries] The key-value pairs to cache.
  3328. */
  3329. function Stack(entries) {
  3330. var data = this.__data__ = new ListCache(entries);
  3331. this.size = data.size;
  3332. }
  3333. /**
  3334. * Removes all key-value entries from the stack.
  3335. *
  3336. * @private
  3337. * @name clear
  3338. * @memberOf Stack
  3339. */
  3340. function stackClear() {
  3341. this.__data__ = new ListCache;
  3342. this.size = 0;
  3343. }
  3344. /**
  3345. * Removes `key` and its value from the stack.
  3346. *
  3347. * @private
  3348. * @name delete
  3349. * @memberOf Stack
  3350. * @param {string} key The key of the value to remove.
  3351. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  3352. */
  3353. function stackDelete(key) {
  3354. var data = this.__data__,
  3355. result = data['delete'](key);
  3356. this.size = data.size;
  3357. return result;
  3358. }
  3359. /**
  3360. * Gets the stack value for `key`.
  3361. *
  3362. * @private
  3363. * @name get
  3364. * @memberOf Stack
  3365. * @param {string} key The key of the value to get.
  3366. * @returns {*} Returns the entry value.
  3367. */
  3368. function stackGet(key) {
  3369. return this.__data__.get(key);
  3370. }
  3371. /**
  3372. * Checks if a stack value for `key` exists.
  3373. *
  3374. * @private
  3375. * @name has
  3376. * @memberOf Stack
  3377. * @param {string} key The key of the entry to check.
  3378. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  3379. */
  3380. function stackHas(key) {
  3381. return this.__data__.has(key);
  3382. }
  3383. /**
  3384. * Sets the stack `key` to `value`.
  3385. *
  3386. * @private
  3387. * @name set
  3388. * @memberOf Stack
  3389. * @param {string} key The key of the value to set.
  3390. * @param {*} value The value to set.
  3391. * @returns {Object} Returns the stack cache instance.
  3392. */
  3393. function stackSet(key, value) {
  3394. var data = this.__data__;
  3395. if (data instanceof ListCache) {
  3396. var pairs = data.__data__;
  3397. if (!Map || (pairs.length < LARGE_ARRAY_SIZE - 1)) {
  3398. pairs.push([key, value]);
  3399. this.size = ++data.size;
  3400. return this;
  3401. }
  3402. data = this.__data__ = new MapCache(pairs);
  3403. }
  3404. data.set(key, value);
  3405. this.size = data.size;
  3406. return this;
  3407. }
  3408. // Add methods to `Stack`.
  3409. Stack.prototype.clear = stackClear;
  3410. Stack.prototype['delete'] = stackDelete;
  3411. Stack.prototype.get = stackGet;
  3412. Stack.prototype.has = stackHas;
  3413. Stack.prototype.set = stackSet;
  3414. /*------------------------------------------------------------------------*/
  3415. /**
  3416. * Creates an array of the enumerable property names of the array-like `value`.
  3417. *
  3418. * @private
  3419. * @param {*} value The value to query.
  3420. * @param {boolean} inherited Specify returning inherited property names.
  3421. * @returns {Array} Returns the array of property names.
  3422. */
  3423. function arrayLikeKeys(value, inherited) {
  3424. var isArr = isArray(value),
  3425. isArg = !isArr && isArguments(value),
  3426. isBuff = !isArr && !isArg && isBuffer(value),
  3427. isType = !isArr && !isArg && !isBuff && isTypedArray(value),
  3428. skipIndexes = isArr || isArg || isBuff || isType,
  3429. result = skipIndexes ? baseTimes(value.length, String) : [],
  3430. length = result.length;
  3431. for (var key in value) {
  3432. if ((inherited || hasOwnProperty.call(value, key)) &&
  3433. !(skipIndexes && (
  3434. // Safari 9 has enumerable `arguments.length` in strict mode.
  3435. key == 'length' ||
  3436. // Node.js 0.10 has enumerable non-index properties on buffers.
  3437. (isBuff && (key == 'offset' || key == 'parent')) ||
  3438. // PhantomJS 2 has enumerable non-index properties on typed arrays.
  3439. (isType && (key == 'buffer' || key == 'byteLength' || key == 'byteOffset')) ||
  3440. // Skip index properties.
  3441. isIndex(key, length)
  3442. ))) {
  3443. result.push(key);
  3444. }
  3445. }
  3446. return result;
  3447. }
  3448. /**
  3449. * A specialized version of `_.sample` for arrays.
  3450. *
  3451. * @private
  3452. * @param {Array} array The array to sample.
  3453. * @returns {*} Returns the random element.
  3454. */
  3455. function arraySample(array) {
  3456. var length = array.length;
  3457. return length ? array[baseRandom(0, length - 1)] : undefined;
  3458. }
  3459. /**
  3460. * A specialized version of `_.sampleSize` for arrays.
  3461. *
  3462. * @private
  3463. * @param {Array} array The array to sample.
  3464. * @param {number} n The number of elements to sample.
  3465. * @returns {Array} Returns the random elements.
  3466. */
  3467. function arraySampleSize(array, n) {
  3468. return shuffleSelf(copyArray(array), baseClamp(n, 0, array.length));
  3469. }
  3470. /**
  3471. * A specialized version of `_.shuffle` for arrays.
  3472. *
  3473. * @private
  3474. * @param {Array} array The array to shuffle.
  3475. * @returns {Array} Returns the new shuffled array.
  3476. */
  3477. function arrayShuffle(array) {
  3478. return shuffleSelf(copyArray(array));
  3479. }
  3480. /**
  3481. * This function is like `assignValue` except that it doesn't assign
  3482. * `undefined` values.
  3483. *
  3484. * @private
  3485. * @param {Object} object The object to modify.
  3486. * @param {string} key The key of the property to assign.
  3487. * @param {*} value The value to assign.
  3488. */
  3489. function assignMergeValue(object, key, value) {
  3490. if ((value !== undefined && !eq(object[key], value)) ||
  3491. (value === undefined && !(key in object))) {
  3492. baseAssignValue(object, key, value);
  3493. }
  3494. }
  3495. /**
  3496. * Assigns `value` to `key` of `object` if the existing value is not equivalent
  3497. * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  3498. * for equality comparisons.
  3499. *
  3500. * @private
  3501. * @param {Object} object The object to modify.
  3502. * @param {string} key The key of the property to assign.
  3503. * @param {*} value The value to assign.
  3504. */
  3505. function assignValue(object, key, value) {
  3506. var objValue = object[key];
  3507. if (!(hasOwnProperty.call(object, key) && eq(objValue, value)) ||
  3508. (value === undefined && !(key in object))) {
  3509. baseAssignValue(object, key, value);
  3510. }
  3511. }
  3512. /**
  3513. * Gets the index at which the `key` is found in `array` of key-value pairs.
  3514. *
  3515. * @private
  3516. * @param {Array} array The array to inspect.
  3517. * @param {*} key The key to search for.
  3518. * @returns {number} Returns the index of the matched value, else `-1`.
  3519. */
  3520. function assocIndexOf(array, key) {
  3521. var length = array.length;
  3522. while (length--) {
  3523. if (eq(array[length][0], key)) {
  3524. return length;
  3525. }
  3526. }
  3527. return -1;
  3528. }
  3529. /**
  3530. * Aggregates elements of `collection` on `accumulator` with keys transformed
  3531. * by `iteratee` and values set by `setter`.
  3532. *
  3533. * @private
  3534. * @param {Array|Object} collection The collection to iterate over.
  3535. * @param {Function} setter The function to set `accumulator` values.
  3536. * @param {Function} iteratee The iteratee to transform keys.
  3537. * @param {Object} accumulator The initial aggregated object.
  3538. * @returns {Function} Returns `accumulator`.
  3539. */
  3540. function baseAggregator(collection, setter, iteratee, accumulator) {
  3541. baseEach(collection, function(value, key, collection) {
  3542. setter(accumulator, value, iteratee(value), collection);
  3543. });
  3544. return accumulator;
  3545. }
  3546. /**
  3547. * The base implementation of `_.assign` without support for multiple sources
  3548. * or `customizer` functions.
  3549. *
  3550. * @private
  3551. * @param {Object} object The destination object.
  3552. * @param {Object} source The source object.
  3553. * @returns {Object} Returns `object`.
  3554. */
  3555. function baseAssign(object, source) {
  3556. return object && copyObject(source, keys(source), object);
  3557. }
  3558. /**
  3559. * The base implementation of `_.assignIn` without support for multiple sources
  3560. * or `customizer` functions.
  3561. *
  3562. * @private
  3563. * @param {Object} object The destination object.
  3564. * @param {Object} source The source object.
  3565. * @returns {Object} Returns `object`.
  3566. */
  3567. function baseAssignIn(object, source) {
  3568. return object && copyObject(source, keysIn(source), object);
  3569. }
  3570. /**
  3571. * The base implementation of `assignValue` and `assignMergeValue` without
  3572. * value checks.
  3573. *
  3574. * @private
  3575. * @param {Object} object The object to modify.
  3576. * @param {string} key The key of the property to assign.
  3577. * @param {*} value The value to assign.
  3578. */
  3579. function baseAssignValue(object, key, value) {
  3580. if (key == '__proto__' && defineProperty) {
  3581. defineProperty(object, key, {
  3582. 'configurable': true,
  3583. 'enumerable': true,
  3584. 'value': value,
  3585. 'writable': true
  3586. });
  3587. } else {
  3588. object[key] = value;
  3589. }
  3590. }
  3591. /**
  3592. * The base implementation of `_.at` without support for individual paths.
  3593. *
  3594. * @private
  3595. * @param {Object} object The object to iterate over.
  3596. * @param {string[]} paths The property paths to pick.
  3597. * @returns {Array} Returns the picked elements.
  3598. */
  3599. function baseAt(object, paths) {
  3600. var index = -1,
  3601. length = paths.length,
  3602. result = Array(length),
  3603. skip = object == null;
  3604. while (++index < length) {
  3605. result[index] = skip ? undefined : get(object, paths[index]);
  3606. }
  3607. return result;
  3608. }
  3609. /**
  3610. * The base implementation of `_.clamp` which doesn't coerce arguments.
  3611. *
  3612. * @private
  3613. * @param {number} number The number to clamp.
  3614. * @param {number} [lower] The lower bound.
  3615. * @param {number} upper The upper bound.
  3616. * @returns {number} Returns the clamped number.
  3617. */
  3618. function baseClamp(number, lower, upper) {
  3619. if (number === number) {
  3620. if (upper !== undefined) {
  3621. number = number <= upper ? number : upper;
  3622. }
  3623. if (lower !== undefined) {
  3624. number = number >= lower ? number : lower;
  3625. }
  3626. }
  3627. return number;
  3628. }
  3629. /**
  3630. * The base implementation of `_.clone` and `_.cloneDeep` which tracks
  3631. * traversed objects.
  3632. *
  3633. * @private
  3634. * @param {*} value The value to clone.
  3635. * @param {boolean} bitmask The bitmask flags.
  3636. * 1 - Deep clone
  3637. * 2 - Flatten inherited properties
  3638. * 4 - Clone symbols
  3639. * @param {Function} [customizer] The function to customize cloning.
  3640. * @param {string} [key] The key of `value`.
  3641. * @param {Object} [object] The parent object of `value`.
  3642. * @param {Object} [stack] Tracks traversed objects and their clone counterparts.
  3643. * @returns {*} Returns the cloned value.
  3644. */
  3645. function baseClone(value, bitmask, customizer, key, object, stack) {
  3646. var result,
  3647. isDeep = bitmask & CLONE_DEEP_FLAG,
  3648. isFlat = bitmask & CLONE_FLAT_FLAG,
  3649. isFull = bitmask & CLONE_SYMBOLS_FLAG;
  3650. if (customizer) {
  3651. result = object ? customizer(value, key, object, stack) : customizer(value);
  3652. }
  3653. if (result !== undefined) {
  3654. return result;
  3655. }
  3656. if (!isObject(value)) {
  3657. return value;
  3658. }
  3659. var isArr = isArray(value);
  3660. if (isArr) {
  3661. result = initCloneArray(value);
  3662. if (!isDeep) {
  3663. return copyArray(value, result);
  3664. }
  3665. } else {
  3666. var tag = getTag(value),
  3667. isFunc = tag == funcTag || tag == genTag;
  3668. if (isBuffer(value)) {
  3669. return cloneBuffer(value, isDeep);
  3670. }
  3671. if (tag == objectTag || tag == argsTag || (isFunc && !object)) {
  3672. result = (isFlat || isFunc) ? {} : initCloneObject(value);
  3673. if (!isDeep) {
  3674. return isFlat
  3675. ? copySymbolsIn(value, baseAssignIn(result, value))
  3676. : copySymbols(value, baseAssign(result, value));
  3677. }
  3678. } else {
  3679. if (!cloneableTags[tag]) {
  3680. return object ? value : {};
  3681. }
  3682. result = initCloneByTag(value, tag, isDeep);
  3683. }
  3684. }
  3685. // Check for circular references and return its corresponding clone.
  3686. stack || (stack = new Stack);
  3687. var stacked = stack.get(value);
  3688. if (stacked) {
  3689. return stacked;
  3690. }
  3691. stack.set(value, result);
  3692. if (isSet(value)) {
  3693. value.forEach(function(subValue) {
  3694. result.add(baseClone(subValue, bitmask, customizer, subValue, value, stack));
  3695. });
  3696. } else if (isMap(value)) {
  3697. value.forEach(function(subValue, key) {
  3698. result.set(key, baseClone(subValue, bitmask, customizer, key, value, stack));
  3699. });
  3700. }
  3701. var keysFunc = isFull
  3702. ? (isFlat ? getAllKeysIn : getAllKeys)
  3703. : (isFlat ? keysIn : keys);
  3704. var props = isArr ? undefined : keysFunc(value);
  3705. arrayEach(props || value, function(subValue, key) {
  3706. if (props) {
  3707. key = subValue;
  3708. subValue = value[key];
  3709. }
  3710. // Recursively populate clone (susceptible to call stack limits).
  3711. assignValue(result, key, baseClone(subValue, bitmask, customizer, key, value, stack));
  3712. });
  3713. return result;
  3714. }
  3715. /**
  3716. * The base implementation of `_.conforms` which doesn't clone `source`.
  3717. *
  3718. * @private
  3719. * @param {Object} source The object of property predicates to conform to.
  3720. * @returns {Function} Returns the new spec function.
  3721. */
  3722. function baseConforms(source) {
  3723. var props = keys(source);
  3724. return function(object) {
  3725. return baseConformsTo(object, source, props);
  3726. };
  3727. }
  3728. /**
  3729. * The base implementation of `_.conformsTo` which accepts `props` to check.
  3730. *
  3731. * @private
  3732. * @param {Object} object The object to inspect.
  3733. * @param {Object} source The object of property predicates to conform to.
  3734. * @returns {boolean} Returns `true` if `object` conforms, else `false`.
  3735. */
  3736. function baseConformsTo(object, source, props) {
  3737. var length = props.length;
  3738. if (object == null) {
  3739. return !length;
  3740. }
  3741. object = Object(object);
  3742. while (length--) {
  3743. var key = props[length],
  3744. predicate = source[key],
  3745. value = object[key];
  3746. if ((value === undefined && !(key in object)) || !predicate(value)) {
  3747. return false;
  3748. }
  3749. }
  3750. return true;
  3751. }
  3752. /**
  3753. * The base implementation of `_.delay` and `_.defer` which accepts `args`
  3754. * to provide to `func`.
  3755. *
  3756. * @private
  3757. * @param {Function} func The function to delay.
  3758. * @param {number} wait The number of milliseconds to delay invocation.
  3759. * @param {Array} args The arguments to provide to `func`.
  3760. * @returns {number|Object} Returns the timer id or timeout object.
  3761. */
  3762. function baseDelay(func, wait, args) {
  3763. if (typeof func != 'function') {
  3764. throw new TypeError(FUNC_ERROR_TEXT);
  3765. }
  3766. return setTimeout(function() { func.apply(undefined, args); }, wait);
  3767. }
  3768. /**
  3769. * The base implementation of methods like `_.difference` without support
  3770. * for excluding multiple arrays or iteratee shorthands.
  3771. *
  3772. * @private
  3773. * @param {Array} array The array to inspect.
  3774. * @param {Array} values The values to exclude.
  3775. * @param {Function} [iteratee] The iteratee invoked per element.
  3776. * @param {Function} [comparator] The comparator invoked per element.
  3777. * @returns {Array} Returns the new array of filtered values.
  3778. */
  3779. function baseDifference(array, values, iteratee, comparator) {
  3780. var index = -1,
  3781. includes = arrayIncludes,
  3782. isCommon = true,
  3783. length = array.length,
  3784. result = [],
  3785. valuesLength = values.length;
  3786. if (!length) {
  3787. return result;
  3788. }
  3789. if (iteratee) {
  3790. values = arrayMap(values, baseUnary(iteratee));
  3791. }
  3792. if (comparator) {
  3793. includes = arrayIncludesWith;
  3794. isCommon = false;
  3795. }
  3796. else if (values.length >= LARGE_ARRAY_SIZE) {
  3797. includes = cacheHas;
  3798. isCommon = false;
  3799. values = new SetCache(values);
  3800. }
  3801. outer:
  3802. while (++index < length) {
  3803. var value = array[index],
  3804. computed = iteratee == null ? value : iteratee(value);
  3805. value = (comparator || value !== 0) ? value : 0;
  3806. if (isCommon && computed === computed) {
  3807. var valuesIndex = valuesLength;
  3808. while (valuesIndex--) {
  3809. if (values[valuesIndex] === computed) {
  3810. continue outer;
  3811. }
  3812. }
  3813. result.push(value);
  3814. }
  3815. else if (!includes(values, computed, comparator)) {
  3816. result.push(value);
  3817. }
  3818. }
  3819. return result;
  3820. }
  3821. /**
  3822. * The base implementation of `_.forEach` without support for iteratee shorthands.
  3823. *
  3824. * @private
  3825. * @param {Array|Object} collection The collection to iterate over.
  3826. * @param {Function} iteratee The function invoked per iteration.
  3827. * @returns {Array|Object} Returns `collection`.
  3828. */
  3829. var baseEach = createBaseEach(baseForOwn);
  3830. /**
  3831. * The base implementation of `_.forEachRight` without support for iteratee shorthands.
  3832. *
  3833. * @private
  3834. * @param {Array|Object} collection The collection to iterate over.
  3835. * @param {Function} iteratee The function invoked per iteration.
  3836. * @returns {Array|Object} Returns `collection`.
  3837. */
  3838. var baseEachRight = createBaseEach(baseForOwnRight, true);
  3839. /**
  3840. * The base implementation of `_.every` without support for iteratee shorthands.
  3841. *
  3842. * @private
  3843. * @param {Array|Object} collection The collection to iterate over.
  3844. * @param {Function} predicate The function invoked per iteration.
  3845. * @returns {boolean} Returns `true` if all elements pass the predicate check,
  3846. * else `false`
  3847. */
  3848. function baseEvery(collection, predicate) {
  3849. var result = true;
  3850. baseEach(collection, function(value, index, collection) {
  3851. result = !!predicate(value, index, collection);
  3852. return result;
  3853. });
  3854. return result;
  3855. }
  3856. /**
  3857. * The base implementation of methods like `_.max` and `_.min` which accepts a
  3858. * `comparator` to determine the extremum value.
  3859. *
  3860. * @private
  3861. * @param {Array} array The array to iterate over.
  3862. * @param {Function} iteratee The iteratee invoked per iteration.
  3863. * @param {Function} comparator The comparator used to compare values.
  3864. * @returns {*} Returns the extremum value.
  3865. */
  3866. function baseExtremum(array, iteratee, comparator) {
  3867. var index = -1,
  3868. length = array.length;
  3869. while (++index < length) {
  3870. var value = array[index],
  3871. current = iteratee(value);
  3872. if (current != null && (computed === undefined
  3873. ? (current === current && !isSymbol(current))
  3874. : comparator(current, computed)
  3875. )) {
  3876. var computed = current,
  3877. result = value;
  3878. }
  3879. }
  3880. return result;
  3881. }
  3882. /**
  3883. * The base implementation of `_.fill` without an iteratee call guard.
  3884. *
  3885. * @private
  3886. * @param {Array} array The array to fill.
  3887. * @param {*} value The value to fill `array` with.
  3888. * @param {number} [start=0] The start position.
  3889. * @param {number} [end=array.length] The end position.
  3890. * @returns {Array} Returns `array`.
  3891. */
  3892. function baseFill(array, value, start, end) {
  3893. var length = array.length;
  3894. start = toInteger(start);
  3895. if (start < 0) {
  3896. start = -start > length ? 0 : (length + start);
  3897. }
  3898. end = (end === undefined || end > length) ? length : toInteger(end);
  3899. if (end < 0) {
  3900. end += length;
  3901. }
  3902. end = start > end ? 0 : toLength(end);
  3903. while (start < end) {
  3904. array[start++] = value;
  3905. }
  3906. return array;
  3907. }
  3908. /**
  3909. * The base implementation of `_.filter` without support for iteratee shorthands.
  3910. *
  3911. * @private
  3912. * @param {Array|Object} collection The collection to iterate over.
  3913. * @param {Function} predicate The function invoked per iteration.
  3914. * @returns {Array} Returns the new filtered array.
  3915. */
  3916. function baseFilter(collection, predicate) {
  3917. var result = [];
  3918. baseEach(collection, function(value, index, collection) {
  3919. if (predicate(value, index, collection)) {
  3920. result.push(value);
  3921. }
  3922. });
  3923. return result;
  3924. }
  3925. /**
  3926. * The base implementation of `_.flatten` with support for restricting flattening.
  3927. *
  3928. * @private
  3929. * @param {Array} array The array to flatten.
  3930. * @param {number} depth The maximum recursion depth.
  3931. * @param {boolean} [predicate=isFlattenable] The function invoked per iteration.
  3932. * @param {boolean} [isStrict] Restrict to values that pass `predicate` checks.
  3933. * @param {Array} [result=[]] The initial result value.
  3934. * @returns {Array} Returns the new flattened array.
  3935. */
  3936. function baseFlatten(array, depth, predicate, isStrict, result) {
  3937. var index = -1,
  3938. length = array.length;
  3939. predicate || (predicate = isFlattenable);
  3940. result || (result = []);
  3941. while (++index < length) {
  3942. var value = array[index];
  3943. if (depth > 0 && predicate(value)) {
  3944. if (depth > 1) {
  3945. // Recursively flatten arrays (susceptible to call stack limits).
  3946. baseFlatten(value, depth - 1, predicate, isStrict, result);
  3947. } else {
  3948. arrayPush(result, value);
  3949. }
  3950. } else if (!isStrict) {
  3951. result[result.length] = value;
  3952. }
  3953. }
  3954. return result;
  3955. }
  3956. /**
  3957. * The base implementation of `baseForOwn` which iterates over `object`
  3958. * properties returned by `keysFunc` and invokes `iteratee` for each property.
  3959. * Iteratee functions may exit iteration early by explicitly returning `false`.
  3960. *
  3961. * @private
  3962. * @param {Object} object The object to iterate over.
  3963. * @param {Function} iteratee The function invoked per iteration.
  3964. * @param {Function} keysFunc The function to get the keys of `object`.
  3965. * @returns {Object} Returns `object`.
  3966. */
  3967. var baseFor = createBaseFor();
  3968. /**
  3969. * This function is like `baseFor` except that it iterates over properties
  3970. * in the opposite order.
  3971. *
  3972. * @private
  3973. * @param {Object} object The object to iterate over.
  3974. * @param {Function} iteratee The function invoked per iteration.
  3975. * @param {Function} keysFunc The function to get the keys of `object`.
  3976. * @returns {Object} Returns `object`.
  3977. */
  3978. var baseForRight = createBaseFor(true);
  3979. /**
  3980. * The base implementation of `_.forOwn` without support for iteratee shorthands.
  3981. *
  3982. * @private
  3983. * @param {Object} object The object to iterate over.
  3984. * @param {Function} iteratee The function invoked per iteration.
  3985. * @returns {Object} Returns `object`.
  3986. */
  3987. function baseForOwn(object, iteratee) {
  3988. return object && baseFor(object, iteratee, keys);
  3989. }
  3990. /**
  3991. * The base implementation of `_.forOwnRight` without support for iteratee shorthands.
  3992. *
  3993. * @private
  3994. * @param {Object} object The object to iterate over.
  3995. * @param {Function} iteratee The function invoked per iteration.
  3996. * @returns {Object} Returns `object`.
  3997. */
  3998. function baseForOwnRight(object, iteratee) {
  3999. return object && baseForRight(object, iteratee, keys);
  4000. }
  4001. /**
  4002. * The base implementation of `_.functions` which creates an array of
  4003. * `object` function property names filtered from `props`.
  4004. *
  4005. * @private
  4006. * @param {Object} object The object to inspect.
  4007. * @param {Array} props The property names to filter.
  4008. * @returns {Array} Returns the function names.
  4009. */
  4010. function baseFunctions(object, props) {
  4011. return arrayFilter(props, function(key) {
  4012. return isFunction(object[key]);
  4013. });
  4014. }
  4015. /**
  4016. * The base implementation of `_.get` without support for default values.
  4017. *
  4018. * @private
  4019. * @param {Object} object The object to query.
  4020. * @param {Array|string} path The path of the property to get.
  4021. * @returns {*} Returns the resolved value.
  4022. */
  4023. function baseGet(object, path) {
  4024. path = castPath(path, object);
  4025. var index = 0,
  4026. length = path.length;
  4027. while (object != null && index < length) {
  4028. object = object[toKey(path[index++])];
  4029. }
  4030. return (index && index == length) ? object : undefined;
  4031. }
  4032. /**
  4033. * The base implementation of `getAllKeys` and `getAllKeysIn` which uses
  4034. * `keysFunc` and `symbolsFunc` to get the enumerable property names and
  4035. * symbols of `object`.
  4036. *
  4037. * @private
  4038. * @param {Object} object The object to query.
  4039. * @param {Function} keysFunc The function to get the keys of `object`.
  4040. * @param {Function} symbolsFunc The function to get the symbols of `object`.
  4041. * @returns {Array} Returns the array of property names and symbols.
  4042. */
  4043. function baseGetAllKeys(object, keysFunc, symbolsFunc) {
  4044. var result = keysFunc(object);
  4045. return isArray(object) ? result : arrayPush(result, symbolsFunc(object));
  4046. }
  4047. /**
  4048. * The base implementation of `getTag` without fallbacks for buggy environments.
  4049. *
  4050. * @private
  4051. * @param {*} value The value to query.
  4052. * @returns {string} Returns the `toStringTag`.
  4053. */
  4054. function baseGetTag(value) {
  4055. if (value == null) {
  4056. return value === undefined ? undefinedTag : nullTag;
  4057. }
  4058. return (symToStringTag && symToStringTag in Object(value))
  4059. ? getRawTag(value)
  4060. : objectToString(value);
  4061. }
  4062. /**
  4063. * The base implementation of `_.gt` which doesn't coerce arguments.
  4064. *
  4065. * @private
  4066. * @param {*} value The value to compare.
  4067. * @param {*} other The other value to compare.
  4068. * @returns {boolean} Returns `true` if `value` is greater than `other`,
  4069. * else `false`.
  4070. */
  4071. function baseGt(value, other) {
  4072. return value > other;
  4073. }
  4074. /**
  4075. * The base implementation of `_.has` without support for deep paths.
  4076. *
  4077. * @private
  4078. * @param {Object} [object] The object to query.
  4079. * @param {Array|string} key The key to check.
  4080. * @returns {boolean} Returns `true` if `key` exists, else `false`.
  4081. */
  4082. function baseHas(object, key) {
  4083. return object != null && hasOwnProperty.call(object, key);
  4084. }
  4085. /**
  4086. * The base implementation of `_.hasIn` without support for deep paths.
  4087. *
  4088. * @private
  4089. * @param {Object} [object] The object to query.
  4090. * @param {Array|string} key The key to check.
  4091. * @returns {boolean} Returns `true` if `key` exists, else `false`.
  4092. */
  4093. function baseHasIn(object, key) {
  4094. return object != null && key in Object(object);
  4095. }
  4096. /**
  4097. * The base implementation of `_.inRange` which doesn't coerce arguments.
  4098. *
  4099. * @private
  4100. * @param {number} number The number to check.
  4101. * @param {number} start The start of the range.
  4102. * @param {number} end The end of the range.
  4103. * @returns {boolean} Returns `true` if `number` is in the range, else `false`.
  4104. */
  4105. function baseInRange(number, start, end) {
  4106. return number >= nativeMin(start, end) && number < nativeMax(start, end);
  4107. }
  4108. /**
  4109. * The base implementation of methods like `_.intersection`, without support
  4110. * for iteratee shorthands, that accepts an array of arrays to inspect.
  4111. *
  4112. * @private
  4113. * @param {Array} arrays The arrays to inspect.
  4114. * @param {Function} [iteratee] The iteratee invoked per element.
  4115. * @param {Function} [comparator] The comparator invoked per element.
  4116. * @returns {Array} Returns the new array of shared values.
  4117. */
  4118. function baseIntersection(arrays, iteratee, comparator) {
  4119. var includes = comparator ? arrayIncludesWith : arrayIncludes,
  4120. length = arrays[0].length,
  4121. othLength = arrays.length,
  4122. othIndex = othLength,
  4123. caches = Array(othLength),
  4124. maxLength = Infinity,
  4125. result = [];
  4126. while (othIndex--) {
  4127. var array = arrays[othIndex];
  4128. if (othIndex && iteratee) {
  4129. array = arrayMap(array, baseUnary(iteratee));
  4130. }
  4131. maxLength = nativeMin(array.length, maxLength);
  4132. caches[othIndex] = !comparator && (iteratee || (length >= 120 && array.length >= 120))
  4133. ? new SetCache(othIndex && array)
  4134. : undefined;
  4135. }
  4136. array = arrays[0];
  4137. var index = -1,
  4138. seen = caches[0];
  4139. outer:
  4140. while (++index < length && result.length < maxLength) {
  4141. var value = array[index],
  4142. computed = iteratee ? iteratee(value) : value;
  4143. value = (comparator || value !== 0) ? value : 0;
  4144. if (!(seen
  4145. ? cacheHas(seen, computed)
  4146. : includes(result, computed, comparator)
  4147. )) {
  4148. othIndex = othLength;
  4149. while (--othIndex) {
  4150. var cache = caches[othIndex];
  4151. if (!(cache
  4152. ? cacheHas(cache, computed)
  4153. : includes(arrays[othIndex], computed, comparator))
  4154. ) {
  4155. continue outer;
  4156. }
  4157. }
  4158. if (seen) {
  4159. seen.push(computed);
  4160. }
  4161. result.push(value);
  4162. }
  4163. }
  4164. return result;
  4165. }
  4166. /**
  4167. * The base implementation of `_.invert` and `_.invertBy` which inverts
  4168. * `object` with values transformed by `iteratee` and set by `setter`.
  4169. *
  4170. * @private
  4171. * @param {Object} object The object to iterate over.
  4172. * @param {Function} setter The function to set `accumulator` values.
  4173. * @param {Function} iteratee The iteratee to transform values.
  4174. * @param {Object} accumulator The initial inverted object.
  4175. * @returns {Function} Returns `accumulator`.
  4176. */
  4177. function baseInverter(object, setter, iteratee, accumulator) {
  4178. baseForOwn(object, function(value, key, object) {
  4179. setter(accumulator, iteratee(value), key, object);
  4180. });
  4181. return accumulator;
  4182. }
  4183. /**
  4184. * The base implementation of `_.invoke` without support for individual
  4185. * method arguments.
  4186. *
  4187. * @private
  4188. * @param {Object} object The object to query.
  4189. * @param {Array|string} path The path of the method to invoke.
  4190. * @param {Array} args The arguments to invoke the method with.
  4191. * @returns {*} Returns the result of the invoked method.
  4192. */
  4193. function baseInvoke(object, path, args) {
  4194. path = castPath(path, object);
  4195. object = parent(object, path);
  4196. var func = object == null ? object : object[toKey(last(path))];
  4197. return func == null ? undefined : apply(func, object, args);
  4198. }
  4199. /**
  4200. * The base implementation of `_.isArguments`.
  4201. *
  4202. * @private
  4203. * @param {*} value The value to check.
  4204. * @returns {boolean} Returns `true` if `value` is an `arguments` object,
  4205. */
  4206. function baseIsArguments(value) {
  4207. return isObjectLike(value) && baseGetTag(value) == argsTag;
  4208. }
  4209. /**
  4210. * The base implementation of `_.isArrayBuffer` without Node.js optimizations.
  4211. *
  4212. * @private
  4213. * @param {*} value The value to check.
  4214. * @returns {boolean} Returns `true` if `value` is an array buffer, else `false`.
  4215. */
  4216. function baseIsArrayBuffer(value) {
  4217. return isObjectLike(value) && baseGetTag(value) == arrayBufferTag;
  4218. }
  4219. /**
  4220. * The base implementation of `_.isDate` without Node.js optimizations.
  4221. *
  4222. * @private
  4223. * @param {*} value The value to check.
  4224. * @returns {boolean} Returns `true` if `value` is a date object, else `false`.
  4225. */
  4226. function baseIsDate(value) {
  4227. return isObjectLike(value) && baseGetTag(value) == dateTag;
  4228. }
  4229. /**
  4230. * The base implementation of `_.isEqual` which supports partial comparisons
  4231. * and tracks traversed objects.
  4232. *
  4233. * @private
  4234. * @param {*} value The value to compare.
  4235. * @param {*} other The other value to compare.
  4236. * @param {boolean} bitmask The bitmask flags.
  4237. * 1 - Unordered comparison
  4238. * 2 - Partial comparison
  4239. * @param {Function} [customizer] The function to customize comparisons.
  4240. * @param {Object} [stack] Tracks traversed `value` and `other` objects.
  4241. * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
  4242. */
  4243. function baseIsEqual(value, other, bitmask, customizer, stack) {
  4244. if (value === other) {
  4245. return true;
  4246. }
  4247. if (value == null || other == null || (!isObjectLike(value) && !isObjectLike(other))) {
  4248. return value !== value && other !== other;
  4249. }
  4250. return baseIsEqualDeep(value, other, bitmask, customizer, baseIsEqual, stack);
  4251. }
  4252. /**
  4253. * A specialized version of `baseIsEqual` for arrays and objects which performs
  4254. * deep comparisons and tracks traversed objects enabling objects with circular
  4255. * references to be compared.
  4256. *
  4257. * @private
  4258. * @param {Object} object The object to compare.
  4259. * @param {Object} other The other object to compare.
  4260. * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
  4261. * @param {Function} customizer The function to customize comparisons.
  4262. * @param {Function} equalFunc The function to determine equivalents of values.
  4263. * @param {Object} [stack] Tracks traversed `object` and `other` objects.
  4264. * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
  4265. */
  4266. function baseIsEqualDeep(object, other, bitmask, customizer, equalFunc, stack) {
  4267. var objIsArr = isArray(object),
  4268. othIsArr = isArray(other),
  4269. objTag = objIsArr ? arrayTag : getTag(object),
  4270. othTag = othIsArr ? arrayTag : getTag(other);
  4271. objTag = objTag == argsTag ? objectTag : objTag;
  4272. othTag = othTag == argsTag ? objectTag : othTag;
  4273. var objIsObj = objTag == objectTag,
  4274. othIsObj = othTag == objectTag,
  4275. isSameTag = objTag == othTag;
  4276. if (isSameTag && isBuffer(object)) {
  4277. if (!isBuffer(other)) {
  4278. return false;
  4279. }
  4280. objIsArr = true;
  4281. objIsObj = false;
  4282. }
  4283. if (isSameTag && !objIsObj) {
  4284. stack || (stack = new Stack);
  4285. return (objIsArr || isTypedArray(object))
  4286. ? equalArrays(object, other, bitmask, customizer, equalFunc, stack)
  4287. : equalByTag(object, other, objTag, bitmask, customizer, equalFunc, stack);
  4288. }
  4289. if (!(bitmask & COMPARE_PARTIAL_FLAG)) {
  4290. var objIsWrapped = objIsObj && hasOwnProperty.call(object, '__wrapped__'),
  4291. othIsWrapped = othIsObj && hasOwnProperty.call(other, '__wrapped__');
  4292. if (objIsWrapped || othIsWrapped) {
  4293. var objUnwrapped = objIsWrapped ? object.value() : object,
  4294. othUnwrapped = othIsWrapped ? other.value() : other;
  4295. stack || (stack = new Stack);
  4296. return equalFunc(objUnwrapped, othUnwrapped, bitmask, customizer, stack);
  4297. }
  4298. }
  4299. if (!isSameTag) {
  4300. return false;
  4301. }
  4302. stack || (stack = new Stack);
  4303. return equalObjects(object, other, bitmask, customizer, equalFunc, stack);
  4304. }
  4305. /**
  4306. * The base implementation of `_.isMap` without Node.js optimizations.
  4307. *
  4308. * @private
  4309. * @param {*} value The value to check.
  4310. * @returns {boolean} Returns `true` if `value` is a map, else `false`.
  4311. */
  4312. function baseIsMap(value) {
  4313. return isObjectLike(value) && getTag(value) == mapTag;
  4314. }
  4315. /**
  4316. * The base implementation of `_.isMatch` without support for iteratee shorthands.
  4317. *
  4318. * @private
  4319. * @param {Object} object The object to inspect.
  4320. * @param {Object} source The object of property values to match.
  4321. * @param {Array} matchData The property names, values, and compare flags to match.
  4322. * @param {Function} [customizer] The function to customize comparisons.
  4323. * @returns {boolean} Returns `true` if `object` is a match, else `false`.
  4324. */
  4325. function baseIsMatch(object, source, matchData, customizer) {
  4326. var index = matchData.length,
  4327. length = index,
  4328. noCustomizer = !customizer;
  4329. if (object == null) {
  4330. return !length;
  4331. }
  4332. object = Object(object);
  4333. while (index--) {
  4334. var data = matchData[index];
  4335. if ((noCustomizer && data[2])
  4336. ? data[1] !== object[data[0]]
  4337. : !(data[0] in object)
  4338. ) {
  4339. return false;
  4340. }
  4341. }
  4342. while (++index < length) {
  4343. data = matchData[index];
  4344. var key = data[0],
  4345. objValue = object[key],
  4346. srcValue = data[1];
  4347. if (noCustomizer && data[2]) {
  4348. if (objValue === undefined && !(key in object)) {
  4349. return false;
  4350. }
  4351. } else {
  4352. var stack = new Stack;
  4353. if (customizer) {
  4354. var result = customizer(objValue, srcValue, key, object, source, stack);
  4355. }
  4356. if (!(result === undefined
  4357. ? baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG, customizer, stack)
  4358. : result
  4359. )) {
  4360. return false;
  4361. }
  4362. }
  4363. }
  4364. return true;
  4365. }
  4366. /**
  4367. * The base implementation of `_.isNative` without bad shim checks.
  4368. *
  4369. * @private
  4370. * @param {*} value The value to check.
  4371. * @returns {boolean} Returns `true` if `value` is a native function,
  4372. * else `false`.
  4373. */
  4374. function baseIsNative(value) {
  4375. if (!isObject(value) || isMasked(value)) {
  4376. return false;
  4377. }
  4378. var pattern = isFunction(value) ? reIsNative : reIsHostCtor;
  4379. return pattern.test(toSource(value));
  4380. }
  4381. /**
  4382. * The base implementation of `_.isRegExp` without Node.js optimizations.
  4383. *
  4384. * @private
  4385. * @param {*} value The value to check.
  4386. * @returns {boolean} Returns `true` if `value` is a regexp, else `false`.
  4387. */
  4388. function baseIsRegExp(value) {
  4389. return isObjectLike(value) && baseGetTag(value) == regexpTag;
  4390. }
  4391. /**
  4392. * The base implementation of `_.isSet` without Node.js optimizations.
  4393. *
  4394. * @private
  4395. * @param {*} value The value to check.
  4396. * @returns {boolean} Returns `true` if `value` is a set, else `false`.
  4397. */
  4398. function baseIsSet(value) {
  4399. return isObjectLike(value) && getTag(value) == setTag;
  4400. }
  4401. /**
  4402. * The base implementation of `_.isTypedArray` without Node.js optimizations.
  4403. *
  4404. * @private
  4405. * @param {*} value The value to check.
  4406. * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.
  4407. */
  4408. function baseIsTypedArray(value) {
  4409. return isObjectLike(value) &&
  4410. isLength(value.length) && !!typedArrayTags[baseGetTag(value)];
  4411. }
  4412. /**
  4413. * The base implementation of `_.iteratee`.
  4414. *
  4415. * @private
  4416. * @param {*} [value=_.identity] The value to convert to an iteratee.
  4417. * @returns {Function} Returns the iteratee.
  4418. */
  4419. function baseIteratee(value) {
  4420. // Don't store the `typeof` result in a variable to avoid a JIT bug in Safari 9.
  4421. // See https://bugs.webkit.org/show_bug.cgi?id=156034 for more details.
  4422. if (typeof value == 'function') {
  4423. return value;
  4424. }
  4425. if (value == null) {
  4426. return identity;
  4427. }
  4428. if (typeof value == 'object') {
  4429. return isArray(value)
  4430. ? baseMatchesProperty(value[0], value[1])
  4431. : baseMatches(value);
  4432. }
  4433. return property(value);
  4434. }
  4435. /**
  4436. * The base implementation of `_.keys` which doesn't treat sparse arrays as dense.
  4437. *
  4438. * @private
  4439. * @param {Object} object The object to query.
  4440. * @returns {Array} Returns the array of property names.
  4441. */
  4442. function baseKeys(object) {
  4443. if (!isPrototype(object)) {
  4444. return nativeKeys(object);
  4445. }
  4446. var result = [];
  4447. for (var key in Object(object)) {
  4448. if (hasOwnProperty.call(object, key) && key != 'constructor') {
  4449. result.push(key);
  4450. }
  4451. }
  4452. return result;
  4453. }
  4454. /**
  4455. * The base implementation of `_.keysIn` which doesn't treat sparse arrays as dense.
  4456. *
  4457. * @private
  4458. * @param {Object} object The object to query.
  4459. * @returns {Array} Returns the array of property names.
  4460. */
  4461. function baseKeysIn(object) {
  4462. if (!isObject(object)) {
  4463. return nativeKeysIn(object);
  4464. }
  4465. var isProto = isPrototype(object),
  4466. result = [];
  4467. for (var key in object) {
  4468. if (!(key == 'constructor' && (isProto || !hasOwnProperty.call(object, key)))) {
  4469. result.push(key);
  4470. }
  4471. }
  4472. return result;
  4473. }
  4474. /**
  4475. * The base implementation of `_.lt` which doesn't coerce arguments.
  4476. *
  4477. * @private
  4478. * @param {*} value The value to compare.
  4479. * @param {*} other The other value to compare.
  4480. * @returns {boolean} Returns `true` if `value` is less than `other`,
  4481. * else `false`.
  4482. */
  4483. function baseLt(value, other) {
  4484. return value < other;
  4485. }
  4486. /**
  4487. * The base implementation of `_.map` without support for iteratee shorthands.
  4488. *
  4489. * @private
  4490. * @param {Array|Object} collection The collection to iterate over.
  4491. * @param {Function} iteratee The function invoked per iteration.
  4492. * @returns {Array} Returns the new mapped array.
  4493. */
  4494. function baseMap(collection, iteratee) {
  4495. var index = -1,
  4496. result = isArrayLike(collection) ? Array(collection.length) : [];
  4497. baseEach(collection, function(value, key, collection) {
  4498. result[++index] = iteratee(value, key, collection);
  4499. });
  4500. return result;
  4501. }
  4502. /**
  4503. * The base implementation of `_.matches` which doesn't clone `source`.
  4504. *
  4505. * @private
  4506. * @param {Object} source The object of property values to match.
  4507. * @returns {Function} Returns the new spec function.
  4508. */
  4509. function baseMatches(source) {
  4510. var matchData = getMatchData(source);
  4511. if (matchData.length == 1 && matchData[0][2]) {
  4512. return matchesStrictComparable(matchData[0][0], matchData[0][1]);
  4513. }
  4514. return function(object) {
  4515. return object === source || baseIsMatch(object, source, matchData);
  4516. };
  4517. }
  4518. /**
  4519. * The base implementation of `_.matchesProperty` which doesn't clone `srcValue`.
  4520. *
  4521. * @private
  4522. * @param {string} path The path of the property to get.
  4523. * @param {*} srcValue The value to match.
  4524. * @returns {Function} Returns the new spec function.
  4525. */
  4526. function baseMatchesProperty(path, srcValue) {
  4527. if (isKey(path) && isStrictComparable(srcValue)) {
  4528. return matchesStrictComparable(toKey(path), srcValue);
  4529. }
  4530. return function(object) {
  4531. var objValue = get(object, path);
  4532. return (objValue === undefined && objValue === srcValue)
  4533. ? hasIn(object, path)
  4534. : baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG);
  4535. };
  4536. }
  4537. /**
  4538. * The base implementation of `_.merge` without support for multiple sources.
  4539. *
  4540. * @private
  4541. * @param {Object} object The destination object.
  4542. * @param {Object} source The source object.
  4543. * @param {number} srcIndex The index of `source`.
  4544. * @param {Function} [customizer] The function to customize merged values.
  4545. * @param {Object} [stack] Tracks traversed source values and their merged
  4546. * counterparts.
  4547. */
  4548. function baseMerge(object, source, srcIndex, customizer, stack) {
  4549. if (object === source) {
  4550. return;
  4551. }
  4552. baseFor(source, function(srcValue, key) {
  4553. stack || (stack = new Stack);
  4554. if (isObject(srcValue)) {
  4555. baseMergeDeep(object, source, key, srcIndex, baseMerge, customizer, stack);
  4556. }
  4557. else {
  4558. var newValue = customizer
  4559. ? customizer(safeGet(object, key), srcValue, (key + ''), object, source, stack)
  4560. : undefined;
  4561. if (newValue === undefined) {
  4562. newValue = srcValue;
  4563. }
  4564. assignMergeValue(object, key, newValue);
  4565. }
  4566. }, keysIn);
  4567. }
  4568. /**
  4569. * A specialized version of `baseMerge` for arrays and objects which performs
  4570. * deep merges and tracks traversed objects enabling objects with circular
  4571. * references to be merged.
  4572. *
  4573. * @private
  4574. * @param {Object} object The destination object.
  4575. * @param {Object} source The source object.
  4576. * @param {string} key The key of the value to merge.
  4577. * @param {number} srcIndex The index of `source`.
  4578. * @param {Function} mergeFunc The function to merge values.
  4579. * @param {Function} [customizer] The function to customize assigned values.
  4580. * @param {Object} [stack] Tracks traversed source values and their merged
  4581. * counterparts.
  4582. */
  4583. function baseMergeDeep(object, source, key, srcIndex, mergeFunc, customizer, stack) {
  4584. var objValue = safeGet(object, key),
  4585. srcValue = safeGet(source, key),
  4586. stacked = stack.get(srcValue);
  4587. if (stacked) {
  4588. assignMergeValue(object, key, stacked);
  4589. return;
  4590. }
  4591. var newValue = customizer
  4592. ? customizer(objValue, srcValue, (key + ''), object, source, stack)
  4593. : undefined;
  4594. var isCommon = newValue === undefined;
  4595. if (isCommon) {
  4596. var isArr = isArray(srcValue),
  4597. isBuff = !isArr && isBuffer(srcValue),
  4598. isTyped = !isArr && !isBuff && isTypedArray(srcValue);
  4599. newValue = srcValue;
  4600. if (isArr || isBuff || isTyped) {
  4601. if (isArray(objValue)) {
  4602. newValue = objValue;
  4603. }
  4604. else if (isArrayLikeObject(objValue)) {
  4605. newValue = copyArray(objValue);
  4606. }
  4607. else if (isBuff) {
  4608. isCommon = false;
  4609. newValue = cloneBuffer(srcValue, true);
  4610. }
  4611. else if (isTyped) {
  4612. isCommon = false;
  4613. newValue = cloneTypedArray(srcValue, true);
  4614. }
  4615. else {
  4616. newValue = [];
  4617. }
  4618. }
  4619. else if (isPlainObject(srcValue) || isArguments(srcValue)) {
  4620. newValue = objValue;
  4621. if (isArguments(objValue)) {
  4622. newValue = toPlainObject(objValue);
  4623. }
  4624. else if (!isObject(objValue) || isFunction(objValue)) {
  4625. newValue = initCloneObject(srcValue);
  4626. }
  4627. }
  4628. else {
  4629. isCommon = false;
  4630. }
  4631. }
  4632. if (isCommon) {
  4633. // Recursively merge objects and arrays (susceptible to call stack limits).
  4634. stack.set(srcValue, newValue);
  4635. mergeFunc(newValue, srcValue, srcIndex, customizer, stack);
  4636. stack['delete'](srcValue);
  4637. }
  4638. assignMergeValue(object, key, newValue);
  4639. }
  4640. /**
  4641. * The base implementation of `_.nth` which doesn't coerce arguments.
  4642. *
  4643. * @private
  4644. * @param {Array} array The array to query.
  4645. * @param {number} n The index of the element to return.
  4646. * @returns {*} Returns the nth element of `array`.
  4647. */
  4648. function baseNth(array, n) {
  4649. var length = array.length;
  4650. if (!length) {
  4651. return;
  4652. }
  4653. n += n < 0 ? length : 0;
  4654. return isIndex(n, length) ? array[n] : undefined;
  4655. }
  4656. /**
  4657. * The base implementation of `_.orderBy` without param guards.
  4658. *
  4659. * @private
  4660. * @param {Array|Object} collection The collection to iterate over.
  4661. * @param {Function[]|Object[]|string[]} iteratees The iteratees to sort by.
  4662. * @param {string[]} orders The sort orders of `iteratees`.
  4663. * @returns {Array} Returns the new sorted array.
  4664. */
  4665. function baseOrderBy(collection, iteratees, orders) {
  4666. if (iteratees.length) {
  4667. iteratees = arrayMap(iteratees, function(iteratee) {
  4668. if (isArray(iteratee)) {
  4669. return function(value) {
  4670. return baseGet(value, iteratee.length === 1 ? iteratee[0] : iteratee);
  4671. }
  4672. }
  4673. return iteratee;
  4674. });
  4675. } else {
  4676. iteratees = [identity];
  4677. }
  4678. var index = -1;
  4679. iteratees = arrayMap(iteratees, baseUnary(getIteratee()));
  4680. var result = baseMap(collection, function(value, key, collection) {
  4681. var criteria = arrayMap(iteratees, function(iteratee) {
  4682. return iteratee(value);
  4683. });
  4684. return { 'criteria': criteria, 'index': ++index, 'value': value };
  4685. });
  4686. return baseSortBy(result, function(object, other) {
  4687. return compareMultiple(object, other, orders);
  4688. });
  4689. }
  4690. /**
  4691. * The base implementation of `_.pick` without support for individual
  4692. * property identifiers.
  4693. *
  4694. * @private
  4695. * @param {Object} object The source object.
  4696. * @param {string[]} paths The property paths to pick.
  4697. * @returns {Object} Returns the new object.
  4698. */
  4699. function basePick(object, paths) {
  4700. return basePickBy(object, paths, function(value, path) {
  4701. return hasIn(object, path);
  4702. });
  4703. }
  4704. /**
  4705. * The base implementation of `_.pickBy` without support for iteratee shorthands.
  4706. *
  4707. * @private
  4708. * @param {Object} object The source object.
  4709. * @param {string[]} paths The property paths to pick.
  4710. * @param {Function} predicate The function invoked per property.
  4711. * @returns {Object} Returns the new object.
  4712. */
  4713. function basePickBy(object, paths, predicate) {
  4714. var index = -1,
  4715. length = paths.length,
  4716. result = {};
  4717. while (++index < length) {
  4718. var path = paths[index],
  4719. value = baseGet(object, path);
  4720. if (predicate(value, path)) {
  4721. baseSet(result, castPath(path, object), value);
  4722. }
  4723. }
  4724. return result;
  4725. }
  4726. /**
  4727. * A specialized version of `baseProperty` which supports deep paths.
  4728. *
  4729. * @private
  4730. * @param {Array|string} path The path of the property to get.
  4731. * @returns {Function} Returns the new accessor function.
  4732. */
  4733. function basePropertyDeep(path) {
  4734. return function(object) {
  4735. return baseGet(object, path);
  4736. };
  4737. }
  4738. /**
  4739. * The base implementation of `_.pullAllBy` without support for iteratee
  4740. * shorthands.
  4741. *
  4742. * @private
  4743. * @param {Array} array The array to modify.
  4744. * @param {Array} values The values to remove.
  4745. * @param {Function} [iteratee] The iteratee invoked per element.
  4746. * @param {Function} [comparator] The comparator invoked per element.
  4747. * @returns {Array} Returns `array`.
  4748. */
  4749. function basePullAll(array, values, iteratee, comparator) {
  4750. var indexOf = comparator ? baseIndexOfWith : baseIndexOf,
  4751. index = -1,
  4752. length = values.length,
  4753. seen = array;
  4754. if (array === values) {
  4755. values = copyArray(values);
  4756. }
  4757. if (iteratee) {
  4758. seen = arrayMap(array, baseUnary(iteratee));
  4759. }
  4760. while (++index < length) {
  4761. var fromIndex = 0,
  4762. value = values[index],
  4763. computed = iteratee ? iteratee(value) : value;
  4764. while ((fromIndex = indexOf(seen, computed, fromIndex, comparator)) > -1) {
  4765. if (seen !== array) {
  4766. splice.call(seen, fromIndex, 1);
  4767. }
  4768. splice.call(array, fromIndex, 1);
  4769. }
  4770. }
  4771. return array;
  4772. }
  4773. /**
  4774. * The base implementation of `_.pullAt` without support for individual
  4775. * indexes or capturing the removed elements.
  4776. *
  4777. * @private
  4778. * @param {Array} array The array to modify.
  4779. * @param {number[]} indexes The indexes of elements to remove.
  4780. * @returns {Array} Returns `array`.
  4781. */
  4782. function basePullAt(array, indexes) {
  4783. var length = array ? indexes.length : 0,
  4784. lastIndex = length - 1;
  4785. while (length--) {
  4786. var index = indexes[length];
  4787. if (length == lastIndex || index !== previous) {
  4788. var previous = index;
  4789. if (isIndex(index)) {
  4790. splice.call(array, index, 1);
  4791. } else {
  4792. baseUnset(array, index);
  4793. }
  4794. }
  4795. }
  4796. return array;
  4797. }
  4798. /**
  4799. * The base implementation of `_.random` without support for returning
  4800. * floating-point numbers.
  4801. *
  4802. * @private
  4803. * @param {number} lower The lower bound.
  4804. * @param {number} upper The upper bound.
  4805. * @returns {number} Returns the random number.
  4806. */
  4807. function baseRandom(lower, upper) {
  4808. return lower + nativeFloor(nativeRandom() * (upper - lower + 1));
  4809. }
  4810. /**
  4811. * The base implementation of `_.range` and `_.rangeRight` which doesn't
  4812. * coerce arguments.
  4813. *
  4814. * @private
  4815. * @param {number} start The start of the range.
  4816. * @param {number} end The end of the range.
  4817. * @param {number} step The value to increment or decrement by.
  4818. * @param {boolean} [fromRight] Specify iterating from right to left.
  4819. * @returns {Array} Returns the range of numbers.
  4820. */
  4821. function baseRange(start, end, step, fromRight) {
  4822. var index = -1,
  4823. length = nativeMax(nativeCeil((end - start) / (step || 1)), 0),
  4824. result = Array(length);
  4825. while (length--) {
  4826. result[fromRight ? length : ++index] = start;
  4827. start += step;
  4828. }
  4829. return result;
  4830. }
  4831. /**
  4832. * The base implementation of `_.repeat` which doesn't coerce arguments.
  4833. *
  4834. * @private
  4835. * @param {string} string The string to repeat.
  4836. * @param {number} n The number of times to repeat the string.
  4837. * @returns {string} Returns the repeated string.
  4838. */
  4839. function baseRepeat(string, n) {
  4840. var result = '';
  4841. if (!string || n < 1 || n > MAX_SAFE_INTEGER) {
  4842. return result;
  4843. }
  4844. // Leverage the exponentiation by squaring algorithm for a faster repeat.
  4845. // See https://en.wikipedia.org/wiki/Exponentiation_by_squaring for more details.
  4846. do {
  4847. if (n % 2) {
  4848. result += string;
  4849. }
  4850. n = nativeFloor(n / 2);
  4851. if (n) {
  4852. string += string;
  4853. }
  4854. } while (n);
  4855. return result;
  4856. }
  4857. /**
  4858. * The base implementation of `_.rest` which doesn't validate or coerce arguments.
  4859. *
  4860. * @private
  4861. * @param {Function} func The function to apply a rest parameter to.
  4862. * @param {number} [start=func.length-1] The start position of the rest parameter.
  4863. * @returns {Function} Returns the new function.
  4864. */
  4865. function baseRest(func, start) {
  4866. return setToString(overRest(func, start, identity), func + '');
  4867. }
  4868. /**
  4869. * The base implementation of `_.sample`.
  4870. *
  4871. * @private
  4872. * @param {Array|Object} collection The collection to sample.
  4873. * @returns {*} Returns the random element.
  4874. */
  4875. function baseSample(collection) {
  4876. return arraySample(values(collection));
  4877. }
  4878. /**
  4879. * The base implementation of `_.sampleSize` without param guards.
  4880. *
  4881. * @private
  4882. * @param {Array|Object} collection The collection to sample.
  4883. * @param {number} n The number of elements to sample.
  4884. * @returns {Array} Returns the random elements.
  4885. */
  4886. function baseSampleSize(collection, n) {
  4887. var array = values(collection);
  4888. return shuffleSelf(array, baseClamp(n, 0, array.length));
  4889. }
  4890. /**
  4891. * The base implementation of `_.set`.
  4892. *
  4893. * @private
  4894. * @param {Object} object The object to modify.
  4895. * @param {Array|string} path The path of the property to set.
  4896. * @param {*} value The value to set.
  4897. * @param {Function} [customizer] The function to customize path creation.
  4898. * @returns {Object} Returns `object`.
  4899. */
  4900. function baseSet(object, path, value, customizer) {
  4901. if (!isObject(object)) {
  4902. return object;
  4903. }
  4904. path = castPath(path, object);
  4905. var index = -1,
  4906. length = path.length,
  4907. lastIndex = length - 1,
  4908. nested = object;
  4909. while (nested != null && ++index < length) {
  4910. var key = toKey(path[index]),
  4911. newValue = value;
  4912. if (key === '__proto__' || key === 'constructor' || key === 'prototype') {
  4913. return object;
  4914. }
  4915. if (index != lastIndex) {
  4916. var objValue = nested[key];
  4917. newValue = customizer ? customizer(objValue, key, nested) : undefined;
  4918. if (newValue === undefined) {
  4919. newValue = isObject(objValue)
  4920. ? objValue
  4921. : (isIndex(path[index + 1]) ? [] : {});
  4922. }
  4923. }
  4924. assignValue(nested, key, newValue);
  4925. nested = nested[key];
  4926. }
  4927. return object;
  4928. }
  4929. /**
  4930. * The base implementation of `setData` without support for hot loop shorting.
  4931. *
  4932. * @private
  4933. * @param {Function} func The function to associate metadata with.
  4934. * @param {*} data The metadata.
  4935. * @returns {Function} Returns `func`.
  4936. */
  4937. var baseSetData = !metaMap ? identity : function(func, data) {
  4938. metaMap.set(func, data);
  4939. return func;
  4940. };
  4941. /**
  4942. * The base implementation of `setToString` without support for hot loop shorting.
  4943. *
  4944. * @private
  4945. * @param {Function} func The function to modify.
  4946. * @param {Function} string The `toString` result.
  4947. * @returns {Function} Returns `func`.
  4948. */
  4949. var baseSetToString = !defineProperty ? identity : function(func, string) {
  4950. return defineProperty(func, 'toString', {
  4951. 'configurable': true,
  4952. 'enumerable': false,
  4953. 'value': constant(string),
  4954. 'writable': true
  4955. });
  4956. };
  4957. /**
  4958. * The base implementation of `_.shuffle`.
  4959. *
  4960. * @private
  4961. * @param {Array|Object} collection The collection to shuffle.
  4962. * @returns {Array} Returns the new shuffled array.
  4963. */
  4964. function baseShuffle(collection) {
  4965. return shuffleSelf(values(collection));
  4966. }
  4967. /**
  4968. * The base implementation of `_.slice` without an iteratee call guard.
  4969. *
  4970. * @private
  4971. * @param {Array} array The array to slice.
  4972. * @param {number} [start=0] The start position.
  4973. * @param {number} [end=array.length] The end position.
  4974. * @returns {Array} Returns the slice of `array`.
  4975. */
  4976. function baseSlice(array, start, end) {
  4977. var index = -1,
  4978. length = array.length;
  4979. if (start < 0) {
  4980. start = -start > length ? 0 : (length + start);
  4981. }
  4982. end = end > length ? length : end;
  4983. if (end < 0) {
  4984. end += length;
  4985. }
  4986. length = start > end ? 0 : ((end - start) >>> 0);
  4987. start >>>= 0;
  4988. var result = Array(length);
  4989. while (++index < length) {
  4990. result[index] = array[index + start];
  4991. }
  4992. return result;
  4993. }
  4994. /**
  4995. * The base implementation of `_.some` without support for iteratee shorthands.
  4996. *
  4997. * @private
  4998. * @param {Array|Object} collection The collection to iterate over.
  4999. * @param {Function} predicate The function invoked per iteration.
  5000. * @returns {boolean} Returns `true` if any element passes the predicate check,
  5001. * else `false`.
  5002. */
  5003. function baseSome(collection, predicate) {
  5004. var result;
  5005. baseEach(collection, function(value, index, collection) {
  5006. result = predicate(value, index, collection);
  5007. return !result;
  5008. });
  5009. return !!result;
  5010. }
  5011. /**
  5012. * The base implementation of `_.sortedIndex` and `_.sortedLastIndex` which
  5013. * performs a binary search of `array` to determine the index at which `value`
  5014. * should be inserted into `array` in order to maintain its sort order.
  5015. *
  5016. * @private
  5017. * @param {Array} array The sorted array to inspect.
  5018. * @param {*} value The value to evaluate.
  5019. * @param {boolean} [retHighest] Specify returning the highest qualified index.
  5020. * @returns {number} Returns the index at which `value` should be inserted
  5021. * into `array`.
  5022. */
  5023. function baseSortedIndex(array, value, retHighest) {
  5024. var low = 0,
  5025. high = array == null ? low : array.length;
  5026. if (typeof value == 'number' && value === value && high <= HALF_MAX_ARRAY_LENGTH) {
  5027. while (low < high) {
  5028. var mid = (low + high) >>> 1,
  5029. computed = array[mid];
  5030. if (computed !== null && !isSymbol(computed) &&
  5031. (retHighest ? (computed <= value) : (computed < value))) {
  5032. low = mid + 1;
  5033. } else {
  5034. high = mid;
  5035. }
  5036. }
  5037. return high;
  5038. }
  5039. return baseSortedIndexBy(array, value, identity, retHighest);
  5040. }
  5041. /**
  5042. * The base implementation of `_.sortedIndexBy` and `_.sortedLastIndexBy`
  5043. * which invokes `iteratee` for `value` and each element of `array` to compute
  5044. * their sort ranking. The iteratee is invoked with one argument; (value).
  5045. *
  5046. * @private
  5047. * @param {Array} array The sorted array to inspect.
  5048. * @param {*} value The value to evaluate.
  5049. * @param {Function} iteratee The iteratee invoked per element.
  5050. * @param {boolean} [retHighest] Specify returning the highest qualified index.
  5051. * @returns {number} Returns the index at which `value` should be inserted
  5052. * into `array`.
  5053. */
  5054. function baseSortedIndexBy(array, value, iteratee, retHighest) {
  5055. var low = 0,
  5056. high = array == null ? 0 : array.length;
  5057. if (high === 0) {
  5058. return 0;
  5059. }
  5060. value = iteratee(value);
  5061. var valIsNaN = value !== value,
  5062. valIsNull = value === null,
  5063. valIsSymbol = isSymbol(value),
  5064. valIsUndefined = value === undefined;
  5065. while (low < high) {
  5066. var mid = nativeFloor((low + high) / 2),
  5067. computed = iteratee(array[mid]),
  5068. othIsDefined = computed !== undefined,
  5069. othIsNull = computed === null,
  5070. othIsReflexive = computed === computed,
  5071. othIsSymbol = isSymbol(computed);
  5072. if (valIsNaN) {
  5073. var setLow = retHighest || othIsReflexive;
  5074. } else if (valIsUndefined) {
  5075. setLow = othIsReflexive && (retHighest || othIsDefined);
  5076. } else if (valIsNull) {
  5077. setLow = othIsReflexive && othIsDefined && (retHighest || !othIsNull);
  5078. } else if (valIsSymbol) {
  5079. setLow = othIsReflexive && othIsDefined && !othIsNull && (retHighest || !othIsSymbol);
  5080. } else if (othIsNull || othIsSymbol) {
  5081. setLow = false;
  5082. } else {
  5083. setLow = retHighest ? (computed <= value) : (computed < value);
  5084. }
  5085. if (setLow) {
  5086. low = mid + 1;
  5087. } else {
  5088. high = mid;
  5089. }
  5090. }
  5091. return nativeMin(high, MAX_ARRAY_INDEX);
  5092. }
  5093. /**
  5094. * The base implementation of `_.sortedUniq` and `_.sortedUniqBy` without
  5095. * support for iteratee shorthands.
  5096. *
  5097. * @private
  5098. * @param {Array} array The array to inspect.
  5099. * @param {Function} [iteratee] The iteratee invoked per element.
  5100. * @returns {Array} Returns the new duplicate free array.
  5101. */
  5102. function baseSortedUniq(array, iteratee) {
  5103. var index = -1,
  5104. length = array.length,
  5105. resIndex = 0,
  5106. result = [];
  5107. while (++index < length) {
  5108. var value = array[index],
  5109. computed = iteratee ? iteratee(value) : value;
  5110. if (!index || !eq(computed, seen)) {
  5111. var seen = computed;
  5112. result[resIndex++] = value === 0 ? 0 : value;
  5113. }
  5114. }
  5115. return result;
  5116. }
  5117. /**
  5118. * The base implementation of `_.toNumber` which doesn't ensure correct
  5119. * conversions of binary, hexadecimal, or octal string values.
  5120. *
  5121. * @private
  5122. * @param {*} value The value to process.
  5123. * @returns {number} Returns the number.
  5124. */
  5125. function baseToNumber(value) {
  5126. if (typeof value == 'number') {
  5127. return value;
  5128. }
  5129. if (isSymbol(value)) {
  5130. return NAN;
  5131. }
  5132. return +value;
  5133. }
  5134. /**
  5135. * The base implementation of `_.toString` which doesn't convert nullish
  5136. * values to empty strings.
  5137. *
  5138. * @private
  5139. * @param {*} value The value to process.
  5140. * @returns {string} Returns the string.
  5141. */
  5142. function baseToString(value) {
  5143. // Exit early for strings to avoid a performance hit in some environments.
  5144. if (typeof value == 'string') {
  5145. return value;
  5146. }
  5147. if (isArray(value)) {
  5148. // Recursively convert values (susceptible to call stack limits).
  5149. return arrayMap(value, baseToString) + '';
  5150. }
  5151. if (isSymbol(value)) {
  5152. return symbolToString ? symbolToString.call(value) : '';
  5153. }
  5154. var result = (value + '');
  5155. return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;
  5156. }
  5157. /**
  5158. * The base implementation of `_.uniqBy` without support for iteratee shorthands.
  5159. *
  5160. * @private
  5161. * @param {Array} array The array to inspect.
  5162. * @param {Function} [iteratee] The iteratee invoked per element.
  5163. * @param {Function} [comparator] The comparator invoked per element.
  5164. * @returns {Array} Returns the new duplicate free array.
  5165. */
  5166. function baseUniq(array, iteratee, comparator) {
  5167. var index = -1,
  5168. includes = arrayIncludes,
  5169. length = array.length,
  5170. isCommon = true,
  5171. result = [],
  5172. seen = result;
  5173. if (comparator) {
  5174. isCommon = false;
  5175. includes = arrayIncludesWith;
  5176. }
  5177. else if (length >= LARGE_ARRAY_SIZE) {
  5178. var set = iteratee ? null : createSet(array);
  5179. if (set) {
  5180. return setToArray(set);
  5181. }
  5182. isCommon = false;
  5183. includes = cacheHas;
  5184. seen = new SetCache;
  5185. }
  5186. else {
  5187. seen = iteratee ? [] : result;
  5188. }
  5189. outer:
  5190. while (++index < length) {
  5191. var value = array[index],
  5192. computed = iteratee ? iteratee(value) : value;
  5193. value = (comparator || value !== 0) ? value : 0;
  5194. if (isCommon && computed === computed) {
  5195. var seenIndex = seen.length;
  5196. while (seenIndex--) {
  5197. if (seen[seenIndex] === computed) {
  5198. continue outer;
  5199. }
  5200. }
  5201. if (iteratee) {
  5202. seen.push(computed);
  5203. }
  5204. result.push(value);
  5205. }
  5206. else if (!includes(seen, computed, comparator)) {
  5207. if (seen !== result) {
  5208. seen.push(computed);
  5209. }
  5210. result.push(value);
  5211. }
  5212. }
  5213. return result;
  5214. }
  5215. /**
  5216. * The base implementation of `_.unset`.
  5217. *
  5218. * @private
  5219. * @param {Object} object The object to modify.
  5220. * @param {Array|string} path The property path to unset.
  5221. * @returns {boolean} Returns `true` if the property is deleted, else `false`.
  5222. */
  5223. function baseUnset(object, path) {
  5224. path = castPath(path, object);
  5225. object = parent(object, path);
  5226. return object == null || delete object[toKey(last(path))];
  5227. }
  5228. /**
  5229. * The base implementation of `_.update`.
  5230. *
  5231. * @private
  5232. * @param {Object} object The object to modify.
  5233. * @param {Array|string} path The path of the property to update.
  5234. * @param {Function} updater The function to produce the updated value.
  5235. * @param {Function} [customizer] The function to customize path creation.
  5236. * @returns {Object} Returns `object`.
  5237. */
  5238. function baseUpdate(object, path, updater, customizer) {
  5239. return baseSet(object, path, updater(baseGet(object, path)), customizer);
  5240. }
  5241. /**
  5242. * The base implementation of methods like `_.dropWhile` and `_.takeWhile`
  5243. * without support for iteratee shorthands.
  5244. *
  5245. * @private
  5246. * @param {Array} array The array to query.
  5247. * @param {Function} predicate The function invoked per iteration.
  5248. * @param {boolean} [isDrop] Specify dropping elements instead of taking them.
  5249. * @param {boolean} [fromRight] Specify iterating from right to left.
  5250. * @returns {Array} Returns the slice of `array`.
  5251. */
  5252. function baseWhile(array, predicate, isDrop, fromRight) {
  5253. var length = array.length,
  5254. index = fromRight ? length : -1;
  5255. while ((fromRight ? index-- : ++index < length) &&
  5256. predicate(array[index], index, array)) {}
  5257. return isDrop
  5258. ? baseSlice(array, (fromRight ? 0 : index), (fromRight ? index + 1 : length))
  5259. : baseSlice(array, (fromRight ? index + 1 : 0), (fromRight ? length : index));
  5260. }
  5261. /**
  5262. * The base implementation of `wrapperValue` which returns the result of
  5263. * performing a sequence of actions on the unwrapped `value`, where each
  5264. * successive action is supplied the return value of the previous.
  5265. *
  5266. * @private
  5267. * @param {*} value The unwrapped value.
  5268. * @param {Array} actions Actions to perform to resolve the unwrapped value.
  5269. * @returns {*} Returns the resolved value.
  5270. */
  5271. function baseWrapperValue(value, actions) {
  5272. var result = value;
  5273. if (result instanceof LazyWrapper) {
  5274. result = result.value();
  5275. }
  5276. return arrayReduce(actions, function(result, action) {
  5277. return action.func.apply(action.thisArg, arrayPush([result], action.args));
  5278. }, result);
  5279. }
  5280. /**
  5281. * The base implementation of methods like `_.xor`, without support for
  5282. * iteratee shorthands, that accepts an array of arrays to inspect.
  5283. *
  5284. * @private
  5285. * @param {Array} arrays The arrays to inspect.
  5286. * @param {Function} [iteratee] The iteratee invoked per element.
  5287. * @param {Function} [comparator] The comparator invoked per element.
  5288. * @returns {Array} Returns the new array of values.
  5289. */
  5290. function baseXor(arrays, iteratee, comparator) {
  5291. var length = arrays.length;
  5292. if (length < 2) {
  5293. return length ? baseUniq(arrays[0]) : [];
  5294. }
  5295. var index = -1,
  5296. result = Array(length);
  5297. while (++index < length) {
  5298. var array = arrays[index],
  5299. othIndex = -1;
  5300. while (++othIndex < length) {
  5301. if (othIndex != index) {
  5302. result[index] = baseDifference(result[index] || array, arrays[othIndex], iteratee, comparator);
  5303. }
  5304. }
  5305. }
  5306. return baseUniq(baseFlatten(result, 1), iteratee, comparator);
  5307. }
  5308. /**
  5309. * This base implementation of `_.zipObject` which assigns values using `assignFunc`.
  5310. *
  5311. * @private
  5312. * @param {Array} props The property identifiers.
  5313. * @param {Array} values The property values.
  5314. * @param {Function} assignFunc The function to assign values.
  5315. * @returns {Object} Returns the new object.
  5316. */
  5317. function baseZipObject(props, values, assignFunc) {
  5318. var index = -1,
  5319. length = props.length,
  5320. valsLength = values.length,
  5321. result = {};
  5322. while (++index < length) {
  5323. var value = index < valsLength ? values[index] : undefined;
  5324. assignFunc(result, props[index], value);
  5325. }
  5326. return result;
  5327. }
  5328. /**
  5329. * Casts `value` to an empty array if it's not an array like object.
  5330. *
  5331. * @private
  5332. * @param {*} value The value to inspect.
  5333. * @returns {Array|Object} Returns the cast array-like object.
  5334. */
  5335. function castArrayLikeObject(value) {
  5336. return isArrayLikeObject(value) ? value : [];
  5337. }
  5338. /**
  5339. * Casts `value` to `identity` if it's not a function.
  5340. *
  5341. * @private
  5342. * @param {*} value The value to inspect.
  5343. * @returns {Function} Returns cast function.
  5344. */
  5345. function castFunction(value) {
  5346. return typeof value == 'function' ? value : identity;
  5347. }
  5348. /**
  5349. * Casts `value` to a path array if it's not one.
  5350. *
  5351. * @private
  5352. * @param {*} value The value to inspect.
  5353. * @param {Object} [object] The object to query keys on.
  5354. * @returns {Array} Returns the cast property path array.
  5355. */
  5356. function castPath(value, object) {
  5357. if (isArray(value)) {
  5358. return value;
  5359. }
  5360. return isKey(value, object) ? [value] : stringToPath(toString(value));
  5361. }
  5362. /**
  5363. * A `baseRest` alias which can be replaced with `identity` by module
  5364. * replacement plugins.
  5365. *
  5366. * @private
  5367. * @type {Function}
  5368. * @param {Function} func The function to apply a rest parameter to.
  5369. * @returns {Function} Returns the new function.
  5370. */
  5371. var castRest = baseRest;
  5372. /**
  5373. * Casts `array` to a slice if it's needed.
  5374. *
  5375. * @private
  5376. * @param {Array} array The array to inspect.
  5377. * @param {number} start The start position.
  5378. * @param {number} [end=array.length] The end position.
  5379. * @returns {Array} Returns the cast slice.
  5380. */
  5381. function castSlice(array, start, end) {
  5382. var length = array.length;
  5383. end = end === undefined ? length : end;
  5384. return (!start && end >= length) ? array : baseSlice(array, start, end);
  5385. }
  5386. /**
  5387. * A simple wrapper around the global [`clearTimeout`](https://mdn.io/clearTimeout).
  5388. *
  5389. * @private
  5390. * @param {number|Object} id The timer id or timeout object of the timer to clear.
  5391. */
  5392. var clearTimeout = ctxClearTimeout || function(id) {
  5393. return root.clearTimeout(id);
  5394. };
  5395. /**
  5396. * Creates a clone of `buffer`.
  5397. *
  5398. * @private
  5399. * @param {Buffer} buffer The buffer to clone.
  5400. * @param {boolean} [isDeep] Specify a deep clone.
  5401. * @returns {Buffer} Returns the cloned buffer.
  5402. */
  5403. function cloneBuffer(buffer, isDeep) {
  5404. if (isDeep) {
  5405. return buffer.slice();
  5406. }
  5407. var length = buffer.length,
  5408. result = allocUnsafe ? allocUnsafe(length) : new buffer.constructor(length);
  5409. buffer.copy(result);
  5410. return result;
  5411. }
  5412. /**
  5413. * Creates a clone of `arrayBuffer`.
  5414. *
  5415. * @private
  5416. * @param {ArrayBuffer} arrayBuffer The array buffer to clone.
  5417. * @returns {ArrayBuffer} Returns the cloned array buffer.
  5418. */
  5419. function cloneArrayBuffer(arrayBuffer) {
  5420. var result = new arrayBuffer.constructor(arrayBuffer.byteLength);
  5421. new Uint8Array(result).set(new Uint8Array(arrayBuffer));
  5422. return result;
  5423. }
  5424. /**
  5425. * Creates a clone of `dataView`.
  5426. *
  5427. * @private
  5428. * @param {Object} dataView The data view to clone.
  5429. * @param {boolean} [isDeep] Specify a deep clone.
  5430. * @returns {Object} Returns the cloned data view.
  5431. */
  5432. function cloneDataView(dataView, isDeep) {
  5433. var buffer = isDeep ? cloneArrayBuffer(dataView.buffer) : dataView.buffer;
  5434. return new dataView.constructor(buffer, dataView.byteOffset, dataView.byteLength);
  5435. }
  5436. /**
  5437. * Creates a clone of `regexp`.
  5438. *
  5439. * @private
  5440. * @param {Object} regexp The regexp to clone.
  5441. * @returns {Object} Returns the cloned regexp.
  5442. */
  5443. function cloneRegExp(regexp) {
  5444. var result = new regexp.constructor(regexp.source, reFlags.exec(regexp));
  5445. result.lastIndex = regexp.lastIndex;
  5446. return result;
  5447. }
  5448. /**
  5449. * Creates a clone of the `symbol` object.
  5450. *
  5451. * @private
  5452. * @param {Object} symbol The symbol object to clone.
  5453. * @returns {Object} Returns the cloned symbol object.
  5454. */
  5455. function cloneSymbol(symbol) {
  5456. return symbolValueOf ? Object(symbolValueOf.call(symbol)) : {};
  5457. }
  5458. /**
  5459. * Creates a clone of `typedArray`.
  5460. *
  5461. * @private
  5462. * @param {Object} typedArray The typed array to clone.
  5463. * @param {boolean} [isDeep] Specify a deep clone.
  5464. * @returns {Object} Returns the cloned typed array.
  5465. */
  5466. function cloneTypedArray(typedArray, isDeep) {
  5467. var buffer = isDeep ? cloneArrayBuffer(typedArray.buffer) : typedArray.buffer;
  5468. return new typedArray.constructor(buffer, typedArray.byteOffset, typedArray.length);
  5469. }
  5470. /**
  5471. * Compares values to sort them in ascending order.
  5472. *
  5473. * @private
  5474. * @param {*} value The value to compare.
  5475. * @param {*} other The other value to compare.
  5476. * @returns {number} Returns the sort order indicator for `value`.
  5477. */
  5478. function compareAscending(value, other) {
  5479. if (value !== other) {
  5480. var valIsDefined = value !== undefined,
  5481. valIsNull = value === null,
  5482. valIsReflexive = value === value,
  5483. valIsSymbol = isSymbol(value);
  5484. var othIsDefined = other !== undefined,
  5485. othIsNull = other === null,
  5486. othIsReflexive = other === other,
  5487. othIsSymbol = isSymbol(other);
  5488. if ((!othIsNull && !othIsSymbol && !valIsSymbol && value > other) ||
  5489. (valIsSymbol && othIsDefined && othIsReflexive && !othIsNull && !othIsSymbol) ||
  5490. (valIsNull && othIsDefined && othIsReflexive) ||
  5491. (!valIsDefined && othIsReflexive) ||
  5492. !valIsReflexive) {
  5493. return 1;
  5494. }
  5495. if ((!valIsNull && !valIsSymbol && !othIsSymbol && value < other) ||
  5496. (othIsSymbol && valIsDefined && valIsReflexive && !valIsNull && !valIsSymbol) ||
  5497. (othIsNull && valIsDefined && valIsReflexive) ||
  5498. (!othIsDefined && valIsReflexive) ||
  5499. !othIsReflexive) {
  5500. return -1;
  5501. }
  5502. }
  5503. return 0;
  5504. }
  5505. /**
  5506. * Used by `_.orderBy` to compare multiple properties of a value to another
  5507. * and stable sort them.
  5508. *
  5509. * If `orders` is unspecified, all values are sorted in ascending order. Otherwise,
  5510. * specify an order of "desc" for descending or "asc" for ascending sort order
  5511. * of corresponding values.
  5512. *
  5513. * @private
  5514. * @param {Object} object The object to compare.
  5515. * @param {Object} other The other object to compare.
  5516. * @param {boolean[]|string[]} orders The order to sort by for each property.
  5517. * @returns {number} Returns the sort order indicator for `object`.
  5518. */
  5519. function compareMultiple(object, other, orders) {
  5520. var index = -1,
  5521. objCriteria = object.criteria,
  5522. othCriteria = other.criteria,
  5523. length = objCriteria.length,
  5524. ordersLength = orders.length;
  5525. while (++index < length) {
  5526. var result = compareAscending(objCriteria[index], othCriteria[index]);
  5527. if (result) {
  5528. if (index >= ordersLength) {
  5529. return result;
  5530. }
  5531. var order = orders[index];
  5532. return result * (order == 'desc' ? -1 : 1);
  5533. }
  5534. }
  5535. // Fixes an `Array#sort` bug in the JS engine embedded in Adobe applications
  5536. // that causes it, under certain circumstances, to provide the same value for
  5537. // `object` and `other`. See https://github.com/jashkenas/underscore/pull/1247
  5538. // for more details.
  5539. //
  5540. // This also ensures a stable sort in V8 and other engines.
  5541. // See https://bugs.chromium.org/p/v8/issues/detail?id=90 for more details.
  5542. return object.index - other.index;
  5543. }
  5544. /**
  5545. * Creates an array that is the composition of partially applied arguments,
  5546. * placeholders, and provided arguments into a single array of arguments.
  5547. *
  5548. * @private
  5549. * @param {Array} args The provided arguments.
  5550. * @param {Array} partials The arguments to prepend to those provided.
  5551. * @param {Array} holders The `partials` placeholder indexes.
  5552. * @params {boolean} [isCurried] Specify composing for a curried function.
  5553. * @returns {Array} Returns the new array of composed arguments.
  5554. */
  5555. function composeArgs(args, partials, holders, isCurried) {
  5556. var argsIndex = -1,
  5557. argsLength = args.length,
  5558. holdersLength = holders.length,
  5559. leftIndex = -1,
  5560. leftLength = partials.length,
  5561. rangeLength = nativeMax(argsLength - holdersLength, 0),
  5562. result = Array(leftLength + rangeLength),
  5563. isUncurried = !isCurried;
  5564. while (++leftIndex < leftLength) {
  5565. result[leftIndex] = partials[leftIndex];
  5566. }
  5567. while (++argsIndex < holdersLength) {
  5568. if (isUncurried || argsIndex < argsLength) {
  5569. result[holders[argsIndex]] = args[argsIndex];
  5570. }
  5571. }
  5572. while (rangeLength--) {
  5573. result[leftIndex++] = args[argsIndex++];
  5574. }
  5575. return result;
  5576. }
  5577. /**
  5578. * This function is like `composeArgs` except that the arguments composition
  5579. * is tailored for `_.partialRight`.
  5580. *
  5581. * @private
  5582. * @param {Array} args The provided arguments.
  5583. * @param {Array} partials The arguments to append to those provided.
  5584. * @param {Array} holders The `partials` placeholder indexes.
  5585. * @params {boolean} [isCurried] Specify composing for a curried function.
  5586. * @returns {Array} Returns the new array of composed arguments.
  5587. */
  5588. function composeArgsRight(args, partials, holders, isCurried) {
  5589. var argsIndex = -1,
  5590. argsLength = args.length,
  5591. holdersIndex = -1,
  5592. holdersLength = holders.length,
  5593. rightIndex = -1,
  5594. rightLength = partials.length,
  5595. rangeLength = nativeMax(argsLength - holdersLength, 0),
  5596. result = Array(rangeLength + rightLength),
  5597. isUncurried = !isCurried;
  5598. while (++argsIndex < rangeLength) {
  5599. result[argsIndex] = args[argsIndex];
  5600. }
  5601. var offset = argsIndex;
  5602. while (++rightIndex < rightLength) {
  5603. result[offset + rightIndex] = partials[rightIndex];
  5604. }
  5605. while (++holdersIndex < holdersLength) {
  5606. if (isUncurried || argsIndex < argsLength) {
  5607. result[offset + holders[holdersIndex]] = args[argsIndex++];
  5608. }
  5609. }
  5610. return result;
  5611. }
  5612. /**
  5613. * Copies the values of `source` to `array`.
  5614. *
  5615. * @private
  5616. * @param {Array} source The array to copy values from.
  5617. * @param {Array} [array=[]] The array to copy values to.
  5618. * @returns {Array} Returns `array`.
  5619. */
  5620. function copyArray(source, array) {
  5621. var index = -1,
  5622. length = source.length;
  5623. array || (array = Array(length));
  5624. while (++index < length) {
  5625. array[index] = source[index];
  5626. }
  5627. return array;
  5628. }
  5629. /**
  5630. * Copies properties of `source` to `object`.
  5631. *
  5632. * @private
  5633. * @param {Object} source The object to copy properties from.
  5634. * @param {Array} props The property identifiers to copy.
  5635. * @param {Object} [object={}] The object to copy properties to.
  5636. * @param {Function} [customizer] The function to customize copied values.
  5637. * @returns {Object} Returns `object`.
  5638. */
  5639. function copyObject(source, props, object, customizer) {
  5640. var isNew = !object;
  5641. object || (object = {});
  5642. var index = -1,
  5643. length = props.length;
  5644. while (++index < length) {
  5645. var key = props[index];
  5646. var newValue = customizer
  5647. ? customizer(object[key], source[key], key, object, source)
  5648. : undefined;
  5649. if (newValue === undefined) {
  5650. newValue = source[key];
  5651. }
  5652. if (isNew) {
  5653. baseAssignValue(object, key, newValue);
  5654. } else {
  5655. assignValue(object, key, newValue);
  5656. }
  5657. }
  5658. return object;
  5659. }
  5660. /**
  5661. * Copies own symbols of `source` to `object`.
  5662. *
  5663. * @private
  5664. * @param {Object} source The object to copy symbols from.
  5665. * @param {Object} [object={}] The object to copy symbols to.
  5666. * @returns {Object} Returns `object`.
  5667. */
  5668. function copySymbols(source, object) {
  5669. return copyObject(source, getSymbols(source), object);
  5670. }
  5671. /**
  5672. * Copies own and inherited symbols of `source` to `object`.
  5673. *
  5674. * @private
  5675. * @param {Object} source The object to copy symbols from.
  5676. * @param {Object} [object={}] The object to copy symbols to.
  5677. * @returns {Object} Returns `object`.
  5678. */
  5679. function copySymbolsIn(source, object) {
  5680. return copyObject(source, getSymbolsIn(source), object);
  5681. }
  5682. /**
  5683. * Creates a function like `_.groupBy`.
  5684. *
  5685. * @private
  5686. * @param {Function} setter The function to set accumulator values.
  5687. * @param {Function} [initializer] The accumulator object initializer.
  5688. * @returns {Function} Returns the new aggregator function.
  5689. */
  5690. function createAggregator(setter, initializer) {
  5691. return function(collection, iteratee) {
  5692. var func = isArray(collection) ? arrayAggregator : baseAggregator,
  5693. accumulator = initializer ? initializer() : {};
  5694. return func(collection, setter, getIteratee(iteratee, 2), accumulator);
  5695. };
  5696. }
  5697. /**
  5698. * Creates a function like `_.assign`.
  5699. *
  5700. * @private
  5701. * @param {Function} assigner The function to assign values.
  5702. * @returns {Function} Returns the new assigner function.
  5703. */
  5704. function createAssigner(assigner) {
  5705. return baseRest(function(object, sources) {
  5706. var index = -1,
  5707. length = sources.length,
  5708. customizer = length > 1 ? sources[length - 1] : undefined,
  5709. guard = length > 2 ? sources[2] : undefined;
  5710. customizer = (assigner.length > 3 && typeof customizer == 'function')
  5711. ? (length--, customizer)
  5712. : undefined;
  5713. if (guard && isIterateeCall(sources[0], sources[1], guard)) {
  5714. customizer = length < 3 ? undefined : customizer;
  5715. length = 1;
  5716. }
  5717. object = Object(object);
  5718. while (++index < length) {
  5719. var source = sources[index];
  5720. if (source) {
  5721. assigner(object, source, index, customizer);
  5722. }
  5723. }
  5724. return object;
  5725. });
  5726. }
  5727. /**
  5728. * Creates a `baseEach` or `baseEachRight` function.
  5729. *
  5730. * @private
  5731. * @param {Function} eachFunc The function to iterate over a collection.
  5732. * @param {boolean} [fromRight] Specify iterating from right to left.
  5733. * @returns {Function} Returns the new base function.
  5734. */
  5735. function createBaseEach(eachFunc, fromRight) {
  5736. return function(collection, iteratee) {
  5737. if (collection == null) {
  5738. return collection;
  5739. }
  5740. if (!isArrayLike(collection)) {
  5741. return eachFunc(collection, iteratee);
  5742. }
  5743. var length = collection.length,
  5744. index = fromRight ? length : -1,
  5745. iterable = Object(collection);
  5746. while ((fromRight ? index-- : ++index < length)) {
  5747. if (iteratee(iterable[index], index, iterable) === false) {
  5748. break;
  5749. }
  5750. }
  5751. return collection;
  5752. };
  5753. }
  5754. /**
  5755. * Creates a base function for methods like `_.forIn` and `_.forOwn`.
  5756. *
  5757. * @private
  5758. * @param {boolean} [fromRight] Specify iterating from right to left.
  5759. * @returns {Function} Returns the new base function.
  5760. */
  5761. function createBaseFor(fromRight) {
  5762. return function(object, iteratee, keysFunc) {
  5763. var index = -1,
  5764. iterable = Object(object),
  5765. props = keysFunc(object),
  5766. length = props.length;
  5767. while (length--) {
  5768. var key = props[fromRight ? length : ++index];
  5769. if (iteratee(iterable[key], key, iterable) === false) {
  5770. break;
  5771. }
  5772. }
  5773. return object;
  5774. };
  5775. }
  5776. /**
  5777. * Creates a function that wraps `func` to invoke it with the optional `this`
  5778. * binding of `thisArg`.
  5779. *
  5780. * @private
  5781. * @param {Function} func The function to wrap.
  5782. * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
  5783. * @param {*} [thisArg] The `this` binding of `func`.
  5784. * @returns {Function} Returns the new wrapped function.
  5785. */
  5786. function createBind(func, bitmask, thisArg) {
  5787. var isBind = bitmask & WRAP_BIND_FLAG,
  5788. Ctor = createCtor(func);
  5789. function wrapper() {
  5790. var fn = (this && this !== root && this instanceof wrapper) ? Ctor : func;
  5791. return fn.apply(isBind ? thisArg : this, arguments);
  5792. }
  5793. return wrapper;
  5794. }
  5795. /**
  5796. * Creates a function like `_.lowerFirst`.
  5797. *
  5798. * @private
  5799. * @param {string} methodName The name of the `String` case method to use.
  5800. * @returns {Function} Returns the new case function.
  5801. */
  5802. function createCaseFirst(methodName) {
  5803. return function(string) {
  5804. string = toString(string);
  5805. var strSymbols = hasUnicode(string)
  5806. ? stringToArray(string)
  5807. : undefined;
  5808. var chr = strSymbols
  5809. ? strSymbols[0]
  5810. : string.charAt(0);
  5811. var trailing = strSymbols
  5812. ? castSlice(strSymbols, 1).join('')
  5813. : string.slice(1);
  5814. return chr[methodName]() + trailing;
  5815. };
  5816. }
  5817. /**
  5818. * Creates a function like `_.camelCase`.
  5819. *
  5820. * @private
  5821. * @param {Function} callback The function to combine each word.
  5822. * @returns {Function} Returns the new compounder function.
  5823. */
  5824. function createCompounder(callback) {
  5825. return function(string) {
  5826. return arrayReduce(words(deburr(string).replace(reApos, '')), callback, '');
  5827. };
  5828. }
  5829. /**
  5830. * Creates a function that produces an instance of `Ctor` regardless of
  5831. * whether it was invoked as part of a `new` expression or by `call` or `apply`.
  5832. *
  5833. * @private
  5834. * @param {Function} Ctor The constructor to wrap.
  5835. * @returns {Function} Returns the new wrapped function.
  5836. */
  5837. function createCtor(Ctor) {
  5838. return function() {
  5839. // Use a `switch` statement to work with class constructors. See
  5840. // http://ecma-international.org/ecma-262/7.0/#sec-ecmascript-function-objects-call-thisargument-argumentslist
  5841. // for more details.
  5842. var args = arguments;
  5843. switch (args.length) {
  5844. case 0: return new Ctor;
  5845. case 1: return new Ctor(args[0]);
  5846. case 2: return new Ctor(args[0], args[1]);
  5847. case 3: return new Ctor(args[0], args[1], args[2]);
  5848. case 4: return new Ctor(args[0], args[1], args[2], args[3]);
  5849. case 5: return new Ctor(args[0], args[1], args[2], args[3], args[4]);
  5850. case 6: return new Ctor(args[0], args[1], args[2], args[3], args[4], args[5]);
  5851. case 7: return new Ctor(args[0], args[1], args[2], args[3], args[4], args[5], args[6]);
  5852. }
  5853. var thisBinding = baseCreate(Ctor.prototype),
  5854. result = Ctor.apply(thisBinding, args);
  5855. // Mimic the constructor's `return` behavior.
  5856. // See https://es5.github.io/#x13.2.2 for more details.
  5857. return isObject(result) ? result : thisBinding;
  5858. };
  5859. }
  5860. /**
  5861. * Creates a function that wraps `func` to enable currying.
  5862. *
  5863. * @private
  5864. * @param {Function} func The function to wrap.
  5865. * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
  5866. * @param {number} arity The arity of `func`.
  5867. * @returns {Function} Returns the new wrapped function.
  5868. */
  5869. function createCurry(func, bitmask, arity) {
  5870. var Ctor = createCtor(func);
  5871. function wrapper() {
  5872. var length = arguments.length,
  5873. args = Array(length),
  5874. index = length,
  5875. placeholder = getHolder(wrapper);
  5876. while (index--) {
  5877. args[index] = arguments[index];
  5878. }
  5879. var holders = (length < 3 && args[0] !== placeholder && args[length - 1] !== placeholder)
  5880. ? []
  5881. : replaceHolders(args, placeholder);
  5882. length -= holders.length;
  5883. if (length < arity) {
  5884. return createRecurry(
  5885. func, bitmask, createHybrid, wrapper.placeholder, undefined,
  5886. args, holders, undefined, undefined, arity - length);
  5887. }
  5888. var fn = (this && this !== root && this instanceof wrapper) ? Ctor : func;
  5889. return apply(fn, this, args);
  5890. }
  5891. return wrapper;
  5892. }
  5893. /**
  5894. * Creates a `_.find` or `_.findLast` function.
  5895. *
  5896. * @private
  5897. * @param {Function} findIndexFunc The function to find the collection index.
  5898. * @returns {Function} Returns the new find function.
  5899. */
  5900. function createFind(findIndexFunc) {
  5901. return function(collection, predicate, fromIndex) {
  5902. var iterable = Object(collection);
  5903. if (!isArrayLike(collection)) {
  5904. var iteratee = getIteratee(predicate, 3);
  5905. collection = keys(collection);
  5906. predicate = function(key) { return iteratee(iterable[key], key, iterable); };
  5907. }
  5908. var index = findIndexFunc(collection, predicate, fromIndex);
  5909. return index > -1 ? iterable[iteratee ? collection[index] : index] : undefined;
  5910. };
  5911. }
  5912. /**
  5913. * Creates a `_.flow` or `_.flowRight` function.
  5914. *
  5915. * @private
  5916. * @param {boolean} [fromRight] Specify iterating from right to left.
  5917. * @returns {Function} Returns the new flow function.
  5918. */
  5919. function createFlow(fromRight) {
  5920. return flatRest(function(funcs) {
  5921. var length = funcs.length,
  5922. index = length,
  5923. prereq = LodashWrapper.prototype.thru;
  5924. if (fromRight) {
  5925. funcs.reverse();
  5926. }
  5927. while (index--) {
  5928. var func = funcs[index];
  5929. if (typeof func != 'function') {
  5930. throw new TypeError(FUNC_ERROR_TEXT);
  5931. }
  5932. if (prereq && !wrapper && getFuncName(func) == 'wrapper') {
  5933. var wrapper = new LodashWrapper([], true);
  5934. }
  5935. }
  5936. index = wrapper ? index : length;
  5937. while (++index < length) {
  5938. func = funcs[index];
  5939. var funcName = getFuncName(func),
  5940. data = funcName == 'wrapper' ? getData(func) : undefined;
  5941. if (data && isLaziable(data[0]) &&
  5942. data[1] == (WRAP_ARY_FLAG | WRAP_CURRY_FLAG | WRAP_PARTIAL_FLAG | WRAP_REARG_FLAG) &&
  5943. !data[4].length && data[9] == 1
  5944. ) {
  5945. wrapper = wrapper[getFuncName(data[0])].apply(wrapper, data[3]);
  5946. } else {
  5947. wrapper = (func.length == 1 && isLaziable(func))
  5948. ? wrapper[funcName]()
  5949. : wrapper.thru(func);
  5950. }
  5951. }
  5952. return function() {
  5953. var args = arguments,
  5954. value = args[0];
  5955. if (wrapper && args.length == 1 && isArray(value)) {
  5956. return wrapper.plant(value).value();
  5957. }
  5958. var index = 0,
  5959. result = length ? funcs[index].apply(this, args) : value;
  5960. while (++index < length) {
  5961. result = funcs[index].call(this, result);
  5962. }
  5963. return result;
  5964. };
  5965. });
  5966. }
  5967. /**
  5968. * Creates a function that wraps `func` to invoke it with optional `this`
  5969. * binding of `thisArg`, partial application, and currying.
  5970. *
  5971. * @private
  5972. * @param {Function|string} func The function or method name to wrap.
  5973. * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
  5974. * @param {*} [thisArg] The `this` binding of `func`.
  5975. * @param {Array} [partials] The arguments to prepend to those provided to
  5976. * the new function.
  5977. * @param {Array} [holders] The `partials` placeholder indexes.
  5978. * @param {Array} [partialsRight] The arguments to append to those provided
  5979. * to the new function.
  5980. * @param {Array} [holdersRight] The `partialsRight` placeholder indexes.
  5981. * @param {Array} [argPos] The argument positions of the new function.
  5982. * @param {number} [ary] The arity cap of `func`.
  5983. * @param {number} [arity] The arity of `func`.
  5984. * @returns {Function} Returns the new wrapped function.
  5985. */
  5986. function createHybrid(func, bitmask, thisArg, partials, holders, partialsRight, holdersRight, argPos, ary, arity) {
  5987. var isAry = bitmask & WRAP_ARY_FLAG,
  5988. isBind = bitmask & WRAP_BIND_FLAG,
  5989. isBindKey = bitmask & WRAP_BIND_KEY_FLAG,
  5990. isCurried = bitmask & (WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG),
  5991. isFlip = bitmask & WRAP_FLIP_FLAG,
  5992. Ctor = isBindKey ? undefined : createCtor(func);
  5993. function wrapper() {
  5994. var length = arguments.length,
  5995. args = Array(length),
  5996. index = length;
  5997. while (index--) {
  5998. args[index] = arguments[index];
  5999. }
  6000. if (isCurried) {
  6001. var placeholder = getHolder(wrapper),
  6002. holdersCount = countHolders(args, placeholder);
  6003. }
  6004. if (partials) {
  6005. args = composeArgs(args, partials, holders, isCurried);
  6006. }
  6007. if (partialsRight) {
  6008. args = composeArgsRight(args, partialsRight, holdersRight, isCurried);
  6009. }
  6010. length -= holdersCount;
  6011. if (isCurried && length < arity) {
  6012. var newHolders = replaceHolders(args, placeholder);
  6013. return createRecurry(
  6014. func, bitmask, createHybrid, wrapper.placeholder, thisArg,
  6015. args, newHolders, argPos, ary, arity - length
  6016. );
  6017. }
  6018. var thisBinding = isBind ? thisArg : this,
  6019. fn = isBindKey ? thisBinding[func] : func;
  6020. length = args.length;
  6021. if (argPos) {
  6022. args = reorder(args, argPos);
  6023. } else if (isFlip && length > 1) {
  6024. args.reverse();
  6025. }
  6026. if (isAry && ary < length) {
  6027. args.length = ary;
  6028. }
  6029. if (this && this !== root && this instanceof wrapper) {
  6030. fn = Ctor || createCtor(fn);
  6031. }
  6032. return fn.apply(thisBinding, args);
  6033. }
  6034. return wrapper;
  6035. }
  6036. /**
  6037. * Creates a function like `_.invertBy`.
  6038. *
  6039. * @private
  6040. * @param {Function} setter The function to set accumulator values.
  6041. * @param {Function} toIteratee The function to resolve iteratees.
  6042. * @returns {Function} Returns the new inverter function.
  6043. */
  6044. function createInverter(setter, toIteratee) {
  6045. return function(object, iteratee) {
  6046. return baseInverter(object, setter, toIteratee(iteratee), {});
  6047. };
  6048. }
  6049. /**
  6050. * Creates a function that performs a mathematical operation on two values.
  6051. *
  6052. * @private
  6053. * @param {Function} operator The function to perform the operation.
  6054. * @param {number} [defaultValue] The value used for `undefined` arguments.
  6055. * @returns {Function} Returns the new mathematical operation function.
  6056. */
  6057. function createMathOperation(operator, defaultValue) {
  6058. return function(value, other) {
  6059. var result;
  6060. if (value === undefined && other === undefined) {
  6061. return defaultValue;
  6062. }
  6063. if (value !== undefined) {
  6064. result = value;
  6065. }
  6066. if (other !== undefined) {
  6067. if (result === undefined) {
  6068. return other;
  6069. }
  6070. if (typeof value == 'string' || typeof other == 'string') {
  6071. value = baseToString(value);
  6072. other = baseToString(other);
  6073. } else {
  6074. value = baseToNumber(value);
  6075. other = baseToNumber(other);
  6076. }
  6077. result = operator(value, other);
  6078. }
  6079. return result;
  6080. };
  6081. }
  6082. /**
  6083. * Creates a function like `_.over`.
  6084. *
  6085. * @private
  6086. * @param {Function} arrayFunc The function to iterate over iteratees.
  6087. * @returns {Function} Returns the new over function.
  6088. */
  6089. function createOver(arrayFunc) {
  6090. return flatRest(function(iteratees) {
  6091. iteratees = arrayMap(iteratees, baseUnary(getIteratee()));
  6092. return baseRest(function(args) {
  6093. var thisArg = this;
  6094. return arrayFunc(iteratees, function(iteratee) {
  6095. return apply(iteratee, thisArg, args);
  6096. });
  6097. });
  6098. });
  6099. }
  6100. /**
  6101. * Creates the padding for `string` based on `length`. The `chars` string
  6102. * is truncated if the number of characters exceeds `length`.
  6103. *
  6104. * @private
  6105. * @param {number} length The padding length.
  6106. * @param {string} [chars=' '] The string used as padding.
  6107. * @returns {string} Returns the padding for `string`.
  6108. */
  6109. function createPadding(length, chars) {
  6110. chars = chars === undefined ? ' ' : baseToString(chars);
  6111. var charsLength = chars.length;
  6112. if (charsLength < 2) {
  6113. return charsLength ? baseRepeat(chars, length) : chars;
  6114. }
  6115. var result = baseRepeat(chars, nativeCeil(length / stringSize(chars)));
  6116. return hasUnicode(chars)
  6117. ? castSlice(stringToArray(result), 0, length).join('')
  6118. : result.slice(0, length);
  6119. }
  6120. /**
  6121. * Creates a function that wraps `func` to invoke it with the `this` binding
  6122. * of `thisArg` and `partials` prepended to the arguments it receives.
  6123. *
  6124. * @private
  6125. * @param {Function} func The function to wrap.
  6126. * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
  6127. * @param {*} thisArg The `this` binding of `func`.
  6128. * @param {Array} partials The arguments to prepend to those provided to
  6129. * the new function.
  6130. * @returns {Function} Returns the new wrapped function.
  6131. */
  6132. function createPartial(func, bitmask, thisArg, partials) {
  6133. var isBind = bitmask & WRAP_BIND_FLAG,
  6134. Ctor = createCtor(func);
  6135. function wrapper() {
  6136. var argsIndex = -1,
  6137. argsLength = arguments.length,
  6138. leftIndex = -1,
  6139. leftLength = partials.length,
  6140. args = Array(leftLength + argsLength),
  6141. fn = (this && this !== root && this instanceof wrapper) ? Ctor : func;
  6142. while (++leftIndex < leftLength) {
  6143. args[leftIndex] = partials[leftIndex];
  6144. }
  6145. while (argsLength--) {
  6146. args[leftIndex++] = arguments[++argsIndex];
  6147. }
  6148. return apply(fn, isBind ? thisArg : this, args);
  6149. }
  6150. return wrapper;
  6151. }
  6152. /**
  6153. * Creates a `_.range` or `_.rangeRight` function.
  6154. *
  6155. * @private
  6156. * @param {boolean} [fromRight] Specify iterating from right to left.
  6157. * @returns {Function} Returns the new range function.
  6158. */
  6159. function createRange(fromRight) {
  6160. return function(start, end, step) {
  6161. if (step && typeof step != 'number' && isIterateeCall(start, end, step)) {
  6162. end = step = undefined;
  6163. }
  6164. // Ensure the sign of `-0` is preserved.
  6165. start = toFinite(start);
  6166. if (end === undefined) {
  6167. end = start;
  6168. start = 0;
  6169. } else {
  6170. end = toFinite(end);
  6171. }
  6172. step = step === undefined ? (start < end ? 1 : -1) : toFinite(step);
  6173. return baseRange(start, end, step, fromRight);
  6174. };
  6175. }
  6176. /**
  6177. * Creates a function that performs a relational operation on two values.
  6178. *
  6179. * @private
  6180. * @param {Function} operator The function to perform the operation.
  6181. * @returns {Function} Returns the new relational operation function.
  6182. */
  6183. function createRelationalOperation(operator) {
  6184. return function(value, other) {
  6185. if (!(typeof value == 'string' && typeof other == 'string')) {
  6186. value = toNumber(value);
  6187. other = toNumber(other);
  6188. }
  6189. return operator(value, other);
  6190. };
  6191. }
  6192. /**
  6193. * Creates a function that wraps `func` to continue currying.
  6194. *
  6195. * @private
  6196. * @param {Function} func The function to wrap.
  6197. * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
  6198. * @param {Function} wrapFunc The function to create the `func` wrapper.
  6199. * @param {*} placeholder The placeholder value.
  6200. * @param {*} [thisArg] The `this` binding of `func`.
  6201. * @param {Array} [partials] The arguments to prepend to those provided to
  6202. * the new function.
  6203. * @param {Array} [holders] The `partials` placeholder indexes.
  6204. * @param {Array} [argPos] The argument positions of the new function.
  6205. * @param {number} [ary] The arity cap of `func`.
  6206. * @param {number} [arity] The arity of `func`.
  6207. * @returns {Function} Returns the new wrapped function.
  6208. */
  6209. function createRecurry(func, bitmask, wrapFunc, placeholder, thisArg, partials, holders, argPos, ary, arity) {
  6210. var isCurry = bitmask & WRAP_CURRY_FLAG,
  6211. newHolders = isCurry ? holders : undefined,
  6212. newHoldersRight = isCurry ? undefined : holders,
  6213. newPartials = isCurry ? partials : undefined,
  6214. newPartialsRight = isCurry ? undefined : partials;
  6215. bitmask |= (isCurry ? WRAP_PARTIAL_FLAG : WRAP_PARTIAL_RIGHT_FLAG);
  6216. bitmask &= ~(isCurry ? WRAP_PARTIAL_RIGHT_FLAG : WRAP_PARTIAL_FLAG);
  6217. if (!(bitmask & WRAP_CURRY_BOUND_FLAG)) {
  6218. bitmask &= ~(WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG);
  6219. }
  6220. var newData = [
  6221. func, bitmask, thisArg, newPartials, newHolders, newPartialsRight,
  6222. newHoldersRight, argPos, ary, arity
  6223. ];
  6224. var result = wrapFunc.apply(undefined, newData);
  6225. if (isLaziable(func)) {
  6226. setData(result, newData);
  6227. }
  6228. result.placeholder = placeholder;
  6229. return setWrapToString(result, func, bitmask);
  6230. }
  6231. /**
  6232. * Creates a function like `_.round`.
  6233. *
  6234. * @private
  6235. * @param {string} methodName The name of the `Math` method to use when rounding.
  6236. * @returns {Function} Returns the new round function.
  6237. */
  6238. function createRound(methodName) {
  6239. var func = Math[methodName];
  6240. return function(number, precision) {
  6241. number = toNumber(number);
  6242. precision = precision == null ? 0 : nativeMin(toInteger(precision), 292);
  6243. if (precision && nativeIsFinite(number)) {
  6244. // Shift with exponential notation to avoid floating-point issues.
  6245. // See [MDN](https://mdn.io/round#Examples) for more details.
  6246. var pair = (toString(number) + 'e').split('e'),
  6247. value = func(pair[0] + 'e' + (+pair[1] + precision));
  6248. pair = (toString(value) + 'e').split('e');
  6249. return +(pair[0] + 'e' + (+pair[1] - precision));
  6250. }
  6251. return func(number);
  6252. };
  6253. }
  6254. /**
  6255. * Creates a set object of `values`.
  6256. *
  6257. * @private
  6258. * @param {Array} values The values to add to the set.
  6259. * @returns {Object} Returns the new set.
  6260. */
  6261. var createSet = !(Set && (1 / setToArray(new Set([,-0]))[1]) == INFINITY) ? noop : function(values) {
  6262. return new Set(values);
  6263. };
  6264. /**
  6265. * Creates a `_.toPairs` or `_.toPairsIn` function.
  6266. *
  6267. * @private
  6268. * @param {Function} keysFunc The function to get the keys of a given object.
  6269. * @returns {Function} Returns the new pairs function.
  6270. */
  6271. function createToPairs(keysFunc) {
  6272. return function(object) {
  6273. var tag = getTag(object);
  6274. if (tag == mapTag) {
  6275. return mapToArray(object);
  6276. }
  6277. if (tag == setTag) {
  6278. return setToPairs(object);
  6279. }
  6280. return baseToPairs(object, keysFunc(object));
  6281. };
  6282. }
  6283. /**
  6284. * Creates a function that either curries or invokes `func` with optional
  6285. * `this` binding and partially applied arguments.
  6286. *
  6287. * @private
  6288. * @param {Function|string} func The function or method name to wrap.
  6289. * @param {number} bitmask The bitmask flags.
  6290. * 1 - `_.bind`
  6291. * 2 - `_.bindKey`
  6292. * 4 - `_.curry` or `_.curryRight` of a bound function
  6293. * 8 - `_.curry`
  6294. * 16 - `_.curryRight`
  6295. * 32 - `_.partial`
  6296. * 64 - `_.partialRight`
  6297. * 128 - `_.rearg`
  6298. * 256 - `_.ary`
  6299. * 512 - `_.flip`
  6300. * @param {*} [thisArg] The `this` binding of `func`.
  6301. * @param {Array} [partials] The arguments to be partially applied.
  6302. * @param {Array} [holders] The `partials` placeholder indexes.
  6303. * @param {Array} [argPos] The argument positions of the new function.
  6304. * @param {number} [ary] The arity cap of `func`.
  6305. * @param {number} [arity] The arity of `func`.
  6306. * @returns {Function} Returns the new wrapped function.
  6307. */
  6308. function createWrap(func, bitmask, thisArg, partials, holders, argPos, ary, arity) {
  6309. var isBindKey = bitmask & WRAP_BIND_KEY_FLAG;
  6310. if (!isBindKey && typeof func != 'function') {
  6311. throw new TypeError(FUNC_ERROR_TEXT);
  6312. }
  6313. var length = partials ? partials.length : 0;
  6314. if (!length) {
  6315. bitmask &= ~(WRAP_PARTIAL_FLAG | WRAP_PARTIAL_RIGHT_FLAG);
  6316. partials = holders = undefined;
  6317. }
  6318. ary = ary === undefined ? ary : nativeMax(toInteger(ary), 0);
  6319. arity = arity === undefined ? arity : toInteger(arity);
  6320. length -= holders ? holders.length : 0;
  6321. if (bitmask & WRAP_PARTIAL_RIGHT_FLAG) {
  6322. var partialsRight = partials,
  6323. holdersRight = holders;
  6324. partials = holders = undefined;
  6325. }
  6326. var data = isBindKey ? undefined : getData(func);
  6327. var newData = [
  6328. func, bitmask, thisArg, partials, holders, partialsRight, holdersRight,
  6329. argPos, ary, arity
  6330. ];
  6331. if (data) {
  6332. mergeData(newData, data);
  6333. }
  6334. func = newData[0];
  6335. bitmask = newData[1];
  6336. thisArg = newData[2];
  6337. partials = newData[3];
  6338. holders = newData[4];
  6339. arity = newData[9] = newData[9] === undefined
  6340. ? (isBindKey ? 0 : func.length)
  6341. : nativeMax(newData[9] - length, 0);
  6342. if (!arity && bitmask & (WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG)) {
  6343. bitmask &= ~(WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG);
  6344. }
  6345. if (!bitmask || bitmask == WRAP_BIND_FLAG) {
  6346. var result = createBind(func, bitmask, thisArg);
  6347. } else if (bitmask == WRAP_CURRY_FLAG || bitmask == WRAP_CURRY_RIGHT_FLAG) {
  6348. result = createCurry(func, bitmask, arity);
  6349. } else if ((bitmask == WRAP_PARTIAL_FLAG || bitmask == (WRAP_BIND_FLAG | WRAP_PARTIAL_FLAG)) && !holders.length) {
  6350. result = createPartial(func, bitmask, thisArg, partials);
  6351. } else {
  6352. result = createHybrid.apply(undefined, newData);
  6353. }
  6354. var setter = data ? baseSetData : setData;
  6355. return setWrapToString(setter(result, newData), func, bitmask);
  6356. }
  6357. /**
  6358. * Used by `_.defaults` to customize its `_.assignIn` use to assign properties
  6359. * of source objects to the destination object for all destination properties
  6360. * that resolve to `undefined`.
  6361. *
  6362. * @private
  6363. * @param {*} objValue The destination value.
  6364. * @param {*} srcValue The source value.
  6365. * @param {string} key The key of the property to assign.
  6366. * @param {Object} object The parent object of `objValue`.
  6367. * @returns {*} Returns the value to assign.
  6368. */
  6369. function customDefaultsAssignIn(objValue, srcValue, key, object) {
  6370. if (objValue === undefined ||
  6371. (eq(objValue, objectProto[key]) && !hasOwnProperty.call(object, key))) {
  6372. return srcValue;
  6373. }
  6374. return objValue;
  6375. }
  6376. /**
  6377. * Used by `_.defaultsDeep` to customize its `_.merge` use to merge source
  6378. * objects into destination objects that are passed thru.
  6379. *
  6380. * @private
  6381. * @param {*} objValue The destination value.
  6382. * @param {*} srcValue The source value.
  6383. * @param {string} key The key of the property to merge.
  6384. * @param {Object} object The parent object of `objValue`.
  6385. * @param {Object} source The parent object of `srcValue`.
  6386. * @param {Object} [stack] Tracks traversed source values and their merged
  6387. * counterparts.
  6388. * @returns {*} Returns the value to assign.
  6389. */
  6390. function customDefaultsMerge(objValue, srcValue, key, object, source, stack) {
  6391. if (isObject(objValue) && isObject(srcValue)) {
  6392. // Recursively merge objects and arrays (susceptible to call stack limits).
  6393. stack.set(srcValue, objValue);
  6394. baseMerge(objValue, srcValue, undefined, customDefaultsMerge, stack);
  6395. stack['delete'](srcValue);
  6396. }
  6397. return objValue;
  6398. }
  6399. /**
  6400. * Used by `_.omit` to customize its `_.cloneDeep` use to only clone plain
  6401. * objects.
  6402. *
  6403. * @private
  6404. * @param {*} value The value to inspect.
  6405. * @param {string} key The key of the property to inspect.
  6406. * @returns {*} Returns the uncloned value or `undefined` to defer cloning to `_.cloneDeep`.
  6407. */
  6408. function customOmitClone(value) {
  6409. return isPlainObject(value) ? undefined : value;
  6410. }
  6411. /**
  6412. * A specialized version of `baseIsEqualDeep` for arrays with support for
  6413. * partial deep comparisons.
  6414. *
  6415. * @private
  6416. * @param {Array} array The array to compare.
  6417. * @param {Array} other The other array to compare.
  6418. * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
  6419. * @param {Function} customizer The function to customize comparisons.
  6420. * @param {Function} equalFunc The function to determine equivalents of values.
  6421. * @param {Object} stack Tracks traversed `array` and `other` objects.
  6422. * @returns {boolean} Returns `true` if the arrays are equivalent, else `false`.
  6423. */
  6424. function equalArrays(array, other, bitmask, customizer, equalFunc, stack) {
  6425. var isPartial = bitmask & COMPARE_PARTIAL_FLAG,
  6426. arrLength = array.length,
  6427. othLength = other.length;
  6428. if (arrLength != othLength && !(isPartial && othLength > arrLength)) {
  6429. return false;
  6430. }
  6431. // Check that cyclic values are equal.
  6432. var arrStacked = stack.get(array);
  6433. var othStacked = stack.get(other);
  6434. if (arrStacked && othStacked) {
  6435. return arrStacked == other && othStacked == array;
  6436. }
  6437. var index = -1,
  6438. result = true,
  6439. seen = (bitmask & COMPARE_UNORDERED_FLAG) ? new SetCache : undefined;
  6440. stack.set(array, other);
  6441. stack.set(other, array);
  6442. // Ignore non-index properties.
  6443. while (++index < arrLength) {
  6444. var arrValue = array[index],
  6445. othValue = other[index];
  6446. if (customizer) {
  6447. var compared = isPartial
  6448. ? customizer(othValue, arrValue, index, other, array, stack)
  6449. : customizer(arrValue, othValue, index, array, other, stack);
  6450. }
  6451. if (compared !== undefined) {
  6452. if (compared) {
  6453. continue;
  6454. }
  6455. result = false;
  6456. break;
  6457. }
  6458. // Recursively compare arrays (susceptible to call stack limits).
  6459. if (seen) {
  6460. if (!arraySome(other, function(othValue, othIndex) {
  6461. if (!cacheHas(seen, othIndex) &&
  6462. (arrValue === othValue || equalFunc(arrValue, othValue, bitmask, customizer, stack))) {
  6463. return seen.push(othIndex);
  6464. }
  6465. })) {
  6466. result = false;
  6467. break;
  6468. }
  6469. } else if (!(
  6470. arrValue === othValue ||
  6471. equalFunc(arrValue, othValue, bitmask, customizer, stack)
  6472. )) {
  6473. result = false;
  6474. break;
  6475. }
  6476. }
  6477. stack['delete'](array);
  6478. stack['delete'](other);
  6479. return result;
  6480. }
  6481. /**
  6482. * A specialized version of `baseIsEqualDeep` for comparing objects of
  6483. * the same `toStringTag`.
  6484. *
  6485. * **Note:** This function only supports comparing values with tags of
  6486. * `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`.
  6487. *
  6488. * @private
  6489. * @param {Object} object The object to compare.
  6490. * @param {Object} other The other object to compare.
  6491. * @param {string} tag The `toStringTag` of the objects to compare.
  6492. * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
  6493. * @param {Function} customizer The function to customize comparisons.
  6494. * @param {Function} equalFunc The function to determine equivalents of values.
  6495. * @param {Object} stack Tracks traversed `object` and `other` objects.
  6496. * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
  6497. */
  6498. function equalByTag(object, other, tag, bitmask, customizer, equalFunc, stack) {
  6499. switch (tag) {
  6500. case dataViewTag:
  6501. if ((object.byteLength != other.byteLength) ||
  6502. (object.byteOffset != other.byteOffset)) {
  6503. return false;
  6504. }
  6505. object = object.buffer;
  6506. other = other.buffer;
  6507. case arrayBufferTag:
  6508. if ((object.byteLength != other.byteLength) ||
  6509. !equalFunc(new Uint8Array(object), new Uint8Array(other))) {
  6510. return false;
  6511. }
  6512. return true;
  6513. case boolTag:
  6514. case dateTag:
  6515. case numberTag:
  6516. // Coerce booleans to `1` or `0` and dates to milliseconds.
  6517. // Invalid dates are coerced to `NaN`.
  6518. return eq(+object, +other);
  6519. case errorTag:
  6520. return object.name == other.name && object.message == other.message;
  6521. case regexpTag:
  6522. case stringTag:
  6523. // Coerce regexes to strings and treat strings, primitives and objects,
  6524. // as equal. See http://www.ecma-international.org/ecma-262/7.0/#sec-regexp.prototype.tostring
  6525. // for more details.
  6526. return object == (other + '');
  6527. case mapTag:
  6528. var convert = mapToArray;
  6529. case setTag:
  6530. var isPartial = bitmask & COMPARE_PARTIAL_FLAG;
  6531. convert || (convert = setToArray);
  6532. if (object.size != other.size && !isPartial) {
  6533. return false;
  6534. }
  6535. // Assume cyclic values are equal.
  6536. var stacked = stack.get(object);
  6537. if (stacked) {
  6538. return stacked == other;
  6539. }
  6540. bitmask |= COMPARE_UNORDERED_FLAG;
  6541. // Recursively compare objects (susceptible to call stack limits).
  6542. stack.set(object, other);
  6543. var result = equalArrays(convert(object), convert(other), bitmask, customizer, equalFunc, stack);
  6544. stack['delete'](object);
  6545. return result;
  6546. case symbolTag:
  6547. if (symbolValueOf) {
  6548. return symbolValueOf.call(object) == symbolValueOf.call(other);
  6549. }
  6550. }
  6551. return false;
  6552. }
  6553. /**
  6554. * A specialized version of `baseIsEqualDeep` for objects with support for
  6555. * partial deep comparisons.
  6556. *
  6557. * @private
  6558. * @param {Object} object The object to compare.
  6559. * @param {Object} other The other object to compare.
  6560. * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
  6561. * @param {Function} customizer The function to customize comparisons.
  6562. * @param {Function} equalFunc The function to determine equivalents of values.
  6563. * @param {Object} stack Tracks traversed `object` and `other` objects.
  6564. * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
  6565. */
  6566. function equalObjects(object, other, bitmask, customizer, equalFunc, stack) {
  6567. var isPartial = bitmask & COMPARE_PARTIAL_FLAG,
  6568. objProps = getAllKeys(object),
  6569. objLength = objProps.length,
  6570. othProps = getAllKeys(other),
  6571. othLength = othProps.length;
  6572. if (objLength != othLength && !isPartial) {
  6573. return false;
  6574. }
  6575. var index = objLength;
  6576. while (index--) {
  6577. var key = objProps[index];
  6578. if (!(isPartial ? key in other : hasOwnProperty.call(other, key))) {
  6579. return false;
  6580. }
  6581. }
  6582. // Check that cyclic values are equal.
  6583. var objStacked = stack.get(object);
  6584. var othStacked = stack.get(other);
  6585. if (objStacked && othStacked) {
  6586. return objStacked == other && othStacked == object;
  6587. }
  6588. var result = true;
  6589. stack.set(object, other);
  6590. stack.set(other, object);
  6591. var skipCtor = isPartial;
  6592. while (++index < objLength) {
  6593. key = objProps[index];
  6594. var objValue = object[key],
  6595. othValue = other[key];
  6596. if (customizer) {
  6597. var compared = isPartial
  6598. ? customizer(othValue, objValue, key, other, object, stack)
  6599. : customizer(objValue, othValue, key, object, other, stack);
  6600. }
  6601. // Recursively compare objects (susceptible to call stack limits).
  6602. if (!(compared === undefined
  6603. ? (objValue === othValue || equalFunc(objValue, othValue, bitmask, customizer, stack))
  6604. : compared
  6605. )) {
  6606. result = false;
  6607. break;
  6608. }
  6609. skipCtor || (skipCtor = key == 'constructor');
  6610. }
  6611. if (result && !skipCtor) {
  6612. var objCtor = object.constructor,
  6613. othCtor = other.constructor;
  6614. // Non `Object` object instances with different constructors are not equal.
  6615. if (objCtor != othCtor &&
  6616. ('constructor' in object && 'constructor' in other) &&
  6617. !(typeof objCtor == 'function' && objCtor instanceof objCtor &&
  6618. typeof othCtor == 'function' && othCtor instanceof othCtor)) {
  6619. result = false;
  6620. }
  6621. }
  6622. stack['delete'](object);
  6623. stack['delete'](other);
  6624. return result;
  6625. }
  6626. /**
  6627. * A specialized version of `baseRest` which flattens the rest array.
  6628. *
  6629. * @private
  6630. * @param {Function} func The function to apply a rest parameter to.
  6631. * @returns {Function} Returns the new function.
  6632. */
  6633. function flatRest(func) {
  6634. return setToString(overRest(func, undefined, flatten), func + '');
  6635. }
  6636. /**
  6637. * Creates an array of own enumerable property names and symbols of `object`.
  6638. *
  6639. * @private
  6640. * @param {Object} object The object to query.
  6641. * @returns {Array} Returns the array of property names and symbols.
  6642. */
  6643. function getAllKeys(object) {
  6644. return baseGetAllKeys(object, keys, getSymbols);
  6645. }
  6646. /**
  6647. * Creates an array of own and inherited enumerable property names and
  6648. * symbols of `object`.
  6649. *
  6650. * @private
  6651. * @param {Object} object The object to query.
  6652. * @returns {Array} Returns the array of property names and symbols.
  6653. */
  6654. function getAllKeysIn(object) {
  6655. return baseGetAllKeys(object, keysIn, getSymbolsIn);
  6656. }
  6657. /**
  6658. * Gets metadata for `func`.
  6659. *
  6660. * @private
  6661. * @param {Function} func The function to query.
  6662. * @returns {*} Returns the metadata for `func`.
  6663. */
  6664. var getData = !metaMap ? noop : function(func) {
  6665. return metaMap.get(func);
  6666. };
  6667. /**
  6668. * Gets the name of `func`.
  6669. *
  6670. * @private
  6671. * @param {Function} func The function to query.
  6672. * @returns {string} Returns the function name.
  6673. */
  6674. function getFuncName(func) {
  6675. var result = (func.name + ''),
  6676. array = realNames[result],
  6677. length = hasOwnProperty.call(realNames, result) ? array.length : 0;
  6678. while (length--) {
  6679. var data = array[length],
  6680. otherFunc = data.func;
  6681. if (otherFunc == null || otherFunc == func) {
  6682. return data.name;
  6683. }
  6684. }
  6685. return result;
  6686. }
  6687. /**
  6688. * Gets the argument placeholder value for `func`.
  6689. *
  6690. * @private
  6691. * @param {Function} func The function to inspect.
  6692. * @returns {*} Returns the placeholder value.
  6693. */
  6694. function getHolder(func) {
  6695. var object = hasOwnProperty.call(lodash, 'placeholder') ? lodash : func;
  6696. return object.placeholder;
  6697. }
  6698. /**
  6699. * Gets the appropriate "iteratee" function. If `_.iteratee` is customized,
  6700. * this function returns the custom method, otherwise it returns `baseIteratee`.
  6701. * If arguments are provided, the chosen function is invoked with them and
  6702. * its result is returned.
  6703. *
  6704. * @private
  6705. * @param {*} [value] The value to convert to an iteratee.
  6706. * @param {number} [arity] The arity of the created iteratee.
  6707. * @returns {Function} Returns the chosen function or its result.
  6708. */
  6709. function getIteratee() {
  6710. var result = lodash.iteratee || iteratee;
  6711. result = result === iteratee ? baseIteratee : result;
  6712. return arguments.length ? result(arguments[0], arguments[1]) : result;
  6713. }
  6714. /**
  6715. * Gets the data for `map`.
  6716. *
  6717. * @private
  6718. * @param {Object} map The map to query.
  6719. * @param {string} key The reference key.
  6720. * @returns {*} Returns the map data.
  6721. */
  6722. function getMapData(map, key) {
  6723. var data = map.__data__;
  6724. return isKeyable(key)
  6725. ? data[typeof key == 'string' ? 'string' : 'hash']
  6726. : data.map;
  6727. }
  6728. /**
  6729. * Gets the property names, values, and compare flags of `object`.
  6730. *
  6731. * @private
  6732. * @param {Object} object The object to query.
  6733. * @returns {Array} Returns the match data of `object`.
  6734. */
  6735. function getMatchData(object) {
  6736. var result = keys(object),
  6737. length = result.length;
  6738. while (length--) {
  6739. var key = result[length],
  6740. value = object[key];
  6741. result[length] = [key, value, isStrictComparable(value)];
  6742. }
  6743. return result;
  6744. }
  6745. /**
  6746. * Gets the native function at `key` of `object`.
  6747. *
  6748. * @private
  6749. * @param {Object} object The object to query.
  6750. * @param {string} key The key of the method to get.
  6751. * @returns {*} Returns the function if it's native, else `undefined`.
  6752. */
  6753. function getNative(object, key) {
  6754. var value = getValue(object, key);
  6755. return baseIsNative(value) ? value : undefined;
  6756. }
  6757. /**
  6758. * A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values.
  6759. *
  6760. * @private
  6761. * @param {*} value The value to query.
  6762. * @returns {string} Returns the raw `toStringTag`.
  6763. */
  6764. function getRawTag(value) {
  6765. var isOwn = hasOwnProperty.call(value, symToStringTag),
  6766. tag = value[symToStringTag];
  6767. try {
  6768. value[symToStringTag] = undefined;
  6769. var unmasked = true;
  6770. } catch (e) {}
  6771. var result = nativeObjectToString.call(value);
  6772. if (unmasked) {
  6773. if (isOwn) {
  6774. value[symToStringTag] = tag;
  6775. } else {
  6776. delete value[symToStringTag];
  6777. }
  6778. }
  6779. return result;
  6780. }
  6781. /**
  6782. * Creates an array of the own enumerable symbols of `object`.
  6783. *
  6784. * @private
  6785. * @param {Object} object The object to query.
  6786. * @returns {Array} Returns the array of symbols.
  6787. */
  6788. var getSymbols = !nativeGetSymbols ? stubArray : function(object) {
  6789. if (object == null) {
  6790. return [];
  6791. }
  6792. object = Object(object);
  6793. return arrayFilter(nativeGetSymbols(object), function(symbol) {
  6794. return propertyIsEnumerable.call(object, symbol);
  6795. });
  6796. };
  6797. /**
  6798. * Creates an array of the own and inherited enumerable symbols of `object`.
  6799. *
  6800. * @private
  6801. * @param {Object} object The object to query.
  6802. * @returns {Array} Returns the array of symbols.
  6803. */
  6804. var getSymbolsIn = !nativeGetSymbols ? stubArray : function(object) {
  6805. var result = [];
  6806. while (object) {
  6807. arrayPush(result, getSymbols(object));
  6808. object = getPrototype(object);
  6809. }
  6810. return result;
  6811. };
  6812. /**
  6813. * Gets the `toStringTag` of `value`.
  6814. *
  6815. * @private
  6816. * @param {*} value The value to query.
  6817. * @returns {string} Returns the `toStringTag`.
  6818. */
  6819. var getTag = baseGetTag;
  6820. // Fallback for data views, maps, sets, and weak maps in IE 11 and promises in Node.js < 6.
  6821. if ((DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag) ||
  6822. (Map && getTag(new Map) != mapTag) ||
  6823. (Promise && getTag(Promise.resolve()) != promiseTag) ||
  6824. (Set && getTag(new Set) != setTag) ||
  6825. (WeakMap && getTag(new WeakMap) != weakMapTag)) {
  6826. getTag = function(value) {
  6827. var result = baseGetTag(value),
  6828. Ctor = result == objectTag ? value.constructor : undefined,
  6829. ctorString = Ctor ? toSource(Ctor) : '';
  6830. if (ctorString) {
  6831. switch (ctorString) {
  6832. case dataViewCtorString: return dataViewTag;
  6833. case mapCtorString: return mapTag;
  6834. case promiseCtorString: return promiseTag;
  6835. case setCtorString: return setTag;
  6836. case weakMapCtorString: return weakMapTag;
  6837. }
  6838. }
  6839. return result;
  6840. };
  6841. }
  6842. /**
  6843. * Gets the view, applying any `transforms` to the `start` and `end` positions.
  6844. *
  6845. * @private
  6846. * @param {number} start The start of the view.
  6847. * @param {number} end The end of the view.
  6848. * @param {Array} transforms The transformations to apply to the view.
  6849. * @returns {Object} Returns an object containing the `start` and `end`
  6850. * positions of the view.
  6851. */
  6852. function getView(start, end, transforms) {
  6853. var index = -1,
  6854. length = transforms.length;
  6855. while (++index < length) {
  6856. var data = transforms[index],
  6857. size = data.size;
  6858. switch (data.type) {
  6859. case 'drop': start += size; break;
  6860. case 'dropRight': end -= size; break;
  6861. case 'take': end = nativeMin(end, start + size); break;
  6862. case 'takeRight': start = nativeMax(start, end - size); break;
  6863. }
  6864. }
  6865. return { 'start': start, 'end': end };
  6866. }
  6867. /**
  6868. * Extracts wrapper details from the `source` body comment.
  6869. *
  6870. * @private
  6871. * @param {string} source The source to inspect.
  6872. * @returns {Array} Returns the wrapper details.
  6873. */
  6874. function getWrapDetails(source) {
  6875. var match = source.match(reWrapDetails);
  6876. return match ? match[1].split(reSplitDetails) : [];
  6877. }
  6878. /**
  6879. * Checks if `path` exists on `object`.
  6880. *
  6881. * @private
  6882. * @param {Object} object The object to query.
  6883. * @param {Array|string} path The path to check.
  6884. * @param {Function} hasFunc The function to check properties.
  6885. * @returns {boolean} Returns `true` if `path` exists, else `false`.
  6886. */
  6887. function hasPath(object, path, hasFunc) {
  6888. path = castPath(path, object);
  6889. var index = -1,
  6890. length = path.length,
  6891. result = false;
  6892. while (++index < length) {
  6893. var key = toKey(path[index]);
  6894. if (!(result = object != null && hasFunc(object, key))) {
  6895. break;
  6896. }
  6897. object = object[key];
  6898. }
  6899. if (result || ++index != length) {
  6900. return result;
  6901. }
  6902. length = object == null ? 0 : object.length;
  6903. return !!length && isLength(length) && isIndex(key, length) &&
  6904. (isArray(object) || isArguments(object));
  6905. }
  6906. /**
  6907. * Initializes an array clone.
  6908. *
  6909. * @private
  6910. * @param {Array} array The array to clone.
  6911. * @returns {Array} Returns the initialized clone.
  6912. */
  6913. function initCloneArray(array) {
  6914. var length = array.length,
  6915. result = new array.constructor(length);
  6916. // Add properties assigned by `RegExp#exec`.
  6917. if (length && typeof array[0] == 'string' && hasOwnProperty.call(array, 'index')) {
  6918. result.index = array.index;
  6919. result.input = array.input;
  6920. }
  6921. return result;
  6922. }
  6923. /**
  6924. * Initializes an object clone.
  6925. *
  6926. * @private
  6927. * @param {Object} object The object to clone.
  6928. * @returns {Object} Returns the initialized clone.
  6929. */
  6930. function initCloneObject(object) {
  6931. return (typeof object.constructor == 'function' && !isPrototype(object))
  6932. ? baseCreate(getPrototype(object))
  6933. : {};
  6934. }
  6935. /**
  6936. * Initializes an object clone based on its `toStringTag`.
  6937. *
  6938. * **Note:** This function only supports cloning values with tags of
  6939. * `Boolean`, `Date`, `Error`, `Map`, `Number`, `RegExp`, `Set`, or `String`.
  6940. *
  6941. * @private
  6942. * @param {Object} object The object to clone.
  6943. * @param {string} tag The `toStringTag` of the object to clone.
  6944. * @param {boolean} [isDeep] Specify a deep clone.
  6945. * @returns {Object} Returns the initialized clone.
  6946. */
  6947. function initCloneByTag(object, tag, isDeep) {
  6948. var Ctor = object.constructor;
  6949. switch (tag) {
  6950. case arrayBufferTag:
  6951. return cloneArrayBuffer(object);
  6952. case boolTag:
  6953. case dateTag:
  6954. return new Ctor(+object);
  6955. case dataViewTag:
  6956. return cloneDataView(object, isDeep);
  6957. case float32Tag: case float64Tag:
  6958. case int8Tag: case int16Tag: case int32Tag:
  6959. case uint8Tag: case uint8ClampedTag: case uint16Tag: case uint32Tag:
  6960. return cloneTypedArray(object, isDeep);
  6961. case mapTag:
  6962. return new Ctor;
  6963. case numberTag:
  6964. case stringTag:
  6965. return new Ctor(object);
  6966. case regexpTag:
  6967. return cloneRegExp(object);
  6968. case setTag:
  6969. return new Ctor;
  6970. case symbolTag:
  6971. return cloneSymbol(object);
  6972. }
  6973. }
  6974. /**
  6975. * Inserts wrapper `details` in a comment at the top of the `source` body.
  6976. *
  6977. * @private
  6978. * @param {string} source The source to modify.
  6979. * @returns {Array} details The details to insert.
  6980. * @returns {string} Returns the modified source.
  6981. */
  6982. function insertWrapDetails(source, details) {
  6983. var length = details.length;
  6984. if (!length) {
  6985. return source;
  6986. }
  6987. var lastIndex = length - 1;
  6988. details[lastIndex] = (length > 1 ? '& ' : '') + details[lastIndex];
  6989. details = details.join(length > 2 ? ', ' : ' ');
  6990. return source.replace(reWrapComment, '{\n/* [wrapped with ' + details + '] */\n');
  6991. }
  6992. /**
  6993. * Checks if `value` is a flattenable `arguments` object or array.
  6994. *
  6995. * @private
  6996. * @param {*} value The value to check.
  6997. * @returns {boolean} Returns `true` if `value` is flattenable, else `false`.
  6998. */
  6999. function isFlattenable(value) {
  7000. return isArray(value) || isArguments(value) ||
  7001. !!(spreadableSymbol && value && value[spreadableSymbol]);
  7002. }
  7003. /**
  7004. * Checks if `value` is a valid array-like index.
  7005. *
  7006. * @private
  7007. * @param {*} value The value to check.
  7008. * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.
  7009. * @returns {boolean} Returns `true` if `value` is a valid index, else `false`.
  7010. */
  7011. function isIndex(value, length) {
  7012. var type = typeof value;
  7013. length = length == null ? MAX_SAFE_INTEGER : length;
  7014. return !!length &&
  7015. (type == 'number' ||
  7016. (type != 'symbol' && reIsUint.test(value))) &&
  7017. (value > -1 && value % 1 == 0 && value < length);
  7018. }
  7019. /**
  7020. * Checks if the given arguments are from an iteratee call.
  7021. *
  7022. * @private
  7023. * @param {*} value The potential iteratee value argument.
  7024. * @param {*} index The potential iteratee index or key argument.
  7025. * @param {*} object The potential iteratee object argument.
  7026. * @returns {boolean} Returns `true` if the arguments are from an iteratee call,
  7027. * else `false`.
  7028. */
  7029. function isIterateeCall(value, index, object) {
  7030. if (!isObject(object)) {
  7031. return false;
  7032. }
  7033. var type = typeof index;
  7034. if (type == 'number'
  7035. ? (isArrayLike(object) && isIndex(index, object.length))
  7036. : (type == 'string' && index in object)
  7037. ) {
  7038. return eq(object[index], value);
  7039. }
  7040. return false;
  7041. }
  7042. /**
  7043. * Checks if `value` is a property name and not a property path.
  7044. *
  7045. * @private
  7046. * @param {*} value The value to check.
  7047. * @param {Object} [object] The object to query keys on.
  7048. * @returns {boolean} Returns `true` if `value` is a property name, else `false`.
  7049. */
  7050. function isKey(value, object) {
  7051. if (isArray(value)) {
  7052. return false;
  7053. }
  7054. var type = typeof value;
  7055. if (type == 'number' || type == 'symbol' || type == 'boolean' ||
  7056. value == null || isSymbol(value)) {
  7057. return true;
  7058. }
  7059. return reIsPlainProp.test(value) || !reIsDeepProp.test(value) ||
  7060. (object != null && value in Object(object));
  7061. }
  7062. /**
  7063. * Checks if `value` is suitable for use as unique object key.
  7064. *
  7065. * @private
  7066. * @param {*} value The value to check.
  7067. * @returns {boolean} Returns `true` if `value` is suitable, else `false`.
  7068. */
  7069. function isKeyable(value) {
  7070. var type = typeof value;
  7071. return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean')
  7072. ? (value !== '__proto__')
  7073. : (value === null);
  7074. }
  7075. /**
  7076. * Checks if `func` has a lazy counterpart.
  7077. *
  7078. * @private
  7079. * @param {Function} func The function to check.
  7080. * @returns {boolean} Returns `true` if `func` has a lazy counterpart,
  7081. * else `false`.
  7082. */
  7083. function isLaziable(func) {
  7084. var funcName = getFuncName(func),
  7085. other = lodash[funcName];
  7086. if (typeof other != 'function' || !(funcName in LazyWrapper.prototype)) {
  7087. return false;
  7088. }
  7089. if (func === other) {
  7090. return true;
  7091. }
  7092. var data = getData(other);
  7093. return !!data && func === data[0];
  7094. }
  7095. /**
  7096. * Checks if `func` has its source masked.
  7097. *
  7098. * @private
  7099. * @param {Function} func The function to check.
  7100. * @returns {boolean} Returns `true` if `func` is masked, else `false`.
  7101. */
  7102. function isMasked(func) {
  7103. return !!maskSrcKey && (maskSrcKey in func);
  7104. }
  7105. /**
  7106. * Checks if `func` is capable of being masked.
  7107. *
  7108. * @private
  7109. * @param {*} value The value to check.
  7110. * @returns {boolean} Returns `true` if `func` is maskable, else `false`.
  7111. */
  7112. var isMaskable = coreJsData ? isFunction : stubFalse;
  7113. /**
  7114. * Checks if `value` is likely a prototype object.
  7115. *
  7116. * @private
  7117. * @param {*} value The value to check.
  7118. * @returns {boolean} Returns `true` if `value` is a prototype, else `false`.
  7119. */
  7120. function isPrototype(value) {
  7121. var Ctor = value && value.constructor,
  7122. proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto;
  7123. return value === proto;
  7124. }
  7125. /**
  7126. * Checks if `value` is suitable for strict equality comparisons, i.e. `===`.
  7127. *
  7128. * @private
  7129. * @param {*} value The value to check.
  7130. * @returns {boolean} Returns `true` if `value` if suitable for strict
  7131. * equality comparisons, else `false`.
  7132. */
  7133. function isStrictComparable(value) {
  7134. return value === value && !isObject(value);
  7135. }
  7136. /**
  7137. * A specialized version of `matchesProperty` for source values suitable
  7138. * for strict equality comparisons, i.e. `===`.
  7139. *
  7140. * @private
  7141. * @param {string} key The key of the property to get.
  7142. * @param {*} srcValue The value to match.
  7143. * @returns {Function} Returns the new spec function.
  7144. */
  7145. function matchesStrictComparable(key, srcValue) {
  7146. return function(object) {
  7147. if (object == null) {
  7148. return false;
  7149. }
  7150. return object[key] === srcValue &&
  7151. (srcValue !== undefined || (key in Object(object)));
  7152. };
  7153. }
  7154. /**
  7155. * A specialized version of `_.memoize` which clears the memoized function's
  7156. * cache when it exceeds `MAX_MEMOIZE_SIZE`.
  7157. *
  7158. * @private
  7159. * @param {Function} func The function to have its output memoized.
  7160. * @returns {Function} Returns the new memoized function.
  7161. */
  7162. function memoizeCapped(func) {
  7163. var result = memoize(func, function(key) {
  7164. if (cache.size === MAX_MEMOIZE_SIZE) {
  7165. cache.clear();
  7166. }
  7167. return key;
  7168. });
  7169. var cache = result.cache;
  7170. return result;
  7171. }
  7172. /**
  7173. * Merges the function metadata of `source` into `data`.
  7174. *
  7175. * Merging metadata reduces the number of wrappers used to invoke a function.
  7176. * This is possible because methods like `_.bind`, `_.curry`, and `_.partial`
  7177. * may be applied regardless of execution order. Methods like `_.ary` and
  7178. * `_.rearg` modify function arguments, making the order in which they are
  7179. * executed important, preventing the merging of metadata. However, we make
  7180. * an exception for a safe combined case where curried functions have `_.ary`
  7181. * and or `_.rearg` applied.
  7182. *
  7183. * @private
  7184. * @param {Array} data The destination metadata.
  7185. * @param {Array} source The source metadata.
  7186. * @returns {Array} Returns `data`.
  7187. */
  7188. function mergeData(data, source) {
  7189. var bitmask = data[1],
  7190. srcBitmask = source[1],
  7191. newBitmask = bitmask | srcBitmask,
  7192. isCommon = newBitmask < (WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG | WRAP_ARY_FLAG);
  7193. var isCombo =
  7194. ((srcBitmask == WRAP_ARY_FLAG) && (bitmask == WRAP_CURRY_FLAG)) ||
  7195. ((srcBitmask == WRAP_ARY_FLAG) && (bitmask == WRAP_REARG_FLAG) && (data[7].length <= source[8])) ||
  7196. ((srcBitmask == (WRAP_ARY_FLAG | WRAP_REARG_FLAG)) && (source[7].length <= source[8]) && (bitmask == WRAP_CURRY_FLAG));
  7197. // Exit early if metadata can't be merged.
  7198. if (!(isCommon || isCombo)) {
  7199. return data;
  7200. }
  7201. // Use source `thisArg` if available.
  7202. if (srcBitmask & WRAP_BIND_FLAG) {
  7203. data[2] = source[2];
  7204. // Set when currying a bound function.
  7205. newBitmask |= bitmask & WRAP_BIND_FLAG ? 0 : WRAP_CURRY_BOUND_FLAG;
  7206. }
  7207. // Compose partial arguments.
  7208. var value = source[3];
  7209. if (value) {
  7210. var partials = data[3];
  7211. data[3] = partials ? composeArgs(partials, value, source[4]) : value;
  7212. data[4] = partials ? replaceHolders(data[3], PLACEHOLDER) : source[4];
  7213. }
  7214. // Compose partial right arguments.
  7215. value = source[5];
  7216. if (value) {
  7217. partials = data[5];
  7218. data[5] = partials ? composeArgsRight(partials, value, source[6]) : value;
  7219. data[6] = partials ? replaceHolders(data[5], PLACEHOLDER) : source[6];
  7220. }
  7221. // Use source `argPos` if available.
  7222. value = source[7];
  7223. if (value) {
  7224. data[7] = value;
  7225. }
  7226. // Use source `ary` if it's smaller.
  7227. if (srcBitmask & WRAP_ARY_FLAG) {
  7228. data[8] = data[8] == null ? source[8] : nativeMin(data[8], source[8]);
  7229. }
  7230. // Use source `arity` if one is not provided.
  7231. if (data[9] == null) {
  7232. data[9] = source[9];
  7233. }
  7234. // Use source `func` and merge bitmasks.
  7235. data[0] = source[0];
  7236. data[1] = newBitmask;
  7237. return data;
  7238. }
  7239. /**
  7240. * This function is like
  7241. * [`Object.keys`](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)
  7242. * except that it includes inherited enumerable properties.
  7243. *
  7244. * @private
  7245. * @param {Object} object The object to query.
  7246. * @returns {Array} Returns the array of property names.
  7247. */
  7248. function nativeKeysIn(object) {
  7249. var result = [];
  7250. if (object != null) {
  7251. for (var key in Object(object)) {
  7252. result.push(key);
  7253. }
  7254. }
  7255. return result;
  7256. }
  7257. /**
  7258. * Converts `value` to a string using `Object.prototype.toString`.
  7259. *
  7260. * @private
  7261. * @param {*} value The value to convert.
  7262. * @returns {string} Returns the converted string.
  7263. */
  7264. function objectToString(value) {
  7265. return nativeObjectToString.call(value);
  7266. }
  7267. /**
  7268. * A specialized version of `baseRest` which transforms the rest array.
  7269. *
  7270. * @private
  7271. * @param {Function} func The function to apply a rest parameter to.
  7272. * @param {number} [start=func.length-1] The start position of the rest parameter.
  7273. * @param {Function} transform The rest array transform.
  7274. * @returns {Function} Returns the new function.
  7275. */
  7276. function overRest(func, start, transform) {
  7277. start = nativeMax(start === undefined ? (func.length - 1) : start, 0);
  7278. return function() {
  7279. var args = arguments,
  7280. index = -1,
  7281. length = nativeMax(args.length - start, 0),
  7282. array = Array(length);
  7283. while (++index < length) {
  7284. array[index] = args[start + index];
  7285. }
  7286. index = -1;
  7287. var otherArgs = Array(start + 1);
  7288. while (++index < start) {
  7289. otherArgs[index] = args[index];
  7290. }
  7291. otherArgs[start] = transform(array);
  7292. return apply(func, this, otherArgs);
  7293. };
  7294. }
  7295. /**
  7296. * Gets the parent value at `path` of `object`.
  7297. *
  7298. * @private
  7299. * @param {Object} object The object to query.
  7300. * @param {Array} path The path to get the parent value of.
  7301. * @returns {*} Returns the parent value.
  7302. */
  7303. function parent(object, path) {
  7304. return path.length < 2 ? object : baseGet(object, baseSlice(path, 0, -1));
  7305. }
  7306. /**
  7307. * Reorder `array` according to the specified indexes where the element at
  7308. * the first index is assigned as the first element, the element at
  7309. * the second index is assigned as the second element, and so on.
  7310. *
  7311. * @private
  7312. * @param {Array} array The array to reorder.
  7313. * @param {Array} indexes The arranged array indexes.
  7314. * @returns {Array} Returns `array`.
  7315. */
  7316. function reorder(array, indexes) {
  7317. var arrLength = array.length,
  7318. length = nativeMin(indexes.length, arrLength),
  7319. oldArray = copyArray(array);
  7320. while (length--) {
  7321. var index = indexes[length];
  7322. array[length] = isIndex(index, arrLength) ? oldArray[index] : undefined;
  7323. }
  7324. return array;
  7325. }
  7326. /**
  7327. * Gets the value at `key`, unless `key` is "__proto__" or "constructor".
  7328. *
  7329. * @private
  7330. * @param {Object} object The object to query.
  7331. * @param {string} key The key of the property to get.
  7332. * @returns {*} Returns the property value.
  7333. */
  7334. function safeGet(object, key) {
  7335. if (key === 'constructor' && typeof object[key] === 'function') {
  7336. return;
  7337. }
  7338. if (key == '__proto__') {
  7339. return;
  7340. }
  7341. return object[key];
  7342. }
  7343. /**
  7344. * Sets metadata for `func`.
  7345. *
  7346. * **Note:** If this function becomes hot, i.e. is invoked a lot in a short
  7347. * period of time, it will trip its breaker and transition to an identity
  7348. * function to avoid garbage collection pauses in V8. See
  7349. * [V8 issue 2070](https://bugs.chromium.org/p/v8/issues/detail?id=2070)
  7350. * for more details.
  7351. *
  7352. * @private
  7353. * @param {Function} func The function to associate metadata with.
  7354. * @param {*} data The metadata.
  7355. * @returns {Function} Returns `func`.
  7356. */
  7357. var setData = shortOut(baseSetData);
  7358. /**
  7359. * A simple wrapper around the global [`setTimeout`](https://mdn.io/setTimeout).
  7360. *
  7361. * @private
  7362. * @param {Function} func The function to delay.
  7363. * @param {number} wait The number of milliseconds to delay invocation.
  7364. * @returns {number|Object} Returns the timer id or timeout object.
  7365. */
  7366. var setTimeout = ctxSetTimeout || function(func, wait) {
  7367. return root.setTimeout(func, wait);
  7368. };
  7369. /**
  7370. * Sets the `toString` method of `func` to return `string`.
  7371. *
  7372. * @private
  7373. * @param {Function} func The function to modify.
  7374. * @param {Function} string The `toString` result.
  7375. * @returns {Function} Returns `func`.
  7376. */
  7377. var setToString = shortOut(baseSetToString);
  7378. /**
  7379. * Sets the `toString` method of `wrapper` to mimic the source of `reference`
  7380. * with wrapper details in a comment at the top of the source body.
  7381. *
  7382. * @private
  7383. * @param {Function} wrapper The function to modify.
  7384. * @param {Function} reference The reference function.
  7385. * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
  7386. * @returns {Function} Returns `wrapper`.
  7387. */
  7388. function setWrapToString(wrapper, reference, bitmask) {
  7389. var source = (reference + '');
  7390. return setToString(wrapper, insertWrapDetails(source, updateWrapDetails(getWrapDetails(source), bitmask)));
  7391. }
  7392. /**
  7393. * Creates a function that'll short out and invoke `identity` instead
  7394. * of `func` when it's called `HOT_COUNT` or more times in `HOT_SPAN`
  7395. * milliseconds.
  7396. *
  7397. * @private
  7398. * @param {Function} func The function to restrict.
  7399. * @returns {Function} Returns the new shortable function.
  7400. */
  7401. function shortOut(func) {
  7402. var count = 0,
  7403. lastCalled = 0;
  7404. return function() {
  7405. var stamp = nativeNow(),
  7406. remaining = HOT_SPAN - (stamp - lastCalled);
  7407. lastCalled = stamp;
  7408. if (remaining > 0) {
  7409. if (++count >= HOT_COUNT) {
  7410. return arguments[0];
  7411. }
  7412. } else {
  7413. count = 0;
  7414. }
  7415. return func.apply(undefined, arguments);
  7416. };
  7417. }
  7418. /**
  7419. * A specialized version of `_.shuffle` which mutates and sets the size of `array`.
  7420. *
  7421. * @private
  7422. * @param {Array} array The array to shuffle.
  7423. * @param {number} [size=array.length] The size of `array`.
  7424. * @returns {Array} Returns `array`.
  7425. */
  7426. function shuffleSelf(array, size) {
  7427. var index = -1,
  7428. length = array.length,
  7429. lastIndex = length - 1;
  7430. size = size === undefined ? length : size;
  7431. while (++index < size) {
  7432. var rand = baseRandom(index, lastIndex),
  7433. value = array[rand];
  7434. array[rand] = array[index];
  7435. array[index] = value;
  7436. }
  7437. array.length = size;
  7438. return array;
  7439. }
  7440. /**
  7441. * Converts `string` to a property path array.
  7442. *
  7443. * @private
  7444. * @param {string} string The string to convert.
  7445. * @returns {Array} Returns the property path array.
  7446. */
  7447. var stringToPath = memoizeCapped(function(string) {
  7448. var result = [];
  7449. if (string.charCodeAt(0) === 46 /* . */) {
  7450. result.push('');
  7451. }
  7452. string.replace(rePropName, function(match, number, quote, subString) {
  7453. result.push(quote ? subString.replace(reEscapeChar, '$1') : (number || match));
  7454. });
  7455. return result;
  7456. });
  7457. /**
  7458. * Converts `value` to a string key if it's not a string or symbol.
  7459. *
  7460. * @private
  7461. * @param {*} value The value to inspect.
  7462. * @returns {string|symbol} Returns the key.
  7463. */
  7464. function toKey(value) {
  7465. if (typeof value == 'string' || isSymbol(value)) {
  7466. return value;
  7467. }
  7468. var result = (value + '');
  7469. return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;
  7470. }
  7471. /**
  7472. * Converts `func` to its source code.
  7473. *
  7474. * @private
  7475. * @param {Function} func The function to convert.
  7476. * @returns {string} Returns the source code.
  7477. */
  7478. function toSource(func) {
  7479. if (func != null) {
  7480. try {
  7481. return funcToString.call(func);
  7482. } catch (e) {}
  7483. try {
  7484. return (func + '');
  7485. } catch (e) {}
  7486. }
  7487. return '';
  7488. }
  7489. /**
  7490. * Updates wrapper `details` based on `bitmask` flags.
  7491. *
  7492. * @private
  7493. * @returns {Array} details The details to modify.
  7494. * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
  7495. * @returns {Array} Returns `details`.
  7496. */
  7497. function updateWrapDetails(details, bitmask) {
  7498. arrayEach(wrapFlags, function(pair) {
  7499. var value = '_.' + pair[0];
  7500. if ((bitmask & pair[1]) && !arrayIncludes(details, value)) {
  7501. details.push(value);
  7502. }
  7503. });
  7504. return details.sort();
  7505. }
  7506. /**
  7507. * Creates a clone of `wrapper`.
  7508. *
  7509. * @private
  7510. * @param {Object} wrapper The wrapper to clone.
  7511. * @returns {Object} Returns the cloned wrapper.
  7512. */
  7513. function wrapperClone(wrapper) {
  7514. if (wrapper instanceof LazyWrapper) {
  7515. return wrapper.clone();
  7516. }
  7517. var result = new LodashWrapper(wrapper.__wrapped__, wrapper.__chain__);
  7518. result.__actions__ = copyArray(wrapper.__actions__);
  7519. result.__index__ = wrapper.__index__;
  7520. result.__values__ = wrapper.__values__;
  7521. return result;
  7522. }
  7523. /*------------------------------------------------------------------------*/
  7524. /**
  7525. * Creates an array of elements split into groups the length of `size`.
  7526. * If `array` can't be split evenly, the final chunk will be the remaining
  7527. * elements.
  7528. *
  7529. * @static
  7530. * @memberOf _
  7531. * @since 3.0.0
  7532. * @category Array
  7533. * @param {Array} array The array to process.
  7534. * @param {number} [size=1] The length of each chunk
  7535. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  7536. * @returns {Array} Returns the new array of chunks.
  7537. * @example
  7538. *
  7539. * _.chunk(['a', 'b', 'c', 'd'], 2);
  7540. * // => [['a', 'b'], ['c', 'd']]
  7541. *
  7542. * _.chunk(['a', 'b', 'c', 'd'], 3);
  7543. * // => [['a', 'b', 'c'], ['d']]
  7544. */
  7545. function chunk(array, size, guard) {
  7546. if ((guard ? isIterateeCall(array, size, guard) : size === undefined)) {
  7547. size = 1;
  7548. } else {
  7549. size = nativeMax(toInteger(size), 0);
  7550. }
  7551. var length = array == null ? 0 : array.length;
  7552. if (!length || size < 1) {
  7553. return [];
  7554. }
  7555. var index = 0,
  7556. resIndex = 0,
  7557. result = Array(nativeCeil(length / size));
  7558. while (index < length) {
  7559. result[resIndex++] = baseSlice(array, index, (index += size));
  7560. }
  7561. return result;
  7562. }
  7563. /**
  7564. * Creates an array with all falsey values removed. The values `false`, `null`,
  7565. * `0`, `""`, `undefined`, and `NaN` are falsey.
  7566. *
  7567. * @static
  7568. * @memberOf _
  7569. * @since 0.1.0
  7570. * @category Array
  7571. * @param {Array} array The array to compact.
  7572. * @returns {Array} Returns the new array of filtered values.
  7573. * @example
  7574. *
  7575. * _.compact([0, 1, false, 2, '', 3]);
  7576. * // => [1, 2, 3]
  7577. */
  7578. function compact(array) {
  7579. var index = -1,
  7580. length = array == null ? 0 : array.length,
  7581. resIndex = 0,
  7582. result = [];
  7583. while (++index < length) {
  7584. var value = array[index];
  7585. if (value) {
  7586. result[resIndex++] = value;
  7587. }
  7588. }
  7589. return result;
  7590. }
  7591. /**
  7592. * Creates a new array concatenating `array` with any additional arrays
  7593. * and/or values.
  7594. *
  7595. * @static
  7596. * @memberOf _
  7597. * @since 4.0.0
  7598. * @category Array
  7599. * @param {Array} array The array to concatenate.
  7600. * @param {...*} [values] The values to concatenate.
  7601. * @returns {Array} Returns the new concatenated array.
  7602. * @example
  7603. *
  7604. * var array = [1];
  7605. * var other = _.concat(array, 2, [3], [[4]]);
  7606. *
  7607. * console.log(other);
  7608. * // => [1, 2, 3, [4]]
  7609. *
  7610. * console.log(array);
  7611. * // => [1]
  7612. */
  7613. function concat() {
  7614. var length = arguments.length;
  7615. if (!length) {
  7616. return [];
  7617. }
  7618. var args = Array(length - 1),
  7619. array = arguments[0],
  7620. index = length;
  7621. while (index--) {
  7622. args[index - 1] = arguments[index];
  7623. }
  7624. return arrayPush(isArray(array) ? copyArray(array) : [array], baseFlatten(args, 1));
  7625. }
  7626. /**
  7627. * Creates an array of `array` values not included in the other given arrays
  7628. * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  7629. * for equality comparisons. The order and references of result values are
  7630. * determined by the first array.
  7631. *
  7632. * **Note:** Unlike `_.pullAll`, this method returns a new array.
  7633. *
  7634. * @static
  7635. * @memberOf _
  7636. * @since 0.1.0
  7637. * @category Array
  7638. * @param {Array} array The array to inspect.
  7639. * @param {...Array} [values] The values to exclude.
  7640. * @returns {Array} Returns the new array of filtered values.
  7641. * @see _.without, _.xor
  7642. * @example
  7643. *
  7644. * _.difference([2, 1], [2, 3]);
  7645. * // => [1]
  7646. */
  7647. var difference = baseRest(function(array, values) {
  7648. return isArrayLikeObject(array)
  7649. ? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true))
  7650. : [];
  7651. });
  7652. /**
  7653. * This method is like `_.difference` except that it accepts `iteratee` which
  7654. * is invoked for each element of `array` and `values` to generate the criterion
  7655. * by which they're compared. The order and references of result values are
  7656. * determined by the first array. The iteratee is invoked with one argument:
  7657. * (value).
  7658. *
  7659. * **Note:** Unlike `_.pullAllBy`, this method returns a new array.
  7660. *
  7661. * @static
  7662. * @memberOf _
  7663. * @since 4.0.0
  7664. * @category Array
  7665. * @param {Array} array The array to inspect.
  7666. * @param {...Array} [values] The values to exclude.
  7667. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  7668. * @returns {Array} Returns the new array of filtered values.
  7669. * @example
  7670. *
  7671. * _.differenceBy([2.1, 1.2], [2.3, 3.4], Math.floor);
  7672. * // => [1.2]
  7673. *
  7674. * // The `_.property` iteratee shorthand.
  7675. * _.differenceBy([{ 'x': 2 }, { 'x': 1 }], [{ 'x': 1 }], 'x');
  7676. * // => [{ 'x': 2 }]
  7677. */
  7678. var differenceBy = baseRest(function(array, values) {
  7679. var iteratee = last(values);
  7680. if (isArrayLikeObject(iteratee)) {
  7681. iteratee = undefined;
  7682. }
  7683. return isArrayLikeObject(array)
  7684. ? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true), getIteratee(iteratee, 2))
  7685. : [];
  7686. });
  7687. /**
  7688. * This method is like `_.difference` except that it accepts `comparator`
  7689. * which is invoked to compare elements of `array` to `values`. The order and
  7690. * references of result values are determined by the first array. The comparator
  7691. * is invoked with two arguments: (arrVal, othVal).
  7692. *
  7693. * **Note:** Unlike `_.pullAllWith`, this method returns a new array.
  7694. *
  7695. * @static
  7696. * @memberOf _
  7697. * @since 4.0.0
  7698. * @category Array
  7699. * @param {Array} array The array to inspect.
  7700. * @param {...Array} [values] The values to exclude.
  7701. * @param {Function} [comparator] The comparator invoked per element.
  7702. * @returns {Array} Returns the new array of filtered values.
  7703. * @example
  7704. *
  7705. * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }];
  7706. *
  7707. * _.differenceWith(objects, [{ 'x': 1, 'y': 2 }], _.isEqual);
  7708. * // => [{ 'x': 2, 'y': 1 }]
  7709. */
  7710. var differenceWith = baseRest(function(array, values) {
  7711. var comparator = last(values);
  7712. if (isArrayLikeObject(comparator)) {
  7713. comparator = undefined;
  7714. }
  7715. return isArrayLikeObject(array)
  7716. ? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true), undefined, comparator)
  7717. : [];
  7718. });
  7719. /**
  7720. * Creates a slice of `array` with `n` elements dropped from the beginning.
  7721. *
  7722. * @static
  7723. * @memberOf _
  7724. * @since 0.5.0
  7725. * @category Array
  7726. * @param {Array} array The array to query.
  7727. * @param {number} [n=1] The number of elements to drop.
  7728. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  7729. * @returns {Array} Returns the slice of `array`.
  7730. * @example
  7731. *
  7732. * _.drop([1, 2, 3]);
  7733. * // => [2, 3]
  7734. *
  7735. * _.drop([1, 2, 3], 2);
  7736. * // => [3]
  7737. *
  7738. * _.drop([1, 2, 3], 5);
  7739. * // => []
  7740. *
  7741. * _.drop([1, 2, 3], 0);
  7742. * // => [1, 2, 3]
  7743. */
  7744. function drop(array, n, guard) {
  7745. var length = array == null ? 0 : array.length;
  7746. if (!length) {
  7747. return [];
  7748. }
  7749. n = (guard || n === undefined) ? 1 : toInteger(n);
  7750. return baseSlice(array, n < 0 ? 0 : n, length);
  7751. }
  7752. /**
  7753. * Creates a slice of `array` with `n` elements dropped from the end.
  7754. *
  7755. * @static
  7756. * @memberOf _
  7757. * @since 3.0.0
  7758. * @category Array
  7759. * @param {Array} array The array to query.
  7760. * @param {number} [n=1] The number of elements to drop.
  7761. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  7762. * @returns {Array} Returns the slice of `array`.
  7763. * @example
  7764. *
  7765. * _.dropRight([1, 2, 3]);
  7766. * // => [1, 2]
  7767. *
  7768. * _.dropRight([1, 2, 3], 2);
  7769. * // => [1]
  7770. *
  7771. * _.dropRight([1, 2, 3], 5);
  7772. * // => []
  7773. *
  7774. * _.dropRight([1, 2, 3], 0);
  7775. * // => [1, 2, 3]
  7776. */
  7777. function dropRight(array, n, guard) {
  7778. var length = array == null ? 0 : array.length;
  7779. if (!length) {
  7780. return [];
  7781. }
  7782. n = (guard || n === undefined) ? 1 : toInteger(n);
  7783. n = length - n;
  7784. return baseSlice(array, 0, n < 0 ? 0 : n);
  7785. }
  7786. /**
  7787. * Creates a slice of `array` excluding elements dropped from the end.
  7788. * Elements are dropped until `predicate` returns falsey. The predicate is
  7789. * invoked with three arguments: (value, index, array).
  7790. *
  7791. * @static
  7792. * @memberOf _
  7793. * @since 3.0.0
  7794. * @category Array
  7795. * @param {Array} array The array to query.
  7796. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  7797. * @returns {Array} Returns the slice of `array`.
  7798. * @example
  7799. *
  7800. * var users = [
  7801. * { 'user': 'barney', 'active': true },
  7802. * { 'user': 'fred', 'active': false },
  7803. * { 'user': 'pebbles', 'active': false }
  7804. * ];
  7805. *
  7806. * _.dropRightWhile(users, function(o) { return !o.active; });
  7807. * // => objects for ['barney']
  7808. *
  7809. * // The `_.matches` iteratee shorthand.
  7810. * _.dropRightWhile(users, { 'user': 'pebbles', 'active': false });
  7811. * // => objects for ['barney', 'fred']
  7812. *
  7813. * // The `_.matchesProperty` iteratee shorthand.
  7814. * _.dropRightWhile(users, ['active', false]);
  7815. * // => objects for ['barney']
  7816. *
  7817. * // The `_.property` iteratee shorthand.
  7818. * _.dropRightWhile(users, 'active');
  7819. * // => objects for ['barney', 'fred', 'pebbles']
  7820. */
  7821. function dropRightWhile(array, predicate) {
  7822. return (array && array.length)
  7823. ? baseWhile(array, getIteratee(predicate, 3), true, true)
  7824. : [];
  7825. }
  7826. /**
  7827. * Creates a slice of `array` excluding elements dropped from the beginning.
  7828. * Elements are dropped until `predicate` returns falsey. The predicate is
  7829. * invoked with three arguments: (value, index, array).
  7830. *
  7831. * @static
  7832. * @memberOf _
  7833. * @since 3.0.0
  7834. * @category Array
  7835. * @param {Array} array The array to query.
  7836. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  7837. * @returns {Array} Returns the slice of `array`.
  7838. * @example
  7839. *
  7840. * var users = [
  7841. * { 'user': 'barney', 'active': false },
  7842. * { 'user': 'fred', 'active': false },
  7843. * { 'user': 'pebbles', 'active': true }
  7844. * ];
  7845. *
  7846. * _.dropWhile(users, function(o) { return !o.active; });
  7847. * // => objects for ['pebbles']
  7848. *
  7849. * // The `_.matches` iteratee shorthand.
  7850. * _.dropWhile(users, { 'user': 'barney', 'active': false });
  7851. * // => objects for ['fred', 'pebbles']
  7852. *
  7853. * // The `_.matchesProperty` iteratee shorthand.
  7854. * _.dropWhile(users, ['active', false]);
  7855. * // => objects for ['pebbles']
  7856. *
  7857. * // The `_.property` iteratee shorthand.
  7858. * _.dropWhile(users, 'active');
  7859. * // => objects for ['barney', 'fred', 'pebbles']
  7860. */
  7861. function dropWhile(array, predicate) {
  7862. return (array && array.length)
  7863. ? baseWhile(array, getIteratee(predicate, 3), true)
  7864. : [];
  7865. }
  7866. /**
  7867. * Fills elements of `array` with `value` from `start` up to, but not
  7868. * including, `end`.
  7869. *
  7870. * **Note:** This method mutates `array`.
  7871. *
  7872. * @static
  7873. * @memberOf _
  7874. * @since 3.2.0
  7875. * @category Array
  7876. * @param {Array} array The array to fill.
  7877. * @param {*} value The value to fill `array` with.
  7878. * @param {number} [start=0] The start position.
  7879. * @param {number} [end=array.length] The end position.
  7880. * @returns {Array} Returns `array`.
  7881. * @example
  7882. *
  7883. * var array = [1, 2, 3];
  7884. *
  7885. * _.fill(array, 'a');
  7886. * console.log(array);
  7887. * // => ['a', 'a', 'a']
  7888. *
  7889. * _.fill(Array(3), 2);
  7890. * // => [2, 2, 2]
  7891. *
  7892. * _.fill([4, 6, 8, 10], '*', 1, 3);
  7893. * // => [4, '*', '*', 10]
  7894. */
  7895. function fill(array, value, start, end) {
  7896. var length = array == null ? 0 : array.length;
  7897. if (!length) {
  7898. return [];
  7899. }
  7900. if (start && typeof start != 'number' && isIterateeCall(array, value, start)) {
  7901. start = 0;
  7902. end = length;
  7903. }
  7904. return baseFill(array, value, start, end);
  7905. }
  7906. /**
  7907. * This method is like `_.find` except that it returns the index of the first
  7908. * element `predicate` returns truthy for instead of the element itself.
  7909. *
  7910. * @static
  7911. * @memberOf _
  7912. * @since 1.1.0
  7913. * @category Array
  7914. * @param {Array} array The array to inspect.
  7915. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  7916. * @param {number} [fromIndex=0] The index to search from.
  7917. * @returns {number} Returns the index of the found element, else `-1`.
  7918. * @example
  7919. *
  7920. * var users = [
  7921. * { 'user': 'barney', 'active': false },
  7922. * { 'user': 'fred', 'active': false },
  7923. * { 'user': 'pebbles', 'active': true }
  7924. * ];
  7925. *
  7926. * _.findIndex(users, function(o) { return o.user == 'barney'; });
  7927. * // => 0
  7928. *
  7929. * // The `_.matches` iteratee shorthand.
  7930. * _.findIndex(users, { 'user': 'fred', 'active': false });
  7931. * // => 1
  7932. *
  7933. * // The `_.matchesProperty` iteratee shorthand.
  7934. * _.findIndex(users, ['active', false]);
  7935. * // => 0
  7936. *
  7937. * // The `_.property` iteratee shorthand.
  7938. * _.findIndex(users, 'active');
  7939. * // => 2
  7940. */
  7941. function findIndex(array, predicate, fromIndex) {
  7942. var length = array == null ? 0 : array.length;
  7943. if (!length) {
  7944. return -1;
  7945. }
  7946. var index = fromIndex == null ? 0 : toInteger(fromIndex);
  7947. if (index < 0) {
  7948. index = nativeMax(length + index, 0);
  7949. }
  7950. return baseFindIndex(array, getIteratee(predicate, 3), index);
  7951. }
  7952. /**
  7953. * This method is like `_.findIndex` except that it iterates over elements
  7954. * of `collection` from right to left.
  7955. *
  7956. * @static
  7957. * @memberOf _
  7958. * @since 2.0.0
  7959. * @category Array
  7960. * @param {Array} array The array to inspect.
  7961. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  7962. * @param {number} [fromIndex=array.length-1] The index to search from.
  7963. * @returns {number} Returns the index of the found element, else `-1`.
  7964. * @example
  7965. *
  7966. * var users = [
  7967. * { 'user': 'barney', 'active': true },
  7968. * { 'user': 'fred', 'active': false },
  7969. * { 'user': 'pebbles', 'active': false }
  7970. * ];
  7971. *
  7972. * _.findLastIndex(users, function(o) { return o.user == 'pebbles'; });
  7973. * // => 2
  7974. *
  7975. * // The `_.matches` iteratee shorthand.
  7976. * _.findLastIndex(users, { 'user': 'barney', 'active': true });
  7977. * // => 0
  7978. *
  7979. * // The `_.matchesProperty` iteratee shorthand.
  7980. * _.findLastIndex(users, ['active', false]);
  7981. * // => 2
  7982. *
  7983. * // The `_.property` iteratee shorthand.
  7984. * _.findLastIndex(users, 'active');
  7985. * // => 0
  7986. */
  7987. function findLastIndex(array, predicate, fromIndex) {
  7988. var length = array == null ? 0 : array.length;
  7989. if (!length) {
  7990. return -1;
  7991. }
  7992. var index = length - 1;
  7993. if (fromIndex !== undefined) {
  7994. index = toInteger(fromIndex);
  7995. index = fromIndex < 0
  7996. ? nativeMax(length + index, 0)
  7997. : nativeMin(index, length - 1);
  7998. }
  7999. return baseFindIndex(array, getIteratee(predicate, 3), index, true);
  8000. }
  8001. /**
  8002. * Flattens `array` a single level deep.
  8003. *
  8004. * @static
  8005. * @memberOf _
  8006. * @since 0.1.0
  8007. * @category Array
  8008. * @param {Array} array The array to flatten.
  8009. * @returns {Array} Returns the new flattened array.
  8010. * @example
  8011. *
  8012. * _.flatten([1, [2, [3, [4]], 5]]);
  8013. * // => [1, 2, [3, [4]], 5]
  8014. */
  8015. function flatten(array) {
  8016. var length = array == null ? 0 : array.length;
  8017. return length ? baseFlatten(array, 1) : [];
  8018. }
  8019. /**
  8020. * Recursively flattens `array`.
  8021. *
  8022. * @static
  8023. * @memberOf _
  8024. * @since 3.0.0
  8025. * @category Array
  8026. * @param {Array} array The array to flatten.
  8027. * @returns {Array} Returns the new flattened array.
  8028. * @example
  8029. *
  8030. * _.flattenDeep([1, [2, [3, [4]], 5]]);
  8031. * // => [1, 2, 3, 4, 5]
  8032. */
  8033. function flattenDeep(array) {
  8034. var length = array == null ? 0 : array.length;
  8035. return length ? baseFlatten(array, INFINITY) : [];
  8036. }
  8037. /**
  8038. * Recursively flatten `array` up to `depth` times.
  8039. *
  8040. * @static
  8041. * @memberOf _
  8042. * @since 4.4.0
  8043. * @category Array
  8044. * @param {Array} array The array to flatten.
  8045. * @param {number} [depth=1] The maximum recursion depth.
  8046. * @returns {Array} Returns the new flattened array.
  8047. * @example
  8048. *
  8049. * var array = [1, [2, [3, [4]], 5]];
  8050. *
  8051. * _.flattenDepth(array, 1);
  8052. * // => [1, 2, [3, [4]], 5]
  8053. *
  8054. * _.flattenDepth(array, 2);
  8055. * // => [1, 2, 3, [4], 5]
  8056. */
  8057. function flattenDepth(array, depth) {
  8058. var length = array == null ? 0 : array.length;
  8059. if (!length) {
  8060. return [];
  8061. }
  8062. depth = depth === undefined ? 1 : toInteger(depth);
  8063. return baseFlatten(array, depth);
  8064. }
  8065. /**
  8066. * The inverse of `_.toPairs`; this method returns an object composed
  8067. * from key-value `pairs`.
  8068. *
  8069. * @static
  8070. * @memberOf _
  8071. * @since 4.0.0
  8072. * @category Array
  8073. * @param {Array} pairs The key-value pairs.
  8074. * @returns {Object} Returns the new object.
  8075. * @example
  8076. *
  8077. * _.fromPairs([['a', 1], ['b', 2]]);
  8078. * // => { 'a': 1, 'b': 2 }
  8079. */
  8080. function fromPairs(pairs) {
  8081. var index = -1,
  8082. length = pairs == null ? 0 : pairs.length,
  8083. result = {};
  8084. while (++index < length) {
  8085. var pair = pairs[index];
  8086. result[pair[0]] = pair[1];
  8087. }
  8088. return result;
  8089. }
  8090. /**
  8091. * Gets the first element of `array`.
  8092. *
  8093. * @static
  8094. * @memberOf _
  8095. * @since 0.1.0
  8096. * @alias first
  8097. * @category Array
  8098. * @param {Array} array The array to query.
  8099. * @returns {*} Returns the first element of `array`.
  8100. * @example
  8101. *
  8102. * _.head([1, 2, 3]);
  8103. * // => 1
  8104. *
  8105. * _.head([]);
  8106. * // => undefined
  8107. */
  8108. function head(array) {
  8109. return (array && array.length) ? array[0] : undefined;
  8110. }
  8111. /**
  8112. * Gets the index at which the first occurrence of `value` is found in `array`
  8113. * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  8114. * for equality comparisons. If `fromIndex` is negative, it's used as the
  8115. * offset from the end of `array`.
  8116. *
  8117. * @static
  8118. * @memberOf _
  8119. * @since 0.1.0
  8120. * @category Array
  8121. * @param {Array} array The array to inspect.
  8122. * @param {*} value The value to search for.
  8123. * @param {number} [fromIndex=0] The index to search from.
  8124. * @returns {number} Returns the index of the matched value, else `-1`.
  8125. * @example
  8126. *
  8127. * _.indexOf([1, 2, 1, 2], 2);
  8128. * // => 1
  8129. *
  8130. * // Search from the `fromIndex`.
  8131. * _.indexOf([1, 2, 1, 2], 2, 2);
  8132. * // => 3
  8133. */
  8134. function indexOf(array, value, fromIndex) {
  8135. var length = array == null ? 0 : array.length;
  8136. if (!length) {
  8137. return -1;
  8138. }
  8139. var index = fromIndex == null ? 0 : toInteger(fromIndex);
  8140. if (index < 0) {
  8141. index = nativeMax(length + index, 0);
  8142. }
  8143. return baseIndexOf(array, value, index);
  8144. }
  8145. /**
  8146. * Gets all but the last element of `array`.
  8147. *
  8148. * @static
  8149. * @memberOf _
  8150. * @since 0.1.0
  8151. * @category Array
  8152. * @param {Array} array The array to query.
  8153. * @returns {Array} Returns the slice of `array`.
  8154. * @example
  8155. *
  8156. * _.initial([1, 2, 3]);
  8157. * // => [1, 2]
  8158. */
  8159. function initial(array) {
  8160. var length = array == null ? 0 : array.length;
  8161. return length ? baseSlice(array, 0, -1) : [];
  8162. }
  8163. /**
  8164. * Creates an array of unique values that are included in all given arrays
  8165. * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  8166. * for equality comparisons. The order and references of result values are
  8167. * determined by the first array.
  8168. *
  8169. * @static
  8170. * @memberOf _
  8171. * @since 0.1.0
  8172. * @category Array
  8173. * @param {...Array} [arrays] The arrays to inspect.
  8174. * @returns {Array} Returns the new array of intersecting values.
  8175. * @example
  8176. *
  8177. * _.intersection([2, 1], [2, 3]);
  8178. * // => [2]
  8179. */
  8180. var intersection = baseRest(function(arrays) {
  8181. var mapped = arrayMap(arrays, castArrayLikeObject);
  8182. return (mapped.length && mapped[0] === arrays[0])
  8183. ? baseIntersection(mapped)
  8184. : [];
  8185. });
  8186. /**
  8187. * This method is like `_.intersection` except that it accepts `iteratee`
  8188. * which is invoked for each element of each `arrays` to generate the criterion
  8189. * by which they're compared. The order and references of result values are
  8190. * determined by the first array. The iteratee is invoked with one argument:
  8191. * (value).
  8192. *
  8193. * @static
  8194. * @memberOf _
  8195. * @since 4.0.0
  8196. * @category Array
  8197. * @param {...Array} [arrays] The arrays to inspect.
  8198. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  8199. * @returns {Array} Returns the new array of intersecting values.
  8200. * @example
  8201. *
  8202. * _.intersectionBy([2.1, 1.2], [2.3, 3.4], Math.floor);
  8203. * // => [2.1]
  8204. *
  8205. * // The `_.property` iteratee shorthand.
  8206. * _.intersectionBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x');
  8207. * // => [{ 'x': 1 }]
  8208. */
  8209. var intersectionBy = baseRest(function(arrays) {
  8210. var iteratee = last(arrays),
  8211. mapped = arrayMap(arrays, castArrayLikeObject);
  8212. if (iteratee === last(mapped)) {
  8213. iteratee = undefined;
  8214. } else {
  8215. mapped.pop();
  8216. }
  8217. return (mapped.length && mapped[0] === arrays[0])
  8218. ? baseIntersection(mapped, getIteratee(iteratee, 2))
  8219. : [];
  8220. });
  8221. /**
  8222. * This method is like `_.intersection` except that it accepts `comparator`
  8223. * which is invoked to compare elements of `arrays`. The order and references
  8224. * of result values are determined by the first array. The comparator is
  8225. * invoked with two arguments: (arrVal, othVal).
  8226. *
  8227. * @static
  8228. * @memberOf _
  8229. * @since 4.0.0
  8230. * @category Array
  8231. * @param {...Array} [arrays] The arrays to inspect.
  8232. * @param {Function} [comparator] The comparator invoked per element.
  8233. * @returns {Array} Returns the new array of intersecting values.
  8234. * @example
  8235. *
  8236. * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }];
  8237. * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }];
  8238. *
  8239. * _.intersectionWith(objects, others, _.isEqual);
  8240. * // => [{ 'x': 1, 'y': 2 }]
  8241. */
  8242. var intersectionWith = baseRest(function(arrays) {
  8243. var comparator = last(arrays),
  8244. mapped = arrayMap(arrays, castArrayLikeObject);
  8245. comparator = typeof comparator == 'function' ? comparator : undefined;
  8246. if (comparator) {
  8247. mapped.pop();
  8248. }
  8249. return (mapped.length && mapped[0] === arrays[0])
  8250. ? baseIntersection(mapped, undefined, comparator)
  8251. : [];
  8252. });
  8253. /**
  8254. * Converts all elements in `array` into a string separated by `separator`.
  8255. *
  8256. * @static
  8257. * @memberOf _
  8258. * @since 4.0.0
  8259. * @category Array
  8260. * @param {Array} array The array to convert.
  8261. * @param {string} [separator=','] The element separator.
  8262. * @returns {string} Returns the joined string.
  8263. * @example
  8264. *
  8265. * _.join(['a', 'b', 'c'], '~');
  8266. * // => 'a~b~c'
  8267. */
  8268. function join(array, separator) {
  8269. return array == null ? '' : nativeJoin.call(array, separator);
  8270. }
  8271. /**
  8272. * Gets the last element of `array`.
  8273. *
  8274. * @static
  8275. * @memberOf _
  8276. * @since 0.1.0
  8277. * @category Array
  8278. * @param {Array} array The array to query.
  8279. * @returns {*} Returns the last element of `array`.
  8280. * @example
  8281. *
  8282. * _.last([1, 2, 3]);
  8283. * // => 3
  8284. */
  8285. function last(array) {
  8286. var length = array == null ? 0 : array.length;
  8287. return length ? array[length - 1] : undefined;
  8288. }
  8289. /**
  8290. * This method is like `_.indexOf` except that it iterates over elements of
  8291. * `array` from right to left.
  8292. *
  8293. * @static
  8294. * @memberOf _
  8295. * @since 0.1.0
  8296. * @category Array
  8297. * @param {Array} array The array to inspect.
  8298. * @param {*} value The value to search for.
  8299. * @param {number} [fromIndex=array.length-1] The index to search from.
  8300. * @returns {number} Returns the index of the matched value, else `-1`.
  8301. * @example
  8302. *
  8303. * _.lastIndexOf([1, 2, 1, 2], 2);
  8304. * // => 3
  8305. *
  8306. * // Search from the `fromIndex`.
  8307. * _.lastIndexOf([1, 2, 1, 2], 2, 2);
  8308. * // => 1
  8309. */
  8310. function lastIndexOf(array, value, fromIndex) {
  8311. var length = array == null ? 0 : array.length;
  8312. if (!length) {
  8313. return -1;
  8314. }
  8315. var index = length;
  8316. if (fromIndex !== undefined) {
  8317. index = toInteger(fromIndex);
  8318. index = index < 0 ? nativeMax(length + index, 0) : nativeMin(index, length - 1);
  8319. }
  8320. return value === value
  8321. ? strictLastIndexOf(array, value, index)
  8322. : baseFindIndex(array, baseIsNaN, index, true);
  8323. }
  8324. /**
  8325. * Gets the element at index `n` of `array`. If `n` is negative, the nth
  8326. * element from the end is returned.
  8327. *
  8328. * @static
  8329. * @memberOf _
  8330. * @since 4.11.0
  8331. * @category Array
  8332. * @param {Array} array The array to query.
  8333. * @param {number} [n=0] The index of the element to return.
  8334. * @returns {*} Returns the nth element of `array`.
  8335. * @example
  8336. *
  8337. * var array = ['a', 'b', 'c', 'd'];
  8338. *
  8339. * _.nth(array, 1);
  8340. * // => 'b'
  8341. *
  8342. * _.nth(array, -2);
  8343. * // => 'c';
  8344. */
  8345. function nth(array, n) {
  8346. return (array && array.length) ? baseNth(array, toInteger(n)) : undefined;
  8347. }
  8348. /**
  8349. * Removes all given values from `array` using
  8350. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  8351. * for equality comparisons.
  8352. *
  8353. * **Note:** Unlike `_.without`, this method mutates `array`. Use `_.remove`
  8354. * to remove elements from an array by predicate.
  8355. *
  8356. * @static
  8357. * @memberOf _
  8358. * @since 2.0.0
  8359. * @category Array
  8360. * @param {Array} array The array to modify.
  8361. * @param {...*} [values] The values to remove.
  8362. * @returns {Array} Returns `array`.
  8363. * @example
  8364. *
  8365. * var array = ['a', 'b', 'c', 'a', 'b', 'c'];
  8366. *
  8367. * _.pull(array, 'a', 'c');
  8368. * console.log(array);
  8369. * // => ['b', 'b']
  8370. */
  8371. var pull = baseRest(pullAll);
  8372. /**
  8373. * This method is like `_.pull` except that it accepts an array of values to remove.
  8374. *
  8375. * **Note:** Unlike `_.difference`, this method mutates `array`.
  8376. *
  8377. * @static
  8378. * @memberOf _
  8379. * @since 4.0.0
  8380. * @category Array
  8381. * @param {Array} array The array to modify.
  8382. * @param {Array} values The values to remove.
  8383. * @returns {Array} Returns `array`.
  8384. * @example
  8385. *
  8386. * var array = ['a', 'b', 'c', 'a', 'b', 'c'];
  8387. *
  8388. * _.pullAll(array, ['a', 'c']);
  8389. * console.log(array);
  8390. * // => ['b', 'b']
  8391. */
  8392. function pullAll(array, values) {
  8393. return (array && array.length && values && values.length)
  8394. ? basePullAll(array, values)
  8395. : array;
  8396. }
  8397. /**
  8398. * This method is like `_.pullAll` except that it accepts `iteratee` which is
  8399. * invoked for each element of `array` and `values` to generate the criterion
  8400. * by which they're compared. The iteratee is invoked with one argument: (value).
  8401. *
  8402. * **Note:** Unlike `_.differenceBy`, this method mutates `array`.
  8403. *
  8404. * @static
  8405. * @memberOf _
  8406. * @since 4.0.0
  8407. * @category Array
  8408. * @param {Array} array The array to modify.
  8409. * @param {Array} values The values to remove.
  8410. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  8411. * @returns {Array} Returns `array`.
  8412. * @example
  8413. *
  8414. * var array = [{ 'x': 1 }, { 'x': 2 }, { 'x': 3 }, { 'x': 1 }];
  8415. *
  8416. * _.pullAllBy(array, [{ 'x': 1 }, { 'x': 3 }], 'x');
  8417. * console.log(array);
  8418. * // => [{ 'x': 2 }]
  8419. */
  8420. function pullAllBy(array, values, iteratee) {
  8421. return (array && array.length && values && values.length)
  8422. ? basePullAll(array, values, getIteratee(iteratee, 2))
  8423. : array;
  8424. }
  8425. /**
  8426. * This method is like `_.pullAll` except that it accepts `comparator` which
  8427. * is invoked to compare elements of `array` to `values`. The comparator is
  8428. * invoked with two arguments: (arrVal, othVal).
  8429. *
  8430. * **Note:** Unlike `_.differenceWith`, this method mutates `array`.
  8431. *
  8432. * @static
  8433. * @memberOf _
  8434. * @since 4.6.0
  8435. * @category Array
  8436. * @param {Array} array The array to modify.
  8437. * @param {Array} values The values to remove.
  8438. * @param {Function} [comparator] The comparator invoked per element.
  8439. * @returns {Array} Returns `array`.
  8440. * @example
  8441. *
  8442. * var array = [{ 'x': 1, 'y': 2 }, { 'x': 3, 'y': 4 }, { 'x': 5, 'y': 6 }];
  8443. *
  8444. * _.pullAllWith(array, [{ 'x': 3, 'y': 4 }], _.isEqual);
  8445. * console.log(array);
  8446. * // => [{ 'x': 1, 'y': 2 }, { 'x': 5, 'y': 6 }]
  8447. */
  8448. function pullAllWith(array, values, comparator) {
  8449. return (array && array.length && values && values.length)
  8450. ? basePullAll(array, values, undefined, comparator)
  8451. : array;
  8452. }
  8453. /**
  8454. * Removes elements from `array` corresponding to `indexes` and returns an
  8455. * array of removed elements.
  8456. *
  8457. * **Note:** Unlike `_.at`, this method mutates `array`.
  8458. *
  8459. * @static
  8460. * @memberOf _
  8461. * @since 3.0.0
  8462. * @category Array
  8463. * @param {Array} array The array to modify.
  8464. * @param {...(number|number[])} [indexes] The indexes of elements to remove.
  8465. * @returns {Array} Returns the new array of removed elements.
  8466. * @example
  8467. *
  8468. * var array = ['a', 'b', 'c', 'd'];
  8469. * var pulled = _.pullAt(array, [1, 3]);
  8470. *
  8471. * console.log(array);
  8472. * // => ['a', 'c']
  8473. *
  8474. * console.log(pulled);
  8475. * // => ['b', 'd']
  8476. */
  8477. var pullAt = flatRest(function(array, indexes) {
  8478. var length = array == null ? 0 : array.length,
  8479. result = baseAt(array, indexes);
  8480. basePullAt(array, arrayMap(indexes, function(index) {
  8481. return isIndex(index, length) ? +index : index;
  8482. }).sort(compareAscending));
  8483. return result;
  8484. });
  8485. /**
  8486. * Removes all elements from `array` that `predicate` returns truthy for
  8487. * and returns an array of the removed elements. The predicate is invoked
  8488. * with three arguments: (value, index, array).
  8489. *
  8490. * **Note:** Unlike `_.filter`, this method mutates `array`. Use `_.pull`
  8491. * to pull elements from an array by value.
  8492. *
  8493. * @static
  8494. * @memberOf _
  8495. * @since 2.0.0
  8496. * @category Array
  8497. * @param {Array} array The array to modify.
  8498. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  8499. * @returns {Array} Returns the new array of removed elements.
  8500. * @example
  8501. *
  8502. * var array = [1, 2, 3, 4];
  8503. * var evens = _.remove(array, function(n) {
  8504. * return n % 2 == 0;
  8505. * });
  8506. *
  8507. * console.log(array);
  8508. * // => [1, 3]
  8509. *
  8510. * console.log(evens);
  8511. * // => [2, 4]
  8512. */
  8513. function remove(array, predicate) {
  8514. var result = [];
  8515. if (!(array && array.length)) {
  8516. return result;
  8517. }
  8518. var index = -1,
  8519. indexes = [],
  8520. length = array.length;
  8521. predicate = getIteratee(predicate, 3);
  8522. while (++index < length) {
  8523. var value = array[index];
  8524. if (predicate(value, index, array)) {
  8525. result.push(value);
  8526. indexes.push(index);
  8527. }
  8528. }
  8529. basePullAt(array, indexes);
  8530. return result;
  8531. }
  8532. /**
  8533. * Reverses `array` so that the first element becomes the last, the second
  8534. * element becomes the second to last, and so on.
  8535. *
  8536. * **Note:** This method mutates `array` and is based on
  8537. * [`Array#reverse`](https://mdn.io/Array/reverse).
  8538. *
  8539. * @static
  8540. * @memberOf _
  8541. * @since 4.0.0
  8542. * @category Array
  8543. * @param {Array} array The array to modify.
  8544. * @returns {Array} Returns `array`.
  8545. * @example
  8546. *
  8547. * var array = [1, 2, 3];
  8548. *
  8549. * _.reverse(array);
  8550. * // => [3, 2, 1]
  8551. *
  8552. * console.log(array);
  8553. * // => [3, 2, 1]
  8554. */
  8555. function reverse(array) {
  8556. return array == null ? array : nativeReverse.call(array);
  8557. }
  8558. /**
  8559. * Creates a slice of `array` from `start` up to, but not including, `end`.
  8560. *
  8561. * **Note:** This method is used instead of
  8562. * [`Array#slice`](https://mdn.io/Array/slice) to ensure dense arrays are
  8563. * returned.
  8564. *
  8565. * @static
  8566. * @memberOf _
  8567. * @since 3.0.0
  8568. * @category Array
  8569. * @param {Array} array The array to slice.
  8570. * @param {number} [start=0] The start position.
  8571. * @param {number} [end=array.length] The end position.
  8572. * @returns {Array} Returns the slice of `array`.
  8573. */
  8574. function slice(array, start, end) {
  8575. var length = array == null ? 0 : array.length;
  8576. if (!length) {
  8577. return [];
  8578. }
  8579. if (end && typeof end != 'number' && isIterateeCall(array, start, end)) {
  8580. start = 0;
  8581. end = length;
  8582. }
  8583. else {
  8584. start = start == null ? 0 : toInteger(start);
  8585. end = end === undefined ? length : toInteger(end);
  8586. }
  8587. return baseSlice(array, start, end);
  8588. }
  8589. /**
  8590. * Uses a binary search to determine the lowest index at which `value`
  8591. * should be inserted into `array` in order to maintain its sort order.
  8592. *
  8593. * @static
  8594. * @memberOf _
  8595. * @since 0.1.0
  8596. * @category Array
  8597. * @param {Array} array The sorted array to inspect.
  8598. * @param {*} value The value to evaluate.
  8599. * @returns {number} Returns the index at which `value` should be inserted
  8600. * into `array`.
  8601. * @example
  8602. *
  8603. * _.sortedIndex([30, 50], 40);
  8604. * // => 1
  8605. */
  8606. function sortedIndex(array, value) {
  8607. return baseSortedIndex(array, value);
  8608. }
  8609. /**
  8610. * This method is like `_.sortedIndex` except that it accepts `iteratee`
  8611. * which is invoked for `value` and each element of `array` to compute their
  8612. * sort ranking. The iteratee is invoked with one argument: (value).
  8613. *
  8614. * @static
  8615. * @memberOf _
  8616. * @since 4.0.0
  8617. * @category Array
  8618. * @param {Array} array The sorted array to inspect.
  8619. * @param {*} value The value to evaluate.
  8620. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  8621. * @returns {number} Returns the index at which `value` should be inserted
  8622. * into `array`.
  8623. * @example
  8624. *
  8625. * var objects = [{ 'x': 4 }, { 'x': 5 }];
  8626. *
  8627. * _.sortedIndexBy(objects, { 'x': 4 }, function(o) { return o.x; });
  8628. * // => 0
  8629. *
  8630. * // The `_.property` iteratee shorthand.
  8631. * _.sortedIndexBy(objects, { 'x': 4 }, 'x');
  8632. * // => 0
  8633. */
  8634. function sortedIndexBy(array, value, iteratee) {
  8635. return baseSortedIndexBy(array, value, getIteratee(iteratee, 2));
  8636. }
  8637. /**
  8638. * This method is like `_.indexOf` except that it performs a binary
  8639. * search on a sorted `array`.
  8640. *
  8641. * @static
  8642. * @memberOf _
  8643. * @since 4.0.0
  8644. * @category Array
  8645. * @param {Array} array The array to inspect.
  8646. * @param {*} value The value to search for.
  8647. * @returns {number} Returns the index of the matched value, else `-1`.
  8648. * @example
  8649. *
  8650. * _.sortedIndexOf([4, 5, 5, 5, 6], 5);
  8651. * // => 1
  8652. */
  8653. function sortedIndexOf(array, value) {
  8654. var length = array == null ? 0 : array.length;
  8655. if (length) {
  8656. var index = baseSortedIndex(array, value);
  8657. if (index < length && eq(array[index], value)) {
  8658. return index;
  8659. }
  8660. }
  8661. return -1;
  8662. }
  8663. /**
  8664. * This method is like `_.sortedIndex` except that it returns the highest
  8665. * index at which `value` should be inserted into `array` in order to
  8666. * maintain its sort order.
  8667. *
  8668. * @static
  8669. * @memberOf _
  8670. * @since 3.0.0
  8671. * @category Array
  8672. * @param {Array} array The sorted array to inspect.
  8673. * @param {*} value The value to evaluate.
  8674. * @returns {number} Returns the index at which `value` should be inserted
  8675. * into `array`.
  8676. * @example
  8677. *
  8678. * _.sortedLastIndex([4, 5, 5, 5, 6], 5);
  8679. * // => 4
  8680. */
  8681. function sortedLastIndex(array, value) {
  8682. return baseSortedIndex(array, value, true);
  8683. }
  8684. /**
  8685. * This method is like `_.sortedLastIndex` except that it accepts `iteratee`
  8686. * which is invoked for `value` and each element of `array` to compute their
  8687. * sort ranking. The iteratee is invoked with one argument: (value).
  8688. *
  8689. * @static
  8690. * @memberOf _
  8691. * @since 4.0.0
  8692. * @category Array
  8693. * @param {Array} array The sorted array to inspect.
  8694. * @param {*} value The value to evaluate.
  8695. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  8696. * @returns {number} Returns the index at which `value` should be inserted
  8697. * into `array`.
  8698. * @example
  8699. *
  8700. * var objects = [{ 'x': 4 }, { 'x': 5 }];
  8701. *
  8702. * _.sortedLastIndexBy(objects, { 'x': 4 }, function(o) { return o.x; });
  8703. * // => 1
  8704. *
  8705. * // The `_.property` iteratee shorthand.
  8706. * _.sortedLastIndexBy(objects, { 'x': 4 }, 'x');
  8707. * // => 1
  8708. */
  8709. function sortedLastIndexBy(array, value, iteratee) {
  8710. return baseSortedIndexBy(array, value, getIteratee(iteratee, 2), true);
  8711. }
  8712. /**
  8713. * This method is like `_.lastIndexOf` except that it performs a binary
  8714. * search on a sorted `array`.
  8715. *
  8716. * @static
  8717. * @memberOf _
  8718. * @since 4.0.0
  8719. * @category Array
  8720. * @param {Array} array The array to inspect.
  8721. * @param {*} value The value to search for.
  8722. * @returns {number} Returns the index of the matched value, else `-1`.
  8723. * @example
  8724. *
  8725. * _.sortedLastIndexOf([4, 5, 5, 5, 6], 5);
  8726. * // => 3
  8727. */
  8728. function sortedLastIndexOf(array, value) {
  8729. var length = array == null ? 0 : array.length;
  8730. if (length) {
  8731. var index = baseSortedIndex(array, value, true) - 1;
  8732. if (eq(array[index], value)) {
  8733. return index;
  8734. }
  8735. }
  8736. return -1;
  8737. }
  8738. /**
  8739. * This method is like `_.uniq` except that it's designed and optimized
  8740. * for sorted arrays.
  8741. *
  8742. * @static
  8743. * @memberOf _
  8744. * @since 4.0.0
  8745. * @category Array
  8746. * @param {Array} array The array to inspect.
  8747. * @returns {Array} Returns the new duplicate free array.
  8748. * @example
  8749. *
  8750. * _.sortedUniq([1, 1, 2]);
  8751. * // => [1, 2]
  8752. */
  8753. function sortedUniq(array) {
  8754. return (array && array.length)
  8755. ? baseSortedUniq(array)
  8756. : [];
  8757. }
  8758. /**
  8759. * This method is like `_.uniqBy` except that it's designed and optimized
  8760. * for sorted arrays.
  8761. *
  8762. * @static
  8763. * @memberOf _
  8764. * @since 4.0.0
  8765. * @category Array
  8766. * @param {Array} array The array to inspect.
  8767. * @param {Function} [iteratee] The iteratee invoked per element.
  8768. * @returns {Array} Returns the new duplicate free array.
  8769. * @example
  8770. *
  8771. * _.sortedUniqBy([1.1, 1.2, 2.3, 2.4], Math.floor);
  8772. * // => [1.1, 2.3]
  8773. */
  8774. function sortedUniqBy(array, iteratee) {
  8775. return (array && array.length)
  8776. ? baseSortedUniq(array, getIteratee(iteratee, 2))
  8777. : [];
  8778. }
  8779. /**
  8780. * Gets all but the first element of `array`.
  8781. *
  8782. * @static
  8783. * @memberOf _
  8784. * @since 4.0.0
  8785. * @category Array
  8786. * @param {Array} array The array to query.
  8787. * @returns {Array} Returns the slice of `array`.
  8788. * @example
  8789. *
  8790. * _.tail([1, 2, 3]);
  8791. * // => [2, 3]
  8792. */
  8793. function tail(array) {
  8794. var length = array == null ? 0 : array.length;
  8795. return length ? baseSlice(array, 1, length) : [];
  8796. }
  8797. /**
  8798. * Creates a slice of `array` with `n` elements taken from the beginning.
  8799. *
  8800. * @static
  8801. * @memberOf _
  8802. * @since 0.1.0
  8803. * @category Array
  8804. * @param {Array} array The array to query.
  8805. * @param {number} [n=1] The number of elements to take.
  8806. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  8807. * @returns {Array} Returns the slice of `array`.
  8808. * @example
  8809. *
  8810. * _.take([1, 2, 3]);
  8811. * // => [1]
  8812. *
  8813. * _.take([1, 2, 3], 2);
  8814. * // => [1, 2]
  8815. *
  8816. * _.take([1, 2, 3], 5);
  8817. * // => [1, 2, 3]
  8818. *
  8819. * _.take([1, 2, 3], 0);
  8820. * // => []
  8821. */
  8822. function take(array, n, guard) {
  8823. if (!(array && array.length)) {
  8824. return [];
  8825. }
  8826. n = (guard || n === undefined) ? 1 : toInteger(n);
  8827. return baseSlice(array, 0, n < 0 ? 0 : n);
  8828. }
  8829. /**
  8830. * Creates a slice of `array` with `n` elements taken from the end.
  8831. *
  8832. * @static
  8833. * @memberOf _
  8834. * @since 3.0.0
  8835. * @category Array
  8836. * @param {Array} array The array to query.
  8837. * @param {number} [n=1] The number of elements to take.
  8838. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  8839. * @returns {Array} Returns the slice of `array`.
  8840. * @example
  8841. *
  8842. * _.takeRight([1, 2, 3]);
  8843. * // => [3]
  8844. *
  8845. * _.takeRight([1, 2, 3], 2);
  8846. * // => [2, 3]
  8847. *
  8848. * _.takeRight([1, 2, 3], 5);
  8849. * // => [1, 2, 3]
  8850. *
  8851. * _.takeRight([1, 2, 3], 0);
  8852. * // => []
  8853. */
  8854. function takeRight(array, n, guard) {
  8855. var length = array == null ? 0 : array.length;
  8856. if (!length) {
  8857. return [];
  8858. }
  8859. n = (guard || n === undefined) ? 1 : toInteger(n);
  8860. n = length - n;
  8861. return baseSlice(array, n < 0 ? 0 : n, length);
  8862. }
  8863. /**
  8864. * Creates a slice of `array` with elements taken from the end. Elements are
  8865. * taken until `predicate` returns falsey. The predicate is invoked with
  8866. * three arguments: (value, index, array).
  8867. *
  8868. * @static
  8869. * @memberOf _
  8870. * @since 3.0.0
  8871. * @category Array
  8872. * @param {Array} array The array to query.
  8873. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  8874. * @returns {Array} Returns the slice of `array`.
  8875. * @example
  8876. *
  8877. * var users = [
  8878. * { 'user': 'barney', 'active': true },
  8879. * { 'user': 'fred', 'active': false },
  8880. * { 'user': 'pebbles', 'active': false }
  8881. * ];
  8882. *
  8883. * _.takeRightWhile(users, function(o) { return !o.active; });
  8884. * // => objects for ['fred', 'pebbles']
  8885. *
  8886. * // The `_.matches` iteratee shorthand.
  8887. * _.takeRightWhile(users, { 'user': 'pebbles', 'active': false });
  8888. * // => objects for ['pebbles']
  8889. *
  8890. * // The `_.matchesProperty` iteratee shorthand.
  8891. * _.takeRightWhile(users, ['active', false]);
  8892. * // => objects for ['fred', 'pebbles']
  8893. *
  8894. * // The `_.property` iteratee shorthand.
  8895. * _.takeRightWhile(users, 'active');
  8896. * // => []
  8897. */
  8898. function takeRightWhile(array, predicate) {
  8899. return (array && array.length)
  8900. ? baseWhile(array, getIteratee(predicate, 3), false, true)
  8901. : [];
  8902. }
  8903. /**
  8904. * Creates a slice of `array` with elements taken from the beginning. Elements
  8905. * are taken until `predicate` returns falsey. The predicate is invoked with
  8906. * three arguments: (value, index, array).
  8907. *
  8908. * @static
  8909. * @memberOf _
  8910. * @since 3.0.0
  8911. * @category Array
  8912. * @param {Array} array The array to query.
  8913. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  8914. * @returns {Array} Returns the slice of `array`.
  8915. * @example
  8916. *
  8917. * var users = [
  8918. * { 'user': 'barney', 'active': false },
  8919. * { 'user': 'fred', 'active': false },
  8920. * { 'user': 'pebbles', 'active': true }
  8921. * ];
  8922. *
  8923. * _.takeWhile(users, function(o) { return !o.active; });
  8924. * // => objects for ['barney', 'fred']
  8925. *
  8926. * // The `_.matches` iteratee shorthand.
  8927. * _.takeWhile(users, { 'user': 'barney', 'active': false });
  8928. * // => objects for ['barney']
  8929. *
  8930. * // The `_.matchesProperty` iteratee shorthand.
  8931. * _.takeWhile(users, ['active', false]);
  8932. * // => objects for ['barney', 'fred']
  8933. *
  8934. * // The `_.property` iteratee shorthand.
  8935. * _.takeWhile(users, 'active');
  8936. * // => []
  8937. */
  8938. function takeWhile(array, predicate) {
  8939. return (array && array.length)
  8940. ? baseWhile(array, getIteratee(predicate, 3))
  8941. : [];
  8942. }
  8943. /**
  8944. * Creates an array of unique values, in order, from all given arrays using
  8945. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  8946. * for equality comparisons.
  8947. *
  8948. * @static
  8949. * @memberOf _
  8950. * @since 0.1.0
  8951. * @category Array
  8952. * @param {...Array} [arrays] The arrays to inspect.
  8953. * @returns {Array} Returns the new array of combined values.
  8954. * @example
  8955. *
  8956. * _.union([2], [1, 2]);
  8957. * // => [2, 1]
  8958. */
  8959. var union = baseRest(function(arrays) {
  8960. return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true));
  8961. });
  8962. /**
  8963. * This method is like `_.union` except that it accepts `iteratee` which is
  8964. * invoked for each element of each `arrays` to generate the criterion by
  8965. * which uniqueness is computed. Result values are chosen from the first
  8966. * array in which the value occurs. The iteratee is invoked with one argument:
  8967. * (value).
  8968. *
  8969. * @static
  8970. * @memberOf _
  8971. * @since 4.0.0
  8972. * @category Array
  8973. * @param {...Array} [arrays] The arrays to inspect.
  8974. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  8975. * @returns {Array} Returns the new array of combined values.
  8976. * @example
  8977. *
  8978. * _.unionBy([2.1], [1.2, 2.3], Math.floor);
  8979. * // => [2.1, 1.2]
  8980. *
  8981. * // The `_.property` iteratee shorthand.
  8982. * _.unionBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x');
  8983. * // => [{ 'x': 1 }, { 'x': 2 }]
  8984. */
  8985. var unionBy = baseRest(function(arrays) {
  8986. var iteratee = last(arrays);
  8987. if (isArrayLikeObject(iteratee)) {
  8988. iteratee = undefined;
  8989. }
  8990. return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true), getIteratee(iteratee, 2));
  8991. });
  8992. /**
  8993. * This method is like `_.union` except that it accepts `comparator` which
  8994. * is invoked to compare elements of `arrays`. Result values are chosen from
  8995. * the first array in which the value occurs. The comparator is invoked
  8996. * with two arguments: (arrVal, othVal).
  8997. *
  8998. * @static
  8999. * @memberOf _
  9000. * @since 4.0.0
  9001. * @category Array
  9002. * @param {...Array} [arrays] The arrays to inspect.
  9003. * @param {Function} [comparator] The comparator invoked per element.
  9004. * @returns {Array} Returns the new array of combined values.
  9005. * @example
  9006. *
  9007. * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }];
  9008. * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }];
  9009. *
  9010. * _.unionWith(objects, others, _.isEqual);
  9011. * // => [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }, { 'x': 1, 'y': 1 }]
  9012. */
  9013. var unionWith = baseRest(function(arrays) {
  9014. var comparator = last(arrays);
  9015. comparator = typeof comparator == 'function' ? comparator : undefined;
  9016. return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true), undefined, comparator);
  9017. });
  9018. /**
  9019. * Creates a duplicate-free version of an array, using
  9020. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  9021. * for equality comparisons, in which only the first occurrence of each element
  9022. * is kept. The order of result values is determined by the order they occur
  9023. * in the array.
  9024. *
  9025. * @static
  9026. * @memberOf _
  9027. * @since 0.1.0
  9028. * @category Array
  9029. * @param {Array} array The array to inspect.
  9030. * @returns {Array} Returns the new duplicate free array.
  9031. * @example
  9032. *
  9033. * _.uniq([2, 1, 2]);
  9034. * // => [2, 1]
  9035. */
  9036. function uniq(array) {
  9037. return (array && array.length) ? baseUniq(array) : [];
  9038. }
  9039. /**
  9040. * This method is like `_.uniq` except that it accepts `iteratee` which is
  9041. * invoked for each element in `array` to generate the criterion by which
  9042. * uniqueness is computed. The order of result values is determined by the
  9043. * order they occur in the array. The iteratee is invoked with one argument:
  9044. * (value).
  9045. *
  9046. * @static
  9047. * @memberOf _
  9048. * @since 4.0.0
  9049. * @category Array
  9050. * @param {Array} array The array to inspect.
  9051. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  9052. * @returns {Array} Returns the new duplicate free array.
  9053. * @example
  9054. *
  9055. * _.uniqBy([2.1, 1.2, 2.3], Math.floor);
  9056. * // => [2.1, 1.2]
  9057. *
  9058. * // The `_.property` iteratee shorthand.
  9059. * _.uniqBy([{ 'x': 1 }, { 'x': 2 }, { 'x': 1 }], 'x');
  9060. * // => [{ 'x': 1 }, { 'x': 2 }]
  9061. */
  9062. function uniqBy(array, iteratee) {
  9063. return (array && array.length) ? baseUniq(array, getIteratee(iteratee, 2)) : [];
  9064. }
  9065. /**
  9066. * This method is like `_.uniq` except that it accepts `comparator` which
  9067. * is invoked to compare elements of `array`. The order of result values is
  9068. * determined by the order they occur in the array.The comparator is invoked
  9069. * with two arguments: (arrVal, othVal).
  9070. *
  9071. * @static
  9072. * @memberOf _
  9073. * @since 4.0.0
  9074. * @category Array
  9075. * @param {Array} array The array to inspect.
  9076. * @param {Function} [comparator] The comparator invoked per element.
  9077. * @returns {Array} Returns the new duplicate free array.
  9078. * @example
  9079. *
  9080. * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }, { 'x': 1, 'y': 2 }];
  9081. *
  9082. * _.uniqWith(objects, _.isEqual);
  9083. * // => [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }]
  9084. */
  9085. function uniqWith(array, comparator) {
  9086. comparator = typeof comparator == 'function' ? comparator : undefined;
  9087. return (array && array.length) ? baseUniq(array, undefined, comparator) : [];
  9088. }
  9089. /**
  9090. * This method is like `_.zip` except that it accepts an array of grouped
  9091. * elements and creates an array regrouping the elements to their pre-zip
  9092. * configuration.
  9093. *
  9094. * @static
  9095. * @memberOf _
  9096. * @since 1.2.0
  9097. * @category Array
  9098. * @param {Array} array The array of grouped elements to process.
  9099. * @returns {Array} Returns the new array of regrouped elements.
  9100. * @example
  9101. *
  9102. * var zipped = _.zip(['a', 'b'], [1, 2], [true, false]);
  9103. * // => [['a', 1, true], ['b', 2, false]]
  9104. *
  9105. * _.unzip(zipped);
  9106. * // => [['a', 'b'], [1, 2], [true, false]]
  9107. */
  9108. function unzip(array) {
  9109. if (!(array && array.length)) {
  9110. return [];
  9111. }
  9112. var length = 0;
  9113. array = arrayFilter(array, function(group) {
  9114. if (isArrayLikeObject(group)) {
  9115. length = nativeMax(group.length, length);
  9116. return true;
  9117. }
  9118. });
  9119. return baseTimes(length, function(index) {
  9120. return arrayMap(array, baseProperty(index));
  9121. });
  9122. }
  9123. /**
  9124. * This method is like `_.unzip` except that it accepts `iteratee` to specify
  9125. * how regrouped values should be combined. The iteratee is invoked with the
  9126. * elements of each group: (...group).
  9127. *
  9128. * @static
  9129. * @memberOf _
  9130. * @since 3.8.0
  9131. * @category Array
  9132. * @param {Array} array The array of grouped elements to process.
  9133. * @param {Function} [iteratee=_.identity] The function to combine
  9134. * regrouped values.
  9135. * @returns {Array} Returns the new array of regrouped elements.
  9136. * @example
  9137. *
  9138. * var zipped = _.zip([1, 2], [10, 20], [100, 200]);
  9139. * // => [[1, 10, 100], [2, 20, 200]]
  9140. *
  9141. * _.unzipWith(zipped, _.add);
  9142. * // => [3, 30, 300]
  9143. */
  9144. function unzipWith(array, iteratee) {
  9145. if (!(array && array.length)) {
  9146. return [];
  9147. }
  9148. var result = unzip(array);
  9149. if (iteratee == null) {
  9150. return result;
  9151. }
  9152. return arrayMap(result, function(group) {
  9153. return apply(iteratee, undefined, group);
  9154. });
  9155. }
  9156. /**
  9157. * Creates an array excluding all given values using
  9158. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  9159. * for equality comparisons.
  9160. *
  9161. * **Note:** Unlike `_.pull`, this method returns a new array.
  9162. *
  9163. * @static
  9164. * @memberOf _
  9165. * @since 0.1.0
  9166. * @category Array
  9167. * @param {Array} array The array to inspect.
  9168. * @param {...*} [values] The values to exclude.
  9169. * @returns {Array} Returns the new array of filtered values.
  9170. * @see _.difference, _.xor
  9171. * @example
  9172. *
  9173. * _.without([2, 1, 2, 3], 1, 2);
  9174. * // => [3]
  9175. */
  9176. var without = baseRest(function(array, values) {
  9177. return isArrayLikeObject(array)
  9178. ? baseDifference(array, values)
  9179. : [];
  9180. });
  9181. /**
  9182. * Creates an array of unique values that is the
  9183. * [symmetric difference](https://en.wikipedia.org/wiki/Symmetric_difference)
  9184. * of the given arrays. The order of result values is determined by the order
  9185. * they occur in the arrays.
  9186. *
  9187. * @static
  9188. * @memberOf _
  9189. * @since 2.4.0
  9190. * @category Array
  9191. * @param {...Array} [arrays] The arrays to inspect.
  9192. * @returns {Array} Returns the new array of filtered values.
  9193. * @see _.difference, _.without
  9194. * @example
  9195. *
  9196. * _.xor([2, 1], [2, 3]);
  9197. * // => [1, 3]
  9198. */
  9199. var xor = baseRest(function(arrays) {
  9200. return baseXor(arrayFilter(arrays, isArrayLikeObject));
  9201. });
  9202. /**
  9203. * This method is like `_.xor` except that it accepts `iteratee` which is
  9204. * invoked for each element of each `arrays` to generate the criterion by
  9205. * which by which they're compared. The order of result values is determined
  9206. * by the order they occur in the arrays. The iteratee is invoked with one
  9207. * argument: (value).
  9208. *
  9209. * @static
  9210. * @memberOf _
  9211. * @since 4.0.0
  9212. * @category Array
  9213. * @param {...Array} [arrays] The arrays to inspect.
  9214. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  9215. * @returns {Array} Returns the new array of filtered values.
  9216. * @example
  9217. *
  9218. * _.xorBy([2.1, 1.2], [2.3, 3.4], Math.floor);
  9219. * // => [1.2, 3.4]
  9220. *
  9221. * // The `_.property` iteratee shorthand.
  9222. * _.xorBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x');
  9223. * // => [{ 'x': 2 }]
  9224. */
  9225. var xorBy = baseRest(function(arrays) {
  9226. var iteratee = last(arrays);
  9227. if (isArrayLikeObject(iteratee)) {
  9228. iteratee = undefined;
  9229. }
  9230. return baseXor(arrayFilter(arrays, isArrayLikeObject), getIteratee(iteratee, 2));
  9231. });
  9232. /**
  9233. * This method is like `_.xor` except that it accepts `comparator` which is
  9234. * invoked to compare elements of `arrays`. The order of result values is
  9235. * determined by the order they occur in the arrays. The comparator is invoked
  9236. * with two arguments: (arrVal, othVal).
  9237. *
  9238. * @static
  9239. * @memberOf _
  9240. * @since 4.0.0
  9241. * @category Array
  9242. * @param {...Array} [arrays] The arrays to inspect.
  9243. * @param {Function} [comparator] The comparator invoked per element.
  9244. * @returns {Array} Returns the new array of filtered values.
  9245. * @example
  9246. *
  9247. * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }];
  9248. * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }];
  9249. *
  9250. * _.xorWith(objects, others, _.isEqual);
  9251. * // => [{ 'x': 2, 'y': 1 }, { 'x': 1, 'y': 1 }]
  9252. */
  9253. var xorWith = baseRest(function(arrays) {
  9254. var comparator = last(arrays);
  9255. comparator = typeof comparator == 'function' ? comparator : undefined;
  9256. return baseXor(arrayFilter(arrays, isArrayLikeObject), undefined, comparator);
  9257. });
  9258. /**
  9259. * Creates an array of grouped elements, the first of which contains the
  9260. * first elements of the given arrays, the second of which contains the
  9261. * second elements of the given arrays, and so on.
  9262. *
  9263. * @static
  9264. * @memberOf _
  9265. * @since 0.1.0
  9266. * @category Array
  9267. * @param {...Array} [arrays] The arrays to process.
  9268. * @returns {Array} Returns the new array of grouped elements.
  9269. * @example
  9270. *
  9271. * _.zip(['a', 'b'], [1, 2], [true, false]);
  9272. * // => [['a', 1, true], ['b', 2, false]]
  9273. */
  9274. var zip = baseRest(unzip);
  9275. /**
  9276. * This method is like `_.fromPairs` except that it accepts two arrays,
  9277. * one of property identifiers and one of corresponding values.
  9278. *
  9279. * @static
  9280. * @memberOf _
  9281. * @since 0.4.0
  9282. * @category Array
  9283. * @param {Array} [props=[]] The property identifiers.
  9284. * @param {Array} [values=[]] The property values.
  9285. * @returns {Object} Returns the new object.
  9286. * @example
  9287. *
  9288. * _.zipObject(['a', 'b'], [1, 2]);
  9289. * // => { 'a': 1, 'b': 2 }
  9290. */
  9291. function zipObject(props, values) {
  9292. return baseZipObject(props || [], values || [], assignValue);
  9293. }
  9294. /**
  9295. * This method is like `_.zipObject` except that it supports property paths.
  9296. *
  9297. * @static
  9298. * @memberOf _
  9299. * @since 4.1.0
  9300. * @category Array
  9301. * @param {Array} [props=[]] The property identifiers.
  9302. * @param {Array} [values=[]] The property values.
  9303. * @returns {Object} Returns the new object.
  9304. * @example
  9305. *
  9306. * _.zipObjectDeep(['a.b[0].c', 'a.b[1].d'], [1, 2]);
  9307. * // => { 'a': { 'b': [{ 'c': 1 }, { 'd': 2 }] } }
  9308. */
  9309. function zipObjectDeep(props, values) {
  9310. return baseZipObject(props || [], values || [], baseSet);
  9311. }
  9312. /**
  9313. * This method is like `_.zip` except that it accepts `iteratee` to specify
  9314. * how grouped values should be combined. The iteratee is invoked with the
  9315. * elements of each group: (...group).
  9316. *
  9317. * @static
  9318. * @memberOf _
  9319. * @since 3.8.0
  9320. * @category Array
  9321. * @param {...Array} [arrays] The arrays to process.
  9322. * @param {Function} [iteratee=_.identity] The function to combine
  9323. * grouped values.
  9324. * @returns {Array} Returns the new array of grouped elements.
  9325. * @example
  9326. *
  9327. * _.zipWith([1, 2], [10, 20], [100, 200], function(a, b, c) {
  9328. * return a + b + c;
  9329. * });
  9330. * // => [111, 222]
  9331. */
  9332. var zipWith = baseRest(function(arrays) {
  9333. var length = arrays.length,
  9334. iteratee = length > 1 ? arrays[length - 1] : undefined;
  9335. iteratee = typeof iteratee == 'function' ? (arrays.pop(), iteratee) : undefined;
  9336. return unzipWith(arrays, iteratee);
  9337. });
  9338. /*------------------------------------------------------------------------*/
  9339. /**
  9340. * Creates a `lodash` wrapper instance that wraps `value` with explicit method
  9341. * chain sequences enabled. The result of such sequences must be unwrapped
  9342. * with `_#value`.
  9343. *
  9344. * @static
  9345. * @memberOf _
  9346. * @since 1.3.0
  9347. * @category Seq
  9348. * @param {*} value The value to wrap.
  9349. * @returns {Object} Returns the new `lodash` wrapper instance.
  9350. * @example
  9351. *
  9352. * var users = [
  9353. * { 'user': 'barney', 'age': 36 },
  9354. * { 'user': 'fred', 'age': 40 },
  9355. * { 'user': 'pebbles', 'age': 1 }
  9356. * ];
  9357. *
  9358. * var youngest = _
  9359. * .chain(users)
  9360. * .sortBy('age')
  9361. * .map(function(o) {
  9362. * return o.user + ' is ' + o.age;
  9363. * })
  9364. * .head()
  9365. * .value();
  9366. * // => 'pebbles is 1'
  9367. */
  9368. function chain(value) {
  9369. var result = lodash(value);
  9370. result.__chain__ = true;
  9371. return result;
  9372. }
  9373. /**
  9374. * This method invokes `interceptor` and returns `value`. The interceptor
  9375. * is invoked with one argument; (value). The purpose of this method is to
  9376. * "tap into" a method chain sequence in order to modify intermediate results.
  9377. *
  9378. * @static
  9379. * @memberOf _
  9380. * @since 0.1.0
  9381. * @category Seq
  9382. * @param {*} value The value to provide to `interceptor`.
  9383. * @param {Function} interceptor The function to invoke.
  9384. * @returns {*} Returns `value`.
  9385. * @example
  9386. *
  9387. * _([1, 2, 3])
  9388. * .tap(function(array) {
  9389. * // Mutate input array.
  9390. * array.pop();
  9391. * })
  9392. * .reverse()
  9393. * .value();
  9394. * // => [2, 1]
  9395. */
  9396. function tap(value, interceptor) {
  9397. interceptor(value);
  9398. return value;
  9399. }
  9400. /**
  9401. * This method is like `_.tap` except that it returns the result of `interceptor`.
  9402. * The purpose of this method is to "pass thru" values replacing intermediate
  9403. * results in a method chain sequence.
  9404. *
  9405. * @static
  9406. * @memberOf _
  9407. * @since 3.0.0
  9408. * @category Seq
  9409. * @param {*} value The value to provide to `interceptor`.
  9410. * @param {Function} interceptor The function to invoke.
  9411. * @returns {*} Returns the result of `interceptor`.
  9412. * @example
  9413. *
  9414. * _(' abc ')
  9415. * .chain()
  9416. * .trim()
  9417. * .thru(function(value) {
  9418. * return [value];
  9419. * })
  9420. * .value();
  9421. * // => ['abc']
  9422. */
  9423. function thru(value, interceptor) {
  9424. return interceptor(value);
  9425. }
  9426. /**
  9427. * This method is the wrapper version of `_.at`.
  9428. *
  9429. * @name at
  9430. * @memberOf _
  9431. * @since 1.0.0
  9432. * @category Seq
  9433. * @param {...(string|string[])} [paths] The property paths to pick.
  9434. * @returns {Object} Returns the new `lodash` wrapper instance.
  9435. * @example
  9436. *
  9437. * var object = { 'a': [{ 'b': { 'c': 3 } }, 4] };
  9438. *
  9439. * _(object).at(['a[0].b.c', 'a[1]']).value();
  9440. * // => [3, 4]
  9441. */
  9442. var wrapperAt = flatRest(function(paths) {
  9443. var length = paths.length,
  9444. start = length ? paths[0] : 0,
  9445. value = this.__wrapped__,
  9446. interceptor = function(object) { return baseAt(object, paths); };
  9447. if (length > 1 || this.__actions__.length ||
  9448. !(value instanceof LazyWrapper) || !isIndex(start)) {
  9449. return this.thru(interceptor);
  9450. }
  9451. value = value.slice(start, +start + (length ? 1 : 0));
  9452. value.__actions__.push({
  9453. 'func': thru,
  9454. 'args': [interceptor],
  9455. 'thisArg': undefined
  9456. });
  9457. return new LodashWrapper(value, this.__chain__).thru(function(array) {
  9458. if (length && !array.length) {
  9459. array.push(undefined);
  9460. }
  9461. return array;
  9462. });
  9463. });
  9464. /**
  9465. * Creates a `lodash` wrapper instance with explicit method chain sequences enabled.
  9466. *
  9467. * @name chain
  9468. * @memberOf _
  9469. * @since 0.1.0
  9470. * @category Seq
  9471. * @returns {Object} Returns the new `lodash` wrapper instance.
  9472. * @example
  9473. *
  9474. * var users = [
  9475. * { 'user': 'barney', 'age': 36 },
  9476. * { 'user': 'fred', 'age': 40 }
  9477. * ];
  9478. *
  9479. * // A sequence without explicit chaining.
  9480. * _(users).head();
  9481. * // => { 'user': 'barney', 'age': 36 }
  9482. *
  9483. * // A sequence with explicit chaining.
  9484. * _(users)
  9485. * .chain()
  9486. * .head()
  9487. * .pick('user')
  9488. * .value();
  9489. * // => { 'user': 'barney' }
  9490. */
  9491. function wrapperChain() {
  9492. return chain(this);
  9493. }
  9494. /**
  9495. * Executes the chain sequence and returns the wrapped result.
  9496. *
  9497. * @name commit
  9498. * @memberOf _
  9499. * @since 3.2.0
  9500. * @category Seq
  9501. * @returns {Object} Returns the new `lodash` wrapper instance.
  9502. * @example
  9503. *
  9504. * var array = [1, 2];
  9505. * var wrapped = _(array).push(3);
  9506. *
  9507. * console.log(array);
  9508. * // => [1, 2]
  9509. *
  9510. * wrapped = wrapped.commit();
  9511. * console.log(array);
  9512. * // => [1, 2, 3]
  9513. *
  9514. * wrapped.last();
  9515. * // => 3
  9516. *
  9517. * console.log(array);
  9518. * // => [1, 2, 3]
  9519. */
  9520. function wrapperCommit() {
  9521. return new LodashWrapper(this.value(), this.__chain__);
  9522. }
  9523. /**
  9524. * Gets the next value on a wrapped object following the
  9525. * [iterator protocol](https://mdn.io/iteration_protocols#iterator).
  9526. *
  9527. * @name next
  9528. * @memberOf _
  9529. * @since 4.0.0
  9530. * @category Seq
  9531. * @returns {Object} Returns the next iterator value.
  9532. * @example
  9533. *
  9534. * var wrapped = _([1, 2]);
  9535. *
  9536. * wrapped.next();
  9537. * // => { 'done': false, 'value': 1 }
  9538. *
  9539. * wrapped.next();
  9540. * // => { 'done': false, 'value': 2 }
  9541. *
  9542. * wrapped.next();
  9543. * // => { 'done': true, 'value': undefined }
  9544. */
  9545. function wrapperNext() {
  9546. if (this.__values__ === undefined) {
  9547. this.__values__ = toArray(this.value());
  9548. }
  9549. var done = this.__index__ >= this.__values__.length,
  9550. value = done ? undefined : this.__values__[this.__index__++];
  9551. return { 'done': done, 'value': value };
  9552. }
  9553. /**
  9554. * Enables the wrapper to be iterable.
  9555. *
  9556. * @name Symbol.iterator
  9557. * @memberOf _
  9558. * @since 4.0.0
  9559. * @category Seq
  9560. * @returns {Object} Returns the wrapper object.
  9561. * @example
  9562. *
  9563. * var wrapped = _([1, 2]);
  9564. *
  9565. * wrapped[Symbol.iterator]() === wrapped;
  9566. * // => true
  9567. *
  9568. * Array.from(wrapped);
  9569. * // => [1, 2]
  9570. */
  9571. function wrapperToIterator() {
  9572. return this;
  9573. }
  9574. /**
  9575. * Creates a clone of the chain sequence planting `value` as the wrapped value.
  9576. *
  9577. * @name plant
  9578. * @memberOf _
  9579. * @since 3.2.0
  9580. * @category Seq
  9581. * @param {*} value The value to plant.
  9582. * @returns {Object} Returns the new `lodash` wrapper instance.
  9583. * @example
  9584. *
  9585. * function square(n) {
  9586. * return n * n;
  9587. * }
  9588. *
  9589. * var wrapped = _([1, 2]).map(square);
  9590. * var other = wrapped.plant([3, 4]);
  9591. *
  9592. * other.value();
  9593. * // => [9, 16]
  9594. *
  9595. * wrapped.value();
  9596. * // => [1, 4]
  9597. */
  9598. function wrapperPlant(value) {
  9599. var result,
  9600. parent = this;
  9601. while (parent instanceof baseLodash) {
  9602. var clone = wrapperClone(parent);
  9603. clone.__index__ = 0;
  9604. clone.__values__ = undefined;
  9605. if (result) {
  9606. previous.__wrapped__ = clone;
  9607. } else {
  9608. result = clone;
  9609. }
  9610. var previous = clone;
  9611. parent = parent.__wrapped__;
  9612. }
  9613. previous.__wrapped__ = value;
  9614. return result;
  9615. }
  9616. /**
  9617. * This method is the wrapper version of `_.reverse`.
  9618. *
  9619. * **Note:** This method mutates the wrapped array.
  9620. *
  9621. * @name reverse
  9622. * @memberOf _
  9623. * @since 0.1.0
  9624. * @category Seq
  9625. * @returns {Object} Returns the new `lodash` wrapper instance.
  9626. * @example
  9627. *
  9628. * var array = [1, 2, 3];
  9629. *
  9630. * _(array).reverse().value()
  9631. * // => [3, 2, 1]
  9632. *
  9633. * console.log(array);
  9634. * // => [3, 2, 1]
  9635. */
  9636. function wrapperReverse() {
  9637. var value = this.__wrapped__;
  9638. if (value instanceof LazyWrapper) {
  9639. var wrapped = value;
  9640. if (this.__actions__.length) {
  9641. wrapped = new LazyWrapper(this);
  9642. }
  9643. wrapped = wrapped.reverse();
  9644. wrapped.__actions__.push({
  9645. 'func': thru,
  9646. 'args': [reverse],
  9647. 'thisArg': undefined
  9648. });
  9649. return new LodashWrapper(wrapped, this.__chain__);
  9650. }
  9651. return this.thru(reverse);
  9652. }
  9653. /**
  9654. * Executes the chain sequence to resolve the unwrapped value.
  9655. *
  9656. * @name value
  9657. * @memberOf _
  9658. * @since 0.1.0
  9659. * @alias toJSON, valueOf
  9660. * @category Seq
  9661. * @returns {*} Returns the resolved unwrapped value.
  9662. * @example
  9663. *
  9664. * _([1, 2, 3]).value();
  9665. * // => [1, 2, 3]
  9666. */
  9667. function wrapperValue() {
  9668. return baseWrapperValue(this.__wrapped__, this.__actions__);
  9669. }
  9670. /*------------------------------------------------------------------------*/
  9671. /**
  9672. * Creates an object composed of keys generated from the results of running
  9673. * each element of `collection` thru `iteratee`. The corresponding value of
  9674. * each key is the number of times the key was returned by `iteratee`. The
  9675. * iteratee is invoked with one argument: (value).
  9676. *
  9677. * @static
  9678. * @memberOf _
  9679. * @since 0.5.0
  9680. * @category Collection
  9681. * @param {Array|Object} collection The collection to iterate over.
  9682. * @param {Function} [iteratee=_.identity] The iteratee to transform keys.
  9683. * @returns {Object} Returns the composed aggregate object.
  9684. * @example
  9685. *
  9686. * _.countBy([6.1, 4.2, 6.3], Math.floor);
  9687. * // => { '4': 1, '6': 2 }
  9688. *
  9689. * // The `_.property` iteratee shorthand.
  9690. * _.countBy(['one', 'two', 'three'], 'length');
  9691. * // => { '3': 2, '5': 1 }
  9692. */
  9693. var countBy = createAggregator(function(result, value, key) {
  9694. if (hasOwnProperty.call(result, key)) {
  9695. ++result[key];
  9696. } else {
  9697. baseAssignValue(result, key, 1);
  9698. }
  9699. });
  9700. /**
  9701. * Checks if `predicate` returns truthy for **all** elements of `collection`.
  9702. * Iteration is stopped once `predicate` returns falsey. The predicate is
  9703. * invoked with three arguments: (value, index|key, collection).
  9704. *
  9705. * **Note:** This method returns `true` for
  9706. * [empty collections](https://en.wikipedia.org/wiki/Empty_set) because
  9707. * [everything is true](https://en.wikipedia.org/wiki/Vacuous_truth) of
  9708. * elements of empty collections.
  9709. *
  9710. * @static
  9711. * @memberOf _
  9712. * @since 0.1.0
  9713. * @category Collection
  9714. * @param {Array|Object} collection The collection to iterate over.
  9715. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  9716. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  9717. * @returns {boolean} Returns `true` if all elements pass the predicate check,
  9718. * else `false`.
  9719. * @example
  9720. *
  9721. * _.every([true, 1, null, 'yes'], Boolean);
  9722. * // => false
  9723. *
  9724. * var users = [
  9725. * { 'user': 'barney', 'age': 36, 'active': false },
  9726. * { 'user': 'fred', 'age': 40, 'active': false }
  9727. * ];
  9728. *
  9729. * // The `_.matches` iteratee shorthand.
  9730. * _.every(users, { 'user': 'barney', 'active': false });
  9731. * // => false
  9732. *
  9733. * // The `_.matchesProperty` iteratee shorthand.
  9734. * _.every(users, ['active', false]);
  9735. * // => true
  9736. *
  9737. * // The `_.property` iteratee shorthand.
  9738. * _.every(users, 'active');
  9739. * // => false
  9740. */
  9741. function every(collection, predicate, guard) {
  9742. var func = isArray(collection) ? arrayEvery : baseEvery;
  9743. if (guard && isIterateeCall(collection, predicate, guard)) {
  9744. predicate = undefined;
  9745. }
  9746. return func(collection, getIteratee(predicate, 3));
  9747. }
  9748. /**
  9749. * Iterates over elements of `collection`, returning an array of all elements
  9750. * `predicate` returns truthy for. The predicate is invoked with three
  9751. * arguments: (value, index|key, collection).
  9752. *
  9753. * **Note:** Unlike `_.remove`, this method returns a new array.
  9754. *
  9755. * @static
  9756. * @memberOf _
  9757. * @since 0.1.0
  9758. * @category Collection
  9759. * @param {Array|Object} collection The collection to iterate over.
  9760. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  9761. * @returns {Array} Returns the new filtered array.
  9762. * @see _.reject
  9763. * @example
  9764. *
  9765. * var users = [
  9766. * { 'user': 'barney', 'age': 36, 'active': true },
  9767. * { 'user': 'fred', 'age': 40, 'active': false }
  9768. * ];
  9769. *
  9770. * _.filter(users, function(o) { return !o.active; });
  9771. * // => objects for ['fred']
  9772. *
  9773. * // The `_.matches` iteratee shorthand.
  9774. * _.filter(users, { 'age': 36, 'active': true });
  9775. * // => objects for ['barney']
  9776. *
  9777. * // The `_.matchesProperty` iteratee shorthand.
  9778. * _.filter(users, ['active', false]);
  9779. * // => objects for ['fred']
  9780. *
  9781. * // The `_.property` iteratee shorthand.
  9782. * _.filter(users, 'active');
  9783. * // => objects for ['barney']
  9784. *
  9785. * // Combining several predicates using `_.overEvery` or `_.overSome`.
  9786. * _.filter(users, _.overSome([{ 'age': 36 }, ['age', 40]]));
  9787. * // => objects for ['fred', 'barney']
  9788. */
  9789. function filter(collection, predicate) {
  9790. var func = isArray(collection) ? arrayFilter : baseFilter;
  9791. return func(collection, getIteratee(predicate, 3));
  9792. }
  9793. /**
  9794. * Iterates over elements of `collection`, returning the first element
  9795. * `predicate` returns truthy for. The predicate is invoked with three
  9796. * arguments: (value, index|key, collection).
  9797. *
  9798. * @static
  9799. * @memberOf _
  9800. * @since 0.1.0
  9801. * @category Collection
  9802. * @param {Array|Object} collection The collection to inspect.
  9803. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  9804. * @param {number} [fromIndex=0] The index to search from.
  9805. * @returns {*} Returns the matched element, else `undefined`.
  9806. * @example
  9807. *
  9808. * var users = [
  9809. * { 'user': 'barney', 'age': 36, 'active': true },
  9810. * { 'user': 'fred', 'age': 40, 'active': false },
  9811. * { 'user': 'pebbles', 'age': 1, 'active': true }
  9812. * ];
  9813. *
  9814. * _.find(users, function(o) { return o.age < 40; });
  9815. * // => object for 'barney'
  9816. *
  9817. * // The `_.matches` iteratee shorthand.
  9818. * _.find(users, { 'age': 1, 'active': true });
  9819. * // => object for 'pebbles'
  9820. *
  9821. * // The `_.matchesProperty` iteratee shorthand.
  9822. * _.find(users, ['active', false]);
  9823. * // => object for 'fred'
  9824. *
  9825. * // The `_.property` iteratee shorthand.
  9826. * _.find(users, 'active');
  9827. * // => object for 'barney'
  9828. */
  9829. var find = createFind(findIndex);
  9830. /**
  9831. * This method is like `_.find` except that it iterates over elements of
  9832. * `collection` from right to left.
  9833. *
  9834. * @static
  9835. * @memberOf _
  9836. * @since 2.0.0
  9837. * @category Collection
  9838. * @param {Array|Object} collection The collection to inspect.
  9839. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  9840. * @param {number} [fromIndex=collection.length-1] The index to search from.
  9841. * @returns {*} Returns the matched element, else `undefined`.
  9842. * @example
  9843. *
  9844. * _.findLast([1, 2, 3, 4], function(n) {
  9845. * return n % 2 == 1;
  9846. * });
  9847. * // => 3
  9848. */
  9849. var findLast = createFind(findLastIndex);
  9850. /**
  9851. * Creates a flattened array of values by running each element in `collection`
  9852. * thru `iteratee` and flattening the mapped results. The iteratee is invoked
  9853. * with three arguments: (value, index|key, collection).
  9854. *
  9855. * @static
  9856. * @memberOf _
  9857. * @since 4.0.0
  9858. * @category Collection
  9859. * @param {Array|Object} collection The collection to iterate over.
  9860. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  9861. * @returns {Array} Returns the new flattened array.
  9862. * @example
  9863. *
  9864. * function duplicate(n) {
  9865. * return [n, n];
  9866. * }
  9867. *
  9868. * _.flatMap([1, 2], duplicate);
  9869. * // => [1, 1, 2, 2]
  9870. */
  9871. function flatMap(collection, iteratee) {
  9872. return baseFlatten(map(collection, iteratee), 1);
  9873. }
  9874. /**
  9875. * This method is like `_.flatMap` except that it recursively flattens the
  9876. * mapped results.
  9877. *
  9878. * @static
  9879. * @memberOf _
  9880. * @since 4.7.0
  9881. * @category Collection
  9882. * @param {Array|Object} collection The collection to iterate over.
  9883. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  9884. * @returns {Array} Returns the new flattened array.
  9885. * @example
  9886. *
  9887. * function duplicate(n) {
  9888. * return [[[n, n]]];
  9889. * }
  9890. *
  9891. * _.flatMapDeep([1, 2], duplicate);
  9892. * // => [1, 1, 2, 2]
  9893. */
  9894. function flatMapDeep(collection, iteratee) {
  9895. return baseFlatten(map(collection, iteratee), INFINITY);
  9896. }
  9897. /**
  9898. * This method is like `_.flatMap` except that it recursively flattens the
  9899. * mapped results up to `depth` times.
  9900. *
  9901. * @static
  9902. * @memberOf _
  9903. * @since 4.7.0
  9904. * @category Collection
  9905. * @param {Array|Object} collection The collection to iterate over.
  9906. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  9907. * @param {number} [depth=1] The maximum recursion depth.
  9908. * @returns {Array} Returns the new flattened array.
  9909. * @example
  9910. *
  9911. * function duplicate(n) {
  9912. * return [[[n, n]]];
  9913. * }
  9914. *
  9915. * _.flatMapDepth([1, 2], duplicate, 2);
  9916. * // => [[1, 1], [2, 2]]
  9917. */
  9918. function flatMapDepth(collection, iteratee, depth) {
  9919. depth = depth === undefined ? 1 : toInteger(depth);
  9920. return baseFlatten(map(collection, iteratee), depth);
  9921. }
  9922. /**
  9923. * Iterates over elements of `collection` and invokes `iteratee` for each element.
  9924. * The iteratee is invoked with three arguments: (value, index|key, collection).
  9925. * Iteratee functions may exit iteration early by explicitly returning `false`.
  9926. *
  9927. * **Note:** As with other "Collections" methods, objects with a "length"
  9928. * property are iterated like arrays. To avoid this behavior use `_.forIn`
  9929. * or `_.forOwn` for object iteration.
  9930. *
  9931. * @static
  9932. * @memberOf _
  9933. * @since 0.1.0
  9934. * @alias each
  9935. * @category Collection
  9936. * @param {Array|Object} collection The collection to iterate over.
  9937. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  9938. * @returns {Array|Object} Returns `collection`.
  9939. * @see _.forEachRight
  9940. * @example
  9941. *
  9942. * _.forEach([1, 2], function(value) {
  9943. * console.log(value);
  9944. * });
  9945. * // => Logs `1` then `2`.
  9946. *
  9947. * _.forEach({ 'a': 1, 'b': 2 }, function(value, key) {
  9948. * console.log(key);
  9949. * });
  9950. * // => Logs 'a' then 'b' (iteration order is not guaranteed).
  9951. */
  9952. function forEach(collection, iteratee) {
  9953. var func = isArray(collection) ? arrayEach : baseEach;
  9954. return func(collection, getIteratee(iteratee, 3));
  9955. }
  9956. /**
  9957. * This method is like `_.forEach` except that it iterates over elements of
  9958. * `collection` from right to left.
  9959. *
  9960. * @static
  9961. * @memberOf _
  9962. * @since 2.0.0
  9963. * @alias eachRight
  9964. * @category Collection
  9965. * @param {Array|Object} collection The collection to iterate over.
  9966. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  9967. * @returns {Array|Object} Returns `collection`.
  9968. * @see _.forEach
  9969. * @example
  9970. *
  9971. * _.forEachRight([1, 2], function(value) {
  9972. * console.log(value);
  9973. * });
  9974. * // => Logs `2` then `1`.
  9975. */
  9976. function forEachRight(collection, iteratee) {
  9977. var func = isArray(collection) ? arrayEachRight : baseEachRight;
  9978. return func(collection, getIteratee(iteratee, 3));
  9979. }
  9980. /**
  9981. * Creates an object composed of keys generated from the results of running
  9982. * each element of `collection` thru `iteratee`. The order of grouped values
  9983. * is determined by the order they occur in `collection`. The corresponding
  9984. * value of each key is an array of elements responsible for generating the
  9985. * key. The iteratee is invoked with one argument: (value).
  9986. *
  9987. * @static
  9988. * @memberOf _
  9989. * @since 0.1.0
  9990. * @category Collection
  9991. * @param {Array|Object} collection The collection to iterate over.
  9992. * @param {Function} [iteratee=_.identity] The iteratee to transform keys.
  9993. * @returns {Object} Returns the composed aggregate object.
  9994. * @example
  9995. *
  9996. * _.groupBy([6.1, 4.2, 6.3], Math.floor);
  9997. * // => { '4': [4.2], '6': [6.1, 6.3] }
  9998. *
  9999. * // The `_.property` iteratee shorthand.
  10000. * _.groupBy(['one', 'two', 'three'], 'length');
  10001. * // => { '3': ['one', 'two'], '5': ['three'] }
  10002. */
  10003. var groupBy = createAggregator(function(result, value, key) {
  10004. if (hasOwnProperty.call(result, key)) {
  10005. result[key].push(value);
  10006. } else {
  10007. baseAssignValue(result, key, [value]);
  10008. }
  10009. });
  10010. /**
  10011. * Checks if `value` is in `collection`. If `collection` is a string, it's
  10012. * checked for a substring of `value`, otherwise
  10013. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  10014. * is used for equality comparisons. If `fromIndex` is negative, it's used as
  10015. * the offset from the end of `collection`.
  10016. *
  10017. * @static
  10018. * @memberOf _
  10019. * @since 0.1.0
  10020. * @category Collection
  10021. * @param {Array|Object|string} collection The collection to inspect.
  10022. * @param {*} value The value to search for.
  10023. * @param {number} [fromIndex=0] The index to search from.
  10024. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.reduce`.
  10025. * @returns {boolean} Returns `true` if `value` is found, else `false`.
  10026. * @example
  10027. *
  10028. * _.includes([1, 2, 3], 1);
  10029. * // => true
  10030. *
  10031. * _.includes([1, 2, 3], 1, 2);
  10032. * // => false
  10033. *
  10034. * _.includes({ 'a': 1, 'b': 2 }, 1);
  10035. * // => true
  10036. *
  10037. * _.includes('abcd', 'bc');
  10038. * // => true
  10039. */
  10040. function includes(collection, value, fromIndex, guard) {
  10041. collection = isArrayLike(collection) ? collection : values(collection);
  10042. fromIndex = (fromIndex && !guard) ? toInteger(fromIndex) : 0;
  10043. var length = collection.length;
  10044. if (fromIndex < 0) {
  10045. fromIndex = nativeMax(length + fromIndex, 0);
  10046. }
  10047. return isString(collection)
  10048. ? (fromIndex <= length && collection.indexOf(value, fromIndex) > -1)
  10049. : (!!length && baseIndexOf(collection, value, fromIndex) > -1);
  10050. }
  10051. /**
  10052. * Invokes the method at `path` of each element in `collection`, returning
  10053. * an array of the results of each invoked method. Any additional arguments
  10054. * are provided to each invoked method. If `path` is a function, it's invoked
  10055. * for, and `this` bound to, each element in `collection`.
  10056. *
  10057. * @static
  10058. * @memberOf _
  10059. * @since 4.0.0
  10060. * @category Collection
  10061. * @param {Array|Object} collection The collection to iterate over.
  10062. * @param {Array|Function|string} path The path of the method to invoke or
  10063. * the function invoked per iteration.
  10064. * @param {...*} [args] The arguments to invoke each method with.
  10065. * @returns {Array} Returns the array of results.
  10066. * @example
  10067. *
  10068. * _.invokeMap([[5, 1, 7], [3, 2, 1]], 'sort');
  10069. * // => [[1, 5, 7], [1, 2, 3]]
  10070. *
  10071. * _.invokeMap([123, 456], String.prototype.split, '');
  10072. * // => [['1', '2', '3'], ['4', '5', '6']]
  10073. */
  10074. var invokeMap = baseRest(function(collection, path, args) {
  10075. var index = -1,
  10076. isFunc = typeof path == 'function',
  10077. result = isArrayLike(collection) ? Array(collection.length) : [];
  10078. baseEach(collection, function(value) {
  10079. result[++index] = isFunc ? apply(path, value, args) : baseInvoke(value, path, args);
  10080. });
  10081. return result;
  10082. });
  10083. /**
  10084. * Creates an object composed of keys generated from the results of running
  10085. * each element of `collection` thru `iteratee`. The corresponding value of
  10086. * each key is the last element responsible for generating the key. The
  10087. * iteratee is invoked with one argument: (value).
  10088. *
  10089. * @static
  10090. * @memberOf _
  10091. * @since 4.0.0
  10092. * @category Collection
  10093. * @param {Array|Object} collection The collection to iterate over.
  10094. * @param {Function} [iteratee=_.identity] The iteratee to transform keys.
  10095. * @returns {Object} Returns the composed aggregate object.
  10096. * @example
  10097. *
  10098. * var array = [
  10099. * { 'dir': 'left', 'code': 97 },
  10100. * { 'dir': 'right', 'code': 100 }
  10101. * ];
  10102. *
  10103. * _.keyBy(array, function(o) {
  10104. * return String.fromCharCode(o.code);
  10105. * });
  10106. * // => { 'a': { 'dir': 'left', 'code': 97 }, 'd': { 'dir': 'right', 'code': 100 } }
  10107. *
  10108. * _.keyBy(array, 'dir');
  10109. * // => { 'left': { 'dir': 'left', 'code': 97 }, 'right': { 'dir': 'right', 'code': 100 } }
  10110. */
  10111. var keyBy = createAggregator(function(result, value, key) {
  10112. baseAssignValue(result, key, value);
  10113. });
  10114. /**
  10115. * Creates an array of values by running each element in `collection` thru
  10116. * `iteratee`. The iteratee is invoked with three arguments:
  10117. * (value, index|key, collection).
  10118. *
  10119. * Many lodash methods are guarded to work as iteratees for methods like
  10120. * `_.every`, `_.filter`, `_.map`, `_.mapValues`, `_.reject`, and `_.some`.
  10121. *
  10122. * The guarded methods are:
  10123. * `ary`, `chunk`, `curry`, `curryRight`, `drop`, `dropRight`, `every`,
  10124. * `fill`, `invert`, `parseInt`, `random`, `range`, `rangeRight`, `repeat`,
  10125. * `sampleSize`, `slice`, `some`, `sortBy`, `split`, `take`, `takeRight`,
  10126. * `template`, `trim`, `trimEnd`, `trimStart`, and `words`
  10127. *
  10128. * @static
  10129. * @memberOf _
  10130. * @since 0.1.0
  10131. * @category Collection
  10132. * @param {Array|Object} collection The collection to iterate over.
  10133. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  10134. * @returns {Array} Returns the new mapped array.
  10135. * @example
  10136. *
  10137. * function square(n) {
  10138. * return n * n;
  10139. * }
  10140. *
  10141. * _.map([4, 8], square);
  10142. * // => [16, 64]
  10143. *
  10144. * _.map({ 'a': 4, 'b': 8 }, square);
  10145. * // => [16, 64] (iteration order is not guaranteed)
  10146. *
  10147. * var users = [
  10148. * { 'user': 'barney' },
  10149. * { 'user': 'fred' }
  10150. * ];
  10151. *
  10152. * // The `_.property` iteratee shorthand.
  10153. * _.map(users, 'user');
  10154. * // => ['barney', 'fred']
  10155. */
  10156. function map(collection, iteratee) {
  10157. var func = isArray(collection) ? arrayMap : baseMap;
  10158. return func(collection, getIteratee(iteratee, 3));
  10159. }
  10160. /**
  10161. * This method is like `_.sortBy` except that it allows specifying the sort
  10162. * orders of the iteratees to sort by. If `orders` is unspecified, all values
  10163. * are sorted in ascending order. Otherwise, specify an order of "desc" for
  10164. * descending or "asc" for ascending sort order of corresponding values.
  10165. *
  10166. * @static
  10167. * @memberOf _
  10168. * @since 4.0.0
  10169. * @category Collection
  10170. * @param {Array|Object} collection The collection to iterate over.
  10171. * @param {Array[]|Function[]|Object[]|string[]} [iteratees=[_.identity]]
  10172. * The iteratees to sort by.
  10173. * @param {string[]} [orders] The sort orders of `iteratees`.
  10174. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.reduce`.
  10175. * @returns {Array} Returns the new sorted array.
  10176. * @example
  10177. *
  10178. * var users = [
  10179. * { 'user': 'fred', 'age': 48 },
  10180. * { 'user': 'barney', 'age': 34 },
  10181. * { 'user': 'fred', 'age': 40 },
  10182. * { 'user': 'barney', 'age': 36 }
  10183. * ];
  10184. *
  10185. * // Sort by `user` in ascending order and by `age` in descending order.
  10186. * _.orderBy(users, ['user', 'age'], ['asc', 'desc']);
  10187. * // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 40]]
  10188. */
  10189. function orderBy(collection, iteratees, orders, guard) {
  10190. if (collection == null) {
  10191. return [];
  10192. }
  10193. if (!isArray(iteratees)) {
  10194. iteratees = iteratees == null ? [] : [iteratees];
  10195. }
  10196. orders = guard ? undefined : orders;
  10197. if (!isArray(orders)) {
  10198. orders = orders == null ? [] : [orders];
  10199. }
  10200. return baseOrderBy(collection, iteratees, orders);
  10201. }
  10202. /**
  10203. * Creates an array of elements split into two groups, the first of which
  10204. * contains elements `predicate` returns truthy for, the second of which
  10205. * contains elements `predicate` returns falsey for. The predicate is
  10206. * invoked with one argument: (value).
  10207. *
  10208. * @static
  10209. * @memberOf _
  10210. * @since 3.0.0
  10211. * @category Collection
  10212. * @param {Array|Object} collection The collection to iterate over.
  10213. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  10214. * @returns {Array} Returns the array of grouped elements.
  10215. * @example
  10216. *
  10217. * var users = [
  10218. * { 'user': 'barney', 'age': 36, 'active': false },
  10219. * { 'user': 'fred', 'age': 40, 'active': true },
  10220. * { 'user': 'pebbles', 'age': 1, 'active': false }
  10221. * ];
  10222. *
  10223. * _.partition(users, function(o) { return o.active; });
  10224. * // => objects for [['fred'], ['barney', 'pebbles']]
  10225. *
  10226. * // The `_.matches` iteratee shorthand.
  10227. * _.partition(users, { 'age': 1, 'active': false });
  10228. * // => objects for [['pebbles'], ['barney', 'fred']]
  10229. *
  10230. * // The `_.matchesProperty` iteratee shorthand.
  10231. * _.partition(users, ['active', false]);
  10232. * // => objects for [['barney', 'pebbles'], ['fred']]
  10233. *
  10234. * // The `_.property` iteratee shorthand.
  10235. * _.partition(users, 'active');
  10236. * // => objects for [['fred'], ['barney', 'pebbles']]
  10237. */
  10238. var partition = createAggregator(function(result, value, key) {
  10239. result[key ? 0 : 1].push(value);
  10240. }, function() { return [[], []]; });
  10241. /**
  10242. * Reduces `collection` to a value which is the accumulated result of running
  10243. * each element in `collection` thru `iteratee`, where each successive
  10244. * invocation is supplied the return value of the previous. If `accumulator`
  10245. * is not given, the first element of `collection` is used as the initial
  10246. * value. The iteratee is invoked with four arguments:
  10247. * (accumulator, value, index|key, collection).
  10248. *
  10249. * Many lodash methods are guarded to work as iteratees for methods like
  10250. * `_.reduce`, `_.reduceRight`, and `_.transform`.
  10251. *
  10252. * The guarded methods are:
  10253. * `assign`, `defaults`, `defaultsDeep`, `includes`, `merge`, `orderBy`,
  10254. * and `sortBy`
  10255. *
  10256. * @static
  10257. * @memberOf _
  10258. * @since 0.1.0
  10259. * @category Collection
  10260. * @param {Array|Object} collection The collection to iterate over.
  10261. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  10262. * @param {*} [accumulator] The initial value.
  10263. * @returns {*} Returns the accumulated value.
  10264. * @see _.reduceRight
  10265. * @example
  10266. *
  10267. * _.reduce([1, 2], function(sum, n) {
  10268. * return sum + n;
  10269. * }, 0);
  10270. * // => 3
  10271. *
  10272. * _.reduce({ 'a': 1, 'b': 2, 'c': 1 }, function(result, value, key) {
  10273. * (result[value] || (result[value] = [])).push(key);
  10274. * return result;
  10275. * }, {});
  10276. * // => { '1': ['a', 'c'], '2': ['b'] } (iteration order is not guaranteed)
  10277. */
  10278. function reduce(collection, iteratee, accumulator) {
  10279. var func = isArray(collection) ? arrayReduce : baseReduce,
  10280. initAccum = arguments.length < 3;
  10281. return func(collection, getIteratee(iteratee, 4), accumulator, initAccum, baseEach);
  10282. }
  10283. /**
  10284. * This method is like `_.reduce` except that it iterates over elements of
  10285. * `collection` from right to left.
  10286. *
  10287. * @static
  10288. * @memberOf _
  10289. * @since 0.1.0
  10290. * @category Collection
  10291. * @param {Array|Object} collection The collection to iterate over.
  10292. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  10293. * @param {*} [accumulator] The initial value.
  10294. * @returns {*} Returns the accumulated value.
  10295. * @see _.reduce
  10296. * @example
  10297. *
  10298. * var array = [[0, 1], [2, 3], [4, 5]];
  10299. *
  10300. * _.reduceRight(array, function(flattened, other) {
  10301. * return flattened.concat(other);
  10302. * }, []);
  10303. * // => [4, 5, 2, 3, 0, 1]
  10304. */
  10305. function reduceRight(collection, iteratee, accumulator) {
  10306. var func = isArray(collection) ? arrayReduceRight : baseReduce,
  10307. initAccum = arguments.length < 3;
  10308. return func(collection, getIteratee(iteratee, 4), accumulator, initAccum, baseEachRight);
  10309. }
  10310. /**
  10311. * The opposite of `_.filter`; this method returns the elements of `collection`
  10312. * that `predicate` does **not** return truthy for.
  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} [predicate=_.identity] The function invoked per iteration.
  10320. * @returns {Array} Returns the new filtered array.
  10321. * @see _.filter
  10322. * @example
  10323. *
  10324. * var users = [
  10325. * { 'user': 'barney', 'age': 36, 'active': false },
  10326. * { 'user': 'fred', 'age': 40, 'active': true }
  10327. * ];
  10328. *
  10329. * _.reject(users, function(o) { return !o.active; });
  10330. * // => objects for ['fred']
  10331. *
  10332. * // The `_.matches` iteratee shorthand.
  10333. * _.reject(users, { 'age': 40, 'active': true });
  10334. * // => objects for ['barney']
  10335. *
  10336. * // The `_.matchesProperty` iteratee shorthand.
  10337. * _.reject(users, ['active', false]);
  10338. * // => objects for ['fred']
  10339. *
  10340. * // The `_.property` iteratee shorthand.
  10341. * _.reject(users, 'active');
  10342. * // => objects for ['barney']
  10343. */
  10344. function reject(collection, predicate) {
  10345. var func = isArray(collection) ? arrayFilter : baseFilter;
  10346. return func(collection, negate(getIteratee(predicate, 3)));
  10347. }
  10348. /**
  10349. * Gets a random element from `collection`.
  10350. *
  10351. * @static
  10352. * @memberOf _
  10353. * @since 2.0.0
  10354. * @category Collection
  10355. * @param {Array|Object} collection The collection to sample.
  10356. * @returns {*} Returns the random element.
  10357. * @example
  10358. *
  10359. * _.sample([1, 2, 3, 4]);
  10360. * // => 2
  10361. */
  10362. function sample(collection) {
  10363. var func = isArray(collection) ? arraySample : baseSample;
  10364. return func(collection);
  10365. }
  10366. /**
  10367. * Gets `n` random elements at unique keys from `collection` up to the
  10368. * size of `collection`.
  10369. *
  10370. * @static
  10371. * @memberOf _
  10372. * @since 4.0.0
  10373. * @category Collection
  10374. * @param {Array|Object} collection The collection to sample.
  10375. * @param {number} [n=1] The number of elements to sample.
  10376. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  10377. * @returns {Array} Returns the random elements.
  10378. * @example
  10379. *
  10380. * _.sampleSize([1, 2, 3], 2);
  10381. * // => [3, 1]
  10382. *
  10383. * _.sampleSize([1, 2, 3], 4);
  10384. * // => [2, 3, 1]
  10385. */
  10386. function sampleSize(collection, n, guard) {
  10387. if ((guard ? isIterateeCall(collection, n, guard) : n === undefined)) {
  10388. n = 1;
  10389. } else {
  10390. n = toInteger(n);
  10391. }
  10392. var func = isArray(collection) ? arraySampleSize : baseSampleSize;
  10393. return func(collection, n);
  10394. }
  10395. /**
  10396. * Creates an array of shuffled values, using a version of the
  10397. * [Fisher-Yates shuffle](https://en.wikipedia.org/wiki/Fisher-Yates_shuffle).
  10398. *
  10399. * @static
  10400. * @memberOf _
  10401. * @since 0.1.0
  10402. * @category Collection
  10403. * @param {Array|Object} collection The collection to shuffle.
  10404. * @returns {Array} Returns the new shuffled array.
  10405. * @example
  10406. *
  10407. * _.shuffle([1, 2, 3, 4]);
  10408. * // => [4, 1, 3, 2]
  10409. */
  10410. function shuffle(collection) {
  10411. var func = isArray(collection) ? arrayShuffle : baseShuffle;
  10412. return func(collection);
  10413. }
  10414. /**
  10415. * Gets the size of `collection` by returning its length for array-like
  10416. * values or the number of own enumerable string keyed properties for objects.
  10417. *
  10418. * @static
  10419. * @memberOf _
  10420. * @since 0.1.0
  10421. * @category Collection
  10422. * @param {Array|Object|string} collection The collection to inspect.
  10423. * @returns {number} Returns the collection size.
  10424. * @example
  10425. *
  10426. * _.size([1, 2, 3]);
  10427. * // => 3
  10428. *
  10429. * _.size({ 'a': 1, 'b': 2 });
  10430. * // => 2
  10431. *
  10432. * _.size('pebbles');
  10433. * // => 7
  10434. */
  10435. function size(collection) {
  10436. if (collection == null) {
  10437. return 0;
  10438. }
  10439. if (isArrayLike(collection)) {
  10440. return isString(collection) ? stringSize(collection) : collection.length;
  10441. }
  10442. var tag = getTag(collection);
  10443. if (tag == mapTag || tag == setTag) {
  10444. return collection.size;
  10445. }
  10446. return baseKeys(collection).length;
  10447. }
  10448. /**
  10449. * Checks if `predicate` returns truthy for **any** element of `collection`.
  10450. * Iteration is stopped once `predicate` returns truthy. The predicate is
  10451. * invoked with three arguments: (value, index|key, collection).
  10452. *
  10453. * @static
  10454. * @memberOf _
  10455. * @since 0.1.0
  10456. * @category Collection
  10457. * @param {Array|Object} collection The collection to iterate over.
  10458. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  10459. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  10460. * @returns {boolean} Returns `true` if any element passes the predicate check,
  10461. * else `false`.
  10462. * @example
  10463. *
  10464. * _.some([null, 0, 'yes', false], Boolean);
  10465. * // => true
  10466. *
  10467. * var users = [
  10468. * { 'user': 'barney', 'active': true },
  10469. * { 'user': 'fred', 'active': false }
  10470. * ];
  10471. *
  10472. * // The `_.matches` iteratee shorthand.
  10473. * _.some(users, { 'user': 'barney', 'active': false });
  10474. * // => false
  10475. *
  10476. * // The `_.matchesProperty` iteratee shorthand.
  10477. * _.some(users, ['active', false]);
  10478. * // => true
  10479. *
  10480. * // The `_.property` iteratee shorthand.
  10481. * _.some(users, 'active');
  10482. * // => true
  10483. */
  10484. function some(collection, predicate, guard) {
  10485. var func = isArray(collection) ? arraySome : baseSome;
  10486. if (guard && isIterateeCall(collection, predicate, guard)) {
  10487. predicate = undefined;
  10488. }
  10489. return func(collection, getIteratee(predicate, 3));
  10490. }
  10491. /**
  10492. * Creates an array of elements, sorted in ascending order by the results of
  10493. * running each element in a collection thru each iteratee. This method
  10494. * performs a stable sort, that is, it preserves the original sort order of
  10495. * equal elements. The iteratees are invoked with one argument: (value).
  10496. *
  10497. * @static
  10498. * @memberOf _
  10499. * @since 0.1.0
  10500. * @category Collection
  10501. * @param {Array|Object} collection The collection to iterate over.
  10502. * @param {...(Function|Function[])} [iteratees=[_.identity]]
  10503. * The iteratees to sort by.
  10504. * @returns {Array} Returns the new sorted array.
  10505. * @example
  10506. *
  10507. * var users = [
  10508. * { 'user': 'fred', 'age': 48 },
  10509. * { 'user': 'barney', 'age': 36 },
  10510. * { 'user': 'fred', 'age': 30 },
  10511. * { 'user': 'barney', 'age': 34 }
  10512. * ];
  10513. *
  10514. * _.sortBy(users, [function(o) { return o.user; }]);
  10515. * // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 30]]
  10516. *
  10517. * _.sortBy(users, ['user', 'age']);
  10518. * // => objects for [['barney', 34], ['barney', 36], ['fred', 30], ['fred', 48]]
  10519. */
  10520. var sortBy = baseRest(function(collection, iteratees) {
  10521. if (collection == null) {
  10522. return [];
  10523. }
  10524. var length = iteratees.length;
  10525. if (length > 1 && isIterateeCall(collection, iteratees[0], iteratees[1])) {
  10526. iteratees = [];
  10527. } else if (length > 2 && isIterateeCall(iteratees[0], iteratees[1], iteratees[2])) {
  10528. iteratees = [iteratees[0]];
  10529. }
  10530. return baseOrderBy(collection, baseFlatten(iteratees, 1), []);
  10531. });
  10532. /*------------------------------------------------------------------------*/
  10533. /**
  10534. * Gets the timestamp of the number of milliseconds that have elapsed since
  10535. * the Unix epoch (1 January 1970 00:00:00 UTC).
  10536. *
  10537. * @static
  10538. * @memberOf _
  10539. * @since 2.4.0
  10540. * @category Date
  10541. * @returns {number} Returns the timestamp.
  10542. * @example
  10543. *
  10544. * _.defer(function(stamp) {
  10545. * console.log(_.now() - stamp);
  10546. * }, _.now());
  10547. * // => Logs the number of milliseconds it took for the deferred invocation.
  10548. */
  10549. var now = ctxNow || function() {
  10550. return root.Date.now();
  10551. };
  10552. /*------------------------------------------------------------------------*/
  10553. /**
  10554. * The opposite of `_.before`; this method creates a function that invokes
  10555. * `func` once it's called `n` or more times.
  10556. *
  10557. * @static
  10558. * @memberOf _
  10559. * @since 0.1.0
  10560. * @category Function
  10561. * @param {number} n The number of calls before `func` is invoked.
  10562. * @param {Function} func The function to restrict.
  10563. * @returns {Function} Returns the new restricted function.
  10564. * @example
  10565. *
  10566. * var saves = ['profile', 'settings'];
  10567. *
  10568. * var done = _.after(saves.length, function() {
  10569. * console.log('done saving!');
  10570. * });
  10571. *
  10572. * _.forEach(saves, function(type) {
  10573. * asyncSave({ 'type': type, 'complete': done });
  10574. * });
  10575. * // => Logs 'done saving!' after the two async saves have completed.
  10576. */
  10577. function after(n, func) {
  10578. if (typeof func != 'function') {
  10579. throw new TypeError(FUNC_ERROR_TEXT);
  10580. }
  10581. n = toInteger(n);
  10582. return function() {
  10583. if (--n < 1) {
  10584. return func.apply(this, arguments);
  10585. }
  10586. };
  10587. }
  10588. /**
  10589. * Creates a function that invokes `func`, with up to `n` arguments,
  10590. * ignoring any additional arguments.
  10591. *
  10592. * @static
  10593. * @memberOf _
  10594. * @since 3.0.0
  10595. * @category Function
  10596. * @param {Function} func The function to cap arguments for.
  10597. * @param {number} [n=func.length] The arity cap.
  10598. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  10599. * @returns {Function} Returns the new capped function.
  10600. * @example
  10601. *
  10602. * _.map(['6', '8', '10'], _.ary(parseInt, 1));
  10603. * // => [6, 8, 10]
  10604. */
  10605. function ary(func, n, guard) {
  10606. n = guard ? undefined : n;
  10607. n = (func && n == null) ? func.length : n;
  10608. return createWrap(func, WRAP_ARY_FLAG, undefined, undefined, undefined, undefined, n);
  10609. }
  10610. /**
  10611. * Creates a function that invokes `func`, with the `this` binding and arguments
  10612. * of the created function, while it's called less than `n` times. Subsequent
  10613. * calls to the created function return the result of the last `func` invocation.
  10614. *
  10615. * @static
  10616. * @memberOf _
  10617. * @since 3.0.0
  10618. * @category Function
  10619. * @param {number} n The number of calls at which `func` is no longer invoked.
  10620. * @param {Function} func The function to restrict.
  10621. * @returns {Function} Returns the new restricted function.
  10622. * @example
  10623. *
  10624. * jQuery(element).on('click', _.before(5, addContactToList));
  10625. * // => Allows adding up to 4 contacts to the list.
  10626. */
  10627. function before(n, func) {
  10628. var result;
  10629. if (typeof func != 'function') {
  10630. throw new TypeError(FUNC_ERROR_TEXT);
  10631. }
  10632. n = toInteger(n);
  10633. return function() {
  10634. if (--n > 0) {
  10635. result = func.apply(this, arguments);
  10636. }
  10637. if (n <= 1) {
  10638. func = undefined;
  10639. }
  10640. return result;
  10641. };
  10642. }
  10643. /**
  10644. * Creates a function that invokes `func` with the `this` binding of `thisArg`
  10645. * and `partials` prepended to the arguments it receives.
  10646. *
  10647. * The `_.bind.placeholder` value, which defaults to `_` in monolithic builds,
  10648. * may be used as a placeholder for partially applied arguments.
  10649. *
  10650. * **Note:** Unlike native `Function#bind`, this method doesn't set the "length"
  10651. * property of bound functions.
  10652. *
  10653. * @static
  10654. * @memberOf _
  10655. * @since 0.1.0
  10656. * @category Function
  10657. * @param {Function} func The function to bind.
  10658. * @param {*} thisArg The `this` binding of `func`.
  10659. * @param {...*} [partials] The arguments to be partially applied.
  10660. * @returns {Function} Returns the new bound function.
  10661. * @example
  10662. *
  10663. * function greet(greeting, punctuation) {
  10664. * return greeting + ' ' + this.user + punctuation;
  10665. * }
  10666. *
  10667. * var object = { 'user': 'fred' };
  10668. *
  10669. * var bound = _.bind(greet, object, 'hi');
  10670. * bound('!');
  10671. * // => 'hi fred!'
  10672. *
  10673. * // Bound with placeholders.
  10674. * var bound = _.bind(greet, object, _, '!');
  10675. * bound('hi');
  10676. * // => 'hi fred!'
  10677. */
  10678. var bind = baseRest(function(func, thisArg, partials) {
  10679. var bitmask = WRAP_BIND_FLAG;
  10680. if (partials.length) {
  10681. var holders = replaceHolders(partials, getHolder(bind));
  10682. bitmask |= WRAP_PARTIAL_FLAG;
  10683. }
  10684. return createWrap(func, bitmask, thisArg, partials, holders);
  10685. });
  10686. /**
  10687. * Creates a function that invokes the method at `object[key]` with `partials`
  10688. * prepended to the arguments it receives.
  10689. *
  10690. * This method differs from `_.bind` by allowing bound functions to reference
  10691. * methods that may be redefined or don't yet exist. See
  10692. * [Peter Michaux's article](http://peter.michaux.ca/articles/lazy-function-definition-pattern)
  10693. * for more details.
  10694. *
  10695. * The `_.bindKey.placeholder` value, which defaults to `_` in monolithic
  10696. * builds, may be used as a placeholder for partially applied arguments.
  10697. *
  10698. * @static
  10699. * @memberOf _
  10700. * @since 0.10.0
  10701. * @category Function
  10702. * @param {Object} object The object to invoke the method on.
  10703. * @param {string} key The key of the method.
  10704. * @param {...*} [partials] The arguments to be partially applied.
  10705. * @returns {Function} Returns the new bound function.
  10706. * @example
  10707. *
  10708. * var object = {
  10709. * 'user': 'fred',
  10710. * 'greet': function(greeting, punctuation) {
  10711. * return greeting + ' ' + this.user + punctuation;
  10712. * }
  10713. * };
  10714. *
  10715. * var bound = _.bindKey(object, 'greet', 'hi');
  10716. * bound('!');
  10717. * // => 'hi fred!'
  10718. *
  10719. * object.greet = function(greeting, punctuation) {
  10720. * return greeting + 'ya ' + this.user + punctuation;
  10721. * };
  10722. *
  10723. * bound('!');
  10724. * // => 'hiya fred!'
  10725. *
  10726. * // Bound with placeholders.
  10727. * var bound = _.bindKey(object, 'greet', _, '!');
  10728. * bound('hi');
  10729. * // => 'hiya fred!'
  10730. */
  10731. var bindKey = baseRest(function(object, key, partials) {
  10732. var bitmask = WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG;
  10733. if (partials.length) {
  10734. var holders = replaceHolders(partials, getHolder(bindKey));
  10735. bitmask |= WRAP_PARTIAL_FLAG;
  10736. }
  10737. return createWrap(key, bitmask, object, partials, holders);
  10738. });
  10739. /**
  10740. * Creates a function that accepts arguments of `func` and either invokes
  10741. * `func` returning its result, if at least `arity` number of arguments have
  10742. * been provided, or returns a function that accepts the remaining `func`
  10743. * arguments, and so on. The arity of `func` may be specified if `func.length`
  10744. * is not sufficient.
  10745. *
  10746. * The `_.curry.placeholder` value, which defaults to `_` in monolithic builds,
  10747. * may be used as a placeholder for provided arguments.
  10748. *
  10749. * **Note:** This method doesn't set the "length" property of curried functions.
  10750. *
  10751. * @static
  10752. * @memberOf _
  10753. * @since 2.0.0
  10754. * @category Function
  10755. * @param {Function} func The function to curry.
  10756. * @param {number} [arity=func.length] The arity of `func`.
  10757. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  10758. * @returns {Function} Returns the new curried function.
  10759. * @example
  10760. *
  10761. * var abc = function(a, b, c) {
  10762. * return [a, b, c];
  10763. * };
  10764. *
  10765. * var curried = _.curry(abc);
  10766. *
  10767. * curried(1)(2)(3);
  10768. * // => [1, 2, 3]
  10769. *
  10770. * curried(1, 2)(3);
  10771. * // => [1, 2, 3]
  10772. *
  10773. * curried(1, 2, 3);
  10774. * // => [1, 2, 3]
  10775. *
  10776. * // Curried with placeholders.
  10777. * curried(1)(_, 3)(2);
  10778. * // => [1, 2, 3]
  10779. */
  10780. function curry(func, arity, guard) {
  10781. arity = guard ? undefined : arity;
  10782. var result = createWrap(func, WRAP_CURRY_FLAG, undefined, undefined, undefined, undefined, undefined, arity);
  10783. result.placeholder = curry.placeholder;
  10784. return result;
  10785. }
  10786. /**
  10787. * This method is like `_.curry` except that arguments are applied to `func`
  10788. * in the manner of `_.partialRight` instead of `_.partial`.
  10789. *
  10790. * The `_.curryRight.placeholder` value, which defaults to `_` in monolithic
  10791. * builds, may be used as a placeholder for provided arguments.
  10792. *
  10793. * **Note:** This method doesn't set the "length" property of curried functions.
  10794. *
  10795. * @static
  10796. * @memberOf _
  10797. * @since 3.0.0
  10798. * @category Function
  10799. * @param {Function} func The function to curry.
  10800. * @param {number} [arity=func.length] The arity of `func`.
  10801. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  10802. * @returns {Function} Returns the new curried function.
  10803. * @example
  10804. *
  10805. * var abc = function(a, b, c) {
  10806. * return [a, b, c];
  10807. * };
  10808. *
  10809. * var curried = _.curryRight(abc);
  10810. *
  10811. * curried(3)(2)(1);
  10812. * // => [1, 2, 3]
  10813. *
  10814. * curried(2, 3)(1);
  10815. * // => [1, 2, 3]
  10816. *
  10817. * curried(1, 2, 3);
  10818. * // => [1, 2, 3]
  10819. *
  10820. * // Curried with placeholders.
  10821. * curried(3)(1, _)(2);
  10822. * // => [1, 2, 3]
  10823. */
  10824. function curryRight(func, arity, guard) {
  10825. arity = guard ? undefined : arity;
  10826. var result = createWrap(func, WRAP_CURRY_RIGHT_FLAG, undefined, undefined, undefined, undefined, undefined, arity);
  10827. result.placeholder = curryRight.placeholder;
  10828. return result;
  10829. }
  10830. /**
  10831. * Creates a debounced function that delays invoking `func` until after `wait`
  10832. * milliseconds have elapsed since the last time the debounced function was
  10833. * invoked. The debounced function comes with a `cancel` method to cancel
  10834. * delayed `func` invocations and a `flush` method to immediately invoke them.
  10835. * Provide `options` to indicate whether `func` should be invoked on the
  10836. * leading and/or trailing edge of the `wait` timeout. The `func` is invoked
  10837. * with the last arguments provided to the debounced function. Subsequent
  10838. * calls to the debounced function return the result of the last `func`
  10839. * invocation.
  10840. *
  10841. * **Note:** If `leading` and `trailing` options are `true`, `func` is
  10842. * invoked on the trailing edge of the timeout only if the debounced function
  10843. * is invoked more than once during the `wait` timeout.
  10844. *
  10845. * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred
  10846. * until to the next tick, similar to `setTimeout` with a timeout of `0`.
  10847. *
  10848. * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/)
  10849. * for details over the differences between `_.debounce` and `_.throttle`.
  10850. *
  10851. * @static
  10852. * @memberOf _
  10853. * @since 0.1.0
  10854. * @category Function
  10855. * @param {Function} func The function to debounce.
  10856. * @param {number} [wait=0] The number of milliseconds to delay.
  10857. * @param {Object} [options={}] The options object.
  10858. * @param {boolean} [options.leading=false]
  10859. * Specify invoking on the leading edge of the timeout.
  10860. * @param {number} [options.maxWait]
  10861. * The maximum time `func` is allowed to be delayed before it's invoked.
  10862. * @param {boolean} [options.trailing=true]
  10863. * Specify invoking on the trailing edge of the timeout.
  10864. * @returns {Function} Returns the new debounced function.
  10865. * @example
  10866. *
  10867. * // Avoid costly calculations while the window size is in flux.
  10868. * jQuery(window).on('resize', _.debounce(calculateLayout, 150));
  10869. *
  10870. * // Invoke `sendMail` when clicked, debouncing subsequent calls.
  10871. * jQuery(element).on('click', _.debounce(sendMail, 300, {
  10872. * 'leading': true,
  10873. * 'trailing': false
  10874. * }));
  10875. *
  10876. * // Ensure `batchLog` is invoked once after 1 second of debounced calls.
  10877. * var debounced = _.debounce(batchLog, 250, { 'maxWait': 1000 });
  10878. * var source = new EventSource('/stream');
  10879. * jQuery(source).on('message', debounced);
  10880. *
  10881. * // Cancel the trailing debounced invocation.
  10882. * jQuery(window).on('popstate', debounced.cancel);
  10883. */
  10884. function debounce(func, wait, options) {
  10885. var lastArgs,
  10886. lastThis,
  10887. maxWait,
  10888. result,
  10889. timerId,
  10890. lastCallTime,
  10891. lastInvokeTime = 0,
  10892. leading = false,
  10893. maxing = false,
  10894. trailing = true;
  10895. if (typeof func != 'function') {
  10896. throw new TypeError(FUNC_ERROR_TEXT);
  10897. }
  10898. wait = toNumber(wait) || 0;
  10899. if (isObject(options)) {
  10900. leading = !!options.leading;
  10901. maxing = 'maxWait' in options;
  10902. maxWait = maxing ? nativeMax(toNumber(options.maxWait) || 0, wait) : maxWait;
  10903. trailing = 'trailing' in options ? !!options.trailing : trailing;
  10904. }
  10905. function invokeFunc(time) {
  10906. var args = lastArgs,
  10907. thisArg = lastThis;
  10908. lastArgs = lastThis = undefined;
  10909. lastInvokeTime = time;
  10910. result = func.apply(thisArg, args);
  10911. return result;
  10912. }
  10913. function leadingEdge(time) {
  10914. // Reset any `maxWait` timer.
  10915. lastInvokeTime = time;
  10916. // Start the timer for the trailing edge.
  10917. timerId = setTimeout(timerExpired, wait);
  10918. // Invoke the leading edge.
  10919. return leading ? invokeFunc(time) : result;
  10920. }
  10921. function remainingWait(time) {
  10922. var timeSinceLastCall = time - lastCallTime,
  10923. timeSinceLastInvoke = time - lastInvokeTime,
  10924. timeWaiting = wait - timeSinceLastCall;
  10925. return maxing
  10926. ? nativeMin(timeWaiting, maxWait - timeSinceLastInvoke)
  10927. : timeWaiting;
  10928. }
  10929. function shouldInvoke(time) {
  10930. var timeSinceLastCall = time - lastCallTime,
  10931. timeSinceLastInvoke = time - lastInvokeTime;
  10932. // Either this is the first call, activity has stopped and we're at the
  10933. // trailing edge, the system time has gone backwards and we're treating
  10934. // it as the trailing edge, or we've hit the `maxWait` limit.
  10935. return (lastCallTime === undefined || (timeSinceLastCall >= wait) ||
  10936. (timeSinceLastCall < 0) || (maxing && timeSinceLastInvoke >= maxWait));
  10937. }
  10938. function timerExpired() {
  10939. var time = now();
  10940. if (shouldInvoke(time)) {
  10941. return trailingEdge(time);
  10942. }
  10943. // Restart the timer.
  10944. timerId = setTimeout(timerExpired, remainingWait(time));
  10945. }
  10946. function trailingEdge(time) {
  10947. timerId = undefined;
  10948. // Only invoke if we have `lastArgs` which means `func` has been
  10949. // debounced at least once.
  10950. if (trailing && lastArgs) {
  10951. return invokeFunc(time);
  10952. }
  10953. lastArgs = lastThis = undefined;
  10954. return result;
  10955. }
  10956. function cancel() {
  10957. if (timerId !== undefined) {
  10958. clearTimeout(timerId);
  10959. }
  10960. lastInvokeTime = 0;
  10961. lastArgs = lastCallTime = lastThis = timerId = undefined;
  10962. }
  10963. function flush() {
  10964. return timerId === undefined ? result : trailingEdge(now());
  10965. }
  10966. function debounced() {
  10967. var time = now(),
  10968. isInvoking = shouldInvoke(time);
  10969. lastArgs = arguments;
  10970. lastThis = this;
  10971. lastCallTime = time;
  10972. if (isInvoking) {
  10973. if (timerId === undefined) {
  10974. return leadingEdge(lastCallTime);
  10975. }
  10976. if (maxing) {
  10977. // Handle invocations in a tight loop.
  10978. clearTimeout(timerId);
  10979. timerId = setTimeout(timerExpired, wait);
  10980. return invokeFunc(lastCallTime);
  10981. }
  10982. }
  10983. if (timerId === undefined) {
  10984. timerId = setTimeout(timerExpired, wait);
  10985. }
  10986. return result;
  10987. }
  10988. debounced.cancel = cancel;
  10989. debounced.flush = flush;
  10990. return debounced;
  10991. }
  10992. /**
  10993. * Defers invoking the `func` until the current call stack has cleared. Any
  10994. * additional arguments are provided to `func` when it's invoked.
  10995. *
  10996. * @static
  10997. * @memberOf _
  10998. * @since 0.1.0
  10999. * @category Function
  11000. * @param {Function} func The function to defer.
  11001. * @param {...*} [args] The arguments to invoke `func` with.
  11002. * @returns {number} Returns the timer id.
  11003. * @example
  11004. *
  11005. * _.defer(function(text) {
  11006. * console.log(text);
  11007. * }, 'deferred');
  11008. * // => Logs 'deferred' after one millisecond.
  11009. */
  11010. var defer = baseRest(function(func, args) {
  11011. return baseDelay(func, 1, args);
  11012. });
  11013. /**
  11014. * Invokes `func` after `wait` milliseconds. Any additional arguments are
  11015. * provided to `func` when it's invoked.
  11016. *
  11017. * @static
  11018. * @memberOf _
  11019. * @since 0.1.0
  11020. * @category Function
  11021. * @param {Function} func The function to delay.
  11022. * @param {number} wait The number of milliseconds to delay invocation.
  11023. * @param {...*} [args] The arguments to invoke `func` with.
  11024. * @returns {number} Returns the timer id.
  11025. * @example
  11026. *
  11027. * _.delay(function(text) {
  11028. * console.log(text);
  11029. * }, 1000, 'later');
  11030. * // => Logs 'later' after one second.
  11031. */
  11032. var delay = baseRest(function(func, wait, args) {
  11033. return baseDelay(func, toNumber(wait) || 0, args);
  11034. });
  11035. /**
  11036. * Creates a function that invokes `func` with arguments reversed.
  11037. *
  11038. * @static
  11039. * @memberOf _
  11040. * @since 4.0.0
  11041. * @category Function
  11042. * @param {Function} func The function to flip arguments for.
  11043. * @returns {Function} Returns the new flipped function.
  11044. * @example
  11045. *
  11046. * var flipped = _.flip(function() {
  11047. * return _.toArray(arguments);
  11048. * });
  11049. *
  11050. * flipped('a', 'b', 'c', 'd');
  11051. * // => ['d', 'c', 'b', 'a']
  11052. */
  11053. function flip(func) {
  11054. return createWrap(func, WRAP_FLIP_FLAG);
  11055. }
  11056. /**
  11057. * Creates a function that memoizes the result of `func`. If `resolver` is
  11058. * provided, it determines the cache key for storing the result based on the
  11059. * arguments provided to the memoized function. By default, the first argument
  11060. * provided to the memoized function is used as the map cache key. The `func`
  11061. * is invoked with the `this` binding of the memoized function.
  11062. *
  11063. * **Note:** The cache is exposed as the `cache` property on the memoized
  11064. * function. Its creation may be customized by replacing the `_.memoize.Cache`
  11065. * constructor with one whose instances implement the
  11066. * [`Map`](http://ecma-international.org/ecma-262/7.0/#sec-properties-of-the-map-prototype-object)
  11067. * method interface of `clear`, `delete`, `get`, `has`, and `set`.
  11068. *
  11069. * @static
  11070. * @memberOf _
  11071. * @since 0.1.0
  11072. * @category Function
  11073. * @param {Function} func The function to have its output memoized.
  11074. * @param {Function} [resolver] The function to resolve the cache key.
  11075. * @returns {Function} Returns the new memoized function.
  11076. * @example
  11077. *
  11078. * var object = { 'a': 1, 'b': 2 };
  11079. * var other = { 'c': 3, 'd': 4 };
  11080. *
  11081. * var values = _.memoize(_.values);
  11082. * values(object);
  11083. * // => [1, 2]
  11084. *
  11085. * values(other);
  11086. * // => [3, 4]
  11087. *
  11088. * object.a = 2;
  11089. * values(object);
  11090. * // => [1, 2]
  11091. *
  11092. * // Modify the result cache.
  11093. * values.cache.set(object, ['a', 'b']);
  11094. * values(object);
  11095. * // => ['a', 'b']
  11096. *
  11097. * // Replace `_.memoize.Cache`.
  11098. * _.memoize.Cache = WeakMap;
  11099. */
  11100. function memoize(func, resolver) {
  11101. if (typeof func != 'function' || (resolver != null && typeof resolver != 'function')) {
  11102. throw new TypeError(FUNC_ERROR_TEXT);
  11103. }
  11104. var memoized = function() {
  11105. var args = arguments,
  11106. key = resolver ? resolver.apply(this, args) : args[0],
  11107. cache = memoized.cache;
  11108. if (cache.has(key)) {
  11109. return cache.get(key);
  11110. }
  11111. var result = func.apply(this, args);
  11112. memoized.cache = cache.set(key, result) || cache;
  11113. return result;
  11114. };
  11115. memoized.cache = new (memoize.Cache || MapCache);
  11116. return memoized;
  11117. }
  11118. // Expose `MapCache`.
  11119. memoize.Cache = MapCache;
  11120. /**
  11121. * Creates a function that negates the result of the predicate `func`. The
  11122. * `func` predicate is invoked with the `this` binding and arguments of the
  11123. * created function.
  11124. *
  11125. * @static
  11126. * @memberOf _
  11127. * @since 3.0.0
  11128. * @category Function
  11129. * @param {Function} predicate The predicate to negate.
  11130. * @returns {Function} Returns the new negated function.
  11131. * @example
  11132. *
  11133. * function isEven(n) {
  11134. * return n % 2 == 0;
  11135. * }
  11136. *
  11137. * _.filter([1, 2, 3, 4, 5, 6], _.negate(isEven));
  11138. * // => [1, 3, 5]
  11139. */
  11140. function negate(predicate) {
  11141. if (typeof predicate != 'function') {
  11142. throw new TypeError(FUNC_ERROR_TEXT);
  11143. }
  11144. return function() {
  11145. var args = arguments;
  11146. switch (args.length) {
  11147. case 0: return !predicate.call(this);
  11148. case 1: return !predicate.call(this, args[0]);
  11149. case 2: return !predicate.call(this, args[0], args[1]);
  11150. case 3: return !predicate.call(this, args[0], args[1], args[2]);
  11151. }
  11152. return !predicate.apply(this, args);
  11153. };
  11154. }
  11155. /**
  11156. * Creates a function that is restricted to invoking `func` once. Repeat calls
  11157. * to the function return the value of the first invocation. The `func` is
  11158. * invoked with the `this` binding and arguments of the created function.
  11159. *
  11160. * @static
  11161. * @memberOf _
  11162. * @since 0.1.0
  11163. * @category Function
  11164. * @param {Function} func The function to restrict.
  11165. * @returns {Function} Returns the new restricted function.
  11166. * @example
  11167. *
  11168. * var initialize = _.once(createApplication);
  11169. * initialize();
  11170. * initialize();
  11171. * // => `createApplication` is invoked once
  11172. */
  11173. function once(func) {
  11174. return before(2, func);
  11175. }
  11176. /**
  11177. * Creates a function that invokes `func` with its arguments transformed.
  11178. *
  11179. * @static
  11180. * @since 4.0.0
  11181. * @memberOf _
  11182. * @category Function
  11183. * @param {Function} func The function to wrap.
  11184. * @param {...(Function|Function[])} [transforms=[_.identity]]
  11185. * The argument transforms.
  11186. * @returns {Function} Returns the new function.
  11187. * @example
  11188. *
  11189. * function doubled(n) {
  11190. * return n * 2;
  11191. * }
  11192. *
  11193. * function square(n) {
  11194. * return n * n;
  11195. * }
  11196. *
  11197. * var func = _.overArgs(function(x, y) {
  11198. * return [x, y];
  11199. * }, [square, doubled]);
  11200. *
  11201. * func(9, 3);
  11202. * // => [81, 6]
  11203. *
  11204. * func(10, 5);
  11205. * // => [100, 10]
  11206. */
  11207. var overArgs = castRest(function(func, transforms) {
  11208. transforms = (transforms.length == 1 && isArray(transforms[0]))
  11209. ? arrayMap(transforms[0], baseUnary(getIteratee()))
  11210. : arrayMap(baseFlatten(transforms, 1), baseUnary(getIteratee()));
  11211. var funcsLength = transforms.length;
  11212. return baseRest(function(args) {
  11213. var index = -1,
  11214. length = nativeMin(args.length, funcsLength);
  11215. while (++index < length) {
  11216. args[index] = transforms[index].call(this, args[index]);
  11217. }
  11218. return apply(func, this, args);
  11219. });
  11220. });
  11221. /**
  11222. * Creates a function that invokes `func` with `partials` prepended to the
  11223. * arguments it receives. This method is like `_.bind` except it does **not**
  11224. * alter the `this` binding.
  11225. *
  11226. * The `_.partial.placeholder` value, which defaults to `_` in monolithic
  11227. * builds, may be used as a placeholder for partially applied arguments.
  11228. *
  11229. * **Note:** This method doesn't set the "length" property of partially
  11230. * applied functions.
  11231. *
  11232. * @static
  11233. * @memberOf _
  11234. * @since 0.2.0
  11235. * @category Function
  11236. * @param {Function} func The function to partially apply arguments to.
  11237. * @param {...*} [partials] The arguments to be partially applied.
  11238. * @returns {Function} Returns the new partially applied function.
  11239. * @example
  11240. *
  11241. * function greet(greeting, name) {
  11242. * return greeting + ' ' + name;
  11243. * }
  11244. *
  11245. * var sayHelloTo = _.partial(greet, 'hello');
  11246. * sayHelloTo('fred');
  11247. * // => 'hello fred'
  11248. *
  11249. * // Partially applied with placeholders.
  11250. * var greetFred = _.partial(greet, _, 'fred');
  11251. * greetFred('hi');
  11252. * // => 'hi fred'
  11253. */
  11254. var partial = baseRest(function(func, partials) {
  11255. var holders = replaceHolders(partials, getHolder(partial));
  11256. return createWrap(func, WRAP_PARTIAL_FLAG, undefined, partials, holders);
  11257. });
  11258. /**
  11259. * This method is like `_.partial` except that partially applied arguments
  11260. * are appended to the arguments it receives.
  11261. *
  11262. * The `_.partialRight.placeholder` value, which defaults to `_` in monolithic
  11263. * builds, may be used as a placeholder for partially applied arguments.
  11264. *
  11265. * **Note:** This method doesn't set the "length" property of partially
  11266. * applied functions.
  11267. *
  11268. * @static
  11269. * @memberOf _
  11270. * @since 1.0.0
  11271. * @category Function
  11272. * @param {Function} func The function to partially apply arguments to.
  11273. * @param {...*} [partials] The arguments to be partially applied.
  11274. * @returns {Function} Returns the new partially applied function.
  11275. * @example
  11276. *
  11277. * function greet(greeting, name) {
  11278. * return greeting + ' ' + name;
  11279. * }
  11280. *
  11281. * var greetFred = _.partialRight(greet, 'fred');
  11282. * greetFred('hi');
  11283. * // => 'hi fred'
  11284. *
  11285. * // Partially applied with placeholders.
  11286. * var sayHelloTo = _.partialRight(greet, 'hello', _);
  11287. * sayHelloTo('fred');
  11288. * // => 'hello fred'
  11289. */
  11290. var partialRight = baseRest(function(func, partials) {
  11291. var holders = replaceHolders(partials, getHolder(partialRight));
  11292. return createWrap(func, WRAP_PARTIAL_RIGHT_FLAG, undefined, partials, holders);
  11293. });
  11294. /**
  11295. * Creates a function that invokes `func` with arguments arranged according
  11296. * to the specified `indexes` where the argument value at the first index is
  11297. * provided as the first argument, the argument value at the second index is
  11298. * provided as the second argument, and so on.
  11299. *
  11300. * @static
  11301. * @memberOf _
  11302. * @since 3.0.0
  11303. * @category Function
  11304. * @param {Function} func The function to rearrange arguments for.
  11305. * @param {...(number|number[])} indexes The arranged argument indexes.
  11306. * @returns {Function} Returns the new function.
  11307. * @example
  11308. *
  11309. * var rearged = _.rearg(function(a, b, c) {
  11310. * return [a, b, c];
  11311. * }, [2, 0, 1]);
  11312. *
  11313. * rearged('b', 'c', 'a')
  11314. * // => ['a', 'b', 'c']
  11315. */
  11316. var rearg = flatRest(function(func, indexes) {
  11317. return createWrap(func, WRAP_REARG_FLAG, undefined, undefined, undefined, indexes);
  11318. });
  11319. /**
  11320. * Creates a function that invokes `func` with the `this` binding of the
  11321. * created function and arguments from `start` and beyond provided as
  11322. * an array.
  11323. *
  11324. * **Note:** This method is based on the
  11325. * [rest parameter](https://mdn.io/rest_parameters).
  11326. *
  11327. * @static
  11328. * @memberOf _
  11329. * @since 4.0.0
  11330. * @category Function
  11331. * @param {Function} func The function to apply a rest parameter to.
  11332. * @param {number} [start=func.length-1] The start position of the rest parameter.
  11333. * @returns {Function} Returns the new function.
  11334. * @example
  11335. *
  11336. * var say = _.rest(function(what, names) {
  11337. * return what + ' ' + _.initial(names).join(', ') +
  11338. * (_.size(names) > 1 ? ', & ' : '') + _.last(names);
  11339. * });
  11340. *
  11341. * say('hello', 'fred', 'barney', 'pebbles');
  11342. * // => 'hello fred, barney, & pebbles'
  11343. */
  11344. function rest(func, start) {
  11345. if (typeof func != 'function') {
  11346. throw new TypeError(FUNC_ERROR_TEXT);
  11347. }
  11348. start = start === undefined ? start : toInteger(start);
  11349. return baseRest(func, start);
  11350. }
  11351. /**
  11352. * Creates a function that invokes `func` with the `this` binding of the
  11353. * create function and an array of arguments much like
  11354. * [`Function#apply`](http://www.ecma-international.org/ecma-262/7.0/#sec-function.prototype.apply).
  11355. *
  11356. * **Note:** This method is based on the
  11357. * [spread operator](https://mdn.io/spread_operator).
  11358. *
  11359. * @static
  11360. * @memberOf _
  11361. * @since 3.2.0
  11362. * @category Function
  11363. * @param {Function} func The function to spread arguments over.
  11364. * @param {number} [start=0] The start position of the spread.
  11365. * @returns {Function} Returns the new function.
  11366. * @example
  11367. *
  11368. * var say = _.spread(function(who, what) {
  11369. * return who + ' says ' + what;
  11370. * });
  11371. *
  11372. * say(['fred', 'hello']);
  11373. * // => 'fred says hello'
  11374. *
  11375. * var numbers = Promise.all([
  11376. * Promise.resolve(40),
  11377. * Promise.resolve(36)
  11378. * ]);
  11379. *
  11380. * numbers.then(_.spread(function(x, y) {
  11381. * return x + y;
  11382. * }));
  11383. * // => a Promise of 76
  11384. */
  11385. function spread(func, start) {
  11386. if (typeof func != 'function') {
  11387. throw new TypeError(FUNC_ERROR_TEXT);
  11388. }
  11389. start = start == null ? 0 : nativeMax(toInteger(start), 0);
  11390. return baseRest(function(args) {
  11391. var array = args[start],
  11392. otherArgs = castSlice(args, 0, start);
  11393. if (array) {
  11394. arrayPush(otherArgs, array);
  11395. }
  11396. return apply(func, this, otherArgs);
  11397. });
  11398. }
  11399. /**
  11400. * Creates a throttled function that only invokes `func` at most once per
  11401. * every `wait` milliseconds. The throttled function comes with a `cancel`
  11402. * method to cancel delayed `func` invocations and a `flush` method to
  11403. * immediately invoke them. Provide `options` to indicate whether `func`
  11404. * should be invoked on the leading and/or trailing edge of the `wait`
  11405. * timeout. The `func` is invoked with the last arguments provided to the
  11406. * throttled function. Subsequent calls to the throttled function return the
  11407. * result of the last `func` invocation.
  11408. *
  11409. * **Note:** If `leading` and `trailing` options are `true`, `func` is
  11410. * invoked on the trailing edge of the timeout only if the throttled function
  11411. * is invoked more than once during the `wait` timeout.
  11412. *
  11413. * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred
  11414. * until to the next tick, similar to `setTimeout` with a timeout of `0`.
  11415. *
  11416. * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/)
  11417. * for details over the differences between `_.throttle` and `_.debounce`.
  11418. *
  11419. * @static
  11420. * @memberOf _
  11421. * @since 0.1.0
  11422. * @category Function
  11423. * @param {Function} func The function to throttle.
  11424. * @param {number} [wait=0] The number of milliseconds to throttle invocations to.
  11425. * @param {Object} [options={}] The options object.
  11426. * @param {boolean} [options.leading=true]
  11427. * Specify invoking on the leading edge of the timeout.
  11428. * @param {boolean} [options.trailing=true]
  11429. * Specify invoking on the trailing edge of the timeout.
  11430. * @returns {Function} Returns the new throttled function.
  11431. * @example
  11432. *
  11433. * // Avoid excessively updating the position while scrolling.
  11434. * jQuery(window).on('scroll', _.throttle(updatePosition, 100));
  11435. *
  11436. * // Invoke `renewToken` when the click event is fired, but not more than once every 5 minutes.
  11437. * var throttled = _.throttle(renewToken, 300000, { 'trailing': false });
  11438. * jQuery(element).on('click', throttled);
  11439. *
  11440. * // Cancel the trailing throttled invocation.
  11441. * jQuery(window).on('popstate', throttled.cancel);
  11442. */
  11443. function throttle(func, wait, options) {
  11444. var leading = true,
  11445. trailing = true;
  11446. if (typeof func != 'function') {
  11447. throw new TypeError(FUNC_ERROR_TEXT);
  11448. }
  11449. if (isObject(options)) {
  11450. leading = 'leading' in options ? !!options.leading : leading;
  11451. trailing = 'trailing' in options ? !!options.trailing : trailing;
  11452. }
  11453. return debounce(func, wait, {
  11454. 'leading': leading,
  11455. 'maxWait': wait,
  11456. 'trailing': trailing
  11457. });
  11458. }
  11459. /**
  11460. * Creates a function that accepts up to one argument, ignoring any
  11461. * additional arguments.
  11462. *
  11463. * @static
  11464. * @memberOf _
  11465. * @since 4.0.0
  11466. * @category Function
  11467. * @param {Function} func The function to cap arguments for.
  11468. * @returns {Function} Returns the new capped function.
  11469. * @example
  11470. *
  11471. * _.map(['6', '8', '10'], _.unary(parseInt));
  11472. * // => [6, 8, 10]
  11473. */
  11474. function unary(func) {
  11475. return ary(func, 1);
  11476. }
  11477. /**
  11478. * Creates a function that provides `value` to `wrapper` as its first
  11479. * argument. Any additional arguments provided to the function are appended
  11480. * to those provided to the `wrapper`. The wrapper is invoked with the `this`
  11481. * binding of the created function.
  11482. *
  11483. * @static
  11484. * @memberOf _
  11485. * @since 0.1.0
  11486. * @category Function
  11487. * @param {*} value The value to wrap.
  11488. * @param {Function} [wrapper=identity] The wrapper function.
  11489. * @returns {Function} Returns the new function.
  11490. * @example
  11491. *
  11492. * var p = _.wrap(_.escape, function(func, text) {
  11493. * return '<p>' + func(text) + '</p>';
  11494. * });
  11495. *
  11496. * p('fred, barney, & pebbles');
  11497. * // => '<p>fred, barney, &amp; pebbles</p>'
  11498. */
  11499. function wrap(value, wrapper) {
  11500. return partial(castFunction(wrapper), value);
  11501. }
  11502. /*------------------------------------------------------------------------*/
  11503. /**
  11504. * Casts `value` as an array if it's not one.
  11505. *
  11506. * @static
  11507. * @memberOf _
  11508. * @since 4.4.0
  11509. * @category Lang
  11510. * @param {*} value The value to inspect.
  11511. * @returns {Array} Returns the cast array.
  11512. * @example
  11513. *
  11514. * _.castArray(1);
  11515. * // => [1]
  11516. *
  11517. * _.castArray({ 'a': 1 });
  11518. * // => [{ 'a': 1 }]
  11519. *
  11520. * _.castArray('abc');
  11521. * // => ['abc']
  11522. *
  11523. * _.castArray(null);
  11524. * // => [null]
  11525. *
  11526. * _.castArray(undefined);
  11527. * // => [undefined]
  11528. *
  11529. * _.castArray();
  11530. * // => []
  11531. *
  11532. * var array = [1, 2, 3];
  11533. * console.log(_.castArray(array) === array);
  11534. * // => true
  11535. */
  11536. function castArray() {
  11537. if (!arguments.length) {
  11538. return [];
  11539. }
  11540. var value = arguments[0];
  11541. return isArray(value) ? value : [value];
  11542. }
  11543. /**
  11544. * Creates a shallow clone of `value`.
  11545. *
  11546. * **Note:** This method is loosely based on the
  11547. * [structured clone algorithm](https://mdn.io/Structured_clone_algorithm)
  11548. * and supports cloning arrays, array buffers, booleans, date objects, maps,
  11549. * numbers, `Object` objects, regexes, sets, strings, symbols, and typed
  11550. * arrays. The own enumerable properties of `arguments` objects are cloned
  11551. * as plain objects. An empty object is returned for uncloneable values such
  11552. * as error objects, functions, DOM nodes, and WeakMaps.
  11553. *
  11554. * @static
  11555. * @memberOf _
  11556. * @since 0.1.0
  11557. * @category Lang
  11558. * @param {*} value The value to clone.
  11559. * @returns {*} Returns the cloned value.
  11560. * @see _.cloneDeep
  11561. * @example
  11562. *
  11563. * var objects = [{ 'a': 1 }, { 'b': 2 }];
  11564. *
  11565. * var shallow = _.clone(objects);
  11566. * console.log(shallow[0] === objects[0]);
  11567. * // => true
  11568. */
  11569. function clone(value) {
  11570. return baseClone(value, CLONE_SYMBOLS_FLAG);
  11571. }
  11572. /**
  11573. * This method is like `_.clone` except that it accepts `customizer` which
  11574. * is invoked to produce the cloned value. If `customizer` returns `undefined`,
  11575. * cloning is handled by the method instead. The `customizer` is invoked with
  11576. * up to four arguments; (value [, index|key, object, stack]).
  11577. *
  11578. * @static
  11579. * @memberOf _
  11580. * @since 4.0.0
  11581. * @category Lang
  11582. * @param {*} value The value to clone.
  11583. * @param {Function} [customizer] The function to customize cloning.
  11584. * @returns {*} Returns the cloned value.
  11585. * @see _.cloneDeepWith
  11586. * @example
  11587. *
  11588. * function customizer(value) {
  11589. * if (_.isElement(value)) {
  11590. * return value.cloneNode(false);
  11591. * }
  11592. * }
  11593. *
  11594. * var el = _.cloneWith(document.body, customizer);
  11595. *
  11596. * console.log(el === document.body);
  11597. * // => false
  11598. * console.log(el.nodeName);
  11599. * // => 'BODY'
  11600. * console.log(el.childNodes.length);
  11601. * // => 0
  11602. */
  11603. function cloneWith(value, customizer) {
  11604. customizer = typeof customizer == 'function' ? customizer : undefined;
  11605. return baseClone(value, CLONE_SYMBOLS_FLAG, customizer);
  11606. }
  11607. /**
  11608. * This method is like `_.clone` except that it recursively clones `value`.
  11609. *
  11610. * @static
  11611. * @memberOf _
  11612. * @since 1.0.0
  11613. * @category Lang
  11614. * @param {*} value The value to recursively clone.
  11615. * @returns {*} Returns the deep cloned value.
  11616. * @see _.clone
  11617. * @example
  11618. *
  11619. * var objects = [{ 'a': 1 }, { 'b': 2 }];
  11620. *
  11621. * var deep = _.cloneDeep(objects);
  11622. * console.log(deep[0] === objects[0]);
  11623. * // => false
  11624. */
  11625. function cloneDeep(value) {
  11626. return baseClone(value, CLONE_DEEP_FLAG | CLONE_SYMBOLS_FLAG);
  11627. }
  11628. /**
  11629. * This method is like `_.cloneWith` except that it recursively clones `value`.
  11630. *
  11631. * @static
  11632. * @memberOf _
  11633. * @since 4.0.0
  11634. * @category Lang
  11635. * @param {*} value The value to recursively clone.
  11636. * @param {Function} [customizer] The function to customize cloning.
  11637. * @returns {*} Returns the deep cloned value.
  11638. * @see _.cloneWith
  11639. * @example
  11640. *
  11641. * function customizer(value) {
  11642. * if (_.isElement(value)) {
  11643. * return value.cloneNode(true);
  11644. * }
  11645. * }
  11646. *
  11647. * var el = _.cloneDeepWith(document.body, customizer);
  11648. *
  11649. * console.log(el === document.body);
  11650. * // => false
  11651. * console.log(el.nodeName);
  11652. * // => 'BODY'
  11653. * console.log(el.childNodes.length);
  11654. * // => 20
  11655. */
  11656. function cloneDeepWith(value, customizer) {
  11657. customizer = typeof customizer == 'function' ? customizer : undefined;
  11658. return baseClone(value, CLONE_DEEP_FLAG | CLONE_SYMBOLS_FLAG, customizer);
  11659. }
  11660. /**
  11661. * Checks if `object` conforms to `source` by invoking the predicate
  11662. * properties of `source` with the corresponding property values of `object`.
  11663. *
  11664. * **Note:** This method is equivalent to `_.conforms` when `source` is
  11665. * partially applied.
  11666. *
  11667. * @static
  11668. * @memberOf _
  11669. * @since 4.14.0
  11670. * @category Lang
  11671. * @param {Object} object The object to inspect.
  11672. * @param {Object} source The object of property predicates to conform to.
  11673. * @returns {boolean} Returns `true` if `object` conforms, else `false`.
  11674. * @example
  11675. *
  11676. * var object = { 'a': 1, 'b': 2 };
  11677. *
  11678. * _.conformsTo(object, { 'b': function(n) { return n > 1; } });
  11679. * // => true
  11680. *
  11681. * _.conformsTo(object, { 'b': function(n) { return n > 2; } });
  11682. * // => false
  11683. */
  11684. function conformsTo(object, source) {
  11685. return source == null || baseConformsTo(object, source, keys(source));
  11686. }
  11687. /**
  11688. * Performs a
  11689. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  11690. * comparison between two values to determine if they are equivalent.
  11691. *
  11692. * @static
  11693. * @memberOf _
  11694. * @since 4.0.0
  11695. * @category Lang
  11696. * @param {*} value The value to compare.
  11697. * @param {*} other The other value to compare.
  11698. * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
  11699. * @example
  11700. *
  11701. * var object = { 'a': 1 };
  11702. * var other = { 'a': 1 };
  11703. *
  11704. * _.eq(object, object);
  11705. * // => true
  11706. *
  11707. * _.eq(object, other);
  11708. * // => false
  11709. *
  11710. * _.eq('a', 'a');
  11711. * // => true
  11712. *
  11713. * _.eq('a', Object('a'));
  11714. * // => false
  11715. *
  11716. * _.eq(NaN, NaN);
  11717. * // => true
  11718. */
  11719. function eq(value, other) {
  11720. return value === other || (value !== value && other !== other);
  11721. }
  11722. /**
  11723. * Checks if `value` is greater than `other`.
  11724. *
  11725. * @static
  11726. * @memberOf _
  11727. * @since 3.9.0
  11728. * @category Lang
  11729. * @param {*} value The value to compare.
  11730. * @param {*} other The other value to compare.
  11731. * @returns {boolean} Returns `true` if `value` is greater than `other`,
  11732. * else `false`.
  11733. * @see _.lt
  11734. * @example
  11735. *
  11736. * _.gt(3, 1);
  11737. * // => true
  11738. *
  11739. * _.gt(3, 3);
  11740. * // => false
  11741. *
  11742. * _.gt(1, 3);
  11743. * // => false
  11744. */
  11745. var gt = createRelationalOperation(baseGt);
  11746. /**
  11747. * Checks if `value` is greater than or equal to `other`.
  11748. *
  11749. * @static
  11750. * @memberOf _
  11751. * @since 3.9.0
  11752. * @category Lang
  11753. * @param {*} value The value to compare.
  11754. * @param {*} other The other value to compare.
  11755. * @returns {boolean} Returns `true` if `value` is greater than or equal to
  11756. * `other`, else `false`.
  11757. * @see _.lte
  11758. * @example
  11759. *
  11760. * _.gte(3, 1);
  11761. * // => true
  11762. *
  11763. * _.gte(3, 3);
  11764. * // => true
  11765. *
  11766. * _.gte(1, 3);
  11767. * // => false
  11768. */
  11769. var gte = createRelationalOperation(function(value, other) {
  11770. return value >= other;
  11771. });
  11772. /**
  11773. * Checks if `value` is likely an `arguments` object.
  11774. *
  11775. * @static
  11776. * @memberOf _
  11777. * @since 0.1.0
  11778. * @category Lang
  11779. * @param {*} value The value to check.
  11780. * @returns {boolean} Returns `true` if `value` is an `arguments` object,
  11781. * else `false`.
  11782. * @example
  11783. *
  11784. * _.isArguments(function() { return arguments; }());
  11785. * // => true
  11786. *
  11787. * _.isArguments([1, 2, 3]);
  11788. * // => false
  11789. */
  11790. var isArguments = baseIsArguments(function() { return arguments; }()) ? baseIsArguments : function(value) {
  11791. return isObjectLike(value) && hasOwnProperty.call(value, 'callee') &&
  11792. !propertyIsEnumerable.call(value, 'callee');
  11793. };
  11794. /**
  11795. * Checks if `value` is classified as an `Array` object.
  11796. *
  11797. * @static
  11798. * @memberOf _
  11799. * @since 0.1.0
  11800. * @category Lang
  11801. * @param {*} value The value to check.
  11802. * @returns {boolean} Returns `true` if `value` is an array, else `false`.
  11803. * @example
  11804. *
  11805. * _.isArray([1, 2, 3]);
  11806. * // => true
  11807. *
  11808. * _.isArray(document.body.children);
  11809. * // => false
  11810. *
  11811. * _.isArray('abc');
  11812. * // => false
  11813. *
  11814. * _.isArray(_.noop);
  11815. * // => false
  11816. */
  11817. var isArray = Array.isArray;
  11818. /**
  11819. * Checks if `value` is classified as an `ArrayBuffer` object.
  11820. *
  11821. * @static
  11822. * @memberOf _
  11823. * @since 4.3.0
  11824. * @category Lang
  11825. * @param {*} value The value to check.
  11826. * @returns {boolean} Returns `true` if `value` is an array buffer, else `false`.
  11827. * @example
  11828. *
  11829. * _.isArrayBuffer(new ArrayBuffer(2));
  11830. * // => true
  11831. *
  11832. * _.isArrayBuffer(new Array(2));
  11833. * // => false
  11834. */
  11835. var isArrayBuffer = nodeIsArrayBuffer ? baseUnary(nodeIsArrayBuffer) : baseIsArrayBuffer;
  11836. /**
  11837. * Checks if `value` is array-like. A value is considered array-like if it's
  11838. * not a function and has a `value.length` that's an integer greater than or
  11839. * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`.
  11840. *
  11841. * @static
  11842. * @memberOf _
  11843. * @since 4.0.0
  11844. * @category Lang
  11845. * @param {*} value The value to check.
  11846. * @returns {boolean} Returns `true` if `value` is array-like, else `false`.
  11847. * @example
  11848. *
  11849. * _.isArrayLike([1, 2, 3]);
  11850. * // => true
  11851. *
  11852. * _.isArrayLike(document.body.children);
  11853. * // => true
  11854. *
  11855. * _.isArrayLike('abc');
  11856. * // => true
  11857. *
  11858. * _.isArrayLike(_.noop);
  11859. * // => false
  11860. */
  11861. function isArrayLike(value) {
  11862. return value != null && isLength(value.length) && !isFunction(value);
  11863. }
  11864. /**
  11865. * This method is like `_.isArrayLike` except that it also checks if `value`
  11866. * is an object.
  11867. *
  11868. * @static
  11869. * @memberOf _
  11870. * @since 4.0.0
  11871. * @category Lang
  11872. * @param {*} value The value to check.
  11873. * @returns {boolean} Returns `true` if `value` is an array-like object,
  11874. * else `false`.
  11875. * @example
  11876. *
  11877. * _.isArrayLikeObject([1, 2, 3]);
  11878. * // => true
  11879. *
  11880. * _.isArrayLikeObject(document.body.children);
  11881. * // => true
  11882. *
  11883. * _.isArrayLikeObject('abc');
  11884. * // => false
  11885. *
  11886. * _.isArrayLikeObject(_.noop);
  11887. * // => false
  11888. */
  11889. function isArrayLikeObject(value) {
  11890. return isObjectLike(value) && isArrayLike(value);
  11891. }
  11892. /**
  11893. * Checks if `value` is classified as a boolean primitive or object.
  11894. *
  11895. * @static
  11896. * @memberOf _
  11897. * @since 0.1.0
  11898. * @category Lang
  11899. * @param {*} value The value to check.
  11900. * @returns {boolean} Returns `true` if `value` is a boolean, else `false`.
  11901. * @example
  11902. *
  11903. * _.isBoolean(false);
  11904. * // => true
  11905. *
  11906. * _.isBoolean(null);
  11907. * // => false
  11908. */
  11909. function isBoolean(value) {
  11910. return value === true || value === false ||
  11911. (isObjectLike(value) && baseGetTag(value) == boolTag);
  11912. }
  11913. /**
  11914. * Checks if `value` is a buffer.
  11915. *
  11916. * @static
  11917. * @memberOf _
  11918. * @since 4.3.0
  11919. * @category Lang
  11920. * @param {*} value The value to check.
  11921. * @returns {boolean} Returns `true` if `value` is a buffer, else `false`.
  11922. * @example
  11923. *
  11924. * _.isBuffer(new Buffer(2));
  11925. * // => true
  11926. *
  11927. * _.isBuffer(new Uint8Array(2));
  11928. * // => false
  11929. */
  11930. var isBuffer = nativeIsBuffer || stubFalse;
  11931. /**
  11932. * Checks if `value` is classified as a `Date` object.
  11933. *
  11934. * @static
  11935. * @memberOf _
  11936. * @since 0.1.0
  11937. * @category Lang
  11938. * @param {*} value The value to check.
  11939. * @returns {boolean} Returns `true` if `value` is a date object, else `false`.
  11940. * @example
  11941. *
  11942. * _.isDate(new Date);
  11943. * // => true
  11944. *
  11945. * _.isDate('Mon April 23 2012');
  11946. * // => false
  11947. */
  11948. var isDate = nodeIsDate ? baseUnary(nodeIsDate) : baseIsDate;
  11949. /**
  11950. * Checks if `value` is likely a DOM element.
  11951. *
  11952. * @static
  11953. * @memberOf _
  11954. * @since 0.1.0
  11955. * @category Lang
  11956. * @param {*} value The value to check.
  11957. * @returns {boolean} Returns `true` if `value` is a DOM element, else `false`.
  11958. * @example
  11959. *
  11960. * _.isElement(document.body);
  11961. * // => true
  11962. *
  11963. * _.isElement('<body>');
  11964. * // => false
  11965. */
  11966. function isElement(value) {
  11967. return isObjectLike(value) && value.nodeType === 1 && !isPlainObject(value);
  11968. }
  11969. /**
  11970. * Checks if `value` is an empty object, collection, map, or set.
  11971. *
  11972. * Objects are considered empty if they have no own enumerable string keyed
  11973. * properties.
  11974. *
  11975. * Array-like values such as `arguments` objects, arrays, buffers, strings, or
  11976. * jQuery-like collections are considered empty if they have a `length` of `0`.
  11977. * Similarly, maps and sets are considered empty if they have a `size` of `0`.
  11978. *
  11979. * @static
  11980. * @memberOf _
  11981. * @since 0.1.0
  11982. * @category Lang
  11983. * @param {*} value The value to check.
  11984. * @returns {boolean} Returns `true` if `value` is empty, else `false`.
  11985. * @example
  11986. *
  11987. * _.isEmpty(null);
  11988. * // => true
  11989. *
  11990. * _.isEmpty(true);
  11991. * // => true
  11992. *
  11993. * _.isEmpty(1);
  11994. * // => true
  11995. *
  11996. * _.isEmpty([1, 2, 3]);
  11997. * // => false
  11998. *
  11999. * _.isEmpty({ 'a': 1 });
  12000. * // => false
  12001. */
  12002. function isEmpty(value) {
  12003. if (value == null) {
  12004. return true;
  12005. }
  12006. if (isArrayLike(value) &&
  12007. (isArray(value) || typeof value == 'string' || typeof value.splice == 'function' ||
  12008. isBuffer(value) || isTypedArray(value) || isArguments(value))) {
  12009. return !value.length;
  12010. }
  12011. var tag = getTag(value);
  12012. if (tag == mapTag || tag == setTag) {
  12013. return !value.size;
  12014. }
  12015. if (isPrototype(value)) {
  12016. return !baseKeys(value).length;
  12017. }
  12018. for (var key in value) {
  12019. if (hasOwnProperty.call(value, key)) {
  12020. return false;
  12021. }
  12022. }
  12023. return true;
  12024. }
  12025. /**
  12026. * Performs a deep comparison between two values to determine if they are
  12027. * equivalent.
  12028. *
  12029. * **Note:** This method supports comparing arrays, array buffers, booleans,
  12030. * date objects, error objects, maps, numbers, `Object` objects, regexes,
  12031. * sets, strings, symbols, and typed arrays. `Object` objects are compared
  12032. * by their own, not inherited, enumerable properties. Functions and DOM
  12033. * nodes are compared by strict equality, i.e. `===`.
  12034. *
  12035. * @static
  12036. * @memberOf _
  12037. * @since 0.1.0
  12038. * @category Lang
  12039. * @param {*} value The value to compare.
  12040. * @param {*} other The other value to compare.
  12041. * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
  12042. * @example
  12043. *
  12044. * var object = { 'a': 1 };
  12045. * var other = { 'a': 1 };
  12046. *
  12047. * _.isEqual(object, other);
  12048. * // => true
  12049. *
  12050. * object === other;
  12051. * // => false
  12052. */
  12053. function isEqual(value, other) {
  12054. return baseIsEqual(value, other);
  12055. }
  12056. /**
  12057. * This method is like `_.isEqual` except that it accepts `customizer` which
  12058. * is invoked to compare values. If `customizer` returns `undefined`, comparisons
  12059. * are handled by the method instead. The `customizer` is invoked with up to
  12060. * six arguments: (objValue, othValue [, index|key, object, other, stack]).
  12061. *
  12062. * @static
  12063. * @memberOf _
  12064. * @since 4.0.0
  12065. * @category Lang
  12066. * @param {*} value The value to compare.
  12067. * @param {*} other The other value to compare.
  12068. * @param {Function} [customizer] The function to customize comparisons.
  12069. * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
  12070. * @example
  12071. *
  12072. * function isGreeting(value) {
  12073. * return /^h(?:i|ello)$/.test(value);
  12074. * }
  12075. *
  12076. * function customizer(objValue, othValue) {
  12077. * if (isGreeting(objValue) && isGreeting(othValue)) {
  12078. * return true;
  12079. * }
  12080. * }
  12081. *
  12082. * var array = ['hello', 'goodbye'];
  12083. * var other = ['hi', 'goodbye'];
  12084. *
  12085. * _.isEqualWith(array, other, customizer);
  12086. * // => true
  12087. */
  12088. function isEqualWith(value, other, customizer) {
  12089. customizer = typeof customizer == 'function' ? customizer : undefined;
  12090. var result = customizer ? customizer(value, other) : undefined;
  12091. return result === undefined ? baseIsEqual(value, other, undefined, customizer) : !!result;
  12092. }
  12093. /**
  12094. * Checks if `value` is an `Error`, `EvalError`, `RangeError`, `ReferenceError`,
  12095. * `SyntaxError`, `TypeError`, or `URIError` object.
  12096. *
  12097. * @static
  12098. * @memberOf _
  12099. * @since 3.0.0
  12100. * @category Lang
  12101. * @param {*} value The value to check.
  12102. * @returns {boolean} Returns `true` if `value` is an error object, else `false`.
  12103. * @example
  12104. *
  12105. * _.isError(new Error);
  12106. * // => true
  12107. *
  12108. * _.isError(Error);
  12109. * // => false
  12110. */
  12111. function isError(value) {
  12112. if (!isObjectLike(value)) {
  12113. return false;
  12114. }
  12115. var tag = baseGetTag(value);
  12116. return tag == errorTag || tag == domExcTag ||
  12117. (typeof value.message == 'string' && typeof value.name == 'string' && !isPlainObject(value));
  12118. }
  12119. /**
  12120. * Checks if `value` is a finite primitive number.
  12121. *
  12122. * **Note:** This method is based on
  12123. * [`Number.isFinite`](https://mdn.io/Number/isFinite).
  12124. *
  12125. * @static
  12126. * @memberOf _
  12127. * @since 0.1.0
  12128. * @category Lang
  12129. * @param {*} value The value to check.
  12130. * @returns {boolean} Returns `true` if `value` is a finite number, else `false`.
  12131. * @example
  12132. *
  12133. * _.isFinite(3);
  12134. * // => true
  12135. *
  12136. * _.isFinite(Number.MIN_VALUE);
  12137. * // => true
  12138. *
  12139. * _.isFinite(Infinity);
  12140. * // => false
  12141. *
  12142. * _.isFinite('3');
  12143. * // => false
  12144. */
  12145. function isFinite(value) {
  12146. return typeof value == 'number' && nativeIsFinite(value);
  12147. }
  12148. /**
  12149. * Checks if `value` is classified as a `Function` object.
  12150. *
  12151. * @static
  12152. * @memberOf _
  12153. * @since 0.1.0
  12154. * @category Lang
  12155. * @param {*} value The value to check.
  12156. * @returns {boolean} Returns `true` if `value` is a function, else `false`.
  12157. * @example
  12158. *
  12159. * _.isFunction(_);
  12160. * // => true
  12161. *
  12162. * _.isFunction(/abc/);
  12163. * // => false
  12164. */
  12165. function isFunction(value) {
  12166. if (!isObject(value)) {
  12167. return false;
  12168. }
  12169. // The use of `Object#toString` avoids issues with the `typeof` operator
  12170. // in Safari 9 which returns 'object' for typed arrays and other constructors.
  12171. var tag = baseGetTag(value);
  12172. return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag;
  12173. }
  12174. /**
  12175. * Checks if `value` is an integer.
  12176. *
  12177. * **Note:** This method is based on
  12178. * [`Number.isInteger`](https://mdn.io/Number/isInteger).
  12179. *
  12180. * @static
  12181. * @memberOf _
  12182. * @since 4.0.0
  12183. * @category Lang
  12184. * @param {*} value The value to check.
  12185. * @returns {boolean} Returns `true` if `value` is an integer, else `false`.
  12186. * @example
  12187. *
  12188. * _.isInteger(3);
  12189. * // => true
  12190. *
  12191. * _.isInteger(Number.MIN_VALUE);
  12192. * // => false
  12193. *
  12194. * _.isInteger(Infinity);
  12195. * // => false
  12196. *
  12197. * _.isInteger('3');
  12198. * // => false
  12199. */
  12200. function isInteger(value) {
  12201. return typeof value == 'number' && value == toInteger(value);
  12202. }
  12203. /**
  12204. * Checks if `value` is a valid array-like length.
  12205. *
  12206. * **Note:** This method is loosely based on
  12207. * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).
  12208. *
  12209. * @static
  12210. * @memberOf _
  12211. * @since 4.0.0
  12212. * @category Lang
  12213. * @param {*} value The value to check.
  12214. * @returns {boolean} Returns `true` if `value` is a valid length, else `false`.
  12215. * @example
  12216. *
  12217. * _.isLength(3);
  12218. * // => true
  12219. *
  12220. * _.isLength(Number.MIN_VALUE);
  12221. * // => false
  12222. *
  12223. * _.isLength(Infinity);
  12224. * // => false
  12225. *
  12226. * _.isLength('3');
  12227. * // => false
  12228. */
  12229. function isLength(value) {
  12230. return typeof value == 'number' &&
  12231. value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;
  12232. }
  12233. /**
  12234. * Checks if `value` is the
  12235. * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)
  12236. * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
  12237. *
  12238. * @static
  12239. * @memberOf _
  12240. * @since 0.1.0
  12241. * @category Lang
  12242. * @param {*} value The value to check.
  12243. * @returns {boolean} Returns `true` if `value` is an object, else `false`.
  12244. * @example
  12245. *
  12246. * _.isObject({});
  12247. * // => true
  12248. *
  12249. * _.isObject([1, 2, 3]);
  12250. * // => true
  12251. *
  12252. * _.isObject(_.noop);
  12253. * // => true
  12254. *
  12255. * _.isObject(null);
  12256. * // => false
  12257. */
  12258. function isObject(value) {
  12259. var type = typeof value;
  12260. return value != null && (type == 'object' || type == 'function');
  12261. }
  12262. /**
  12263. * Checks if `value` is object-like. A value is object-like if it's not `null`
  12264. * and has a `typeof` result of "object".
  12265. *
  12266. * @static
  12267. * @memberOf _
  12268. * @since 4.0.0
  12269. * @category Lang
  12270. * @param {*} value The value to check.
  12271. * @returns {boolean} Returns `true` if `value` is object-like, else `false`.
  12272. * @example
  12273. *
  12274. * _.isObjectLike({});
  12275. * // => true
  12276. *
  12277. * _.isObjectLike([1, 2, 3]);
  12278. * // => true
  12279. *
  12280. * _.isObjectLike(_.noop);
  12281. * // => false
  12282. *
  12283. * _.isObjectLike(null);
  12284. * // => false
  12285. */
  12286. function isObjectLike(value) {
  12287. return value != null && typeof value == 'object';
  12288. }
  12289. /**
  12290. * Checks if `value` is classified as a `Map` object.
  12291. *
  12292. * @static
  12293. * @memberOf _
  12294. * @since 4.3.0
  12295. * @category Lang
  12296. * @param {*} value The value to check.
  12297. * @returns {boolean} Returns `true` if `value` is a map, else `false`.
  12298. * @example
  12299. *
  12300. * _.isMap(new Map);
  12301. * // => true
  12302. *
  12303. * _.isMap(new WeakMap);
  12304. * // => false
  12305. */
  12306. var isMap = nodeIsMap ? baseUnary(nodeIsMap) : baseIsMap;
  12307. /**
  12308. * Performs a partial deep comparison between `object` and `source` to
  12309. * determine if `object` contains equivalent property values.
  12310. *
  12311. * **Note:** This method is equivalent to `_.matches` when `source` is
  12312. * partially applied.
  12313. *
  12314. * Partial comparisons will match empty array and empty object `source`
  12315. * values against any array or object value, respectively. See `_.isEqual`
  12316. * for a list of supported value comparisons.
  12317. *
  12318. * @static
  12319. * @memberOf _
  12320. * @since 3.0.0
  12321. * @category Lang
  12322. * @param {Object} object The object to inspect.
  12323. * @param {Object} source The object of property values to match.
  12324. * @returns {boolean} Returns `true` if `object` is a match, else `false`.
  12325. * @example
  12326. *
  12327. * var object = { 'a': 1, 'b': 2 };
  12328. *
  12329. * _.isMatch(object, { 'b': 2 });
  12330. * // => true
  12331. *
  12332. * _.isMatch(object, { 'b': 1 });
  12333. * // => false
  12334. */
  12335. function isMatch(object, source) {
  12336. return object === source || baseIsMatch(object, source, getMatchData(source));
  12337. }
  12338. /**
  12339. * This method is like `_.isMatch` except that it accepts `customizer` which
  12340. * is invoked to compare values. If `customizer` returns `undefined`, comparisons
  12341. * are handled by the method instead. The `customizer` is invoked with five
  12342. * arguments: (objValue, srcValue, index|key, object, source).
  12343. *
  12344. * @static
  12345. * @memberOf _
  12346. * @since 4.0.0
  12347. * @category Lang
  12348. * @param {Object} object The object to inspect.
  12349. * @param {Object} source The object of property values to match.
  12350. * @param {Function} [customizer] The function to customize comparisons.
  12351. * @returns {boolean} Returns `true` if `object` is a match, else `false`.
  12352. * @example
  12353. *
  12354. * function isGreeting(value) {
  12355. * return /^h(?:i|ello)$/.test(value);
  12356. * }
  12357. *
  12358. * function customizer(objValue, srcValue) {
  12359. * if (isGreeting(objValue) && isGreeting(srcValue)) {
  12360. * return true;
  12361. * }
  12362. * }
  12363. *
  12364. * var object = { 'greeting': 'hello' };
  12365. * var source = { 'greeting': 'hi' };
  12366. *
  12367. * _.isMatchWith(object, source, customizer);
  12368. * // => true
  12369. */
  12370. function isMatchWith(object, source, customizer) {
  12371. customizer = typeof customizer == 'function' ? customizer : undefined;
  12372. return baseIsMatch(object, source, getMatchData(source), customizer);
  12373. }
  12374. /**
  12375. * Checks if `value` is `NaN`.
  12376. *
  12377. * **Note:** This method is based on
  12378. * [`Number.isNaN`](https://mdn.io/Number/isNaN) and is not the same as
  12379. * global [`isNaN`](https://mdn.io/isNaN) which returns `true` for
  12380. * `undefined` and other non-number values.
  12381. *
  12382. * @static
  12383. * @memberOf _
  12384. * @since 0.1.0
  12385. * @category Lang
  12386. * @param {*} value The value to check.
  12387. * @returns {boolean} Returns `true` if `value` is `NaN`, else `false`.
  12388. * @example
  12389. *
  12390. * _.isNaN(NaN);
  12391. * // => true
  12392. *
  12393. * _.isNaN(new Number(NaN));
  12394. * // => true
  12395. *
  12396. * isNaN(undefined);
  12397. * // => true
  12398. *
  12399. * _.isNaN(undefined);
  12400. * // => false
  12401. */
  12402. function isNaN(value) {
  12403. // An `NaN` primitive is the only value that is not equal to itself.
  12404. // Perform the `toStringTag` check first to avoid errors with some
  12405. // ActiveX objects in IE.
  12406. return isNumber(value) && value != +value;
  12407. }
  12408. /**
  12409. * Checks if `value` is a pristine native function.
  12410. *
  12411. * **Note:** This method can't reliably detect native functions in the presence
  12412. * of the core-js package because core-js circumvents this kind of detection.
  12413. * Despite multiple requests, the core-js maintainer has made it clear: any
  12414. * attempt to fix the detection will be obstructed. As a result, we're left
  12415. * with little choice but to throw an error. Unfortunately, this also affects
  12416. * packages, like [babel-polyfill](https://www.npmjs.com/package/babel-polyfill),
  12417. * which rely on core-js.
  12418. *
  12419. * @static
  12420. * @memberOf _
  12421. * @since 3.0.0
  12422. * @category Lang
  12423. * @param {*} value The value to check.
  12424. * @returns {boolean} Returns `true` if `value` is a native function,
  12425. * else `false`.
  12426. * @example
  12427. *
  12428. * _.isNative(Array.prototype.push);
  12429. * // => true
  12430. *
  12431. * _.isNative(_);
  12432. * // => false
  12433. */
  12434. function isNative(value) {
  12435. if (isMaskable(value)) {
  12436. throw new Error(CORE_ERROR_TEXT);
  12437. }
  12438. return baseIsNative(value);
  12439. }
  12440. /**
  12441. * Checks if `value` is `null`.
  12442. *
  12443. * @static
  12444. * @memberOf _
  12445. * @since 0.1.0
  12446. * @category Lang
  12447. * @param {*} value The value to check.
  12448. * @returns {boolean} Returns `true` if `value` is `null`, else `false`.
  12449. * @example
  12450. *
  12451. * _.isNull(null);
  12452. * // => true
  12453. *
  12454. * _.isNull(void 0);
  12455. * // => false
  12456. */
  12457. function isNull(value) {
  12458. return value === null;
  12459. }
  12460. /**
  12461. * Checks if `value` is `null` or `undefined`.
  12462. *
  12463. * @static
  12464. * @memberOf _
  12465. * @since 4.0.0
  12466. * @category Lang
  12467. * @param {*} value The value to check.
  12468. * @returns {boolean} Returns `true` if `value` is nullish, else `false`.
  12469. * @example
  12470. *
  12471. * _.isNil(null);
  12472. * // => true
  12473. *
  12474. * _.isNil(void 0);
  12475. * // => true
  12476. *
  12477. * _.isNil(NaN);
  12478. * // => false
  12479. */
  12480. function isNil(value) {
  12481. return value == null;
  12482. }
  12483. /**
  12484. * Checks if `value` is classified as a `Number` primitive or object.
  12485. *
  12486. * **Note:** To exclude `Infinity`, `-Infinity`, and `NaN`, which are
  12487. * classified as numbers, use the `_.isFinite` method.
  12488. *
  12489. * @static
  12490. * @memberOf _
  12491. * @since 0.1.0
  12492. * @category Lang
  12493. * @param {*} value The value to check.
  12494. * @returns {boolean} Returns `true` if `value` is a number, else `false`.
  12495. * @example
  12496. *
  12497. * _.isNumber(3);
  12498. * // => true
  12499. *
  12500. * _.isNumber(Number.MIN_VALUE);
  12501. * // => true
  12502. *
  12503. * _.isNumber(Infinity);
  12504. * // => true
  12505. *
  12506. * _.isNumber('3');
  12507. * // => false
  12508. */
  12509. function isNumber(value) {
  12510. return typeof value == 'number' ||
  12511. (isObjectLike(value) && baseGetTag(value) == numberTag);
  12512. }
  12513. /**
  12514. * Checks if `value` is a plain object, that is, an object created by the
  12515. * `Object` constructor or one with a `[[Prototype]]` of `null`.
  12516. *
  12517. * @static
  12518. * @memberOf _
  12519. * @since 0.8.0
  12520. * @category Lang
  12521. * @param {*} value The value to check.
  12522. * @returns {boolean} Returns `true` if `value` is a plain object, else `false`.
  12523. * @example
  12524. *
  12525. * function Foo() {
  12526. * this.a = 1;
  12527. * }
  12528. *
  12529. * _.isPlainObject(new Foo);
  12530. * // => false
  12531. *
  12532. * _.isPlainObject([1, 2, 3]);
  12533. * // => false
  12534. *
  12535. * _.isPlainObject({ 'x': 0, 'y': 0 });
  12536. * // => true
  12537. *
  12538. * _.isPlainObject(Object.create(null));
  12539. * // => true
  12540. */
  12541. function isPlainObject(value) {
  12542. if (!isObjectLike(value) || baseGetTag(value) != objectTag) {
  12543. return false;
  12544. }
  12545. var proto = getPrototype(value);
  12546. if (proto === null) {
  12547. return true;
  12548. }
  12549. var Ctor = hasOwnProperty.call(proto, 'constructor') && proto.constructor;
  12550. return typeof Ctor == 'function' && Ctor instanceof Ctor &&
  12551. funcToString.call(Ctor) == objectCtorString;
  12552. }
  12553. /**
  12554. * Checks if `value` is classified as a `RegExp` object.
  12555. *
  12556. * @static
  12557. * @memberOf _
  12558. * @since 0.1.0
  12559. * @category Lang
  12560. * @param {*} value The value to check.
  12561. * @returns {boolean} Returns `true` if `value` is a regexp, else `false`.
  12562. * @example
  12563. *
  12564. * _.isRegExp(/abc/);
  12565. * // => true
  12566. *
  12567. * _.isRegExp('/abc/');
  12568. * // => false
  12569. */
  12570. var isRegExp = nodeIsRegExp ? baseUnary(nodeIsRegExp) : baseIsRegExp;
  12571. /**
  12572. * Checks if `value` is a safe integer. An integer is safe if it's an IEEE-754
  12573. * double precision number which isn't the result of a rounded unsafe integer.
  12574. *
  12575. * **Note:** This method is based on
  12576. * [`Number.isSafeInteger`](https://mdn.io/Number/isSafeInteger).
  12577. *
  12578. * @static
  12579. * @memberOf _
  12580. * @since 4.0.0
  12581. * @category Lang
  12582. * @param {*} value The value to check.
  12583. * @returns {boolean} Returns `true` if `value` is a safe integer, else `false`.
  12584. * @example
  12585. *
  12586. * _.isSafeInteger(3);
  12587. * // => true
  12588. *
  12589. * _.isSafeInteger(Number.MIN_VALUE);
  12590. * // => false
  12591. *
  12592. * _.isSafeInteger(Infinity);
  12593. * // => false
  12594. *
  12595. * _.isSafeInteger('3');
  12596. * // => false
  12597. */
  12598. function isSafeInteger(value) {
  12599. return isInteger(value) && value >= -MAX_SAFE_INTEGER && value <= MAX_SAFE_INTEGER;
  12600. }
  12601. /**
  12602. * Checks if `value` is classified as a `Set` object.
  12603. *
  12604. * @static
  12605. * @memberOf _
  12606. * @since 4.3.0
  12607. * @category Lang
  12608. * @param {*} value The value to check.
  12609. * @returns {boolean} Returns `true` if `value` is a set, else `false`.
  12610. * @example
  12611. *
  12612. * _.isSet(new Set);
  12613. * // => true
  12614. *
  12615. * _.isSet(new WeakSet);
  12616. * // => false
  12617. */
  12618. var isSet = nodeIsSet ? baseUnary(nodeIsSet) : baseIsSet;
  12619. /**
  12620. * Checks if `value` is classified as a `String` primitive or object.
  12621. *
  12622. * @static
  12623. * @since 0.1.0
  12624. * @memberOf _
  12625. * @category Lang
  12626. * @param {*} value The value to check.
  12627. * @returns {boolean} Returns `true` if `value` is a string, else `false`.
  12628. * @example
  12629. *
  12630. * _.isString('abc');
  12631. * // => true
  12632. *
  12633. * _.isString(1);
  12634. * // => false
  12635. */
  12636. function isString(value) {
  12637. return typeof value == 'string' ||
  12638. (!isArray(value) && isObjectLike(value) && baseGetTag(value) == stringTag);
  12639. }
  12640. /**
  12641. * Checks if `value` is classified as a `Symbol` primitive or object.
  12642. *
  12643. * @static
  12644. * @memberOf _
  12645. * @since 4.0.0
  12646. * @category Lang
  12647. * @param {*} value The value to check.
  12648. * @returns {boolean} Returns `true` if `value` is a symbol, else `false`.
  12649. * @example
  12650. *
  12651. * _.isSymbol(Symbol.iterator);
  12652. * // => true
  12653. *
  12654. * _.isSymbol('abc');
  12655. * // => false
  12656. */
  12657. function isSymbol(value) {
  12658. return typeof value == 'symbol' ||
  12659. (isObjectLike(value) && baseGetTag(value) == symbolTag);
  12660. }
  12661. /**
  12662. * Checks if `value` is classified as a typed array.
  12663. *
  12664. * @static
  12665. * @memberOf _
  12666. * @since 3.0.0
  12667. * @category Lang
  12668. * @param {*} value The value to check.
  12669. * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.
  12670. * @example
  12671. *
  12672. * _.isTypedArray(new Uint8Array);
  12673. * // => true
  12674. *
  12675. * _.isTypedArray([]);
  12676. * // => false
  12677. */
  12678. var isTypedArray = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray;
  12679. /**
  12680. * Checks if `value` is `undefined`.
  12681. *
  12682. * @static
  12683. * @since 0.1.0
  12684. * @memberOf _
  12685. * @category Lang
  12686. * @param {*} value The value to check.
  12687. * @returns {boolean} Returns `true` if `value` is `undefined`, else `false`.
  12688. * @example
  12689. *
  12690. * _.isUndefined(void 0);
  12691. * // => true
  12692. *
  12693. * _.isUndefined(null);
  12694. * // => false
  12695. */
  12696. function isUndefined(value) {
  12697. return value === undefined;
  12698. }
  12699. /**
  12700. * Checks if `value` is classified as a `WeakMap` object.
  12701. *
  12702. * @static
  12703. * @memberOf _
  12704. * @since 4.3.0
  12705. * @category Lang
  12706. * @param {*} value The value to check.
  12707. * @returns {boolean} Returns `true` if `value` is a weak map, else `false`.
  12708. * @example
  12709. *
  12710. * _.isWeakMap(new WeakMap);
  12711. * // => true
  12712. *
  12713. * _.isWeakMap(new Map);
  12714. * // => false
  12715. */
  12716. function isWeakMap(value) {
  12717. return isObjectLike(value) && getTag(value) == weakMapTag;
  12718. }
  12719. /**
  12720. * Checks if `value` is classified as a `WeakSet` object.
  12721. *
  12722. * @static
  12723. * @memberOf _
  12724. * @since 4.3.0
  12725. * @category Lang
  12726. * @param {*} value The value to check.
  12727. * @returns {boolean} Returns `true` if `value` is a weak set, else `false`.
  12728. * @example
  12729. *
  12730. * _.isWeakSet(new WeakSet);
  12731. * // => true
  12732. *
  12733. * _.isWeakSet(new Set);
  12734. * // => false
  12735. */
  12736. function isWeakSet(value) {
  12737. return isObjectLike(value) && baseGetTag(value) == weakSetTag;
  12738. }
  12739. /**
  12740. * Checks if `value` is less than `other`.
  12741. *
  12742. * @static
  12743. * @memberOf _
  12744. * @since 3.9.0
  12745. * @category Lang
  12746. * @param {*} value The value to compare.
  12747. * @param {*} other The other value to compare.
  12748. * @returns {boolean} Returns `true` if `value` is less than `other`,
  12749. * else `false`.
  12750. * @see _.gt
  12751. * @example
  12752. *
  12753. * _.lt(1, 3);
  12754. * // => true
  12755. *
  12756. * _.lt(3, 3);
  12757. * // => false
  12758. *
  12759. * _.lt(3, 1);
  12760. * // => false
  12761. */
  12762. var lt = createRelationalOperation(baseLt);
  12763. /**
  12764. * Checks if `value` is less than or equal to `other`.
  12765. *
  12766. * @static
  12767. * @memberOf _
  12768. * @since 3.9.0
  12769. * @category Lang
  12770. * @param {*} value The value to compare.
  12771. * @param {*} other The other value to compare.
  12772. * @returns {boolean} Returns `true` if `value` is less than or equal to
  12773. * `other`, else `false`.
  12774. * @see _.gte
  12775. * @example
  12776. *
  12777. * _.lte(1, 3);
  12778. * // => true
  12779. *
  12780. * _.lte(3, 3);
  12781. * // => true
  12782. *
  12783. * _.lte(3, 1);
  12784. * // => false
  12785. */
  12786. var lte = createRelationalOperation(function(value, other) {
  12787. return value <= other;
  12788. });
  12789. /**
  12790. * Converts `value` to an array.
  12791. *
  12792. * @static
  12793. * @since 0.1.0
  12794. * @memberOf _
  12795. * @category Lang
  12796. * @param {*} value The value to convert.
  12797. * @returns {Array} Returns the converted array.
  12798. * @example
  12799. *
  12800. * _.toArray({ 'a': 1, 'b': 2 });
  12801. * // => [1, 2]
  12802. *
  12803. * _.toArray('abc');
  12804. * // => ['a', 'b', 'c']
  12805. *
  12806. * _.toArray(1);
  12807. * // => []
  12808. *
  12809. * _.toArray(null);
  12810. * // => []
  12811. */
  12812. function toArray(value) {
  12813. if (!value) {
  12814. return [];
  12815. }
  12816. if (isArrayLike(value)) {
  12817. return isString(value) ? stringToArray(value) : copyArray(value);
  12818. }
  12819. if (symIterator && value[symIterator]) {
  12820. return iteratorToArray(value[symIterator]());
  12821. }
  12822. var tag = getTag(value),
  12823. func = tag == mapTag ? mapToArray : (tag == setTag ? setToArray : values);
  12824. return func(value);
  12825. }
  12826. /**
  12827. * Converts `value` to a finite number.
  12828. *
  12829. * @static
  12830. * @memberOf _
  12831. * @since 4.12.0
  12832. * @category Lang
  12833. * @param {*} value The value to convert.
  12834. * @returns {number} Returns the converted number.
  12835. * @example
  12836. *
  12837. * _.toFinite(3.2);
  12838. * // => 3.2
  12839. *
  12840. * _.toFinite(Number.MIN_VALUE);
  12841. * // => 5e-324
  12842. *
  12843. * _.toFinite(Infinity);
  12844. * // => 1.7976931348623157e+308
  12845. *
  12846. * _.toFinite('3.2');
  12847. * // => 3.2
  12848. */
  12849. function toFinite(value) {
  12850. if (!value) {
  12851. return value === 0 ? value : 0;
  12852. }
  12853. value = toNumber(value);
  12854. if (value === INFINITY || value === -INFINITY) {
  12855. var sign = (value < 0 ? -1 : 1);
  12856. return sign * MAX_INTEGER;
  12857. }
  12858. return value === value ? value : 0;
  12859. }
  12860. /**
  12861. * Converts `value` to an integer.
  12862. *
  12863. * **Note:** This method is loosely based on
  12864. * [`ToInteger`](http://www.ecma-international.org/ecma-262/7.0/#sec-tointeger).
  12865. *
  12866. * @static
  12867. * @memberOf _
  12868. * @since 4.0.0
  12869. * @category Lang
  12870. * @param {*} value The value to convert.
  12871. * @returns {number} Returns the converted integer.
  12872. * @example
  12873. *
  12874. * _.toInteger(3.2);
  12875. * // => 3
  12876. *
  12877. * _.toInteger(Number.MIN_VALUE);
  12878. * // => 0
  12879. *
  12880. * _.toInteger(Infinity);
  12881. * // => 1.7976931348623157e+308
  12882. *
  12883. * _.toInteger('3.2');
  12884. * // => 3
  12885. */
  12886. function toInteger(value) {
  12887. var result = toFinite(value),
  12888. remainder = result % 1;
  12889. return result === result ? (remainder ? result - remainder : result) : 0;
  12890. }
  12891. /**
  12892. * Converts `value` to an integer suitable for use as the length of an
  12893. * array-like object.
  12894. *
  12895. * **Note:** This method is based on
  12896. * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).
  12897. *
  12898. * @static
  12899. * @memberOf _
  12900. * @since 4.0.0
  12901. * @category Lang
  12902. * @param {*} value The value to convert.
  12903. * @returns {number} Returns the converted integer.
  12904. * @example
  12905. *
  12906. * _.toLength(3.2);
  12907. * // => 3
  12908. *
  12909. * _.toLength(Number.MIN_VALUE);
  12910. * // => 0
  12911. *
  12912. * _.toLength(Infinity);
  12913. * // => 4294967295
  12914. *
  12915. * _.toLength('3.2');
  12916. * // => 3
  12917. */
  12918. function toLength(value) {
  12919. return value ? baseClamp(toInteger(value), 0, MAX_ARRAY_LENGTH) : 0;
  12920. }
  12921. /**
  12922. * Converts `value` to a number.
  12923. *
  12924. * @static
  12925. * @memberOf _
  12926. * @since 4.0.0
  12927. * @category Lang
  12928. * @param {*} value The value to process.
  12929. * @returns {number} Returns the number.
  12930. * @example
  12931. *
  12932. * _.toNumber(3.2);
  12933. * // => 3.2
  12934. *
  12935. * _.toNumber(Number.MIN_VALUE);
  12936. * // => 5e-324
  12937. *
  12938. * _.toNumber(Infinity);
  12939. * // => Infinity
  12940. *
  12941. * _.toNumber('3.2');
  12942. * // => 3.2
  12943. */
  12944. function toNumber(value) {
  12945. if (typeof value == 'number') {
  12946. return value;
  12947. }
  12948. if (isSymbol(value)) {
  12949. return NAN;
  12950. }
  12951. if (isObject(value)) {
  12952. var other = typeof value.valueOf == 'function' ? value.valueOf() : value;
  12953. value = isObject(other) ? (other + '') : other;
  12954. }
  12955. if (typeof value != 'string') {
  12956. return value === 0 ? value : +value;
  12957. }
  12958. value = baseTrim(value);
  12959. var isBinary = reIsBinary.test(value);
  12960. return (isBinary || reIsOctal.test(value))
  12961. ? freeParseInt(value.slice(2), isBinary ? 2 : 8)
  12962. : (reIsBadHex.test(value) ? NAN : +value);
  12963. }
  12964. /**
  12965. * Converts `value` to a plain object flattening inherited enumerable string
  12966. * keyed properties of `value` to own properties of the plain object.
  12967. *
  12968. * @static
  12969. * @memberOf _
  12970. * @since 3.0.0
  12971. * @category Lang
  12972. * @param {*} value The value to convert.
  12973. * @returns {Object} Returns the converted plain object.
  12974. * @example
  12975. *
  12976. * function Foo() {
  12977. * this.b = 2;
  12978. * }
  12979. *
  12980. * Foo.prototype.c = 3;
  12981. *
  12982. * _.assign({ 'a': 1 }, new Foo);
  12983. * // => { 'a': 1, 'b': 2 }
  12984. *
  12985. * _.assign({ 'a': 1 }, _.toPlainObject(new Foo));
  12986. * // => { 'a': 1, 'b': 2, 'c': 3 }
  12987. */
  12988. function toPlainObject(value) {
  12989. return copyObject(value, keysIn(value));
  12990. }
  12991. /**
  12992. * Converts `value` to a safe integer. A safe integer can be compared and
  12993. * represented correctly.
  12994. *
  12995. * @static
  12996. * @memberOf _
  12997. * @since 4.0.0
  12998. * @category Lang
  12999. * @param {*} value The value to convert.
  13000. * @returns {number} Returns the converted integer.
  13001. * @example
  13002. *
  13003. * _.toSafeInteger(3.2);
  13004. * // => 3
  13005. *
  13006. * _.toSafeInteger(Number.MIN_VALUE);
  13007. * // => 0
  13008. *
  13009. * _.toSafeInteger(Infinity);
  13010. * // => 9007199254740991
  13011. *
  13012. * _.toSafeInteger('3.2');
  13013. * // => 3
  13014. */
  13015. function toSafeInteger(value) {
  13016. return value
  13017. ? baseClamp(toInteger(value), -MAX_SAFE_INTEGER, MAX_SAFE_INTEGER)
  13018. : (value === 0 ? value : 0);
  13019. }
  13020. /**
  13021. * Converts `value` to a string. An empty string is returned for `null`
  13022. * and `undefined` values. The sign of `-0` is preserved.
  13023. *
  13024. * @static
  13025. * @memberOf _
  13026. * @since 4.0.0
  13027. * @category Lang
  13028. * @param {*} value The value to convert.
  13029. * @returns {string} Returns the converted string.
  13030. * @example
  13031. *
  13032. * _.toString(null);
  13033. * // => ''
  13034. *
  13035. * _.toString(-0);
  13036. * // => '-0'
  13037. *
  13038. * _.toString([1, 2, 3]);
  13039. * // => '1,2,3'
  13040. */
  13041. function toString(value) {
  13042. return value == null ? '' : baseToString(value);
  13043. }
  13044. /*------------------------------------------------------------------------*/
  13045. /**
  13046. * Assigns own enumerable string keyed properties of source objects to the
  13047. * destination object. Source objects are applied from left to right.
  13048. * Subsequent sources overwrite property assignments of previous sources.
  13049. *
  13050. * **Note:** This method mutates `object` and is loosely based on
  13051. * [`Object.assign`](https://mdn.io/Object/assign).
  13052. *
  13053. * @static
  13054. * @memberOf _
  13055. * @since 0.10.0
  13056. * @category Object
  13057. * @param {Object} object The destination object.
  13058. * @param {...Object} [sources] The source objects.
  13059. * @returns {Object} Returns `object`.
  13060. * @see _.assignIn
  13061. * @example
  13062. *
  13063. * function Foo() {
  13064. * this.a = 1;
  13065. * }
  13066. *
  13067. * function Bar() {
  13068. * this.c = 3;
  13069. * }
  13070. *
  13071. * Foo.prototype.b = 2;
  13072. * Bar.prototype.d = 4;
  13073. *
  13074. * _.assign({ 'a': 0 }, new Foo, new Bar);
  13075. * // => { 'a': 1, 'c': 3 }
  13076. */
  13077. var assign = createAssigner(function(object, source) {
  13078. if (isPrototype(source) || isArrayLike(source)) {
  13079. copyObject(source, keys(source), object);
  13080. return;
  13081. }
  13082. for (var key in source) {
  13083. if (hasOwnProperty.call(source, key)) {
  13084. assignValue(object, key, source[key]);
  13085. }
  13086. }
  13087. });
  13088. /**
  13089. * This method is like `_.assign` except that it iterates over own and
  13090. * inherited source properties.
  13091. *
  13092. * **Note:** This method mutates `object`.
  13093. *
  13094. * @static
  13095. * @memberOf _
  13096. * @since 4.0.0
  13097. * @alias extend
  13098. * @category Object
  13099. * @param {Object} object The destination object.
  13100. * @param {...Object} [sources] The source objects.
  13101. * @returns {Object} Returns `object`.
  13102. * @see _.assign
  13103. * @example
  13104. *
  13105. * function Foo() {
  13106. * this.a = 1;
  13107. * }
  13108. *
  13109. * function Bar() {
  13110. * this.c = 3;
  13111. * }
  13112. *
  13113. * Foo.prototype.b = 2;
  13114. * Bar.prototype.d = 4;
  13115. *
  13116. * _.assignIn({ 'a': 0 }, new Foo, new Bar);
  13117. * // => { 'a': 1, 'b': 2, 'c': 3, 'd': 4 }
  13118. */
  13119. var assignIn = createAssigner(function(object, source) {
  13120. copyObject(source, keysIn(source), object);
  13121. });
  13122. /**
  13123. * This method is like `_.assignIn` except that it accepts `customizer`
  13124. * which is invoked to produce the assigned values. If `customizer` returns
  13125. * `undefined`, assignment is handled by the method instead. The `customizer`
  13126. * is invoked with five arguments: (objValue, srcValue, key, object, source).
  13127. *
  13128. * **Note:** This method mutates `object`.
  13129. *
  13130. * @static
  13131. * @memberOf _
  13132. * @since 4.0.0
  13133. * @alias extendWith
  13134. * @category Object
  13135. * @param {Object} object The destination object.
  13136. * @param {...Object} sources The source objects.
  13137. * @param {Function} [customizer] The function to customize assigned values.
  13138. * @returns {Object} Returns `object`.
  13139. * @see _.assignWith
  13140. * @example
  13141. *
  13142. * function customizer(objValue, srcValue) {
  13143. * return _.isUndefined(objValue) ? srcValue : objValue;
  13144. * }
  13145. *
  13146. * var defaults = _.partialRight(_.assignInWith, customizer);
  13147. *
  13148. * defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 });
  13149. * // => { 'a': 1, 'b': 2 }
  13150. */
  13151. var assignInWith = createAssigner(function(object, source, srcIndex, customizer) {
  13152. copyObject(source, keysIn(source), object, customizer);
  13153. });
  13154. /**
  13155. * This method is like `_.assign` except that it accepts `customizer`
  13156. * which is invoked to produce the assigned values. If `customizer` returns
  13157. * `undefined`, assignment is handled by the method instead. The `customizer`
  13158. * is invoked with five arguments: (objValue, srcValue, key, object, source).
  13159. *
  13160. * **Note:** This method mutates `object`.
  13161. *
  13162. * @static
  13163. * @memberOf _
  13164. * @since 4.0.0
  13165. * @category Object
  13166. * @param {Object} object The destination object.
  13167. * @param {...Object} sources The source objects.
  13168. * @param {Function} [customizer] The function to customize assigned values.
  13169. * @returns {Object} Returns `object`.
  13170. * @see _.assignInWith
  13171. * @example
  13172. *
  13173. * function customizer(objValue, srcValue) {
  13174. * return _.isUndefined(objValue) ? srcValue : objValue;
  13175. * }
  13176. *
  13177. * var defaults = _.partialRight(_.assignWith, customizer);
  13178. *
  13179. * defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 });
  13180. * // => { 'a': 1, 'b': 2 }
  13181. */
  13182. var assignWith = createAssigner(function(object, source, srcIndex, customizer) {
  13183. copyObject(source, keys(source), object, customizer);
  13184. });
  13185. /**
  13186. * Creates an array of values corresponding to `paths` of `object`.
  13187. *
  13188. * @static
  13189. * @memberOf _
  13190. * @since 1.0.0
  13191. * @category Object
  13192. * @param {Object} object The object to iterate over.
  13193. * @param {...(string|string[])} [paths] The property paths to pick.
  13194. * @returns {Array} Returns the picked values.
  13195. * @example
  13196. *
  13197. * var object = { 'a': [{ 'b': { 'c': 3 } }, 4] };
  13198. *
  13199. * _.at(object, ['a[0].b.c', 'a[1]']);
  13200. * // => [3, 4]
  13201. */
  13202. var at = flatRest(baseAt);
  13203. /**
  13204. * Creates an object that inherits from the `prototype` object. If a
  13205. * `properties` object is given, its own enumerable string keyed properties
  13206. * are assigned to the created object.
  13207. *
  13208. * @static
  13209. * @memberOf _
  13210. * @since 2.3.0
  13211. * @category Object
  13212. * @param {Object} prototype The object to inherit from.
  13213. * @param {Object} [properties] The properties to assign to the object.
  13214. * @returns {Object} Returns the new object.
  13215. * @example
  13216. *
  13217. * function Shape() {
  13218. * this.x = 0;
  13219. * this.y = 0;
  13220. * }
  13221. *
  13222. * function Circle() {
  13223. * Shape.call(this);
  13224. * }
  13225. *
  13226. * Circle.prototype = _.create(Shape.prototype, {
  13227. * 'constructor': Circle
  13228. * });
  13229. *
  13230. * var circle = new Circle;
  13231. * circle instanceof Circle;
  13232. * // => true
  13233. *
  13234. * circle instanceof Shape;
  13235. * // => true
  13236. */
  13237. function create(prototype, properties) {
  13238. var result = baseCreate(prototype);
  13239. return properties == null ? result : baseAssign(result, properties);
  13240. }
  13241. /**
  13242. * Assigns own and inherited enumerable string keyed properties of source
  13243. * objects to the destination object for all destination properties that
  13244. * resolve to `undefined`. Source objects are applied from left to right.
  13245. * Once a property is set, additional values of the same property are ignored.
  13246. *
  13247. * **Note:** This method mutates `object`.
  13248. *
  13249. * @static
  13250. * @since 0.1.0
  13251. * @memberOf _
  13252. * @category Object
  13253. * @param {Object} object The destination object.
  13254. * @param {...Object} [sources] The source objects.
  13255. * @returns {Object} Returns `object`.
  13256. * @see _.defaultsDeep
  13257. * @example
  13258. *
  13259. * _.defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 });
  13260. * // => { 'a': 1, 'b': 2 }
  13261. */
  13262. var defaults = baseRest(function(object, sources) {
  13263. object = Object(object);
  13264. var index = -1;
  13265. var length = sources.length;
  13266. var guard = length > 2 ? sources[2] : undefined;
  13267. if (guard && isIterateeCall(sources[0], sources[1], guard)) {
  13268. length = 1;
  13269. }
  13270. while (++index < length) {
  13271. var source = sources[index];
  13272. var props = keysIn(source);
  13273. var propsIndex = -1;
  13274. var propsLength = props.length;
  13275. while (++propsIndex < propsLength) {
  13276. var key = props[propsIndex];
  13277. var value = object[key];
  13278. if (value === undefined ||
  13279. (eq(value, objectProto[key]) && !hasOwnProperty.call(object, key))) {
  13280. object[key] = source[key];
  13281. }
  13282. }
  13283. }
  13284. return object;
  13285. });
  13286. /**
  13287. * This method is like `_.defaults` except that it recursively assigns
  13288. * default properties.
  13289. *
  13290. * **Note:** This method mutates `object`.
  13291. *
  13292. * @static
  13293. * @memberOf _
  13294. * @since 3.10.0
  13295. * @category Object
  13296. * @param {Object} object The destination object.
  13297. * @param {...Object} [sources] The source objects.
  13298. * @returns {Object} Returns `object`.
  13299. * @see _.defaults
  13300. * @example
  13301. *
  13302. * _.defaultsDeep({ 'a': { 'b': 2 } }, { 'a': { 'b': 1, 'c': 3 } });
  13303. * // => { 'a': { 'b': 2, 'c': 3 } }
  13304. */
  13305. var defaultsDeep = baseRest(function(args) {
  13306. args.push(undefined, customDefaultsMerge);
  13307. return apply(mergeWith, undefined, args);
  13308. });
  13309. /**
  13310. * This method is like `_.find` except that it returns the key of the first
  13311. * element `predicate` returns truthy for instead of the element itself.
  13312. *
  13313. * @static
  13314. * @memberOf _
  13315. * @since 1.1.0
  13316. * @category Object
  13317. * @param {Object} object The object to inspect.
  13318. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  13319. * @returns {string|undefined} Returns the key of the matched element,
  13320. * else `undefined`.
  13321. * @example
  13322. *
  13323. * var users = {
  13324. * 'barney': { 'age': 36, 'active': true },
  13325. * 'fred': { 'age': 40, 'active': false },
  13326. * 'pebbles': { 'age': 1, 'active': true }
  13327. * };
  13328. *
  13329. * _.findKey(users, function(o) { return o.age < 40; });
  13330. * // => 'barney' (iteration order is not guaranteed)
  13331. *
  13332. * // The `_.matches` iteratee shorthand.
  13333. * _.findKey(users, { 'age': 1, 'active': true });
  13334. * // => 'pebbles'
  13335. *
  13336. * // The `_.matchesProperty` iteratee shorthand.
  13337. * _.findKey(users, ['active', false]);
  13338. * // => 'fred'
  13339. *
  13340. * // The `_.property` iteratee shorthand.
  13341. * _.findKey(users, 'active');
  13342. * // => 'barney'
  13343. */
  13344. function findKey(object, predicate) {
  13345. return baseFindKey(object, getIteratee(predicate, 3), baseForOwn);
  13346. }
  13347. /**
  13348. * This method is like `_.findKey` except that it iterates over elements of
  13349. * a collection in the opposite order.
  13350. *
  13351. * @static
  13352. * @memberOf _
  13353. * @since 2.0.0
  13354. * @category Object
  13355. * @param {Object} object The object to inspect.
  13356. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  13357. * @returns {string|undefined} Returns the key of the matched element,
  13358. * else `undefined`.
  13359. * @example
  13360. *
  13361. * var users = {
  13362. * 'barney': { 'age': 36, 'active': true },
  13363. * 'fred': { 'age': 40, 'active': false },
  13364. * 'pebbles': { 'age': 1, 'active': true }
  13365. * };
  13366. *
  13367. * _.findLastKey(users, function(o) { return o.age < 40; });
  13368. * // => returns 'pebbles' assuming `_.findKey` returns 'barney'
  13369. *
  13370. * // The `_.matches` iteratee shorthand.
  13371. * _.findLastKey(users, { 'age': 36, 'active': true });
  13372. * // => 'barney'
  13373. *
  13374. * // The `_.matchesProperty` iteratee shorthand.
  13375. * _.findLastKey(users, ['active', false]);
  13376. * // => 'fred'
  13377. *
  13378. * // The `_.property` iteratee shorthand.
  13379. * _.findLastKey(users, 'active');
  13380. * // => 'pebbles'
  13381. */
  13382. function findLastKey(object, predicate) {
  13383. return baseFindKey(object, getIteratee(predicate, 3), baseForOwnRight);
  13384. }
  13385. /**
  13386. * Iterates over own and inherited enumerable string keyed properties of an
  13387. * object and invokes `iteratee` for each property. The iteratee is invoked
  13388. * with three arguments: (value, key, object). Iteratee functions may exit
  13389. * iteration early by explicitly returning `false`.
  13390. *
  13391. * @static
  13392. * @memberOf _
  13393. * @since 0.3.0
  13394. * @category Object
  13395. * @param {Object} object The object to iterate over.
  13396. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  13397. * @returns {Object} Returns `object`.
  13398. * @see _.forInRight
  13399. * @example
  13400. *
  13401. * function Foo() {
  13402. * this.a = 1;
  13403. * this.b = 2;
  13404. * }
  13405. *
  13406. * Foo.prototype.c = 3;
  13407. *
  13408. * _.forIn(new Foo, function(value, key) {
  13409. * console.log(key);
  13410. * });
  13411. * // => Logs 'a', 'b', then 'c' (iteration order is not guaranteed).
  13412. */
  13413. function forIn(object, iteratee) {
  13414. return object == null
  13415. ? object
  13416. : baseFor(object, getIteratee(iteratee, 3), keysIn);
  13417. }
  13418. /**
  13419. * This method is like `_.forIn` except that it iterates over properties of
  13420. * `object` in the opposite order.
  13421. *
  13422. * @static
  13423. * @memberOf _
  13424. * @since 2.0.0
  13425. * @category Object
  13426. * @param {Object} object The object to iterate over.
  13427. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  13428. * @returns {Object} Returns `object`.
  13429. * @see _.forIn
  13430. * @example
  13431. *
  13432. * function Foo() {
  13433. * this.a = 1;
  13434. * this.b = 2;
  13435. * }
  13436. *
  13437. * Foo.prototype.c = 3;
  13438. *
  13439. * _.forInRight(new Foo, function(value, key) {
  13440. * console.log(key);
  13441. * });
  13442. * // => Logs 'c', 'b', then 'a' assuming `_.forIn` logs 'a', 'b', then 'c'.
  13443. */
  13444. function forInRight(object, iteratee) {
  13445. return object == null
  13446. ? object
  13447. : baseForRight(object, getIteratee(iteratee, 3), keysIn);
  13448. }
  13449. /**
  13450. * Iterates over own enumerable string keyed properties of an object and
  13451. * invokes `iteratee` for each property. The iteratee is invoked with three
  13452. * arguments: (value, key, object). Iteratee functions may exit iteration
  13453. * early by explicitly returning `false`.
  13454. *
  13455. * @static
  13456. * @memberOf _
  13457. * @since 0.3.0
  13458. * @category Object
  13459. * @param {Object} object The object to iterate over.
  13460. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  13461. * @returns {Object} Returns `object`.
  13462. * @see _.forOwnRight
  13463. * @example
  13464. *
  13465. * function Foo() {
  13466. * this.a = 1;
  13467. * this.b = 2;
  13468. * }
  13469. *
  13470. * Foo.prototype.c = 3;
  13471. *
  13472. * _.forOwn(new Foo, function(value, key) {
  13473. * console.log(key);
  13474. * });
  13475. * // => Logs 'a' then 'b' (iteration order is not guaranteed).
  13476. */
  13477. function forOwn(object, iteratee) {
  13478. return object && baseForOwn(object, getIteratee(iteratee, 3));
  13479. }
  13480. /**
  13481. * This method is like `_.forOwn` except that it iterates over properties of
  13482. * `object` in the opposite order.
  13483. *
  13484. * @static
  13485. * @memberOf _
  13486. * @since 2.0.0
  13487. * @category Object
  13488. * @param {Object} object The object to iterate over.
  13489. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  13490. * @returns {Object} Returns `object`.
  13491. * @see _.forOwn
  13492. * @example
  13493. *
  13494. * function Foo() {
  13495. * this.a = 1;
  13496. * this.b = 2;
  13497. * }
  13498. *
  13499. * Foo.prototype.c = 3;
  13500. *
  13501. * _.forOwnRight(new Foo, function(value, key) {
  13502. * console.log(key);
  13503. * });
  13504. * // => Logs 'b' then 'a' assuming `_.forOwn` logs 'a' then 'b'.
  13505. */
  13506. function forOwnRight(object, iteratee) {
  13507. return object && baseForOwnRight(object, getIteratee(iteratee, 3));
  13508. }
  13509. /**
  13510. * Creates an array of function property names from own enumerable properties
  13511. * of `object`.
  13512. *
  13513. * @static
  13514. * @since 0.1.0
  13515. * @memberOf _
  13516. * @category Object
  13517. * @param {Object} object The object to inspect.
  13518. * @returns {Array} Returns the function names.
  13519. * @see _.functionsIn
  13520. * @example
  13521. *
  13522. * function Foo() {
  13523. * this.a = _.constant('a');
  13524. * this.b = _.constant('b');
  13525. * }
  13526. *
  13527. * Foo.prototype.c = _.constant('c');
  13528. *
  13529. * _.functions(new Foo);
  13530. * // => ['a', 'b']
  13531. */
  13532. function functions(object) {
  13533. return object == null ? [] : baseFunctions(object, keys(object));
  13534. }
  13535. /**
  13536. * Creates an array of function property names from own and inherited
  13537. * enumerable properties of `object`.
  13538. *
  13539. * @static
  13540. * @memberOf _
  13541. * @since 4.0.0
  13542. * @category Object
  13543. * @param {Object} object The object to inspect.
  13544. * @returns {Array} Returns the function names.
  13545. * @see _.functions
  13546. * @example
  13547. *
  13548. * function Foo() {
  13549. * this.a = _.constant('a');
  13550. * this.b = _.constant('b');
  13551. * }
  13552. *
  13553. * Foo.prototype.c = _.constant('c');
  13554. *
  13555. * _.functionsIn(new Foo);
  13556. * // => ['a', 'b', 'c']
  13557. */
  13558. function functionsIn(object) {
  13559. return object == null ? [] : baseFunctions(object, keysIn(object));
  13560. }
  13561. /**
  13562. * Gets the value at `path` of `object`. If the resolved value is
  13563. * `undefined`, the `defaultValue` is returned in its place.
  13564. *
  13565. * @static
  13566. * @memberOf _
  13567. * @since 3.7.0
  13568. * @category Object
  13569. * @param {Object} object The object to query.
  13570. * @param {Array|string} path The path of the property to get.
  13571. * @param {*} [defaultValue] The value returned for `undefined` resolved values.
  13572. * @returns {*} Returns the resolved value.
  13573. * @example
  13574. *
  13575. * var object = { 'a': [{ 'b': { 'c': 3 } }] };
  13576. *
  13577. * _.get(object, 'a[0].b.c');
  13578. * // => 3
  13579. *
  13580. * _.get(object, ['a', '0', 'b', 'c']);
  13581. * // => 3
  13582. *
  13583. * _.get(object, 'a.b.c', 'default');
  13584. * // => 'default'
  13585. */
  13586. function get(object, path, defaultValue) {
  13587. var result = object == null ? undefined : baseGet(object, path);
  13588. return result === undefined ? defaultValue : result;
  13589. }
  13590. /**
  13591. * Checks if `path` is a direct property of `object`.
  13592. *
  13593. * @static
  13594. * @since 0.1.0
  13595. * @memberOf _
  13596. * @category Object
  13597. * @param {Object} object The object to query.
  13598. * @param {Array|string} path The path to check.
  13599. * @returns {boolean} Returns `true` if `path` exists, else `false`.
  13600. * @example
  13601. *
  13602. * var object = { 'a': { 'b': 2 } };
  13603. * var other = _.create({ 'a': _.create({ 'b': 2 }) });
  13604. *
  13605. * _.has(object, 'a');
  13606. * // => true
  13607. *
  13608. * _.has(object, 'a.b');
  13609. * // => true
  13610. *
  13611. * _.has(object, ['a', 'b']);
  13612. * // => true
  13613. *
  13614. * _.has(other, 'a');
  13615. * // => false
  13616. */
  13617. function has(object, path) {
  13618. return object != null && hasPath(object, path, baseHas);
  13619. }
  13620. /**
  13621. * Checks if `path` is a direct or inherited property of `object`.
  13622. *
  13623. * @static
  13624. * @memberOf _
  13625. * @since 4.0.0
  13626. * @category Object
  13627. * @param {Object} object The object to query.
  13628. * @param {Array|string} path The path to check.
  13629. * @returns {boolean} Returns `true` if `path` exists, else `false`.
  13630. * @example
  13631. *
  13632. * var object = _.create({ 'a': _.create({ 'b': 2 }) });
  13633. *
  13634. * _.hasIn(object, 'a');
  13635. * // => true
  13636. *
  13637. * _.hasIn(object, 'a.b');
  13638. * // => true
  13639. *
  13640. * _.hasIn(object, ['a', 'b']);
  13641. * // => true
  13642. *
  13643. * _.hasIn(object, 'b');
  13644. * // => false
  13645. */
  13646. function hasIn(object, path) {
  13647. return object != null && hasPath(object, path, baseHasIn);
  13648. }
  13649. /**
  13650. * Creates an object composed of the inverted keys and values of `object`.
  13651. * If `object` contains duplicate values, subsequent values overwrite
  13652. * property assignments of previous values.
  13653. *
  13654. * @static
  13655. * @memberOf _
  13656. * @since 0.7.0
  13657. * @category Object
  13658. * @param {Object} object The object to invert.
  13659. * @returns {Object} Returns the new inverted object.
  13660. * @example
  13661. *
  13662. * var object = { 'a': 1, 'b': 2, 'c': 1 };
  13663. *
  13664. * _.invert(object);
  13665. * // => { '1': 'c', '2': 'b' }
  13666. */
  13667. var invert = createInverter(function(result, value, key) {
  13668. if (value != null &&
  13669. typeof value.toString != 'function') {
  13670. value = nativeObjectToString.call(value);
  13671. }
  13672. result[value] = key;
  13673. }, constant(identity));
  13674. /**
  13675. * This method is like `_.invert` except that the inverted object is generated
  13676. * from the results of running each element of `object` thru `iteratee`. The
  13677. * corresponding inverted value of each inverted key is an array of keys
  13678. * responsible for generating the inverted value. The iteratee is invoked
  13679. * with one argument: (value).
  13680. *
  13681. * @static
  13682. * @memberOf _
  13683. * @since 4.1.0
  13684. * @category Object
  13685. * @param {Object} object The object to invert.
  13686. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  13687. * @returns {Object} Returns the new inverted object.
  13688. * @example
  13689. *
  13690. * var object = { 'a': 1, 'b': 2, 'c': 1 };
  13691. *
  13692. * _.invertBy(object);
  13693. * // => { '1': ['a', 'c'], '2': ['b'] }
  13694. *
  13695. * _.invertBy(object, function(value) {
  13696. * return 'group' + value;
  13697. * });
  13698. * // => { 'group1': ['a', 'c'], 'group2': ['b'] }
  13699. */
  13700. var invertBy = createInverter(function(result, value, key) {
  13701. if (value != null &&
  13702. typeof value.toString != 'function') {
  13703. value = nativeObjectToString.call(value);
  13704. }
  13705. if (hasOwnProperty.call(result, value)) {
  13706. result[value].push(key);
  13707. } else {
  13708. result[value] = [key];
  13709. }
  13710. }, getIteratee);
  13711. /**
  13712. * Invokes the method at `path` of `object`.
  13713. *
  13714. * @static
  13715. * @memberOf _
  13716. * @since 4.0.0
  13717. * @category Object
  13718. * @param {Object} object The object to query.
  13719. * @param {Array|string} path The path of the method to invoke.
  13720. * @param {...*} [args] The arguments to invoke the method with.
  13721. * @returns {*} Returns the result of the invoked method.
  13722. * @example
  13723. *
  13724. * var object = { 'a': [{ 'b': { 'c': [1, 2, 3, 4] } }] };
  13725. *
  13726. * _.invoke(object, 'a[0].b.c.slice', 1, 3);
  13727. * // => [2, 3]
  13728. */
  13729. var invoke = baseRest(baseInvoke);
  13730. /**
  13731. * Creates an array of the own enumerable property names of `object`.
  13732. *
  13733. * **Note:** Non-object values are coerced to objects. See the
  13734. * [ES spec](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)
  13735. * for more details.
  13736. *
  13737. * @static
  13738. * @since 0.1.0
  13739. * @memberOf _
  13740. * @category Object
  13741. * @param {Object} object The object to query.
  13742. * @returns {Array} Returns the array of property names.
  13743. * @example
  13744. *
  13745. * function Foo() {
  13746. * this.a = 1;
  13747. * this.b = 2;
  13748. * }
  13749. *
  13750. * Foo.prototype.c = 3;
  13751. *
  13752. * _.keys(new Foo);
  13753. * // => ['a', 'b'] (iteration order is not guaranteed)
  13754. *
  13755. * _.keys('hi');
  13756. * // => ['0', '1']
  13757. */
  13758. function keys(object) {
  13759. return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object);
  13760. }
  13761. /**
  13762. * Creates an array of the own and inherited enumerable property names of `object`.
  13763. *
  13764. * **Note:** Non-object values are coerced to objects.
  13765. *
  13766. * @static
  13767. * @memberOf _
  13768. * @since 3.0.0
  13769. * @category Object
  13770. * @param {Object} object The object to query.
  13771. * @returns {Array} Returns the array of property names.
  13772. * @example
  13773. *
  13774. * function Foo() {
  13775. * this.a = 1;
  13776. * this.b = 2;
  13777. * }
  13778. *
  13779. * Foo.prototype.c = 3;
  13780. *
  13781. * _.keysIn(new Foo);
  13782. * // => ['a', 'b', 'c'] (iteration order is not guaranteed)
  13783. */
  13784. function keysIn(object) {
  13785. return isArrayLike(object) ? arrayLikeKeys(object, true) : baseKeysIn(object);
  13786. }
  13787. /**
  13788. * The opposite of `_.mapValues`; this method creates an object with the
  13789. * same values as `object` and keys generated by running each own enumerable
  13790. * string keyed property of `object` thru `iteratee`. The iteratee is invoked
  13791. * with three arguments: (value, key, object).
  13792. *
  13793. * @static
  13794. * @memberOf _
  13795. * @since 3.8.0
  13796. * @category Object
  13797. * @param {Object} object The object to iterate over.
  13798. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  13799. * @returns {Object} Returns the new mapped object.
  13800. * @see _.mapValues
  13801. * @example
  13802. *
  13803. * _.mapKeys({ 'a': 1, 'b': 2 }, function(value, key) {
  13804. * return key + value;
  13805. * });
  13806. * // => { 'a1': 1, 'b2': 2 }
  13807. */
  13808. function mapKeys(object, iteratee) {
  13809. var result = {};
  13810. iteratee = getIteratee(iteratee, 3);
  13811. baseForOwn(object, function(value, key, object) {
  13812. baseAssignValue(result, iteratee(value, key, object), value);
  13813. });
  13814. return result;
  13815. }
  13816. /**
  13817. * Creates an object with the same keys as `object` and values generated
  13818. * by running each own enumerable string keyed property of `object` thru
  13819. * `iteratee`. The iteratee is invoked with three arguments:
  13820. * (value, key, object).
  13821. *
  13822. * @static
  13823. * @memberOf _
  13824. * @since 2.4.0
  13825. * @category Object
  13826. * @param {Object} object The object to iterate over.
  13827. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  13828. * @returns {Object} Returns the new mapped object.
  13829. * @see _.mapKeys
  13830. * @example
  13831. *
  13832. * var users = {
  13833. * 'fred': { 'user': 'fred', 'age': 40 },
  13834. * 'pebbles': { 'user': 'pebbles', 'age': 1 }
  13835. * };
  13836. *
  13837. * _.mapValues(users, function(o) { return o.age; });
  13838. * // => { 'fred': 40, 'pebbles': 1 } (iteration order is not guaranteed)
  13839. *
  13840. * // The `_.property` iteratee shorthand.
  13841. * _.mapValues(users, 'age');
  13842. * // => { 'fred': 40, 'pebbles': 1 } (iteration order is not guaranteed)
  13843. */
  13844. function mapValues(object, iteratee) {
  13845. var result = {};
  13846. iteratee = getIteratee(iteratee, 3);
  13847. baseForOwn(object, function(value, key, object) {
  13848. baseAssignValue(result, key, iteratee(value, key, object));
  13849. });
  13850. return result;
  13851. }
  13852. /**
  13853. * This method is like `_.assign` except that it recursively merges own and
  13854. * inherited enumerable string keyed properties of source objects into the
  13855. * destination object. Source properties that resolve to `undefined` are
  13856. * skipped if a destination value exists. Array and plain object properties
  13857. * are merged recursively. Other objects and value types are overridden by
  13858. * assignment. Source objects are applied from left to right. Subsequent
  13859. * sources overwrite property assignments of previous sources.
  13860. *
  13861. * **Note:** This method mutates `object`.
  13862. *
  13863. * @static
  13864. * @memberOf _
  13865. * @since 0.5.0
  13866. * @category Object
  13867. * @param {Object} object The destination object.
  13868. * @param {...Object} [sources] The source objects.
  13869. * @returns {Object} Returns `object`.
  13870. * @example
  13871. *
  13872. * var object = {
  13873. * 'a': [{ 'b': 2 }, { 'd': 4 }]
  13874. * };
  13875. *
  13876. * var other = {
  13877. * 'a': [{ 'c': 3 }, { 'e': 5 }]
  13878. * };
  13879. *
  13880. * _.merge(object, other);
  13881. * // => { 'a': [{ 'b': 2, 'c': 3 }, { 'd': 4, 'e': 5 }] }
  13882. */
  13883. var merge = createAssigner(function(object, source, srcIndex) {
  13884. baseMerge(object, source, srcIndex);
  13885. });
  13886. /**
  13887. * This method is like `_.merge` except that it accepts `customizer` which
  13888. * is invoked to produce the merged values of the destination and source
  13889. * properties. If `customizer` returns `undefined`, merging is handled by the
  13890. * method instead. The `customizer` is invoked with six arguments:
  13891. * (objValue, srcValue, key, object, source, stack).
  13892. *
  13893. * **Note:** This method mutates `object`.
  13894. *
  13895. * @static
  13896. * @memberOf _
  13897. * @since 4.0.0
  13898. * @category Object
  13899. * @param {Object} object The destination object.
  13900. * @param {...Object} sources The source objects.
  13901. * @param {Function} customizer The function to customize assigned values.
  13902. * @returns {Object} Returns `object`.
  13903. * @example
  13904. *
  13905. * function customizer(objValue, srcValue) {
  13906. * if (_.isArray(objValue)) {
  13907. * return objValue.concat(srcValue);
  13908. * }
  13909. * }
  13910. *
  13911. * var object = { 'a': [1], 'b': [2] };
  13912. * var other = { 'a': [3], 'b': [4] };
  13913. *
  13914. * _.mergeWith(object, other, customizer);
  13915. * // => { 'a': [1, 3], 'b': [2, 4] }
  13916. */
  13917. var mergeWith = createAssigner(function(object, source, srcIndex, customizer) {
  13918. baseMerge(object, source, srcIndex, customizer);
  13919. });
  13920. /**
  13921. * The opposite of `_.pick`; this method creates an object composed of the
  13922. * own and inherited enumerable property paths of `object` that are not omitted.
  13923. *
  13924. * **Note:** This method is considerably slower than `_.pick`.
  13925. *
  13926. * @static
  13927. * @since 0.1.0
  13928. * @memberOf _
  13929. * @category Object
  13930. * @param {Object} object The source object.
  13931. * @param {...(string|string[])} [paths] The property paths to omit.
  13932. * @returns {Object} Returns the new object.
  13933. * @example
  13934. *
  13935. * var object = { 'a': 1, 'b': '2', 'c': 3 };
  13936. *
  13937. * _.omit(object, ['a', 'c']);
  13938. * // => { 'b': '2' }
  13939. */
  13940. var omit = flatRest(function(object, paths) {
  13941. var result = {};
  13942. if (object == null) {
  13943. return result;
  13944. }
  13945. var isDeep = false;
  13946. paths = arrayMap(paths, function(path) {
  13947. path = castPath(path, object);
  13948. isDeep || (isDeep = path.length > 1);
  13949. return path;
  13950. });
  13951. copyObject(object, getAllKeysIn(object), result);
  13952. if (isDeep) {
  13953. result = baseClone(result, CLONE_DEEP_FLAG | CLONE_FLAT_FLAG | CLONE_SYMBOLS_FLAG, customOmitClone);
  13954. }
  13955. var length = paths.length;
  13956. while (length--) {
  13957. baseUnset(result, paths[length]);
  13958. }
  13959. return result;
  13960. });
  13961. /**
  13962. * The opposite of `_.pickBy`; this method creates an object composed of
  13963. * the own and inherited enumerable string keyed properties of `object` that
  13964. * `predicate` doesn't return truthy for. The predicate is invoked with two
  13965. * arguments: (value, key).
  13966. *
  13967. * @static
  13968. * @memberOf _
  13969. * @since 4.0.0
  13970. * @category Object
  13971. * @param {Object} object The source object.
  13972. * @param {Function} [predicate=_.identity] The function invoked per property.
  13973. * @returns {Object} Returns the new object.
  13974. * @example
  13975. *
  13976. * var object = { 'a': 1, 'b': '2', 'c': 3 };
  13977. *
  13978. * _.omitBy(object, _.isNumber);
  13979. * // => { 'b': '2' }
  13980. */
  13981. function omitBy(object, predicate) {
  13982. return pickBy(object, negate(getIteratee(predicate)));
  13983. }
  13984. /**
  13985. * Creates an object composed of the picked `object` properties.
  13986. *
  13987. * @static
  13988. * @since 0.1.0
  13989. * @memberOf _
  13990. * @category Object
  13991. * @param {Object} object The source object.
  13992. * @param {...(string|string[])} [paths] The property paths to pick.
  13993. * @returns {Object} Returns the new object.
  13994. * @example
  13995. *
  13996. * var object = { 'a': 1, 'b': '2', 'c': 3 };
  13997. *
  13998. * _.pick(object, ['a', 'c']);
  13999. * // => { 'a': 1, 'c': 3 }
  14000. */
  14001. var pick = flatRest(function(object, paths) {
  14002. return object == null ? {} : basePick(object, paths);
  14003. });
  14004. /**
  14005. * Creates an object composed of the `object` properties `predicate` returns
  14006. * truthy for. The predicate is invoked with two arguments: (value, key).
  14007. *
  14008. * @static
  14009. * @memberOf _
  14010. * @since 4.0.0
  14011. * @category Object
  14012. * @param {Object} object The source object.
  14013. * @param {Function} [predicate=_.identity] The function invoked per property.
  14014. * @returns {Object} Returns the new object.
  14015. * @example
  14016. *
  14017. * var object = { 'a': 1, 'b': '2', 'c': 3 };
  14018. *
  14019. * _.pickBy(object, _.isNumber);
  14020. * // => { 'a': 1, 'c': 3 }
  14021. */
  14022. function pickBy(object, predicate) {
  14023. if (object == null) {
  14024. return {};
  14025. }
  14026. var props = arrayMap(getAllKeysIn(object), function(prop) {
  14027. return [prop];
  14028. });
  14029. predicate = getIteratee(predicate);
  14030. return basePickBy(object, props, function(value, path) {
  14031. return predicate(value, path[0]);
  14032. });
  14033. }
  14034. /**
  14035. * This method is like `_.get` except that if the resolved value is a
  14036. * function it's invoked with the `this` binding of its parent object and
  14037. * its result is returned.
  14038. *
  14039. * @static
  14040. * @since 0.1.0
  14041. * @memberOf _
  14042. * @category Object
  14043. * @param {Object} object The object to query.
  14044. * @param {Array|string} path The path of the property to resolve.
  14045. * @param {*} [defaultValue] The value returned for `undefined` resolved values.
  14046. * @returns {*} Returns the resolved value.
  14047. * @example
  14048. *
  14049. * var object = { 'a': [{ 'b': { 'c1': 3, 'c2': _.constant(4) } }] };
  14050. *
  14051. * _.result(object, 'a[0].b.c1');
  14052. * // => 3
  14053. *
  14054. * _.result(object, 'a[0].b.c2');
  14055. * // => 4
  14056. *
  14057. * _.result(object, 'a[0].b.c3', 'default');
  14058. * // => 'default'
  14059. *
  14060. * _.result(object, 'a[0].b.c3', _.constant('default'));
  14061. * // => 'default'
  14062. */
  14063. function result(object, path, defaultValue) {
  14064. path = castPath(path, object);
  14065. var index = -1,
  14066. length = path.length;
  14067. // Ensure the loop is entered when path is empty.
  14068. if (!length) {
  14069. length = 1;
  14070. object = undefined;
  14071. }
  14072. while (++index < length) {
  14073. var value = object == null ? undefined : object[toKey(path[index])];
  14074. if (value === undefined) {
  14075. index = length;
  14076. value = defaultValue;
  14077. }
  14078. object = isFunction(value) ? value.call(object) : value;
  14079. }
  14080. return object;
  14081. }
  14082. /**
  14083. * Sets the value at `path` of `object`. If a portion of `path` doesn't exist,
  14084. * it's created. Arrays are created for missing index properties while objects
  14085. * are created for all other missing properties. Use `_.setWith` to customize
  14086. * `path` creation.
  14087. *
  14088. * **Note:** This method mutates `object`.
  14089. *
  14090. * @static
  14091. * @memberOf _
  14092. * @since 3.7.0
  14093. * @category Object
  14094. * @param {Object} object The object to modify.
  14095. * @param {Array|string} path The path of the property to set.
  14096. * @param {*} value The value to set.
  14097. * @returns {Object} Returns `object`.
  14098. * @example
  14099. *
  14100. * var object = { 'a': [{ 'b': { 'c': 3 } }] };
  14101. *
  14102. * _.set(object, 'a[0].b.c', 4);
  14103. * console.log(object.a[0].b.c);
  14104. * // => 4
  14105. *
  14106. * _.set(object, ['x', '0', 'y', 'z'], 5);
  14107. * console.log(object.x[0].y.z);
  14108. * // => 5
  14109. */
  14110. function set(object, path, value) {
  14111. return object == null ? object : baseSet(object, path, value);
  14112. }
  14113. /**
  14114. * This method is like `_.set` except that it accepts `customizer` which is
  14115. * invoked to produce the objects of `path`. If `customizer` returns `undefined`
  14116. * path creation is handled by the method instead. The `customizer` is invoked
  14117. * with three arguments: (nsValue, key, nsObject).
  14118. *
  14119. * **Note:** This method mutates `object`.
  14120. *
  14121. * @static
  14122. * @memberOf _
  14123. * @since 4.0.0
  14124. * @category Object
  14125. * @param {Object} object The object to modify.
  14126. * @param {Array|string} path The path of the property to set.
  14127. * @param {*} value The value to set.
  14128. * @param {Function} [customizer] The function to customize assigned values.
  14129. * @returns {Object} Returns `object`.
  14130. * @example
  14131. *
  14132. * var object = {};
  14133. *
  14134. * _.setWith(object, '[0][1]', 'a', Object);
  14135. * // => { '0': { '1': 'a' } }
  14136. */
  14137. function setWith(object, path, value, customizer) {
  14138. customizer = typeof customizer == 'function' ? customizer : undefined;
  14139. return object == null ? object : baseSet(object, path, value, customizer);
  14140. }
  14141. /**
  14142. * Creates an array of own enumerable string keyed-value pairs for `object`
  14143. * which can be consumed by `_.fromPairs`. If `object` is a map or set, its
  14144. * entries are returned.
  14145. *
  14146. * @static
  14147. * @memberOf _
  14148. * @since 4.0.0
  14149. * @alias entries
  14150. * @category Object
  14151. * @param {Object} object The object to query.
  14152. * @returns {Array} Returns the key-value pairs.
  14153. * @example
  14154. *
  14155. * function Foo() {
  14156. * this.a = 1;
  14157. * this.b = 2;
  14158. * }
  14159. *
  14160. * Foo.prototype.c = 3;
  14161. *
  14162. * _.toPairs(new Foo);
  14163. * // => [['a', 1], ['b', 2]] (iteration order is not guaranteed)
  14164. */
  14165. var toPairs = createToPairs(keys);
  14166. /**
  14167. * Creates an array of own and inherited enumerable string keyed-value pairs
  14168. * for `object` which can be consumed by `_.fromPairs`. If `object` is a map
  14169. * or set, its entries are returned.
  14170. *
  14171. * @static
  14172. * @memberOf _
  14173. * @since 4.0.0
  14174. * @alias entriesIn
  14175. * @category Object
  14176. * @param {Object} object The object to query.
  14177. * @returns {Array} Returns the key-value pairs.
  14178. * @example
  14179. *
  14180. * function Foo() {
  14181. * this.a = 1;
  14182. * this.b = 2;
  14183. * }
  14184. *
  14185. * Foo.prototype.c = 3;
  14186. *
  14187. * _.toPairsIn(new Foo);
  14188. * // => [['a', 1], ['b', 2], ['c', 3]] (iteration order is not guaranteed)
  14189. */
  14190. var toPairsIn = createToPairs(keysIn);
  14191. /**
  14192. * An alternative to `_.reduce`; this method transforms `object` to a new
  14193. * `accumulator` object which is the result of running each of its own
  14194. * enumerable string keyed properties thru `iteratee`, with each invocation
  14195. * potentially mutating the `accumulator` object. If `accumulator` is not
  14196. * provided, a new object with the same `[[Prototype]]` will be used. The
  14197. * iteratee is invoked with four arguments: (accumulator, value, key, object).
  14198. * Iteratee functions may exit iteration early by explicitly returning `false`.
  14199. *
  14200. * @static
  14201. * @memberOf _
  14202. * @since 1.3.0
  14203. * @category Object
  14204. * @param {Object} object The object to iterate over.
  14205. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  14206. * @param {*} [accumulator] The custom accumulator value.
  14207. * @returns {*} Returns the accumulated value.
  14208. * @example
  14209. *
  14210. * _.transform([2, 3, 4], function(result, n) {
  14211. * result.push(n *= n);
  14212. * return n % 2 == 0;
  14213. * }, []);
  14214. * // => [4, 9]
  14215. *
  14216. * _.transform({ 'a': 1, 'b': 2, 'c': 1 }, function(result, value, key) {
  14217. * (result[value] || (result[value] = [])).push(key);
  14218. * }, {});
  14219. * // => { '1': ['a', 'c'], '2': ['b'] }
  14220. */
  14221. function transform(object, iteratee, accumulator) {
  14222. var isArr = isArray(object),
  14223. isArrLike = isArr || isBuffer(object) || isTypedArray(object);
  14224. iteratee = getIteratee(iteratee, 4);
  14225. if (accumulator == null) {
  14226. var Ctor = object && object.constructor;
  14227. if (isArrLike) {
  14228. accumulator = isArr ? new Ctor : [];
  14229. }
  14230. else if (isObject(object)) {
  14231. accumulator = isFunction(Ctor) ? baseCreate(getPrototype(object)) : {};
  14232. }
  14233. else {
  14234. accumulator = {};
  14235. }
  14236. }
  14237. (isArrLike ? arrayEach : baseForOwn)(object, function(value, index, object) {
  14238. return iteratee(accumulator, value, index, object);
  14239. });
  14240. return accumulator;
  14241. }
  14242. /**
  14243. * Removes the property at `path` of `object`.
  14244. *
  14245. * **Note:** This method mutates `object`.
  14246. *
  14247. * @static
  14248. * @memberOf _
  14249. * @since 4.0.0
  14250. * @category Object
  14251. * @param {Object} object The object to modify.
  14252. * @param {Array|string} path The path of the property to unset.
  14253. * @returns {boolean} Returns `true` if the property is deleted, else `false`.
  14254. * @example
  14255. *
  14256. * var object = { 'a': [{ 'b': { 'c': 7 } }] };
  14257. * _.unset(object, 'a[0].b.c');
  14258. * // => true
  14259. *
  14260. * console.log(object);
  14261. * // => { 'a': [{ 'b': {} }] };
  14262. *
  14263. * _.unset(object, ['a', '0', 'b', 'c']);
  14264. * // => true
  14265. *
  14266. * console.log(object);
  14267. * // => { 'a': [{ 'b': {} }] };
  14268. */
  14269. function unset(object, path) {
  14270. return object == null ? true : baseUnset(object, path);
  14271. }
  14272. /**
  14273. * This method is like `_.set` except that accepts `updater` to produce the
  14274. * value to set. Use `_.updateWith` to customize `path` creation. The `updater`
  14275. * is invoked with one argument: (value).
  14276. *
  14277. * **Note:** This method mutates `object`.
  14278. *
  14279. * @static
  14280. * @memberOf _
  14281. * @since 4.6.0
  14282. * @category Object
  14283. * @param {Object} object The object to modify.
  14284. * @param {Array|string} path The path of the property to set.
  14285. * @param {Function} updater The function to produce the updated value.
  14286. * @returns {Object} Returns `object`.
  14287. * @example
  14288. *
  14289. * var object = { 'a': [{ 'b': { 'c': 3 } }] };
  14290. *
  14291. * _.update(object, 'a[0].b.c', function(n) { return n * n; });
  14292. * console.log(object.a[0].b.c);
  14293. * // => 9
  14294. *
  14295. * _.update(object, 'x[0].y.z', function(n) { return n ? n + 1 : 0; });
  14296. * console.log(object.x[0].y.z);
  14297. * // => 0
  14298. */
  14299. function update(object, path, updater) {
  14300. return object == null ? object : baseUpdate(object, path, castFunction(updater));
  14301. }
  14302. /**
  14303. * This method is like `_.update` except that it accepts `customizer` which is
  14304. * invoked to produce the objects of `path`. If `customizer` returns `undefined`
  14305. * path creation is handled by the method instead. The `customizer` is invoked
  14306. * with three arguments: (nsValue, key, nsObject).
  14307. *
  14308. * **Note:** This method mutates `object`.
  14309. *
  14310. * @static
  14311. * @memberOf _
  14312. * @since 4.6.0
  14313. * @category Object
  14314. * @param {Object} object The object to modify.
  14315. * @param {Array|string} path The path of the property to set.
  14316. * @param {Function} updater The function to produce the updated value.
  14317. * @param {Function} [customizer] The function to customize assigned values.
  14318. * @returns {Object} Returns `object`.
  14319. * @example
  14320. *
  14321. * var object = {};
  14322. *
  14323. * _.updateWith(object, '[0][1]', _.constant('a'), Object);
  14324. * // => { '0': { '1': 'a' } }
  14325. */
  14326. function updateWith(object, path, updater, customizer) {
  14327. customizer = typeof customizer == 'function' ? customizer : undefined;
  14328. return object == null ? object : baseUpdate(object, path, castFunction(updater), customizer);
  14329. }
  14330. /**
  14331. * Creates an array of the own enumerable string keyed property values of `object`.
  14332. *
  14333. * **Note:** Non-object values are coerced to objects.
  14334. *
  14335. * @static
  14336. * @since 0.1.0
  14337. * @memberOf _
  14338. * @category Object
  14339. * @param {Object} object The object to query.
  14340. * @returns {Array} Returns the array of property values.
  14341. * @example
  14342. *
  14343. * function Foo() {
  14344. * this.a = 1;
  14345. * this.b = 2;
  14346. * }
  14347. *
  14348. * Foo.prototype.c = 3;
  14349. *
  14350. * _.values(new Foo);
  14351. * // => [1, 2] (iteration order is not guaranteed)
  14352. *
  14353. * _.values('hi');
  14354. * // => ['h', 'i']
  14355. */
  14356. function values(object) {
  14357. return object == null ? [] : baseValues(object, keys(object));
  14358. }
  14359. /**
  14360. * Creates an array of the own and inherited enumerable string keyed property
  14361. * values of `object`.
  14362. *
  14363. * **Note:** Non-object values are coerced to objects.
  14364. *
  14365. * @static
  14366. * @memberOf _
  14367. * @since 3.0.0
  14368. * @category Object
  14369. * @param {Object} object The object to query.
  14370. * @returns {Array} Returns the array of property values.
  14371. * @example
  14372. *
  14373. * function Foo() {
  14374. * this.a = 1;
  14375. * this.b = 2;
  14376. * }
  14377. *
  14378. * Foo.prototype.c = 3;
  14379. *
  14380. * _.valuesIn(new Foo);
  14381. * // => [1, 2, 3] (iteration order is not guaranteed)
  14382. */
  14383. function valuesIn(object) {
  14384. return object == null ? [] : baseValues(object, keysIn(object));
  14385. }
  14386. /*------------------------------------------------------------------------*/
  14387. /**
  14388. * Clamps `number` within the inclusive `lower` and `upper` bounds.
  14389. *
  14390. * @static
  14391. * @memberOf _
  14392. * @since 4.0.0
  14393. * @category Number
  14394. * @param {number} number The number to clamp.
  14395. * @param {number} [lower] The lower bound.
  14396. * @param {number} upper The upper bound.
  14397. * @returns {number} Returns the clamped number.
  14398. * @example
  14399. *
  14400. * _.clamp(-10, -5, 5);
  14401. * // => -5
  14402. *
  14403. * _.clamp(10, -5, 5);
  14404. * // => 5
  14405. */
  14406. function clamp(number, lower, upper) {
  14407. if (upper === undefined) {
  14408. upper = lower;
  14409. lower = undefined;
  14410. }
  14411. if (upper !== undefined) {
  14412. upper = toNumber(upper);
  14413. upper = upper === upper ? upper : 0;
  14414. }
  14415. if (lower !== undefined) {
  14416. lower = toNumber(lower);
  14417. lower = lower === lower ? lower : 0;
  14418. }
  14419. return baseClamp(toNumber(number), lower, upper);
  14420. }
  14421. /**
  14422. * Checks if `n` is between `start` and up to, but not including, `end`. If
  14423. * `end` is not specified, it's set to `start` with `start` then set to `0`.
  14424. * If `start` is greater than `end` the params are swapped to support
  14425. * negative ranges.
  14426. *
  14427. * @static
  14428. * @memberOf _
  14429. * @since 3.3.0
  14430. * @category Number
  14431. * @param {number} number The number to check.
  14432. * @param {number} [start=0] The start of the range.
  14433. * @param {number} end The end of the range.
  14434. * @returns {boolean} Returns `true` if `number` is in the range, else `false`.
  14435. * @see _.range, _.rangeRight
  14436. * @example
  14437. *
  14438. * _.inRange(3, 2, 4);
  14439. * // => true
  14440. *
  14441. * _.inRange(4, 8);
  14442. * // => true
  14443. *
  14444. * _.inRange(4, 2);
  14445. * // => false
  14446. *
  14447. * _.inRange(2, 2);
  14448. * // => false
  14449. *
  14450. * _.inRange(1.2, 2);
  14451. * // => true
  14452. *
  14453. * _.inRange(5.2, 4);
  14454. * // => false
  14455. *
  14456. * _.inRange(-3, -2, -6);
  14457. * // => true
  14458. */
  14459. function inRange(number, start, end) {
  14460. start = toFinite(start);
  14461. if (end === undefined) {
  14462. end = start;
  14463. start = 0;
  14464. } else {
  14465. end = toFinite(end);
  14466. }
  14467. number = toNumber(number);
  14468. return baseInRange(number, start, end);
  14469. }
  14470. /**
  14471. * Produces a random number between the inclusive `lower` and `upper` bounds.
  14472. * If only one argument is provided a number between `0` and the given number
  14473. * is returned. If `floating` is `true`, or either `lower` or `upper` are
  14474. * floats, a floating-point number is returned instead of an integer.
  14475. *
  14476. * **Note:** JavaScript follows the IEEE-754 standard for resolving
  14477. * floating-point values which can produce unexpected results.
  14478. *
  14479. * @static
  14480. * @memberOf _
  14481. * @since 0.7.0
  14482. * @category Number
  14483. * @param {number} [lower=0] The lower bound.
  14484. * @param {number} [upper=1] The upper bound.
  14485. * @param {boolean} [floating] Specify returning a floating-point number.
  14486. * @returns {number} Returns the random number.
  14487. * @example
  14488. *
  14489. * _.random(0, 5);
  14490. * // => an integer between 0 and 5
  14491. *
  14492. * _.random(5);
  14493. * // => also an integer between 0 and 5
  14494. *
  14495. * _.random(5, true);
  14496. * // => a floating-point number between 0 and 5
  14497. *
  14498. * _.random(1.2, 5.2);
  14499. * // => a floating-point number between 1.2 and 5.2
  14500. */
  14501. function random(lower, upper, floating) {
  14502. if (floating && typeof floating != 'boolean' && isIterateeCall(lower, upper, floating)) {
  14503. upper = floating = undefined;
  14504. }
  14505. if (floating === undefined) {
  14506. if (typeof upper == 'boolean') {
  14507. floating = upper;
  14508. upper = undefined;
  14509. }
  14510. else if (typeof lower == 'boolean') {
  14511. floating = lower;
  14512. lower = undefined;
  14513. }
  14514. }
  14515. if (lower === undefined && upper === undefined) {
  14516. lower = 0;
  14517. upper = 1;
  14518. }
  14519. else {
  14520. lower = toFinite(lower);
  14521. if (upper === undefined) {
  14522. upper = lower;
  14523. lower = 0;
  14524. } else {
  14525. upper = toFinite(upper);
  14526. }
  14527. }
  14528. if (lower > upper) {
  14529. var temp = lower;
  14530. lower = upper;
  14531. upper = temp;
  14532. }
  14533. if (floating || lower % 1 || upper % 1) {
  14534. var rand = nativeRandom();
  14535. return nativeMin(lower + (rand * (upper - lower + freeParseFloat('1e-' + ((rand + '').length - 1)))), upper);
  14536. }
  14537. return baseRandom(lower, upper);
  14538. }
  14539. /*------------------------------------------------------------------------*/
  14540. /**
  14541. * Converts `string` to [camel case](https://en.wikipedia.org/wiki/CamelCase).
  14542. *
  14543. * @static
  14544. * @memberOf _
  14545. * @since 3.0.0
  14546. * @category String
  14547. * @param {string} [string=''] The string to convert.
  14548. * @returns {string} Returns the camel cased string.
  14549. * @example
  14550. *
  14551. * _.camelCase('Foo Bar');
  14552. * // => 'fooBar'
  14553. *
  14554. * _.camelCase('--foo-bar--');
  14555. * // => 'fooBar'
  14556. *
  14557. * _.camelCase('__FOO_BAR__');
  14558. * // => 'fooBar'
  14559. */
  14560. var camelCase = createCompounder(function(result, word, index) {
  14561. word = word.toLowerCase();
  14562. return result + (index ? capitalize(word) : word);
  14563. });
  14564. /**
  14565. * Converts the first character of `string` to upper case and the remaining
  14566. * to lower case.
  14567. *
  14568. * @static
  14569. * @memberOf _
  14570. * @since 3.0.0
  14571. * @category String
  14572. * @param {string} [string=''] The string to capitalize.
  14573. * @returns {string} Returns the capitalized string.
  14574. * @example
  14575. *
  14576. * _.capitalize('FRED');
  14577. * // => 'Fred'
  14578. */
  14579. function capitalize(string) {
  14580. return upperFirst(toString(string).toLowerCase());
  14581. }
  14582. /**
  14583. * Deburrs `string` by converting
  14584. * [Latin-1 Supplement](https://en.wikipedia.org/wiki/Latin-1_Supplement_(Unicode_block)#Character_table)
  14585. * and [Latin Extended-A](https://en.wikipedia.org/wiki/Latin_Extended-A)
  14586. * letters to basic Latin letters and removing
  14587. * [combining diacritical marks](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks).
  14588. *
  14589. * @static
  14590. * @memberOf _
  14591. * @since 3.0.0
  14592. * @category String
  14593. * @param {string} [string=''] The string to deburr.
  14594. * @returns {string} Returns the deburred string.
  14595. * @example
  14596. *
  14597. * _.deburr('déjà vu');
  14598. * // => 'deja vu'
  14599. */
  14600. function deburr(string) {
  14601. string = toString(string);
  14602. return string && string.replace(reLatin, deburrLetter).replace(reComboMark, '');
  14603. }
  14604. /**
  14605. * Checks if `string` ends with the given target string.
  14606. *
  14607. * @static
  14608. * @memberOf _
  14609. * @since 3.0.0
  14610. * @category String
  14611. * @param {string} [string=''] The string to inspect.
  14612. * @param {string} [target] The string to search for.
  14613. * @param {number} [position=string.length] The position to search up to.
  14614. * @returns {boolean} Returns `true` if `string` ends with `target`,
  14615. * else `false`.
  14616. * @example
  14617. *
  14618. * _.endsWith('abc', 'c');
  14619. * // => true
  14620. *
  14621. * _.endsWith('abc', 'b');
  14622. * // => false
  14623. *
  14624. * _.endsWith('abc', 'b', 2);
  14625. * // => true
  14626. */
  14627. function endsWith(string, target, position) {
  14628. string = toString(string);
  14629. target = baseToString(target);
  14630. var length = string.length;
  14631. position = position === undefined
  14632. ? length
  14633. : baseClamp(toInteger(position), 0, length);
  14634. var end = position;
  14635. position -= target.length;
  14636. return position >= 0 && string.slice(position, end) == target;
  14637. }
  14638. /**
  14639. * Converts the characters "&", "<", ">", '"', and "'" in `string` to their
  14640. * corresponding HTML entities.
  14641. *
  14642. * **Note:** No other characters are escaped. To escape additional
  14643. * characters use a third-party library like [_he_](https://mths.be/he).
  14644. *
  14645. * Though the ">" character is escaped for symmetry, characters like
  14646. * ">" and "/" don't need escaping in HTML and have no special meaning
  14647. * unless they're part of a tag or unquoted attribute value. See
  14648. * [Mathias Bynens's article](https://mathiasbynens.be/notes/ambiguous-ampersands)
  14649. * (under "semi-related fun fact") for more details.
  14650. *
  14651. * When working with HTML you should always
  14652. * [quote attribute values](http://wonko.com/post/html-escaping) to reduce
  14653. * XSS vectors.
  14654. *
  14655. * @static
  14656. * @since 0.1.0
  14657. * @memberOf _
  14658. * @category String
  14659. * @param {string} [string=''] The string to escape.
  14660. * @returns {string} Returns the escaped string.
  14661. * @example
  14662. *
  14663. * _.escape('fred, barney, & pebbles');
  14664. * // => 'fred, barney, &amp; pebbles'
  14665. */
  14666. function escape(string) {
  14667. string = toString(string);
  14668. return (string && reHasUnescapedHtml.test(string))
  14669. ? string.replace(reUnescapedHtml, escapeHtmlChar)
  14670. : string;
  14671. }
  14672. /**
  14673. * Escapes the `RegExp` special characters "^", "$", "\", ".", "*", "+",
  14674. * "?", "(", ")", "[", "]", "{", "}", and "|" in `string`.
  14675. *
  14676. * @static
  14677. * @memberOf _
  14678. * @since 3.0.0
  14679. * @category String
  14680. * @param {string} [string=''] The string to escape.
  14681. * @returns {string} Returns the escaped string.
  14682. * @example
  14683. *
  14684. * _.escapeRegExp('[lodash](https://lodash.com/)');
  14685. * // => '\[lodash\]\(https://lodash\.com/\)'
  14686. */
  14687. function escapeRegExp(string) {
  14688. string = toString(string);
  14689. return (string && reHasRegExpChar.test(string))
  14690. ? string.replace(reRegExpChar, '\\$&')
  14691. : string;
  14692. }
  14693. /**
  14694. * Converts `string` to
  14695. * [kebab case](https://en.wikipedia.org/wiki/Letter_case#Special_case_styles).
  14696. *
  14697. * @static
  14698. * @memberOf _
  14699. * @since 3.0.0
  14700. * @category String
  14701. * @param {string} [string=''] The string to convert.
  14702. * @returns {string} Returns the kebab cased string.
  14703. * @example
  14704. *
  14705. * _.kebabCase('Foo Bar');
  14706. * // => 'foo-bar'
  14707. *
  14708. * _.kebabCase('fooBar');
  14709. * // => 'foo-bar'
  14710. *
  14711. * _.kebabCase('__FOO_BAR__');
  14712. * // => 'foo-bar'
  14713. */
  14714. var kebabCase = createCompounder(function(result, word, index) {
  14715. return result + (index ? '-' : '') + word.toLowerCase();
  14716. });
  14717. /**
  14718. * Converts `string`, as space separated words, to lower case.
  14719. *
  14720. * @static
  14721. * @memberOf _
  14722. * @since 4.0.0
  14723. * @category String
  14724. * @param {string} [string=''] The string to convert.
  14725. * @returns {string} Returns the lower cased string.
  14726. * @example
  14727. *
  14728. * _.lowerCase('--Foo-Bar--');
  14729. * // => 'foo bar'
  14730. *
  14731. * _.lowerCase('fooBar');
  14732. * // => 'foo bar'
  14733. *
  14734. * _.lowerCase('__FOO_BAR__');
  14735. * // => 'foo bar'
  14736. */
  14737. var lowerCase = createCompounder(function(result, word, index) {
  14738. return result + (index ? ' ' : '') + word.toLowerCase();
  14739. });
  14740. /**
  14741. * Converts the first character of `string` to lower case.
  14742. *
  14743. * @static
  14744. * @memberOf _
  14745. * @since 4.0.0
  14746. * @category String
  14747. * @param {string} [string=''] The string to convert.
  14748. * @returns {string} Returns the converted string.
  14749. * @example
  14750. *
  14751. * _.lowerFirst('Fred');
  14752. * // => 'fred'
  14753. *
  14754. * _.lowerFirst('FRED');
  14755. * // => 'fRED'
  14756. */
  14757. var lowerFirst = createCaseFirst('toLowerCase');
  14758. /**
  14759. * Pads `string` on the left and right sides if it's shorter than `length`.
  14760. * Padding characters are truncated if they can't be evenly divided by `length`.
  14761. *
  14762. * @static
  14763. * @memberOf _
  14764. * @since 3.0.0
  14765. * @category String
  14766. * @param {string} [string=''] The string to pad.
  14767. * @param {number} [length=0] The padding length.
  14768. * @param {string} [chars=' '] The string used as padding.
  14769. * @returns {string} Returns the padded string.
  14770. * @example
  14771. *
  14772. * _.pad('abc', 8);
  14773. * // => ' abc '
  14774. *
  14775. * _.pad('abc', 8, '_-');
  14776. * // => '_-abc_-_'
  14777. *
  14778. * _.pad('abc', 3);
  14779. * // => 'abc'
  14780. */
  14781. function pad(string, length, chars) {
  14782. string = toString(string);
  14783. length = toInteger(length);
  14784. var strLength = length ? stringSize(string) : 0;
  14785. if (!length || strLength >= length) {
  14786. return string;
  14787. }
  14788. var mid = (length - strLength) / 2;
  14789. return (
  14790. createPadding(nativeFloor(mid), chars) +
  14791. string +
  14792. createPadding(nativeCeil(mid), chars)
  14793. );
  14794. }
  14795. /**
  14796. * Pads `string` on the right side if it's shorter than `length`. Padding
  14797. * characters are truncated if they exceed `length`.
  14798. *
  14799. * @static
  14800. * @memberOf _
  14801. * @since 4.0.0
  14802. * @category String
  14803. * @param {string} [string=''] The string to pad.
  14804. * @param {number} [length=0] The padding length.
  14805. * @param {string} [chars=' '] The string used as padding.
  14806. * @returns {string} Returns the padded string.
  14807. * @example
  14808. *
  14809. * _.padEnd('abc', 6);
  14810. * // => 'abc '
  14811. *
  14812. * _.padEnd('abc', 6, '_-');
  14813. * // => 'abc_-_'
  14814. *
  14815. * _.padEnd('abc', 3);
  14816. * // => 'abc'
  14817. */
  14818. function padEnd(string, length, chars) {
  14819. string = toString(string);
  14820. length = toInteger(length);
  14821. var strLength = length ? stringSize(string) : 0;
  14822. return (length && strLength < length)
  14823. ? (string + createPadding(length - strLength, chars))
  14824. : string;
  14825. }
  14826. /**
  14827. * Pads `string` on the left side if it's shorter than `length`. Padding
  14828. * characters are truncated if they exceed `length`.
  14829. *
  14830. * @static
  14831. * @memberOf _
  14832. * @since 4.0.0
  14833. * @category String
  14834. * @param {string} [string=''] The string to pad.
  14835. * @param {number} [length=0] The padding length.
  14836. * @param {string} [chars=' '] The string used as padding.
  14837. * @returns {string} Returns the padded string.
  14838. * @example
  14839. *
  14840. * _.padStart('abc', 6);
  14841. * // => ' abc'
  14842. *
  14843. * _.padStart('abc', 6, '_-');
  14844. * // => '_-_abc'
  14845. *
  14846. * _.padStart('abc', 3);
  14847. * // => 'abc'
  14848. */
  14849. function padStart(string, length, chars) {
  14850. string = toString(string);
  14851. length = toInteger(length);
  14852. var strLength = length ? stringSize(string) : 0;
  14853. return (length && strLength < length)
  14854. ? (createPadding(length - strLength, chars) + string)
  14855. : string;
  14856. }
  14857. /**
  14858. * Converts `string` to an integer of the specified radix. If `radix` is
  14859. * `undefined` or `0`, a `radix` of `10` is used unless `value` is a
  14860. * hexadecimal, in which case a `radix` of `16` is used.
  14861. *
  14862. * **Note:** This method aligns with the
  14863. * [ES5 implementation](https://es5.github.io/#x15.1.2.2) of `parseInt`.
  14864. *
  14865. * @static
  14866. * @memberOf _
  14867. * @since 1.1.0
  14868. * @category String
  14869. * @param {string} string The string to convert.
  14870. * @param {number} [radix=10] The radix to interpret `value` by.
  14871. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  14872. * @returns {number} Returns the converted integer.
  14873. * @example
  14874. *
  14875. * _.parseInt('08');
  14876. * // => 8
  14877. *
  14878. * _.map(['6', '08', '10'], _.parseInt);
  14879. * // => [6, 8, 10]
  14880. */
  14881. function parseInt(string, radix, guard) {
  14882. if (guard || radix == null) {
  14883. radix = 0;
  14884. } else if (radix) {
  14885. radix = +radix;
  14886. }
  14887. return nativeParseInt(toString(string).replace(reTrimStart, ''), radix || 0);
  14888. }
  14889. /**
  14890. * Repeats the given string `n` times.
  14891. *
  14892. * @static
  14893. * @memberOf _
  14894. * @since 3.0.0
  14895. * @category String
  14896. * @param {string} [string=''] The string to repeat.
  14897. * @param {number} [n=1] The number of times to repeat the string.
  14898. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  14899. * @returns {string} Returns the repeated string.
  14900. * @example
  14901. *
  14902. * _.repeat('*', 3);
  14903. * // => '***'
  14904. *
  14905. * _.repeat('abc', 2);
  14906. * // => 'abcabc'
  14907. *
  14908. * _.repeat('abc', 0);
  14909. * // => ''
  14910. */
  14911. function repeat(string, n, guard) {
  14912. if ((guard ? isIterateeCall(string, n, guard) : n === undefined)) {
  14913. n = 1;
  14914. } else {
  14915. n = toInteger(n);
  14916. }
  14917. return baseRepeat(toString(string), n);
  14918. }
  14919. /**
  14920. * Replaces matches for `pattern` in `string` with `replacement`.
  14921. *
  14922. * **Note:** This method is based on
  14923. * [`String#replace`](https://mdn.io/String/replace).
  14924. *
  14925. * @static
  14926. * @memberOf _
  14927. * @since 4.0.0
  14928. * @category String
  14929. * @param {string} [string=''] The string to modify.
  14930. * @param {RegExp|string} pattern The pattern to replace.
  14931. * @param {Function|string} replacement The match replacement.
  14932. * @returns {string} Returns the modified string.
  14933. * @example
  14934. *
  14935. * _.replace('Hi Fred', 'Fred', 'Barney');
  14936. * // => 'Hi Barney'
  14937. */
  14938. function replace() {
  14939. var args = arguments,
  14940. string = toString(args[0]);
  14941. return args.length < 3 ? string : string.replace(args[1], args[2]);
  14942. }
  14943. /**
  14944. * Converts `string` to
  14945. * [snake case](https://en.wikipedia.org/wiki/Snake_case).
  14946. *
  14947. * @static
  14948. * @memberOf _
  14949. * @since 3.0.0
  14950. * @category String
  14951. * @param {string} [string=''] The string to convert.
  14952. * @returns {string} Returns the snake cased string.
  14953. * @example
  14954. *
  14955. * _.snakeCase('Foo Bar');
  14956. * // => 'foo_bar'
  14957. *
  14958. * _.snakeCase('fooBar');
  14959. * // => 'foo_bar'
  14960. *
  14961. * _.snakeCase('--FOO-BAR--');
  14962. * // => 'foo_bar'
  14963. */
  14964. var snakeCase = createCompounder(function(result, word, index) {
  14965. return result + (index ? '_' : '') + word.toLowerCase();
  14966. });
  14967. /**
  14968. * Splits `string` by `separator`.
  14969. *
  14970. * **Note:** This method is based on
  14971. * [`String#split`](https://mdn.io/String/split).
  14972. *
  14973. * @static
  14974. * @memberOf _
  14975. * @since 4.0.0
  14976. * @category String
  14977. * @param {string} [string=''] The string to split.
  14978. * @param {RegExp|string} separator The separator pattern to split by.
  14979. * @param {number} [limit] The length to truncate results to.
  14980. * @returns {Array} Returns the string segments.
  14981. * @example
  14982. *
  14983. * _.split('a-b-c', '-', 2);
  14984. * // => ['a', 'b']
  14985. */
  14986. function split(string, separator, limit) {
  14987. if (limit && typeof limit != 'number' && isIterateeCall(string, separator, limit)) {
  14988. separator = limit = undefined;
  14989. }
  14990. limit = limit === undefined ? MAX_ARRAY_LENGTH : limit >>> 0;
  14991. if (!limit) {
  14992. return [];
  14993. }
  14994. string = toString(string);
  14995. if (string && (
  14996. typeof separator == 'string' ||
  14997. (separator != null && !isRegExp(separator))
  14998. )) {
  14999. separator = baseToString(separator);
  15000. if (!separator && hasUnicode(string)) {
  15001. return castSlice(stringToArray(string), 0, limit);
  15002. }
  15003. }
  15004. return string.split(separator, limit);
  15005. }
  15006. /**
  15007. * Converts `string` to
  15008. * [start case](https://en.wikipedia.org/wiki/Letter_case#Stylistic_or_specialised_usage).
  15009. *
  15010. * @static
  15011. * @memberOf _
  15012. * @since 3.1.0
  15013. * @category String
  15014. * @param {string} [string=''] The string to convert.
  15015. * @returns {string} Returns the start cased string.
  15016. * @example
  15017. *
  15018. * _.startCase('--foo-bar--');
  15019. * // => 'Foo Bar'
  15020. *
  15021. * _.startCase('fooBar');
  15022. * // => 'Foo Bar'
  15023. *
  15024. * _.startCase('__FOO_BAR__');
  15025. * // => 'FOO BAR'
  15026. */
  15027. var startCase = createCompounder(function(result, word, index) {
  15028. return result + (index ? ' ' : '') + upperFirst(word);
  15029. });
  15030. /**
  15031. * Checks if `string` starts with the given target string.
  15032. *
  15033. * @static
  15034. * @memberOf _
  15035. * @since 3.0.0
  15036. * @category String
  15037. * @param {string} [string=''] The string to inspect.
  15038. * @param {string} [target] The string to search for.
  15039. * @param {number} [position=0] The position to search from.
  15040. * @returns {boolean} Returns `true` if `string` starts with `target`,
  15041. * else `false`.
  15042. * @example
  15043. *
  15044. * _.startsWith('abc', 'a');
  15045. * // => true
  15046. *
  15047. * _.startsWith('abc', 'b');
  15048. * // => false
  15049. *
  15050. * _.startsWith('abc', 'b', 1);
  15051. * // => true
  15052. */
  15053. function startsWith(string, target, position) {
  15054. string = toString(string);
  15055. position = position == null
  15056. ? 0
  15057. : baseClamp(toInteger(position), 0, string.length);
  15058. target = baseToString(target);
  15059. return string.slice(position, position + target.length) == target;
  15060. }
  15061. /**
  15062. * Creates a compiled template function that can interpolate data properties
  15063. * in "interpolate" delimiters, HTML-escape interpolated data properties in
  15064. * "escape" delimiters, and execute JavaScript in "evaluate" delimiters. Data
  15065. * properties may be accessed as free variables in the template. If a setting
  15066. * object is given, it takes precedence over `_.templateSettings` values.
  15067. *
  15068. * **Note:** In the development build `_.template` utilizes
  15069. * [sourceURLs](http://www.html5rocks.com/en/tutorials/developertools/sourcemaps/#toc-sourceurl)
  15070. * for easier debugging.
  15071. *
  15072. * For more information on precompiling templates see
  15073. * [lodash's custom builds documentation](https://lodash.com/custom-builds).
  15074. *
  15075. * For more information on Chrome extension sandboxes see
  15076. * [Chrome's extensions documentation](https://developer.chrome.com/extensions/sandboxingEval).
  15077. *
  15078. * @static
  15079. * @since 0.1.0
  15080. * @memberOf _
  15081. * @category String
  15082. * @param {string} [string=''] The template string.
  15083. * @param {Object} [options={}] The options object.
  15084. * @param {RegExp} [options.escape=_.templateSettings.escape]
  15085. * The HTML "escape" delimiter.
  15086. * @param {RegExp} [options.evaluate=_.templateSettings.evaluate]
  15087. * The "evaluate" delimiter.
  15088. * @param {Object} [options.imports=_.templateSettings.imports]
  15089. * An object to import into the template as free variables.
  15090. * @param {RegExp} [options.interpolate=_.templateSettings.interpolate]
  15091. * The "interpolate" delimiter.
  15092. * @param {string} [options.sourceURL='lodash.templateSources[n]']
  15093. * The sourceURL of the compiled template.
  15094. * @param {string} [options.variable='obj']
  15095. * The data object variable name.
  15096. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  15097. * @returns {Function} Returns the compiled template function.
  15098. * @example
  15099. *
  15100. * // Use the "interpolate" delimiter to create a compiled template.
  15101. * var compiled = _.template('hello <%= user %>!');
  15102. * compiled({ 'user': 'fred' });
  15103. * // => 'hello fred!'
  15104. *
  15105. * // Use the HTML "escape" delimiter to escape data property values.
  15106. * var compiled = _.template('<b><%- value %></b>');
  15107. * compiled({ 'value': '<script>' });
  15108. * // => '<b>&lt;script&gt;</b>'
  15109. *
  15110. * // Use the "evaluate" delimiter to execute JavaScript and generate HTML.
  15111. * var compiled = _.template('<% _.forEach(users, function(user) { %><li><%- user %></li><% }); %>');
  15112. * compiled({ 'users': ['fred', 'barney'] });
  15113. * // => '<li>fred</li><li>barney</li>'
  15114. *
  15115. * // Use the internal `print` function in "evaluate" delimiters.
  15116. * var compiled = _.template('<% print("hello " + user); %>!');
  15117. * compiled({ 'user': 'barney' });
  15118. * // => 'hello barney!'
  15119. *
  15120. * // Use the ES template literal delimiter as an "interpolate" delimiter.
  15121. * // Disable support by replacing the "interpolate" delimiter.
  15122. * var compiled = _.template('hello ${ user }!');
  15123. * compiled({ 'user': 'pebbles' });
  15124. * // => 'hello pebbles!'
  15125. *
  15126. * // Use backslashes to treat delimiters as plain text.
  15127. * var compiled = _.template('<%= "\\<%- value %\\>" %>');
  15128. * compiled({ 'value': 'ignored' });
  15129. * // => '<%- value %>'
  15130. *
  15131. * // Use the `imports` option to import `jQuery` as `jq`.
  15132. * var text = '<% jq.each(users, function(user) { %><li><%- user %></li><% }); %>';
  15133. * var compiled = _.template(text, { 'imports': { 'jq': jQuery } });
  15134. * compiled({ 'users': ['fred', 'barney'] });
  15135. * // => '<li>fred</li><li>barney</li>'
  15136. *
  15137. * // Use the `sourceURL` option to specify a custom sourceURL for the template.
  15138. * var compiled = _.template('hello <%= user %>!', { 'sourceURL': '/basic/greeting.jst' });
  15139. * compiled(data);
  15140. * // => Find the source of "greeting.jst" under the Sources tab or Resources panel of the web inspector.
  15141. *
  15142. * // Use the `variable` option to ensure a with-statement isn't used in the compiled template.
  15143. * var compiled = _.template('hi <%= data.user %>!', { 'variable': 'data' });
  15144. * compiled.source;
  15145. * // => function(data) {
  15146. * // var __t, __p = '';
  15147. * // __p += 'hi ' + ((__t = ( data.user )) == null ? '' : __t) + '!';
  15148. * // return __p;
  15149. * // }
  15150. *
  15151. * // Use custom template delimiters.
  15152. * _.templateSettings.interpolate = /{{([\s\S]+?)}}/g;
  15153. * var compiled = _.template('hello {{ user }}!');
  15154. * compiled({ 'user': 'mustache' });
  15155. * // => 'hello mustache!'
  15156. *
  15157. * // Use the `source` property to inline compiled templates for meaningful
  15158. * // line numbers in error messages and stack traces.
  15159. * fs.writeFileSync(path.join(process.cwd(), 'jst.js'), '\
  15160. * var JST = {\
  15161. * "main": ' + _.template(mainText).source + '\
  15162. * };\
  15163. * ');
  15164. */
  15165. function template(string, options, guard) {
  15166. // Based on John Resig's `tmpl` implementation
  15167. // (http://ejohn.org/blog/javascript-micro-templating/)
  15168. // and Laura Doktorova's doT.js (https://github.com/olado/doT).
  15169. var settings = lodash.templateSettings;
  15170. if (guard && isIterateeCall(string, options, guard)) {
  15171. options = undefined;
  15172. }
  15173. string = toString(string);
  15174. options = assignInWith({}, options, settings, customDefaultsAssignIn);
  15175. var imports = assignInWith({}, options.imports, settings.imports, customDefaultsAssignIn),
  15176. importsKeys = keys(imports),
  15177. importsValues = baseValues(imports, importsKeys);
  15178. var isEscaping,
  15179. isEvaluating,
  15180. index = 0,
  15181. interpolate = options.interpolate || reNoMatch,
  15182. source = "__p += '";
  15183. // Compile the regexp to match each delimiter.
  15184. var reDelimiters = RegExp(
  15185. (options.escape || reNoMatch).source + '|' +
  15186. interpolate.source + '|' +
  15187. (interpolate === reInterpolate ? reEsTemplate : reNoMatch).source + '|' +
  15188. (options.evaluate || reNoMatch).source + '|$'
  15189. , 'g');
  15190. // Use a sourceURL for easier debugging.
  15191. // The sourceURL gets injected into the source that's eval-ed, so be careful
  15192. // to normalize all kinds of whitespace, so e.g. newlines (and unicode versions of it) can't sneak in
  15193. // and escape the comment, thus injecting code that gets evaled.
  15194. var sourceURL = '//# sourceURL=' +
  15195. (hasOwnProperty.call(options, 'sourceURL')
  15196. ? (options.sourceURL + '').replace(/\s/g, ' ')
  15197. : ('lodash.templateSources[' + (++templateCounter) + ']')
  15198. ) + '\n';
  15199. string.replace(reDelimiters, function(match, escapeValue, interpolateValue, esTemplateValue, evaluateValue, offset) {
  15200. interpolateValue || (interpolateValue = esTemplateValue);
  15201. // Escape characters that can't be included in string literals.
  15202. source += string.slice(index, offset).replace(reUnescapedString, escapeStringChar);
  15203. // Replace delimiters with snippets.
  15204. if (escapeValue) {
  15205. isEscaping = true;
  15206. source += "' +\n__e(" + escapeValue + ") +\n'";
  15207. }
  15208. if (evaluateValue) {
  15209. isEvaluating = true;
  15210. source += "';\n" + evaluateValue + ";\n__p += '";
  15211. }
  15212. if (interpolateValue) {
  15213. source += "' +\n((__t = (" + interpolateValue + ")) == null ? '' : __t) +\n'";
  15214. }
  15215. index = offset + match.length;
  15216. // The JS engine embedded in Adobe products needs `match` returned in
  15217. // order to produce the correct `offset` value.
  15218. return match;
  15219. });
  15220. source += "';\n";
  15221. // If `variable` is not specified wrap a with-statement around the generated
  15222. // code to add the data object to the top of the scope chain.
  15223. var variable = hasOwnProperty.call(options, 'variable') && options.variable;
  15224. if (!variable) {
  15225. source = 'with (obj) {\n' + source + '\n}\n';
  15226. }
  15227. // Throw an error if a forbidden character was found in `variable`, to prevent
  15228. // potential command injection attacks.
  15229. else if (reForbiddenIdentifierChars.test(variable)) {
  15230. throw new Error(INVALID_TEMPL_VAR_ERROR_TEXT);
  15231. }
  15232. // Cleanup code by stripping empty strings.
  15233. source = (isEvaluating ? source.replace(reEmptyStringLeading, '') : source)
  15234. .replace(reEmptyStringMiddle, '$1')
  15235. .replace(reEmptyStringTrailing, '$1;');
  15236. // Frame code as the function body.
  15237. source = 'function(' + (variable || 'obj') + ') {\n' +
  15238. (variable
  15239. ? ''
  15240. : 'obj || (obj = {});\n'
  15241. ) +
  15242. "var __t, __p = ''" +
  15243. (isEscaping
  15244. ? ', __e = _.escape'
  15245. : ''
  15246. ) +
  15247. (isEvaluating
  15248. ? ', __j = Array.prototype.join;\n' +
  15249. "function print() { __p += __j.call(arguments, '') }\n"
  15250. : ';\n'
  15251. ) +
  15252. source +
  15253. 'return __p\n}';
  15254. var result = attempt(function() {
  15255. return Function(importsKeys, sourceURL + 'return ' + source)
  15256. .apply(undefined, importsValues);
  15257. });
  15258. // Provide the compiled function's source by its `toString` method or
  15259. // the `source` property as a convenience for inlining compiled templates.
  15260. result.source = source;
  15261. if (isError(result)) {
  15262. throw result;
  15263. }
  15264. return result;
  15265. }
  15266. /**
  15267. * Converts `string`, as a whole, to lower case just like
  15268. * [String#toLowerCase](https://mdn.io/toLowerCase).
  15269. *
  15270. * @static
  15271. * @memberOf _
  15272. * @since 4.0.0
  15273. * @category String
  15274. * @param {string} [string=''] The string to convert.
  15275. * @returns {string} Returns the lower cased string.
  15276. * @example
  15277. *
  15278. * _.toLower('--Foo-Bar--');
  15279. * // => '--foo-bar--'
  15280. *
  15281. * _.toLower('fooBar');
  15282. * // => 'foobar'
  15283. *
  15284. * _.toLower('__FOO_BAR__');
  15285. * // => '__foo_bar__'
  15286. */
  15287. function toLower(value) {
  15288. return toString(value).toLowerCase();
  15289. }
  15290. /**
  15291. * Converts `string`, as a whole, to upper case just like
  15292. * [String#toUpperCase](https://mdn.io/toUpperCase).
  15293. *
  15294. * @static
  15295. * @memberOf _
  15296. * @since 4.0.0
  15297. * @category String
  15298. * @param {string} [string=''] The string to convert.
  15299. * @returns {string} Returns the upper cased string.
  15300. * @example
  15301. *
  15302. * _.toUpper('--foo-bar--');
  15303. * // => '--FOO-BAR--'
  15304. *
  15305. * _.toUpper('fooBar');
  15306. * // => 'FOOBAR'
  15307. *
  15308. * _.toUpper('__foo_bar__');
  15309. * // => '__FOO_BAR__'
  15310. */
  15311. function toUpper(value) {
  15312. return toString(value).toUpperCase();
  15313. }
  15314. /**
  15315. * Removes leading and trailing whitespace or specified characters from `string`.
  15316. *
  15317. * @static
  15318. * @memberOf _
  15319. * @since 3.0.0
  15320. * @category String
  15321. * @param {string} [string=''] The string to trim.
  15322. * @param {string} [chars=whitespace] The characters to trim.
  15323. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  15324. * @returns {string} Returns the trimmed string.
  15325. * @example
  15326. *
  15327. * _.trim(' abc ');
  15328. * // => 'abc'
  15329. *
  15330. * _.trim('-_-abc-_-', '_-');
  15331. * // => 'abc'
  15332. *
  15333. * _.map([' foo ', ' bar '], _.trim);
  15334. * // => ['foo', 'bar']
  15335. */
  15336. function trim(string, chars, guard) {
  15337. string = toString(string);
  15338. if (string && (guard || chars === undefined)) {
  15339. return baseTrim(string);
  15340. }
  15341. if (!string || !(chars = baseToString(chars))) {
  15342. return string;
  15343. }
  15344. var strSymbols = stringToArray(string),
  15345. chrSymbols = stringToArray(chars),
  15346. start = charsStartIndex(strSymbols, chrSymbols),
  15347. end = charsEndIndex(strSymbols, chrSymbols) + 1;
  15348. return castSlice(strSymbols, start, end).join('');
  15349. }
  15350. /**
  15351. * Removes trailing whitespace or specified characters from `string`.
  15352. *
  15353. * @static
  15354. * @memberOf _
  15355. * @since 4.0.0
  15356. * @category String
  15357. * @param {string} [string=''] The string to trim.
  15358. * @param {string} [chars=whitespace] The characters to trim.
  15359. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  15360. * @returns {string} Returns the trimmed string.
  15361. * @example
  15362. *
  15363. * _.trimEnd(' abc ');
  15364. * // => ' abc'
  15365. *
  15366. * _.trimEnd('-_-abc-_-', '_-');
  15367. * // => '-_-abc'
  15368. */
  15369. function trimEnd(string, chars, guard) {
  15370. string = toString(string);
  15371. if (string && (guard || chars === undefined)) {
  15372. return string.slice(0, trimmedEndIndex(string) + 1);
  15373. }
  15374. if (!string || !(chars = baseToString(chars))) {
  15375. return string;
  15376. }
  15377. var strSymbols = stringToArray(string),
  15378. end = charsEndIndex(strSymbols, stringToArray(chars)) + 1;
  15379. return castSlice(strSymbols, 0, end).join('');
  15380. }
  15381. /**
  15382. * Removes leading whitespace or specified characters from `string`.
  15383. *
  15384. * @static
  15385. * @memberOf _
  15386. * @since 4.0.0
  15387. * @category String
  15388. * @param {string} [string=''] The string to trim.
  15389. * @param {string} [chars=whitespace] The characters to trim.
  15390. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  15391. * @returns {string} Returns the trimmed string.
  15392. * @example
  15393. *
  15394. * _.trimStart(' abc ');
  15395. * // => 'abc '
  15396. *
  15397. * _.trimStart('-_-abc-_-', '_-');
  15398. * // => 'abc-_-'
  15399. */
  15400. function trimStart(string, chars, guard) {
  15401. string = toString(string);
  15402. if (string && (guard || chars === undefined)) {
  15403. return string.replace(reTrimStart, '');
  15404. }
  15405. if (!string || !(chars = baseToString(chars))) {
  15406. return string;
  15407. }
  15408. var strSymbols = stringToArray(string),
  15409. start = charsStartIndex(strSymbols, stringToArray(chars));
  15410. return castSlice(strSymbols, start).join('');
  15411. }
  15412. /**
  15413. * Truncates `string` if it's longer than the given maximum string length.
  15414. * The last characters of the truncated string are replaced with the omission
  15415. * string which defaults to "...".
  15416. *
  15417. * @static
  15418. * @memberOf _
  15419. * @since 4.0.0
  15420. * @category String
  15421. * @param {string} [string=''] The string to truncate.
  15422. * @param {Object} [options={}] The options object.
  15423. * @param {number} [options.length=30] The maximum string length.
  15424. * @param {string} [options.omission='...'] The string to indicate text is omitted.
  15425. * @param {RegExp|string} [options.separator] The separator pattern to truncate to.
  15426. * @returns {string} Returns the truncated string.
  15427. * @example
  15428. *
  15429. * _.truncate('hi-diddly-ho there, neighborino');
  15430. * // => 'hi-diddly-ho there, neighbo...'
  15431. *
  15432. * _.truncate('hi-diddly-ho there, neighborino', {
  15433. * 'length': 24,
  15434. * 'separator': ' '
  15435. * });
  15436. * // => 'hi-diddly-ho there,...'
  15437. *
  15438. * _.truncate('hi-diddly-ho there, neighborino', {
  15439. * 'length': 24,
  15440. * 'separator': /,? +/
  15441. * });
  15442. * // => 'hi-diddly-ho there...'
  15443. *
  15444. * _.truncate('hi-diddly-ho there, neighborino', {
  15445. * 'omission': ' [...]'
  15446. * });
  15447. * // => 'hi-diddly-ho there, neig [...]'
  15448. */
  15449. function truncate(string, options) {
  15450. var length = DEFAULT_TRUNC_LENGTH,
  15451. omission = DEFAULT_TRUNC_OMISSION;
  15452. if (isObject(options)) {
  15453. var separator = 'separator' in options ? options.separator : separator;
  15454. length = 'length' in options ? toInteger(options.length) : length;
  15455. omission = 'omission' in options ? baseToString(options.omission) : omission;
  15456. }
  15457. string = toString(string);
  15458. var strLength = string.length;
  15459. if (hasUnicode(string)) {
  15460. var strSymbols = stringToArray(string);
  15461. strLength = strSymbols.length;
  15462. }
  15463. if (length >= strLength) {
  15464. return string;
  15465. }
  15466. var end = length - stringSize(omission);
  15467. if (end < 1) {
  15468. return omission;
  15469. }
  15470. var result = strSymbols
  15471. ? castSlice(strSymbols, 0, end).join('')
  15472. : string.slice(0, end);
  15473. if (separator === undefined) {
  15474. return result + omission;
  15475. }
  15476. if (strSymbols) {
  15477. end += (result.length - end);
  15478. }
  15479. if (isRegExp(separator)) {
  15480. if (string.slice(end).search(separator)) {
  15481. var match,
  15482. substring = result;
  15483. if (!separator.global) {
  15484. separator = RegExp(separator.source, toString(reFlags.exec(separator)) + 'g');
  15485. }
  15486. separator.lastIndex = 0;
  15487. while ((match = separator.exec(substring))) {
  15488. var newEnd = match.index;
  15489. }
  15490. result = result.slice(0, newEnd === undefined ? end : newEnd);
  15491. }
  15492. } else if (string.indexOf(baseToString(separator), end) != end) {
  15493. var index = result.lastIndexOf(separator);
  15494. if (index > -1) {
  15495. result = result.slice(0, index);
  15496. }
  15497. }
  15498. return result + omission;
  15499. }
  15500. /**
  15501. * The inverse of `_.escape`; this method converts the HTML entities
  15502. * `&amp;`, `&lt;`, `&gt;`, `&quot;`, and `&#39;` in `string` to
  15503. * their corresponding characters.
  15504. *
  15505. * **Note:** No other HTML entities are unescaped. To unescape additional
  15506. * HTML entities use a third-party library like [_he_](https://mths.be/he).
  15507. *
  15508. * @static
  15509. * @memberOf _
  15510. * @since 0.6.0
  15511. * @category String
  15512. * @param {string} [string=''] The string to unescape.
  15513. * @returns {string} Returns the unescaped string.
  15514. * @example
  15515. *
  15516. * _.unescape('fred, barney, &amp; pebbles');
  15517. * // => 'fred, barney, & pebbles'
  15518. */
  15519. function unescape(string) {
  15520. string = toString(string);
  15521. return (string && reHasEscapedHtml.test(string))
  15522. ? string.replace(reEscapedHtml, unescapeHtmlChar)
  15523. : string;
  15524. }
  15525. /**
  15526. * Converts `string`, as space separated words, to upper case.
  15527. *
  15528. * @static
  15529. * @memberOf _
  15530. * @since 4.0.0
  15531. * @category String
  15532. * @param {string} [string=''] The string to convert.
  15533. * @returns {string} Returns the upper cased string.
  15534. * @example
  15535. *
  15536. * _.upperCase('--foo-bar');
  15537. * // => 'FOO BAR'
  15538. *
  15539. * _.upperCase('fooBar');
  15540. * // => 'FOO BAR'
  15541. *
  15542. * _.upperCase('__foo_bar__');
  15543. * // => 'FOO BAR'
  15544. */
  15545. var upperCase = createCompounder(function(result, word, index) {
  15546. return result + (index ? ' ' : '') + word.toUpperCase();
  15547. });
  15548. /**
  15549. * Converts the first character of `string` to upper case.
  15550. *
  15551. * @static
  15552. * @memberOf _
  15553. * @since 4.0.0
  15554. * @category String
  15555. * @param {string} [string=''] The string to convert.
  15556. * @returns {string} Returns the converted string.
  15557. * @example
  15558. *
  15559. * _.upperFirst('fred');
  15560. * // => 'Fred'
  15561. *
  15562. * _.upperFirst('FRED');
  15563. * // => 'FRED'
  15564. */
  15565. var upperFirst = createCaseFirst('toUpperCase');
  15566. /**
  15567. * Splits `string` into an array of its words.
  15568. *
  15569. * @static
  15570. * @memberOf _
  15571. * @since 3.0.0
  15572. * @category String
  15573. * @param {string} [string=''] The string to inspect.
  15574. * @param {RegExp|string} [pattern] The pattern to match words.
  15575. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  15576. * @returns {Array} Returns the words of `string`.
  15577. * @example
  15578. *
  15579. * _.words('fred, barney, & pebbles');
  15580. * // => ['fred', 'barney', 'pebbles']
  15581. *
  15582. * _.words('fred, barney, & pebbles', /[^, ]+/g);
  15583. * // => ['fred', 'barney', '&', 'pebbles']
  15584. */
  15585. function words(string, pattern, guard) {
  15586. string = toString(string);
  15587. pattern = guard ? undefined : pattern;
  15588. if (pattern === undefined) {
  15589. return hasUnicodeWord(string) ? unicodeWords(string) : asciiWords(string);
  15590. }
  15591. return string.match(pattern) || [];
  15592. }
  15593. /*------------------------------------------------------------------------*/
  15594. /**
  15595. * Attempts to invoke `func`, returning either the result or the caught error
  15596. * object. Any additional arguments are provided to `func` when it's invoked.
  15597. *
  15598. * @static
  15599. * @memberOf _
  15600. * @since 3.0.0
  15601. * @category Util
  15602. * @param {Function} func The function to attempt.
  15603. * @param {...*} [args] The arguments to invoke `func` with.
  15604. * @returns {*} Returns the `func` result or error object.
  15605. * @example
  15606. *
  15607. * // Avoid throwing errors for invalid selectors.
  15608. * var elements = _.attempt(function(selector) {
  15609. * return document.querySelectorAll(selector);
  15610. * }, '>_>');
  15611. *
  15612. * if (_.isError(elements)) {
  15613. * elements = [];
  15614. * }
  15615. */
  15616. var attempt = baseRest(function(func, args) {
  15617. try {
  15618. return apply(func, undefined, args);
  15619. } catch (e) {
  15620. return isError(e) ? e : new Error(e);
  15621. }
  15622. });
  15623. /**
  15624. * Binds methods of an object to the object itself, overwriting the existing
  15625. * method.
  15626. *
  15627. * **Note:** This method doesn't set the "length" property of bound functions.
  15628. *
  15629. * @static
  15630. * @since 0.1.0
  15631. * @memberOf _
  15632. * @category Util
  15633. * @param {Object} object The object to bind and assign the bound methods to.
  15634. * @param {...(string|string[])} methodNames The object method names to bind.
  15635. * @returns {Object} Returns `object`.
  15636. * @example
  15637. *
  15638. * var view = {
  15639. * 'label': 'docs',
  15640. * 'click': function() {
  15641. * console.log('clicked ' + this.label);
  15642. * }
  15643. * };
  15644. *
  15645. * _.bindAll(view, ['click']);
  15646. * jQuery(element).on('click', view.click);
  15647. * // => Logs 'clicked docs' when clicked.
  15648. */
  15649. var bindAll = flatRest(function(object, methodNames) {
  15650. arrayEach(methodNames, function(key) {
  15651. key = toKey(key);
  15652. baseAssignValue(object, key, bind(object[key], object));
  15653. });
  15654. return object;
  15655. });
  15656. /**
  15657. * Creates a function that iterates over `pairs` and invokes the corresponding
  15658. * function of the first predicate to return truthy. The predicate-function
  15659. * pairs are invoked with the `this` binding and arguments of the created
  15660. * function.
  15661. *
  15662. * @static
  15663. * @memberOf _
  15664. * @since 4.0.0
  15665. * @category Util
  15666. * @param {Array} pairs The predicate-function pairs.
  15667. * @returns {Function} Returns the new composite function.
  15668. * @example
  15669. *
  15670. * var func = _.cond([
  15671. * [_.matches({ 'a': 1 }), _.constant('matches A')],
  15672. * [_.conforms({ 'b': _.isNumber }), _.constant('matches B')],
  15673. * [_.stubTrue, _.constant('no match')]
  15674. * ]);
  15675. *
  15676. * func({ 'a': 1, 'b': 2 });
  15677. * // => 'matches A'
  15678. *
  15679. * func({ 'a': 0, 'b': 1 });
  15680. * // => 'matches B'
  15681. *
  15682. * func({ 'a': '1', 'b': '2' });
  15683. * // => 'no match'
  15684. */
  15685. function cond(pairs) {
  15686. var length = pairs == null ? 0 : pairs.length,
  15687. toIteratee = getIteratee();
  15688. pairs = !length ? [] : arrayMap(pairs, function(pair) {
  15689. if (typeof pair[1] != 'function') {
  15690. throw new TypeError(FUNC_ERROR_TEXT);
  15691. }
  15692. return [toIteratee(pair[0]), pair[1]];
  15693. });
  15694. return baseRest(function(args) {
  15695. var index = -1;
  15696. while (++index < length) {
  15697. var pair = pairs[index];
  15698. if (apply(pair[0], this, args)) {
  15699. return apply(pair[1], this, args);
  15700. }
  15701. }
  15702. });
  15703. }
  15704. /**
  15705. * Creates a function that invokes the predicate properties of `source` with
  15706. * the corresponding property values of a given object, returning `true` if
  15707. * all predicates return truthy, else `false`.
  15708. *
  15709. * **Note:** The created function is equivalent to `_.conformsTo` with
  15710. * `source` partially applied.
  15711. *
  15712. * @static
  15713. * @memberOf _
  15714. * @since 4.0.0
  15715. * @category Util
  15716. * @param {Object} source The object of property predicates to conform to.
  15717. * @returns {Function} Returns the new spec function.
  15718. * @example
  15719. *
  15720. * var objects = [
  15721. * { 'a': 2, 'b': 1 },
  15722. * { 'a': 1, 'b': 2 }
  15723. * ];
  15724. *
  15725. * _.filter(objects, _.conforms({ 'b': function(n) { return n > 1; } }));
  15726. * // => [{ 'a': 1, 'b': 2 }]
  15727. */
  15728. function conforms(source) {
  15729. return baseConforms(baseClone(source, CLONE_DEEP_FLAG));
  15730. }
  15731. /**
  15732. * Creates a function that returns `value`.
  15733. *
  15734. * @static
  15735. * @memberOf _
  15736. * @since 2.4.0
  15737. * @category Util
  15738. * @param {*} value The value to return from the new function.
  15739. * @returns {Function} Returns the new constant function.
  15740. * @example
  15741. *
  15742. * var objects = _.times(2, _.constant({ 'a': 1 }));
  15743. *
  15744. * console.log(objects);
  15745. * // => [{ 'a': 1 }, { 'a': 1 }]
  15746. *
  15747. * console.log(objects[0] === objects[1]);
  15748. * // => true
  15749. */
  15750. function constant(value) {
  15751. return function() {
  15752. return value;
  15753. };
  15754. }
  15755. /**
  15756. * Checks `value` to determine whether a default value should be returned in
  15757. * its place. The `defaultValue` is returned if `value` is `NaN`, `null`,
  15758. * or `undefined`.
  15759. *
  15760. * @static
  15761. * @memberOf _
  15762. * @since 4.14.0
  15763. * @category Util
  15764. * @param {*} value The value to check.
  15765. * @param {*} defaultValue The default value.
  15766. * @returns {*} Returns the resolved value.
  15767. * @example
  15768. *
  15769. * _.defaultTo(1, 10);
  15770. * // => 1
  15771. *
  15772. * _.defaultTo(undefined, 10);
  15773. * // => 10
  15774. */
  15775. function defaultTo(value, defaultValue) {
  15776. return (value == null || value !== value) ? defaultValue : value;
  15777. }
  15778. /**
  15779. * Creates a function that returns the result of invoking the given functions
  15780. * with the `this` binding of the created function, where each successive
  15781. * invocation is supplied the return value of the previous.
  15782. *
  15783. * @static
  15784. * @memberOf _
  15785. * @since 3.0.0
  15786. * @category Util
  15787. * @param {...(Function|Function[])} [funcs] The functions to invoke.
  15788. * @returns {Function} Returns the new composite function.
  15789. * @see _.flowRight
  15790. * @example
  15791. *
  15792. * function square(n) {
  15793. * return n * n;
  15794. * }
  15795. *
  15796. * var addSquare = _.flow([_.add, square]);
  15797. * addSquare(1, 2);
  15798. * // => 9
  15799. */
  15800. var flow = createFlow();
  15801. /**
  15802. * This method is like `_.flow` except that it creates a function that
  15803. * invokes the given functions from right to left.
  15804. *
  15805. * @static
  15806. * @since 3.0.0
  15807. * @memberOf _
  15808. * @category Util
  15809. * @param {...(Function|Function[])} [funcs] The functions to invoke.
  15810. * @returns {Function} Returns the new composite function.
  15811. * @see _.flow
  15812. * @example
  15813. *
  15814. * function square(n) {
  15815. * return n * n;
  15816. * }
  15817. *
  15818. * var addSquare = _.flowRight([square, _.add]);
  15819. * addSquare(1, 2);
  15820. * // => 9
  15821. */
  15822. var flowRight = createFlow(true);
  15823. /**
  15824. * This method returns the first argument it receives.
  15825. *
  15826. * @static
  15827. * @since 0.1.0
  15828. * @memberOf _
  15829. * @category Util
  15830. * @param {*} value Any value.
  15831. * @returns {*} Returns `value`.
  15832. * @example
  15833. *
  15834. * var object = { 'a': 1 };
  15835. *
  15836. * console.log(_.identity(object) === object);
  15837. * // => true
  15838. */
  15839. function identity(value) {
  15840. return value;
  15841. }
  15842. /**
  15843. * Creates a function that invokes `func` with the arguments of the created
  15844. * function. If `func` is a property name, the created function returns the
  15845. * property value for a given element. If `func` is an array or object, the
  15846. * created function returns `true` for elements that contain the equivalent
  15847. * source properties, otherwise it returns `false`.
  15848. *
  15849. * @static
  15850. * @since 4.0.0
  15851. * @memberOf _
  15852. * @category Util
  15853. * @param {*} [func=_.identity] The value to convert to a callback.
  15854. * @returns {Function} Returns the callback.
  15855. * @example
  15856. *
  15857. * var users = [
  15858. * { 'user': 'barney', 'age': 36, 'active': true },
  15859. * { 'user': 'fred', 'age': 40, 'active': false }
  15860. * ];
  15861. *
  15862. * // The `_.matches` iteratee shorthand.
  15863. * _.filter(users, _.iteratee({ 'user': 'barney', 'active': true }));
  15864. * // => [{ 'user': 'barney', 'age': 36, 'active': true }]
  15865. *
  15866. * // The `_.matchesProperty` iteratee shorthand.
  15867. * _.filter(users, _.iteratee(['user', 'fred']));
  15868. * // => [{ 'user': 'fred', 'age': 40 }]
  15869. *
  15870. * // The `_.property` iteratee shorthand.
  15871. * _.map(users, _.iteratee('user'));
  15872. * // => ['barney', 'fred']
  15873. *
  15874. * // Create custom iteratee shorthands.
  15875. * _.iteratee = _.wrap(_.iteratee, function(iteratee, func) {
  15876. * return !_.isRegExp(func) ? iteratee(func) : function(string) {
  15877. * return func.test(string);
  15878. * };
  15879. * });
  15880. *
  15881. * _.filter(['abc', 'def'], /ef/);
  15882. * // => ['def']
  15883. */
  15884. function iteratee(func) {
  15885. return baseIteratee(typeof func == 'function' ? func : baseClone(func, CLONE_DEEP_FLAG));
  15886. }
  15887. /**
  15888. * Creates a function that performs a partial deep comparison between a given
  15889. * object and `source`, returning `true` if the given object has equivalent
  15890. * property values, else `false`.
  15891. *
  15892. * **Note:** The created function is equivalent to `_.isMatch` with `source`
  15893. * partially applied.
  15894. *
  15895. * Partial comparisons will match empty array and empty object `source`
  15896. * values against any array or object value, respectively. See `_.isEqual`
  15897. * for a list of supported value comparisons.
  15898. *
  15899. * **Note:** Multiple values can be checked by combining several matchers
  15900. * using `_.overSome`
  15901. *
  15902. * @static
  15903. * @memberOf _
  15904. * @since 3.0.0
  15905. * @category Util
  15906. * @param {Object} source The object of property values to match.
  15907. * @returns {Function} Returns the new spec function.
  15908. * @example
  15909. *
  15910. * var objects = [
  15911. * { 'a': 1, 'b': 2, 'c': 3 },
  15912. * { 'a': 4, 'b': 5, 'c': 6 }
  15913. * ];
  15914. *
  15915. * _.filter(objects, _.matches({ 'a': 4, 'c': 6 }));
  15916. * // => [{ 'a': 4, 'b': 5, 'c': 6 }]
  15917. *
  15918. * // Checking for several possible values
  15919. * _.filter(objects, _.overSome([_.matches({ 'a': 1 }), _.matches({ 'a': 4 })]));
  15920. * // => [{ 'a': 1, 'b': 2, 'c': 3 }, { 'a': 4, 'b': 5, 'c': 6 }]
  15921. */
  15922. function matches(source) {
  15923. return baseMatches(baseClone(source, CLONE_DEEP_FLAG));
  15924. }
  15925. /**
  15926. * Creates a function that performs a partial deep comparison between the
  15927. * value at `path` of a given object to `srcValue`, returning `true` if the
  15928. * object value is equivalent, else `false`.
  15929. *
  15930. * **Note:** Partial comparisons will match empty array and empty object
  15931. * `srcValue` values against any array or object value, respectively. See
  15932. * `_.isEqual` for a list of supported value comparisons.
  15933. *
  15934. * **Note:** Multiple values can be checked by combining several matchers
  15935. * using `_.overSome`
  15936. *
  15937. * @static
  15938. * @memberOf _
  15939. * @since 3.2.0
  15940. * @category Util
  15941. * @param {Array|string} path The path of the property to get.
  15942. * @param {*} srcValue The value to match.
  15943. * @returns {Function} Returns the new spec function.
  15944. * @example
  15945. *
  15946. * var objects = [
  15947. * { 'a': 1, 'b': 2, 'c': 3 },
  15948. * { 'a': 4, 'b': 5, 'c': 6 }
  15949. * ];
  15950. *
  15951. * _.find(objects, _.matchesProperty('a', 4));
  15952. * // => { 'a': 4, 'b': 5, 'c': 6 }
  15953. *
  15954. * // Checking for several possible values
  15955. * _.filter(objects, _.overSome([_.matchesProperty('a', 1), _.matchesProperty('a', 4)]));
  15956. * // => [{ 'a': 1, 'b': 2, 'c': 3 }, { 'a': 4, 'b': 5, 'c': 6 }]
  15957. */
  15958. function matchesProperty(path, srcValue) {
  15959. return baseMatchesProperty(path, baseClone(srcValue, CLONE_DEEP_FLAG));
  15960. }
  15961. /**
  15962. * Creates a function that invokes the method at `path` of a given object.
  15963. * Any additional arguments are provided to the invoked method.
  15964. *
  15965. * @static
  15966. * @memberOf _
  15967. * @since 3.7.0
  15968. * @category Util
  15969. * @param {Array|string} path The path of the method to invoke.
  15970. * @param {...*} [args] The arguments to invoke the method with.
  15971. * @returns {Function} Returns the new invoker function.
  15972. * @example
  15973. *
  15974. * var objects = [
  15975. * { 'a': { 'b': _.constant(2) } },
  15976. * { 'a': { 'b': _.constant(1) } }
  15977. * ];
  15978. *
  15979. * _.map(objects, _.method('a.b'));
  15980. * // => [2, 1]
  15981. *
  15982. * _.map(objects, _.method(['a', 'b']));
  15983. * // => [2, 1]
  15984. */
  15985. var method = baseRest(function(path, args) {
  15986. return function(object) {
  15987. return baseInvoke(object, path, args);
  15988. };
  15989. });
  15990. /**
  15991. * The opposite of `_.method`; this method creates a function that invokes
  15992. * the method at a given path of `object`. Any additional arguments are
  15993. * provided to the invoked method.
  15994. *
  15995. * @static
  15996. * @memberOf _
  15997. * @since 3.7.0
  15998. * @category Util
  15999. * @param {Object} object The object to query.
  16000. * @param {...*} [args] The arguments to invoke the method with.
  16001. * @returns {Function} Returns the new invoker function.
  16002. * @example
  16003. *
  16004. * var array = _.times(3, _.constant),
  16005. * object = { 'a': array, 'b': array, 'c': array };
  16006. *
  16007. * _.map(['a[2]', 'c[0]'], _.methodOf(object));
  16008. * // => [2, 0]
  16009. *
  16010. * _.map([['a', '2'], ['c', '0']], _.methodOf(object));
  16011. * // => [2, 0]
  16012. */
  16013. var methodOf = baseRest(function(object, args) {
  16014. return function(path) {
  16015. return baseInvoke(object, path, args);
  16016. };
  16017. });
  16018. /**
  16019. * Adds all own enumerable string keyed function properties of a source
  16020. * object to the destination object. If `object` is a function, then methods
  16021. * are added to its prototype as well.
  16022. *
  16023. * **Note:** Use `_.runInContext` to create a pristine `lodash` function to
  16024. * avoid conflicts caused by modifying the original.
  16025. *
  16026. * @static
  16027. * @since 0.1.0
  16028. * @memberOf _
  16029. * @category Util
  16030. * @param {Function|Object} [object=lodash] The destination object.
  16031. * @param {Object} source The object of functions to add.
  16032. * @param {Object} [options={}] The options object.
  16033. * @param {boolean} [options.chain=true] Specify whether mixins are chainable.
  16034. * @returns {Function|Object} Returns `object`.
  16035. * @example
  16036. *
  16037. * function vowels(string) {
  16038. * return _.filter(string, function(v) {
  16039. * return /[aeiou]/i.test(v);
  16040. * });
  16041. * }
  16042. *
  16043. * _.mixin({ 'vowels': vowels });
  16044. * _.vowels('fred');
  16045. * // => ['e']
  16046. *
  16047. * _('fred').vowels().value();
  16048. * // => ['e']
  16049. *
  16050. * _.mixin({ 'vowels': vowels }, { 'chain': false });
  16051. * _('fred').vowels();
  16052. * // => ['e']
  16053. */
  16054. function mixin(object, source, options) {
  16055. var props = keys(source),
  16056. methodNames = baseFunctions(source, props);
  16057. if (options == null &&
  16058. !(isObject(source) && (methodNames.length || !props.length))) {
  16059. options = source;
  16060. source = object;
  16061. object = this;
  16062. methodNames = baseFunctions(source, keys(source));
  16063. }
  16064. var chain = !(isObject(options) && 'chain' in options) || !!options.chain,
  16065. isFunc = isFunction(object);
  16066. arrayEach(methodNames, function(methodName) {
  16067. var func = source[methodName];
  16068. object[methodName] = func;
  16069. if (isFunc) {
  16070. object.prototype[methodName] = function() {
  16071. var chainAll = this.__chain__;
  16072. if (chain || chainAll) {
  16073. var result = object(this.__wrapped__),
  16074. actions = result.__actions__ = copyArray(this.__actions__);
  16075. actions.push({ 'func': func, 'args': arguments, 'thisArg': object });
  16076. result.__chain__ = chainAll;
  16077. return result;
  16078. }
  16079. return func.apply(object, arrayPush([this.value()], arguments));
  16080. };
  16081. }
  16082. });
  16083. return object;
  16084. }
  16085. /**
  16086. * Reverts the `_` variable to its previous value and returns a reference to
  16087. * the `lodash` function.
  16088. *
  16089. * @static
  16090. * @since 0.1.0
  16091. * @memberOf _
  16092. * @category Util
  16093. * @returns {Function} Returns the `lodash` function.
  16094. * @example
  16095. *
  16096. * var lodash = _.noConflict();
  16097. */
  16098. function noConflict() {
  16099. if (root._ === this) {
  16100. root._ = oldDash;
  16101. }
  16102. return this;
  16103. }
  16104. /**
  16105. * This method returns `undefined`.
  16106. *
  16107. * @static
  16108. * @memberOf _
  16109. * @since 2.3.0
  16110. * @category Util
  16111. * @example
  16112. *
  16113. * _.times(2, _.noop);
  16114. * // => [undefined, undefined]
  16115. */
  16116. function noop() {
  16117. // No operation performed.
  16118. }
  16119. /**
  16120. * Creates a function that gets the argument at index `n`. If `n` is negative,
  16121. * the nth argument from the end is returned.
  16122. *
  16123. * @static
  16124. * @memberOf _
  16125. * @since 4.0.0
  16126. * @category Util
  16127. * @param {number} [n=0] The index of the argument to return.
  16128. * @returns {Function} Returns the new pass-thru function.
  16129. * @example
  16130. *
  16131. * var func = _.nthArg(1);
  16132. * func('a', 'b', 'c', 'd');
  16133. * // => 'b'
  16134. *
  16135. * var func = _.nthArg(-2);
  16136. * func('a', 'b', 'c', 'd');
  16137. * // => 'c'
  16138. */
  16139. function nthArg(n) {
  16140. n = toInteger(n);
  16141. return baseRest(function(args) {
  16142. return baseNth(args, n);
  16143. });
  16144. }
  16145. /**
  16146. * Creates a function that invokes `iteratees` with the arguments it receives
  16147. * and returns their results.
  16148. *
  16149. * @static
  16150. * @memberOf _
  16151. * @since 4.0.0
  16152. * @category Util
  16153. * @param {...(Function|Function[])} [iteratees=[_.identity]]
  16154. * The iteratees to invoke.
  16155. * @returns {Function} Returns the new function.
  16156. * @example
  16157. *
  16158. * var func = _.over([Math.max, Math.min]);
  16159. *
  16160. * func(1, 2, 3, 4);
  16161. * // => [4, 1]
  16162. */
  16163. var over = createOver(arrayMap);
  16164. /**
  16165. * Creates a function that checks if **all** of the `predicates` return
  16166. * truthy when invoked with the arguments it receives.
  16167. *
  16168. * Following shorthands are possible for providing predicates.
  16169. * Pass an `Object` and it will be used as an parameter for `_.matches` to create the predicate.
  16170. * Pass an `Array` of parameters for `_.matchesProperty` and the predicate will be created using them.
  16171. *
  16172. * @static
  16173. * @memberOf _
  16174. * @since 4.0.0
  16175. * @category Util
  16176. * @param {...(Function|Function[])} [predicates=[_.identity]]
  16177. * The predicates to check.
  16178. * @returns {Function} Returns the new function.
  16179. * @example
  16180. *
  16181. * var func = _.overEvery([Boolean, isFinite]);
  16182. *
  16183. * func('1');
  16184. * // => true
  16185. *
  16186. * func(null);
  16187. * // => false
  16188. *
  16189. * func(NaN);
  16190. * // => false
  16191. */
  16192. var overEvery = createOver(arrayEvery);
  16193. /**
  16194. * Creates a function that checks if **any** of the `predicates` return
  16195. * truthy when invoked with the arguments it receives.
  16196. *
  16197. * Following shorthands are possible for providing predicates.
  16198. * Pass an `Object` and it will be used as an parameter for `_.matches` to create the predicate.
  16199. * Pass an `Array` of parameters for `_.matchesProperty` and the predicate will be created using them.
  16200. *
  16201. * @static
  16202. * @memberOf _
  16203. * @since 4.0.0
  16204. * @category Util
  16205. * @param {...(Function|Function[])} [predicates=[_.identity]]
  16206. * The predicates to check.
  16207. * @returns {Function} Returns the new function.
  16208. * @example
  16209. *
  16210. * var func = _.overSome([Boolean, isFinite]);
  16211. *
  16212. * func('1');
  16213. * // => true
  16214. *
  16215. * func(null);
  16216. * // => true
  16217. *
  16218. * func(NaN);
  16219. * // => false
  16220. *
  16221. * var matchesFunc = _.overSome([{ 'a': 1 }, { 'a': 2 }])
  16222. * var matchesPropertyFunc = _.overSome([['a', 1], ['a', 2]])
  16223. */
  16224. var overSome = createOver(arraySome);
  16225. /**
  16226. * Creates a function that returns the value at `path` of a given object.
  16227. *
  16228. * @static
  16229. * @memberOf _
  16230. * @since 2.4.0
  16231. * @category Util
  16232. * @param {Array|string} path The path of the property to get.
  16233. * @returns {Function} Returns the new accessor function.
  16234. * @example
  16235. *
  16236. * var objects = [
  16237. * { 'a': { 'b': 2 } },
  16238. * { 'a': { 'b': 1 } }
  16239. * ];
  16240. *
  16241. * _.map(objects, _.property('a.b'));
  16242. * // => [2, 1]
  16243. *
  16244. * _.map(_.sortBy(objects, _.property(['a', 'b'])), 'a.b');
  16245. * // => [1, 2]
  16246. */
  16247. function property(path) {
  16248. return isKey(path) ? baseProperty(toKey(path)) : basePropertyDeep(path);
  16249. }
  16250. /**
  16251. * The opposite of `_.property`; this method creates a function that returns
  16252. * the value at a given path of `object`.
  16253. *
  16254. * @static
  16255. * @memberOf _
  16256. * @since 3.0.0
  16257. * @category Util
  16258. * @param {Object} object The object to query.
  16259. * @returns {Function} Returns the new accessor function.
  16260. * @example
  16261. *
  16262. * var array = [0, 1, 2],
  16263. * object = { 'a': array, 'b': array, 'c': array };
  16264. *
  16265. * _.map(['a[2]', 'c[0]'], _.propertyOf(object));
  16266. * // => [2, 0]
  16267. *
  16268. * _.map([['a', '2'], ['c', '0']], _.propertyOf(object));
  16269. * // => [2, 0]
  16270. */
  16271. function propertyOf(object) {
  16272. return function(path) {
  16273. return object == null ? undefined : baseGet(object, path);
  16274. };
  16275. }
  16276. /**
  16277. * Creates an array of numbers (positive and/or negative) progressing from
  16278. * `start` up to, but not including, `end`. A step of `-1` is used if a negative
  16279. * `start` is specified without an `end` or `step`. If `end` is not specified,
  16280. * it's set to `start` with `start` then set to `0`.
  16281. *
  16282. * **Note:** JavaScript follows the IEEE-754 standard for resolving
  16283. * floating-point values which can produce unexpected results.
  16284. *
  16285. * @static
  16286. * @since 0.1.0
  16287. * @memberOf _
  16288. * @category Util
  16289. * @param {number} [start=0] The start of the range.
  16290. * @param {number} end The end of the range.
  16291. * @param {number} [step=1] The value to increment or decrement by.
  16292. * @returns {Array} Returns the range of numbers.
  16293. * @see _.inRange, _.rangeRight
  16294. * @example
  16295. *
  16296. * _.range(4);
  16297. * // => [0, 1, 2, 3]
  16298. *
  16299. * _.range(-4);
  16300. * // => [0, -1, -2, -3]
  16301. *
  16302. * _.range(1, 5);
  16303. * // => [1, 2, 3, 4]
  16304. *
  16305. * _.range(0, 20, 5);
  16306. * // => [0, 5, 10, 15]
  16307. *
  16308. * _.range(0, -4, -1);
  16309. * // => [0, -1, -2, -3]
  16310. *
  16311. * _.range(1, 4, 0);
  16312. * // => [1, 1, 1]
  16313. *
  16314. * _.range(0);
  16315. * // => []
  16316. */
  16317. var range = createRange();
  16318. /**
  16319. * This method is like `_.range` except that it populates values in
  16320. * descending order.
  16321. *
  16322. * @static
  16323. * @memberOf _
  16324. * @since 4.0.0
  16325. * @category Util
  16326. * @param {number} [start=0] The start of the range.
  16327. * @param {number} end The end of the range.
  16328. * @param {number} [step=1] The value to increment or decrement by.
  16329. * @returns {Array} Returns the range of numbers.
  16330. * @see _.inRange, _.range
  16331. * @example
  16332. *
  16333. * _.rangeRight(4);
  16334. * // => [3, 2, 1, 0]
  16335. *
  16336. * _.rangeRight(-4);
  16337. * // => [-3, -2, -1, 0]
  16338. *
  16339. * _.rangeRight(1, 5);
  16340. * // => [4, 3, 2, 1]
  16341. *
  16342. * _.rangeRight(0, 20, 5);
  16343. * // => [15, 10, 5, 0]
  16344. *
  16345. * _.rangeRight(0, -4, -1);
  16346. * // => [-3, -2, -1, 0]
  16347. *
  16348. * _.rangeRight(1, 4, 0);
  16349. * // => [1, 1, 1]
  16350. *
  16351. * _.rangeRight(0);
  16352. * // => []
  16353. */
  16354. var rangeRight = createRange(true);
  16355. /**
  16356. * This method returns a new empty array.
  16357. *
  16358. * @static
  16359. * @memberOf _
  16360. * @since 4.13.0
  16361. * @category Util
  16362. * @returns {Array} Returns the new empty array.
  16363. * @example
  16364. *
  16365. * var arrays = _.times(2, _.stubArray);
  16366. *
  16367. * console.log(arrays);
  16368. * // => [[], []]
  16369. *
  16370. * console.log(arrays[0] === arrays[1]);
  16371. * // => false
  16372. */
  16373. function stubArray() {
  16374. return [];
  16375. }
  16376. /**
  16377. * This method returns `false`.
  16378. *
  16379. * @static
  16380. * @memberOf _
  16381. * @since 4.13.0
  16382. * @category Util
  16383. * @returns {boolean} Returns `false`.
  16384. * @example
  16385. *
  16386. * _.times(2, _.stubFalse);
  16387. * // => [false, false]
  16388. */
  16389. function stubFalse() {
  16390. return false;
  16391. }
  16392. /**
  16393. * This method returns a new empty object.
  16394. *
  16395. * @static
  16396. * @memberOf _
  16397. * @since 4.13.0
  16398. * @category Util
  16399. * @returns {Object} Returns the new empty object.
  16400. * @example
  16401. *
  16402. * var objects = _.times(2, _.stubObject);
  16403. *
  16404. * console.log(objects);
  16405. * // => [{}, {}]
  16406. *
  16407. * console.log(objects[0] === objects[1]);
  16408. * // => false
  16409. */
  16410. function stubObject() {
  16411. return {};
  16412. }
  16413. /**
  16414. * This method returns an empty string.
  16415. *
  16416. * @static
  16417. * @memberOf _
  16418. * @since 4.13.0
  16419. * @category Util
  16420. * @returns {string} Returns the empty string.
  16421. * @example
  16422. *
  16423. * _.times(2, _.stubString);
  16424. * // => ['', '']
  16425. */
  16426. function stubString() {
  16427. return '';
  16428. }
  16429. /**
  16430. * This method returns `true`.
  16431. *
  16432. * @static
  16433. * @memberOf _
  16434. * @since 4.13.0
  16435. * @category Util
  16436. * @returns {boolean} Returns `true`.
  16437. * @example
  16438. *
  16439. * _.times(2, _.stubTrue);
  16440. * // => [true, true]
  16441. */
  16442. function stubTrue() {
  16443. return true;
  16444. }
  16445. /**
  16446. * Invokes the iteratee `n` times, returning an array of the results of
  16447. * each invocation. The iteratee is invoked with one argument; (index).
  16448. *
  16449. * @static
  16450. * @since 0.1.0
  16451. * @memberOf _
  16452. * @category Util
  16453. * @param {number} n The number of times to invoke `iteratee`.
  16454. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  16455. * @returns {Array} Returns the array of results.
  16456. * @example
  16457. *
  16458. * _.times(3, String);
  16459. * // => ['0', '1', '2']
  16460. *
  16461. * _.times(4, _.constant(0));
  16462. * // => [0, 0, 0, 0]
  16463. */
  16464. function times(n, iteratee) {
  16465. n = toInteger(n);
  16466. if (n < 1 || n > MAX_SAFE_INTEGER) {
  16467. return [];
  16468. }
  16469. var index = MAX_ARRAY_LENGTH,
  16470. length = nativeMin(n, MAX_ARRAY_LENGTH);
  16471. iteratee = getIteratee(iteratee);
  16472. n -= MAX_ARRAY_LENGTH;
  16473. var result = baseTimes(length, iteratee);
  16474. while (++index < n) {
  16475. iteratee(index);
  16476. }
  16477. return result;
  16478. }
  16479. /**
  16480. * Converts `value` to a property path array.
  16481. *
  16482. * @static
  16483. * @memberOf _
  16484. * @since 4.0.0
  16485. * @category Util
  16486. * @param {*} value The value to convert.
  16487. * @returns {Array} Returns the new property path array.
  16488. * @example
  16489. *
  16490. * _.toPath('a.b.c');
  16491. * // => ['a', 'b', 'c']
  16492. *
  16493. * _.toPath('a[0].b.c');
  16494. * // => ['a', '0', 'b', 'c']
  16495. */
  16496. function toPath(value) {
  16497. if (isArray(value)) {
  16498. return arrayMap(value, toKey);
  16499. }
  16500. return isSymbol(value) ? [value] : copyArray(stringToPath(toString(value)));
  16501. }
  16502. /**
  16503. * Generates a unique ID. If `prefix` is given, the ID is appended to it.
  16504. *
  16505. * @static
  16506. * @since 0.1.0
  16507. * @memberOf _
  16508. * @category Util
  16509. * @param {string} [prefix=''] The value to prefix the ID with.
  16510. * @returns {string} Returns the unique ID.
  16511. * @example
  16512. *
  16513. * _.uniqueId('contact_');
  16514. * // => 'contact_104'
  16515. *
  16516. * _.uniqueId();
  16517. * // => '105'
  16518. */
  16519. function uniqueId(prefix) {
  16520. var id = ++idCounter;
  16521. return toString(prefix) + id;
  16522. }
  16523. /*------------------------------------------------------------------------*/
  16524. /**
  16525. * Adds two numbers.
  16526. *
  16527. * @static
  16528. * @memberOf _
  16529. * @since 3.4.0
  16530. * @category Math
  16531. * @param {number} augend The first number in an addition.
  16532. * @param {number} addend The second number in an addition.
  16533. * @returns {number} Returns the total.
  16534. * @example
  16535. *
  16536. * _.add(6, 4);
  16537. * // => 10
  16538. */
  16539. var add = createMathOperation(function(augend, addend) {
  16540. return augend + addend;
  16541. }, 0);
  16542. /**
  16543. * Computes `number` rounded up to `precision`.
  16544. *
  16545. * @static
  16546. * @memberOf _
  16547. * @since 3.10.0
  16548. * @category Math
  16549. * @param {number} number The number to round up.
  16550. * @param {number} [precision=0] The precision to round up to.
  16551. * @returns {number} Returns the rounded up number.
  16552. * @example
  16553. *
  16554. * _.ceil(4.006);
  16555. * // => 5
  16556. *
  16557. * _.ceil(6.004, 2);
  16558. * // => 6.01
  16559. *
  16560. * _.ceil(6040, -2);
  16561. * // => 6100
  16562. */
  16563. var ceil = createRound('ceil');
  16564. /**
  16565. * Divide two numbers.
  16566. *
  16567. * @static
  16568. * @memberOf _
  16569. * @since 4.7.0
  16570. * @category Math
  16571. * @param {number} dividend The first number in a division.
  16572. * @param {number} divisor The second number in a division.
  16573. * @returns {number} Returns the quotient.
  16574. * @example
  16575. *
  16576. * _.divide(6, 4);
  16577. * // => 1.5
  16578. */
  16579. var divide = createMathOperation(function(dividend, divisor) {
  16580. return dividend / divisor;
  16581. }, 1);
  16582. /**
  16583. * Computes `number` rounded down to `precision`.
  16584. *
  16585. * @static
  16586. * @memberOf _
  16587. * @since 3.10.0
  16588. * @category Math
  16589. * @param {number} number The number to round down.
  16590. * @param {number} [precision=0] The precision to round down to.
  16591. * @returns {number} Returns the rounded down number.
  16592. * @example
  16593. *
  16594. * _.floor(4.006);
  16595. * // => 4
  16596. *
  16597. * _.floor(0.046, 2);
  16598. * // => 0.04
  16599. *
  16600. * _.floor(4060, -2);
  16601. * // => 4000
  16602. */
  16603. var floor = createRound('floor');
  16604. /**
  16605. * Computes the maximum value of `array`. If `array` is empty or falsey,
  16606. * `undefined` is returned.
  16607. *
  16608. * @static
  16609. * @since 0.1.0
  16610. * @memberOf _
  16611. * @category Math
  16612. * @param {Array} array The array to iterate over.
  16613. * @returns {*} Returns the maximum value.
  16614. * @example
  16615. *
  16616. * _.max([4, 2, 8, 6]);
  16617. * // => 8
  16618. *
  16619. * _.max([]);
  16620. * // => undefined
  16621. */
  16622. function max(array) {
  16623. return (array && array.length)
  16624. ? baseExtremum(array, identity, baseGt)
  16625. : undefined;
  16626. }
  16627. /**
  16628. * This method is like `_.max` except that it accepts `iteratee` which is
  16629. * invoked for each element in `array` to generate the criterion by which
  16630. * the value is ranked. The iteratee is invoked with one argument: (value).
  16631. *
  16632. * @static
  16633. * @memberOf _
  16634. * @since 4.0.0
  16635. * @category Math
  16636. * @param {Array} array The array to iterate over.
  16637. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  16638. * @returns {*} Returns the maximum value.
  16639. * @example
  16640. *
  16641. * var objects = [{ 'n': 1 }, { 'n': 2 }];
  16642. *
  16643. * _.maxBy(objects, function(o) { return o.n; });
  16644. * // => { 'n': 2 }
  16645. *
  16646. * // The `_.property` iteratee shorthand.
  16647. * _.maxBy(objects, 'n');
  16648. * // => { 'n': 2 }
  16649. */
  16650. function maxBy(array, iteratee) {
  16651. return (array && array.length)
  16652. ? baseExtremum(array, getIteratee(iteratee, 2), baseGt)
  16653. : undefined;
  16654. }
  16655. /**
  16656. * Computes the mean of the values in `array`.
  16657. *
  16658. * @static
  16659. * @memberOf _
  16660. * @since 4.0.0
  16661. * @category Math
  16662. * @param {Array} array The array to iterate over.
  16663. * @returns {number} Returns the mean.
  16664. * @example
  16665. *
  16666. * _.mean([4, 2, 8, 6]);
  16667. * // => 5
  16668. */
  16669. function mean(array) {
  16670. return baseMean(array, identity);
  16671. }
  16672. /**
  16673. * This method is like `_.mean` except that it accepts `iteratee` which is
  16674. * invoked for each element in `array` to generate the value to be averaged.
  16675. * The iteratee is invoked with one argument: (value).
  16676. *
  16677. * @static
  16678. * @memberOf _
  16679. * @since 4.7.0
  16680. * @category Math
  16681. * @param {Array} array The array to iterate over.
  16682. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  16683. * @returns {number} Returns the mean.
  16684. * @example
  16685. *
  16686. * var objects = [{ 'n': 4 }, { 'n': 2 }, { 'n': 8 }, { 'n': 6 }];
  16687. *
  16688. * _.meanBy(objects, function(o) { return o.n; });
  16689. * // => 5
  16690. *
  16691. * // The `_.property` iteratee shorthand.
  16692. * _.meanBy(objects, 'n');
  16693. * // => 5
  16694. */
  16695. function meanBy(array, iteratee) {
  16696. return baseMean(array, getIteratee(iteratee, 2));
  16697. }
  16698. /**
  16699. * Computes the minimum value of `array`. If `array` is empty or falsey,
  16700. * `undefined` is returned.
  16701. *
  16702. * @static
  16703. * @since 0.1.0
  16704. * @memberOf _
  16705. * @category Math
  16706. * @param {Array} array The array to iterate over.
  16707. * @returns {*} Returns the minimum value.
  16708. * @example
  16709. *
  16710. * _.min([4, 2, 8, 6]);
  16711. * // => 2
  16712. *
  16713. * _.min([]);
  16714. * // => undefined
  16715. */
  16716. function min(array) {
  16717. return (array && array.length)
  16718. ? baseExtremum(array, identity, baseLt)
  16719. : undefined;
  16720. }
  16721. /**
  16722. * This method is like `_.min` except that it accepts `iteratee` which is
  16723. * invoked for each element in `array` to generate the criterion by which
  16724. * the value is ranked. The iteratee is invoked with one argument: (value).
  16725. *
  16726. * @static
  16727. * @memberOf _
  16728. * @since 4.0.0
  16729. * @category Math
  16730. * @param {Array} array The array to iterate over.
  16731. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  16732. * @returns {*} Returns the minimum value.
  16733. * @example
  16734. *
  16735. * var objects = [{ 'n': 1 }, { 'n': 2 }];
  16736. *
  16737. * _.minBy(objects, function(o) { return o.n; });
  16738. * // => { 'n': 1 }
  16739. *
  16740. * // The `_.property` iteratee shorthand.
  16741. * _.minBy(objects, 'n');
  16742. * // => { 'n': 1 }
  16743. */
  16744. function minBy(array, iteratee) {
  16745. return (array && array.length)
  16746. ? baseExtremum(array, getIteratee(iteratee, 2), baseLt)
  16747. : undefined;
  16748. }
  16749. /**
  16750. * Multiply two numbers.
  16751. *
  16752. * @static
  16753. * @memberOf _
  16754. * @since 4.7.0
  16755. * @category Math
  16756. * @param {number} multiplier The first number in a multiplication.
  16757. * @param {number} multiplicand The second number in a multiplication.
  16758. * @returns {number} Returns the product.
  16759. * @example
  16760. *
  16761. * _.multiply(6, 4);
  16762. * // => 24
  16763. */
  16764. var multiply = createMathOperation(function(multiplier, multiplicand) {
  16765. return multiplier * multiplicand;
  16766. }, 1);
  16767. /**
  16768. * Computes `number` rounded to `precision`.
  16769. *
  16770. * @static
  16771. * @memberOf _
  16772. * @since 3.10.0
  16773. * @category Math
  16774. * @param {number} number The number to round.
  16775. * @param {number} [precision=0] The precision to round to.
  16776. * @returns {number} Returns the rounded number.
  16777. * @example
  16778. *
  16779. * _.round(4.006);
  16780. * // => 4
  16781. *
  16782. * _.round(4.006, 2);
  16783. * // => 4.01
  16784. *
  16785. * _.round(4060, -2);
  16786. * // => 4100
  16787. */
  16788. var round = createRound('round');
  16789. /**
  16790. * Subtract two numbers.
  16791. *
  16792. * @static
  16793. * @memberOf _
  16794. * @since 4.0.0
  16795. * @category Math
  16796. * @param {number} minuend The first number in a subtraction.
  16797. * @param {number} subtrahend The second number in a subtraction.
  16798. * @returns {number} Returns the difference.
  16799. * @example
  16800. *
  16801. * _.subtract(6, 4);
  16802. * // => 2
  16803. */
  16804. var subtract = createMathOperation(function(minuend, subtrahend) {
  16805. return minuend - subtrahend;
  16806. }, 0);
  16807. /**
  16808. * Computes the sum of the values in `array`.
  16809. *
  16810. * @static
  16811. * @memberOf _
  16812. * @since 3.4.0
  16813. * @category Math
  16814. * @param {Array} array The array to iterate over.
  16815. * @returns {number} Returns the sum.
  16816. * @example
  16817. *
  16818. * _.sum([4, 2, 8, 6]);
  16819. * // => 20
  16820. */
  16821. function sum(array) {
  16822. return (array && array.length)
  16823. ? baseSum(array, identity)
  16824. : 0;
  16825. }
  16826. /**
  16827. * This method is like `_.sum` except that it accepts `iteratee` which is
  16828. * invoked for each element in `array` to generate the value to be summed.
  16829. * The iteratee is invoked with one argument: (value).
  16830. *
  16831. * @static
  16832. * @memberOf _
  16833. * @since 4.0.0
  16834. * @category Math
  16835. * @param {Array} array The array to iterate over.
  16836. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  16837. * @returns {number} Returns the sum.
  16838. * @example
  16839. *
  16840. * var objects = [{ 'n': 4 }, { 'n': 2 }, { 'n': 8 }, { 'n': 6 }];
  16841. *
  16842. * _.sumBy(objects, function(o) { return o.n; });
  16843. * // => 20
  16844. *
  16845. * // The `_.property` iteratee shorthand.
  16846. * _.sumBy(objects, 'n');
  16847. * // => 20
  16848. */
  16849. function sumBy(array, iteratee) {
  16850. return (array && array.length)
  16851. ? baseSum(array, getIteratee(iteratee, 2))
  16852. : 0;
  16853. }
  16854. /*------------------------------------------------------------------------*/
  16855. // Add methods that return wrapped values in chain sequences.
  16856. lodash.after = after;
  16857. lodash.ary = ary;
  16858. lodash.assign = assign;
  16859. lodash.assignIn = assignIn;
  16860. lodash.assignInWith = assignInWith;
  16861. lodash.assignWith = assignWith;
  16862. lodash.at = at;
  16863. lodash.before = before;
  16864. lodash.bind = bind;
  16865. lodash.bindAll = bindAll;
  16866. lodash.bindKey = bindKey;
  16867. lodash.castArray = castArray;
  16868. lodash.chain = chain;
  16869. lodash.chunk = chunk;
  16870. lodash.compact = compact;
  16871. lodash.concat = concat;
  16872. lodash.cond = cond;
  16873. lodash.conforms = conforms;
  16874. lodash.constant = constant;
  16875. lodash.countBy = countBy;
  16876. lodash.create = create;
  16877. lodash.curry = curry;
  16878. lodash.curryRight = curryRight;
  16879. lodash.debounce = debounce;
  16880. lodash.defaults = defaults;
  16881. lodash.defaultsDeep = defaultsDeep;
  16882. lodash.defer = defer;
  16883. lodash.delay = delay;
  16884. lodash.difference = difference;
  16885. lodash.differenceBy = differenceBy;
  16886. lodash.differenceWith = differenceWith;
  16887. lodash.drop = drop;
  16888. lodash.dropRight = dropRight;
  16889. lodash.dropRightWhile = dropRightWhile;
  16890. lodash.dropWhile = dropWhile;
  16891. lodash.fill = fill;
  16892. lodash.filter = filter;
  16893. lodash.flatMap = flatMap;
  16894. lodash.flatMapDeep = flatMapDeep;
  16895. lodash.flatMapDepth = flatMapDepth;
  16896. lodash.flatten = flatten;
  16897. lodash.flattenDeep = flattenDeep;
  16898. lodash.flattenDepth = flattenDepth;
  16899. lodash.flip = flip;
  16900. lodash.flow = flow;
  16901. lodash.flowRight = flowRight;
  16902. lodash.fromPairs = fromPairs;
  16903. lodash.functions = functions;
  16904. lodash.functionsIn = functionsIn;
  16905. lodash.groupBy = groupBy;
  16906. lodash.initial = initial;
  16907. lodash.intersection = intersection;
  16908. lodash.intersectionBy = intersectionBy;
  16909. lodash.intersectionWith = intersectionWith;
  16910. lodash.invert = invert;
  16911. lodash.invertBy = invertBy;
  16912. lodash.invokeMap = invokeMap;
  16913. lodash.iteratee = iteratee;
  16914. lodash.keyBy = keyBy;
  16915. lodash.keys = keys;
  16916. lodash.keysIn = keysIn;
  16917. lodash.map = map;
  16918. lodash.mapKeys = mapKeys;
  16919. lodash.mapValues = mapValues;
  16920. lodash.matches = matches;
  16921. lodash.matchesProperty = matchesProperty;
  16922. lodash.memoize = memoize;
  16923. lodash.merge = merge;
  16924. lodash.mergeWith = mergeWith;
  16925. lodash.method = method;
  16926. lodash.methodOf = methodOf;
  16927. lodash.mixin = mixin;
  16928. lodash.negate = negate;
  16929. lodash.nthArg = nthArg;
  16930. lodash.omit = omit;
  16931. lodash.omitBy = omitBy;
  16932. lodash.once = once;
  16933. lodash.orderBy = orderBy;
  16934. lodash.over = over;
  16935. lodash.overArgs = overArgs;
  16936. lodash.overEvery = overEvery;
  16937. lodash.overSome = overSome;
  16938. lodash.partial = partial;
  16939. lodash.partialRight = partialRight;
  16940. lodash.partition = partition;
  16941. lodash.pick = pick;
  16942. lodash.pickBy = pickBy;
  16943. lodash.property = property;
  16944. lodash.propertyOf = propertyOf;
  16945. lodash.pull = pull;
  16946. lodash.pullAll = pullAll;
  16947. lodash.pullAllBy = pullAllBy;
  16948. lodash.pullAllWith = pullAllWith;
  16949. lodash.pullAt = pullAt;
  16950. lodash.range = range;
  16951. lodash.rangeRight = rangeRight;
  16952. lodash.rearg = rearg;
  16953. lodash.reject = reject;
  16954. lodash.remove = remove;
  16955. lodash.rest = rest;
  16956. lodash.reverse = reverse;
  16957. lodash.sampleSize = sampleSize;
  16958. lodash.set = set;
  16959. lodash.setWith = setWith;
  16960. lodash.shuffle = shuffle;
  16961. lodash.slice = slice;
  16962. lodash.sortBy = sortBy;
  16963. lodash.sortedUniq = sortedUniq;
  16964. lodash.sortedUniqBy = sortedUniqBy;
  16965. lodash.split = split;
  16966. lodash.spread = spread;
  16967. lodash.tail = tail;
  16968. lodash.take = take;
  16969. lodash.takeRight = takeRight;
  16970. lodash.takeRightWhile = takeRightWhile;
  16971. lodash.takeWhile = takeWhile;
  16972. lodash.tap = tap;
  16973. lodash.throttle = throttle;
  16974. lodash.thru = thru;
  16975. lodash.toArray = toArray;
  16976. lodash.toPairs = toPairs;
  16977. lodash.toPairsIn = toPairsIn;
  16978. lodash.toPath = toPath;
  16979. lodash.toPlainObject = toPlainObject;
  16980. lodash.transform = transform;
  16981. lodash.unary = unary;
  16982. lodash.union = union;
  16983. lodash.unionBy = unionBy;
  16984. lodash.unionWith = unionWith;
  16985. lodash.uniq = uniq;
  16986. lodash.uniqBy = uniqBy;
  16987. lodash.uniqWith = uniqWith;
  16988. lodash.unset = unset;
  16989. lodash.unzip = unzip;
  16990. lodash.unzipWith = unzipWith;
  16991. lodash.update = update;
  16992. lodash.updateWith = updateWith;
  16993. lodash.values = values;
  16994. lodash.valuesIn = valuesIn;
  16995. lodash.without = without;
  16996. lodash.words = words;
  16997. lodash.wrap = wrap;
  16998. lodash.xor = xor;
  16999. lodash.xorBy = xorBy;
  17000. lodash.xorWith = xorWith;
  17001. lodash.zip = zip;
  17002. lodash.zipObject = zipObject;
  17003. lodash.zipObjectDeep = zipObjectDeep;
  17004. lodash.zipWith = zipWith;
  17005. // Add aliases.
  17006. lodash.entries = toPairs;
  17007. lodash.entriesIn = toPairsIn;
  17008. lodash.extend = assignIn;
  17009. lodash.extendWith = assignInWith;
  17010. // Add methods to `lodash.prototype`.
  17011. mixin(lodash, lodash);
  17012. /*------------------------------------------------------------------------*/
  17013. // Add methods that return unwrapped values in chain sequences.
  17014. lodash.add = add;
  17015. lodash.attempt = attempt;
  17016. lodash.camelCase = camelCase;
  17017. lodash.capitalize = capitalize;
  17018. lodash.ceil = ceil;
  17019. lodash.clamp = clamp;
  17020. lodash.clone = clone;
  17021. lodash.cloneDeep = cloneDeep;
  17022. lodash.cloneDeepWith = cloneDeepWith;
  17023. lodash.cloneWith = cloneWith;
  17024. lodash.conformsTo = conformsTo;
  17025. lodash.deburr = deburr;
  17026. lodash.defaultTo = defaultTo;
  17027. lodash.divide = divide;
  17028. lodash.endsWith = endsWith;
  17029. lodash.eq = eq;
  17030. lodash.escape = escape;
  17031. lodash.escapeRegExp = escapeRegExp;
  17032. lodash.every = every;
  17033. lodash.find = find;
  17034. lodash.findIndex = findIndex;
  17035. lodash.findKey = findKey;
  17036. lodash.findLast = findLast;
  17037. lodash.findLastIndex = findLastIndex;
  17038. lodash.findLastKey = findLastKey;
  17039. lodash.floor = floor;
  17040. lodash.forEach = forEach;
  17041. lodash.forEachRight = forEachRight;
  17042. lodash.forIn = forIn;
  17043. lodash.forInRight = forInRight;
  17044. lodash.forOwn = forOwn;
  17045. lodash.forOwnRight = forOwnRight;
  17046. lodash.get = get;
  17047. lodash.gt = gt;
  17048. lodash.gte = gte;
  17049. lodash.has = has;
  17050. lodash.hasIn = hasIn;
  17051. lodash.head = head;
  17052. lodash.identity = identity;
  17053. lodash.includes = includes;
  17054. lodash.indexOf = indexOf;
  17055. lodash.inRange = inRange;
  17056. lodash.invoke = invoke;
  17057. lodash.isArguments = isArguments;
  17058. lodash.isArray = isArray;
  17059. lodash.isArrayBuffer = isArrayBuffer;
  17060. lodash.isArrayLike = isArrayLike;
  17061. lodash.isArrayLikeObject = isArrayLikeObject;
  17062. lodash.isBoolean = isBoolean;
  17063. lodash.isBuffer = isBuffer;
  17064. lodash.isDate = isDate;
  17065. lodash.isElement = isElement;
  17066. lodash.isEmpty = isEmpty;
  17067. lodash.isEqual = isEqual;
  17068. lodash.isEqualWith = isEqualWith;
  17069. lodash.isError = isError;
  17070. lodash.isFinite = isFinite;
  17071. lodash.isFunction = isFunction;
  17072. lodash.isInteger = isInteger;
  17073. lodash.isLength = isLength;
  17074. lodash.isMap = isMap;
  17075. lodash.isMatch = isMatch;
  17076. lodash.isMatchWith = isMatchWith;
  17077. lodash.isNaN = isNaN;
  17078. lodash.isNative = isNative;
  17079. lodash.isNil = isNil;
  17080. lodash.isNull = isNull;
  17081. lodash.isNumber = isNumber;
  17082. lodash.isObject = isObject;
  17083. lodash.isObjectLike = isObjectLike;
  17084. lodash.isPlainObject = isPlainObject;
  17085. lodash.isRegExp = isRegExp;
  17086. lodash.isSafeInteger = isSafeInteger;
  17087. lodash.isSet = isSet;
  17088. lodash.isString = isString;
  17089. lodash.isSymbol = isSymbol;
  17090. lodash.isTypedArray = isTypedArray;
  17091. lodash.isUndefined = isUndefined;
  17092. lodash.isWeakMap = isWeakMap;
  17093. lodash.isWeakSet = isWeakSet;
  17094. lodash.join = join;
  17095. lodash.kebabCase = kebabCase;
  17096. lodash.last = last;
  17097. lodash.lastIndexOf = lastIndexOf;
  17098. lodash.lowerCase = lowerCase;
  17099. lodash.lowerFirst = lowerFirst;
  17100. lodash.lt = lt;
  17101. lodash.lte = lte;
  17102. lodash.max = max;
  17103. lodash.maxBy = maxBy;
  17104. lodash.mean = mean;
  17105. lodash.meanBy = meanBy;
  17106. lodash.min = min;
  17107. lodash.minBy = minBy;
  17108. lodash.stubArray = stubArray;
  17109. lodash.stubFalse = stubFalse;
  17110. lodash.stubObject = stubObject;
  17111. lodash.stubString = stubString;
  17112. lodash.stubTrue = stubTrue;
  17113. lodash.multiply = multiply;
  17114. lodash.nth = nth;
  17115. lodash.noConflict = noConflict;
  17116. lodash.noop = noop;
  17117. lodash.now = now;
  17118. lodash.pad = pad;
  17119. lodash.padEnd = padEnd;
  17120. lodash.padStart = padStart;
  17121. lodash.parseInt = parseInt;
  17122. lodash.random = random;
  17123. lodash.reduce = reduce;
  17124. lodash.reduceRight = reduceRight;
  17125. lodash.repeat = repeat;
  17126. lodash.replace = replace;
  17127. lodash.result = result;
  17128. lodash.round = round;
  17129. lodash.runInContext = runInContext;
  17130. lodash.sample = sample;
  17131. lodash.size = size;
  17132. lodash.snakeCase = snakeCase;
  17133. lodash.some = some;
  17134. lodash.sortedIndex = sortedIndex;
  17135. lodash.sortedIndexBy = sortedIndexBy;
  17136. lodash.sortedIndexOf = sortedIndexOf;
  17137. lodash.sortedLastIndex = sortedLastIndex;
  17138. lodash.sortedLastIndexBy = sortedLastIndexBy;
  17139. lodash.sortedLastIndexOf = sortedLastIndexOf;
  17140. lodash.startCase = startCase;
  17141. lodash.startsWith = startsWith;
  17142. lodash.subtract = subtract;
  17143. lodash.sum = sum;
  17144. lodash.sumBy = sumBy;
  17145. lodash.template = template;
  17146. lodash.times = times;
  17147. lodash.toFinite = toFinite;
  17148. lodash.toInteger = toInteger;
  17149. lodash.toLength = toLength;
  17150. lodash.toLower = toLower;
  17151. lodash.toNumber = toNumber;
  17152. lodash.toSafeInteger = toSafeInteger;
  17153. lodash.toString = toString;
  17154. lodash.toUpper = toUpper;
  17155. lodash.trim = trim;
  17156. lodash.trimEnd = trimEnd;
  17157. lodash.trimStart = trimStart;
  17158. lodash.truncate = truncate;
  17159. lodash.unescape = unescape;
  17160. lodash.uniqueId = uniqueId;
  17161. lodash.upperCase = upperCase;
  17162. lodash.upperFirst = upperFirst;
  17163. // Add aliases.
  17164. lodash.each = forEach;
  17165. lodash.eachRight = forEachRight;
  17166. lodash.first = head;
  17167. mixin(lodash, (function() {
  17168. var source = {};
  17169. baseForOwn(lodash, function(func, methodName) {
  17170. if (!hasOwnProperty.call(lodash.prototype, methodName)) {
  17171. source[methodName] = func;
  17172. }
  17173. });
  17174. return source;
  17175. }()), { 'chain': false });
  17176. /*------------------------------------------------------------------------*/
  17177. /**
  17178. * The semantic version number.
  17179. *
  17180. * @static
  17181. * @memberOf _
  17182. * @type {string}
  17183. */
  17184. lodash.VERSION = VERSION;
  17185. // Assign default placeholders.
  17186. arrayEach(['bind', 'bindKey', 'curry', 'curryRight', 'partial', 'partialRight'], function(methodName) {
  17187. lodash[methodName].placeholder = lodash;
  17188. });
  17189. // Add `LazyWrapper` methods for `_.drop` and `_.take` variants.
  17190. arrayEach(['drop', 'take'], function(methodName, index) {
  17191. LazyWrapper.prototype[methodName] = function(n) {
  17192. n = n === undefined ? 1 : nativeMax(toInteger(n), 0);
  17193. var result = (this.__filtered__ && !index)
  17194. ? new LazyWrapper(this)
  17195. : this.clone();
  17196. if (result.__filtered__) {
  17197. result.__takeCount__ = nativeMin(n, result.__takeCount__);
  17198. } else {
  17199. result.__views__.push({
  17200. 'size': nativeMin(n, MAX_ARRAY_LENGTH),
  17201. 'type': methodName + (result.__dir__ < 0 ? 'Right' : '')
  17202. });
  17203. }
  17204. return result;
  17205. };
  17206. LazyWrapper.prototype[methodName + 'Right'] = function(n) {
  17207. return this.reverse()[methodName](n).reverse();
  17208. };
  17209. });
  17210. // Add `LazyWrapper` methods that accept an `iteratee` value.
  17211. arrayEach(['filter', 'map', 'takeWhile'], function(methodName, index) {
  17212. var type = index + 1,
  17213. isFilter = type == LAZY_FILTER_FLAG || type == LAZY_WHILE_FLAG;
  17214. LazyWrapper.prototype[methodName] = function(iteratee) {
  17215. var result = this.clone();
  17216. result.__iteratees__.push({
  17217. 'iteratee': getIteratee(iteratee, 3),
  17218. 'type': type
  17219. });
  17220. result.__filtered__ = result.__filtered__ || isFilter;
  17221. return result;
  17222. };
  17223. });
  17224. // Add `LazyWrapper` methods for `_.head` and `_.last`.
  17225. arrayEach(['head', 'last'], function(methodName, index) {
  17226. var takeName = 'take' + (index ? 'Right' : '');
  17227. LazyWrapper.prototype[methodName] = function() {
  17228. return this[takeName](1).value()[0];
  17229. };
  17230. });
  17231. // Add `LazyWrapper` methods for `_.initial` and `_.tail`.
  17232. arrayEach(['initial', 'tail'], function(methodName, index) {
  17233. var dropName = 'drop' + (index ? '' : 'Right');
  17234. LazyWrapper.prototype[methodName] = function() {
  17235. return this.__filtered__ ? new LazyWrapper(this) : this[dropName](1);
  17236. };
  17237. });
  17238. LazyWrapper.prototype.compact = function() {
  17239. return this.filter(identity);
  17240. };
  17241. LazyWrapper.prototype.find = function(predicate) {
  17242. return this.filter(predicate).head();
  17243. };
  17244. LazyWrapper.prototype.findLast = function(predicate) {
  17245. return this.reverse().find(predicate);
  17246. };
  17247. LazyWrapper.prototype.invokeMap = baseRest(function(path, args) {
  17248. if (typeof path == 'function') {
  17249. return new LazyWrapper(this);
  17250. }
  17251. return this.map(function(value) {
  17252. return baseInvoke(value, path, args);
  17253. });
  17254. });
  17255. LazyWrapper.prototype.reject = function(predicate) {
  17256. return this.filter(negate(getIteratee(predicate)));
  17257. };
  17258. LazyWrapper.prototype.slice = function(start, end) {
  17259. start = toInteger(start);
  17260. var result = this;
  17261. if (result.__filtered__ && (start > 0 || end < 0)) {
  17262. return new LazyWrapper(result);
  17263. }
  17264. if (start < 0) {
  17265. result = result.takeRight(-start);
  17266. } else if (start) {
  17267. result = result.drop(start);
  17268. }
  17269. if (end !== undefined) {
  17270. end = toInteger(end);
  17271. result = end < 0 ? result.dropRight(-end) : result.take(end - start);
  17272. }
  17273. return result;
  17274. };
  17275. LazyWrapper.prototype.takeRightWhile = function(predicate) {
  17276. return this.reverse().takeWhile(predicate).reverse();
  17277. };
  17278. LazyWrapper.prototype.toArray = function() {
  17279. return this.take(MAX_ARRAY_LENGTH);
  17280. };
  17281. // Add `LazyWrapper` methods to `lodash.prototype`.
  17282. baseForOwn(LazyWrapper.prototype, function(func, methodName) {
  17283. var checkIteratee = /^(?:filter|find|map|reject)|While$/.test(methodName),
  17284. isTaker = /^(?:head|last)$/.test(methodName),
  17285. lodashFunc = lodash[isTaker ? ('take' + (methodName == 'last' ? 'Right' : '')) : methodName],
  17286. retUnwrapped = isTaker || /^find/.test(methodName);
  17287. if (!lodashFunc) {
  17288. return;
  17289. }
  17290. lodash.prototype[methodName] = function() {
  17291. var value = this.__wrapped__,
  17292. args = isTaker ? [1] : arguments,
  17293. isLazy = value instanceof LazyWrapper,
  17294. iteratee = args[0],
  17295. useLazy = isLazy || isArray(value);
  17296. var interceptor = function(value) {
  17297. var result = lodashFunc.apply(lodash, arrayPush([value], args));
  17298. return (isTaker && chainAll) ? result[0] : result;
  17299. };
  17300. if (useLazy && checkIteratee && typeof iteratee == 'function' && iteratee.length != 1) {
  17301. // Avoid lazy use if the iteratee has a "length" value other than `1`.
  17302. isLazy = useLazy = false;
  17303. }
  17304. var chainAll = this.__chain__,
  17305. isHybrid = !!this.__actions__.length,
  17306. isUnwrapped = retUnwrapped && !chainAll,
  17307. onlyLazy = isLazy && !isHybrid;
  17308. if (!retUnwrapped && useLazy) {
  17309. value = onlyLazy ? value : new LazyWrapper(this);
  17310. var result = func.apply(value, args);
  17311. result.__actions__.push({ 'func': thru, 'args': [interceptor], 'thisArg': undefined });
  17312. return new LodashWrapper(result, chainAll);
  17313. }
  17314. if (isUnwrapped && onlyLazy) {
  17315. return func.apply(this, args);
  17316. }
  17317. result = this.thru(interceptor);
  17318. return isUnwrapped ? (isTaker ? result.value()[0] : result.value()) : result;
  17319. };
  17320. });
  17321. // Add `Array` methods to `lodash.prototype`.
  17322. arrayEach(['pop', 'push', 'shift', 'sort', 'splice', 'unshift'], function(methodName) {
  17323. var func = arrayProto[methodName],
  17324. chainName = /^(?:push|sort|unshift)$/.test(methodName) ? 'tap' : 'thru',
  17325. retUnwrapped = /^(?:pop|shift)$/.test(methodName);
  17326. lodash.prototype[methodName] = function() {
  17327. var args = arguments;
  17328. if (retUnwrapped && !this.__chain__) {
  17329. var value = this.value();
  17330. return func.apply(isArray(value) ? value : [], args);
  17331. }
  17332. return this[chainName](function(value) {
  17333. return func.apply(isArray(value) ? value : [], args);
  17334. });
  17335. };
  17336. });
  17337. // Map minified method names to their real names.
  17338. baseForOwn(LazyWrapper.prototype, function(func, methodName) {
  17339. var lodashFunc = lodash[methodName];
  17340. if (lodashFunc) {
  17341. var key = lodashFunc.name + '';
  17342. if (!hasOwnProperty.call(realNames, key)) {
  17343. realNames[key] = [];
  17344. }
  17345. realNames[key].push({ 'name': methodName, 'func': lodashFunc });
  17346. }
  17347. });
  17348. realNames[createHybrid(undefined, WRAP_BIND_KEY_FLAG).name] = [{
  17349. 'name': 'wrapper',
  17350. 'func': undefined
  17351. }];
  17352. // Add methods to `LazyWrapper`.
  17353. LazyWrapper.prototype.clone = lazyClone;
  17354. LazyWrapper.prototype.reverse = lazyReverse;
  17355. LazyWrapper.prototype.value = lazyValue;
  17356. // Add chain sequence methods to the `lodash` wrapper.
  17357. lodash.prototype.at = wrapperAt;
  17358. lodash.prototype.chain = wrapperChain;
  17359. lodash.prototype.commit = wrapperCommit;
  17360. lodash.prototype.next = wrapperNext;
  17361. lodash.prototype.plant = wrapperPlant;
  17362. lodash.prototype.reverse = wrapperReverse;
  17363. lodash.prototype.toJSON = lodash.prototype.valueOf = lodash.prototype.value = wrapperValue;
  17364. // Add lazy aliases.
  17365. lodash.prototype.first = lodash.prototype.head;
  17366. if (symIterator) {
  17367. lodash.prototype[symIterator] = wrapperToIterator;
  17368. }
  17369. return lodash;
  17370. });
  17371. /*--------------------------------------------------------------------------*/
  17372. // Export lodash.
  17373. var _ = runInContext();
  17374. // Some AMD build optimizers, like r.js, check for condition patterns like:
  17375. if (true) {
  17376. // Expose Lodash on the global object to prevent errors when Lodash is
  17377. // loaded by a script tag in the presence of an AMD loader.
  17378. // See http://requirejs.org/docs/errors.html#mismatch for more details.
  17379. // Use `_.noConflict` to remove Lodash from the global object.
  17380. root._ = _;
  17381. // Define as an anonymous module so, through path mapping, it can be
  17382. // referenced as the "underscore" module.
  17383. !(__WEBPACK_AMD_DEFINE_RESULT__ = (function() {
  17384. return _;
  17385. }).call(exports, __webpack_require__, exports, module),
  17386. __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
  17387. }
  17388. // Check for `exports` after `define` in case a build optimizer adds it.
  17389. else {}
  17390. }.call(this));
  17391. /***/ }),
  17392. /***/ "./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/Dashboard/Components/Sidebar.vue?vue&type=style&index=0&id=5b49aa22&lang=scss&scoped=true":
  17393. /*!*******************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  17394. !*** ./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/Dashboard/Components/Sidebar.vue?vue&type=style&index=0&id=5b49aa22&lang=scss&scoped=true ***!
  17395. \*******************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  17396. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17397. "use strict";
  17398. __webpack_require__.r(__webpack_exports__);
  17399. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17400. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17401. /* harmony export */ });
  17402. /* 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");
  17403. /* 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__);
  17404. /* 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_Sidebar_vue_vue_type_style_index_0_id_5b49aa22_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]!./Sidebar.vue?vue&type=style&index=0&id=5b49aa22&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/Dashboard/Components/Sidebar.vue?vue&type=style&index=0&id=5b49aa22&lang=scss&scoped=true");
  17405. var options = {};
  17406. options.insert = "head";
  17407. options.singleton = false;
  17408. 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_Sidebar_vue_vue_type_style_index_0_id_5b49aa22_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_1__["default"], options);
  17409. /* 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_Sidebar_vue_vue_type_style_index_0_id_5b49aa22_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_1__["default"].locals || {});
  17410. /***/ }),
  17411. /***/ "./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/Dashboard/Components/SubSidebar.vue?vue&type=style&index=0&id=b1b23eb4&lang=scss&scoped=true":
  17412. /*!**********************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  17413. !*** ./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/Dashboard/Components/SubSidebar.vue?vue&type=style&index=0&id=b1b23eb4&lang=scss&scoped=true ***!
  17414. \**********************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  17415. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17416. "use strict";
  17417. __webpack_require__.r(__webpack_exports__);
  17418. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17419. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17420. /* harmony export */ });
  17421. /* 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");
  17422. /* 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__);
  17423. /* 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_SubSidebar_vue_vue_type_style_index_0_id_b1b23eb4_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]!./SubSidebar.vue?vue&type=style&index=0&id=b1b23eb4&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/Dashboard/Components/SubSidebar.vue?vue&type=style&index=0&id=b1b23eb4&lang=scss&scoped=true");
  17424. var options = {};
  17425. options.insert = "head";
  17426. options.singleton = false;
  17427. 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_SubSidebar_vue_vue_type_style_index_0_id_b1b23eb4_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_1__["default"], options);
  17428. /* 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_SubSidebar_vue_vue_type_style_index_0_id_b1b23eb4_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_1__["default"].locals || {});
  17429. /***/ }),
  17430. /***/ "./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/Dashboard/Components/TopBar.vue?vue&type=style&index=0&id=0b7edbb0&lang=scss&scoped=true":
  17431. /*!******************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  17432. !*** ./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/Dashboard/Components/TopBar.vue?vue&type=style&index=0&id=0b7edbb0&lang=scss&scoped=true ***!
  17433. \******************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  17434. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17435. "use strict";
  17436. __webpack_require__.r(__webpack_exports__);
  17437. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17438. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17439. /* harmony export */ });
  17440. /* 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");
  17441. /* 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__);
  17442. /* 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_TopBar_vue_vue_type_style_index_0_id_0b7edbb0_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]!./TopBar.vue?vue&type=style&index=0&id=0b7edbb0&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/Dashboard/Components/TopBar.vue?vue&type=style&index=0&id=0b7edbb0&lang=scss&scoped=true");
  17443. var options = {};
  17444. options.insert = "head";
  17445. options.singleton = false;
  17446. 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_TopBar_vue_vue_type_style_index_0_id_0b7edbb0_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_1__["default"], options);
  17447. /* 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_TopBar_vue_vue_type_style_index_0_id_0b7edbb0_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_1__["default"].locals || {});
  17448. /***/ }),
  17449. /***/ "./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/Dashboard/DashboardLayout.vue?vue&type=style&index=0&id=1d279fe2&lang=scss&scoped=true":
  17450. /*!****************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  17451. !*** ./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/Dashboard/DashboardLayout.vue?vue&type=style&index=0&id=1d279fe2&lang=scss&scoped=true ***!
  17452. \****************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  17453. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17454. "use strict";
  17455. __webpack_require__.r(__webpack_exports__);
  17456. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17457. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17458. /* harmony export */ });
  17459. /* 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");
  17460. /* 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__);
  17461. /* 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_1d279fe2_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=1d279fe2&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/Dashboard/DashboardLayout.vue?vue&type=style&index=0&id=1d279fe2&lang=scss&scoped=true");
  17462. var options = {};
  17463. options.insert = "head";
  17464. options.singleton = false;
  17465. 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_1d279fe2_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_1__["default"], options);
  17466. /* 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_1d279fe2_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_1__["default"].locals || {});
  17467. /***/ }),
  17468. /***/ "./node_modules/vue-loader/dist/exportHelper.js":
  17469. /*!******************************************************!*\
  17470. !*** ./node_modules/vue-loader/dist/exportHelper.js ***!
  17471. \******************************************************/
  17472. /***/ ((__unused_webpack_module, exports) => {
  17473. "use strict";
  17474. Object.defineProperty(exports, "__esModule", ({ value: true }));
  17475. // runtime helper for setting properties on components
  17476. // in a tree-shakable way
  17477. exports["default"] = (sfc, props) => {
  17478. const target = sfc.__vccOpts || sfc;
  17479. for (const [key, val] of props) {
  17480. target[key] = val;
  17481. }
  17482. return target;
  17483. };
  17484. /***/ }),
  17485. /***/ "./resources/js/components/AppButtonLink.vue":
  17486. /*!***************************************************!*\
  17487. !*** ./resources/js/components/AppButtonLink.vue ***!
  17488. \***************************************************/
  17489. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17490. "use strict";
  17491. __webpack_require__.r(__webpack_exports__);
  17492. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17493. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17494. /* harmony export */ });
  17495. /* harmony import */ var _AppButtonLink_vue_vue_type_template_id_c3621f1c__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./AppButtonLink.vue?vue&type=template&id=c3621f1c */ "./resources/js/components/AppButtonLink.vue?vue&type=template&id=c3621f1c");
  17496. /* harmony import */ var _AppButtonLink_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./AppButtonLink.vue?vue&type=script&setup=true&lang=js */ "./resources/js/components/AppButtonLink.vue?vue&type=script&setup=true&lang=js");
  17497. /* harmony import */ var _media_dijitalcode_3ad9c6e0_4296_4a57_b136_144df49e7bb8_Projects_cahaya_agung_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");
  17498. ;
  17499. const __exports__ = /*#__PURE__*/(0,_media_dijitalcode_3ad9c6e0_4296_4a57_b136_144df49e7bb8_Projects_cahaya_agung_node_modules_vue_loader_dist_exportHelper_js__WEBPACK_IMPORTED_MODULE_2__["default"])(_AppButtonLink_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_1__["default"], [['render',_AppButtonLink_vue_vue_type_template_id_c3621f1c__WEBPACK_IMPORTED_MODULE_0__.render],['__file',"resources/js/components/AppButtonLink.vue"]])
  17500. /* hot reload */
  17501. if (false) {}
  17502. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__);
  17503. /***/ }),
  17504. /***/ "./resources/js/components/AppMessage.vue":
  17505. /*!************************************************!*\
  17506. !*** ./resources/js/components/AppMessage.vue ***!
  17507. \************************************************/
  17508. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17509. "use strict";
  17510. __webpack_require__.r(__webpack_exports__);
  17511. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17512. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17513. /* harmony export */ });
  17514. /* 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");
  17515. /* 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");
  17516. /* harmony import */ var _media_dijitalcode_3ad9c6e0_4296_4a57_b136_144df49e7bb8_Projects_cahaya_agung_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");
  17517. ;
  17518. const __exports__ = /*#__PURE__*/(0,_media_dijitalcode_3ad9c6e0_4296_4a57_b136_144df49e7bb8_Projects_cahaya_agung_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"]])
  17519. /* hot reload */
  17520. if (false) {}
  17521. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__);
  17522. /***/ }),
  17523. /***/ "./resources/js/components/AppPagination.vue":
  17524. /*!***************************************************!*\
  17525. !*** ./resources/js/components/AppPagination.vue ***!
  17526. \***************************************************/
  17527. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17528. "use strict";
  17529. __webpack_require__.r(__webpack_exports__);
  17530. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17531. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17532. /* harmony export */ });
  17533. /* harmony import */ var _AppPagination_vue_vue_type_template_id_4da56ec0__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./AppPagination.vue?vue&type=template&id=4da56ec0 */ "./resources/js/components/AppPagination.vue?vue&type=template&id=4da56ec0");
  17534. /* harmony import */ var _AppPagination_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./AppPagination.vue?vue&type=script&setup=true&lang=js */ "./resources/js/components/AppPagination.vue?vue&type=script&setup=true&lang=js");
  17535. /* harmony import */ var _media_dijitalcode_3ad9c6e0_4296_4a57_b136_144df49e7bb8_Projects_cahaya_agung_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");
  17536. ;
  17537. const __exports__ = /*#__PURE__*/(0,_media_dijitalcode_3ad9c6e0_4296_4a57_b136_144df49e7bb8_Projects_cahaya_agung_node_modules_vue_loader_dist_exportHelper_js__WEBPACK_IMPORTED_MODULE_2__["default"])(_AppPagination_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_1__["default"], [['render',_AppPagination_vue_vue_type_template_id_4da56ec0__WEBPACK_IMPORTED_MODULE_0__.render],['__file',"resources/js/components/AppPagination.vue"]])
  17538. /* hot reload */
  17539. if (false) {}
  17540. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__);
  17541. /***/ }),
  17542. /***/ "./resources/js/components/AppSearch.vue":
  17543. /*!***********************************************!*\
  17544. !*** ./resources/js/components/AppSearch.vue ***!
  17545. \***********************************************/
  17546. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17547. "use strict";
  17548. __webpack_require__.r(__webpack_exports__);
  17549. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17550. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17551. /* harmony export */ });
  17552. /* harmony import */ var _AppSearch_vue_vue_type_template_id_5b9fdcce__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./AppSearch.vue?vue&type=template&id=5b9fdcce */ "./resources/js/components/AppSearch.vue?vue&type=template&id=5b9fdcce");
  17553. /* harmony import */ var _AppSearch_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./AppSearch.vue?vue&type=script&setup=true&lang=js */ "./resources/js/components/AppSearch.vue?vue&type=script&setup=true&lang=js");
  17554. /* harmony import */ var _media_dijitalcode_3ad9c6e0_4296_4a57_b136_144df49e7bb8_Projects_cahaya_agung_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");
  17555. ;
  17556. const __exports__ = /*#__PURE__*/(0,_media_dijitalcode_3ad9c6e0_4296_4a57_b136_144df49e7bb8_Projects_cahaya_agung_node_modules_vue_loader_dist_exportHelper_js__WEBPACK_IMPORTED_MODULE_2__["default"])(_AppSearch_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_1__["default"], [['render',_AppSearch_vue_vue_type_template_id_5b9fdcce__WEBPACK_IMPORTED_MODULE_0__.render],['__file',"resources/js/components/AppSearch.vue"]])
  17557. /* hot reload */
  17558. if (false) {}
  17559. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__);
  17560. /***/ }),
  17561. /***/ "./resources/js/layouts/Dashboard/Components/Footer.vue":
  17562. /*!**************************************************************!*\
  17563. !*** ./resources/js/layouts/Dashboard/Components/Footer.vue ***!
  17564. \**************************************************************/
  17565. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17566. "use strict";
  17567. __webpack_require__.r(__webpack_exports__);
  17568. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17569. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17570. /* harmony export */ });
  17571. /* harmony import */ var _Footer_vue_vue_type_template_id_dbb3aa76__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./Footer.vue?vue&type=template&id=dbb3aa76 */ "./resources/js/layouts/Dashboard/Components/Footer.vue?vue&type=template&id=dbb3aa76");
  17572. /* harmony import */ var _media_dijitalcode_3ad9c6e0_4296_4a57_b136_144df49e7bb8_Projects_cahaya_agung_node_modules_vue_loader_dist_exportHelper_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./node_modules/vue-loader/dist/exportHelper.js */ "./node_modules/vue-loader/dist/exportHelper.js");
  17573. const script = {}
  17574. ;
  17575. const __exports__ = /*#__PURE__*/(0,_media_dijitalcode_3ad9c6e0_4296_4a57_b136_144df49e7bb8_Projects_cahaya_agung_node_modules_vue_loader_dist_exportHelper_js__WEBPACK_IMPORTED_MODULE_1__["default"])(script, [['render',_Footer_vue_vue_type_template_id_dbb3aa76__WEBPACK_IMPORTED_MODULE_0__.render],['__file',"resources/js/layouts/Dashboard/Components/Footer.vue"]])
  17576. /* hot reload */
  17577. if (false) {}
  17578. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__);
  17579. /***/ }),
  17580. /***/ "./resources/js/layouts/Dashboard/Components/Sidebar.vue":
  17581. /*!***************************************************************!*\
  17582. !*** ./resources/js/layouts/Dashboard/Components/Sidebar.vue ***!
  17583. \***************************************************************/
  17584. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17585. "use strict";
  17586. __webpack_require__.r(__webpack_exports__);
  17587. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17588. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17589. /* harmony export */ });
  17590. /* harmony import */ var _Sidebar_vue_vue_type_template_id_5b49aa22_scoped_true__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./Sidebar.vue?vue&type=template&id=5b49aa22&scoped=true */ "./resources/js/layouts/Dashboard/Components/Sidebar.vue?vue&type=template&id=5b49aa22&scoped=true");
  17591. /* harmony import */ var _Sidebar_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./Sidebar.vue?vue&type=script&setup=true&lang=js */ "./resources/js/layouts/Dashboard/Components/Sidebar.vue?vue&type=script&setup=true&lang=js");
  17592. /* harmony import */ var _Sidebar_vue_vue_type_style_index_0_id_5b49aa22_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./Sidebar.vue?vue&type=style&index=0&id=5b49aa22&lang=scss&scoped=true */ "./resources/js/layouts/Dashboard/Components/Sidebar.vue?vue&type=style&index=0&id=5b49aa22&lang=scss&scoped=true");
  17593. /* harmony import */ var _media_dijitalcode_3ad9c6e0_4296_4a57_b136_144df49e7bb8_Projects_cahaya_agung_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");
  17594. ;
  17595. const __exports__ = /*#__PURE__*/(0,_media_dijitalcode_3ad9c6e0_4296_4a57_b136_144df49e7bb8_Projects_cahaya_agung_node_modules_vue_loader_dist_exportHelper_js__WEBPACK_IMPORTED_MODULE_3__["default"])(_Sidebar_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_1__["default"], [['render',_Sidebar_vue_vue_type_template_id_5b49aa22_scoped_true__WEBPACK_IMPORTED_MODULE_0__.render],['__scopeId',"data-v-5b49aa22"],['__file',"resources/js/layouts/Dashboard/Components/Sidebar.vue"]])
  17596. /* hot reload */
  17597. if (false) {}
  17598. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__);
  17599. /***/ }),
  17600. /***/ "./resources/js/layouts/Dashboard/Components/SubSidebar.vue":
  17601. /*!******************************************************************!*\
  17602. !*** ./resources/js/layouts/Dashboard/Components/SubSidebar.vue ***!
  17603. \******************************************************************/
  17604. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17605. "use strict";
  17606. __webpack_require__.r(__webpack_exports__);
  17607. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17608. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17609. /* harmony export */ });
  17610. /* harmony import */ var _SubSidebar_vue_vue_type_template_id_b1b23eb4_scoped_true__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./SubSidebar.vue?vue&type=template&id=b1b23eb4&scoped=true */ "./resources/js/layouts/Dashboard/Components/SubSidebar.vue?vue&type=template&id=b1b23eb4&scoped=true");
  17611. /* harmony import */ var _SubSidebar_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./SubSidebar.vue?vue&type=script&setup=true&lang=js */ "./resources/js/layouts/Dashboard/Components/SubSidebar.vue?vue&type=script&setup=true&lang=js");
  17612. /* harmony import */ var _SubSidebar_vue_vue_type_style_index_0_id_b1b23eb4_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./SubSidebar.vue?vue&type=style&index=0&id=b1b23eb4&lang=scss&scoped=true */ "./resources/js/layouts/Dashboard/Components/SubSidebar.vue?vue&type=style&index=0&id=b1b23eb4&lang=scss&scoped=true");
  17613. /* harmony import */ var _media_dijitalcode_3ad9c6e0_4296_4a57_b136_144df49e7bb8_Projects_cahaya_agung_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");
  17614. ;
  17615. const __exports__ = /*#__PURE__*/(0,_media_dijitalcode_3ad9c6e0_4296_4a57_b136_144df49e7bb8_Projects_cahaya_agung_node_modules_vue_loader_dist_exportHelper_js__WEBPACK_IMPORTED_MODULE_3__["default"])(_SubSidebar_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_1__["default"], [['render',_SubSidebar_vue_vue_type_template_id_b1b23eb4_scoped_true__WEBPACK_IMPORTED_MODULE_0__.render],['__scopeId',"data-v-b1b23eb4"],['__file',"resources/js/layouts/Dashboard/Components/SubSidebar.vue"]])
  17616. /* hot reload */
  17617. if (false) {}
  17618. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__);
  17619. /***/ }),
  17620. /***/ "./resources/js/layouts/Dashboard/Components/TopBar.vue":
  17621. /*!**************************************************************!*\
  17622. !*** ./resources/js/layouts/Dashboard/Components/TopBar.vue ***!
  17623. \**************************************************************/
  17624. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17625. "use strict";
  17626. __webpack_require__.r(__webpack_exports__);
  17627. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17628. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17629. /* harmony export */ });
  17630. /* harmony import */ var _TopBar_vue_vue_type_template_id_0b7edbb0_scoped_true__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./TopBar.vue?vue&type=template&id=0b7edbb0&scoped=true */ "./resources/js/layouts/Dashboard/Components/TopBar.vue?vue&type=template&id=0b7edbb0&scoped=true");
  17631. /* harmony import */ var _TopBar_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./TopBar.vue?vue&type=script&setup=true&lang=js */ "./resources/js/layouts/Dashboard/Components/TopBar.vue?vue&type=script&setup=true&lang=js");
  17632. /* harmony import */ var _TopBar_vue_vue_type_style_index_0_id_0b7edbb0_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./TopBar.vue?vue&type=style&index=0&id=0b7edbb0&lang=scss&scoped=true */ "./resources/js/layouts/Dashboard/Components/TopBar.vue?vue&type=style&index=0&id=0b7edbb0&lang=scss&scoped=true");
  17633. /* harmony import */ var _media_dijitalcode_3ad9c6e0_4296_4a57_b136_144df49e7bb8_Projects_cahaya_agung_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");
  17634. ;
  17635. const __exports__ = /*#__PURE__*/(0,_media_dijitalcode_3ad9c6e0_4296_4a57_b136_144df49e7bb8_Projects_cahaya_agung_node_modules_vue_loader_dist_exportHelper_js__WEBPACK_IMPORTED_MODULE_3__["default"])(_TopBar_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_1__["default"], [['render',_TopBar_vue_vue_type_template_id_0b7edbb0_scoped_true__WEBPACK_IMPORTED_MODULE_0__.render],['__scopeId',"data-v-0b7edbb0"],['__file',"resources/js/layouts/Dashboard/Components/TopBar.vue"]])
  17636. /* hot reload */
  17637. if (false) {}
  17638. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__);
  17639. /***/ }),
  17640. /***/ "./resources/js/layouts/Dashboard/DashboardLayout.vue":
  17641. /*!************************************************************!*\
  17642. !*** ./resources/js/layouts/Dashboard/DashboardLayout.vue ***!
  17643. \************************************************************/
  17644. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17645. "use strict";
  17646. __webpack_require__.r(__webpack_exports__);
  17647. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17648. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17649. /* harmony export */ });
  17650. /* harmony import */ var _DashboardLayout_vue_vue_type_template_id_1d279fe2_scoped_true__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./DashboardLayout.vue?vue&type=template&id=1d279fe2&scoped=true */ "./resources/js/layouts/Dashboard/DashboardLayout.vue?vue&type=template&id=1d279fe2&scoped=true");
  17651. /* 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/Dashboard/DashboardLayout.vue?vue&type=script&setup=true&lang=js");
  17652. /* harmony import */ var _DashboardLayout_vue_vue_type_style_index_0_id_1d279fe2_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./DashboardLayout.vue?vue&type=style&index=0&id=1d279fe2&lang=scss&scoped=true */ "./resources/js/layouts/Dashboard/DashboardLayout.vue?vue&type=style&index=0&id=1d279fe2&lang=scss&scoped=true");
  17653. /* harmony import */ var _media_dijitalcode_3ad9c6e0_4296_4a57_b136_144df49e7bb8_Projects_cahaya_agung_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");
  17654. ;
  17655. const __exports__ = /*#__PURE__*/(0,_media_dijitalcode_3ad9c6e0_4296_4a57_b136_144df49e7bb8_Projects_cahaya_agung_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_1d279fe2_scoped_true__WEBPACK_IMPORTED_MODULE_0__.render],['__scopeId',"data-v-1d279fe2"],['__file',"resources/js/layouts/Dashboard/DashboardLayout.vue"]])
  17656. /* hot reload */
  17657. if (false) {}
  17658. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__);
  17659. /***/ }),
  17660. /***/ "./resources/js/pages/Suppliers/Index.vue":
  17661. /*!************************************************!*\
  17662. !*** ./resources/js/pages/Suppliers/Index.vue ***!
  17663. \************************************************/
  17664. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17665. "use strict";
  17666. __webpack_require__.r(__webpack_exports__);
  17667. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17668. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17669. /* harmony export */ });
  17670. /* harmony import */ var _Index_vue_vue_type_template_id_06c8ed5e__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./Index.vue?vue&type=template&id=06c8ed5e */ "./resources/js/pages/Suppliers/Index.vue?vue&type=template&id=06c8ed5e");
  17671. /* 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/Suppliers/Index.vue?vue&type=script&setup=true&lang=js");
  17672. /* harmony import */ var _media_dijitalcode_3ad9c6e0_4296_4a57_b136_144df49e7bb8_Projects_cahaya_agung_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");
  17673. ;
  17674. const __exports__ = /*#__PURE__*/(0,_media_dijitalcode_3ad9c6e0_4296_4a57_b136_144df49e7bb8_Projects_cahaya_agung_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_06c8ed5e__WEBPACK_IMPORTED_MODULE_0__.render],['__file',"resources/js/pages/Suppliers/Index.vue"]])
  17675. /* hot reload */
  17676. if (false) {}
  17677. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__);
  17678. /***/ }),
  17679. /***/ "./resources/js/components/AppButtonLink.vue?vue&type=script&setup=true&lang=js":
  17680. /*!**************************************************************************************!*\
  17681. !*** ./resources/js/components/AppButtonLink.vue?vue&type=script&setup=true&lang=js ***!
  17682. \**************************************************************************************/
  17683. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17684. "use strict";
  17685. __webpack_require__.r(__webpack_exports__);
  17686. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17687. /* 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_AppButtonLink_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_0__["default"])
  17688. /* harmony export */ });
  17689. /* 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_AppButtonLink_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]!./AppButtonLink.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/AppButtonLink.vue?vue&type=script&setup=true&lang=js");
  17690. /***/ }),
  17691. /***/ "./resources/js/components/AppMessage.vue?vue&type=script&setup=true&lang=js":
  17692. /*!***********************************************************************************!*\
  17693. !*** ./resources/js/components/AppMessage.vue?vue&type=script&setup=true&lang=js ***!
  17694. \***********************************************************************************/
  17695. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17696. "use strict";
  17697. __webpack_require__.r(__webpack_exports__);
  17698. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17699. /* 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"])
  17700. /* harmony export */ });
  17701. /* 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");
  17702. /***/ }),
  17703. /***/ "./resources/js/components/AppPagination.vue?vue&type=script&setup=true&lang=js":
  17704. /*!**************************************************************************************!*\
  17705. !*** ./resources/js/components/AppPagination.vue?vue&type=script&setup=true&lang=js ***!
  17706. \**************************************************************************************/
  17707. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17708. "use strict";
  17709. __webpack_require__.r(__webpack_exports__);
  17710. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17711. /* 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_AppPagination_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_0__["default"])
  17712. /* harmony export */ });
  17713. /* 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_AppPagination_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]!./AppPagination.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/AppPagination.vue?vue&type=script&setup=true&lang=js");
  17714. /***/ }),
  17715. /***/ "./resources/js/components/AppSearch.vue?vue&type=script&setup=true&lang=js":
  17716. /*!**********************************************************************************!*\
  17717. !*** ./resources/js/components/AppSearch.vue?vue&type=script&setup=true&lang=js ***!
  17718. \**********************************************************************************/
  17719. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17720. "use strict";
  17721. __webpack_require__.r(__webpack_exports__);
  17722. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17723. /* 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_AppSearch_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_0__["default"])
  17724. /* harmony export */ });
  17725. /* 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_AppSearch_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]!./AppSearch.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/AppSearch.vue?vue&type=script&setup=true&lang=js");
  17726. /***/ }),
  17727. /***/ "./resources/js/layouts/Dashboard/Components/Sidebar.vue?vue&type=script&setup=true&lang=js":
  17728. /*!**************************************************************************************************!*\
  17729. !*** ./resources/js/layouts/Dashboard/Components/Sidebar.vue?vue&type=script&setup=true&lang=js ***!
  17730. \**************************************************************************************************/
  17731. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17732. "use strict";
  17733. __webpack_require__.r(__webpack_exports__);
  17734. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17735. /* 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_Sidebar_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_0__["default"])
  17736. /* harmony export */ });
  17737. /* 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_Sidebar_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]!./Sidebar.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/Dashboard/Components/Sidebar.vue?vue&type=script&setup=true&lang=js");
  17738. /***/ }),
  17739. /***/ "./resources/js/layouts/Dashboard/Components/SubSidebar.vue?vue&type=script&setup=true&lang=js":
  17740. /*!*****************************************************************************************************!*\
  17741. !*** ./resources/js/layouts/Dashboard/Components/SubSidebar.vue?vue&type=script&setup=true&lang=js ***!
  17742. \*****************************************************************************************************/
  17743. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17744. "use strict";
  17745. __webpack_require__.r(__webpack_exports__);
  17746. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17747. /* 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_SubSidebar_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_0__["default"])
  17748. /* harmony export */ });
  17749. /* 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_SubSidebar_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]!./SubSidebar.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/Dashboard/Components/SubSidebar.vue?vue&type=script&setup=true&lang=js");
  17750. /***/ }),
  17751. /***/ "./resources/js/layouts/Dashboard/Components/TopBar.vue?vue&type=script&setup=true&lang=js":
  17752. /*!*************************************************************************************************!*\
  17753. !*** ./resources/js/layouts/Dashboard/Components/TopBar.vue?vue&type=script&setup=true&lang=js ***!
  17754. \*************************************************************************************************/
  17755. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17756. "use strict";
  17757. __webpack_require__.r(__webpack_exports__);
  17758. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17759. /* 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_TopBar_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_0__["default"])
  17760. /* harmony export */ });
  17761. /* 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_TopBar_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]!./TopBar.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/Dashboard/Components/TopBar.vue?vue&type=script&setup=true&lang=js");
  17762. /***/ }),
  17763. /***/ "./resources/js/layouts/Dashboard/DashboardLayout.vue?vue&type=script&setup=true&lang=js":
  17764. /*!***********************************************************************************************!*\
  17765. !*** ./resources/js/layouts/Dashboard/DashboardLayout.vue?vue&type=script&setup=true&lang=js ***!
  17766. \***********************************************************************************************/
  17767. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17768. "use strict";
  17769. __webpack_require__.r(__webpack_exports__);
  17770. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17771. /* 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"])
  17772. /* harmony export */ });
  17773. /* 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/Dashboard/DashboardLayout.vue?vue&type=script&setup=true&lang=js");
  17774. /***/ }),
  17775. /***/ "./resources/js/pages/Suppliers/Index.vue?vue&type=script&setup=true&lang=js":
  17776. /*!***********************************************************************************!*\
  17777. !*** ./resources/js/pages/Suppliers/Index.vue?vue&type=script&setup=true&lang=js ***!
  17778. \***********************************************************************************/
  17779. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17780. "use strict";
  17781. __webpack_require__.r(__webpack_exports__);
  17782. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17783. /* 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"])
  17784. /* harmony export */ });
  17785. /* 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/Suppliers/Index.vue?vue&type=script&setup=true&lang=js");
  17786. /***/ }),
  17787. /***/ "./resources/js/components/AppButtonLink.vue?vue&type=template&id=c3621f1c":
  17788. /*!*********************************************************************************!*\
  17789. !*** ./resources/js/components/AppButtonLink.vue?vue&type=template&id=c3621f1c ***!
  17790. \*********************************************************************************/
  17791. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17792. "use strict";
  17793. __webpack_require__.r(__webpack_exports__);
  17794. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17795. /* 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_AppButtonLink_vue_vue_type_template_id_c3621f1c__WEBPACK_IMPORTED_MODULE_0__.render)
  17796. /* harmony export */ });
  17797. /* 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_AppButtonLink_vue_vue_type_template_id_c3621f1c__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]!./AppButtonLink.vue?vue&type=template&id=c3621f1c */ "./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/AppButtonLink.vue?vue&type=template&id=c3621f1c");
  17798. /***/ }),
  17799. /***/ "./resources/js/components/AppMessage.vue?vue&type=template&id=07159051":
  17800. /*!******************************************************************************!*\
  17801. !*** ./resources/js/components/AppMessage.vue?vue&type=template&id=07159051 ***!
  17802. \******************************************************************************/
  17803. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17804. "use strict";
  17805. __webpack_require__.r(__webpack_exports__);
  17806. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17807. /* 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)
  17808. /* harmony export */ });
  17809. /* 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");
  17810. /***/ }),
  17811. /***/ "./resources/js/components/AppPagination.vue?vue&type=template&id=4da56ec0":
  17812. /*!*********************************************************************************!*\
  17813. !*** ./resources/js/components/AppPagination.vue?vue&type=template&id=4da56ec0 ***!
  17814. \*********************************************************************************/
  17815. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17816. "use strict";
  17817. __webpack_require__.r(__webpack_exports__);
  17818. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17819. /* 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_AppPagination_vue_vue_type_template_id_4da56ec0__WEBPACK_IMPORTED_MODULE_0__.render)
  17820. /* harmony export */ });
  17821. /* 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_AppPagination_vue_vue_type_template_id_4da56ec0__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]!./AppPagination.vue?vue&type=template&id=4da56ec0 */ "./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/AppPagination.vue?vue&type=template&id=4da56ec0");
  17822. /***/ }),
  17823. /***/ "./resources/js/components/AppSearch.vue?vue&type=template&id=5b9fdcce":
  17824. /*!*****************************************************************************!*\
  17825. !*** ./resources/js/components/AppSearch.vue?vue&type=template&id=5b9fdcce ***!
  17826. \*****************************************************************************/
  17827. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17828. "use strict";
  17829. __webpack_require__.r(__webpack_exports__);
  17830. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17831. /* 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_AppSearch_vue_vue_type_template_id_5b9fdcce__WEBPACK_IMPORTED_MODULE_0__.render)
  17832. /* harmony export */ });
  17833. /* 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_AppSearch_vue_vue_type_template_id_5b9fdcce__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]!./AppSearch.vue?vue&type=template&id=5b9fdcce */ "./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/AppSearch.vue?vue&type=template&id=5b9fdcce");
  17834. /***/ }),
  17835. /***/ "./resources/js/layouts/Dashboard/Components/Footer.vue?vue&type=template&id=dbb3aa76":
  17836. /*!********************************************************************************************!*\
  17837. !*** ./resources/js/layouts/Dashboard/Components/Footer.vue?vue&type=template&id=dbb3aa76 ***!
  17838. \********************************************************************************************/
  17839. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17840. "use strict";
  17841. __webpack_require__.r(__webpack_exports__);
  17842. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17843. /* 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_Footer_vue_vue_type_template_id_dbb3aa76__WEBPACK_IMPORTED_MODULE_0__.render)
  17844. /* harmony export */ });
  17845. /* 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_Footer_vue_vue_type_template_id_dbb3aa76__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]!./Footer.vue?vue&type=template&id=dbb3aa76 */ "./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/Dashboard/Components/Footer.vue?vue&type=template&id=dbb3aa76");
  17846. /***/ }),
  17847. /***/ "./resources/js/layouts/Dashboard/Components/Sidebar.vue?vue&type=template&id=5b49aa22&scoped=true":
  17848. /*!*********************************************************************************************************!*\
  17849. !*** ./resources/js/layouts/Dashboard/Components/Sidebar.vue?vue&type=template&id=5b49aa22&scoped=true ***!
  17850. \*********************************************************************************************************/
  17851. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17852. "use strict";
  17853. __webpack_require__.r(__webpack_exports__);
  17854. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17855. /* 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_Sidebar_vue_vue_type_template_id_5b49aa22_scoped_true__WEBPACK_IMPORTED_MODULE_0__.render)
  17856. /* harmony export */ });
  17857. /* 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_Sidebar_vue_vue_type_template_id_5b49aa22_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]!./Sidebar.vue?vue&type=template&id=5b49aa22&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/Dashboard/Components/Sidebar.vue?vue&type=template&id=5b49aa22&scoped=true");
  17858. /***/ }),
  17859. /***/ "./resources/js/layouts/Dashboard/Components/SubSidebar.vue?vue&type=template&id=b1b23eb4&scoped=true":
  17860. /*!************************************************************************************************************!*\
  17861. !*** ./resources/js/layouts/Dashboard/Components/SubSidebar.vue?vue&type=template&id=b1b23eb4&scoped=true ***!
  17862. \************************************************************************************************************/
  17863. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17864. "use strict";
  17865. __webpack_require__.r(__webpack_exports__);
  17866. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17867. /* 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_SubSidebar_vue_vue_type_template_id_b1b23eb4_scoped_true__WEBPACK_IMPORTED_MODULE_0__.render)
  17868. /* harmony export */ });
  17869. /* 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_SubSidebar_vue_vue_type_template_id_b1b23eb4_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]!./SubSidebar.vue?vue&type=template&id=b1b23eb4&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/Dashboard/Components/SubSidebar.vue?vue&type=template&id=b1b23eb4&scoped=true");
  17870. /***/ }),
  17871. /***/ "./resources/js/layouts/Dashboard/Components/TopBar.vue?vue&type=template&id=0b7edbb0&scoped=true":
  17872. /*!********************************************************************************************************!*\
  17873. !*** ./resources/js/layouts/Dashboard/Components/TopBar.vue?vue&type=template&id=0b7edbb0&scoped=true ***!
  17874. \********************************************************************************************************/
  17875. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17876. "use strict";
  17877. __webpack_require__.r(__webpack_exports__);
  17878. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17879. /* 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_TopBar_vue_vue_type_template_id_0b7edbb0_scoped_true__WEBPACK_IMPORTED_MODULE_0__.render)
  17880. /* harmony export */ });
  17881. /* 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_TopBar_vue_vue_type_template_id_0b7edbb0_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]!./TopBar.vue?vue&type=template&id=0b7edbb0&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/Dashboard/Components/TopBar.vue?vue&type=template&id=0b7edbb0&scoped=true");
  17882. /***/ }),
  17883. /***/ "./resources/js/layouts/Dashboard/DashboardLayout.vue?vue&type=template&id=1d279fe2&scoped=true":
  17884. /*!******************************************************************************************************!*\
  17885. !*** ./resources/js/layouts/Dashboard/DashboardLayout.vue?vue&type=template&id=1d279fe2&scoped=true ***!
  17886. \******************************************************************************************************/
  17887. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17888. "use strict";
  17889. __webpack_require__.r(__webpack_exports__);
  17890. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17891. /* 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_1d279fe2_scoped_true__WEBPACK_IMPORTED_MODULE_0__.render)
  17892. /* harmony export */ });
  17893. /* 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_1d279fe2_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=1d279fe2&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/Dashboard/DashboardLayout.vue?vue&type=template&id=1d279fe2&scoped=true");
  17894. /***/ }),
  17895. /***/ "./resources/js/pages/Suppliers/Index.vue?vue&type=template&id=06c8ed5e":
  17896. /*!******************************************************************************!*\
  17897. !*** ./resources/js/pages/Suppliers/Index.vue?vue&type=template&id=06c8ed5e ***!
  17898. \******************************************************************************/
  17899. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17900. "use strict";
  17901. __webpack_require__.r(__webpack_exports__);
  17902. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17903. /* 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_06c8ed5e__WEBPACK_IMPORTED_MODULE_0__.render)
  17904. /* harmony export */ });
  17905. /* 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_06c8ed5e__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=06c8ed5e */ "./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/Suppliers/Index.vue?vue&type=template&id=06c8ed5e");
  17906. /***/ }),
  17907. /***/ "./resources/js/layouts/Dashboard/Components/Sidebar.vue?vue&type=style&index=0&id=5b49aa22&lang=scss&scoped=true":
  17908. /*!************************************************************************************************************************!*\
  17909. !*** ./resources/js/layouts/Dashboard/Components/Sidebar.vue?vue&type=style&index=0&id=5b49aa22&lang=scss&scoped=true ***!
  17910. \************************************************************************************************************************/
  17911. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17912. "use strict";
  17913. __webpack_require__.r(__webpack_exports__);
  17914. /* 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_Sidebar_vue_vue_type_style_index_0_id_5b49aa22_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]!./Sidebar.vue?vue&type=style&index=0&id=5b49aa22&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/Dashboard/Components/Sidebar.vue?vue&type=style&index=0&id=5b49aa22&lang=scss&scoped=true");
  17915. /***/ }),
  17916. /***/ "./resources/js/layouts/Dashboard/Components/SubSidebar.vue?vue&type=style&index=0&id=b1b23eb4&lang=scss&scoped=true":
  17917. /*!***************************************************************************************************************************!*\
  17918. !*** ./resources/js/layouts/Dashboard/Components/SubSidebar.vue?vue&type=style&index=0&id=b1b23eb4&lang=scss&scoped=true ***!
  17919. \***************************************************************************************************************************/
  17920. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17921. "use strict";
  17922. __webpack_require__.r(__webpack_exports__);
  17923. /* 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_SubSidebar_vue_vue_type_style_index_0_id_b1b23eb4_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]!./SubSidebar.vue?vue&type=style&index=0&id=b1b23eb4&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/Dashboard/Components/SubSidebar.vue?vue&type=style&index=0&id=b1b23eb4&lang=scss&scoped=true");
  17924. /***/ }),
  17925. /***/ "./resources/js/layouts/Dashboard/Components/TopBar.vue?vue&type=style&index=0&id=0b7edbb0&lang=scss&scoped=true":
  17926. /*!***********************************************************************************************************************!*\
  17927. !*** ./resources/js/layouts/Dashboard/Components/TopBar.vue?vue&type=style&index=0&id=0b7edbb0&lang=scss&scoped=true ***!
  17928. \***********************************************************************************************************************/
  17929. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17930. "use strict";
  17931. __webpack_require__.r(__webpack_exports__);
  17932. /* 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_TopBar_vue_vue_type_style_index_0_id_0b7edbb0_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]!./TopBar.vue?vue&type=style&index=0&id=0b7edbb0&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/Dashboard/Components/TopBar.vue?vue&type=style&index=0&id=0b7edbb0&lang=scss&scoped=true");
  17933. /***/ }),
  17934. /***/ "./resources/js/layouts/Dashboard/DashboardLayout.vue?vue&type=style&index=0&id=1d279fe2&lang=scss&scoped=true":
  17935. /*!*********************************************************************************************************************!*\
  17936. !*** ./resources/js/layouts/Dashboard/DashboardLayout.vue?vue&type=style&index=0&id=1d279fe2&lang=scss&scoped=true ***!
  17937. \*********************************************************************************************************************/
  17938. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17939. "use strict";
  17940. __webpack_require__.r(__webpack_exports__);
  17941. /* 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_1d279fe2_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=1d279fe2&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/Dashboard/DashboardLayout.vue?vue&type=style&index=0&id=1d279fe2&lang=scss&scoped=true");
  17942. /***/ })
  17943. }]);