resources_js_pages_Customers_Index_vue.js 679KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663466446654666466746684669467046714672467346744675467646774678467946804681468246834684468546864687468846894690469146924693469446954696469746984699470047014702470347044705470647074708470947104711471247134714471547164717471847194720472147224723472447254726472747284729473047314732473347344735473647374738473947404741474247434744474547464747474847494750475147524753475447554756475747584759476047614762476347644765476647674768476947704771477247734774477547764777477847794780478147824783478447854786478747884789479047914792479347944795479647974798479948004801480248034804480548064807480848094810481148124813481448154816481748184819482048214822482348244825482648274828482948304831483248334834483548364837483848394840484148424843484448454846484748484849485048514852485348544855485648574858485948604861486248634864486548664867486848694870487148724873487448754876487748784879488048814882488348844885488648874888488948904891489248934894489548964897489848994900490149024903490449054906490749084909491049114912491349144915491649174918491949204921492249234924492549264927492849294930493149324933493449354936493749384939494049414942494349444945494649474948494949504951495249534954495549564957495849594960496149624963496449654966496749684969497049714972497349744975497649774978497949804981498249834984498549864987498849894990499149924993499449954996499749984999500050015002500350045005500650075008500950105011501250135014501550165017501850195020502150225023502450255026502750285029503050315032503350345035503650375038503950405041504250435044504550465047504850495050505150525053505450555056505750585059506050615062506350645065506650675068506950705071507250735074507550765077507850795080508150825083508450855086508750885089509050915092509350945095509650975098509951005101510251035104510551065107510851095110511151125113511451155116511751185119512051215122512351245125512651275128512951305131513251335134513551365137513851395140514151425143514451455146514751485149515051515152515351545155515651575158515951605161516251635164516551665167516851695170517151725173517451755176517751785179518051815182518351845185518651875188518951905191519251935194519551965197519851995200520152025203520452055206520752085209521052115212521352145215521652175218521952205221522252235224522552265227522852295230523152325233523452355236523752385239524052415242524352445245524652475248524952505251525252535254525552565257525852595260526152625263526452655266526752685269527052715272527352745275527652775278527952805281528252835284528552865287528852895290529152925293529452955296529752985299530053015302530353045305530653075308530953105311531253135314531553165317531853195320532153225323532453255326532753285329533053315332533353345335533653375338533953405341534253435344534553465347534853495350535153525353535453555356535753585359536053615362536353645365536653675368536953705371537253735374537553765377537853795380538153825383538453855386538753885389539053915392539353945395539653975398539954005401540254035404540554065407540854095410541154125413541454155416541754185419542054215422542354245425542654275428542954305431543254335434543554365437543854395440544154425443544454455446544754485449545054515452545354545455545654575458545954605461546254635464546554665467546854695470547154725473547454755476547754785479548054815482548354845485548654875488548954905491549254935494549554965497549854995500550155025503550455055506550755085509551055115512551355145515551655175518551955205521552255235524552555265527552855295530553155325533553455355536553755385539554055415542554355445545554655475548554955505551555255535554555555565557555855595560556155625563556455655566556755685569557055715572557355745575557655775578557955805581558255835584558555865587558855895590559155925593559455955596559755985599560056015602560356045605560656075608560956105611561256135614561556165617561856195620562156225623562456255626562756285629563056315632563356345635563656375638563956405641564256435644564556465647564856495650565156525653565456555656565756585659566056615662566356645665566656675668566956705671567256735674567556765677567856795680568156825683568456855686568756885689569056915692569356945695569656975698569957005701570257035704570557065707570857095710571157125713571457155716571757185719572057215722572357245725572657275728572957305731573257335734573557365737573857395740574157425743574457455746574757485749575057515752575357545755575657575758575957605761576257635764576557665767576857695770577157725773577457755776577757785779578057815782578357845785578657875788578957905791579257935794579557965797579857995800580158025803580458055806580758085809581058115812581358145815581658175818581958205821582258235824582558265827582858295830583158325833583458355836583758385839584058415842584358445845584658475848584958505851585258535854585558565857585858595860586158625863586458655866586758685869587058715872587358745875587658775878587958805881588258835884588558865887588858895890589158925893589458955896589758985899590059015902590359045905590659075908590959105911591259135914591559165917591859195920592159225923592459255926592759285929593059315932593359345935593659375938593959405941594259435944594559465947594859495950595159525953595459555956595759585959596059615962596359645965596659675968596959705971597259735974597559765977597859795980598159825983598459855986598759885989599059915992599359945995599659975998599960006001600260036004600560066007600860096010601160126013601460156016601760186019602060216022602360246025602660276028602960306031603260336034603560366037603860396040604160426043604460456046604760486049605060516052605360546055605660576058605960606061606260636064606560666067606860696070607160726073607460756076607760786079608060816082608360846085608660876088608960906091609260936094609560966097609860996100610161026103610461056106610761086109611061116112611361146115611661176118611961206121612261236124612561266127612861296130613161326133613461356136613761386139614061416142614361446145614661476148614961506151615261536154615561566157615861596160616161626163616461656166616761686169617061716172617361746175617661776178617961806181618261836184618561866187618861896190619161926193619461956196619761986199620062016202620362046205620662076208620962106211621262136214621562166217621862196220622162226223622462256226622762286229623062316232623362346235623662376238623962406241624262436244624562466247624862496250625162526253625462556256625762586259626062616262626362646265626662676268626962706271627262736274627562766277627862796280628162826283628462856286628762886289629062916292629362946295629662976298629963006301630263036304630563066307630863096310631163126313631463156316631763186319632063216322632363246325632663276328632963306331633263336334633563366337633863396340634163426343634463456346634763486349635063516352635363546355635663576358635963606361636263636364636563666367636863696370637163726373637463756376637763786379638063816382638363846385638663876388638963906391639263936394639563966397639863996400640164026403640464056406640764086409641064116412641364146415641664176418641964206421642264236424642564266427642864296430643164326433643464356436643764386439644064416442644364446445644664476448644964506451645264536454645564566457645864596460646164626463646464656466646764686469647064716472647364746475647664776478647964806481648264836484648564866487648864896490649164926493649464956496649764986499650065016502650365046505650665076508650965106511651265136514651565166517651865196520652165226523652465256526652765286529653065316532653365346535653665376538653965406541654265436544654565466547654865496550655165526553655465556556655765586559656065616562656365646565656665676568656965706571657265736574657565766577657865796580658165826583658465856586658765886589659065916592659365946595659665976598659966006601660266036604660566066607660866096610661166126613661466156616661766186619662066216622662366246625662666276628662966306631663266336634663566366637663866396640664166426643664466456646664766486649665066516652665366546655665666576658665966606661666266636664666566666667666866696670667166726673667466756676667766786679668066816682668366846685668666876688668966906691669266936694669566966697669866996700670167026703670467056706670767086709671067116712671367146715671667176718671967206721672267236724672567266727672867296730673167326733673467356736673767386739674067416742674367446745674667476748674967506751675267536754675567566757675867596760676167626763676467656766676767686769677067716772677367746775677667776778677967806781678267836784678567866787678867896790679167926793679467956796679767986799680068016802680368046805680668076808680968106811681268136814681568166817681868196820682168226823682468256826682768286829683068316832683368346835683668376838683968406841684268436844684568466847684868496850685168526853685468556856685768586859686068616862686368646865686668676868686968706871687268736874687568766877687868796880688168826883688468856886688768886889689068916892689368946895689668976898689969006901690269036904690569066907690869096910691169126913691469156916691769186919692069216922692369246925692669276928692969306931693269336934693569366937693869396940694169426943694469456946694769486949695069516952695369546955695669576958695969606961696269636964696569666967696869696970697169726973697469756976697769786979698069816982698369846985698669876988698969906991699269936994699569966997699869997000700170027003700470057006700770087009701070117012701370147015701670177018701970207021702270237024702570267027702870297030703170327033703470357036703770387039704070417042704370447045704670477048704970507051705270537054705570567057705870597060706170627063706470657066706770687069707070717072707370747075707670777078707970807081708270837084708570867087708870897090709170927093709470957096709770987099710071017102710371047105710671077108710971107111711271137114711571167117711871197120712171227123712471257126712771287129713071317132713371347135713671377138713971407141714271437144714571467147714871497150715171527153715471557156715771587159716071617162716371647165716671677168716971707171717271737174717571767177717871797180718171827183718471857186718771887189719071917192719371947195719671977198719972007201720272037204720572067207720872097210721172127213721472157216721772187219722072217222722372247225722672277228722972307231723272337234723572367237723872397240724172427243724472457246724772487249725072517252725372547255725672577258725972607261726272637264726572667267726872697270727172727273727472757276727772787279728072817282728372847285728672877288728972907291729272937294729572967297729872997300730173027303730473057306730773087309731073117312731373147315731673177318731973207321732273237324732573267327732873297330733173327333733473357336733773387339734073417342734373447345734673477348734973507351735273537354735573567357735873597360736173627363736473657366736773687369737073717372737373747375737673777378737973807381738273837384738573867387738873897390739173927393739473957396739773987399740074017402740374047405740674077408740974107411741274137414741574167417741874197420742174227423742474257426742774287429743074317432743374347435743674377438743974407441744274437444744574467447744874497450745174527453745474557456745774587459746074617462746374647465746674677468746974707471747274737474747574767477747874797480748174827483748474857486748774887489749074917492749374947495749674977498749975007501750275037504750575067507750875097510751175127513751475157516751775187519752075217522752375247525752675277528752975307531753275337534753575367537753875397540754175427543754475457546754775487549755075517552755375547555755675577558755975607561756275637564756575667567756875697570757175727573757475757576757775787579758075817582758375847585758675877588758975907591759275937594759575967597759875997600760176027603760476057606760776087609761076117612761376147615761676177618761976207621762276237624762576267627762876297630763176327633763476357636763776387639764076417642764376447645764676477648764976507651765276537654765576567657765876597660766176627663766476657666766776687669767076717672767376747675767676777678767976807681768276837684768576867687768876897690769176927693769476957696769776987699770077017702770377047705770677077708770977107711771277137714771577167717771877197720772177227723772477257726772777287729773077317732773377347735773677377738773977407741774277437744774577467747774877497750775177527753775477557756775777587759776077617762776377647765776677677768776977707771777277737774777577767777777877797780778177827783778477857786778777887789779077917792779377947795779677977798779978007801780278037804780578067807780878097810781178127813781478157816781778187819782078217822782378247825782678277828782978307831783278337834783578367837783878397840784178427843784478457846784778487849785078517852785378547855785678577858785978607861786278637864786578667867786878697870787178727873787478757876787778787879788078817882788378847885788678877888788978907891789278937894789578967897789878997900790179027903790479057906790779087909791079117912791379147915791679177918791979207921792279237924792579267927792879297930793179327933793479357936793779387939794079417942794379447945794679477948794979507951795279537954795579567957795879597960796179627963796479657966796779687969797079717972797379747975797679777978797979807981798279837984798579867987798879897990799179927993799479957996799779987999800080018002800380048005800680078008800980108011801280138014801580168017801880198020802180228023802480258026802780288029803080318032803380348035803680378038803980408041804280438044804580468047804880498050805180528053805480558056805780588059806080618062806380648065806680678068806980708071807280738074807580768077807880798080808180828083808480858086808780888089809080918092809380948095809680978098809981008101810281038104810581068107810881098110811181128113811481158116811781188119812081218122812381248125812681278128812981308131813281338134813581368137813881398140814181428143814481458146814781488149815081518152815381548155815681578158815981608161816281638164816581668167816881698170817181728173817481758176817781788179818081818182818381848185818681878188818981908191819281938194819581968197819881998200820182028203820482058206820782088209821082118212821382148215821682178218821982208221822282238224822582268227822882298230823182328233823482358236823782388239824082418242824382448245824682478248824982508251825282538254825582568257825882598260826182628263826482658266826782688269827082718272827382748275827682778278827982808281828282838284828582868287828882898290829182928293829482958296829782988299830083018302830383048305830683078308830983108311831283138314831583168317831883198320832183228323832483258326832783288329833083318332833383348335833683378338833983408341834283438344834583468347834883498350835183528353835483558356835783588359836083618362836383648365836683678368836983708371837283738374837583768377837883798380838183828383838483858386838783888389839083918392839383948395839683978398839984008401840284038404840584068407840884098410841184128413841484158416841784188419842084218422842384248425842684278428842984308431843284338434843584368437843884398440844184428443844484458446844784488449845084518452845384548455845684578458845984608461846284638464846584668467846884698470847184728473847484758476847784788479848084818482848384848485848684878488848984908491849284938494849584968497849884998500850185028503850485058506850785088509851085118512851385148515851685178518851985208521852285238524852585268527852885298530853185328533853485358536853785388539854085418542854385448545854685478548854985508551855285538554855585568557855885598560856185628563856485658566856785688569857085718572857385748575857685778578857985808581858285838584858585868587858885898590859185928593859485958596859785988599860086018602860386048605860686078608860986108611861286138614861586168617861886198620862186228623862486258626862786288629863086318632863386348635863686378638863986408641864286438644864586468647864886498650865186528653865486558656865786588659866086618662866386648665866686678668866986708671867286738674867586768677867886798680868186828683868486858686868786888689869086918692869386948695869686978698869987008701870287038704870587068707870887098710871187128713871487158716871787188719872087218722872387248725872687278728872987308731873287338734873587368737873887398740874187428743874487458746874787488749875087518752875387548755875687578758875987608761876287638764876587668767876887698770877187728773877487758776877787788779878087818782878387848785878687878788878987908791879287938794879587968797879887998800880188028803880488058806880788088809881088118812881388148815881688178818881988208821882288238824882588268827882888298830883188328833883488358836883788388839884088418842884388448845884688478848884988508851885288538854885588568857885888598860886188628863886488658866886788688869887088718872887388748875887688778878887988808881888288838884888588868887888888898890889188928893889488958896889788988899890089018902890389048905890689078908890989108911891289138914891589168917891889198920892189228923892489258926892789288929893089318932893389348935893689378938893989408941894289438944894589468947894889498950895189528953895489558956895789588959896089618962896389648965896689678968896989708971897289738974897589768977897889798980898189828983898489858986898789888989899089918992899389948995899689978998899990009001900290039004900590069007900890099010901190129013901490159016901790189019902090219022902390249025902690279028902990309031903290339034903590369037903890399040904190429043904490459046904790489049905090519052905390549055905690579058905990609061906290639064906590669067906890699070907190729073907490759076907790789079908090819082908390849085908690879088908990909091909290939094909590969097909890999100910191029103910491059106910791089109911091119112911391149115911691179118911991209121912291239124912591269127912891299130913191329133913491359136913791389139914091419142914391449145914691479148914991509151915291539154915591569157915891599160916191629163916491659166916791689169917091719172917391749175917691779178917991809181918291839184918591869187918891899190919191929193919491959196919791989199920092019202920392049205920692079208920992109211921292139214921592169217921892199220922192229223922492259226922792289229923092319232923392349235923692379238923992409241924292439244924592469247924892499250925192529253925492559256925792589259926092619262926392649265926692679268926992709271927292739274927592769277927892799280928192829283928492859286928792889289929092919292929392949295929692979298929993009301930293039304930593069307930893099310931193129313931493159316931793189319932093219322932393249325932693279328932993309331933293339334933593369337933893399340934193429343934493459346934793489349935093519352935393549355935693579358935993609361936293639364936593669367936893699370937193729373937493759376937793789379938093819382938393849385938693879388938993909391939293939394939593969397939893999400940194029403940494059406940794089409941094119412941394149415941694179418941994209421942294239424942594269427942894299430943194329433943494359436943794389439944094419442944394449445944694479448944994509451945294539454945594569457945894599460946194629463946494659466946794689469947094719472947394749475947694779478947994809481948294839484948594869487948894899490949194929493949494959496949794989499950095019502950395049505950695079508950995109511951295139514951595169517951895199520952195229523952495259526952795289529953095319532953395349535953695379538953995409541954295439544954595469547954895499550955195529553955495559556955795589559956095619562956395649565956695679568956995709571957295739574957595769577957895799580958195829583958495859586958795889589959095919592959395949595959695979598959996009601960296039604960596069607960896099610961196129613961496159616961796189619962096219622962396249625962696279628962996309631963296339634963596369637963896399640964196429643964496459646964796489649965096519652965396549655965696579658965996609661966296639664966596669667966896699670967196729673967496759676967796789679968096819682968396849685968696879688968996909691969296939694969596969697969896999700970197029703970497059706970797089709971097119712971397149715971697179718971997209721972297239724972597269727972897299730973197329733973497359736973797389739974097419742974397449745974697479748974997509751975297539754975597569757975897599760976197629763976497659766976797689769977097719772977397749775977697779778977997809781978297839784978597869787978897899790979197929793979497959796979797989799980098019802980398049805980698079808980998109811981298139814981598169817981898199820982198229823982498259826982798289829983098319832983398349835983698379838983998409841984298439844984598469847984898499850985198529853985498559856985798589859986098619862986398649865986698679868986998709871987298739874987598769877987898799880988198829883988498859886988798889889989098919892989398949895989698979898989999009901990299039904990599069907990899099910991199129913991499159916991799189919992099219922992399249925992699279928992999309931993299339934993599369937993899399940994199429943994499459946994799489949995099519952995399549955995699579958995999609961996299639964996599669967996899699970997199729973997499759976997799789979998099819982998399849985998699879988998999909991999299939994999599969997999899991000010001100021000310004100051000610007100081000910010100111001210013100141001510016100171001810019100201002110022100231002410025100261002710028100291003010031100321003310034100351003610037100381003910040100411004210043100441004510046100471004810049100501005110052100531005410055100561005710058100591006010061100621006310064100651006610067100681006910070100711007210073100741007510076100771007810079100801008110082100831008410085100861008710088100891009010091100921009310094100951009610097100981009910100101011010210103101041010510106101071010810109101101011110112101131011410115101161011710118101191012010121101221012310124101251012610127101281012910130101311013210133101341013510136101371013810139101401014110142101431014410145101461014710148101491015010151101521015310154101551015610157101581015910160101611016210163101641016510166101671016810169101701017110172101731017410175101761017710178101791018010181101821018310184101851018610187101881018910190101911019210193101941019510196101971019810199102001020110202102031020410205102061020710208102091021010211102121021310214102151021610217102181021910220102211022210223102241022510226102271022810229102301023110232102331023410235102361023710238102391024010241102421024310244102451024610247102481024910250102511025210253102541025510256102571025810259102601026110262102631026410265102661026710268102691027010271102721027310274102751027610277102781027910280102811028210283102841028510286102871028810289102901029110292102931029410295102961029710298102991030010301103021030310304103051030610307103081030910310103111031210313103141031510316103171031810319103201032110322103231032410325103261032710328103291033010331103321033310334103351033610337103381033910340103411034210343103441034510346103471034810349103501035110352103531035410355103561035710358103591036010361103621036310364103651036610367103681036910370103711037210373103741037510376103771037810379103801038110382103831038410385103861038710388103891039010391103921039310394103951039610397103981039910400104011040210403104041040510406104071040810409104101041110412104131041410415104161041710418104191042010421104221042310424104251042610427104281042910430104311043210433104341043510436104371043810439104401044110442104431044410445104461044710448104491045010451104521045310454104551045610457104581045910460104611046210463104641046510466104671046810469104701047110472104731047410475104761047710478104791048010481104821048310484104851048610487104881048910490104911049210493104941049510496104971049810499105001050110502105031050410505105061050710508105091051010511105121051310514105151051610517105181051910520105211052210523105241052510526105271052810529105301053110532105331053410535105361053710538105391054010541105421054310544105451054610547105481054910550105511055210553105541055510556105571055810559105601056110562105631056410565105661056710568105691057010571105721057310574105751057610577105781057910580105811058210583105841058510586105871058810589105901059110592105931059410595105961059710598105991060010601106021060310604106051060610607106081060910610106111061210613106141061510616106171061810619106201062110622106231062410625106261062710628106291063010631106321063310634106351063610637106381063910640106411064210643106441064510646106471064810649106501065110652106531065410655106561065710658106591066010661106621066310664106651066610667106681066910670106711067210673106741067510676106771067810679106801068110682106831068410685106861068710688106891069010691106921069310694106951069610697106981069910700107011070210703107041070510706107071070810709107101071110712107131071410715107161071710718107191072010721107221072310724107251072610727107281072910730107311073210733107341073510736107371073810739107401074110742107431074410745107461074710748107491075010751107521075310754107551075610757107581075910760107611076210763107641076510766107671076810769107701077110772107731077410775107761077710778107791078010781107821078310784107851078610787107881078910790107911079210793107941079510796107971079810799108001080110802108031080410805108061080710808108091081010811108121081310814108151081610817108181081910820108211082210823108241082510826108271082810829108301083110832108331083410835108361083710838108391084010841108421084310844108451084610847108481084910850108511085210853108541085510856108571085810859108601086110862108631086410865108661086710868108691087010871108721087310874108751087610877108781087910880108811088210883108841088510886108871088810889108901089110892108931089410895108961089710898108991090010901109021090310904109051090610907109081090910910109111091210913109141091510916109171091810919109201092110922109231092410925109261092710928109291093010931109321093310934109351093610937109381093910940109411094210943109441094510946109471094810949109501095110952109531095410955109561095710958109591096010961109621096310964109651096610967109681096910970109711097210973109741097510976109771097810979109801098110982109831098410985109861098710988109891099010991109921099310994109951099610997109981099911000110011100211003110041100511006110071100811009110101101111012110131101411015110161101711018110191102011021110221102311024110251102611027110281102911030110311103211033110341103511036110371103811039110401104111042110431104411045110461104711048110491105011051110521105311054110551105611057110581105911060110611106211063110641106511066110671106811069110701107111072110731107411075110761107711078110791108011081110821108311084110851108611087110881108911090110911109211093110941109511096110971109811099111001110111102111031110411105111061110711108111091111011111111121111311114111151111611117111181111911120111211112211123111241112511126111271112811129111301113111132111331113411135111361113711138111391114011141111421114311144111451114611147111481114911150111511115211153111541115511156111571115811159111601116111162111631116411165111661116711168111691117011171111721117311174111751117611177111781117911180111811118211183111841118511186111871118811189111901119111192111931119411195111961119711198111991120011201112021120311204112051120611207112081120911210112111121211213112141121511216112171121811219112201122111222112231122411225112261122711228112291123011231112321123311234112351123611237112381123911240112411124211243112441124511246112471124811249112501125111252112531125411255112561125711258112591126011261112621126311264112651126611267112681126911270112711127211273112741127511276112771127811279112801128111282112831128411285112861128711288112891129011291112921129311294112951129611297112981129911300113011130211303113041130511306113071130811309113101131111312113131131411315113161131711318113191132011321113221132311324113251132611327113281132911330113311133211333113341133511336113371133811339113401134111342113431134411345113461134711348113491135011351113521135311354113551135611357113581135911360113611136211363113641136511366113671136811369113701137111372113731137411375113761137711378113791138011381113821138311384113851138611387113881138911390113911139211393113941139511396113971139811399114001140111402114031140411405114061140711408114091141011411114121141311414114151141611417114181141911420114211142211423114241142511426114271142811429114301143111432114331143411435114361143711438114391144011441114421144311444114451144611447114481144911450114511145211453114541145511456114571145811459114601146111462114631146411465114661146711468114691147011471114721147311474114751147611477114781147911480114811148211483114841148511486114871148811489114901149111492114931149411495114961149711498114991150011501115021150311504115051150611507115081150911510115111151211513115141151511516115171151811519115201152111522115231152411525115261152711528115291153011531115321153311534115351153611537115381153911540115411154211543115441154511546115471154811549115501155111552115531155411555115561155711558115591156011561115621156311564115651156611567115681156911570115711157211573115741157511576115771157811579115801158111582115831158411585115861158711588115891159011591115921159311594115951159611597115981159911600116011160211603116041160511606116071160811609116101161111612116131161411615116161161711618116191162011621116221162311624116251162611627116281162911630116311163211633116341163511636116371163811639116401164111642116431164411645116461164711648116491165011651116521165311654116551165611657116581165911660116611166211663116641166511666116671166811669116701167111672116731167411675116761167711678116791168011681116821168311684116851168611687116881168911690116911169211693116941169511696116971169811699117001170111702117031170411705117061170711708117091171011711117121171311714117151171611717117181171911720117211172211723117241172511726117271172811729117301173111732117331173411735117361173711738117391174011741117421174311744117451174611747117481174911750117511175211753117541175511756117571175811759117601176111762117631176411765117661176711768117691177011771117721177311774117751177611777117781177911780117811178211783117841178511786117871178811789117901179111792117931179411795117961179711798117991180011801118021180311804118051180611807118081180911810118111181211813118141181511816118171181811819118201182111822118231182411825118261182711828118291183011831118321183311834118351183611837118381183911840118411184211843118441184511846118471184811849118501185111852118531185411855118561185711858118591186011861118621186311864118651186611867118681186911870118711187211873118741187511876118771187811879118801188111882118831188411885118861188711888118891189011891118921189311894118951189611897118981189911900119011190211903119041190511906119071190811909119101191111912119131191411915119161191711918119191192011921119221192311924119251192611927119281192911930119311193211933119341193511936119371193811939119401194111942119431194411945119461194711948119491195011951119521195311954119551195611957119581195911960119611196211963119641196511966119671196811969119701197111972119731197411975119761197711978119791198011981119821198311984119851198611987119881198911990119911199211993119941199511996119971199811999120001200112002120031200412005120061200712008120091201012011120121201312014120151201612017120181201912020120211202212023120241202512026120271202812029120301203112032120331203412035120361203712038120391204012041120421204312044120451204612047120481204912050120511205212053120541205512056120571205812059120601206112062120631206412065120661206712068120691207012071120721207312074120751207612077120781207912080120811208212083120841208512086120871208812089120901209112092120931209412095120961209712098120991210012101121021210312104121051210612107121081210912110121111211212113121141211512116121171211812119121201212112122121231212412125121261212712128121291213012131121321213312134121351213612137121381213912140121411214212143121441214512146121471214812149121501215112152121531215412155121561215712158121591216012161121621216312164121651216612167121681216912170121711217212173121741217512176121771217812179121801218112182121831218412185121861218712188121891219012191121921219312194121951219612197121981219912200122011220212203122041220512206122071220812209122101221112212122131221412215122161221712218122191222012221122221222312224122251222612227122281222912230122311223212233122341223512236122371223812239122401224112242122431224412245122461224712248122491225012251122521225312254122551225612257122581225912260122611226212263122641226512266122671226812269122701227112272122731227412275122761227712278122791228012281122821228312284122851228612287122881228912290122911229212293122941229512296122971229812299123001230112302123031230412305123061230712308123091231012311123121231312314123151231612317123181231912320123211232212323123241232512326123271232812329123301233112332123331233412335123361233712338123391234012341123421234312344123451234612347123481234912350123511235212353123541235512356123571235812359123601236112362123631236412365123661236712368123691237012371123721237312374123751237612377123781237912380123811238212383123841238512386123871238812389123901239112392123931239412395123961239712398123991240012401124021240312404124051240612407124081240912410124111241212413124141241512416124171241812419124201242112422124231242412425124261242712428124291243012431124321243312434124351243612437124381243912440124411244212443124441244512446124471244812449124501245112452124531245412455124561245712458124591246012461124621246312464124651246612467124681246912470124711247212473124741247512476124771247812479124801248112482124831248412485124861248712488124891249012491124921249312494124951249612497124981249912500125011250212503125041250512506125071250812509125101251112512125131251412515125161251712518125191252012521125221252312524125251252612527125281252912530125311253212533125341253512536125371253812539125401254112542125431254412545125461254712548125491255012551125521255312554125551255612557125581255912560125611256212563125641256512566125671256812569125701257112572125731257412575125761257712578125791258012581125821258312584125851258612587125881258912590125911259212593125941259512596125971259812599126001260112602126031260412605126061260712608126091261012611126121261312614126151261612617126181261912620126211262212623126241262512626126271262812629126301263112632126331263412635126361263712638126391264012641126421264312644126451264612647126481264912650126511265212653126541265512656126571265812659126601266112662126631266412665126661266712668126691267012671126721267312674126751267612677126781267912680126811268212683126841268512686126871268812689126901269112692126931269412695126961269712698126991270012701127021270312704127051270612707127081270912710127111271212713127141271512716127171271812719127201272112722127231272412725127261272712728127291273012731127321273312734127351273612737127381273912740127411274212743127441274512746127471274812749127501275112752127531275412755127561275712758127591276012761127621276312764127651276612767127681276912770127711277212773127741277512776127771277812779127801278112782127831278412785127861278712788127891279012791127921279312794127951279612797127981279912800128011280212803128041280512806128071280812809128101281112812128131281412815128161281712818128191282012821128221282312824128251282612827128281282912830128311283212833128341283512836128371283812839128401284112842128431284412845128461284712848128491285012851128521285312854128551285612857128581285912860128611286212863128641286512866128671286812869128701287112872128731287412875128761287712878128791288012881128821288312884128851288612887128881288912890128911289212893128941289512896128971289812899129001290112902129031290412905129061290712908129091291012911129121291312914129151291612917129181291912920129211292212923129241292512926129271292812929129301293112932129331293412935129361293712938129391294012941129421294312944129451294612947129481294912950129511295212953129541295512956129571295812959129601296112962129631296412965129661296712968129691297012971129721297312974129751297612977129781297912980129811298212983129841298512986129871298812989129901299112992129931299412995129961299712998129991300013001130021300313004130051300613007130081300913010130111301213013130141301513016130171301813019130201302113022130231302413025130261302713028130291303013031130321303313034130351303613037130381303913040130411304213043130441304513046130471304813049130501305113052130531305413055130561305713058130591306013061130621306313064130651306613067130681306913070130711307213073130741307513076130771307813079130801308113082130831308413085130861308713088130891309013091130921309313094130951309613097130981309913100131011310213103131041310513106131071310813109131101311113112131131311413115131161311713118131191312013121131221312313124131251312613127131281312913130131311313213133131341313513136131371313813139131401314113142131431314413145131461314713148131491315013151131521315313154131551315613157131581315913160131611316213163131641316513166131671316813169131701317113172131731317413175131761317713178131791318013181131821318313184131851318613187131881318913190131911319213193131941319513196131971319813199132001320113202132031320413205132061320713208132091321013211132121321313214132151321613217132181321913220132211322213223132241322513226132271322813229132301323113232132331323413235132361323713238132391324013241132421324313244132451324613247132481324913250132511325213253132541325513256132571325813259132601326113262132631326413265132661326713268132691327013271132721327313274132751327613277132781327913280132811328213283132841328513286132871328813289132901329113292132931329413295132961329713298132991330013301133021330313304133051330613307133081330913310133111331213313133141331513316133171331813319133201332113322133231332413325133261332713328133291333013331133321333313334133351333613337133381333913340133411334213343133441334513346133471334813349133501335113352133531335413355133561335713358133591336013361133621336313364133651336613367133681336913370133711337213373133741337513376133771337813379133801338113382133831338413385133861338713388133891339013391133921339313394133951339613397133981339913400134011340213403134041340513406134071340813409134101341113412134131341413415134161341713418134191342013421134221342313424134251342613427134281342913430134311343213433134341343513436134371343813439134401344113442134431344413445134461344713448134491345013451134521345313454134551345613457134581345913460134611346213463134641346513466134671346813469134701347113472134731347413475134761347713478134791348013481134821348313484134851348613487134881348913490134911349213493134941349513496134971349813499135001350113502135031350413505135061350713508135091351013511135121351313514135151351613517135181351913520135211352213523135241352513526135271352813529135301353113532135331353413535135361353713538135391354013541135421354313544135451354613547135481354913550135511355213553135541355513556135571355813559135601356113562135631356413565135661356713568135691357013571135721357313574135751357613577135781357913580135811358213583135841358513586135871358813589135901359113592135931359413595135961359713598135991360013601136021360313604136051360613607136081360913610136111361213613136141361513616136171361813619136201362113622136231362413625136261362713628136291363013631136321363313634136351363613637136381363913640136411364213643136441364513646136471364813649136501365113652136531365413655136561365713658136591366013661136621366313664136651366613667136681366913670136711367213673136741367513676136771367813679136801368113682136831368413685136861368713688136891369013691136921369313694136951369613697136981369913700137011370213703137041370513706137071370813709137101371113712137131371413715137161371713718137191372013721137221372313724137251372613727137281372913730137311373213733137341373513736137371373813739137401374113742137431374413745137461374713748137491375013751137521375313754137551375613757137581375913760137611376213763137641376513766137671376813769137701377113772137731377413775137761377713778137791378013781137821378313784137851378613787137881378913790137911379213793137941379513796137971379813799138001380113802138031380413805138061380713808138091381013811138121381313814138151381613817138181381913820138211382213823138241382513826138271382813829138301383113832138331383413835138361383713838138391384013841138421384313844138451384613847138481384913850138511385213853138541385513856138571385813859138601386113862138631386413865138661386713868138691387013871138721387313874138751387613877138781387913880138811388213883138841388513886138871388813889138901389113892138931389413895138961389713898138991390013901139021390313904139051390613907139081390913910139111391213913139141391513916139171391813919139201392113922139231392413925139261392713928139291393013931139321393313934139351393613937139381393913940139411394213943139441394513946139471394813949139501395113952139531395413955139561395713958139591396013961139621396313964139651396613967139681396913970139711397213973139741397513976139771397813979139801398113982139831398413985139861398713988139891399013991139921399313994139951399613997139981399914000140011400214003140041400514006140071400814009140101401114012140131401414015140161401714018140191402014021140221402314024140251402614027140281402914030140311403214033140341403514036140371403814039140401404114042140431404414045140461404714048140491405014051140521405314054140551405614057140581405914060140611406214063140641406514066140671406814069140701407114072140731407414075140761407714078140791408014081140821408314084140851408614087140881408914090140911409214093140941409514096140971409814099141001410114102141031410414105141061410714108141091411014111141121411314114141151411614117141181411914120141211412214123141241412514126141271412814129141301413114132141331413414135141361413714138141391414014141141421414314144141451414614147141481414914150141511415214153141541415514156141571415814159141601416114162141631416414165141661416714168141691417014171141721417314174141751417614177141781417914180141811418214183141841418514186141871418814189141901419114192141931419414195141961419714198141991420014201142021420314204142051420614207142081420914210142111421214213142141421514216142171421814219142201422114222142231422414225142261422714228142291423014231142321423314234142351423614237142381423914240142411424214243142441424514246142471424814249142501425114252142531425414255142561425714258142591426014261142621426314264142651426614267142681426914270142711427214273142741427514276142771427814279142801428114282142831428414285142861428714288142891429014291142921429314294142951429614297142981429914300143011430214303143041430514306143071430814309143101431114312143131431414315143161431714318143191432014321143221432314324143251432614327143281432914330143311433214333143341433514336143371433814339143401434114342143431434414345143461434714348143491435014351143521435314354143551435614357143581435914360143611436214363143641436514366143671436814369143701437114372143731437414375143761437714378143791438014381143821438314384143851438614387143881438914390143911439214393143941439514396143971439814399144001440114402144031440414405144061440714408144091441014411144121441314414144151441614417144181441914420144211442214423144241442514426144271442814429144301443114432144331443414435144361443714438144391444014441144421444314444144451444614447144481444914450144511445214453144541445514456144571445814459144601446114462144631446414465144661446714468144691447014471144721447314474144751447614477144781447914480144811448214483144841448514486144871448814489144901449114492144931449414495144961449714498144991450014501145021450314504145051450614507145081450914510145111451214513145141451514516145171451814519145201452114522145231452414525145261452714528145291453014531145321453314534145351453614537145381453914540145411454214543145441454514546145471454814549145501455114552145531455414555145561455714558145591456014561145621456314564145651456614567145681456914570145711457214573145741457514576145771457814579145801458114582145831458414585145861458714588145891459014591145921459314594145951459614597145981459914600146011460214603146041460514606146071460814609146101461114612146131461414615146161461714618146191462014621146221462314624146251462614627146281462914630146311463214633146341463514636146371463814639146401464114642146431464414645146461464714648146491465014651146521465314654146551465614657146581465914660146611466214663146641466514666146671466814669146701467114672146731467414675146761467714678146791468014681146821468314684146851468614687146881468914690146911469214693146941469514696146971469814699147001470114702147031470414705147061470714708147091471014711147121471314714147151471614717147181471914720147211472214723147241472514726147271472814729147301473114732147331473414735147361473714738147391474014741147421474314744147451474614747147481474914750147511475214753147541475514756147571475814759147601476114762147631476414765147661476714768147691477014771147721477314774147751477614777147781477914780147811478214783147841478514786147871478814789147901479114792147931479414795147961479714798147991480014801148021480314804148051480614807148081480914810148111481214813148141481514816148171481814819148201482114822148231482414825148261482714828148291483014831148321483314834148351483614837148381483914840148411484214843148441484514846148471484814849148501485114852148531485414855148561485714858148591486014861148621486314864148651486614867148681486914870148711487214873148741487514876148771487814879148801488114882148831488414885148861488714888148891489014891148921489314894148951489614897148981489914900149011490214903149041490514906149071490814909149101491114912149131491414915149161491714918149191492014921149221492314924149251492614927149281492914930149311493214933149341493514936149371493814939149401494114942149431494414945149461494714948149491495014951149521495314954149551495614957149581495914960149611496214963149641496514966149671496814969149701497114972149731497414975149761497714978149791498014981149821498314984149851498614987149881498914990149911499214993149941499514996149971499814999150001500115002150031500415005150061500715008150091501015011150121501315014150151501615017150181501915020150211502215023150241502515026150271502815029150301503115032150331503415035150361503715038150391504015041150421504315044150451504615047150481504915050150511505215053150541505515056150571505815059150601506115062150631506415065150661506715068150691507015071150721507315074150751507615077150781507915080150811508215083150841508515086150871508815089150901509115092150931509415095150961509715098150991510015101151021510315104151051510615107151081510915110151111511215113151141511515116151171511815119151201512115122151231512415125151261512715128151291513015131151321513315134151351513615137151381513915140151411514215143151441514515146151471514815149151501515115152151531515415155151561515715158151591516015161151621516315164151651516615167151681516915170151711517215173151741517515176151771517815179151801518115182151831518415185151861518715188151891519015191151921519315194151951519615197151981519915200152011520215203152041520515206152071520815209152101521115212152131521415215152161521715218152191522015221152221522315224152251522615227152281522915230152311523215233152341523515236152371523815239152401524115242152431524415245152461524715248152491525015251152521525315254152551525615257152581525915260152611526215263152641526515266152671526815269152701527115272152731527415275152761527715278152791528015281152821528315284152851528615287152881528915290152911529215293152941529515296152971529815299153001530115302153031530415305153061530715308153091531015311153121531315314153151531615317153181531915320153211532215323153241532515326153271532815329153301533115332153331533415335153361533715338153391534015341153421534315344153451534615347153481534915350153511535215353153541535515356153571535815359153601536115362153631536415365153661536715368153691537015371153721537315374153751537615377153781537915380153811538215383153841538515386153871538815389153901539115392153931539415395153961539715398153991540015401154021540315404154051540615407154081540915410154111541215413154141541515416154171541815419154201542115422154231542415425154261542715428154291543015431154321543315434154351543615437154381543915440154411544215443154441544515446154471544815449154501545115452154531545415455154561545715458154591546015461154621546315464154651546615467154681546915470154711547215473154741547515476154771547815479154801548115482154831548415485154861548715488154891549015491154921549315494154951549615497154981549915500155011550215503155041550515506155071550815509155101551115512155131551415515155161551715518155191552015521155221552315524155251552615527155281552915530155311553215533155341553515536155371553815539155401554115542155431554415545155461554715548155491555015551155521555315554155551555615557155581555915560155611556215563155641556515566155671556815569155701557115572155731557415575155761557715578155791558015581155821558315584155851558615587155881558915590155911559215593155941559515596155971559815599156001560115602156031560415605156061560715608156091561015611156121561315614156151561615617156181561915620156211562215623156241562515626156271562815629156301563115632156331563415635156361563715638156391564015641156421564315644156451564615647156481564915650156511565215653156541565515656156571565815659156601566115662156631566415665156661566715668156691567015671156721567315674156751567615677156781567915680156811568215683156841568515686156871568815689156901569115692156931569415695156961569715698156991570015701157021570315704157051570615707157081570915710157111571215713157141571515716157171571815719157201572115722157231572415725157261572715728157291573015731157321573315734157351573615737157381573915740157411574215743157441574515746157471574815749157501575115752157531575415755157561575715758157591576015761157621576315764157651576615767157681576915770157711577215773157741577515776157771577815779157801578115782157831578415785157861578715788157891579015791157921579315794157951579615797157981579915800158011580215803158041580515806158071580815809158101581115812158131581415815158161581715818158191582015821158221582315824158251582615827158281582915830158311583215833158341583515836158371583815839158401584115842158431584415845158461584715848158491585015851158521585315854158551585615857158581585915860158611586215863158641586515866158671586815869158701587115872158731587415875158761587715878158791588015881158821588315884158851588615887158881588915890158911589215893158941589515896158971589815899159001590115902159031590415905159061590715908159091591015911159121591315914159151591615917159181591915920159211592215923159241592515926159271592815929159301593115932159331593415935159361593715938159391594015941159421594315944159451594615947159481594915950159511595215953159541595515956159571595815959159601596115962159631596415965159661596715968159691597015971159721597315974159751597615977159781597915980159811598215983159841598515986159871598815989159901599115992159931599415995159961599715998159991600016001160021600316004160051600616007160081600916010160111601216013160141601516016160171601816019160201602116022160231602416025160261602716028160291603016031160321603316034160351603616037160381603916040160411604216043160441604516046160471604816049160501605116052160531605416055160561605716058160591606016061160621606316064160651606616067160681606916070160711607216073160741607516076160771607816079160801608116082160831608416085160861608716088160891609016091160921609316094160951609616097160981609916100161011610216103161041610516106161071610816109161101611116112161131611416115161161611716118161191612016121161221612316124161251612616127161281612916130161311613216133161341613516136161371613816139161401614116142161431614416145161461614716148161491615016151161521615316154161551615616157161581615916160161611616216163161641616516166161671616816169161701617116172161731617416175161761617716178161791618016181161821618316184161851618616187161881618916190161911619216193161941619516196161971619816199162001620116202162031620416205162061620716208162091621016211162121621316214162151621616217162181621916220162211622216223162241622516226162271622816229162301623116232162331623416235162361623716238162391624016241162421624316244162451624616247162481624916250162511625216253162541625516256162571625816259162601626116262162631626416265162661626716268162691627016271162721627316274162751627616277162781627916280162811628216283162841628516286162871628816289162901629116292162931629416295162961629716298162991630016301163021630316304163051630616307163081630916310163111631216313163141631516316163171631816319163201632116322163231632416325163261632716328163291633016331163321633316334163351633616337163381633916340163411634216343163441634516346163471634816349163501635116352163531635416355163561635716358163591636016361163621636316364163651636616367163681636916370163711637216373163741637516376163771637816379163801638116382163831638416385163861638716388163891639016391163921639316394163951639616397163981639916400164011640216403164041640516406164071640816409164101641116412164131641416415164161641716418164191642016421164221642316424164251642616427164281642916430164311643216433164341643516436164371643816439164401644116442164431644416445164461644716448164491645016451164521645316454164551645616457164581645916460164611646216463164641646516466164671646816469164701647116472164731647416475164761647716478164791648016481164821648316484164851648616487164881648916490164911649216493164941649516496164971649816499165001650116502165031650416505165061650716508165091651016511165121651316514165151651616517165181651916520165211652216523165241652516526165271652816529165301653116532165331653416535165361653716538165391654016541165421654316544165451654616547165481654916550165511655216553165541655516556165571655816559165601656116562165631656416565165661656716568165691657016571165721657316574165751657616577165781657916580165811658216583165841658516586165871658816589165901659116592165931659416595165961659716598165991660016601166021660316604166051660616607166081660916610166111661216613166141661516616166171661816619166201662116622166231662416625166261662716628166291663016631166321663316634166351663616637166381663916640166411664216643166441664516646166471664816649166501665116652166531665416655166561665716658166591666016661166621666316664166651666616667166681666916670166711667216673166741667516676166771667816679166801668116682166831668416685166861668716688166891669016691166921669316694166951669616697166981669916700167011670216703167041670516706167071670816709167101671116712167131671416715167161671716718167191672016721167221672316724167251672616727167281672916730167311673216733167341673516736167371673816739167401674116742167431674416745167461674716748167491675016751167521675316754167551675616757167581675916760167611676216763167641676516766167671676816769167701677116772167731677416775167761677716778167791678016781167821678316784167851678616787167881678916790167911679216793167941679516796167971679816799168001680116802168031680416805168061680716808168091681016811168121681316814168151681616817168181681916820168211682216823168241682516826168271682816829168301683116832168331683416835168361683716838168391684016841168421684316844168451684616847168481684916850168511685216853168541685516856168571685816859168601686116862168631686416865168661686716868168691687016871168721687316874168751687616877168781687916880168811688216883168841688516886168871688816889168901689116892168931689416895168961689716898168991690016901169021690316904169051690616907169081690916910169111691216913169141691516916169171691816919169201692116922169231692416925169261692716928169291693016931169321693316934169351693616937169381693916940169411694216943169441694516946169471694816949169501695116952169531695416955169561695716958169591696016961169621696316964169651696616967169681696916970169711697216973169741697516976169771697816979169801698116982169831698416985169861698716988169891699016991169921699316994169951699616997169981699917000170011700217003170041700517006170071700817009170101701117012170131701417015170161701717018170191702017021170221702317024170251702617027170281702917030170311703217033170341703517036170371703817039170401704117042170431704417045170461704717048170491705017051170521705317054170551705617057170581705917060170611706217063170641706517066170671706817069170701707117072170731707417075170761707717078170791708017081170821708317084170851708617087170881708917090170911709217093170941709517096170971709817099171001710117102171031710417105171061710717108171091711017111171121711317114171151711617117171181711917120171211712217123171241712517126171271712817129171301713117132171331713417135171361713717138171391714017141171421714317144171451714617147171481714917150171511715217153171541715517156171571715817159171601716117162171631716417165171661716717168171691717017171171721717317174171751717617177171781717917180171811718217183171841718517186171871718817189171901719117192171931719417195171961719717198171991720017201172021720317204172051720617207172081720917210172111721217213172141721517216172171721817219172201722117222172231722417225172261722717228172291723017231172321723317234172351723617237172381723917240172411724217243172441724517246172471724817249172501725117252172531725417255172561725717258172591726017261172621726317264172651726617267172681726917270172711727217273172741727517276172771727817279172801728117282172831728417285172861728717288172891729017291172921729317294172951729617297172981729917300173011730217303173041730517306173071730817309173101731117312173131731417315173161731717318173191732017321173221732317324173251732617327173281732917330173311733217333173341733517336173371733817339173401734117342173431734417345173461734717348173491735017351173521735317354173551735617357173581735917360173611736217363173641736517366173671736817369173701737117372173731737417375173761737717378173791738017381173821738317384173851738617387173881738917390173911739217393173941739517396173971739817399174001740117402174031740417405174061740717408174091741017411174121741317414174151741617417174181741917420174211742217423174241742517426174271742817429174301743117432174331743417435174361743717438174391744017441174421744317444174451744617447174481744917450174511745217453174541745517456174571745817459174601746117462174631746417465174661746717468174691747017471174721747317474174751747617477174781747917480174811748217483174841748517486174871748817489174901749117492174931749417495174961749717498174991750017501175021750317504175051750617507175081750917510175111751217513175141751517516175171751817519175201752117522175231752417525175261752717528175291753017531175321753317534175351753617537175381753917540175411754217543175441754517546175471754817549175501755117552175531755417555175561755717558175591756017561175621756317564175651756617567175681756917570175711757217573175741757517576175771757817579175801758117582175831758417585175861758717588175891759017591175921759317594175951759617597175981759917600176011760217603176041760517606176071760817609176101761117612176131761417615176161761717618176191762017621176221762317624176251762617627176281762917630176311763217633176341763517636176371763817639176401764117642176431764417645176461764717648176491765017651176521765317654176551765617657176581765917660176611766217663176641766517666176671766817669176701767117672176731767417675176761767717678176791768017681176821768317684176851768617687176881768917690176911769217693176941769517696176971769817699177001770117702177031770417705177061770717708177091771017711177121771317714177151771617717177181771917720177211772217723177241772517726177271772817729177301773117732177331773417735177361773717738177391774017741177421774317744177451774617747177481774917750177511775217753177541775517756177571775817759177601776117762177631776417765177661776717768177691777017771177721777317774177751777617777177781777917780177811778217783177841778517786177871778817789177901779117792177931779417795177961779717798177991780017801178021780317804178051780617807178081780917810178111781217813178141781517816178171781817819178201782117822178231782417825178261782717828178291783017831178321783317834178351783617837178381783917840178411784217843178441784517846178471784817849178501785117852178531785417855178561785717858178591786017861178621786317864178651786617867178681786917870178711787217873178741787517876178771787817879178801788117882178831788417885178861788717888178891789017891178921789317894178951789617897178981789917900179011790217903179041790517906179071790817909179101791117912179131791417915179161791717918179191792017921179221792317924179251792617927179281792917930179311793217933179341793517936179371793817939179401794117942179431794417945179461794717948179491795017951179521795317954179551795617957179581795917960179611796217963179641796517966179671796817969179701797117972179731797417975179761797717978179791798017981179821798317984179851798617987179881798917990179911799217993179941799517996179971799817999180001800118002180031800418005180061800718008180091801018011180121801318014180151801618017180181801918020180211802218023180241802518026180271802818029180301803118032180331803418035180361803718038180391804018041180421804318044180451804618047180481804918050180511805218053180541805518056180571805818059180601806118062180631806418065180661806718068180691807018071180721807318074180751807618077180781807918080180811808218083180841808518086180871808818089180901809118092180931809418095180961809718098180991810018101181021810318104181051810618107181081810918110181111811218113181141811518116181171811818119181201812118122181231812418125181261812718128181291813018131181321813318134181351813618137181381813918140181411814218143181441814518146181471814818149181501815118152181531815418155181561815718158181591816018161181621816318164181651816618167181681816918170181711817218173181741817518176181771817818179181801818118182181831818418185181861818718188181891819018191181921819318194181951819618197181981819918200182011820218203182041820518206182071820818209182101821118212182131821418215182161821718218182191822018221182221822318224182251822618227182281822918230182311823218233182341823518236182371823818239182401824118242182431824418245182461824718248182491825018251182521825318254182551825618257182581825918260182611826218263182641826518266182671826818269182701827118272182731827418275182761827718278182791828018281182821828318284182851828618287182881828918290182911829218293182941829518296182971829818299183001830118302183031830418305183061830718308183091831018311183121831318314183151831618317183181831918320183211832218323183241832518326183271832818329183301833118332183331833418335183361833718338183391834018341183421834318344183451834618347183481834918350183511835218353183541835518356183571835818359183601836118362183631836418365183661836718368183691837018371183721837318374183751837618377183781837918380183811838218383183841838518386183871838818389183901839118392183931839418395183961839718398183991840018401184021840318404184051840618407184081840918410184111841218413184141841518416184171841818419184201842118422184231842418425184261842718428184291843018431184321843318434184351843618437184381843918440184411844218443184441844518446184471844818449184501845118452184531845418455184561845718458184591846018461184621846318464184651846618467184681846918470184711847218473184741847518476184771847818479184801848118482184831848418485184861848718488184891849018491184921849318494184951849618497184981849918500185011850218503185041850518506185071850818509185101851118512185131851418515185161851718518185191852018521185221852318524185251852618527185281852918530185311853218533185341853518536185371853818539185401854118542185431854418545185461854718548185491855018551185521855318554185551855618557185581855918560185611856218563185641856518566185671856818569185701857118572185731857418575185761857718578185791858018581185821858318584185851858618587185881858918590185911859218593185941859518596185971859818599186001860118602186031860418605186061860718608186091861018611186121861318614186151861618617186181861918620186211862218623186241862518626186271862818629186301863118632186331863418635186361863718638186391864018641186421864318644186451864618647186481864918650186511865218653186541865518656186571865818659186601866118662186631866418665186661866718668186691867018671186721867318674186751867618677186781867918680186811868218683186841868518686186871868818689186901869118692186931869418695186961869718698186991870018701187021870318704187051870618707187081870918710187111871218713187141871518716187171871818719187201872118722187231872418725187261872718728187291873018731187321873318734187351873618737187381873918740187411874218743187441874518746187471874818749187501875118752187531875418755187561875718758187591876018761187621876318764187651876618767187681876918770187711877218773187741877518776187771877818779187801878118782187831878418785187861878718788187891879018791187921879318794187951879618797187981879918800188011880218803188041880518806188071880818809188101881118812188131881418815188161881718818188191882018821188221882318824188251882618827188281882918830188311883218833188341883518836188371883818839188401884118842188431884418845188461884718848188491885018851188521885318854188551885618857188581885918860188611886218863188641886518866188671886818869188701887118872188731887418875188761887718878188791888018881188821888318884188851888618887188881888918890188911889218893188941889518896188971889818899189001890118902189031890418905189061890718908189091891018911189121891318914189151891618917189181891918920189211892218923189241892518926189271892818929189301893118932189331893418935189361893718938189391894018941189421894318944189451894618947189481894918950189511895218953189541895518956189571895818959189601896118962189631896418965189661896718968189691897018971189721897318974189751897618977189781897918980189811898218983189841898518986189871898818989189901899118992189931899418995189961899718998189991900019001190021900319004190051900619007190081900919010190111901219013190141901519016190171901819019190201902119022190231902419025190261902719028190291903019031190321903319034190351903619037190381903919040190411904219043190441904519046190471904819049190501905119052190531905419055190561905719058190591906019061190621906319064190651906619067190681906919070190711907219073190741907519076190771907819079190801908119082190831908419085190861908719088190891909019091190921909319094190951909619097190981909919100191011910219103191041910519106191071910819109191101911119112191131911419115191161911719118191191912019121191221912319124191251912619127191281912919130191311913219133191341913519136191371913819139191401914119142191431914419145191461914719148191491915019151191521915319154191551915619157191581915919160191611916219163191641916519166191671916819169191701917119172191731917419175191761917719178
  1. (self["webpackChunk"] = self["webpackChunk"] || []).push([["resources_js_pages_Customers_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/AppSidebar.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/AppSidebar.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 _components_AppSubSidebar_vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @/components/AppSubSidebar.vue */ "./resources/js/components/AppSubSidebar.vue");
  114. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
  115. __name: 'AppSidebar',
  116. props: {
  117. menu: Array
  118. },
  119. setup: function setup(__props, _ref) {
  120. var expose = _ref.expose;
  121. expose();
  122. var __returned__ = {
  123. AppSubSidebar: _components_AppSubSidebar_vue__WEBPACK_IMPORTED_MODULE_0__["default"]
  124. };
  125. Object.defineProperty(__returned__, '__isScriptSetup', {
  126. enumerable: false,
  127. value: true
  128. });
  129. return __returned__;
  130. }
  131. });
  132. /***/ }),
  133. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppSubSidebar.vue?vue&type=script&setup=true&lang=js":
  134. /*!******************************************************************************************************************************************************************************************************************!*\
  135. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppSubSidebar.vue?vue&type=script&setup=true&lang=js ***!
  136. \******************************************************************************************************************************************************************************************************************/
  137. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  138. "use strict";
  139. __webpack_require__.r(__webpack_exports__);
  140. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  141. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  142. /* harmony export */ });
  143. /* harmony import */ var _inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @inertiajs/inertia-vue3 */ "./node_modules/@inertiajs/inertia-vue3/dist/index.js");
  144. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
  145. __name: 'AppSubSidebar',
  146. props: {
  147. items: Array,
  148. root: {
  149. type: Boolean,
  150. "default": false
  151. }
  152. },
  153. setup: function setup(__props, _ref) {
  154. var expose = _ref.expose;
  155. expose();
  156. var __returned__ = {
  157. Link: _inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_0__.Link
  158. };
  159. Object.defineProperty(__returned__, '__isScriptSetup', {
  160. enumerable: false,
  161. value: true
  162. });
  163. return __returned__;
  164. }
  165. });
  166. /***/ }),
  167. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppTopBar.vue?vue&type=script&setup=true&lang=js":
  168. /*!**************************************************************************************************************************************************************************************************************!*\
  169. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppTopBar.vue?vue&type=script&setup=true&lang=js ***!
  170. \**************************************************************************************************************************************************************************************************************/
  171. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  172. "use strict";
  173. __webpack_require__.r(__webpack_exports__);
  174. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  175. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  176. /* harmony export */ });
  177. /* harmony import */ var _inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @inertiajs/inertia-vue3 */ "./node_modules/@inertiajs/inertia-vue3/dist/index.js");
  178. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
  179. __name: 'AppTopBar',
  180. emits: ['menu-toggle'],
  181. setup: function setup(__props, _ref) {
  182. var expose = _ref.expose;
  183. expose();
  184. var __returned__ = {
  185. Link: _inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_0__.Link
  186. };
  187. Object.defineProperty(__returned__, '__isScriptSetup', {
  188. enumerable: false,
  189. value: true
  190. });
  191. return __returned__;
  192. }
  193. });
  194. /***/ }),
  195. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/layouts/DashboardLayout.vue?vue&type=script&setup=true&lang=js":
  196. /*!*****************************************************************************************************************************************************************************************************************!*\
  197. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/layouts/DashboardLayout.vue?vue&type=script&setup=true&lang=js ***!
  198. \*****************************************************************************************************************************************************************************************************************/
  199. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  200. "use strict";
  201. __webpack_require__.r(__webpack_exports__);
  202. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  203. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  204. /* harmony export */ });
  205. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  206. /* harmony import */ var _components_AppTopBar_vue__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @/components/AppTopBar.vue */ "./resources/js/components/AppTopBar.vue");
  207. /* harmony import */ var _components_AppSidebar_vue__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @/components/AppSidebar.vue */ "./resources/js/components/AppSidebar.vue");
  208. /* harmony import */ var _components_AppMessage_vue__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @/components/AppMessage.vue */ "./resources/js/components/AppMessage.vue");
  209. /* harmony import */ var _utils_menu__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @/utils/menu */ "./resources/js/utils/menu.js");
  210. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
  211. __name: 'DashboardLayout',
  212. setup: function setup(__props, _ref) {
  213. var expose = _ref.expose;
  214. expose();
  215. var mobileMenuActive = (0,vue__WEBPACK_IMPORTED_MODULE_0__.ref)(false);
  216. var staticMenuInactive = (0,vue__WEBPACK_IMPORTED_MODULE_0__.ref)(false);
  217. var menuClick = (0,vue__WEBPACK_IMPORTED_MODULE_0__.ref)(false);
  218. var isDesktop = function isDesktop() {
  219. return window.innerWidth >= 992;
  220. };
  221. var containerClass = (0,vue__WEBPACK_IMPORTED_MODULE_0__.computed)(function () {
  222. return ['layout-wrapper', {
  223. 'layout-static-sidebar-inactive': staticMenuInactive.value,
  224. 'layout-mobile-sidebar-active': mobileMenuActive.value
  225. }];
  226. });
  227. var onWrapperClick = function onWrapperClick() {
  228. if (!menuClick.value) {
  229. mobileMenuActive.value = false;
  230. }
  231. menuClick.value = false;
  232. };
  233. var onMenuToggle = function onMenuToggle(event) {
  234. menuClick.value = true;
  235. if (isDesktop()) {
  236. staticMenuInactive.value = !staticMenuInactive.value;
  237. } else {
  238. mobileMenuActive.value = !mobileMenuActive.value;
  239. }
  240. event.preventDefault();
  241. };
  242. var __returned__ = {
  243. mobileMenuActive: mobileMenuActive,
  244. staticMenuInactive: staticMenuInactive,
  245. menuClick: menuClick,
  246. isDesktop: isDesktop,
  247. containerClass: containerClass,
  248. onWrapperClick: onWrapperClick,
  249. onMenuToggle: onMenuToggle,
  250. ref: vue__WEBPACK_IMPORTED_MODULE_0__.ref,
  251. computed: vue__WEBPACK_IMPORTED_MODULE_0__.computed,
  252. AppTopBar: _components_AppTopBar_vue__WEBPACK_IMPORTED_MODULE_1__["default"],
  253. AppSidebar: _components_AppSidebar_vue__WEBPACK_IMPORTED_MODULE_2__["default"],
  254. AppMessage: _components_AppMessage_vue__WEBPACK_IMPORTED_MODULE_3__["default"],
  255. menu: _utils_menu__WEBPACK_IMPORTED_MODULE_4__["default"]
  256. };
  257. Object.defineProperty(__returned__, '__isScriptSetup', {
  258. enumerable: false,
  259. value: true
  260. });
  261. return __returned__;
  262. }
  263. });
  264. /***/ }),
  265. /***/ "./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/Customers/Index.vue?vue&type=script&setup=true&lang=js":
  266. /*!***************************************************************************************************************************************************************************************************************!*\
  267. !*** ./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/Customers/Index.vue?vue&type=script&setup=true&lang=js ***!
  268. \***************************************************************************************************************************************************************************************************************/
  269. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  270. "use strict";
  271. __webpack_require__.r(__webpack_exports__);
  272. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  273. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  274. /* harmony export */ });
  275. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  276. /* harmony import */ var _inertiajs_inertia__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @inertiajs/inertia */ "./node_modules/@inertiajs/inertia/dist/index.js");
  277. /* harmony import */ var _inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @inertiajs/inertia-vue3 */ "./node_modules/@inertiajs/inertia-vue3/dist/index.js");
  278. /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! lodash */ "./node_modules/lodash/lodash.js");
  279. /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_3__);
  280. /* harmony import */ var _tableHeader__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./tableHeader */ "./resources/js/pages/Customers/tableHeader.js");
  281. /* harmony import */ var _components_useSearchText__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @/components/useSearchText */ "./resources/js/components/useSearchText.js");
  282. /* harmony import */ var _layouts_DashboardLayout_vue__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @/layouts/DashboardLayout.vue */ "./resources/js/layouts/DashboardLayout.vue");
  283. /* harmony import */ var _components_AppButtonLink_vue__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @/components/AppButtonLink.vue */ "./resources/js/components/AppButtonLink.vue");
  284. /* harmony import */ var _components_AppPagination_vue__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @/components/AppPagination.vue */ "./resources/js/components/AppPagination.vue");
  285. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
  286. __name: 'Index',
  287. props: {
  288. customers: Object,
  289. initialSearch: String
  290. },
  291. setup: function setup(__props, _ref) {
  292. var expose = _ref.expose;
  293. expose();
  294. var props = __props;
  295. var _useSearchText = (0,_components_useSearchText__WEBPACK_IMPORTED_MODULE_5__.useSearchText)(props),
  296. search = _useSearchText.search;
  297. (0,vue__WEBPACK_IMPORTED_MODULE_0__.watch)(search, function () {
  298. _inertiajs_inertia__WEBPACK_IMPORTED_MODULE_1__.Inertia.get('/customers', (0,lodash__WEBPACK_IMPORTED_MODULE_3__.pickBy)({
  299. search: search.value
  300. }), {
  301. preserveState: true
  302. });
  303. });
  304. var __returned__ = {
  305. props: props,
  306. search: search,
  307. watch: vue__WEBPACK_IMPORTED_MODULE_0__.watch,
  308. Inertia: _inertiajs_inertia__WEBPACK_IMPORTED_MODULE_1__.Inertia,
  309. Head: _inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_2__.Head,
  310. pickBy: lodash__WEBPACK_IMPORTED_MODULE_3__.pickBy,
  311. tableHeader: _tableHeader__WEBPACK_IMPORTED_MODULE_4__["default"],
  312. useSearchText: _components_useSearchText__WEBPACK_IMPORTED_MODULE_5__.useSearchText,
  313. DashboardLayout: _layouts_DashboardLayout_vue__WEBPACK_IMPORTED_MODULE_6__["default"],
  314. AppButtonLink: _components_AppButtonLink_vue__WEBPACK_IMPORTED_MODULE_7__["default"],
  315. AppPagination: _components_AppPagination_vue__WEBPACK_IMPORTED_MODULE_8__["default"]
  316. };
  317. Object.defineProperty(__returned__, '__isScriptSetup', {
  318. enumerable: false,
  319. value: true
  320. });
  321. return __returned__;
  322. }
  323. });
  324. /***/ }),
  325. /***/ "./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":
  326. /*!***********************************************************************************************************************************************************************************************************************************************************************************!*\
  327. !*** ./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 ***!
  328. \***********************************************************************************************************************************************************************************************************************************************************************************/
  329. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  330. "use strict";
  331. __webpack_require__.r(__webpack_exports__);
  332. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  333. /* harmony export */ "render": () => (/* binding */ render)
  334. /* harmony export */ });
  335. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  336. var _hoisted_1 = {
  337. key: 1,
  338. "class": "p-button-label"
  339. };
  340. var _hoisted_2 = {
  341. key: 1,
  342. "class": "p-button p-component"
  343. };
  344. var _hoisted_3 = {
  345. key: 1,
  346. "class": "p-button-label"
  347. };
  348. function render(_ctx, _cache, $props, $setup, $data, $options) {
  349. return $props.inertiaLink ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createBlock)($setup["Link"], {
  350. key: 0,
  351. "class": "p-button p-component",
  352. as: "button",
  353. type: "button"
  354. }, {
  355. "default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  356. return [$props.icon ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)("span", {
  357. key: 0,
  358. "class": (0,vue__WEBPACK_IMPORTED_MODULE_0__.normalizeClass)(["p-button-icon p-button-icon-left", $props.icon])
  359. }, null, 2
  360. /* CLASS */
  361. )) : (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
  362. /* TEXT */
  363. )) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true)];
  364. }),
  365. _: 1
  366. /* STABLE */
  367. })) : ((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", {
  368. key: 0,
  369. "class": (0,vue__WEBPACK_IMPORTED_MODULE_0__.normalizeClass)(["p-button-icon p-button-icon-left", $props.icon])
  370. }, null, 2
  371. /* CLASS */
  372. )) : (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
  373. /* TEXT */
  374. )) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true)]));
  375. }
  376. /***/ }),
  377. /***/ "./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":
  378. /*!********************************************************************************************************************************************************************************************************************************************************************************!*\
  379. !*** ./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 ***!
  380. \********************************************************************************************************************************************************************************************************************************************************************************/
  381. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  382. "use strict";
  383. __webpack_require__.r(__webpack_exports__);
  384. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  385. /* harmony export */ "render": () => (/* binding */ render)
  386. /* harmony export */ });
  387. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  388. var _hoisted_1 = {
  389. key: 0
  390. };
  391. var _hoisted_2 = {
  392. key: 1
  393. };
  394. function render(_ctx, _cache, $props, $setup, $data, $options) {
  395. var _component_Message = (0,vue__WEBPACK_IMPORTED_MODULE_0__.resolveComponent)("Message");
  396. 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, {
  397. key: 0,
  398. severity: "success",
  399. onClose: $setup.onClose
  400. }, {
  401. "default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  402. return [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createTextVNode)((0,vue__WEBPACK_IMPORTED_MODULE_0__.toDisplayString)(_ctx.$page.props.flash.success), 1
  403. /* TEXT */
  404. )];
  405. }),
  406. _: 1
  407. /* STABLE */
  408. })) : (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, {
  409. key: 1,
  410. severity: "error",
  411. onClose: $setup.onClose
  412. }, {
  413. "default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  414. return [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createTextVNode)((0,vue__WEBPACK_IMPORTED_MODULE_0__.toDisplayString)(_ctx.$page.props.flash.error), 1
  415. /* TEXT */
  416. )];
  417. }),
  418. _: 1
  419. /* STABLE */
  420. })) : (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, {
  421. key: 2,
  422. severity: "error",
  423. onClose: $setup.onClose
  424. }, {
  425. "default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  426. 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
  427. /* TEXT */
  428. ))];
  429. }),
  430. _: 1
  431. /* STABLE */
  432. })) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true)], 64
  433. /* STABLE_FRAGMENT */
  434. );
  435. }
  436. /***/ }),
  437. /***/ "./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":
  438. /*!***********************************************************************************************************************************************************************************************************************************************************************************!*\
  439. !*** ./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 ***!
  440. \***********************************************************************************************************************************************************************************************************************************************************************************/
  441. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  442. "use strict";
  443. __webpack_require__.r(__webpack_exports__);
  444. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  445. /* harmony export */ "render": () => (/* binding */ render)
  446. /* harmony export */ });
  447. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  448. var _hoisted_1 = {
  449. key: 0,
  450. "class": "p-paginator p-component flex justify-content-start"
  451. };
  452. var _hoisted_2 = {
  453. "class": "p-paginator-pages"
  454. };
  455. var _hoisted_3 = ["innerHTML"];
  456. function render(_ctx, _cache, $props, $setup, $data, $options) {
  457. 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) {
  458. 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", {
  459. key: "link-".concat(key),
  460. "class": (0,vue__WEBPACK_IMPORTED_MODULE_0__.normalizeClass)(["p-paginator-page p-paginator-element p-link", {
  461. 'p-disabled': link
  462. }]),
  463. innerHTML: link.label
  464. }, null, 10
  465. /* CLASS, PROPS */
  466. , _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"], {
  467. key: "link-".concat(key),
  468. href: link.url,
  469. "class": (0,vue__WEBPACK_IMPORTED_MODULE_0__.normalizeClass)([{
  470. 'p-highlight': link.active
  471. }, "p-paginator-page p-paginator-element p-link"]),
  472. innerHTML: link.label
  473. }, null, 8
  474. /* PROPS */
  475. , ["href", "class", "innerHTML"])) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true)], 64
  476. /* STABLE_FRAGMENT */
  477. );
  478. }), 256
  479. /* UNKEYED_FRAGMENT */
  480. ))])])) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true);
  481. }
  482. /***/ }),
  483. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppSidebar.vue?vue&type=template&id=22a4e926&scoped=true":
  484. /*!********************************************************************************************************************************************************************************************************************************************************************************************!*\
  485. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppSidebar.vue?vue&type=template&id=22a4e926&scoped=true ***!
  486. \********************************************************************************************************************************************************************************************************************************************************************************************/
  487. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  488. "use strict";
  489. __webpack_require__.r(__webpack_exports__);
  490. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  491. /* harmony export */ "render": () => (/* binding */ render)
  492. /* harmony export */ });
  493. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  494. function render(_ctx, _cache, $props, $setup, $data, $options) {
  495. return (0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)("div", null, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)($setup["AppSubSidebar"], {
  496. "class": "layout-menu",
  497. items: $props.menu,
  498. root: true
  499. }, null, 8
  500. /* PROPS */
  501. , ["items"])]);
  502. }
  503. /***/ }),
  504. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppSubSidebar.vue?vue&type=template&id=0addd9bc&scoped=true":
  505. /*!***********************************************************************************************************************************************************************************************************************************************************************************************!*\
  506. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppSubSidebar.vue?vue&type=template&id=0addd9bc&scoped=true ***!
  507. \***********************************************************************************************************************************************************************************************************************************************************************************************/
  508. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  509. "use strict";
  510. __webpack_require__.r(__webpack_exports__);
  511. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  512. /* harmony export */ "render": () => (/* binding */ render)
  513. /* harmony export */ });
  514. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  515. var _withScopeId = function _withScopeId(n) {
  516. return (0,vue__WEBPACK_IMPORTED_MODULE_0__.pushScopeId)("data-v-0addd9bc"), n = n(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.popScopeId)(), n;
  517. };
  518. var _hoisted_1 = {
  519. key: 0
  520. };
  521. var _hoisted_2 = ["aria-label"];
  522. var _hoisted_3 = ["aria-label"];
  523. function render(_ctx, _cache, $props, $setup, $data, $options) {
  524. var _component_AppSubSidebar = (0,vue__WEBPACK_IMPORTED_MODULE_0__.resolveComponent)("AppSubSidebar", true);
  525. 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) {
  526. 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", {
  527. key: i,
  528. "class": (0,vue__WEBPACK_IMPORTED_MODULE_0__.normalizeClass)([{
  529. 'layout-menuitem-category': $props.root
  530. }]),
  531. role: "none"
  532. }, [$props.root ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)(vue__WEBPACK_IMPORTED_MODULE_0__.Fragment, {
  533. key: 0
  534. }, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("div", {
  535. "class": "layout-menuitem-root-text",
  536. "aria-label": item.label
  537. }, (0,vue__WEBPACK_IMPORTED_MODULE_0__.toDisplayString)(item.label), 9
  538. /* TEXT, PROPS */
  539. , _hoisted_2), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(_component_AppSubSidebar, {
  540. items: item.items
  541. }, null, 8
  542. /* PROPS */
  543. , ["items"])], 64
  544. /* STABLE_FRAGMENT */
  545. )) : ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)(vue__WEBPACK_IMPORTED_MODULE_0__.Fragment, {
  546. key: 1
  547. }, [item.to ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createBlock)($setup["Link"], {
  548. key: 0,
  549. role: "menuitem",
  550. href: item.to,
  551. "class": (0,vue__WEBPACK_IMPORTED_MODULE_0__.normalizeClass)([{
  552. 'router-link-active': _ctx.$page.component.startsWith(item.component) || _ctx.$page.url.startsWith(item.to),
  553. 'router-link-exact-active': _ctx.$page.component.startsWith(item.component) || _ctx.$page.url.startsWith(item.to)
  554. }]),
  555. "aria-label": item.label
  556. }, {
  557. "default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  558. return [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("i", {
  559. "class": (0,vue__WEBPACK_IMPORTED_MODULE_0__.normalizeClass)(item.icon)
  560. }, null, 2
  561. /* CLASS */
  562. ), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("span", null, (0,vue__WEBPACK_IMPORTED_MODULE_0__.toDisplayString)(item.label), 1
  563. /* TEXT */
  564. )];
  565. }),
  566. _: 2
  567. /* DYNAMIC */
  568. }, 1032
  569. /* PROPS, DYNAMIC_SLOTS */
  570. , ["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", {
  571. key: 1,
  572. href: "#",
  573. role: "menuitem",
  574. "aria-label": item.label
  575. }, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("i", {
  576. "class": (0,vue__WEBPACK_IMPORTED_MODULE_0__.normalizeClass)(item.icon)
  577. }, null, 2
  578. /* CLASS */
  579. ), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("span", null, (0,vue__WEBPACK_IMPORTED_MODULE_0__.toDisplayString)(item.label), 1
  580. /* TEXT */
  581. )], 8
  582. /* PROPS */
  583. , _hoisted_3)) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(_component_AppSubSidebar, {
  584. items: item.items
  585. }, null, 8
  586. /* PROPS */
  587. , ["items"])], 64
  588. /* STABLE_FRAGMENT */
  589. ))], 2
  590. /* CLASS */
  591. )) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true)], 64
  592. /* STABLE_FRAGMENT */
  593. );
  594. }), 256
  595. /* UNKEYED_FRAGMENT */
  596. ))])) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true);
  597. }
  598. /***/ }),
  599. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppTopBar.vue?vue&type=template&id=42bf62a4&scoped=true":
  600. /*!*******************************************************************************************************************************************************************************************************************************************************************************************!*\
  601. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppTopBar.vue?vue&type=template&id=42bf62a4&scoped=true ***!
  602. \*******************************************************************************************************************************************************************************************************************************************************************************************/
  603. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  604. "use strict";
  605. __webpack_require__.r(__webpack_exports__);
  606. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  607. /* harmony export */ "render": () => (/* binding */ render)
  608. /* harmony export */ });
  609. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  610. var _withScopeId = function _withScopeId(n) {
  611. return (0,vue__WEBPACK_IMPORTED_MODULE_0__.pushScopeId)("data-v-42bf62a4"), n = n(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.popScopeId)(), n;
  612. };
  613. var _hoisted_1 = {
  614. "class": "layout-topbar"
  615. };
  616. var _hoisted_2 = /*#__PURE__*/_withScopeId(function () {
  617. return /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("img", {
  618. alt: "Brand Logo",
  619. src: "/images/logo.svg",
  620. "class": "md:mr-3"
  621. }, null, -1
  622. /* HOISTED */
  623. );
  624. });
  625. var _hoisted_3 = /*#__PURE__*/_withScopeId(function () {
  626. return /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("span", null, "Cahaya Agung", -1
  627. /* HOISTED */
  628. );
  629. });
  630. var _hoisted_4 = /*#__PURE__*/_withScopeId(function () {
  631. return /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("i", {
  632. "class": "pi pi-bars"
  633. }, null, -1
  634. /* HOISTED */
  635. );
  636. });
  637. var _hoisted_5 = [_hoisted_4];
  638. var _hoisted_6 = {
  639. "class": "p-link layout-topbar-menu-button layout-topbar-button"
  640. };
  641. var _hoisted_7 = /*#__PURE__*/_withScopeId(function () {
  642. return /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("i", {
  643. "class": "pi pi-ellipsis-v"
  644. }, null, -1
  645. /* HOISTED */
  646. );
  647. });
  648. var _hoisted_8 = [_hoisted_7];
  649. var _hoisted_9 = {
  650. "class": "layout-topbar-menu hidden lg:flex origin-top"
  651. };
  652. var _hoisted_10 = {
  653. "class": "align-self-center"
  654. };
  655. var _hoisted_11 = {
  656. "class": "hidden lg:inline"
  657. };
  658. var _hoisted_12 = /*#__PURE__*/_withScopeId(function () {
  659. return /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("i", {
  660. "class": "pi pi-user"
  661. }, null, -1
  662. /* HOISTED */
  663. );
  664. });
  665. var _hoisted_13 = /*#__PURE__*/_withScopeId(function () {
  666. return /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("span", null, "Ubah Profil", -1
  667. /* HOISTED */
  668. );
  669. });
  670. var _hoisted_14 = /*#__PURE__*/_withScopeId(function () {
  671. return /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("i", {
  672. "class": "pi pi-sign-out"
  673. }, null, -1
  674. /* HOISTED */
  675. );
  676. });
  677. var _hoisted_15 = /*#__PURE__*/_withScopeId(function () {
  678. return /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("span", null, "Keluar", -1
  679. /* HOISTED */
  680. );
  681. });
  682. function render(_ctx, _cache, $props, $setup, $data, $options) {
  683. var _directive_styleclass = (0,vue__WEBPACK_IMPORTED_MODULE_0__.resolveDirective)("styleclass");
  684. var _directive_tooltip = (0,vue__WEBPACK_IMPORTED_MODULE_0__.resolveDirective)("tooltip");
  685. 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"], {
  686. href: "/",
  687. "class": "layout-topbar-logo"
  688. }, {
  689. "default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  690. return [_hoisted_2, _hoisted_3];
  691. }),
  692. _: 1
  693. /* STABLE */
  694. }), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("button", {
  695. "class": "p-link layout-menu-button layout-topbar-button",
  696. onClick: _cache[0] || (_cache[0] = function ($event) {
  697. return _ctx.$emit('menu-toggle', $event);
  698. })
  699. }, _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, {
  700. selector: '@next',
  701. enterClass: 'hidden',
  702. enterActiveClass: 'scalein',
  703. leaveToClass: 'hidden',
  704. leaveActiveClass: 'fadeout',
  705. hideOnOutsideClick: true
  706. }]]), (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
  707. /* TEXT */
  708. )]), (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"], {
  709. href: _ctx.route('users.show', _ctx.$page.props.auth.user.id),
  710. "class": "p-link layout-topbar-button"
  711. }, {
  712. "default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  713. return [_hoisted_12, _hoisted_13];
  714. }),
  715. _: 1
  716. /* STABLE */
  717. }, 8
  718. /* PROPS */
  719. , ["href"])), [[_directive_tooltip, {
  720. value: 'Ubah Profil',
  721. "class": 'layout-topbar-menu-tooltip'
  722. }, void 0, {
  723. bottom: true
  724. }]])]), (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"], {
  725. href: _ctx.route('logout'),
  726. as: "button",
  727. method: "post",
  728. "class": "p-link layout-topbar-button"
  729. }, {
  730. "default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  731. return [_hoisted_14, _hoisted_15];
  732. }),
  733. _: 1
  734. /* STABLE */
  735. }, 8
  736. /* PROPS */
  737. , ["href"])), [[_directive_tooltip, {
  738. value: 'Keluar',
  739. "class": 'layout-topbar-menu-tooltip'
  740. }, void 0, {
  741. bottom: true
  742. }]])])])]);
  743. }
  744. /***/ }),
  745. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/layouts/DashboardLayout.vue?vue&type=template&id=549bf5ac&scoped=true":
  746. /*!**********************************************************************************************************************************************************************************************************************************************************************************************!*\
  747. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/layouts/DashboardLayout.vue?vue&type=template&id=549bf5ac&scoped=true ***!
  748. \**********************************************************************************************************************************************************************************************************************************************************************************************/
  749. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  750. "use strict";
  751. __webpack_require__.r(__webpack_exports__);
  752. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  753. /* harmony export */ "render": () => (/* binding */ render)
  754. /* harmony export */ });
  755. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  756. var _withScopeId = function _withScopeId(n) {
  757. return (0,vue__WEBPACK_IMPORTED_MODULE_0__.pushScopeId)("data-v-549bf5ac"), n = n(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.popScopeId)(), n;
  758. };
  759. var _hoisted_1 = {
  760. "class": "layout-sidebar"
  761. };
  762. var _hoisted_2 = {
  763. "class": "layout-main-container"
  764. };
  765. var _hoisted_3 = {
  766. "class": "layout-main"
  767. };
  768. var _hoisted_4 = /*#__PURE__*/_withScopeId(function () {
  769. return /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("div", {
  770. "class": "layout-footer"
  771. }, [/*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createTextVNode)(" Developed by "), /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("a", {
  772. href: "https://dijitalcode.com",
  773. target: "_blank",
  774. "class": "font-medium ml-2"
  775. }, "DijitalCODE")], -1
  776. /* HOISTED */
  777. );
  778. });
  779. var _hoisted_5 = {
  780. key: 0,
  781. "class": "layout-mask p-component-overlay"
  782. };
  783. function render(_ctx, _cache, $props, $setup, $data, $options) {
  784. return (0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)("div", {
  785. "class": (0,vue__WEBPACK_IMPORTED_MODULE_0__.normalizeClass)($setup.containerClass),
  786. onClick: $setup.onWrapperClick
  787. }, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)($setup["AppTopBar"], {
  788. onMenuToggle: $setup.onMenuToggle
  789. }), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("div", _hoisted_1, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)($setup["AppSidebar"], {
  790. menu: $setup.menu[_ctx.$page.props.auth.user.role_id]
  791. }, null, 8
  792. /* PROPS */
  793. , ["menu"])]), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("div", _hoisted_2, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("div", _hoisted_3, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)($setup["AppMessage"]), (0,vue__WEBPACK_IMPORTED_MODULE_0__.renderSlot)(_ctx.$slots, "default", {}, undefined, true)]), _hoisted_4]), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(vue__WEBPACK_IMPORTED_MODULE_0__.Transition, {
  794. name: "layout-mask"
  795. }, {
  796. "default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  797. return [$setup.mobileMenuActive ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)("div", _hoisted_5)) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true)];
  798. }),
  799. _: 1
  800. /* STABLE */
  801. })], 2
  802. /* CLASS */
  803. );
  804. }
  805. /***/ }),
  806. /***/ "./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/Customers/Index.vue?vue&type=template&id=2f43e3ff":
  807. /*!********************************************************************************************************************************************************************************************************************************************************************************!*\
  808. !*** ./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/Customers/Index.vue?vue&type=template&id=2f43e3ff ***!
  809. \********************************************************************************************************************************************************************************************************************************************************************************/
  810. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  811. "use strict";
  812. __webpack_require__.r(__webpack_exports__);
  813. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  814. /* harmony export */ "render": () => (/* binding */ render)
  815. /* harmony export */ });
  816. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  817. var _hoisted_1 = /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("h1", null, "Pelanggan", -1
  818. /* HOISTED */
  819. );
  820. var _hoisted_2 = {
  821. "class": "grid"
  822. };
  823. var _hoisted_3 = {
  824. "class": "col-12 md:col-8"
  825. };
  826. var _hoisted_4 = {
  827. "class": "flex align-items-center"
  828. };
  829. var _hoisted_5 = {
  830. "class": "col-12 md:col-4 flex flex-column md:flex-row justify-content-end"
  831. };
  832. function render(_ctx, _cache, $props, $setup, $data, $options) {
  833. var _component_InputText = (0,vue__WEBPACK_IMPORTED_MODULE_0__.resolveComponent)("InputText");
  834. var _component_Column = (0,vue__WEBPACK_IMPORTED_MODULE_0__.resolveComponent)("Column");
  835. var _component_DataTable = (0,vue__WEBPACK_IMPORTED_MODULE_0__.resolveComponent)("DataTable");
  836. var _directive_tooltip = (0,vue__WEBPACK_IMPORTED_MODULE_0__.resolveDirective)("tooltip");
  837. 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"], {
  838. title: "Daftar Pelanggan"
  839. }), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)($setup["DashboardLayout"], null, {
  840. "default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  841. return [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(_component_DataTable, {
  842. responsiveLayout: "scroll",
  843. columnResizeMode: "expand",
  844. value: $props.customers.data,
  845. rowHover: true,
  846. stripedRows: true
  847. }, {
  848. header: (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  849. 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)(_component_InputText, {
  850. "class": "w-full md:w-27rem",
  851. placeholder: "cari, contoh: tina, 08xx, 0x",
  852. modelValue: $setup.search,
  853. "onUpdate:modelValue": _cache[0] || (_cache[0] = function ($event) {
  854. return $setup.search = $event;
  855. })
  856. }, null, 8
  857. /* PROPS */
  858. , ["modelValue"])])]), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("div", _hoisted_5, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)($setup["AppButtonLink"], {
  859. label: "Tambah Pelanggan",
  860. icon: "pi pi-pencil",
  861. "class": "p-button-outlined",
  862. href: _ctx.route('customers.create')
  863. }, null, 8
  864. /* PROPS */
  865. , ["href"])])])];
  866. }),
  867. "default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  868. 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.tableHeader, function (value) {
  869. return (0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createBlock)(_component_Column, {
  870. field: value.field,
  871. header: value.header,
  872. key: value.field
  873. }, null, 8
  874. /* PROPS */
  875. , ["field", "header"]);
  876. }), 128
  877. /* KEYED_FRAGMENT */
  878. )), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(_component_Column, null, {
  879. body: (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function (_ref) {
  880. var data = _ref.data;
  881. return [(0,vue__WEBPACK_IMPORTED_MODULE_0__.withDirectives)((0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)($setup["AppButtonLink"], {
  882. icon: "pi pi-pencil",
  883. "class": "p-button-icon-only p-button-rounded p-button-text",
  884. href: _ctx.route('customers.edit', data.id)
  885. }, null, 8
  886. /* PROPS */
  887. , ["href"]), [[_directive_tooltip, 'Ubah Pelanggan', void 0, {
  888. bottom: true
  889. }]])];
  890. }),
  891. _: 1
  892. /* STABLE */
  893. })];
  894. }),
  895. _: 1
  896. /* STABLE */
  897. }, 8
  898. /* PROPS */
  899. , ["value"]), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)($setup["AppPagination"], {
  900. links: $props.customers.links
  901. }, null, 8
  902. /* PROPS */
  903. , ["links"])];
  904. }),
  905. _: 1
  906. /* STABLE */
  907. })], 64
  908. /* STABLE_FRAGMENT */
  909. );
  910. }
  911. /***/ }),
  912. /***/ "./resources/js/components/useSearchText.js":
  913. /*!**************************************************!*\
  914. !*** ./resources/js/components/useSearchText.js ***!
  915. \**************************************************/
  916. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  917. "use strict";
  918. __webpack_require__.r(__webpack_exports__);
  919. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  920. /* harmony export */ "useSearchText": () => (/* binding */ useSearchText)
  921. /* harmony export */ });
  922. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  923. function useSearchText(props) {
  924. var search = (0,vue__WEBPACK_IMPORTED_MODULE_0__.ref)(props.initialSearch);
  925. return {
  926. search: search
  927. };
  928. }
  929. /***/ }),
  930. /***/ "./resources/js/pages/Customers/tableHeader.js":
  931. /*!*****************************************************!*\
  932. !*** ./resources/js/pages/Customers/tableHeader.js ***!
  933. \*****************************************************/
  934. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  935. "use strict";
  936. __webpack_require__.r(__webpack_exports__);
  937. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  938. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  939. /* harmony export */ });
  940. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ([{
  941. field: 'name',
  942. header: 'Nama'
  943. }, {
  944. field: 'address',
  945. header: 'Alamat'
  946. }, {
  947. field: 'phone',
  948. header: 'No HP'
  949. }, {
  950. field: 'npwp',
  951. header: 'NPWP'
  952. }]);
  953. /***/ }),
  954. /***/ "./resources/js/utils/menu.js":
  955. /*!************************************!*\
  956. !*** ./resources/js/utils/menu.js ***!
  957. \************************************/
  958. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  959. "use strict";
  960. __webpack_require__.r(__webpack_exports__);
  961. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  962. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  963. /* harmony export */ });
  964. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
  965. // Admin
  966. 1: [{
  967. label: 'Home',
  968. items: [{
  969. label: 'Dashboard',
  970. icon: 'pi pi-chart-bar',
  971. to: '/dashboards',
  972. component: 'Dashboards/Index'
  973. }]
  974. }, {
  975. label: 'Laporan',
  976. items: []
  977. }, {
  978. label: 'Master',
  979. items: [{
  980. label: 'User',
  981. icon: 'pi pi-user',
  982. to: '/users',
  983. component: 'Users/Index'
  984. }]
  985. }],
  986. // Supervisor
  987. 2: [{
  988. label: 'Home',
  989. items: [{
  990. label: 'Dashboard',
  991. icon: 'pi pi-chart-bar',
  992. to: '/dashboards',
  993. component: 'Dashboards/Index'
  994. }]
  995. }, {
  996. label: 'Master',
  997. items: [{
  998. label: 'Pelanggan',
  999. icon: 'pi pi-users',
  1000. to: '/customers',
  1001. component: 'Customers/Index'
  1002. }, {
  1003. label: 'Pembelian',
  1004. icon: 'pi pi-shopping-cart',
  1005. to: '/purchases',
  1006. component: 'Purchases/Index'
  1007. }, {
  1008. label: 'Penjualan',
  1009. icon: 'pi pi-tag',
  1010. to: '/sales',
  1011. component: 'Sales/Index'
  1012. }, {
  1013. label: 'Produk',
  1014. icon: 'pi pi-th-large',
  1015. to: '/products',
  1016. component: 'Products/Index'
  1017. }]
  1018. }],
  1019. // Operator
  1020. 3: [{
  1021. label: 'Home',
  1022. items: [{
  1023. label: 'Dashboard',
  1024. icon: 'pi pi-chart-bar',
  1025. to: '/dashboards',
  1026. component: 'Dashboards/Index'
  1027. }]
  1028. }, {
  1029. label: 'Master',
  1030. items: [{
  1031. label: 'Supplier',
  1032. icon: 'pi pi-shopping-cart',
  1033. to: '/suppliers',
  1034. component: 'Suppliers/Index'
  1035. }, {
  1036. label: 'Stok Barang',
  1037. icon: 'pi pi-box',
  1038. to: '/stock-products',
  1039. component: 'StockProducts/Index'
  1040. }]
  1041. }]
  1042. });
  1043. /***/ }),
  1044. /***/ "./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppSidebar.vue?vue&type=style&index=0&id=22a4e926&lang=scss&scoped=true":
  1045. /*!************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  1046. !*** ./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppSidebar.vue?vue&type=style&index=0&id=22a4e926&lang=scss&scoped=true ***!
  1047. \************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  1048. /***/ ((module, __webpack_exports__, __webpack_require__) => {
  1049. "use strict";
  1050. __webpack_require__.r(__webpack_exports__);
  1051. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  1052. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  1053. /* harmony export */ });
  1054. /* 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");
  1055. /* 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__);
  1056. // Imports
  1057. var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_0___default()(function(i){return i[1]});
  1058. // Module
  1059. ___CSS_LOADER_EXPORT___.push([module.id, ".layout-menu[data-v-22a4e926] {\n list-style-type: none;\n margin: 0;\n padding: 0;\n}", ""]);
  1060. // Exports
  1061. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);
  1062. /***/ }),
  1063. /***/ "./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppSubSidebar.vue?vue&type=style&index=0&id=0addd9bc&lang=scss&scoped=true":
  1064. /*!***************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  1065. !*** ./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppSubSidebar.vue?vue&type=style&index=0&id=0addd9bc&lang=scss&scoped=true ***!
  1066. \***************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  1067. /***/ ((module, __webpack_exports__, __webpack_require__) => {
  1068. "use strict";
  1069. __webpack_require__.r(__webpack_exports__);
  1070. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  1071. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  1072. /* harmony export */ });
  1073. /* 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");
  1074. /* 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__);
  1075. // Imports
  1076. var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_0___default()(function(i){return i[1]});
  1077. // Module
  1078. ___CSS_LOADER_EXPORT___.push([module.id, "li.layout-menuitem-category[data-v-0addd9bc] {\n margin-top: 0.75rem;\n}\nli.layout-menuitem-category[data-v-0addd9bc]:first-child {\n margin-top: 0;\n}\nli .layout-menuitem-root-text[data-v-0addd9bc] {\n text-transform: uppercase;\n color: var(--surface-900);\n font-weight: 600;\n margin-bottom: 0.5rem;\n font-size: 0.875rem;\n}\nli a[data-v-0addd9bc] {\n cursor: pointer;\n text-decoration: none;\n display: flex;\n align-items: center;\n color: var(--text-color);\n transition: color 0.2s;\n border-radius: 12px;\n padding: 0.75rem 1rem;\n transition: background-color 0.15s;\n}\nli a span[data-v-0addd9bc] {\n margin-left: 0.5rem;\n}\nli a .menuitem-toggle-icon[data-v-0addd9bc] {\n margin-left: auto;\n}\nli a[data-v-0addd9bc]:focus {\n outline: 0 none;\n outline-offset: 0;\n transition: box-shadow 0.2s;\n box-shadow: inset var(--focus-ring);\n}\nli a[data-v-0addd9bc]:hover {\n background-color: var(--surface-hover);\n}\nli a.router-link-exact-active[data-v-0addd9bc] {\n font-weight: 700;\n color: var(--primary-color);\n}\nli ul[data-v-0addd9bc] {\n list-style-type: none;\n margin: 0;\n padding: 0;\n}\nli ul ul[data-v-0addd9bc] {\n padding-left: 1rem;\n}", ""]);
  1079. // Exports
  1080. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);
  1081. /***/ }),
  1082. /***/ "./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppTopBar.vue?vue&type=style&index=0&id=42bf62a4&lang=scss&scoped=true":
  1083. /*!***********************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  1084. !*** ./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppTopBar.vue?vue&type=style&index=0&id=42bf62a4&lang=scss&scoped=true ***!
  1085. \***********************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  1086. /***/ ((module, __webpack_exports__, __webpack_require__) => {
  1087. "use strict";
  1088. __webpack_require__.r(__webpack_exports__);
  1089. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  1090. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  1091. /* harmony export */ });
  1092. /* 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");
  1093. /* 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__);
  1094. // Imports
  1095. var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_0___default()(function(i){return i[1]});
  1096. // Module
  1097. ___CSS_LOADER_EXPORT___.push([module.id, ".layout-topbar[data-v-42bf62a4] {\n position: fixed;\n height: 5rem;\n z-index: 994;\n left: 0;\n top: 0;\n width: 100%;\n padding: 0 2rem;\n background-color: var(--surface-card);\n transition: left 0.2s;\n display: flex;\n align-items: center;\n box-shadow: 0px 3px 5px rgba(0, 0, 0, 0.02), 0px 0px 2px rgba(0, 0, 0, 0.05), 0px 1px 4px rgba(0, 0, 0, 0.08);\n}\n.layout-topbar .layout-topbar-logo[data-v-42bf62a4] {\n display: flex;\n align-items: center;\n color: var(--surface-900);\n font-size: 1.5rem;\n font-weight: 500;\n width: 300px;\n border-radius: 12px;\n}\n.layout-topbar .layout-topbar-logo img[data-v-42bf62a4] {\n height: 2.5rem;\n margin-right: 0.5rem;\n}\n.layout-topbar .layout-topbar-logo[data-v-42bf62a4]:focus {\n outline: 0 none;\n outline-offset: 0;\n transition: box-shadow 0.2s;\n box-shadow: var(--focus-ring);\n}\n.layout-topbar .layout-topbar-button[data-v-42bf62a4] {\n display: inline-flex;\n justify-content: center;\n align-items: center;\n position: relative;\n color: var(--text-color-secondary);\n border-radius: 50%;\n width: 3rem;\n height: 3rem;\n cursor: pointer;\n transition: background-color 0.2s;\n}\n.layout-topbar .layout-topbar-button[data-v-42bf62a4]:hover {\n color: var(--text-color);\n background-color: var(--surface-hover);\n}\n.layout-topbar .layout-topbar-button[data-v-42bf62a4]:focus {\n outline: 0 none;\n outline-offset: 0;\n transition: box-shadow 0.2s;\n box-shadow: var(--focus-ring);\n}\n.layout-topbar .layout-topbar-button i[data-v-42bf62a4] {\n font-size: 1.5rem;\n}\n.layout-topbar .layout-topbar-button span[data-v-42bf62a4] {\n font-size: 1rem;\n display: none;\n}\n.layout-topbar .layout-menu-button[data-v-42bf62a4] {\n margin-left: 2rem;\n}\n.layout-topbar .layout-topbar-menu-button[data-v-42bf62a4] {\n display: none;\n}\n.layout-topbar .layout-topbar-menu-button i[data-v-42bf62a4] {\n font-size: 1.25rem;\n}\n.layout-topbar .layout-topbar-menu[data-v-42bf62a4] {\n margin: 0 0 0 auto;\n padding: 0;\n list-style: none;\n display: flex;\n}\n.layout-topbar .layout-topbar-menu .layout-topbar-button[data-v-42bf62a4] {\n margin-left: 1rem;\n}\n@media (max-width: 991px) {\n.layout-topbar[data-v-42bf62a4] {\n justify-content: space-between;\n}\n.layout-topbar .layout-topbar-logo[data-v-42bf62a4] {\n width: auto;\n order: 2;\n}\n.layout-topbar .layout-menu-button[data-v-42bf62a4] {\n margin-left: 0;\n order: 1;\n}\n.layout-topbar .layout-topbar-menu-button[data-v-42bf62a4] {\n display: inline-flex;\n margin-left: 0;\n order: 3;\n}\n.layout-topbar .layout-topbar-menu[data-v-42bf62a4] {\n margin-left: 0;\n position: absolute;\n flex-direction: column;\n background-color: var(--surface-overlay);\n box-shadow: 0px 3px 5px rgba(0, 0, 0, 0.02), 0px 0px 2px rgba(0, 0, 0, 0.05), 0px 1px 4px rgba(0, 0, 0, 0.08);\n border-radius: 4px;\n padding: 1rem;\n right: 2rem;\n top: 5.5rem;\n min-width: 15rem;\n}\n.layout-topbar .layout-topbar-menu .layout-topbar-button[data-v-42bf62a4] {\n margin-left: 0;\n display: flex;\n width: 100%;\n height: auto;\n justify-content: flex-start;\n border-radius: 12px;\n padding: 1rem;\n}\n.layout-topbar .layout-topbar-menu .layout-topbar-button i[data-v-42bf62a4] {\n font-size: 1rem;\n margin-right: 0.5rem;\n}\n.layout-topbar .layout-topbar-menu .layout-topbar-button span[data-v-42bf62a4] {\n font-weight: medium;\n display: block;\n}\n}", ""]);
  1098. // Exports
  1099. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);
  1100. /***/ }),
  1101. /***/ "./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/layouts/DashboardLayout.vue?vue&type=style&index=0&id=549bf5ac&lang=scss&scoped=true":
  1102. /*!**************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  1103. !*** ./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/layouts/DashboardLayout.vue?vue&type=style&index=0&id=549bf5ac&lang=scss&scoped=true ***!
  1104. \**************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  1105. /***/ ((module, __webpack_exports__, __webpack_require__) => {
  1106. "use strict";
  1107. __webpack_require__.r(__webpack_exports__);
  1108. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  1109. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  1110. /* harmony export */ });
  1111. /* 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");
  1112. /* 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__);
  1113. // Imports
  1114. var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_0___default()(function(i){return i[1]});
  1115. // Module
  1116. ___CSS_LOADER_EXPORT___.push([module.id, ".layout-sidebar[data-v-549bf5ac] {\n position: fixed;\n width: 300px;\n height: calc(100vh - 9rem);\n z-index: 996;\n overflow-y: auto;\n -webkit-user-select: none;\n -moz-user-select: none;\n -ms-user-select: none;\n user-select: none;\n top: 7rem;\n left: 2rem;\n transition: transform 0.2s, left 0.2s;\n background-color: var(--surface-overlay);\n border-radius: 4px;\n padding: 1.5rem;\n box-shadow: 0px 3px 5px rgba(0, 0, 0, 0.02), 0px 0px 2px rgba(0, 0, 0, 0.05), 0px 1px 4px rgba(0, 0, 0, 0.08);\n}\n.layout-main-container[data-v-549bf5ac] {\n display: flex;\n flex-direction: column;\n min-height: 100vh;\n justify-content: space-between;\n padding: 7rem 2rem 2rem 4rem;\n transition: margin-left 0.2s;\n}\n.layout-main[data-v-549bf5ac] {\n flex: 1 1 auto;\n}\n.layout-footer[data-v-549bf5ac] {\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-549bf5ac] {\n margin-left: 300px;\n}\n.layout-wrapper.layout-static-sidebar-inactive .layout-sidebar[data-v-549bf5ac] {\n transform: translateX(-100%);\n left: 0;\n}\n.layout-wrapper.layout-static-sidebar-inactive .layout-main-container[data-v-549bf5ac] {\n margin-left: 0;\n padding-left: 2rem;\n}\n.layout-wrapper .layout-mask[data-v-549bf5ac] {\n display: none;\n}\n}\n@media (max-width: 991px) {\n.layout-wrapper .layout-main-container[data-v-549bf5ac] {\n margin-left: 0;\n padding-left: 2rem;\n}\n.layout-wrapper .layout-sidebar[data-v-549bf5ac] {\n transform: translateX(-100%);\n left: 0;\n top: 0;\n height: 100vh;\n border-top-left-radius: 0;\n border-bottom-left-radius: 0;\n}\n.layout-wrapper .layout-mask[data-v-549bf5ac] {\n z-index: 995;\n background-color: var(--maskbg);\n}\n.layout-wrapper .layout-mask.layout-mask-enter-from[data-v-549bf5ac], .layout-wrapper .layout-mask.layout-mask-leave-to[data-v-549bf5ac] {\n background-color: transparent;\n}\n.layout-wrapper.layout-mobile-sidebar-active .layout-sidebar[data-v-549bf5ac] {\n transform: translateX(0);\n}\n.layout-wrapper.layout-mobile-sidebar-active .layout-mask[data-v-549bf5ac] {\n display: block;\n}\n}", ""]);
  1117. // Exports
  1118. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);
  1119. /***/ }),
  1120. /***/ "./node_modules/lodash/lodash.js":
  1121. /*!***************************************!*\
  1122. !*** ./node_modules/lodash/lodash.js ***!
  1123. \***************************************/
  1124. /***/ (function(module, exports, __webpack_require__) {
  1125. /* module decorator */ module = __webpack_require__.nmd(module);
  1126. var __WEBPACK_AMD_DEFINE_RESULT__;/**
  1127. * @license
  1128. * Lodash <https://lodash.com/>
  1129. * Copyright OpenJS Foundation and other contributors <https://openjsf.org/>
  1130. * Released under MIT license <https://lodash.com/license>
  1131. * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
  1132. * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
  1133. */
  1134. ;(function() {
  1135. /** Used as a safe reference for `undefined` in pre-ES5 environments. */
  1136. var undefined;
  1137. /** Used as the semantic version number. */
  1138. var VERSION = '4.17.21';
  1139. /** Used as the size to enable large array optimizations. */
  1140. var LARGE_ARRAY_SIZE = 200;
  1141. /** Error message constants. */
  1142. var CORE_ERROR_TEXT = 'Unsupported core-js use. Try https://npms.io/search?q=ponyfill.',
  1143. FUNC_ERROR_TEXT = 'Expected a function',
  1144. INVALID_TEMPL_VAR_ERROR_TEXT = 'Invalid `variable` option passed into `_.template`';
  1145. /** Used to stand-in for `undefined` hash values. */
  1146. var HASH_UNDEFINED = '__lodash_hash_undefined__';
  1147. /** Used as the maximum memoize cache size. */
  1148. var MAX_MEMOIZE_SIZE = 500;
  1149. /** Used as the internal argument placeholder. */
  1150. var PLACEHOLDER = '__lodash_placeholder__';
  1151. /** Used to compose bitmasks for cloning. */
  1152. var CLONE_DEEP_FLAG = 1,
  1153. CLONE_FLAT_FLAG = 2,
  1154. CLONE_SYMBOLS_FLAG = 4;
  1155. /** Used to compose bitmasks for value comparisons. */
  1156. var COMPARE_PARTIAL_FLAG = 1,
  1157. COMPARE_UNORDERED_FLAG = 2;
  1158. /** Used to compose bitmasks for function metadata. */
  1159. var WRAP_BIND_FLAG = 1,
  1160. WRAP_BIND_KEY_FLAG = 2,
  1161. WRAP_CURRY_BOUND_FLAG = 4,
  1162. WRAP_CURRY_FLAG = 8,
  1163. WRAP_CURRY_RIGHT_FLAG = 16,
  1164. WRAP_PARTIAL_FLAG = 32,
  1165. WRAP_PARTIAL_RIGHT_FLAG = 64,
  1166. WRAP_ARY_FLAG = 128,
  1167. WRAP_REARG_FLAG = 256,
  1168. WRAP_FLIP_FLAG = 512;
  1169. /** Used as default options for `_.truncate`. */
  1170. var DEFAULT_TRUNC_LENGTH = 30,
  1171. DEFAULT_TRUNC_OMISSION = '...';
  1172. /** Used to detect hot functions by number of calls within a span of milliseconds. */
  1173. var HOT_COUNT = 800,
  1174. HOT_SPAN = 16;
  1175. /** Used to indicate the type of lazy iteratees. */
  1176. var LAZY_FILTER_FLAG = 1,
  1177. LAZY_MAP_FLAG = 2,
  1178. LAZY_WHILE_FLAG = 3;
  1179. /** Used as references for various `Number` constants. */
  1180. var INFINITY = 1 / 0,
  1181. MAX_SAFE_INTEGER = 9007199254740991,
  1182. MAX_INTEGER = 1.7976931348623157e+308,
  1183. NAN = 0 / 0;
  1184. /** Used as references for the maximum length and index of an array. */
  1185. var MAX_ARRAY_LENGTH = 4294967295,
  1186. MAX_ARRAY_INDEX = MAX_ARRAY_LENGTH - 1,
  1187. HALF_MAX_ARRAY_LENGTH = MAX_ARRAY_LENGTH >>> 1;
  1188. /** Used to associate wrap methods with their bit flags. */
  1189. var wrapFlags = [
  1190. ['ary', WRAP_ARY_FLAG],
  1191. ['bind', WRAP_BIND_FLAG],
  1192. ['bindKey', WRAP_BIND_KEY_FLAG],
  1193. ['curry', WRAP_CURRY_FLAG],
  1194. ['curryRight', WRAP_CURRY_RIGHT_FLAG],
  1195. ['flip', WRAP_FLIP_FLAG],
  1196. ['partial', WRAP_PARTIAL_FLAG],
  1197. ['partialRight', WRAP_PARTIAL_RIGHT_FLAG],
  1198. ['rearg', WRAP_REARG_FLAG]
  1199. ];
  1200. /** `Object#toString` result references. */
  1201. var argsTag = '[object Arguments]',
  1202. arrayTag = '[object Array]',
  1203. asyncTag = '[object AsyncFunction]',
  1204. boolTag = '[object Boolean]',
  1205. dateTag = '[object Date]',
  1206. domExcTag = '[object DOMException]',
  1207. errorTag = '[object Error]',
  1208. funcTag = '[object Function]',
  1209. genTag = '[object GeneratorFunction]',
  1210. mapTag = '[object Map]',
  1211. numberTag = '[object Number]',
  1212. nullTag = '[object Null]',
  1213. objectTag = '[object Object]',
  1214. promiseTag = '[object Promise]',
  1215. proxyTag = '[object Proxy]',
  1216. regexpTag = '[object RegExp]',
  1217. setTag = '[object Set]',
  1218. stringTag = '[object String]',
  1219. symbolTag = '[object Symbol]',
  1220. undefinedTag = '[object Undefined]',
  1221. weakMapTag = '[object WeakMap]',
  1222. weakSetTag = '[object WeakSet]';
  1223. var arrayBufferTag = '[object ArrayBuffer]',
  1224. dataViewTag = '[object DataView]',
  1225. float32Tag = '[object Float32Array]',
  1226. float64Tag = '[object Float64Array]',
  1227. int8Tag = '[object Int8Array]',
  1228. int16Tag = '[object Int16Array]',
  1229. int32Tag = '[object Int32Array]',
  1230. uint8Tag = '[object Uint8Array]',
  1231. uint8ClampedTag = '[object Uint8ClampedArray]',
  1232. uint16Tag = '[object Uint16Array]',
  1233. uint32Tag = '[object Uint32Array]';
  1234. /** Used to match empty string literals in compiled template source. */
  1235. var reEmptyStringLeading = /\b__p \+= '';/g,
  1236. reEmptyStringMiddle = /\b(__p \+=) '' \+/g,
  1237. reEmptyStringTrailing = /(__e\(.*?\)|\b__t\)) \+\n'';/g;
  1238. /** Used to match HTML entities and HTML characters. */
  1239. var reEscapedHtml = /&(?:amp|lt|gt|quot|#39);/g,
  1240. reUnescapedHtml = /[&<>"']/g,
  1241. reHasEscapedHtml = RegExp(reEscapedHtml.source),
  1242. reHasUnescapedHtml = RegExp(reUnescapedHtml.source);
  1243. /** Used to match template delimiters. */
  1244. var reEscape = /<%-([\s\S]+?)%>/g,
  1245. reEvaluate = /<%([\s\S]+?)%>/g,
  1246. reInterpolate = /<%=([\s\S]+?)%>/g;
  1247. /** Used to match property names within property paths. */
  1248. var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,
  1249. reIsPlainProp = /^\w*$/,
  1250. rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g;
  1251. /**
  1252. * Used to match `RegExp`
  1253. * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).
  1254. */
  1255. var reRegExpChar = /[\\^$.*+?()[\]{}|]/g,
  1256. reHasRegExpChar = RegExp(reRegExpChar.source);
  1257. /** Used to match leading whitespace. */
  1258. var reTrimStart = /^\s+/;
  1259. /** Used to match a single whitespace character. */
  1260. var reWhitespace = /\s/;
  1261. /** Used to match wrap detail comments. */
  1262. var reWrapComment = /\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,
  1263. reWrapDetails = /\{\n\/\* \[wrapped with (.+)\] \*/,
  1264. reSplitDetails = /,? & /;
  1265. /** Used to match words composed of alphanumeric characters. */
  1266. var reAsciiWord = /[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;
  1267. /**
  1268. * Used to validate the `validate` option in `_.template` variable.
  1269. *
  1270. * Forbids characters which could potentially change the meaning of the function argument definition:
  1271. * - "()," (modification of function parameters)
  1272. * - "=" (default value)
  1273. * - "[]{}" (destructuring of function parameters)
  1274. * - "/" (beginning of a comment)
  1275. * - whitespace
  1276. */
  1277. var reForbiddenIdentifierChars = /[()=,{}\[\]\/\s]/;
  1278. /** Used to match backslashes in property paths. */
  1279. var reEscapeChar = /\\(\\)?/g;
  1280. /**
  1281. * Used to match
  1282. * [ES template delimiters](http://ecma-international.org/ecma-262/7.0/#sec-template-literal-lexical-components).
  1283. */
  1284. var reEsTemplate = /\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g;
  1285. /** Used to match `RegExp` flags from their coerced string values. */
  1286. var reFlags = /\w*$/;
  1287. /** Used to detect bad signed hexadecimal string values. */
  1288. var reIsBadHex = /^[-+]0x[0-9a-f]+$/i;
  1289. /** Used to detect binary string values. */
  1290. var reIsBinary = /^0b[01]+$/i;
  1291. /** Used to detect host constructors (Safari). */
  1292. var reIsHostCtor = /^\[object .+?Constructor\]$/;
  1293. /** Used to detect octal string values. */
  1294. var reIsOctal = /^0o[0-7]+$/i;
  1295. /** Used to detect unsigned integer values. */
  1296. var reIsUint = /^(?:0|[1-9]\d*)$/;
  1297. /** Used to match Latin Unicode letters (excluding mathematical operators). */
  1298. var reLatin = /[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g;
  1299. /** Used to ensure capturing order of template delimiters. */
  1300. var reNoMatch = /($^)/;
  1301. /** Used to match unescaped characters in compiled string literals. */
  1302. var reUnescapedString = /['\n\r\u2028\u2029\\]/g;
  1303. /** Used to compose unicode character classes. */
  1304. var rsAstralRange = '\\ud800-\\udfff',
  1305. rsComboMarksRange = '\\u0300-\\u036f',
  1306. reComboHalfMarksRange = '\\ufe20-\\ufe2f',
  1307. rsComboSymbolsRange = '\\u20d0-\\u20ff',
  1308. rsComboRange = rsComboMarksRange + reComboHalfMarksRange + rsComboSymbolsRange,
  1309. rsDingbatRange = '\\u2700-\\u27bf',
  1310. rsLowerRange = 'a-z\\xdf-\\xf6\\xf8-\\xff',
  1311. rsMathOpRange = '\\xac\\xb1\\xd7\\xf7',
  1312. rsNonCharRange = '\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf',
  1313. rsPunctuationRange = '\\u2000-\\u206f',
  1314. 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',
  1315. rsUpperRange = 'A-Z\\xc0-\\xd6\\xd8-\\xde',
  1316. rsVarRange = '\\ufe0e\\ufe0f',
  1317. rsBreakRange = rsMathOpRange + rsNonCharRange + rsPunctuationRange + rsSpaceRange;
  1318. /** Used to compose unicode capture groups. */
  1319. var rsApos = "['\u2019]",
  1320. rsAstral = '[' + rsAstralRange + ']',
  1321. rsBreak = '[' + rsBreakRange + ']',
  1322. rsCombo = '[' + rsComboRange + ']',
  1323. rsDigits = '\\d+',
  1324. rsDingbat = '[' + rsDingbatRange + ']',
  1325. rsLower = '[' + rsLowerRange + ']',
  1326. rsMisc = '[^' + rsAstralRange + rsBreakRange + rsDigits + rsDingbatRange + rsLowerRange + rsUpperRange + ']',
  1327. rsFitz = '\\ud83c[\\udffb-\\udfff]',
  1328. rsModifier = '(?:' + rsCombo + '|' + rsFitz + ')',
  1329. rsNonAstral = '[^' + rsAstralRange + ']',
  1330. rsRegional = '(?:\\ud83c[\\udde6-\\uddff]){2}',
  1331. rsSurrPair = '[\\ud800-\\udbff][\\udc00-\\udfff]',
  1332. rsUpper = '[' + rsUpperRange + ']',
  1333. rsZWJ = '\\u200d';
  1334. /** Used to compose unicode regexes. */
  1335. var rsMiscLower = '(?:' + rsLower + '|' + rsMisc + ')',
  1336. rsMiscUpper = '(?:' + rsUpper + '|' + rsMisc + ')',
  1337. rsOptContrLower = '(?:' + rsApos + '(?:d|ll|m|re|s|t|ve))?',
  1338. rsOptContrUpper = '(?:' + rsApos + '(?:D|LL|M|RE|S|T|VE))?',
  1339. reOptMod = rsModifier + '?',
  1340. rsOptVar = '[' + rsVarRange + ']?',
  1341. rsOptJoin = '(?:' + rsZWJ + '(?:' + [rsNonAstral, rsRegional, rsSurrPair].join('|') + ')' + rsOptVar + reOptMod + ')*',
  1342. rsOrdLower = '\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])',
  1343. rsOrdUpper = '\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])',
  1344. rsSeq = rsOptVar + reOptMod + rsOptJoin,
  1345. rsEmoji = '(?:' + [rsDingbat, rsRegional, rsSurrPair].join('|') + ')' + rsSeq,
  1346. rsSymbol = '(?:' + [rsNonAstral + rsCombo + '?', rsCombo, rsRegional, rsSurrPair, rsAstral].join('|') + ')';
  1347. /** Used to match apostrophes. */
  1348. var reApos = RegExp(rsApos, 'g');
  1349. /**
  1350. * Used to match [combining diacritical marks](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks) and
  1351. * [combining diacritical marks for symbols](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks_for_Symbols).
  1352. */
  1353. var reComboMark = RegExp(rsCombo, 'g');
  1354. /** Used to match [string symbols](https://mathiasbynens.be/notes/javascript-unicode). */
  1355. var reUnicode = RegExp(rsFitz + '(?=' + rsFitz + ')|' + rsSymbol + rsSeq, 'g');
  1356. /** Used to match complex or compound words. */
  1357. var reUnicodeWord = RegExp([
  1358. rsUpper + '?' + rsLower + '+' + rsOptContrLower + '(?=' + [rsBreak, rsUpper, '$'].join('|') + ')',
  1359. rsMiscUpper + '+' + rsOptContrUpper + '(?=' + [rsBreak, rsUpper + rsMiscLower, '$'].join('|') + ')',
  1360. rsUpper + '?' + rsMiscLower + '+' + rsOptContrLower,
  1361. rsUpper + '+' + rsOptContrUpper,
  1362. rsOrdUpper,
  1363. rsOrdLower,
  1364. rsDigits,
  1365. rsEmoji
  1366. ].join('|'), 'g');
  1367. /** 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/). */
  1368. var reHasUnicode = RegExp('[' + rsZWJ + rsAstralRange + rsComboRange + rsVarRange + ']');
  1369. /** Used to detect strings that need a more robust regexp to match words. */
  1370. 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 ]/;
  1371. /** Used to assign default `context` object properties. */
  1372. var contextProps = [
  1373. 'Array', 'Buffer', 'DataView', 'Date', 'Error', 'Float32Array', 'Float64Array',
  1374. 'Function', 'Int8Array', 'Int16Array', 'Int32Array', 'Map', 'Math', 'Object',
  1375. 'Promise', 'RegExp', 'Set', 'String', 'Symbol', 'TypeError', 'Uint8Array',
  1376. 'Uint8ClampedArray', 'Uint16Array', 'Uint32Array', 'WeakMap',
  1377. '_', 'clearTimeout', 'isFinite', 'parseInt', 'setTimeout'
  1378. ];
  1379. /** Used to make template sourceURLs easier to identify. */
  1380. var templateCounter = -1;
  1381. /** Used to identify `toStringTag` values of typed arrays. */
  1382. var typedArrayTags = {};
  1383. typedArrayTags[float32Tag] = typedArrayTags[float64Tag] =
  1384. typedArrayTags[int8Tag] = typedArrayTags[int16Tag] =
  1385. typedArrayTags[int32Tag] = typedArrayTags[uint8Tag] =
  1386. typedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] =
  1387. typedArrayTags[uint32Tag] = true;
  1388. typedArrayTags[argsTag] = typedArrayTags[arrayTag] =
  1389. typedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] =
  1390. typedArrayTags[dataViewTag] = typedArrayTags[dateTag] =
  1391. typedArrayTags[errorTag] = typedArrayTags[funcTag] =
  1392. typedArrayTags[mapTag] = typedArrayTags[numberTag] =
  1393. typedArrayTags[objectTag] = typedArrayTags[regexpTag] =
  1394. typedArrayTags[setTag] = typedArrayTags[stringTag] =
  1395. typedArrayTags[weakMapTag] = false;
  1396. /** Used to identify `toStringTag` values supported by `_.clone`. */
  1397. var cloneableTags = {};
  1398. cloneableTags[argsTag] = cloneableTags[arrayTag] =
  1399. cloneableTags[arrayBufferTag] = cloneableTags[dataViewTag] =
  1400. cloneableTags[boolTag] = cloneableTags[dateTag] =
  1401. cloneableTags[float32Tag] = cloneableTags[float64Tag] =
  1402. cloneableTags[int8Tag] = cloneableTags[int16Tag] =
  1403. cloneableTags[int32Tag] = cloneableTags[mapTag] =
  1404. cloneableTags[numberTag] = cloneableTags[objectTag] =
  1405. cloneableTags[regexpTag] = cloneableTags[setTag] =
  1406. cloneableTags[stringTag] = cloneableTags[symbolTag] =
  1407. cloneableTags[uint8Tag] = cloneableTags[uint8ClampedTag] =
  1408. cloneableTags[uint16Tag] = cloneableTags[uint32Tag] = true;
  1409. cloneableTags[errorTag] = cloneableTags[funcTag] =
  1410. cloneableTags[weakMapTag] = false;
  1411. /** Used to map Latin Unicode letters to basic Latin letters. */
  1412. var deburredLetters = {
  1413. // Latin-1 Supplement block.
  1414. '\xc0': 'A', '\xc1': 'A', '\xc2': 'A', '\xc3': 'A', '\xc4': 'A', '\xc5': 'A',
  1415. '\xe0': 'a', '\xe1': 'a', '\xe2': 'a', '\xe3': 'a', '\xe4': 'a', '\xe5': 'a',
  1416. '\xc7': 'C', '\xe7': 'c',
  1417. '\xd0': 'D', '\xf0': 'd',
  1418. '\xc8': 'E', '\xc9': 'E', '\xca': 'E', '\xcb': 'E',
  1419. '\xe8': 'e', '\xe9': 'e', '\xea': 'e', '\xeb': 'e',
  1420. '\xcc': 'I', '\xcd': 'I', '\xce': 'I', '\xcf': 'I',
  1421. '\xec': 'i', '\xed': 'i', '\xee': 'i', '\xef': 'i',
  1422. '\xd1': 'N', '\xf1': 'n',
  1423. '\xd2': 'O', '\xd3': 'O', '\xd4': 'O', '\xd5': 'O', '\xd6': 'O', '\xd8': 'O',
  1424. '\xf2': 'o', '\xf3': 'o', '\xf4': 'o', '\xf5': 'o', '\xf6': 'o', '\xf8': 'o',
  1425. '\xd9': 'U', '\xda': 'U', '\xdb': 'U', '\xdc': 'U',
  1426. '\xf9': 'u', '\xfa': 'u', '\xfb': 'u', '\xfc': 'u',
  1427. '\xdd': 'Y', '\xfd': 'y', '\xff': 'y',
  1428. '\xc6': 'Ae', '\xe6': 'ae',
  1429. '\xde': 'Th', '\xfe': 'th',
  1430. '\xdf': 'ss',
  1431. // Latin Extended-A block.
  1432. '\u0100': 'A', '\u0102': 'A', '\u0104': 'A',
  1433. '\u0101': 'a', '\u0103': 'a', '\u0105': 'a',
  1434. '\u0106': 'C', '\u0108': 'C', '\u010a': 'C', '\u010c': 'C',
  1435. '\u0107': 'c', '\u0109': 'c', '\u010b': 'c', '\u010d': 'c',
  1436. '\u010e': 'D', '\u0110': 'D', '\u010f': 'd', '\u0111': 'd',
  1437. '\u0112': 'E', '\u0114': 'E', '\u0116': 'E', '\u0118': 'E', '\u011a': 'E',
  1438. '\u0113': 'e', '\u0115': 'e', '\u0117': 'e', '\u0119': 'e', '\u011b': 'e',
  1439. '\u011c': 'G', '\u011e': 'G', '\u0120': 'G', '\u0122': 'G',
  1440. '\u011d': 'g', '\u011f': 'g', '\u0121': 'g', '\u0123': 'g',
  1441. '\u0124': 'H', '\u0126': 'H', '\u0125': 'h', '\u0127': 'h',
  1442. '\u0128': 'I', '\u012a': 'I', '\u012c': 'I', '\u012e': 'I', '\u0130': 'I',
  1443. '\u0129': 'i', '\u012b': 'i', '\u012d': 'i', '\u012f': 'i', '\u0131': 'i',
  1444. '\u0134': 'J', '\u0135': 'j',
  1445. '\u0136': 'K', '\u0137': 'k', '\u0138': 'k',
  1446. '\u0139': 'L', '\u013b': 'L', '\u013d': 'L', '\u013f': 'L', '\u0141': 'L',
  1447. '\u013a': 'l', '\u013c': 'l', '\u013e': 'l', '\u0140': 'l', '\u0142': 'l',
  1448. '\u0143': 'N', '\u0145': 'N', '\u0147': 'N', '\u014a': 'N',
  1449. '\u0144': 'n', '\u0146': 'n', '\u0148': 'n', '\u014b': 'n',
  1450. '\u014c': 'O', '\u014e': 'O', '\u0150': 'O',
  1451. '\u014d': 'o', '\u014f': 'o', '\u0151': 'o',
  1452. '\u0154': 'R', '\u0156': 'R', '\u0158': 'R',
  1453. '\u0155': 'r', '\u0157': 'r', '\u0159': 'r',
  1454. '\u015a': 'S', '\u015c': 'S', '\u015e': 'S', '\u0160': 'S',
  1455. '\u015b': 's', '\u015d': 's', '\u015f': 's', '\u0161': 's',
  1456. '\u0162': 'T', '\u0164': 'T', '\u0166': 'T',
  1457. '\u0163': 't', '\u0165': 't', '\u0167': 't',
  1458. '\u0168': 'U', '\u016a': 'U', '\u016c': 'U', '\u016e': 'U', '\u0170': 'U', '\u0172': 'U',
  1459. '\u0169': 'u', '\u016b': 'u', '\u016d': 'u', '\u016f': 'u', '\u0171': 'u', '\u0173': 'u',
  1460. '\u0174': 'W', '\u0175': 'w',
  1461. '\u0176': 'Y', '\u0177': 'y', '\u0178': 'Y',
  1462. '\u0179': 'Z', '\u017b': 'Z', '\u017d': 'Z',
  1463. '\u017a': 'z', '\u017c': 'z', '\u017e': 'z',
  1464. '\u0132': 'IJ', '\u0133': 'ij',
  1465. '\u0152': 'Oe', '\u0153': 'oe',
  1466. '\u0149': "'n", '\u017f': 's'
  1467. };
  1468. /** Used to map characters to HTML entities. */
  1469. var htmlEscapes = {
  1470. '&': '&amp;',
  1471. '<': '&lt;',
  1472. '>': '&gt;',
  1473. '"': '&quot;',
  1474. "'": '&#39;'
  1475. };
  1476. /** Used to map HTML entities to characters. */
  1477. var htmlUnescapes = {
  1478. '&amp;': '&',
  1479. '&lt;': '<',
  1480. '&gt;': '>',
  1481. '&quot;': '"',
  1482. '&#39;': "'"
  1483. };
  1484. /** Used to escape characters for inclusion in compiled string literals. */
  1485. var stringEscapes = {
  1486. '\\': '\\',
  1487. "'": "'",
  1488. '\n': 'n',
  1489. '\r': 'r',
  1490. '\u2028': 'u2028',
  1491. '\u2029': 'u2029'
  1492. };
  1493. /** Built-in method references without a dependency on `root`. */
  1494. var freeParseFloat = parseFloat,
  1495. freeParseInt = parseInt;
  1496. /** Detect free variable `global` from Node.js. */
  1497. var freeGlobal = typeof __webpack_require__.g == 'object' && __webpack_require__.g && __webpack_require__.g.Object === Object && __webpack_require__.g;
  1498. /** Detect free variable `self`. */
  1499. var freeSelf = typeof self == 'object' && self && self.Object === Object && self;
  1500. /** Used as a reference to the global object. */
  1501. var root = freeGlobal || freeSelf || Function('return this')();
  1502. /** Detect free variable `exports`. */
  1503. var freeExports = true && exports && !exports.nodeType && exports;
  1504. /** Detect free variable `module`. */
  1505. var freeModule = freeExports && "object" == 'object' && module && !module.nodeType && module;
  1506. /** Detect the popular CommonJS extension `module.exports`. */
  1507. var moduleExports = freeModule && freeModule.exports === freeExports;
  1508. /** Detect free variable `process` from Node.js. */
  1509. var freeProcess = moduleExports && freeGlobal.process;
  1510. /** Used to access faster Node.js helpers. */
  1511. var nodeUtil = (function() {
  1512. try {
  1513. // Use `util.types` for Node.js 10+.
  1514. var types = freeModule && freeModule.require && freeModule.require('util').types;
  1515. if (types) {
  1516. return types;
  1517. }
  1518. // Legacy `process.binding('util')` for Node.js < 10.
  1519. return freeProcess && freeProcess.binding && freeProcess.binding('util');
  1520. } catch (e) {}
  1521. }());
  1522. /* Node.js helper references. */
  1523. var nodeIsArrayBuffer = nodeUtil && nodeUtil.isArrayBuffer,
  1524. nodeIsDate = nodeUtil && nodeUtil.isDate,
  1525. nodeIsMap = nodeUtil && nodeUtil.isMap,
  1526. nodeIsRegExp = nodeUtil && nodeUtil.isRegExp,
  1527. nodeIsSet = nodeUtil && nodeUtil.isSet,
  1528. nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray;
  1529. /*--------------------------------------------------------------------------*/
  1530. /**
  1531. * A faster alternative to `Function#apply`, this function invokes `func`
  1532. * with the `this` binding of `thisArg` and the arguments of `args`.
  1533. *
  1534. * @private
  1535. * @param {Function} func The function to invoke.
  1536. * @param {*} thisArg The `this` binding of `func`.
  1537. * @param {Array} args The arguments to invoke `func` with.
  1538. * @returns {*} Returns the result of `func`.
  1539. */
  1540. function apply(func, thisArg, args) {
  1541. switch (args.length) {
  1542. case 0: return func.call(thisArg);
  1543. case 1: return func.call(thisArg, args[0]);
  1544. case 2: return func.call(thisArg, args[0], args[1]);
  1545. case 3: return func.call(thisArg, args[0], args[1], args[2]);
  1546. }
  1547. return func.apply(thisArg, args);
  1548. }
  1549. /**
  1550. * A specialized version of `baseAggregator` for arrays.
  1551. *
  1552. * @private
  1553. * @param {Array} [array] The array to iterate over.
  1554. * @param {Function} setter The function to set `accumulator` values.
  1555. * @param {Function} iteratee The iteratee to transform keys.
  1556. * @param {Object} accumulator The initial aggregated object.
  1557. * @returns {Function} Returns `accumulator`.
  1558. */
  1559. function arrayAggregator(array, setter, iteratee, accumulator) {
  1560. var index = -1,
  1561. length = array == null ? 0 : array.length;
  1562. while (++index < length) {
  1563. var value = array[index];
  1564. setter(accumulator, value, iteratee(value), array);
  1565. }
  1566. return accumulator;
  1567. }
  1568. /**
  1569. * A specialized version of `_.forEach` for arrays without support for
  1570. * iteratee shorthands.
  1571. *
  1572. * @private
  1573. * @param {Array} [array] The array to iterate over.
  1574. * @param {Function} iteratee The function invoked per iteration.
  1575. * @returns {Array} Returns `array`.
  1576. */
  1577. function arrayEach(array, iteratee) {
  1578. var index = -1,
  1579. length = array == null ? 0 : array.length;
  1580. while (++index < length) {
  1581. if (iteratee(array[index], index, array) === false) {
  1582. break;
  1583. }
  1584. }
  1585. return array;
  1586. }
  1587. /**
  1588. * A specialized version of `_.forEachRight` for arrays without support for
  1589. * iteratee shorthands.
  1590. *
  1591. * @private
  1592. * @param {Array} [array] The array to iterate over.
  1593. * @param {Function} iteratee The function invoked per iteration.
  1594. * @returns {Array} Returns `array`.
  1595. */
  1596. function arrayEachRight(array, iteratee) {
  1597. var length = array == null ? 0 : array.length;
  1598. while (length--) {
  1599. if (iteratee(array[length], length, array) === false) {
  1600. break;
  1601. }
  1602. }
  1603. return array;
  1604. }
  1605. /**
  1606. * A specialized version of `_.every` for arrays without support for
  1607. * iteratee shorthands.
  1608. *
  1609. * @private
  1610. * @param {Array} [array] The array to iterate over.
  1611. * @param {Function} predicate The function invoked per iteration.
  1612. * @returns {boolean} Returns `true` if all elements pass the predicate check,
  1613. * else `false`.
  1614. */
  1615. function arrayEvery(array, predicate) {
  1616. var index = -1,
  1617. length = array == null ? 0 : array.length;
  1618. while (++index < length) {
  1619. if (!predicate(array[index], index, array)) {
  1620. return false;
  1621. }
  1622. }
  1623. return true;
  1624. }
  1625. /**
  1626. * A specialized version of `_.filter` for arrays without support for
  1627. * iteratee shorthands.
  1628. *
  1629. * @private
  1630. * @param {Array} [array] The array to iterate over.
  1631. * @param {Function} predicate The function invoked per iteration.
  1632. * @returns {Array} Returns the new filtered array.
  1633. */
  1634. function arrayFilter(array, predicate) {
  1635. var index = -1,
  1636. length = array == null ? 0 : array.length,
  1637. resIndex = 0,
  1638. result = [];
  1639. while (++index < length) {
  1640. var value = array[index];
  1641. if (predicate(value, index, array)) {
  1642. result[resIndex++] = value;
  1643. }
  1644. }
  1645. return result;
  1646. }
  1647. /**
  1648. * A specialized version of `_.includes` for arrays without support for
  1649. * specifying an index to search from.
  1650. *
  1651. * @private
  1652. * @param {Array} [array] The array to inspect.
  1653. * @param {*} target The value to search for.
  1654. * @returns {boolean} Returns `true` if `target` is found, else `false`.
  1655. */
  1656. function arrayIncludes(array, value) {
  1657. var length = array == null ? 0 : array.length;
  1658. return !!length && baseIndexOf(array, value, 0) > -1;
  1659. }
  1660. /**
  1661. * This function is like `arrayIncludes` except that it accepts a comparator.
  1662. *
  1663. * @private
  1664. * @param {Array} [array] The array to inspect.
  1665. * @param {*} target The value to search for.
  1666. * @param {Function} comparator The comparator invoked per element.
  1667. * @returns {boolean} Returns `true` if `target` is found, else `false`.
  1668. */
  1669. function arrayIncludesWith(array, value, comparator) {
  1670. var index = -1,
  1671. length = array == null ? 0 : array.length;
  1672. while (++index < length) {
  1673. if (comparator(value, array[index])) {
  1674. return true;
  1675. }
  1676. }
  1677. return false;
  1678. }
  1679. /**
  1680. * A specialized version of `_.map` for arrays without support for iteratee
  1681. * shorthands.
  1682. *
  1683. * @private
  1684. * @param {Array} [array] The array to iterate over.
  1685. * @param {Function} iteratee The function invoked per iteration.
  1686. * @returns {Array} Returns the new mapped array.
  1687. */
  1688. function arrayMap(array, iteratee) {
  1689. var index = -1,
  1690. length = array == null ? 0 : array.length,
  1691. result = Array(length);
  1692. while (++index < length) {
  1693. result[index] = iteratee(array[index], index, array);
  1694. }
  1695. return result;
  1696. }
  1697. /**
  1698. * Appends the elements of `values` to `array`.
  1699. *
  1700. * @private
  1701. * @param {Array} array The array to modify.
  1702. * @param {Array} values The values to append.
  1703. * @returns {Array} Returns `array`.
  1704. */
  1705. function arrayPush(array, values) {
  1706. var index = -1,
  1707. length = values.length,
  1708. offset = array.length;
  1709. while (++index < length) {
  1710. array[offset + index] = values[index];
  1711. }
  1712. return array;
  1713. }
  1714. /**
  1715. * A specialized version of `_.reduce` for arrays without support for
  1716. * iteratee shorthands.
  1717. *
  1718. * @private
  1719. * @param {Array} [array] The array to iterate over.
  1720. * @param {Function} iteratee The function invoked per iteration.
  1721. * @param {*} [accumulator] The initial value.
  1722. * @param {boolean} [initAccum] Specify using the first element of `array` as
  1723. * the initial value.
  1724. * @returns {*} Returns the accumulated value.
  1725. */
  1726. function arrayReduce(array, iteratee, accumulator, initAccum) {
  1727. var index = -1,
  1728. length = array == null ? 0 : array.length;
  1729. if (initAccum && length) {
  1730. accumulator = array[++index];
  1731. }
  1732. while (++index < length) {
  1733. accumulator = iteratee(accumulator, array[index], index, array);
  1734. }
  1735. return accumulator;
  1736. }
  1737. /**
  1738. * A specialized version of `_.reduceRight` for arrays without support for
  1739. * iteratee shorthands.
  1740. *
  1741. * @private
  1742. * @param {Array} [array] The array to iterate over.
  1743. * @param {Function} iteratee The function invoked per iteration.
  1744. * @param {*} [accumulator] The initial value.
  1745. * @param {boolean} [initAccum] Specify using the last element of `array` as
  1746. * the initial value.
  1747. * @returns {*} Returns the accumulated value.
  1748. */
  1749. function arrayReduceRight(array, iteratee, accumulator, initAccum) {
  1750. var length = array == null ? 0 : array.length;
  1751. if (initAccum && length) {
  1752. accumulator = array[--length];
  1753. }
  1754. while (length--) {
  1755. accumulator = iteratee(accumulator, array[length], length, array);
  1756. }
  1757. return accumulator;
  1758. }
  1759. /**
  1760. * A specialized version of `_.some` for arrays without support for iteratee
  1761. * shorthands.
  1762. *
  1763. * @private
  1764. * @param {Array} [array] The array to iterate over.
  1765. * @param {Function} predicate The function invoked per iteration.
  1766. * @returns {boolean} Returns `true` if any element passes the predicate check,
  1767. * else `false`.
  1768. */
  1769. function arraySome(array, predicate) {
  1770. var index = -1,
  1771. length = array == null ? 0 : array.length;
  1772. while (++index < length) {
  1773. if (predicate(array[index], index, array)) {
  1774. return true;
  1775. }
  1776. }
  1777. return false;
  1778. }
  1779. /**
  1780. * Gets the size of an ASCII `string`.
  1781. *
  1782. * @private
  1783. * @param {string} string The string inspect.
  1784. * @returns {number} Returns the string size.
  1785. */
  1786. var asciiSize = baseProperty('length');
  1787. /**
  1788. * Converts an ASCII `string` to an array.
  1789. *
  1790. * @private
  1791. * @param {string} string The string to convert.
  1792. * @returns {Array} Returns the converted array.
  1793. */
  1794. function asciiToArray(string) {
  1795. return string.split('');
  1796. }
  1797. /**
  1798. * Splits an ASCII `string` into an array of its words.
  1799. *
  1800. * @private
  1801. * @param {string} The string to inspect.
  1802. * @returns {Array} Returns the words of `string`.
  1803. */
  1804. function asciiWords(string) {
  1805. return string.match(reAsciiWord) || [];
  1806. }
  1807. /**
  1808. * The base implementation of methods like `_.findKey` and `_.findLastKey`,
  1809. * without support for iteratee shorthands, which iterates over `collection`
  1810. * using `eachFunc`.
  1811. *
  1812. * @private
  1813. * @param {Array|Object} collection The collection to inspect.
  1814. * @param {Function} predicate The function invoked per iteration.
  1815. * @param {Function} eachFunc The function to iterate over `collection`.
  1816. * @returns {*} Returns the found element or its key, else `undefined`.
  1817. */
  1818. function baseFindKey(collection, predicate, eachFunc) {
  1819. var result;
  1820. eachFunc(collection, function(value, key, collection) {
  1821. if (predicate(value, key, collection)) {
  1822. result = key;
  1823. return false;
  1824. }
  1825. });
  1826. return result;
  1827. }
  1828. /**
  1829. * The base implementation of `_.findIndex` and `_.findLastIndex` without
  1830. * support for iteratee shorthands.
  1831. *
  1832. * @private
  1833. * @param {Array} array The array to inspect.
  1834. * @param {Function} predicate The function invoked per iteration.
  1835. * @param {number} fromIndex The index to search from.
  1836. * @param {boolean} [fromRight] Specify iterating from right to left.
  1837. * @returns {number} Returns the index of the matched value, else `-1`.
  1838. */
  1839. function baseFindIndex(array, predicate, fromIndex, fromRight) {
  1840. var length = array.length,
  1841. index = fromIndex + (fromRight ? 1 : -1);
  1842. while ((fromRight ? index-- : ++index < length)) {
  1843. if (predicate(array[index], index, array)) {
  1844. return index;
  1845. }
  1846. }
  1847. return -1;
  1848. }
  1849. /**
  1850. * The base implementation of `_.indexOf` without `fromIndex` bounds checks.
  1851. *
  1852. * @private
  1853. * @param {Array} array The array to inspect.
  1854. * @param {*} value The value to search for.
  1855. * @param {number} fromIndex The index to search from.
  1856. * @returns {number} Returns the index of the matched value, else `-1`.
  1857. */
  1858. function baseIndexOf(array, value, fromIndex) {
  1859. return value === value
  1860. ? strictIndexOf(array, value, fromIndex)
  1861. : baseFindIndex(array, baseIsNaN, fromIndex);
  1862. }
  1863. /**
  1864. * This function is like `baseIndexOf` except that it accepts a comparator.
  1865. *
  1866. * @private
  1867. * @param {Array} array The array to inspect.
  1868. * @param {*} value The value to search for.
  1869. * @param {number} fromIndex The index to search from.
  1870. * @param {Function} comparator The comparator invoked per element.
  1871. * @returns {number} Returns the index of the matched value, else `-1`.
  1872. */
  1873. function baseIndexOfWith(array, value, fromIndex, comparator) {
  1874. var index = fromIndex - 1,
  1875. length = array.length;
  1876. while (++index < length) {
  1877. if (comparator(array[index], value)) {
  1878. return index;
  1879. }
  1880. }
  1881. return -1;
  1882. }
  1883. /**
  1884. * The base implementation of `_.isNaN` without support for number objects.
  1885. *
  1886. * @private
  1887. * @param {*} value The value to check.
  1888. * @returns {boolean} Returns `true` if `value` is `NaN`, else `false`.
  1889. */
  1890. function baseIsNaN(value) {
  1891. return value !== value;
  1892. }
  1893. /**
  1894. * The base implementation of `_.mean` and `_.meanBy` without support for
  1895. * iteratee shorthands.
  1896. *
  1897. * @private
  1898. * @param {Array} array The array to iterate over.
  1899. * @param {Function} iteratee The function invoked per iteration.
  1900. * @returns {number} Returns the mean.
  1901. */
  1902. function baseMean(array, iteratee) {
  1903. var length = array == null ? 0 : array.length;
  1904. return length ? (baseSum(array, iteratee) / length) : NAN;
  1905. }
  1906. /**
  1907. * The base implementation of `_.property` without support for deep paths.
  1908. *
  1909. * @private
  1910. * @param {string} key The key of the property to get.
  1911. * @returns {Function} Returns the new accessor function.
  1912. */
  1913. function baseProperty(key) {
  1914. return function(object) {
  1915. return object == null ? undefined : object[key];
  1916. };
  1917. }
  1918. /**
  1919. * The base implementation of `_.propertyOf` without support for deep paths.
  1920. *
  1921. * @private
  1922. * @param {Object} object The object to query.
  1923. * @returns {Function} Returns the new accessor function.
  1924. */
  1925. function basePropertyOf(object) {
  1926. return function(key) {
  1927. return object == null ? undefined : object[key];
  1928. };
  1929. }
  1930. /**
  1931. * The base implementation of `_.reduce` and `_.reduceRight`, without support
  1932. * for iteratee shorthands, which iterates over `collection` using `eachFunc`.
  1933. *
  1934. * @private
  1935. * @param {Array|Object} collection The collection to iterate over.
  1936. * @param {Function} iteratee The function invoked per iteration.
  1937. * @param {*} accumulator The initial value.
  1938. * @param {boolean} initAccum Specify using the first or last element of
  1939. * `collection` as the initial value.
  1940. * @param {Function} eachFunc The function to iterate over `collection`.
  1941. * @returns {*} Returns the accumulated value.
  1942. */
  1943. function baseReduce(collection, iteratee, accumulator, initAccum, eachFunc) {
  1944. eachFunc(collection, function(value, index, collection) {
  1945. accumulator = initAccum
  1946. ? (initAccum = false, value)
  1947. : iteratee(accumulator, value, index, collection);
  1948. });
  1949. return accumulator;
  1950. }
  1951. /**
  1952. * The base implementation of `_.sortBy` which uses `comparer` to define the
  1953. * sort order of `array` and replaces criteria objects with their corresponding
  1954. * values.
  1955. *
  1956. * @private
  1957. * @param {Array} array The array to sort.
  1958. * @param {Function} comparer The function to define sort order.
  1959. * @returns {Array} Returns `array`.
  1960. */
  1961. function baseSortBy(array, comparer) {
  1962. var length = array.length;
  1963. array.sort(comparer);
  1964. while (length--) {
  1965. array[length] = array[length].value;
  1966. }
  1967. return array;
  1968. }
  1969. /**
  1970. * The base implementation of `_.sum` and `_.sumBy` without support for
  1971. * iteratee shorthands.
  1972. *
  1973. * @private
  1974. * @param {Array} array The array to iterate over.
  1975. * @param {Function} iteratee The function invoked per iteration.
  1976. * @returns {number} Returns the sum.
  1977. */
  1978. function baseSum(array, iteratee) {
  1979. var result,
  1980. index = -1,
  1981. length = array.length;
  1982. while (++index < length) {
  1983. var current = iteratee(array[index]);
  1984. if (current !== undefined) {
  1985. result = result === undefined ? current : (result + current);
  1986. }
  1987. }
  1988. return result;
  1989. }
  1990. /**
  1991. * The base implementation of `_.times` without support for iteratee shorthands
  1992. * or max array length checks.
  1993. *
  1994. * @private
  1995. * @param {number} n The number of times to invoke `iteratee`.
  1996. * @param {Function} iteratee The function invoked per iteration.
  1997. * @returns {Array} Returns the array of results.
  1998. */
  1999. function baseTimes(n, iteratee) {
  2000. var index = -1,
  2001. result = Array(n);
  2002. while (++index < n) {
  2003. result[index] = iteratee(index);
  2004. }
  2005. return result;
  2006. }
  2007. /**
  2008. * The base implementation of `_.toPairs` and `_.toPairsIn` which creates an array
  2009. * of key-value pairs for `object` corresponding to the property names of `props`.
  2010. *
  2011. * @private
  2012. * @param {Object} object The object to query.
  2013. * @param {Array} props The property names to get values for.
  2014. * @returns {Object} Returns the key-value pairs.
  2015. */
  2016. function baseToPairs(object, props) {
  2017. return arrayMap(props, function(key) {
  2018. return [key, object[key]];
  2019. });
  2020. }
  2021. /**
  2022. * The base implementation of `_.trim`.
  2023. *
  2024. * @private
  2025. * @param {string} string The string to trim.
  2026. * @returns {string} Returns the trimmed string.
  2027. */
  2028. function baseTrim(string) {
  2029. return string
  2030. ? string.slice(0, trimmedEndIndex(string) + 1).replace(reTrimStart, '')
  2031. : string;
  2032. }
  2033. /**
  2034. * The base implementation of `_.unary` without support for storing metadata.
  2035. *
  2036. * @private
  2037. * @param {Function} func The function to cap arguments for.
  2038. * @returns {Function} Returns the new capped function.
  2039. */
  2040. function baseUnary(func) {
  2041. return function(value) {
  2042. return func(value);
  2043. };
  2044. }
  2045. /**
  2046. * The base implementation of `_.values` and `_.valuesIn` which creates an
  2047. * array of `object` property values corresponding to the property names
  2048. * of `props`.
  2049. *
  2050. * @private
  2051. * @param {Object} object The object to query.
  2052. * @param {Array} props The property names to get values for.
  2053. * @returns {Object} Returns the array of property values.
  2054. */
  2055. function baseValues(object, props) {
  2056. return arrayMap(props, function(key) {
  2057. return object[key];
  2058. });
  2059. }
  2060. /**
  2061. * Checks if a `cache` value for `key` exists.
  2062. *
  2063. * @private
  2064. * @param {Object} cache The cache to query.
  2065. * @param {string} key The key of the entry to check.
  2066. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  2067. */
  2068. function cacheHas(cache, key) {
  2069. return cache.has(key);
  2070. }
  2071. /**
  2072. * Used by `_.trim` and `_.trimStart` to get the index of the first string symbol
  2073. * that is not found in the character symbols.
  2074. *
  2075. * @private
  2076. * @param {Array} strSymbols The string symbols to inspect.
  2077. * @param {Array} chrSymbols The character symbols to find.
  2078. * @returns {number} Returns the index of the first unmatched string symbol.
  2079. */
  2080. function charsStartIndex(strSymbols, chrSymbols) {
  2081. var index = -1,
  2082. length = strSymbols.length;
  2083. while (++index < length && baseIndexOf(chrSymbols, strSymbols[index], 0) > -1) {}
  2084. return index;
  2085. }
  2086. /**
  2087. * Used by `_.trim` and `_.trimEnd` to get the index of the last string symbol
  2088. * that is not found in the character symbols.
  2089. *
  2090. * @private
  2091. * @param {Array} strSymbols The string symbols to inspect.
  2092. * @param {Array} chrSymbols The character symbols to find.
  2093. * @returns {number} Returns the index of the last unmatched string symbol.
  2094. */
  2095. function charsEndIndex(strSymbols, chrSymbols) {
  2096. var index = strSymbols.length;
  2097. while (index-- && baseIndexOf(chrSymbols, strSymbols[index], 0) > -1) {}
  2098. return index;
  2099. }
  2100. /**
  2101. * Gets the number of `placeholder` occurrences in `array`.
  2102. *
  2103. * @private
  2104. * @param {Array} array The array to inspect.
  2105. * @param {*} placeholder The placeholder to search for.
  2106. * @returns {number} Returns the placeholder count.
  2107. */
  2108. function countHolders(array, placeholder) {
  2109. var length = array.length,
  2110. result = 0;
  2111. while (length--) {
  2112. if (array[length] === placeholder) {
  2113. ++result;
  2114. }
  2115. }
  2116. return result;
  2117. }
  2118. /**
  2119. * Used by `_.deburr` to convert Latin-1 Supplement and Latin Extended-A
  2120. * letters to basic Latin letters.
  2121. *
  2122. * @private
  2123. * @param {string} letter The matched letter to deburr.
  2124. * @returns {string} Returns the deburred letter.
  2125. */
  2126. var deburrLetter = basePropertyOf(deburredLetters);
  2127. /**
  2128. * Used by `_.escape` to convert characters to HTML entities.
  2129. *
  2130. * @private
  2131. * @param {string} chr The matched character to escape.
  2132. * @returns {string} Returns the escaped character.
  2133. */
  2134. var escapeHtmlChar = basePropertyOf(htmlEscapes);
  2135. /**
  2136. * Used by `_.template` to escape characters for inclusion in compiled string literals.
  2137. *
  2138. * @private
  2139. * @param {string} chr The matched character to escape.
  2140. * @returns {string} Returns the escaped character.
  2141. */
  2142. function escapeStringChar(chr) {
  2143. return '\\' + stringEscapes[chr];
  2144. }
  2145. /**
  2146. * Gets the value at `key` of `object`.
  2147. *
  2148. * @private
  2149. * @param {Object} [object] The object to query.
  2150. * @param {string} key The key of the property to get.
  2151. * @returns {*} Returns the property value.
  2152. */
  2153. function getValue(object, key) {
  2154. return object == null ? undefined : object[key];
  2155. }
  2156. /**
  2157. * Checks if `string` contains Unicode symbols.
  2158. *
  2159. * @private
  2160. * @param {string} string The string to inspect.
  2161. * @returns {boolean} Returns `true` if a symbol is found, else `false`.
  2162. */
  2163. function hasUnicode(string) {
  2164. return reHasUnicode.test(string);
  2165. }
  2166. /**
  2167. * Checks if `string` contains a word composed of Unicode symbols.
  2168. *
  2169. * @private
  2170. * @param {string} string The string to inspect.
  2171. * @returns {boolean} Returns `true` if a word is found, else `false`.
  2172. */
  2173. function hasUnicodeWord(string) {
  2174. return reHasUnicodeWord.test(string);
  2175. }
  2176. /**
  2177. * Converts `iterator` to an array.
  2178. *
  2179. * @private
  2180. * @param {Object} iterator The iterator to convert.
  2181. * @returns {Array} Returns the converted array.
  2182. */
  2183. function iteratorToArray(iterator) {
  2184. var data,
  2185. result = [];
  2186. while (!(data = iterator.next()).done) {
  2187. result.push(data.value);
  2188. }
  2189. return result;
  2190. }
  2191. /**
  2192. * Converts `map` to its key-value pairs.
  2193. *
  2194. * @private
  2195. * @param {Object} map The map to convert.
  2196. * @returns {Array} Returns the key-value pairs.
  2197. */
  2198. function mapToArray(map) {
  2199. var index = -1,
  2200. result = Array(map.size);
  2201. map.forEach(function(value, key) {
  2202. result[++index] = [key, value];
  2203. });
  2204. return result;
  2205. }
  2206. /**
  2207. * Creates a unary function that invokes `func` with its argument transformed.
  2208. *
  2209. * @private
  2210. * @param {Function} func The function to wrap.
  2211. * @param {Function} transform The argument transform.
  2212. * @returns {Function} Returns the new function.
  2213. */
  2214. function overArg(func, transform) {
  2215. return function(arg) {
  2216. return func(transform(arg));
  2217. };
  2218. }
  2219. /**
  2220. * Replaces all `placeholder` elements in `array` with an internal placeholder
  2221. * and returns an array of their indexes.
  2222. *
  2223. * @private
  2224. * @param {Array} array The array to modify.
  2225. * @param {*} placeholder The placeholder to replace.
  2226. * @returns {Array} Returns the new array of placeholder indexes.
  2227. */
  2228. function replaceHolders(array, placeholder) {
  2229. var index = -1,
  2230. length = array.length,
  2231. resIndex = 0,
  2232. result = [];
  2233. while (++index < length) {
  2234. var value = array[index];
  2235. if (value === placeholder || value === PLACEHOLDER) {
  2236. array[index] = PLACEHOLDER;
  2237. result[resIndex++] = index;
  2238. }
  2239. }
  2240. return result;
  2241. }
  2242. /**
  2243. * Converts `set` to an array of its values.
  2244. *
  2245. * @private
  2246. * @param {Object} set The set to convert.
  2247. * @returns {Array} Returns the values.
  2248. */
  2249. function setToArray(set) {
  2250. var index = -1,
  2251. result = Array(set.size);
  2252. set.forEach(function(value) {
  2253. result[++index] = value;
  2254. });
  2255. return result;
  2256. }
  2257. /**
  2258. * Converts `set` to its value-value pairs.
  2259. *
  2260. * @private
  2261. * @param {Object} set The set to convert.
  2262. * @returns {Array} Returns the value-value pairs.
  2263. */
  2264. function setToPairs(set) {
  2265. var index = -1,
  2266. result = Array(set.size);
  2267. set.forEach(function(value) {
  2268. result[++index] = [value, value];
  2269. });
  2270. return result;
  2271. }
  2272. /**
  2273. * A specialized version of `_.indexOf` which performs strict equality
  2274. * comparisons of values, i.e. `===`.
  2275. *
  2276. * @private
  2277. * @param {Array} array The array to inspect.
  2278. * @param {*} value The value to search for.
  2279. * @param {number} fromIndex The index to search from.
  2280. * @returns {number} Returns the index of the matched value, else `-1`.
  2281. */
  2282. function strictIndexOf(array, value, fromIndex) {
  2283. var index = fromIndex - 1,
  2284. length = array.length;
  2285. while (++index < length) {
  2286. if (array[index] === value) {
  2287. return index;
  2288. }
  2289. }
  2290. return -1;
  2291. }
  2292. /**
  2293. * A specialized version of `_.lastIndexOf` which performs strict equality
  2294. * comparisons of values, i.e. `===`.
  2295. *
  2296. * @private
  2297. * @param {Array} array The array to inspect.
  2298. * @param {*} value The value to search for.
  2299. * @param {number} fromIndex The index to search from.
  2300. * @returns {number} Returns the index of the matched value, else `-1`.
  2301. */
  2302. function strictLastIndexOf(array, value, fromIndex) {
  2303. var index = fromIndex + 1;
  2304. while (index--) {
  2305. if (array[index] === value) {
  2306. return index;
  2307. }
  2308. }
  2309. return index;
  2310. }
  2311. /**
  2312. * Gets the number of symbols in `string`.
  2313. *
  2314. * @private
  2315. * @param {string} string The string to inspect.
  2316. * @returns {number} Returns the string size.
  2317. */
  2318. function stringSize(string) {
  2319. return hasUnicode(string)
  2320. ? unicodeSize(string)
  2321. : asciiSize(string);
  2322. }
  2323. /**
  2324. * Converts `string` to an array.
  2325. *
  2326. * @private
  2327. * @param {string} string The string to convert.
  2328. * @returns {Array} Returns the converted array.
  2329. */
  2330. function stringToArray(string) {
  2331. return hasUnicode(string)
  2332. ? unicodeToArray(string)
  2333. : asciiToArray(string);
  2334. }
  2335. /**
  2336. * Used by `_.trim` and `_.trimEnd` to get the index of the last non-whitespace
  2337. * character of `string`.
  2338. *
  2339. * @private
  2340. * @param {string} string The string to inspect.
  2341. * @returns {number} Returns the index of the last non-whitespace character.
  2342. */
  2343. function trimmedEndIndex(string) {
  2344. var index = string.length;
  2345. while (index-- && reWhitespace.test(string.charAt(index))) {}
  2346. return index;
  2347. }
  2348. /**
  2349. * Used by `_.unescape` to convert HTML entities to characters.
  2350. *
  2351. * @private
  2352. * @param {string} chr The matched character to unescape.
  2353. * @returns {string} Returns the unescaped character.
  2354. */
  2355. var unescapeHtmlChar = basePropertyOf(htmlUnescapes);
  2356. /**
  2357. * Gets the size of a Unicode `string`.
  2358. *
  2359. * @private
  2360. * @param {string} string The string inspect.
  2361. * @returns {number} Returns the string size.
  2362. */
  2363. function unicodeSize(string) {
  2364. var result = reUnicode.lastIndex = 0;
  2365. while (reUnicode.test(string)) {
  2366. ++result;
  2367. }
  2368. return result;
  2369. }
  2370. /**
  2371. * Converts a Unicode `string` to an array.
  2372. *
  2373. * @private
  2374. * @param {string} string The string to convert.
  2375. * @returns {Array} Returns the converted array.
  2376. */
  2377. function unicodeToArray(string) {
  2378. return string.match(reUnicode) || [];
  2379. }
  2380. /**
  2381. * Splits a Unicode `string` into an array of its words.
  2382. *
  2383. * @private
  2384. * @param {string} The string to inspect.
  2385. * @returns {Array} Returns the words of `string`.
  2386. */
  2387. function unicodeWords(string) {
  2388. return string.match(reUnicodeWord) || [];
  2389. }
  2390. /*--------------------------------------------------------------------------*/
  2391. /**
  2392. * Create a new pristine `lodash` function using the `context` object.
  2393. *
  2394. * @static
  2395. * @memberOf _
  2396. * @since 1.1.0
  2397. * @category Util
  2398. * @param {Object} [context=root] The context object.
  2399. * @returns {Function} Returns a new `lodash` function.
  2400. * @example
  2401. *
  2402. * _.mixin({ 'foo': _.constant('foo') });
  2403. *
  2404. * var lodash = _.runInContext();
  2405. * lodash.mixin({ 'bar': lodash.constant('bar') });
  2406. *
  2407. * _.isFunction(_.foo);
  2408. * // => true
  2409. * _.isFunction(_.bar);
  2410. * // => false
  2411. *
  2412. * lodash.isFunction(lodash.foo);
  2413. * // => false
  2414. * lodash.isFunction(lodash.bar);
  2415. * // => true
  2416. *
  2417. * // Create a suped-up `defer` in Node.js.
  2418. * var defer = _.runInContext({ 'setTimeout': setImmediate }).defer;
  2419. */
  2420. var runInContext = (function runInContext(context) {
  2421. context = context == null ? root : _.defaults(root.Object(), context, _.pick(root, contextProps));
  2422. /** Built-in constructor references. */
  2423. var Array = context.Array,
  2424. Date = context.Date,
  2425. Error = context.Error,
  2426. Function = context.Function,
  2427. Math = context.Math,
  2428. Object = context.Object,
  2429. RegExp = context.RegExp,
  2430. String = context.String,
  2431. TypeError = context.TypeError;
  2432. /** Used for built-in method references. */
  2433. var arrayProto = Array.prototype,
  2434. funcProto = Function.prototype,
  2435. objectProto = Object.prototype;
  2436. /** Used to detect overreaching core-js shims. */
  2437. var coreJsData = context['__core-js_shared__'];
  2438. /** Used to resolve the decompiled source of functions. */
  2439. var funcToString = funcProto.toString;
  2440. /** Used to check objects for own properties. */
  2441. var hasOwnProperty = objectProto.hasOwnProperty;
  2442. /** Used to generate unique IDs. */
  2443. var idCounter = 0;
  2444. /** Used to detect methods masquerading as native. */
  2445. var maskSrcKey = (function() {
  2446. var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || '');
  2447. return uid ? ('Symbol(src)_1.' + uid) : '';
  2448. }());
  2449. /**
  2450. * Used to resolve the
  2451. * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
  2452. * of values.
  2453. */
  2454. var nativeObjectToString = objectProto.toString;
  2455. /** Used to infer the `Object` constructor. */
  2456. var objectCtorString = funcToString.call(Object);
  2457. /** Used to restore the original `_` reference in `_.noConflict`. */
  2458. var oldDash = root._;
  2459. /** Used to detect if a method is native. */
  2460. var reIsNative = RegExp('^' +
  2461. funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\$&')
  2462. .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$'
  2463. );
  2464. /** Built-in value references. */
  2465. var Buffer = moduleExports ? context.Buffer : undefined,
  2466. Symbol = context.Symbol,
  2467. Uint8Array = context.Uint8Array,
  2468. allocUnsafe = Buffer ? Buffer.allocUnsafe : undefined,
  2469. getPrototype = overArg(Object.getPrototypeOf, Object),
  2470. objectCreate = Object.create,
  2471. propertyIsEnumerable = objectProto.propertyIsEnumerable,
  2472. splice = arrayProto.splice,
  2473. spreadableSymbol = Symbol ? Symbol.isConcatSpreadable : undefined,
  2474. symIterator = Symbol ? Symbol.iterator : undefined,
  2475. symToStringTag = Symbol ? Symbol.toStringTag : undefined;
  2476. var defineProperty = (function() {
  2477. try {
  2478. var func = getNative(Object, 'defineProperty');
  2479. func({}, '', {});
  2480. return func;
  2481. } catch (e) {}
  2482. }());
  2483. /** Mocked built-ins. */
  2484. var ctxClearTimeout = context.clearTimeout !== root.clearTimeout && context.clearTimeout,
  2485. ctxNow = Date && Date.now !== root.Date.now && Date.now,
  2486. ctxSetTimeout = context.setTimeout !== root.setTimeout && context.setTimeout;
  2487. /* Built-in method references for those with the same name as other `lodash` methods. */
  2488. var nativeCeil = Math.ceil,
  2489. nativeFloor = Math.floor,
  2490. nativeGetSymbols = Object.getOwnPropertySymbols,
  2491. nativeIsBuffer = Buffer ? Buffer.isBuffer : undefined,
  2492. nativeIsFinite = context.isFinite,
  2493. nativeJoin = arrayProto.join,
  2494. nativeKeys = overArg(Object.keys, Object),
  2495. nativeMax = Math.max,
  2496. nativeMin = Math.min,
  2497. nativeNow = Date.now,
  2498. nativeParseInt = context.parseInt,
  2499. nativeRandom = Math.random,
  2500. nativeReverse = arrayProto.reverse;
  2501. /* Built-in method references that are verified to be native. */
  2502. var DataView = getNative(context, 'DataView'),
  2503. Map = getNative(context, 'Map'),
  2504. Promise = getNative(context, 'Promise'),
  2505. Set = getNative(context, 'Set'),
  2506. WeakMap = getNative(context, 'WeakMap'),
  2507. nativeCreate = getNative(Object, 'create');
  2508. /** Used to store function metadata. */
  2509. var metaMap = WeakMap && new WeakMap;
  2510. /** Used to lookup unminified function names. */
  2511. var realNames = {};
  2512. /** Used to detect maps, sets, and weakmaps. */
  2513. var dataViewCtorString = toSource(DataView),
  2514. mapCtorString = toSource(Map),
  2515. promiseCtorString = toSource(Promise),
  2516. setCtorString = toSource(Set),
  2517. weakMapCtorString = toSource(WeakMap);
  2518. /** Used to convert symbols to primitives and strings. */
  2519. var symbolProto = Symbol ? Symbol.prototype : undefined,
  2520. symbolValueOf = symbolProto ? symbolProto.valueOf : undefined,
  2521. symbolToString = symbolProto ? symbolProto.toString : undefined;
  2522. /*------------------------------------------------------------------------*/
  2523. /**
  2524. * Creates a `lodash` object which wraps `value` to enable implicit method
  2525. * chain sequences. Methods that operate on and return arrays, collections,
  2526. * and functions can be chained together. Methods that retrieve a single value
  2527. * or may return a primitive value will automatically end the chain sequence
  2528. * and return the unwrapped value. Otherwise, the value must be unwrapped
  2529. * with `_#value`.
  2530. *
  2531. * Explicit chain sequences, which must be unwrapped with `_#value`, may be
  2532. * enabled using `_.chain`.
  2533. *
  2534. * The execution of chained methods is lazy, that is, it's deferred until
  2535. * `_#value` is implicitly or explicitly called.
  2536. *
  2537. * Lazy evaluation allows several methods to support shortcut fusion.
  2538. * Shortcut fusion is an optimization to merge iteratee calls; this avoids
  2539. * the creation of intermediate arrays and can greatly reduce the number of
  2540. * iteratee executions. Sections of a chain sequence qualify for shortcut
  2541. * fusion if the section is applied to an array and iteratees accept only
  2542. * one argument. The heuristic for whether a section qualifies for shortcut
  2543. * fusion is subject to change.
  2544. *
  2545. * Chaining is supported in custom builds as long as the `_#value` method is
  2546. * directly or indirectly included in the build.
  2547. *
  2548. * In addition to lodash methods, wrappers have `Array` and `String` methods.
  2549. *
  2550. * The wrapper `Array` methods are:
  2551. * `concat`, `join`, `pop`, `push`, `shift`, `sort`, `splice`, and `unshift`
  2552. *
  2553. * The wrapper `String` methods are:
  2554. * `replace` and `split`
  2555. *
  2556. * The wrapper methods that support shortcut fusion are:
  2557. * `at`, `compact`, `drop`, `dropRight`, `dropWhile`, `filter`, `find`,
  2558. * `findLast`, `head`, `initial`, `last`, `map`, `reject`, `reverse`, `slice`,
  2559. * `tail`, `take`, `takeRight`, `takeRightWhile`, `takeWhile`, and `toArray`
  2560. *
  2561. * The chainable wrapper methods are:
  2562. * `after`, `ary`, `assign`, `assignIn`, `assignInWith`, `assignWith`, `at`,
  2563. * `before`, `bind`, `bindAll`, `bindKey`, `castArray`, `chain`, `chunk`,
  2564. * `commit`, `compact`, `concat`, `conforms`, `constant`, `countBy`, `create`,
  2565. * `curry`, `debounce`, `defaults`, `defaultsDeep`, `defer`, `delay`,
  2566. * `difference`, `differenceBy`, `differenceWith`, `drop`, `dropRight`,
  2567. * `dropRightWhile`, `dropWhile`, `extend`, `extendWith`, `fill`, `filter`,
  2568. * `flatMap`, `flatMapDeep`, `flatMapDepth`, `flatten`, `flattenDeep`,
  2569. * `flattenDepth`, `flip`, `flow`, `flowRight`, `fromPairs`, `functions`,
  2570. * `functionsIn`, `groupBy`, `initial`, `intersection`, `intersectionBy`,
  2571. * `intersectionWith`, `invert`, `invertBy`, `invokeMap`, `iteratee`, `keyBy`,
  2572. * `keys`, `keysIn`, `map`, `mapKeys`, `mapValues`, `matches`, `matchesProperty`,
  2573. * `memoize`, `merge`, `mergeWith`, `method`, `methodOf`, `mixin`, `negate`,
  2574. * `nthArg`, `omit`, `omitBy`, `once`, `orderBy`, `over`, `overArgs`,
  2575. * `overEvery`, `overSome`, `partial`, `partialRight`, `partition`, `pick`,
  2576. * `pickBy`, `plant`, `property`, `propertyOf`, `pull`, `pullAll`, `pullAllBy`,
  2577. * `pullAllWith`, `pullAt`, `push`, `range`, `rangeRight`, `rearg`, `reject`,
  2578. * `remove`, `rest`, `reverse`, `sampleSize`, `set`, `setWith`, `shuffle`,
  2579. * `slice`, `sort`, `sortBy`, `splice`, `spread`, `tail`, `take`, `takeRight`,
  2580. * `takeRightWhile`, `takeWhile`, `tap`, `throttle`, `thru`, `toArray`,
  2581. * `toPairs`, `toPairsIn`, `toPath`, `toPlainObject`, `transform`, `unary`,
  2582. * `union`, `unionBy`, `unionWith`, `uniq`, `uniqBy`, `uniqWith`, `unset`,
  2583. * `unshift`, `unzip`, `unzipWith`, `update`, `updateWith`, `values`,
  2584. * `valuesIn`, `without`, `wrap`, `xor`, `xorBy`, `xorWith`, `zip`,
  2585. * `zipObject`, `zipObjectDeep`, and `zipWith`
  2586. *
  2587. * The wrapper methods that are **not** chainable by default are:
  2588. * `add`, `attempt`, `camelCase`, `capitalize`, `ceil`, `clamp`, `clone`,
  2589. * `cloneDeep`, `cloneDeepWith`, `cloneWith`, `conformsTo`, `deburr`,
  2590. * `defaultTo`, `divide`, `each`, `eachRight`, `endsWith`, `eq`, `escape`,
  2591. * `escapeRegExp`, `every`, `find`, `findIndex`, `findKey`, `findLast`,
  2592. * `findLastIndex`, `findLastKey`, `first`, `floor`, `forEach`, `forEachRight`,
  2593. * `forIn`, `forInRight`, `forOwn`, `forOwnRight`, `get`, `gt`, `gte`, `has`,
  2594. * `hasIn`, `head`, `identity`, `includes`, `indexOf`, `inRange`, `invoke`,
  2595. * `isArguments`, `isArray`, `isArrayBuffer`, `isArrayLike`, `isArrayLikeObject`,
  2596. * `isBoolean`, `isBuffer`, `isDate`, `isElement`, `isEmpty`, `isEqual`,
  2597. * `isEqualWith`, `isError`, `isFinite`, `isFunction`, `isInteger`, `isLength`,
  2598. * `isMap`, `isMatch`, `isMatchWith`, `isNaN`, `isNative`, `isNil`, `isNull`,
  2599. * `isNumber`, `isObject`, `isObjectLike`, `isPlainObject`, `isRegExp`,
  2600. * `isSafeInteger`, `isSet`, `isString`, `isUndefined`, `isTypedArray`,
  2601. * `isWeakMap`, `isWeakSet`, `join`, `kebabCase`, `last`, `lastIndexOf`,
  2602. * `lowerCase`, `lowerFirst`, `lt`, `lte`, `max`, `maxBy`, `mean`, `meanBy`,
  2603. * `min`, `minBy`, `multiply`, `noConflict`, `noop`, `now`, `nth`, `pad`,
  2604. * `padEnd`, `padStart`, `parseInt`, `pop`, `random`, `reduce`, `reduceRight`,
  2605. * `repeat`, `result`, `round`, `runInContext`, `sample`, `shift`, `size`,
  2606. * `snakeCase`, `some`, `sortedIndex`, `sortedIndexBy`, `sortedLastIndex`,
  2607. * `sortedLastIndexBy`, `startCase`, `startsWith`, `stubArray`, `stubFalse`,
  2608. * `stubObject`, `stubString`, `stubTrue`, `subtract`, `sum`, `sumBy`,
  2609. * `template`, `times`, `toFinite`, `toInteger`, `toJSON`, `toLength`,
  2610. * `toLower`, `toNumber`, `toSafeInteger`, `toString`, `toUpper`, `trim`,
  2611. * `trimEnd`, `trimStart`, `truncate`, `unescape`, `uniqueId`, `upperCase`,
  2612. * `upperFirst`, `value`, and `words`
  2613. *
  2614. * @name _
  2615. * @constructor
  2616. * @category Seq
  2617. * @param {*} value The value to wrap in a `lodash` instance.
  2618. * @returns {Object} Returns the new `lodash` wrapper instance.
  2619. * @example
  2620. *
  2621. * function square(n) {
  2622. * return n * n;
  2623. * }
  2624. *
  2625. * var wrapped = _([1, 2, 3]);
  2626. *
  2627. * // Returns an unwrapped value.
  2628. * wrapped.reduce(_.add);
  2629. * // => 6
  2630. *
  2631. * // Returns a wrapped value.
  2632. * var squares = wrapped.map(square);
  2633. *
  2634. * _.isArray(squares);
  2635. * // => false
  2636. *
  2637. * _.isArray(squares.value());
  2638. * // => true
  2639. */
  2640. function lodash(value) {
  2641. if (isObjectLike(value) && !isArray(value) && !(value instanceof LazyWrapper)) {
  2642. if (value instanceof LodashWrapper) {
  2643. return value;
  2644. }
  2645. if (hasOwnProperty.call(value, '__wrapped__')) {
  2646. return wrapperClone(value);
  2647. }
  2648. }
  2649. return new LodashWrapper(value);
  2650. }
  2651. /**
  2652. * The base implementation of `_.create` without support for assigning
  2653. * properties to the created object.
  2654. *
  2655. * @private
  2656. * @param {Object} proto The object to inherit from.
  2657. * @returns {Object} Returns the new object.
  2658. */
  2659. var baseCreate = (function() {
  2660. function object() {}
  2661. return function(proto) {
  2662. if (!isObject(proto)) {
  2663. return {};
  2664. }
  2665. if (objectCreate) {
  2666. return objectCreate(proto);
  2667. }
  2668. object.prototype = proto;
  2669. var result = new object;
  2670. object.prototype = undefined;
  2671. return result;
  2672. };
  2673. }());
  2674. /**
  2675. * The function whose prototype chain sequence wrappers inherit from.
  2676. *
  2677. * @private
  2678. */
  2679. function baseLodash() {
  2680. // No operation performed.
  2681. }
  2682. /**
  2683. * The base constructor for creating `lodash` wrapper objects.
  2684. *
  2685. * @private
  2686. * @param {*} value The value to wrap.
  2687. * @param {boolean} [chainAll] Enable explicit method chain sequences.
  2688. */
  2689. function LodashWrapper(value, chainAll) {
  2690. this.__wrapped__ = value;
  2691. this.__actions__ = [];
  2692. this.__chain__ = !!chainAll;
  2693. this.__index__ = 0;
  2694. this.__values__ = undefined;
  2695. }
  2696. /**
  2697. * By default, the template delimiters used by lodash are like those in
  2698. * embedded Ruby (ERB) as well as ES2015 template strings. Change the
  2699. * following template settings to use alternative delimiters.
  2700. *
  2701. * @static
  2702. * @memberOf _
  2703. * @type {Object}
  2704. */
  2705. lodash.templateSettings = {
  2706. /**
  2707. * Used to detect `data` property values to be HTML-escaped.
  2708. *
  2709. * @memberOf _.templateSettings
  2710. * @type {RegExp}
  2711. */
  2712. 'escape': reEscape,
  2713. /**
  2714. * Used to detect code to be evaluated.
  2715. *
  2716. * @memberOf _.templateSettings
  2717. * @type {RegExp}
  2718. */
  2719. 'evaluate': reEvaluate,
  2720. /**
  2721. * Used to detect `data` property values to inject.
  2722. *
  2723. * @memberOf _.templateSettings
  2724. * @type {RegExp}
  2725. */
  2726. 'interpolate': reInterpolate,
  2727. /**
  2728. * Used to reference the data object in the template text.
  2729. *
  2730. * @memberOf _.templateSettings
  2731. * @type {string}
  2732. */
  2733. 'variable': '',
  2734. /**
  2735. * Used to import variables into the compiled template.
  2736. *
  2737. * @memberOf _.templateSettings
  2738. * @type {Object}
  2739. */
  2740. 'imports': {
  2741. /**
  2742. * A reference to the `lodash` function.
  2743. *
  2744. * @memberOf _.templateSettings.imports
  2745. * @type {Function}
  2746. */
  2747. '_': lodash
  2748. }
  2749. };
  2750. // Ensure wrappers are instances of `baseLodash`.
  2751. lodash.prototype = baseLodash.prototype;
  2752. lodash.prototype.constructor = lodash;
  2753. LodashWrapper.prototype = baseCreate(baseLodash.prototype);
  2754. LodashWrapper.prototype.constructor = LodashWrapper;
  2755. /*------------------------------------------------------------------------*/
  2756. /**
  2757. * Creates a lazy wrapper object which wraps `value` to enable lazy evaluation.
  2758. *
  2759. * @private
  2760. * @constructor
  2761. * @param {*} value The value to wrap.
  2762. */
  2763. function LazyWrapper(value) {
  2764. this.__wrapped__ = value;
  2765. this.__actions__ = [];
  2766. this.__dir__ = 1;
  2767. this.__filtered__ = false;
  2768. this.__iteratees__ = [];
  2769. this.__takeCount__ = MAX_ARRAY_LENGTH;
  2770. this.__views__ = [];
  2771. }
  2772. /**
  2773. * Creates a clone of the lazy wrapper object.
  2774. *
  2775. * @private
  2776. * @name clone
  2777. * @memberOf LazyWrapper
  2778. * @returns {Object} Returns the cloned `LazyWrapper` object.
  2779. */
  2780. function lazyClone() {
  2781. var result = new LazyWrapper(this.__wrapped__);
  2782. result.__actions__ = copyArray(this.__actions__);
  2783. result.__dir__ = this.__dir__;
  2784. result.__filtered__ = this.__filtered__;
  2785. result.__iteratees__ = copyArray(this.__iteratees__);
  2786. result.__takeCount__ = this.__takeCount__;
  2787. result.__views__ = copyArray(this.__views__);
  2788. return result;
  2789. }
  2790. /**
  2791. * Reverses the direction of lazy iteration.
  2792. *
  2793. * @private
  2794. * @name reverse
  2795. * @memberOf LazyWrapper
  2796. * @returns {Object} Returns the new reversed `LazyWrapper` object.
  2797. */
  2798. function lazyReverse() {
  2799. if (this.__filtered__) {
  2800. var result = new LazyWrapper(this);
  2801. result.__dir__ = -1;
  2802. result.__filtered__ = true;
  2803. } else {
  2804. result = this.clone();
  2805. result.__dir__ *= -1;
  2806. }
  2807. return result;
  2808. }
  2809. /**
  2810. * Extracts the unwrapped value from its lazy wrapper.
  2811. *
  2812. * @private
  2813. * @name value
  2814. * @memberOf LazyWrapper
  2815. * @returns {*} Returns the unwrapped value.
  2816. */
  2817. function lazyValue() {
  2818. var array = this.__wrapped__.value(),
  2819. dir = this.__dir__,
  2820. isArr = isArray(array),
  2821. isRight = dir < 0,
  2822. arrLength = isArr ? array.length : 0,
  2823. view = getView(0, arrLength, this.__views__),
  2824. start = view.start,
  2825. end = view.end,
  2826. length = end - start,
  2827. index = isRight ? end : (start - 1),
  2828. iteratees = this.__iteratees__,
  2829. iterLength = iteratees.length,
  2830. resIndex = 0,
  2831. takeCount = nativeMin(length, this.__takeCount__);
  2832. if (!isArr || (!isRight && arrLength == length && takeCount == length)) {
  2833. return baseWrapperValue(array, this.__actions__);
  2834. }
  2835. var result = [];
  2836. outer:
  2837. while (length-- && resIndex < takeCount) {
  2838. index += dir;
  2839. var iterIndex = -1,
  2840. value = array[index];
  2841. while (++iterIndex < iterLength) {
  2842. var data = iteratees[iterIndex],
  2843. iteratee = data.iteratee,
  2844. type = data.type,
  2845. computed = iteratee(value);
  2846. if (type == LAZY_MAP_FLAG) {
  2847. value = computed;
  2848. } else if (!computed) {
  2849. if (type == LAZY_FILTER_FLAG) {
  2850. continue outer;
  2851. } else {
  2852. break outer;
  2853. }
  2854. }
  2855. }
  2856. result[resIndex++] = value;
  2857. }
  2858. return result;
  2859. }
  2860. // Ensure `LazyWrapper` is an instance of `baseLodash`.
  2861. LazyWrapper.prototype = baseCreate(baseLodash.prototype);
  2862. LazyWrapper.prototype.constructor = LazyWrapper;
  2863. /*------------------------------------------------------------------------*/
  2864. /**
  2865. * Creates a hash object.
  2866. *
  2867. * @private
  2868. * @constructor
  2869. * @param {Array} [entries] The key-value pairs to cache.
  2870. */
  2871. function Hash(entries) {
  2872. var index = -1,
  2873. length = entries == null ? 0 : entries.length;
  2874. this.clear();
  2875. while (++index < length) {
  2876. var entry = entries[index];
  2877. this.set(entry[0], entry[1]);
  2878. }
  2879. }
  2880. /**
  2881. * Removes all key-value entries from the hash.
  2882. *
  2883. * @private
  2884. * @name clear
  2885. * @memberOf Hash
  2886. */
  2887. function hashClear() {
  2888. this.__data__ = nativeCreate ? nativeCreate(null) : {};
  2889. this.size = 0;
  2890. }
  2891. /**
  2892. * Removes `key` and its value from the hash.
  2893. *
  2894. * @private
  2895. * @name delete
  2896. * @memberOf Hash
  2897. * @param {Object} hash The hash to modify.
  2898. * @param {string} key The key of the value to remove.
  2899. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  2900. */
  2901. function hashDelete(key) {
  2902. var result = this.has(key) && delete this.__data__[key];
  2903. this.size -= result ? 1 : 0;
  2904. return result;
  2905. }
  2906. /**
  2907. * Gets the hash value for `key`.
  2908. *
  2909. * @private
  2910. * @name get
  2911. * @memberOf Hash
  2912. * @param {string} key The key of the value to get.
  2913. * @returns {*} Returns the entry value.
  2914. */
  2915. function hashGet(key) {
  2916. var data = this.__data__;
  2917. if (nativeCreate) {
  2918. var result = data[key];
  2919. return result === HASH_UNDEFINED ? undefined : result;
  2920. }
  2921. return hasOwnProperty.call(data, key) ? data[key] : undefined;
  2922. }
  2923. /**
  2924. * Checks if a hash value for `key` exists.
  2925. *
  2926. * @private
  2927. * @name has
  2928. * @memberOf Hash
  2929. * @param {string} key The key of the entry to check.
  2930. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  2931. */
  2932. function hashHas(key) {
  2933. var data = this.__data__;
  2934. return nativeCreate ? (data[key] !== undefined) : hasOwnProperty.call(data, key);
  2935. }
  2936. /**
  2937. * Sets the hash `key` to `value`.
  2938. *
  2939. * @private
  2940. * @name set
  2941. * @memberOf Hash
  2942. * @param {string} key The key of the value to set.
  2943. * @param {*} value The value to set.
  2944. * @returns {Object} Returns the hash instance.
  2945. */
  2946. function hashSet(key, value) {
  2947. var data = this.__data__;
  2948. this.size += this.has(key) ? 0 : 1;
  2949. data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value;
  2950. return this;
  2951. }
  2952. // Add methods to `Hash`.
  2953. Hash.prototype.clear = hashClear;
  2954. Hash.prototype['delete'] = hashDelete;
  2955. Hash.prototype.get = hashGet;
  2956. Hash.prototype.has = hashHas;
  2957. Hash.prototype.set = hashSet;
  2958. /*------------------------------------------------------------------------*/
  2959. /**
  2960. * Creates an list cache object.
  2961. *
  2962. * @private
  2963. * @constructor
  2964. * @param {Array} [entries] The key-value pairs to cache.
  2965. */
  2966. function ListCache(entries) {
  2967. var index = -1,
  2968. length = entries == null ? 0 : entries.length;
  2969. this.clear();
  2970. while (++index < length) {
  2971. var entry = entries[index];
  2972. this.set(entry[0], entry[1]);
  2973. }
  2974. }
  2975. /**
  2976. * Removes all key-value entries from the list cache.
  2977. *
  2978. * @private
  2979. * @name clear
  2980. * @memberOf ListCache
  2981. */
  2982. function listCacheClear() {
  2983. this.__data__ = [];
  2984. this.size = 0;
  2985. }
  2986. /**
  2987. * Removes `key` and its value from the list cache.
  2988. *
  2989. * @private
  2990. * @name delete
  2991. * @memberOf ListCache
  2992. * @param {string} key The key of the value to remove.
  2993. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  2994. */
  2995. function listCacheDelete(key) {
  2996. var data = this.__data__,
  2997. index = assocIndexOf(data, key);
  2998. if (index < 0) {
  2999. return false;
  3000. }
  3001. var lastIndex = data.length - 1;
  3002. if (index == lastIndex) {
  3003. data.pop();
  3004. } else {
  3005. splice.call(data, index, 1);
  3006. }
  3007. --this.size;
  3008. return true;
  3009. }
  3010. /**
  3011. * Gets the list cache value for `key`.
  3012. *
  3013. * @private
  3014. * @name get
  3015. * @memberOf ListCache
  3016. * @param {string} key The key of the value to get.
  3017. * @returns {*} Returns the entry value.
  3018. */
  3019. function listCacheGet(key) {
  3020. var data = this.__data__,
  3021. index = assocIndexOf(data, key);
  3022. return index < 0 ? undefined : data[index][1];
  3023. }
  3024. /**
  3025. * Checks if a list cache value for `key` exists.
  3026. *
  3027. * @private
  3028. * @name has
  3029. * @memberOf ListCache
  3030. * @param {string} key The key of the entry to check.
  3031. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  3032. */
  3033. function listCacheHas(key) {
  3034. return assocIndexOf(this.__data__, key) > -1;
  3035. }
  3036. /**
  3037. * Sets the list cache `key` to `value`.
  3038. *
  3039. * @private
  3040. * @name set
  3041. * @memberOf ListCache
  3042. * @param {string} key The key of the value to set.
  3043. * @param {*} value The value to set.
  3044. * @returns {Object} Returns the list cache instance.
  3045. */
  3046. function listCacheSet(key, value) {
  3047. var data = this.__data__,
  3048. index = assocIndexOf(data, key);
  3049. if (index < 0) {
  3050. ++this.size;
  3051. data.push([key, value]);
  3052. } else {
  3053. data[index][1] = value;
  3054. }
  3055. return this;
  3056. }
  3057. // Add methods to `ListCache`.
  3058. ListCache.prototype.clear = listCacheClear;
  3059. ListCache.prototype['delete'] = listCacheDelete;
  3060. ListCache.prototype.get = listCacheGet;
  3061. ListCache.prototype.has = listCacheHas;
  3062. ListCache.prototype.set = listCacheSet;
  3063. /*------------------------------------------------------------------------*/
  3064. /**
  3065. * Creates a map cache object to store key-value pairs.
  3066. *
  3067. * @private
  3068. * @constructor
  3069. * @param {Array} [entries] The key-value pairs to cache.
  3070. */
  3071. function MapCache(entries) {
  3072. var index = -1,
  3073. length = entries == null ? 0 : entries.length;
  3074. this.clear();
  3075. while (++index < length) {
  3076. var entry = entries[index];
  3077. this.set(entry[0], entry[1]);
  3078. }
  3079. }
  3080. /**
  3081. * Removes all key-value entries from the map.
  3082. *
  3083. * @private
  3084. * @name clear
  3085. * @memberOf MapCache
  3086. */
  3087. function mapCacheClear() {
  3088. this.size = 0;
  3089. this.__data__ = {
  3090. 'hash': new Hash,
  3091. 'map': new (Map || ListCache),
  3092. 'string': new Hash
  3093. };
  3094. }
  3095. /**
  3096. * Removes `key` and its value from the map.
  3097. *
  3098. * @private
  3099. * @name delete
  3100. * @memberOf MapCache
  3101. * @param {string} key The key of the value to remove.
  3102. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  3103. */
  3104. function mapCacheDelete(key) {
  3105. var result = getMapData(this, key)['delete'](key);
  3106. this.size -= result ? 1 : 0;
  3107. return result;
  3108. }
  3109. /**
  3110. * Gets the map value for `key`.
  3111. *
  3112. * @private
  3113. * @name get
  3114. * @memberOf MapCache
  3115. * @param {string} key The key of the value to get.
  3116. * @returns {*} Returns the entry value.
  3117. */
  3118. function mapCacheGet(key) {
  3119. return getMapData(this, key).get(key);
  3120. }
  3121. /**
  3122. * Checks if a map value for `key` exists.
  3123. *
  3124. * @private
  3125. * @name has
  3126. * @memberOf MapCache
  3127. * @param {string} key The key of the entry to check.
  3128. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  3129. */
  3130. function mapCacheHas(key) {
  3131. return getMapData(this, key).has(key);
  3132. }
  3133. /**
  3134. * Sets the map `key` to `value`.
  3135. *
  3136. * @private
  3137. * @name set
  3138. * @memberOf MapCache
  3139. * @param {string} key The key of the value to set.
  3140. * @param {*} value The value to set.
  3141. * @returns {Object} Returns the map cache instance.
  3142. */
  3143. function mapCacheSet(key, value) {
  3144. var data = getMapData(this, key),
  3145. size = data.size;
  3146. data.set(key, value);
  3147. this.size += data.size == size ? 0 : 1;
  3148. return this;
  3149. }
  3150. // Add methods to `MapCache`.
  3151. MapCache.prototype.clear = mapCacheClear;
  3152. MapCache.prototype['delete'] = mapCacheDelete;
  3153. MapCache.prototype.get = mapCacheGet;
  3154. MapCache.prototype.has = mapCacheHas;
  3155. MapCache.prototype.set = mapCacheSet;
  3156. /*------------------------------------------------------------------------*/
  3157. /**
  3158. *
  3159. * Creates an array cache object to store unique values.
  3160. *
  3161. * @private
  3162. * @constructor
  3163. * @param {Array} [values] The values to cache.
  3164. */
  3165. function SetCache(values) {
  3166. var index = -1,
  3167. length = values == null ? 0 : values.length;
  3168. this.__data__ = new MapCache;
  3169. while (++index < length) {
  3170. this.add(values[index]);
  3171. }
  3172. }
  3173. /**
  3174. * Adds `value` to the array cache.
  3175. *
  3176. * @private
  3177. * @name add
  3178. * @memberOf SetCache
  3179. * @alias push
  3180. * @param {*} value The value to cache.
  3181. * @returns {Object} Returns the cache instance.
  3182. */
  3183. function setCacheAdd(value) {
  3184. this.__data__.set(value, HASH_UNDEFINED);
  3185. return this;
  3186. }
  3187. /**
  3188. * Checks if `value` is in the array cache.
  3189. *
  3190. * @private
  3191. * @name has
  3192. * @memberOf SetCache
  3193. * @param {*} value The value to search for.
  3194. * @returns {number} Returns `true` if `value` is found, else `false`.
  3195. */
  3196. function setCacheHas(value) {
  3197. return this.__data__.has(value);
  3198. }
  3199. // Add methods to `SetCache`.
  3200. SetCache.prototype.add = SetCache.prototype.push = setCacheAdd;
  3201. SetCache.prototype.has = setCacheHas;
  3202. /*------------------------------------------------------------------------*/
  3203. /**
  3204. * Creates a stack cache object to store key-value pairs.
  3205. *
  3206. * @private
  3207. * @constructor
  3208. * @param {Array} [entries] The key-value pairs to cache.
  3209. */
  3210. function Stack(entries) {
  3211. var data = this.__data__ = new ListCache(entries);
  3212. this.size = data.size;
  3213. }
  3214. /**
  3215. * Removes all key-value entries from the stack.
  3216. *
  3217. * @private
  3218. * @name clear
  3219. * @memberOf Stack
  3220. */
  3221. function stackClear() {
  3222. this.__data__ = new ListCache;
  3223. this.size = 0;
  3224. }
  3225. /**
  3226. * Removes `key` and its value from the stack.
  3227. *
  3228. * @private
  3229. * @name delete
  3230. * @memberOf Stack
  3231. * @param {string} key The key of the value to remove.
  3232. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  3233. */
  3234. function stackDelete(key) {
  3235. var data = this.__data__,
  3236. result = data['delete'](key);
  3237. this.size = data.size;
  3238. return result;
  3239. }
  3240. /**
  3241. * Gets the stack value for `key`.
  3242. *
  3243. * @private
  3244. * @name get
  3245. * @memberOf Stack
  3246. * @param {string} key The key of the value to get.
  3247. * @returns {*} Returns the entry value.
  3248. */
  3249. function stackGet(key) {
  3250. return this.__data__.get(key);
  3251. }
  3252. /**
  3253. * Checks if a stack value for `key` exists.
  3254. *
  3255. * @private
  3256. * @name has
  3257. * @memberOf Stack
  3258. * @param {string} key The key of the entry to check.
  3259. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  3260. */
  3261. function stackHas(key) {
  3262. return this.__data__.has(key);
  3263. }
  3264. /**
  3265. * Sets the stack `key` to `value`.
  3266. *
  3267. * @private
  3268. * @name set
  3269. * @memberOf Stack
  3270. * @param {string} key The key of the value to set.
  3271. * @param {*} value The value to set.
  3272. * @returns {Object} Returns the stack cache instance.
  3273. */
  3274. function stackSet(key, value) {
  3275. var data = this.__data__;
  3276. if (data instanceof ListCache) {
  3277. var pairs = data.__data__;
  3278. if (!Map || (pairs.length < LARGE_ARRAY_SIZE - 1)) {
  3279. pairs.push([key, value]);
  3280. this.size = ++data.size;
  3281. return this;
  3282. }
  3283. data = this.__data__ = new MapCache(pairs);
  3284. }
  3285. data.set(key, value);
  3286. this.size = data.size;
  3287. return this;
  3288. }
  3289. // Add methods to `Stack`.
  3290. Stack.prototype.clear = stackClear;
  3291. Stack.prototype['delete'] = stackDelete;
  3292. Stack.prototype.get = stackGet;
  3293. Stack.prototype.has = stackHas;
  3294. Stack.prototype.set = stackSet;
  3295. /*------------------------------------------------------------------------*/
  3296. /**
  3297. * Creates an array of the enumerable property names of the array-like `value`.
  3298. *
  3299. * @private
  3300. * @param {*} value The value to query.
  3301. * @param {boolean} inherited Specify returning inherited property names.
  3302. * @returns {Array} Returns the array of property names.
  3303. */
  3304. function arrayLikeKeys(value, inherited) {
  3305. var isArr = isArray(value),
  3306. isArg = !isArr && isArguments(value),
  3307. isBuff = !isArr && !isArg && isBuffer(value),
  3308. isType = !isArr && !isArg && !isBuff && isTypedArray(value),
  3309. skipIndexes = isArr || isArg || isBuff || isType,
  3310. result = skipIndexes ? baseTimes(value.length, String) : [],
  3311. length = result.length;
  3312. for (var key in value) {
  3313. if ((inherited || hasOwnProperty.call(value, key)) &&
  3314. !(skipIndexes && (
  3315. // Safari 9 has enumerable `arguments.length` in strict mode.
  3316. key == 'length' ||
  3317. // Node.js 0.10 has enumerable non-index properties on buffers.
  3318. (isBuff && (key == 'offset' || key == 'parent')) ||
  3319. // PhantomJS 2 has enumerable non-index properties on typed arrays.
  3320. (isType && (key == 'buffer' || key == 'byteLength' || key == 'byteOffset')) ||
  3321. // Skip index properties.
  3322. isIndex(key, length)
  3323. ))) {
  3324. result.push(key);
  3325. }
  3326. }
  3327. return result;
  3328. }
  3329. /**
  3330. * A specialized version of `_.sample` for arrays.
  3331. *
  3332. * @private
  3333. * @param {Array} array The array to sample.
  3334. * @returns {*} Returns the random element.
  3335. */
  3336. function arraySample(array) {
  3337. var length = array.length;
  3338. return length ? array[baseRandom(0, length - 1)] : undefined;
  3339. }
  3340. /**
  3341. * A specialized version of `_.sampleSize` for arrays.
  3342. *
  3343. * @private
  3344. * @param {Array} array The array to sample.
  3345. * @param {number} n The number of elements to sample.
  3346. * @returns {Array} Returns the random elements.
  3347. */
  3348. function arraySampleSize(array, n) {
  3349. return shuffleSelf(copyArray(array), baseClamp(n, 0, array.length));
  3350. }
  3351. /**
  3352. * A specialized version of `_.shuffle` for arrays.
  3353. *
  3354. * @private
  3355. * @param {Array} array The array to shuffle.
  3356. * @returns {Array} Returns the new shuffled array.
  3357. */
  3358. function arrayShuffle(array) {
  3359. return shuffleSelf(copyArray(array));
  3360. }
  3361. /**
  3362. * This function is like `assignValue` except that it doesn't assign
  3363. * `undefined` values.
  3364. *
  3365. * @private
  3366. * @param {Object} object The object to modify.
  3367. * @param {string} key The key of the property to assign.
  3368. * @param {*} value The value to assign.
  3369. */
  3370. function assignMergeValue(object, key, value) {
  3371. if ((value !== undefined && !eq(object[key], value)) ||
  3372. (value === undefined && !(key in object))) {
  3373. baseAssignValue(object, key, value);
  3374. }
  3375. }
  3376. /**
  3377. * Assigns `value` to `key` of `object` if the existing value is not equivalent
  3378. * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  3379. * for equality comparisons.
  3380. *
  3381. * @private
  3382. * @param {Object} object The object to modify.
  3383. * @param {string} key The key of the property to assign.
  3384. * @param {*} value The value to assign.
  3385. */
  3386. function assignValue(object, key, value) {
  3387. var objValue = object[key];
  3388. if (!(hasOwnProperty.call(object, key) && eq(objValue, value)) ||
  3389. (value === undefined && !(key in object))) {
  3390. baseAssignValue(object, key, value);
  3391. }
  3392. }
  3393. /**
  3394. * Gets the index at which the `key` is found in `array` of key-value pairs.
  3395. *
  3396. * @private
  3397. * @param {Array} array The array to inspect.
  3398. * @param {*} key The key to search for.
  3399. * @returns {number} Returns the index of the matched value, else `-1`.
  3400. */
  3401. function assocIndexOf(array, key) {
  3402. var length = array.length;
  3403. while (length--) {
  3404. if (eq(array[length][0], key)) {
  3405. return length;
  3406. }
  3407. }
  3408. return -1;
  3409. }
  3410. /**
  3411. * Aggregates elements of `collection` on `accumulator` with keys transformed
  3412. * by `iteratee` and values set by `setter`.
  3413. *
  3414. * @private
  3415. * @param {Array|Object} collection The collection to iterate over.
  3416. * @param {Function} setter The function to set `accumulator` values.
  3417. * @param {Function} iteratee The iteratee to transform keys.
  3418. * @param {Object} accumulator The initial aggregated object.
  3419. * @returns {Function} Returns `accumulator`.
  3420. */
  3421. function baseAggregator(collection, setter, iteratee, accumulator) {
  3422. baseEach(collection, function(value, key, collection) {
  3423. setter(accumulator, value, iteratee(value), collection);
  3424. });
  3425. return accumulator;
  3426. }
  3427. /**
  3428. * The base implementation of `_.assign` without support for multiple sources
  3429. * or `customizer` functions.
  3430. *
  3431. * @private
  3432. * @param {Object} object The destination object.
  3433. * @param {Object} source The source object.
  3434. * @returns {Object} Returns `object`.
  3435. */
  3436. function baseAssign(object, source) {
  3437. return object && copyObject(source, keys(source), object);
  3438. }
  3439. /**
  3440. * The base implementation of `_.assignIn` without support for multiple sources
  3441. * or `customizer` functions.
  3442. *
  3443. * @private
  3444. * @param {Object} object The destination object.
  3445. * @param {Object} source The source object.
  3446. * @returns {Object} Returns `object`.
  3447. */
  3448. function baseAssignIn(object, source) {
  3449. return object && copyObject(source, keysIn(source), object);
  3450. }
  3451. /**
  3452. * The base implementation of `assignValue` and `assignMergeValue` without
  3453. * value checks.
  3454. *
  3455. * @private
  3456. * @param {Object} object The object to modify.
  3457. * @param {string} key The key of the property to assign.
  3458. * @param {*} value The value to assign.
  3459. */
  3460. function baseAssignValue(object, key, value) {
  3461. if (key == '__proto__' && defineProperty) {
  3462. defineProperty(object, key, {
  3463. 'configurable': true,
  3464. 'enumerable': true,
  3465. 'value': value,
  3466. 'writable': true
  3467. });
  3468. } else {
  3469. object[key] = value;
  3470. }
  3471. }
  3472. /**
  3473. * The base implementation of `_.at` without support for individual paths.
  3474. *
  3475. * @private
  3476. * @param {Object} object The object to iterate over.
  3477. * @param {string[]} paths The property paths to pick.
  3478. * @returns {Array} Returns the picked elements.
  3479. */
  3480. function baseAt(object, paths) {
  3481. var index = -1,
  3482. length = paths.length,
  3483. result = Array(length),
  3484. skip = object == null;
  3485. while (++index < length) {
  3486. result[index] = skip ? undefined : get(object, paths[index]);
  3487. }
  3488. return result;
  3489. }
  3490. /**
  3491. * The base implementation of `_.clamp` which doesn't coerce arguments.
  3492. *
  3493. * @private
  3494. * @param {number} number The number to clamp.
  3495. * @param {number} [lower] The lower bound.
  3496. * @param {number} upper The upper bound.
  3497. * @returns {number} Returns the clamped number.
  3498. */
  3499. function baseClamp(number, lower, upper) {
  3500. if (number === number) {
  3501. if (upper !== undefined) {
  3502. number = number <= upper ? number : upper;
  3503. }
  3504. if (lower !== undefined) {
  3505. number = number >= lower ? number : lower;
  3506. }
  3507. }
  3508. return number;
  3509. }
  3510. /**
  3511. * The base implementation of `_.clone` and `_.cloneDeep` which tracks
  3512. * traversed objects.
  3513. *
  3514. * @private
  3515. * @param {*} value The value to clone.
  3516. * @param {boolean} bitmask The bitmask flags.
  3517. * 1 - Deep clone
  3518. * 2 - Flatten inherited properties
  3519. * 4 - Clone symbols
  3520. * @param {Function} [customizer] The function to customize cloning.
  3521. * @param {string} [key] The key of `value`.
  3522. * @param {Object} [object] The parent object of `value`.
  3523. * @param {Object} [stack] Tracks traversed objects and their clone counterparts.
  3524. * @returns {*} Returns the cloned value.
  3525. */
  3526. function baseClone(value, bitmask, customizer, key, object, stack) {
  3527. var result,
  3528. isDeep = bitmask & CLONE_DEEP_FLAG,
  3529. isFlat = bitmask & CLONE_FLAT_FLAG,
  3530. isFull = bitmask & CLONE_SYMBOLS_FLAG;
  3531. if (customizer) {
  3532. result = object ? customizer(value, key, object, stack) : customizer(value);
  3533. }
  3534. if (result !== undefined) {
  3535. return result;
  3536. }
  3537. if (!isObject(value)) {
  3538. return value;
  3539. }
  3540. var isArr = isArray(value);
  3541. if (isArr) {
  3542. result = initCloneArray(value);
  3543. if (!isDeep) {
  3544. return copyArray(value, result);
  3545. }
  3546. } else {
  3547. var tag = getTag(value),
  3548. isFunc = tag == funcTag || tag == genTag;
  3549. if (isBuffer(value)) {
  3550. return cloneBuffer(value, isDeep);
  3551. }
  3552. if (tag == objectTag || tag == argsTag || (isFunc && !object)) {
  3553. result = (isFlat || isFunc) ? {} : initCloneObject(value);
  3554. if (!isDeep) {
  3555. return isFlat
  3556. ? copySymbolsIn(value, baseAssignIn(result, value))
  3557. : copySymbols(value, baseAssign(result, value));
  3558. }
  3559. } else {
  3560. if (!cloneableTags[tag]) {
  3561. return object ? value : {};
  3562. }
  3563. result = initCloneByTag(value, tag, isDeep);
  3564. }
  3565. }
  3566. // Check for circular references and return its corresponding clone.
  3567. stack || (stack = new Stack);
  3568. var stacked = stack.get(value);
  3569. if (stacked) {
  3570. return stacked;
  3571. }
  3572. stack.set(value, result);
  3573. if (isSet(value)) {
  3574. value.forEach(function(subValue) {
  3575. result.add(baseClone(subValue, bitmask, customizer, subValue, value, stack));
  3576. });
  3577. } else if (isMap(value)) {
  3578. value.forEach(function(subValue, key) {
  3579. result.set(key, baseClone(subValue, bitmask, customizer, key, value, stack));
  3580. });
  3581. }
  3582. var keysFunc = isFull
  3583. ? (isFlat ? getAllKeysIn : getAllKeys)
  3584. : (isFlat ? keysIn : keys);
  3585. var props = isArr ? undefined : keysFunc(value);
  3586. arrayEach(props || value, function(subValue, key) {
  3587. if (props) {
  3588. key = subValue;
  3589. subValue = value[key];
  3590. }
  3591. // Recursively populate clone (susceptible to call stack limits).
  3592. assignValue(result, key, baseClone(subValue, bitmask, customizer, key, value, stack));
  3593. });
  3594. return result;
  3595. }
  3596. /**
  3597. * The base implementation of `_.conforms` which doesn't clone `source`.
  3598. *
  3599. * @private
  3600. * @param {Object} source The object of property predicates to conform to.
  3601. * @returns {Function} Returns the new spec function.
  3602. */
  3603. function baseConforms(source) {
  3604. var props = keys(source);
  3605. return function(object) {
  3606. return baseConformsTo(object, source, props);
  3607. };
  3608. }
  3609. /**
  3610. * The base implementation of `_.conformsTo` which accepts `props` to check.
  3611. *
  3612. * @private
  3613. * @param {Object} object The object to inspect.
  3614. * @param {Object} source The object of property predicates to conform to.
  3615. * @returns {boolean} Returns `true` if `object` conforms, else `false`.
  3616. */
  3617. function baseConformsTo(object, source, props) {
  3618. var length = props.length;
  3619. if (object == null) {
  3620. return !length;
  3621. }
  3622. object = Object(object);
  3623. while (length--) {
  3624. var key = props[length],
  3625. predicate = source[key],
  3626. value = object[key];
  3627. if ((value === undefined && !(key in object)) || !predicate(value)) {
  3628. return false;
  3629. }
  3630. }
  3631. return true;
  3632. }
  3633. /**
  3634. * The base implementation of `_.delay` and `_.defer` which accepts `args`
  3635. * to provide to `func`.
  3636. *
  3637. * @private
  3638. * @param {Function} func The function to delay.
  3639. * @param {number} wait The number of milliseconds to delay invocation.
  3640. * @param {Array} args The arguments to provide to `func`.
  3641. * @returns {number|Object} Returns the timer id or timeout object.
  3642. */
  3643. function baseDelay(func, wait, args) {
  3644. if (typeof func != 'function') {
  3645. throw new TypeError(FUNC_ERROR_TEXT);
  3646. }
  3647. return setTimeout(function() { func.apply(undefined, args); }, wait);
  3648. }
  3649. /**
  3650. * The base implementation of methods like `_.difference` without support
  3651. * for excluding multiple arrays or iteratee shorthands.
  3652. *
  3653. * @private
  3654. * @param {Array} array The array to inspect.
  3655. * @param {Array} values The values to exclude.
  3656. * @param {Function} [iteratee] The iteratee invoked per element.
  3657. * @param {Function} [comparator] The comparator invoked per element.
  3658. * @returns {Array} Returns the new array of filtered values.
  3659. */
  3660. function baseDifference(array, values, iteratee, comparator) {
  3661. var index = -1,
  3662. includes = arrayIncludes,
  3663. isCommon = true,
  3664. length = array.length,
  3665. result = [],
  3666. valuesLength = values.length;
  3667. if (!length) {
  3668. return result;
  3669. }
  3670. if (iteratee) {
  3671. values = arrayMap(values, baseUnary(iteratee));
  3672. }
  3673. if (comparator) {
  3674. includes = arrayIncludesWith;
  3675. isCommon = false;
  3676. }
  3677. else if (values.length >= LARGE_ARRAY_SIZE) {
  3678. includes = cacheHas;
  3679. isCommon = false;
  3680. values = new SetCache(values);
  3681. }
  3682. outer:
  3683. while (++index < length) {
  3684. var value = array[index],
  3685. computed = iteratee == null ? value : iteratee(value);
  3686. value = (comparator || value !== 0) ? value : 0;
  3687. if (isCommon && computed === computed) {
  3688. var valuesIndex = valuesLength;
  3689. while (valuesIndex--) {
  3690. if (values[valuesIndex] === computed) {
  3691. continue outer;
  3692. }
  3693. }
  3694. result.push(value);
  3695. }
  3696. else if (!includes(values, computed, comparator)) {
  3697. result.push(value);
  3698. }
  3699. }
  3700. return result;
  3701. }
  3702. /**
  3703. * The base implementation of `_.forEach` without support for iteratee shorthands.
  3704. *
  3705. * @private
  3706. * @param {Array|Object} collection The collection to iterate over.
  3707. * @param {Function} iteratee The function invoked per iteration.
  3708. * @returns {Array|Object} Returns `collection`.
  3709. */
  3710. var baseEach = createBaseEach(baseForOwn);
  3711. /**
  3712. * The base implementation of `_.forEachRight` without support for iteratee shorthands.
  3713. *
  3714. * @private
  3715. * @param {Array|Object} collection The collection to iterate over.
  3716. * @param {Function} iteratee The function invoked per iteration.
  3717. * @returns {Array|Object} Returns `collection`.
  3718. */
  3719. var baseEachRight = createBaseEach(baseForOwnRight, true);
  3720. /**
  3721. * The base implementation of `_.every` without support for iteratee shorthands.
  3722. *
  3723. * @private
  3724. * @param {Array|Object} collection The collection to iterate over.
  3725. * @param {Function} predicate The function invoked per iteration.
  3726. * @returns {boolean} Returns `true` if all elements pass the predicate check,
  3727. * else `false`
  3728. */
  3729. function baseEvery(collection, predicate) {
  3730. var result = true;
  3731. baseEach(collection, function(value, index, collection) {
  3732. result = !!predicate(value, index, collection);
  3733. return result;
  3734. });
  3735. return result;
  3736. }
  3737. /**
  3738. * The base implementation of methods like `_.max` and `_.min` which accepts a
  3739. * `comparator` to determine the extremum value.
  3740. *
  3741. * @private
  3742. * @param {Array} array The array to iterate over.
  3743. * @param {Function} iteratee The iteratee invoked per iteration.
  3744. * @param {Function} comparator The comparator used to compare values.
  3745. * @returns {*} Returns the extremum value.
  3746. */
  3747. function baseExtremum(array, iteratee, comparator) {
  3748. var index = -1,
  3749. length = array.length;
  3750. while (++index < length) {
  3751. var value = array[index],
  3752. current = iteratee(value);
  3753. if (current != null && (computed === undefined
  3754. ? (current === current && !isSymbol(current))
  3755. : comparator(current, computed)
  3756. )) {
  3757. var computed = current,
  3758. result = value;
  3759. }
  3760. }
  3761. return result;
  3762. }
  3763. /**
  3764. * The base implementation of `_.fill` without an iteratee call guard.
  3765. *
  3766. * @private
  3767. * @param {Array} array The array to fill.
  3768. * @param {*} value The value to fill `array` with.
  3769. * @param {number} [start=0] The start position.
  3770. * @param {number} [end=array.length] The end position.
  3771. * @returns {Array} Returns `array`.
  3772. */
  3773. function baseFill(array, value, start, end) {
  3774. var length = array.length;
  3775. start = toInteger(start);
  3776. if (start < 0) {
  3777. start = -start > length ? 0 : (length + start);
  3778. }
  3779. end = (end === undefined || end > length) ? length : toInteger(end);
  3780. if (end < 0) {
  3781. end += length;
  3782. }
  3783. end = start > end ? 0 : toLength(end);
  3784. while (start < end) {
  3785. array[start++] = value;
  3786. }
  3787. return array;
  3788. }
  3789. /**
  3790. * The base implementation of `_.filter` without support for iteratee shorthands.
  3791. *
  3792. * @private
  3793. * @param {Array|Object} collection The collection to iterate over.
  3794. * @param {Function} predicate The function invoked per iteration.
  3795. * @returns {Array} Returns the new filtered array.
  3796. */
  3797. function baseFilter(collection, predicate) {
  3798. var result = [];
  3799. baseEach(collection, function(value, index, collection) {
  3800. if (predicate(value, index, collection)) {
  3801. result.push(value);
  3802. }
  3803. });
  3804. return result;
  3805. }
  3806. /**
  3807. * The base implementation of `_.flatten` with support for restricting flattening.
  3808. *
  3809. * @private
  3810. * @param {Array} array The array to flatten.
  3811. * @param {number} depth The maximum recursion depth.
  3812. * @param {boolean} [predicate=isFlattenable] The function invoked per iteration.
  3813. * @param {boolean} [isStrict] Restrict to values that pass `predicate` checks.
  3814. * @param {Array} [result=[]] The initial result value.
  3815. * @returns {Array} Returns the new flattened array.
  3816. */
  3817. function baseFlatten(array, depth, predicate, isStrict, result) {
  3818. var index = -1,
  3819. length = array.length;
  3820. predicate || (predicate = isFlattenable);
  3821. result || (result = []);
  3822. while (++index < length) {
  3823. var value = array[index];
  3824. if (depth > 0 && predicate(value)) {
  3825. if (depth > 1) {
  3826. // Recursively flatten arrays (susceptible to call stack limits).
  3827. baseFlatten(value, depth - 1, predicate, isStrict, result);
  3828. } else {
  3829. arrayPush(result, value);
  3830. }
  3831. } else if (!isStrict) {
  3832. result[result.length] = value;
  3833. }
  3834. }
  3835. return result;
  3836. }
  3837. /**
  3838. * The base implementation of `baseForOwn` which iterates over `object`
  3839. * properties returned by `keysFunc` and invokes `iteratee` for each property.
  3840. * Iteratee functions may exit iteration early by explicitly returning `false`.
  3841. *
  3842. * @private
  3843. * @param {Object} object The object to iterate over.
  3844. * @param {Function} iteratee The function invoked per iteration.
  3845. * @param {Function} keysFunc The function to get the keys of `object`.
  3846. * @returns {Object} Returns `object`.
  3847. */
  3848. var baseFor = createBaseFor();
  3849. /**
  3850. * This function is like `baseFor` except that it iterates over properties
  3851. * in the opposite order.
  3852. *
  3853. * @private
  3854. * @param {Object} object The object to iterate over.
  3855. * @param {Function} iteratee The function invoked per iteration.
  3856. * @param {Function} keysFunc The function to get the keys of `object`.
  3857. * @returns {Object} Returns `object`.
  3858. */
  3859. var baseForRight = createBaseFor(true);
  3860. /**
  3861. * The base implementation of `_.forOwn` without support for iteratee shorthands.
  3862. *
  3863. * @private
  3864. * @param {Object} object The object to iterate over.
  3865. * @param {Function} iteratee The function invoked per iteration.
  3866. * @returns {Object} Returns `object`.
  3867. */
  3868. function baseForOwn(object, iteratee) {
  3869. return object && baseFor(object, iteratee, keys);
  3870. }
  3871. /**
  3872. * The base implementation of `_.forOwnRight` without support for iteratee shorthands.
  3873. *
  3874. * @private
  3875. * @param {Object} object The object to iterate over.
  3876. * @param {Function} iteratee The function invoked per iteration.
  3877. * @returns {Object} Returns `object`.
  3878. */
  3879. function baseForOwnRight(object, iteratee) {
  3880. return object && baseForRight(object, iteratee, keys);
  3881. }
  3882. /**
  3883. * The base implementation of `_.functions` which creates an array of
  3884. * `object` function property names filtered from `props`.
  3885. *
  3886. * @private
  3887. * @param {Object} object The object to inspect.
  3888. * @param {Array} props The property names to filter.
  3889. * @returns {Array} Returns the function names.
  3890. */
  3891. function baseFunctions(object, props) {
  3892. return arrayFilter(props, function(key) {
  3893. return isFunction(object[key]);
  3894. });
  3895. }
  3896. /**
  3897. * The base implementation of `_.get` without support for default values.
  3898. *
  3899. * @private
  3900. * @param {Object} object The object to query.
  3901. * @param {Array|string} path The path of the property to get.
  3902. * @returns {*} Returns the resolved value.
  3903. */
  3904. function baseGet(object, path) {
  3905. path = castPath(path, object);
  3906. var index = 0,
  3907. length = path.length;
  3908. while (object != null && index < length) {
  3909. object = object[toKey(path[index++])];
  3910. }
  3911. return (index && index == length) ? object : undefined;
  3912. }
  3913. /**
  3914. * The base implementation of `getAllKeys` and `getAllKeysIn` which uses
  3915. * `keysFunc` and `symbolsFunc` to get the enumerable property names and
  3916. * symbols of `object`.
  3917. *
  3918. * @private
  3919. * @param {Object} object The object to query.
  3920. * @param {Function} keysFunc The function to get the keys of `object`.
  3921. * @param {Function} symbolsFunc The function to get the symbols of `object`.
  3922. * @returns {Array} Returns the array of property names and symbols.
  3923. */
  3924. function baseGetAllKeys(object, keysFunc, symbolsFunc) {
  3925. var result = keysFunc(object);
  3926. return isArray(object) ? result : arrayPush(result, symbolsFunc(object));
  3927. }
  3928. /**
  3929. * The base implementation of `getTag` without fallbacks for buggy environments.
  3930. *
  3931. * @private
  3932. * @param {*} value The value to query.
  3933. * @returns {string} Returns the `toStringTag`.
  3934. */
  3935. function baseGetTag(value) {
  3936. if (value == null) {
  3937. return value === undefined ? undefinedTag : nullTag;
  3938. }
  3939. return (symToStringTag && symToStringTag in Object(value))
  3940. ? getRawTag(value)
  3941. : objectToString(value);
  3942. }
  3943. /**
  3944. * The base implementation of `_.gt` which doesn't coerce arguments.
  3945. *
  3946. * @private
  3947. * @param {*} value The value to compare.
  3948. * @param {*} other The other value to compare.
  3949. * @returns {boolean} Returns `true` if `value` is greater than `other`,
  3950. * else `false`.
  3951. */
  3952. function baseGt(value, other) {
  3953. return value > other;
  3954. }
  3955. /**
  3956. * The base implementation of `_.has` without support for deep paths.
  3957. *
  3958. * @private
  3959. * @param {Object} [object] The object to query.
  3960. * @param {Array|string} key The key to check.
  3961. * @returns {boolean} Returns `true` if `key` exists, else `false`.
  3962. */
  3963. function baseHas(object, key) {
  3964. return object != null && hasOwnProperty.call(object, key);
  3965. }
  3966. /**
  3967. * The base implementation of `_.hasIn` without support for deep paths.
  3968. *
  3969. * @private
  3970. * @param {Object} [object] The object to query.
  3971. * @param {Array|string} key The key to check.
  3972. * @returns {boolean} Returns `true` if `key` exists, else `false`.
  3973. */
  3974. function baseHasIn(object, key) {
  3975. return object != null && key in Object(object);
  3976. }
  3977. /**
  3978. * The base implementation of `_.inRange` which doesn't coerce arguments.
  3979. *
  3980. * @private
  3981. * @param {number} number The number to check.
  3982. * @param {number} start The start of the range.
  3983. * @param {number} end The end of the range.
  3984. * @returns {boolean} Returns `true` if `number` is in the range, else `false`.
  3985. */
  3986. function baseInRange(number, start, end) {
  3987. return number >= nativeMin(start, end) && number < nativeMax(start, end);
  3988. }
  3989. /**
  3990. * The base implementation of methods like `_.intersection`, without support
  3991. * for iteratee shorthands, that accepts an array of arrays to inspect.
  3992. *
  3993. * @private
  3994. * @param {Array} arrays The arrays to inspect.
  3995. * @param {Function} [iteratee] The iteratee invoked per element.
  3996. * @param {Function} [comparator] The comparator invoked per element.
  3997. * @returns {Array} Returns the new array of shared values.
  3998. */
  3999. function baseIntersection(arrays, iteratee, comparator) {
  4000. var includes = comparator ? arrayIncludesWith : arrayIncludes,
  4001. length = arrays[0].length,
  4002. othLength = arrays.length,
  4003. othIndex = othLength,
  4004. caches = Array(othLength),
  4005. maxLength = Infinity,
  4006. result = [];
  4007. while (othIndex--) {
  4008. var array = arrays[othIndex];
  4009. if (othIndex && iteratee) {
  4010. array = arrayMap(array, baseUnary(iteratee));
  4011. }
  4012. maxLength = nativeMin(array.length, maxLength);
  4013. caches[othIndex] = !comparator && (iteratee || (length >= 120 && array.length >= 120))
  4014. ? new SetCache(othIndex && array)
  4015. : undefined;
  4016. }
  4017. array = arrays[0];
  4018. var index = -1,
  4019. seen = caches[0];
  4020. outer:
  4021. while (++index < length && result.length < maxLength) {
  4022. var value = array[index],
  4023. computed = iteratee ? iteratee(value) : value;
  4024. value = (comparator || value !== 0) ? value : 0;
  4025. if (!(seen
  4026. ? cacheHas(seen, computed)
  4027. : includes(result, computed, comparator)
  4028. )) {
  4029. othIndex = othLength;
  4030. while (--othIndex) {
  4031. var cache = caches[othIndex];
  4032. if (!(cache
  4033. ? cacheHas(cache, computed)
  4034. : includes(arrays[othIndex], computed, comparator))
  4035. ) {
  4036. continue outer;
  4037. }
  4038. }
  4039. if (seen) {
  4040. seen.push(computed);
  4041. }
  4042. result.push(value);
  4043. }
  4044. }
  4045. return result;
  4046. }
  4047. /**
  4048. * The base implementation of `_.invert` and `_.invertBy` which inverts
  4049. * `object` with values transformed by `iteratee` and set by `setter`.
  4050. *
  4051. * @private
  4052. * @param {Object} object The object to iterate over.
  4053. * @param {Function} setter The function to set `accumulator` values.
  4054. * @param {Function} iteratee The iteratee to transform values.
  4055. * @param {Object} accumulator The initial inverted object.
  4056. * @returns {Function} Returns `accumulator`.
  4057. */
  4058. function baseInverter(object, setter, iteratee, accumulator) {
  4059. baseForOwn(object, function(value, key, object) {
  4060. setter(accumulator, iteratee(value), key, object);
  4061. });
  4062. return accumulator;
  4063. }
  4064. /**
  4065. * The base implementation of `_.invoke` without support for individual
  4066. * method arguments.
  4067. *
  4068. * @private
  4069. * @param {Object} object The object to query.
  4070. * @param {Array|string} path The path of the method to invoke.
  4071. * @param {Array} args The arguments to invoke the method with.
  4072. * @returns {*} Returns the result of the invoked method.
  4073. */
  4074. function baseInvoke(object, path, args) {
  4075. path = castPath(path, object);
  4076. object = parent(object, path);
  4077. var func = object == null ? object : object[toKey(last(path))];
  4078. return func == null ? undefined : apply(func, object, args);
  4079. }
  4080. /**
  4081. * The base implementation of `_.isArguments`.
  4082. *
  4083. * @private
  4084. * @param {*} value The value to check.
  4085. * @returns {boolean} Returns `true` if `value` is an `arguments` object,
  4086. */
  4087. function baseIsArguments(value) {
  4088. return isObjectLike(value) && baseGetTag(value) == argsTag;
  4089. }
  4090. /**
  4091. * The base implementation of `_.isArrayBuffer` without Node.js optimizations.
  4092. *
  4093. * @private
  4094. * @param {*} value The value to check.
  4095. * @returns {boolean} Returns `true` if `value` is an array buffer, else `false`.
  4096. */
  4097. function baseIsArrayBuffer(value) {
  4098. return isObjectLike(value) && baseGetTag(value) == arrayBufferTag;
  4099. }
  4100. /**
  4101. * The base implementation of `_.isDate` without Node.js optimizations.
  4102. *
  4103. * @private
  4104. * @param {*} value The value to check.
  4105. * @returns {boolean} Returns `true` if `value` is a date object, else `false`.
  4106. */
  4107. function baseIsDate(value) {
  4108. return isObjectLike(value) && baseGetTag(value) == dateTag;
  4109. }
  4110. /**
  4111. * The base implementation of `_.isEqual` which supports partial comparisons
  4112. * and tracks traversed objects.
  4113. *
  4114. * @private
  4115. * @param {*} value The value to compare.
  4116. * @param {*} other The other value to compare.
  4117. * @param {boolean} bitmask The bitmask flags.
  4118. * 1 - Unordered comparison
  4119. * 2 - Partial comparison
  4120. * @param {Function} [customizer] The function to customize comparisons.
  4121. * @param {Object} [stack] Tracks traversed `value` and `other` objects.
  4122. * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
  4123. */
  4124. function baseIsEqual(value, other, bitmask, customizer, stack) {
  4125. if (value === other) {
  4126. return true;
  4127. }
  4128. if (value == null || other == null || (!isObjectLike(value) && !isObjectLike(other))) {
  4129. return value !== value && other !== other;
  4130. }
  4131. return baseIsEqualDeep(value, other, bitmask, customizer, baseIsEqual, stack);
  4132. }
  4133. /**
  4134. * A specialized version of `baseIsEqual` for arrays and objects which performs
  4135. * deep comparisons and tracks traversed objects enabling objects with circular
  4136. * references to be compared.
  4137. *
  4138. * @private
  4139. * @param {Object} object The object to compare.
  4140. * @param {Object} other The other object to compare.
  4141. * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
  4142. * @param {Function} customizer The function to customize comparisons.
  4143. * @param {Function} equalFunc The function to determine equivalents of values.
  4144. * @param {Object} [stack] Tracks traversed `object` and `other` objects.
  4145. * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
  4146. */
  4147. function baseIsEqualDeep(object, other, bitmask, customizer, equalFunc, stack) {
  4148. var objIsArr = isArray(object),
  4149. othIsArr = isArray(other),
  4150. objTag = objIsArr ? arrayTag : getTag(object),
  4151. othTag = othIsArr ? arrayTag : getTag(other);
  4152. objTag = objTag == argsTag ? objectTag : objTag;
  4153. othTag = othTag == argsTag ? objectTag : othTag;
  4154. var objIsObj = objTag == objectTag,
  4155. othIsObj = othTag == objectTag,
  4156. isSameTag = objTag == othTag;
  4157. if (isSameTag && isBuffer(object)) {
  4158. if (!isBuffer(other)) {
  4159. return false;
  4160. }
  4161. objIsArr = true;
  4162. objIsObj = false;
  4163. }
  4164. if (isSameTag && !objIsObj) {
  4165. stack || (stack = new Stack);
  4166. return (objIsArr || isTypedArray(object))
  4167. ? equalArrays(object, other, bitmask, customizer, equalFunc, stack)
  4168. : equalByTag(object, other, objTag, bitmask, customizer, equalFunc, stack);
  4169. }
  4170. if (!(bitmask & COMPARE_PARTIAL_FLAG)) {
  4171. var objIsWrapped = objIsObj && hasOwnProperty.call(object, '__wrapped__'),
  4172. othIsWrapped = othIsObj && hasOwnProperty.call(other, '__wrapped__');
  4173. if (objIsWrapped || othIsWrapped) {
  4174. var objUnwrapped = objIsWrapped ? object.value() : object,
  4175. othUnwrapped = othIsWrapped ? other.value() : other;
  4176. stack || (stack = new Stack);
  4177. return equalFunc(objUnwrapped, othUnwrapped, bitmask, customizer, stack);
  4178. }
  4179. }
  4180. if (!isSameTag) {
  4181. return false;
  4182. }
  4183. stack || (stack = new Stack);
  4184. return equalObjects(object, other, bitmask, customizer, equalFunc, stack);
  4185. }
  4186. /**
  4187. * The base implementation of `_.isMap` without Node.js optimizations.
  4188. *
  4189. * @private
  4190. * @param {*} value The value to check.
  4191. * @returns {boolean} Returns `true` if `value` is a map, else `false`.
  4192. */
  4193. function baseIsMap(value) {
  4194. return isObjectLike(value) && getTag(value) == mapTag;
  4195. }
  4196. /**
  4197. * The base implementation of `_.isMatch` without support for iteratee shorthands.
  4198. *
  4199. * @private
  4200. * @param {Object} object The object to inspect.
  4201. * @param {Object} source The object of property values to match.
  4202. * @param {Array} matchData The property names, values, and compare flags to match.
  4203. * @param {Function} [customizer] The function to customize comparisons.
  4204. * @returns {boolean} Returns `true` if `object` is a match, else `false`.
  4205. */
  4206. function baseIsMatch(object, source, matchData, customizer) {
  4207. var index = matchData.length,
  4208. length = index,
  4209. noCustomizer = !customizer;
  4210. if (object == null) {
  4211. return !length;
  4212. }
  4213. object = Object(object);
  4214. while (index--) {
  4215. var data = matchData[index];
  4216. if ((noCustomizer && data[2])
  4217. ? data[1] !== object[data[0]]
  4218. : !(data[0] in object)
  4219. ) {
  4220. return false;
  4221. }
  4222. }
  4223. while (++index < length) {
  4224. data = matchData[index];
  4225. var key = data[0],
  4226. objValue = object[key],
  4227. srcValue = data[1];
  4228. if (noCustomizer && data[2]) {
  4229. if (objValue === undefined && !(key in object)) {
  4230. return false;
  4231. }
  4232. } else {
  4233. var stack = new Stack;
  4234. if (customizer) {
  4235. var result = customizer(objValue, srcValue, key, object, source, stack);
  4236. }
  4237. if (!(result === undefined
  4238. ? baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG, customizer, stack)
  4239. : result
  4240. )) {
  4241. return false;
  4242. }
  4243. }
  4244. }
  4245. return true;
  4246. }
  4247. /**
  4248. * The base implementation of `_.isNative` without bad shim checks.
  4249. *
  4250. * @private
  4251. * @param {*} value The value to check.
  4252. * @returns {boolean} Returns `true` if `value` is a native function,
  4253. * else `false`.
  4254. */
  4255. function baseIsNative(value) {
  4256. if (!isObject(value) || isMasked(value)) {
  4257. return false;
  4258. }
  4259. var pattern = isFunction(value) ? reIsNative : reIsHostCtor;
  4260. return pattern.test(toSource(value));
  4261. }
  4262. /**
  4263. * The base implementation of `_.isRegExp` without Node.js optimizations.
  4264. *
  4265. * @private
  4266. * @param {*} value The value to check.
  4267. * @returns {boolean} Returns `true` if `value` is a regexp, else `false`.
  4268. */
  4269. function baseIsRegExp(value) {
  4270. return isObjectLike(value) && baseGetTag(value) == regexpTag;
  4271. }
  4272. /**
  4273. * The base implementation of `_.isSet` without Node.js optimizations.
  4274. *
  4275. * @private
  4276. * @param {*} value The value to check.
  4277. * @returns {boolean} Returns `true` if `value` is a set, else `false`.
  4278. */
  4279. function baseIsSet(value) {
  4280. return isObjectLike(value) && getTag(value) == setTag;
  4281. }
  4282. /**
  4283. * The base implementation of `_.isTypedArray` without Node.js optimizations.
  4284. *
  4285. * @private
  4286. * @param {*} value The value to check.
  4287. * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.
  4288. */
  4289. function baseIsTypedArray(value) {
  4290. return isObjectLike(value) &&
  4291. isLength(value.length) && !!typedArrayTags[baseGetTag(value)];
  4292. }
  4293. /**
  4294. * The base implementation of `_.iteratee`.
  4295. *
  4296. * @private
  4297. * @param {*} [value=_.identity] The value to convert to an iteratee.
  4298. * @returns {Function} Returns the iteratee.
  4299. */
  4300. function baseIteratee(value) {
  4301. // Don't store the `typeof` result in a variable to avoid a JIT bug in Safari 9.
  4302. // See https://bugs.webkit.org/show_bug.cgi?id=156034 for more details.
  4303. if (typeof value == 'function') {
  4304. return value;
  4305. }
  4306. if (value == null) {
  4307. return identity;
  4308. }
  4309. if (typeof value == 'object') {
  4310. return isArray(value)
  4311. ? baseMatchesProperty(value[0], value[1])
  4312. : baseMatches(value);
  4313. }
  4314. return property(value);
  4315. }
  4316. /**
  4317. * The base implementation of `_.keys` which doesn't treat sparse arrays as dense.
  4318. *
  4319. * @private
  4320. * @param {Object} object The object to query.
  4321. * @returns {Array} Returns the array of property names.
  4322. */
  4323. function baseKeys(object) {
  4324. if (!isPrototype(object)) {
  4325. return nativeKeys(object);
  4326. }
  4327. var result = [];
  4328. for (var key in Object(object)) {
  4329. if (hasOwnProperty.call(object, key) && key != 'constructor') {
  4330. result.push(key);
  4331. }
  4332. }
  4333. return result;
  4334. }
  4335. /**
  4336. * The base implementation of `_.keysIn` which doesn't treat sparse arrays as dense.
  4337. *
  4338. * @private
  4339. * @param {Object} object The object to query.
  4340. * @returns {Array} Returns the array of property names.
  4341. */
  4342. function baseKeysIn(object) {
  4343. if (!isObject(object)) {
  4344. return nativeKeysIn(object);
  4345. }
  4346. var isProto = isPrototype(object),
  4347. result = [];
  4348. for (var key in object) {
  4349. if (!(key == 'constructor' && (isProto || !hasOwnProperty.call(object, key)))) {
  4350. result.push(key);
  4351. }
  4352. }
  4353. return result;
  4354. }
  4355. /**
  4356. * The base implementation of `_.lt` which doesn't coerce arguments.
  4357. *
  4358. * @private
  4359. * @param {*} value The value to compare.
  4360. * @param {*} other The other value to compare.
  4361. * @returns {boolean} Returns `true` if `value` is less than `other`,
  4362. * else `false`.
  4363. */
  4364. function baseLt(value, other) {
  4365. return value < other;
  4366. }
  4367. /**
  4368. * The base implementation of `_.map` without support for iteratee shorthands.
  4369. *
  4370. * @private
  4371. * @param {Array|Object} collection The collection to iterate over.
  4372. * @param {Function} iteratee The function invoked per iteration.
  4373. * @returns {Array} Returns the new mapped array.
  4374. */
  4375. function baseMap(collection, iteratee) {
  4376. var index = -1,
  4377. result = isArrayLike(collection) ? Array(collection.length) : [];
  4378. baseEach(collection, function(value, key, collection) {
  4379. result[++index] = iteratee(value, key, collection);
  4380. });
  4381. return result;
  4382. }
  4383. /**
  4384. * The base implementation of `_.matches` which doesn't clone `source`.
  4385. *
  4386. * @private
  4387. * @param {Object} source The object of property values to match.
  4388. * @returns {Function} Returns the new spec function.
  4389. */
  4390. function baseMatches(source) {
  4391. var matchData = getMatchData(source);
  4392. if (matchData.length == 1 && matchData[0][2]) {
  4393. return matchesStrictComparable(matchData[0][0], matchData[0][1]);
  4394. }
  4395. return function(object) {
  4396. return object === source || baseIsMatch(object, source, matchData);
  4397. };
  4398. }
  4399. /**
  4400. * The base implementation of `_.matchesProperty` which doesn't clone `srcValue`.
  4401. *
  4402. * @private
  4403. * @param {string} path The path of the property to get.
  4404. * @param {*} srcValue The value to match.
  4405. * @returns {Function} Returns the new spec function.
  4406. */
  4407. function baseMatchesProperty(path, srcValue) {
  4408. if (isKey(path) && isStrictComparable(srcValue)) {
  4409. return matchesStrictComparable(toKey(path), srcValue);
  4410. }
  4411. return function(object) {
  4412. var objValue = get(object, path);
  4413. return (objValue === undefined && objValue === srcValue)
  4414. ? hasIn(object, path)
  4415. : baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG);
  4416. };
  4417. }
  4418. /**
  4419. * The base implementation of `_.merge` without support for multiple sources.
  4420. *
  4421. * @private
  4422. * @param {Object} object The destination object.
  4423. * @param {Object} source The source object.
  4424. * @param {number} srcIndex The index of `source`.
  4425. * @param {Function} [customizer] The function to customize merged values.
  4426. * @param {Object} [stack] Tracks traversed source values and their merged
  4427. * counterparts.
  4428. */
  4429. function baseMerge(object, source, srcIndex, customizer, stack) {
  4430. if (object === source) {
  4431. return;
  4432. }
  4433. baseFor(source, function(srcValue, key) {
  4434. stack || (stack = new Stack);
  4435. if (isObject(srcValue)) {
  4436. baseMergeDeep(object, source, key, srcIndex, baseMerge, customizer, stack);
  4437. }
  4438. else {
  4439. var newValue = customizer
  4440. ? customizer(safeGet(object, key), srcValue, (key + ''), object, source, stack)
  4441. : undefined;
  4442. if (newValue === undefined) {
  4443. newValue = srcValue;
  4444. }
  4445. assignMergeValue(object, key, newValue);
  4446. }
  4447. }, keysIn);
  4448. }
  4449. /**
  4450. * A specialized version of `baseMerge` for arrays and objects which performs
  4451. * deep merges and tracks traversed objects enabling objects with circular
  4452. * references to be merged.
  4453. *
  4454. * @private
  4455. * @param {Object} object The destination object.
  4456. * @param {Object} source The source object.
  4457. * @param {string} key The key of the value to merge.
  4458. * @param {number} srcIndex The index of `source`.
  4459. * @param {Function} mergeFunc The function to merge values.
  4460. * @param {Function} [customizer] The function to customize assigned values.
  4461. * @param {Object} [stack] Tracks traversed source values and their merged
  4462. * counterparts.
  4463. */
  4464. function baseMergeDeep(object, source, key, srcIndex, mergeFunc, customizer, stack) {
  4465. var objValue = safeGet(object, key),
  4466. srcValue = safeGet(source, key),
  4467. stacked = stack.get(srcValue);
  4468. if (stacked) {
  4469. assignMergeValue(object, key, stacked);
  4470. return;
  4471. }
  4472. var newValue = customizer
  4473. ? customizer(objValue, srcValue, (key + ''), object, source, stack)
  4474. : undefined;
  4475. var isCommon = newValue === undefined;
  4476. if (isCommon) {
  4477. var isArr = isArray(srcValue),
  4478. isBuff = !isArr && isBuffer(srcValue),
  4479. isTyped = !isArr && !isBuff && isTypedArray(srcValue);
  4480. newValue = srcValue;
  4481. if (isArr || isBuff || isTyped) {
  4482. if (isArray(objValue)) {
  4483. newValue = objValue;
  4484. }
  4485. else if (isArrayLikeObject(objValue)) {
  4486. newValue = copyArray(objValue);
  4487. }
  4488. else if (isBuff) {
  4489. isCommon = false;
  4490. newValue = cloneBuffer(srcValue, true);
  4491. }
  4492. else if (isTyped) {
  4493. isCommon = false;
  4494. newValue = cloneTypedArray(srcValue, true);
  4495. }
  4496. else {
  4497. newValue = [];
  4498. }
  4499. }
  4500. else if (isPlainObject(srcValue) || isArguments(srcValue)) {
  4501. newValue = objValue;
  4502. if (isArguments(objValue)) {
  4503. newValue = toPlainObject(objValue);
  4504. }
  4505. else if (!isObject(objValue) || isFunction(objValue)) {
  4506. newValue = initCloneObject(srcValue);
  4507. }
  4508. }
  4509. else {
  4510. isCommon = false;
  4511. }
  4512. }
  4513. if (isCommon) {
  4514. // Recursively merge objects and arrays (susceptible to call stack limits).
  4515. stack.set(srcValue, newValue);
  4516. mergeFunc(newValue, srcValue, srcIndex, customizer, stack);
  4517. stack['delete'](srcValue);
  4518. }
  4519. assignMergeValue(object, key, newValue);
  4520. }
  4521. /**
  4522. * The base implementation of `_.nth` which doesn't coerce arguments.
  4523. *
  4524. * @private
  4525. * @param {Array} array The array to query.
  4526. * @param {number} n The index of the element to return.
  4527. * @returns {*} Returns the nth element of `array`.
  4528. */
  4529. function baseNth(array, n) {
  4530. var length = array.length;
  4531. if (!length) {
  4532. return;
  4533. }
  4534. n += n < 0 ? length : 0;
  4535. return isIndex(n, length) ? array[n] : undefined;
  4536. }
  4537. /**
  4538. * The base implementation of `_.orderBy` without param guards.
  4539. *
  4540. * @private
  4541. * @param {Array|Object} collection The collection to iterate over.
  4542. * @param {Function[]|Object[]|string[]} iteratees The iteratees to sort by.
  4543. * @param {string[]} orders The sort orders of `iteratees`.
  4544. * @returns {Array} Returns the new sorted array.
  4545. */
  4546. function baseOrderBy(collection, iteratees, orders) {
  4547. if (iteratees.length) {
  4548. iteratees = arrayMap(iteratees, function(iteratee) {
  4549. if (isArray(iteratee)) {
  4550. return function(value) {
  4551. return baseGet(value, iteratee.length === 1 ? iteratee[0] : iteratee);
  4552. }
  4553. }
  4554. return iteratee;
  4555. });
  4556. } else {
  4557. iteratees = [identity];
  4558. }
  4559. var index = -1;
  4560. iteratees = arrayMap(iteratees, baseUnary(getIteratee()));
  4561. var result = baseMap(collection, function(value, key, collection) {
  4562. var criteria = arrayMap(iteratees, function(iteratee) {
  4563. return iteratee(value);
  4564. });
  4565. return { 'criteria': criteria, 'index': ++index, 'value': value };
  4566. });
  4567. return baseSortBy(result, function(object, other) {
  4568. return compareMultiple(object, other, orders);
  4569. });
  4570. }
  4571. /**
  4572. * The base implementation of `_.pick` without support for individual
  4573. * property identifiers.
  4574. *
  4575. * @private
  4576. * @param {Object} object The source object.
  4577. * @param {string[]} paths The property paths to pick.
  4578. * @returns {Object} Returns the new object.
  4579. */
  4580. function basePick(object, paths) {
  4581. return basePickBy(object, paths, function(value, path) {
  4582. return hasIn(object, path);
  4583. });
  4584. }
  4585. /**
  4586. * The base implementation of `_.pickBy` without support for iteratee shorthands.
  4587. *
  4588. * @private
  4589. * @param {Object} object The source object.
  4590. * @param {string[]} paths The property paths to pick.
  4591. * @param {Function} predicate The function invoked per property.
  4592. * @returns {Object} Returns the new object.
  4593. */
  4594. function basePickBy(object, paths, predicate) {
  4595. var index = -1,
  4596. length = paths.length,
  4597. result = {};
  4598. while (++index < length) {
  4599. var path = paths[index],
  4600. value = baseGet(object, path);
  4601. if (predicate(value, path)) {
  4602. baseSet(result, castPath(path, object), value);
  4603. }
  4604. }
  4605. return result;
  4606. }
  4607. /**
  4608. * A specialized version of `baseProperty` which supports deep paths.
  4609. *
  4610. * @private
  4611. * @param {Array|string} path The path of the property to get.
  4612. * @returns {Function} Returns the new accessor function.
  4613. */
  4614. function basePropertyDeep(path) {
  4615. return function(object) {
  4616. return baseGet(object, path);
  4617. };
  4618. }
  4619. /**
  4620. * The base implementation of `_.pullAllBy` without support for iteratee
  4621. * shorthands.
  4622. *
  4623. * @private
  4624. * @param {Array} array The array to modify.
  4625. * @param {Array} values The values to remove.
  4626. * @param {Function} [iteratee] The iteratee invoked per element.
  4627. * @param {Function} [comparator] The comparator invoked per element.
  4628. * @returns {Array} Returns `array`.
  4629. */
  4630. function basePullAll(array, values, iteratee, comparator) {
  4631. var indexOf = comparator ? baseIndexOfWith : baseIndexOf,
  4632. index = -1,
  4633. length = values.length,
  4634. seen = array;
  4635. if (array === values) {
  4636. values = copyArray(values);
  4637. }
  4638. if (iteratee) {
  4639. seen = arrayMap(array, baseUnary(iteratee));
  4640. }
  4641. while (++index < length) {
  4642. var fromIndex = 0,
  4643. value = values[index],
  4644. computed = iteratee ? iteratee(value) : value;
  4645. while ((fromIndex = indexOf(seen, computed, fromIndex, comparator)) > -1) {
  4646. if (seen !== array) {
  4647. splice.call(seen, fromIndex, 1);
  4648. }
  4649. splice.call(array, fromIndex, 1);
  4650. }
  4651. }
  4652. return array;
  4653. }
  4654. /**
  4655. * The base implementation of `_.pullAt` without support for individual
  4656. * indexes or capturing the removed elements.
  4657. *
  4658. * @private
  4659. * @param {Array} array The array to modify.
  4660. * @param {number[]} indexes The indexes of elements to remove.
  4661. * @returns {Array} Returns `array`.
  4662. */
  4663. function basePullAt(array, indexes) {
  4664. var length = array ? indexes.length : 0,
  4665. lastIndex = length - 1;
  4666. while (length--) {
  4667. var index = indexes[length];
  4668. if (length == lastIndex || index !== previous) {
  4669. var previous = index;
  4670. if (isIndex(index)) {
  4671. splice.call(array, index, 1);
  4672. } else {
  4673. baseUnset(array, index);
  4674. }
  4675. }
  4676. }
  4677. return array;
  4678. }
  4679. /**
  4680. * The base implementation of `_.random` without support for returning
  4681. * floating-point numbers.
  4682. *
  4683. * @private
  4684. * @param {number} lower The lower bound.
  4685. * @param {number} upper The upper bound.
  4686. * @returns {number} Returns the random number.
  4687. */
  4688. function baseRandom(lower, upper) {
  4689. return lower + nativeFloor(nativeRandom() * (upper - lower + 1));
  4690. }
  4691. /**
  4692. * The base implementation of `_.range` and `_.rangeRight` which doesn't
  4693. * coerce arguments.
  4694. *
  4695. * @private
  4696. * @param {number} start The start of the range.
  4697. * @param {number} end The end of the range.
  4698. * @param {number} step The value to increment or decrement by.
  4699. * @param {boolean} [fromRight] Specify iterating from right to left.
  4700. * @returns {Array} Returns the range of numbers.
  4701. */
  4702. function baseRange(start, end, step, fromRight) {
  4703. var index = -1,
  4704. length = nativeMax(nativeCeil((end - start) / (step || 1)), 0),
  4705. result = Array(length);
  4706. while (length--) {
  4707. result[fromRight ? length : ++index] = start;
  4708. start += step;
  4709. }
  4710. return result;
  4711. }
  4712. /**
  4713. * The base implementation of `_.repeat` which doesn't coerce arguments.
  4714. *
  4715. * @private
  4716. * @param {string} string The string to repeat.
  4717. * @param {number} n The number of times to repeat the string.
  4718. * @returns {string} Returns the repeated string.
  4719. */
  4720. function baseRepeat(string, n) {
  4721. var result = '';
  4722. if (!string || n < 1 || n > MAX_SAFE_INTEGER) {
  4723. return result;
  4724. }
  4725. // Leverage the exponentiation by squaring algorithm for a faster repeat.
  4726. // See https://en.wikipedia.org/wiki/Exponentiation_by_squaring for more details.
  4727. do {
  4728. if (n % 2) {
  4729. result += string;
  4730. }
  4731. n = nativeFloor(n / 2);
  4732. if (n) {
  4733. string += string;
  4734. }
  4735. } while (n);
  4736. return result;
  4737. }
  4738. /**
  4739. * The base implementation of `_.rest` which doesn't validate or coerce arguments.
  4740. *
  4741. * @private
  4742. * @param {Function} func The function to apply a rest parameter to.
  4743. * @param {number} [start=func.length-1] The start position of the rest parameter.
  4744. * @returns {Function} Returns the new function.
  4745. */
  4746. function baseRest(func, start) {
  4747. return setToString(overRest(func, start, identity), func + '');
  4748. }
  4749. /**
  4750. * The base implementation of `_.sample`.
  4751. *
  4752. * @private
  4753. * @param {Array|Object} collection The collection to sample.
  4754. * @returns {*} Returns the random element.
  4755. */
  4756. function baseSample(collection) {
  4757. return arraySample(values(collection));
  4758. }
  4759. /**
  4760. * The base implementation of `_.sampleSize` without param guards.
  4761. *
  4762. * @private
  4763. * @param {Array|Object} collection The collection to sample.
  4764. * @param {number} n The number of elements to sample.
  4765. * @returns {Array} Returns the random elements.
  4766. */
  4767. function baseSampleSize(collection, n) {
  4768. var array = values(collection);
  4769. return shuffleSelf(array, baseClamp(n, 0, array.length));
  4770. }
  4771. /**
  4772. * The base implementation of `_.set`.
  4773. *
  4774. * @private
  4775. * @param {Object} object The object to modify.
  4776. * @param {Array|string} path The path of the property to set.
  4777. * @param {*} value The value to set.
  4778. * @param {Function} [customizer] The function to customize path creation.
  4779. * @returns {Object} Returns `object`.
  4780. */
  4781. function baseSet(object, path, value, customizer) {
  4782. if (!isObject(object)) {
  4783. return object;
  4784. }
  4785. path = castPath(path, object);
  4786. var index = -1,
  4787. length = path.length,
  4788. lastIndex = length - 1,
  4789. nested = object;
  4790. while (nested != null && ++index < length) {
  4791. var key = toKey(path[index]),
  4792. newValue = value;
  4793. if (key === '__proto__' || key === 'constructor' || key === 'prototype') {
  4794. return object;
  4795. }
  4796. if (index != lastIndex) {
  4797. var objValue = nested[key];
  4798. newValue = customizer ? customizer(objValue, key, nested) : undefined;
  4799. if (newValue === undefined) {
  4800. newValue = isObject(objValue)
  4801. ? objValue
  4802. : (isIndex(path[index + 1]) ? [] : {});
  4803. }
  4804. }
  4805. assignValue(nested, key, newValue);
  4806. nested = nested[key];
  4807. }
  4808. return object;
  4809. }
  4810. /**
  4811. * The base implementation of `setData` without support for hot loop shorting.
  4812. *
  4813. * @private
  4814. * @param {Function} func The function to associate metadata with.
  4815. * @param {*} data The metadata.
  4816. * @returns {Function} Returns `func`.
  4817. */
  4818. var baseSetData = !metaMap ? identity : function(func, data) {
  4819. metaMap.set(func, data);
  4820. return func;
  4821. };
  4822. /**
  4823. * The base implementation of `setToString` without support for hot loop shorting.
  4824. *
  4825. * @private
  4826. * @param {Function} func The function to modify.
  4827. * @param {Function} string The `toString` result.
  4828. * @returns {Function} Returns `func`.
  4829. */
  4830. var baseSetToString = !defineProperty ? identity : function(func, string) {
  4831. return defineProperty(func, 'toString', {
  4832. 'configurable': true,
  4833. 'enumerable': false,
  4834. 'value': constant(string),
  4835. 'writable': true
  4836. });
  4837. };
  4838. /**
  4839. * The base implementation of `_.shuffle`.
  4840. *
  4841. * @private
  4842. * @param {Array|Object} collection The collection to shuffle.
  4843. * @returns {Array} Returns the new shuffled array.
  4844. */
  4845. function baseShuffle(collection) {
  4846. return shuffleSelf(values(collection));
  4847. }
  4848. /**
  4849. * The base implementation of `_.slice` without an iteratee call guard.
  4850. *
  4851. * @private
  4852. * @param {Array} array The array to slice.
  4853. * @param {number} [start=0] The start position.
  4854. * @param {number} [end=array.length] The end position.
  4855. * @returns {Array} Returns the slice of `array`.
  4856. */
  4857. function baseSlice(array, start, end) {
  4858. var index = -1,
  4859. length = array.length;
  4860. if (start < 0) {
  4861. start = -start > length ? 0 : (length + start);
  4862. }
  4863. end = end > length ? length : end;
  4864. if (end < 0) {
  4865. end += length;
  4866. }
  4867. length = start > end ? 0 : ((end - start) >>> 0);
  4868. start >>>= 0;
  4869. var result = Array(length);
  4870. while (++index < length) {
  4871. result[index] = array[index + start];
  4872. }
  4873. return result;
  4874. }
  4875. /**
  4876. * The base implementation of `_.some` without support for iteratee shorthands.
  4877. *
  4878. * @private
  4879. * @param {Array|Object} collection The collection to iterate over.
  4880. * @param {Function} predicate The function invoked per iteration.
  4881. * @returns {boolean} Returns `true` if any element passes the predicate check,
  4882. * else `false`.
  4883. */
  4884. function baseSome(collection, predicate) {
  4885. var result;
  4886. baseEach(collection, function(value, index, collection) {
  4887. result = predicate(value, index, collection);
  4888. return !result;
  4889. });
  4890. return !!result;
  4891. }
  4892. /**
  4893. * The base implementation of `_.sortedIndex` and `_.sortedLastIndex` which
  4894. * performs a binary search of `array` to determine the index at which `value`
  4895. * should be inserted into `array` in order to maintain its sort order.
  4896. *
  4897. * @private
  4898. * @param {Array} array The sorted array to inspect.
  4899. * @param {*} value The value to evaluate.
  4900. * @param {boolean} [retHighest] Specify returning the highest qualified index.
  4901. * @returns {number} Returns the index at which `value` should be inserted
  4902. * into `array`.
  4903. */
  4904. function baseSortedIndex(array, value, retHighest) {
  4905. var low = 0,
  4906. high = array == null ? low : array.length;
  4907. if (typeof value == 'number' && value === value && high <= HALF_MAX_ARRAY_LENGTH) {
  4908. while (low < high) {
  4909. var mid = (low + high) >>> 1,
  4910. computed = array[mid];
  4911. if (computed !== null && !isSymbol(computed) &&
  4912. (retHighest ? (computed <= value) : (computed < value))) {
  4913. low = mid + 1;
  4914. } else {
  4915. high = mid;
  4916. }
  4917. }
  4918. return high;
  4919. }
  4920. return baseSortedIndexBy(array, value, identity, retHighest);
  4921. }
  4922. /**
  4923. * The base implementation of `_.sortedIndexBy` and `_.sortedLastIndexBy`
  4924. * which invokes `iteratee` for `value` and each element of `array` to compute
  4925. * their sort ranking. The iteratee is invoked with one argument; (value).
  4926. *
  4927. * @private
  4928. * @param {Array} array The sorted array to inspect.
  4929. * @param {*} value The value to evaluate.
  4930. * @param {Function} iteratee The iteratee invoked per element.
  4931. * @param {boolean} [retHighest] Specify returning the highest qualified index.
  4932. * @returns {number} Returns the index at which `value` should be inserted
  4933. * into `array`.
  4934. */
  4935. function baseSortedIndexBy(array, value, iteratee, retHighest) {
  4936. var low = 0,
  4937. high = array == null ? 0 : array.length;
  4938. if (high === 0) {
  4939. return 0;
  4940. }
  4941. value = iteratee(value);
  4942. var valIsNaN = value !== value,
  4943. valIsNull = value === null,
  4944. valIsSymbol = isSymbol(value),
  4945. valIsUndefined = value === undefined;
  4946. while (low < high) {
  4947. var mid = nativeFloor((low + high) / 2),
  4948. computed = iteratee(array[mid]),
  4949. othIsDefined = computed !== undefined,
  4950. othIsNull = computed === null,
  4951. othIsReflexive = computed === computed,
  4952. othIsSymbol = isSymbol(computed);
  4953. if (valIsNaN) {
  4954. var setLow = retHighest || othIsReflexive;
  4955. } else if (valIsUndefined) {
  4956. setLow = othIsReflexive && (retHighest || othIsDefined);
  4957. } else if (valIsNull) {
  4958. setLow = othIsReflexive && othIsDefined && (retHighest || !othIsNull);
  4959. } else if (valIsSymbol) {
  4960. setLow = othIsReflexive && othIsDefined && !othIsNull && (retHighest || !othIsSymbol);
  4961. } else if (othIsNull || othIsSymbol) {
  4962. setLow = false;
  4963. } else {
  4964. setLow = retHighest ? (computed <= value) : (computed < value);
  4965. }
  4966. if (setLow) {
  4967. low = mid + 1;
  4968. } else {
  4969. high = mid;
  4970. }
  4971. }
  4972. return nativeMin(high, MAX_ARRAY_INDEX);
  4973. }
  4974. /**
  4975. * The base implementation of `_.sortedUniq` and `_.sortedUniqBy` without
  4976. * support for iteratee shorthands.
  4977. *
  4978. * @private
  4979. * @param {Array} array The array to inspect.
  4980. * @param {Function} [iteratee] The iteratee invoked per element.
  4981. * @returns {Array} Returns the new duplicate free array.
  4982. */
  4983. function baseSortedUniq(array, iteratee) {
  4984. var index = -1,
  4985. length = array.length,
  4986. resIndex = 0,
  4987. result = [];
  4988. while (++index < length) {
  4989. var value = array[index],
  4990. computed = iteratee ? iteratee(value) : value;
  4991. if (!index || !eq(computed, seen)) {
  4992. var seen = computed;
  4993. result[resIndex++] = value === 0 ? 0 : value;
  4994. }
  4995. }
  4996. return result;
  4997. }
  4998. /**
  4999. * The base implementation of `_.toNumber` which doesn't ensure correct
  5000. * conversions of binary, hexadecimal, or octal string values.
  5001. *
  5002. * @private
  5003. * @param {*} value The value to process.
  5004. * @returns {number} Returns the number.
  5005. */
  5006. function baseToNumber(value) {
  5007. if (typeof value == 'number') {
  5008. return value;
  5009. }
  5010. if (isSymbol(value)) {
  5011. return NAN;
  5012. }
  5013. return +value;
  5014. }
  5015. /**
  5016. * The base implementation of `_.toString` which doesn't convert nullish
  5017. * values to empty strings.
  5018. *
  5019. * @private
  5020. * @param {*} value The value to process.
  5021. * @returns {string} Returns the string.
  5022. */
  5023. function baseToString(value) {
  5024. // Exit early for strings to avoid a performance hit in some environments.
  5025. if (typeof value == 'string') {
  5026. return value;
  5027. }
  5028. if (isArray(value)) {
  5029. // Recursively convert values (susceptible to call stack limits).
  5030. return arrayMap(value, baseToString) + '';
  5031. }
  5032. if (isSymbol(value)) {
  5033. return symbolToString ? symbolToString.call(value) : '';
  5034. }
  5035. var result = (value + '');
  5036. return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;
  5037. }
  5038. /**
  5039. * The base implementation of `_.uniqBy` without support for iteratee shorthands.
  5040. *
  5041. * @private
  5042. * @param {Array} array The array to inspect.
  5043. * @param {Function} [iteratee] The iteratee invoked per element.
  5044. * @param {Function} [comparator] The comparator invoked per element.
  5045. * @returns {Array} Returns the new duplicate free array.
  5046. */
  5047. function baseUniq(array, iteratee, comparator) {
  5048. var index = -1,
  5049. includes = arrayIncludes,
  5050. length = array.length,
  5051. isCommon = true,
  5052. result = [],
  5053. seen = result;
  5054. if (comparator) {
  5055. isCommon = false;
  5056. includes = arrayIncludesWith;
  5057. }
  5058. else if (length >= LARGE_ARRAY_SIZE) {
  5059. var set = iteratee ? null : createSet(array);
  5060. if (set) {
  5061. return setToArray(set);
  5062. }
  5063. isCommon = false;
  5064. includes = cacheHas;
  5065. seen = new SetCache;
  5066. }
  5067. else {
  5068. seen = iteratee ? [] : result;
  5069. }
  5070. outer:
  5071. while (++index < length) {
  5072. var value = array[index],
  5073. computed = iteratee ? iteratee(value) : value;
  5074. value = (comparator || value !== 0) ? value : 0;
  5075. if (isCommon && computed === computed) {
  5076. var seenIndex = seen.length;
  5077. while (seenIndex--) {
  5078. if (seen[seenIndex] === computed) {
  5079. continue outer;
  5080. }
  5081. }
  5082. if (iteratee) {
  5083. seen.push(computed);
  5084. }
  5085. result.push(value);
  5086. }
  5087. else if (!includes(seen, computed, comparator)) {
  5088. if (seen !== result) {
  5089. seen.push(computed);
  5090. }
  5091. result.push(value);
  5092. }
  5093. }
  5094. return result;
  5095. }
  5096. /**
  5097. * The base implementation of `_.unset`.
  5098. *
  5099. * @private
  5100. * @param {Object} object The object to modify.
  5101. * @param {Array|string} path The property path to unset.
  5102. * @returns {boolean} Returns `true` if the property is deleted, else `false`.
  5103. */
  5104. function baseUnset(object, path) {
  5105. path = castPath(path, object);
  5106. object = parent(object, path);
  5107. return object == null || delete object[toKey(last(path))];
  5108. }
  5109. /**
  5110. * The base implementation of `_.update`.
  5111. *
  5112. * @private
  5113. * @param {Object} object The object to modify.
  5114. * @param {Array|string} path The path of the property to update.
  5115. * @param {Function} updater The function to produce the updated value.
  5116. * @param {Function} [customizer] The function to customize path creation.
  5117. * @returns {Object} Returns `object`.
  5118. */
  5119. function baseUpdate(object, path, updater, customizer) {
  5120. return baseSet(object, path, updater(baseGet(object, path)), customizer);
  5121. }
  5122. /**
  5123. * The base implementation of methods like `_.dropWhile` and `_.takeWhile`
  5124. * without support for iteratee shorthands.
  5125. *
  5126. * @private
  5127. * @param {Array} array The array to query.
  5128. * @param {Function} predicate The function invoked per iteration.
  5129. * @param {boolean} [isDrop] Specify dropping elements instead of taking them.
  5130. * @param {boolean} [fromRight] Specify iterating from right to left.
  5131. * @returns {Array} Returns the slice of `array`.
  5132. */
  5133. function baseWhile(array, predicate, isDrop, fromRight) {
  5134. var length = array.length,
  5135. index = fromRight ? length : -1;
  5136. while ((fromRight ? index-- : ++index < length) &&
  5137. predicate(array[index], index, array)) {}
  5138. return isDrop
  5139. ? baseSlice(array, (fromRight ? 0 : index), (fromRight ? index + 1 : length))
  5140. : baseSlice(array, (fromRight ? index + 1 : 0), (fromRight ? length : index));
  5141. }
  5142. /**
  5143. * The base implementation of `wrapperValue` which returns the result of
  5144. * performing a sequence of actions on the unwrapped `value`, where each
  5145. * successive action is supplied the return value of the previous.
  5146. *
  5147. * @private
  5148. * @param {*} value The unwrapped value.
  5149. * @param {Array} actions Actions to perform to resolve the unwrapped value.
  5150. * @returns {*} Returns the resolved value.
  5151. */
  5152. function baseWrapperValue(value, actions) {
  5153. var result = value;
  5154. if (result instanceof LazyWrapper) {
  5155. result = result.value();
  5156. }
  5157. return arrayReduce(actions, function(result, action) {
  5158. return action.func.apply(action.thisArg, arrayPush([result], action.args));
  5159. }, result);
  5160. }
  5161. /**
  5162. * The base implementation of methods like `_.xor`, without support for
  5163. * iteratee shorthands, that accepts an array of arrays to inspect.
  5164. *
  5165. * @private
  5166. * @param {Array} arrays The arrays to inspect.
  5167. * @param {Function} [iteratee] The iteratee invoked per element.
  5168. * @param {Function} [comparator] The comparator invoked per element.
  5169. * @returns {Array} Returns the new array of values.
  5170. */
  5171. function baseXor(arrays, iteratee, comparator) {
  5172. var length = arrays.length;
  5173. if (length < 2) {
  5174. return length ? baseUniq(arrays[0]) : [];
  5175. }
  5176. var index = -1,
  5177. result = Array(length);
  5178. while (++index < length) {
  5179. var array = arrays[index],
  5180. othIndex = -1;
  5181. while (++othIndex < length) {
  5182. if (othIndex != index) {
  5183. result[index] = baseDifference(result[index] || array, arrays[othIndex], iteratee, comparator);
  5184. }
  5185. }
  5186. }
  5187. return baseUniq(baseFlatten(result, 1), iteratee, comparator);
  5188. }
  5189. /**
  5190. * This base implementation of `_.zipObject` which assigns values using `assignFunc`.
  5191. *
  5192. * @private
  5193. * @param {Array} props The property identifiers.
  5194. * @param {Array} values The property values.
  5195. * @param {Function} assignFunc The function to assign values.
  5196. * @returns {Object} Returns the new object.
  5197. */
  5198. function baseZipObject(props, values, assignFunc) {
  5199. var index = -1,
  5200. length = props.length,
  5201. valsLength = values.length,
  5202. result = {};
  5203. while (++index < length) {
  5204. var value = index < valsLength ? values[index] : undefined;
  5205. assignFunc(result, props[index], value);
  5206. }
  5207. return result;
  5208. }
  5209. /**
  5210. * Casts `value` to an empty array if it's not an array like object.
  5211. *
  5212. * @private
  5213. * @param {*} value The value to inspect.
  5214. * @returns {Array|Object} Returns the cast array-like object.
  5215. */
  5216. function castArrayLikeObject(value) {
  5217. return isArrayLikeObject(value) ? value : [];
  5218. }
  5219. /**
  5220. * Casts `value` to `identity` if it's not a function.
  5221. *
  5222. * @private
  5223. * @param {*} value The value to inspect.
  5224. * @returns {Function} Returns cast function.
  5225. */
  5226. function castFunction(value) {
  5227. return typeof value == 'function' ? value : identity;
  5228. }
  5229. /**
  5230. * Casts `value` to a path array if it's not one.
  5231. *
  5232. * @private
  5233. * @param {*} value The value to inspect.
  5234. * @param {Object} [object] The object to query keys on.
  5235. * @returns {Array} Returns the cast property path array.
  5236. */
  5237. function castPath(value, object) {
  5238. if (isArray(value)) {
  5239. return value;
  5240. }
  5241. return isKey(value, object) ? [value] : stringToPath(toString(value));
  5242. }
  5243. /**
  5244. * A `baseRest` alias which can be replaced with `identity` by module
  5245. * replacement plugins.
  5246. *
  5247. * @private
  5248. * @type {Function}
  5249. * @param {Function} func The function to apply a rest parameter to.
  5250. * @returns {Function} Returns the new function.
  5251. */
  5252. var castRest = baseRest;
  5253. /**
  5254. * Casts `array` to a slice if it's needed.
  5255. *
  5256. * @private
  5257. * @param {Array} array The array to inspect.
  5258. * @param {number} start The start position.
  5259. * @param {number} [end=array.length] The end position.
  5260. * @returns {Array} Returns the cast slice.
  5261. */
  5262. function castSlice(array, start, end) {
  5263. var length = array.length;
  5264. end = end === undefined ? length : end;
  5265. return (!start && end >= length) ? array : baseSlice(array, start, end);
  5266. }
  5267. /**
  5268. * A simple wrapper around the global [`clearTimeout`](https://mdn.io/clearTimeout).
  5269. *
  5270. * @private
  5271. * @param {number|Object} id The timer id or timeout object of the timer to clear.
  5272. */
  5273. var clearTimeout = ctxClearTimeout || function(id) {
  5274. return root.clearTimeout(id);
  5275. };
  5276. /**
  5277. * Creates a clone of `buffer`.
  5278. *
  5279. * @private
  5280. * @param {Buffer} buffer The buffer to clone.
  5281. * @param {boolean} [isDeep] Specify a deep clone.
  5282. * @returns {Buffer} Returns the cloned buffer.
  5283. */
  5284. function cloneBuffer(buffer, isDeep) {
  5285. if (isDeep) {
  5286. return buffer.slice();
  5287. }
  5288. var length = buffer.length,
  5289. result = allocUnsafe ? allocUnsafe(length) : new buffer.constructor(length);
  5290. buffer.copy(result);
  5291. return result;
  5292. }
  5293. /**
  5294. * Creates a clone of `arrayBuffer`.
  5295. *
  5296. * @private
  5297. * @param {ArrayBuffer} arrayBuffer The array buffer to clone.
  5298. * @returns {ArrayBuffer} Returns the cloned array buffer.
  5299. */
  5300. function cloneArrayBuffer(arrayBuffer) {
  5301. var result = new arrayBuffer.constructor(arrayBuffer.byteLength);
  5302. new Uint8Array(result).set(new Uint8Array(arrayBuffer));
  5303. return result;
  5304. }
  5305. /**
  5306. * Creates a clone of `dataView`.
  5307. *
  5308. * @private
  5309. * @param {Object} dataView The data view to clone.
  5310. * @param {boolean} [isDeep] Specify a deep clone.
  5311. * @returns {Object} Returns the cloned data view.
  5312. */
  5313. function cloneDataView(dataView, isDeep) {
  5314. var buffer = isDeep ? cloneArrayBuffer(dataView.buffer) : dataView.buffer;
  5315. return new dataView.constructor(buffer, dataView.byteOffset, dataView.byteLength);
  5316. }
  5317. /**
  5318. * Creates a clone of `regexp`.
  5319. *
  5320. * @private
  5321. * @param {Object} regexp The regexp to clone.
  5322. * @returns {Object} Returns the cloned regexp.
  5323. */
  5324. function cloneRegExp(regexp) {
  5325. var result = new regexp.constructor(regexp.source, reFlags.exec(regexp));
  5326. result.lastIndex = regexp.lastIndex;
  5327. return result;
  5328. }
  5329. /**
  5330. * Creates a clone of the `symbol` object.
  5331. *
  5332. * @private
  5333. * @param {Object} symbol The symbol object to clone.
  5334. * @returns {Object} Returns the cloned symbol object.
  5335. */
  5336. function cloneSymbol(symbol) {
  5337. return symbolValueOf ? Object(symbolValueOf.call(symbol)) : {};
  5338. }
  5339. /**
  5340. * Creates a clone of `typedArray`.
  5341. *
  5342. * @private
  5343. * @param {Object} typedArray The typed array to clone.
  5344. * @param {boolean} [isDeep] Specify a deep clone.
  5345. * @returns {Object} Returns the cloned typed array.
  5346. */
  5347. function cloneTypedArray(typedArray, isDeep) {
  5348. var buffer = isDeep ? cloneArrayBuffer(typedArray.buffer) : typedArray.buffer;
  5349. return new typedArray.constructor(buffer, typedArray.byteOffset, typedArray.length);
  5350. }
  5351. /**
  5352. * Compares values to sort them in ascending order.
  5353. *
  5354. * @private
  5355. * @param {*} value The value to compare.
  5356. * @param {*} other The other value to compare.
  5357. * @returns {number} Returns the sort order indicator for `value`.
  5358. */
  5359. function compareAscending(value, other) {
  5360. if (value !== other) {
  5361. var valIsDefined = value !== undefined,
  5362. valIsNull = value === null,
  5363. valIsReflexive = value === value,
  5364. valIsSymbol = isSymbol(value);
  5365. var othIsDefined = other !== undefined,
  5366. othIsNull = other === null,
  5367. othIsReflexive = other === other,
  5368. othIsSymbol = isSymbol(other);
  5369. if ((!othIsNull && !othIsSymbol && !valIsSymbol && value > other) ||
  5370. (valIsSymbol && othIsDefined && othIsReflexive && !othIsNull && !othIsSymbol) ||
  5371. (valIsNull && othIsDefined && othIsReflexive) ||
  5372. (!valIsDefined && othIsReflexive) ||
  5373. !valIsReflexive) {
  5374. return 1;
  5375. }
  5376. if ((!valIsNull && !valIsSymbol && !othIsSymbol && value < other) ||
  5377. (othIsSymbol && valIsDefined && valIsReflexive && !valIsNull && !valIsSymbol) ||
  5378. (othIsNull && valIsDefined && valIsReflexive) ||
  5379. (!othIsDefined && valIsReflexive) ||
  5380. !othIsReflexive) {
  5381. return -1;
  5382. }
  5383. }
  5384. return 0;
  5385. }
  5386. /**
  5387. * Used by `_.orderBy` to compare multiple properties of a value to another
  5388. * and stable sort them.
  5389. *
  5390. * If `orders` is unspecified, all values are sorted in ascending order. Otherwise,
  5391. * specify an order of "desc" for descending or "asc" for ascending sort order
  5392. * of corresponding values.
  5393. *
  5394. * @private
  5395. * @param {Object} object The object to compare.
  5396. * @param {Object} other The other object to compare.
  5397. * @param {boolean[]|string[]} orders The order to sort by for each property.
  5398. * @returns {number} Returns the sort order indicator for `object`.
  5399. */
  5400. function compareMultiple(object, other, orders) {
  5401. var index = -1,
  5402. objCriteria = object.criteria,
  5403. othCriteria = other.criteria,
  5404. length = objCriteria.length,
  5405. ordersLength = orders.length;
  5406. while (++index < length) {
  5407. var result = compareAscending(objCriteria[index], othCriteria[index]);
  5408. if (result) {
  5409. if (index >= ordersLength) {
  5410. return result;
  5411. }
  5412. var order = orders[index];
  5413. return result * (order == 'desc' ? -1 : 1);
  5414. }
  5415. }
  5416. // Fixes an `Array#sort` bug in the JS engine embedded in Adobe applications
  5417. // that causes it, under certain circumstances, to provide the same value for
  5418. // `object` and `other`. See https://github.com/jashkenas/underscore/pull/1247
  5419. // for more details.
  5420. //
  5421. // This also ensures a stable sort in V8 and other engines.
  5422. // See https://bugs.chromium.org/p/v8/issues/detail?id=90 for more details.
  5423. return object.index - other.index;
  5424. }
  5425. /**
  5426. * Creates an array that is the composition of partially applied arguments,
  5427. * placeholders, and provided arguments into a single array of arguments.
  5428. *
  5429. * @private
  5430. * @param {Array} args The provided arguments.
  5431. * @param {Array} partials The arguments to prepend to those provided.
  5432. * @param {Array} holders The `partials` placeholder indexes.
  5433. * @params {boolean} [isCurried] Specify composing for a curried function.
  5434. * @returns {Array} Returns the new array of composed arguments.
  5435. */
  5436. function composeArgs(args, partials, holders, isCurried) {
  5437. var argsIndex = -1,
  5438. argsLength = args.length,
  5439. holdersLength = holders.length,
  5440. leftIndex = -1,
  5441. leftLength = partials.length,
  5442. rangeLength = nativeMax(argsLength - holdersLength, 0),
  5443. result = Array(leftLength + rangeLength),
  5444. isUncurried = !isCurried;
  5445. while (++leftIndex < leftLength) {
  5446. result[leftIndex] = partials[leftIndex];
  5447. }
  5448. while (++argsIndex < holdersLength) {
  5449. if (isUncurried || argsIndex < argsLength) {
  5450. result[holders[argsIndex]] = args[argsIndex];
  5451. }
  5452. }
  5453. while (rangeLength--) {
  5454. result[leftIndex++] = args[argsIndex++];
  5455. }
  5456. return result;
  5457. }
  5458. /**
  5459. * This function is like `composeArgs` except that the arguments composition
  5460. * is tailored for `_.partialRight`.
  5461. *
  5462. * @private
  5463. * @param {Array} args The provided arguments.
  5464. * @param {Array} partials The arguments to append to those provided.
  5465. * @param {Array} holders The `partials` placeholder indexes.
  5466. * @params {boolean} [isCurried] Specify composing for a curried function.
  5467. * @returns {Array} Returns the new array of composed arguments.
  5468. */
  5469. function composeArgsRight(args, partials, holders, isCurried) {
  5470. var argsIndex = -1,
  5471. argsLength = args.length,
  5472. holdersIndex = -1,
  5473. holdersLength = holders.length,
  5474. rightIndex = -1,
  5475. rightLength = partials.length,
  5476. rangeLength = nativeMax(argsLength - holdersLength, 0),
  5477. result = Array(rangeLength + rightLength),
  5478. isUncurried = !isCurried;
  5479. while (++argsIndex < rangeLength) {
  5480. result[argsIndex] = args[argsIndex];
  5481. }
  5482. var offset = argsIndex;
  5483. while (++rightIndex < rightLength) {
  5484. result[offset + rightIndex] = partials[rightIndex];
  5485. }
  5486. while (++holdersIndex < holdersLength) {
  5487. if (isUncurried || argsIndex < argsLength) {
  5488. result[offset + holders[holdersIndex]] = args[argsIndex++];
  5489. }
  5490. }
  5491. return result;
  5492. }
  5493. /**
  5494. * Copies the values of `source` to `array`.
  5495. *
  5496. * @private
  5497. * @param {Array} source The array to copy values from.
  5498. * @param {Array} [array=[]] The array to copy values to.
  5499. * @returns {Array} Returns `array`.
  5500. */
  5501. function copyArray(source, array) {
  5502. var index = -1,
  5503. length = source.length;
  5504. array || (array = Array(length));
  5505. while (++index < length) {
  5506. array[index] = source[index];
  5507. }
  5508. return array;
  5509. }
  5510. /**
  5511. * Copies properties of `source` to `object`.
  5512. *
  5513. * @private
  5514. * @param {Object} source The object to copy properties from.
  5515. * @param {Array} props The property identifiers to copy.
  5516. * @param {Object} [object={}] The object to copy properties to.
  5517. * @param {Function} [customizer] The function to customize copied values.
  5518. * @returns {Object} Returns `object`.
  5519. */
  5520. function copyObject(source, props, object, customizer) {
  5521. var isNew = !object;
  5522. object || (object = {});
  5523. var index = -1,
  5524. length = props.length;
  5525. while (++index < length) {
  5526. var key = props[index];
  5527. var newValue = customizer
  5528. ? customizer(object[key], source[key], key, object, source)
  5529. : undefined;
  5530. if (newValue === undefined) {
  5531. newValue = source[key];
  5532. }
  5533. if (isNew) {
  5534. baseAssignValue(object, key, newValue);
  5535. } else {
  5536. assignValue(object, key, newValue);
  5537. }
  5538. }
  5539. return object;
  5540. }
  5541. /**
  5542. * Copies own symbols of `source` to `object`.
  5543. *
  5544. * @private
  5545. * @param {Object} source The object to copy symbols from.
  5546. * @param {Object} [object={}] The object to copy symbols to.
  5547. * @returns {Object} Returns `object`.
  5548. */
  5549. function copySymbols(source, object) {
  5550. return copyObject(source, getSymbols(source), object);
  5551. }
  5552. /**
  5553. * Copies own and inherited symbols of `source` to `object`.
  5554. *
  5555. * @private
  5556. * @param {Object} source The object to copy symbols from.
  5557. * @param {Object} [object={}] The object to copy symbols to.
  5558. * @returns {Object} Returns `object`.
  5559. */
  5560. function copySymbolsIn(source, object) {
  5561. return copyObject(source, getSymbolsIn(source), object);
  5562. }
  5563. /**
  5564. * Creates a function like `_.groupBy`.
  5565. *
  5566. * @private
  5567. * @param {Function} setter The function to set accumulator values.
  5568. * @param {Function} [initializer] The accumulator object initializer.
  5569. * @returns {Function} Returns the new aggregator function.
  5570. */
  5571. function createAggregator(setter, initializer) {
  5572. return function(collection, iteratee) {
  5573. var func = isArray(collection) ? arrayAggregator : baseAggregator,
  5574. accumulator = initializer ? initializer() : {};
  5575. return func(collection, setter, getIteratee(iteratee, 2), accumulator);
  5576. };
  5577. }
  5578. /**
  5579. * Creates a function like `_.assign`.
  5580. *
  5581. * @private
  5582. * @param {Function} assigner The function to assign values.
  5583. * @returns {Function} Returns the new assigner function.
  5584. */
  5585. function createAssigner(assigner) {
  5586. return baseRest(function(object, sources) {
  5587. var index = -1,
  5588. length = sources.length,
  5589. customizer = length > 1 ? sources[length - 1] : undefined,
  5590. guard = length > 2 ? sources[2] : undefined;
  5591. customizer = (assigner.length > 3 && typeof customizer == 'function')
  5592. ? (length--, customizer)
  5593. : undefined;
  5594. if (guard && isIterateeCall(sources[0], sources[1], guard)) {
  5595. customizer = length < 3 ? undefined : customizer;
  5596. length = 1;
  5597. }
  5598. object = Object(object);
  5599. while (++index < length) {
  5600. var source = sources[index];
  5601. if (source) {
  5602. assigner(object, source, index, customizer);
  5603. }
  5604. }
  5605. return object;
  5606. });
  5607. }
  5608. /**
  5609. * Creates a `baseEach` or `baseEachRight` function.
  5610. *
  5611. * @private
  5612. * @param {Function} eachFunc The function to iterate over a collection.
  5613. * @param {boolean} [fromRight] Specify iterating from right to left.
  5614. * @returns {Function} Returns the new base function.
  5615. */
  5616. function createBaseEach(eachFunc, fromRight) {
  5617. return function(collection, iteratee) {
  5618. if (collection == null) {
  5619. return collection;
  5620. }
  5621. if (!isArrayLike(collection)) {
  5622. return eachFunc(collection, iteratee);
  5623. }
  5624. var length = collection.length,
  5625. index = fromRight ? length : -1,
  5626. iterable = Object(collection);
  5627. while ((fromRight ? index-- : ++index < length)) {
  5628. if (iteratee(iterable[index], index, iterable) === false) {
  5629. break;
  5630. }
  5631. }
  5632. return collection;
  5633. };
  5634. }
  5635. /**
  5636. * Creates a base function for methods like `_.forIn` and `_.forOwn`.
  5637. *
  5638. * @private
  5639. * @param {boolean} [fromRight] Specify iterating from right to left.
  5640. * @returns {Function} Returns the new base function.
  5641. */
  5642. function createBaseFor(fromRight) {
  5643. return function(object, iteratee, keysFunc) {
  5644. var index = -1,
  5645. iterable = Object(object),
  5646. props = keysFunc(object),
  5647. length = props.length;
  5648. while (length--) {
  5649. var key = props[fromRight ? length : ++index];
  5650. if (iteratee(iterable[key], key, iterable) === false) {
  5651. break;
  5652. }
  5653. }
  5654. return object;
  5655. };
  5656. }
  5657. /**
  5658. * Creates a function that wraps `func` to invoke it with the optional `this`
  5659. * binding of `thisArg`.
  5660. *
  5661. * @private
  5662. * @param {Function} func The function to wrap.
  5663. * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
  5664. * @param {*} [thisArg] The `this` binding of `func`.
  5665. * @returns {Function} Returns the new wrapped function.
  5666. */
  5667. function createBind(func, bitmask, thisArg) {
  5668. var isBind = bitmask & WRAP_BIND_FLAG,
  5669. Ctor = createCtor(func);
  5670. function wrapper() {
  5671. var fn = (this && this !== root && this instanceof wrapper) ? Ctor : func;
  5672. return fn.apply(isBind ? thisArg : this, arguments);
  5673. }
  5674. return wrapper;
  5675. }
  5676. /**
  5677. * Creates a function like `_.lowerFirst`.
  5678. *
  5679. * @private
  5680. * @param {string} methodName The name of the `String` case method to use.
  5681. * @returns {Function} Returns the new case function.
  5682. */
  5683. function createCaseFirst(methodName) {
  5684. return function(string) {
  5685. string = toString(string);
  5686. var strSymbols = hasUnicode(string)
  5687. ? stringToArray(string)
  5688. : undefined;
  5689. var chr = strSymbols
  5690. ? strSymbols[0]
  5691. : string.charAt(0);
  5692. var trailing = strSymbols
  5693. ? castSlice(strSymbols, 1).join('')
  5694. : string.slice(1);
  5695. return chr[methodName]() + trailing;
  5696. };
  5697. }
  5698. /**
  5699. * Creates a function like `_.camelCase`.
  5700. *
  5701. * @private
  5702. * @param {Function} callback The function to combine each word.
  5703. * @returns {Function} Returns the new compounder function.
  5704. */
  5705. function createCompounder(callback) {
  5706. return function(string) {
  5707. return arrayReduce(words(deburr(string).replace(reApos, '')), callback, '');
  5708. };
  5709. }
  5710. /**
  5711. * Creates a function that produces an instance of `Ctor` regardless of
  5712. * whether it was invoked as part of a `new` expression or by `call` or `apply`.
  5713. *
  5714. * @private
  5715. * @param {Function} Ctor The constructor to wrap.
  5716. * @returns {Function} Returns the new wrapped function.
  5717. */
  5718. function createCtor(Ctor) {
  5719. return function() {
  5720. // Use a `switch` statement to work with class constructors. See
  5721. // http://ecma-international.org/ecma-262/7.0/#sec-ecmascript-function-objects-call-thisargument-argumentslist
  5722. // for more details.
  5723. var args = arguments;
  5724. switch (args.length) {
  5725. case 0: return new Ctor;
  5726. case 1: return new Ctor(args[0]);
  5727. case 2: return new Ctor(args[0], args[1]);
  5728. case 3: return new Ctor(args[0], args[1], args[2]);
  5729. case 4: return new Ctor(args[0], args[1], args[2], args[3]);
  5730. case 5: return new Ctor(args[0], args[1], args[2], args[3], args[4]);
  5731. case 6: return new Ctor(args[0], args[1], args[2], args[3], args[4], args[5]);
  5732. case 7: return new Ctor(args[0], args[1], args[2], args[3], args[4], args[5], args[6]);
  5733. }
  5734. var thisBinding = baseCreate(Ctor.prototype),
  5735. result = Ctor.apply(thisBinding, args);
  5736. // Mimic the constructor's `return` behavior.
  5737. // See https://es5.github.io/#x13.2.2 for more details.
  5738. return isObject(result) ? result : thisBinding;
  5739. };
  5740. }
  5741. /**
  5742. * Creates a function that wraps `func` to enable currying.
  5743. *
  5744. * @private
  5745. * @param {Function} func The function to wrap.
  5746. * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
  5747. * @param {number} arity The arity of `func`.
  5748. * @returns {Function} Returns the new wrapped function.
  5749. */
  5750. function createCurry(func, bitmask, arity) {
  5751. var Ctor = createCtor(func);
  5752. function wrapper() {
  5753. var length = arguments.length,
  5754. args = Array(length),
  5755. index = length,
  5756. placeholder = getHolder(wrapper);
  5757. while (index--) {
  5758. args[index] = arguments[index];
  5759. }
  5760. var holders = (length < 3 && args[0] !== placeholder && args[length - 1] !== placeholder)
  5761. ? []
  5762. : replaceHolders(args, placeholder);
  5763. length -= holders.length;
  5764. if (length < arity) {
  5765. return createRecurry(
  5766. func, bitmask, createHybrid, wrapper.placeholder, undefined,
  5767. args, holders, undefined, undefined, arity - length);
  5768. }
  5769. var fn = (this && this !== root && this instanceof wrapper) ? Ctor : func;
  5770. return apply(fn, this, args);
  5771. }
  5772. return wrapper;
  5773. }
  5774. /**
  5775. * Creates a `_.find` or `_.findLast` function.
  5776. *
  5777. * @private
  5778. * @param {Function} findIndexFunc The function to find the collection index.
  5779. * @returns {Function} Returns the new find function.
  5780. */
  5781. function createFind(findIndexFunc) {
  5782. return function(collection, predicate, fromIndex) {
  5783. var iterable = Object(collection);
  5784. if (!isArrayLike(collection)) {
  5785. var iteratee = getIteratee(predicate, 3);
  5786. collection = keys(collection);
  5787. predicate = function(key) { return iteratee(iterable[key], key, iterable); };
  5788. }
  5789. var index = findIndexFunc(collection, predicate, fromIndex);
  5790. return index > -1 ? iterable[iteratee ? collection[index] : index] : undefined;
  5791. };
  5792. }
  5793. /**
  5794. * Creates a `_.flow` or `_.flowRight` function.
  5795. *
  5796. * @private
  5797. * @param {boolean} [fromRight] Specify iterating from right to left.
  5798. * @returns {Function} Returns the new flow function.
  5799. */
  5800. function createFlow(fromRight) {
  5801. return flatRest(function(funcs) {
  5802. var length = funcs.length,
  5803. index = length,
  5804. prereq = LodashWrapper.prototype.thru;
  5805. if (fromRight) {
  5806. funcs.reverse();
  5807. }
  5808. while (index--) {
  5809. var func = funcs[index];
  5810. if (typeof func != 'function') {
  5811. throw new TypeError(FUNC_ERROR_TEXT);
  5812. }
  5813. if (prereq && !wrapper && getFuncName(func) == 'wrapper') {
  5814. var wrapper = new LodashWrapper([], true);
  5815. }
  5816. }
  5817. index = wrapper ? index : length;
  5818. while (++index < length) {
  5819. func = funcs[index];
  5820. var funcName = getFuncName(func),
  5821. data = funcName == 'wrapper' ? getData(func) : undefined;
  5822. if (data && isLaziable(data[0]) &&
  5823. data[1] == (WRAP_ARY_FLAG | WRAP_CURRY_FLAG | WRAP_PARTIAL_FLAG | WRAP_REARG_FLAG) &&
  5824. !data[4].length && data[9] == 1
  5825. ) {
  5826. wrapper = wrapper[getFuncName(data[0])].apply(wrapper, data[3]);
  5827. } else {
  5828. wrapper = (func.length == 1 && isLaziable(func))
  5829. ? wrapper[funcName]()
  5830. : wrapper.thru(func);
  5831. }
  5832. }
  5833. return function() {
  5834. var args = arguments,
  5835. value = args[0];
  5836. if (wrapper && args.length == 1 && isArray(value)) {
  5837. return wrapper.plant(value).value();
  5838. }
  5839. var index = 0,
  5840. result = length ? funcs[index].apply(this, args) : value;
  5841. while (++index < length) {
  5842. result = funcs[index].call(this, result);
  5843. }
  5844. return result;
  5845. };
  5846. });
  5847. }
  5848. /**
  5849. * Creates a function that wraps `func` to invoke it with optional `this`
  5850. * binding of `thisArg`, partial application, and currying.
  5851. *
  5852. * @private
  5853. * @param {Function|string} func The function or method name to wrap.
  5854. * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
  5855. * @param {*} [thisArg] The `this` binding of `func`.
  5856. * @param {Array} [partials] The arguments to prepend to those provided to
  5857. * the new function.
  5858. * @param {Array} [holders] The `partials` placeholder indexes.
  5859. * @param {Array} [partialsRight] The arguments to append to those provided
  5860. * to the new function.
  5861. * @param {Array} [holdersRight] The `partialsRight` placeholder indexes.
  5862. * @param {Array} [argPos] The argument positions of the new function.
  5863. * @param {number} [ary] The arity cap of `func`.
  5864. * @param {number} [arity] The arity of `func`.
  5865. * @returns {Function} Returns the new wrapped function.
  5866. */
  5867. function createHybrid(func, bitmask, thisArg, partials, holders, partialsRight, holdersRight, argPos, ary, arity) {
  5868. var isAry = bitmask & WRAP_ARY_FLAG,
  5869. isBind = bitmask & WRAP_BIND_FLAG,
  5870. isBindKey = bitmask & WRAP_BIND_KEY_FLAG,
  5871. isCurried = bitmask & (WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG),
  5872. isFlip = bitmask & WRAP_FLIP_FLAG,
  5873. Ctor = isBindKey ? undefined : createCtor(func);
  5874. function wrapper() {
  5875. var length = arguments.length,
  5876. args = Array(length),
  5877. index = length;
  5878. while (index--) {
  5879. args[index] = arguments[index];
  5880. }
  5881. if (isCurried) {
  5882. var placeholder = getHolder(wrapper),
  5883. holdersCount = countHolders(args, placeholder);
  5884. }
  5885. if (partials) {
  5886. args = composeArgs(args, partials, holders, isCurried);
  5887. }
  5888. if (partialsRight) {
  5889. args = composeArgsRight(args, partialsRight, holdersRight, isCurried);
  5890. }
  5891. length -= holdersCount;
  5892. if (isCurried && length < arity) {
  5893. var newHolders = replaceHolders(args, placeholder);
  5894. return createRecurry(
  5895. func, bitmask, createHybrid, wrapper.placeholder, thisArg,
  5896. args, newHolders, argPos, ary, arity - length
  5897. );
  5898. }
  5899. var thisBinding = isBind ? thisArg : this,
  5900. fn = isBindKey ? thisBinding[func] : func;
  5901. length = args.length;
  5902. if (argPos) {
  5903. args = reorder(args, argPos);
  5904. } else if (isFlip && length > 1) {
  5905. args.reverse();
  5906. }
  5907. if (isAry && ary < length) {
  5908. args.length = ary;
  5909. }
  5910. if (this && this !== root && this instanceof wrapper) {
  5911. fn = Ctor || createCtor(fn);
  5912. }
  5913. return fn.apply(thisBinding, args);
  5914. }
  5915. return wrapper;
  5916. }
  5917. /**
  5918. * Creates a function like `_.invertBy`.
  5919. *
  5920. * @private
  5921. * @param {Function} setter The function to set accumulator values.
  5922. * @param {Function} toIteratee The function to resolve iteratees.
  5923. * @returns {Function} Returns the new inverter function.
  5924. */
  5925. function createInverter(setter, toIteratee) {
  5926. return function(object, iteratee) {
  5927. return baseInverter(object, setter, toIteratee(iteratee), {});
  5928. };
  5929. }
  5930. /**
  5931. * Creates a function that performs a mathematical operation on two values.
  5932. *
  5933. * @private
  5934. * @param {Function} operator The function to perform the operation.
  5935. * @param {number} [defaultValue] The value used for `undefined` arguments.
  5936. * @returns {Function} Returns the new mathematical operation function.
  5937. */
  5938. function createMathOperation(operator, defaultValue) {
  5939. return function(value, other) {
  5940. var result;
  5941. if (value === undefined && other === undefined) {
  5942. return defaultValue;
  5943. }
  5944. if (value !== undefined) {
  5945. result = value;
  5946. }
  5947. if (other !== undefined) {
  5948. if (result === undefined) {
  5949. return other;
  5950. }
  5951. if (typeof value == 'string' || typeof other == 'string') {
  5952. value = baseToString(value);
  5953. other = baseToString(other);
  5954. } else {
  5955. value = baseToNumber(value);
  5956. other = baseToNumber(other);
  5957. }
  5958. result = operator(value, other);
  5959. }
  5960. return result;
  5961. };
  5962. }
  5963. /**
  5964. * Creates a function like `_.over`.
  5965. *
  5966. * @private
  5967. * @param {Function} arrayFunc The function to iterate over iteratees.
  5968. * @returns {Function} Returns the new over function.
  5969. */
  5970. function createOver(arrayFunc) {
  5971. return flatRest(function(iteratees) {
  5972. iteratees = arrayMap(iteratees, baseUnary(getIteratee()));
  5973. return baseRest(function(args) {
  5974. var thisArg = this;
  5975. return arrayFunc(iteratees, function(iteratee) {
  5976. return apply(iteratee, thisArg, args);
  5977. });
  5978. });
  5979. });
  5980. }
  5981. /**
  5982. * Creates the padding for `string` based on `length`. The `chars` string
  5983. * is truncated if the number of characters exceeds `length`.
  5984. *
  5985. * @private
  5986. * @param {number} length The padding length.
  5987. * @param {string} [chars=' '] The string used as padding.
  5988. * @returns {string} Returns the padding for `string`.
  5989. */
  5990. function createPadding(length, chars) {
  5991. chars = chars === undefined ? ' ' : baseToString(chars);
  5992. var charsLength = chars.length;
  5993. if (charsLength < 2) {
  5994. return charsLength ? baseRepeat(chars, length) : chars;
  5995. }
  5996. var result = baseRepeat(chars, nativeCeil(length / stringSize(chars)));
  5997. return hasUnicode(chars)
  5998. ? castSlice(stringToArray(result), 0, length).join('')
  5999. : result.slice(0, length);
  6000. }
  6001. /**
  6002. * Creates a function that wraps `func` to invoke it with the `this` binding
  6003. * of `thisArg` and `partials` prepended to the arguments it receives.
  6004. *
  6005. * @private
  6006. * @param {Function} func The function to wrap.
  6007. * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
  6008. * @param {*} thisArg The `this` binding of `func`.
  6009. * @param {Array} partials The arguments to prepend to those provided to
  6010. * the new function.
  6011. * @returns {Function} Returns the new wrapped function.
  6012. */
  6013. function createPartial(func, bitmask, thisArg, partials) {
  6014. var isBind = bitmask & WRAP_BIND_FLAG,
  6015. Ctor = createCtor(func);
  6016. function wrapper() {
  6017. var argsIndex = -1,
  6018. argsLength = arguments.length,
  6019. leftIndex = -1,
  6020. leftLength = partials.length,
  6021. args = Array(leftLength + argsLength),
  6022. fn = (this && this !== root && this instanceof wrapper) ? Ctor : func;
  6023. while (++leftIndex < leftLength) {
  6024. args[leftIndex] = partials[leftIndex];
  6025. }
  6026. while (argsLength--) {
  6027. args[leftIndex++] = arguments[++argsIndex];
  6028. }
  6029. return apply(fn, isBind ? thisArg : this, args);
  6030. }
  6031. return wrapper;
  6032. }
  6033. /**
  6034. * Creates a `_.range` or `_.rangeRight` function.
  6035. *
  6036. * @private
  6037. * @param {boolean} [fromRight] Specify iterating from right to left.
  6038. * @returns {Function} Returns the new range function.
  6039. */
  6040. function createRange(fromRight) {
  6041. return function(start, end, step) {
  6042. if (step && typeof step != 'number' && isIterateeCall(start, end, step)) {
  6043. end = step = undefined;
  6044. }
  6045. // Ensure the sign of `-0` is preserved.
  6046. start = toFinite(start);
  6047. if (end === undefined) {
  6048. end = start;
  6049. start = 0;
  6050. } else {
  6051. end = toFinite(end);
  6052. }
  6053. step = step === undefined ? (start < end ? 1 : -1) : toFinite(step);
  6054. return baseRange(start, end, step, fromRight);
  6055. };
  6056. }
  6057. /**
  6058. * Creates a function that performs a relational operation on two values.
  6059. *
  6060. * @private
  6061. * @param {Function} operator The function to perform the operation.
  6062. * @returns {Function} Returns the new relational operation function.
  6063. */
  6064. function createRelationalOperation(operator) {
  6065. return function(value, other) {
  6066. if (!(typeof value == 'string' && typeof other == 'string')) {
  6067. value = toNumber(value);
  6068. other = toNumber(other);
  6069. }
  6070. return operator(value, other);
  6071. };
  6072. }
  6073. /**
  6074. * Creates a function that wraps `func` to continue currying.
  6075. *
  6076. * @private
  6077. * @param {Function} func The function to wrap.
  6078. * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
  6079. * @param {Function} wrapFunc The function to create the `func` wrapper.
  6080. * @param {*} placeholder The placeholder value.
  6081. * @param {*} [thisArg] The `this` binding of `func`.
  6082. * @param {Array} [partials] The arguments to prepend to those provided to
  6083. * the new function.
  6084. * @param {Array} [holders] The `partials` placeholder indexes.
  6085. * @param {Array} [argPos] The argument positions of the new function.
  6086. * @param {number} [ary] The arity cap of `func`.
  6087. * @param {number} [arity] The arity of `func`.
  6088. * @returns {Function} Returns the new wrapped function.
  6089. */
  6090. function createRecurry(func, bitmask, wrapFunc, placeholder, thisArg, partials, holders, argPos, ary, arity) {
  6091. var isCurry = bitmask & WRAP_CURRY_FLAG,
  6092. newHolders = isCurry ? holders : undefined,
  6093. newHoldersRight = isCurry ? undefined : holders,
  6094. newPartials = isCurry ? partials : undefined,
  6095. newPartialsRight = isCurry ? undefined : partials;
  6096. bitmask |= (isCurry ? WRAP_PARTIAL_FLAG : WRAP_PARTIAL_RIGHT_FLAG);
  6097. bitmask &= ~(isCurry ? WRAP_PARTIAL_RIGHT_FLAG : WRAP_PARTIAL_FLAG);
  6098. if (!(bitmask & WRAP_CURRY_BOUND_FLAG)) {
  6099. bitmask &= ~(WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG);
  6100. }
  6101. var newData = [
  6102. func, bitmask, thisArg, newPartials, newHolders, newPartialsRight,
  6103. newHoldersRight, argPos, ary, arity
  6104. ];
  6105. var result = wrapFunc.apply(undefined, newData);
  6106. if (isLaziable(func)) {
  6107. setData(result, newData);
  6108. }
  6109. result.placeholder = placeholder;
  6110. return setWrapToString(result, func, bitmask);
  6111. }
  6112. /**
  6113. * Creates a function like `_.round`.
  6114. *
  6115. * @private
  6116. * @param {string} methodName The name of the `Math` method to use when rounding.
  6117. * @returns {Function} Returns the new round function.
  6118. */
  6119. function createRound(methodName) {
  6120. var func = Math[methodName];
  6121. return function(number, precision) {
  6122. number = toNumber(number);
  6123. precision = precision == null ? 0 : nativeMin(toInteger(precision), 292);
  6124. if (precision && nativeIsFinite(number)) {
  6125. // Shift with exponential notation to avoid floating-point issues.
  6126. // See [MDN](https://mdn.io/round#Examples) for more details.
  6127. var pair = (toString(number) + 'e').split('e'),
  6128. value = func(pair[0] + 'e' + (+pair[1] + precision));
  6129. pair = (toString(value) + 'e').split('e');
  6130. return +(pair[0] + 'e' + (+pair[1] - precision));
  6131. }
  6132. return func(number);
  6133. };
  6134. }
  6135. /**
  6136. * Creates a set object of `values`.
  6137. *
  6138. * @private
  6139. * @param {Array} values The values to add to the set.
  6140. * @returns {Object} Returns the new set.
  6141. */
  6142. var createSet = !(Set && (1 / setToArray(new Set([,-0]))[1]) == INFINITY) ? noop : function(values) {
  6143. return new Set(values);
  6144. };
  6145. /**
  6146. * Creates a `_.toPairs` or `_.toPairsIn` function.
  6147. *
  6148. * @private
  6149. * @param {Function} keysFunc The function to get the keys of a given object.
  6150. * @returns {Function} Returns the new pairs function.
  6151. */
  6152. function createToPairs(keysFunc) {
  6153. return function(object) {
  6154. var tag = getTag(object);
  6155. if (tag == mapTag) {
  6156. return mapToArray(object);
  6157. }
  6158. if (tag == setTag) {
  6159. return setToPairs(object);
  6160. }
  6161. return baseToPairs(object, keysFunc(object));
  6162. };
  6163. }
  6164. /**
  6165. * Creates a function that either curries or invokes `func` with optional
  6166. * `this` binding and partially applied arguments.
  6167. *
  6168. * @private
  6169. * @param {Function|string} func The function or method name to wrap.
  6170. * @param {number} bitmask The bitmask flags.
  6171. * 1 - `_.bind`
  6172. * 2 - `_.bindKey`
  6173. * 4 - `_.curry` or `_.curryRight` of a bound function
  6174. * 8 - `_.curry`
  6175. * 16 - `_.curryRight`
  6176. * 32 - `_.partial`
  6177. * 64 - `_.partialRight`
  6178. * 128 - `_.rearg`
  6179. * 256 - `_.ary`
  6180. * 512 - `_.flip`
  6181. * @param {*} [thisArg] The `this` binding of `func`.
  6182. * @param {Array} [partials] The arguments to be partially applied.
  6183. * @param {Array} [holders] The `partials` placeholder indexes.
  6184. * @param {Array} [argPos] The argument positions of the new function.
  6185. * @param {number} [ary] The arity cap of `func`.
  6186. * @param {number} [arity] The arity of `func`.
  6187. * @returns {Function} Returns the new wrapped function.
  6188. */
  6189. function createWrap(func, bitmask, thisArg, partials, holders, argPos, ary, arity) {
  6190. var isBindKey = bitmask & WRAP_BIND_KEY_FLAG;
  6191. if (!isBindKey && typeof func != 'function') {
  6192. throw new TypeError(FUNC_ERROR_TEXT);
  6193. }
  6194. var length = partials ? partials.length : 0;
  6195. if (!length) {
  6196. bitmask &= ~(WRAP_PARTIAL_FLAG | WRAP_PARTIAL_RIGHT_FLAG);
  6197. partials = holders = undefined;
  6198. }
  6199. ary = ary === undefined ? ary : nativeMax(toInteger(ary), 0);
  6200. arity = arity === undefined ? arity : toInteger(arity);
  6201. length -= holders ? holders.length : 0;
  6202. if (bitmask & WRAP_PARTIAL_RIGHT_FLAG) {
  6203. var partialsRight = partials,
  6204. holdersRight = holders;
  6205. partials = holders = undefined;
  6206. }
  6207. var data = isBindKey ? undefined : getData(func);
  6208. var newData = [
  6209. func, bitmask, thisArg, partials, holders, partialsRight, holdersRight,
  6210. argPos, ary, arity
  6211. ];
  6212. if (data) {
  6213. mergeData(newData, data);
  6214. }
  6215. func = newData[0];
  6216. bitmask = newData[1];
  6217. thisArg = newData[2];
  6218. partials = newData[3];
  6219. holders = newData[4];
  6220. arity = newData[9] = newData[9] === undefined
  6221. ? (isBindKey ? 0 : func.length)
  6222. : nativeMax(newData[9] - length, 0);
  6223. if (!arity && bitmask & (WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG)) {
  6224. bitmask &= ~(WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG);
  6225. }
  6226. if (!bitmask || bitmask == WRAP_BIND_FLAG) {
  6227. var result = createBind(func, bitmask, thisArg);
  6228. } else if (bitmask == WRAP_CURRY_FLAG || bitmask == WRAP_CURRY_RIGHT_FLAG) {
  6229. result = createCurry(func, bitmask, arity);
  6230. } else if ((bitmask == WRAP_PARTIAL_FLAG || bitmask == (WRAP_BIND_FLAG | WRAP_PARTIAL_FLAG)) && !holders.length) {
  6231. result = createPartial(func, bitmask, thisArg, partials);
  6232. } else {
  6233. result = createHybrid.apply(undefined, newData);
  6234. }
  6235. var setter = data ? baseSetData : setData;
  6236. return setWrapToString(setter(result, newData), func, bitmask);
  6237. }
  6238. /**
  6239. * Used by `_.defaults` to customize its `_.assignIn` use to assign properties
  6240. * of source objects to the destination object for all destination properties
  6241. * that resolve to `undefined`.
  6242. *
  6243. * @private
  6244. * @param {*} objValue The destination value.
  6245. * @param {*} srcValue The source value.
  6246. * @param {string} key The key of the property to assign.
  6247. * @param {Object} object The parent object of `objValue`.
  6248. * @returns {*} Returns the value to assign.
  6249. */
  6250. function customDefaultsAssignIn(objValue, srcValue, key, object) {
  6251. if (objValue === undefined ||
  6252. (eq(objValue, objectProto[key]) && !hasOwnProperty.call(object, key))) {
  6253. return srcValue;
  6254. }
  6255. return objValue;
  6256. }
  6257. /**
  6258. * Used by `_.defaultsDeep` to customize its `_.merge` use to merge source
  6259. * objects into destination objects that are passed thru.
  6260. *
  6261. * @private
  6262. * @param {*} objValue The destination value.
  6263. * @param {*} srcValue The source value.
  6264. * @param {string} key The key of the property to merge.
  6265. * @param {Object} object The parent object of `objValue`.
  6266. * @param {Object} source The parent object of `srcValue`.
  6267. * @param {Object} [stack] Tracks traversed source values and their merged
  6268. * counterparts.
  6269. * @returns {*} Returns the value to assign.
  6270. */
  6271. function customDefaultsMerge(objValue, srcValue, key, object, source, stack) {
  6272. if (isObject(objValue) && isObject(srcValue)) {
  6273. // Recursively merge objects and arrays (susceptible to call stack limits).
  6274. stack.set(srcValue, objValue);
  6275. baseMerge(objValue, srcValue, undefined, customDefaultsMerge, stack);
  6276. stack['delete'](srcValue);
  6277. }
  6278. return objValue;
  6279. }
  6280. /**
  6281. * Used by `_.omit` to customize its `_.cloneDeep` use to only clone plain
  6282. * objects.
  6283. *
  6284. * @private
  6285. * @param {*} value The value to inspect.
  6286. * @param {string} key The key of the property to inspect.
  6287. * @returns {*} Returns the uncloned value or `undefined` to defer cloning to `_.cloneDeep`.
  6288. */
  6289. function customOmitClone(value) {
  6290. return isPlainObject(value) ? undefined : value;
  6291. }
  6292. /**
  6293. * A specialized version of `baseIsEqualDeep` for arrays with support for
  6294. * partial deep comparisons.
  6295. *
  6296. * @private
  6297. * @param {Array} array The array to compare.
  6298. * @param {Array} other The other array to compare.
  6299. * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
  6300. * @param {Function} customizer The function to customize comparisons.
  6301. * @param {Function} equalFunc The function to determine equivalents of values.
  6302. * @param {Object} stack Tracks traversed `array` and `other` objects.
  6303. * @returns {boolean} Returns `true` if the arrays are equivalent, else `false`.
  6304. */
  6305. function equalArrays(array, other, bitmask, customizer, equalFunc, stack) {
  6306. var isPartial = bitmask & COMPARE_PARTIAL_FLAG,
  6307. arrLength = array.length,
  6308. othLength = other.length;
  6309. if (arrLength != othLength && !(isPartial && othLength > arrLength)) {
  6310. return false;
  6311. }
  6312. // Check that cyclic values are equal.
  6313. var arrStacked = stack.get(array);
  6314. var othStacked = stack.get(other);
  6315. if (arrStacked && othStacked) {
  6316. return arrStacked == other && othStacked == array;
  6317. }
  6318. var index = -1,
  6319. result = true,
  6320. seen = (bitmask & COMPARE_UNORDERED_FLAG) ? new SetCache : undefined;
  6321. stack.set(array, other);
  6322. stack.set(other, array);
  6323. // Ignore non-index properties.
  6324. while (++index < arrLength) {
  6325. var arrValue = array[index],
  6326. othValue = other[index];
  6327. if (customizer) {
  6328. var compared = isPartial
  6329. ? customizer(othValue, arrValue, index, other, array, stack)
  6330. : customizer(arrValue, othValue, index, array, other, stack);
  6331. }
  6332. if (compared !== undefined) {
  6333. if (compared) {
  6334. continue;
  6335. }
  6336. result = false;
  6337. break;
  6338. }
  6339. // Recursively compare arrays (susceptible to call stack limits).
  6340. if (seen) {
  6341. if (!arraySome(other, function(othValue, othIndex) {
  6342. if (!cacheHas(seen, othIndex) &&
  6343. (arrValue === othValue || equalFunc(arrValue, othValue, bitmask, customizer, stack))) {
  6344. return seen.push(othIndex);
  6345. }
  6346. })) {
  6347. result = false;
  6348. break;
  6349. }
  6350. } else if (!(
  6351. arrValue === othValue ||
  6352. equalFunc(arrValue, othValue, bitmask, customizer, stack)
  6353. )) {
  6354. result = false;
  6355. break;
  6356. }
  6357. }
  6358. stack['delete'](array);
  6359. stack['delete'](other);
  6360. return result;
  6361. }
  6362. /**
  6363. * A specialized version of `baseIsEqualDeep` for comparing objects of
  6364. * the same `toStringTag`.
  6365. *
  6366. * **Note:** This function only supports comparing values with tags of
  6367. * `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`.
  6368. *
  6369. * @private
  6370. * @param {Object} object The object to compare.
  6371. * @param {Object} other The other object to compare.
  6372. * @param {string} tag The `toStringTag` of the objects to compare.
  6373. * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
  6374. * @param {Function} customizer The function to customize comparisons.
  6375. * @param {Function} equalFunc The function to determine equivalents of values.
  6376. * @param {Object} stack Tracks traversed `object` and `other` objects.
  6377. * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
  6378. */
  6379. function equalByTag(object, other, tag, bitmask, customizer, equalFunc, stack) {
  6380. switch (tag) {
  6381. case dataViewTag:
  6382. if ((object.byteLength != other.byteLength) ||
  6383. (object.byteOffset != other.byteOffset)) {
  6384. return false;
  6385. }
  6386. object = object.buffer;
  6387. other = other.buffer;
  6388. case arrayBufferTag:
  6389. if ((object.byteLength != other.byteLength) ||
  6390. !equalFunc(new Uint8Array(object), new Uint8Array(other))) {
  6391. return false;
  6392. }
  6393. return true;
  6394. case boolTag:
  6395. case dateTag:
  6396. case numberTag:
  6397. // Coerce booleans to `1` or `0` and dates to milliseconds.
  6398. // Invalid dates are coerced to `NaN`.
  6399. return eq(+object, +other);
  6400. case errorTag:
  6401. return object.name == other.name && object.message == other.message;
  6402. case regexpTag:
  6403. case stringTag:
  6404. // Coerce regexes to strings and treat strings, primitives and objects,
  6405. // as equal. See http://www.ecma-international.org/ecma-262/7.0/#sec-regexp.prototype.tostring
  6406. // for more details.
  6407. return object == (other + '');
  6408. case mapTag:
  6409. var convert = mapToArray;
  6410. case setTag:
  6411. var isPartial = bitmask & COMPARE_PARTIAL_FLAG;
  6412. convert || (convert = setToArray);
  6413. if (object.size != other.size && !isPartial) {
  6414. return false;
  6415. }
  6416. // Assume cyclic values are equal.
  6417. var stacked = stack.get(object);
  6418. if (stacked) {
  6419. return stacked == other;
  6420. }
  6421. bitmask |= COMPARE_UNORDERED_FLAG;
  6422. // Recursively compare objects (susceptible to call stack limits).
  6423. stack.set(object, other);
  6424. var result = equalArrays(convert(object), convert(other), bitmask, customizer, equalFunc, stack);
  6425. stack['delete'](object);
  6426. return result;
  6427. case symbolTag:
  6428. if (symbolValueOf) {
  6429. return symbolValueOf.call(object) == symbolValueOf.call(other);
  6430. }
  6431. }
  6432. return false;
  6433. }
  6434. /**
  6435. * A specialized version of `baseIsEqualDeep` for objects with support for
  6436. * partial deep comparisons.
  6437. *
  6438. * @private
  6439. * @param {Object} object The object to compare.
  6440. * @param {Object} other The other object to compare.
  6441. * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
  6442. * @param {Function} customizer The function to customize comparisons.
  6443. * @param {Function} equalFunc The function to determine equivalents of values.
  6444. * @param {Object} stack Tracks traversed `object` and `other` objects.
  6445. * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
  6446. */
  6447. function equalObjects(object, other, bitmask, customizer, equalFunc, stack) {
  6448. var isPartial = bitmask & COMPARE_PARTIAL_FLAG,
  6449. objProps = getAllKeys(object),
  6450. objLength = objProps.length,
  6451. othProps = getAllKeys(other),
  6452. othLength = othProps.length;
  6453. if (objLength != othLength && !isPartial) {
  6454. return false;
  6455. }
  6456. var index = objLength;
  6457. while (index--) {
  6458. var key = objProps[index];
  6459. if (!(isPartial ? key in other : hasOwnProperty.call(other, key))) {
  6460. return false;
  6461. }
  6462. }
  6463. // Check that cyclic values are equal.
  6464. var objStacked = stack.get(object);
  6465. var othStacked = stack.get(other);
  6466. if (objStacked && othStacked) {
  6467. return objStacked == other && othStacked == object;
  6468. }
  6469. var result = true;
  6470. stack.set(object, other);
  6471. stack.set(other, object);
  6472. var skipCtor = isPartial;
  6473. while (++index < objLength) {
  6474. key = objProps[index];
  6475. var objValue = object[key],
  6476. othValue = other[key];
  6477. if (customizer) {
  6478. var compared = isPartial
  6479. ? customizer(othValue, objValue, key, other, object, stack)
  6480. : customizer(objValue, othValue, key, object, other, stack);
  6481. }
  6482. // Recursively compare objects (susceptible to call stack limits).
  6483. if (!(compared === undefined
  6484. ? (objValue === othValue || equalFunc(objValue, othValue, bitmask, customizer, stack))
  6485. : compared
  6486. )) {
  6487. result = false;
  6488. break;
  6489. }
  6490. skipCtor || (skipCtor = key == 'constructor');
  6491. }
  6492. if (result && !skipCtor) {
  6493. var objCtor = object.constructor,
  6494. othCtor = other.constructor;
  6495. // Non `Object` object instances with different constructors are not equal.
  6496. if (objCtor != othCtor &&
  6497. ('constructor' in object && 'constructor' in other) &&
  6498. !(typeof objCtor == 'function' && objCtor instanceof objCtor &&
  6499. typeof othCtor == 'function' && othCtor instanceof othCtor)) {
  6500. result = false;
  6501. }
  6502. }
  6503. stack['delete'](object);
  6504. stack['delete'](other);
  6505. return result;
  6506. }
  6507. /**
  6508. * A specialized version of `baseRest` which flattens the rest array.
  6509. *
  6510. * @private
  6511. * @param {Function} func The function to apply a rest parameter to.
  6512. * @returns {Function} Returns the new function.
  6513. */
  6514. function flatRest(func) {
  6515. return setToString(overRest(func, undefined, flatten), func + '');
  6516. }
  6517. /**
  6518. * Creates an array of own enumerable property names and symbols of `object`.
  6519. *
  6520. * @private
  6521. * @param {Object} object The object to query.
  6522. * @returns {Array} Returns the array of property names and symbols.
  6523. */
  6524. function getAllKeys(object) {
  6525. return baseGetAllKeys(object, keys, getSymbols);
  6526. }
  6527. /**
  6528. * Creates an array of own and inherited enumerable property names and
  6529. * symbols of `object`.
  6530. *
  6531. * @private
  6532. * @param {Object} object The object to query.
  6533. * @returns {Array} Returns the array of property names and symbols.
  6534. */
  6535. function getAllKeysIn(object) {
  6536. return baseGetAllKeys(object, keysIn, getSymbolsIn);
  6537. }
  6538. /**
  6539. * Gets metadata for `func`.
  6540. *
  6541. * @private
  6542. * @param {Function} func The function to query.
  6543. * @returns {*} Returns the metadata for `func`.
  6544. */
  6545. var getData = !metaMap ? noop : function(func) {
  6546. return metaMap.get(func);
  6547. };
  6548. /**
  6549. * Gets the name of `func`.
  6550. *
  6551. * @private
  6552. * @param {Function} func The function to query.
  6553. * @returns {string} Returns the function name.
  6554. */
  6555. function getFuncName(func) {
  6556. var result = (func.name + ''),
  6557. array = realNames[result],
  6558. length = hasOwnProperty.call(realNames, result) ? array.length : 0;
  6559. while (length--) {
  6560. var data = array[length],
  6561. otherFunc = data.func;
  6562. if (otherFunc == null || otherFunc == func) {
  6563. return data.name;
  6564. }
  6565. }
  6566. return result;
  6567. }
  6568. /**
  6569. * Gets the argument placeholder value for `func`.
  6570. *
  6571. * @private
  6572. * @param {Function} func The function to inspect.
  6573. * @returns {*} Returns the placeholder value.
  6574. */
  6575. function getHolder(func) {
  6576. var object = hasOwnProperty.call(lodash, 'placeholder') ? lodash : func;
  6577. return object.placeholder;
  6578. }
  6579. /**
  6580. * Gets the appropriate "iteratee" function. If `_.iteratee` is customized,
  6581. * this function returns the custom method, otherwise it returns `baseIteratee`.
  6582. * If arguments are provided, the chosen function is invoked with them and
  6583. * its result is returned.
  6584. *
  6585. * @private
  6586. * @param {*} [value] The value to convert to an iteratee.
  6587. * @param {number} [arity] The arity of the created iteratee.
  6588. * @returns {Function} Returns the chosen function or its result.
  6589. */
  6590. function getIteratee() {
  6591. var result = lodash.iteratee || iteratee;
  6592. result = result === iteratee ? baseIteratee : result;
  6593. return arguments.length ? result(arguments[0], arguments[1]) : result;
  6594. }
  6595. /**
  6596. * Gets the data for `map`.
  6597. *
  6598. * @private
  6599. * @param {Object} map The map to query.
  6600. * @param {string} key The reference key.
  6601. * @returns {*} Returns the map data.
  6602. */
  6603. function getMapData(map, key) {
  6604. var data = map.__data__;
  6605. return isKeyable(key)
  6606. ? data[typeof key == 'string' ? 'string' : 'hash']
  6607. : data.map;
  6608. }
  6609. /**
  6610. * Gets the property names, values, and compare flags of `object`.
  6611. *
  6612. * @private
  6613. * @param {Object} object The object to query.
  6614. * @returns {Array} Returns the match data of `object`.
  6615. */
  6616. function getMatchData(object) {
  6617. var result = keys(object),
  6618. length = result.length;
  6619. while (length--) {
  6620. var key = result[length],
  6621. value = object[key];
  6622. result[length] = [key, value, isStrictComparable(value)];
  6623. }
  6624. return result;
  6625. }
  6626. /**
  6627. * Gets the native function at `key` of `object`.
  6628. *
  6629. * @private
  6630. * @param {Object} object The object to query.
  6631. * @param {string} key The key of the method to get.
  6632. * @returns {*} Returns the function if it's native, else `undefined`.
  6633. */
  6634. function getNative(object, key) {
  6635. var value = getValue(object, key);
  6636. return baseIsNative(value) ? value : undefined;
  6637. }
  6638. /**
  6639. * A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values.
  6640. *
  6641. * @private
  6642. * @param {*} value The value to query.
  6643. * @returns {string} Returns the raw `toStringTag`.
  6644. */
  6645. function getRawTag(value) {
  6646. var isOwn = hasOwnProperty.call(value, symToStringTag),
  6647. tag = value[symToStringTag];
  6648. try {
  6649. value[symToStringTag] = undefined;
  6650. var unmasked = true;
  6651. } catch (e) {}
  6652. var result = nativeObjectToString.call(value);
  6653. if (unmasked) {
  6654. if (isOwn) {
  6655. value[symToStringTag] = tag;
  6656. } else {
  6657. delete value[symToStringTag];
  6658. }
  6659. }
  6660. return result;
  6661. }
  6662. /**
  6663. * Creates an array of the own enumerable symbols of `object`.
  6664. *
  6665. * @private
  6666. * @param {Object} object The object to query.
  6667. * @returns {Array} Returns the array of symbols.
  6668. */
  6669. var getSymbols = !nativeGetSymbols ? stubArray : function(object) {
  6670. if (object == null) {
  6671. return [];
  6672. }
  6673. object = Object(object);
  6674. return arrayFilter(nativeGetSymbols(object), function(symbol) {
  6675. return propertyIsEnumerable.call(object, symbol);
  6676. });
  6677. };
  6678. /**
  6679. * Creates an array of the own and inherited enumerable symbols of `object`.
  6680. *
  6681. * @private
  6682. * @param {Object} object The object to query.
  6683. * @returns {Array} Returns the array of symbols.
  6684. */
  6685. var getSymbolsIn = !nativeGetSymbols ? stubArray : function(object) {
  6686. var result = [];
  6687. while (object) {
  6688. arrayPush(result, getSymbols(object));
  6689. object = getPrototype(object);
  6690. }
  6691. return result;
  6692. };
  6693. /**
  6694. * Gets the `toStringTag` of `value`.
  6695. *
  6696. * @private
  6697. * @param {*} value The value to query.
  6698. * @returns {string} Returns the `toStringTag`.
  6699. */
  6700. var getTag = baseGetTag;
  6701. // Fallback for data views, maps, sets, and weak maps in IE 11 and promises in Node.js < 6.
  6702. if ((DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag) ||
  6703. (Map && getTag(new Map) != mapTag) ||
  6704. (Promise && getTag(Promise.resolve()) != promiseTag) ||
  6705. (Set && getTag(new Set) != setTag) ||
  6706. (WeakMap && getTag(new WeakMap) != weakMapTag)) {
  6707. getTag = function(value) {
  6708. var result = baseGetTag(value),
  6709. Ctor = result == objectTag ? value.constructor : undefined,
  6710. ctorString = Ctor ? toSource(Ctor) : '';
  6711. if (ctorString) {
  6712. switch (ctorString) {
  6713. case dataViewCtorString: return dataViewTag;
  6714. case mapCtorString: return mapTag;
  6715. case promiseCtorString: return promiseTag;
  6716. case setCtorString: return setTag;
  6717. case weakMapCtorString: return weakMapTag;
  6718. }
  6719. }
  6720. return result;
  6721. };
  6722. }
  6723. /**
  6724. * Gets the view, applying any `transforms` to the `start` and `end` positions.
  6725. *
  6726. * @private
  6727. * @param {number} start The start of the view.
  6728. * @param {number} end The end of the view.
  6729. * @param {Array} transforms The transformations to apply to the view.
  6730. * @returns {Object} Returns an object containing the `start` and `end`
  6731. * positions of the view.
  6732. */
  6733. function getView(start, end, transforms) {
  6734. var index = -1,
  6735. length = transforms.length;
  6736. while (++index < length) {
  6737. var data = transforms[index],
  6738. size = data.size;
  6739. switch (data.type) {
  6740. case 'drop': start += size; break;
  6741. case 'dropRight': end -= size; break;
  6742. case 'take': end = nativeMin(end, start + size); break;
  6743. case 'takeRight': start = nativeMax(start, end - size); break;
  6744. }
  6745. }
  6746. return { 'start': start, 'end': end };
  6747. }
  6748. /**
  6749. * Extracts wrapper details from the `source` body comment.
  6750. *
  6751. * @private
  6752. * @param {string} source The source to inspect.
  6753. * @returns {Array} Returns the wrapper details.
  6754. */
  6755. function getWrapDetails(source) {
  6756. var match = source.match(reWrapDetails);
  6757. return match ? match[1].split(reSplitDetails) : [];
  6758. }
  6759. /**
  6760. * Checks if `path` exists on `object`.
  6761. *
  6762. * @private
  6763. * @param {Object} object The object to query.
  6764. * @param {Array|string} path The path to check.
  6765. * @param {Function} hasFunc The function to check properties.
  6766. * @returns {boolean} Returns `true` if `path` exists, else `false`.
  6767. */
  6768. function hasPath(object, path, hasFunc) {
  6769. path = castPath(path, object);
  6770. var index = -1,
  6771. length = path.length,
  6772. result = false;
  6773. while (++index < length) {
  6774. var key = toKey(path[index]);
  6775. if (!(result = object != null && hasFunc(object, key))) {
  6776. break;
  6777. }
  6778. object = object[key];
  6779. }
  6780. if (result || ++index != length) {
  6781. return result;
  6782. }
  6783. length = object == null ? 0 : object.length;
  6784. return !!length && isLength(length) && isIndex(key, length) &&
  6785. (isArray(object) || isArguments(object));
  6786. }
  6787. /**
  6788. * Initializes an array clone.
  6789. *
  6790. * @private
  6791. * @param {Array} array The array to clone.
  6792. * @returns {Array} Returns the initialized clone.
  6793. */
  6794. function initCloneArray(array) {
  6795. var length = array.length,
  6796. result = new array.constructor(length);
  6797. // Add properties assigned by `RegExp#exec`.
  6798. if (length && typeof array[0] == 'string' && hasOwnProperty.call(array, 'index')) {
  6799. result.index = array.index;
  6800. result.input = array.input;
  6801. }
  6802. return result;
  6803. }
  6804. /**
  6805. * Initializes an object clone.
  6806. *
  6807. * @private
  6808. * @param {Object} object The object to clone.
  6809. * @returns {Object} Returns the initialized clone.
  6810. */
  6811. function initCloneObject(object) {
  6812. return (typeof object.constructor == 'function' && !isPrototype(object))
  6813. ? baseCreate(getPrototype(object))
  6814. : {};
  6815. }
  6816. /**
  6817. * Initializes an object clone based on its `toStringTag`.
  6818. *
  6819. * **Note:** This function only supports cloning values with tags of
  6820. * `Boolean`, `Date`, `Error`, `Map`, `Number`, `RegExp`, `Set`, or `String`.
  6821. *
  6822. * @private
  6823. * @param {Object} object The object to clone.
  6824. * @param {string} tag The `toStringTag` of the object to clone.
  6825. * @param {boolean} [isDeep] Specify a deep clone.
  6826. * @returns {Object} Returns the initialized clone.
  6827. */
  6828. function initCloneByTag(object, tag, isDeep) {
  6829. var Ctor = object.constructor;
  6830. switch (tag) {
  6831. case arrayBufferTag:
  6832. return cloneArrayBuffer(object);
  6833. case boolTag:
  6834. case dateTag:
  6835. return new Ctor(+object);
  6836. case dataViewTag:
  6837. return cloneDataView(object, isDeep);
  6838. case float32Tag: case float64Tag:
  6839. case int8Tag: case int16Tag: case int32Tag:
  6840. case uint8Tag: case uint8ClampedTag: case uint16Tag: case uint32Tag:
  6841. return cloneTypedArray(object, isDeep);
  6842. case mapTag:
  6843. return new Ctor;
  6844. case numberTag:
  6845. case stringTag:
  6846. return new Ctor(object);
  6847. case regexpTag:
  6848. return cloneRegExp(object);
  6849. case setTag:
  6850. return new Ctor;
  6851. case symbolTag:
  6852. return cloneSymbol(object);
  6853. }
  6854. }
  6855. /**
  6856. * Inserts wrapper `details` in a comment at the top of the `source` body.
  6857. *
  6858. * @private
  6859. * @param {string} source The source to modify.
  6860. * @returns {Array} details The details to insert.
  6861. * @returns {string} Returns the modified source.
  6862. */
  6863. function insertWrapDetails(source, details) {
  6864. var length = details.length;
  6865. if (!length) {
  6866. return source;
  6867. }
  6868. var lastIndex = length - 1;
  6869. details[lastIndex] = (length > 1 ? '& ' : '') + details[lastIndex];
  6870. details = details.join(length > 2 ? ', ' : ' ');
  6871. return source.replace(reWrapComment, '{\n/* [wrapped with ' + details + '] */\n');
  6872. }
  6873. /**
  6874. * Checks if `value` is a flattenable `arguments` object or array.
  6875. *
  6876. * @private
  6877. * @param {*} value The value to check.
  6878. * @returns {boolean} Returns `true` if `value` is flattenable, else `false`.
  6879. */
  6880. function isFlattenable(value) {
  6881. return isArray(value) || isArguments(value) ||
  6882. !!(spreadableSymbol && value && value[spreadableSymbol]);
  6883. }
  6884. /**
  6885. * Checks if `value` is a valid array-like index.
  6886. *
  6887. * @private
  6888. * @param {*} value The value to check.
  6889. * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.
  6890. * @returns {boolean} Returns `true` if `value` is a valid index, else `false`.
  6891. */
  6892. function isIndex(value, length) {
  6893. var type = typeof value;
  6894. length = length == null ? MAX_SAFE_INTEGER : length;
  6895. return !!length &&
  6896. (type == 'number' ||
  6897. (type != 'symbol' && reIsUint.test(value))) &&
  6898. (value > -1 && value % 1 == 0 && value < length);
  6899. }
  6900. /**
  6901. * Checks if the given arguments are from an iteratee call.
  6902. *
  6903. * @private
  6904. * @param {*} value The potential iteratee value argument.
  6905. * @param {*} index The potential iteratee index or key argument.
  6906. * @param {*} object The potential iteratee object argument.
  6907. * @returns {boolean} Returns `true` if the arguments are from an iteratee call,
  6908. * else `false`.
  6909. */
  6910. function isIterateeCall(value, index, object) {
  6911. if (!isObject(object)) {
  6912. return false;
  6913. }
  6914. var type = typeof index;
  6915. if (type == 'number'
  6916. ? (isArrayLike(object) && isIndex(index, object.length))
  6917. : (type == 'string' && index in object)
  6918. ) {
  6919. return eq(object[index], value);
  6920. }
  6921. return false;
  6922. }
  6923. /**
  6924. * Checks if `value` is a property name and not a property path.
  6925. *
  6926. * @private
  6927. * @param {*} value The value to check.
  6928. * @param {Object} [object] The object to query keys on.
  6929. * @returns {boolean} Returns `true` if `value` is a property name, else `false`.
  6930. */
  6931. function isKey(value, object) {
  6932. if (isArray(value)) {
  6933. return false;
  6934. }
  6935. var type = typeof value;
  6936. if (type == 'number' || type == 'symbol' || type == 'boolean' ||
  6937. value == null || isSymbol(value)) {
  6938. return true;
  6939. }
  6940. return reIsPlainProp.test(value) || !reIsDeepProp.test(value) ||
  6941. (object != null && value in Object(object));
  6942. }
  6943. /**
  6944. * Checks if `value` is suitable for use as unique object key.
  6945. *
  6946. * @private
  6947. * @param {*} value The value to check.
  6948. * @returns {boolean} Returns `true` if `value` is suitable, else `false`.
  6949. */
  6950. function isKeyable(value) {
  6951. var type = typeof value;
  6952. return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean')
  6953. ? (value !== '__proto__')
  6954. : (value === null);
  6955. }
  6956. /**
  6957. * Checks if `func` has a lazy counterpart.
  6958. *
  6959. * @private
  6960. * @param {Function} func The function to check.
  6961. * @returns {boolean} Returns `true` if `func` has a lazy counterpart,
  6962. * else `false`.
  6963. */
  6964. function isLaziable(func) {
  6965. var funcName = getFuncName(func),
  6966. other = lodash[funcName];
  6967. if (typeof other != 'function' || !(funcName in LazyWrapper.prototype)) {
  6968. return false;
  6969. }
  6970. if (func === other) {
  6971. return true;
  6972. }
  6973. var data = getData(other);
  6974. return !!data && func === data[0];
  6975. }
  6976. /**
  6977. * Checks if `func` has its source masked.
  6978. *
  6979. * @private
  6980. * @param {Function} func The function to check.
  6981. * @returns {boolean} Returns `true` if `func` is masked, else `false`.
  6982. */
  6983. function isMasked(func) {
  6984. return !!maskSrcKey && (maskSrcKey in func);
  6985. }
  6986. /**
  6987. * Checks if `func` is capable of being masked.
  6988. *
  6989. * @private
  6990. * @param {*} value The value to check.
  6991. * @returns {boolean} Returns `true` if `func` is maskable, else `false`.
  6992. */
  6993. var isMaskable = coreJsData ? isFunction : stubFalse;
  6994. /**
  6995. * Checks if `value` is likely a prototype object.
  6996. *
  6997. * @private
  6998. * @param {*} value The value to check.
  6999. * @returns {boolean} Returns `true` if `value` is a prototype, else `false`.
  7000. */
  7001. function isPrototype(value) {
  7002. var Ctor = value && value.constructor,
  7003. proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto;
  7004. return value === proto;
  7005. }
  7006. /**
  7007. * Checks if `value` is suitable for strict equality comparisons, i.e. `===`.
  7008. *
  7009. * @private
  7010. * @param {*} value The value to check.
  7011. * @returns {boolean} Returns `true` if `value` if suitable for strict
  7012. * equality comparisons, else `false`.
  7013. */
  7014. function isStrictComparable(value) {
  7015. return value === value && !isObject(value);
  7016. }
  7017. /**
  7018. * A specialized version of `matchesProperty` for source values suitable
  7019. * for strict equality comparisons, i.e. `===`.
  7020. *
  7021. * @private
  7022. * @param {string} key The key of the property to get.
  7023. * @param {*} srcValue The value to match.
  7024. * @returns {Function} Returns the new spec function.
  7025. */
  7026. function matchesStrictComparable(key, srcValue) {
  7027. return function(object) {
  7028. if (object == null) {
  7029. return false;
  7030. }
  7031. return object[key] === srcValue &&
  7032. (srcValue !== undefined || (key in Object(object)));
  7033. };
  7034. }
  7035. /**
  7036. * A specialized version of `_.memoize` which clears the memoized function's
  7037. * cache when it exceeds `MAX_MEMOIZE_SIZE`.
  7038. *
  7039. * @private
  7040. * @param {Function} func The function to have its output memoized.
  7041. * @returns {Function} Returns the new memoized function.
  7042. */
  7043. function memoizeCapped(func) {
  7044. var result = memoize(func, function(key) {
  7045. if (cache.size === MAX_MEMOIZE_SIZE) {
  7046. cache.clear();
  7047. }
  7048. return key;
  7049. });
  7050. var cache = result.cache;
  7051. return result;
  7052. }
  7053. /**
  7054. * Merges the function metadata of `source` into `data`.
  7055. *
  7056. * Merging metadata reduces the number of wrappers used to invoke a function.
  7057. * This is possible because methods like `_.bind`, `_.curry`, and `_.partial`
  7058. * may be applied regardless of execution order. Methods like `_.ary` and
  7059. * `_.rearg` modify function arguments, making the order in which they are
  7060. * executed important, preventing the merging of metadata. However, we make
  7061. * an exception for a safe combined case where curried functions have `_.ary`
  7062. * and or `_.rearg` applied.
  7063. *
  7064. * @private
  7065. * @param {Array} data The destination metadata.
  7066. * @param {Array} source The source metadata.
  7067. * @returns {Array} Returns `data`.
  7068. */
  7069. function mergeData(data, source) {
  7070. var bitmask = data[1],
  7071. srcBitmask = source[1],
  7072. newBitmask = bitmask | srcBitmask,
  7073. isCommon = newBitmask < (WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG | WRAP_ARY_FLAG);
  7074. var isCombo =
  7075. ((srcBitmask == WRAP_ARY_FLAG) && (bitmask == WRAP_CURRY_FLAG)) ||
  7076. ((srcBitmask == WRAP_ARY_FLAG) && (bitmask == WRAP_REARG_FLAG) && (data[7].length <= source[8])) ||
  7077. ((srcBitmask == (WRAP_ARY_FLAG | WRAP_REARG_FLAG)) && (source[7].length <= source[8]) && (bitmask == WRAP_CURRY_FLAG));
  7078. // Exit early if metadata can't be merged.
  7079. if (!(isCommon || isCombo)) {
  7080. return data;
  7081. }
  7082. // Use source `thisArg` if available.
  7083. if (srcBitmask & WRAP_BIND_FLAG) {
  7084. data[2] = source[2];
  7085. // Set when currying a bound function.
  7086. newBitmask |= bitmask & WRAP_BIND_FLAG ? 0 : WRAP_CURRY_BOUND_FLAG;
  7087. }
  7088. // Compose partial arguments.
  7089. var value = source[3];
  7090. if (value) {
  7091. var partials = data[3];
  7092. data[3] = partials ? composeArgs(partials, value, source[4]) : value;
  7093. data[4] = partials ? replaceHolders(data[3], PLACEHOLDER) : source[4];
  7094. }
  7095. // Compose partial right arguments.
  7096. value = source[5];
  7097. if (value) {
  7098. partials = data[5];
  7099. data[5] = partials ? composeArgsRight(partials, value, source[6]) : value;
  7100. data[6] = partials ? replaceHolders(data[5], PLACEHOLDER) : source[6];
  7101. }
  7102. // Use source `argPos` if available.
  7103. value = source[7];
  7104. if (value) {
  7105. data[7] = value;
  7106. }
  7107. // Use source `ary` if it's smaller.
  7108. if (srcBitmask & WRAP_ARY_FLAG) {
  7109. data[8] = data[8] == null ? source[8] : nativeMin(data[8], source[8]);
  7110. }
  7111. // Use source `arity` if one is not provided.
  7112. if (data[9] == null) {
  7113. data[9] = source[9];
  7114. }
  7115. // Use source `func` and merge bitmasks.
  7116. data[0] = source[0];
  7117. data[1] = newBitmask;
  7118. return data;
  7119. }
  7120. /**
  7121. * This function is like
  7122. * [`Object.keys`](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)
  7123. * except that it includes inherited enumerable properties.
  7124. *
  7125. * @private
  7126. * @param {Object} object The object to query.
  7127. * @returns {Array} Returns the array of property names.
  7128. */
  7129. function nativeKeysIn(object) {
  7130. var result = [];
  7131. if (object != null) {
  7132. for (var key in Object(object)) {
  7133. result.push(key);
  7134. }
  7135. }
  7136. return result;
  7137. }
  7138. /**
  7139. * Converts `value` to a string using `Object.prototype.toString`.
  7140. *
  7141. * @private
  7142. * @param {*} value The value to convert.
  7143. * @returns {string} Returns the converted string.
  7144. */
  7145. function objectToString(value) {
  7146. return nativeObjectToString.call(value);
  7147. }
  7148. /**
  7149. * A specialized version of `baseRest` which transforms the rest array.
  7150. *
  7151. * @private
  7152. * @param {Function} func The function to apply a rest parameter to.
  7153. * @param {number} [start=func.length-1] The start position of the rest parameter.
  7154. * @param {Function} transform The rest array transform.
  7155. * @returns {Function} Returns the new function.
  7156. */
  7157. function overRest(func, start, transform) {
  7158. start = nativeMax(start === undefined ? (func.length - 1) : start, 0);
  7159. return function() {
  7160. var args = arguments,
  7161. index = -1,
  7162. length = nativeMax(args.length - start, 0),
  7163. array = Array(length);
  7164. while (++index < length) {
  7165. array[index] = args[start + index];
  7166. }
  7167. index = -1;
  7168. var otherArgs = Array(start + 1);
  7169. while (++index < start) {
  7170. otherArgs[index] = args[index];
  7171. }
  7172. otherArgs[start] = transform(array);
  7173. return apply(func, this, otherArgs);
  7174. };
  7175. }
  7176. /**
  7177. * Gets the parent value at `path` of `object`.
  7178. *
  7179. * @private
  7180. * @param {Object} object The object to query.
  7181. * @param {Array} path The path to get the parent value of.
  7182. * @returns {*} Returns the parent value.
  7183. */
  7184. function parent(object, path) {
  7185. return path.length < 2 ? object : baseGet(object, baseSlice(path, 0, -1));
  7186. }
  7187. /**
  7188. * Reorder `array` according to the specified indexes where the element at
  7189. * the first index is assigned as the first element, the element at
  7190. * the second index is assigned as the second element, and so on.
  7191. *
  7192. * @private
  7193. * @param {Array} array The array to reorder.
  7194. * @param {Array} indexes The arranged array indexes.
  7195. * @returns {Array} Returns `array`.
  7196. */
  7197. function reorder(array, indexes) {
  7198. var arrLength = array.length,
  7199. length = nativeMin(indexes.length, arrLength),
  7200. oldArray = copyArray(array);
  7201. while (length--) {
  7202. var index = indexes[length];
  7203. array[length] = isIndex(index, arrLength) ? oldArray[index] : undefined;
  7204. }
  7205. return array;
  7206. }
  7207. /**
  7208. * Gets the value at `key`, unless `key` is "__proto__" or "constructor".
  7209. *
  7210. * @private
  7211. * @param {Object} object The object to query.
  7212. * @param {string} key The key of the property to get.
  7213. * @returns {*} Returns the property value.
  7214. */
  7215. function safeGet(object, key) {
  7216. if (key === 'constructor' && typeof object[key] === 'function') {
  7217. return;
  7218. }
  7219. if (key == '__proto__') {
  7220. return;
  7221. }
  7222. return object[key];
  7223. }
  7224. /**
  7225. * Sets metadata for `func`.
  7226. *
  7227. * **Note:** If this function becomes hot, i.e. is invoked a lot in a short
  7228. * period of time, it will trip its breaker and transition to an identity
  7229. * function to avoid garbage collection pauses in V8. See
  7230. * [V8 issue 2070](https://bugs.chromium.org/p/v8/issues/detail?id=2070)
  7231. * for more details.
  7232. *
  7233. * @private
  7234. * @param {Function} func The function to associate metadata with.
  7235. * @param {*} data The metadata.
  7236. * @returns {Function} Returns `func`.
  7237. */
  7238. var setData = shortOut(baseSetData);
  7239. /**
  7240. * A simple wrapper around the global [`setTimeout`](https://mdn.io/setTimeout).
  7241. *
  7242. * @private
  7243. * @param {Function} func The function to delay.
  7244. * @param {number} wait The number of milliseconds to delay invocation.
  7245. * @returns {number|Object} Returns the timer id or timeout object.
  7246. */
  7247. var setTimeout = ctxSetTimeout || function(func, wait) {
  7248. return root.setTimeout(func, wait);
  7249. };
  7250. /**
  7251. * Sets the `toString` method of `func` to return `string`.
  7252. *
  7253. * @private
  7254. * @param {Function} func The function to modify.
  7255. * @param {Function} string The `toString` result.
  7256. * @returns {Function} Returns `func`.
  7257. */
  7258. var setToString = shortOut(baseSetToString);
  7259. /**
  7260. * Sets the `toString` method of `wrapper` to mimic the source of `reference`
  7261. * with wrapper details in a comment at the top of the source body.
  7262. *
  7263. * @private
  7264. * @param {Function} wrapper The function to modify.
  7265. * @param {Function} reference The reference function.
  7266. * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
  7267. * @returns {Function} Returns `wrapper`.
  7268. */
  7269. function setWrapToString(wrapper, reference, bitmask) {
  7270. var source = (reference + '');
  7271. return setToString(wrapper, insertWrapDetails(source, updateWrapDetails(getWrapDetails(source), bitmask)));
  7272. }
  7273. /**
  7274. * Creates a function that'll short out and invoke `identity` instead
  7275. * of `func` when it's called `HOT_COUNT` or more times in `HOT_SPAN`
  7276. * milliseconds.
  7277. *
  7278. * @private
  7279. * @param {Function} func The function to restrict.
  7280. * @returns {Function} Returns the new shortable function.
  7281. */
  7282. function shortOut(func) {
  7283. var count = 0,
  7284. lastCalled = 0;
  7285. return function() {
  7286. var stamp = nativeNow(),
  7287. remaining = HOT_SPAN - (stamp - lastCalled);
  7288. lastCalled = stamp;
  7289. if (remaining > 0) {
  7290. if (++count >= HOT_COUNT) {
  7291. return arguments[0];
  7292. }
  7293. } else {
  7294. count = 0;
  7295. }
  7296. return func.apply(undefined, arguments);
  7297. };
  7298. }
  7299. /**
  7300. * A specialized version of `_.shuffle` which mutates and sets the size of `array`.
  7301. *
  7302. * @private
  7303. * @param {Array} array The array to shuffle.
  7304. * @param {number} [size=array.length] The size of `array`.
  7305. * @returns {Array} Returns `array`.
  7306. */
  7307. function shuffleSelf(array, size) {
  7308. var index = -1,
  7309. length = array.length,
  7310. lastIndex = length - 1;
  7311. size = size === undefined ? length : size;
  7312. while (++index < size) {
  7313. var rand = baseRandom(index, lastIndex),
  7314. value = array[rand];
  7315. array[rand] = array[index];
  7316. array[index] = value;
  7317. }
  7318. array.length = size;
  7319. return array;
  7320. }
  7321. /**
  7322. * Converts `string` to a property path array.
  7323. *
  7324. * @private
  7325. * @param {string} string The string to convert.
  7326. * @returns {Array} Returns the property path array.
  7327. */
  7328. var stringToPath = memoizeCapped(function(string) {
  7329. var result = [];
  7330. if (string.charCodeAt(0) === 46 /* . */) {
  7331. result.push('');
  7332. }
  7333. string.replace(rePropName, function(match, number, quote, subString) {
  7334. result.push(quote ? subString.replace(reEscapeChar, '$1') : (number || match));
  7335. });
  7336. return result;
  7337. });
  7338. /**
  7339. * Converts `value` to a string key if it's not a string or symbol.
  7340. *
  7341. * @private
  7342. * @param {*} value The value to inspect.
  7343. * @returns {string|symbol} Returns the key.
  7344. */
  7345. function toKey(value) {
  7346. if (typeof value == 'string' || isSymbol(value)) {
  7347. return value;
  7348. }
  7349. var result = (value + '');
  7350. return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;
  7351. }
  7352. /**
  7353. * Converts `func` to its source code.
  7354. *
  7355. * @private
  7356. * @param {Function} func The function to convert.
  7357. * @returns {string} Returns the source code.
  7358. */
  7359. function toSource(func) {
  7360. if (func != null) {
  7361. try {
  7362. return funcToString.call(func);
  7363. } catch (e) {}
  7364. try {
  7365. return (func + '');
  7366. } catch (e) {}
  7367. }
  7368. return '';
  7369. }
  7370. /**
  7371. * Updates wrapper `details` based on `bitmask` flags.
  7372. *
  7373. * @private
  7374. * @returns {Array} details The details to modify.
  7375. * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
  7376. * @returns {Array} Returns `details`.
  7377. */
  7378. function updateWrapDetails(details, bitmask) {
  7379. arrayEach(wrapFlags, function(pair) {
  7380. var value = '_.' + pair[0];
  7381. if ((bitmask & pair[1]) && !arrayIncludes(details, value)) {
  7382. details.push(value);
  7383. }
  7384. });
  7385. return details.sort();
  7386. }
  7387. /**
  7388. * Creates a clone of `wrapper`.
  7389. *
  7390. * @private
  7391. * @param {Object} wrapper The wrapper to clone.
  7392. * @returns {Object} Returns the cloned wrapper.
  7393. */
  7394. function wrapperClone(wrapper) {
  7395. if (wrapper instanceof LazyWrapper) {
  7396. return wrapper.clone();
  7397. }
  7398. var result = new LodashWrapper(wrapper.__wrapped__, wrapper.__chain__);
  7399. result.__actions__ = copyArray(wrapper.__actions__);
  7400. result.__index__ = wrapper.__index__;
  7401. result.__values__ = wrapper.__values__;
  7402. return result;
  7403. }
  7404. /*------------------------------------------------------------------------*/
  7405. /**
  7406. * Creates an array of elements split into groups the length of `size`.
  7407. * If `array` can't be split evenly, the final chunk will be the remaining
  7408. * elements.
  7409. *
  7410. * @static
  7411. * @memberOf _
  7412. * @since 3.0.0
  7413. * @category Array
  7414. * @param {Array} array The array to process.
  7415. * @param {number} [size=1] The length of each chunk
  7416. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  7417. * @returns {Array} Returns the new array of chunks.
  7418. * @example
  7419. *
  7420. * _.chunk(['a', 'b', 'c', 'd'], 2);
  7421. * // => [['a', 'b'], ['c', 'd']]
  7422. *
  7423. * _.chunk(['a', 'b', 'c', 'd'], 3);
  7424. * // => [['a', 'b', 'c'], ['d']]
  7425. */
  7426. function chunk(array, size, guard) {
  7427. if ((guard ? isIterateeCall(array, size, guard) : size === undefined)) {
  7428. size = 1;
  7429. } else {
  7430. size = nativeMax(toInteger(size), 0);
  7431. }
  7432. var length = array == null ? 0 : array.length;
  7433. if (!length || size < 1) {
  7434. return [];
  7435. }
  7436. var index = 0,
  7437. resIndex = 0,
  7438. result = Array(nativeCeil(length / size));
  7439. while (index < length) {
  7440. result[resIndex++] = baseSlice(array, index, (index += size));
  7441. }
  7442. return result;
  7443. }
  7444. /**
  7445. * Creates an array with all falsey values removed. The values `false`, `null`,
  7446. * `0`, `""`, `undefined`, and `NaN` are falsey.
  7447. *
  7448. * @static
  7449. * @memberOf _
  7450. * @since 0.1.0
  7451. * @category Array
  7452. * @param {Array} array The array to compact.
  7453. * @returns {Array} Returns the new array of filtered values.
  7454. * @example
  7455. *
  7456. * _.compact([0, 1, false, 2, '', 3]);
  7457. * // => [1, 2, 3]
  7458. */
  7459. function compact(array) {
  7460. var index = -1,
  7461. length = array == null ? 0 : array.length,
  7462. resIndex = 0,
  7463. result = [];
  7464. while (++index < length) {
  7465. var value = array[index];
  7466. if (value) {
  7467. result[resIndex++] = value;
  7468. }
  7469. }
  7470. return result;
  7471. }
  7472. /**
  7473. * Creates a new array concatenating `array` with any additional arrays
  7474. * and/or values.
  7475. *
  7476. * @static
  7477. * @memberOf _
  7478. * @since 4.0.0
  7479. * @category Array
  7480. * @param {Array} array The array to concatenate.
  7481. * @param {...*} [values] The values to concatenate.
  7482. * @returns {Array} Returns the new concatenated array.
  7483. * @example
  7484. *
  7485. * var array = [1];
  7486. * var other = _.concat(array, 2, [3], [[4]]);
  7487. *
  7488. * console.log(other);
  7489. * // => [1, 2, 3, [4]]
  7490. *
  7491. * console.log(array);
  7492. * // => [1]
  7493. */
  7494. function concat() {
  7495. var length = arguments.length;
  7496. if (!length) {
  7497. return [];
  7498. }
  7499. var args = Array(length - 1),
  7500. array = arguments[0],
  7501. index = length;
  7502. while (index--) {
  7503. args[index - 1] = arguments[index];
  7504. }
  7505. return arrayPush(isArray(array) ? copyArray(array) : [array], baseFlatten(args, 1));
  7506. }
  7507. /**
  7508. * Creates an array of `array` values not included in the other given arrays
  7509. * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  7510. * for equality comparisons. The order and references of result values are
  7511. * determined by the first array.
  7512. *
  7513. * **Note:** Unlike `_.pullAll`, this method returns a new array.
  7514. *
  7515. * @static
  7516. * @memberOf _
  7517. * @since 0.1.0
  7518. * @category Array
  7519. * @param {Array} array The array to inspect.
  7520. * @param {...Array} [values] The values to exclude.
  7521. * @returns {Array} Returns the new array of filtered values.
  7522. * @see _.without, _.xor
  7523. * @example
  7524. *
  7525. * _.difference([2, 1], [2, 3]);
  7526. * // => [1]
  7527. */
  7528. var difference = baseRest(function(array, values) {
  7529. return isArrayLikeObject(array)
  7530. ? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true))
  7531. : [];
  7532. });
  7533. /**
  7534. * This method is like `_.difference` except that it accepts `iteratee` which
  7535. * is invoked for each element of `array` and `values` to generate the criterion
  7536. * by which they're compared. The order and references of result values are
  7537. * determined by the first array. The iteratee is invoked with one argument:
  7538. * (value).
  7539. *
  7540. * **Note:** Unlike `_.pullAllBy`, this method returns a new array.
  7541. *
  7542. * @static
  7543. * @memberOf _
  7544. * @since 4.0.0
  7545. * @category Array
  7546. * @param {Array} array The array to inspect.
  7547. * @param {...Array} [values] The values to exclude.
  7548. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  7549. * @returns {Array} Returns the new array of filtered values.
  7550. * @example
  7551. *
  7552. * _.differenceBy([2.1, 1.2], [2.3, 3.4], Math.floor);
  7553. * // => [1.2]
  7554. *
  7555. * // The `_.property` iteratee shorthand.
  7556. * _.differenceBy([{ 'x': 2 }, { 'x': 1 }], [{ 'x': 1 }], 'x');
  7557. * // => [{ 'x': 2 }]
  7558. */
  7559. var differenceBy = baseRest(function(array, values) {
  7560. var iteratee = last(values);
  7561. if (isArrayLikeObject(iteratee)) {
  7562. iteratee = undefined;
  7563. }
  7564. return isArrayLikeObject(array)
  7565. ? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true), getIteratee(iteratee, 2))
  7566. : [];
  7567. });
  7568. /**
  7569. * This method is like `_.difference` except that it accepts `comparator`
  7570. * which is invoked to compare elements of `array` to `values`. The order and
  7571. * references of result values are determined by the first array. The comparator
  7572. * is invoked with two arguments: (arrVal, othVal).
  7573. *
  7574. * **Note:** Unlike `_.pullAllWith`, this method returns a new array.
  7575. *
  7576. * @static
  7577. * @memberOf _
  7578. * @since 4.0.0
  7579. * @category Array
  7580. * @param {Array} array The array to inspect.
  7581. * @param {...Array} [values] The values to exclude.
  7582. * @param {Function} [comparator] The comparator invoked per element.
  7583. * @returns {Array} Returns the new array of filtered values.
  7584. * @example
  7585. *
  7586. * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }];
  7587. *
  7588. * _.differenceWith(objects, [{ 'x': 1, 'y': 2 }], _.isEqual);
  7589. * // => [{ 'x': 2, 'y': 1 }]
  7590. */
  7591. var differenceWith = baseRest(function(array, values) {
  7592. var comparator = last(values);
  7593. if (isArrayLikeObject(comparator)) {
  7594. comparator = undefined;
  7595. }
  7596. return isArrayLikeObject(array)
  7597. ? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true), undefined, comparator)
  7598. : [];
  7599. });
  7600. /**
  7601. * Creates a slice of `array` with `n` elements dropped from the beginning.
  7602. *
  7603. * @static
  7604. * @memberOf _
  7605. * @since 0.5.0
  7606. * @category Array
  7607. * @param {Array} array The array to query.
  7608. * @param {number} [n=1] The number of elements to drop.
  7609. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  7610. * @returns {Array} Returns the slice of `array`.
  7611. * @example
  7612. *
  7613. * _.drop([1, 2, 3]);
  7614. * // => [2, 3]
  7615. *
  7616. * _.drop([1, 2, 3], 2);
  7617. * // => [3]
  7618. *
  7619. * _.drop([1, 2, 3], 5);
  7620. * // => []
  7621. *
  7622. * _.drop([1, 2, 3], 0);
  7623. * // => [1, 2, 3]
  7624. */
  7625. function drop(array, n, guard) {
  7626. var length = array == null ? 0 : array.length;
  7627. if (!length) {
  7628. return [];
  7629. }
  7630. n = (guard || n === undefined) ? 1 : toInteger(n);
  7631. return baseSlice(array, n < 0 ? 0 : n, length);
  7632. }
  7633. /**
  7634. * Creates a slice of `array` with `n` elements dropped from the end.
  7635. *
  7636. * @static
  7637. * @memberOf _
  7638. * @since 3.0.0
  7639. * @category Array
  7640. * @param {Array} array The array to query.
  7641. * @param {number} [n=1] The number of elements to drop.
  7642. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  7643. * @returns {Array} Returns the slice of `array`.
  7644. * @example
  7645. *
  7646. * _.dropRight([1, 2, 3]);
  7647. * // => [1, 2]
  7648. *
  7649. * _.dropRight([1, 2, 3], 2);
  7650. * // => [1]
  7651. *
  7652. * _.dropRight([1, 2, 3], 5);
  7653. * // => []
  7654. *
  7655. * _.dropRight([1, 2, 3], 0);
  7656. * // => [1, 2, 3]
  7657. */
  7658. function dropRight(array, n, guard) {
  7659. var length = array == null ? 0 : array.length;
  7660. if (!length) {
  7661. return [];
  7662. }
  7663. n = (guard || n === undefined) ? 1 : toInteger(n);
  7664. n = length - n;
  7665. return baseSlice(array, 0, n < 0 ? 0 : n);
  7666. }
  7667. /**
  7668. * Creates a slice of `array` excluding elements dropped from the end.
  7669. * Elements are dropped until `predicate` returns falsey. The predicate is
  7670. * invoked with three arguments: (value, index, array).
  7671. *
  7672. * @static
  7673. * @memberOf _
  7674. * @since 3.0.0
  7675. * @category Array
  7676. * @param {Array} array The array to query.
  7677. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  7678. * @returns {Array} Returns the slice of `array`.
  7679. * @example
  7680. *
  7681. * var users = [
  7682. * { 'user': 'barney', 'active': true },
  7683. * { 'user': 'fred', 'active': false },
  7684. * { 'user': 'pebbles', 'active': false }
  7685. * ];
  7686. *
  7687. * _.dropRightWhile(users, function(o) { return !o.active; });
  7688. * // => objects for ['barney']
  7689. *
  7690. * // The `_.matches` iteratee shorthand.
  7691. * _.dropRightWhile(users, { 'user': 'pebbles', 'active': false });
  7692. * // => objects for ['barney', 'fred']
  7693. *
  7694. * // The `_.matchesProperty` iteratee shorthand.
  7695. * _.dropRightWhile(users, ['active', false]);
  7696. * // => objects for ['barney']
  7697. *
  7698. * // The `_.property` iteratee shorthand.
  7699. * _.dropRightWhile(users, 'active');
  7700. * // => objects for ['barney', 'fred', 'pebbles']
  7701. */
  7702. function dropRightWhile(array, predicate) {
  7703. return (array && array.length)
  7704. ? baseWhile(array, getIteratee(predicate, 3), true, true)
  7705. : [];
  7706. }
  7707. /**
  7708. * Creates a slice of `array` excluding elements dropped from the beginning.
  7709. * Elements are dropped until `predicate` returns falsey. The predicate is
  7710. * invoked with three arguments: (value, index, array).
  7711. *
  7712. * @static
  7713. * @memberOf _
  7714. * @since 3.0.0
  7715. * @category Array
  7716. * @param {Array} array The array to query.
  7717. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  7718. * @returns {Array} Returns the slice of `array`.
  7719. * @example
  7720. *
  7721. * var users = [
  7722. * { 'user': 'barney', 'active': false },
  7723. * { 'user': 'fred', 'active': false },
  7724. * { 'user': 'pebbles', 'active': true }
  7725. * ];
  7726. *
  7727. * _.dropWhile(users, function(o) { return !o.active; });
  7728. * // => objects for ['pebbles']
  7729. *
  7730. * // The `_.matches` iteratee shorthand.
  7731. * _.dropWhile(users, { 'user': 'barney', 'active': false });
  7732. * // => objects for ['fred', 'pebbles']
  7733. *
  7734. * // The `_.matchesProperty` iteratee shorthand.
  7735. * _.dropWhile(users, ['active', false]);
  7736. * // => objects for ['pebbles']
  7737. *
  7738. * // The `_.property` iteratee shorthand.
  7739. * _.dropWhile(users, 'active');
  7740. * // => objects for ['barney', 'fred', 'pebbles']
  7741. */
  7742. function dropWhile(array, predicate) {
  7743. return (array && array.length)
  7744. ? baseWhile(array, getIteratee(predicate, 3), true)
  7745. : [];
  7746. }
  7747. /**
  7748. * Fills elements of `array` with `value` from `start` up to, but not
  7749. * including, `end`.
  7750. *
  7751. * **Note:** This method mutates `array`.
  7752. *
  7753. * @static
  7754. * @memberOf _
  7755. * @since 3.2.0
  7756. * @category Array
  7757. * @param {Array} array The array to fill.
  7758. * @param {*} value The value to fill `array` with.
  7759. * @param {number} [start=0] The start position.
  7760. * @param {number} [end=array.length] The end position.
  7761. * @returns {Array} Returns `array`.
  7762. * @example
  7763. *
  7764. * var array = [1, 2, 3];
  7765. *
  7766. * _.fill(array, 'a');
  7767. * console.log(array);
  7768. * // => ['a', 'a', 'a']
  7769. *
  7770. * _.fill(Array(3), 2);
  7771. * // => [2, 2, 2]
  7772. *
  7773. * _.fill([4, 6, 8, 10], '*', 1, 3);
  7774. * // => [4, '*', '*', 10]
  7775. */
  7776. function fill(array, value, start, end) {
  7777. var length = array == null ? 0 : array.length;
  7778. if (!length) {
  7779. return [];
  7780. }
  7781. if (start && typeof start != 'number' && isIterateeCall(array, value, start)) {
  7782. start = 0;
  7783. end = length;
  7784. }
  7785. return baseFill(array, value, start, end);
  7786. }
  7787. /**
  7788. * This method is like `_.find` except that it returns the index of the first
  7789. * element `predicate` returns truthy for instead of the element itself.
  7790. *
  7791. * @static
  7792. * @memberOf _
  7793. * @since 1.1.0
  7794. * @category Array
  7795. * @param {Array} array The array to inspect.
  7796. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  7797. * @param {number} [fromIndex=0] The index to search from.
  7798. * @returns {number} Returns the index of the found element, else `-1`.
  7799. * @example
  7800. *
  7801. * var users = [
  7802. * { 'user': 'barney', 'active': false },
  7803. * { 'user': 'fred', 'active': false },
  7804. * { 'user': 'pebbles', 'active': true }
  7805. * ];
  7806. *
  7807. * _.findIndex(users, function(o) { return o.user == 'barney'; });
  7808. * // => 0
  7809. *
  7810. * // The `_.matches` iteratee shorthand.
  7811. * _.findIndex(users, { 'user': 'fred', 'active': false });
  7812. * // => 1
  7813. *
  7814. * // The `_.matchesProperty` iteratee shorthand.
  7815. * _.findIndex(users, ['active', false]);
  7816. * // => 0
  7817. *
  7818. * // The `_.property` iteratee shorthand.
  7819. * _.findIndex(users, 'active');
  7820. * // => 2
  7821. */
  7822. function findIndex(array, predicate, fromIndex) {
  7823. var length = array == null ? 0 : array.length;
  7824. if (!length) {
  7825. return -1;
  7826. }
  7827. var index = fromIndex == null ? 0 : toInteger(fromIndex);
  7828. if (index < 0) {
  7829. index = nativeMax(length + index, 0);
  7830. }
  7831. return baseFindIndex(array, getIteratee(predicate, 3), index);
  7832. }
  7833. /**
  7834. * This method is like `_.findIndex` except that it iterates over elements
  7835. * of `collection` from right to left.
  7836. *
  7837. * @static
  7838. * @memberOf _
  7839. * @since 2.0.0
  7840. * @category Array
  7841. * @param {Array} array The array to inspect.
  7842. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  7843. * @param {number} [fromIndex=array.length-1] The index to search from.
  7844. * @returns {number} Returns the index of the found element, else `-1`.
  7845. * @example
  7846. *
  7847. * var users = [
  7848. * { 'user': 'barney', 'active': true },
  7849. * { 'user': 'fred', 'active': false },
  7850. * { 'user': 'pebbles', 'active': false }
  7851. * ];
  7852. *
  7853. * _.findLastIndex(users, function(o) { return o.user == 'pebbles'; });
  7854. * // => 2
  7855. *
  7856. * // The `_.matches` iteratee shorthand.
  7857. * _.findLastIndex(users, { 'user': 'barney', 'active': true });
  7858. * // => 0
  7859. *
  7860. * // The `_.matchesProperty` iteratee shorthand.
  7861. * _.findLastIndex(users, ['active', false]);
  7862. * // => 2
  7863. *
  7864. * // The `_.property` iteratee shorthand.
  7865. * _.findLastIndex(users, 'active');
  7866. * // => 0
  7867. */
  7868. function findLastIndex(array, predicate, fromIndex) {
  7869. var length = array == null ? 0 : array.length;
  7870. if (!length) {
  7871. return -1;
  7872. }
  7873. var index = length - 1;
  7874. if (fromIndex !== undefined) {
  7875. index = toInteger(fromIndex);
  7876. index = fromIndex < 0
  7877. ? nativeMax(length + index, 0)
  7878. : nativeMin(index, length - 1);
  7879. }
  7880. return baseFindIndex(array, getIteratee(predicate, 3), index, true);
  7881. }
  7882. /**
  7883. * Flattens `array` a single level deep.
  7884. *
  7885. * @static
  7886. * @memberOf _
  7887. * @since 0.1.0
  7888. * @category Array
  7889. * @param {Array} array The array to flatten.
  7890. * @returns {Array} Returns the new flattened array.
  7891. * @example
  7892. *
  7893. * _.flatten([1, [2, [3, [4]], 5]]);
  7894. * // => [1, 2, [3, [4]], 5]
  7895. */
  7896. function flatten(array) {
  7897. var length = array == null ? 0 : array.length;
  7898. return length ? baseFlatten(array, 1) : [];
  7899. }
  7900. /**
  7901. * Recursively flattens `array`.
  7902. *
  7903. * @static
  7904. * @memberOf _
  7905. * @since 3.0.0
  7906. * @category Array
  7907. * @param {Array} array The array to flatten.
  7908. * @returns {Array} Returns the new flattened array.
  7909. * @example
  7910. *
  7911. * _.flattenDeep([1, [2, [3, [4]], 5]]);
  7912. * // => [1, 2, 3, 4, 5]
  7913. */
  7914. function flattenDeep(array) {
  7915. var length = array == null ? 0 : array.length;
  7916. return length ? baseFlatten(array, INFINITY) : [];
  7917. }
  7918. /**
  7919. * Recursively flatten `array` up to `depth` times.
  7920. *
  7921. * @static
  7922. * @memberOf _
  7923. * @since 4.4.0
  7924. * @category Array
  7925. * @param {Array} array The array to flatten.
  7926. * @param {number} [depth=1] The maximum recursion depth.
  7927. * @returns {Array} Returns the new flattened array.
  7928. * @example
  7929. *
  7930. * var array = [1, [2, [3, [4]], 5]];
  7931. *
  7932. * _.flattenDepth(array, 1);
  7933. * // => [1, 2, [3, [4]], 5]
  7934. *
  7935. * _.flattenDepth(array, 2);
  7936. * // => [1, 2, 3, [4], 5]
  7937. */
  7938. function flattenDepth(array, depth) {
  7939. var length = array == null ? 0 : array.length;
  7940. if (!length) {
  7941. return [];
  7942. }
  7943. depth = depth === undefined ? 1 : toInteger(depth);
  7944. return baseFlatten(array, depth);
  7945. }
  7946. /**
  7947. * The inverse of `_.toPairs`; this method returns an object composed
  7948. * from key-value `pairs`.
  7949. *
  7950. * @static
  7951. * @memberOf _
  7952. * @since 4.0.0
  7953. * @category Array
  7954. * @param {Array} pairs The key-value pairs.
  7955. * @returns {Object} Returns the new object.
  7956. * @example
  7957. *
  7958. * _.fromPairs([['a', 1], ['b', 2]]);
  7959. * // => { 'a': 1, 'b': 2 }
  7960. */
  7961. function fromPairs(pairs) {
  7962. var index = -1,
  7963. length = pairs == null ? 0 : pairs.length,
  7964. result = {};
  7965. while (++index < length) {
  7966. var pair = pairs[index];
  7967. result[pair[0]] = pair[1];
  7968. }
  7969. return result;
  7970. }
  7971. /**
  7972. * Gets the first element of `array`.
  7973. *
  7974. * @static
  7975. * @memberOf _
  7976. * @since 0.1.0
  7977. * @alias first
  7978. * @category Array
  7979. * @param {Array} array The array to query.
  7980. * @returns {*} Returns the first element of `array`.
  7981. * @example
  7982. *
  7983. * _.head([1, 2, 3]);
  7984. * // => 1
  7985. *
  7986. * _.head([]);
  7987. * // => undefined
  7988. */
  7989. function head(array) {
  7990. return (array && array.length) ? array[0] : undefined;
  7991. }
  7992. /**
  7993. * Gets the index at which the first occurrence of `value` is found in `array`
  7994. * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  7995. * for equality comparisons. If `fromIndex` is negative, it's used as the
  7996. * offset from the end of `array`.
  7997. *
  7998. * @static
  7999. * @memberOf _
  8000. * @since 0.1.0
  8001. * @category Array
  8002. * @param {Array} array The array to inspect.
  8003. * @param {*} value The value to search for.
  8004. * @param {number} [fromIndex=0] The index to search from.
  8005. * @returns {number} Returns the index of the matched value, else `-1`.
  8006. * @example
  8007. *
  8008. * _.indexOf([1, 2, 1, 2], 2);
  8009. * // => 1
  8010. *
  8011. * // Search from the `fromIndex`.
  8012. * _.indexOf([1, 2, 1, 2], 2, 2);
  8013. * // => 3
  8014. */
  8015. function indexOf(array, value, fromIndex) {
  8016. var length = array == null ? 0 : array.length;
  8017. if (!length) {
  8018. return -1;
  8019. }
  8020. var index = fromIndex == null ? 0 : toInteger(fromIndex);
  8021. if (index < 0) {
  8022. index = nativeMax(length + index, 0);
  8023. }
  8024. return baseIndexOf(array, value, index);
  8025. }
  8026. /**
  8027. * Gets all but the last element of `array`.
  8028. *
  8029. * @static
  8030. * @memberOf _
  8031. * @since 0.1.0
  8032. * @category Array
  8033. * @param {Array} array The array to query.
  8034. * @returns {Array} Returns the slice of `array`.
  8035. * @example
  8036. *
  8037. * _.initial([1, 2, 3]);
  8038. * // => [1, 2]
  8039. */
  8040. function initial(array) {
  8041. var length = array == null ? 0 : array.length;
  8042. return length ? baseSlice(array, 0, -1) : [];
  8043. }
  8044. /**
  8045. * Creates an array of unique values that are included in all given arrays
  8046. * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  8047. * for equality comparisons. The order and references of result values are
  8048. * determined by the first array.
  8049. *
  8050. * @static
  8051. * @memberOf _
  8052. * @since 0.1.0
  8053. * @category Array
  8054. * @param {...Array} [arrays] The arrays to inspect.
  8055. * @returns {Array} Returns the new array of intersecting values.
  8056. * @example
  8057. *
  8058. * _.intersection([2, 1], [2, 3]);
  8059. * // => [2]
  8060. */
  8061. var intersection = baseRest(function(arrays) {
  8062. var mapped = arrayMap(arrays, castArrayLikeObject);
  8063. return (mapped.length && mapped[0] === arrays[0])
  8064. ? baseIntersection(mapped)
  8065. : [];
  8066. });
  8067. /**
  8068. * This method is like `_.intersection` except that it accepts `iteratee`
  8069. * which is invoked for each element of each `arrays` to generate the criterion
  8070. * by which they're compared. The order and references of result values are
  8071. * determined by the first array. The iteratee is invoked with one argument:
  8072. * (value).
  8073. *
  8074. * @static
  8075. * @memberOf _
  8076. * @since 4.0.0
  8077. * @category Array
  8078. * @param {...Array} [arrays] The arrays to inspect.
  8079. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  8080. * @returns {Array} Returns the new array of intersecting values.
  8081. * @example
  8082. *
  8083. * _.intersectionBy([2.1, 1.2], [2.3, 3.4], Math.floor);
  8084. * // => [2.1]
  8085. *
  8086. * // The `_.property` iteratee shorthand.
  8087. * _.intersectionBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x');
  8088. * // => [{ 'x': 1 }]
  8089. */
  8090. var intersectionBy = baseRest(function(arrays) {
  8091. var iteratee = last(arrays),
  8092. mapped = arrayMap(arrays, castArrayLikeObject);
  8093. if (iteratee === last(mapped)) {
  8094. iteratee = undefined;
  8095. } else {
  8096. mapped.pop();
  8097. }
  8098. return (mapped.length && mapped[0] === arrays[0])
  8099. ? baseIntersection(mapped, getIteratee(iteratee, 2))
  8100. : [];
  8101. });
  8102. /**
  8103. * This method is like `_.intersection` except that it accepts `comparator`
  8104. * which is invoked to compare elements of `arrays`. The order and references
  8105. * of result values are determined by the first array. The comparator is
  8106. * invoked with two arguments: (arrVal, othVal).
  8107. *
  8108. * @static
  8109. * @memberOf _
  8110. * @since 4.0.0
  8111. * @category Array
  8112. * @param {...Array} [arrays] The arrays to inspect.
  8113. * @param {Function} [comparator] The comparator invoked per element.
  8114. * @returns {Array} Returns the new array of intersecting values.
  8115. * @example
  8116. *
  8117. * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }];
  8118. * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }];
  8119. *
  8120. * _.intersectionWith(objects, others, _.isEqual);
  8121. * // => [{ 'x': 1, 'y': 2 }]
  8122. */
  8123. var intersectionWith = baseRest(function(arrays) {
  8124. var comparator = last(arrays),
  8125. mapped = arrayMap(arrays, castArrayLikeObject);
  8126. comparator = typeof comparator == 'function' ? comparator : undefined;
  8127. if (comparator) {
  8128. mapped.pop();
  8129. }
  8130. return (mapped.length && mapped[0] === arrays[0])
  8131. ? baseIntersection(mapped, undefined, comparator)
  8132. : [];
  8133. });
  8134. /**
  8135. * Converts all elements in `array` into a string separated by `separator`.
  8136. *
  8137. * @static
  8138. * @memberOf _
  8139. * @since 4.0.0
  8140. * @category Array
  8141. * @param {Array} array The array to convert.
  8142. * @param {string} [separator=','] The element separator.
  8143. * @returns {string} Returns the joined string.
  8144. * @example
  8145. *
  8146. * _.join(['a', 'b', 'c'], '~');
  8147. * // => 'a~b~c'
  8148. */
  8149. function join(array, separator) {
  8150. return array == null ? '' : nativeJoin.call(array, separator);
  8151. }
  8152. /**
  8153. * Gets the last element of `array`.
  8154. *
  8155. * @static
  8156. * @memberOf _
  8157. * @since 0.1.0
  8158. * @category Array
  8159. * @param {Array} array The array to query.
  8160. * @returns {*} Returns the last element of `array`.
  8161. * @example
  8162. *
  8163. * _.last([1, 2, 3]);
  8164. * // => 3
  8165. */
  8166. function last(array) {
  8167. var length = array == null ? 0 : array.length;
  8168. return length ? array[length - 1] : undefined;
  8169. }
  8170. /**
  8171. * This method is like `_.indexOf` except that it iterates over elements of
  8172. * `array` from right to left.
  8173. *
  8174. * @static
  8175. * @memberOf _
  8176. * @since 0.1.0
  8177. * @category Array
  8178. * @param {Array} array The array to inspect.
  8179. * @param {*} value The value to search for.
  8180. * @param {number} [fromIndex=array.length-1] The index to search from.
  8181. * @returns {number} Returns the index of the matched value, else `-1`.
  8182. * @example
  8183. *
  8184. * _.lastIndexOf([1, 2, 1, 2], 2);
  8185. * // => 3
  8186. *
  8187. * // Search from the `fromIndex`.
  8188. * _.lastIndexOf([1, 2, 1, 2], 2, 2);
  8189. * // => 1
  8190. */
  8191. function lastIndexOf(array, value, fromIndex) {
  8192. var length = array == null ? 0 : array.length;
  8193. if (!length) {
  8194. return -1;
  8195. }
  8196. var index = length;
  8197. if (fromIndex !== undefined) {
  8198. index = toInteger(fromIndex);
  8199. index = index < 0 ? nativeMax(length + index, 0) : nativeMin(index, length - 1);
  8200. }
  8201. return value === value
  8202. ? strictLastIndexOf(array, value, index)
  8203. : baseFindIndex(array, baseIsNaN, index, true);
  8204. }
  8205. /**
  8206. * Gets the element at index `n` of `array`. If `n` is negative, the nth
  8207. * element from the end is returned.
  8208. *
  8209. * @static
  8210. * @memberOf _
  8211. * @since 4.11.0
  8212. * @category Array
  8213. * @param {Array} array The array to query.
  8214. * @param {number} [n=0] The index of the element to return.
  8215. * @returns {*} Returns the nth element of `array`.
  8216. * @example
  8217. *
  8218. * var array = ['a', 'b', 'c', 'd'];
  8219. *
  8220. * _.nth(array, 1);
  8221. * // => 'b'
  8222. *
  8223. * _.nth(array, -2);
  8224. * // => 'c';
  8225. */
  8226. function nth(array, n) {
  8227. return (array && array.length) ? baseNth(array, toInteger(n)) : undefined;
  8228. }
  8229. /**
  8230. * Removes all given values from `array` using
  8231. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  8232. * for equality comparisons.
  8233. *
  8234. * **Note:** Unlike `_.without`, this method mutates `array`. Use `_.remove`
  8235. * to remove elements from an array by predicate.
  8236. *
  8237. * @static
  8238. * @memberOf _
  8239. * @since 2.0.0
  8240. * @category Array
  8241. * @param {Array} array The array to modify.
  8242. * @param {...*} [values] The values to remove.
  8243. * @returns {Array} Returns `array`.
  8244. * @example
  8245. *
  8246. * var array = ['a', 'b', 'c', 'a', 'b', 'c'];
  8247. *
  8248. * _.pull(array, 'a', 'c');
  8249. * console.log(array);
  8250. * // => ['b', 'b']
  8251. */
  8252. var pull = baseRest(pullAll);
  8253. /**
  8254. * This method is like `_.pull` except that it accepts an array of values to remove.
  8255. *
  8256. * **Note:** Unlike `_.difference`, this method mutates `array`.
  8257. *
  8258. * @static
  8259. * @memberOf _
  8260. * @since 4.0.0
  8261. * @category Array
  8262. * @param {Array} array The array to modify.
  8263. * @param {Array} values The values to remove.
  8264. * @returns {Array} Returns `array`.
  8265. * @example
  8266. *
  8267. * var array = ['a', 'b', 'c', 'a', 'b', 'c'];
  8268. *
  8269. * _.pullAll(array, ['a', 'c']);
  8270. * console.log(array);
  8271. * // => ['b', 'b']
  8272. */
  8273. function pullAll(array, values) {
  8274. return (array && array.length && values && values.length)
  8275. ? basePullAll(array, values)
  8276. : array;
  8277. }
  8278. /**
  8279. * This method is like `_.pullAll` except that it accepts `iteratee` which is
  8280. * invoked for each element of `array` and `values` to generate the criterion
  8281. * by which they're compared. The iteratee is invoked with one argument: (value).
  8282. *
  8283. * **Note:** Unlike `_.differenceBy`, this method mutates `array`.
  8284. *
  8285. * @static
  8286. * @memberOf _
  8287. * @since 4.0.0
  8288. * @category Array
  8289. * @param {Array} array The array to modify.
  8290. * @param {Array} values The values to remove.
  8291. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  8292. * @returns {Array} Returns `array`.
  8293. * @example
  8294. *
  8295. * var array = [{ 'x': 1 }, { 'x': 2 }, { 'x': 3 }, { 'x': 1 }];
  8296. *
  8297. * _.pullAllBy(array, [{ 'x': 1 }, { 'x': 3 }], 'x');
  8298. * console.log(array);
  8299. * // => [{ 'x': 2 }]
  8300. */
  8301. function pullAllBy(array, values, iteratee) {
  8302. return (array && array.length && values && values.length)
  8303. ? basePullAll(array, values, getIteratee(iteratee, 2))
  8304. : array;
  8305. }
  8306. /**
  8307. * This method is like `_.pullAll` except that it accepts `comparator` which
  8308. * is invoked to compare elements of `array` to `values`. The comparator is
  8309. * invoked with two arguments: (arrVal, othVal).
  8310. *
  8311. * **Note:** Unlike `_.differenceWith`, this method mutates `array`.
  8312. *
  8313. * @static
  8314. * @memberOf _
  8315. * @since 4.6.0
  8316. * @category Array
  8317. * @param {Array} array The array to modify.
  8318. * @param {Array} values The values to remove.
  8319. * @param {Function} [comparator] The comparator invoked per element.
  8320. * @returns {Array} Returns `array`.
  8321. * @example
  8322. *
  8323. * var array = [{ 'x': 1, 'y': 2 }, { 'x': 3, 'y': 4 }, { 'x': 5, 'y': 6 }];
  8324. *
  8325. * _.pullAllWith(array, [{ 'x': 3, 'y': 4 }], _.isEqual);
  8326. * console.log(array);
  8327. * // => [{ 'x': 1, 'y': 2 }, { 'x': 5, 'y': 6 }]
  8328. */
  8329. function pullAllWith(array, values, comparator) {
  8330. return (array && array.length && values && values.length)
  8331. ? basePullAll(array, values, undefined, comparator)
  8332. : array;
  8333. }
  8334. /**
  8335. * Removes elements from `array` corresponding to `indexes` and returns an
  8336. * array of removed elements.
  8337. *
  8338. * **Note:** Unlike `_.at`, this method mutates `array`.
  8339. *
  8340. * @static
  8341. * @memberOf _
  8342. * @since 3.0.0
  8343. * @category Array
  8344. * @param {Array} array The array to modify.
  8345. * @param {...(number|number[])} [indexes] The indexes of elements to remove.
  8346. * @returns {Array} Returns the new array of removed elements.
  8347. * @example
  8348. *
  8349. * var array = ['a', 'b', 'c', 'd'];
  8350. * var pulled = _.pullAt(array, [1, 3]);
  8351. *
  8352. * console.log(array);
  8353. * // => ['a', 'c']
  8354. *
  8355. * console.log(pulled);
  8356. * // => ['b', 'd']
  8357. */
  8358. var pullAt = flatRest(function(array, indexes) {
  8359. var length = array == null ? 0 : array.length,
  8360. result = baseAt(array, indexes);
  8361. basePullAt(array, arrayMap(indexes, function(index) {
  8362. return isIndex(index, length) ? +index : index;
  8363. }).sort(compareAscending));
  8364. return result;
  8365. });
  8366. /**
  8367. * Removes all elements from `array` that `predicate` returns truthy for
  8368. * and returns an array of the removed elements. The predicate is invoked
  8369. * with three arguments: (value, index, array).
  8370. *
  8371. * **Note:** Unlike `_.filter`, this method mutates `array`. Use `_.pull`
  8372. * to pull elements from an array by value.
  8373. *
  8374. * @static
  8375. * @memberOf _
  8376. * @since 2.0.0
  8377. * @category Array
  8378. * @param {Array} array The array to modify.
  8379. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  8380. * @returns {Array} Returns the new array of removed elements.
  8381. * @example
  8382. *
  8383. * var array = [1, 2, 3, 4];
  8384. * var evens = _.remove(array, function(n) {
  8385. * return n % 2 == 0;
  8386. * });
  8387. *
  8388. * console.log(array);
  8389. * // => [1, 3]
  8390. *
  8391. * console.log(evens);
  8392. * // => [2, 4]
  8393. */
  8394. function remove(array, predicate) {
  8395. var result = [];
  8396. if (!(array && array.length)) {
  8397. return result;
  8398. }
  8399. var index = -1,
  8400. indexes = [],
  8401. length = array.length;
  8402. predicate = getIteratee(predicate, 3);
  8403. while (++index < length) {
  8404. var value = array[index];
  8405. if (predicate(value, index, array)) {
  8406. result.push(value);
  8407. indexes.push(index);
  8408. }
  8409. }
  8410. basePullAt(array, indexes);
  8411. return result;
  8412. }
  8413. /**
  8414. * Reverses `array` so that the first element becomes the last, the second
  8415. * element becomes the second to last, and so on.
  8416. *
  8417. * **Note:** This method mutates `array` and is based on
  8418. * [`Array#reverse`](https://mdn.io/Array/reverse).
  8419. *
  8420. * @static
  8421. * @memberOf _
  8422. * @since 4.0.0
  8423. * @category Array
  8424. * @param {Array} array The array to modify.
  8425. * @returns {Array} Returns `array`.
  8426. * @example
  8427. *
  8428. * var array = [1, 2, 3];
  8429. *
  8430. * _.reverse(array);
  8431. * // => [3, 2, 1]
  8432. *
  8433. * console.log(array);
  8434. * // => [3, 2, 1]
  8435. */
  8436. function reverse(array) {
  8437. return array == null ? array : nativeReverse.call(array);
  8438. }
  8439. /**
  8440. * Creates a slice of `array` from `start` up to, but not including, `end`.
  8441. *
  8442. * **Note:** This method is used instead of
  8443. * [`Array#slice`](https://mdn.io/Array/slice) to ensure dense arrays are
  8444. * returned.
  8445. *
  8446. * @static
  8447. * @memberOf _
  8448. * @since 3.0.0
  8449. * @category Array
  8450. * @param {Array} array The array to slice.
  8451. * @param {number} [start=0] The start position.
  8452. * @param {number} [end=array.length] The end position.
  8453. * @returns {Array} Returns the slice of `array`.
  8454. */
  8455. function slice(array, start, end) {
  8456. var length = array == null ? 0 : array.length;
  8457. if (!length) {
  8458. return [];
  8459. }
  8460. if (end && typeof end != 'number' && isIterateeCall(array, start, end)) {
  8461. start = 0;
  8462. end = length;
  8463. }
  8464. else {
  8465. start = start == null ? 0 : toInteger(start);
  8466. end = end === undefined ? length : toInteger(end);
  8467. }
  8468. return baseSlice(array, start, end);
  8469. }
  8470. /**
  8471. * Uses a binary search to determine the lowest index at which `value`
  8472. * should be inserted into `array` in order to maintain its sort order.
  8473. *
  8474. * @static
  8475. * @memberOf _
  8476. * @since 0.1.0
  8477. * @category Array
  8478. * @param {Array} array The sorted array to inspect.
  8479. * @param {*} value The value to evaluate.
  8480. * @returns {number} Returns the index at which `value` should be inserted
  8481. * into `array`.
  8482. * @example
  8483. *
  8484. * _.sortedIndex([30, 50], 40);
  8485. * // => 1
  8486. */
  8487. function sortedIndex(array, value) {
  8488. return baseSortedIndex(array, value);
  8489. }
  8490. /**
  8491. * This method is like `_.sortedIndex` except that it accepts `iteratee`
  8492. * which is invoked for `value` and each element of `array` to compute their
  8493. * sort ranking. The iteratee is invoked with one argument: (value).
  8494. *
  8495. * @static
  8496. * @memberOf _
  8497. * @since 4.0.0
  8498. * @category Array
  8499. * @param {Array} array The sorted array to inspect.
  8500. * @param {*} value The value to evaluate.
  8501. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  8502. * @returns {number} Returns the index at which `value` should be inserted
  8503. * into `array`.
  8504. * @example
  8505. *
  8506. * var objects = [{ 'x': 4 }, { 'x': 5 }];
  8507. *
  8508. * _.sortedIndexBy(objects, { 'x': 4 }, function(o) { return o.x; });
  8509. * // => 0
  8510. *
  8511. * // The `_.property` iteratee shorthand.
  8512. * _.sortedIndexBy(objects, { 'x': 4 }, 'x');
  8513. * // => 0
  8514. */
  8515. function sortedIndexBy(array, value, iteratee) {
  8516. return baseSortedIndexBy(array, value, getIteratee(iteratee, 2));
  8517. }
  8518. /**
  8519. * This method is like `_.indexOf` except that it performs a binary
  8520. * search on a sorted `array`.
  8521. *
  8522. * @static
  8523. * @memberOf _
  8524. * @since 4.0.0
  8525. * @category Array
  8526. * @param {Array} array The array to inspect.
  8527. * @param {*} value The value to search for.
  8528. * @returns {number} Returns the index of the matched value, else `-1`.
  8529. * @example
  8530. *
  8531. * _.sortedIndexOf([4, 5, 5, 5, 6], 5);
  8532. * // => 1
  8533. */
  8534. function sortedIndexOf(array, value) {
  8535. var length = array == null ? 0 : array.length;
  8536. if (length) {
  8537. var index = baseSortedIndex(array, value);
  8538. if (index < length && eq(array[index], value)) {
  8539. return index;
  8540. }
  8541. }
  8542. return -1;
  8543. }
  8544. /**
  8545. * This method is like `_.sortedIndex` except that it returns the highest
  8546. * index at which `value` should be inserted into `array` in order to
  8547. * maintain its sort order.
  8548. *
  8549. * @static
  8550. * @memberOf _
  8551. * @since 3.0.0
  8552. * @category Array
  8553. * @param {Array} array The sorted array to inspect.
  8554. * @param {*} value The value to evaluate.
  8555. * @returns {number} Returns the index at which `value` should be inserted
  8556. * into `array`.
  8557. * @example
  8558. *
  8559. * _.sortedLastIndex([4, 5, 5, 5, 6], 5);
  8560. * // => 4
  8561. */
  8562. function sortedLastIndex(array, value) {
  8563. return baseSortedIndex(array, value, true);
  8564. }
  8565. /**
  8566. * This method is like `_.sortedLastIndex` except that it accepts `iteratee`
  8567. * which is invoked for `value` and each element of `array` to compute their
  8568. * sort ranking. The iteratee is invoked with one argument: (value).
  8569. *
  8570. * @static
  8571. * @memberOf _
  8572. * @since 4.0.0
  8573. * @category Array
  8574. * @param {Array} array The sorted array to inspect.
  8575. * @param {*} value The value to evaluate.
  8576. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  8577. * @returns {number} Returns the index at which `value` should be inserted
  8578. * into `array`.
  8579. * @example
  8580. *
  8581. * var objects = [{ 'x': 4 }, { 'x': 5 }];
  8582. *
  8583. * _.sortedLastIndexBy(objects, { 'x': 4 }, function(o) { return o.x; });
  8584. * // => 1
  8585. *
  8586. * // The `_.property` iteratee shorthand.
  8587. * _.sortedLastIndexBy(objects, { 'x': 4 }, 'x');
  8588. * // => 1
  8589. */
  8590. function sortedLastIndexBy(array, value, iteratee) {
  8591. return baseSortedIndexBy(array, value, getIteratee(iteratee, 2), true);
  8592. }
  8593. /**
  8594. * This method is like `_.lastIndexOf` except that it performs a binary
  8595. * search on a sorted `array`.
  8596. *
  8597. * @static
  8598. * @memberOf _
  8599. * @since 4.0.0
  8600. * @category Array
  8601. * @param {Array} array The array to inspect.
  8602. * @param {*} value The value to search for.
  8603. * @returns {number} Returns the index of the matched value, else `-1`.
  8604. * @example
  8605. *
  8606. * _.sortedLastIndexOf([4, 5, 5, 5, 6], 5);
  8607. * // => 3
  8608. */
  8609. function sortedLastIndexOf(array, value) {
  8610. var length = array == null ? 0 : array.length;
  8611. if (length) {
  8612. var index = baseSortedIndex(array, value, true) - 1;
  8613. if (eq(array[index], value)) {
  8614. return index;
  8615. }
  8616. }
  8617. return -1;
  8618. }
  8619. /**
  8620. * This method is like `_.uniq` except that it's designed and optimized
  8621. * for sorted arrays.
  8622. *
  8623. * @static
  8624. * @memberOf _
  8625. * @since 4.0.0
  8626. * @category Array
  8627. * @param {Array} array The array to inspect.
  8628. * @returns {Array} Returns the new duplicate free array.
  8629. * @example
  8630. *
  8631. * _.sortedUniq([1, 1, 2]);
  8632. * // => [1, 2]
  8633. */
  8634. function sortedUniq(array) {
  8635. return (array && array.length)
  8636. ? baseSortedUniq(array)
  8637. : [];
  8638. }
  8639. /**
  8640. * This method is like `_.uniqBy` except that it's designed and optimized
  8641. * for sorted arrays.
  8642. *
  8643. * @static
  8644. * @memberOf _
  8645. * @since 4.0.0
  8646. * @category Array
  8647. * @param {Array} array The array to inspect.
  8648. * @param {Function} [iteratee] The iteratee invoked per element.
  8649. * @returns {Array} Returns the new duplicate free array.
  8650. * @example
  8651. *
  8652. * _.sortedUniqBy([1.1, 1.2, 2.3, 2.4], Math.floor);
  8653. * // => [1.1, 2.3]
  8654. */
  8655. function sortedUniqBy(array, iteratee) {
  8656. return (array && array.length)
  8657. ? baseSortedUniq(array, getIteratee(iteratee, 2))
  8658. : [];
  8659. }
  8660. /**
  8661. * Gets all but the first element of `array`.
  8662. *
  8663. * @static
  8664. * @memberOf _
  8665. * @since 4.0.0
  8666. * @category Array
  8667. * @param {Array} array The array to query.
  8668. * @returns {Array} Returns the slice of `array`.
  8669. * @example
  8670. *
  8671. * _.tail([1, 2, 3]);
  8672. * // => [2, 3]
  8673. */
  8674. function tail(array) {
  8675. var length = array == null ? 0 : array.length;
  8676. return length ? baseSlice(array, 1, length) : [];
  8677. }
  8678. /**
  8679. * Creates a slice of `array` with `n` elements taken from the beginning.
  8680. *
  8681. * @static
  8682. * @memberOf _
  8683. * @since 0.1.0
  8684. * @category Array
  8685. * @param {Array} array The array to query.
  8686. * @param {number} [n=1] The number of elements to take.
  8687. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  8688. * @returns {Array} Returns the slice of `array`.
  8689. * @example
  8690. *
  8691. * _.take([1, 2, 3]);
  8692. * // => [1]
  8693. *
  8694. * _.take([1, 2, 3], 2);
  8695. * // => [1, 2]
  8696. *
  8697. * _.take([1, 2, 3], 5);
  8698. * // => [1, 2, 3]
  8699. *
  8700. * _.take([1, 2, 3], 0);
  8701. * // => []
  8702. */
  8703. function take(array, n, guard) {
  8704. if (!(array && array.length)) {
  8705. return [];
  8706. }
  8707. n = (guard || n === undefined) ? 1 : toInteger(n);
  8708. return baseSlice(array, 0, n < 0 ? 0 : n);
  8709. }
  8710. /**
  8711. * Creates a slice of `array` with `n` elements taken from the end.
  8712. *
  8713. * @static
  8714. * @memberOf _
  8715. * @since 3.0.0
  8716. * @category Array
  8717. * @param {Array} array The array to query.
  8718. * @param {number} [n=1] The number of elements to take.
  8719. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  8720. * @returns {Array} Returns the slice of `array`.
  8721. * @example
  8722. *
  8723. * _.takeRight([1, 2, 3]);
  8724. * // => [3]
  8725. *
  8726. * _.takeRight([1, 2, 3], 2);
  8727. * // => [2, 3]
  8728. *
  8729. * _.takeRight([1, 2, 3], 5);
  8730. * // => [1, 2, 3]
  8731. *
  8732. * _.takeRight([1, 2, 3], 0);
  8733. * // => []
  8734. */
  8735. function takeRight(array, n, guard) {
  8736. var length = array == null ? 0 : array.length;
  8737. if (!length) {
  8738. return [];
  8739. }
  8740. n = (guard || n === undefined) ? 1 : toInteger(n);
  8741. n = length - n;
  8742. return baseSlice(array, n < 0 ? 0 : n, length);
  8743. }
  8744. /**
  8745. * Creates a slice of `array` with elements taken from the end. Elements are
  8746. * taken until `predicate` returns falsey. The predicate is invoked with
  8747. * three arguments: (value, index, array).
  8748. *
  8749. * @static
  8750. * @memberOf _
  8751. * @since 3.0.0
  8752. * @category Array
  8753. * @param {Array} array The array to query.
  8754. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  8755. * @returns {Array} Returns the slice of `array`.
  8756. * @example
  8757. *
  8758. * var users = [
  8759. * { 'user': 'barney', 'active': true },
  8760. * { 'user': 'fred', 'active': false },
  8761. * { 'user': 'pebbles', 'active': false }
  8762. * ];
  8763. *
  8764. * _.takeRightWhile(users, function(o) { return !o.active; });
  8765. * // => objects for ['fred', 'pebbles']
  8766. *
  8767. * // The `_.matches` iteratee shorthand.
  8768. * _.takeRightWhile(users, { 'user': 'pebbles', 'active': false });
  8769. * // => objects for ['pebbles']
  8770. *
  8771. * // The `_.matchesProperty` iteratee shorthand.
  8772. * _.takeRightWhile(users, ['active', false]);
  8773. * // => objects for ['fred', 'pebbles']
  8774. *
  8775. * // The `_.property` iteratee shorthand.
  8776. * _.takeRightWhile(users, 'active');
  8777. * // => []
  8778. */
  8779. function takeRightWhile(array, predicate) {
  8780. return (array && array.length)
  8781. ? baseWhile(array, getIteratee(predicate, 3), false, true)
  8782. : [];
  8783. }
  8784. /**
  8785. * Creates a slice of `array` with elements taken from the beginning. Elements
  8786. * are taken until `predicate` returns falsey. The predicate is invoked with
  8787. * three arguments: (value, index, array).
  8788. *
  8789. * @static
  8790. * @memberOf _
  8791. * @since 3.0.0
  8792. * @category Array
  8793. * @param {Array} array The array to query.
  8794. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  8795. * @returns {Array} Returns the slice of `array`.
  8796. * @example
  8797. *
  8798. * var users = [
  8799. * { 'user': 'barney', 'active': false },
  8800. * { 'user': 'fred', 'active': false },
  8801. * { 'user': 'pebbles', 'active': true }
  8802. * ];
  8803. *
  8804. * _.takeWhile(users, function(o) { return !o.active; });
  8805. * // => objects for ['barney', 'fred']
  8806. *
  8807. * // The `_.matches` iteratee shorthand.
  8808. * _.takeWhile(users, { 'user': 'barney', 'active': false });
  8809. * // => objects for ['barney']
  8810. *
  8811. * // The `_.matchesProperty` iteratee shorthand.
  8812. * _.takeWhile(users, ['active', false]);
  8813. * // => objects for ['barney', 'fred']
  8814. *
  8815. * // The `_.property` iteratee shorthand.
  8816. * _.takeWhile(users, 'active');
  8817. * // => []
  8818. */
  8819. function takeWhile(array, predicate) {
  8820. return (array && array.length)
  8821. ? baseWhile(array, getIteratee(predicate, 3))
  8822. : [];
  8823. }
  8824. /**
  8825. * Creates an array of unique values, in order, from all given arrays using
  8826. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  8827. * for equality comparisons.
  8828. *
  8829. * @static
  8830. * @memberOf _
  8831. * @since 0.1.0
  8832. * @category Array
  8833. * @param {...Array} [arrays] The arrays to inspect.
  8834. * @returns {Array} Returns the new array of combined values.
  8835. * @example
  8836. *
  8837. * _.union([2], [1, 2]);
  8838. * // => [2, 1]
  8839. */
  8840. var union = baseRest(function(arrays) {
  8841. return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true));
  8842. });
  8843. /**
  8844. * This method is like `_.union` except that it accepts `iteratee` which is
  8845. * invoked for each element of each `arrays` to generate the criterion by
  8846. * which uniqueness is computed. Result values are chosen from the first
  8847. * array in which the value occurs. The iteratee is invoked with one argument:
  8848. * (value).
  8849. *
  8850. * @static
  8851. * @memberOf _
  8852. * @since 4.0.0
  8853. * @category Array
  8854. * @param {...Array} [arrays] The arrays to inspect.
  8855. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  8856. * @returns {Array} Returns the new array of combined values.
  8857. * @example
  8858. *
  8859. * _.unionBy([2.1], [1.2, 2.3], Math.floor);
  8860. * // => [2.1, 1.2]
  8861. *
  8862. * // The `_.property` iteratee shorthand.
  8863. * _.unionBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x');
  8864. * // => [{ 'x': 1 }, { 'x': 2 }]
  8865. */
  8866. var unionBy = baseRest(function(arrays) {
  8867. var iteratee = last(arrays);
  8868. if (isArrayLikeObject(iteratee)) {
  8869. iteratee = undefined;
  8870. }
  8871. return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true), getIteratee(iteratee, 2));
  8872. });
  8873. /**
  8874. * This method is like `_.union` except that it accepts `comparator` which
  8875. * is invoked to compare elements of `arrays`. Result values are chosen from
  8876. * the first array in which the value occurs. The comparator is invoked
  8877. * with two arguments: (arrVal, othVal).
  8878. *
  8879. * @static
  8880. * @memberOf _
  8881. * @since 4.0.0
  8882. * @category Array
  8883. * @param {...Array} [arrays] The arrays to inspect.
  8884. * @param {Function} [comparator] The comparator invoked per element.
  8885. * @returns {Array} Returns the new array of combined values.
  8886. * @example
  8887. *
  8888. * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }];
  8889. * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }];
  8890. *
  8891. * _.unionWith(objects, others, _.isEqual);
  8892. * // => [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }, { 'x': 1, 'y': 1 }]
  8893. */
  8894. var unionWith = baseRest(function(arrays) {
  8895. var comparator = last(arrays);
  8896. comparator = typeof comparator == 'function' ? comparator : undefined;
  8897. return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true), undefined, comparator);
  8898. });
  8899. /**
  8900. * Creates a duplicate-free version of an array, using
  8901. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  8902. * for equality comparisons, in which only the first occurrence of each element
  8903. * is kept. The order of result values is determined by the order they occur
  8904. * in the array.
  8905. *
  8906. * @static
  8907. * @memberOf _
  8908. * @since 0.1.0
  8909. * @category Array
  8910. * @param {Array} array The array to inspect.
  8911. * @returns {Array} Returns the new duplicate free array.
  8912. * @example
  8913. *
  8914. * _.uniq([2, 1, 2]);
  8915. * // => [2, 1]
  8916. */
  8917. function uniq(array) {
  8918. return (array && array.length) ? baseUniq(array) : [];
  8919. }
  8920. /**
  8921. * This method is like `_.uniq` except that it accepts `iteratee` which is
  8922. * invoked for each element in `array` to generate the criterion by which
  8923. * uniqueness is computed. The order of result values is determined by the
  8924. * order they occur in the array. The iteratee is invoked with one argument:
  8925. * (value).
  8926. *
  8927. * @static
  8928. * @memberOf _
  8929. * @since 4.0.0
  8930. * @category Array
  8931. * @param {Array} array The array to inspect.
  8932. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  8933. * @returns {Array} Returns the new duplicate free array.
  8934. * @example
  8935. *
  8936. * _.uniqBy([2.1, 1.2, 2.3], Math.floor);
  8937. * // => [2.1, 1.2]
  8938. *
  8939. * // The `_.property` iteratee shorthand.
  8940. * _.uniqBy([{ 'x': 1 }, { 'x': 2 }, { 'x': 1 }], 'x');
  8941. * // => [{ 'x': 1 }, { 'x': 2 }]
  8942. */
  8943. function uniqBy(array, iteratee) {
  8944. return (array && array.length) ? baseUniq(array, getIteratee(iteratee, 2)) : [];
  8945. }
  8946. /**
  8947. * This method is like `_.uniq` except that it accepts `comparator` which
  8948. * is invoked to compare elements of `array`. The order of result values is
  8949. * determined by the order they occur in the array.The comparator is invoked
  8950. * with two arguments: (arrVal, othVal).
  8951. *
  8952. * @static
  8953. * @memberOf _
  8954. * @since 4.0.0
  8955. * @category Array
  8956. * @param {Array} array The array to inspect.
  8957. * @param {Function} [comparator] The comparator invoked per element.
  8958. * @returns {Array} Returns the new duplicate free array.
  8959. * @example
  8960. *
  8961. * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }, { 'x': 1, 'y': 2 }];
  8962. *
  8963. * _.uniqWith(objects, _.isEqual);
  8964. * // => [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }]
  8965. */
  8966. function uniqWith(array, comparator) {
  8967. comparator = typeof comparator == 'function' ? comparator : undefined;
  8968. return (array && array.length) ? baseUniq(array, undefined, comparator) : [];
  8969. }
  8970. /**
  8971. * This method is like `_.zip` except that it accepts an array of grouped
  8972. * elements and creates an array regrouping the elements to their pre-zip
  8973. * configuration.
  8974. *
  8975. * @static
  8976. * @memberOf _
  8977. * @since 1.2.0
  8978. * @category Array
  8979. * @param {Array} array The array of grouped elements to process.
  8980. * @returns {Array} Returns the new array of regrouped elements.
  8981. * @example
  8982. *
  8983. * var zipped = _.zip(['a', 'b'], [1, 2], [true, false]);
  8984. * // => [['a', 1, true], ['b', 2, false]]
  8985. *
  8986. * _.unzip(zipped);
  8987. * // => [['a', 'b'], [1, 2], [true, false]]
  8988. */
  8989. function unzip(array) {
  8990. if (!(array && array.length)) {
  8991. return [];
  8992. }
  8993. var length = 0;
  8994. array = arrayFilter(array, function(group) {
  8995. if (isArrayLikeObject(group)) {
  8996. length = nativeMax(group.length, length);
  8997. return true;
  8998. }
  8999. });
  9000. return baseTimes(length, function(index) {
  9001. return arrayMap(array, baseProperty(index));
  9002. });
  9003. }
  9004. /**
  9005. * This method is like `_.unzip` except that it accepts `iteratee` to specify
  9006. * how regrouped values should be combined. The iteratee is invoked with the
  9007. * elements of each group: (...group).
  9008. *
  9009. * @static
  9010. * @memberOf _
  9011. * @since 3.8.0
  9012. * @category Array
  9013. * @param {Array} array The array of grouped elements to process.
  9014. * @param {Function} [iteratee=_.identity] The function to combine
  9015. * regrouped values.
  9016. * @returns {Array} Returns the new array of regrouped elements.
  9017. * @example
  9018. *
  9019. * var zipped = _.zip([1, 2], [10, 20], [100, 200]);
  9020. * // => [[1, 10, 100], [2, 20, 200]]
  9021. *
  9022. * _.unzipWith(zipped, _.add);
  9023. * // => [3, 30, 300]
  9024. */
  9025. function unzipWith(array, iteratee) {
  9026. if (!(array && array.length)) {
  9027. return [];
  9028. }
  9029. var result = unzip(array);
  9030. if (iteratee == null) {
  9031. return result;
  9032. }
  9033. return arrayMap(result, function(group) {
  9034. return apply(iteratee, undefined, group);
  9035. });
  9036. }
  9037. /**
  9038. * Creates an array excluding all given values using
  9039. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  9040. * for equality comparisons.
  9041. *
  9042. * **Note:** Unlike `_.pull`, this method returns a new array.
  9043. *
  9044. * @static
  9045. * @memberOf _
  9046. * @since 0.1.0
  9047. * @category Array
  9048. * @param {Array} array The array to inspect.
  9049. * @param {...*} [values] The values to exclude.
  9050. * @returns {Array} Returns the new array of filtered values.
  9051. * @see _.difference, _.xor
  9052. * @example
  9053. *
  9054. * _.without([2, 1, 2, 3], 1, 2);
  9055. * // => [3]
  9056. */
  9057. var without = baseRest(function(array, values) {
  9058. return isArrayLikeObject(array)
  9059. ? baseDifference(array, values)
  9060. : [];
  9061. });
  9062. /**
  9063. * Creates an array of unique values that is the
  9064. * [symmetric difference](https://en.wikipedia.org/wiki/Symmetric_difference)
  9065. * of the given arrays. The order of result values is determined by the order
  9066. * they occur in the arrays.
  9067. *
  9068. * @static
  9069. * @memberOf _
  9070. * @since 2.4.0
  9071. * @category Array
  9072. * @param {...Array} [arrays] The arrays to inspect.
  9073. * @returns {Array} Returns the new array of filtered values.
  9074. * @see _.difference, _.without
  9075. * @example
  9076. *
  9077. * _.xor([2, 1], [2, 3]);
  9078. * // => [1, 3]
  9079. */
  9080. var xor = baseRest(function(arrays) {
  9081. return baseXor(arrayFilter(arrays, isArrayLikeObject));
  9082. });
  9083. /**
  9084. * This method is like `_.xor` except that it accepts `iteratee` which is
  9085. * invoked for each element of each `arrays` to generate the criterion by
  9086. * which by which they're compared. The order of result values is determined
  9087. * by the order they occur in the arrays. The iteratee is invoked with one
  9088. * argument: (value).
  9089. *
  9090. * @static
  9091. * @memberOf _
  9092. * @since 4.0.0
  9093. * @category Array
  9094. * @param {...Array} [arrays] The arrays to inspect.
  9095. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  9096. * @returns {Array} Returns the new array of filtered values.
  9097. * @example
  9098. *
  9099. * _.xorBy([2.1, 1.2], [2.3, 3.4], Math.floor);
  9100. * // => [1.2, 3.4]
  9101. *
  9102. * // The `_.property` iteratee shorthand.
  9103. * _.xorBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x');
  9104. * // => [{ 'x': 2 }]
  9105. */
  9106. var xorBy = baseRest(function(arrays) {
  9107. var iteratee = last(arrays);
  9108. if (isArrayLikeObject(iteratee)) {
  9109. iteratee = undefined;
  9110. }
  9111. return baseXor(arrayFilter(arrays, isArrayLikeObject), getIteratee(iteratee, 2));
  9112. });
  9113. /**
  9114. * This method is like `_.xor` except that it accepts `comparator` which is
  9115. * invoked to compare elements of `arrays`. The order of result values is
  9116. * determined by the order they occur in the arrays. The comparator is invoked
  9117. * with two arguments: (arrVal, othVal).
  9118. *
  9119. * @static
  9120. * @memberOf _
  9121. * @since 4.0.0
  9122. * @category Array
  9123. * @param {...Array} [arrays] The arrays to inspect.
  9124. * @param {Function} [comparator] The comparator invoked per element.
  9125. * @returns {Array} Returns the new array of filtered values.
  9126. * @example
  9127. *
  9128. * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }];
  9129. * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }];
  9130. *
  9131. * _.xorWith(objects, others, _.isEqual);
  9132. * // => [{ 'x': 2, 'y': 1 }, { 'x': 1, 'y': 1 }]
  9133. */
  9134. var xorWith = baseRest(function(arrays) {
  9135. var comparator = last(arrays);
  9136. comparator = typeof comparator == 'function' ? comparator : undefined;
  9137. return baseXor(arrayFilter(arrays, isArrayLikeObject), undefined, comparator);
  9138. });
  9139. /**
  9140. * Creates an array of grouped elements, the first of which contains the
  9141. * first elements of the given arrays, the second of which contains the
  9142. * second elements of the given arrays, and so on.
  9143. *
  9144. * @static
  9145. * @memberOf _
  9146. * @since 0.1.0
  9147. * @category Array
  9148. * @param {...Array} [arrays] The arrays to process.
  9149. * @returns {Array} Returns the new array of grouped elements.
  9150. * @example
  9151. *
  9152. * _.zip(['a', 'b'], [1, 2], [true, false]);
  9153. * // => [['a', 1, true], ['b', 2, false]]
  9154. */
  9155. var zip = baseRest(unzip);
  9156. /**
  9157. * This method is like `_.fromPairs` except that it accepts two arrays,
  9158. * one of property identifiers and one of corresponding values.
  9159. *
  9160. * @static
  9161. * @memberOf _
  9162. * @since 0.4.0
  9163. * @category Array
  9164. * @param {Array} [props=[]] The property identifiers.
  9165. * @param {Array} [values=[]] The property values.
  9166. * @returns {Object} Returns the new object.
  9167. * @example
  9168. *
  9169. * _.zipObject(['a', 'b'], [1, 2]);
  9170. * // => { 'a': 1, 'b': 2 }
  9171. */
  9172. function zipObject(props, values) {
  9173. return baseZipObject(props || [], values || [], assignValue);
  9174. }
  9175. /**
  9176. * This method is like `_.zipObject` except that it supports property paths.
  9177. *
  9178. * @static
  9179. * @memberOf _
  9180. * @since 4.1.0
  9181. * @category Array
  9182. * @param {Array} [props=[]] The property identifiers.
  9183. * @param {Array} [values=[]] The property values.
  9184. * @returns {Object} Returns the new object.
  9185. * @example
  9186. *
  9187. * _.zipObjectDeep(['a.b[0].c', 'a.b[1].d'], [1, 2]);
  9188. * // => { 'a': { 'b': [{ 'c': 1 }, { 'd': 2 }] } }
  9189. */
  9190. function zipObjectDeep(props, values) {
  9191. return baseZipObject(props || [], values || [], baseSet);
  9192. }
  9193. /**
  9194. * This method is like `_.zip` except that it accepts `iteratee` to specify
  9195. * how grouped values should be combined. The iteratee is invoked with the
  9196. * elements of each group: (...group).
  9197. *
  9198. * @static
  9199. * @memberOf _
  9200. * @since 3.8.0
  9201. * @category Array
  9202. * @param {...Array} [arrays] The arrays to process.
  9203. * @param {Function} [iteratee=_.identity] The function to combine
  9204. * grouped values.
  9205. * @returns {Array} Returns the new array of grouped elements.
  9206. * @example
  9207. *
  9208. * _.zipWith([1, 2], [10, 20], [100, 200], function(a, b, c) {
  9209. * return a + b + c;
  9210. * });
  9211. * // => [111, 222]
  9212. */
  9213. var zipWith = baseRest(function(arrays) {
  9214. var length = arrays.length,
  9215. iteratee = length > 1 ? arrays[length - 1] : undefined;
  9216. iteratee = typeof iteratee == 'function' ? (arrays.pop(), iteratee) : undefined;
  9217. return unzipWith(arrays, iteratee);
  9218. });
  9219. /*------------------------------------------------------------------------*/
  9220. /**
  9221. * Creates a `lodash` wrapper instance that wraps `value` with explicit method
  9222. * chain sequences enabled. The result of such sequences must be unwrapped
  9223. * with `_#value`.
  9224. *
  9225. * @static
  9226. * @memberOf _
  9227. * @since 1.3.0
  9228. * @category Seq
  9229. * @param {*} value The value to wrap.
  9230. * @returns {Object} Returns the new `lodash` wrapper instance.
  9231. * @example
  9232. *
  9233. * var users = [
  9234. * { 'user': 'barney', 'age': 36 },
  9235. * { 'user': 'fred', 'age': 40 },
  9236. * { 'user': 'pebbles', 'age': 1 }
  9237. * ];
  9238. *
  9239. * var youngest = _
  9240. * .chain(users)
  9241. * .sortBy('age')
  9242. * .map(function(o) {
  9243. * return o.user + ' is ' + o.age;
  9244. * })
  9245. * .head()
  9246. * .value();
  9247. * // => 'pebbles is 1'
  9248. */
  9249. function chain(value) {
  9250. var result = lodash(value);
  9251. result.__chain__ = true;
  9252. return result;
  9253. }
  9254. /**
  9255. * This method invokes `interceptor` and returns `value`. The interceptor
  9256. * is invoked with one argument; (value). The purpose of this method is to
  9257. * "tap into" a method chain sequence in order to modify intermediate results.
  9258. *
  9259. * @static
  9260. * @memberOf _
  9261. * @since 0.1.0
  9262. * @category Seq
  9263. * @param {*} value The value to provide to `interceptor`.
  9264. * @param {Function} interceptor The function to invoke.
  9265. * @returns {*} Returns `value`.
  9266. * @example
  9267. *
  9268. * _([1, 2, 3])
  9269. * .tap(function(array) {
  9270. * // Mutate input array.
  9271. * array.pop();
  9272. * })
  9273. * .reverse()
  9274. * .value();
  9275. * // => [2, 1]
  9276. */
  9277. function tap(value, interceptor) {
  9278. interceptor(value);
  9279. return value;
  9280. }
  9281. /**
  9282. * This method is like `_.tap` except that it returns the result of `interceptor`.
  9283. * The purpose of this method is to "pass thru" values replacing intermediate
  9284. * results in a method chain sequence.
  9285. *
  9286. * @static
  9287. * @memberOf _
  9288. * @since 3.0.0
  9289. * @category Seq
  9290. * @param {*} value The value to provide to `interceptor`.
  9291. * @param {Function} interceptor The function to invoke.
  9292. * @returns {*} Returns the result of `interceptor`.
  9293. * @example
  9294. *
  9295. * _(' abc ')
  9296. * .chain()
  9297. * .trim()
  9298. * .thru(function(value) {
  9299. * return [value];
  9300. * })
  9301. * .value();
  9302. * // => ['abc']
  9303. */
  9304. function thru(value, interceptor) {
  9305. return interceptor(value);
  9306. }
  9307. /**
  9308. * This method is the wrapper version of `_.at`.
  9309. *
  9310. * @name at
  9311. * @memberOf _
  9312. * @since 1.0.0
  9313. * @category Seq
  9314. * @param {...(string|string[])} [paths] The property paths to pick.
  9315. * @returns {Object} Returns the new `lodash` wrapper instance.
  9316. * @example
  9317. *
  9318. * var object = { 'a': [{ 'b': { 'c': 3 } }, 4] };
  9319. *
  9320. * _(object).at(['a[0].b.c', 'a[1]']).value();
  9321. * // => [3, 4]
  9322. */
  9323. var wrapperAt = flatRest(function(paths) {
  9324. var length = paths.length,
  9325. start = length ? paths[0] : 0,
  9326. value = this.__wrapped__,
  9327. interceptor = function(object) { return baseAt(object, paths); };
  9328. if (length > 1 || this.__actions__.length ||
  9329. !(value instanceof LazyWrapper) || !isIndex(start)) {
  9330. return this.thru(interceptor);
  9331. }
  9332. value = value.slice(start, +start + (length ? 1 : 0));
  9333. value.__actions__.push({
  9334. 'func': thru,
  9335. 'args': [interceptor],
  9336. 'thisArg': undefined
  9337. });
  9338. return new LodashWrapper(value, this.__chain__).thru(function(array) {
  9339. if (length && !array.length) {
  9340. array.push(undefined);
  9341. }
  9342. return array;
  9343. });
  9344. });
  9345. /**
  9346. * Creates a `lodash` wrapper instance with explicit method chain sequences enabled.
  9347. *
  9348. * @name chain
  9349. * @memberOf _
  9350. * @since 0.1.0
  9351. * @category Seq
  9352. * @returns {Object} Returns the new `lodash` wrapper instance.
  9353. * @example
  9354. *
  9355. * var users = [
  9356. * { 'user': 'barney', 'age': 36 },
  9357. * { 'user': 'fred', 'age': 40 }
  9358. * ];
  9359. *
  9360. * // A sequence without explicit chaining.
  9361. * _(users).head();
  9362. * // => { 'user': 'barney', 'age': 36 }
  9363. *
  9364. * // A sequence with explicit chaining.
  9365. * _(users)
  9366. * .chain()
  9367. * .head()
  9368. * .pick('user')
  9369. * .value();
  9370. * // => { 'user': 'barney' }
  9371. */
  9372. function wrapperChain() {
  9373. return chain(this);
  9374. }
  9375. /**
  9376. * Executes the chain sequence and returns the wrapped result.
  9377. *
  9378. * @name commit
  9379. * @memberOf _
  9380. * @since 3.2.0
  9381. * @category Seq
  9382. * @returns {Object} Returns the new `lodash` wrapper instance.
  9383. * @example
  9384. *
  9385. * var array = [1, 2];
  9386. * var wrapped = _(array).push(3);
  9387. *
  9388. * console.log(array);
  9389. * // => [1, 2]
  9390. *
  9391. * wrapped = wrapped.commit();
  9392. * console.log(array);
  9393. * // => [1, 2, 3]
  9394. *
  9395. * wrapped.last();
  9396. * // => 3
  9397. *
  9398. * console.log(array);
  9399. * // => [1, 2, 3]
  9400. */
  9401. function wrapperCommit() {
  9402. return new LodashWrapper(this.value(), this.__chain__);
  9403. }
  9404. /**
  9405. * Gets the next value on a wrapped object following the
  9406. * [iterator protocol](https://mdn.io/iteration_protocols#iterator).
  9407. *
  9408. * @name next
  9409. * @memberOf _
  9410. * @since 4.0.0
  9411. * @category Seq
  9412. * @returns {Object} Returns the next iterator value.
  9413. * @example
  9414. *
  9415. * var wrapped = _([1, 2]);
  9416. *
  9417. * wrapped.next();
  9418. * // => { 'done': false, 'value': 1 }
  9419. *
  9420. * wrapped.next();
  9421. * // => { 'done': false, 'value': 2 }
  9422. *
  9423. * wrapped.next();
  9424. * // => { 'done': true, 'value': undefined }
  9425. */
  9426. function wrapperNext() {
  9427. if (this.__values__ === undefined) {
  9428. this.__values__ = toArray(this.value());
  9429. }
  9430. var done = this.__index__ >= this.__values__.length,
  9431. value = done ? undefined : this.__values__[this.__index__++];
  9432. return { 'done': done, 'value': value };
  9433. }
  9434. /**
  9435. * Enables the wrapper to be iterable.
  9436. *
  9437. * @name Symbol.iterator
  9438. * @memberOf _
  9439. * @since 4.0.0
  9440. * @category Seq
  9441. * @returns {Object} Returns the wrapper object.
  9442. * @example
  9443. *
  9444. * var wrapped = _([1, 2]);
  9445. *
  9446. * wrapped[Symbol.iterator]() === wrapped;
  9447. * // => true
  9448. *
  9449. * Array.from(wrapped);
  9450. * // => [1, 2]
  9451. */
  9452. function wrapperToIterator() {
  9453. return this;
  9454. }
  9455. /**
  9456. * Creates a clone of the chain sequence planting `value` as the wrapped value.
  9457. *
  9458. * @name plant
  9459. * @memberOf _
  9460. * @since 3.2.0
  9461. * @category Seq
  9462. * @param {*} value The value to plant.
  9463. * @returns {Object} Returns the new `lodash` wrapper instance.
  9464. * @example
  9465. *
  9466. * function square(n) {
  9467. * return n * n;
  9468. * }
  9469. *
  9470. * var wrapped = _([1, 2]).map(square);
  9471. * var other = wrapped.plant([3, 4]);
  9472. *
  9473. * other.value();
  9474. * // => [9, 16]
  9475. *
  9476. * wrapped.value();
  9477. * // => [1, 4]
  9478. */
  9479. function wrapperPlant(value) {
  9480. var result,
  9481. parent = this;
  9482. while (parent instanceof baseLodash) {
  9483. var clone = wrapperClone(parent);
  9484. clone.__index__ = 0;
  9485. clone.__values__ = undefined;
  9486. if (result) {
  9487. previous.__wrapped__ = clone;
  9488. } else {
  9489. result = clone;
  9490. }
  9491. var previous = clone;
  9492. parent = parent.__wrapped__;
  9493. }
  9494. previous.__wrapped__ = value;
  9495. return result;
  9496. }
  9497. /**
  9498. * This method is the wrapper version of `_.reverse`.
  9499. *
  9500. * **Note:** This method mutates the wrapped array.
  9501. *
  9502. * @name reverse
  9503. * @memberOf _
  9504. * @since 0.1.0
  9505. * @category Seq
  9506. * @returns {Object} Returns the new `lodash` wrapper instance.
  9507. * @example
  9508. *
  9509. * var array = [1, 2, 3];
  9510. *
  9511. * _(array).reverse().value()
  9512. * // => [3, 2, 1]
  9513. *
  9514. * console.log(array);
  9515. * // => [3, 2, 1]
  9516. */
  9517. function wrapperReverse() {
  9518. var value = this.__wrapped__;
  9519. if (value instanceof LazyWrapper) {
  9520. var wrapped = value;
  9521. if (this.__actions__.length) {
  9522. wrapped = new LazyWrapper(this);
  9523. }
  9524. wrapped = wrapped.reverse();
  9525. wrapped.__actions__.push({
  9526. 'func': thru,
  9527. 'args': [reverse],
  9528. 'thisArg': undefined
  9529. });
  9530. return new LodashWrapper(wrapped, this.__chain__);
  9531. }
  9532. return this.thru(reverse);
  9533. }
  9534. /**
  9535. * Executes the chain sequence to resolve the unwrapped value.
  9536. *
  9537. * @name value
  9538. * @memberOf _
  9539. * @since 0.1.0
  9540. * @alias toJSON, valueOf
  9541. * @category Seq
  9542. * @returns {*} Returns the resolved unwrapped value.
  9543. * @example
  9544. *
  9545. * _([1, 2, 3]).value();
  9546. * // => [1, 2, 3]
  9547. */
  9548. function wrapperValue() {
  9549. return baseWrapperValue(this.__wrapped__, this.__actions__);
  9550. }
  9551. /*------------------------------------------------------------------------*/
  9552. /**
  9553. * Creates an object composed of keys generated from the results of running
  9554. * each element of `collection` thru `iteratee`. The corresponding value of
  9555. * each key is the number of times the key was returned by `iteratee`. The
  9556. * iteratee is invoked with one argument: (value).
  9557. *
  9558. * @static
  9559. * @memberOf _
  9560. * @since 0.5.0
  9561. * @category Collection
  9562. * @param {Array|Object} collection The collection to iterate over.
  9563. * @param {Function} [iteratee=_.identity] The iteratee to transform keys.
  9564. * @returns {Object} Returns the composed aggregate object.
  9565. * @example
  9566. *
  9567. * _.countBy([6.1, 4.2, 6.3], Math.floor);
  9568. * // => { '4': 1, '6': 2 }
  9569. *
  9570. * // The `_.property` iteratee shorthand.
  9571. * _.countBy(['one', 'two', 'three'], 'length');
  9572. * // => { '3': 2, '5': 1 }
  9573. */
  9574. var countBy = createAggregator(function(result, value, key) {
  9575. if (hasOwnProperty.call(result, key)) {
  9576. ++result[key];
  9577. } else {
  9578. baseAssignValue(result, key, 1);
  9579. }
  9580. });
  9581. /**
  9582. * Checks if `predicate` returns truthy for **all** elements of `collection`.
  9583. * Iteration is stopped once `predicate` returns falsey. The predicate is
  9584. * invoked with three arguments: (value, index|key, collection).
  9585. *
  9586. * **Note:** This method returns `true` for
  9587. * [empty collections](https://en.wikipedia.org/wiki/Empty_set) because
  9588. * [everything is true](https://en.wikipedia.org/wiki/Vacuous_truth) of
  9589. * elements of empty collections.
  9590. *
  9591. * @static
  9592. * @memberOf _
  9593. * @since 0.1.0
  9594. * @category Collection
  9595. * @param {Array|Object} collection The collection to iterate over.
  9596. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  9597. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  9598. * @returns {boolean} Returns `true` if all elements pass the predicate check,
  9599. * else `false`.
  9600. * @example
  9601. *
  9602. * _.every([true, 1, null, 'yes'], Boolean);
  9603. * // => false
  9604. *
  9605. * var users = [
  9606. * { 'user': 'barney', 'age': 36, 'active': false },
  9607. * { 'user': 'fred', 'age': 40, 'active': false }
  9608. * ];
  9609. *
  9610. * // The `_.matches` iteratee shorthand.
  9611. * _.every(users, { 'user': 'barney', 'active': false });
  9612. * // => false
  9613. *
  9614. * // The `_.matchesProperty` iteratee shorthand.
  9615. * _.every(users, ['active', false]);
  9616. * // => true
  9617. *
  9618. * // The `_.property` iteratee shorthand.
  9619. * _.every(users, 'active');
  9620. * // => false
  9621. */
  9622. function every(collection, predicate, guard) {
  9623. var func = isArray(collection) ? arrayEvery : baseEvery;
  9624. if (guard && isIterateeCall(collection, predicate, guard)) {
  9625. predicate = undefined;
  9626. }
  9627. return func(collection, getIteratee(predicate, 3));
  9628. }
  9629. /**
  9630. * Iterates over elements of `collection`, returning an array of all elements
  9631. * `predicate` returns truthy for. The predicate is invoked with three
  9632. * arguments: (value, index|key, collection).
  9633. *
  9634. * **Note:** Unlike `_.remove`, this method returns a new array.
  9635. *
  9636. * @static
  9637. * @memberOf _
  9638. * @since 0.1.0
  9639. * @category Collection
  9640. * @param {Array|Object} collection The collection to iterate over.
  9641. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  9642. * @returns {Array} Returns the new filtered array.
  9643. * @see _.reject
  9644. * @example
  9645. *
  9646. * var users = [
  9647. * { 'user': 'barney', 'age': 36, 'active': true },
  9648. * { 'user': 'fred', 'age': 40, 'active': false }
  9649. * ];
  9650. *
  9651. * _.filter(users, function(o) { return !o.active; });
  9652. * // => objects for ['fred']
  9653. *
  9654. * // The `_.matches` iteratee shorthand.
  9655. * _.filter(users, { 'age': 36, 'active': true });
  9656. * // => objects for ['barney']
  9657. *
  9658. * // The `_.matchesProperty` iteratee shorthand.
  9659. * _.filter(users, ['active', false]);
  9660. * // => objects for ['fred']
  9661. *
  9662. * // The `_.property` iteratee shorthand.
  9663. * _.filter(users, 'active');
  9664. * // => objects for ['barney']
  9665. *
  9666. * // Combining several predicates using `_.overEvery` or `_.overSome`.
  9667. * _.filter(users, _.overSome([{ 'age': 36 }, ['age', 40]]));
  9668. * // => objects for ['fred', 'barney']
  9669. */
  9670. function filter(collection, predicate) {
  9671. var func = isArray(collection) ? arrayFilter : baseFilter;
  9672. return func(collection, getIteratee(predicate, 3));
  9673. }
  9674. /**
  9675. * Iterates over elements of `collection`, returning the first element
  9676. * `predicate` returns truthy for. The predicate is invoked with three
  9677. * arguments: (value, index|key, collection).
  9678. *
  9679. * @static
  9680. * @memberOf _
  9681. * @since 0.1.0
  9682. * @category Collection
  9683. * @param {Array|Object} collection The collection to inspect.
  9684. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  9685. * @param {number} [fromIndex=0] The index to search from.
  9686. * @returns {*} Returns the matched element, else `undefined`.
  9687. * @example
  9688. *
  9689. * var users = [
  9690. * { 'user': 'barney', 'age': 36, 'active': true },
  9691. * { 'user': 'fred', 'age': 40, 'active': false },
  9692. * { 'user': 'pebbles', 'age': 1, 'active': true }
  9693. * ];
  9694. *
  9695. * _.find(users, function(o) { return o.age < 40; });
  9696. * // => object for 'barney'
  9697. *
  9698. * // The `_.matches` iteratee shorthand.
  9699. * _.find(users, { 'age': 1, 'active': true });
  9700. * // => object for 'pebbles'
  9701. *
  9702. * // The `_.matchesProperty` iteratee shorthand.
  9703. * _.find(users, ['active', false]);
  9704. * // => object for 'fred'
  9705. *
  9706. * // The `_.property` iteratee shorthand.
  9707. * _.find(users, 'active');
  9708. * // => object for 'barney'
  9709. */
  9710. var find = createFind(findIndex);
  9711. /**
  9712. * This method is like `_.find` except that it iterates over elements of
  9713. * `collection` from right to left.
  9714. *
  9715. * @static
  9716. * @memberOf _
  9717. * @since 2.0.0
  9718. * @category Collection
  9719. * @param {Array|Object} collection The collection to inspect.
  9720. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  9721. * @param {number} [fromIndex=collection.length-1] The index to search from.
  9722. * @returns {*} Returns the matched element, else `undefined`.
  9723. * @example
  9724. *
  9725. * _.findLast([1, 2, 3, 4], function(n) {
  9726. * return n % 2 == 1;
  9727. * });
  9728. * // => 3
  9729. */
  9730. var findLast = createFind(findLastIndex);
  9731. /**
  9732. * Creates a flattened array of values by running each element in `collection`
  9733. * thru `iteratee` and flattening the mapped results. The iteratee is invoked
  9734. * with three arguments: (value, index|key, collection).
  9735. *
  9736. * @static
  9737. * @memberOf _
  9738. * @since 4.0.0
  9739. * @category Collection
  9740. * @param {Array|Object} collection The collection to iterate over.
  9741. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  9742. * @returns {Array} Returns the new flattened array.
  9743. * @example
  9744. *
  9745. * function duplicate(n) {
  9746. * return [n, n];
  9747. * }
  9748. *
  9749. * _.flatMap([1, 2], duplicate);
  9750. * // => [1, 1, 2, 2]
  9751. */
  9752. function flatMap(collection, iteratee) {
  9753. return baseFlatten(map(collection, iteratee), 1);
  9754. }
  9755. /**
  9756. * This method is like `_.flatMap` except that it recursively flattens the
  9757. * mapped results.
  9758. *
  9759. * @static
  9760. * @memberOf _
  9761. * @since 4.7.0
  9762. * @category Collection
  9763. * @param {Array|Object} collection The collection to iterate over.
  9764. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  9765. * @returns {Array} Returns the new flattened array.
  9766. * @example
  9767. *
  9768. * function duplicate(n) {
  9769. * return [[[n, n]]];
  9770. * }
  9771. *
  9772. * _.flatMapDeep([1, 2], duplicate);
  9773. * // => [1, 1, 2, 2]
  9774. */
  9775. function flatMapDeep(collection, iteratee) {
  9776. return baseFlatten(map(collection, iteratee), INFINITY);
  9777. }
  9778. /**
  9779. * This method is like `_.flatMap` except that it recursively flattens the
  9780. * mapped results up to `depth` times.
  9781. *
  9782. * @static
  9783. * @memberOf _
  9784. * @since 4.7.0
  9785. * @category Collection
  9786. * @param {Array|Object} collection The collection to iterate over.
  9787. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  9788. * @param {number} [depth=1] The maximum recursion depth.
  9789. * @returns {Array} Returns the new flattened array.
  9790. * @example
  9791. *
  9792. * function duplicate(n) {
  9793. * return [[[n, n]]];
  9794. * }
  9795. *
  9796. * _.flatMapDepth([1, 2], duplicate, 2);
  9797. * // => [[1, 1], [2, 2]]
  9798. */
  9799. function flatMapDepth(collection, iteratee, depth) {
  9800. depth = depth === undefined ? 1 : toInteger(depth);
  9801. return baseFlatten(map(collection, iteratee), depth);
  9802. }
  9803. /**
  9804. * Iterates over elements of `collection` and invokes `iteratee` for each element.
  9805. * The iteratee is invoked with three arguments: (value, index|key, collection).
  9806. * Iteratee functions may exit iteration early by explicitly returning `false`.
  9807. *
  9808. * **Note:** As with other "Collections" methods, objects with a "length"
  9809. * property are iterated like arrays. To avoid this behavior use `_.forIn`
  9810. * or `_.forOwn` for object iteration.
  9811. *
  9812. * @static
  9813. * @memberOf _
  9814. * @since 0.1.0
  9815. * @alias each
  9816. * @category Collection
  9817. * @param {Array|Object} collection The collection to iterate over.
  9818. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  9819. * @returns {Array|Object} Returns `collection`.
  9820. * @see _.forEachRight
  9821. * @example
  9822. *
  9823. * _.forEach([1, 2], function(value) {
  9824. * console.log(value);
  9825. * });
  9826. * // => Logs `1` then `2`.
  9827. *
  9828. * _.forEach({ 'a': 1, 'b': 2 }, function(value, key) {
  9829. * console.log(key);
  9830. * });
  9831. * // => Logs 'a' then 'b' (iteration order is not guaranteed).
  9832. */
  9833. function forEach(collection, iteratee) {
  9834. var func = isArray(collection) ? arrayEach : baseEach;
  9835. return func(collection, getIteratee(iteratee, 3));
  9836. }
  9837. /**
  9838. * This method is like `_.forEach` except that it iterates over elements of
  9839. * `collection` from right to left.
  9840. *
  9841. * @static
  9842. * @memberOf _
  9843. * @since 2.0.0
  9844. * @alias eachRight
  9845. * @category Collection
  9846. * @param {Array|Object} collection The collection to iterate over.
  9847. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  9848. * @returns {Array|Object} Returns `collection`.
  9849. * @see _.forEach
  9850. * @example
  9851. *
  9852. * _.forEachRight([1, 2], function(value) {
  9853. * console.log(value);
  9854. * });
  9855. * // => Logs `2` then `1`.
  9856. */
  9857. function forEachRight(collection, iteratee) {
  9858. var func = isArray(collection) ? arrayEachRight : baseEachRight;
  9859. return func(collection, getIteratee(iteratee, 3));
  9860. }
  9861. /**
  9862. * Creates an object composed of keys generated from the results of running
  9863. * each element of `collection` thru `iteratee`. The order of grouped values
  9864. * is determined by the order they occur in `collection`. The corresponding
  9865. * value of each key is an array of elements responsible for generating the
  9866. * key. The iteratee is invoked with one argument: (value).
  9867. *
  9868. * @static
  9869. * @memberOf _
  9870. * @since 0.1.0
  9871. * @category Collection
  9872. * @param {Array|Object} collection The collection to iterate over.
  9873. * @param {Function} [iteratee=_.identity] The iteratee to transform keys.
  9874. * @returns {Object} Returns the composed aggregate object.
  9875. * @example
  9876. *
  9877. * _.groupBy([6.1, 4.2, 6.3], Math.floor);
  9878. * // => { '4': [4.2], '6': [6.1, 6.3] }
  9879. *
  9880. * // The `_.property` iteratee shorthand.
  9881. * _.groupBy(['one', 'two', 'three'], 'length');
  9882. * // => { '3': ['one', 'two'], '5': ['three'] }
  9883. */
  9884. var groupBy = createAggregator(function(result, value, key) {
  9885. if (hasOwnProperty.call(result, key)) {
  9886. result[key].push(value);
  9887. } else {
  9888. baseAssignValue(result, key, [value]);
  9889. }
  9890. });
  9891. /**
  9892. * Checks if `value` is in `collection`. If `collection` is a string, it's
  9893. * checked for a substring of `value`, otherwise
  9894. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  9895. * is used for equality comparisons. If `fromIndex` is negative, it's used as
  9896. * the offset from the end of `collection`.
  9897. *
  9898. * @static
  9899. * @memberOf _
  9900. * @since 0.1.0
  9901. * @category Collection
  9902. * @param {Array|Object|string} collection The collection to inspect.
  9903. * @param {*} value The value to search for.
  9904. * @param {number} [fromIndex=0] The index to search from.
  9905. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.reduce`.
  9906. * @returns {boolean} Returns `true` if `value` is found, else `false`.
  9907. * @example
  9908. *
  9909. * _.includes([1, 2, 3], 1);
  9910. * // => true
  9911. *
  9912. * _.includes([1, 2, 3], 1, 2);
  9913. * // => false
  9914. *
  9915. * _.includes({ 'a': 1, 'b': 2 }, 1);
  9916. * // => true
  9917. *
  9918. * _.includes('abcd', 'bc');
  9919. * // => true
  9920. */
  9921. function includes(collection, value, fromIndex, guard) {
  9922. collection = isArrayLike(collection) ? collection : values(collection);
  9923. fromIndex = (fromIndex && !guard) ? toInteger(fromIndex) : 0;
  9924. var length = collection.length;
  9925. if (fromIndex < 0) {
  9926. fromIndex = nativeMax(length + fromIndex, 0);
  9927. }
  9928. return isString(collection)
  9929. ? (fromIndex <= length && collection.indexOf(value, fromIndex) > -1)
  9930. : (!!length && baseIndexOf(collection, value, fromIndex) > -1);
  9931. }
  9932. /**
  9933. * Invokes the method at `path` of each element in `collection`, returning
  9934. * an array of the results of each invoked method. Any additional arguments
  9935. * are provided to each invoked method. If `path` is a function, it's invoked
  9936. * for, and `this` bound to, each element in `collection`.
  9937. *
  9938. * @static
  9939. * @memberOf _
  9940. * @since 4.0.0
  9941. * @category Collection
  9942. * @param {Array|Object} collection The collection to iterate over.
  9943. * @param {Array|Function|string} path The path of the method to invoke or
  9944. * the function invoked per iteration.
  9945. * @param {...*} [args] The arguments to invoke each method with.
  9946. * @returns {Array} Returns the array of results.
  9947. * @example
  9948. *
  9949. * _.invokeMap([[5, 1, 7], [3, 2, 1]], 'sort');
  9950. * // => [[1, 5, 7], [1, 2, 3]]
  9951. *
  9952. * _.invokeMap([123, 456], String.prototype.split, '');
  9953. * // => [['1', '2', '3'], ['4', '5', '6']]
  9954. */
  9955. var invokeMap = baseRest(function(collection, path, args) {
  9956. var index = -1,
  9957. isFunc = typeof path == 'function',
  9958. result = isArrayLike(collection) ? Array(collection.length) : [];
  9959. baseEach(collection, function(value) {
  9960. result[++index] = isFunc ? apply(path, value, args) : baseInvoke(value, path, args);
  9961. });
  9962. return result;
  9963. });
  9964. /**
  9965. * Creates an object composed of keys generated from the results of running
  9966. * each element of `collection` thru `iteratee`. The corresponding value of
  9967. * each key is the last element responsible for generating the key. The
  9968. * iteratee is invoked with one argument: (value).
  9969. *
  9970. * @static
  9971. * @memberOf _
  9972. * @since 4.0.0
  9973. * @category Collection
  9974. * @param {Array|Object} collection The collection to iterate over.
  9975. * @param {Function} [iteratee=_.identity] The iteratee to transform keys.
  9976. * @returns {Object} Returns the composed aggregate object.
  9977. * @example
  9978. *
  9979. * var array = [
  9980. * { 'dir': 'left', 'code': 97 },
  9981. * { 'dir': 'right', 'code': 100 }
  9982. * ];
  9983. *
  9984. * _.keyBy(array, function(o) {
  9985. * return String.fromCharCode(o.code);
  9986. * });
  9987. * // => { 'a': { 'dir': 'left', 'code': 97 }, 'd': { 'dir': 'right', 'code': 100 } }
  9988. *
  9989. * _.keyBy(array, 'dir');
  9990. * // => { 'left': { 'dir': 'left', 'code': 97 }, 'right': { 'dir': 'right', 'code': 100 } }
  9991. */
  9992. var keyBy = createAggregator(function(result, value, key) {
  9993. baseAssignValue(result, key, value);
  9994. });
  9995. /**
  9996. * Creates an array of values by running each element in `collection` thru
  9997. * `iteratee`. The iteratee is invoked with three arguments:
  9998. * (value, index|key, collection).
  9999. *
  10000. * Many lodash methods are guarded to work as iteratees for methods like
  10001. * `_.every`, `_.filter`, `_.map`, `_.mapValues`, `_.reject`, and `_.some`.
  10002. *
  10003. * The guarded methods are:
  10004. * `ary`, `chunk`, `curry`, `curryRight`, `drop`, `dropRight`, `every`,
  10005. * `fill`, `invert`, `parseInt`, `random`, `range`, `rangeRight`, `repeat`,
  10006. * `sampleSize`, `slice`, `some`, `sortBy`, `split`, `take`, `takeRight`,
  10007. * `template`, `trim`, `trimEnd`, `trimStart`, and `words`
  10008. *
  10009. * @static
  10010. * @memberOf _
  10011. * @since 0.1.0
  10012. * @category Collection
  10013. * @param {Array|Object} collection The collection to iterate over.
  10014. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  10015. * @returns {Array} Returns the new mapped array.
  10016. * @example
  10017. *
  10018. * function square(n) {
  10019. * return n * n;
  10020. * }
  10021. *
  10022. * _.map([4, 8], square);
  10023. * // => [16, 64]
  10024. *
  10025. * _.map({ 'a': 4, 'b': 8 }, square);
  10026. * // => [16, 64] (iteration order is not guaranteed)
  10027. *
  10028. * var users = [
  10029. * { 'user': 'barney' },
  10030. * { 'user': 'fred' }
  10031. * ];
  10032. *
  10033. * // The `_.property` iteratee shorthand.
  10034. * _.map(users, 'user');
  10035. * // => ['barney', 'fred']
  10036. */
  10037. function map(collection, iteratee) {
  10038. var func = isArray(collection) ? arrayMap : baseMap;
  10039. return func(collection, getIteratee(iteratee, 3));
  10040. }
  10041. /**
  10042. * This method is like `_.sortBy` except that it allows specifying the sort
  10043. * orders of the iteratees to sort by. If `orders` is unspecified, all values
  10044. * are sorted in ascending order. Otherwise, specify an order of "desc" for
  10045. * descending or "asc" for ascending sort order of corresponding values.
  10046. *
  10047. * @static
  10048. * @memberOf _
  10049. * @since 4.0.0
  10050. * @category Collection
  10051. * @param {Array|Object} collection The collection to iterate over.
  10052. * @param {Array[]|Function[]|Object[]|string[]} [iteratees=[_.identity]]
  10053. * The iteratees to sort by.
  10054. * @param {string[]} [orders] The sort orders of `iteratees`.
  10055. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.reduce`.
  10056. * @returns {Array} Returns the new sorted array.
  10057. * @example
  10058. *
  10059. * var users = [
  10060. * { 'user': 'fred', 'age': 48 },
  10061. * { 'user': 'barney', 'age': 34 },
  10062. * { 'user': 'fred', 'age': 40 },
  10063. * { 'user': 'barney', 'age': 36 }
  10064. * ];
  10065. *
  10066. * // Sort by `user` in ascending order and by `age` in descending order.
  10067. * _.orderBy(users, ['user', 'age'], ['asc', 'desc']);
  10068. * // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 40]]
  10069. */
  10070. function orderBy(collection, iteratees, orders, guard) {
  10071. if (collection == null) {
  10072. return [];
  10073. }
  10074. if (!isArray(iteratees)) {
  10075. iteratees = iteratees == null ? [] : [iteratees];
  10076. }
  10077. orders = guard ? undefined : orders;
  10078. if (!isArray(orders)) {
  10079. orders = orders == null ? [] : [orders];
  10080. }
  10081. return baseOrderBy(collection, iteratees, orders);
  10082. }
  10083. /**
  10084. * Creates an array of elements split into two groups, the first of which
  10085. * contains elements `predicate` returns truthy for, the second of which
  10086. * contains elements `predicate` returns falsey for. The predicate is
  10087. * invoked with one argument: (value).
  10088. *
  10089. * @static
  10090. * @memberOf _
  10091. * @since 3.0.0
  10092. * @category Collection
  10093. * @param {Array|Object} collection The collection to iterate over.
  10094. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  10095. * @returns {Array} Returns the array of grouped elements.
  10096. * @example
  10097. *
  10098. * var users = [
  10099. * { 'user': 'barney', 'age': 36, 'active': false },
  10100. * { 'user': 'fred', 'age': 40, 'active': true },
  10101. * { 'user': 'pebbles', 'age': 1, 'active': false }
  10102. * ];
  10103. *
  10104. * _.partition(users, function(o) { return o.active; });
  10105. * // => objects for [['fred'], ['barney', 'pebbles']]
  10106. *
  10107. * // The `_.matches` iteratee shorthand.
  10108. * _.partition(users, { 'age': 1, 'active': false });
  10109. * // => objects for [['pebbles'], ['barney', 'fred']]
  10110. *
  10111. * // The `_.matchesProperty` iteratee shorthand.
  10112. * _.partition(users, ['active', false]);
  10113. * // => objects for [['barney', 'pebbles'], ['fred']]
  10114. *
  10115. * // The `_.property` iteratee shorthand.
  10116. * _.partition(users, 'active');
  10117. * // => objects for [['fred'], ['barney', 'pebbles']]
  10118. */
  10119. var partition = createAggregator(function(result, value, key) {
  10120. result[key ? 0 : 1].push(value);
  10121. }, function() { return [[], []]; });
  10122. /**
  10123. * Reduces `collection` to a value which is the accumulated result of running
  10124. * each element in `collection` thru `iteratee`, where each successive
  10125. * invocation is supplied the return value of the previous. If `accumulator`
  10126. * is not given, the first element of `collection` is used as the initial
  10127. * value. The iteratee is invoked with four arguments:
  10128. * (accumulator, value, index|key, collection).
  10129. *
  10130. * Many lodash methods are guarded to work as iteratees for methods like
  10131. * `_.reduce`, `_.reduceRight`, and `_.transform`.
  10132. *
  10133. * The guarded methods are:
  10134. * `assign`, `defaults`, `defaultsDeep`, `includes`, `merge`, `orderBy`,
  10135. * and `sortBy`
  10136. *
  10137. * @static
  10138. * @memberOf _
  10139. * @since 0.1.0
  10140. * @category Collection
  10141. * @param {Array|Object} collection The collection to iterate over.
  10142. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  10143. * @param {*} [accumulator] The initial value.
  10144. * @returns {*} Returns the accumulated value.
  10145. * @see _.reduceRight
  10146. * @example
  10147. *
  10148. * _.reduce([1, 2], function(sum, n) {
  10149. * return sum + n;
  10150. * }, 0);
  10151. * // => 3
  10152. *
  10153. * _.reduce({ 'a': 1, 'b': 2, 'c': 1 }, function(result, value, key) {
  10154. * (result[value] || (result[value] = [])).push(key);
  10155. * return result;
  10156. * }, {});
  10157. * // => { '1': ['a', 'c'], '2': ['b'] } (iteration order is not guaranteed)
  10158. */
  10159. function reduce(collection, iteratee, accumulator) {
  10160. var func = isArray(collection) ? arrayReduce : baseReduce,
  10161. initAccum = arguments.length < 3;
  10162. return func(collection, getIteratee(iteratee, 4), accumulator, initAccum, baseEach);
  10163. }
  10164. /**
  10165. * This method is like `_.reduce` except that it iterates over elements of
  10166. * `collection` from right to left.
  10167. *
  10168. * @static
  10169. * @memberOf _
  10170. * @since 0.1.0
  10171. * @category Collection
  10172. * @param {Array|Object} collection The collection to iterate over.
  10173. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  10174. * @param {*} [accumulator] The initial value.
  10175. * @returns {*} Returns the accumulated value.
  10176. * @see _.reduce
  10177. * @example
  10178. *
  10179. * var array = [[0, 1], [2, 3], [4, 5]];
  10180. *
  10181. * _.reduceRight(array, function(flattened, other) {
  10182. * return flattened.concat(other);
  10183. * }, []);
  10184. * // => [4, 5, 2, 3, 0, 1]
  10185. */
  10186. function reduceRight(collection, iteratee, accumulator) {
  10187. var func = isArray(collection) ? arrayReduceRight : baseReduce,
  10188. initAccum = arguments.length < 3;
  10189. return func(collection, getIteratee(iteratee, 4), accumulator, initAccum, baseEachRight);
  10190. }
  10191. /**
  10192. * The opposite of `_.filter`; this method returns the elements of `collection`
  10193. * that `predicate` does **not** return truthy for.
  10194. *
  10195. * @static
  10196. * @memberOf _
  10197. * @since 0.1.0
  10198. * @category Collection
  10199. * @param {Array|Object} collection The collection to iterate over.
  10200. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  10201. * @returns {Array} Returns the new filtered array.
  10202. * @see _.filter
  10203. * @example
  10204. *
  10205. * var users = [
  10206. * { 'user': 'barney', 'age': 36, 'active': false },
  10207. * { 'user': 'fred', 'age': 40, 'active': true }
  10208. * ];
  10209. *
  10210. * _.reject(users, function(o) { return !o.active; });
  10211. * // => objects for ['fred']
  10212. *
  10213. * // The `_.matches` iteratee shorthand.
  10214. * _.reject(users, { 'age': 40, 'active': true });
  10215. * // => objects for ['barney']
  10216. *
  10217. * // The `_.matchesProperty` iteratee shorthand.
  10218. * _.reject(users, ['active', false]);
  10219. * // => objects for ['fred']
  10220. *
  10221. * // The `_.property` iteratee shorthand.
  10222. * _.reject(users, 'active');
  10223. * // => objects for ['barney']
  10224. */
  10225. function reject(collection, predicate) {
  10226. var func = isArray(collection) ? arrayFilter : baseFilter;
  10227. return func(collection, negate(getIteratee(predicate, 3)));
  10228. }
  10229. /**
  10230. * Gets a random element from `collection`.
  10231. *
  10232. * @static
  10233. * @memberOf _
  10234. * @since 2.0.0
  10235. * @category Collection
  10236. * @param {Array|Object} collection The collection to sample.
  10237. * @returns {*} Returns the random element.
  10238. * @example
  10239. *
  10240. * _.sample([1, 2, 3, 4]);
  10241. * // => 2
  10242. */
  10243. function sample(collection) {
  10244. var func = isArray(collection) ? arraySample : baseSample;
  10245. return func(collection);
  10246. }
  10247. /**
  10248. * Gets `n` random elements at unique keys from `collection` up to the
  10249. * size of `collection`.
  10250. *
  10251. * @static
  10252. * @memberOf _
  10253. * @since 4.0.0
  10254. * @category Collection
  10255. * @param {Array|Object} collection The collection to sample.
  10256. * @param {number} [n=1] The number of elements to sample.
  10257. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  10258. * @returns {Array} Returns the random elements.
  10259. * @example
  10260. *
  10261. * _.sampleSize([1, 2, 3], 2);
  10262. * // => [3, 1]
  10263. *
  10264. * _.sampleSize([1, 2, 3], 4);
  10265. * // => [2, 3, 1]
  10266. */
  10267. function sampleSize(collection, n, guard) {
  10268. if ((guard ? isIterateeCall(collection, n, guard) : n === undefined)) {
  10269. n = 1;
  10270. } else {
  10271. n = toInteger(n);
  10272. }
  10273. var func = isArray(collection) ? arraySampleSize : baseSampleSize;
  10274. return func(collection, n);
  10275. }
  10276. /**
  10277. * Creates an array of shuffled values, using a version of the
  10278. * [Fisher-Yates shuffle](https://en.wikipedia.org/wiki/Fisher-Yates_shuffle).
  10279. *
  10280. * @static
  10281. * @memberOf _
  10282. * @since 0.1.0
  10283. * @category Collection
  10284. * @param {Array|Object} collection The collection to shuffle.
  10285. * @returns {Array} Returns the new shuffled array.
  10286. * @example
  10287. *
  10288. * _.shuffle([1, 2, 3, 4]);
  10289. * // => [4, 1, 3, 2]
  10290. */
  10291. function shuffle(collection) {
  10292. var func = isArray(collection) ? arrayShuffle : baseShuffle;
  10293. return func(collection);
  10294. }
  10295. /**
  10296. * Gets the size of `collection` by returning its length for array-like
  10297. * values or the number of own enumerable string keyed properties for objects.
  10298. *
  10299. * @static
  10300. * @memberOf _
  10301. * @since 0.1.0
  10302. * @category Collection
  10303. * @param {Array|Object|string} collection The collection to inspect.
  10304. * @returns {number} Returns the collection size.
  10305. * @example
  10306. *
  10307. * _.size([1, 2, 3]);
  10308. * // => 3
  10309. *
  10310. * _.size({ 'a': 1, 'b': 2 });
  10311. * // => 2
  10312. *
  10313. * _.size('pebbles');
  10314. * // => 7
  10315. */
  10316. function size(collection) {
  10317. if (collection == null) {
  10318. return 0;
  10319. }
  10320. if (isArrayLike(collection)) {
  10321. return isString(collection) ? stringSize(collection) : collection.length;
  10322. }
  10323. var tag = getTag(collection);
  10324. if (tag == mapTag || tag == setTag) {
  10325. return collection.size;
  10326. }
  10327. return baseKeys(collection).length;
  10328. }
  10329. /**
  10330. * Checks if `predicate` returns truthy for **any** element of `collection`.
  10331. * Iteration is stopped once `predicate` returns truthy. The predicate is
  10332. * invoked with three arguments: (value, index|key, collection).
  10333. *
  10334. * @static
  10335. * @memberOf _
  10336. * @since 0.1.0
  10337. * @category Collection
  10338. * @param {Array|Object} collection The collection to iterate over.
  10339. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  10340. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  10341. * @returns {boolean} Returns `true` if any element passes the predicate check,
  10342. * else `false`.
  10343. * @example
  10344. *
  10345. * _.some([null, 0, 'yes', false], Boolean);
  10346. * // => true
  10347. *
  10348. * var users = [
  10349. * { 'user': 'barney', 'active': true },
  10350. * { 'user': 'fred', 'active': false }
  10351. * ];
  10352. *
  10353. * // The `_.matches` iteratee shorthand.
  10354. * _.some(users, { 'user': 'barney', 'active': false });
  10355. * // => false
  10356. *
  10357. * // The `_.matchesProperty` iteratee shorthand.
  10358. * _.some(users, ['active', false]);
  10359. * // => true
  10360. *
  10361. * // The `_.property` iteratee shorthand.
  10362. * _.some(users, 'active');
  10363. * // => true
  10364. */
  10365. function some(collection, predicate, guard) {
  10366. var func = isArray(collection) ? arraySome : baseSome;
  10367. if (guard && isIterateeCall(collection, predicate, guard)) {
  10368. predicate = undefined;
  10369. }
  10370. return func(collection, getIteratee(predicate, 3));
  10371. }
  10372. /**
  10373. * Creates an array of elements, sorted in ascending order by the results of
  10374. * running each element in a collection thru each iteratee. This method
  10375. * performs a stable sort, that is, it preserves the original sort order of
  10376. * equal elements. The iteratees are invoked with one argument: (value).
  10377. *
  10378. * @static
  10379. * @memberOf _
  10380. * @since 0.1.0
  10381. * @category Collection
  10382. * @param {Array|Object} collection The collection to iterate over.
  10383. * @param {...(Function|Function[])} [iteratees=[_.identity]]
  10384. * The iteratees to sort by.
  10385. * @returns {Array} Returns the new sorted array.
  10386. * @example
  10387. *
  10388. * var users = [
  10389. * { 'user': 'fred', 'age': 48 },
  10390. * { 'user': 'barney', 'age': 36 },
  10391. * { 'user': 'fred', 'age': 30 },
  10392. * { 'user': 'barney', 'age': 34 }
  10393. * ];
  10394. *
  10395. * _.sortBy(users, [function(o) { return o.user; }]);
  10396. * // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 30]]
  10397. *
  10398. * _.sortBy(users, ['user', 'age']);
  10399. * // => objects for [['barney', 34], ['barney', 36], ['fred', 30], ['fred', 48]]
  10400. */
  10401. var sortBy = baseRest(function(collection, iteratees) {
  10402. if (collection == null) {
  10403. return [];
  10404. }
  10405. var length = iteratees.length;
  10406. if (length > 1 && isIterateeCall(collection, iteratees[0], iteratees[1])) {
  10407. iteratees = [];
  10408. } else if (length > 2 && isIterateeCall(iteratees[0], iteratees[1], iteratees[2])) {
  10409. iteratees = [iteratees[0]];
  10410. }
  10411. return baseOrderBy(collection, baseFlatten(iteratees, 1), []);
  10412. });
  10413. /*------------------------------------------------------------------------*/
  10414. /**
  10415. * Gets the timestamp of the number of milliseconds that have elapsed since
  10416. * the Unix epoch (1 January 1970 00:00:00 UTC).
  10417. *
  10418. * @static
  10419. * @memberOf _
  10420. * @since 2.4.0
  10421. * @category Date
  10422. * @returns {number} Returns the timestamp.
  10423. * @example
  10424. *
  10425. * _.defer(function(stamp) {
  10426. * console.log(_.now() - stamp);
  10427. * }, _.now());
  10428. * // => Logs the number of milliseconds it took for the deferred invocation.
  10429. */
  10430. var now = ctxNow || function() {
  10431. return root.Date.now();
  10432. };
  10433. /*------------------------------------------------------------------------*/
  10434. /**
  10435. * The opposite of `_.before`; this method creates a function that invokes
  10436. * `func` once it's called `n` or more times.
  10437. *
  10438. * @static
  10439. * @memberOf _
  10440. * @since 0.1.0
  10441. * @category Function
  10442. * @param {number} n The number of calls before `func` is invoked.
  10443. * @param {Function} func The function to restrict.
  10444. * @returns {Function} Returns the new restricted function.
  10445. * @example
  10446. *
  10447. * var saves = ['profile', 'settings'];
  10448. *
  10449. * var done = _.after(saves.length, function() {
  10450. * console.log('done saving!');
  10451. * });
  10452. *
  10453. * _.forEach(saves, function(type) {
  10454. * asyncSave({ 'type': type, 'complete': done });
  10455. * });
  10456. * // => Logs 'done saving!' after the two async saves have completed.
  10457. */
  10458. function after(n, func) {
  10459. if (typeof func != 'function') {
  10460. throw new TypeError(FUNC_ERROR_TEXT);
  10461. }
  10462. n = toInteger(n);
  10463. return function() {
  10464. if (--n < 1) {
  10465. return func.apply(this, arguments);
  10466. }
  10467. };
  10468. }
  10469. /**
  10470. * Creates a function that invokes `func`, with up to `n` arguments,
  10471. * ignoring any additional arguments.
  10472. *
  10473. * @static
  10474. * @memberOf _
  10475. * @since 3.0.0
  10476. * @category Function
  10477. * @param {Function} func The function to cap arguments for.
  10478. * @param {number} [n=func.length] The arity cap.
  10479. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  10480. * @returns {Function} Returns the new capped function.
  10481. * @example
  10482. *
  10483. * _.map(['6', '8', '10'], _.ary(parseInt, 1));
  10484. * // => [6, 8, 10]
  10485. */
  10486. function ary(func, n, guard) {
  10487. n = guard ? undefined : n;
  10488. n = (func && n == null) ? func.length : n;
  10489. return createWrap(func, WRAP_ARY_FLAG, undefined, undefined, undefined, undefined, n);
  10490. }
  10491. /**
  10492. * Creates a function that invokes `func`, with the `this` binding and arguments
  10493. * of the created function, while it's called less than `n` times. Subsequent
  10494. * calls to the created function return the result of the last `func` invocation.
  10495. *
  10496. * @static
  10497. * @memberOf _
  10498. * @since 3.0.0
  10499. * @category Function
  10500. * @param {number} n The number of calls at which `func` is no longer invoked.
  10501. * @param {Function} func The function to restrict.
  10502. * @returns {Function} Returns the new restricted function.
  10503. * @example
  10504. *
  10505. * jQuery(element).on('click', _.before(5, addContactToList));
  10506. * // => Allows adding up to 4 contacts to the list.
  10507. */
  10508. function before(n, func) {
  10509. var result;
  10510. if (typeof func != 'function') {
  10511. throw new TypeError(FUNC_ERROR_TEXT);
  10512. }
  10513. n = toInteger(n);
  10514. return function() {
  10515. if (--n > 0) {
  10516. result = func.apply(this, arguments);
  10517. }
  10518. if (n <= 1) {
  10519. func = undefined;
  10520. }
  10521. return result;
  10522. };
  10523. }
  10524. /**
  10525. * Creates a function that invokes `func` with the `this` binding of `thisArg`
  10526. * and `partials` prepended to the arguments it receives.
  10527. *
  10528. * The `_.bind.placeholder` value, which defaults to `_` in monolithic builds,
  10529. * may be used as a placeholder for partially applied arguments.
  10530. *
  10531. * **Note:** Unlike native `Function#bind`, this method doesn't set the "length"
  10532. * property of bound functions.
  10533. *
  10534. * @static
  10535. * @memberOf _
  10536. * @since 0.1.0
  10537. * @category Function
  10538. * @param {Function} func The function to bind.
  10539. * @param {*} thisArg The `this` binding of `func`.
  10540. * @param {...*} [partials] The arguments to be partially applied.
  10541. * @returns {Function} Returns the new bound function.
  10542. * @example
  10543. *
  10544. * function greet(greeting, punctuation) {
  10545. * return greeting + ' ' + this.user + punctuation;
  10546. * }
  10547. *
  10548. * var object = { 'user': 'fred' };
  10549. *
  10550. * var bound = _.bind(greet, object, 'hi');
  10551. * bound('!');
  10552. * // => 'hi fred!'
  10553. *
  10554. * // Bound with placeholders.
  10555. * var bound = _.bind(greet, object, _, '!');
  10556. * bound('hi');
  10557. * // => 'hi fred!'
  10558. */
  10559. var bind = baseRest(function(func, thisArg, partials) {
  10560. var bitmask = WRAP_BIND_FLAG;
  10561. if (partials.length) {
  10562. var holders = replaceHolders(partials, getHolder(bind));
  10563. bitmask |= WRAP_PARTIAL_FLAG;
  10564. }
  10565. return createWrap(func, bitmask, thisArg, partials, holders);
  10566. });
  10567. /**
  10568. * Creates a function that invokes the method at `object[key]` with `partials`
  10569. * prepended to the arguments it receives.
  10570. *
  10571. * This method differs from `_.bind` by allowing bound functions to reference
  10572. * methods that may be redefined or don't yet exist. See
  10573. * [Peter Michaux's article](http://peter.michaux.ca/articles/lazy-function-definition-pattern)
  10574. * for more details.
  10575. *
  10576. * The `_.bindKey.placeholder` value, which defaults to `_` in monolithic
  10577. * builds, may be used as a placeholder for partially applied arguments.
  10578. *
  10579. * @static
  10580. * @memberOf _
  10581. * @since 0.10.0
  10582. * @category Function
  10583. * @param {Object} object The object to invoke the method on.
  10584. * @param {string} key The key of the method.
  10585. * @param {...*} [partials] The arguments to be partially applied.
  10586. * @returns {Function} Returns the new bound function.
  10587. * @example
  10588. *
  10589. * var object = {
  10590. * 'user': 'fred',
  10591. * 'greet': function(greeting, punctuation) {
  10592. * return greeting + ' ' + this.user + punctuation;
  10593. * }
  10594. * };
  10595. *
  10596. * var bound = _.bindKey(object, 'greet', 'hi');
  10597. * bound('!');
  10598. * // => 'hi fred!'
  10599. *
  10600. * object.greet = function(greeting, punctuation) {
  10601. * return greeting + 'ya ' + this.user + punctuation;
  10602. * };
  10603. *
  10604. * bound('!');
  10605. * // => 'hiya fred!'
  10606. *
  10607. * // Bound with placeholders.
  10608. * var bound = _.bindKey(object, 'greet', _, '!');
  10609. * bound('hi');
  10610. * // => 'hiya fred!'
  10611. */
  10612. var bindKey = baseRest(function(object, key, partials) {
  10613. var bitmask = WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG;
  10614. if (partials.length) {
  10615. var holders = replaceHolders(partials, getHolder(bindKey));
  10616. bitmask |= WRAP_PARTIAL_FLAG;
  10617. }
  10618. return createWrap(key, bitmask, object, partials, holders);
  10619. });
  10620. /**
  10621. * Creates a function that accepts arguments of `func` and either invokes
  10622. * `func` returning its result, if at least `arity` number of arguments have
  10623. * been provided, or returns a function that accepts the remaining `func`
  10624. * arguments, and so on. The arity of `func` may be specified if `func.length`
  10625. * is not sufficient.
  10626. *
  10627. * The `_.curry.placeholder` value, which defaults to `_` in monolithic builds,
  10628. * may be used as a placeholder for provided arguments.
  10629. *
  10630. * **Note:** This method doesn't set the "length" property of curried functions.
  10631. *
  10632. * @static
  10633. * @memberOf _
  10634. * @since 2.0.0
  10635. * @category Function
  10636. * @param {Function} func The function to curry.
  10637. * @param {number} [arity=func.length] The arity of `func`.
  10638. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  10639. * @returns {Function} Returns the new curried function.
  10640. * @example
  10641. *
  10642. * var abc = function(a, b, c) {
  10643. * return [a, b, c];
  10644. * };
  10645. *
  10646. * var curried = _.curry(abc);
  10647. *
  10648. * curried(1)(2)(3);
  10649. * // => [1, 2, 3]
  10650. *
  10651. * curried(1, 2)(3);
  10652. * // => [1, 2, 3]
  10653. *
  10654. * curried(1, 2, 3);
  10655. * // => [1, 2, 3]
  10656. *
  10657. * // Curried with placeholders.
  10658. * curried(1)(_, 3)(2);
  10659. * // => [1, 2, 3]
  10660. */
  10661. function curry(func, arity, guard) {
  10662. arity = guard ? undefined : arity;
  10663. var result = createWrap(func, WRAP_CURRY_FLAG, undefined, undefined, undefined, undefined, undefined, arity);
  10664. result.placeholder = curry.placeholder;
  10665. return result;
  10666. }
  10667. /**
  10668. * This method is like `_.curry` except that arguments are applied to `func`
  10669. * in the manner of `_.partialRight` instead of `_.partial`.
  10670. *
  10671. * The `_.curryRight.placeholder` value, which defaults to `_` in monolithic
  10672. * builds, may be used as a placeholder for provided arguments.
  10673. *
  10674. * **Note:** This method doesn't set the "length" property of curried functions.
  10675. *
  10676. * @static
  10677. * @memberOf _
  10678. * @since 3.0.0
  10679. * @category Function
  10680. * @param {Function} func The function to curry.
  10681. * @param {number} [arity=func.length] The arity of `func`.
  10682. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  10683. * @returns {Function} Returns the new curried function.
  10684. * @example
  10685. *
  10686. * var abc = function(a, b, c) {
  10687. * return [a, b, c];
  10688. * };
  10689. *
  10690. * var curried = _.curryRight(abc);
  10691. *
  10692. * curried(3)(2)(1);
  10693. * // => [1, 2, 3]
  10694. *
  10695. * curried(2, 3)(1);
  10696. * // => [1, 2, 3]
  10697. *
  10698. * curried(1, 2, 3);
  10699. * // => [1, 2, 3]
  10700. *
  10701. * // Curried with placeholders.
  10702. * curried(3)(1, _)(2);
  10703. * // => [1, 2, 3]
  10704. */
  10705. function curryRight(func, arity, guard) {
  10706. arity = guard ? undefined : arity;
  10707. var result = createWrap(func, WRAP_CURRY_RIGHT_FLAG, undefined, undefined, undefined, undefined, undefined, arity);
  10708. result.placeholder = curryRight.placeholder;
  10709. return result;
  10710. }
  10711. /**
  10712. * Creates a debounced function that delays invoking `func` until after `wait`
  10713. * milliseconds have elapsed since the last time the debounced function was
  10714. * invoked. The debounced function comes with a `cancel` method to cancel
  10715. * delayed `func` invocations and a `flush` method to immediately invoke them.
  10716. * Provide `options` to indicate whether `func` should be invoked on the
  10717. * leading and/or trailing edge of the `wait` timeout. The `func` is invoked
  10718. * with the last arguments provided to the debounced function. Subsequent
  10719. * calls to the debounced function return the result of the last `func`
  10720. * invocation.
  10721. *
  10722. * **Note:** If `leading` and `trailing` options are `true`, `func` is
  10723. * invoked on the trailing edge of the timeout only if the debounced function
  10724. * is invoked more than once during the `wait` timeout.
  10725. *
  10726. * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred
  10727. * until to the next tick, similar to `setTimeout` with a timeout of `0`.
  10728. *
  10729. * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/)
  10730. * for details over the differences between `_.debounce` and `_.throttle`.
  10731. *
  10732. * @static
  10733. * @memberOf _
  10734. * @since 0.1.0
  10735. * @category Function
  10736. * @param {Function} func The function to debounce.
  10737. * @param {number} [wait=0] The number of milliseconds to delay.
  10738. * @param {Object} [options={}] The options object.
  10739. * @param {boolean} [options.leading=false]
  10740. * Specify invoking on the leading edge of the timeout.
  10741. * @param {number} [options.maxWait]
  10742. * The maximum time `func` is allowed to be delayed before it's invoked.
  10743. * @param {boolean} [options.trailing=true]
  10744. * Specify invoking on the trailing edge of the timeout.
  10745. * @returns {Function} Returns the new debounced function.
  10746. * @example
  10747. *
  10748. * // Avoid costly calculations while the window size is in flux.
  10749. * jQuery(window).on('resize', _.debounce(calculateLayout, 150));
  10750. *
  10751. * // Invoke `sendMail` when clicked, debouncing subsequent calls.
  10752. * jQuery(element).on('click', _.debounce(sendMail, 300, {
  10753. * 'leading': true,
  10754. * 'trailing': false
  10755. * }));
  10756. *
  10757. * // Ensure `batchLog` is invoked once after 1 second of debounced calls.
  10758. * var debounced = _.debounce(batchLog, 250, { 'maxWait': 1000 });
  10759. * var source = new EventSource('/stream');
  10760. * jQuery(source).on('message', debounced);
  10761. *
  10762. * // Cancel the trailing debounced invocation.
  10763. * jQuery(window).on('popstate', debounced.cancel);
  10764. */
  10765. function debounce(func, wait, options) {
  10766. var lastArgs,
  10767. lastThis,
  10768. maxWait,
  10769. result,
  10770. timerId,
  10771. lastCallTime,
  10772. lastInvokeTime = 0,
  10773. leading = false,
  10774. maxing = false,
  10775. trailing = true;
  10776. if (typeof func != 'function') {
  10777. throw new TypeError(FUNC_ERROR_TEXT);
  10778. }
  10779. wait = toNumber(wait) || 0;
  10780. if (isObject(options)) {
  10781. leading = !!options.leading;
  10782. maxing = 'maxWait' in options;
  10783. maxWait = maxing ? nativeMax(toNumber(options.maxWait) || 0, wait) : maxWait;
  10784. trailing = 'trailing' in options ? !!options.trailing : trailing;
  10785. }
  10786. function invokeFunc(time) {
  10787. var args = lastArgs,
  10788. thisArg = lastThis;
  10789. lastArgs = lastThis = undefined;
  10790. lastInvokeTime = time;
  10791. result = func.apply(thisArg, args);
  10792. return result;
  10793. }
  10794. function leadingEdge(time) {
  10795. // Reset any `maxWait` timer.
  10796. lastInvokeTime = time;
  10797. // Start the timer for the trailing edge.
  10798. timerId = setTimeout(timerExpired, wait);
  10799. // Invoke the leading edge.
  10800. return leading ? invokeFunc(time) : result;
  10801. }
  10802. function remainingWait(time) {
  10803. var timeSinceLastCall = time - lastCallTime,
  10804. timeSinceLastInvoke = time - lastInvokeTime,
  10805. timeWaiting = wait - timeSinceLastCall;
  10806. return maxing
  10807. ? nativeMin(timeWaiting, maxWait - timeSinceLastInvoke)
  10808. : timeWaiting;
  10809. }
  10810. function shouldInvoke(time) {
  10811. var timeSinceLastCall = time - lastCallTime,
  10812. timeSinceLastInvoke = time - lastInvokeTime;
  10813. // Either this is the first call, activity has stopped and we're at the
  10814. // trailing edge, the system time has gone backwards and we're treating
  10815. // it as the trailing edge, or we've hit the `maxWait` limit.
  10816. return (lastCallTime === undefined || (timeSinceLastCall >= wait) ||
  10817. (timeSinceLastCall < 0) || (maxing && timeSinceLastInvoke >= maxWait));
  10818. }
  10819. function timerExpired() {
  10820. var time = now();
  10821. if (shouldInvoke(time)) {
  10822. return trailingEdge(time);
  10823. }
  10824. // Restart the timer.
  10825. timerId = setTimeout(timerExpired, remainingWait(time));
  10826. }
  10827. function trailingEdge(time) {
  10828. timerId = undefined;
  10829. // Only invoke if we have `lastArgs` which means `func` has been
  10830. // debounced at least once.
  10831. if (trailing && lastArgs) {
  10832. return invokeFunc(time);
  10833. }
  10834. lastArgs = lastThis = undefined;
  10835. return result;
  10836. }
  10837. function cancel() {
  10838. if (timerId !== undefined) {
  10839. clearTimeout(timerId);
  10840. }
  10841. lastInvokeTime = 0;
  10842. lastArgs = lastCallTime = lastThis = timerId = undefined;
  10843. }
  10844. function flush() {
  10845. return timerId === undefined ? result : trailingEdge(now());
  10846. }
  10847. function debounced() {
  10848. var time = now(),
  10849. isInvoking = shouldInvoke(time);
  10850. lastArgs = arguments;
  10851. lastThis = this;
  10852. lastCallTime = time;
  10853. if (isInvoking) {
  10854. if (timerId === undefined) {
  10855. return leadingEdge(lastCallTime);
  10856. }
  10857. if (maxing) {
  10858. // Handle invocations in a tight loop.
  10859. clearTimeout(timerId);
  10860. timerId = setTimeout(timerExpired, wait);
  10861. return invokeFunc(lastCallTime);
  10862. }
  10863. }
  10864. if (timerId === undefined) {
  10865. timerId = setTimeout(timerExpired, wait);
  10866. }
  10867. return result;
  10868. }
  10869. debounced.cancel = cancel;
  10870. debounced.flush = flush;
  10871. return debounced;
  10872. }
  10873. /**
  10874. * Defers invoking the `func` until the current call stack has cleared. Any
  10875. * additional arguments are provided to `func` when it's invoked.
  10876. *
  10877. * @static
  10878. * @memberOf _
  10879. * @since 0.1.0
  10880. * @category Function
  10881. * @param {Function} func The function to defer.
  10882. * @param {...*} [args] The arguments to invoke `func` with.
  10883. * @returns {number} Returns the timer id.
  10884. * @example
  10885. *
  10886. * _.defer(function(text) {
  10887. * console.log(text);
  10888. * }, 'deferred');
  10889. * // => Logs 'deferred' after one millisecond.
  10890. */
  10891. var defer = baseRest(function(func, args) {
  10892. return baseDelay(func, 1, args);
  10893. });
  10894. /**
  10895. * Invokes `func` after `wait` milliseconds. Any additional arguments are
  10896. * provided to `func` when it's invoked.
  10897. *
  10898. * @static
  10899. * @memberOf _
  10900. * @since 0.1.0
  10901. * @category Function
  10902. * @param {Function} func The function to delay.
  10903. * @param {number} wait The number of milliseconds to delay invocation.
  10904. * @param {...*} [args] The arguments to invoke `func` with.
  10905. * @returns {number} Returns the timer id.
  10906. * @example
  10907. *
  10908. * _.delay(function(text) {
  10909. * console.log(text);
  10910. * }, 1000, 'later');
  10911. * // => Logs 'later' after one second.
  10912. */
  10913. var delay = baseRest(function(func, wait, args) {
  10914. return baseDelay(func, toNumber(wait) || 0, args);
  10915. });
  10916. /**
  10917. * Creates a function that invokes `func` with arguments reversed.
  10918. *
  10919. * @static
  10920. * @memberOf _
  10921. * @since 4.0.0
  10922. * @category Function
  10923. * @param {Function} func The function to flip arguments for.
  10924. * @returns {Function} Returns the new flipped function.
  10925. * @example
  10926. *
  10927. * var flipped = _.flip(function() {
  10928. * return _.toArray(arguments);
  10929. * });
  10930. *
  10931. * flipped('a', 'b', 'c', 'd');
  10932. * // => ['d', 'c', 'b', 'a']
  10933. */
  10934. function flip(func) {
  10935. return createWrap(func, WRAP_FLIP_FLAG);
  10936. }
  10937. /**
  10938. * Creates a function that memoizes the result of `func`. If `resolver` is
  10939. * provided, it determines the cache key for storing the result based on the
  10940. * arguments provided to the memoized function. By default, the first argument
  10941. * provided to the memoized function is used as the map cache key. The `func`
  10942. * is invoked with the `this` binding of the memoized function.
  10943. *
  10944. * **Note:** The cache is exposed as the `cache` property on the memoized
  10945. * function. Its creation may be customized by replacing the `_.memoize.Cache`
  10946. * constructor with one whose instances implement the
  10947. * [`Map`](http://ecma-international.org/ecma-262/7.0/#sec-properties-of-the-map-prototype-object)
  10948. * method interface of `clear`, `delete`, `get`, `has`, and `set`.
  10949. *
  10950. * @static
  10951. * @memberOf _
  10952. * @since 0.1.0
  10953. * @category Function
  10954. * @param {Function} func The function to have its output memoized.
  10955. * @param {Function} [resolver] The function to resolve the cache key.
  10956. * @returns {Function} Returns the new memoized function.
  10957. * @example
  10958. *
  10959. * var object = { 'a': 1, 'b': 2 };
  10960. * var other = { 'c': 3, 'd': 4 };
  10961. *
  10962. * var values = _.memoize(_.values);
  10963. * values(object);
  10964. * // => [1, 2]
  10965. *
  10966. * values(other);
  10967. * // => [3, 4]
  10968. *
  10969. * object.a = 2;
  10970. * values(object);
  10971. * // => [1, 2]
  10972. *
  10973. * // Modify the result cache.
  10974. * values.cache.set(object, ['a', 'b']);
  10975. * values(object);
  10976. * // => ['a', 'b']
  10977. *
  10978. * // Replace `_.memoize.Cache`.
  10979. * _.memoize.Cache = WeakMap;
  10980. */
  10981. function memoize(func, resolver) {
  10982. if (typeof func != 'function' || (resolver != null && typeof resolver != 'function')) {
  10983. throw new TypeError(FUNC_ERROR_TEXT);
  10984. }
  10985. var memoized = function() {
  10986. var args = arguments,
  10987. key = resolver ? resolver.apply(this, args) : args[0],
  10988. cache = memoized.cache;
  10989. if (cache.has(key)) {
  10990. return cache.get(key);
  10991. }
  10992. var result = func.apply(this, args);
  10993. memoized.cache = cache.set(key, result) || cache;
  10994. return result;
  10995. };
  10996. memoized.cache = new (memoize.Cache || MapCache);
  10997. return memoized;
  10998. }
  10999. // Expose `MapCache`.
  11000. memoize.Cache = MapCache;
  11001. /**
  11002. * Creates a function that negates the result of the predicate `func`. The
  11003. * `func` predicate is invoked with the `this` binding and arguments of the
  11004. * created function.
  11005. *
  11006. * @static
  11007. * @memberOf _
  11008. * @since 3.0.0
  11009. * @category Function
  11010. * @param {Function} predicate The predicate to negate.
  11011. * @returns {Function} Returns the new negated function.
  11012. * @example
  11013. *
  11014. * function isEven(n) {
  11015. * return n % 2 == 0;
  11016. * }
  11017. *
  11018. * _.filter([1, 2, 3, 4, 5, 6], _.negate(isEven));
  11019. * // => [1, 3, 5]
  11020. */
  11021. function negate(predicate) {
  11022. if (typeof predicate != 'function') {
  11023. throw new TypeError(FUNC_ERROR_TEXT);
  11024. }
  11025. return function() {
  11026. var args = arguments;
  11027. switch (args.length) {
  11028. case 0: return !predicate.call(this);
  11029. case 1: return !predicate.call(this, args[0]);
  11030. case 2: return !predicate.call(this, args[0], args[1]);
  11031. case 3: return !predicate.call(this, args[0], args[1], args[2]);
  11032. }
  11033. return !predicate.apply(this, args);
  11034. };
  11035. }
  11036. /**
  11037. * Creates a function that is restricted to invoking `func` once. Repeat calls
  11038. * to the function return the value of the first invocation. The `func` is
  11039. * invoked with the `this` binding and arguments of the created function.
  11040. *
  11041. * @static
  11042. * @memberOf _
  11043. * @since 0.1.0
  11044. * @category Function
  11045. * @param {Function} func The function to restrict.
  11046. * @returns {Function} Returns the new restricted function.
  11047. * @example
  11048. *
  11049. * var initialize = _.once(createApplication);
  11050. * initialize();
  11051. * initialize();
  11052. * // => `createApplication` is invoked once
  11053. */
  11054. function once(func) {
  11055. return before(2, func);
  11056. }
  11057. /**
  11058. * Creates a function that invokes `func` with its arguments transformed.
  11059. *
  11060. * @static
  11061. * @since 4.0.0
  11062. * @memberOf _
  11063. * @category Function
  11064. * @param {Function} func The function to wrap.
  11065. * @param {...(Function|Function[])} [transforms=[_.identity]]
  11066. * The argument transforms.
  11067. * @returns {Function} Returns the new function.
  11068. * @example
  11069. *
  11070. * function doubled(n) {
  11071. * return n * 2;
  11072. * }
  11073. *
  11074. * function square(n) {
  11075. * return n * n;
  11076. * }
  11077. *
  11078. * var func = _.overArgs(function(x, y) {
  11079. * return [x, y];
  11080. * }, [square, doubled]);
  11081. *
  11082. * func(9, 3);
  11083. * // => [81, 6]
  11084. *
  11085. * func(10, 5);
  11086. * // => [100, 10]
  11087. */
  11088. var overArgs = castRest(function(func, transforms) {
  11089. transforms = (transforms.length == 1 && isArray(transforms[0]))
  11090. ? arrayMap(transforms[0], baseUnary(getIteratee()))
  11091. : arrayMap(baseFlatten(transforms, 1), baseUnary(getIteratee()));
  11092. var funcsLength = transforms.length;
  11093. return baseRest(function(args) {
  11094. var index = -1,
  11095. length = nativeMin(args.length, funcsLength);
  11096. while (++index < length) {
  11097. args[index] = transforms[index].call(this, args[index]);
  11098. }
  11099. return apply(func, this, args);
  11100. });
  11101. });
  11102. /**
  11103. * Creates a function that invokes `func` with `partials` prepended to the
  11104. * arguments it receives. This method is like `_.bind` except it does **not**
  11105. * alter the `this` binding.
  11106. *
  11107. * The `_.partial.placeholder` value, which defaults to `_` in monolithic
  11108. * builds, may be used as a placeholder for partially applied arguments.
  11109. *
  11110. * **Note:** This method doesn't set the "length" property of partially
  11111. * applied functions.
  11112. *
  11113. * @static
  11114. * @memberOf _
  11115. * @since 0.2.0
  11116. * @category Function
  11117. * @param {Function} func The function to partially apply arguments to.
  11118. * @param {...*} [partials] The arguments to be partially applied.
  11119. * @returns {Function} Returns the new partially applied function.
  11120. * @example
  11121. *
  11122. * function greet(greeting, name) {
  11123. * return greeting + ' ' + name;
  11124. * }
  11125. *
  11126. * var sayHelloTo = _.partial(greet, 'hello');
  11127. * sayHelloTo('fred');
  11128. * // => 'hello fred'
  11129. *
  11130. * // Partially applied with placeholders.
  11131. * var greetFred = _.partial(greet, _, 'fred');
  11132. * greetFred('hi');
  11133. * // => 'hi fred'
  11134. */
  11135. var partial = baseRest(function(func, partials) {
  11136. var holders = replaceHolders(partials, getHolder(partial));
  11137. return createWrap(func, WRAP_PARTIAL_FLAG, undefined, partials, holders);
  11138. });
  11139. /**
  11140. * This method is like `_.partial` except that partially applied arguments
  11141. * are appended to the arguments it receives.
  11142. *
  11143. * The `_.partialRight.placeholder` value, which defaults to `_` in monolithic
  11144. * builds, may be used as a placeholder for partially applied arguments.
  11145. *
  11146. * **Note:** This method doesn't set the "length" property of partially
  11147. * applied functions.
  11148. *
  11149. * @static
  11150. * @memberOf _
  11151. * @since 1.0.0
  11152. * @category Function
  11153. * @param {Function} func The function to partially apply arguments to.
  11154. * @param {...*} [partials] The arguments to be partially applied.
  11155. * @returns {Function} Returns the new partially applied function.
  11156. * @example
  11157. *
  11158. * function greet(greeting, name) {
  11159. * return greeting + ' ' + name;
  11160. * }
  11161. *
  11162. * var greetFred = _.partialRight(greet, 'fred');
  11163. * greetFred('hi');
  11164. * // => 'hi fred'
  11165. *
  11166. * // Partially applied with placeholders.
  11167. * var sayHelloTo = _.partialRight(greet, 'hello', _);
  11168. * sayHelloTo('fred');
  11169. * // => 'hello fred'
  11170. */
  11171. var partialRight = baseRest(function(func, partials) {
  11172. var holders = replaceHolders(partials, getHolder(partialRight));
  11173. return createWrap(func, WRAP_PARTIAL_RIGHT_FLAG, undefined, partials, holders);
  11174. });
  11175. /**
  11176. * Creates a function that invokes `func` with arguments arranged according
  11177. * to the specified `indexes` where the argument value at the first index is
  11178. * provided as the first argument, the argument value at the second index is
  11179. * provided as the second argument, and so on.
  11180. *
  11181. * @static
  11182. * @memberOf _
  11183. * @since 3.0.0
  11184. * @category Function
  11185. * @param {Function} func The function to rearrange arguments for.
  11186. * @param {...(number|number[])} indexes The arranged argument indexes.
  11187. * @returns {Function} Returns the new function.
  11188. * @example
  11189. *
  11190. * var rearged = _.rearg(function(a, b, c) {
  11191. * return [a, b, c];
  11192. * }, [2, 0, 1]);
  11193. *
  11194. * rearged('b', 'c', 'a')
  11195. * // => ['a', 'b', 'c']
  11196. */
  11197. var rearg = flatRest(function(func, indexes) {
  11198. return createWrap(func, WRAP_REARG_FLAG, undefined, undefined, undefined, indexes);
  11199. });
  11200. /**
  11201. * Creates a function that invokes `func` with the `this` binding of the
  11202. * created function and arguments from `start` and beyond provided as
  11203. * an array.
  11204. *
  11205. * **Note:** This method is based on the
  11206. * [rest parameter](https://mdn.io/rest_parameters).
  11207. *
  11208. * @static
  11209. * @memberOf _
  11210. * @since 4.0.0
  11211. * @category Function
  11212. * @param {Function} func The function to apply a rest parameter to.
  11213. * @param {number} [start=func.length-1] The start position of the rest parameter.
  11214. * @returns {Function} Returns the new function.
  11215. * @example
  11216. *
  11217. * var say = _.rest(function(what, names) {
  11218. * return what + ' ' + _.initial(names).join(', ') +
  11219. * (_.size(names) > 1 ? ', & ' : '') + _.last(names);
  11220. * });
  11221. *
  11222. * say('hello', 'fred', 'barney', 'pebbles');
  11223. * // => 'hello fred, barney, & pebbles'
  11224. */
  11225. function rest(func, start) {
  11226. if (typeof func != 'function') {
  11227. throw new TypeError(FUNC_ERROR_TEXT);
  11228. }
  11229. start = start === undefined ? start : toInteger(start);
  11230. return baseRest(func, start);
  11231. }
  11232. /**
  11233. * Creates a function that invokes `func` with the `this` binding of the
  11234. * create function and an array of arguments much like
  11235. * [`Function#apply`](http://www.ecma-international.org/ecma-262/7.0/#sec-function.prototype.apply).
  11236. *
  11237. * **Note:** This method is based on the
  11238. * [spread operator](https://mdn.io/spread_operator).
  11239. *
  11240. * @static
  11241. * @memberOf _
  11242. * @since 3.2.0
  11243. * @category Function
  11244. * @param {Function} func The function to spread arguments over.
  11245. * @param {number} [start=0] The start position of the spread.
  11246. * @returns {Function} Returns the new function.
  11247. * @example
  11248. *
  11249. * var say = _.spread(function(who, what) {
  11250. * return who + ' says ' + what;
  11251. * });
  11252. *
  11253. * say(['fred', 'hello']);
  11254. * // => 'fred says hello'
  11255. *
  11256. * var numbers = Promise.all([
  11257. * Promise.resolve(40),
  11258. * Promise.resolve(36)
  11259. * ]);
  11260. *
  11261. * numbers.then(_.spread(function(x, y) {
  11262. * return x + y;
  11263. * }));
  11264. * // => a Promise of 76
  11265. */
  11266. function spread(func, start) {
  11267. if (typeof func != 'function') {
  11268. throw new TypeError(FUNC_ERROR_TEXT);
  11269. }
  11270. start = start == null ? 0 : nativeMax(toInteger(start), 0);
  11271. return baseRest(function(args) {
  11272. var array = args[start],
  11273. otherArgs = castSlice(args, 0, start);
  11274. if (array) {
  11275. arrayPush(otherArgs, array);
  11276. }
  11277. return apply(func, this, otherArgs);
  11278. });
  11279. }
  11280. /**
  11281. * Creates a throttled function that only invokes `func` at most once per
  11282. * every `wait` milliseconds. The throttled function comes with a `cancel`
  11283. * method to cancel delayed `func` invocations and a `flush` method to
  11284. * immediately invoke them. Provide `options` to indicate whether `func`
  11285. * should be invoked on the leading and/or trailing edge of the `wait`
  11286. * timeout. The `func` is invoked with the last arguments provided to the
  11287. * throttled function. Subsequent calls to the throttled function return the
  11288. * result of the last `func` invocation.
  11289. *
  11290. * **Note:** If `leading` and `trailing` options are `true`, `func` is
  11291. * invoked on the trailing edge of the timeout only if the throttled function
  11292. * is invoked more than once during the `wait` timeout.
  11293. *
  11294. * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred
  11295. * until to the next tick, similar to `setTimeout` with a timeout of `0`.
  11296. *
  11297. * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/)
  11298. * for details over the differences between `_.throttle` and `_.debounce`.
  11299. *
  11300. * @static
  11301. * @memberOf _
  11302. * @since 0.1.0
  11303. * @category Function
  11304. * @param {Function} func The function to throttle.
  11305. * @param {number} [wait=0] The number of milliseconds to throttle invocations to.
  11306. * @param {Object} [options={}] The options object.
  11307. * @param {boolean} [options.leading=true]
  11308. * Specify invoking on the leading edge of the timeout.
  11309. * @param {boolean} [options.trailing=true]
  11310. * Specify invoking on the trailing edge of the timeout.
  11311. * @returns {Function} Returns the new throttled function.
  11312. * @example
  11313. *
  11314. * // Avoid excessively updating the position while scrolling.
  11315. * jQuery(window).on('scroll', _.throttle(updatePosition, 100));
  11316. *
  11317. * // Invoke `renewToken` when the click event is fired, but not more than once every 5 minutes.
  11318. * var throttled = _.throttle(renewToken, 300000, { 'trailing': false });
  11319. * jQuery(element).on('click', throttled);
  11320. *
  11321. * // Cancel the trailing throttled invocation.
  11322. * jQuery(window).on('popstate', throttled.cancel);
  11323. */
  11324. function throttle(func, wait, options) {
  11325. var leading = true,
  11326. trailing = true;
  11327. if (typeof func != 'function') {
  11328. throw new TypeError(FUNC_ERROR_TEXT);
  11329. }
  11330. if (isObject(options)) {
  11331. leading = 'leading' in options ? !!options.leading : leading;
  11332. trailing = 'trailing' in options ? !!options.trailing : trailing;
  11333. }
  11334. return debounce(func, wait, {
  11335. 'leading': leading,
  11336. 'maxWait': wait,
  11337. 'trailing': trailing
  11338. });
  11339. }
  11340. /**
  11341. * Creates a function that accepts up to one argument, ignoring any
  11342. * additional arguments.
  11343. *
  11344. * @static
  11345. * @memberOf _
  11346. * @since 4.0.0
  11347. * @category Function
  11348. * @param {Function} func The function to cap arguments for.
  11349. * @returns {Function} Returns the new capped function.
  11350. * @example
  11351. *
  11352. * _.map(['6', '8', '10'], _.unary(parseInt));
  11353. * // => [6, 8, 10]
  11354. */
  11355. function unary(func) {
  11356. return ary(func, 1);
  11357. }
  11358. /**
  11359. * Creates a function that provides `value` to `wrapper` as its first
  11360. * argument. Any additional arguments provided to the function are appended
  11361. * to those provided to the `wrapper`. The wrapper is invoked with the `this`
  11362. * binding of the created function.
  11363. *
  11364. * @static
  11365. * @memberOf _
  11366. * @since 0.1.0
  11367. * @category Function
  11368. * @param {*} value The value to wrap.
  11369. * @param {Function} [wrapper=identity] The wrapper function.
  11370. * @returns {Function} Returns the new function.
  11371. * @example
  11372. *
  11373. * var p = _.wrap(_.escape, function(func, text) {
  11374. * return '<p>' + func(text) + '</p>';
  11375. * });
  11376. *
  11377. * p('fred, barney, & pebbles');
  11378. * // => '<p>fred, barney, &amp; pebbles</p>'
  11379. */
  11380. function wrap(value, wrapper) {
  11381. return partial(castFunction(wrapper), value);
  11382. }
  11383. /*------------------------------------------------------------------------*/
  11384. /**
  11385. * Casts `value` as an array if it's not one.
  11386. *
  11387. * @static
  11388. * @memberOf _
  11389. * @since 4.4.0
  11390. * @category Lang
  11391. * @param {*} value The value to inspect.
  11392. * @returns {Array} Returns the cast array.
  11393. * @example
  11394. *
  11395. * _.castArray(1);
  11396. * // => [1]
  11397. *
  11398. * _.castArray({ 'a': 1 });
  11399. * // => [{ 'a': 1 }]
  11400. *
  11401. * _.castArray('abc');
  11402. * // => ['abc']
  11403. *
  11404. * _.castArray(null);
  11405. * // => [null]
  11406. *
  11407. * _.castArray(undefined);
  11408. * // => [undefined]
  11409. *
  11410. * _.castArray();
  11411. * // => []
  11412. *
  11413. * var array = [1, 2, 3];
  11414. * console.log(_.castArray(array) === array);
  11415. * // => true
  11416. */
  11417. function castArray() {
  11418. if (!arguments.length) {
  11419. return [];
  11420. }
  11421. var value = arguments[0];
  11422. return isArray(value) ? value : [value];
  11423. }
  11424. /**
  11425. * Creates a shallow clone of `value`.
  11426. *
  11427. * **Note:** This method is loosely based on the
  11428. * [structured clone algorithm](https://mdn.io/Structured_clone_algorithm)
  11429. * and supports cloning arrays, array buffers, booleans, date objects, maps,
  11430. * numbers, `Object` objects, regexes, sets, strings, symbols, and typed
  11431. * arrays. The own enumerable properties of `arguments` objects are cloned
  11432. * as plain objects. An empty object is returned for uncloneable values such
  11433. * as error objects, functions, DOM nodes, and WeakMaps.
  11434. *
  11435. * @static
  11436. * @memberOf _
  11437. * @since 0.1.0
  11438. * @category Lang
  11439. * @param {*} value The value to clone.
  11440. * @returns {*} Returns the cloned value.
  11441. * @see _.cloneDeep
  11442. * @example
  11443. *
  11444. * var objects = [{ 'a': 1 }, { 'b': 2 }];
  11445. *
  11446. * var shallow = _.clone(objects);
  11447. * console.log(shallow[0] === objects[0]);
  11448. * // => true
  11449. */
  11450. function clone(value) {
  11451. return baseClone(value, CLONE_SYMBOLS_FLAG);
  11452. }
  11453. /**
  11454. * This method is like `_.clone` except that it accepts `customizer` which
  11455. * is invoked to produce the cloned value. If `customizer` returns `undefined`,
  11456. * cloning is handled by the method instead. The `customizer` is invoked with
  11457. * up to four arguments; (value [, index|key, object, stack]).
  11458. *
  11459. * @static
  11460. * @memberOf _
  11461. * @since 4.0.0
  11462. * @category Lang
  11463. * @param {*} value The value to clone.
  11464. * @param {Function} [customizer] The function to customize cloning.
  11465. * @returns {*} Returns the cloned value.
  11466. * @see _.cloneDeepWith
  11467. * @example
  11468. *
  11469. * function customizer(value) {
  11470. * if (_.isElement(value)) {
  11471. * return value.cloneNode(false);
  11472. * }
  11473. * }
  11474. *
  11475. * var el = _.cloneWith(document.body, customizer);
  11476. *
  11477. * console.log(el === document.body);
  11478. * // => false
  11479. * console.log(el.nodeName);
  11480. * // => 'BODY'
  11481. * console.log(el.childNodes.length);
  11482. * // => 0
  11483. */
  11484. function cloneWith(value, customizer) {
  11485. customizer = typeof customizer == 'function' ? customizer : undefined;
  11486. return baseClone(value, CLONE_SYMBOLS_FLAG, customizer);
  11487. }
  11488. /**
  11489. * This method is like `_.clone` except that it recursively clones `value`.
  11490. *
  11491. * @static
  11492. * @memberOf _
  11493. * @since 1.0.0
  11494. * @category Lang
  11495. * @param {*} value The value to recursively clone.
  11496. * @returns {*} Returns the deep cloned value.
  11497. * @see _.clone
  11498. * @example
  11499. *
  11500. * var objects = [{ 'a': 1 }, { 'b': 2 }];
  11501. *
  11502. * var deep = _.cloneDeep(objects);
  11503. * console.log(deep[0] === objects[0]);
  11504. * // => false
  11505. */
  11506. function cloneDeep(value) {
  11507. return baseClone(value, CLONE_DEEP_FLAG | CLONE_SYMBOLS_FLAG);
  11508. }
  11509. /**
  11510. * This method is like `_.cloneWith` except that it recursively clones `value`.
  11511. *
  11512. * @static
  11513. * @memberOf _
  11514. * @since 4.0.0
  11515. * @category Lang
  11516. * @param {*} value The value to recursively clone.
  11517. * @param {Function} [customizer] The function to customize cloning.
  11518. * @returns {*} Returns the deep cloned value.
  11519. * @see _.cloneWith
  11520. * @example
  11521. *
  11522. * function customizer(value) {
  11523. * if (_.isElement(value)) {
  11524. * return value.cloneNode(true);
  11525. * }
  11526. * }
  11527. *
  11528. * var el = _.cloneDeepWith(document.body, customizer);
  11529. *
  11530. * console.log(el === document.body);
  11531. * // => false
  11532. * console.log(el.nodeName);
  11533. * // => 'BODY'
  11534. * console.log(el.childNodes.length);
  11535. * // => 20
  11536. */
  11537. function cloneDeepWith(value, customizer) {
  11538. customizer = typeof customizer == 'function' ? customizer : undefined;
  11539. return baseClone(value, CLONE_DEEP_FLAG | CLONE_SYMBOLS_FLAG, customizer);
  11540. }
  11541. /**
  11542. * Checks if `object` conforms to `source` by invoking the predicate
  11543. * properties of `source` with the corresponding property values of `object`.
  11544. *
  11545. * **Note:** This method is equivalent to `_.conforms` when `source` is
  11546. * partially applied.
  11547. *
  11548. * @static
  11549. * @memberOf _
  11550. * @since 4.14.0
  11551. * @category Lang
  11552. * @param {Object} object The object to inspect.
  11553. * @param {Object} source The object of property predicates to conform to.
  11554. * @returns {boolean} Returns `true` if `object` conforms, else `false`.
  11555. * @example
  11556. *
  11557. * var object = { 'a': 1, 'b': 2 };
  11558. *
  11559. * _.conformsTo(object, { 'b': function(n) { return n > 1; } });
  11560. * // => true
  11561. *
  11562. * _.conformsTo(object, { 'b': function(n) { return n > 2; } });
  11563. * // => false
  11564. */
  11565. function conformsTo(object, source) {
  11566. return source == null || baseConformsTo(object, source, keys(source));
  11567. }
  11568. /**
  11569. * Performs a
  11570. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  11571. * comparison between two values to determine if they are equivalent.
  11572. *
  11573. * @static
  11574. * @memberOf _
  11575. * @since 4.0.0
  11576. * @category Lang
  11577. * @param {*} value The value to compare.
  11578. * @param {*} other The other value to compare.
  11579. * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
  11580. * @example
  11581. *
  11582. * var object = { 'a': 1 };
  11583. * var other = { 'a': 1 };
  11584. *
  11585. * _.eq(object, object);
  11586. * // => true
  11587. *
  11588. * _.eq(object, other);
  11589. * // => false
  11590. *
  11591. * _.eq('a', 'a');
  11592. * // => true
  11593. *
  11594. * _.eq('a', Object('a'));
  11595. * // => false
  11596. *
  11597. * _.eq(NaN, NaN);
  11598. * // => true
  11599. */
  11600. function eq(value, other) {
  11601. return value === other || (value !== value && other !== other);
  11602. }
  11603. /**
  11604. * Checks if `value` is greater than `other`.
  11605. *
  11606. * @static
  11607. * @memberOf _
  11608. * @since 3.9.0
  11609. * @category Lang
  11610. * @param {*} value The value to compare.
  11611. * @param {*} other The other value to compare.
  11612. * @returns {boolean} Returns `true` if `value` is greater than `other`,
  11613. * else `false`.
  11614. * @see _.lt
  11615. * @example
  11616. *
  11617. * _.gt(3, 1);
  11618. * // => true
  11619. *
  11620. * _.gt(3, 3);
  11621. * // => false
  11622. *
  11623. * _.gt(1, 3);
  11624. * // => false
  11625. */
  11626. var gt = createRelationalOperation(baseGt);
  11627. /**
  11628. * Checks if `value` is greater than or equal to `other`.
  11629. *
  11630. * @static
  11631. * @memberOf _
  11632. * @since 3.9.0
  11633. * @category Lang
  11634. * @param {*} value The value to compare.
  11635. * @param {*} other The other value to compare.
  11636. * @returns {boolean} Returns `true` if `value` is greater than or equal to
  11637. * `other`, else `false`.
  11638. * @see _.lte
  11639. * @example
  11640. *
  11641. * _.gte(3, 1);
  11642. * // => true
  11643. *
  11644. * _.gte(3, 3);
  11645. * // => true
  11646. *
  11647. * _.gte(1, 3);
  11648. * // => false
  11649. */
  11650. var gte = createRelationalOperation(function(value, other) {
  11651. return value >= other;
  11652. });
  11653. /**
  11654. * Checks if `value` is likely an `arguments` object.
  11655. *
  11656. * @static
  11657. * @memberOf _
  11658. * @since 0.1.0
  11659. * @category Lang
  11660. * @param {*} value The value to check.
  11661. * @returns {boolean} Returns `true` if `value` is an `arguments` object,
  11662. * else `false`.
  11663. * @example
  11664. *
  11665. * _.isArguments(function() { return arguments; }());
  11666. * // => true
  11667. *
  11668. * _.isArguments([1, 2, 3]);
  11669. * // => false
  11670. */
  11671. var isArguments = baseIsArguments(function() { return arguments; }()) ? baseIsArguments : function(value) {
  11672. return isObjectLike(value) && hasOwnProperty.call(value, 'callee') &&
  11673. !propertyIsEnumerable.call(value, 'callee');
  11674. };
  11675. /**
  11676. * Checks if `value` is classified as an `Array` object.
  11677. *
  11678. * @static
  11679. * @memberOf _
  11680. * @since 0.1.0
  11681. * @category Lang
  11682. * @param {*} value The value to check.
  11683. * @returns {boolean} Returns `true` if `value` is an array, else `false`.
  11684. * @example
  11685. *
  11686. * _.isArray([1, 2, 3]);
  11687. * // => true
  11688. *
  11689. * _.isArray(document.body.children);
  11690. * // => false
  11691. *
  11692. * _.isArray('abc');
  11693. * // => false
  11694. *
  11695. * _.isArray(_.noop);
  11696. * // => false
  11697. */
  11698. var isArray = Array.isArray;
  11699. /**
  11700. * Checks if `value` is classified as an `ArrayBuffer` object.
  11701. *
  11702. * @static
  11703. * @memberOf _
  11704. * @since 4.3.0
  11705. * @category Lang
  11706. * @param {*} value The value to check.
  11707. * @returns {boolean} Returns `true` if `value` is an array buffer, else `false`.
  11708. * @example
  11709. *
  11710. * _.isArrayBuffer(new ArrayBuffer(2));
  11711. * // => true
  11712. *
  11713. * _.isArrayBuffer(new Array(2));
  11714. * // => false
  11715. */
  11716. var isArrayBuffer = nodeIsArrayBuffer ? baseUnary(nodeIsArrayBuffer) : baseIsArrayBuffer;
  11717. /**
  11718. * Checks if `value` is array-like. A value is considered array-like if it's
  11719. * not a function and has a `value.length` that's an integer greater than or
  11720. * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`.
  11721. *
  11722. * @static
  11723. * @memberOf _
  11724. * @since 4.0.0
  11725. * @category Lang
  11726. * @param {*} value The value to check.
  11727. * @returns {boolean} Returns `true` if `value` is array-like, else `false`.
  11728. * @example
  11729. *
  11730. * _.isArrayLike([1, 2, 3]);
  11731. * // => true
  11732. *
  11733. * _.isArrayLike(document.body.children);
  11734. * // => true
  11735. *
  11736. * _.isArrayLike('abc');
  11737. * // => true
  11738. *
  11739. * _.isArrayLike(_.noop);
  11740. * // => false
  11741. */
  11742. function isArrayLike(value) {
  11743. return value != null && isLength(value.length) && !isFunction(value);
  11744. }
  11745. /**
  11746. * This method is like `_.isArrayLike` except that it also checks if `value`
  11747. * is an object.
  11748. *
  11749. * @static
  11750. * @memberOf _
  11751. * @since 4.0.0
  11752. * @category Lang
  11753. * @param {*} value The value to check.
  11754. * @returns {boolean} Returns `true` if `value` is an array-like object,
  11755. * else `false`.
  11756. * @example
  11757. *
  11758. * _.isArrayLikeObject([1, 2, 3]);
  11759. * // => true
  11760. *
  11761. * _.isArrayLikeObject(document.body.children);
  11762. * // => true
  11763. *
  11764. * _.isArrayLikeObject('abc');
  11765. * // => false
  11766. *
  11767. * _.isArrayLikeObject(_.noop);
  11768. * // => false
  11769. */
  11770. function isArrayLikeObject(value) {
  11771. return isObjectLike(value) && isArrayLike(value);
  11772. }
  11773. /**
  11774. * Checks if `value` is classified as a boolean primitive or object.
  11775. *
  11776. * @static
  11777. * @memberOf _
  11778. * @since 0.1.0
  11779. * @category Lang
  11780. * @param {*} value The value to check.
  11781. * @returns {boolean} Returns `true` if `value` is a boolean, else `false`.
  11782. * @example
  11783. *
  11784. * _.isBoolean(false);
  11785. * // => true
  11786. *
  11787. * _.isBoolean(null);
  11788. * // => false
  11789. */
  11790. function isBoolean(value) {
  11791. return value === true || value === false ||
  11792. (isObjectLike(value) && baseGetTag(value) == boolTag);
  11793. }
  11794. /**
  11795. * Checks if `value` is a buffer.
  11796. *
  11797. * @static
  11798. * @memberOf _
  11799. * @since 4.3.0
  11800. * @category Lang
  11801. * @param {*} value The value to check.
  11802. * @returns {boolean} Returns `true` if `value` is a buffer, else `false`.
  11803. * @example
  11804. *
  11805. * _.isBuffer(new Buffer(2));
  11806. * // => true
  11807. *
  11808. * _.isBuffer(new Uint8Array(2));
  11809. * // => false
  11810. */
  11811. var isBuffer = nativeIsBuffer || stubFalse;
  11812. /**
  11813. * Checks if `value` is classified as a `Date` object.
  11814. *
  11815. * @static
  11816. * @memberOf _
  11817. * @since 0.1.0
  11818. * @category Lang
  11819. * @param {*} value The value to check.
  11820. * @returns {boolean} Returns `true` if `value` is a date object, else `false`.
  11821. * @example
  11822. *
  11823. * _.isDate(new Date);
  11824. * // => true
  11825. *
  11826. * _.isDate('Mon April 23 2012');
  11827. * // => false
  11828. */
  11829. var isDate = nodeIsDate ? baseUnary(nodeIsDate) : baseIsDate;
  11830. /**
  11831. * Checks if `value` is likely a DOM element.
  11832. *
  11833. * @static
  11834. * @memberOf _
  11835. * @since 0.1.0
  11836. * @category Lang
  11837. * @param {*} value The value to check.
  11838. * @returns {boolean} Returns `true` if `value` is a DOM element, else `false`.
  11839. * @example
  11840. *
  11841. * _.isElement(document.body);
  11842. * // => true
  11843. *
  11844. * _.isElement('<body>');
  11845. * // => false
  11846. */
  11847. function isElement(value) {
  11848. return isObjectLike(value) && value.nodeType === 1 && !isPlainObject(value);
  11849. }
  11850. /**
  11851. * Checks if `value` is an empty object, collection, map, or set.
  11852. *
  11853. * Objects are considered empty if they have no own enumerable string keyed
  11854. * properties.
  11855. *
  11856. * Array-like values such as `arguments` objects, arrays, buffers, strings, or
  11857. * jQuery-like collections are considered empty if they have a `length` of `0`.
  11858. * Similarly, maps and sets are considered empty if they have a `size` of `0`.
  11859. *
  11860. * @static
  11861. * @memberOf _
  11862. * @since 0.1.0
  11863. * @category Lang
  11864. * @param {*} value The value to check.
  11865. * @returns {boolean} Returns `true` if `value` is empty, else `false`.
  11866. * @example
  11867. *
  11868. * _.isEmpty(null);
  11869. * // => true
  11870. *
  11871. * _.isEmpty(true);
  11872. * // => true
  11873. *
  11874. * _.isEmpty(1);
  11875. * // => true
  11876. *
  11877. * _.isEmpty([1, 2, 3]);
  11878. * // => false
  11879. *
  11880. * _.isEmpty({ 'a': 1 });
  11881. * // => false
  11882. */
  11883. function isEmpty(value) {
  11884. if (value == null) {
  11885. return true;
  11886. }
  11887. if (isArrayLike(value) &&
  11888. (isArray(value) || typeof value == 'string' || typeof value.splice == 'function' ||
  11889. isBuffer(value) || isTypedArray(value) || isArguments(value))) {
  11890. return !value.length;
  11891. }
  11892. var tag = getTag(value);
  11893. if (tag == mapTag || tag == setTag) {
  11894. return !value.size;
  11895. }
  11896. if (isPrototype(value)) {
  11897. return !baseKeys(value).length;
  11898. }
  11899. for (var key in value) {
  11900. if (hasOwnProperty.call(value, key)) {
  11901. return false;
  11902. }
  11903. }
  11904. return true;
  11905. }
  11906. /**
  11907. * Performs a deep comparison between two values to determine if they are
  11908. * equivalent.
  11909. *
  11910. * **Note:** This method supports comparing arrays, array buffers, booleans,
  11911. * date objects, error objects, maps, numbers, `Object` objects, regexes,
  11912. * sets, strings, symbols, and typed arrays. `Object` objects are compared
  11913. * by their own, not inherited, enumerable properties. Functions and DOM
  11914. * nodes are compared by strict equality, i.e. `===`.
  11915. *
  11916. * @static
  11917. * @memberOf _
  11918. * @since 0.1.0
  11919. * @category Lang
  11920. * @param {*} value The value to compare.
  11921. * @param {*} other The other value to compare.
  11922. * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
  11923. * @example
  11924. *
  11925. * var object = { 'a': 1 };
  11926. * var other = { 'a': 1 };
  11927. *
  11928. * _.isEqual(object, other);
  11929. * // => true
  11930. *
  11931. * object === other;
  11932. * // => false
  11933. */
  11934. function isEqual(value, other) {
  11935. return baseIsEqual(value, other);
  11936. }
  11937. /**
  11938. * This method is like `_.isEqual` except that it accepts `customizer` which
  11939. * is invoked to compare values. If `customizer` returns `undefined`, comparisons
  11940. * are handled by the method instead. The `customizer` is invoked with up to
  11941. * six arguments: (objValue, othValue [, index|key, object, other, stack]).
  11942. *
  11943. * @static
  11944. * @memberOf _
  11945. * @since 4.0.0
  11946. * @category Lang
  11947. * @param {*} value The value to compare.
  11948. * @param {*} other The other value to compare.
  11949. * @param {Function} [customizer] The function to customize comparisons.
  11950. * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
  11951. * @example
  11952. *
  11953. * function isGreeting(value) {
  11954. * return /^h(?:i|ello)$/.test(value);
  11955. * }
  11956. *
  11957. * function customizer(objValue, othValue) {
  11958. * if (isGreeting(objValue) && isGreeting(othValue)) {
  11959. * return true;
  11960. * }
  11961. * }
  11962. *
  11963. * var array = ['hello', 'goodbye'];
  11964. * var other = ['hi', 'goodbye'];
  11965. *
  11966. * _.isEqualWith(array, other, customizer);
  11967. * // => true
  11968. */
  11969. function isEqualWith(value, other, customizer) {
  11970. customizer = typeof customizer == 'function' ? customizer : undefined;
  11971. var result = customizer ? customizer(value, other) : undefined;
  11972. return result === undefined ? baseIsEqual(value, other, undefined, customizer) : !!result;
  11973. }
  11974. /**
  11975. * Checks if `value` is an `Error`, `EvalError`, `RangeError`, `ReferenceError`,
  11976. * `SyntaxError`, `TypeError`, or `URIError` object.
  11977. *
  11978. * @static
  11979. * @memberOf _
  11980. * @since 3.0.0
  11981. * @category Lang
  11982. * @param {*} value The value to check.
  11983. * @returns {boolean} Returns `true` if `value` is an error object, else `false`.
  11984. * @example
  11985. *
  11986. * _.isError(new Error);
  11987. * // => true
  11988. *
  11989. * _.isError(Error);
  11990. * // => false
  11991. */
  11992. function isError(value) {
  11993. if (!isObjectLike(value)) {
  11994. return false;
  11995. }
  11996. var tag = baseGetTag(value);
  11997. return tag == errorTag || tag == domExcTag ||
  11998. (typeof value.message == 'string' && typeof value.name == 'string' && !isPlainObject(value));
  11999. }
  12000. /**
  12001. * Checks if `value` is a finite primitive number.
  12002. *
  12003. * **Note:** This method is based on
  12004. * [`Number.isFinite`](https://mdn.io/Number/isFinite).
  12005. *
  12006. * @static
  12007. * @memberOf _
  12008. * @since 0.1.0
  12009. * @category Lang
  12010. * @param {*} value The value to check.
  12011. * @returns {boolean} Returns `true` if `value` is a finite number, else `false`.
  12012. * @example
  12013. *
  12014. * _.isFinite(3);
  12015. * // => true
  12016. *
  12017. * _.isFinite(Number.MIN_VALUE);
  12018. * // => true
  12019. *
  12020. * _.isFinite(Infinity);
  12021. * // => false
  12022. *
  12023. * _.isFinite('3');
  12024. * // => false
  12025. */
  12026. function isFinite(value) {
  12027. return typeof value == 'number' && nativeIsFinite(value);
  12028. }
  12029. /**
  12030. * Checks if `value` is classified as a `Function` object.
  12031. *
  12032. * @static
  12033. * @memberOf _
  12034. * @since 0.1.0
  12035. * @category Lang
  12036. * @param {*} value The value to check.
  12037. * @returns {boolean} Returns `true` if `value` is a function, else `false`.
  12038. * @example
  12039. *
  12040. * _.isFunction(_);
  12041. * // => true
  12042. *
  12043. * _.isFunction(/abc/);
  12044. * // => false
  12045. */
  12046. function isFunction(value) {
  12047. if (!isObject(value)) {
  12048. return false;
  12049. }
  12050. // The use of `Object#toString` avoids issues with the `typeof` operator
  12051. // in Safari 9 which returns 'object' for typed arrays and other constructors.
  12052. var tag = baseGetTag(value);
  12053. return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag;
  12054. }
  12055. /**
  12056. * Checks if `value` is an integer.
  12057. *
  12058. * **Note:** This method is based on
  12059. * [`Number.isInteger`](https://mdn.io/Number/isInteger).
  12060. *
  12061. * @static
  12062. * @memberOf _
  12063. * @since 4.0.0
  12064. * @category Lang
  12065. * @param {*} value The value to check.
  12066. * @returns {boolean} Returns `true` if `value` is an integer, else `false`.
  12067. * @example
  12068. *
  12069. * _.isInteger(3);
  12070. * // => true
  12071. *
  12072. * _.isInteger(Number.MIN_VALUE);
  12073. * // => false
  12074. *
  12075. * _.isInteger(Infinity);
  12076. * // => false
  12077. *
  12078. * _.isInteger('3');
  12079. * // => false
  12080. */
  12081. function isInteger(value) {
  12082. return typeof value == 'number' && value == toInteger(value);
  12083. }
  12084. /**
  12085. * Checks if `value` is a valid array-like length.
  12086. *
  12087. * **Note:** This method is loosely based on
  12088. * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).
  12089. *
  12090. * @static
  12091. * @memberOf _
  12092. * @since 4.0.0
  12093. * @category Lang
  12094. * @param {*} value The value to check.
  12095. * @returns {boolean} Returns `true` if `value` is a valid length, else `false`.
  12096. * @example
  12097. *
  12098. * _.isLength(3);
  12099. * // => true
  12100. *
  12101. * _.isLength(Number.MIN_VALUE);
  12102. * // => false
  12103. *
  12104. * _.isLength(Infinity);
  12105. * // => false
  12106. *
  12107. * _.isLength('3');
  12108. * // => false
  12109. */
  12110. function isLength(value) {
  12111. return typeof value == 'number' &&
  12112. value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;
  12113. }
  12114. /**
  12115. * Checks if `value` is the
  12116. * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)
  12117. * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
  12118. *
  12119. * @static
  12120. * @memberOf _
  12121. * @since 0.1.0
  12122. * @category Lang
  12123. * @param {*} value The value to check.
  12124. * @returns {boolean} Returns `true` if `value` is an object, else `false`.
  12125. * @example
  12126. *
  12127. * _.isObject({});
  12128. * // => true
  12129. *
  12130. * _.isObject([1, 2, 3]);
  12131. * // => true
  12132. *
  12133. * _.isObject(_.noop);
  12134. * // => true
  12135. *
  12136. * _.isObject(null);
  12137. * // => false
  12138. */
  12139. function isObject(value) {
  12140. var type = typeof value;
  12141. return value != null && (type == 'object' || type == 'function');
  12142. }
  12143. /**
  12144. * Checks if `value` is object-like. A value is object-like if it's not `null`
  12145. * and has a `typeof` result of "object".
  12146. *
  12147. * @static
  12148. * @memberOf _
  12149. * @since 4.0.0
  12150. * @category Lang
  12151. * @param {*} value The value to check.
  12152. * @returns {boolean} Returns `true` if `value` is object-like, else `false`.
  12153. * @example
  12154. *
  12155. * _.isObjectLike({});
  12156. * // => true
  12157. *
  12158. * _.isObjectLike([1, 2, 3]);
  12159. * // => true
  12160. *
  12161. * _.isObjectLike(_.noop);
  12162. * // => false
  12163. *
  12164. * _.isObjectLike(null);
  12165. * // => false
  12166. */
  12167. function isObjectLike(value) {
  12168. return value != null && typeof value == 'object';
  12169. }
  12170. /**
  12171. * Checks if `value` is classified as a `Map` object.
  12172. *
  12173. * @static
  12174. * @memberOf _
  12175. * @since 4.3.0
  12176. * @category Lang
  12177. * @param {*} value The value to check.
  12178. * @returns {boolean} Returns `true` if `value` is a map, else `false`.
  12179. * @example
  12180. *
  12181. * _.isMap(new Map);
  12182. * // => true
  12183. *
  12184. * _.isMap(new WeakMap);
  12185. * // => false
  12186. */
  12187. var isMap = nodeIsMap ? baseUnary(nodeIsMap) : baseIsMap;
  12188. /**
  12189. * Performs a partial deep comparison between `object` and `source` to
  12190. * determine if `object` contains equivalent property values.
  12191. *
  12192. * **Note:** This method is equivalent to `_.matches` when `source` is
  12193. * partially applied.
  12194. *
  12195. * Partial comparisons will match empty array and empty object `source`
  12196. * values against any array or object value, respectively. See `_.isEqual`
  12197. * for a list of supported value comparisons.
  12198. *
  12199. * @static
  12200. * @memberOf _
  12201. * @since 3.0.0
  12202. * @category Lang
  12203. * @param {Object} object The object to inspect.
  12204. * @param {Object} source The object of property values to match.
  12205. * @returns {boolean} Returns `true` if `object` is a match, else `false`.
  12206. * @example
  12207. *
  12208. * var object = { 'a': 1, 'b': 2 };
  12209. *
  12210. * _.isMatch(object, { 'b': 2 });
  12211. * // => true
  12212. *
  12213. * _.isMatch(object, { 'b': 1 });
  12214. * // => false
  12215. */
  12216. function isMatch(object, source) {
  12217. return object === source || baseIsMatch(object, source, getMatchData(source));
  12218. }
  12219. /**
  12220. * This method is like `_.isMatch` except that it accepts `customizer` which
  12221. * is invoked to compare values. If `customizer` returns `undefined`, comparisons
  12222. * are handled by the method instead. The `customizer` is invoked with five
  12223. * arguments: (objValue, srcValue, index|key, object, source).
  12224. *
  12225. * @static
  12226. * @memberOf _
  12227. * @since 4.0.0
  12228. * @category Lang
  12229. * @param {Object} object The object to inspect.
  12230. * @param {Object} source The object of property values to match.
  12231. * @param {Function} [customizer] The function to customize comparisons.
  12232. * @returns {boolean} Returns `true` if `object` is a match, else `false`.
  12233. * @example
  12234. *
  12235. * function isGreeting(value) {
  12236. * return /^h(?:i|ello)$/.test(value);
  12237. * }
  12238. *
  12239. * function customizer(objValue, srcValue) {
  12240. * if (isGreeting(objValue) && isGreeting(srcValue)) {
  12241. * return true;
  12242. * }
  12243. * }
  12244. *
  12245. * var object = { 'greeting': 'hello' };
  12246. * var source = { 'greeting': 'hi' };
  12247. *
  12248. * _.isMatchWith(object, source, customizer);
  12249. * // => true
  12250. */
  12251. function isMatchWith(object, source, customizer) {
  12252. customizer = typeof customizer == 'function' ? customizer : undefined;
  12253. return baseIsMatch(object, source, getMatchData(source), customizer);
  12254. }
  12255. /**
  12256. * Checks if `value` is `NaN`.
  12257. *
  12258. * **Note:** This method is based on
  12259. * [`Number.isNaN`](https://mdn.io/Number/isNaN) and is not the same as
  12260. * global [`isNaN`](https://mdn.io/isNaN) which returns `true` for
  12261. * `undefined` and other non-number values.
  12262. *
  12263. * @static
  12264. * @memberOf _
  12265. * @since 0.1.0
  12266. * @category Lang
  12267. * @param {*} value The value to check.
  12268. * @returns {boolean} Returns `true` if `value` is `NaN`, else `false`.
  12269. * @example
  12270. *
  12271. * _.isNaN(NaN);
  12272. * // => true
  12273. *
  12274. * _.isNaN(new Number(NaN));
  12275. * // => true
  12276. *
  12277. * isNaN(undefined);
  12278. * // => true
  12279. *
  12280. * _.isNaN(undefined);
  12281. * // => false
  12282. */
  12283. function isNaN(value) {
  12284. // An `NaN` primitive is the only value that is not equal to itself.
  12285. // Perform the `toStringTag` check first to avoid errors with some
  12286. // ActiveX objects in IE.
  12287. return isNumber(value) && value != +value;
  12288. }
  12289. /**
  12290. * Checks if `value` is a pristine native function.
  12291. *
  12292. * **Note:** This method can't reliably detect native functions in the presence
  12293. * of the core-js package because core-js circumvents this kind of detection.
  12294. * Despite multiple requests, the core-js maintainer has made it clear: any
  12295. * attempt to fix the detection will be obstructed. As a result, we're left
  12296. * with little choice but to throw an error. Unfortunately, this also affects
  12297. * packages, like [babel-polyfill](https://www.npmjs.com/package/babel-polyfill),
  12298. * which rely on core-js.
  12299. *
  12300. * @static
  12301. * @memberOf _
  12302. * @since 3.0.0
  12303. * @category Lang
  12304. * @param {*} value The value to check.
  12305. * @returns {boolean} Returns `true` if `value` is a native function,
  12306. * else `false`.
  12307. * @example
  12308. *
  12309. * _.isNative(Array.prototype.push);
  12310. * // => true
  12311. *
  12312. * _.isNative(_);
  12313. * // => false
  12314. */
  12315. function isNative(value) {
  12316. if (isMaskable(value)) {
  12317. throw new Error(CORE_ERROR_TEXT);
  12318. }
  12319. return baseIsNative(value);
  12320. }
  12321. /**
  12322. * Checks if `value` is `null`.
  12323. *
  12324. * @static
  12325. * @memberOf _
  12326. * @since 0.1.0
  12327. * @category Lang
  12328. * @param {*} value The value to check.
  12329. * @returns {boolean} Returns `true` if `value` is `null`, else `false`.
  12330. * @example
  12331. *
  12332. * _.isNull(null);
  12333. * // => true
  12334. *
  12335. * _.isNull(void 0);
  12336. * // => false
  12337. */
  12338. function isNull(value) {
  12339. return value === null;
  12340. }
  12341. /**
  12342. * Checks if `value` is `null` or `undefined`.
  12343. *
  12344. * @static
  12345. * @memberOf _
  12346. * @since 4.0.0
  12347. * @category Lang
  12348. * @param {*} value The value to check.
  12349. * @returns {boolean} Returns `true` if `value` is nullish, else `false`.
  12350. * @example
  12351. *
  12352. * _.isNil(null);
  12353. * // => true
  12354. *
  12355. * _.isNil(void 0);
  12356. * // => true
  12357. *
  12358. * _.isNil(NaN);
  12359. * // => false
  12360. */
  12361. function isNil(value) {
  12362. return value == null;
  12363. }
  12364. /**
  12365. * Checks if `value` is classified as a `Number` primitive or object.
  12366. *
  12367. * **Note:** To exclude `Infinity`, `-Infinity`, and `NaN`, which are
  12368. * classified as numbers, use the `_.isFinite` method.
  12369. *
  12370. * @static
  12371. * @memberOf _
  12372. * @since 0.1.0
  12373. * @category Lang
  12374. * @param {*} value The value to check.
  12375. * @returns {boolean} Returns `true` if `value` is a number, else `false`.
  12376. * @example
  12377. *
  12378. * _.isNumber(3);
  12379. * // => true
  12380. *
  12381. * _.isNumber(Number.MIN_VALUE);
  12382. * // => true
  12383. *
  12384. * _.isNumber(Infinity);
  12385. * // => true
  12386. *
  12387. * _.isNumber('3');
  12388. * // => false
  12389. */
  12390. function isNumber(value) {
  12391. return typeof value == 'number' ||
  12392. (isObjectLike(value) && baseGetTag(value) == numberTag);
  12393. }
  12394. /**
  12395. * Checks if `value` is a plain object, that is, an object created by the
  12396. * `Object` constructor or one with a `[[Prototype]]` of `null`.
  12397. *
  12398. * @static
  12399. * @memberOf _
  12400. * @since 0.8.0
  12401. * @category Lang
  12402. * @param {*} value The value to check.
  12403. * @returns {boolean} Returns `true` if `value` is a plain object, else `false`.
  12404. * @example
  12405. *
  12406. * function Foo() {
  12407. * this.a = 1;
  12408. * }
  12409. *
  12410. * _.isPlainObject(new Foo);
  12411. * // => false
  12412. *
  12413. * _.isPlainObject([1, 2, 3]);
  12414. * // => false
  12415. *
  12416. * _.isPlainObject({ 'x': 0, 'y': 0 });
  12417. * // => true
  12418. *
  12419. * _.isPlainObject(Object.create(null));
  12420. * // => true
  12421. */
  12422. function isPlainObject(value) {
  12423. if (!isObjectLike(value) || baseGetTag(value) != objectTag) {
  12424. return false;
  12425. }
  12426. var proto = getPrototype(value);
  12427. if (proto === null) {
  12428. return true;
  12429. }
  12430. var Ctor = hasOwnProperty.call(proto, 'constructor') && proto.constructor;
  12431. return typeof Ctor == 'function' && Ctor instanceof Ctor &&
  12432. funcToString.call(Ctor) == objectCtorString;
  12433. }
  12434. /**
  12435. * Checks if `value` is classified as a `RegExp` object.
  12436. *
  12437. * @static
  12438. * @memberOf _
  12439. * @since 0.1.0
  12440. * @category Lang
  12441. * @param {*} value The value to check.
  12442. * @returns {boolean} Returns `true` if `value` is a regexp, else `false`.
  12443. * @example
  12444. *
  12445. * _.isRegExp(/abc/);
  12446. * // => true
  12447. *
  12448. * _.isRegExp('/abc/');
  12449. * // => false
  12450. */
  12451. var isRegExp = nodeIsRegExp ? baseUnary(nodeIsRegExp) : baseIsRegExp;
  12452. /**
  12453. * Checks if `value` is a safe integer. An integer is safe if it's an IEEE-754
  12454. * double precision number which isn't the result of a rounded unsafe integer.
  12455. *
  12456. * **Note:** This method is based on
  12457. * [`Number.isSafeInteger`](https://mdn.io/Number/isSafeInteger).
  12458. *
  12459. * @static
  12460. * @memberOf _
  12461. * @since 4.0.0
  12462. * @category Lang
  12463. * @param {*} value The value to check.
  12464. * @returns {boolean} Returns `true` if `value` is a safe integer, else `false`.
  12465. * @example
  12466. *
  12467. * _.isSafeInteger(3);
  12468. * // => true
  12469. *
  12470. * _.isSafeInteger(Number.MIN_VALUE);
  12471. * // => false
  12472. *
  12473. * _.isSafeInteger(Infinity);
  12474. * // => false
  12475. *
  12476. * _.isSafeInteger('3');
  12477. * // => false
  12478. */
  12479. function isSafeInteger(value) {
  12480. return isInteger(value) && value >= -MAX_SAFE_INTEGER && value <= MAX_SAFE_INTEGER;
  12481. }
  12482. /**
  12483. * Checks if `value` is classified as a `Set` object.
  12484. *
  12485. * @static
  12486. * @memberOf _
  12487. * @since 4.3.0
  12488. * @category Lang
  12489. * @param {*} value The value to check.
  12490. * @returns {boolean} Returns `true` if `value` is a set, else `false`.
  12491. * @example
  12492. *
  12493. * _.isSet(new Set);
  12494. * // => true
  12495. *
  12496. * _.isSet(new WeakSet);
  12497. * // => false
  12498. */
  12499. var isSet = nodeIsSet ? baseUnary(nodeIsSet) : baseIsSet;
  12500. /**
  12501. * Checks if `value` is classified as a `String` primitive or object.
  12502. *
  12503. * @static
  12504. * @since 0.1.0
  12505. * @memberOf _
  12506. * @category Lang
  12507. * @param {*} value The value to check.
  12508. * @returns {boolean} Returns `true` if `value` is a string, else `false`.
  12509. * @example
  12510. *
  12511. * _.isString('abc');
  12512. * // => true
  12513. *
  12514. * _.isString(1);
  12515. * // => false
  12516. */
  12517. function isString(value) {
  12518. return typeof value == 'string' ||
  12519. (!isArray(value) && isObjectLike(value) && baseGetTag(value) == stringTag);
  12520. }
  12521. /**
  12522. * Checks if `value` is classified as a `Symbol` primitive or object.
  12523. *
  12524. * @static
  12525. * @memberOf _
  12526. * @since 4.0.0
  12527. * @category Lang
  12528. * @param {*} value The value to check.
  12529. * @returns {boolean} Returns `true` if `value` is a symbol, else `false`.
  12530. * @example
  12531. *
  12532. * _.isSymbol(Symbol.iterator);
  12533. * // => true
  12534. *
  12535. * _.isSymbol('abc');
  12536. * // => false
  12537. */
  12538. function isSymbol(value) {
  12539. return typeof value == 'symbol' ||
  12540. (isObjectLike(value) && baseGetTag(value) == symbolTag);
  12541. }
  12542. /**
  12543. * Checks if `value` is classified as a typed array.
  12544. *
  12545. * @static
  12546. * @memberOf _
  12547. * @since 3.0.0
  12548. * @category Lang
  12549. * @param {*} value The value to check.
  12550. * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.
  12551. * @example
  12552. *
  12553. * _.isTypedArray(new Uint8Array);
  12554. * // => true
  12555. *
  12556. * _.isTypedArray([]);
  12557. * // => false
  12558. */
  12559. var isTypedArray = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray;
  12560. /**
  12561. * Checks if `value` is `undefined`.
  12562. *
  12563. * @static
  12564. * @since 0.1.0
  12565. * @memberOf _
  12566. * @category Lang
  12567. * @param {*} value The value to check.
  12568. * @returns {boolean} Returns `true` if `value` is `undefined`, else `false`.
  12569. * @example
  12570. *
  12571. * _.isUndefined(void 0);
  12572. * // => true
  12573. *
  12574. * _.isUndefined(null);
  12575. * // => false
  12576. */
  12577. function isUndefined(value) {
  12578. return value === undefined;
  12579. }
  12580. /**
  12581. * Checks if `value` is classified as a `WeakMap` object.
  12582. *
  12583. * @static
  12584. * @memberOf _
  12585. * @since 4.3.0
  12586. * @category Lang
  12587. * @param {*} value The value to check.
  12588. * @returns {boolean} Returns `true` if `value` is a weak map, else `false`.
  12589. * @example
  12590. *
  12591. * _.isWeakMap(new WeakMap);
  12592. * // => true
  12593. *
  12594. * _.isWeakMap(new Map);
  12595. * // => false
  12596. */
  12597. function isWeakMap(value) {
  12598. return isObjectLike(value) && getTag(value) == weakMapTag;
  12599. }
  12600. /**
  12601. * Checks if `value` is classified as a `WeakSet` object.
  12602. *
  12603. * @static
  12604. * @memberOf _
  12605. * @since 4.3.0
  12606. * @category Lang
  12607. * @param {*} value The value to check.
  12608. * @returns {boolean} Returns `true` if `value` is a weak set, else `false`.
  12609. * @example
  12610. *
  12611. * _.isWeakSet(new WeakSet);
  12612. * // => true
  12613. *
  12614. * _.isWeakSet(new Set);
  12615. * // => false
  12616. */
  12617. function isWeakSet(value) {
  12618. return isObjectLike(value) && baseGetTag(value) == weakSetTag;
  12619. }
  12620. /**
  12621. * Checks if `value` is less than `other`.
  12622. *
  12623. * @static
  12624. * @memberOf _
  12625. * @since 3.9.0
  12626. * @category Lang
  12627. * @param {*} value The value to compare.
  12628. * @param {*} other The other value to compare.
  12629. * @returns {boolean} Returns `true` if `value` is less than `other`,
  12630. * else `false`.
  12631. * @see _.gt
  12632. * @example
  12633. *
  12634. * _.lt(1, 3);
  12635. * // => true
  12636. *
  12637. * _.lt(3, 3);
  12638. * // => false
  12639. *
  12640. * _.lt(3, 1);
  12641. * // => false
  12642. */
  12643. var lt = createRelationalOperation(baseLt);
  12644. /**
  12645. * Checks if `value` is less than or equal to `other`.
  12646. *
  12647. * @static
  12648. * @memberOf _
  12649. * @since 3.9.0
  12650. * @category Lang
  12651. * @param {*} value The value to compare.
  12652. * @param {*} other The other value to compare.
  12653. * @returns {boolean} Returns `true` if `value` is less than or equal to
  12654. * `other`, else `false`.
  12655. * @see _.gte
  12656. * @example
  12657. *
  12658. * _.lte(1, 3);
  12659. * // => true
  12660. *
  12661. * _.lte(3, 3);
  12662. * // => true
  12663. *
  12664. * _.lte(3, 1);
  12665. * // => false
  12666. */
  12667. var lte = createRelationalOperation(function(value, other) {
  12668. return value <= other;
  12669. });
  12670. /**
  12671. * Converts `value` to an array.
  12672. *
  12673. * @static
  12674. * @since 0.1.0
  12675. * @memberOf _
  12676. * @category Lang
  12677. * @param {*} value The value to convert.
  12678. * @returns {Array} Returns the converted array.
  12679. * @example
  12680. *
  12681. * _.toArray({ 'a': 1, 'b': 2 });
  12682. * // => [1, 2]
  12683. *
  12684. * _.toArray('abc');
  12685. * // => ['a', 'b', 'c']
  12686. *
  12687. * _.toArray(1);
  12688. * // => []
  12689. *
  12690. * _.toArray(null);
  12691. * // => []
  12692. */
  12693. function toArray(value) {
  12694. if (!value) {
  12695. return [];
  12696. }
  12697. if (isArrayLike(value)) {
  12698. return isString(value) ? stringToArray(value) : copyArray(value);
  12699. }
  12700. if (symIterator && value[symIterator]) {
  12701. return iteratorToArray(value[symIterator]());
  12702. }
  12703. var tag = getTag(value),
  12704. func = tag == mapTag ? mapToArray : (tag == setTag ? setToArray : values);
  12705. return func(value);
  12706. }
  12707. /**
  12708. * Converts `value` to a finite number.
  12709. *
  12710. * @static
  12711. * @memberOf _
  12712. * @since 4.12.0
  12713. * @category Lang
  12714. * @param {*} value The value to convert.
  12715. * @returns {number} Returns the converted number.
  12716. * @example
  12717. *
  12718. * _.toFinite(3.2);
  12719. * // => 3.2
  12720. *
  12721. * _.toFinite(Number.MIN_VALUE);
  12722. * // => 5e-324
  12723. *
  12724. * _.toFinite(Infinity);
  12725. * // => 1.7976931348623157e+308
  12726. *
  12727. * _.toFinite('3.2');
  12728. * // => 3.2
  12729. */
  12730. function toFinite(value) {
  12731. if (!value) {
  12732. return value === 0 ? value : 0;
  12733. }
  12734. value = toNumber(value);
  12735. if (value === INFINITY || value === -INFINITY) {
  12736. var sign = (value < 0 ? -1 : 1);
  12737. return sign * MAX_INTEGER;
  12738. }
  12739. return value === value ? value : 0;
  12740. }
  12741. /**
  12742. * Converts `value` to an integer.
  12743. *
  12744. * **Note:** This method is loosely based on
  12745. * [`ToInteger`](http://www.ecma-international.org/ecma-262/7.0/#sec-tointeger).
  12746. *
  12747. * @static
  12748. * @memberOf _
  12749. * @since 4.0.0
  12750. * @category Lang
  12751. * @param {*} value The value to convert.
  12752. * @returns {number} Returns the converted integer.
  12753. * @example
  12754. *
  12755. * _.toInteger(3.2);
  12756. * // => 3
  12757. *
  12758. * _.toInteger(Number.MIN_VALUE);
  12759. * // => 0
  12760. *
  12761. * _.toInteger(Infinity);
  12762. * // => 1.7976931348623157e+308
  12763. *
  12764. * _.toInteger('3.2');
  12765. * // => 3
  12766. */
  12767. function toInteger(value) {
  12768. var result = toFinite(value),
  12769. remainder = result % 1;
  12770. return result === result ? (remainder ? result - remainder : result) : 0;
  12771. }
  12772. /**
  12773. * Converts `value` to an integer suitable for use as the length of an
  12774. * array-like object.
  12775. *
  12776. * **Note:** This method is based on
  12777. * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).
  12778. *
  12779. * @static
  12780. * @memberOf _
  12781. * @since 4.0.0
  12782. * @category Lang
  12783. * @param {*} value The value to convert.
  12784. * @returns {number} Returns the converted integer.
  12785. * @example
  12786. *
  12787. * _.toLength(3.2);
  12788. * // => 3
  12789. *
  12790. * _.toLength(Number.MIN_VALUE);
  12791. * // => 0
  12792. *
  12793. * _.toLength(Infinity);
  12794. * // => 4294967295
  12795. *
  12796. * _.toLength('3.2');
  12797. * // => 3
  12798. */
  12799. function toLength(value) {
  12800. return value ? baseClamp(toInteger(value), 0, MAX_ARRAY_LENGTH) : 0;
  12801. }
  12802. /**
  12803. * Converts `value` to a number.
  12804. *
  12805. * @static
  12806. * @memberOf _
  12807. * @since 4.0.0
  12808. * @category Lang
  12809. * @param {*} value The value to process.
  12810. * @returns {number} Returns the number.
  12811. * @example
  12812. *
  12813. * _.toNumber(3.2);
  12814. * // => 3.2
  12815. *
  12816. * _.toNumber(Number.MIN_VALUE);
  12817. * // => 5e-324
  12818. *
  12819. * _.toNumber(Infinity);
  12820. * // => Infinity
  12821. *
  12822. * _.toNumber('3.2');
  12823. * // => 3.2
  12824. */
  12825. function toNumber(value) {
  12826. if (typeof value == 'number') {
  12827. return value;
  12828. }
  12829. if (isSymbol(value)) {
  12830. return NAN;
  12831. }
  12832. if (isObject(value)) {
  12833. var other = typeof value.valueOf == 'function' ? value.valueOf() : value;
  12834. value = isObject(other) ? (other + '') : other;
  12835. }
  12836. if (typeof value != 'string') {
  12837. return value === 0 ? value : +value;
  12838. }
  12839. value = baseTrim(value);
  12840. var isBinary = reIsBinary.test(value);
  12841. return (isBinary || reIsOctal.test(value))
  12842. ? freeParseInt(value.slice(2), isBinary ? 2 : 8)
  12843. : (reIsBadHex.test(value) ? NAN : +value);
  12844. }
  12845. /**
  12846. * Converts `value` to a plain object flattening inherited enumerable string
  12847. * keyed properties of `value` to own properties of the plain object.
  12848. *
  12849. * @static
  12850. * @memberOf _
  12851. * @since 3.0.0
  12852. * @category Lang
  12853. * @param {*} value The value to convert.
  12854. * @returns {Object} Returns the converted plain object.
  12855. * @example
  12856. *
  12857. * function Foo() {
  12858. * this.b = 2;
  12859. * }
  12860. *
  12861. * Foo.prototype.c = 3;
  12862. *
  12863. * _.assign({ 'a': 1 }, new Foo);
  12864. * // => { 'a': 1, 'b': 2 }
  12865. *
  12866. * _.assign({ 'a': 1 }, _.toPlainObject(new Foo));
  12867. * // => { 'a': 1, 'b': 2, 'c': 3 }
  12868. */
  12869. function toPlainObject(value) {
  12870. return copyObject(value, keysIn(value));
  12871. }
  12872. /**
  12873. * Converts `value` to a safe integer. A safe integer can be compared and
  12874. * represented correctly.
  12875. *
  12876. * @static
  12877. * @memberOf _
  12878. * @since 4.0.0
  12879. * @category Lang
  12880. * @param {*} value The value to convert.
  12881. * @returns {number} Returns the converted integer.
  12882. * @example
  12883. *
  12884. * _.toSafeInteger(3.2);
  12885. * // => 3
  12886. *
  12887. * _.toSafeInteger(Number.MIN_VALUE);
  12888. * // => 0
  12889. *
  12890. * _.toSafeInteger(Infinity);
  12891. * // => 9007199254740991
  12892. *
  12893. * _.toSafeInteger('3.2');
  12894. * // => 3
  12895. */
  12896. function toSafeInteger(value) {
  12897. return value
  12898. ? baseClamp(toInteger(value), -MAX_SAFE_INTEGER, MAX_SAFE_INTEGER)
  12899. : (value === 0 ? value : 0);
  12900. }
  12901. /**
  12902. * Converts `value` to a string. An empty string is returned for `null`
  12903. * and `undefined` values. The sign of `-0` is preserved.
  12904. *
  12905. * @static
  12906. * @memberOf _
  12907. * @since 4.0.0
  12908. * @category Lang
  12909. * @param {*} value The value to convert.
  12910. * @returns {string} Returns the converted string.
  12911. * @example
  12912. *
  12913. * _.toString(null);
  12914. * // => ''
  12915. *
  12916. * _.toString(-0);
  12917. * // => '-0'
  12918. *
  12919. * _.toString([1, 2, 3]);
  12920. * // => '1,2,3'
  12921. */
  12922. function toString(value) {
  12923. return value == null ? '' : baseToString(value);
  12924. }
  12925. /*------------------------------------------------------------------------*/
  12926. /**
  12927. * Assigns own enumerable string keyed properties of source objects to the
  12928. * destination object. Source objects are applied from left to right.
  12929. * Subsequent sources overwrite property assignments of previous sources.
  12930. *
  12931. * **Note:** This method mutates `object` and is loosely based on
  12932. * [`Object.assign`](https://mdn.io/Object/assign).
  12933. *
  12934. * @static
  12935. * @memberOf _
  12936. * @since 0.10.0
  12937. * @category Object
  12938. * @param {Object} object The destination object.
  12939. * @param {...Object} [sources] The source objects.
  12940. * @returns {Object} Returns `object`.
  12941. * @see _.assignIn
  12942. * @example
  12943. *
  12944. * function Foo() {
  12945. * this.a = 1;
  12946. * }
  12947. *
  12948. * function Bar() {
  12949. * this.c = 3;
  12950. * }
  12951. *
  12952. * Foo.prototype.b = 2;
  12953. * Bar.prototype.d = 4;
  12954. *
  12955. * _.assign({ 'a': 0 }, new Foo, new Bar);
  12956. * // => { 'a': 1, 'c': 3 }
  12957. */
  12958. var assign = createAssigner(function(object, source) {
  12959. if (isPrototype(source) || isArrayLike(source)) {
  12960. copyObject(source, keys(source), object);
  12961. return;
  12962. }
  12963. for (var key in source) {
  12964. if (hasOwnProperty.call(source, key)) {
  12965. assignValue(object, key, source[key]);
  12966. }
  12967. }
  12968. });
  12969. /**
  12970. * This method is like `_.assign` except that it iterates over own and
  12971. * inherited source properties.
  12972. *
  12973. * **Note:** This method mutates `object`.
  12974. *
  12975. * @static
  12976. * @memberOf _
  12977. * @since 4.0.0
  12978. * @alias extend
  12979. * @category Object
  12980. * @param {Object} object The destination object.
  12981. * @param {...Object} [sources] The source objects.
  12982. * @returns {Object} Returns `object`.
  12983. * @see _.assign
  12984. * @example
  12985. *
  12986. * function Foo() {
  12987. * this.a = 1;
  12988. * }
  12989. *
  12990. * function Bar() {
  12991. * this.c = 3;
  12992. * }
  12993. *
  12994. * Foo.prototype.b = 2;
  12995. * Bar.prototype.d = 4;
  12996. *
  12997. * _.assignIn({ 'a': 0 }, new Foo, new Bar);
  12998. * // => { 'a': 1, 'b': 2, 'c': 3, 'd': 4 }
  12999. */
  13000. var assignIn = createAssigner(function(object, source) {
  13001. copyObject(source, keysIn(source), object);
  13002. });
  13003. /**
  13004. * This method is like `_.assignIn` except that it accepts `customizer`
  13005. * which is invoked to produce the assigned values. If `customizer` returns
  13006. * `undefined`, assignment is handled by the method instead. The `customizer`
  13007. * is invoked with five arguments: (objValue, srcValue, key, object, source).
  13008. *
  13009. * **Note:** This method mutates `object`.
  13010. *
  13011. * @static
  13012. * @memberOf _
  13013. * @since 4.0.0
  13014. * @alias extendWith
  13015. * @category Object
  13016. * @param {Object} object The destination object.
  13017. * @param {...Object} sources The source objects.
  13018. * @param {Function} [customizer] The function to customize assigned values.
  13019. * @returns {Object} Returns `object`.
  13020. * @see _.assignWith
  13021. * @example
  13022. *
  13023. * function customizer(objValue, srcValue) {
  13024. * return _.isUndefined(objValue) ? srcValue : objValue;
  13025. * }
  13026. *
  13027. * var defaults = _.partialRight(_.assignInWith, customizer);
  13028. *
  13029. * defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 });
  13030. * // => { 'a': 1, 'b': 2 }
  13031. */
  13032. var assignInWith = createAssigner(function(object, source, srcIndex, customizer) {
  13033. copyObject(source, keysIn(source), object, customizer);
  13034. });
  13035. /**
  13036. * This method is like `_.assign` except that it accepts `customizer`
  13037. * which is invoked to produce the assigned values. If `customizer` returns
  13038. * `undefined`, assignment is handled by the method instead. The `customizer`
  13039. * is invoked with five arguments: (objValue, srcValue, key, object, source).
  13040. *
  13041. * **Note:** This method mutates `object`.
  13042. *
  13043. * @static
  13044. * @memberOf _
  13045. * @since 4.0.0
  13046. * @category Object
  13047. * @param {Object} object The destination object.
  13048. * @param {...Object} sources The source objects.
  13049. * @param {Function} [customizer] The function to customize assigned values.
  13050. * @returns {Object} Returns `object`.
  13051. * @see _.assignInWith
  13052. * @example
  13053. *
  13054. * function customizer(objValue, srcValue) {
  13055. * return _.isUndefined(objValue) ? srcValue : objValue;
  13056. * }
  13057. *
  13058. * var defaults = _.partialRight(_.assignWith, customizer);
  13059. *
  13060. * defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 });
  13061. * // => { 'a': 1, 'b': 2 }
  13062. */
  13063. var assignWith = createAssigner(function(object, source, srcIndex, customizer) {
  13064. copyObject(source, keys(source), object, customizer);
  13065. });
  13066. /**
  13067. * Creates an array of values corresponding to `paths` of `object`.
  13068. *
  13069. * @static
  13070. * @memberOf _
  13071. * @since 1.0.0
  13072. * @category Object
  13073. * @param {Object} object The object to iterate over.
  13074. * @param {...(string|string[])} [paths] The property paths to pick.
  13075. * @returns {Array} Returns the picked values.
  13076. * @example
  13077. *
  13078. * var object = { 'a': [{ 'b': { 'c': 3 } }, 4] };
  13079. *
  13080. * _.at(object, ['a[0].b.c', 'a[1]']);
  13081. * // => [3, 4]
  13082. */
  13083. var at = flatRest(baseAt);
  13084. /**
  13085. * Creates an object that inherits from the `prototype` object. If a
  13086. * `properties` object is given, its own enumerable string keyed properties
  13087. * are assigned to the created object.
  13088. *
  13089. * @static
  13090. * @memberOf _
  13091. * @since 2.3.0
  13092. * @category Object
  13093. * @param {Object} prototype The object to inherit from.
  13094. * @param {Object} [properties] The properties to assign to the object.
  13095. * @returns {Object} Returns the new object.
  13096. * @example
  13097. *
  13098. * function Shape() {
  13099. * this.x = 0;
  13100. * this.y = 0;
  13101. * }
  13102. *
  13103. * function Circle() {
  13104. * Shape.call(this);
  13105. * }
  13106. *
  13107. * Circle.prototype = _.create(Shape.prototype, {
  13108. * 'constructor': Circle
  13109. * });
  13110. *
  13111. * var circle = new Circle;
  13112. * circle instanceof Circle;
  13113. * // => true
  13114. *
  13115. * circle instanceof Shape;
  13116. * // => true
  13117. */
  13118. function create(prototype, properties) {
  13119. var result = baseCreate(prototype);
  13120. return properties == null ? result : baseAssign(result, properties);
  13121. }
  13122. /**
  13123. * Assigns own and inherited enumerable string keyed properties of source
  13124. * objects to the destination object for all destination properties that
  13125. * resolve to `undefined`. Source objects are applied from left to right.
  13126. * Once a property is set, additional values of the same property are ignored.
  13127. *
  13128. * **Note:** This method mutates `object`.
  13129. *
  13130. * @static
  13131. * @since 0.1.0
  13132. * @memberOf _
  13133. * @category Object
  13134. * @param {Object} object The destination object.
  13135. * @param {...Object} [sources] The source objects.
  13136. * @returns {Object} Returns `object`.
  13137. * @see _.defaultsDeep
  13138. * @example
  13139. *
  13140. * _.defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 });
  13141. * // => { 'a': 1, 'b': 2 }
  13142. */
  13143. var defaults = baseRest(function(object, sources) {
  13144. object = Object(object);
  13145. var index = -1;
  13146. var length = sources.length;
  13147. var guard = length > 2 ? sources[2] : undefined;
  13148. if (guard && isIterateeCall(sources[0], sources[1], guard)) {
  13149. length = 1;
  13150. }
  13151. while (++index < length) {
  13152. var source = sources[index];
  13153. var props = keysIn(source);
  13154. var propsIndex = -1;
  13155. var propsLength = props.length;
  13156. while (++propsIndex < propsLength) {
  13157. var key = props[propsIndex];
  13158. var value = object[key];
  13159. if (value === undefined ||
  13160. (eq(value, objectProto[key]) && !hasOwnProperty.call(object, key))) {
  13161. object[key] = source[key];
  13162. }
  13163. }
  13164. }
  13165. return object;
  13166. });
  13167. /**
  13168. * This method is like `_.defaults` except that it recursively assigns
  13169. * default properties.
  13170. *
  13171. * **Note:** This method mutates `object`.
  13172. *
  13173. * @static
  13174. * @memberOf _
  13175. * @since 3.10.0
  13176. * @category Object
  13177. * @param {Object} object The destination object.
  13178. * @param {...Object} [sources] The source objects.
  13179. * @returns {Object} Returns `object`.
  13180. * @see _.defaults
  13181. * @example
  13182. *
  13183. * _.defaultsDeep({ 'a': { 'b': 2 } }, { 'a': { 'b': 1, 'c': 3 } });
  13184. * // => { 'a': { 'b': 2, 'c': 3 } }
  13185. */
  13186. var defaultsDeep = baseRest(function(args) {
  13187. args.push(undefined, customDefaultsMerge);
  13188. return apply(mergeWith, undefined, args);
  13189. });
  13190. /**
  13191. * This method is like `_.find` except that it returns the key of the first
  13192. * element `predicate` returns truthy for instead of the element itself.
  13193. *
  13194. * @static
  13195. * @memberOf _
  13196. * @since 1.1.0
  13197. * @category Object
  13198. * @param {Object} object The object to inspect.
  13199. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  13200. * @returns {string|undefined} Returns the key of the matched element,
  13201. * else `undefined`.
  13202. * @example
  13203. *
  13204. * var users = {
  13205. * 'barney': { 'age': 36, 'active': true },
  13206. * 'fred': { 'age': 40, 'active': false },
  13207. * 'pebbles': { 'age': 1, 'active': true }
  13208. * };
  13209. *
  13210. * _.findKey(users, function(o) { return o.age < 40; });
  13211. * // => 'barney' (iteration order is not guaranteed)
  13212. *
  13213. * // The `_.matches` iteratee shorthand.
  13214. * _.findKey(users, { 'age': 1, 'active': true });
  13215. * // => 'pebbles'
  13216. *
  13217. * // The `_.matchesProperty` iteratee shorthand.
  13218. * _.findKey(users, ['active', false]);
  13219. * // => 'fred'
  13220. *
  13221. * // The `_.property` iteratee shorthand.
  13222. * _.findKey(users, 'active');
  13223. * // => 'barney'
  13224. */
  13225. function findKey(object, predicate) {
  13226. return baseFindKey(object, getIteratee(predicate, 3), baseForOwn);
  13227. }
  13228. /**
  13229. * This method is like `_.findKey` except that it iterates over elements of
  13230. * a collection in the opposite order.
  13231. *
  13232. * @static
  13233. * @memberOf _
  13234. * @since 2.0.0
  13235. * @category Object
  13236. * @param {Object} object The object to inspect.
  13237. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  13238. * @returns {string|undefined} Returns the key of the matched element,
  13239. * else `undefined`.
  13240. * @example
  13241. *
  13242. * var users = {
  13243. * 'barney': { 'age': 36, 'active': true },
  13244. * 'fred': { 'age': 40, 'active': false },
  13245. * 'pebbles': { 'age': 1, 'active': true }
  13246. * };
  13247. *
  13248. * _.findLastKey(users, function(o) { return o.age < 40; });
  13249. * // => returns 'pebbles' assuming `_.findKey` returns 'barney'
  13250. *
  13251. * // The `_.matches` iteratee shorthand.
  13252. * _.findLastKey(users, { 'age': 36, 'active': true });
  13253. * // => 'barney'
  13254. *
  13255. * // The `_.matchesProperty` iteratee shorthand.
  13256. * _.findLastKey(users, ['active', false]);
  13257. * // => 'fred'
  13258. *
  13259. * // The `_.property` iteratee shorthand.
  13260. * _.findLastKey(users, 'active');
  13261. * // => 'pebbles'
  13262. */
  13263. function findLastKey(object, predicate) {
  13264. return baseFindKey(object, getIteratee(predicate, 3), baseForOwnRight);
  13265. }
  13266. /**
  13267. * Iterates over own and inherited enumerable string keyed properties of an
  13268. * object and invokes `iteratee` for each property. The iteratee is invoked
  13269. * with three arguments: (value, key, object). Iteratee functions may exit
  13270. * iteration early by explicitly returning `false`.
  13271. *
  13272. * @static
  13273. * @memberOf _
  13274. * @since 0.3.0
  13275. * @category Object
  13276. * @param {Object} object The object to iterate over.
  13277. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  13278. * @returns {Object} Returns `object`.
  13279. * @see _.forInRight
  13280. * @example
  13281. *
  13282. * function Foo() {
  13283. * this.a = 1;
  13284. * this.b = 2;
  13285. * }
  13286. *
  13287. * Foo.prototype.c = 3;
  13288. *
  13289. * _.forIn(new Foo, function(value, key) {
  13290. * console.log(key);
  13291. * });
  13292. * // => Logs 'a', 'b', then 'c' (iteration order is not guaranteed).
  13293. */
  13294. function forIn(object, iteratee) {
  13295. return object == null
  13296. ? object
  13297. : baseFor(object, getIteratee(iteratee, 3), keysIn);
  13298. }
  13299. /**
  13300. * This method is like `_.forIn` except that it iterates over properties of
  13301. * `object` in the opposite order.
  13302. *
  13303. * @static
  13304. * @memberOf _
  13305. * @since 2.0.0
  13306. * @category Object
  13307. * @param {Object} object The object to iterate over.
  13308. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  13309. * @returns {Object} Returns `object`.
  13310. * @see _.forIn
  13311. * @example
  13312. *
  13313. * function Foo() {
  13314. * this.a = 1;
  13315. * this.b = 2;
  13316. * }
  13317. *
  13318. * Foo.prototype.c = 3;
  13319. *
  13320. * _.forInRight(new Foo, function(value, key) {
  13321. * console.log(key);
  13322. * });
  13323. * // => Logs 'c', 'b', then 'a' assuming `_.forIn` logs 'a', 'b', then 'c'.
  13324. */
  13325. function forInRight(object, iteratee) {
  13326. return object == null
  13327. ? object
  13328. : baseForRight(object, getIteratee(iteratee, 3), keysIn);
  13329. }
  13330. /**
  13331. * Iterates over own enumerable string keyed properties of an object and
  13332. * invokes `iteratee` for each property. The iteratee is invoked with three
  13333. * arguments: (value, key, object). Iteratee functions may exit iteration
  13334. * early by explicitly returning `false`.
  13335. *
  13336. * @static
  13337. * @memberOf _
  13338. * @since 0.3.0
  13339. * @category Object
  13340. * @param {Object} object The object to iterate over.
  13341. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  13342. * @returns {Object} Returns `object`.
  13343. * @see _.forOwnRight
  13344. * @example
  13345. *
  13346. * function Foo() {
  13347. * this.a = 1;
  13348. * this.b = 2;
  13349. * }
  13350. *
  13351. * Foo.prototype.c = 3;
  13352. *
  13353. * _.forOwn(new Foo, function(value, key) {
  13354. * console.log(key);
  13355. * });
  13356. * // => Logs 'a' then 'b' (iteration order is not guaranteed).
  13357. */
  13358. function forOwn(object, iteratee) {
  13359. return object && baseForOwn(object, getIteratee(iteratee, 3));
  13360. }
  13361. /**
  13362. * This method is like `_.forOwn` except that it iterates over properties of
  13363. * `object` in the opposite order.
  13364. *
  13365. * @static
  13366. * @memberOf _
  13367. * @since 2.0.0
  13368. * @category Object
  13369. * @param {Object} object The object to iterate over.
  13370. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  13371. * @returns {Object} Returns `object`.
  13372. * @see _.forOwn
  13373. * @example
  13374. *
  13375. * function Foo() {
  13376. * this.a = 1;
  13377. * this.b = 2;
  13378. * }
  13379. *
  13380. * Foo.prototype.c = 3;
  13381. *
  13382. * _.forOwnRight(new Foo, function(value, key) {
  13383. * console.log(key);
  13384. * });
  13385. * // => Logs 'b' then 'a' assuming `_.forOwn` logs 'a' then 'b'.
  13386. */
  13387. function forOwnRight(object, iteratee) {
  13388. return object && baseForOwnRight(object, getIteratee(iteratee, 3));
  13389. }
  13390. /**
  13391. * Creates an array of function property names from own enumerable properties
  13392. * of `object`.
  13393. *
  13394. * @static
  13395. * @since 0.1.0
  13396. * @memberOf _
  13397. * @category Object
  13398. * @param {Object} object The object to inspect.
  13399. * @returns {Array} Returns the function names.
  13400. * @see _.functionsIn
  13401. * @example
  13402. *
  13403. * function Foo() {
  13404. * this.a = _.constant('a');
  13405. * this.b = _.constant('b');
  13406. * }
  13407. *
  13408. * Foo.prototype.c = _.constant('c');
  13409. *
  13410. * _.functions(new Foo);
  13411. * // => ['a', 'b']
  13412. */
  13413. function functions(object) {
  13414. return object == null ? [] : baseFunctions(object, keys(object));
  13415. }
  13416. /**
  13417. * Creates an array of function property names from own and inherited
  13418. * enumerable properties of `object`.
  13419. *
  13420. * @static
  13421. * @memberOf _
  13422. * @since 4.0.0
  13423. * @category Object
  13424. * @param {Object} object The object to inspect.
  13425. * @returns {Array} Returns the function names.
  13426. * @see _.functions
  13427. * @example
  13428. *
  13429. * function Foo() {
  13430. * this.a = _.constant('a');
  13431. * this.b = _.constant('b');
  13432. * }
  13433. *
  13434. * Foo.prototype.c = _.constant('c');
  13435. *
  13436. * _.functionsIn(new Foo);
  13437. * // => ['a', 'b', 'c']
  13438. */
  13439. function functionsIn(object) {
  13440. return object == null ? [] : baseFunctions(object, keysIn(object));
  13441. }
  13442. /**
  13443. * Gets the value at `path` of `object`. If the resolved value is
  13444. * `undefined`, the `defaultValue` is returned in its place.
  13445. *
  13446. * @static
  13447. * @memberOf _
  13448. * @since 3.7.0
  13449. * @category Object
  13450. * @param {Object} object The object to query.
  13451. * @param {Array|string} path The path of the property to get.
  13452. * @param {*} [defaultValue] The value returned for `undefined` resolved values.
  13453. * @returns {*} Returns the resolved value.
  13454. * @example
  13455. *
  13456. * var object = { 'a': [{ 'b': { 'c': 3 } }] };
  13457. *
  13458. * _.get(object, 'a[0].b.c');
  13459. * // => 3
  13460. *
  13461. * _.get(object, ['a', '0', 'b', 'c']);
  13462. * // => 3
  13463. *
  13464. * _.get(object, 'a.b.c', 'default');
  13465. * // => 'default'
  13466. */
  13467. function get(object, path, defaultValue) {
  13468. var result = object == null ? undefined : baseGet(object, path);
  13469. return result === undefined ? defaultValue : result;
  13470. }
  13471. /**
  13472. * Checks if `path` is a direct property of `object`.
  13473. *
  13474. * @static
  13475. * @since 0.1.0
  13476. * @memberOf _
  13477. * @category Object
  13478. * @param {Object} object The object to query.
  13479. * @param {Array|string} path The path to check.
  13480. * @returns {boolean} Returns `true` if `path` exists, else `false`.
  13481. * @example
  13482. *
  13483. * var object = { 'a': { 'b': 2 } };
  13484. * var other = _.create({ 'a': _.create({ 'b': 2 }) });
  13485. *
  13486. * _.has(object, 'a');
  13487. * // => true
  13488. *
  13489. * _.has(object, 'a.b');
  13490. * // => true
  13491. *
  13492. * _.has(object, ['a', 'b']);
  13493. * // => true
  13494. *
  13495. * _.has(other, 'a');
  13496. * // => false
  13497. */
  13498. function has(object, path) {
  13499. return object != null && hasPath(object, path, baseHas);
  13500. }
  13501. /**
  13502. * Checks if `path` is a direct or inherited property of `object`.
  13503. *
  13504. * @static
  13505. * @memberOf _
  13506. * @since 4.0.0
  13507. * @category Object
  13508. * @param {Object} object The object to query.
  13509. * @param {Array|string} path The path to check.
  13510. * @returns {boolean} Returns `true` if `path` exists, else `false`.
  13511. * @example
  13512. *
  13513. * var object = _.create({ 'a': _.create({ 'b': 2 }) });
  13514. *
  13515. * _.hasIn(object, 'a');
  13516. * // => true
  13517. *
  13518. * _.hasIn(object, 'a.b');
  13519. * // => true
  13520. *
  13521. * _.hasIn(object, ['a', 'b']);
  13522. * // => true
  13523. *
  13524. * _.hasIn(object, 'b');
  13525. * // => false
  13526. */
  13527. function hasIn(object, path) {
  13528. return object != null && hasPath(object, path, baseHasIn);
  13529. }
  13530. /**
  13531. * Creates an object composed of the inverted keys and values of `object`.
  13532. * If `object` contains duplicate values, subsequent values overwrite
  13533. * property assignments of previous values.
  13534. *
  13535. * @static
  13536. * @memberOf _
  13537. * @since 0.7.0
  13538. * @category Object
  13539. * @param {Object} object The object to invert.
  13540. * @returns {Object} Returns the new inverted object.
  13541. * @example
  13542. *
  13543. * var object = { 'a': 1, 'b': 2, 'c': 1 };
  13544. *
  13545. * _.invert(object);
  13546. * // => { '1': 'c', '2': 'b' }
  13547. */
  13548. var invert = createInverter(function(result, value, key) {
  13549. if (value != null &&
  13550. typeof value.toString != 'function') {
  13551. value = nativeObjectToString.call(value);
  13552. }
  13553. result[value] = key;
  13554. }, constant(identity));
  13555. /**
  13556. * This method is like `_.invert` except that the inverted object is generated
  13557. * from the results of running each element of `object` thru `iteratee`. The
  13558. * corresponding inverted value of each inverted key is an array of keys
  13559. * responsible for generating the inverted value. The iteratee is invoked
  13560. * with one argument: (value).
  13561. *
  13562. * @static
  13563. * @memberOf _
  13564. * @since 4.1.0
  13565. * @category Object
  13566. * @param {Object} object The object to invert.
  13567. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  13568. * @returns {Object} Returns the new inverted object.
  13569. * @example
  13570. *
  13571. * var object = { 'a': 1, 'b': 2, 'c': 1 };
  13572. *
  13573. * _.invertBy(object);
  13574. * // => { '1': ['a', 'c'], '2': ['b'] }
  13575. *
  13576. * _.invertBy(object, function(value) {
  13577. * return 'group' + value;
  13578. * });
  13579. * // => { 'group1': ['a', 'c'], 'group2': ['b'] }
  13580. */
  13581. var invertBy = createInverter(function(result, value, key) {
  13582. if (value != null &&
  13583. typeof value.toString != 'function') {
  13584. value = nativeObjectToString.call(value);
  13585. }
  13586. if (hasOwnProperty.call(result, value)) {
  13587. result[value].push(key);
  13588. } else {
  13589. result[value] = [key];
  13590. }
  13591. }, getIteratee);
  13592. /**
  13593. * Invokes the method at `path` of `object`.
  13594. *
  13595. * @static
  13596. * @memberOf _
  13597. * @since 4.0.0
  13598. * @category Object
  13599. * @param {Object} object The object to query.
  13600. * @param {Array|string} path The path of the method to invoke.
  13601. * @param {...*} [args] The arguments to invoke the method with.
  13602. * @returns {*} Returns the result of the invoked method.
  13603. * @example
  13604. *
  13605. * var object = { 'a': [{ 'b': { 'c': [1, 2, 3, 4] } }] };
  13606. *
  13607. * _.invoke(object, 'a[0].b.c.slice', 1, 3);
  13608. * // => [2, 3]
  13609. */
  13610. var invoke = baseRest(baseInvoke);
  13611. /**
  13612. * Creates an array of the own enumerable property names of `object`.
  13613. *
  13614. * **Note:** Non-object values are coerced to objects. See the
  13615. * [ES spec](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)
  13616. * for more details.
  13617. *
  13618. * @static
  13619. * @since 0.1.0
  13620. * @memberOf _
  13621. * @category Object
  13622. * @param {Object} object The object to query.
  13623. * @returns {Array} Returns the array of property names.
  13624. * @example
  13625. *
  13626. * function Foo() {
  13627. * this.a = 1;
  13628. * this.b = 2;
  13629. * }
  13630. *
  13631. * Foo.prototype.c = 3;
  13632. *
  13633. * _.keys(new Foo);
  13634. * // => ['a', 'b'] (iteration order is not guaranteed)
  13635. *
  13636. * _.keys('hi');
  13637. * // => ['0', '1']
  13638. */
  13639. function keys(object) {
  13640. return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object);
  13641. }
  13642. /**
  13643. * Creates an array of the own and inherited enumerable property names of `object`.
  13644. *
  13645. * **Note:** Non-object values are coerced to objects.
  13646. *
  13647. * @static
  13648. * @memberOf _
  13649. * @since 3.0.0
  13650. * @category Object
  13651. * @param {Object} object The object to query.
  13652. * @returns {Array} Returns the array of property names.
  13653. * @example
  13654. *
  13655. * function Foo() {
  13656. * this.a = 1;
  13657. * this.b = 2;
  13658. * }
  13659. *
  13660. * Foo.prototype.c = 3;
  13661. *
  13662. * _.keysIn(new Foo);
  13663. * // => ['a', 'b', 'c'] (iteration order is not guaranteed)
  13664. */
  13665. function keysIn(object) {
  13666. return isArrayLike(object) ? arrayLikeKeys(object, true) : baseKeysIn(object);
  13667. }
  13668. /**
  13669. * The opposite of `_.mapValues`; this method creates an object with the
  13670. * same values as `object` and keys generated by running each own enumerable
  13671. * string keyed property of `object` thru `iteratee`. The iteratee is invoked
  13672. * with three arguments: (value, key, object).
  13673. *
  13674. * @static
  13675. * @memberOf _
  13676. * @since 3.8.0
  13677. * @category Object
  13678. * @param {Object} object The object to iterate over.
  13679. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  13680. * @returns {Object} Returns the new mapped object.
  13681. * @see _.mapValues
  13682. * @example
  13683. *
  13684. * _.mapKeys({ 'a': 1, 'b': 2 }, function(value, key) {
  13685. * return key + value;
  13686. * });
  13687. * // => { 'a1': 1, 'b2': 2 }
  13688. */
  13689. function mapKeys(object, iteratee) {
  13690. var result = {};
  13691. iteratee = getIteratee(iteratee, 3);
  13692. baseForOwn(object, function(value, key, object) {
  13693. baseAssignValue(result, iteratee(value, key, object), value);
  13694. });
  13695. return result;
  13696. }
  13697. /**
  13698. * Creates an object with the same keys as `object` and values generated
  13699. * by running each own enumerable string keyed property of `object` thru
  13700. * `iteratee`. The iteratee is invoked with three arguments:
  13701. * (value, key, object).
  13702. *
  13703. * @static
  13704. * @memberOf _
  13705. * @since 2.4.0
  13706. * @category Object
  13707. * @param {Object} object The object to iterate over.
  13708. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  13709. * @returns {Object} Returns the new mapped object.
  13710. * @see _.mapKeys
  13711. * @example
  13712. *
  13713. * var users = {
  13714. * 'fred': { 'user': 'fred', 'age': 40 },
  13715. * 'pebbles': { 'user': 'pebbles', 'age': 1 }
  13716. * };
  13717. *
  13718. * _.mapValues(users, function(o) { return o.age; });
  13719. * // => { 'fred': 40, 'pebbles': 1 } (iteration order is not guaranteed)
  13720. *
  13721. * // The `_.property` iteratee shorthand.
  13722. * _.mapValues(users, 'age');
  13723. * // => { 'fred': 40, 'pebbles': 1 } (iteration order is not guaranteed)
  13724. */
  13725. function mapValues(object, iteratee) {
  13726. var result = {};
  13727. iteratee = getIteratee(iteratee, 3);
  13728. baseForOwn(object, function(value, key, object) {
  13729. baseAssignValue(result, key, iteratee(value, key, object));
  13730. });
  13731. return result;
  13732. }
  13733. /**
  13734. * This method is like `_.assign` except that it recursively merges own and
  13735. * inherited enumerable string keyed properties of source objects into the
  13736. * destination object. Source properties that resolve to `undefined` are
  13737. * skipped if a destination value exists. Array and plain object properties
  13738. * are merged recursively. Other objects and value types are overridden by
  13739. * assignment. Source objects are applied from left to right. Subsequent
  13740. * sources overwrite property assignments of previous sources.
  13741. *
  13742. * **Note:** This method mutates `object`.
  13743. *
  13744. * @static
  13745. * @memberOf _
  13746. * @since 0.5.0
  13747. * @category Object
  13748. * @param {Object} object The destination object.
  13749. * @param {...Object} [sources] The source objects.
  13750. * @returns {Object} Returns `object`.
  13751. * @example
  13752. *
  13753. * var object = {
  13754. * 'a': [{ 'b': 2 }, { 'd': 4 }]
  13755. * };
  13756. *
  13757. * var other = {
  13758. * 'a': [{ 'c': 3 }, { 'e': 5 }]
  13759. * };
  13760. *
  13761. * _.merge(object, other);
  13762. * // => { 'a': [{ 'b': 2, 'c': 3 }, { 'd': 4, 'e': 5 }] }
  13763. */
  13764. var merge = createAssigner(function(object, source, srcIndex) {
  13765. baseMerge(object, source, srcIndex);
  13766. });
  13767. /**
  13768. * This method is like `_.merge` except that it accepts `customizer` which
  13769. * is invoked to produce the merged values of the destination and source
  13770. * properties. If `customizer` returns `undefined`, merging is handled by the
  13771. * method instead. The `customizer` is invoked with six arguments:
  13772. * (objValue, srcValue, key, object, source, stack).
  13773. *
  13774. * **Note:** This method mutates `object`.
  13775. *
  13776. * @static
  13777. * @memberOf _
  13778. * @since 4.0.0
  13779. * @category Object
  13780. * @param {Object} object The destination object.
  13781. * @param {...Object} sources The source objects.
  13782. * @param {Function} customizer The function to customize assigned values.
  13783. * @returns {Object} Returns `object`.
  13784. * @example
  13785. *
  13786. * function customizer(objValue, srcValue) {
  13787. * if (_.isArray(objValue)) {
  13788. * return objValue.concat(srcValue);
  13789. * }
  13790. * }
  13791. *
  13792. * var object = { 'a': [1], 'b': [2] };
  13793. * var other = { 'a': [3], 'b': [4] };
  13794. *
  13795. * _.mergeWith(object, other, customizer);
  13796. * // => { 'a': [1, 3], 'b': [2, 4] }
  13797. */
  13798. var mergeWith = createAssigner(function(object, source, srcIndex, customizer) {
  13799. baseMerge(object, source, srcIndex, customizer);
  13800. });
  13801. /**
  13802. * The opposite of `_.pick`; this method creates an object composed of the
  13803. * own and inherited enumerable property paths of `object` that are not omitted.
  13804. *
  13805. * **Note:** This method is considerably slower than `_.pick`.
  13806. *
  13807. * @static
  13808. * @since 0.1.0
  13809. * @memberOf _
  13810. * @category Object
  13811. * @param {Object} object The source object.
  13812. * @param {...(string|string[])} [paths] The property paths to omit.
  13813. * @returns {Object} Returns the new object.
  13814. * @example
  13815. *
  13816. * var object = { 'a': 1, 'b': '2', 'c': 3 };
  13817. *
  13818. * _.omit(object, ['a', 'c']);
  13819. * // => { 'b': '2' }
  13820. */
  13821. var omit = flatRest(function(object, paths) {
  13822. var result = {};
  13823. if (object == null) {
  13824. return result;
  13825. }
  13826. var isDeep = false;
  13827. paths = arrayMap(paths, function(path) {
  13828. path = castPath(path, object);
  13829. isDeep || (isDeep = path.length > 1);
  13830. return path;
  13831. });
  13832. copyObject(object, getAllKeysIn(object), result);
  13833. if (isDeep) {
  13834. result = baseClone(result, CLONE_DEEP_FLAG | CLONE_FLAT_FLAG | CLONE_SYMBOLS_FLAG, customOmitClone);
  13835. }
  13836. var length = paths.length;
  13837. while (length--) {
  13838. baseUnset(result, paths[length]);
  13839. }
  13840. return result;
  13841. });
  13842. /**
  13843. * The opposite of `_.pickBy`; this method creates an object composed of
  13844. * the own and inherited enumerable string keyed properties of `object` that
  13845. * `predicate` doesn't return truthy for. The predicate is invoked with two
  13846. * arguments: (value, key).
  13847. *
  13848. * @static
  13849. * @memberOf _
  13850. * @since 4.0.0
  13851. * @category Object
  13852. * @param {Object} object The source object.
  13853. * @param {Function} [predicate=_.identity] The function invoked per property.
  13854. * @returns {Object} Returns the new object.
  13855. * @example
  13856. *
  13857. * var object = { 'a': 1, 'b': '2', 'c': 3 };
  13858. *
  13859. * _.omitBy(object, _.isNumber);
  13860. * // => { 'b': '2' }
  13861. */
  13862. function omitBy(object, predicate) {
  13863. return pickBy(object, negate(getIteratee(predicate)));
  13864. }
  13865. /**
  13866. * Creates an object composed of the picked `object` properties.
  13867. *
  13868. * @static
  13869. * @since 0.1.0
  13870. * @memberOf _
  13871. * @category Object
  13872. * @param {Object} object The source object.
  13873. * @param {...(string|string[])} [paths] The property paths to pick.
  13874. * @returns {Object} Returns the new object.
  13875. * @example
  13876. *
  13877. * var object = { 'a': 1, 'b': '2', 'c': 3 };
  13878. *
  13879. * _.pick(object, ['a', 'c']);
  13880. * // => { 'a': 1, 'c': 3 }
  13881. */
  13882. var pick = flatRest(function(object, paths) {
  13883. return object == null ? {} : basePick(object, paths);
  13884. });
  13885. /**
  13886. * Creates an object composed of the `object` properties `predicate` returns
  13887. * truthy for. The predicate is invoked with two arguments: (value, key).
  13888. *
  13889. * @static
  13890. * @memberOf _
  13891. * @since 4.0.0
  13892. * @category Object
  13893. * @param {Object} object The source object.
  13894. * @param {Function} [predicate=_.identity] The function invoked per property.
  13895. * @returns {Object} Returns the new object.
  13896. * @example
  13897. *
  13898. * var object = { 'a': 1, 'b': '2', 'c': 3 };
  13899. *
  13900. * _.pickBy(object, _.isNumber);
  13901. * // => { 'a': 1, 'c': 3 }
  13902. */
  13903. function pickBy(object, predicate) {
  13904. if (object == null) {
  13905. return {};
  13906. }
  13907. var props = arrayMap(getAllKeysIn(object), function(prop) {
  13908. return [prop];
  13909. });
  13910. predicate = getIteratee(predicate);
  13911. return basePickBy(object, props, function(value, path) {
  13912. return predicate(value, path[0]);
  13913. });
  13914. }
  13915. /**
  13916. * This method is like `_.get` except that if the resolved value is a
  13917. * function it's invoked with the `this` binding of its parent object and
  13918. * its result is returned.
  13919. *
  13920. * @static
  13921. * @since 0.1.0
  13922. * @memberOf _
  13923. * @category Object
  13924. * @param {Object} object The object to query.
  13925. * @param {Array|string} path The path of the property to resolve.
  13926. * @param {*} [defaultValue] The value returned for `undefined` resolved values.
  13927. * @returns {*} Returns the resolved value.
  13928. * @example
  13929. *
  13930. * var object = { 'a': [{ 'b': { 'c1': 3, 'c2': _.constant(4) } }] };
  13931. *
  13932. * _.result(object, 'a[0].b.c1');
  13933. * // => 3
  13934. *
  13935. * _.result(object, 'a[0].b.c2');
  13936. * // => 4
  13937. *
  13938. * _.result(object, 'a[0].b.c3', 'default');
  13939. * // => 'default'
  13940. *
  13941. * _.result(object, 'a[0].b.c3', _.constant('default'));
  13942. * // => 'default'
  13943. */
  13944. function result(object, path, defaultValue) {
  13945. path = castPath(path, object);
  13946. var index = -1,
  13947. length = path.length;
  13948. // Ensure the loop is entered when path is empty.
  13949. if (!length) {
  13950. length = 1;
  13951. object = undefined;
  13952. }
  13953. while (++index < length) {
  13954. var value = object == null ? undefined : object[toKey(path[index])];
  13955. if (value === undefined) {
  13956. index = length;
  13957. value = defaultValue;
  13958. }
  13959. object = isFunction(value) ? value.call(object) : value;
  13960. }
  13961. return object;
  13962. }
  13963. /**
  13964. * Sets the value at `path` of `object`. If a portion of `path` doesn't exist,
  13965. * it's created. Arrays are created for missing index properties while objects
  13966. * are created for all other missing properties. Use `_.setWith` to customize
  13967. * `path` creation.
  13968. *
  13969. * **Note:** This method mutates `object`.
  13970. *
  13971. * @static
  13972. * @memberOf _
  13973. * @since 3.7.0
  13974. * @category Object
  13975. * @param {Object} object The object to modify.
  13976. * @param {Array|string} path The path of the property to set.
  13977. * @param {*} value The value to set.
  13978. * @returns {Object} Returns `object`.
  13979. * @example
  13980. *
  13981. * var object = { 'a': [{ 'b': { 'c': 3 } }] };
  13982. *
  13983. * _.set(object, 'a[0].b.c', 4);
  13984. * console.log(object.a[0].b.c);
  13985. * // => 4
  13986. *
  13987. * _.set(object, ['x', '0', 'y', 'z'], 5);
  13988. * console.log(object.x[0].y.z);
  13989. * // => 5
  13990. */
  13991. function set(object, path, value) {
  13992. return object == null ? object : baseSet(object, path, value);
  13993. }
  13994. /**
  13995. * This method is like `_.set` except that it accepts `customizer` which is
  13996. * invoked to produce the objects of `path`. If `customizer` returns `undefined`
  13997. * path creation is handled by the method instead. The `customizer` is invoked
  13998. * with three arguments: (nsValue, key, nsObject).
  13999. *
  14000. * **Note:** This method mutates `object`.
  14001. *
  14002. * @static
  14003. * @memberOf _
  14004. * @since 4.0.0
  14005. * @category Object
  14006. * @param {Object} object The object to modify.
  14007. * @param {Array|string} path The path of the property to set.
  14008. * @param {*} value The value to set.
  14009. * @param {Function} [customizer] The function to customize assigned values.
  14010. * @returns {Object} Returns `object`.
  14011. * @example
  14012. *
  14013. * var object = {};
  14014. *
  14015. * _.setWith(object, '[0][1]', 'a', Object);
  14016. * // => { '0': { '1': 'a' } }
  14017. */
  14018. function setWith(object, path, value, customizer) {
  14019. customizer = typeof customizer == 'function' ? customizer : undefined;
  14020. return object == null ? object : baseSet(object, path, value, customizer);
  14021. }
  14022. /**
  14023. * Creates an array of own enumerable string keyed-value pairs for `object`
  14024. * which can be consumed by `_.fromPairs`. If `object` is a map or set, its
  14025. * entries are returned.
  14026. *
  14027. * @static
  14028. * @memberOf _
  14029. * @since 4.0.0
  14030. * @alias entries
  14031. * @category Object
  14032. * @param {Object} object The object to query.
  14033. * @returns {Array} Returns the key-value pairs.
  14034. * @example
  14035. *
  14036. * function Foo() {
  14037. * this.a = 1;
  14038. * this.b = 2;
  14039. * }
  14040. *
  14041. * Foo.prototype.c = 3;
  14042. *
  14043. * _.toPairs(new Foo);
  14044. * // => [['a', 1], ['b', 2]] (iteration order is not guaranteed)
  14045. */
  14046. var toPairs = createToPairs(keys);
  14047. /**
  14048. * Creates an array of own and inherited enumerable string keyed-value pairs
  14049. * for `object` which can be consumed by `_.fromPairs`. If `object` is a map
  14050. * or set, its entries are returned.
  14051. *
  14052. * @static
  14053. * @memberOf _
  14054. * @since 4.0.0
  14055. * @alias entriesIn
  14056. * @category Object
  14057. * @param {Object} object The object to query.
  14058. * @returns {Array} Returns the key-value pairs.
  14059. * @example
  14060. *
  14061. * function Foo() {
  14062. * this.a = 1;
  14063. * this.b = 2;
  14064. * }
  14065. *
  14066. * Foo.prototype.c = 3;
  14067. *
  14068. * _.toPairsIn(new Foo);
  14069. * // => [['a', 1], ['b', 2], ['c', 3]] (iteration order is not guaranteed)
  14070. */
  14071. var toPairsIn = createToPairs(keysIn);
  14072. /**
  14073. * An alternative to `_.reduce`; this method transforms `object` to a new
  14074. * `accumulator` object which is the result of running each of its own
  14075. * enumerable string keyed properties thru `iteratee`, with each invocation
  14076. * potentially mutating the `accumulator` object. If `accumulator` is not
  14077. * provided, a new object with the same `[[Prototype]]` will be used. The
  14078. * iteratee is invoked with four arguments: (accumulator, value, key, object).
  14079. * Iteratee functions may exit iteration early by explicitly returning `false`.
  14080. *
  14081. * @static
  14082. * @memberOf _
  14083. * @since 1.3.0
  14084. * @category Object
  14085. * @param {Object} object The object to iterate over.
  14086. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  14087. * @param {*} [accumulator] The custom accumulator value.
  14088. * @returns {*} Returns the accumulated value.
  14089. * @example
  14090. *
  14091. * _.transform([2, 3, 4], function(result, n) {
  14092. * result.push(n *= n);
  14093. * return n % 2 == 0;
  14094. * }, []);
  14095. * // => [4, 9]
  14096. *
  14097. * _.transform({ 'a': 1, 'b': 2, 'c': 1 }, function(result, value, key) {
  14098. * (result[value] || (result[value] = [])).push(key);
  14099. * }, {});
  14100. * // => { '1': ['a', 'c'], '2': ['b'] }
  14101. */
  14102. function transform(object, iteratee, accumulator) {
  14103. var isArr = isArray(object),
  14104. isArrLike = isArr || isBuffer(object) || isTypedArray(object);
  14105. iteratee = getIteratee(iteratee, 4);
  14106. if (accumulator == null) {
  14107. var Ctor = object && object.constructor;
  14108. if (isArrLike) {
  14109. accumulator = isArr ? new Ctor : [];
  14110. }
  14111. else if (isObject(object)) {
  14112. accumulator = isFunction(Ctor) ? baseCreate(getPrototype(object)) : {};
  14113. }
  14114. else {
  14115. accumulator = {};
  14116. }
  14117. }
  14118. (isArrLike ? arrayEach : baseForOwn)(object, function(value, index, object) {
  14119. return iteratee(accumulator, value, index, object);
  14120. });
  14121. return accumulator;
  14122. }
  14123. /**
  14124. * Removes the property at `path` of `object`.
  14125. *
  14126. * **Note:** This method mutates `object`.
  14127. *
  14128. * @static
  14129. * @memberOf _
  14130. * @since 4.0.0
  14131. * @category Object
  14132. * @param {Object} object The object to modify.
  14133. * @param {Array|string} path The path of the property to unset.
  14134. * @returns {boolean} Returns `true` if the property is deleted, else `false`.
  14135. * @example
  14136. *
  14137. * var object = { 'a': [{ 'b': { 'c': 7 } }] };
  14138. * _.unset(object, 'a[0].b.c');
  14139. * // => true
  14140. *
  14141. * console.log(object);
  14142. * // => { 'a': [{ 'b': {} }] };
  14143. *
  14144. * _.unset(object, ['a', '0', 'b', 'c']);
  14145. * // => true
  14146. *
  14147. * console.log(object);
  14148. * // => { 'a': [{ 'b': {} }] };
  14149. */
  14150. function unset(object, path) {
  14151. return object == null ? true : baseUnset(object, path);
  14152. }
  14153. /**
  14154. * This method is like `_.set` except that accepts `updater` to produce the
  14155. * value to set. Use `_.updateWith` to customize `path` creation. The `updater`
  14156. * is invoked with one argument: (value).
  14157. *
  14158. * **Note:** This method mutates `object`.
  14159. *
  14160. * @static
  14161. * @memberOf _
  14162. * @since 4.6.0
  14163. * @category Object
  14164. * @param {Object} object The object to modify.
  14165. * @param {Array|string} path The path of the property to set.
  14166. * @param {Function} updater The function to produce the updated value.
  14167. * @returns {Object} Returns `object`.
  14168. * @example
  14169. *
  14170. * var object = { 'a': [{ 'b': { 'c': 3 } }] };
  14171. *
  14172. * _.update(object, 'a[0].b.c', function(n) { return n * n; });
  14173. * console.log(object.a[0].b.c);
  14174. * // => 9
  14175. *
  14176. * _.update(object, 'x[0].y.z', function(n) { return n ? n + 1 : 0; });
  14177. * console.log(object.x[0].y.z);
  14178. * // => 0
  14179. */
  14180. function update(object, path, updater) {
  14181. return object == null ? object : baseUpdate(object, path, castFunction(updater));
  14182. }
  14183. /**
  14184. * This method is like `_.update` except that it accepts `customizer` which is
  14185. * invoked to produce the objects of `path`. If `customizer` returns `undefined`
  14186. * path creation is handled by the method instead. The `customizer` is invoked
  14187. * with three arguments: (nsValue, key, nsObject).
  14188. *
  14189. * **Note:** This method mutates `object`.
  14190. *
  14191. * @static
  14192. * @memberOf _
  14193. * @since 4.6.0
  14194. * @category Object
  14195. * @param {Object} object The object to modify.
  14196. * @param {Array|string} path The path of the property to set.
  14197. * @param {Function} updater The function to produce the updated value.
  14198. * @param {Function} [customizer] The function to customize assigned values.
  14199. * @returns {Object} Returns `object`.
  14200. * @example
  14201. *
  14202. * var object = {};
  14203. *
  14204. * _.updateWith(object, '[0][1]', _.constant('a'), Object);
  14205. * // => { '0': { '1': 'a' } }
  14206. */
  14207. function updateWith(object, path, updater, customizer) {
  14208. customizer = typeof customizer == 'function' ? customizer : undefined;
  14209. return object == null ? object : baseUpdate(object, path, castFunction(updater), customizer);
  14210. }
  14211. /**
  14212. * Creates an array of the own enumerable string keyed property values of `object`.
  14213. *
  14214. * **Note:** Non-object values are coerced to objects.
  14215. *
  14216. * @static
  14217. * @since 0.1.0
  14218. * @memberOf _
  14219. * @category Object
  14220. * @param {Object} object The object to query.
  14221. * @returns {Array} Returns the array of property values.
  14222. * @example
  14223. *
  14224. * function Foo() {
  14225. * this.a = 1;
  14226. * this.b = 2;
  14227. * }
  14228. *
  14229. * Foo.prototype.c = 3;
  14230. *
  14231. * _.values(new Foo);
  14232. * // => [1, 2] (iteration order is not guaranteed)
  14233. *
  14234. * _.values('hi');
  14235. * // => ['h', 'i']
  14236. */
  14237. function values(object) {
  14238. return object == null ? [] : baseValues(object, keys(object));
  14239. }
  14240. /**
  14241. * Creates an array of the own and inherited enumerable string keyed property
  14242. * values of `object`.
  14243. *
  14244. * **Note:** Non-object values are coerced to objects.
  14245. *
  14246. * @static
  14247. * @memberOf _
  14248. * @since 3.0.0
  14249. * @category Object
  14250. * @param {Object} object The object to query.
  14251. * @returns {Array} Returns the array of property values.
  14252. * @example
  14253. *
  14254. * function Foo() {
  14255. * this.a = 1;
  14256. * this.b = 2;
  14257. * }
  14258. *
  14259. * Foo.prototype.c = 3;
  14260. *
  14261. * _.valuesIn(new Foo);
  14262. * // => [1, 2, 3] (iteration order is not guaranteed)
  14263. */
  14264. function valuesIn(object) {
  14265. return object == null ? [] : baseValues(object, keysIn(object));
  14266. }
  14267. /*------------------------------------------------------------------------*/
  14268. /**
  14269. * Clamps `number` within the inclusive `lower` and `upper` bounds.
  14270. *
  14271. * @static
  14272. * @memberOf _
  14273. * @since 4.0.0
  14274. * @category Number
  14275. * @param {number} number The number to clamp.
  14276. * @param {number} [lower] The lower bound.
  14277. * @param {number} upper The upper bound.
  14278. * @returns {number} Returns the clamped number.
  14279. * @example
  14280. *
  14281. * _.clamp(-10, -5, 5);
  14282. * // => -5
  14283. *
  14284. * _.clamp(10, -5, 5);
  14285. * // => 5
  14286. */
  14287. function clamp(number, lower, upper) {
  14288. if (upper === undefined) {
  14289. upper = lower;
  14290. lower = undefined;
  14291. }
  14292. if (upper !== undefined) {
  14293. upper = toNumber(upper);
  14294. upper = upper === upper ? upper : 0;
  14295. }
  14296. if (lower !== undefined) {
  14297. lower = toNumber(lower);
  14298. lower = lower === lower ? lower : 0;
  14299. }
  14300. return baseClamp(toNumber(number), lower, upper);
  14301. }
  14302. /**
  14303. * Checks if `n` is between `start` and up to, but not including, `end`. If
  14304. * `end` is not specified, it's set to `start` with `start` then set to `0`.
  14305. * If `start` is greater than `end` the params are swapped to support
  14306. * negative ranges.
  14307. *
  14308. * @static
  14309. * @memberOf _
  14310. * @since 3.3.0
  14311. * @category Number
  14312. * @param {number} number The number to check.
  14313. * @param {number} [start=0] The start of the range.
  14314. * @param {number} end The end of the range.
  14315. * @returns {boolean} Returns `true` if `number` is in the range, else `false`.
  14316. * @see _.range, _.rangeRight
  14317. * @example
  14318. *
  14319. * _.inRange(3, 2, 4);
  14320. * // => true
  14321. *
  14322. * _.inRange(4, 8);
  14323. * // => true
  14324. *
  14325. * _.inRange(4, 2);
  14326. * // => false
  14327. *
  14328. * _.inRange(2, 2);
  14329. * // => false
  14330. *
  14331. * _.inRange(1.2, 2);
  14332. * // => true
  14333. *
  14334. * _.inRange(5.2, 4);
  14335. * // => false
  14336. *
  14337. * _.inRange(-3, -2, -6);
  14338. * // => true
  14339. */
  14340. function inRange(number, start, end) {
  14341. start = toFinite(start);
  14342. if (end === undefined) {
  14343. end = start;
  14344. start = 0;
  14345. } else {
  14346. end = toFinite(end);
  14347. }
  14348. number = toNumber(number);
  14349. return baseInRange(number, start, end);
  14350. }
  14351. /**
  14352. * Produces a random number between the inclusive `lower` and `upper` bounds.
  14353. * If only one argument is provided a number between `0` and the given number
  14354. * is returned. If `floating` is `true`, or either `lower` or `upper` are
  14355. * floats, a floating-point number is returned instead of an integer.
  14356. *
  14357. * **Note:** JavaScript follows the IEEE-754 standard for resolving
  14358. * floating-point values which can produce unexpected results.
  14359. *
  14360. * @static
  14361. * @memberOf _
  14362. * @since 0.7.0
  14363. * @category Number
  14364. * @param {number} [lower=0] The lower bound.
  14365. * @param {number} [upper=1] The upper bound.
  14366. * @param {boolean} [floating] Specify returning a floating-point number.
  14367. * @returns {number} Returns the random number.
  14368. * @example
  14369. *
  14370. * _.random(0, 5);
  14371. * // => an integer between 0 and 5
  14372. *
  14373. * _.random(5);
  14374. * // => also an integer between 0 and 5
  14375. *
  14376. * _.random(5, true);
  14377. * // => a floating-point number between 0 and 5
  14378. *
  14379. * _.random(1.2, 5.2);
  14380. * // => a floating-point number between 1.2 and 5.2
  14381. */
  14382. function random(lower, upper, floating) {
  14383. if (floating && typeof floating != 'boolean' && isIterateeCall(lower, upper, floating)) {
  14384. upper = floating = undefined;
  14385. }
  14386. if (floating === undefined) {
  14387. if (typeof upper == 'boolean') {
  14388. floating = upper;
  14389. upper = undefined;
  14390. }
  14391. else if (typeof lower == 'boolean') {
  14392. floating = lower;
  14393. lower = undefined;
  14394. }
  14395. }
  14396. if (lower === undefined && upper === undefined) {
  14397. lower = 0;
  14398. upper = 1;
  14399. }
  14400. else {
  14401. lower = toFinite(lower);
  14402. if (upper === undefined) {
  14403. upper = lower;
  14404. lower = 0;
  14405. } else {
  14406. upper = toFinite(upper);
  14407. }
  14408. }
  14409. if (lower > upper) {
  14410. var temp = lower;
  14411. lower = upper;
  14412. upper = temp;
  14413. }
  14414. if (floating || lower % 1 || upper % 1) {
  14415. var rand = nativeRandom();
  14416. return nativeMin(lower + (rand * (upper - lower + freeParseFloat('1e-' + ((rand + '').length - 1)))), upper);
  14417. }
  14418. return baseRandom(lower, upper);
  14419. }
  14420. /*------------------------------------------------------------------------*/
  14421. /**
  14422. * Converts `string` to [camel case](https://en.wikipedia.org/wiki/CamelCase).
  14423. *
  14424. * @static
  14425. * @memberOf _
  14426. * @since 3.0.0
  14427. * @category String
  14428. * @param {string} [string=''] The string to convert.
  14429. * @returns {string} Returns the camel cased string.
  14430. * @example
  14431. *
  14432. * _.camelCase('Foo Bar');
  14433. * // => 'fooBar'
  14434. *
  14435. * _.camelCase('--foo-bar--');
  14436. * // => 'fooBar'
  14437. *
  14438. * _.camelCase('__FOO_BAR__');
  14439. * // => 'fooBar'
  14440. */
  14441. var camelCase = createCompounder(function(result, word, index) {
  14442. word = word.toLowerCase();
  14443. return result + (index ? capitalize(word) : word);
  14444. });
  14445. /**
  14446. * Converts the first character of `string` to upper case and the remaining
  14447. * to lower case.
  14448. *
  14449. * @static
  14450. * @memberOf _
  14451. * @since 3.0.0
  14452. * @category String
  14453. * @param {string} [string=''] The string to capitalize.
  14454. * @returns {string} Returns the capitalized string.
  14455. * @example
  14456. *
  14457. * _.capitalize('FRED');
  14458. * // => 'Fred'
  14459. */
  14460. function capitalize(string) {
  14461. return upperFirst(toString(string).toLowerCase());
  14462. }
  14463. /**
  14464. * Deburrs `string` by converting
  14465. * [Latin-1 Supplement](https://en.wikipedia.org/wiki/Latin-1_Supplement_(Unicode_block)#Character_table)
  14466. * and [Latin Extended-A](https://en.wikipedia.org/wiki/Latin_Extended-A)
  14467. * letters to basic Latin letters and removing
  14468. * [combining diacritical marks](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks).
  14469. *
  14470. * @static
  14471. * @memberOf _
  14472. * @since 3.0.0
  14473. * @category String
  14474. * @param {string} [string=''] The string to deburr.
  14475. * @returns {string} Returns the deburred string.
  14476. * @example
  14477. *
  14478. * _.deburr('déjà vu');
  14479. * // => 'deja vu'
  14480. */
  14481. function deburr(string) {
  14482. string = toString(string);
  14483. return string && string.replace(reLatin, deburrLetter).replace(reComboMark, '');
  14484. }
  14485. /**
  14486. * Checks if `string` ends with the given target string.
  14487. *
  14488. * @static
  14489. * @memberOf _
  14490. * @since 3.0.0
  14491. * @category String
  14492. * @param {string} [string=''] The string to inspect.
  14493. * @param {string} [target] The string to search for.
  14494. * @param {number} [position=string.length] The position to search up to.
  14495. * @returns {boolean} Returns `true` if `string` ends with `target`,
  14496. * else `false`.
  14497. * @example
  14498. *
  14499. * _.endsWith('abc', 'c');
  14500. * // => true
  14501. *
  14502. * _.endsWith('abc', 'b');
  14503. * // => false
  14504. *
  14505. * _.endsWith('abc', 'b', 2);
  14506. * // => true
  14507. */
  14508. function endsWith(string, target, position) {
  14509. string = toString(string);
  14510. target = baseToString(target);
  14511. var length = string.length;
  14512. position = position === undefined
  14513. ? length
  14514. : baseClamp(toInteger(position), 0, length);
  14515. var end = position;
  14516. position -= target.length;
  14517. return position >= 0 && string.slice(position, end) == target;
  14518. }
  14519. /**
  14520. * Converts the characters "&", "<", ">", '"', and "'" in `string` to their
  14521. * corresponding HTML entities.
  14522. *
  14523. * **Note:** No other characters are escaped. To escape additional
  14524. * characters use a third-party library like [_he_](https://mths.be/he).
  14525. *
  14526. * Though the ">" character is escaped for symmetry, characters like
  14527. * ">" and "/" don't need escaping in HTML and have no special meaning
  14528. * unless they're part of a tag or unquoted attribute value. See
  14529. * [Mathias Bynens's article](https://mathiasbynens.be/notes/ambiguous-ampersands)
  14530. * (under "semi-related fun fact") for more details.
  14531. *
  14532. * When working with HTML you should always
  14533. * [quote attribute values](http://wonko.com/post/html-escaping) to reduce
  14534. * XSS vectors.
  14535. *
  14536. * @static
  14537. * @since 0.1.0
  14538. * @memberOf _
  14539. * @category String
  14540. * @param {string} [string=''] The string to escape.
  14541. * @returns {string} Returns the escaped string.
  14542. * @example
  14543. *
  14544. * _.escape('fred, barney, & pebbles');
  14545. * // => 'fred, barney, &amp; pebbles'
  14546. */
  14547. function escape(string) {
  14548. string = toString(string);
  14549. return (string && reHasUnescapedHtml.test(string))
  14550. ? string.replace(reUnescapedHtml, escapeHtmlChar)
  14551. : string;
  14552. }
  14553. /**
  14554. * Escapes the `RegExp` special characters "^", "$", "\", ".", "*", "+",
  14555. * "?", "(", ")", "[", "]", "{", "}", and "|" in `string`.
  14556. *
  14557. * @static
  14558. * @memberOf _
  14559. * @since 3.0.0
  14560. * @category String
  14561. * @param {string} [string=''] The string to escape.
  14562. * @returns {string} Returns the escaped string.
  14563. * @example
  14564. *
  14565. * _.escapeRegExp('[lodash](https://lodash.com/)');
  14566. * // => '\[lodash\]\(https://lodash\.com/\)'
  14567. */
  14568. function escapeRegExp(string) {
  14569. string = toString(string);
  14570. return (string && reHasRegExpChar.test(string))
  14571. ? string.replace(reRegExpChar, '\\$&')
  14572. : string;
  14573. }
  14574. /**
  14575. * Converts `string` to
  14576. * [kebab case](https://en.wikipedia.org/wiki/Letter_case#Special_case_styles).
  14577. *
  14578. * @static
  14579. * @memberOf _
  14580. * @since 3.0.0
  14581. * @category String
  14582. * @param {string} [string=''] The string to convert.
  14583. * @returns {string} Returns the kebab cased string.
  14584. * @example
  14585. *
  14586. * _.kebabCase('Foo Bar');
  14587. * // => 'foo-bar'
  14588. *
  14589. * _.kebabCase('fooBar');
  14590. * // => 'foo-bar'
  14591. *
  14592. * _.kebabCase('__FOO_BAR__');
  14593. * // => 'foo-bar'
  14594. */
  14595. var kebabCase = createCompounder(function(result, word, index) {
  14596. return result + (index ? '-' : '') + word.toLowerCase();
  14597. });
  14598. /**
  14599. * Converts `string`, as space separated words, to lower case.
  14600. *
  14601. * @static
  14602. * @memberOf _
  14603. * @since 4.0.0
  14604. * @category String
  14605. * @param {string} [string=''] The string to convert.
  14606. * @returns {string} Returns the lower cased string.
  14607. * @example
  14608. *
  14609. * _.lowerCase('--Foo-Bar--');
  14610. * // => 'foo bar'
  14611. *
  14612. * _.lowerCase('fooBar');
  14613. * // => 'foo bar'
  14614. *
  14615. * _.lowerCase('__FOO_BAR__');
  14616. * // => 'foo bar'
  14617. */
  14618. var lowerCase = createCompounder(function(result, word, index) {
  14619. return result + (index ? ' ' : '') + word.toLowerCase();
  14620. });
  14621. /**
  14622. * Converts the first character of `string` to lower case.
  14623. *
  14624. * @static
  14625. * @memberOf _
  14626. * @since 4.0.0
  14627. * @category String
  14628. * @param {string} [string=''] The string to convert.
  14629. * @returns {string} Returns the converted string.
  14630. * @example
  14631. *
  14632. * _.lowerFirst('Fred');
  14633. * // => 'fred'
  14634. *
  14635. * _.lowerFirst('FRED');
  14636. * // => 'fRED'
  14637. */
  14638. var lowerFirst = createCaseFirst('toLowerCase');
  14639. /**
  14640. * Pads `string` on the left and right sides if it's shorter than `length`.
  14641. * Padding characters are truncated if they can't be evenly divided by `length`.
  14642. *
  14643. * @static
  14644. * @memberOf _
  14645. * @since 3.0.0
  14646. * @category String
  14647. * @param {string} [string=''] The string to pad.
  14648. * @param {number} [length=0] The padding length.
  14649. * @param {string} [chars=' '] The string used as padding.
  14650. * @returns {string} Returns the padded string.
  14651. * @example
  14652. *
  14653. * _.pad('abc', 8);
  14654. * // => ' abc '
  14655. *
  14656. * _.pad('abc', 8, '_-');
  14657. * // => '_-abc_-_'
  14658. *
  14659. * _.pad('abc', 3);
  14660. * // => 'abc'
  14661. */
  14662. function pad(string, length, chars) {
  14663. string = toString(string);
  14664. length = toInteger(length);
  14665. var strLength = length ? stringSize(string) : 0;
  14666. if (!length || strLength >= length) {
  14667. return string;
  14668. }
  14669. var mid = (length - strLength) / 2;
  14670. return (
  14671. createPadding(nativeFloor(mid), chars) +
  14672. string +
  14673. createPadding(nativeCeil(mid), chars)
  14674. );
  14675. }
  14676. /**
  14677. * Pads `string` on the right side if it's shorter than `length`. Padding
  14678. * characters are truncated if they exceed `length`.
  14679. *
  14680. * @static
  14681. * @memberOf _
  14682. * @since 4.0.0
  14683. * @category String
  14684. * @param {string} [string=''] The string to pad.
  14685. * @param {number} [length=0] The padding length.
  14686. * @param {string} [chars=' '] The string used as padding.
  14687. * @returns {string} Returns the padded string.
  14688. * @example
  14689. *
  14690. * _.padEnd('abc', 6);
  14691. * // => 'abc '
  14692. *
  14693. * _.padEnd('abc', 6, '_-');
  14694. * // => 'abc_-_'
  14695. *
  14696. * _.padEnd('abc', 3);
  14697. * // => 'abc'
  14698. */
  14699. function padEnd(string, length, chars) {
  14700. string = toString(string);
  14701. length = toInteger(length);
  14702. var strLength = length ? stringSize(string) : 0;
  14703. return (length && strLength < length)
  14704. ? (string + createPadding(length - strLength, chars))
  14705. : string;
  14706. }
  14707. /**
  14708. * Pads `string` on the left side if it's shorter than `length`. Padding
  14709. * characters are truncated if they exceed `length`.
  14710. *
  14711. * @static
  14712. * @memberOf _
  14713. * @since 4.0.0
  14714. * @category String
  14715. * @param {string} [string=''] The string to pad.
  14716. * @param {number} [length=0] The padding length.
  14717. * @param {string} [chars=' '] The string used as padding.
  14718. * @returns {string} Returns the padded string.
  14719. * @example
  14720. *
  14721. * _.padStart('abc', 6);
  14722. * // => ' abc'
  14723. *
  14724. * _.padStart('abc', 6, '_-');
  14725. * // => '_-_abc'
  14726. *
  14727. * _.padStart('abc', 3);
  14728. * // => 'abc'
  14729. */
  14730. function padStart(string, length, chars) {
  14731. string = toString(string);
  14732. length = toInteger(length);
  14733. var strLength = length ? stringSize(string) : 0;
  14734. return (length && strLength < length)
  14735. ? (createPadding(length - strLength, chars) + string)
  14736. : string;
  14737. }
  14738. /**
  14739. * Converts `string` to an integer of the specified radix. If `radix` is
  14740. * `undefined` or `0`, a `radix` of `10` is used unless `value` is a
  14741. * hexadecimal, in which case a `radix` of `16` is used.
  14742. *
  14743. * **Note:** This method aligns with the
  14744. * [ES5 implementation](https://es5.github.io/#x15.1.2.2) of `parseInt`.
  14745. *
  14746. * @static
  14747. * @memberOf _
  14748. * @since 1.1.0
  14749. * @category String
  14750. * @param {string} string The string to convert.
  14751. * @param {number} [radix=10] The radix to interpret `value` by.
  14752. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  14753. * @returns {number} Returns the converted integer.
  14754. * @example
  14755. *
  14756. * _.parseInt('08');
  14757. * // => 8
  14758. *
  14759. * _.map(['6', '08', '10'], _.parseInt);
  14760. * // => [6, 8, 10]
  14761. */
  14762. function parseInt(string, radix, guard) {
  14763. if (guard || radix == null) {
  14764. radix = 0;
  14765. } else if (radix) {
  14766. radix = +radix;
  14767. }
  14768. return nativeParseInt(toString(string).replace(reTrimStart, ''), radix || 0);
  14769. }
  14770. /**
  14771. * Repeats the given string `n` times.
  14772. *
  14773. * @static
  14774. * @memberOf _
  14775. * @since 3.0.0
  14776. * @category String
  14777. * @param {string} [string=''] The string to repeat.
  14778. * @param {number} [n=1] The number of times to repeat the string.
  14779. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  14780. * @returns {string} Returns the repeated string.
  14781. * @example
  14782. *
  14783. * _.repeat('*', 3);
  14784. * // => '***'
  14785. *
  14786. * _.repeat('abc', 2);
  14787. * // => 'abcabc'
  14788. *
  14789. * _.repeat('abc', 0);
  14790. * // => ''
  14791. */
  14792. function repeat(string, n, guard) {
  14793. if ((guard ? isIterateeCall(string, n, guard) : n === undefined)) {
  14794. n = 1;
  14795. } else {
  14796. n = toInteger(n);
  14797. }
  14798. return baseRepeat(toString(string), n);
  14799. }
  14800. /**
  14801. * Replaces matches for `pattern` in `string` with `replacement`.
  14802. *
  14803. * **Note:** This method is based on
  14804. * [`String#replace`](https://mdn.io/String/replace).
  14805. *
  14806. * @static
  14807. * @memberOf _
  14808. * @since 4.0.0
  14809. * @category String
  14810. * @param {string} [string=''] The string to modify.
  14811. * @param {RegExp|string} pattern The pattern to replace.
  14812. * @param {Function|string} replacement The match replacement.
  14813. * @returns {string} Returns the modified string.
  14814. * @example
  14815. *
  14816. * _.replace('Hi Fred', 'Fred', 'Barney');
  14817. * // => 'Hi Barney'
  14818. */
  14819. function replace() {
  14820. var args = arguments,
  14821. string = toString(args[0]);
  14822. return args.length < 3 ? string : string.replace(args[1], args[2]);
  14823. }
  14824. /**
  14825. * Converts `string` to
  14826. * [snake case](https://en.wikipedia.org/wiki/Snake_case).
  14827. *
  14828. * @static
  14829. * @memberOf _
  14830. * @since 3.0.0
  14831. * @category String
  14832. * @param {string} [string=''] The string to convert.
  14833. * @returns {string} Returns the snake cased string.
  14834. * @example
  14835. *
  14836. * _.snakeCase('Foo Bar');
  14837. * // => 'foo_bar'
  14838. *
  14839. * _.snakeCase('fooBar');
  14840. * // => 'foo_bar'
  14841. *
  14842. * _.snakeCase('--FOO-BAR--');
  14843. * // => 'foo_bar'
  14844. */
  14845. var snakeCase = createCompounder(function(result, word, index) {
  14846. return result + (index ? '_' : '') + word.toLowerCase();
  14847. });
  14848. /**
  14849. * Splits `string` by `separator`.
  14850. *
  14851. * **Note:** This method is based on
  14852. * [`String#split`](https://mdn.io/String/split).
  14853. *
  14854. * @static
  14855. * @memberOf _
  14856. * @since 4.0.0
  14857. * @category String
  14858. * @param {string} [string=''] The string to split.
  14859. * @param {RegExp|string} separator The separator pattern to split by.
  14860. * @param {number} [limit] The length to truncate results to.
  14861. * @returns {Array} Returns the string segments.
  14862. * @example
  14863. *
  14864. * _.split('a-b-c', '-', 2);
  14865. * // => ['a', 'b']
  14866. */
  14867. function split(string, separator, limit) {
  14868. if (limit && typeof limit != 'number' && isIterateeCall(string, separator, limit)) {
  14869. separator = limit = undefined;
  14870. }
  14871. limit = limit === undefined ? MAX_ARRAY_LENGTH : limit >>> 0;
  14872. if (!limit) {
  14873. return [];
  14874. }
  14875. string = toString(string);
  14876. if (string && (
  14877. typeof separator == 'string' ||
  14878. (separator != null && !isRegExp(separator))
  14879. )) {
  14880. separator = baseToString(separator);
  14881. if (!separator && hasUnicode(string)) {
  14882. return castSlice(stringToArray(string), 0, limit);
  14883. }
  14884. }
  14885. return string.split(separator, limit);
  14886. }
  14887. /**
  14888. * Converts `string` to
  14889. * [start case](https://en.wikipedia.org/wiki/Letter_case#Stylistic_or_specialised_usage).
  14890. *
  14891. * @static
  14892. * @memberOf _
  14893. * @since 3.1.0
  14894. * @category String
  14895. * @param {string} [string=''] The string to convert.
  14896. * @returns {string} Returns the start cased string.
  14897. * @example
  14898. *
  14899. * _.startCase('--foo-bar--');
  14900. * // => 'Foo Bar'
  14901. *
  14902. * _.startCase('fooBar');
  14903. * // => 'Foo Bar'
  14904. *
  14905. * _.startCase('__FOO_BAR__');
  14906. * // => 'FOO BAR'
  14907. */
  14908. var startCase = createCompounder(function(result, word, index) {
  14909. return result + (index ? ' ' : '') + upperFirst(word);
  14910. });
  14911. /**
  14912. * Checks if `string` starts with the given target string.
  14913. *
  14914. * @static
  14915. * @memberOf _
  14916. * @since 3.0.0
  14917. * @category String
  14918. * @param {string} [string=''] The string to inspect.
  14919. * @param {string} [target] The string to search for.
  14920. * @param {number} [position=0] The position to search from.
  14921. * @returns {boolean} Returns `true` if `string` starts with `target`,
  14922. * else `false`.
  14923. * @example
  14924. *
  14925. * _.startsWith('abc', 'a');
  14926. * // => true
  14927. *
  14928. * _.startsWith('abc', 'b');
  14929. * // => false
  14930. *
  14931. * _.startsWith('abc', 'b', 1);
  14932. * // => true
  14933. */
  14934. function startsWith(string, target, position) {
  14935. string = toString(string);
  14936. position = position == null
  14937. ? 0
  14938. : baseClamp(toInteger(position), 0, string.length);
  14939. target = baseToString(target);
  14940. return string.slice(position, position + target.length) == target;
  14941. }
  14942. /**
  14943. * Creates a compiled template function that can interpolate data properties
  14944. * in "interpolate" delimiters, HTML-escape interpolated data properties in
  14945. * "escape" delimiters, and execute JavaScript in "evaluate" delimiters. Data
  14946. * properties may be accessed as free variables in the template. If a setting
  14947. * object is given, it takes precedence over `_.templateSettings` values.
  14948. *
  14949. * **Note:** In the development build `_.template` utilizes
  14950. * [sourceURLs](http://www.html5rocks.com/en/tutorials/developertools/sourcemaps/#toc-sourceurl)
  14951. * for easier debugging.
  14952. *
  14953. * For more information on precompiling templates see
  14954. * [lodash's custom builds documentation](https://lodash.com/custom-builds).
  14955. *
  14956. * For more information on Chrome extension sandboxes see
  14957. * [Chrome's extensions documentation](https://developer.chrome.com/extensions/sandboxingEval).
  14958. *
  14959. * @static
  14960. * @since 0.1.0
  14961. * @memberOf _
  14962. * @category String
  14963. * @param {string} [string=''] The template string.
  14964. * @param {Object} [options={}] The options object.
  14965. * @param {RegExp} [options.escape=_.templateSettings.escape]
  14966. * The HTML "escape" delimiter.
  14967. * @param {RegExp} [options.evaluate=_.templateSettings.evaluate]
  14968. * The "evaluate" delimiter.
  14969. * @param {Object} [options.imports=_.templateSettings.imports]
  14970. * An object to import into the template as free variables.
  14971. * @param {RegExp} [options.interpolate=_.templateSettings.interpolate]
  14972. * The "interpolate" delimiter.
  14973. * @param {string} [options.sourceURL='lodash.templateSources[n]']
  14974. * The sourceURL of the compiled template.
  14975. * @param {string} [options.variable='obj']
  14976. * The data object variable name.
  14977. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  14978. * @returns {Function} Returns the compiled template function.
  14979. * @example
  14980. *
  14981. * // Use the "interpolate" delimiter to create a compiled template.
  14982. * var compiled = _.template('hello <%= user %>!');
  14983. * compiled({ 'user': 'fred' });
  14984. * // => 'hello fred!'
  14985. *
  14986. * // Use the HTML "escape" delimiter to escape data property values.
  14987. * var compiled = _.template('<b><%- value %></b>');
  14988. * compiled({ 'value': '<script>' });
  14989. * // => '<b>&lt;script&gt;</b>'
  14990. *
  14991. * // Use the "evaluate" delimiter to execute JavaScript and generate HTML.
  14992. * var compiled = _.template('<% _.forEach(users, function(user) { %><li><%- user %></li><% }); %>');
  14993. * compiled({ 'users': ['fred', 'barney'] });
  14994. * // => '<li>fred</li><li>barney</li>'
  14995. *
  14996. * // Use the internal `print` function in "evaluate" delimiters.
  14997. * var compiled = _.template('<% print("hello " + user); %>!');
  14998. * compiled({ 'user': 'barney' });
  14999. * // => 'hello barney!'
  15000. *
  15001. * // Use the ES template literal delimiter as an "interpolate" delimiter.
  15002. * // Disable support by replacing the "interpolate" delimiter.
  15003. * var compiled = _.template('hello ${ user }!');
  15004. * compiled({ 'user': 'pebbles' });
  15005. * // => 'hello pebbles!'
  15006. *
  15007. * // Use backslashes to treat delimiters as plain text.
  15008. * var compiled = _.template('<%= "\\<%- value %\\>" %>');
  15009. * compiled({ 'value': 'ignored' });
  15010. * // => '<%- value %>'
  15011. *
  15012. * // Use the `imports` option to import `jQuery` as `jq`.
  15013. * var text = '<% jq.each(users, function(user) { %><li><%- user %></li><% }); %>';
  15014. * var compiled = _.template(text, { 'imports': { 'jq': jQuery } });
  15015. * compiled({ 'users': ['fred', 'barney'] });
  15016. * // => '<li>fred</li><li>barney</li>'
  15017. *
  15018. * // Use the `sourceURL` option to specify a custom sourceURL for the template.
  15019. * var compiled = _.template('hello <%= user %>!', { 'sourceURL': '/basic/greeting.jst' });
  15020. * compiled(data);
  15021. * // => Find the source of "greeting.jst" under the Sources tab or Resources panel of the web inspector.
  15022. *
  15023. * // Use the `variable` option to ensure a with-statement isn't used in the compiled template.
  15024. * var compiled = _.template('hi <%= data.user %>!', { 'variable': 'data' });
  15025. * compiled.source;
  15026. * // => function(data) {
  15027. * // var __t, __p = '';
  15028. * // __p += 'hi ' + ((__t = ( data.user )) == null ? '' : __t) + '!';
  15029. * // return __p;
  15030. * // }
  15031. *
  15032. * // Use custom template delimiters.
  15033. * _.templateSettings.interpolate = /{{([\s\S]+?)}}/g;
  15034. * var compiled = _.template('hello {{ user }}!');
  15035. * compiled({ 'user': 'mustache' });
  15036. * // => 'hello mustache!'
  15037. *
  15038. * // Use the `source` property to inline compiled templates for meaningful
  15039. * // line numbers in error messages and stack traces.
  15040. * fs.writeFileSync(path.join(process.cwd(), 'jst.js'), '\
  15041. * var JST = {\
  15042. * "main": ' + _.template(mainText).source + '\
  15043. * };\
  15044. * ');
  15045. */
  15046. function template(string, options, guard) {
  15047. // Based on John Resig's `tmpl` implementation
  15048. // (http://ejohn.org/blog/javascript-micro-templating/)
  15049. // and Laura Doktorova's doT.js (https://github.com/olado/doT).
  15050. var settings = lodash.templateSettings;
  15051. if (guard && isIterateeCall(string, options, guard)) {
  15052. options = undefined;
  15053. }
  15054. string = toString(string);
  15055. options = assignInWith({}, options, settings, customDefaultsAssignIn);
  15056. var imports = assignInWith({}, options.imports, settings.imports, customDefaultsAssignIn),
  15057. importsKeys = keys(imports),
  15058. importsValues = baseValues(imports, importsKeys);
  15059. var isEscaping,
  15060. isEvaluating,
  15061. index = 0,
  15062. interpolate = options.interpolate || reNoMatch,
  15063. source = "__p += '";
  15064. // Compile the regexp to match each delimiter.
  15065. var reDelimiters = RegExp(
  15066. (options.escape || reNoMatch).source + '|' +
  15067. interpolate.source + '|' +
  15068. (interpolate === reInterpolate ? reEsTemplate : reNoMatch).source + '|' +
  15069. (options.evaluate || reNoMatch).source + '|$'
  15070. , 'g');
  15071. // Use a sourceURL for easier debugging.
  15072. // The sourceURL gets injected into the source that's eval-ed, so be careful
  15073. // to normalize all kinds of whitespace, so e.g. newlines (and unicode versions of it) can't sneak in
  15074. // and escape the comment, thus injecting code that gets evaled.
  15075. var sourceURL = '//# sourceURL=' +
  15076. (hasOwnProperty.call(options, 'sourceURL')
  15077. ? (options.sourceURL + '').replace(/\s/g, ' ')
  15078. : ('lodash.templateSources[' + (++templateCounter) + ']')
  15079. ) + '\n';
  15080. string.replace(reDelimiters, function(match, escapeValue, interpolateValue, esTemplateValue, evaluateValue, offset) {
  15081. interpolateValue || (interpolateValue = esTemplateValue);
  15082. // Escape characters that can't be included in string literals.
  15083. source += string.slice(index, offset).replace(reUnescapedString, escapeStringChar);
  15084. // Replace delimiters with snippets.
  15085. if (escapeValue) {
  15086. isEscaping = true;
  15087. source += "' +\n__e(" + escapeValue + ") +\n'";
  15088. }
  15089. if (evaluateValue) {
  15090. isEvaluating = true;
  15091. source += "';\n" + evaluateValue + ";\n__p += '";
  15092. }
  15093. if (interpolateValue) {
  15094. source += "' +\n((__t = (" + interpolateValue + ")) == null ? '' : __t) +\n'";
  15095. }
  15096. index = offset + match.length;
  15097. // The JS engine embedded in Adobe products needs `match` returned in
  15098. // order to produce the correct `offset` value.
  15099. return match;
  15100. });
  15101. source += "';\n";
  15102. // If `variable` is not specified wrap a with-statement around the generated
  15103. // code to add the data object to the top of the scope chain.
  15104. var variable = hasOwnProperty.call(options, 'variable') && options.variable;
  15105. if (!variable) {
  15106. source = 'with (obj) {\n' + source + '\n}\n';
  15107. }
  15108. // Throw an error if a forbidden character was found in `variable`, to prevent
  15109. // potential command injection attacks.
  15110. else if (reForbiddenIdentifierChars.test(variable)) {
  15111. throw new Error(INVALID_TEMPL_VAR_ERROR_TEXT);
  15112. }
  15113. // Cleanup code by stripping empty strings.
  15114. source = (isEvaluating ? source.replace(reEmptyStringLeading, '') : source)
  15115. .replace(reEmptyStringMiddle, '$1')
  15116. .replace(reEmptyStringTrailing, '$1;');
  15117. // Frame code as the function body.
  15118. source = 'function(' + (variable || 'obj') + ') {\n' +
  15119. (variable
  15120. ? ''
  15121. : 'obj || (obj = {});\n'
  15122. ) +
  15123. "var __t, __p = ''" +
  15124. (isEscaping
  15125. ? ', __e = _.escape'
  15126. : ''
  15127. ) +
  15128. (isEvaluating
  15129. ? ', __j = Array.prototype.join;\n' +
  15130. "function print() { __p += __j.call(arguments, '') }\n"
  15131. : ';\n'
  15132. ) +
  15133. source +
  15134. 'return __p\n}';
  15135. var result = attempt(function() {
  15136. return Function(importsKeys, sourceURL + 'return ' + source)
  15137. .apply(undefined, importsValues);
  15138. });
  15139. // Provide the compiled function's source by its `toString` method or
  15140. // the `source` property as a convenience for inlining compiled templates.
  15141. result.source = source;
  15142. if (isError(result)) {
  15143. throw result;
  15144. }
  15145. return result;
  15146. }
  15147. /**
  15148. * Converts `string`, as a whole, to lower case just like
  15149. * [String#toLowerCase](https://mdn.io/toLowerCase).
  15150. *
  15151. * @static
  15152. * @memberOf _
  15153. * @since 4.0.0
  15154. * @category String
  15155. * @param {string} [string=''] The string to convert.
  15156. * @returns {string} Returns the lower cased string.
  15157. * @example
  15158. *
  15159. * _.toLower('--Foo-Bar--');
  15160. * // => '--foo-bar--'
  15161. *
  15162. * _.toLower('fooBar');
  15163. * // => 'foobar'
  15164. *
  15165. * _.toLower('__FOO_BAR__');
  15166. * // => '__foo_bar__'
  15167. */
  15168. function toLower(value) {
  15169. return toString(value).toLowerCase();
  15170. }
  15171. /**
  15172. * Converts `string`, as a whole, to upper case just like
  15173. * [String#toUpperCase](https://mdn.io/toUpperCase).
  15174. *
  15175. * @static
  15176. * @memberOf _
  15177. * @since 4.0.0
  15178. * @category String
  15179. * @param {string} [string=''] The string to convert.
  15180. * @returns {string} Returns the upper cased string.
  15181. * @example
  15182. *
  15183. * _.toUpper('--foo-bar--');
  15184. * // => '--FOO-BAR--'
  15185. *
  15186. * _.toUpper('fooBar');
  15187. * // => 'FOOBAR'
  15188. *
  15189. * _.toUpper('__foo_bar__');
  15190. * // => '__FOO_BAR__'
  15191. */
  15192. function toUpper(value) {
  15193. return toString(value).toUpperCase();
  15194. }
  15195. /**
  15196. * Removes leading and trailing whitespace or specified characters from `string`.
  15197. *
  15198. * @static
  15199. * @memberOf _
  15200. * @since 3.0.0
  15201. * @category String
  15202. * @param {string} [string=''] The string to trim.
  15203. * @param {string} [chars=whitespace] The characters to trim.
  15204. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  15205. * @returns {string} Returns the trimmed string.
  15206. * @example
  15207. *
  15208. * _.trim(' abc ');
  15209. * // => 'abc'
  15210. *
  15211. * _.trim('-_-abc-_-', '_-');
  15212. * // => 'abc'
  15213. *
  15214. * _.map([' foo ', ' bar '], _.trim);
  15215. * // => ['foo', 'bar']
  15216. */
  15217. function trim(string, chars, guard) {
  15218. string = toString(string);
  15219. if (string && (guard || chars === undefined)) {
  15220. return baseTrim(string);
  15221. }
  15222. if (!string || !(chars = baseToString(chars))) {
  15223. return string;
  15224. }
  15225. var strSymbols = stringToArray(string),
  15226. chrSymbols = stringToArray(chars),
  15227. start = charsStartIndex(strSymbols, chrSymbols),
  15228. end = charsEndIndex(strSymbols, chrSymbols) + 1;
  15229. return castSlice(strSymbols, start, end).join('');
  15230. }
  15231. /**
  15232. * Removes trailing whitespace or specified characters from `string`.
  15233. *
  15234. * @static
  15235. * @memberOf _
  15236. * @since 4.0.0
  15237. * @category String
  15238. * @param {string} [string=''] The string to trim.
  15239. * @param {string} [chars=whitespace] The characters to trim.
  15240. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  15241. * @returns {string} Returns the trimmed string.
  15242. * @example
  15243. *
  15244. * _.trimEnd(' abc ');
  15245. * // => ' abc'
  15246. *
  15247. * _.trimEnd('-_-abc-_-', '_-');
  15248. * // => '-_-abc'
  15249. */
  15250. function trimEnd(string, chars, guard) {
  15251. string = toString(string);
  15252. if (string && (guard || chars === undefined)) {
  15253. return string.slice(0, trimmedEndIndex(string) + 1);
  15254. }
  15255. if (!string || !(chars = baseToString(chars))) {
  15256. return string;
  15257. }
  15258. var strSymbols = stringToArray(string),
  15259. end = charsEndIndex(strSymbols, stringToArray(chars)) + 1;
  15260. return castSlice(strSymbols, 0, end).join('');
  15261. }
  15262. /**
  15263. * Removes leading whitespace or specified characters from `string`.
  15264. *
  15265. * @static
  15266. * @memberOf _
  15267. * @since 4.0.0
  15268. * @category String
  15269. * @param {string} [string=''] The string to trim.
  15270. * @param {string} [chars=whitespace] The characters to trim.
  15271. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  15272. * @returns {string} Returns the trimmed string.
  15273. * @example
  15274. *
  15275. * _.trimStart(' abc ');
  15276. * // => 'abc '
  15277. *
  15278. * _.trimStart('-_-abc-_-', '_-');
  15279. * // => 'abc-_-'
  15280. */
  15281. function trimStart(string, chars, guard) {
  15282. string = toString(string);
  15283. if (string && (guard || chars === undefined)) {
  15284. return string.replace(reTrimStart, '');
  15285. }
  15286. if (!string || !(chars = baseToString(chars))) {
  15287. return string;
  15288. }
  15289. var strSymbols = stringToArray(string),
  15290. start = charsStartIndex(strSymbols, stringToArray(chars));
  15291. return castSlice(strSymbols, start).join('');
  15292. }
  15293. /**
  15294. * Truncates `string` if it's longer than the given maximum string length.
  15295. * The last characters of the truncated string are replaced with the omission
  15296. * string which defaults to "...".
  15297. *
  15298. * @static
  15299. * @memberOf _
  15300. * @since 4.0.0
  15301. * @category String
  15302. * @param {string} [string=''] The string to truncate.
  15303. * @param {Object} [options={}] The options object.
  15304. * @param {number} [options.length=30] The maximum string length.
  15305. * @param {string} [options.omission='...'] The string to indicate text is omitted.
  15306. * @param {RegExp|string} [options.separator] The separator pattern to truncate to.
  15307. * @returns {string} Returns the truncated string.
  15308. * @example
  15309. *
  15310. * _.truncate('hi-diddly-ho there, neighborino');
  15311. * // => 'hi-diddly-ho there, neighbo...'
  15312. *
  15313. * _.truncate('hi-diddly-ho there, neighborino', {
  15314. * 'length': 24,
  15315. * 'separator': ' '
  15316. * });
  15317. * // => 'hi-diddly-ho there,...'
  15318. *
  15319. * _.truncate('hi-diddly-ho there, neighborino', {
  15320. * 'length': 24,
  15321. * 'separator': /,? +/
  15322. * });
  15323. * // => 'hi-diddly-ho there...'
  15324. *
  15325. * _.truncate('hi-diddly-ho there, neighborino', {
  15326. * 'omission': ' [...]'
  15327. * });
  15328. * // => 'hi-diddly-ho there, neig [...]'
  15329. */
  15330. function truncate(string, options) {
  15331. var length = DEFAULT_TRUNC_LENGTH,
  15332. omission = DEFAULT_TRUNC_OMISSION;
  15333. if (isObject(options)) {
  15334. var separator = 'separator' in options ? options.separator : separator;
  15335. length = 'length' in options ? toInteger(options.length) : length;
  15336. omission = 'omission' in options ? baseToString(options.omission) : omission;
  15337. }
  15338. string = toString(string);
  15339. var strLength = string.length;
  15340. if (hasUnicode(string)) {
  15341. var strSymbols = stringToArray(string);
  15342. strLength = strSymbols.length;
  15343. }
  15344. if (length >= strLength) {
  15345. return string;
  15346. }
  15347. var end = length - stringSize(omission);
  15348. if (end < 1) {
  15349. return omission;
  15350. }
  15351. var result = strSymbols
  15352. ? castSlice(strSymbols, 0, end).join('')
  15353. : string.slice(0, end);
  15354. if (separator === undefined) {
  15355. return result + omission;
  15356. }
  15357. if (strSymbols) {
  15358. end += (result.length - end);
  15359. }
  15360. if (isRegExp(separator)) {
  15361. if (string.slice(end).search(separator)) {
  15362. var match,
  15363. substring = result;
  15364. if (!separator.global) {
  15365. separator = RegExp(separator.source, toString(reFlags.exec(separator)) + 'g');
  15366. }
  15367. separator.lastIndex = 0;
  15368. while ((match = separator.exec(substring))) {
  15369. var newEnd = match.index;
  15370. }
  15371. result = result.slice(0, newEnd === undefined ? end : newEnd);
  15372. }
  15373. } else if (string.indexOf(baseToString(separator), end) != end) {
  15374. var index = result.lastIndexOf(separator);
  15375. if (index > -1) {
  15376. result = result.slice(0, index);
  15377. }
  15378. }
  15379. return result + omission;
  15380. }
  15381. /**
  15382. * The inverse of `_.escape`; this method converts the HTML entities
  15383. * `&amp;`, `&lt;`, `&gt;`, `&quot;`, and `&#39;` in `string` to
  15384. * their corresponding characters.
  15385. *
  15386. * **Note:** No other HTML entities are unescaped. To unescape additional
  15387. * HTML entities use a third-party library like [_he_](https://mths.be/he).
  15388. *
  15389. * @static
  15390. * @memberOf _
  15391. * @since 0.6.0
  15392. * @category String
  15393. * @param {string} [string=''] The string to unescape.
  15394. * @returns {string} Returns the unescaped string.
  15395. * @example
  15396. *
  15397. * _.unescape('fred, barney, &amp; pebbles');
  15398. * // => 'fred, barney, & pebbles'
  15399. */
  15400. function unescape(string) {
  15401. string = toString(string);
  15402. return (string && reHasEscapedHtml.test(string))
  15403. ? string.replace(reEscapedHtml, unescapeHtmlChar)
  15404. : string;
  15405. }
  15406. /**
  15407. * Converts `string`, as space separated words, to upper case.
  15408. *
  15409. * @static
  15410. * @memberOf _
  15411. * @since 4.0.0
  15412. * @category String
  15413. * @param {string} [string=''] The string to convert.
  15414. * @returns {string} Returns the upper cased string.
  15415. * @example
  15416. *
  15417. * _.upperCase('--foo-bar');
  15418. * // => 'FOO BAR'
  15419. *
  15420. * _.upperCase('fooBar');
  15421. * // => 'FOO BAR'
  15422. *
  15423. * _.upperCase('__foo_bar__');
  15424. * // => 'FOO BAR'
  15425. */
  15426. var upperCase = createCompounder(function(result, word, index) {
  15427. return result + (index ? ' ' : '') + word.toUpperCase();
  15428. });
  15429. /**
  15430. * Converts the first character of `string` to upper case.
  15431. *
  15432. * @static
  15433. * @memberOf _
  15434. * @since 4.0.0
  15435. * @category String
  15436. * @param {string} [string=''] The string to convert.
  15437. * @returns {string} Returns the converted string.
  15438. * @example
  15439. *
  15440. * _.upperFirst('fred');
  15441. * // => 'Fred'
  15442. *
  15443. * _.upperFirst('FRED');
  15444. * // => 'FRED'
  15445. */
  15446. var upperFirst = createCaseFirst('toUpperCase');
  15447. /**
  15448. * Splits `string` into an array of its words.
  15449. *
  15450. * @static
  15451. * @memberOf _
  15452. * @since 3.0.0
  15453. * @category String
  15454. * @param {string} [string=''] The string to inspect.
  15455. * @param {RegExp|string} [pattern] The pattern to match words.
  15456. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  15457. * @returns {Array} Returns the words of `string`.
  15458. * @example
  15459. *
  15460. * _.words('fred, barney, & pebbles');
  15461. * // => ['fred', 'barney', 'pebbles']
  15462. *
  15463. * _.words('fred, barney, & pebbles', /[^, ]+/g);
  15464. * // => ['fred', 'barney', '&', 'pebbles']
  15465. */
  15466. function words(string, pattern, guard) {
  15467. string = toString(string);
  15468. pattern = guard ? undefined : pattern;
  15469. if (pattern === undefined) {
  15470. return hasUnicodeWord(string) ? unicodeWords(string) : asciiWords(string);
  15471. }
  15472. return string.match(pattern) || [];
  15473. }
  15474. /*------------------------------------------------------------------------*/
  15475. /**
  15476. * Attempts to invoke `func`, returning either the result or the caught error
  15477. * object. Any additional arguments are provided to `func` when it's invoked.
  15478. *
  15479. * @static
  15480. * @memberOf _
  15481. * @since 3.0.0
  15482. * @category Util
  15483. * @param {Function} func The function to attempt.
  15484. * @param {...*} [args] The arguments to invoke `func` with.
  15485. * @returns {*} Returns the `func` result or error object.
  15486. * @example
  15487. *
  15488. * // Avoid throwing errors for invalid selectors.
  15489. * var elements = _.attempt(function(selector) {
  15490. * return document.querySelectorAll(selector);
  15491. * }, '>_>');
  15492. *
  15493. * if (_.isError(elements)) {
  15494. * elements = [];
  15495. * }
  15496. */
  15497. var attempt = baseRest(function(func, args) {
  15498. try {
  15499. return apply(func, undefined, args);
  15500. } catch (e) {
  15501. return isError(e) ? e : new Error(e);
  15502. }
  15503. });
  15504. /**
  15505. * Binds methods of an object to the object itself, overwriting the existing
  15506. * method.
  15507. *
  15508. * **Note:** This method doesn't set the "length" property of bound functions.
  15509. *
  15510. * @static
  15511. * @since 0.1.0
  15512. * @memberOf _
  15513. * @category Util
  15514. * @param {Object} object The object to bind and assign the bound methods to.
  15515. * @param {...(string|string[])} methodNames The object method names to bind.
  15516. * @returns {Object} Returns `object`.
  15517. * @example
  15518. *
  15519. * var view = {
  15520. * 'label': 'docs',
  15521. * 'click': function() {
  15522. * console.log('clicked ' + this.label);
  15523. * }
  15524. * };
  15525. *
  15526. * _.bindAll(view, ['click']);
  15527. * jQuery(element).on('click', view.click);
  15528. * // => Logs 'clicked docs' when clicked.
  15529. */
  15530. var bindAll = flatRest(function(object, methodNames) {
  15531. arrayEach(methodNames, function(key) {
  15532. key = toKey(key);
  15533. baseAssignValue(object, key, bind(object[key], object));
  15534. });
  15535. return object;
  15536. });
  15537. /**
  15538. * Creates a function that iterates over `pairs` and invokes the corresponding
  15539. * function of the first predicate to return truthy. The predicate-function
  15540. * pairs are invoked with the `this` binding and arguments of the created
  15541. * function.
  15542. *
  15543. * @static
  15544. * @memberOf _
  15545. * @since 4.0.0
  15546. * @category Util
  15547. * @param {Array} pairs The predicate-function pairs.
  15548. * @returns {Function} Returns the new composite function.
  15549. * @example
  15550. *
  15551. * var func = _.cond([
  15552. * [_.matches({ 'a': 1 }), _.constant('matches A')],
  15553. * [_.conforms({ 'b': _.isNumber }), _.constant('matches B')],
  15554. * [_.stubTrue, _.constant('no match')]
  15555. * ]);
  15556. *
  15557. * func({ 'a': 1, 'b': 2 });
  15558. * // => 'matches A'
  15559. *
  15560. * func({ 'a': 0, 'b': 1 });
  15561. * // => 'matches B'
  15562. *
  15563. * func({ 'a': '1', 'b': '2' });
  15564. * // => 'no match'
  15565. */
  15566. function cond(pairs) {
  15567. var length = pairs == null ? 0 : pairs.length,
  15568. toIteratee = getIteratee();
  15569. pairs = !length ? [] : arrayMap(pairs, function(pair) {
  15570. if (typeof pair[1] != 'function') {
  15571. throw new TypeError(FUNC_ERROR_TEXT);
  15572. }
  15573. return [toIteratee(pair[0]), pair[1]];
  15574. });
  15575. return baseRest(function(args) {
  15576. var index = -1;
  15577. while (++index < length) {
  15578. var pair = pairs[index];
  15579. if (apply(pair[0], this, args)) {
  15580. return apply(pair[1], this, args);
  15581. }
  15582. }
  15583. });
  15584. }
  15585. /**
  15586. * Creates a function that invokes the predicate properties of `source` with
  15587. * the corresponding property values of a given object, returning `true` if
  15588. * all predicates return truthy, else `false`.
  15589. *
  15590. * **Note:** The created function is equivalent to `_.conformsTo` with
  15591. * `source` partially applied.
  15592. *
  15593. * @static
  15594. * @memberOf _
  15595. * @since 4.0.0
  15596. * @category Util
  15597. * @param {Object} source The object of property predicates to conform to.
  15598. * @returns {Function} Returns the new spec function.
  15599. * @example
  15600. *
  15601. * var objects = [
  15602. * { 'a': 2, 'b': 1 },
  15603. * { 'a': 1, 'b': 2 }
  15604. * ];
  15605. *
  15606. * _.filter(objects, _.conforms({ 'b': function(n) { return n > 1; } }));
  15607. * // => [{ 'a': 1, 'b': 2 }]
  15608. */
  15609. function conforms(source) {
  15610. return baseConforms(baseClone(source, CLONE_DEEP_FLAG));
  15611. }
  15612. /**
  15613. * Creates a function that returns `value`.
  15614. *
  15615. * @static
  15616. * @memberOf _
  15617. * @since 2.4.0
  15618. * @category Util
  15619. * @param {*} value The value to return from the new function.
  15620. * @returns {Function} Returns the new constant function.
  15621. * @example
  15622. *
  15623. * var objects = _.times(2, _.constant({ 'a': 1 }));
  15624. *
  15625. * console.log(objects);
  15626. * // => [{ 'a': 1 }, { 'a': 1 }]
  15627. *
  15628. * console.log(objects[0] === objects[1]);
  15629. * // => true
  15630. */
  15631. function constant(value) {
  15632. return function() {
  15633. return value;
  15634. };
  15635. }
  15636. /**
  15637. * Checks `value` to determine whether a default value should be returned in
  15638. * its place. The `defaultValue` is returned if `value` is `NaN`, `null`,
  15639. * or `undefined`.
  15640. *
  15641. * @static
  15642. * @memberOf _
  15643. * @since 4.14.0
  15644. * @category Util
  15645. * @param {*} value The value to check.
  15646. * @param {*} defaultValue The default value.
  15647. * @returns {*} Returns the resolved value.
  15648. * @example
  15649. *
  15650. * _.defaultTo(1, 10);
  15651. * // => 1
  15652. *
  15653. * _.defaultTo(undefined, 10);
  15654. * // => 10
  15655. */
  15656. function defaultTo(value, defaultValue) {
  15657. return (value == null || value !== value) ? defaultValue : value;
  15658. }
  15659. /**
  15660. * Creates a function that returns the result of invoking the given functions
  15661. * with the `this` binding of the created function, where each successive
  15662. * invocation is supplied the return value of the previous.
  15663. *
  15664. * @static
  15665. * @memberOf _
  15666. * @since 3.0.0
  15667. * @category Util
  15668. * @param {...(Function|Function[])} [funcs] The functions to invoke.
  15669. * @returns {Function} Returns the new composite function.
  15670. * @see _.flowRight
  15671. * @example
  15672. *
  15673. * function square(n) {
  15674. * return n * n;
  15675. * }
  15676. *
  15677. * var addSquare = _.flow([_.add, square]);
  15678. * addSquare(1, 2);
  15679. * // => 9
  15680. */
  15681. var flow = createFlow();
  15682. /**
  15683. * This method is like `_.flow` except that it creates a function that
  15684. * invokes the given functions from right to left.
  15685. *
  15686. * @static
  15687. * @since 3.0.0
  15688. * @memberOf _
  15689. * @category Util
  15690. * @param {...(Function|Function[])} [funcs] The functions to invoke.
  15691. * @returns {Function} Returns the new composite function.
  15692. * @see _.flow
  15693. * @example
  15694. *
  15695. * function square(n) {
  15696. * return n * n;
  15697. * }
  15698. *
  15699. * var addSquare = _.flowRight([square, _.add]);
  15700. * addSquare(1, 2);
  15701. * // => 9
  15702. */
  15703. var flowRight = createFlow(true);
  15704. /**
  15705. * This method returns the first argument it receives.
  15706. *
  15707. * @static
  15708. * @since 0.1.0
  15709. * @memberOf _
  15710. * @category Util
  15711. * @param {*} value Any value.
  15712. * @returns {*} Returns `value`.
  15713. * @example
  15714. *
  15715. * var object = { 'a': 1 };
  15716. *
  15717. * console.log(_.identity(object) === object);
  15718. * // => true
  15719. */
  15720. function identity(value) {
  15721. return value;
  15722. }
  15723. /**
  15724. * Creates a function that invokes `func` with the arguments of the created
  15725. * function. If `func` is a property name, the created function returns the
  15726. * property value for a given element. If `func` is an array or object, the
  15727. * created function returns `true` for elements that contain the equivalent
  15728. * source properties, otherwise it returns `false`.
  15729. *
  15730. * @static
  15731. * @since 4.0.0
  15732. * @memberOf _
  15733. * @category Util
  15734. * @param {*} [func=_.identity] The value to convert to a callback.
  15735. * @returns {Function} Returns the callback.
  15736. * @example
  15737. *
  15738. * var users = [
  15739. * { 'user': 'barney', 'age': 36, 'active': true },
  15740. * { 'user': 'fred', 'age': 40, 'active': false }
  15741. * ];
  15742. *
  15743. * // The `_.matches` iteratee shorthand.
  15744. * _.filter(users, _.iteratee({ 'user': 'barney', 'active': true }));
  15745. * // => [{ 'user': 'barney', 'age': 36, 'active': true }]
  15746. *
  15747. * // The `_.matchesProperty` iteratee shorthand.
  15748. * _.filter(users, _.iteratee(['user', 'fred']));
  15749. * // => [{ 'user': 'fred', 'age': 40 }]
  15750. *
  15751. * // The `_.property` iteratee shorthand.
  15752. * _.map(users, _.iteratee('user'));
  15753. * // => ['barney', 'fred']
  15754. *
  15755. * // Create custom iteratee shorthands.
  15756. * _.iteratee = _.wrap(_.iteratee, function(iteratee, func) {
  15757. * return !_.isRegExp(func) ? iteratee(func) : function(string) {
  15758. * return func.test(string);
  15759. * };
  15760. * });
  15761. *
  15762. * _.filter(['abc', 'def'], /ef/);
  15763. * // => ['def']
  15764. */
  15765. function iteratee(func) {
  15766. return baseIteratee(typeof func == 'function' ? func : baseClone(func, CLONE_DEEP_FLAG));
  15767. }
  15768. /**
  15769. * Creates a function that performs a partial deep comparison between a given
  15770. * object and `source`, returning `true` if the given object has equivalent
  15771. * property values, else `false`.
  15772. *
  15773. * **Note:** The created function is equivalent to `_.isMatch` with `source`
  15774. * partially applied.
  15775. *
  15776. * Partial comparisons will match empty array and empty object `source`
  15777. * values against any array or object value, respectively. See `_.isEqual`
  15778. * for a list of supported value comparisons.
  15779. *
  15780. * **Note:** Multiple values can be checked by combining several matchers
  15781. * using `_.overSome`
  15782. *
  15783. * @static
  15784. * @memberOf _
  15785. * @since 3.0.0
  15786. * @category Util
  15787. * @param {Object} source The object of property values to match.
  15788. * @returns {Function} Returns the new spec function.
  15789. * @example
  15790. *
  15791. * var objects = [
  15792. * { 'a': 1, 'b': 2, 'c': 3 },
  15793. * { 'a': 4, 'b': 5, 'c': 6 }
  15794. * ];
  15795. *
  15796. * _.filter(objects, _.matches({ 'a': 4, 'c': 6 }));
  15797. * // => [{ 'a': 4, 'b': 5, 'c': 6 }]
  15798. *
  15799. * // Checking for several possible values
  15800. * _.filter(objects, _.overSome([_.matches({ 'a': 1 }), _.matches({ 'a': 4 })]));
  15801. * // => [{ 'a': 1, 'b': 2, 'c': 3 }, { 'a': 4, 'b': 5, 'c': 6 }]
  15802. */
  15803. function matches(source) {
  15804. return baseMatches(baseClone(source, CLONE_DEEP_FLAG));
  15805. }
  15806. /**
  15807. * Creates a function that performs a partial deep comparison between the
  15808. * value at `path` of a given object to `srcValue`, returning `true` if the
  15809. * object value is equivalent, else `false`.
  15810. *
  15811. * **Note:** Partial comparisons will match empty array and empty object
  15812. * `srcValue` values against any array or object value, respectively. See
  15813. * `_.isEqual` for a list of supported value comparisons.
  15814. *
  15815. * **Note:** Multiple values can be checked by combining several matchers
  15816. * using `_.overSome`
  15817. *
  15818. * @static
  15819. * @memberOf _
  15820. * @since 3.2.0
  15821. * @category Util
  15822. * @param {Array|string} path The path of the property to get.
  15823. * @param {*} srcValue The value to match.
  15824. * @returns {Function} Returns the new spec function.
  15825. * @example
  15826. *
  15827. * var objects = [
  15828. * { 'a': 1, 'b': 2, 'c': 3 },
  15829. * { 'a': 4, 'b': 5, 'c': 6 }
  15830. * ];
  15831. *
  15832. * _.find(objects, _.matchesProperty('a', 4));
  15833. * // => { 'a': 4, 'b': 5, 'c': 6 }
  15834. *
  15835. * // Checking for several possible values
  15836. * _.filter(objects, _.overSome([_.matchesProperty('a', 1), _.matchesProperty('a', 4)]));
  15837. * // => [{ 'a': 1, 'b': 2, 'c': 3 }, { 'a': 4, 'b': 5, 'c': 6 }]
  15838. */
  15839. function matchesProperty(path, srcValue) {
  15840. return baseMatchesProperty(path, baseClone(srcValue, CLONE_DEEP_FLAG));
  15841. }
  15842. /**
  15843. * Creates a function that invokes the method at `path` of a given object.
  15844. * Any additional arguments are provided to the invoked method.
  15845. *
  15846. * @static
  15847. * @memberOf _
  15848. * @since 3.7.0
  15849. * @category Util
  15850. * @param {Array|string} path The path of the method to invoke.
  15851. * @param {...*} [args] The arguments to invoke the method with.
  15852. * @returns {Function} Returns the new invoker function.
  15853. * @example
  15854. *
  15855. * var objects = [
  15856. * { 'a': { 'b': _.constant(2) } },
  15857. * { 'a': { 'b': _.constant(1) } }
  15858. * ];
  15859. *
  15860. * _.map(objects, _.method('a.b'));
  15861. * // => [2, 1]
  15862. *
  15863. * _.map(objects, _.method(['a', 'b']));
  15864. * // => [2, 1]
  15865. */
  15866. var method = baseRest(function(path, args) {
  15867. return function(object) {
  15868. return baseInvoke(object, path, args);
  15869. };
  15870. });
  15871. /**
  15872. * The opposite of `_.method`; this method creates a function that invokes
  15873. * the method at a given path of `object`. Any additional arguments are
  15874. * provided to the invoked method.
  15875. *
  15876. * @static
  15877. * @memberOf _
  15878. * @since 3.7.0
  15879. * @category Util
  15880. * @param {Object} object The object to query.
  15881. * @param {...*} [args] The arguments to invoke the method with.
  15882. * @returns {Function} Returns the new invoker function.
  15883. * @example
  15884. *
  15885. * var array = _.times(3, _.constant),
  15886. * object = { 'a': array, 'b': array, 'c': array };
  15887. *
  15888. * _.map(['a[2]', 'c[0]'], _.methodOf(object));
  15889. * // => [2, 0]
  15890. *
  15891. * _.map([['a', '2'], ['c', '0']], _.methodOf(object));
  15892. * // => [2, 0]
  15893. */
  15894. var methodOf = baseRest(function(object, args) {
  15895. return function(path) {
  15896. return baseInvoke(object, path, args);
  15897. };
  15898. });
  15899. /**
  15900. * Adds all own enumerable string keyed function properties of a source
  15901. * object to the destination object. If `object` is a function, then methods
  15902. * are added to its prototype as well.
  15903. *
  15904. * **Note:** Use `_.runInContext` to create a pristine `lodash` function to
  15905. * avoid conflicts caused by modifying the original.
  15906. *
  15907. * @static
  15908. * @since 0.1.0
  15909. * @memberOf _
  15910. * @category Util
  15911. * @param {Function|Object} [object=lodash] The destination object.
  15912. * @param {Object} source The object of functions to add.
  15913. * @param {Object} [options={}] The options object.
  15914. * @param {boolean} [options.chain=true] Specify whether mixins are chainable.
  15915. * @returns {Function|Object} Returns `object`.
  15916. * @example
  15917. *
  15918. * function vowels(string) {
  15919. * return _.filter(string, function(v) {
  15920. * return /[aeiou]/i.test(v);
  15921. * });
  15922. * }
  15923. *
  15924. * _.mixin({ 'vowels': vowels });
  15925. * _.vowels('fred');
  15926. * // => ['e']
  15927. *
  15928. * _('fred').vowels().value();
  15929. * // => ['e']
  15930. *
  15931. * _.mixin({ 'vowels': vowels }, { 'chain': false });
  15932. * _('fred').vowels();
  15933. * // => ['e']
  15934. */
  15935. function mixin(object, source, options) {
  15936. var props = keys(source),
  15937. methodNames = baseFunctions(source, props);
  15938. if (options == null &&
  15939. !(isObject(source) && (methodNames.length || !props.length))) {
  15940. options = source;
  15941. source = object;
  15942. object = this;
  15943. methodNames = baseFunctions(source, keys(source));
  15944. }
  15945. var chain = !(isObject(options) && 'chain' in options) || !!options.chain,
  15946. isFunc = isFunction(object);
  15947. arrayEach(methodNames, function(methodName) {
  15948. var func = source[methodName];
  15949. object[methodName] = func;
  15950. if (isFunc) {
  15951. object.prototype[methodName] = function() {
  15952. var chainAll = this.__chain__;
  15953. if (chain || chainAll) {
  15954. var result = object(this.__wrapped__),
  15955. actions = result.__actions__ = copyArray(this.__actions__);
  15956. actions.push({ 'func': func, 'args': arguments, 'thisArg': object });
  15957. result.__chain__ = chainAll;
  15958. return result;
  15959. }
  15960. return func.apply(object, arrayPush([this.value()], arguments));
  15961. };
  15962. }
  15963. });
  15964. return object;
  15965. }
  15966. /**
  15967. * Reverts the `_` variable to its previous value and returns a reference to
  15968. * the `lodash` function.
  15969. *
  15970. * @static
  15971. * @since 0.1.0
  15972. * @memberOf _
  15973. * @category Util
  15974. * @returns {Function} Returns the `lodash` function.
  15975. * @example
  15976. *
  15977. * var lodash = _.noConflict();
  15978. */
  15979. function noConflict() {
  15980. if (root._ === this) {
  15981. root._ = oldDash;
  15982. }
  15983. return this;
  15984. }
  15985. /**
  15986. * This method returns `undefined`.
  15987. *
  15988. * @static
  15989. * @memberOf _
  15990. * @since 2.3.0
  15991. * @category Util
  15992. * @example
  15993. *
  15994. * _.times(2, _.noop);
  15995. * // => [undefined, undefined]
  15996. */
  15997. function noop() {
  15998. // No operation performed.
  15999. }
  16000. /**
  16001. * Creates a function that gets the argument at index `n`. If `n` is negative,
  16002. * the nth argument from the end is returned.
  16003. *
  16004. * @static
  16005. * @memberOf _
  16006. * @since 4.0.0
  16007. * @category Util
  16008. * @param {number} [n=0] The index of the argument to return.
  16009. * @returns {Function} Returns the new pass-thru function.
  16010. * @example
  16011. *
  16012. * var func = _.nthArg(1);
  16013. * func('a', 'b', 'c', 'd');
  16014. * // => 'b'
  16015. *
  16016. * var func = _.nthArg(-2);
  16017. * func('a', 'b', 'c', 'd');
  16018. * // => 'c'
  16019. */
  16020. function nthArg(n) {
  16021. n = toInteger(n);
  16022. return baseRest(function(args) {
  16023. return baseNth(args, n);
  16024. });
  16025. }
  16026. /**
  16027. * Creates a function that invokes `iteratees` with the arguments it receives
  16028. * and returns their results.
  16029. *
  16030. * @static
  16031. * @memberOf _
  16032. * @since 4.0.0
  16033. * @category Util
  16034. * @param {...(Function|Function[])} [iteratees=[_.identity]]
  16035. * The iteratees to invoke.
  16036. * @returns {Function} Returns the new function.
  16037. * @example
  16038. *
  16039. * var func = _.over([Math.max, Math.min]);
  16040. *
  16041. * func(1, 2, 3, 4);
  16042. * // => [4, 1]
  16043. */
  16044. var over = createOver(arrayMap);
  16045. /**
  16046. * Creates a function that checks if **all** of the `predicates` return
  16047. * truthy when invoked with the arguments it receives.
  16048. *
  16049. * Following shorthands are possible for providing predicates.
  16050. * Pass an `Object` and it will be used as an parameter for `_.matches` to create the predicate.
  16051. * Pass an `Array` of parameters for `_.matchesProperty` and the predicate will be created using them.
  16052. *
  16053. * @static
  16054. * @memberOf _
  16055. * @since 4.0.0
  16056. * @category Util
  16057. * @param {...(Function|Function[])} [predicates=[_.identity]]
  16058. * The predicates to check.
  16059. * @returns {Function} Returns the new function.
  16060. * @example
  16061. *
  16062. * var func = _.overEvery([Boolean, isFinite]);
  16063. *
  16064. * func('1');
  16065. * // => true
  16066. *
  16067. * func(null);
  16068. * // => false
  16069. *
  16070. * func(NaN);
  16071. * // => false
  16072. */
  16073. var overEvery = createOver(arrayEvery);
  16074. /**
  16075. * Creates a function that checks if **any** of the `predicates` return
  16076. * truthy when invoked with the arguments it receives.
  16077. *
  16078. * Following shorthands are possible for providing predicates.
  16079. * Pass an `Object` and it will be used as an parameter for `_.matches` to create the predicate.
  16080. * Pass an `Array` of parameters for `_.matchesProperty` and the predicate will be created using them.
  16081. *
  16082. * @static
  16083. * @memberOf _
  16084. * @since 4.0.0
  16085. * @category Util
  16086. * @param {...(Function|Function[])} [predicates=[_.identity]]
  16087. * The predicates to check.
  16088. * @returns {Function} Returns the new function.
  16089. * @example
  16090. *
  16091. * var func = _.overSome([Boolean, isFinite]);
  16092. *
  16093. * func('1');
  16094. * // => true
  16095. *
  16096. * func(null);
  16097. * // => true
  16098. *
  16099. * func(NaN);
  16100. * // => false
  16101. *
  16102. * var matchesFunc = _.overSome([{ 'a': 1 }, { 'a': 2 }])
  16103. * var matchesPropertyFunc = _.overSome([['a', 1], ['a', 2]])
  16104. */
  16105. var overSome = createOver(arraySome);
  16106. /**
  16107. * Creates a function that returns the value at `path` of a given object.
  16108. *
  16109. * @static
  16110. * @memberOf _
  16111. * @since 2.4.0
  16112. * @category Util
  16113. * @param {Array|string} path The path of the property to get.
  16114. * @returns {Function} Returns the new accessor function.
  16115. * @example
  16116. *
  16117. * var objects = [
  16118. * { 'a': { 'b': 2 } },
  16119. * { 'a': { 'b': 1 } }
  16120. * ];
  16121. *
  16122. * _.map(objects, _.property('a.b'));
  16123. * // => [2, 1]
  16124. *
  16125. * _.map(_.sortBy(objects, _.property(['a', 'b'])), 'a.b');
  16126. * // => [1, 2]
  16127. */
  16128. function property(path) {
  16129. return isKey(path) ? baseProperty(toKey(path)) : basePropertyDeep(path);
  16130. }
  16131. /**
  16132. * The opposite of `_.property`; this method creates a function that returns
  16133. * the value at a given path of `object`.
  16134. *
  16135. * @static
  16136. * @memberOf _
  16137. * @since 3.0.0
  16138. * @category Util
  16139. * @param {Object} object The object to query.
  16140. * @returns {Function} Returns the new accessor function.
  16141. * @example
  16142. *
  16143. * var array = [0, 1, 2],
  16144. * object = { 'a': array, 'b': array, 'c': array };
  16145. *
  16146. * _.map(['a[2]', 'c[0]'], _.propertyOf(object));
  16147. * // => [2, 0]
  16148. *
  16149. * _.map([['a', '2'], ['c', '0']], _.propertyOf(object));
  16150. * // => [2, 0]
  16151. */
  16152. function propertyOf(object) {
  16153. return function(path) {
  16154. return object == null ? undefined : baseGet(object, path);
  16155. };
  16156. }
  16157. /**
  16158. * Creates an array of numbers (positive and/or negative) progressing from
  16159. * `start` up to, but not including, `end`. A step of `-1` is used if a negative
  16160. * `start` is specified without an `end` or `step`. If `end` is not specified,
  16161. * it's set to `start` with `start` then set to `0`.
  16162. *
  16163. * **Note:** JavaScript follows the IEEE-754 standard for resolving
  16164. * floating-point values which can produce unexpected results.
  16165. *
  16166. * @static
  16167. * @since 0.1.0
  16168. * @memberOf _
  16169. * @category Util
  16170. * @param {number} [start=0] The start of the range.
  16171. * @param {number} end The end of the range.
  16172. * @param {number} [step=1] The value to increment or decrement by.
  16173. * @returns {Array} Returns the range of numbers.
  16174. * @see _.inRange, _.rangeRight
  16175. * @example
  16176. *
  16177. * _.range(4);
  16178. * // => [0, 1, 2, 3]
  16179. *
  16180. * _.range(-4);
  16181. * // => [0, -1, -2, -3]
  16182. *
  16183. * _.range(1, 5);
  16184. * // => [1, 2, 3, 4]
  16185. *
  16186. * _.range(0, 20, 5);
  16187. * // => [0, 5, 10, 15]
  16188. *
  16189. * _.range(0, -4, -1);
  16190. * // => [0, -1, -2, -3]
  16191. *
  16192. * _.range(1, 4, 0);
  16193. * // => [1, 1, 1]
  16194. *
  16195. * _.range(0);
  16196. * // => []
  16197. */
  16198. var range = createRange();
  16199. /**
  16200. * This method is like `_.range` except that it populates values in
  16201. * descending order.
  16202. *
  16203. * @static
  16204. * @memberOf _
  16205. * @since 4.0.0
  16206. * @category Util
  16207. * @param {number} [start=0] The start of the range.
  16208. * @param {number} end The end of the range.
  16209. * @param {number} [step=1] The value to increment or decrement by.
  16210. * @returns {Array} Returns the range of numbers.
  16211. * @see _.inRange, _.range
  16212. * @example
  16213. *
  16214. * _.rangeRight(4);
  16215. * // => [3, 2, 1, 0]
  16216. *
  16217. * _.rangeRight(-4);
  16218. * // => [-3, -2, -1, 0]
  16219. *
  16220. * _.rangeRight(1, 5);
  16221. * // => [4, 3, 2, 1]
  16222. *
  16223. * _.rangeRight(0, 20, 5);
  16224. * // => [15, 10, 5, 0]
  16225. *
  16226. * _.rangeRight(0, -4, -1);
  16227. * // => [-3, -2, -1, 0]
  16228. *
  16229. * _.rangeRight(1, 4, 0);
  16230. * // => [1, 1, 1]
  16231. *
  16232. * _.rangeRight(0);
  16233. * // => []
  16234. */
  16235. var rangeRight = createRange(true);
  16236. /**
  16237. * This method returns a new empty array.
  16238. *
  16239. * @static
  16240. * @memberOf _
  16241. * @since 4.13.0
  16242. * @category Util
  16243. * @returns {Array} Returns the new empty array.
  16244. * @example
  16245. *
  16246. * var arrays = _.times(2, _.stubArray);
  16247. *
  16248. * console.log(arrays);
  16249. * // => [[], []]
  16250. *
  16251. * console.log(arrays[0] === arrays[1]);
  16252. * // => false
  16253. */
  16254. function stubArray() {
  16255. return [];
  16256. }
  16257. /**
  16258. * This method returns `false`.
  16259. *
  16260. * @static
  16261. * @memberOf _
  16262. * @since 4.13.0
  16263. * @category Util
  16264. * @returns {boolean} Returns `false`.
  16265. * @example
  16266. *
  16267. * _.times(2, _.stubFalse);
  16268. * // => [false, false]
  16269. */
  16270. function stubFalse() {
  16271. return false;
  16272. }
  16273. /**
  16274. * This method returns a new empty object.
  16275. *
  16276. * @static
  16277. * @memberOf _
  16278. * @since 4.13.0
  16279. * @category Util
  16280. * @returns {Object} Returns the new empty object.
  16281. * @example
  16282. *
  16283. * var objects = _.times(2, _.stubObject);
  16284. *
  16285. * console.log(objects);
  16286. * // => [{}, {}]
  16287. *
  16288. * console.log(objects[0] === objects[1]);
  16289. * // => false
  16290. */
  16291. function stubObject() {
  16292. return {};
  16293. }
  16294. /**
  16295. * This method returns an empty string.
  16296. *
  16297. * @static
  16298. * @memberOf _
  16299. * @since 4.13.0
  16300. * @category Util
  16301. * @returns {string} Returns the empty string.
  16302. * @example
  16303. *
  16304. * _.times(2, _.stubString);
  16305. * // => ['', '']
  16306. */
  16307. function stubString() {
  16308. return '';
  16309. }
  16310. /**
  16311. * This method returns `true`.
  16312. *
  16313. * @static
  16314. * @memberOf _
  16315. * @since 4.13.0
  16316. * @category Util
  16317. * @returns {boolean} Returns `true`.
  16318. * @example
  16319. *
  16320. * _.times(2, _.stubTrue);
  16321. * // => [true, true]
  16322. */
  16323. function stubTrue() {
  16324. return true;
  16325. }
  16326. /**
  16327. * Invokes the iteratee `n` times, returning an array of the results of
  16328. * each invocation. The iteratee is invoked with one argument; (index).
  16329. *
  16330. * @static
  16331. * @since 0.1.0
  16332. * @memberOf _
  16333. * @category Util
  16334. * @param {number} n The number of times to invoke `iteratee`.
  16335. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  16336. * @returns {Array} Returns the array of results.
  16337. * @example
  16338. *
  16339. * _.times(3, String);
  16340. * // => ['0', '1', '2']
  16341. *
  16342. * _.times(4, _.constant(0));
  16343. * // => [0, 0, 0, 0]
  16344. */
  16345. function times(n, iteratee) {
  16346. n = toInteger(n);
  16347. if (n < 1 || n > MAX_SAFE_INTEGER) {
  16348. return [];
  16349. }
  16350. var index = MAX_ARRAY_LENGTH,
  16351. length = nativeMin(n, MAX_ARRAY_LENGTH);
  16352. iteratee = getIteratee(iteratee);
  16353. n -= MAX_ARRAY_LENGTH;
  16354. var result = baseTimes(length, iteratee);
  16355. while (++index < n) {
  16356. iteratee(index);
  16357. }
  16358. return result;
  16359. }
  16360. /**
  16361. * Converts `value` to a property path array.
  16362. *
  16363. * @static
  16364. * @memberOf _
  16365. * @since 4.0.0
  16366. * @category Util
  16367. * @param {*} value The value to convert.
  16368. * @returns {Array} Returns the new property path array.
  16369. * @example
  16370. *
  16371. * _.toPath('a.b.c');
  16372. * // => ['a', 'b', 'c']
  16373. *
  16374. * _.toPath('a[0].b.c');
  16375. * // => ['a', '0', 'b', 'c']
  16376. */
  16377. function toPath(value) {
  16378. if (isArray(value)) {
  16379. return arrayMap(value, toKey);
  16380. }
  16381. return isSymbol(value) ? [value] : copyArray(stringToPath(toString(value)));
  16382. }
  16383. /**
  16384. * Generates a unique ID. If `prefix` is given, the ID is appended to it.
  16385. *
  16386. * @static
  16387. * @since 0.1.0
  16388. * @memberOf _
  16389. * @category Util
  16390. * @param {string} [prefix=''] The value to prefix the ID with.
  16391. * @returns {string} Returns the unique ID.
  16392. * @example
  16393. *
  16394. * _.uniqueId('contact_');
  16395. * // => 'contact_104'
  16396. *
  16397. * _.uniqueId();
  16398. * // => '105'
  16399. */
  16400. function uniqueId(prefix) {
  16401. var id = ++idCounter;
  16402. return toString(prefix) + id;
  16403. }
  16404. /*------------------------------------------------------------------------*/
  16405. /**
  16406. * Adds two numbers.
  16407. *
  16408. * @static
  16409. * @memberOf _
  16410. * @since 3.4.0
  16411. * @category Math
  16412. * @param {number} augend The first number in an addition.
  16413. * @param {number} addend The second number in an addition.
  16414. * @returns {number} Returns the total.
  16415. * @example
  16416. *
  16417. * _.add(6, 4);
  16418. * // => 10
  16419. */
  16420. var add = createMathOperation(function(augend, addend) {
  16421. return augend + addend;
  16422. }, 0);
  16423. /**
  16424. * Computes `number` rounded up to `precision`.
  16425. *
  16426. * @static
  16427. * @memberOf _
  16428. * @since 3.10.0
  16429. * @category Math
  16430. * @param {number} number The number to round up.
  16431. * @param {number} [precision=0] The precision to round up to.
  16432. * @returns {number} Returns the rounded up number.
  16433. * @example
  16434. *
  16435. * _.ceil(4.006);
  16436. * // => 5
  16437. *
  16438. * _.ceil(6.004, 2);
  16439. * // => 6.01
  16440. *
  16441. * _.ceil(6040, -2);
  16442. * // => 6100
  16443. */
  16444. var ceil = createRound('ceil');
  16445. /**
  16446. * Divide two numbers.
  16447. *
  16448. * @static
  16449. * @memberOf _
  16450. * @since 4.7.0
  16451. * @category Math
  16452. * @param {number} dividend The first number in a division.
  16453. * @param {number} divisor The second number in a division.
  16454. * @returns {number} Returns the quotient.
  16455. * @example
  16456. *
  16457. * _.divide(6, 4);
  16458. * // => 1.5
  16459. */
  16460. var divide = createMathOperation(function(dividend, divisor) {
  16461. return dividend / divisor;
  16462. }, 1);
  16463. /**
  16464. * Computes `number` rounded down to `precision`.
  16465. *
  16466. * @static
  16467. * @memberOf _
  16468. * @since 3.10.0
  16469. * @category Math
  16470. * @param {number} number The number to round down.
  16471. * @param {number} [precision=0] The precision to round down to.
  16472. * @returns {number} Returns the rounded down number.
  16473. * @example
  16474. *
  16475. * _.floor(4.006);
  16476. * // => 4
  16477. *
  16478. * _.floor(0.046, 2);
  16479. * // => 0.04
  16480. *
  16481. * _.floor(4060, -2);
  16482. * // => 4000
  16483. */
  16484. var floor = createRound('floor');
  16485. /**
  16486. * Computes the maximum value of `array`. If `array` is empty or falsey,
  16487. * `undefined` is returned.
  16488. *
  16489. * @static
  16490. * @since 0.1.0
  16491. * @memberOf _
  16492. * @category Math
  16493. * @param {Array} array The array to iterate over.
  16494. * @returns {*} Returns the maximum value.
  16495. * @example
  16496. *
  16497. * _.max([4, 2, 8, 6]);
  16498. * // => 8
  16499. *
  16500. * _.max([]);
  16501. * // => undefined
  16502. */
  16503. function max(array) {
  16504. return (array && array.length)
  16505. ? baseExtremum(array, identity, baseGt)
  16506. : undefined;
  16507. }
  16508. /**
  16509. * This method is like `_.max` except that it accepts `iteratee` which is
  16510. * invoked for each element in `array` to generate the criterion by which
  16511. * the value is ranked. The iteratee is invoked with one argument: (value).
  16512. *
  16513. * @static
  16514. * @memberOf _
  16515. * @since 4.0.0
  16516. * @category Math
  16517. * @param {Array} array The array to iterate over.
  16518. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  16519. * @returns {*} Returns the maximum value.
  16520. * @example
  16521. *
  16522. * var objects = [{ 'n': 1 }, { 'n': 2 }];
  16523. *
  16524. * _.maxBy(objects, function(o) { return o.n; });
  16525. * // => { 'n': 2 }
  16526. *
  16527. * // The `_.property` iteratee shorthand.
  16528. * _.maxBy(objects, 'n');
  16529. * // => { 'n': 2 }
  16530. */
  16531. function maxBy(array, iteratee) {
  16532. return (array && array.length)
  16533. ? baseExtremum(array, getIteratee(iteratee, 2), baseGt)
  16534. : undefined;
  16535. }
  16536. /**
  16537. * Computes the mean of the values in `array`.
  16538. *
  16539. * @static
  16540. * @memberOf _
  16541. * @since 4.0.0
  16542. * @category Math
  16543. * @param {Array} array The array to iterate over.
  16544. * @returns {number} Returns the mean.
  16545. * @example
  16546. *
  16547. * _.mean([4, 2, 8, 6]);
  16548. * // => 5
  16549. */
  16550. function mean(array) {
  16551. return baseMean(array, identity);
  16552. }
  16553. /**
  16554. * This method is like `_.mean` except that it accepts `iteratee` which is
  16555. * invoked for each element in `array` to generate the value to be averaged.
  16556. * The iteratee is invoked with one argument: (value).
  16557. *
  16558. * @static
  16559. * @memberOf _
  16560. * @since 4.7.0
  16561. * @category Math
  16562. * @param {Array} array The array to iterate over.
  16563. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  16564. * @returns {number} Returns the mean.
  16565. * @example
  16566. *
  16567. * var objects = [{ 'n': 4 }, { 'n': 2 }, { 'n': 8 }, { 'n': 6 }];
  16568. *
  16569. * _.meanBy(objects, function(o) { return o.n; });
  16570. * // => 5
  16571. *
  16572. * // The `_.property` iteratee shorthand.
  16573. * _.meanBy(objects, 'n');
  16574. * // => 5
  16575. */
  16576. function meanBy(array, iteratee) {
  16577. return baseMean(array, getIteratee(iteratee, 2));
  16578. }
  16579. /**
  16580. * Computes the minimum value of `array`. If `array` is empty or falsey,
  16581. * `undefined` is returned.
  16582. *
  16583. * @static
  16584. * @since 0.1.0
  16585. * @memberOf _
  16586. * @category Math
  16587. * @param {Array} array The array to iterate over.
  16588. * @returns {*} Returns the minimum value.
  16589. * @example
  16590. *
  16591. * _.min([4, 2, 8, 6]);
  16592. * // => 2
  16593. *
  16594. * _.min([]);
  16595. * // => undefined
  16596. */
  16597. function min(array) {
  16598. return (array && array.length)
  16599. ? baseExtremum(array, identity, baseLt)
  16600. : undefined;
  16601. }
  16602. /**
  16603. * This method is like `_.min` except that it accepts `iteratee` which is
  16604. * invoked for each element in `array` to generate the criterion by which
  16605. * the value is ranked. The iteratee is invoked with one argument: (value).
  16606. *
  16607. * @static
  16608. * @memberOf _
  16609. * @since 4.0.0
  16610. * @category Math
  16611. * @param {Array} array The array to iterate over.
  16612. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  16613. * @returns {*} Returns the minimum value.
  16614. * @example
  16615. *
  16616. * var objects = [{ 'n': 1 }, { 'n': 2 }];
  16617. *
  16618. * _.minBy(objects, function(o) { return o.n; });
  16619. * // => { 'n': 1 }
  16620. *
  16621. * // The `_.property` iteratee shorthand.
  16622. * _.minBy(objects, 'n');
  16623. * // => { 'n': 1 }
  16624. */
  16625. function minBy(array, iteratee) {
  16626. return (array && array.length)
  16627. ? baseExtremum(array, getIteratee(iteratee, 2), baseLt)
  16628. : undefined;
  16629. }
  16630. /**
  16631. * Multiply two numbers.
  16632. *
  16633. * @static
  16634. * @memberOf _
  16635. * @since 4.7.0
  16636. * @category Math
  16637. * @param {number} multiplier The first number in a multiplication.
  16638. * @param {number} multiplicand The second number in a multiplication.
  16639. * @returns {number} Returns the product.
  16640. * @example
  16641. *
  16642. * _.multiply(6, 4);
  16643. * // => 24
  16644. */
  16645. var multiply = createMathOperation(function(multiplier, multiplicand) {
  16646. return multiplier * multiplicand;
  16647. }, 1);
  16648. /**
  16649. * Computes `number` rounded to `precision`.
  16650. *
  16651. * @static
  16652. * @memberOf _
  16653. * @since 3.10.0
  16654. * @category Math
  16655. * @param {number} number The number to round.
  16656. * @param {number} [precision=0] The precision to round to.
  16657. * @returns {number} Returns the rounded number.
  16658. * @example
  16659. *
  16660. * _.round(4.006);
  16661. * // => 4
  16662. *
  16663. * _.round(4.006, 2);
  16664. * // => 4.01
  16665. *
  16666. * _.round(4060, -2);
  16667. * // => 4100
  16668. */
  16669. var round = createRound('round');
  16670. /**
  16671. * Subtract two numbers.
  16672. *
  16673. * @static
  16674. * @memberOf _
  16675. * @since 4.0.0
  16676. * @category Math
  16677. * @param {number} minuend The first number in a subtraction.
  16678. * @param {number} subtrahend The second number in a subtraction.
  16679. * @returns {number} Returns the difference.
  16680. * @example
  16681. *
  16682. * _.subtract(6, 4);
  16683. * // => 2
  16684. */
  16685. var subtract = createMathOperation(function(minuend, subtrahend) {
  16686. return minuend - subtrahend;
  16687. }, 0);
  16688. /**
  16689. * Computes the sum of the values in `array`.
  16690. *
  16691. * @static
  16692. * @memberOf _
  16693. * @since 3.4.0
  16694. * @category Math
  16695. * @param {Array} array The array to iterate over.
  16696. * @returns {number} Returns the sum.
  16697. * @example
  16698. *
  16699. * _.sum([4, 2, 8, 6]);
  16700. * // => 20
  16701. */
  16702. function sum(array) {
  16703. return (array && array.length)
  16704. ? baseSum(array, identity)
  16705. : 0;
  16706. }
  16707. /**
  16708. * This method is like `_.sum` except that it accepts `iteratee` which is
  16709. * invoked for each element in `array` to generate the value to be summed.
  16710. * The iteratee is invoked with one argument: (value).
  16711. *
  16712. * @static
  16713. * @memberOf _
  16714. * @since 4.0.0
  16715. * @category Math
  16716. * @param {Array} array The array to iterate over.
  16717. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  16718. * @returns {number} Returns the sum.
  16719. * @example
  16720. *
  16721. * var objects = [{ 'n': 4 }, { 'n': 2 }, { 'n': 8 }, { 'n': 6 }];
  16722. *
  16723. * _.sumBy(objects, function(o) { return o.n; });
  16724. * // => 20
  16725. *
  16726. * // The `_.property` iteratee shorthand.
  16727. * _.sumBy(objects, 'n');
  16728. * // => 20
  16729. */
  16730. function sumBy(array, iteratee) {
  16731. return (array && array.length)
  16732. ? baseSum(array, getIteratee(iteratee, 2))
  16733. : 0;
  16734. }
  16735. /*------------------------------------------------------------------------*/
  16736. // Add methods that return wrapped values in chain sequences.
  16737. lodash.after = after;
  16738. lodash.ary = ary;
  16739. lodash.assign = assign;
  16740. lodash.assignIn = assignIn;
  16741. lodash.assignInWith = assignInWith;
  16742. lodash.assignWith = assignWith;
  16743. lodash.at = at;
  16744. lodash.before = before;
  16745. lodash.bind = bind;
  16746. lodash.bindAll = bindAll;
  16747. lodash.bindKey = bindKey;
  16748. lodash.castArray = castArray;
  16749. lodash.chain = chain;
  16750. lodash.chunk = chunk;
  16751. lodash.compact = compact;
  16752. lodash.concat = concat;
  16753. lodash.cond = cond;
  16754. lodash.conforms = conforms;
  16755. lodash.constant = constant;
  16756. lodash.countBy = countBy;
  16757. lodash.create = create;
  16758. lodash.curry = curry;
  16759. lodash.curryRight = curryRight;
  16760. lodash.debounce = debounce;
  16761. lodash.defaults = defaults;
  16762. lodash.defaultsDeep = defaultsDeep;
  16763. lodash.defer = defer;
  16764. lodash.delay = delay;
  16765. lodash.difference = difference;
  16766. lodash.differenceBy = differenceBy;
  16767. lodash.differenceWith = differenceWith;
  16768. lodash.drop = drop;
  16769. lodash.dropRight = dropRight;
  16770. lodash.dropRightWhile = dropRightWhile;
  16771. lodash.dropWhile = dropWhile;
  16772. lodash.fill = fill;
  16773. lodash.filter = filter;
  16774. lodash.flatMap = flatMap;
  16775. lodash.flatMapDeep = flatMapDeep;
  16776. lodash.flatMapDepth = flatMapDepth;
  16777. lodash.flatten = flatten;
  16778. lodash.flattenDeep = flattenDeep;
  16779. lodash.flattenDepth = flattenDepth;
  16780. lodash.flip = flip;
  16781. lodash.flow = flow;
  16782. lodash.flowRight = flowRight;
  16783. lodash.fromPairs = fromPairs;
  16784. lodash.functions = functions;
  16785. lodash.functionsIn = functionsIn;
  16786. lodash.groupBy = groupBy;
  16787. lodash.initial = initial;
  16788. lodash.intersection = intersection;
  16789. lodash.intersectionBy = intersectionBy;
  16790. lodash.intersectionWith = intersectionWith;
  16791. lodash.invert = invert;
  16792. lodash.invertBy = invertBy;
  16793. lodash.invokeMap = invokeMap;
  16794. lodash.iteratee = iteratee;
  16795. lodash.keyBy = keyBy;
  16796. lodash.keys = keys;
  16797. lodash.keysIn = keysIn;
  16798. lodash.map = map;
  16799. lodash.mapKeys = mapKeys;
  16800. lodash.mapValues = mapValues;
  16801. lodash.matches = matches;
  16802. lodash.matchesProperty = matchesProperty;
  16803. lodash.memoize = memoize;
  16804. lodash.merge = merge;
  16805. lodash.mergeWith = mergeWith;
  16806. lodash.method = method;
  16807. lodash.methodOf = methodOf;
  16808. lodash.mixin = mixin;
  16809. lodash.negate = negate;
  16810. lodash.nthArg = nthArg;
  16811. lodash.omit = omit;
  16812. lodash.omitBy = omitBy;
  16813. lodash.once = once;
  16814. lodash.orderBy = orderBy;
  16815. lodash.over = over;
  16816. lodash.overArgs = overArgs;
  16817. lodash.overEvery = overEvery;
  16818. lodash.overSome = overSome;
  16819. lodash.partial = partial;
  16820. lodash.partialRight = partialRight;
  16821. lodash.partition = partition;
  16822. lodash.pick = pick;
  16823. lodash.pickBy = pickBy;
  16824. lodash.property = property;
  16825. lodash.propertyOf = propertyOf;
  16826. lodash.pull = pull;
  16827. lodash.pullAll = pullAll;
  16828. lodash.pullAllBy = pullAllBy;
  16829. lodash.pullAllWith = pullAllWith;
  16830. lodash.pullAt = pullAt;
  16831. lodash.range = range;
  16832. lodash.rangeRight = rangeRight;
  16833. lodash.rearg = rearg;
  16834. lodash.reject = reject;
  16835. lodash.remove = remove;
  16836. lodash.rest = rest;
  16837. lodash.reverse = reverse;
  16838. lodash.sampleSize = sampleSize;
  16839. lodash.set = set;
  16840. lodash.setWith = setWith;
  16841. lodash.shuffle = shuffle;
  16842. lodash.slice = slice;
  16843. lodash.sortBy = sortBy;
  16844. lodash.sortedUniq = sortedUniq;
  16845. lodash.sortedUniqBy = sortedUniqBy;
  16846. lodash.split = split;
  16847. lodash.spread = spread;
  16848. lodash.tail = tail;
  16849. lodash.take = take;
  16850. lodash.takeRight = takeRight;
  16851. lodash.takeRightWhile = takeRightWhile;
  16852. lodash.takeWhile = takeWhile;
  16853. lodash.tap = tap;
  16854. lodash.throttle = throttle;
  16855. lodash.thru = thru;
  16856. lodash.toArray = toArray;
  16857. lodash.toPairs = toPairs;
  16858. lodash.toPairsIn = toPairsIn;
  16859. lodash.toPath = toPath;
  16860. lodash.toPlainObject = toPlainObject;
  16861. lodash.transform = transform;
  16862. lodash.unary = unary;
  16863. lodash.union = union;
  16864. lodash.unionBy = unionBy;
  16865. lodash.unionWith = unionWith;
  16866. lodash.uniq = uniq;
  16867. lodash.uniqBy = uniqBy;
  16868. lodash.uniqWith = uniqWith;
  16869. lodash.unset = unset;
  16870. lodash.unzip = unzip;
  16871. lodash.unzipWith = unzipWith;
  16872. lodash.update = update;
  16873. lodash.updateWith = updateWith;
  16874. lodash.values = values;
  16875. lodash.valuesIn = valuesIn;
  16876. lodash.without = without;
  16877. lodash.words = words;
  16878. lodash.wrap = wrap;
  16879. lodash.xor = xor;
  16880. lodash.xorBy = xorBy;
  16881. lodash.xorWith = xorWith;
  16882. lodash.zip = zip;
  16883. lodash.zipObject = zipObject;
  16884. lodash.zipObjectDeep = zipObjectDeep;
  16885. lodash.zipWith = zipWith;
  16886. // Add aliases.
  16887. lodash.entries = toPairs;
  16888. lodash.entriesIn = toPairsIn;
  16889. lodash.extend = assignIn;
  16890. lodash.extendWith = assignInWith;
  16891. // Add methods to `lodash.prototype`.
  16892. mixin(lodash, lodash);
  16893. /*------------------------------------------------------------------------*/
  16894. // Add methods that return unwrapped values in chain sequences.
  16895. lodash.add = add;
  16896. lodash.attempt = attempt;
  16897. lodash.camelCase = camelCase;
  16898. lodash.capitalize = capitalize;
  16899. lodash.ceil = ceil;
  16900. lodash.clamp = clamp;
  16901. lodash.clone = clone;
  16902. lodash.cloneDeep = cloneDeep;
  16903. lodash.cloneDeepWith = cloneDeepWith;
  16904. lodash.cloneWith = cloneWith;
  16905. lodash.conformsTo = conformsTo;
  16906. lodash.deburr = deburr;
  16907. lodash.defaultTo = defaultTo;
  16908. lodash.divide = divide;
  16909. lodash.endsWith = endsWith;
  16910. lodash.eq = eq;
  16911. lodash.escape = escape;
  16912. lodash.escapeRegExp = escapeRegExp;
  16913. lodash.every = every;
  16914. lodash.find = find;
  16915. lodash.findIndex = findIndex;
  16916. lodash.findKey = findKey;
  16917. lodash.findLast = findLast;
  16918. lodash.findLastIndex = findLastIndex;
  16919. lodash.findLastKey = findLastKey;
  16920. lodash.floor = floor;
  16921. lodash.forEach = forEach;
  16922. lodash.forEachRight = forEachRight;
  16923. lodash.forIn = forIn;
  16924. lodash.forInRight = forInRight;
  16925. lodash.forOwn = forOwn;
  16926. lodash.forOwnRight = forOwnRight;
  16927. lodash.get = get;
  16928. lodash.gt = gt;
  16929. lodash.gte = gte;
  16930. lodash.has = has;
  16931. lodash.hasIn = hasIn;
  16932. lodash.head = head;
  16933. lodash.identity = identity;
  16934. lodash.includes = includes;
  16935. lodash.indexOf = indexOf;
  16936. lodash.inRange = inRange;
  16937. lodash.invoke = invoke;
  16938. lodash.isArguments = isArguments;
  16939. lodash.isArray = isArray;
  16940. lodash.isArrayBuffer = isArrayBuffer;
  16941. lodash.isArrayLike = isArrayLike;
  16942. lodash.isArrayLikeObject = isArrayLikeObject;
  16943. lodash.isBoolean = isBoolean;
  16944. lodash.isBuffer = isBuffer;
  16945. lodash.isDate = isDate;
  16946. lodash.isElement = isElement;
  16947. lodash.isEmpty = isEmpty;
  16948. lodash.isEqual = isEqual;
  16949. lodash.isEqualWith = isEqualWith;
  16950. lodash.isError = isError;
  16951. lodash.isFinite = isFinite;
  16952. lodash.isFunction = isFunction;
  16953. lodash.isInteger = isInteger;
  16954. lodash.isLength = isLength;
  16955. lodash.isMap = isMap;
  16956. lodash.isMatch = isMatch;
  16957. lodash.isMatchWith = isMatchWith;
  16958. lodash.isNaN = isNaN;
  16959. lodash.isNative = isNative;
  16960. lodash.isNil = isNil;
  16961. lodash.isNull = isNull;
  16962. lodash.isNumber = isNumber;
  16963. lodash.isObject = isObject;
  16964. lodash.isObjectLike = isObjectLike;
  16965. lodash.isPlainObject = isPlainObject;
  16966. lodash.isRegExp = isRegExp;
  16967. lodash.isSafeInteger = isSafeInteger;
  16968. lodash.isSet = isSet;
  16969. lodash.isString = isString;
  16970. lodash.isSymbol = isSymbol;
  16971. lodash.isTypedArray = isTypedArray;
  16972. lodash.isUndefined = isUndefined;
  16973. lodash.isWeakMap = isWeakMap;
  16974. lodash.isWeakSet = isWeakSet;
  16975. lodash.join = join;
  16976. lodash.kebabCase = kebabCase;
  16977. lodash.last = last;
  16978. lodash.lastIndexOf = lastIndexOf;
  16979. lodash.lowerCase = lowerCase;
  16980. lodash.lowerFirst = lowerFirst;
  16981. lodash.lt = lt;
  16982. lodash.lte = lte;
  16983. lodash.max = max;
  16984. lodash.maxBy = maxBy;
  16985. lodash.mean = mean;
  16986. lodash.meanBy = meanBy;
  16987. lodash.min = min;
  16988. lodash.minBy = minBy;
  16989. lodash.stubArray = stubArray;
  16990. lodash.stubFalse = stubFalse;
  16991. lodash.stubObject = stubObject;
  16992. lodash.stubString = stubString;
  16993. lodash.stubTrue = stubTrue;
  16994. lodash.multiply = multiply;
  16995. lodash.nth = nth;
  16996. lodash.noConflict = noConflict;
  16997. lodash.noop = noop;
  16998. lodash.now = now;
  16999. lodash.pad = pad;
  17000. lodash.padEnd = padEnd;
  17001. lodash.padStart = padStart;
  17002. lodash.parseInt = parseInt;
  17003. lodash.random = random;
  17004. lodash.reduce = reduce;
  17005. lodash.reduceRight = reduceRight;
  17006. lodash.repeat = repeat;
  17007. lodash.replace = replace;
  17008. lodash.result = result;
  17009. lodash.round = round;
  17010. lodash.runInContext = runInContext;
  17011. lodash.sample = sample;
  17012. lodash.size = size;
  17013. lodash.snakeCase = snakeCase;
  17014. lodash.some = some;
  17015. lodash.sortedIndex = sortedIndex;
  17016. lodash.sortedIndexBy = sortedIndexBy;
  17017. lodash.sortedIndexOf = sortedIndexOf;
  17018. lodash.sortedLastIndex = sortedLastIndex;
  17019. lodash.sortedLastIndexBy = sortedLastIndexBy;
  17020. lodash.sortedLastIndexOf = sortedLastIndexOf;
  17021. lodash.startCase = startCase;
  17022. lodash.startsWith = startsWith;
  17023. lodash.subtract = subtract;
  17024. lodash.sum = sum;
  17025. lodash.sumBy = sumBy;
  17026. lodash.template = template;
  17027. lodash.times = times;
  17028. lodash.toFinite = toFinite;
  17029. lodash.toInteger = toInteger;
  17030. lodash.toLength = toLength;
  17031. lodash.toLower = toLower;
  17032. lodash.toNumber = toNumber;
  17033. lodash.toSafeInteger = toSafeInteger;
  17034. lodash.toString = toString;
  17035. lodash.toUpper = toUpper;
  17036. lodash.trim = trim;
  17037. lodash.trimEnd = trimEnd;
  17038. lodash.trimStart = trimStart;
  17039. lodash.truncate = truncate;
  17040. lodash.unescape = unescape;
  17041. lodash.uniqueId = uniqueId;
  17042. lodash.upperCase = upperCase;
  17043. lodash.upperFirst = upperFirst;
  17044. // Add aliases.
  17045. lodash.each = forEach;
  17046. lodash.eachRight = forEachRight;
  17047. lodash.first = head;
  17048. mixin(lodash, (function() {
  17049. var source = {};
  17050. baseForOwn(lodash, function(func, methodName) {
  17051. if (!hasOwnProperty.call(lodash.prototype, methodName)) {
  17052. source[methodName] = func;
  17053. }
  17054. });
  17055. return source;
  17056. }()), { 'chain': false });
  17057. /*------------------------------------------------------------------------*/
  17058. /**
  17059. * The semantic version number.
  17060. *
  17061. * @static
  17062. * @memberOf _
  17063. * @type {string}
  17064. */
  17065. lodash.VERSION = VERSION;
  17066. // Assign default placeholders.
  17067. arrayEach(['bind', 'bindKey', 'curry', 'curryRight', 'partial', 'partialRight'], function(methodName) {
  17068. lodash[methodName].placeholder = lodash;
  17069. });
  17070. // Add `LazyWrapper` methods for `_.drop` and `_.take` variants.
  17071. arrayEach(['drop', 'take'], function(methodName, index) {
  17072. LazyWrapper.prototype[methodName] = function(n) {
  17073. n = n === undefined ? 1 : nativeMax(toInteger(n), 0);
  17074. var result = (this.__filtered__ && !index)
  17075. ? new LazyWrapper(this)
  17076. : this.clone();
  17077. if (result.__filtered__) {
  17078. result.__takeCount__ = nativeMin(n, result.__takeCount__);
  17079. } else {
  17080. result.__views__.push({
  17081. 'size': nativeMin(n, MAX_ARRAY_LENGTH),
  17082. 'type': methodName + (result.__dir__ < 0 ? 'Right' : '')
  17083. });
  17084. }
  17085. return result;
  17086. };
  17087. LazyWrapper.prototype[methodName + 'Right'] = function(n) {
  17088. return this.reverse()[methodName](n).reverse();
  17089. };
  17090. });
  17091. // Add `LazyWrapper` methods that accept an `iteratee` value.
  17092. arrayEach(['filter', 'map', 'takeWhile'], function(methodName, index) {
  17093. var type = index + 1,
  17094. isFilter = type == LAZY_FILTER_FLAG || type == LAZY_WHILE_FLAG;
  17095. LazyWrapper.prototype[methodName] = function(iteratee) {
  17096. var result = this.clone();
  17097. result.__iteratees__.push({
  17098. 'iteratee': getIteratee(iteratee, 3),
  17099. 'type': type
  17100. });
  17101. result.__filtered__ = result.__filtered__ || isFilter;
  17102. return result;
  17103. };
  17104. });
  17105. // Add `LazyWrapper` methods for `_.head` and `_.last`.
  17106. arrayEach(['head', 'last'], function(methodName, index) {
  17107. var takeName = 'take' + (index ? 'Right' : '');
  17108. LazyWrapper.prototype[methodName] = function() {
  17109. return this[takeName](1).value()[0];
  17110. };
  17111. });
  17112. // Add `LazyWrapper` methods for `_.initial` and `_.tail`.
  17113. arrayEach(['initial', 'tail'], function(methodName, index) {
  17114. var dropName = 'drop' + (index ? '' : 'Right');
  17115. LazyWrapper.prototype[methodName] = function() {
  17116. return this.__filtered__ ? new LazyWrapper(this) : this[dropName](1);
  17117. };
  17118. });
  17119. LazyWrapper.prototype.compact = function() {
  17120. return this.filter(identity);
  17121. };
  17122. LazyWrapper.prototype.find = function(predicate) {
  17123. return this.filter(predicate).head();
  17124. };
  17125. LazyWrapper.prototype.findLast = function(predicate) {
  17126. return this.reverse().find(predicate);
  17127. };
  17128. LazyWrapper.prototype.invokeMap = baseRest(function(path, args) {
  17129. if (typeof path == 'function') {
  17130. return new LazyWrapper(this);
  17131. }
  17132. return this.map(function(value) {
  17133. return baseInvoke(value, path, args);
  17134. });
  17135. });
  17136. LazyWrapper.prototype.reject = function(predicate) {
  17137. return this.filter(negate(getIteratee(predicate)));
  17138. };
  17139. LazyWrapper.prototype.slice = function(start, end) {
  17140. start = toInteger(start);
  17141. var result = this;
  17142. if (result.__filtered__ && (start > 0 || end < 0)) {
  17143. return new LazyWrapper(result);
  17144. }
  17145. if (start < 0) {
  17146. result = result.takeRight(-start);
  17147. } else if (start) {
  17148. result = result.drop(start);
  17149. }
  17150. if (end !== undefined) {
  17151. end = toInteger(end);
  17152. result = end < 0 ? result.dropRight(-end) : result.take(end - start);
  17153. }
  17154. return result;
  17155. };
  17156. LazyWrapper.prototype.takeRightWhile = function(predicate) {
  17157. return this.reverse().takeWhile(predicate).reverse();
  17158. };
  17159. LazyWrapper.prototype.toArray = function() {
  17160. return this.take(MAX_ARRAY_LENGTH);
  17161. };
  17162. // Add `LazyWrapper` methods to `lodash.prototype`.
  17163. baseForOwn(LazyWrapper.prototype, function(func, methodName) {
  17164. var checkIteratee = /^(?:filter|find|map|reject)|While$/.test(methodName),
  17165. isTaker = /^(?:head|last)$/.test(methodName),
  17166. lodashFunc = lodash[isTaker ? ('take' + (methodName == 'last' ? 'Right' : '')) : methodName],
  17167. retUnwrapped = isTaker || /^find/.test(methodName);
  17168. if (!lodashFunc) {
  17169. return;
  17170. }
  17171. lodash.prototype[methodName] = function() {
  17172. var value = this.__wrapped__,
  17173. args = isTaker ? [1] : arguments,
  17174. isLazy = value instanceof LazyWrapper,
  17175. iteratee = args[0],
  17176. useLazy = isLazy || isArray(value);
  17177. var interceptor = function(value) {
  17178. var result = lodashFunc.apply(lodash, arrayPush([value], args));
  17179. return (isTaker && chainAll) ? result[0] : result;
  17180. };
  17181. if (useLazy && checkIteratee && typeof iteratee == 'function' && iteratee.length != 1) {
  17182. // Avoid lazy use if the iteratee has a "length" value other than `1`.
  17183. isLazy = useLazy = false;
  17184. }
  17185. var chainAll = this.__chain__,
  17186. isHybrid = !!this.__actions__.length,
  17187. isUnwrapped = retUnwrapped && !chainAll,
  17188. onlyLazy = isLazy && !isHybrid;
  17189. if (!retUnwrapped && useLazy) {
  17190. value = onlyLazy ? value : new LazyWrapper(this);
  17191. var result = func.apply(value, args);
  17192. result.__actions__.push({ 'func': thru, 'args': [interceptor], 'thisArg': undefined });
  17193. return new LodashWrapper(result, chainAll);
  17194. }
  17195. if (isUnwrapped && onlyLazy) {
  17196. return func.apply(this, args);
  17197. }
  17198. result = this.thru(interceptor);
  17199. return isUnwrapped ? (isTaker ? result.value()[0] : result.value()) : result;
  17200. };
  17201. });
  17202. // Add `Array` methods to `lodash.prototype`.
  17203. arrayEach(['pop', 'push', 'shift', 'sort', 'splice', 'unshift'], function(methodName) {
  17204. var func = arrayProto[methodName],
  17205. chainName = /^(?:push|sort|unshift)$/.test(methodName) ? 'tap' : 'thru',
  17206. retUnwrapped = /^(?:pop|shift)$/.test(methodName);
  17207. lodash.prototype[methodName] = function() {
  17208. var args = arguments;
  17209. if (retUnwrapped && !this.__chain__) {
  17210. var value = this.value();
  17211. return func.apply(isArray(value) ? value : [], args);
  17212. }
  17213. return this[chainName](function(value) {
  17214. return func.apply(isArray(value) ? value : [], args);
  17215. });
  17216. };
  17217. });
  17218. // Map minified method names to their real names.
  17219. baseForOwn(LazyWrapper.prototype, function(func, methodName) {
  17220. var lodashFunc = lodash[methodName];
  17221. if (lodashFunc) {
  17222. var key = lodashFunc.name + '';
  17223. if (!hasOwnProperty.call(realNames, key)) {
  17224. realNames[key] = [];
  17225. }
  17226. realNames[key].push({ 'name': methodName, 'func': lodashFunc });
  17227. }
  17228. });
  17229. realNames[createHybrid(undefined, WRAP_BIND_KEY_FLAG).name] = [{
  17230. 'name': 'wrapper',
  17231. 'func': undefined
  17232. }];
  17233. // Add methods to `LazyWrapper`.
  17234. LazyWrapper.prototype.clone = lazyClone;
  17235. LazyWrapper.prototype.reverse = lazyReverse;
  17236. LazyWrapper.prototype.value = lazyValue;
  17237. // Add chain sequence methods to the `lodash` wrapper.
  17238. lodash.prototype.at = wrapperAt;
  17239. lodash.prototype.chain = wrapperChain;
  17240. lodash.prototype.commit = wrapperCommit;
  17241. lodash.prototype.next = wrapperNext;
  17242. lodash.prototype.plant = wrapperPlant;
  17243. lodash.prototype.reverse = wrapperReverse;
  17244. lodash.prototype.toJSON = lodash.prototype.valueOf = lodash.prototype.value = wrapperValue;
  17245. // Add lazy aliases.
  17246. lodash.prototype.first = lodash.prototype.head;
  17247. if (symIterator) {
  17248. lodash.prototype[symIterator] = wrapperToIterator;
  17249. }
  17250. return lodash;
  17251. });
  17252. /*--------------------------------------------------------------------------*/
  17253. // Export lodash.
  17254. var _ = runInContext();
  17255. // Some AMD build optimizers, like r.js, check for condition patterns like:
  17256. if (true) {
  17257. // Expose Lodash on the global object to prevent errors when Lodash is
  17258. // loaded by a script tag in the presence of an AMD loader.
  17259. // See http://requirejs.org/docs/errors.html#mismatch for more details.
  17260. // Use `_.noConflict` to remove Lodash from the global object.
  17261. root._ = _;
  17262. // Define as an anonymous module so, through path mapping, it can be
  17263. // referenced as the "underscore" module.
  17264. !(__WEBPACK_AMD_DEFINE_RESULT__ = (function() {
  17265. return _;
  17266. }).call(exports, __webpack_require__, exports, module),
  17267. __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
  17268. }
  17269. // Check for `exports` after `define` in case a build optimizer adds it.
  17270. else {}
  17271. }.call(this));
  17272. /***/ }),
  17273. /***/ "./node_modules/style-loader/dist/cjs.js!./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppSidebar.vue?vue&type=style&index=0&id=22a4e926&lang=scss&scoped=true":
  17274. /*!****************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  17275. !*** ./node_modules/style-loader/dist/cjs.js!./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppSidebar.vue?vue&type=style&index=0&id=22a4e926&lang=scss&scoped=true ***!
  17276. \****************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  17277. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17278. "use strict";
  17279. __webpack_require__.r(__webpack_exports__);
  17280. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17281. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17282. /* harmony export */ });
  17283. /* 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");
  17284. /* 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__);
  17285. /* harmony import */ var _node_modules_css_loader_dist_cjs_js_clonedRuleSet_11_use_1_node_modules_vue_loader_dist_stylePostLoader_js_node_modules_postcss_loader_dist_cjs_js_clonedRuleSet_11_use_2_node_modules_sass_loader_dist_cjs_js_clonedRuleSet_11_use_3_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_AppSidebar_vue_vue_type_style_index_0_id_22a4e926_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! !!../../../node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!../../../node_modules/vue-loader/dist/stylePostLoader.js!../../../node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!../../../node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!../../../node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./AppSidebar.vue?vue&type=style&index=0&id=22a4e926&lang=scss&scoped=true */ "./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppSidebar.vue?vue&type=style&index=0&id=22a4e926&lang=scss&scoped=true");
  17286. var options = {};
  17287. options.insert = "head";
  17288. options.singleton = false;
  17289. var update = _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default()(_node_modules_css_loader_dist_cjs_js_clonedRuleSet_11_use_1_node_modules_vue_loader_dist_stylePostLoader_js_node_modules_postcss_loader_dist_cjs_js_clonedRuleSet_11_use_2_node_modules_sass_loader_dist_cjs_js_clonedRuleSet_11_use_3_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_AppSidebar_vue_vue_type_style_index_0_id_22a4e926_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_1__["default"], options);
  17290. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (_node_modules_css_loader_dist_cjs_js_clonedRuleSet_11_use_1_node_modules_vue_loader_dist_stylePostLoader_js_node_modules_postcss_loader_dist_cjs_js_clonedRuleSet_11_use_2_node_modules_sass_loader_dist_cjs_js_clonedRuleSet_11_use_3_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_AppSidebar_vue_vue_type_style_index_0_id_22a4e926_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_1__["default"].locals || {});
  17291. /***/ }),
  17292. /***/ "./node_modules/style-loader/dist/cjs.js!./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppSubSidebar.vue?vue&type=style&index=0&id=0addd9bc&lang=scss&scoped=true":
  17293. /*!*******************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  17294. !*** ./node_modules/style-loader/dist/cjs.js!./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppSubSidebar.vue?vue&type=style&index=0&id=0addd9bc&lang=scss&scoped=true ***!
  17295. \*******************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  17296. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17297. "use strict";
  17298. __webpack_require__.r(__webpack_exports__);
  17299. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17300. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17301. /* harmony export */ });
  17302. /* 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");
  17303. /* 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__);
  17304. /* harmony import */ var _node_modules_css_loader_dist_cjs_js_clonedRuleSet_11_use_1_node_modules_vue_loader_dist_stylePostLoader_js_node_modules_postcss_loader_dist_cjs_js_clonedRuleSet_11_use_2_node_modules_sass_loader_dist_cjs_js_clonedRuleSet_11_use_3_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_AppSubSidebar_vue_vue_type_style_index_0_id_0addd9bc_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! !!../../../node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!../../../node_modules/vue-loader/dist/stylePostLoader.js!../../../node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!../../../node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!../../../node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./AppSubSidebar.vue?vue&type=style&index=0&id=0addd9bc&lang=scss&scoped=true */ "./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppSubSidebar.vue?vue&type=style&index=0&id=0addd9bc&lang=scss&scoped=true");
  17305. var options = {};
  17306. options.insert = "head";
  17307. options.singleton = false;
  17308. var update = _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default()(_node_modules_css_loader_dist_cjs_js_clonedRuleSet_11_use_1_node_modules_vue_loader_dist_stylePostLoader_js_node_modules_postcss_loader_dist_cjs_js_clonedRuleSet_11_use_2_node_modules_sass_loader_dist_cjs_js_clonedRuleSet_11_use_3_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_AppSubSidebar_vue_vue_type_style_index_0_id_0addd9bc_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_1__["default"], options);
  17309. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (_node_modules_css_loader_dist_cjs_js_clonedRuleSet_11_use_1_node_modules_vue_loader_dist_stylePostLoader_js_node_modules_postcss_loader_dist_cjs_js_clonedRuleSet_11_use_2_node_modules_sass_loader_dist_cjs_js_clonedRuleSet_11_use_3_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_AppSubSidebar_vue_vue_type_style_index_0_id_0addd9bc_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_1__["default"].locals || {});
  17310. /***/ }),
  17311. /***/ "./node_modules/style-loader/dist/cjs.js!./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppTopBar.vue?vue&type=style&index=0&id=42bf62a4&lang=scss&scoped=true":
  17312. /*!***************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  17313. !*** ./node_modules/style-loader/dist/cjs.js!./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppTopBar.vue?vue&type=style&index=0&id=42bf62a4&lang=scss&scoped=true ***!
  17314. \***************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  17315. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17316. "use strict";
  17317. __webpack_require__.r(__webpack_exports__);
  17318. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17319. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17320. /* harmony export */ });
  17321. /* 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");
  17322. /* 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__);
  17323. /* harmony import */ var _node_modules_css_loader_dist_cjs_js_clonedRuleSet_11_use_1_node_modules_vue_loader_dist_stylePostLoader_js_node_modules_postcss_loader_dist_cjs_js_clonedRuleSet_11_use_2_node_modules_sass_loader_dist_cjs_js_clonedRuleSet_11_use_3_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_AppTopBar_vue_vue_type_style_index_0_id_42bf62a4_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! !!../../../node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!../../../node_modules/vue-loader/dist/stylePostLoader.js!../../../node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!../../../node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!../../../node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./AppTopBar.vue?vue&type=style&index=0&id=42bf62a4&lang=scss&scoped=true */ "./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppTopBar.vue?vue&type=style&index=0&id=42bf62a4&lang=scss&scoped=true");
  17324. var options = {};
  17325. options.insert = "head";
  17326. options.singleton = false;
  17327. var update = _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default()(_node_modules_css_loader_dist_cjs_js_clonedRuleSet_11_use_1_node_modules_vue_loader_dist_stylePostLoader_js_node_modules_postcss_loader_dist_cjs_js_clonedRuleSet_11_use_2_node_modules_sass_loader_dist_cjs_js_clonedRuleSet_11_use_3_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_AppTopBar_vue_vue_type_style_index_0_id_42bf62a4_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_1__["default"], options);
  17328. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (_node_modules_css_loader_dist_cjs_js_clonedRuleSet_11_use_1_node_modules_vue_loader_dist_stylePostLoader_js_node_modules_postcss_loader_dist_cjs_js_clonedRuleSet_11_use_2_node_modules_sass_loader_dist_cjs_js_clonedRuleSet_11_use_3_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_AppTopBar_vue_vue_type_style_index_0_id_42bf62a4_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_1__["default"].locals || {});
  17329. /***/ }),
  17330. /***/ "./node_modules/style-loader/dist/cjs.js!./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/layouts/DashboardLayout.vue?vue&type=style&index=0&id=549bf5ac&lang=scss&scoped=true":
  17331. /*!******************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  17332. !*** ./node_modules/style-loader/dist/cjs.js!./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/layouts/DashboardLayout.vue?vue&type=style&index=0&id=549bf5ac&lang=scss&scoped=true ***!
  17333. \******************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  17334. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17335. "use strict";
  17336. __webpack_require__.r(__webpack_exports__);
  17337. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17338. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17339. /* harmony export */ });
  17340. /* 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");
  17341. /* 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__);
  17342. /* harmony import */ var _node_modules_css_loader_dist_cjs_js_clonedRuleSet_11_use_1_node_modules_vue_loader_dist_stylePostLoader_js_node_modules_postcss_loader_dist_cjs_js_clonedRuleSet_11_use_2_node_modules_sass_loader_dist_cjs_js_clonedRuleSet_11_use_3_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_DashboardLayout_vue_vue_type_style_index_0_id_549bf5ac_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! !!../../../node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!../../../node_modules/vue-loader/dist/stylePostLoader.js!../../../node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!../../../node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!../../../node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./DashboardLayout.vue?vue&type=style&index=0&id=549bf5ac&lang=scss&scoped=true */ "./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/layouts/DashboardLayout.vue?vue&type=style&index=0&id=549bf5ac&lang=scss&scoped=true");
  17343. var options = {};
  17344. options.insert = "head";
  17345. options.singleton = false;
  17346. var update = _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default()(_node_modules_css_loader_dist_cjs_js_clonedRuleSet_11_use_1_node_modules_vue_loader_dist_stylePostLoader_js_node_modules_postcss_loader_dist_cjs_js_clonedRuleSet_11_use_2_node_modules_sass_loader_dist_cjs_js_clonedRuleSet_11_use_3_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_DashboardLayout_vue_vue_type_style_index_0_id_549bf5ac_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_1__["default"], options);
  17347. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (_node_modules_css_loader_dist_cjs_js_clonedRuleSet_11_use_1_node_modules_vue_loader_dist_stylePostLoader_js_node_modules_postcss_loader_dist_cjs_js_clonedRuleSet_11_use_2_node_modules_sass_loader_dist_cjs_js_clonedRuleSet_11_use_3_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_DashboardLayout_vue_vue_type_style_index_0_id_549bf5ac_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_1__["default"].locals || {});
  17348. /***/ }),
  17349. /***/ "./node_modules/vue-loader/dist/exportHelper.js":
  17350. /*!******************************************************!*\
  17351. !*** ./node_modules/vue-loader/dist/exportHelper.js ***!
  17352. \******************************************************/
  17353. /***/ ((__unused_webpack_module, exports) => {
  17354. "use strict";
  17355. Object.defineProperty(exports, "__esModule", ({ value: true }));
  17356. // runtime helper for setting properties on components
  17357. // in a tree-shakable way
  17358. exports["default"] = (sfc, props) => {
  17359. const target = sfc.__vccOpts || sfc;
  17360. for (const [key, val] of props) {
  17361. target[key] = val;
  17362. }
  17363. return target;
  17364. };
  17365. /***/ }),
  17366. /***/ "./resources/js/components/AppButtonLink.vue":
  17367. /*!***************************************************!*\
  17368. !*** ./resources/js/components/AppButtonLink.vue ***!
  17369. \***************************************************/
  17370. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17371. "use strict";
  17372. __webpack_require__.r(__webpack_exports__);
  17373. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17374. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17375. /* harmony export */ });
  17376. /* 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");
  17377. /* 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");
  17378. /* 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");
  17379. ;
  17380. 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"]])
  17381. /* hot reload */
  17382. if (false) {}
  17383. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__);
  17384. /***/ }),
  17385. /***/ "./resources/js/components/AppMessage.vue":
  17386. /*!************************************************!*\
  17387. !*** ./resources/js/components/AppMessage.vue ***!
  17388. \************************************************/
  17389. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17390. "use strict";
  17391. __webpack_require__.r(__webpack_exports__);
  17392. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17393. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17394. /* harmony export */ });
  17395. /* harmony import */ var _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");
  17396. /* 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");
  17397. /* 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");
  17398. ;
  17399. 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"]])
  17400. /* hot reload */
  17401. if (false) {}
  17402. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__);
  17403. /***/ }),
  17404. /***/ "./resources/js/components/AppPagination.vue":
  17405. /*!***************************************************!*\
  17406. !*** ./resources/js/components/AppPagination.vue ***!
  17407. \***************************************************/
  17408. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17409. "use strict";
  17410. __webpack_require__.r(__webpack_exports__);
  17411. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17412. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17413. /* harmony export */ });
  17414. /* 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");
  17415. /* 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");
  17416. /* 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");
  17417. ;
  17418. 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"]])
  17419. /* hot reload */
  17420. if (false) {}
  17421. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__);
  17422. /***/ }),
  17423. /***/ "./resources/js/components/AppSidebar.vue":
  17424. /*!************************************************!*\
  17425. !*** ./resources/js/components/AppSidebar.vue ***!
  17426. \************************************************/
  17427. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17428. "use strict";
  17429. __webpack_require__.r(__webpack_exports__);
  17430. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17431. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17432. /* harmony export */ });
  17433. /* harmony import */ var _AppSidebar_vue_vue_type_template_id_22a4e926_scoped_true__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./AppSidebar.vue?vue&type=template&id=22a4e926&scoped=true */ "./resources/js/components/AppSidebar.vue?vue&type=template&id=22a4e926&scoped=true");
  17434. /* harmony import */ var _AppSidebar_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./AppSidebar.vue?vue&type=script&setup=true&lang=js */ "./resources/js/components/AppSidebar.vue?vue&type=script&setup=true&lang=js");
  17435. /* harmony import */ var _AppSidebar_vue_vue_type_style_index_0_id_22a4e926_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./AppSidebar.vue?vue&type=style&index=0&id=22a4e926&lang=scss&scoped=true */ "./resources/js/components/AppSidebar.vue?vue&type=style&index=0&id=22a4e926&lang=scss&scoped=true");
  17436. /* 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");
  17437. ;
  17438. 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"])(_AppSidebar_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_1__["default"], [['render',_AppSidebar_vue_vue_type_template_id_22a4e926_scoped_true__WEBPACK_IMPORTED_MODULE_0__.render],['__scopeId',"data-v-22a4e926"],['__file',"resources/js/components/AppSidebar.vue"]])
  17439. /* hot reload */
  17440. if (false) {}
  17441. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__);
  17442. /***/ }),
  17443. /***/ "./resources/js/components/AppSubSidebar.vue":
  17444. /*!***************************************************!*\
  17445. !*** ./resources/js/components/AppSubSidebar.vue ***!
  17446. \***************************************************/
  17447. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17448. "use strict";
  17449. __webpack_require__.r(__webpack_exports__);
  17450. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17451. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17452. /* harmony export */ });
  17453. /* harmony import */ var _AppSubSidebar_vue_vue_type_template_id_0addd9bc_scoped_true__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./AppSubSidebar.vue?vue&type=template&id=0addd9bc&scoped=true */ "./resources/js/components/AppSubSidebar.vue?vue&type=template&id=0addd9bc&scoped=true");
  17454. /* harmony import */ var _AppSubSidebar_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./AppSubSidebar.vue?vue&type=script&setup=true&lang=js */ "./resources/js/components/AppSubSidebar.vue?vue&type=script&setup=true&lang=js");
  17455. /* harmony import */ var _AppSubSidebar_vue_vue_type_style_index_0_id_0addd9bc_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./AppSubSidebar.vue?vue&type=style&index=0&id=0addd9bc&lang=scss&scoped=true */ "./resources/js/components/AppSubSidebar.vue?vue&type=style&index=0&id=0addd9bc&lang=scss&scoped=true");
  17456. /* 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");
  17457. ;
  17458. 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"])(_AppSubSidebar_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_1__["default"], [['render',_AppSubSidebar_vue_vue_type_template_id_0addd9bc_scoped_true__WEBPACK_IMPORTED_MODULE_0__.render],['__scopeId',"data-v-0addd9bc"],['__file',"resources/js/components/AppSubSidebar.vue"]])
  17459. /* hot reload */
  17460. if (false) {}
  17461. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__);
  17462. /***/ }),
  17463. /***/ "./resources/js/components/AppTopBar.vue":
  17464. /*!***********************************************!*\
  17465. !*** ./resources/js/components/AppTopBar.vue ***!
  17466. \***********************************************/
  17467. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17468. "use strict";
  17469. __webpack_require__.r(__webpack_exports__);
  17470. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17471. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17472. /* harmony export */ });
  17473. /* harmony import */ var _AppTopBar_vue_vue_type_template_id_42bf62a4_scoped_true__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./AppTopBar.vue?vue&type=template&id=42bf62a4&scoped=true */ "./resources/js/components/AppTopBar.vue?vue&type=template&id=42bf62a4&scoped=true");
  17474. /* harmony import */ var _AppTopBar_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./AppTopBar.vue?vue&type=script&setup=true&lang=js */ "./resources/js/components/AppTopBar.vue?vue&type=script&setup=true&lang=js");
  17475. /* harmony import */ var _AppTopBar_vue_vue_type_style_index_0_id_42bf62a4_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./AppTopBar.vue?vue&type=style&index=0&id=42bf62a4&lang=scss&scoped=true */ "./resources/js/components/AppTopBar.vue?vue&type=style&index=0&id=42bf62a4&lang=scss&scoped=true");
  17476. /* 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");
  17477. ;
  17478. 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"])(_AppTopBar_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_1__["default"], [['render',_AppTopBar_vue_vue_type_template_id_42bf62a4_scoped_true__WEBPACK_IMPORTED_MODULE_0__.render],['__scopeId',"data-v-42bf62a4"],['__file',"resources/js/components/AppTopBar.vue"]])
  17479. /* hot reload */
  17480. if (false) {}
  17481. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__);
  17482. /***/ }),
  17483. /***/ "./resources/js/layouts/DashboardLayout.vue":
  17484. /*!**************************************************!*\
  17485. !*** ./resources/js/layouts/DashboardLayout.vue ***!
  17486. \**************************************************/
  17487. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17488. "use strict";
  17489. __webpack_require__.r(__webpack_exports__);
  17490. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17491. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17492. /* harmony export */ });
  17493. /* harmony import */ var _DashboardLayout_vue_vue_type_template_id_549bf5ac_scoped_true__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./DashboardLayout.vue?vue&type=template&id=549bf5ac&scoped=true */ "./resources/js/layouts/DashboardLayout.vue?vue&type=template&id=549bf5ac&scoped=true");
  17494. /* harmony import */ var _DashboardLayout_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./DashboardLayout.vue?vue&type=script&setup=true&lang=js */ "./resources/js/layouts/DashboardLayout.vue?vue&type=script&setup=true&lang=js");
  17495. /* harmony import */ var _DashboardLayout_vue_vue_type_style_index_0_id_549bf5ac_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./DashboardLayout.vue?vue&type=style&index=0&id=549bf5ac&lang=scss&scoped=true */ "./resources/js/layouts/DashboardLayout.vue?vue&type=style&index=0&id=549bf5ac&lang=scss&scoped=true");
  17496. /* 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");
  17497. ;
  17498. 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_549bf5ac_scoped_true__WEBPACK_IMPORTED_MODULE_0__.render],['__scopeId',"data-v-549bf5ac"],['__file',"resources/js/layouts/DashboardLayout.vue"]])
  17499. /* hot reload */
  17500. if (false) {}
  17501. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__);
  17502. /***/ }),
  17503. /***/ "./resources/js/pages/Customers/Index.vue":
  17504. /*!************************************************!*\
  17505. !*** ./resources/js/pages/Customers/Index.vue ***!
  17506. \************************************************/
  17507. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17508. "use strict";
  17509. __webpack_require__.r(__webpack_exports__);
  17510. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17511. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17512. /* harmony export */ });
  17513. /* harmony import */ var _Index_vue_vue_type_template_id_2f43e3ff__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./Index.vue?vue&type=template&id=2f43e3ff */ "./resources/js/pages/Customers/Index.vue?vue&type=template&id=2f43e3ff");
  17514. /* 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/Customers/Index.vue?vue&type=script&setup=true&lang=js");
  17515. /* 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");
  17516. ;
  17517. 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_2f43e3ff__WEBPACK_IMPORTED_MODULE_0__.render],['__file',"resources/js/pages/Customers/Index.vue"]])
  17518. /* hot reload */
  17519. if (false) {}
  17520. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__);
  17521. /***/ }),
  17522. /***/ "./resources/js/components/AppButtonLink.vue?vue&type=script&setup=true&lang=js":
  17523. /*!**************************************************************************************!*\
  17524. !*** ./resources/js/components/AppButtonLink.vue?vue&type=script&setup=true&lang=js ***!
  17525. \**************************************************************************************/
  17526. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17527. "use strict";
  17528. __webpack_require__.r(__webpack_exports__);
  17529. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17530. /* 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"])
  17531. /* harmony export */ });
  17532. /* 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");
  17533. /***/ }),
  17534. /***/ "./resources/js/components/AppMessage.vue?vue&type=script&setup=true&lang=js":
  17535. /*!***********************************************************************************!*\
  17536. !*** ./resources/js/components/AppMessage.vue?vue&type=script&setup=true&lang=js ***!
  17537. \***********************************************************************************/
  17538. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17539. "use strict";
  17540. __webpack_require__.r(__webpack_exports__);
  17541. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17542. /* 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"])
  17543. /* harmony export */ });
  17544. /* 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");
  17545. /***/ }),
  17546. /***/ "./resources/js/components/AppPagination.vue?vue&type=script&setup=true&lang=js":
  17547. /*!**************************************************************************************!*\
  17548. !*** ./resources/js/components/AppPagination.vue?vue&type=script&setup=true&lang=js ***!
  17549. \**************************************************************************************/
  17550. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17551. "use strict";
  17552. __webpack_require__.r(__webpack_exports__);
  17553. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17554. /* 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"])
  17555. /* harmony export */ });
  17556. /* 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");
  17557. /***/ }),
  17558. /***/ "./resources/js/components/AppSidebar.vue?vue&type=script&setup=true&lang=js":
  17559. /*!***********************************************************************************!*\
  17560. !*** ./resources/js/components/AppSidebar.vue?vue&type=script&setup=true&lang=js ***!
  17561. \***********************************************************************************/
  17562. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17563. "use strict";
  17564. __webpack_require__.r(__webpack_exports__);
  17565. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17566. /* harmony export */ "default": () => (/* reexport safe */ _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_AppSidebar_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_0__["default"])
  17567. /* harmony export */ });
  17568. /* harmony import */ var _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_AppSidebar_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!../../../node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./AppSidebar.vue?vue&type=script&setup=true&lang=js */ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppSidebar.vue?vue&type=script&setup=true&lang=js");
  17569. /***/ }),
  17570. /***/ "./resources/js/components/AppSubSidebar.vue?vue&type=script&setup=true&lang=js":
  17571. /*!**************************************************************************************!*\
  17572. !*** ./resources/js/components/AppSubSidebar.vue?vue&type=script&setup=true&lang=js ***!
  17573. \**************************************************************************************/
  17574. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17575. "use strict";
  17576. __webpack_require__.r(__webpack_exports__);
  17577. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17578. /* harmony export */ "default": () => (/* reexport safe */ _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_AppSubSidebar_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_0__["default"])
  17579. /* harmony export */ });
  17580. /* harmony import */ var _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_AppSubSidebar_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!../../../node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./AppSubSidebar.vue?vue&type=script&setup=true&lang=js */ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppSubSidebar.vue?vue&type=script&setup=true&lang=js");
  17581. /***/ }),
  17582. /***/ "./resources/js/components/AppTopBar.vue?vue&type=script&setup=true&lang=js":
  17583. /*!**********************************************************************************!*\
  17584. !*** ./resources/js/components/AppTopBar.vue?vue&type=script&setup=true&lang=js ***!
  17585. \**********************************************************************************/
  17586. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17587. "use strict";
  17588. __webpack_require__.r(__webpack_exports__);
  17589. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17590. /* harmony export */ "default": () => (/* reexport safe */ _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_AppTopBar_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_0__["default"])
  17591. /* harmony export */ });
  17592. /* harmony import */ var _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_AppTopBar_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!../../../node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./AppTopBar.vue?vue&type=script&setup=true&lang=js */ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppTopBar.vue?vue&type=script&setup=true&lang=js");
  17593. /***/ }),
  17594. /***/ "./resources/js/layouts/DashboardLayout.vue?vue&type=script&setup=true&lang=js":
  17595. /*!*************************************************************************************!*\
  17596. !*** ./resources/js/layouts/DashboardLayout.vue?vue&type=script&setup=true&lang=js ***!
  17597. \*************************************************************************************/
  17598. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17599. "use strict";
  17600. __webpack_require__.r(__webpack_exports__);
  17601. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17602. /* 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"])
  17603. /* harmony export */ });
  17604. /* harmony import */ var _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_DashboardLayout_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!../../../node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./DashboardLayout.vue?vue&type=script&setup=true&lang=js */ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/layouts/DashboardLayout.vue?vue&type=script&setup=true&lang=js");
  17605. /***/ }),
  17606. /***/ "./resources/js/pages/Customers/Index.vue?vue&type=script&setup=true&lang=js":
  17607. /*!***********************************************************************************!*\
  17608. !*** ./resources/js/pages/Customers/Index.vue?vue&type=script&setup=true&lang=js ***!
  17609. \***********************************************************************************/
  17610. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17611. "use strict";
  17612. __webpack_require__.r(__webpack_exports__);
  17613. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17614. /* 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"])
  17615. /* harmony export */ });
  17616. /* 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/Customers/Index.vue?vue&type=script&setup=true&lang=js");
  17617. /***/ }),
  17618. /***/ "./resources/js/components/AppButtonLink.vue?vue&type=template&id=c3621f1c":
  17619. /*!*********************************************************************************!*\
  17620. !*** ./resources/js/components/AppButtonLink.vue?vue&type=template&id=c3621f1c ***!
  17621. \*********************************************************************************/
  17622. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17623. "use strict";
  17624. __webpack_require__.r(__webpack_exports__);
  17625. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17626. /* 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)
  17627. /* harmony export */ });
  17628. /* 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");
  17629. /***/ }),
  17630. /***/ "./resources/js/components/AppMessage.vue?vue&type=template&id=07159051":
  17631. /*!******************************************************************************!*\
  17632. !*** ./resources/js/components/AppMessage.vue?vue&type=template&id=07159051 ***!
  17633. \******************************************************************************/
  17634. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17635. "use strict";
  17636. __webpack_require__.r(__webpack_exports__);
  17637. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17638. /* 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)
  17639. /* harmony export */ });
  17640. /* 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");
  17641. /***/ }),
  17642. /***/ "./resources/js/components/AppPagination.vue?vue&type=template&id=4da56ec0":
  17643. /*!*********************************************************************************!*\
  17644. !*** ./resources/js/components/AppPagination.vue?vue&type=template&id=4da56ec0 ***!
  17645. \*********************************************************************************/
  17646. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17647. "use strict";
  17648. __webpack_require__.r(__webpack_exports__);
  17649. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17650. /* 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)
  17651. /* harmony export */ });
  17652. /* 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");
  17653. /***/ }),
  17654. /***/ "./resources/js/components/AppSidebar.vue?vue&type=template&id=22a4e926&scoped=true":
  17655. /*!******************************************************************************************!*\
  17656. !*** ./resources/js/components/AppSidebar.vue?vue&type=template&id=22a4e926&scoped=true ***!
  17657. \******************************************************************************************/
  17658. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17659. "use strict";
  17660. __webpack_require__.r(__webpack_exports__);
  17661. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17662. /* harmony export */ "render": () => (/* reexport safe */ _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_templateLoader_js_ruleSet_1_rules_2_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_AppSidebar_vue_vue_type_template_id_22a4e926_scoped_true__WEBPACK_IMPORTED_MODULE_0__.render)
  17663. /* harmony export */ });
  17664. /* harmony import */ var _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_templateLoader_js_ruleSet_1_rules_2_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_AppSidebar_vue_vue_type_template_id_22a4e926_scoped_true__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!../../../node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!../../../node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./AppSidebar.vue?vue&type=template&id=22a4e926&scoped=true */ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppSidebar.vue?vue&type=template&id=22a4e926&scoped=true");
  17665. /***/ }),
  17666. /***/ "./resources/js/components/AppSubSidebar.vue?vue&type=template&id=0addd9bc&scoped=true":
  17667. /*!*********************************************************************************************!*\
  17668. !*** ./resources/js/components/AppSubSidebar.vue?vue&type=template&id=0addd9bc&scoped=true ***!
  17669. \*********************************************************************************************/
  17670. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17671. "use strict";
  17672. __webpack_require__.r(__webpack_exports__);
  17673. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17674. /* harmony export */ "render": () => (/* reexport safe */ _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_templateLoader_js_ruleSet_1_rules_2_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_AppSubSidebar_vue_vue_type_template_id_0addd9bc_scoped_true__WEBPACK_IMPORTED_MODULE_0__.render)
  17675. /* harmony export */ });
  17676. /* harmony import */ var _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_templateLoader_js_ruleSet_1_rules_2_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_AppSubSidebar_vue_vue_type_template_id_0addd9bc_scoped_true__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!../../../node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!../../../node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./AppSubSidebar.vue?vue&type=template&id=0addd9bc&scoped=true */ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppSubSidebar.vue?vue&type=template&id=0addd9bc&scoped=true");
  17677. /***/ }),
  17678. /***/ "./resources/js/components/AppTopBar.vue?vue&type=template&id=42bf62a4&scoped=true":
  17679. /*!*****************************************************************************************!*\
  17680. !*** ./resources/js/components/AppTopBar.vue?vue&type=template&id=42bf62a4&scoped=true ***!
  17681. \*****************************************************************************************/
  17682. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17683. "use strict";
  17684. __webpack_require__.r(__webpack_exports__);
  17685. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17686. /* harmony export */ "render": () => (/* reexport safe */ _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_templateLoader_js_ruleSet_1_rules_2_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_AppTopBar_vue_vue_type_template_id_42bf62a4_scoped_true__WEBPACK_IMPORTED_MODULE_0__.render)
  17687. /* harmony export */ });
  17688. /* harmony import */ var _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_templateLoader_js_ruleSet_1_rules_2_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_AppTopBar_vue_vue_type_template_id_42bf62a4_scoped_true__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!../../../node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!../../../node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./AppTopBar.vue?vue&type=template&id=42bf62a4&scoped=true */ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppTopBar.vue?vue&type=template&id=42bf62a4&scoped=true");
  17689. /***/ }),
  17690. /***/ "./resources/js/layouts/DashboardLayout.vue?vue&type=template&id=549bf5ac&scoped=true":
  17691. /*!********************************************************************************************!*\
  17692. !*** ./resources/js/layouts/DashboardLayout.vue?vue&type=template&id=549bf5ac&scoped=true ***!
  17693. \********************************************************************************************/
  17694. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17695. "use strict";
  17696. __webpack_require__.r(__webpack_exports__);
  17697. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17698. /* harmony export */ "render": () => (/* reexport safe */ _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_templateLoader_js_ruleSet_1_rules_2_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_DashboardLayout_vue_vue_type_template_id_549bf5ac_scoped_true__WEBPACK_IMPORTED_MODULE_0__.render)
  17699. /* harmony export */ });
  17700. /* harmony import */ var _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_templateLoader_js_ruleSet_1_rules_2_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_DashboardLayout_vue_vue_type_template_id_549bf5ac_scoped_true__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!../../../node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!../../../node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./DashboardLayout.vue?vue&type=template&id=549bf5ac&scoped=true */ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/layouts/DashboardLayout.vue?vue&type=template&id=549bf5ac&scoped=true");
  17701. /***/ }),
  17702. /***/ "./resources/js/pages/Customers/Index.vue?vue&type=template&id=2f43e3ff":
  17703. /*!******************************************************************************!*\
  17704. !*** ./resources/js/pages/Customers/Index.vue?vue&type=template&id=2f43e3ff ***!
  17705. \******************************************************************************/
  17706. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17707. "use strict";
  17708. __webpack_require__.r(__webpack_exports__);
  17709. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17710. /* 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_2f43e3ff__WEBPACK_IMPORTED_MODULE_0__.render)
  17711. /* harmony export */ });
  17712. /* 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_2f43e3ff__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=2f43e3ff */ "./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/Customers/Index.vue?vue&type=template&id=2f43e3ff");
  17713. /***/ }),
  17714. /***/ "./resources/js/components/AppSidebar.vue?vue&type=style&index=0&id=22a4e926&lang=scss&scoped=true":
  17715. /*!*********************************************************************************************************!*\
  17716. !*** ./resources/js/components/AppSidebar.vue?vue&type=style&index=0&id=22a4e926&lang=scss&scoped=true ***!
  17717. \*********************************************************************************************************/
  17718. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17719. "use strict";
  17720. __webpack_require__.r(__webpack_exports__);
  17721. /* harmony import */ var _node_modules_style_loader_dist_cjs_js_node_modules_css_loader_dist_cjs_js_clonedRuleSet_11_use_1_node_modules_vue_loader_dist_stylePostLoader_js_node_modules_postcss_loader_dist_cjs_js_clonedRuleSet_11_use_2_node_modules_sass_loader_dist_cjs_js_clonedRuleSet_11_use_3_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_AppSidebar_vue_vue_type_style_index_0_id_22a4e926_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../node_modules/style-loader/dist/cjs.js!../../../node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!../../../node_modules/vue-loader/dist/stylePostLoader.js!../../../node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!../../../node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!../../../node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./AppSidebar.vue?vue&type=style&index=0&id=22a4e926&lang=scss&scoped=true */ "./node_modules/style-loader/dist/cjs.js!./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppSidebar.vue?vue&type=style&index=0&id=22a4e926&lang=scss&scoped=true");
  17722. /***/ }),
  17723. /***/ "./resources/js/components/AppSubSidebar.vue?vue&type=style&index=0&id=0addd9bc&lang=scss&scoped=true":
  17724. /*!************************************************************************************************************!*\
  17725. !*** ./resources/js/components/AppSubSidebar.vue?vue&type=style&index=0&id=0addd9bc&lang=scss&scoped=true ***!
  17726. \************************************************************************************************************/
  17727. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17728. "use strict";
  17729. __webpack_require__.r(__webpack_exports__);
  17730. /* harmony import */ var _node_modules_style_loader_dist_cjs_js_node_modules_css_loader_dist_cjs_js_clonedRuleSet_11_use_1_node_modules_vue_loader_dist_stylePostLoader_js_node_modules_postcss_loader_dist_cjs_js_clonedRuleSet_11_use_2_node_modules_sass_loader_dist_cjs_js_clonedRuleSet_11_use_3_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_AppSubSidebar_vue_vue_type_style_index_0_id_0addd9bc_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../node_modules/style-loader/dist/cjs.js!../../../node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!../../../node_modules/vue-loader/dist/stylePostLoader.js!../../../node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!../../../node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!../../../node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./AppSubSidebar.vue?vue&type=style&index=0&id=0addd9bc&lang=scss&scoped=true */ "./node_modules/style-loader/dist/cjs.js!./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppSubSidebar.vue?vue&type=style&index=0&id=0addd9bc&lang=scss&scoped=true");
  17731. /***/ }),
  17732. /***/ "./resources/js/components/AppTopBar.vue?vue&type=style&index=0&id=42bf62a4&lang=scss&scoped=true":
  17733. /*!********************************************************************************************************!*\
  17734. !*** ./resources/js/components/AppTopBar.vue?vue&type=style&index=0&id=42bf62a4&lang=scss&scoped=true ***!
  17735. \********************************************************************************************************/
  17736. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17737. "use strict";
  17738. __webpack_require__.r(__webpack_exports__);
  17739. /* harmony import */ var _node_modules_style_loader_dist_cjs_js_node_modules_css_loader_dist_cjs_js_clonedRuleSet_11_use_1_node_modules_vue_loader_dist_stylePostLoader_js_node_modules_postcss_loader_dist_cjs_js_clonedRuleSet_11_use_2_node_modules_sass_loader_dist_cjs_js_clonedRuleSet_11_use_3_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_AppTopBar_vue_vue_type_style_index_0_id_42bf62a4_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../node_modules/style-loader/dist/cjs.js!../../../node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!../../../node_modules/vue-loader/dist/stylePostLoader.js!../../../node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!../../../node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!../../../node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./AppTopBar.vue?vue&type=style&index=0&id=42bf62a4&lang=scss&scoped=true */ "./node_modules/style-loader/dist/cjs.js!./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppTopBar.vue?vue&type=style&index=0&id=42bf62a4&lang=scss&scoped=true");
  17740. /***/ }),
  17741. /***/ "./resources/js/layouts/DashboardLayout.vue?vue&type=style&index=0&id=549bf5ac&lang=scss&scoped=true":
  17742. /*!***********************************************************************************************************!*\
  17743. !*** ./resources/js/layouts/DashboardLayout.vue?vue&type=style&index=0&id=549bf5ac&lang=scss&scoped=true ***!
  17744. \***********************************************************************************************************/
  17745. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17746. "use strict";
  17747. __webpack_require__.r(__webpack_exports__);
  17748. /* harmony import */ var _node_modules_style_loader_dist_cjs_js_node_modules_css_loader_dist_cjs_js_clonedRuleSet_11_use_1_node_modules_vue_loader_dist_stylePostLoader_js_node_modules_postcss_loader_dist_cjs_js_clonedRuleSet_11_use_2_node_modules_sass_loader_dist_cjs_js_clonedRuleSet_11_use_3_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_DashboardLayout_vue_vue_type_style_index_0_id_549bf5ac_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../node_modules/style-loader/dist/cjs.js!../../../node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!../../../node_modules/vue-loader/dist/stylePostLoader.js!../../../node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!../../../node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!../../../node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./DashboardLayout.vue?vue&type=style&index=0&id=549bf5ac&lang=scss&scoped=true */ "./node_modules/style-loader/dist/cjs.js!./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/layouts/DashboardLayout.vue?vue&type=style&index=0&id=549bf5ac&lang=scss&scoped=true");
  17749. /***/ })
  17750. }]);