resources_js_pages_Users_Index_vue.js 696KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663466446654666466746684669467046714672467346744675467646774678467946804681468246834684468546864687468846894690469146924693469446954696469746984699470047014702470347044705470647074708470947104711471247134714471547164717471847194720472147224723472447254726472747284729473047314732473347344735473647374738473947404741474247434744474547464747474847494750475147524753475447554756475747584759476047614762476347644765476647674768476947704771477247734774477547764777477847794780478147824783478447854786478747884789479047914792479347944795479647974798479948004801480248034804480548064807480848094810481148124813481448154816481748184819482048214822482348244825482648274828482948304831483248334834483548364837483848394840484148424843484448454846484748484849485048514852485348544855485648574858485948604861486248634864486548664867486848694870487148724873487448754876487748784879488048814882488348844885488648874888488948904891489248934894489548964897489848994900490149024903490449054906490749084909491049114912491349144915491649174918491949204921492249234924492549264927492849294930493149324933493449354936493749384939494049414942494349444945494649474948494949504951495249534954495549564957495849594960496149624963496449654966496749684969497049714972497349744975497649774978497949804981498249834984498549864987498849894990499149924993499449954996499749984999500050015002500350045005500650075008500950105011501250135014501550165017501850195020502150225023502450255026502750285029503050315032503350345035503650375038503950405041504250435044504550465047504850495050505150525053505450555056505750585059506050615062506350645065506650675068506950705071507250735074507550765077507850795080508150825083508450855086508750885089509050915092509350945095509650975098509951005101510251035104510551065107510851095110511151125113511451155116511751185119512051215122512351245125512651275128512951305131513251335134513551365137513851395140514151425143514451455146514751485149515051515152515351545155515651575158515951605161516251635164516551665167516851695170517151725173517451755176517751785179518051815182518351845185518651875188518951905191519251935194519551965197519851995200520152025203520452055206520752085209521052115212521352145215521652175218521952205221522252235224522552265227522852295230523152325233523452355236523752385239524052415242524352445245524652475248524952505251525252535254525552565257525852595260526152625263526452655266526752685269527052715272527352745275527652775278527952805281528252835284528552865287528852895290529152925293529452955296529752985299530053015302530353045305530653075308530953105311531253135314531553165317531853195320532153225323532453255326532753285329533053315332533353345335533653375338533953405341534253435344534553465347534853495350535153525353535453555356535753585359536053615362536353645365536653675368536953705371537253735374537553765377537853795380538153825383538453855386538753885389539053915392539353945395539653975398539954005401540254035404540554065407540854095410541154125413541454155416541754185419542054215422542354245425542654275428542954305431543254335434543554365437543854395440544154425443544454455446544754485449545054515452545354545455545654575458545954605461546254635464546554665467546854695470547154725473547454755476547754785479548054815482548354845485548654875488548954905491549254935494549554965497549854995500550155025503550455055506550755085509551055115512551355145515551655175518551955205521552255235524552555265527552855295530553155325533553455355536553755385539554055415542554355445545554655475548554955505551555255535554555555565557555855595560556155625563556455655566556755685569557055715572557355745575557655775578557955805581558255835584558555865587558855895590559155925593559455955596559755985599560056015602560356045605560656075608560956105611561256135614561556165617561856195620562156225623562456255626562756285629563056315632563356345635563656375638563956405641564256435644564556465647564856495650565156525653565456555656565756585659566056615662566356645665566656675668566956705671567256735674567556765677567856795680568156825683568456855686568756885689569056915692569356945695569656975698569957005701570257035704570557065707570857095710571157125713571457155716571757185719572057215722572357245725572657275728572957305731573257335734573557365737573857395740574157425743574457455746574757485749575057515752575357545755575657575758575957605761576257635764576557665767576857695770577157725773577457755776577757785779578057815782578357845785578657875788578957905791579257935794579557965797579857995800580158025803580458055806580758085809581058115812581358145815581658175818581958205821582258235824582558265827582858295830583158325833583458355836583758385839584058415842584358445845584658475848584958505851585258535854585558565857585858595860586158625863586458655866586758685869587058715872587358745875587658775878587958805881588258835884588558865887588858895890589158925893589458955896589758985899590059015902590359045905590659075908590959105911591259135914591559165917591859195920592159225923592459255926592759285929593059315932593359345935593659375938593959405941594259435944594559465947594859495950595159525953595459555956595759585959596059615962596359645965596659675968596959705971597259735974597559765977597859795980598159825983598459855986598759885989599059915992599359945995599659975998599960006001600260036004600560066007600860096010601160126013601460156016601760186019602060216022602360246025602660276028602960306031603260336034603560366037603860396040604160426043604460456046604760486049605060516052605360546055605660576058605960606061606260636064606560666067606860696070607160726073607460756076607760786079608060816082608360846085608660876088608960906091609260936094609560966097609860996100610161026103610461056106610761086109611061116112611361146115611661176118611961206121612261236124612561266127612861296130613161326133613461356136613761386139614061416142614361446145614661476148614961506151615261536154615561566157615861596160616161626163616461656166616761686169617061716172617361746175617661776178617961806181618261836184618561866187618861896190619161926193619461956196619761986199620062016202620362046205620662076208620962106211621262136214621562166217621862196220622162226223622462256226622762286229623062316232623362346235623662376238623962406241624262436244624562466247624862496250625162526253625462556256625762586259626062616262626362646265626662676268626962706271627262736274627562766277627862796280628162826283628462856286628762886289629062916292629362946295629662976298629963006301630263036304630563066307630863096310631163126313631463156316631763186319632063216322632363246325632663276328632963306331633263336334633563366337633863396340634163426343634463456346634763486349635063516352635363546355635663576358635963606361636263636364636563666367636863696370637163726373637463756376637763786379638063816382638363846385638663876388638963906391639263936394639563966397639863996400640164026403640464056406640764086409641064116412641364146415641664176418641964206421642264236424642564266427642864296430643164326433643464356436643764386439644064416442644364446445644664476448644964506451645264536454645564566457645864596460646164626463646464656466646764686469647064716472647364746475647664776478647964806481648264836484648564866487648864896490649164926493649464956496649764986499650065016502650365046505650665076508650965106511651265136514651565166517651865196520652165226523652465256526652765286529653065316532653365346535653665376538653965406541654265436544654565466547654865496550655165526553655465556556655765586559656065616562656365646565656665676568656965706571657265736574657565766577657865796580658165826583658465856586658765886589659065916592659365946595659665976598659966006601660266036604660566066607660866096610661166126613661466156616661766186619662066216622662366246625662666276628662966306631663266336634663566366637663866396640664166426643664466456646664766486649665066516652665366546655665666576658665966606661666266636664666566666667666866696670667166726673667466756676667766786679668066816682668366846685668666876688668966906691669266936694669566966697669866996700670167026703670467056706670767086709671067116712671367146715671667176718671967206721672267236724672567266727672867296730673167326733673467356736673767386739674067416742674367446745674667476748674967506751675267536754675567566757675867596760676167626763676467656766676767686769677067716772677367746775677667776778677967806781678267836784678567866787678867896790679167926793679467956796679767986799680068016802680368046805680668076808680968106811681268136814681568166817681868196820682168226823682468256826682768286829683068316832683368346835683668376838683968406841684268436844684568466847684868496850685168526853685468556856685768586859686068616862686368646865686668676868686968706871687268736874687568766877687868796880688168826883688468856886688768886889689068916892689368946895689668976898689969006901690269036904690569066907690869096910691169126913691469156916691769186919692069216922692369246925692669276928692969306931693269336934693569366937693869396940694169426943694469456946694769486949695069516952695369546955695669576958695969606961696269636964696569666967696869696970697169726973697469756976697769786979698069816982698369846985698669876988698969906991699269936994699569966997699869997000700170027003700470057006700770087009701070117012701370147015701670177018701970207021702270237024702570267027702870297030703170327033703470357036703770387039704070417042704370447045704670477048704970507051705270537054705570567057705870597060706170627063706470657066706770687069707070717072707370747075707670777078707970807081708270837084708570867087708870897090709170927093709470957096709770987099710071017102710371047105710671077108710971107111711271137114711571167117711871197120712171227123712471257126712771287129713071317132713371347135713671377138713971407141714271437144714571467147714871497150715171527153715471557156715771587159716071617162716371647165716671677168716971707171717271737174717571767177717871797180718171827183718471857186718771887189719071917192719371947195719671977198719972007201720272037204720572067207720872097210721172127213721472157216721772187219722072217222722372247225722672277228722972307231723272337234723572367237723872397240724172427243724472457246724772487249725072517252725372547255725672577258725972607261726272637264726572667267726872697270727172727273727472757276727772787279728072817282728372847285728672877288728972907291729272937294729572967297729872997300730173027303730473057306730773087309731073117312731373147315731673177318731973207321732273237324732573267327732873297330733173327333733473357336733773387339734073417342734373447345734673477348734973507351735273537354735573567357735873597360736173627363736473657366736773687369737073717372737373747375737673777378737973807381738273837384738573867387738873897390739173927393739473957396739773987399740074017402740374047405740674077408740974107411741274137414741574167417741874197420742174227423742474257426742774287429743074317432743374347435743674377438743974407441744274437444744574467447744874497450745174527453745474557456745774587459746074617462746374647465746674677468746974707471747274737474747574767477747874797480748174827483748474857486748774887489749074917492749374947495749674977498749975007501750275037504750575067507750875097510751175127513751475157516751775187519752075217522752375247525752675277528752975307531753275337534753575367537753875397540754175427543754475457546754775487549755075517552755375547555755675577558755975607561756275637564756575667567756875697570757175727573757475757576757775787579758075817582758375847585758675877588758975907591759275937594759575967597759875997600760176027603760476057606760776087609761076117612761376147615761676177618761976207621762276237624762576267627762876297630763176327633763476357636763776387639764076417642764376447645764676477648764976507651765276537654765576567657765876597660766176627663766476657666766776687669767076717672767376747675767676777678767976807681768276837684768576867687768876897690769176927693769476957696769776987699770077017702770377047705770677077708770977107711771277137714771577167717771877197720772177227723772477257726772777287729773077317732773377347735773677377738773977407741774277437744774577467747774877497750775177527753775477557756775777587759776077617762776377647765776677677768776977707771777277737774777577767777777877797780778177827783778477857786778777887789779077917792779377947795779677977798779978007801780278037804780578067807780878097810781178127813781478157816781778187819782078217822782378247825782678277828782978307831783278337834783578367837783878397840784178427843784478457846784778487849785078517852785378547855785678577858785978607861786278637864786578667867786878697870787178727873787478757876787778787879788078817882788378847885788678877888788978907891789278937894789578967897789878997900790179027903790479057906790779087909791079117912791379147915791679177918791979207921792279237924792579267927792879297930793179327933793479357936793779387939794079417942794379447945794679477948794979507951795279537954795579567957795879597960796179627963796479657966796779687969797079717972797379747975797679777978797979807981798279837984798579867987798879897990799179927993799479957996799779987999800080018002800380048005800680078008800980108011801280138014801580168017801880198020802180228023802480258026802780288029803080318032803380348035803680378038803980408041804280438044804580468047804880498050805180528053805480558056805780588059806080618062806380648065806680678068806980708071807280738074807580768077807880798080808180828083808480858086808780888089809080918092809380948095809680978098809981008101810281038104810581068107810881098110811181128113811481158116811781188119812081218122812381248125812681278128812981308131813281338134813581368137813881398140814181428143814481458146814781488149815081518152815381548155815681578158815981608161816281638164816581668167816881698170817181728173817481758176817781788179818081818182818381848185818681878188818981908191819281938194819581968197819881998200820182028203820482058206820782088209821082118212821382148215821682178218821982208221822282238224822582268227822882298230823182328233823482358236823782388239824082418242824382448245824682478248824982508251825282538254825582568257825882598260826182628263826482658266826782688269827082718272827382748275827682778278827982808281828282838284828582868287828882898290829182928293829482958296829782988299830083018302830383048305830683078308830983108311831283138314831583168317831883198320832183228323832483258326832783288329833083318332833383348335833683378338833983408341834283438344834583468347834883498350835183528353835483558356835783588359836083618362836383648365836683678368836983708371837283738374837583768377837883798380838183828383838483858386838783888389839083918392839383948395839683978398839984008401840284038404840584068407840884098410841184128413841484158416841784188419842084218422842384248425842684278428842984308431843284338434843584368437843884398440844184428443844484458446844784488449845084518452845384548455845684578458845984608461846284638464846584668467846884698470847184728473847484758476847784788479848084818482848384848485848684878488848984908491849284938494849584968497849884998500850185028503850485058506850785088509851085118512851385148515851685178518851985208521852285238524852585268527852885298530853185328533853485358536853785388539854085418542854385448545854685478548854985508551855285538554855585568557855885598560856185628563856485658566856785688569857085718572857385748575857685778578857985808581858285838584858585868587858885898590859185928593859485958596859785988599860086018602860386048605860686078608860986108611861286138614861586168617861886198620862186228623862486258626862786288629863086318632863386348635863686378638863986408641864286438644864586468647864886498650865186528653865486558656865786588659866086618662866386648665866686678668866986708671867286738674867586768677867886798680868186828683868486858686868786888689869086918692869386948695869686978698869987008701870287038704870587068707870887098710871187128713871487158716871787188719872087218722872387248725872687278728872987308731873287338734873587368737873887398740874187428743874487458746874787488749875087518752875387548755875687578758875987608761876287638764876587668767876887698770877187728773877487758776877787788779878087818782878387848785878687878788878987908791879287938794879587968797879887998800880188028803880488058806880788088809881088118812881388148815881688178818881988208821882288238824882588268827882888298830883188328833883488358836883788388839884088418842884388448845884688478848884988508851885288538854885588568857885888598860886188628863886488658866886788688869887088718872887388748875887688778878887988808881888288838884888588868887888888898890889188928893889488958896889788988899890089018902890389048905890689078908890989108911891289138914891589168917891889198920892189228923892489258926892789288929893089318932893389348935893689378938893989408941894289438944894589468947894889498950895189528953895489558956895789588959896089618962896389648965896689678968896989708971897289738974897589768977897889798980898189828983898489858986898789888989899089918992899389948995899689978998899990009001900290039004900590069007900890099010901190129013901490159016901790189019902090219022902390249025902690279028902990309031903290339034903590369037903890399040904190429043904490459046904790489049905090519052905390549055905690579058905990609061906290639064906590669067906890699070907190729073907490759076907790789079908090819082908390849085908690879088908990909091909290939094909590969097909890999100910191029103910491059106910791089109911091119112911391149115911691179118911991209121912291239124912591269127912891299130913191329133913491359136913791389139914091419142914391449145914691479148914991509151915291539154915591569157915891599160916191629163916491659166916791689169917091719172917391749175917691779178917991809181918291839184918591869187918891899190919191929193919491959196919791989199920092019202920392049205920692079208920992109211921292139214921592169217921892199220922192229223922492259226922792289229923092319232923392349235923692379238923992409241924292439244924592469247924892499250925192529253925492559256925792589259926092619262926392649265926692679268926992709271927292739274927592769277927892799280928192829283928492859286928792889289929092919292929392949295929692979298929993009301930293039304930593069307930893099310931193129313931493159316931793189319932093219322932393249325932693279328932993309331933293339334933593369337933893399340934193429343934493459346934793489349935093519352935393549355935693579358935993609361936293639364936593669367936893699370937193729373937493759376937793789379938093819382938393849385938693879388938993909391939293939394939593969397939893999400940194029403940494059406940794089409941094119412941394149415941694179418941994209421942294239424942594269427942894299430943194329433943494359436943794389439944094419442944394449445944694479448944994509451945294539454945594569457945894599460946194629463946494659466946794689469947094719472947394749475947694779478947994809481948294839484948594869487948894899490949194929493949494959496949794989499950095019502950395049505950695079508950995109511951295139514951595169517951895199520952195229523952495259526952795289529953095319532953395349535953695379538953995409541954295439544954595469547954895499550955195529553955495559556955795589559956095619562956395649565956695679568956995709571957295739574957595769577957895799580958195829583958495859586958795889589959095919592959395949595959695979598959996009601960296039604960596069607960896099610961196129613961496159616961796189619962096219622962396249625962696279628962996309631963296339634963596369637963896399640964196429643964496459646964796489649965096519652965396549655965696579658965996609661966296639664966596669667966896699670967196729673967496759676967796789679968096819682968396849685968696879688968996909691969296939694969596969697969896999700970197029703970497059706970797089709971097119712971397149715971697179718971997209721972297239724972597269727972897299730973197329733973497359736973797389739974097419742974397449745974697479748974997509751975297539754975597569757975897599760976197629763976497659766976797689769977097719772977397749775977697779778977997809781978297839784978597869787978897899790979197929793979497959796979797989799980098019802980398049805980698079808980998109811981298139814981598169817981898199820982198229823982498259826982798289829983098319832983398349835983698379838983998409841984298439844984598469847984898499850985198529853985498559856985798589859986098619862986398649865986698679868986998709871987298739874987598769877987898799880988198829883988498859886988798889889989098919892989398949895989698979898989999009901990299039904990599069907990899099910991199129913991499159916991799189919992099219922992399249925992699279928992999309931993299339934993599369937993899399940994199429943994499459946994799489949995099519952995399549955995699579958995999609961996299639964996599669967996899699970997199729973997499759976997799789979998099819982998399849985998699879988998999909991999299939994999599969997999899991000010001100021000310004100051000610007100081000910010100111001210013100141001510016100171001810019100201002110022100231002410025100261002710028100291003010031100321003310034100351003610037100381003910040100411004210043100441004510046100471004810049100501005110052100531005410055100561005710058100591006010061100621006310064100651006610067100681006910070100711007210073100741007510076100771007810079100801008110082100831008410085100861008710088100891009010091100921009310094100951009610097100981009910100101011010210103101041010510106101071010810109101101011110112101131011410115101161011710118101191012010121101221012310124101251012610127101281012910130101311013210133101341013510136101371013810139101401014110142101431014410145101461014710148101491015010151101521015310154101551015610157101581015910160101611016210163101641016510166101671016810169101701017110172101731017410175101761017710178101791018010181101821018310184101851018610187101881018910190101911019210193101941019510196101971019810199102001020110202102031020410205102061020710208102091021010211102121021310214102151021610217102181021910220102211022210223102241022510226102271022810229102301023110232102331023410235102361023710238102391024010241102421024310244102451024610247102481024910250102511025210253102541025510256102571025810259102601026110262102631026410265102661026710268102691027010271102721027310274102751027610277102781027910280102811028210283102841028510286102871028810289102901029110292102931029410295102961029710298102991030010301103021030310304103051030610307103081030910310103111031210313103141031510316103171031810319103201032110322103231032410325103261032710328103291033010331103321033310334103351033610337103381033910340103411034210343103441034510346103471034810349103501035110352103531035410355103561035710358103591036010361103621036310364103651036610367103681036910370103711037210373103741037510376103771037810379103801038110382103831038410385103861038710388103891039010391103921039310394103951039610397103981039910400104011040210403104041040510406104071040810409104101041110412104131041410415104161041710418104191042010421104221042310424104251042610427104281042910430104311043210433104341043510436104371043810439104401044110442104431044410445104461044710448104491045010451104521045310454104551045610457104581045910460104611046210463104641046510466104671046810469104701047110472104731047410475104761047710478104791048010481104821048310484104851048610487104881048910490104911049210493104941049510496104971049810499105001050110502105031050410505105061050710508105091051010511105121051310514105151051610517105181051910520105211052210523105241052510526105271052810529105301053110532105331053410535105361053710538105391054010541105421054310544105451054610547105481054910550105511055210553105541055510556105571055810559105601056110562105631056410565105661056710568105691057010571105721057310574105751057610577105781057910580105811058210583105841058510586105871058810589105901059110592105931059410595105961059710598105991060010601106021060310604106051060610607106081060910610106111061210613106141061510616106171061810619106201062110622106231062410625106261062710628106291063010631106321063310634106351063610637106381063910640106411064210643106441064510646106471064810649106501065110652106531065410655106561065710658106591066010661106621066310664106651066610667106681066910670106711067210673106741067510676106771067810679106801068110682106831068410685106861068710688106891069010691106921069310694106951069610697106981069910700107011070210703107041070510706107071070810709107101071110712107131071410715107161071710718107191072010721107221072310724107251072610727107281072910730107311073210733107341073510736107371073810739107401074110742107431074410745107461074710748107491075010751107521075310754107551075610757107581075910760107611076210763107641076510766107671076810769107701077110772107731077410775107761077710778107791078010781107821078310784107851078610787107881078910790107911079210793107941079510796107971079810799108001080110802108031080410805108061080710808108091081010811108121081310814108151081610817108181081910820108211082210823108241082510826108271082810829108301083110832108331083410835108361083710838108391084010841108421084310844108451084610847108481084910850108511085210853108541085510856108571085810859108601086110862108631086410865108661086710868108691087010871108721087310874108751087610877108781087910880108811088210883108841088510886108871088810889108901089110892108931089410895108961089710898108991090010901109021090310904109051090610907109081090910910109111091210913109141091510916109171091810919109201092110922109231092410925109261092710928109291093010931109321093310934109351093610937109381093910940109411094210943109441094510946109471094810949109501095110952109531095410955109561095710958109591096010961109621096310964109651096610967109681096910970109711097210973109741097510976109771097810979109801098110982109831098410985109861098710988109891099010991109921099310994109951099610997109981099911000110011100211003110041100511006110071100811009110101101111012110131101411015110161101711018110191102011021110221102311024110251102611027110281102911030110311103211033110341103511036110371103811039110401104111042110431104411045110461104711048110491105011051110521105311054110551105611057110581105911060110611106211063110641106511066110671106811069110701107111072110731107411075110761107711078110791108011081110821108311084110851108611087110881108911090110911109211093110941109511096110971109811099111001110111102111031110411105111061110711108111091111011111111121111311114111151111611117111181111911120111211112211123111241112511126111271112811129111301113111132111331113411135111361113711138111391114011141111421114311144111451114611147111481114911150111511115211153111541115511156111571115811159111601116111162111631116411165111661116711168111691117011171111721117311174111751117611177111781117911180111811118211183111841118511186111871118811189111901119111192111931119411195111961119711198111991120011201112021120311204112051120611207112081120911210112111121211213112141121511216112171121811219112201122111222112231122411225112261122711228112291123011231112321123311234112351123611237112381123911240112411124211243112441124511246112471124811249112501125111252112531125411255112561125711258112591126011261112621126311264112651126611267112681126911270112711127211273112741127511276112771127811279112801128111282112831128411285112861128711288112891129011291112921129311294112951129611297112981129911300113011130211303113041130511306113071130811309113101131111312113131131411315113161131711318113191132011321113221132311324113251132611327113281132911330113311133211333113341133511336113371133811339113401134111342113431134411345113461134711348113491135011351113521135311354113551135611357113581135911360113611136211363113641136511366113671136811369113701137111372113731137411375113761137711378113791138011381113821138311384113851138611387113881138911390113911139211393113941139511396113971139811399114001140111402114031140411405114061140711408114091141011411114121141311414114151141611417114181141911420114211142211423114241142511426114271142811429114301143111432114331143411435114361143711438114391144011441114421144311444114451144611447114481144911450114511145211453114541145511456114571145811459114601146111462114631146411465114661146711468114691147011471114721147311474114751147611477114781147911480114811148211483114841148511486114871148811489114901149111492114931149411495114961149711498114991150011501115021150311504115051150611507115081150911510115111151211513115141151511516115171151811519115201152111522115231152411525115261152711528115291153011531115321153311534115351153611537115381153911540115411154211543115441154511546115471154811549115501155111552115531155411555115561155711558115591156011561115621156311564115651156611567115681156911570115711157211573115741157511576115771157811579115801158111582115831158411585115861158711588115891159011591115921159311594115951159611597115981159911600116011160211603116041160511606116071160811609116101161111612116131161411615116161161711618116191162011621116221162311624116251162611627116281162911630116311163211633116341163511636116371163811639116401164111642116431164411645116461164711648116491165011651116521165311654116551165611657116581165911660116611166211663116641166511666116671166811669116701167111672116731167411675116761167711678116791168011681116821168311684116851168611687116881168911690116911169211693116941169511696116971169811699117001170111702117031170411705117061170711708117091171011711117121171311714117151171611717117181171911720117211172211723117241172511726117271172811729117301173111732117331173411735117361173711738117391174011741117421174311744117451174611747117481174911750117511175211753117541175511756117571175811759117601176111762117631176411765117661176711768117691177011771117721177311774117751177611777117781177911780117811178211783117841178511786117871178811789117901179111792117931179411795117961179711798117991180011801118021180311804118051180611807118081180911810118111181211813118141181511816118171181811819118201182111822118231182411825118261182711828118291183011831118321183311834118351183611837118381183911840118411184211843118441184511846118471184811849118501185111852118531185411855118561185711858118591186011861118621186311864118651186611867118681186911870118711187211873118741187511876118771187811879118801188111882118831188411885118861188711888118891189011891118921189311894118951189611897118981189911900119011190211903119041190511906119071190811909119101191111912119131191411915119161191711918119191192011921119221192311924119251192611927119281192911930119311193211933119341193511936119371193811939119401194111942119431194411945119461194711948119491195011951119521195311954119551195611957119581195911960119611196211963119641196511966119671196811969119701197111972119731197411975119761197711978119791198011981119821198311984119851198611987119881198911990119911199211993119941199511996119971199811999120001200112002120031200412005120061200712008120091201012011120121201312014120151201612017120181201912020120211202212023120241202512026120271202812029120301203112032120331203412035120361203712038120391204012041120421204312044120451204612047120481204912050120511205212053120541205512056120571205812059120601206112062120631206412065120661206712068120691207012071120721207312074120751207612077120781207912080120811208212083120841208512086120871208812089120901209112092120931209412095120961209712098120991210012101121021210312104121051210612107121081210912110121111211212113121141211512116121171211812119121201212112122121231212412125121261212712128121291213012131121321213312134121351213612137121381213912140121411214212143121441214512146121471214812149121501215112152121531215412155121561215712158121591216012161121621216312164121651216612167121681216912170121711217212173121741217512176121771217812179121801218112182121831218412185121861218712188121891219012191121921219312194121951219612197121981219912200122011220212203122041220512206122071220812209122101221112212122131221412215122161221712218122191222012221122221222312224122251222612227122281222912230122311223212233122341223512236122371223812239122401224112242122431224412245122461224712248122491225012251122521225312254122551225612257122581225912260122611226212263122641226512266122671226812269122701227112272122731227412275122761227712278122791228012281122821228312284122851228612287122881228912290122911229212293122941229512296122971229812299123001230112302123031230412305123061230712308123091231012311123121231312314123151231612317123181231912320123211232212323123241232512326123271232812329123301233112332123331233412335123361233712338123391234012341123421234312344123451234612347123481234912350123511235212353123541235512356123571235812359123601236112362123631236412365123661236712368123691237012371123721237312374123751237612377123781237912380123811238212383123841238512386123871238812389123901239112392123931239412395123961239712398123991240012401124021240312404124051240612407124081240912410124111241212413124141241512416124171241812419124201242112422124231242412425124261242712428124291243012431124321243312434124351243612437124381243912440124411244212443124441244512446124471244812449124501245112452124531245412455124561245712458124591246012461124621246312464124651246612467124681246912470124711247212473124741247512476124771247812479124801248112482124831248412485124861248712488124891249012491124921249312494124951249612497124981249912500125011250212503125041250512506125071250812509125101251112512125131251412515125161251712518125191252012521125221252312524125251252612527125281252912530125311253212533125341253512536125371253812539125401254112542125431254412545125461254712548125491255012551125521255312554125551255612557125581255912560125611256212563125641256512566125671256812569125701257112572125731257412575125761257712578125791258012581125821258312584125851258612587125881258912590125911259212593125941259512596125971259812599126001260112602126031260412605126061260712608126091261012611126121261312614126151261612617126181261912620126211262212623126241262512626126271262812629126301263112632126331263412635126361263712638126391264012641126421264312644126451264612647126481264912650126511265212653126541265512656126571265812659126601266112662126631266412665126661266712668126691267012671126721267312674126751267612677126781267912680126811268212683126841268512686126871268812689126901269112692126931269412695126961269712698126991270012701127021270312704127051270612707127081270912710127111271212713127141271512716127171271812719127201272112722127231272412725127261272712728127291273012731127321273312734127351273612737127381273912740127411274212743127441274512746127471274812749127501275112752127531275412755127561275712758127591276012761127621276312764127651276612767127681276912770127711277212773127741277512776127771277812779127801278112782127831278412785127861278712788127891279012791127921279312794127951279612797127981279912800128011280212803128041280512806128071280812809128101281112812128131281412815128161281712818128191282012821128221282312824128251282612827128281282912830128311283212833128341283512836128371283812839128401284112842128431284412845128461284712848128491285012851128521285312854128551285612857128581285912860128611286212863128641286512866128671286812869128701287112872128731287412875128761287712878128791288012881128821288312884128851288612887128881288912890128911289212893128941289512896128971289812899129001290112902129031290412905129061290712908129091291012911129121291312914129151291612917129181291912920129211292212923129241292512926129271292812929129301293112932129331293412935129361293712938129391294012941129421294312944129451294612947129481294912950129511295212953129541295512956129571295812959129601296112962129631296412965129661296712968129691297012971129721297312974129751297612977129781297912980129811298212983129841298512986129871298812989129901299112992129931299412995129961299712998129991300013001130021300313004130051300613007130081300913010130111301213013130141301513016130171301813019130201302113022130231302413025130261302713028130291303013031130321303313034130351303613037130381303913040130411304213043130441304513046130471304813049130501305113052130531305413055130561305713058130591306013061130621306313064130651306613067130681306913070130711307213073130741307513076130771307813079130801308113082130831308413085130861308713088130891309013091130921309313094130951309613097130981309913100131011310213103131041310513106131071310813109131101311113112131131311413115131161311713118131191312013121131221312313124131251312613127131281312913130131311313213133131341313513136131371313813139131401314113142131431314413145131461314713148131491315013151131521315313154131551315613157131581315913160131611316213163131641316513166131671316813169131701317113172131731317413175131761317713178131791318013181131821318313184131851318613187131881318913190131911319213193131941319513196131971319813199132001320113202132031320413205132061320713208132091321013211132121321313214132151321613217132181321913220132211322213223132241322513226132271322813229132301323113232132331323413235132361323713238132391324013241132421324313244132451324613247132481324913250132511325213253132541325513256132571325813259132601326113262132631326413265132661326713268132691327013271132721327313274132751327613277132781327913280132811328213283132841328513286132871328813289132901329113292132931329413295132961329713298132991330013301133021330313304133051330613307133081330913310133111331213313133141331513316133171331813319133201332113322133231332413325133261332713328133291333013331133321333313334133351333613337133381333913340133411334213343133441334513346133471334813349133501335113352133531335413355133561335713358133591336013361133621336313364133651336613367133681336913370133711337213373133741337513376133771337813379133801338113382133831338413385133861338713388133891339013391133921339313394133951339613397133981339913400134011340213403134041340513406134071340813409134101341113412134131341413415134161341713418134191342013421134221342313424134251342613427134281342913430134311343213433134341343513436134371343813439134401344113442134431344413445134461344713448134491345013451134521345313454134551345613457134581345913460134611346213463134641346513466134671346813469134701347113472134731347413475134761347713478134791348013481134821348313484134851348613487134881348913490134911349213493134941349513496134971349813499135001350113502135031350413505135061350713508135091351013511135121351313514135151351613517135181351913520135211352213523135241352513526135271352813529135301353113532135331353413535135361353713538135391354013541135421354313544135451354613547135481354913550135511355213553135541355513556135571355813559135601356113562135631356413565135661356713568135691357013571135721357313574135751357613577135781357913580135811358213583135841358513586135871358813589135901359113592135931359413595135961359713598135991360013601136021360313604136051360613607136081360913610136111361213613136141361513616136171361813619136201362113622136231362413625136261362713628136291363013631136321363313634136351363613637136381363913640136411364213643136441364513646136471364813649136501365113652136531365413655136561365713658136591366013661136621366313664136651366613667136681366913670136711367213673136741367513676136771367813679136801368113682136831368413685136861368713688136891369013691136921369313694136951369613697136981369913700137011370213703137041370513706137071370813709137101371113712137131371413715137161371713718137191372013721137221372313724137251372613727137281372913730137311373213733137341373513736137371373813739137401374113742137431374413745137461374713748137491375013751137521375313754137551375613757137581375913760137611376213763137641376513766137671376813769137701377113772137731377413775137761377713778137791378013781137821378313784137851378613787137881378913790137911379213793137941379513796137971379813799138001380113802138031380413805138061380713808138091381013811138121381313814138151381613817138181381913820138211382213823138241382513826138271382813829138301383113832138331383413835138361383713838138391384013841138421384313844138451384613847138481384913850138511385213853138541385513856138571385813859138601386113862138631386413865138661386713868138691387013871138721387313874138751387613877138781387913880138811388213883138841388513886138871388813889138901389113892138931389413895138961389713898138991390013901139021390313904139051390613907139081390913910139111391213913139141391513916139171391813919139201392113922139231392413925139261392713928139291393013931139321393313934139351393613937139381393913940139411394213943139441394513946139471394813949139501395113952139531395413955139561395713958139591396013961139621396313964139651396613967139681396913970139711397213973139741397513976139771397813979139801398113982139831398413985139861398713988139891399013991139921399313994139951399613997139981399914000140011400214003140041400514006140071400814009140101401114012140131401414015140161401714018140191402014021140221402314024140251402614027140281402914030140311403214033140341403514036140371403814039140401404114042140431404414045140461404714048140491405014051140521405314054140551405614057140581405914060140611406214063140641406514066140671406814069140701407114072140731407414075140761407714078140791408014081140821408314084140851408614087140881408914090140911409214093140941409514096140971409814099141001410114102141031410414105141061410714108141091411014111141121411314114141151411614117141181411914120141211412214123141241412514126141271412814129141301413114132141331413414135141361413714138141391414014141141421414314144141451414614147141481414914150141511415214153141541415514156141571415814159141601416114162141631416414165141661416714168141691417014171141721417314174141751417614177141781417914180141811418214183141841418514186141871418814189141901419114192141931419414195141961419714198141991420014201142021420314204142051420614207142081420914210142111421214213142141421514216142171421814219142201422114222142231422414225142261422714228142291423014231142321423314234142351423614237142381423914240142411424214243142441424514246142471424814249142501425114252142531425414255142561425714258142591426014261142621426314264142651426614267142681426914270142711427214273142741427514276142771427814279142801428114282142831428414285142861428714288142891429014291142921429314294142951429614297142981429914300143011430214303143041430514306143071430814309143101431114312143131431414315143161431714318143191432014321143221432314324143251432614327143281432914330143311433214333143341433514336143371433814339143401434114342143431434414345143461434714348143491435014351143521435314354143551435614357143581435914360143611436214363143641436514366143671436814369143701437114372143731437414375143761437714378143791438014381143821438314384143851438614387143881438914390143911439214393143941439514396143971439814399144001440114402144031440414405144061440714408144091441014411144121441314414144151441614417144181441914420144211442214423144241442514426144271442814429144301443114432144331443414435144361443714438144391444014441144421444314444144451444614447144481444914450144511445214453144541445514456144571445814459144601446114462144631446414465144661446714468144691447014471144721447314474144751447614477144781447914480144811448214483144841448514486144871448814489144901449114492144931449414495144961449714498144991450014501145021450314504145051450614507145081450914510145111451214513145141451514516145171451814519145201452114522145231452414525145261452714528145291453014531145321453314534145351453614537145381453914540145411454214543145441454514546145471454814549145501455114552145531455414555145561455714558145591456014561145621456314564145651456614567145681456914570145711457214573145741457514576145771457814579145801458114582145831458414585145861458714588145891459014591145921459314594145951459614597145981459914600146011460214603146041460514606146071460814609146101461114612146131461414615146161461714618146191462014621146221462314624146251462614627146281462914630146311463214633146341463514636146371463814639146401464114642146431464414645146461464714648146491465014651146521465314654146551465614657146581465914660146611466214663146641466514666146671466814669146701467114672146731467414675146761467714678146791468014681146821468314684146851468614687146881468914690146911469214693146941469514696146971469814699147001470114702147031470414705147061470714708147091471014711147121471314714147151471614717147181471914720147211472214723147241472514726147271472814729147301473114732147331473414735147361473714738147391474014741147421474314744147451474614747147481474914750147511475214753147541475514756147571475814759147601476114762147631476414765147661476714768147691477014771147721477314774147751477614777147781477914780147811478214783147841478514786147871478814789147901479114792147931479414795147961479714798147991480014801148021480314804148051480614807148081480914810148111481214813148141481514816148171481814819148201482114822148231482414825148261482714828148291483014831148321483314834148351483614837148381483914840148411484214843148441484514846148471484814849148501485114852148531485414855148561485714858148591486014861148621486314864148651486614867148681486914870148711487214873148741487514876148771487814879148801488114882148831488414885148861488714888148891489014891148921489314894148951489614897148981489914900149011490214903149041490514906149071490814909149101491114912149131491414915149161491714918149191492014921149221492314924149251492614927149281492914930149311493214933149341493514936149371493814939149401494114942149431494414945149461494714948149491495014951149521495314954149551495614957149581495914960149611496214963149641496514966149671496814969149701497114972149731497414975149761497714978149791498014981149821498314984149851498614987149881498914990149911499214993149941499514996149971499814999150001500115002150031500415005150061500715008150091501015011150121501315014150151501615017150181501915020150211502215023150241502515026150271502815029150301503115032150331503415035150361503715038150391504015041150421504315044150451504615047150481504915050150511505215053150541505515056150571505815059150601506115062150631506415065150661506715068150691507015071150721507315074150751507615077150781507915080150811508215083150841508515086150871508815089150901509115092150931509415095150961509715098150991510015101151021510315104151051510615107151081510915110151111511215113151141511515116151171511815119151201512115122151231512415125151261512715128151291513015131151321513315134151351513615137151381513915140151411514215143151441514515146151471514815149151501515115152151531515415155151561515715158151591516015161151621516315164151651516615167151681516915170151711517215173151741517515176151771517815179151801518115182151831518415185151861518715188151891519015191151921519315194151951519615197151981519915200152011520215203152041520515206152071520815209152101521115212152131521415215152161521715218152191522015221152221522315224152251522615227152281522915230152311523215233152341523515236152371523815239152401524115242152431524415245152461524715248152491525015251152521525315254152551525615257152581525915260152611526215263152641526515266152671526815269152701527115272152731527415275152761527715278152791528015281152821528315284152851528615287152881528915290152911529215293152941529515296152971529815299153001530115302153031530415305153061530715308153091531015311153121531315314153151531615317153181531915320153211532215323153241532515326153271532815329153301533115332153331533415335153361533715338153391534015341153421534315344153451534615347153481534915350153511535215353153541535515356153571535815359153601536115362153631536415365153661536715368153691537015371153721537315374153751537615377153781537915380153811538215383153841538515386153871538815389153901539115392153931539415395153961539715398153991540015401154021540315404154051540615407154081540915410154111541215413154141541515416154171541815419154201542115422154231542415425154261542715428154291543015431154321543315434154351543615437154381543915440154411544215443154441544515446154471544815449154501545115452154531545415455154561545715458154591546015461154621546315464154651546615467154681546915470154711547215473154741547515476154771547815479154801548115482154831548415485154861548715488154891549015491154921549315494154951549615497154981549915500155011550215503155041550515506155071550815509155101551115512155131551415515155161551715518155191552015521155221552315524155251552615527155281552915530155311553215533155341553515536155371553815539155401554115542155431554415545155461554715548155491555015551155521555315554155551555615557155581555915560155611556215563155641556515566155671556815569155701557115572155731557415575155761557715578155791558015581155821558315584155851558615587155881558915590155911559215593155941559515596155971559815599156001560115602156031560415605156061560715608156091561015611156121561315614156151561615617156181561915620156211562215623156241562515626156271562815629156301563115632156331563415635156361563715638156391564015641156421564315644156451564615647156481564915650156511565215653156541565515656156571565815659156601566115662156631566415665156661566715668156691567015671156721567315674156751567615677156781567915680156811568215683156841568515686156871568815689156901569115692156931569415695156961569715698156991570015701157021570315704157051570615707157081570915710157111571215713157141571515716157171571815719157201572115722157231572415725157261572715728157291573015731157321573315734157351573615737157381573915740157411574215743157441574515746157471574815749157501575115752157531575415755157561575715758157591576015761157621576315764157651576615767157681576915770157711577215773157741577515776157771577815779157801578115782157831578415785157861578715788157891579015791157921579315794157951579615797157981579915800158011580215803158041580515806158071580815809158101581115812158131581415815158161581715818158191582015821158221582315824158251582615827158281582915830158311583215833158341583515836158371583815839158401584115842158431584415845158461584715848158491585015851158521585315854158551585615857158581585915860158611586215863158641586515866158671586815869158701587115872158731587415875158761587715878158791588015881158821588315884158851588615887158881588915890158911589215893158941589515896158971589815899159001590115902159031590415905159061590715908159091591015911159121591315914159151591615917159181591915920159211592215923159241592515926159271592815929159301593115932159331593415935159361593715938159391594015941159421594315944159451594615947159481594915950159511595215953159541595515956159571595815959159601596115962159631596415965159661596715968159691597015971159721597315974159751597615977159781597915980159811598215983159841598515986159871598815989159901599115992159931599415995159961599715998159991600016001160021600316004160051600616007160081600916010160111601216013160141601516016160171601816019160201602116022160231602416025160261602716028160291603016031160321603316034160351603616037160381603916040160411604216043160441604516046160471604816049160501605116052160531605416055160561605716058160591606016061160621606316064160651606616067160681606916070160711607216073160741607516076160771607816079160801608116082160831608416085160861608716088160891609016091160921609316094160951609616097160981609916100161011610216103161041610516106161071610816109161101611116112161131611416115161161611716118161191612016121161221612316124161251612616127161281612916130161311613216133161341613516136161371613816139161401614116142161431614416145161461614716148161491615016151161521615316154161551615616157161581615916160161611616216163161641616516166161671616816169161701617116172161731617416175161761617716178161791618016181161821618316184161851618616187161881618916190161911619216193161941619516196161971619816199162001620116202162031620416205162061620716208162091621016211162121621316214162151621616217162181621916220162211622216223162241622516226162271622816229162301623116232162331623416235162361623716238162391624016241162421624316244162451624616247162481624916250162511625216253162541625516256162571625816259162601626116262162631626416265162661626716268162691627016271162721627316274162751627616277162781627916280162811628216283162841628516286162871628816289162901629116292162931629416295162961629716298162991630016301163021630316304163051630616307163081630916310163111631216313163141631516316163171631816319163201632116322163231632416325163261632716328163291633016331163321633316334163351633616337163381633916340163411634216343163441634516346163471634816349163501635116352163531635416355163561635716358163591636016361163621636316364163651636616367163681636916370163711637216373163741637516376163771637816379163801638116382163831638416385163861638716388163891639016391163921639316394163951639616397163981639916400164011640216403164041640516406164071640816409164101641116412164131641416415164161641716418164191642016421164221642316424164251642616427164281642916430164311643216433164341643516436164371643816439164401644116442164431644416445164461644716448164491645016451164521645316454164551645616457164581645916460164611646216463164641646516466164671646816469164701647116472164731647416475164761647716478164791648016481164821648316484164851648616487164881648916490164911649216493164941649516496164971649816499165001650116502165031650416505165061650716508165091651016511165121651316514165151651616517165181651916520165211652216523165241652516526165271652816529165301653116532165331653416535165361653716538165391654016541165421654316544165451654616547165481654916550165511655216553165541655516556165571655816559165601656116562165631656416565165661656716568165691657016571165721657316574165751657616577165781657916580165811658216583165841658516586165871658816589165901659116592165931659416595165961659716598165991660016601166021660316604166051660616607166081660916610166111661216613166141661516616166171661816619166201662116622166231662416625166261662716628166291663016631166321663316634166351663616637166381663916640166411664216643166441664516646166471664816649166501665116652166531665416655166561665716658166591666016661166621666316664166651666616667166681666916670166711667216673166741667516676166771667816679166801668116682166831668416685166861668716688166891669016691166921669316694166951669616697166981669916700167011670216703167041670516706167071670816709167101671116712167131671416715167161671716718167191672016721167221672316724167251672616727167281672916730167311673216733167341673516736167371673816739167401674116742167431674416745167461674716748167491675016751167521675316754167551675616757167581675916760167611676216763167641676516766167671676816769167701677116772167731677416775167761677716778167791678016781167821678316784167851678616787167881678916790167911679216793167941679516796167971679816799168001680116802168031680416805168061680716808168091681016811168121681316814168151681616817168181681916820168211682216823168241682516826168271682816829168301683116832168331683416835168361683716838168391684016841168421684316844168451684616847168481684916850168511685216853168541685516856168571685816859168601686116862168631686416865168661686716868168691687016871168721687316874168751687616877168781687916880168811688216883168841688516886168871688816889168901689116892168931689416895168961689716898168991690016901169021690316904169051690616907169081690916910169111691216913169141691516916169171691816919169201692116922169231692416925169261692716928169291693016931169321693316934169351693616937169381693916940169411694216943169441694516946169471694816949169501695116952169531695416955169561695716958169591696016961169621696316964169651696616967169681696916970169711697216973169741697516976169771697816979169801698116982169831698416985169861698716988169891699016991169921699316994169951699616997169981699917000170011700217003170041700517006170071700817009170101701117012170131701417015170161701717018170191702017021170221702317024170251702617027170281702917030170311703217033170341703517036170371703817039170401704117042170431704417045170461704717048170491705017051170521705317054170551705617057170581705917060170611706217063170641706517066170671706817069170701707117072170731707417075170761707717078170791708017081170821708317084170851708617087170881708917090170911709217093170941709517096170971709817099171001710117102171031710417105171061710717108171091711017111171121711317114171151711617117171181711917120171211712217123171241712517126171271712817129171301713117132171331713417135171361713717138171391714017141171421714317144171451714617147171481714917150171511715217153171541715517156171571715817159171601716117162171631716417165171661716717168171691717017171171721717317174171751717617177171781717917180171811718217183171841718517186171871718817189171901719117192171931719417195171961719717198171991720017201172021720317204172051720617207172081720917210172111721217213172141721517216172171721817219172201722117222172231722417225172261722717228172291723017231172321723317234172351723617237172381723917240172411724217243172441724517246172471724817249172501725117252172531725417255172561725717258172591726017261172621726317264172651726617267172681726917270172711727217273172741727517276172771727817279172801728117282172831728417285172861728717288172891729017291172921729317294172951729617297172981729917300173011730217303173041730517306173071730817309173101731117312173131731417315173161731717318173191732017321173221732317324173251732617327173281732917330173311733217333173341733517336173371733817339173401734117342173431734417345173461734717348173491735017351173521735317354173551735617357173581735917360173611736217363173641736517366173671736817369173701737117372173731737417375173761737717378173791738017381173821738317384173851738617387173881738917390173911739217393173941739517396173971739817399174001740117402174031740417405174061740717408174091741017411174121741317414174151741617417174181741917420174211742217423174241742517426174271742817429174301743117432174331743417435174361743717438174391744017441174421744317444174451744617447174481744917450174511745217453174541745517456174571745817459174601746117462174631746417465174661746717468174691747017471174721747317474174751747617477174781747917480174811748217483174841748517486174871748817489174901749117492174931749417495174961749717498174991750017501175021750317504175051750617507175081750917510175111751217513175141751517516175171751817519175201752117522175231752417525175261752717528175291753017531175321753317534175351753617537175381753917540175411754217543175441754517546175471754817549175501755117552175531755417555175561755717558175591756017561175621756317564175651756617567175681756917570175711757217573175741757517576175771757817579175801758117582175831758417585175861758717588175891759017591175921759317594175951759617597175981759917600176011760217603176041760517606176071760817609176101761117612176131761417615176161761717618176191762017621176221762317624176251762617627176281762917630176311763217633176341763517636176371763817639176401764117642176431764417645176461764717648176491765017651176521765317654176551765617657176581765917660176611766217663176641766517666176671766817669176701767117672176731767417675176761767717678176791768017681176821768317684176851768617687176881768917690176911769217693176941769517696176971769817699177001770117702177031770417705177061770717708177091771017711177121771317714177151771617717177181771917720177211772217723177241772517726177271772817729177301773117732177331773417735177361773717738177391774017741177421774317744177451774617747177481774917750177511775217753177541775517756177571775817759177601776117762177631776417765177661776717768177691777017771177721777317774177751777617777177781777917780177811778217783177841778517786177871778817789177901779117792177931779417795177961779717798177991780017801178021780317804178051780617807178081780917810178111781217813178141781517816178171781817819178201782117822178231782417825178261782717828178291783017831178321783317834178351783617837178381783917840178411784217843178441784517846178471784817849178501785117852178531785417855178561785717858178591786017861178621786317864178651786617867178681786917870178711787217873178741787517876178771787817879178801788117882178831788417885178861788717888178891789017891178921789317894178951789617897178981789917900179011790217903179041790517906179071790817909179101791117912179131791417915179161791717918179191792017921179221792317924179251792617927179281792917930179311793217933179341793517936179371793817939179401794117942179431794417945179461794717948179491795017951179521795317954179551795617957179581795917960179611796217963179641796517966179671796817969179701797117972179731797417975179761797717978179791798017981179821798317984179851798617987179881798917990179911799217993179941799517996179971799817999180001800118002180031800418005180061800718008180091801018011180121801318014180151801618017180181801918020180211802218023180241802518026180271802818029180301803118032180331803418035180361803718038180391804018041180421804318044180451804618047180481804918050180511805218053180541805518056180571805818059180601806118062180631806418065180661806718068180691807018071180721807318074180751807618077180781807918080180811808218083180841808518086180871808818089180901809118092180931809418095180961809718098180991810018101181021810318104181051810618107181081810918110181111811218113181141811518116181171811818119181201812118122181231812418125181261812718128181291813018131181321813318134181351813618137181381813918140181411814218143181441814518146181471814818149181501815118152181531815418155181561815718158181591816018161181621816318164181651816618167181681816918170181711817218173181741817518176181771817818179181801818118182181831818418185181861818718188181891819018191181921819318194181951819618197181981819918200182011820218203182041820518206182071820818209182101821118212182131821418215182161821718218182191822018221182221822318224182251822618227182281822918230182311823218233182341823518236182371823818239182401824118242182431824418245182461824718248182491825018251182521825318254182551825618257182581825918260182611826218263182641826518266182671826818269182701827118272182731827418275182761827718278182791828018281182821828318284182851828618287182881828918290182911829218293182941829518296182971829818299183001830118302183031830418305183061830718308183091831018311183121831318314183151831618317183181831918320183211832218323183241832518326183271832818329183301833118332183331833418335183361833718338183391834018341183421834318344183451834618347183481834918350183511835218353183541835518356183571835818359183601836118362183631836418365183661836718368183691837018371183721837318374183751837618377183781837918380183811838218383183841838518386183871838818389183901839118392183931839418395183961839718398183991840018401184021840318404184051840618407184081840918410184111841218413184141841518416184171841818419184201842118422184231842418425184261842718428184291843018431184321843318434184351843618437184381843918440184411844218443184441844518446184471844818449184501845118452184531845418455184561845718458184591846018461184621846318464184651846618467184681846918470184711847218473184741847518476184771847818479184801848118482184831848418485184861848718488184891849018491184921849318494184951849618497184981849918500185011850218503185041850518506185071850818509185101851118512185131851418515185161851718518185191852018521185221852318524185251852618527185281852918530185311853218533185341853518536185371853818539185401854118542185431854418545185461854718548185491855018551185521855318554185551855618557185581855918560185611856218563185641856518566185671856818569185701857118572185731857418575185761857718578185791858018581185821858318584185851858618587185881858918590185911859218593185941859518596185971859818599186001860118602186031860418605186061860718608186091861018611186121861318614186151861618617186181861918620186211862218623186241862518626186271862818629186301863118632186331863418635186361863718638186391864018641186421864318644186451864618647186481864918650186511865218653186541865518656186571865818659186601866118662186631866418665186661866718668186691867018671186721867318674186751867618677186781867918680186811868218683186841868518686186871868818689186901869118692186931869418695186961869718698186991870018701187021870318704187051870618707187081870918710187111871218713187141871518716187171871818719187201872118722187231872418725187261872718728187291873018731187321873318734187351873618737187381873918740187411874218743187441874518746187471874818749187501875118752187531875418755187561875718758187591876018761187621876318764187651876618767187681876918770187711877218773187741877518776187771877818779187801878118782187831878418785187861878718788187891879018791187921879318794187951879618797187981879918800188011880218803188041880518806188071880818809188101881118812188131881418815188161881718818188191882018821188221882318824188251882618827188281882918830188311883218833188341883518836188371883818839188401884118842188431884418845188461884718848188491885018851188521885318854188551885618857188581885918860188611886218863188641886518866188671886818869188701887118872188731887418875188761887718878188791888018881188821888318884188851888618887188881888918890188911889218893188941889518896188971889818899189001890118902189031890418905189061890718908189091891018911189121891318914189151891618917189181891918920189211892218923189241892518926189271892818929189301893118932189331893418935189361893718938189391894018941189421894318944189451894618947189481894918950189511895218953189541895518956189571895818959189601896118962189631896418965189661896718968189691897018971189721897318974189751897618977189781897918980189811898218983189841898518986189871898818989189901899118992189931899418995189961899718998189991900019001190021900319004190051900619007190081900919010190111901219013190141901519016190171901819019190201902119022190231902419025190261902719028190291903019031190321903319034190351903619037190381903919040190411904219043190441904519046190471904819049190501905119052190531905419055190561905719058190591906019061190621906319064190651906619067190681906919070190711907219073190741907519076190771907819079190801908119082190831908419085190861908719088190891909019091190921909319094190951909619097190981909919100191011910219103191041910519106191071910819109191101911119112191131911419115191161911719118191191912019121191221912319124191251912619127191281912919130191311913219133191341913519136191371913819139191401914119142191431914419145191461914719148191491915019151191521915319154191551915619157191581915919160191611916219163191641916519166191671916819169191701917119172191731917419175191761917719178191791918019181191821918319184191851918619187191881918919190191911919219193191941919519196191971919819199192001920119202192031920419205192061920719208192091921019211192121921319214192151921619217192181921919220192211922219223192241922519226192271922819229192301923119232192331923419235192361923719238192391924019241192421924319244192451924619247192481924919250192511925219253192541925519256192571925819259192601926119262192631926419265192661926719268192691927019271192721927319274192751927619277192781927919280192811928219283192841928519286192871928819289192901929119292192931929419295192961929719298192991930019301193021930319304193051930619307193081930919310193111931219313193141931519316193171931819319193201932119322193231932419325193261932719328193291933019331193321933319334193351933619337193381933919340193411934219343193441934519346193471934819349193501935119352193531935419355193561935719358193591936019361193621936319364193651936619367193681936919370193711937219373193741937519376193771937819379193801938119382193831938419385193861938719388193891939019391193921939319394193951939619397193981939919400
  1. (self["webpackChunk"] = self["webpackChunk"] || []).push([["resources_js_pages_Users_Index_vue"],{
  2. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppButtonLink.vue?vue&type=script&setup=true&lang=js":
  3. /*!******************************************************************************************************************************************************************************************************************!*\
  4. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppButtonLink.vue?vue&type=script&setup=true&lang=js ***!
  5. \******************************************************************************************************************************************************************************************************************/
  6. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  7. "use strict";
  8. __webpack_require__.r(__webpack_exports__);
  9. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  10. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  11. /* harmony export */ });
  12. /* harmony import */ var _inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @inertiajs/inertia-vue3 */ "./node_modules/@inertiajs/inertia-vue3/dist/index.js");
  13. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
  14. __name: 'AppButtonLink',
  15. props: {
  16. inertiaLink: {
  17. type: Boolean,
  18. "default": true
  19. },
  20. icon: {
  21. type: String,
  22. required: true
  23. },
  24. label: String
  25. },
  26. setup: function setup(__props, _ref) {
  27. var expose = _ref.expose;
  28. expose();
  29. var __returned__ = {
  30. Link: _inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_0__.Link
  31. };
  32. Object.defineProperty(__returned__, '__isScriptSetup', {
  33. enumerable: false,
  34. value: true
  35. });
  36. return __returned__;
  37. }
  38. });
  39. /***/ }),
  40. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppMessage.vue?vue&type=script&setup=true&lang=js":
  41. /*!***************************************************************************************************************************************************************************************************************!*\
  42. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppMessage.vue?vue&type=script&setup=true&lang=js ***!
  43. \***************************************************************************************************************************************************************************************************************/
  44. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  45. "use strict";
  46. __webpack_require__.r(__webpack_exports__);
  47. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  48. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  49. /* harmony export */ });
  50. /* harmony import */ var _inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @inertiajs/inertia-vue3 */ "./node_modules/@inertiajs/inertia-vue3/dist/index.js");
  51. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
  52. __name: 'AppMessage',
  53. setup: function setup(__props, _ref) {
  54. var expose = _ref.expose;
  55. expose();
  56. var onClose = function onClose() {
  57. (0,_inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_0__.usePage)().props.value.errors = {};
  58. (0,_inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_0__.usePage)().props.value.flash.success = null;
  59. (0,_inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_0__.usePage)().props.value.flash.error = null;
  60. };
  61. var __returned__ = {
  62. onClose: onClose,
  63. usePage: _inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_0__.usePage
  64. };
  65. Object.defineProperty(__returned__, '__isScriptSetup', {
  66. enumerable: false,
  67. value: true
  68. });
  69. return __returned__;
  70. }
  71. });
  72. /***/ }),
  73. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppPagination.vue?vue&type=script&setup=true&lang=js":
  74. /*!******************************************************************************************************************************************************************************************************************!*\
  75. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppPagination.vue?vue&type=script&setup=true&lang=js ***!
  76. \******************************************************************************************************************************************************************************************************************/
  77. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  78. "use strict";
  79. __webpack_require__.r(__webpack_exports__);
  80. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  81. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  82. /* harmony export */ });
  83. /* harmony import */ var _inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @inertiajs/inertia-vue3 */ "./node_modules/@inertiajs/inertia-vue3/dist/index.js");
  84. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
  85. __name: 'AppPagination',
  86. props: {
  87. links: Array
  88. },
  89. setup: function setup(__props, _ref) {
  90. var expose = _ref.expose;
  91. expose();
  92. var __returned__ = {
  93. Link: _inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_0__.Link
  94. };
  95. Object.defineProperty(__returned__, '__isScriptSetup', {
  96. enumerable: false,
  97. value: true
  98. });
  99. return __returned__;
  100. }
  101. });
  102. /***/ }),
  103. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppSearch.vue?vue&type=script&setup=true&lang=js":
  104. /*!**************************************************************************************************************************************************************************************************************!*\
  105. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppSearch.vue?vue&type=script&setup=true&lang=js ***!
  106. \**************************************************************************************************************************************************************************************************************/
  107. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  108. "use strict";
  109. __webpack_require__.r(__webpack_exports__);
  110. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  111. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  112. /* harmony export */ });
  113. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  114. /* harmony import */ var _inertiajs_inertia__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @inertiajs/inertia */ "./node_modules/@inertiajs/inertia/dist/index.js");
  115. /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! lodash */ "./node_modules/lodash/lodash.js");
  116. /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_2__);
  117. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
  118. __name: 'AppSearch',
  119. props: {
  120. url: {
  121. type: String,
  122. required: true
  123. },
  124. initialSearch: {
  125. required: true
  126. }
  127. },
  128. setup: function setup(__props, _ref) {
  129. var expose = _ref.expose;
  130. expose();
  131. var props = __props;
  132. var search = (0,vue__WEBPACK_IMPORTED_MODULE_0__.ref)(props.initialSearch);
  133. (0,vue__WEBPACK_IMPORTED_MODULE_0__.watch)(search, function () {
  134. _inertiajs_inertia__WEBPACK_IMPORTED_MODULE_1__.Inertia.get(props.url, (0,lodash__WEBPACK_IMPORTED_MODULE_2__.pickBy)({
  135. search: search.value
  136. }), {
  137. preserveState: true
  138. });
  139. });
  140. var __returned__ = {
  141. props: props,
  142. search: search,
  143. ref: vue__WEBPACK_IMPORTED_MODULE_0__.ref,
  144. watch: vue__WEBPACK_IMPORTED_MODULE_0__.watch,
  145. Inertia: _inertiajs_inertia__WEBPACK_IMPORTED_MODULE_1__.Inertia,
  146. pickBy: lodash__WEBPACK_IMPORTED_MODULE_2__.pickBy
  147. };
  148. Object.defineProperty(__returned__, '__isScriptSetup', {
  149. enumerable: false,
  150. value: true
  151. });
  152. return __returned__;
  153. }
  154. });
  155. /***/ }),
  156. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/layouts/Dashboard/Components/Sidebar.vue?vue&type=script&setup=true&lang=js":
  157. /*!******************************************************************************************************************************************************************************************************************************!*\
  158. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/layouts/Dashboard/Components/Sidebar.vue?vue&type=script&setup=true&lang=js ***!
  159. \******************************************************************************************************************************************************************************************************************************/
  160. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  161. "use strict";
  162. __webpack_require__.r(__webpack_exports__);
  163. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  164. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  165. /* harmony export */ });
  166. /* harmony import */ var _SubSidebar_vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./SubSidebar.vue */ "./resources/js/layouts/Dashboard/Components/SubSidebar.vue");
  167. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
  168. __name: 'Sidebar',
  169. props: {
  170. menu: Array
  171. },
  172. setup: function setup(__props, _ref) {
  173. var expose = _ref.expose;
  174. expose();
  175. var __returned__ = {
  176. SubSidebar: _SubSidebar_vue__WEBPACK_IMPORTED_MODULE_0__["default"]
  177. };
  178. Object.defineProperty(__returned__, '__isScriptSetup', {
  179. enumerable: false,
  180. value: true
  181. });
  182. return __returned__;
  183. }
  184. });
  185. /***/ }),
  186. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/layouts/Dashboard/Components/SubSidebar.vue?vue&type=script&setup=true&lang=js":
  187. /*!*********************************************************************************************************************************************************************************************************************************!*\
  188. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/layouts/Dashboard/Components/SubSidebar.vue?vue&type=script&setup=true&lang=js ***!
  189. \*********************************************************************************************************************************************************************************************************************************/
  190. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  191. "use strict";
  192. __webpack_require__.r(__webpack_exports__);
  193. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  194. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  195. /* harmony export */ });
  196. /* harmony import */ var _inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @inertiajs/inertia-vue3 */ "./node_modules/@inertiajs/inertia-vue3/dist/index.js");
  197. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
  198. __name: 'SubSidebar',
  199. props: {
  200. items: Array,
  201. root: {
  202. type: Boolean,
  203. "default": false
  204. }
  205. },
  206. setup: function setup(__props, _ref) {
  207. var expose = _ref.expose;
  208. expose();
  209. var __returned__ = {
  210. Link: _inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_0__.Link
  211. };
  212. Object.defineProperty(__returned__, '__isScriptSetup', {
  213. enumerable: false,
  214. value: true
  215. });
  216. return __returned__;
  217. }
  218. });
  219. /***/ }),
  220. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/layouts/Dashboard/Components/TopBar.vue?vue&type=script&setup=true&lang=js":
  221. /*!*****************************************************************************************************************************************************************************************************************************!*\
  222. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/layouts/Dashboard/Components/TopBar.vue?vue&type=script&setup=true&lang=js ***!
  223. \*****************************************************************************************************************************************************************************************************************************/
  224. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  225. "use strict";
  226. __webpack_require__.r(__webpack_exports__);
  227. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  228. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  229. /* harmony export */ });
  230. /* harmony import */ var _inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @inertiajs/inertia-vue3 */ "./node_modules/@inertiajs/inertia-vue3/dist/index.js");
  231. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
  232. __name: 'TopBar',
  233. setup: function setup(__props, _ref) {
  234. var expose = _ref.expose;
  235. expose();
  236. var __returned__ = {
  237. Link: _inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_0__.Link
  238. };
  239. Object.defineProperty(__returned__, '__isScriptSetup', {
  240. enumerable: false,
  241. value: true
  242. });
  243. return __returned__;
  244. }
  245. });
  246. /***/ }),
  247. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/layouts/Dashboard/DashboardLayout.vue?vue&type=script&setup=true&lang=js":
  248. /*!***************************************************************************************************************************************************************************************************************************!*\
  249. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/layouts/Dashboard/DashboardLayout.vue?vue&type=script&setup=true&lang=js ***!
  250. \***************************************************************************************************************************************************************************************************************************/
  251. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  252. "use strict";
  253. __webpack_require__.r(__webpack_exports__);
  254. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  255. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  256. /* harmony export */ });
  257. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  258. /* harmony import */ var _inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @inertiajs/inertia-vue3 */ "./node_modules/@inertiajs/inertia-vue3/dist/index.js");
  259. /* harmony import */ var _utils_menu__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @/utils/menu */ "./resources/js/utils/menu.js");
  260. /* harmony import */ var _components_AppMessage_vue__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @/components/AppMessage.vue */ "./resources/js/components/AppMessage.vue");
  261. /* harmony import */ var _Components_TopBar_vue__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./Components/TopBar.vue */ "./resources/js/layouts/Dashboard/Components/TopBar.vue");
  262. /* harmony import */ var _Components_Sidebar_vue__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./Components/Sidebar.vue */ "./resources/js/layouts/Dashboard/Components/Sidebar.vue");
  263. /* harmony import */ var _Components_Footer_vue__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./Components/Footer.vue */ "./resources/js/layouts/Dashboard/Components/Footer.vue");
  264. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
  265. __name: 'DashboardLayout',
  266. props: {
  267. title: String
  268. },
  269. setup: function setup(__props, _ref) {
  270. var expose = _ref.expose;
  271. expose();
  272. var mobileMenuActive = (0,vue__WEBPACK_IMPORTED_MODULE_0__.ref)(false);
  273. var staticMenuInactive = (0,vue__WEBPACK_IMPORTED_MODULE_0__.ref)(false);
  274. var menuClick = (0,vue__WEBPACK_IMPORTED_MODULE_0__.ref)(false);
  275. var isDesktop = function isDesktop() {
  276. return window.innerWidth >= 992;
  277. };
  278. var containerClass = (0,vue__WEBPACK_IMPORTED_MODULE_0__.computed)(function () {
  279. return ['layout-wrapper', {
  280. 'layout-static-sidebar-inactive': staticMenuInactive.value,
  281. 'layout-mobile-sidebar-active': mobileMenuActive.value
  282. }];
  283. });
  284. var onWrapperClick = function onWrapperClick() {
  285. if (!menuClick.value) {
  286. mobileMenuActive.value = false;
  287. }
  288. menuClick.value = false;
  289. };
  290. var onMenuToggle = function onMenuToggle(event) {
  291. menuClick.value = true;
  292. if (isDesktop()) {
  293. staticMenuInactive.value = !staticMenuInactive.value;
  294. } else {
  295. mobileMenuActive.value = !mobileMenuActive.value;
  296. }
  297. event.preventDefault();
  298. };
  299. var __returned__ = {
  300. mobileMenuActive: mobileMenuActive,
  301. staticMenuInactive: staticMenuInactive,
  302. menuClick: menuClick,
  303. isDesktop: isDesktop,
  304. containerClass: containerClass,
  305. onWrapperClick: onWrapperClick,
  306. onMenuToggle: onMenuToggle,
  307. ref: vue__WEBPACK_IMPORTED_MODULE_0__.ref,
  308. computed: vue__WEBPACK_IMPORTED_MODULE_0__.computed,
  309. Head: _inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_1__.Head,
  310. menu: _utils_menu__WEBPACK_IMPORTED_MODULE_2__["default"],
  311. AppMessage: _components_AppMessage_vue__WEBPACK_IMPORTED_MODULE_3__["default"],
  312. TopBar: _Components_TopBar_vue__WEBPACK_IMPORTED_MODULE_4__["default"],
  313. Sidebar: _Components_Sidebar_vue__WEBPACK_IMPORTED_MODULE_5__["default"],
  314. Footer: _Components_Footer_vue__WEBPACK_IMPORTED_MODULE_6__["default"]
  315. };
  316. Object.defineProperty(__returned__, '__isScriptSetup', {
  317. enumerable: false,
  318. value: true
  319. });
  320. return __returned__;
  321. }
  322. });
  323. /***/ }),
  324. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/pages/Users/Index.vue?vue&type=script&setup=true&lang=js":
  325. /*!***********************************************************************************************************************************************************************************************************!*\
  326. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/pages/Users/Index.vue?vue&type=script&setup=true&lang=js ***!
  327. \***********************************************************************************************************************************************************************************************************/
  328. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  329. "use strict";
  330. __webpack_require__.r(__webpack_exports__);
  331. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  332. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  333. /* harmony export */ });
  334. /* harmony import */ var _inertiajs_inertia__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @inertiajs/inertia */ "./node_modules/@inertiajs/inertia/dist/index.js");
  335. /* harmony import */ var primevue_useconfirm__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! primevue/useconfirm */ "./node_modules/primevue/useconfirm/useconfirm.esm.js");
  336. /* harmony import */ var _config__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./config */ "./resources/js/pages/Users/config.js");
  337. /* harmony import */ var _components_AppSearch_vue__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @/components/AppSearch.vue */ "./resources/js/components/AppSearch.vue");
  338. /* harmony import */ var _components_AppButtonLink_vue__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @/components/AppButtonLink.vue */ "./resources/js/components/AppButtonLink.vue");
  339. /* harmony import */ var _components_AppPagination_vue__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @/components/AppPagination.vue */ "./resources/js/components/AppPagination.vue");
  340. /* harmony import */ var _layouts_Dashboard_DashboardLayout_vue__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @/layouts/Dashboard/DashboardLayout.vue */ "./resources/js/layouts/Dashboard/DashboardLayout.vue");
  341. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
  342. __name: 'Index',
  343. props: {
  344. users: Object,
  345. initialSearch: String
  346. },
  347. setup: function setup(__props, _ref) {
  348. var expose = _ref.expose;
  349. expose();
  350. var resetConfirm = (0,primevue_useconfirm__WEBPACK_IMPORTED_MODULE_1__.useConfirm)();
  351. var onResetPassword = function onResetPassword(data) {
  352. resetConfirm.require({
  353. message: "Yakin mereset kata sandi (".concat(data.name, ") ?"),
  354. header: 'Reset Kata Sandi',
  355. acceptLabel: 'Iya',
  356. rejectLabel: 'Tidak',
  357. accept: function accept() {
  358. _inertiajs_inertia__WEBPACK_IMPORTED_MODULE_0__.Inertia.put(route('users.reset-password', data.id));
  359. },
  360. reject: function reject() {
  361. resetConfirm.close();
  362. }
  363. });
  364. };
  365. var __returned__ = {
  366. resetConfirm: resetConfirm,
  367. onResetPassword: onResetPassword,
  368. Inertia: _inertiajs_inertia__WEBPACK_IMPORTED_MODULE_0__.Inertia,
  369. useConfirm: primevue_useconfirm__WEBPACK_IMPORTED_MODULE_1__.useConfirm,
  370. indexTable: _config__WEBPACK_IMPORTED_MODULE_2__.indexTable,
  371. AppSearch: _components_AppSearch_vue__WEBPACK_IMPORTED_MODULE_3__["default"],
  372. AppButtonLink: _components_AppButtonLink_vue__WEBPACK_IMPORTED_MODULE_4__["default"],
  373. AppPagination: _components_AppPagination_vue__WEBPACK_IMPORTED_MODULE_5__["default"],
  374. DashboardLayout: _layouts_Dashboard_DashboardLayout_vue__WEBPACK_IMPORTED_MODULE_6__["default"]
  375. };
  376. Object.defineProperty(__returned__, '__isScriptSetup', {
  377. enumerable: false,
  378. value: true
  379. });
  380. return __returned__;
  381. }
  382. });
  383. /***/ }),
  384. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppButtonLink.vue?vue&type=template&id=c3621f1c":
  385. /*!***********************************************************************************************************************************************************************************************************************************************************************************!*\
  386. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppButtonLink.vue?vue&type=template&id=c3621f1c ***!
  387. \***********************************************************************************************************************************************************************************************************************************************************************************/
  388. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  389. "use strict";
  390. __webpack_require__.r(__webpack_exports__);
  391. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  392. /* harmony export */ "render": () => (/* binding */ render)
  393. /* harmony export */ });
  394. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  395. var _hoisted_1 = {
  396. key: 1,
  397. "class": "p-button-label"
  398. };
  399. var _hoisted_2 = {
  400. key: 1,
  401. "class": "p-button p-component"
  402. };
  403. var _hoisted_3 = {
  404. key: 1,
  405. "class": "p-button-label"
  406. };
  407. function render(_ctx, _cache, $props, $setup, $data, $options) {
  408. return $props.inertiaLink ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createBlock)($setup["Link"], {
  409. key: 0,
  410. "class": "p-button p-component",
  411. as: "button",
  412. type: "button"
  413. }, {
  414. "default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  415. return [$props.icon ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)("span", {
  416. key: 0,
  417. "class": (0,vue__WEBPACK_IMPORTED_MODULE_0__.normalizeClass)(["p-button-icon p-button-icon-left", $props.icon])
  418. }, null, 2
  419. /* CLASS */
  420. )) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true), $props.label ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)("span", _hoisted_1, (0,vue__WEBPACK_IMPORTED_MODULE_0__.toDisplayString)($props.label), 1
  421. /* TEXT */
  422. )) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true)];
  423. }),
  424. _: 1
  425. /* STABLE */
  426. })) : ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)("a", _hoisted_2, [$props.icon ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)("span", {
  427. key: 0,
  428. "class": (0,vue__WEBPACK_IMPORTED_MODULE_0__.normalizeClass)(["p-button-icon p-button-icon-left", $props.icon])
  429. }, null, 2
  430. /* CLASS */
  431. )) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true), $props.label ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)("span", _hoisted_3, (0,vue__WEBPACK_IMPORTED_MODULE_0__.toDisplayString)($props.label), 1
  432. /* TEXT */
  433. )) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true)]));
  434. }
  435. /***/ }),
  436. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppMessage.vue?vue&type=template&id=07159051":
  437. /*!********************************************************************************************************************************************************************************************************************************************************************************!*\
  438. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppMessage.vue?vue&type=template&id=07159051 ***!
  439. \********************************************************************************************************************************************************************************************************************************************************************************/
  440. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  441. "use strict";
  442. __webpack_require__.r(__webpack_exports__);
  443. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  444. /* harmony export */ "render": () => (/* binding */ render)
  445. /* harmony export */ });
  446. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  447. var _hoisted_1 = {
  448. key: 0
  449. };
  450. var _hoisted_2 = {
  451. key: 1
  452. };
  453. function render(_ctx, _cache, $props, $setup, $data, $options) {
  454. var _component_Message = (0,vue__WEBPACK_IMPORTED_MODULE_0__.resolveComponent)("Message");
  455. return (0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)(vue__WEBPACK_IMPORTED_MODULE_0__.Fragment, null, [_ctx.$page.props.flash.success ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createBlock)(_component_Message, {
  456. key: 0,
  457. severity: "success",
  458. onClose: $setup.onClose
  459. }, {
  460. "default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  461. return [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createTextVNode)((0,vue__WEBPACK_IMPORTED_MODULE_0__.toDisplayString)(_ctx.$page.props.flash.success), 1
  462. /* TEXT */
  463. )];
  464. }),
  465. _: 1
  466. /* STABLE */
  467. })) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true), _ctx.$page.props.flash.error ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createBlock)(_component_Message, {
  468. key: 1,
  469. severity: "error",
  470. onClose: $setup.onClose
  471. }, {
  472. "default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  473. return [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createTextVNode)((0,vue__WEBPACK_IMPORTED_MODULE_0__.toDisplayString)(_ctx.$page.props.flash.error), 1
  474. /* TEXT */
  475. )];
  476. }),
  477. _: 1
  478. /* STABLE */
  479. })) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true), Object.keys(_ctx.$page.props.errors).length > 0 ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createBlock)(_component_Message, {
  480. key: 2,
  481. severity: "error",
  482. onClose: $setup.onClose
  483. }, {
  484. "default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  485. return [Object.keys(_ctx.$page.props.errors).length === 1 ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)("div", _hoisted_1, " Ditemukan satu error pada form ")) : ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)("div", _hoisted_2, " Ditemukan " + (0,vue__WEBPACK_IMPORTED_MODULE_0__.toDisplayString)(Object.keys(_ctx.$page.props.errors).length) + " error pada form ", 1
  486. /* TEXT */
  487. ))];
  488. }),
  489. _: 1
  490. /* STABLE */
  491. })) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true)], 64
  492. /* STABLE_FRAGMENT */
  493. );
  494. }
  495. /***/ }),
  496. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppPagination.vue?vue&type=template&id=4da56ec0":
  497. /*!***********************************************************************************************************************************************************************************************************************************************************************************!*\
  498. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppPagination.vue?vue&type=template&id=4da56ec0 ***!
  499. \***********************************************************************************************************************************************************************************************************************************************************************************/
  500. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  501. "use strict";
  502. __webpack_require__.r(__webpack_exports__);
  503. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  504. /* harmony export */ "render": () => (/* binding */ render)
  505. /* harmony export */ });
  506. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  507. var _hoisted_1 = {
  508. key: 0,
  509. "class": "p-paginator p-component flex justify-content-start"
  510. };
  511. var _hoisted_2 = {
  512. "class": "p-paginator-pages"
  513. };
  514. var _hoisted_3 = ["innerHTML"];
  515. function render(_ctx, _cache, $props, $setup, $data, $options) {
  516. return $props.links.length > 3 ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)("nav", _hoisted_1, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("div", _hoisted_2, [((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(true), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)(vue__WEBPACK_IMPORTED_MODULE_0__.Fragment, null, (0,vue__WEBPACK_IMPORTED_MODULE_0__.renderList)($props.links, function (link, key) {
  517. return (0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)(vue__WEBPACK_IMPORTED_MODULE_0__.Fragment, null, [link.url === null ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)("div", {
  518. key: "link-".concat(key),
  519. "class": (0,vue__WEBPACK_IMPORTED_MODULE_0__.normalizeClass)(["p-paginator-page p-paginator-element p-link", {
  520. 'p-disabled': link
  521. }]),
  522. innerHTML: link.label
  523. }, null, 10
  524. /* CLASS, PROPS */
  525. , _hoisted_3)) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true), link.url !== null ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createBlock)($setup["Link"], {
  526. key: "link-".concat(key),
  527. href: link.url,
  528. "class": (0,vue__WEBPACK_IMPORTED_MODULE_0__.normalizeClass)([{
  529. 'p-highlight': link.active
  530. }, "p-paginator-page p-paginator-element p-link"]),
  531. innerHTML: link.label
  532. }, null, 8
  533. /* PROPS */
  534. , ["href", "class", "innerHTML"])) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true)], 64
  535. /* STABLE_FRAGMENT */
  536. );
  537. }), 256
  538. /* UNKEYED_FRAGMENT */
  539. ))])])) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true);
  540. }
  541. /***/ }),
  542. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppSearch.vue?vue&type=template&id=5b9fdcce":
  543. /*!*******************************************************************************************************************************************************************************************************************************************************************************!*\
  544. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppSearch.vue?vue&type=template&id=5b9fdcce ***!
  545. \*******************************************************************************************************************************************************************************************************************************************************************************/
  546. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  547. "use strict";
  548. __webpack_require__.r(__webpack_exports__);
  549. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  550. /* harmony export */ "render": () => (/* binding */ render)
  551. /* harmony export */ });
  552. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  553. function render(_ctx, _cache, $props, $setup, $data, $options) {
  554. var _component_InputText = (0,vue__WEBPACK_IMPORTED_MODULE_0__.resolveComponent)("InputText");
  555. return (0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createBlock)(_component_InputText, {
  556. modelValue: $setup.search,
  557. "onUpdate:modelValue": _cache[0] || (_cache[0] = function ($event) {
  558. return $setup.search = $event;
  559. })
  560. }, null, 8
  561. /* PROPS */
  562. , ["modelValue"]);
  563. }
  564. /***/ }),
  565. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/layouts/Dashboard/Components/Footer.vue?vue&type=template&id=dbb3aa76":
  566. /*!**********************************************************************************************************************************************************************************************************************************************************************************************!*\
  567. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/layouts/Dashboard/Components/Footer.vue?vue&type=template&id=dbb3aa76 ***!
  568. \**********************************************************************************************************************************************************************************************************************************************************************************************/
  569. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  570. "use strict";
  571. __webpack_require__.r(__webpack_exports__);
  572. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  573. /* harmony export */ "render": () => (/* binding */ render)
  574. /* harmony export */ });
  575. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  576. var _hoisted_1 = {
  577. "class": "layout-footer"
  578. };
  579. var _hoisted_2 = /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createTextVNode)(" Developed by ");
  580. var _hoisted_3 = /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("a", {
  581. href: "https://dijitalcode.com",
  582. target: "_blank",
  583. "class": "font-medium ml-2"
  584. }, " DijitalCODE ", -1
  585. /* HOISTED */
  586. );
  587. var _hoisted_4 = [_hoisted_2, _hoisted_3];
  588. function render(_ctx, _cache) {
  589. return (0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)("footer", _hoisted_1, _hoisted_4);
  590. }
  591. /***/ }),
  592. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/layouts/Dashboard/Components/Sidebar.vue?vue&type=template&id=5b49aa22&scoped=true":
  593. /*!***********************************************************************************************************************************************************************************************************************************************************************************************************!*\
  594. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/layouts/Dashboard/Components/Sidebar.vue?vue&type=template&id=5b49aa22&scoped=true ***!
  595. \***********************************************************************************************************************************************************************************************************************************************************************************************************/
  596. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  597. "use strict";
  598. __webpack_require__.r(__webpack_exports__);
  599. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  600. /* harmony export */ "render": () => (/* binding */ render)
  601. /* harmony export */ });
  602. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  603. function render(_ctx, _cache, $props, $setup, $data, $options) {
  604. return (0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)("div", null, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)($setup["SubSidebar"], {
  605. "class": "layout-menu",
  606. items: $props.menu,
  607. root: true
  608. }, null, 8
  609. /* PROPS */
  610. , ["items"])]);
  611. }
  612. /***/ }),
  613. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/layouts/Dashboard/Components/SubSidebar.vue?vue&type=template&id=b1b23eb4&scoped=true":
  614. /*!**************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  615. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/layouts/Dashboard/Components/SubSidebar.vue?vue&type=template&id=b1b23eb4&scoped=true ***!
  616. \**************************************************************************************************************************************************************************************************************************************************************************************************************/
  617. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  618. "use strict";
  619. __webpack_require__.r(__webpack_exports__);
  620. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  621. /* harmony export */ "render": () => (/* binding */ render)
  622. /* harmony export */ });
  623. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  624. var _withScopeId = function _withScopeId(n) {
  625. return (0,vue__WEBPACK_IMPORTED_MODULE_0__.pushScopeId)("data-v-b1b23eb4"), n = n(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.popScopeId)(), n;
  626. };
  627. var _hoisted_1 = {
  628. key: 0
  629. };
  630. var _hoisted_2 = ["aria-label"];
  631. var _hoisted_3 = ["aria-label"];
  632. function render(_ctx, _cache, $props, $setup, $data, $options) {
  633. var _component_SubSidebar = (0,vue__WEBPACK_IMPORTED_MODULE_0__.resolveComponent)("SubSidebar", true);
  634. return $props.items ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)("ul", _hoisted_1, [((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(true), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)(vue__WEBPACK_IMPORTED_MODULE_0__.Fragment, null, (0,vue__WEBPACK_IMPORTED_MODULE_0__.renderList)($props.items, function (item, i) {
  635. return (0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)(vue__WEBPACK_IMPORTED_MODULE_0__.Fragment, null, [item ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)("li", {
  636. key: i,
  637. "class": (0,vue__WEBPACK_IMPORTED_MODULE_0__.normalizeClass)([{
  638. 'layout-menuitem-category': $props.root
  639. }]),
  640. role: "none"
  641. }, [$props.root ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)(vue__WEBPACK_IMPORTED_MODULE_0__.Fragment, {
  642. key: 0
  643. }, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("div", {
  644. "class": "layout-menuitem-root-text",
  645. "aria-label": item.label
  646. }, (0,vue__WEBPACK_IMPORTED_MODULE_0__.toDisplayString)(item.label), 9
  647. /* TEXT, PROPS */
  648. , _hoisted_2), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(_component_SubSidebar, {
  649. items: item.items
  650. }, null, 8
  651. /* PROPS */
  652. , ["items"])], 64
  653. /* STABLE_FRAGMENT */
  654. )) : ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)(vue__WEBPACK_IMPORTED_MODULE_0__.Fragment, {
  655. key: 1
  656. }, [item.to ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createBlock)($setup["Link"], {
  657. key: 0,
  658. role: "menuitem",
  659. href: item.to,
  660. "class": (0,vue__WEBPACK_IMPORTED_MODULE_0__.normalizeClass)([{
  661. 'router-link-active': _ctx.$page.component.startsWith(item.component) || _ctx.$page.url.startsWith(item.to),
  662. 'router-link-exact-active': _ctx.$page.component.startsWith(item.component) || _ctx.$page.url.startsWith(item.to)
  663. }]),
  664. "aria-label": item.label
  665. }, {
  666. "default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  667. return [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("i", {
  668. "class": (0,vue__WEBPACK_IMPORTED_MODULE_0__.normalizeClass)(item.icon)
  669. }, null, 2
  670. /* CLASS */
  671. ), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("span", null, (0,vue__WEBPACK_IMPORTED_MODULE_0__.toDisplayString)(item.label), 1
  672. /* TEXT */
  673. )];
  674. }),
  675. _: 2
  676. /* DYNAMIC */
  677. }, 1032
  678. /* PROPS, DYNAMIC_SLOTS */
  679. , ["href", "class", "aria-label"])) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true), !item.to ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)("a", {
  680. key: 1,
  681. href: "#",
  682. role: "menuitem",
  683. "aria-label": item.label
  684. }, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("i", {
  685. "class": (0,vue__WEBPACK_IMPORTED_MODULE_0__.normalizeClass)(item.icon)
  686. }, null, 2
  687. /* CLASS */
  688. ), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("span", null, (0,vue__WEBPACK_IMPORTED_MODULE_0__.toDisplayString)(item.label), 1
  689. /* TEXT */
  690. )], 8
  691. /* PROPS */
  692. , _hoisted_3)) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(_component_SubSidebar, {
  693. items: item.items
  694. }, null, 8
  695. /* PROPS */
  696. , ["items"])], 64
  697. /* STABLE_FRAGMENT */
  698. ))], 2
  699. /* CLASS */
  700. )) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true)], 64
  701. /* STABLE_FRAGMENT */
  702. );
  703. }), 256
  704. /* UNKEYED_FRAGMENT */
  705. ))])) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true);
  706. }
  707. /***/ }),
  708. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/layouts/Dashboard/Components/TopBar.vue?vue&type=template&id=0b7edbb0&scoped=true":
  709. /*!**********************************************************************************************************************************************************************************************************************************************************************************************************!*\
  710. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/layouts/Dashboard/Components/TopBar.vue?vue&type=template&id=0b7edbb0&scoped=true ***!
  711. \**********************************************************************************************************************************************************************************************************************************************************************************************************/
  712. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  713. "use strict";
  714. __webpack_require__.r(__webpack_exports__);
  715. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  716. /* harmony export */ "render": () => (/* binding */ render)
  717. /* harmony export */ });
  718. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  719. var _withScopeId = function _withScopeId(n) {
  720. return (0,vue__WEBPACK_IMPORTED_MODULE_0__.pushScopeId)("data-v-0b7edbb0"), n = n(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.popScopeId)(), n;
  721. };
  722. var _hoisted_1 = {
  723. "class": "layout-topbar"
  724. };
  725. var _hoisted_2 = /*#__PURE__*/_withScopeId(function () {
  726. return /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("img", {
  727. alt: "Brand Logo",
  728. src: "/images/logo.svg",
  729. "class": "md:mr-3"
  730. }, null, -1
  731. /* HOISTED */
  732. );
  733. });
  734. var _hoisted_3 = /*#__PURE__*/_withScopeId(function () {
  735. return /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("span", null, "Cahaya Agung", -1
  736. /* HOISTED */
  737. );
  738. });
  739. var _hoisted_4 = /*#__PURE__*/_withScopeId(function () {
  740. return /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("i", {
  741. "class": "pi pi-bars"
  742. }, null, -1
  743. /* HOISTED */
  744. );
  745. });
  746. var _hoisted_5 = [_hoisted_4];
  747. var _hoisted_6 = {
  748. "class": "p-link layout-topbar-menu-button layout-topbar-button"
  749. };
  750. var _hoisted_7 = /*#__PURE__*/_withScopeId(function () {
  751. return /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("i", {
  752. "class": "pi pi-ellipsis-v"
  753. }, null, -1
  754. /* HOISTED */
  755. );
  756. });
  757. var _hoisted_8 = [_hoisted_7];
  758. var _hoisted_9 = {
  759. "class": "layout-topbar-menu hidden lg:flex origin-top"
  760. };
  761. var _hoisted_10 = {
  762. "class": "align-self-center"
  763. };
  764. var _hoisted_11 = {
  765. "class": "hidden lg:inline"
  766. };
  767. var _hoisted_12 = /*#__PURE__*/_withScopeId(function () {
  768. return /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("i", {
  769. "class": "pi pi-user"
  770. }, null, -1
  771. /* HOISTED */
  772. );
  773. });
  774. var _hoisted_13 = /*#__PURE__*/_withScopeId(function () {
  775. return /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("span", null, "Ubah Profil", -1
  776. /* HOISTED */
  777. );
  778. });
  779. var _hoisted_14 = /*#__PURE__*/_withScopeId(function () {
  780. return /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("i", {
  781. "class": "pi pi-sign-out"
  782. }, null, -1
  783. /* HOISTED */
  784. );
  785. });
  786. var _hoisted_15 = /*#__PURE__*/_withScopeId(function () {
  787. return /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("span", null, "Keluar", -1
  788. /* HOISTED */
  789. );
  790. });
  791. function render(_ctx, _cache, $props, $setup, $data, $options) {
  792. var _directive_styleclass = (0,vue__WEBPACK_IMPORTED_MODULE_0__.resolveDirective)("styleclass");
  793. var _directive_tooltip = (0,vue__WEBPACK_IMPORTED_MODULE_0__.resolveDirective)("tooltip");
  794. return (0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)("div", _hoisted_1, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)($setup["Link"], {
  795. href: "/",
  796. "class": "layout-topbar-logo"
  797. }, {
  798. "default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  799. return [_hoisted_2, _hoisted_3];
  800. }),
  801. _: 1
  802. /* STABLE */
  803. }), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("button", {
  804. "class": "p-link layout-menu-button layout-topbar-button",
  805. onClick: _cache[0] || (_cache[0] = function ($event) {
  806. return _ctx.$emit('menu-toggle', $event);
  807. })
  808. }, _hoisted_5), (0,vue__WEBPACK_IMPORTED_MODULE_0__.withDirectives)(((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)("button", _hoisted_6, _hoisted_8)), [[_directive_styleclass, {
  809. selector: '@next',
  810. enterClass: 'hidden',
  811. enterActiveClass: 'scalein',
  812. leaveToClass: 'hidden',
  813. leaveActiveClass: 'fadeout',
  814. hideOnOutsideClick: true
  815. }]]), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("ul", _hoisted_9, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("li", _hoisted_10, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("span", _hoisted_11, (0,vue__WEBPACK_IMPORTED_MODULE_0__.toDisplayString)(_ctx.$page.props.auth.user.name), 1
  816. /* TEXT */
  817. )]), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("li", null, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.withDirectives)(((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createBlock)($setup["Link"], {
  818. href: _ctx.route('users.show', _ctx.$page.props.auth.user.id),
  819. "class": "p-link layout-topbar-button"
  820. }, {
  821. "default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  822. return [_hoisted_12, _hoisted_13];
  823. }),
  824. _: 1
  825. /* STABLE */
  826. }, 8
  827. /* PROPS */
  828. , ["href"])), [[_directive_tooltip, {
  829. value: 'Ubah Profil',
  830. "class": 'layout-topbar-menu-tooltip'
  831. }, void 0, {
  832. bottom: true
  833. }]])]), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("li", null, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.withDirectives)(((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createBlock)($setup["Link"], {
  834. href: _ctx.route('logout'),
  835. as: "button",
  836. method: "post",
  837. "class": "p-link layout-topbar-button"
  838. }, {
  839. "default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  840. return [_hoisted_14, _hoisted_15];
  841. }),
  842. _: 1
  843. /* STABLE */
  844. }, 8
  845. /* PROPS */
  846. , ["href"])), [[_directive_tooltip, {
  847. value: 'Keluar',
  848. "class": 'layout-topbar-menu-tooltip'
  849. }, void 0, {
  850. bottom: true
  851. }]])])])]);
  852. }
  853. /***/ }),
  854. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/layouts/Dashboard/DashboardLayout.vue?vue&type=template&id=1d279fe2&scoped=true":
  855. /*!********************************************************************************************************************************************************************************************************************************************************************************************************!*\
  856. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/layouts/Dashboard/DashboardLayout.vue?vue&type=template&id=1d279fe2&scoped=true ***!
  857. \********************************************************************************************************************************************************************************************************************************************************************************************************/
  858. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  859. "use strict";
  860. __webpack_require__.r(__webpack_exports__);
  861. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  862. /* harmony export */ "render": () => (/* binding */ render)
  863. /* harmony export */ });
  864. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  865. var _withScopeId = function _withScopeId(n) {
  866. return (0,vue__WEBPACK_IMPORTED_MODULE_0__.pushScopeId)("data-v-1d279fe2"), n = n(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.popScopeId)(), n;
  867. };
  868. var _hoisted_1 = {
  869. "class": "layout-sidebar"
  870. };
  871. var _hoisted_2 = {
  872. "class": "layout-main-container"
  873. };
  874. var _hoisted_3 = {
  875. "class": "layout-main"
  876. };
  877. var _hoisted_4 = {
  878. key: 0,
  879. "class": "layout-mask p-component-overlay"
  880. };
  881. function render(_ctx, _cache, $props, $setup, $data, $options) {
  882. return (0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)(vue__WEBPACK_IMPORTED_MODULE_0__.Fragment, null, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)($setup["Head"], {
  883. title: $props.title
  884. }, null, 8
  885. /* PROPS */
  886. , ["title"]), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("div", {
  887. "class": (0,vue__WEBPACK_IMPORTED_MODULE_0__.normalizeClass)($setup.containerClass),
  888. onClick: $setup.onWrapperClick
  889. }, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)($setup["TopBar"], {
  890. onMenuToggle: $setup.onMenuToggle
  891. }), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("nav", _hoisted_1, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)($setup["Sidebar"], {
  892. menu: $setup.menu[_ctx.$page.props.auth.user.role_id]
  893. }, null, 8
  894. /* PROPS */
  895. , ["menu"])]), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("div", _hoisted_2, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("main", _hoisted_3, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)($setup["AppMessage"]), (0,vue__WEBPACK_IMPORTED_MODULE_0__.renderSlot)(_ctx.$slots, "default", {}, undefined, true)]), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)($setup["Footer"])]), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(vue__WEBPACK_IMPORTED_MODULE_0__.Transition, {
  896. name: "layout-mask"
  897. }, {
  898. "default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  899. return [$setup.mobileMenuActive ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)("div", _hoisted_4)) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true)];
  900. }),
  901. _: 1
  902. /* STABLE */
  903. })], 2
  904. /* CLASS */
  905. )], 64
  906. /* STABLE_FRAGMENT */
  907. );
  908. }
  909. /***/ }),
  910. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/pages/Users/Index.vue?vue&type=template&id=203afd1c":
  911. /*!****************************************************************************************************************************************************************************************************************************************************************************!*\
  912. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/pages/Users/Index.vue?vue&type=template&id=203afd1c ***!
  913. \****************************************************************************************************************************************************************************************************************************************************************************/
  914. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  915. "use strict";
  916. __webpack_require__.r(__webpack_exports__);
  917. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  918. /* harmony export */ "render": () => (/* binding */ render)
  919. /* harmony export */ });
  920. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  921. var _hoisted_1 = /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("h1", null, "User", -1
  922. /* HOISTED */
  923. );
  924. var _hoisted_2 = {
  925. "class": "grid"
  926. };
  927. var _hoisted_3 = {
  928. "class": "col-12 md:col-8"
  929. };
  930. var _hoisted_4 = {
  931. "class": "flex align-items-center"
  932. };
  933. var _hoisted_5 = {
  934. "class": "col-12 md:col-4 flex flex-column md:flex-row justify-content-end"
  935. };
  936. function render(_ctx, _cache, $props, $setup, $data, $options) {
  937. var _component_ConfirmDialog = (0,vue__WEBPACK_IMPORTED_MODULE_0__.resolveComponent)("ConfirmDialog");
  938. var _component_Column = (0,vue__WEBPACK_IMPORTED_MODULE_0__.resolveComponent)("Column");
  939. var _component_Button = (0,vue__WEBPACK_IMPORTED_MODULE_0__.resolveComponent)("Button");
  940. var _component_DataTable = (0,vue__WEBPACK_IMPORTED_MODULE_0__.resolveComponent)("DataTable");
  941. var _directive_tooltip = (0,vue__WEBPACK_IMPORTED_MODULE_0__.resolveDirective)("tooltip");
  942. return (0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createBlock)($setup["DashboardLayout"], {
  943. title: "Daftar User"
  944. }, {
  945. "default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  946. return [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(_component_ConfirmDialog), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(_component_DataTable, {
  947. responsiveLayout: "scroll",
  948. columnResizeMode: "expand",
  949. value: $props.users.data,
  950. rowHover: true,
  951. stripedRows: true
  952. }, {
  953. header: (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  954. return [_hoisted_1, (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("div", _hoisted_2, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("div", _hoisted_3, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("div", _hoisted_4, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)($setup["AppSearch"], {
  955. "class": "w-full md:w-27rem",
  956. placeholder: "cari, contoh: tina",
  957. url: "/users",
  958. initialSearch: $props.initialSearch
  959. }, null, 8
  960. /* PROPS */
  961. , ["initialSearch"])])]), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("div", _hoisted_5, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)($setup["AppButtonLink"], {
  962. label: "Tambah User",
  963. icon: "pi pi-pencil",
  964. "class": "p-button-outlined",
  965. href: _ctx.route('users.create')
  966. }, null, 8
  967. /* PROPS */
  968. , ["href"])])])];
  969. }),
  970. "default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  971. return [((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(true), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)(vue__WEBPACK_IMPORTED_MODULE_0__.Fragment, null, (0,vue__WEBPACK_IMPORTED_MODULE_0__.renderList)($setup.indexTable, function (value) {
  972. return (0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createBlock)(_component_Column, {
  973. field: value.field,
  974. header: value.header,
  975. key: value.field
  976. }, null, 8
  977. /* PROPS */
  978. , ["field", "header"]);
  979. }), 128
  980. /* KEYED_FRAGMENT */
  981. )), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(_component_Column, null, {
  982. body: (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function (_ref) {
  983. var data = _ref.data;
  984. return [(0,vue__WEBPACK_IMPORTED_MODULE_0__.withDirectives)((0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)($setup["AppButtonLink"], {
  985. icon: "pi pi-pencil",
  986. "class": "p-button-icon-only p-button-rounded p-button-text",
  987. href: _ctx.route('users.edit', data.id)
  988. }, null, 8
  989. /* PROPS */
  990. , ["href"]), [[_directive_tooltip, 'Ubah User', void 0, {
  991. bottom: true
  992. }]]), data.role_id !== 1 ? (0,vue__WEBPACK_IMPORTED_MODULE_0__.withDirectives)(((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createBlock)(_component_Button, {
  993. key: 0,
  994. icon: "pi pi-key",
  995. "class": "p-button-icon-only p-button-rounded p-button-text",
  996. onClick: function onClick($event) {
  997. return $setup.onResetPassword(data);
  998. }
  999. }, null, 8
  1000. /* PROPS */
  1001. , ["onClick"])), [[_directive_tooltip, 'Reset Kata Sandi', void 0, {
  1002. bottom: true
  1003. }]]) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true)];
  1004. }),
  1005. _: 1
  1006. /* STABLE */
  1007. })];
  1008. }),
  1009. _: 1
  1010. /* STABLE */
  1011. }, 8
  1012. /* PROPS */
  1013. , ["value"]), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)($setup["AppPagination"], {
  1014. links: $props.users.links
  1015. }, null, 8
  1016. /* PROPS */
  1017. , ["links"])];
  1018. }),
  1019. _: 1
  1020. /* STABLE */
  1021. });
  1022. }
  1023. /***/ }),
  1024. /***/ "./resources/js/pages/Users/config.js":
  1025. /*!********************************************!*\
  1026. !*** ./resources/js/pages/Users/config.js ***!
  1027. \********************************************/
  1028. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  1029. "use strict";
  1030. __webpack_require__.r(__webpack_exports__);
  1031. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  1032. /* harmony export */ "indexTable": () => (/* binding */ indexTable)
  1033. /* harmony export */ });
  1034. var indexTable = [{
  1035. field: 'name',
  1036. header: 'Nama'
  1037. }, {
  1038. field: 'username',
  1039. header: 'Nama Pengguna'
  1040. }, {
  1041. field: 'role',
  1042. header: 'Hak Akses'
  1043. }, {
  1044. field: 'status',
  1045. header: 'Status'
  1046. }];
  1047. /***/ }),
  1048. /***/ "./resources/js/utils/menu.js":
  1049. /*!************************************!*\
  1050. !*** ./resources/js/utils/menu.js ***!
  1051. \************************************/
  1052. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  1053. "use strict";
  1054. __webpack_require__.r(__webpack_exports__);
  1055. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  1056. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  1057. /* harmony export */ });
  1058. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
  1059. // Admin
  1060. 1: [{
  1061. label: 'Home',
  1062. items: [{
  1063. label: 'Dashboard',
  1064. icon: 'pi pi-chart-bar',
  1065. to: '/dashboards',
  1066. component: 'Dashboards/Index'
  1067. }]
  1068. }, {
  1069. label: 'Laporan',
  1070. items: []
  1071. }, {
  1072. label: 'Master',
  1073. items: [{
  1074. label: 'User',
  1075. icon: 'pi pi-user',
  1076. to: '/users',
  1077. component: 'Users/Index'
  1078. }]
  1079. }, {
  1080. label: 'Pengaturan',
  1081. items: [{
  1082. label: 'PPN',
  1083. icon: 'pi pi-percentage',
  1084. to: '/ppn',
  1085. component: 'PPN/Index'
  1086. }]
  1087. }],
  1088. // Supervisor
  1089. 2: [{
  1090. label: 'Home',
  1091. items: [{
  1092. label: 'Dashboard',
  1093. icon: 'pi pi-chart-bar',
  1094. to: '/dashboards',
  1095. component: 'Dashboards/Index'
  1096. }]
  1097. }, {
  1098. label: 'Master',
  1099. items: [{
  1100. label: 'Pelanggan',
  1101. icon: 'pi pi-users',
  1102. to: '/customers',
  1103. component: 'Customers/Index'
  1104. }, {
  1105. label: 'Penjualan',
  1106. icon: 'pi pi-tag',
  1107. to: '/sales',
  1108. component: 'Sales/Index'
  1109. }, {
  1110. label: 'Stok Barang',
  1111. icon: 'pi pi-box',
  1112. to: '/stock-products',
  1113. component: 'StockProducts/Index'
  1114. }]
  1115. }],
  1116. // Operator
  1117. 3: [{
  1118. label: 'Home',
  1119. items: [{
  1120. label: 'Dashboard',
  1121. icon: 'pi pi-chart-bar',
  1122. to: '/dashboards',
  1123. component: 'Dashboards/Index'
  1124. }]
  1125. }, {
  1126. label: 'Master',
  1127. items: [{
  1128. label: 'Supplier',
  1129. icon: 'pi pi-shopping-cart',
  1130. to: '/suppliers',
  1131. component: 'Suppliers/Index'
  1132. }, {
  1133. label: 'Produk',
  1134. icon: 'pi pi-th-large',
  1135. to: '/products',
  1136. component: 'Products/Index'
  1137. }, {
  1138. label: 'Pembelian',
  1139. icon: 'pi pi-shopping-cart',
  1140. to: '/purchases',
  1141. component: 'Purchases/Index'
  1142. }, {
  1143. label: 'Stok Barang',
  1144. icon: 'pi pi-box',
  1145. to: '/stock-products',
  1146. component: 'StockProducts/Index'
  1147. }]
  1148. }]
  1149. });
  1150. /***/ }),
  1151. /***/ "./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/layouts/Dashboard/Components/Sidebar.vue?vue&type=style&index=0&id=5b49aa22&lang=scss&scoped=true":
  1152. /*!***************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  1153. !*** ./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/layouts/Dashboard/Components/Sidebar.vue?vue&type=style&index=0&id=5b49aa22&lang=scss&scoped=true ***!
  1154. \***************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  1155. /***/ ((module, __webpack_exports__, __webpack_require__) => {
  1156. "use strict";
  1157. __webpack_require__.r(__webpack_exports__);
  1158. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  1159. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  1160. /* harmony export */ });
  1161. /* 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");
  1162. /* 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__);
  1163. // Imports
  1164. var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_0___default()(function(i){return i[1]});
  1165. // Module
  1166. ___CSS_LOADER_EXPORT___.push([module.id, ".layout-menu[data-v-5b49aa22] {\n list-style-type: none;\n margin: 0;\n padding: 0;\n}", ""]);
  1167. // Exports
  1168. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);
  1169. /***/ }),
  1170. /***/ "./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/layouts/Dashboard/Components/SubSidebar.vue?vue&type=style&index=0&id=b1b23eb4&lang=scss&scoped=true":
  1171. /*!******************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  1172. !*** ./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/layouts/Dashboard/Components/SubSidebar.vue?vue&type=style&index=0&id=b1b23eb4&lang=scss&scoped=true ***!
  1173. \******************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  1174. /***/ ((module, __webpack_exports__, __webpack_require__) => {
  1175. "use strict";
  1176. __webpack_require__.r(__webpack_exports__);
  1177. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  1178. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  1179. /* harmony export */ });
  1180. /* 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");
  1181. /* 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__);
  1182. // Imports
  1183. var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_0___default()(function(i){return i[1]});
  1184. // Module
  1185. ___CSS_LOADER_EXPORT___.push([module.id, "li.layout-menuitem-category[data-v-b1b23eb4] {\n margin-top: 0.75rem;\n}\nli.layout-menuitem-category[data-v-b1b23eb4]:first-child {\n margin-top: 0;\n}\nli .layout-menuitem-root-text[data-v-b1b23eb4] {\n text-transform: uppercase;\n color: var(--surface-900);\n font-weight: 600;\n margin-bottom: 0.5rem;\n font-size: 0.875rem;\n}\nli a[data-v-b1b23eb4] {\n cursor: pointer;\n text-decoration: none;\n display: flex;\n align-items: center;\n color: var(--text-color);\n transition: color 0.2s;\n border-radius: 12px;\n padding: 0.75rem 1rem;\n transition: background-color 0.15s;\n}\nli a span[data-v-b1b23eb4] {\n margin-left: 0.5rem;\n}\nli a .menuitem-toggle-icon[data-v-b1b23eb4] {\n margin-left: auto;\n}\nli a[data-v-b1b23eb4]:focus {\n outline: 0 none;\n outline-offset: 0;\n transition: box-shadow 0.2s;\n box-shadow: inset var(--focus-ring);\n}\nli a[data-v-b1b23eb4]:hover {\n background-color: var(--surface-hover);\n}\nli a.router-link-exact-active[data-v-b1b23eb4] {\n font-weight: 700;\n color: var(--primary-color);\n}\nli ul[data-v-b1b23eb4] {\n list-style-type: none;\n margin: 0;\n padding: 0;\n}\nli ul ul[data-v-b1b23eb4] {\n padding-left: 1rem;\n}", ""]);
  1186. // Exports
  1187. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);
  1188. /***/ }),
  1189. /***/ "./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/layouts/Dashboard/Components/TopBar.vue?vue&type=style&index=0&id=0b7edbb0&lang=scss&scoped=true":
  1190. /*!**************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  1191. !*** ./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/layouts/Dashboard/Components/TopBar.vue?vue&type=style&index=0&id=0b7edbb0&lang=scss&scoped=true ***!
  1192. \**************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  1193. /***/ ((module, __webpack_exports__, __webpack_require__) => {
  1194. "use strict";
  1195. __webpack_require__.r(__webpack_exports__);
  1196. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  1197. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  1198. /* harmony export */ });
  1199. /* 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");
  1200. /* 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__);
  1201. // Imports
  1202. var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_0___default()(function(i){return i[1]});
  1203. // Module
  1204. ___CSS_LOADER_EXPORT___.push([module.id, ".layout-topbar[data-v-0b7edbb0] {\n position: fixed;\n height: 5rem;\n z-index: 994;\n left: 0;\n top: 0;\n width: 100%;\n padding: 0 2rem;\n background-color: var(--surface-card);\n transition: left 0.2s;\n display: flex;\n align-items: center;\n box-shadow: 0px 3px 5px rgba(0, 0, 0, 0.02), 0px 0px 2px rgba(0, 0, 0, 0.05), 0px 1px 4px rgba(0, 0, 0, 0.08);\n}\n.layout-topbar .layout-topbar-logo[data-v-0b7edbb0] {\n display: flex;\n align-items: center;\n color: var(--surface-900);\n font-size: 1.5rem;\n font-weight: 500;\n width: 300px;\n border-radius: 12px;\n}\n.layout-topbar .layout-topbar-logo img[data-v-0b7edbb0] {\n height: 2.5rem;\n margin-right: 0.5rem;\n}\n.layout-topbar .layout-topbar-logo[data-v-0b7edbb0]:focus {\n outline: 0 none;\n outline-offset: 0;\n transition: box-shadow 0.2s;\n box-shadow: var(--focus-ring);\n}\n.layout-topbar .layout-topbar-button[data-v-0b7edbb0] {\n display: inline-flex;\n justify-content: center;\n align-items: center;\n position: relative;\n color: var(--text-color-secondary);\n border-radius: 50%;\n width: 3rem;\n height: 3rem;\n cursor: pointer;\n transition: background-color 0.2s;\n}\n.layout-topbar .layout-topbar-button[data-v-0b7edbb0]:hover {\n color: var(--text-color);\n background-color: var(--surface-hover);\n}\n.layout-topbar .layout-topbar-button[data-v-0b7edbb0]:focus {\n outline: 0 none;\n outline-offset: 0;\n transition: box-shadow 0.2s;\n box-shadow: var(--focus-ring);\n}\n.layout-topbar .layout-topbar-button i[data-v-0b7edbb0] {\n font-size: 1.5rem;\n}\n.layout-topbar .layout-topbar-button span[data-v-0b7edbb0] {\n font-size: 1rem;\n display: none;\n}\n.layout-topbar .layout-menu-button[data-v-0b7edbb0] {\n margin-left: 2rem;\n}\n.layout-topbar .layout-topbar-menu-button[data-v-0b7edbb0] {\n display: none;\n}\n.layout-topbar .layout-topbar-menu-button i[data-v-0b7edbb0] {\n font-size: 1.25rem;\n}\n.layout-topbar .layout-topbar-menu[data-v-0b7edbb0] {\n margin: 0 0 0 auto;\n padding: 0;\n list-style: none;\n display: flex;\n}\n.layout-topbar .layout-topbar-menu .layout-topbar-button[data-v-0b7edbb0] {\n margin-left: 1rem;\n}\n@media (max-width: 991px) {\n.layout-topbar[data-v-0b7edbb0] {\n justify-content: space-between;\n}\n.layout-topbar .layout-topbar-logo[data-v-0b7edbb0] {\n width: auto;\n order: 2;\n}\n.layout-topbar .layout-menu-button[data-v-0b7edbb0] {\n margin-left: 0;\n order: 1;\n}\n.layout-topbar .layout-topbar-menu-button[data-v-0b7edbb0] {\n display: inline-flex;\n margin-left: 0;\n order: 3;\n}\n.layout-topbar .layout-topbar-menu[data-v-0b7edbb0] {\n margin-left: 0;\n position: absolute;\n flex-direction: column;\n background-color: var(--surface-overlay);\n box-shadow: 0px 3px 5px rgba(0, 0, 0, 0.02), 0px 0px 2px rgba(0, 0, 0, 0.05), 0px 1px 4px rgba(0, 0, 0, 0.08);\n border-radius: 4px;\n padding: 1rem;\n right: 2rem;\n top: 5.5rem;\n min-width: 15rem;\n}\n.layout-topbar .layout-topbar-menu .layout-topbar-button[data-v-0b7edbb0] {\n margin-left: 0;\n display: flex;\n width: 100%;\n height: auto;\n justify-content: flex-start;\n border-radius: 12px;\n padding: 1rem;\n}\n.layout-topbar .layout-topbar-menu .layout-topbar-button i[data-v-0b7edbb0] {\n font-size: 1rem;\n margin-right: 0.5rem;\n}\n.layout-topbar .layout-topbar-menu .layout-topbar-button span[data-v-0b7edbb0] {\n font-weight: medium;\n display: block;\n}\n}", ""]);
  1205. // Exports
  1206. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);
  1207. /***/ }),
  1208. /***/ "./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/layouts/Dashboard/DashboardLayout.vue?vue&type=style&index=0&id=1d279fe2&lang=scss&scoped=true":
  1209. /*!************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  1210. !*** ./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/layouts/Dashboard/DashboardLayout.vue?vue&type=style&index=0&id=1d279fe2&lang=scss&scoped=true ***!
  1211. \************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  1212. /***/ ((module, __webpack_exports__, __webpack_require__) => {
  1213. "use strict";
  1214. __webpack_require__.r(__webpack_exports__);
  1215. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  1216. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  1217. /* harmony export */ });
  1218. /* 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");
  1219. /* 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__);
  1220. // Imports
  1221. var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_0___default()(function(i){return i[1]});
  1222. // Module
  1223. ___CSS_LOADER_EXPORT___.push([module.id, ".layout-sidebar[data-v-1d279fe2] {\n position: fixed;\n width: 300px;\n height: calc(100vh - 9rem);\n z-index: 996;\n overflow-y: auto;\n -webkit-user-select: none;\n -moz-user-select: none;\n -ms-user-select: none;\n user-select: none;\n top: 7rem;\n left: 2rem;\n transition: transform 0.2s, left 0.2s;\n background-color: var(--surface-overlay);\n border-radius: 4px;\n padding: 1.5rem;\n box-shadow: 0px 3px 5px rgba(0, 0, 0, 0.02), 0px 0px 2px rgba(0, 0, 0, 0.05), 0px 1px 4px rgba(0, 0, 0, 0.08);\n}\n.layout-main-container[data-v-1d279fe2] {\n display: flex;\n flex-direction: column;\n min-height: 100vh;\n justify-content: space-between;\n padding: 7rem 2rem 2rem 4rem;\n transition: margin-left 0.2s;\n}\n.layout-main[data-v-1d279fe2] {\n flex: 1 1 auto;\n}\n.layout-footer[data-v-1d279fe2] {\n transition: margin-left 0.2s;\n display: flex;\n align-items: center;\n justify-content: center;\n padding-top: 1rem;\n border-top: 1px solid var(--surface-border);\n}\n@media (min-width: 992px) {\n.layout-wrapper .layout-main-container[data-v-1d279fe2] {\n margin-left: 300px;\n}\n.layout-wrapper.layout-static-sidebar-inactive .layout-sidebar[data-v-1d279fe2] {\n transform: translateX(-100%);\n left: 0;\n}\n.layout-wrapper.layout-static-sidebar-inactive .layout-main-container[data-v-1d279fe2] {\n margin-left: 0;\n padding-left: 2rem;\n}\n.layout-wrapper .layout-mask[data-v-1d279fe2] {\n display: none;\n}\n}\n@media (max-width: 991px) {\n.layout-wrapper .layout-main-container[data-v-1d279fe2] {\n margin-left: 0;\n padding-left: 2rem;\n}\n.layout-wrapper .layout-sidebar[data-v-1d279fe2] {\n transform: translateX(-100%);\n left: 0;\n top: 0;\n height: 100vh;\n border-top-left-radius: 0;\n border-bottom-left-radius: 0;\n}\n.layout-wrapper .layout-mask[data-v-1d279fe2] {\n z-index: 995;\n background-color: var(--maskbg);\n}\n.layout-wrapper .layout-mask.layout-mask-enter-from[data-v-1d279fe2], .layout-wrapper .layout-mask.layout-mask-leave-to[data-v-1d279fe2] {\n background-color: transparent;\n}\n.layout-wrapper.layout-mobile-sidebar-active .layout-sidebar[data-v-1d279fe2] {\n transform: translateX(0);\n}\n.layout-wrapper.layout-mobile-sidebar-active .layout-mask[data-v-1d279fe2] {\n display: block;\n}\n}", ""]);
  1224. // Exports
  1225. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);
  1226. /***/ }),
  1227. /***/ "./node_modules/lodash/lodash.js":
  1228. /*!***************************************!*\
  1229. !*** ./node_modules/lodash/lodash.js ***!
  1230. \***************************************/
  1231. /***/ (function(module, exports, __webpack_require__) {
  1232. /* module decorator */ module = __webpack_require__.nmd(module);
  1233. var __WEBPACK_AMD_DEFINE_RESULT__;/**
  1234. * @license
  1235. * Lodash <https://lodash.com/>
  1236. * Copyright OpenJS Foundation and other contributors <https://openjsf.org/>
  1237. * Released under MIT license <https://lodash.com/license>
  1238. * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
  1239. * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
  1240. */
  1241. ;(function() {
  1242. /** Used as a safe reference for `undefined` in pre-ES5 environments. */
  1243. var undefined;
  1244. /** Used as the semantic version number. */
  1245. var VERSION = '4.17.21';
  1246. /** Used as the size to enable large array optimizations. */
  1247. var LARGE_ARRAY_SIZE = 200;
  1248. /** Error message constants. */
  1249. var CORE_ERROR_TEXT = 'Unsupported core-js use. Try https://npms.io/search?q=ponyfill.',
  1250. FUNC_ERROR_TEXT = 'Expected a function',
  1251. INVALID_TEMPL_VAR_ERROR_TEXT = 'Invalid `variable` option passed into `_.template`';
  1252. /** Used to stand-in for `undefined` hash values. */
  1253. var HASH_UNDEFINED = '__lodash_hash_undefined__';
  1254. /** Used as the maximum memoize cache size. */
  1255. var MAX_MEMOIZE_SIZE = 500;
  1256. /** Used as the internal argument placeholder. */
  1257. var PLACEHOLDER = '__lodash_placeholder__';
  1258. /** Used to compose bitmasks for cloning. */
  1259. var CLONE_DEEP_FLAG = 1,
  1260. CLONE_FLAT_FLAG = 2,
  1261. CLONE_SYMBOLS_FLAG = 4;
  1262. /** Used to compose bitmasks for value comparisons. */
  1263. var COMPARE_PARTIAL_FLAG = 1,
  1264. COMPARE_UNORDERED_FLAG = 2;
  1265. /** Used to compose bitmasks for function metadata. */
  1266. var WRAP_BIND_FLAG = 1,
  1267. WRAP_BIND_KEY_FLAG = 2,
  1268. WRAP_CURRY_BOUND_FLAG = 4,
  1269. WRAP_CURRY_FLAG = 8,
  1270. WRAP_CURRY_RIGHT_FLAG = 16,
  1271. WRAP_PARTIAL_FLAG = 32,
  1272. WRAP_PARTIAL_RIGHT_FLAG = 64,
  1273. WRAP_ARY_FLAG = 128,
  1274. WRAP_REARG_FLAG = 256,
  1275. WRAP_FLIP_FLAG = 512;
  1276. /** Used as default options for `_.truncate`. */
  1277. var DEFAULT_TRUNC_LENGTH = 30,
  1278. DEFAULT_TRUNC_OMISSION = '...';
  1279. /** Used to detect hot functions by number of calls within a span of milliseconds. */
  1280. var HOT_COUNT = 800,
  1281. HOT_SPAN = 16;
  1282. /** Used to indicate the type of lazy iteratees. */
  1283. var LAZY_FILTER_FLAG = 1,
  1284. LAZY_MAP_FLAG = 2,
  1285. LAZY_WHILE_FLAG = 3;
  1286. /** Used as references for various `Number` constants. */
  1287. var INFINITY = 1 / 0,
  1288. MAX_SAFE_INTEGER = 9007199254740991,
  1289. MAX_INTEGER = 1.7976931348623157e+308,
  1290. NAN = 0 / 0;
  1291. /** Used as references for the maximum length and index of an array. */
  1292. var MAX_ARRAY_LENGTH = 4294967295,
  1293. MAX_ARRAY_INDEX = MAX_ARRAY_LENGTH - 1,
  1294. HALF_MAX_ARRAY_LENGTH = MAX_ARRAY_LENGTH >>> 1;
  1295. /** Used to associate wrap methods with their bit flags. */
  1296. var wrapFlags = [
  1297. ['ary', WRAP_ARY_FLAG],
  1298. ['bind', WRAP_BIND_FLAG],
  1299. ['bindKey', WRAP_BIND_KEY_FLAG],
  1300. ['curry', WRAP_CURRY_FLAG],
  1301. ['curryRight', WRAP_CURRY_RIGHT_FLAG],
  1302. ['flip', WRAP_FLIP_FLAG],
  1303. ['partial', WRAP_PARTIAL_FLAG],
  1304. ['partialRight', WRAP_PARTIAL_RIGHT_FLAG],
  1305. ['rearg', WRAP_REARG_FLAG]
  1306. ];
  1307. /** `Object#toString` result references. */
  1308. var argsTag = '[object Arguments]',
  1309. arrayTag = '[object Array]',
  1310. asyncTag = '[object AsyncFunction]',
  1311. boolTag = '[object Boolean]',
  1312. dateTag = '[object Date]',
  1313. domExcTag = '[object DOMException]',
  1314. errorTag = '[object Error]',
  1315. funcTag = '[object Function]',
  1316. genTag = '[object GeneratorFunction]',
  1317. mapTag = '[object Map]',
  1318. numberTag = '[object Number]',
  1319. nullTag = '[object Null]',
  1320. objectTag = '[object Object]',
  1321. promiseTag = '[object Promise]',
  1322. proxyTag = '[object Proxy]',
  1323. regexpTag = '[object RegExp]',
  1324. setTag = '[object Set]',
  1325. stringTag = '[object String]',
  1326. symbolTag = '[object Symbol]',
  1327. undefinedTag = '[object Undefined]',
  1328. weakMapTag = '[object WeakMap]',
  1329. weakSetTag = '[object WeakSet]';
  1330. var arrayBufferTag = '[object ArrayBuffer]',
  1331. dataViewTag = '[object DataView]',
  1332. float32Tag = '[object Float32Array]',
  1333. float64Tag = '[object Float64Array]',
  1334. int8Tag = '[object Int8Array]',
  1335. int16Tag = '[object Int16Array]',
  1336. int32Tag = '[object Int32Array]',
  1337. uint8Tag = '[object Uint8Array]',
  1338. uint8ClampedTag = '[object Uint8ClampedArray]',
  1339. uint16Tag = '[object Uint16Array]',
  1340. uint32Tag = '[object Uint32Array]';
  1341. /** Used to match empty string literals in compiled template source. */
  1342. var reEmptyStringLeading = /\b__p \+= '';/g,
  1343. reEmptyStringMiddle = /\b(__p \+=) '' \+/g,
  1344. reEmptyStringTrailing = /(__e\(.*?\)|\b__t\)) \+\n'';/g;
  1345. /** Used to match HTML entities and HTML characters. */
  1346. var reEscapedHtml = /&(?:amp|lt|gt|quot|#39);/g,
  1347. reUnescapedHtml = /[&<>"']/g,
  1348. reHasEscapedHtml = RegExp(reEscapedHtml.source),
  1349. reHasUnescapedHtml = RegExp(reUnescapedHtml.source);
  1350. /** Used to match template delimiters. */
  1351. var reEscape = /<%-([\s\S]+?)%>/g,
  1352. reEvaluate = /<%([\s\S]+?)%>/g,
  1353. reInterpolate = /<%=([\s\S]+?)%>/g;
  1354. /** Used to match property names within property paths. */
  1355. var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,
  1356. reIsPlainProp = /^\w*$/,
  1357. rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g;
  1358. /**
  1359. * Used to match `RegExp`
  1360. * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).
  1361. */
  1362. var reRegExpChar = /[\\^$.*+?()[\]{}|]/g,
  1363. reHasRegExpChar = RegExp(reRegExpChar.source);
  1364. /** Used to match leading whitespace. */
  1365. var reTrimStart = /^\s+/;
  1366. /** Used to match a single whitespace character. */
  1367. var reWhitespace = /\s/;
  1368. /** Used to match wrap detail comments. */
  1369. var reWrapComment = /\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,
  1370. reWrapDetails = /\{\n\/\* \[wrapped with (.+)\] \*/,
  1371. reSplitDetails = /,? & /;
  1372. /** Used to match words composed of alphanumeric characters. */
  1373. var reAsciiWord = /[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;
  1374. /**
  1375. * Used to validate the `validate` option in `_.template` variable.
  1376. *
  1377. * Forbids characters which could potentially change the meaning of the function argument definition:
  1378. * - "()," (modification of function parameters)
  1379. * - "=" (default value)
  1380. * - "[]{}" (destructuring of function parameters)
  1381. * - "/" (beginning of a comment)
  1382. * - whitespace
  1383. */
  1384. var reForbiddenIdentifierChars = /[()=,{}\[\]\/\s]/;
  1385. /** Used to match backslashes in property paths. */
  1386. var reEscapeChar = /\\(\\)?/g;
  1387. /**
  1388. * Used to match
  1389. * [ES template delimiters](http://ecma-international.org/ecma-262/7.0/#sec-template-literal-lexical-components).
  1390. */
  1391. var reEsTemplate = /\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g;
  1392. /** Used to match `RegExp` flags from their coerced string values. */
  1393. var reFlags = /\w*$/;
  1394. /** Used to detect bad signed hexadecimal string values. */
  1395. var reIsBadHex = /^[-+]0x[0-9a-f]+$/i;
  1396. /** Used to detect binary string values. */
  1397. var reIsBinary = /^0b[01]+$/i;
  1398. /** Used to detect host constructors (Safari). */
  1399. var reIsHostCtor = /^\[object .+?Constructor\]$/;
  1400. /** Used to detect octal string values. */
  1401. var reIsOctal = /^0o[0-7]+$/i;
  1402. /** Used to detect unsigned integer values. */
  1403. var reIsUint = /^(?:0|[1-9]\d*)$/;
  1404. /** Used to match Latin Unicode letters (excluding mathematical operators). */
  1405. var reLatin = /[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g;
  1406. /** Used to ensure capturing order of template delimiters. */
  1407. var reNoMatch = /($^)/;
  1408. /** Used to match unescaped characters in compiled string literals. */
  1409. var reUnescapedString = /['\n\r\u2028\u2029\\]/g;
  1410. /** Used to compose unicode character classes. */
  1411. var rsAstralRange = '\\ud800-\\udfff',
  1412. rsComboMarksRange = '\\u0300-\\u036f',
  1413. reComboHalfMarksRange = '\\ufe20-\\ufe2f',
  1414. rsComboSymbolsRange = '\\u20d0-\\u20ff',
  1415. rsComboRange = rsComboMarksRange + reComboHalfMarksRange + rsComboSymbolsRange,
  1416. rsDingbatRange = '\\u2700-\\u27bf',
  1417. rsLowerRange = 'a-z\\xdf-\\xf6\\xf8-\\xff',
  1418. rsMathOpRange = '\\xac\\xb1\\xd7\\xf7',
  1419. rsNonCharRange = '\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf',
  1420. rsPunctuationRange = '\\u2000-\\u206f',
  1421. 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',
  1422. rsUpperRange = 'A-Z\\xc0-\\xd6\\xd8-\\xde',
  1423. rsVarRange = '\\ufe0e\\ufe0f',
  1424. rsBreakRange = rsMathOpRange + rsNonCharRange + rsPunctuationRange + rsSpaceRange;
  1425. /** Used to compose unicode capture groups. */
  1426. var rsApos = "['\u2019]",
  1427. rsAstral = '[' + rsAstralRange + ']',
  1428. rsBreak = '[' + rsBreakRange + ']',
  1429. rsCombo = '[' + rsComboRange + ']',
  1430. rsDigits = '\\d+',
  1431. rsDingbat = '[' + rsDingbatRange + ']',
  1432. rsLower = '[' + rsLowerRange + ']',
  1433. rsMisc = '[^' + rsAstralRange + rsBreakRange + rsDigits + rsDingbatRange + rsLowerRange + rsUpperRange + ']',
  1434. rsFitz = '\\ud83c[\\udffb-\\udfff]',
  1435. rsModifier = '(?:' + rsCombo + '|' + rsFitz + ')',
  1436. rsNonAstral = '[^' + rsAstralRange + ']',
  1437. rsRegional = '(?:\\ud83c[\\udde6-\\uddff]){2}',
  1438. rsSurrPair = '[\\ud800-\\udbff][\\udc00-\\udfff]',
  1439. rsUpper = '[' + rsUpperRange + ']',
  1440. rsZWJ = '\\u200d';
  1441. /** Used to compose unicode regexes. */
  1442. var rsMiscLower = '(?:' + rsLower + '|' + rsMisc + ')',
  1443. rsMiscUpper = '(?:' + rsUpper + '|' + rsMisc + ')',
  1444. rsOptContrLower = '(?:' + rsApos + '(?:d|ll|m|re|s|t|ve))?',
  1445. rsOptContrUpper = '(?:' + rsApos + '(?:D|LL|M|RE|S|T|VE))?',
  1446. reOptMod = rsModifier + '?',
  1447. rsOptVar = '[' + rsVarRange + ']?',
  1448. rsOptJoin = '(?:' + rsZWJ + '(?:' + [rsNonAstral, rsRegional, rsSurrPair].join('|') + ')' + rsOptVar + reOptMod + ')*',
  1449. rsOrdLower = '\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])',
  1450. rsOrdUpper = '\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])',
  1451. rsSeq = rsOptVar + reOptMod + rsOptJoin,
  1452. rsEmoji = '(?:' + [rsDingbat, rsRegional, rsSurrPair].join('|') + ')' + rsSeq,
  1453. rsSymbol = '(?:' + [rsNonAstral + rsCombo + '?', rsCombo, rsRegional, rsSurrPair, rsAstral].join('|') + ')';
  1454. /** Used to match apostrophes. */
  1455. var reApos = RegExp(rsApos, 'g');
  1456. /**
  1457. * Used to match [combining diacritical marks](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks) and
  1458. * [combining diacritical marks for symbols](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks_for_Symbols).
  1459. */
  1460. var reComboMark = RegExp(rsCombo, 'g');
  1461. /** Used to match [string symbols](https://mathiasbynens.be/notes/javascript-unicode). */
  1462. var reUnicode = RegExp(rsFitz + '(?=' + rsFitz + ')|' + rsSymbol + rsSeq, 'g');
  1463. /** Used to match complex or compound words. */
  1464. var reUnicodeWord = RegExp([
  1465. rsUpper + '?' + rsLower + '+' + rsOptContrLower + '(?=' + [rsBreak, rsUpper, '$'].join('|') + ')',
  1466. rsMiscUpper + '+' + rsOptContrUpper + '(?=' + [rsBreak, rsUpper + rsMiscLower, '$'].join('|') + ')',
  1467. rsUpper + '?' + rsMiscLower + '+' + rsOptContrLower,
  1468. rsUpper + '+' + rsOptContrUpper,
  1469. rsOrdUpper,
  1470. rsOrdLower,
  1471. rsDigits,
  1472. rsEmoji
  1473. ].join('|'), 'g');
  1474. /** 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/). */
  1475. var reHasUnicode = RegExp('[' + rsZWJ + rsAstralRange + rsComboRange + rsVarRange + ']');
  1476. /** Used to detect strings that need a more robust regexp to match words. */
  1477. 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 ]/;
  1478. /** Used to assign default `context` object properties. */
  1479. var contextProps = [
  1480. 'Array', 'Buffer', 'DataView', 'Date', 'Error', 'Float32Array', 'Float64Array',
  1481. 'Function', 'Int8Array', 'Int16Array', 'Int32Array', 'Map', 'Math', 'Object',
  1482. 'Promise', 'RegExp', 'Set', 'String', 'Symbol', 'TypeError', 'Uint8Array',
  1483. 'Uint8ClampedArray', 'Uint16Array', 'Uint32Array', 'WeakMap',
  1484. '_', 'clearTimeout', 'isFinite', 'parseInt', 'setTimeout'
  1485. ];
  1486. /** Used to make template sourceURLs easier to identify. */
  1487. var templateCounter = -1;
  1488. /** Used to identify `toStringTag` values of typed arrays. */
  1489. var typedArrayTags = {};
  1490. typedArrayTags[float32Tag] = typedArrayTags[float64Tag] =
  1491. typedArrayTags[int8Tag] = typedArrayTags[int16Tag] =
  1492. typedArrayTags[int32Tag] = typedArrayTags[uint8Tag] =
  1493. typedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] =
  1494. typedArrayTags[uint32Tag] = true;
  1495. typedArrayTags[argsTag] = typedArrayTags[arrayTag] =
  1496. typedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] =
  1497. typedArrayTags[dataViewTag] = typedArrayTags[dateTag] =
  1498. typedArrayTags[errorTag] = typedArrayTags[funcTag] =
  1499. typedArrayTags[mapTag] = typedArrayTags[numberTag] =
  1500. typedArrayTags[objectTag] = typedArrayTags[regexpTag] =
  1501. typedArrayTags[setTag] = typedArrayTags[stringTag] =
  1502. typedArrayTags[weakMapTag] = false;
  1503. /** Used to identify `toStringTag` values supported by `_.clone`. */
  1504. var cloneableTags = {};
  1505. cloneableTags[argsTag] = cloneableTags[arrayTag] =
  1506. cloneableTags[arrayBufferTag] = cloneableTags[dataViewTag] =
  1507. cloneableTags[boolTag] = cloneableTags[dateTag] =
  1508. cloneableTags[float32Tag] = cloneableTags[float64Tag] =
  1509. cloneableTags[int8Tag] = cloneableTags[int16Tag] =
  1510. cloneableTags[int32Tag] = cloneableTags[mapTag] =
  1511. cloneableTags[numberTag] = cloneableTags[objectTag] =
  1512. cloneableTags[regexpTag] = cloneableTags[setTag] =
  1513. cloneableTags[stringTag] = cloneableTags[symbolTag] =
  1514. cloneableTags[uint8Tag] = cloneableTags[uint8ClampedTag] =
  1515. cloneableTags[uint16Tag] = cloneableTags[uint32Tag] = true;
  1516. cloneableTags[errorTag] = cloneableTags[funcTag] =
  1517. cloneableTags[weakMapTag] = false;
  1518. /** Used to map Latin Unicode letters to basic Latin letters. */
  1519. var deburredLetters = {
  1520. // Latin-1 Supplement block.
  1521. '\xc0': 'A', '\xc1': 'A', '\xc2': 'A', '\xc3': 'A', '\xc4': 'A', '\xc5': 'A',
  1522. '\xe0': 'a', '\xe1': 'a', '\xe2': 'a', '\xe3': 'a', '\xe4': 'a', '\xe5': 'a',
  1523. '\xc7': 'C', '\xe7': 'c',
  1524. '\xd0': 'D', '\xf0': 'd',
  1525. '\xc8': 'E', '\xc9': 'E', '\xca': 'E', '\xcb': 'E',
  1526. '\xe8': 'e', '\xe9': 'e', '\xea': 'e', '\xeb': 'e',
  1527. '\xcc': 'I', '\xcd': 'I', '\xce': 'I', '\xcf': 'I',
  1528. '\xec': 'i', '\xed': 'i', '\xee': 'i', '\xef': 'i',
  1529. '\xd1': 'N', '\xf1': 'n',
  1530. '\xd2': 'O', '\xd3': 'O', '\xd4': 'O', '\xd5': 'O', '\xd6': 'O', '\xd8': 'O',
  1531. '\xf2': 'o', '\xf3': 'o', '\xf4': 'o', '\xf5': 'o', '\xf6': 'o', '\xf8': 'o',
  1532. '\xd9': 'U', '\xda': 'U', '\xdb': 'U', '\xdc': 'U',
  1533. '\xf9': 'u', '\xfa': 'u', '\xfb': 'u', '\xfc': 'u',
  1534. '\xdd': 'Y', '\xfd': 'y', '\xff': 'y',
  1535. '\xc6': 'Ae', '\xe6': 'ae',
  1536. '\xde': 'Th', '\xfe': 'th',
  1537. '\xdf': 'ss',
  1538. // Latin Extended-A block.
  1539. '\u0100': 'A', '\u0102': 'A', '\u0104': 'A',
  1540. '\u0101': 'a', '\u0103': 'a', '\u0105': 'a',
  1541. '\u0106': 'C', '\u0108': 'C', '\u010a': 'C', '\u010c': 'C',
  1542. '\u0107': 'c', '\u0109': 'c', '\u010b': 'c', '\u010d': 'c',
  1543. '\u010e': 'D', '\u0110': 'D', '\u010f': 'd', '\u0111': 'd',
  1544. '\u0112': 'E', '\u0114': 'E', '\u0116': 'E', '\u0118': 'E', '\u011a': 'E',
  1545. '\u0113': 'e', '\u0115': 'e', '\u0117': 'e', '\u0119': 'e', '\u011b': 'e',
  1546. '\u011c': 'G', '\u011e': 'G', '\u0120': 'G', '\u0122': 'G',
  1547. '\u011d': 'g', '\u011f': 'g', '\u0121': 'g', '\u0123': 'g',
  1548. '\u0124': 'H', '\u0126': 'H', '\u0125': 'h', '\u0127': 'h',
  1549. '\u0128': 'I', '\u012a': 'I', '\u012c': 'I', '\u012e': 'I', '\u0130': 'I',
  1550. '\u0129': 'i', '\u012b': 'i', '\u012d': 'i', '\u012f': 'i', '\u0131': 'i',
  1551. '\u0134': 'J', '\u0135': 'j',
  1552. '\u0136': 'K', '\u0137': 'k', '\u0138': 'k',
  1553. '\u0139': 'L', '\u013b': 'L', '\u013d': 'L', '\u013f': 'L', '\u0141': 'L',
  1554. '\u013a': 'l', '\u013c': 'l', '\u013e': 'l', '\u0140': 'l', '\u0142': 'l',
  1555. '\u0143': 'N', '\u0145': 'N', '\u0147': 'N', '\u014a': 'N',
  1556. '\u0144': 'n', '\u0146': 'n', '\u0148': 'n', '\u014b': 'n',
  1557. '\u014c': 'O', '\u014e': 'O', '\u0150': 'O',
  1558. '\u014d': 'o', '\u014f': 'o', '\u0151': 'o',
  1559. '\u0154': 'R', '\u0156': 'R', '\u0158': 'R',
  1560. '\u0155': 'r', '\u0157': 'r', '\u0159': 'r',
  1561. '\u015a': 'S', '\u015c': 'S', '\u015e': 'S', '\u0160': 'S',
  1562. '\u015b': 's', '\u015d': 's', '\u015f': 's', '\u0161': 's',
  1563. '\u0162': 'T', '\u0164': 'T', '\u0166': 'T',
  1564. '\u0163': 't', '\u0165': 't', '\u0167': 't',
  1565. '\u0168': 'U', '\u016a': 'U', '\u016c': 'U', '\u016e': 'U', '\u0170': 'U', '\u0172': 'U',
  1566. '\u0169': 'u', '\u016b': 'u', '\u016d': 'u', '\u016f': 'u', '\u0171': 'u', '\u0173': 'u',
  1567. '\u0174': 'W', '\u0175': 'w',
  1568. '\u0176': 'Y', '\u0177': 'y', '\u0178': 'Y',
  1569. '\u0179': 'Z', '\u017b': 'Z', '\u017d': 'Z',
  1570. '\u017a': 'z', '\u017c': 'z', '\u017e': 'z',
  1571. '\u0132': 'IJ', '\u0133': 'ij',
  1572. '\u0152': 'Oe', '\u0153': 'oe',
  1573. '\u0149': "'n", '\u017f': 's'
  1574. };
  1575. /** Used to map characters to HTML entities. */
  1576. var htmlEscapes = {
  1577. '&': '&amp;',
  1578. '<': '&lt;',
  1579. '>': '&gt;',
  1580. '"': '&quot;',
  1581. "'": '&#39;'
  1582. };
  1583. /** Used to map HTML entities to characters. */
  1584. var htmlUnescapes = {
  1585. '&amp;': '&',
  1586. '&lt;': '<',
  1587. '&gt;': '>',
  1588. '&quot;': '"',
  1589. '&#39;': "'"
  1590. };
  1591. /** Used to escape characters for inclusion in compiled string literals. */
  1592. var stringEscapes = {
  1593. '\\': '\\',
  1594. "'": "'",
  1595. '\n': 'n',
  1596. '\r': 'r',
  1597. '\u2028': 'u2028',
  1598. '\u2029': 'u2029'
  1599. };
  1600. /** Built-in method references without a dependency on `root`. */
  1601. var freeParseFloat = parseFloat,
  1602. freeParseInt = parseInt;
  1603. /** Detect free variable `global` from Node.js. */
  1604. var freeGlobal = typeof __webpack_require__.g == 'object' && __webpack_require__.g && __webpack_require__.g.Object === Object && __webpack_require__.g;
  1605. /** Detect free variable `self`. */
  1606. var freeSelf = typeof self == 'object' && self && self.Object === Object && self;
  1607. /** Used as a reference to the global object. */
  1608. var root = freeGlobal || freeSelf || Function('return this')();
  1609. /** Detect free variable `exports`. */
  1610. var freeExports = true && exports && !exports.nodeType && exports;
  1611. /** Detect free variable `module`. */
  1612. var freeModule = freeExports && "object" == 'object' && module && !module.nodeType && module;
  1613. /** Detect the popular CommonJS extension `module.exports`. */
  1614. var moduleExports = freeModule && freeModule.exports === freeExports;
  1615. /** Detect free variable `process` from Node.js. */
  1616. var freeProcess = moduleExports && freeGlobal.process;
  1617. /** Used to access faster Node.js helpers. */
  1618. var nodeUtil = (function() {
  1619. try {
  1620. // Use `util.types` for Node.js 10+.
  1621. var types = freeModule && freeModule.require && freeModule.require('util').types;
  1622. if (types) {
  1623. return types;
  1624. }
  1625. // Legacy `process.binding('util')` for Node.js < 10.
  1626. return freeProcess && freeProcess.binding && freeProcess.binding('util');
  1627. } catch (e) {}
  1628. }());
  1629. /* Node.js helper references. */
  1630. var nodeIsArrayBuffer = nodeUtil && nodeUtil.isArrayBuffer,
  1631. nodeIsDate = nodeUtil && nodeUtil.isDate,
  1632. nodeIsMap = nodeUtil && nodeUtil.isMap,
  1633. nodeIsRegExp = nodeUtil && nodeUtil.isRegExp,
  1634. nodeIsSet = nodeUtil && nodeUtil.isSet,
  1635. nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray;
  1636. /*--------------------------------------------------------------------------*/
  1637. /**
  1638. * A faster alternative to `Function#apply`, this function invokes `func`
  1639. * with the `this` binding of `thisArg` and the arguments of `args`.
  1640. *
  1641. * @private
  1642. * @param {Function} func The function to invoke.
  1643. * @param {*} thisArg The `this` binding of `func`.
  1644. * @param {Array} args The arguments to invoke `func` with.
  1645. * @returns {*} Returns the result of `func`.
  1646. */
  1647. function apply(func, thisArg, args) {
  1648. switch (args.length) {
  1649. case 0: return func.call(thisArg);
  1650. case 1: return func.call(thisArg, args[0]);
  1651. case 2: return func.call(thisArg, args[0], args[1]);
  1652. case 3: return func.call(thisArg, args[0], args[1], args[2]);
  1653. }
  1654. return func.apply(thisArg, args);
  1655. }
  1656. /**
  1657. * A specialized version of `baseAggregator` for arrays.
  1658. *
  1659. * @private
  1660. * @param {Array} [array] The array to iterate over.
  1661. * @param {Function} setter The function to set `accumulator` values.
  1662. * @param {Function} iteratee The iteratee to transform keys.
  1663. * @param {Object} accumulator The initial aggregated object.
  1664. * @returns {Function} Returns `accumulator`.
  1665. */
  1666. function arrayAggregator(array, setter, iteratee, accumulator) {
  1667. var index = -1,
  1668. length = array == null ? 0 : array.length;
  1669. while (++index < length) {
  1670. var value = array[index];
  1671. setter(accumulator, value, iteratee(value), array);
  1672. }
  1673. return accumulator;
  1674. }
  1675. /**
  1676. * A specialized version of `_.forEach` for arrays without support for
  1677. * iteratee shorthands.
  1678. *
  1679. * @private
  1680. * @param {Array} [array] The array to iterate over.
  1681. * @param {Function} iteratee The function invoked per iteration.
  1682. * @returns {Array} Returns `array`.
  1683. */
  1684. function arrayEach(array, iteratee) {
  1685. var index = -1,
  1686. length = array == null ? 0 : array.length;
  1687. while (++index < length) {
  1688. if (iteratee(array[index], index, array) === false) {
  1689. break;
  1690. }
  1691. }
  1692. return array;
  1693. }
  1694. /**
  1695. * A specialized version of `_.forEachRight` for arrays without support for
  1696. * iteratee shorthands.
  1697. *
  1698. * @private
  1699. * @param {Array} [array] The array to iterate over.
  1700. * @param {Function} iteratee The function invoked per iteration.
  1701. * @returns {Array} Returns `array`.
  1702. */
  1703. function arrayEachRight(array, iteratee) {
  1704. var length = array == null ? 0 : array.length;
  1705. while (length--) {
  1706. if (iteratee(array[length], length, array) === false) {
  1707. break;
  1708. }
  1709. }
  1710. return array;
  1711. }
  1712. /**
  1713. * A specialized version of `_.every` for arrays without support for
  1714. * iteratee shorthands.
  1715. *
  1716. * @private
  1717. * @param {Array} [array] The array to iterate over.
  1718. * @param {Function} predicate The function invoked per iteration.
  1719. * @returns {boolean} Returns `true` if all elements pass the predicate check,
  1720. * else `false`.
  1721. */
  1722. function arrayEvery(array, predicate) {
  1723. var index = -1,
  1724. length = array == null ? 0 : array.length;
  1725. while (++index < length) {
  1726. if (!predicate(array[index], index, array)) {
  1727. return false;
  1728. }
  1729. }
  1730. return true;
  1731. }
  1732. /**
  1733. * A specialized version of `_.filter` for arrays without support for
  1734. * iteratee shorthands.
  1735. *
  1736. * @private
  1737. * @param {Array} [array] The array to iterate over.
  1738. * @param {Function} predicate The function invoked per iteration.
  1739. * @returns {Array} Returns the new filtered array.
  1740. */
  1741. function arrayFilter(array, predicate) {
  1742. var index = -1,
  1743. length = array == null ? 0 : array.length,
  1744. resIndex = 0,
  1745. result = [];
  1746. while (++index < length) {
  1747. var value = array[index];
  1748. if (predicate(value, index, array)) {
  1749. result[resIndex++] = value;
  1750. }
  1751. }
  1752. return result;
  1753. }
  1754. /**
  1755. * A specialized version of `_.includes` for arrays without support for
  1756. * specifying an index to search from.
  1757. *
  1758. * @private
  1759. * @param {Array} [array] The array to inspect.
  1760. * @param {*} target The value to search for.
  1761. * @returns {boolean} Returns `true` if `target` is found, else `false`.
  1762. */
  1763. function arrayIncludes(array, value) {
  1764. var length = array == null ? 0 : array.length;
  1765. return !!length && baseIndexOf(array, value, 0) > -1;
  1766. }
  1767. /**
  1768. * This function is like `arrayIncludes` except that it accepts a comparator.
  1769. *
  1770. * @private
  1771. * @param {Array} [array] The array to inspect.
  1772. * @param {*} target The value to search for.
  1773. * @param {Function} comparator The comparator invoked per element.
  1774. * @returns {boolean} Returns `true` if `target` is found, else `false`.
  1775. */
  1776. function arrayIncludesWith(array, value, comparator) {
  1777. var index = -1,
  1778. length = array == null ? 0 : array.length;
  1779. while (++index < length) {
  1780. if (comparator(value, array[index])) {
  1781. return true;
  1782. }
  1783. }
  1784. return false;
  1785. }
  1786. /**
  1787. * A specialized version of `_.map` for arrays without support for iteratee
  1788. * shorthands.
  1789. *
  1790. * @private
  1791. * @param {Array} [array] The array to iterate over.
  1792. * @param {Function} iteratee The function invoked per iteration.
  1793. * @returns {Array} Returns the new mapped array.
  1794. */
  1795. function arrayMap(array, iteratee) {
  1796. var index = -1,
  1797. length = array == null ? 0 : array.length,
  1798. result = Array(length);
  1799. while (++index < length) {
  1800. result[index] = iteratee(array[index], index, array);
  1801. }
  1802. return result;
  1803. }
  1804. /**
  1805. * Appends the elements of `values` to `array`.
  1806. *
  1807. * @private
  1808. * @param {Array} array The array to modify.
  1809. * @param {Array} values The values to append.
  1810. * @returns {Array} Returns `array`.
  1811. */
  1812. function arrayPush(array, values) {
  1813. var index = -1,
  1814. length = values.length,
  1815. offset = array.length;
  1816. while (++index < length) {
  1817. array[offset + index] = values[index];
  1818. }
  1819. return array;
  1820. }
  1821. /**
  1822. * A specialized version of `_.reduce` for arrays without support for
  1823. * iteratee shorthands.
  1824. *
  1825. * @private
  1826. * @param {Array} [array] The array to iterate over.
  1827. * @param {Function} iteratee The function invoked per iteration.
  1828. * @param {*} [accumulator] The initial value.
  1829. * @param {boolean} [initAccum] Specify using the first element of `array` as
  1830. * the initial value.
  1831. * @returns {*} Returns the accumulated value.
  1832. */
  1833. function arrayReduce(array, iteratee, accumulator, initAccum) {
  1834. var index = -1,
  1835. length = array == null ? 0 : array.length;
  1836. if (initAccum && length) {
  1837. accumulator = array[++index];
  1838. }
  1839. while (++index < length) {
  1840. accumulator = iteratee(accumulator, array[index], index, array);
  1841. }
  1842. return accumulator;
  1843. }
  1844. /**
  1845. * A specialized version of `_.reduceRight` for arrays without support for
  1846. * iteratee shorthands.
  1847. *
  1848. * @private
  1849. * @param {Array} [array] The array to iterate over.
  1850. * @param {Function} iteratee The function invoked per iteration.
  1851. * @param {*} [accumulator] The initial value.
  1852. * @param {boolean} [initAccum] Specify using the last element of `array` as
  1853. * the initial value.
  1854. * @returns {*} Returns the accumulated value.
  1855. */
  1856. function arrayReduceRight(array, iteratee, accumulator, initAccum) {
  1857. var length = array == null ? 0 : array.length;
  1858. if (initAccum && length) {
  1859. accumulator = array[--length];
  1860. }
  1861. while (length--) {
  1862. accumulator = iteratee(accumulator, array[length], length, array);
  1863. }
  1864. return accumulator;
  1865. }
  1866. /**
  1867. * A specialized version of `_.some` for arrays without support for iteratee
  1868. * shorthands.
  1869. *
  1870. * @private
  1871. * @param {Array} [array] The array to iterate over.
  1872. * @param {Function} predicate The function invoked per iteration.
  1873. * @returns {boolean} Returns `true` if any element passes the predicate check,
  1874. * else `false`.
  1875. */
  1876. function arraySome(array, predicate) {
  1877. var index = -1,
  1878. length = array == null ? 0 : array.length;
  1879. while (++index < length) {
  1880. if (predicate(array[index], index, array)) {
  1881. return true;
  1882. }
  1883. }
  1884. return false;
  1885. }
  1886. /**
  1887. * Gets the size of an ASCII `string`.
  1888. *
  1889. * @private
  1890. * @param {string} string The string inspect.
  1891. * @returns {number} Returns the string size.
  1892. */
  1893. var asciiSize = baseProperty('length');
  1894. /**
  1895. * Converts an ASCII `string` to an array.
  1896. *
  1897. * @private
  1898. * @param {string} string The string to convert.
  1899. * @returns {Array} Returns the converted array.
  1900. */
  1901. function asciiToArray(string) {
  1902. return string.split('');
  1903. }
  1904. /**
  1905. * Splits an ASCII `string` into an array of its words.
  1906. *
  1907. * @private
  1908. * @param {string} The string to inspect.
  1909. * @returns {Array} Returns the words of `string`.
  1910. */
  1911. function asciiWords(string) {
  1912. return string.match(reAsciiWord) || [];
  1913. }
  1914. /**
  1915. * The base implementation of methods like `_.findKey` and `_.findLastKey`,
  1916. * without support for iteratee shorthands, which iterates over `collection`
  1917. * using `eachFunc`.
  1918. *
  1919. * @private
  1920. * @param {Array|Object} collection The collection to inspect.
  1921. * @param {Function} predicate The function invoked per iteration.
  1922. * @param {Function} eachFunc The function to iterate over `collection`.
  1923. * @returns {*} Returns the found element or its key, else `undefined`.
  1924. */
  1925. function baseFindKey(collection, predicate, eachFunc) {
  1926. var result;
  1927. eachFunc(collection, function(value, key, collection) {
  1928. if (predicate(value, key, collection)) {
  1929. result = key;
  1930. return false;
  1931. }
  1932. });
  1933. return result;
  1934. }
  1935. /**
  1936. * The base implementation of `_.findIndex` and `_.findLastIndex` without
  1937. * support for iteratee shorthands.
  1938. *
  1939. * @private
  1940. * @param {Array} array The array to inspect.
  1941. * @param {Function} predicate The function invoked per iteration.
  1942. * @param {number} fromIndex The index to search from.
  1943. * @param {boolean} [fromRight] Specify iterating from right to left.
  1944. * @returns {number} Returns the index of the matched value, else `-1`.
  1945. */
  1946. function baseFindIndex(array, predicate, fromIndex, fromRight) {
  1947. var length = array.length,
  1948. index = fromIndex + (fromRight ? 1 : -1);
  1949. while ((fromRight ? index-- : ++index < length)) {
  1950. if (predicate(array[index], index, array)) {
  1951. return index;
  1952. }
  1953. }
  1954. return -1;
  1955. }
  1956. /**
  1957. * The base implementation of `_.indexOf` without `fromIndex` bounds checks.
  1958. *
  1959. * @private
  1960. * @param {Array} array The array to inspect.
  1961. * @param {*} value The value to search for.
  1962. * @param {number} fromIndex The index to search from.
  1963. * @returns {number} Returns the index of the matched value, else `-1`.
  1964. */
  1965. function baseIndexOf(array, value, fromIndex) {
  1966. return value === value
  1967. ? strictIndexOf(array, value, fromIndex)
  1968. : baseFindIndex(array, baseIsNaN, fromIndex);
  1969. }
  1970. /**
  1971. * This function is like `baseIndexOf` except that it accepts a comparator.
  1972. *
  1973. * @private
  1974. * @param {Array} array The array to inspect.
  1975. * @param {*} value The value to search for.
  1976. * @param {number} fromIndex The index to search from.
  1977. * @param {Function} comparator The comparator invoked per element.
  1978. * @returns {number} Returns the index of the matched value, else `-1`.
  1979. */
  1980. function baseIndexOfWith(array, value, fromIndex, comparator) {
  1981. var index = fromIndex - 1,
  1982. length = array.length;
  1983. while (++index < length) {
  1984. if (comparator(array[index], value)) {
  1985. return index;
  1986. }
  1987. }
  1988. return -1;
  1989. }
  1990. /**
  1991. * The base implementation of `_.isNaN` without support for number objects.
  1992. *
  1993. * @private
  1994. * @param {*} value The value to check.
  1995. * @returns {boolean} Returns `true` if `value` is `NaN`, else `false`.
  1996. */
  1997. function baseIsNaN(value) {
  1998. return value !== value;
  1999. }
  2000. /**
  2001. * The base implementation of `_.mean` and `_.meanBy` without support for
  2002. * iteratee shorthands.
  2003. *
  2004. * @private
  2005. * @param {Array} array The array to iterate over.
  2006. * @param {Function} iteratee The function invoked per iteration.
  2007. * @returns {number} Returns the mean.
  2008. */
  2009. function baseMean(array, iteratee) {
  2010. var length = array == null ? 0 : array.length;
  2011. return length ? (baseSum(array, iteratee) / length) : NAN;
  2012. }
  2013. /**
  2014. * The base implementation of `_.property` without support for deep paths.
  2015. *
  2016. * @private
  2017. * @param {string} key The key of the property to get.
  2018. * @returns {Function} Returns the new accessor function.
  2019. */
  2020. function baseProperty(key) {
  2021. return function(object) {
  2022. return object == null ? undefined : object[key];
  2023. };
  2024. }
  2025. /**
  2026. * The base implementation of `_.propertyOf` without support for deep paths.
  2027. *
  2028. * @private
  2029. * @param {Object} object The object to query.
  2030. * @returns {Function} Returns the new accessor function.
  2031. */
  2032. function basePropertyOf(object) {
  2033. return function(key) {
  2034. return object == null ? undefined : object[key];
  2035. };
  2036. }
  2037. /**
  2038. * The base implementation of `_.reduce` and `_.reduceRight`, without support
  2039. * for iteratee shorthands, which iterates over `collection` using `eachFunc`.
  2040. *
  2041. * @private
  2042. * @param {Array|Object} collection The collection to iterate over.
  2043. * @param {Function} iteratee The function invoked per iteration.
  2044. * @param {*} accumulator The initial value.
  2045. * @param {boolean} initAccum Specify using the first or last element of
  2046. * `collection` as the initial value.
  2047. * @param {Function} eachFunc The function to iterate over `collection`.
  2048. * @returns {*} Returns the accumulated value.
  2049. */
  2050. function baseReduce(collection, iteratee, accumulator, initAccum, eachFunc) {
  2051. eachFunc(collection, function(value, index, collection) {
  2052. accumulator = initAccum
  2053. ? (initAccum = false, value)
  2054. : iteratee(accumulator, value, index, collection);
  2055. });
  2056. return accumulator;
  2057. }
  2058. /**
  2059. * The base implementation of `_.sortBy` which uses `comparer` to define the
  2060. * sort order of `array` and replaces criteria objects with their corresponding
  2061. * values.
  2062. *
  2063. * @private
  2064. * @param {Array} array The array to sort.
  2065. * @param {Function} comparer The function to define sort order.
  2066. * @returns {Array} Returns `array`.
  2067. */
  2068. function baseSortBy(array, comparer) {
  2069. var length = array.length;
  2070. array.sort(comparer);
  2071. while (length--) {
  2072. array[length] = array[length].value;
  2073. }
  2074. return array;
  2075. }
  2076. /**
  2077. * The base implementation of `_.sum` and `_.sumBy` without support for
  2078. * iteratee shorthands.
  2079. *
  2080. * @private
  2081. * @param {Array} array The array to iterate over.
  2082. * @param {Function} iteratee The function invoked per iteration.
  2083. * @returns {number} Returns the sum.
  2084. */
  2085. function baseSum(array, iteratee) {
  2086. var result,
  2087. index = -1,
  2088. length = array.length;
  2089. while (++index < length) {
  2090. var current = iteratee(array[index]);
  2091. if (current !== undefined) {
  2092. result = result === undefined ? current : (result + current);
  2093. }
  2094. }
  2095. return result;
  2096. }
  2097. /**
  2098. * The base implementation of `_.times` without support for iteratee shorthands
  2099. * or max array length checks.
  2100. *
  2101. * @private
  2102. * @param {number} n The number of times to invoke `iteratee`.
  2103. * @param {Function} iteratee The function invoked per iteration.
  2104. * @returns {Array} Returns the array of results.
  2105. */
  2106. function baseTimes(n, iteratee) {
  2107. var index = -1,
  2108. result = Array(n);
  2109. while (++index < n) {
  2110. result[index] = iteratee(index);
  2111. }
  2112. return result;
  2113. }
  2114. /**
  2115. * The base implementation of `_.toPairs` and `_.toPairsIn` which creates an array
  2116. * of key-value pairs for `object` corresponding to the property names of `props`.
  2117. *
  2118. * @private
  2119. * @param {Object} object The object to query.
  2120. * @param {Array} props The property names to get values for.
  2121. * @returns {Object} Returns the key-value pairs.
  2122. */
  2123. function baseToPairs(object, props) {
  2124. return arrayMap(props, function(key) {
  2125. return [key, object[key]];
  2126. });
  2127. }
  2128. /**
  2129. * The base implementation of `_.trim`.
  2130. *
  2131. * @private
  2132. * @param {string} string The string to trim.
  2133. * @returns {string} Returns the trimmed string.
  2134. */
  2135. function baseTrim(string) {
  2136. return string
  2137. ? string.slice(0, trimmedEndIndex(string) + 1).replace(reTrimStart, '')
  2138. : string;
  2139. }
  2140. /**
  2141. * The base implementation of `_.unary` without support for storing metadata.
  2142. *
  2143. * @private
  2144. * @param {Function} func The function to cap arguments for.
  2145. * @returns {Function} Returns the new capped function.
  2146. */
  2147. function baseUnary(func) {
  2148. return function(value) {
  2149. return func(value);
  2150. };
  2151. }
  2152. /**
  2153. * The base implementation of `_.values` and `_.valuesIn` which creates an
  2154. * array of `object` property values corresponding to the property names
  2155. * of `props`.
  2156. *
  2157. * @private
  2158. * @param {Object} object The object to query.
  2159. * @param {Array} props The property names to get values for.
  2160. * @returns {Object} Returns the array of property values.
  2161. */
  2162. function baseValues(object, props) {
  2163. return arrayMap(props, function(key) {
  2164. return object[key];
  2165. });
  2166. }
  2167. /**
  2168. * Checks if a `cache` value for `key` exists.
  2169. *
  2170. * @private
  2171. * @param {Object} cache The cache to query.
  2172. * @param {string} key The key of the entry to check.
  2173. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  2174. */
  2175. function cacheHas(cache, key) {
  2176. return cache.has(key);
  2177. }
  2178. /**
  2179. * Used by `_.trim` and `_.trimStart` to get the index of the first string symbol
  2180. * that is not found in the character symbols.
  2181. *
  2182. * @private
  2183. * @param {Array} strSymbols The string symbols to inspect.
  2184. * @param {Array} chrSymbols The character symbols to find.
  2185. * @returns {number} Returns the index of the first unmatched string symbol.
  2186. */
  2187. function charsStartIndex(strSymbols, chrSymbols) {
  2188. var index = -1,
  2189. length = strSymbols.length;
  2190. while (++index < length && baseIndexOf(chrSymbols, strSymbols[index], 0) > -1) {}
  2191. return index;
  2192. }
  2193. /**
  2194. * Used by `_.trim` and `_.trimEnd` to get the index of the last string symbol
  2195. * that is not found in the character symbols.
  2196. *
  2197. * @private
  2198. * @param {Array} strSymbols The string symbols to inspect.
  2199. * @param {Array} chrSymbols The character symbols to find.
  2200. * @returns {number} Returns the index of the last unmatched string symbol.
  2201. */
  2202. function charsEndIndex(strSymbols, chrSymbols) {
  2203. var index = strSymbols.length;
  2204. while (index-- && baseIndexOf(chrSymbols, strSymbols[index], 0) > -1) {}
  2205. return index;
  2206. }
  2207. /**
  2208. * Gets the number of `placeholder` occurrences in `array`.
  2209. *
  2210. * @private
  2211. * @param {Array} array The array to inspect.
  2212. * @param {*} placeholder The placeholder to search for.
  2213. * @returns {number} Returns the placeholder count.
  2214. */
  2215. function countHolders(array, placeholder) {
  2216. var length = array.length,
  2217. result = 0;
  2218. while (length--) {
  2219. if (array[length] === placeholder) {
  2220. ++result;
  2221. }
  2222. }
  2223. return result;
  2224. }
  2225. /**
  2226. * Used by `_.deburr` to convert Latin-1 Supplement and Latin Extended-A
  2227. * letters to basic Latin letters.
  2228. *
  2229. * @private
  2230. * @param {string} letter The matched letter to deburr.
  2231. * @returns {string} Returns the deburred letter.
  2232. */
  2233. var deburrLetter = basePropertyOf(deburredLetters);
  2234. /**
  2235. * Used by `_.escape` to convert characters to HTML entities.
  2236. *
  2237. * @private
  2238. * @param {string} chr The matched character to escape.
  2239. * @returns {string} Returns the escaped character.
  2240. */
  2241. var escapeHtmlChar = basePropertyOf(htmlEscapes);
  2242. /**
  2243. * Used by `_.template` to escape characters for inclusion in compiled string literals.
  2244. *
  2245. * @private
  2246. * @param {string} chr The matched character to escape.
  2247. * @returns {string} Returns the escaped character.
  2248. */
  2249. function escapeStringChar(chr) {
  2250. return '\\' + stringEscapes[chr];
  2251. }
  2252. /**
  2253. * Gets the value at `key` of `object`.
  2254. *
  2255. * @private
  2256. * @param {Object} [object] The object to query.
  2257. * @param {string} key The key of the property to get.
  2258. * @returns {*} Returns the property value.
  2259. */
  2260. function getValue(object, key) {
  2261. return object == null ? undefined : object[key];
  2262. }
  2263. /**
  2264. * Checks if `string` contains Unicode symbols.
  2265. *
  2266. * @private
  2267. * @param {string} string The string to inspect.
  2268. * @returns {boolean} Returns `true` if a symbol is found, else `false`.
  2269. */
  2270. function hasUnicode(string) {
  2271. return reHasUnicode.test(string);
  2272. }
  2273. /**
  2274. * Checks if `string` contains a word composed of Unicode symbols.
  2275. *
  2276. * @private
  2277. * @param {string} string The string to inspect.
  2278. * @returns {boolean} Returns `true` if a word is found, else `false`.
  2279. */
  2280. function hasUnicodeWord(string) {
  2281. return reHasUnicodeWord.test(string);
  2282. }
  2283. /**
  2284. * Converts `iterator` to an array.
  2285. *
  2286. * @private
  2287. * @param {Object} iterator The iterator to convert.
  2288. * @returns {Array} Returns the converted array.
  2289. */
  2290. function iteratorToArray(iterator) {
  2291. var data,
  2292. result = [];
  2293. while (!(data = iterator.next()).done) {
  2294. result.push(data.value);
  2295. }
  2296. return result;
  2297. }
  2298. /**
  2299. * Converts `map` to its key-value pairs.
  2300. *
  2301. * @private
  2302. * @param {Object} map The map to convert.
  2303. * @returns {Array} Returns the key-value pairs.
  2304. */
  2305. function mapToArray(map) {
  2306. var index = -1,
  2307. result = Array(map.size);
  2308. map.forEach(function(value, key) {
  2309. result[++index] = [key, value];
  2310. });
  2311. return result;
  2312. }
  2313. /**
  2314. * Creates a unary function that invokes `func` with its argument transformed.
  2315. *
  2316. * @private
  2317. * @param {Function} func The function to wrap.
  2318. * @param {Function} transform The argument transform.
  2319. * @returns {Function} Returns the new function.
  2320. */
  2321. function overArg(func, transform) {
  2322. return function(arg) {
  2323. return func(transform(arg));
  2324. };
  2325. }
  2326. /**
  2327. * Replaces all `placeholder` elements in `array` with an internal placeholder
  2328. * and returns an array of their indexes.
  2329. *
  2330. * @private
  2331. * @param {Array} array The array to modify.
  2332. * @param {*} placeholder The placeholder to replace.
  2333. * @returns {Array} Returns the new array of placeholder indexes.
  2334. */
  2335. function replaceHolders(array, placeholder) {
  2336. var index = -1,
  2337. length = array.length,
  2338. resIndex = 0,
  2339. result = [];
  2340. while (++index < length) {
  2341. var value = array[index];
  2342. if (value === placeholder || value === PLACEHOLDER) {
  2343. array[index] = PLACEHOLDER;
  2344. result[resIndex++] = index;
  2345. }
  2346. }
  2347. return result;
  2348. }
  2349. /**
  2350. * Converts `set` to an array of its values.
  2351. *
  2352. * @private
  2353. * @param {Object} set The set to convert.
  2354. * @returns {Array} Returns the values.
  2355. */
  2356. function setToArray(set) {
  2357. var index = -1,
  2358. result = Array(set.size);
  2359. set.forEach(function(value) {
  2360. result[++index] = value;
  2361. });
  2362. return result;
  2363. }
  2364. /**
  2365. * Converts `set` to its value-value pairs.
  2366. *
  2367. * @private
  2368. * @param {Object} set The set to convert.
  2369. * @returns {Array} Returns the value-value pairs.
  2370. */
  2371. function setToPairs(set) {
  2372. var index = -1,
  2373. result = Array(set.size);
  2374. set.forEach(function(value) {
  2375. result[++index] = [value, value];
  2376. });
  2377. return result;
  2378. }
  2379. /**
  2380. * A specialized version of `_.indexOf` which performs strict equality
  2381. * comparisons of values, i.e. `===`.
  2382. *
  2383. * @private
  2384. * @param {Array} array The array to inspect.
  2385. * @param {*} value The value to search for.
  2386. * @param {number} fromIndex The index to search from.
  2387. * @returns {number} Returns the index of the matched value, else `-1`.
  2388. */
  2389. function strictIndexOf(array, value, fromIndex) {
  2390. var index = fromIndex - 1,
  2391. length = array.length;
  2392. while (++index < length) {
  2393. if (array[index] === value) {
  2394. return index;
  2395. }
  2396. }
  2397. return -1;
  2398. }
  2399. /**
  2400. * A specialized version of `_.lastIndexOf` which performs strict equality
  2401. * comparisons of values, i.e. `===`.
  2402. *
  2403. * @private
  2404. * @param {Array} array The array to inspect.
  2405. * @param {*} value The value to search for.
  2406. * @param {number} fromIndex The index to search from.
  2407. * @returns {number} Returns the index of the matched value, else `-1`.
  2408. */
  2409. function strictLastIndexOf(array, value, fromIndex) {
  2410. var index = fromIndex + 1;
  2411. while (index--) {
  2412. if (array[index] === value) {
  2413. return index;
  2414. }
  2415. }
  2416. return index;
  2417. }
  2418. /**
  2419. * Gets the number of symbols in `string`.
  2420. *
  2421. * @private
  2422. * @param {string} string The string to inspect.
  2423. * @returns {number} Returns the string size.
  2424. */
  2425. function stringSize(string) {
  2426. return hasUnicode(string)
  2427. ? unicodeSize(string)
  2428. : asciiSize(string);
  2429. }
  2430. /**
  2431. * Converts `string` to an array.
  2432. *
  2433. * @private
  2434. * @param {string} string The string to convert.
  2435. * @returns {Array} Returns the converted array.
  2436. */
  2437. function stringToArray(string) {
  2438. return hasUnicode(string)
  2439. ? unicodeToArray(string)
  2440. : asciiToArray(string);
  2441. }
  2442. /**
  2443. * Used by `_.trim` and `_.trimEnd` to get the index of the last non-whitespace
  2444. * character of `string`.
  2445. *
  2446. * @private
  2447. * @param {string} string The string to inspect.
  2448. * @returns {number} Returns the index of the last non-whitespace character.
  2449. */
  2450. function trimmedEndIndex(string) {
  2451. var index = string.length;
  2452. while (index-- && reWhitespace.test(string.charAt(index))) {}
  2453. return index;
  2454. }
  2455. /**
  2456. * Used by `_.unescape` to convert HTML entities to characters.
  2457. *
  2458. * @private
  2459. * @param {string} chr The matched character to unescape.
  2460. * @returns {string} Returns the unescaped character.
  2461. */
  2462. var unescapeHtmlChar = basePropertyOf(htmlUnescapes);
  2463. /**
  2464. * Gets the size of a Unicode `string`.
  2465. *
  2466. * @private
  2467. * @param {string} string The string inspect.
  2468. * @returns {number} Returns the string size.
  2469. */
  2470. function unicodeSize(string) {
  2471. var result = reUnicode.lastIndex = 0;
  2472. while (reUnicode.test(string)) {
  2473. ++result;
  2474. }
  2475. return result;
  2476. }
  2477. /**
  2478. * Converts a Unicode `string` to an array.
  2479. *
  2480. * @private
  2481. * @param {string} string The string to convert.
  2482. * @returns {Array} Returns the converted array.
  2483. */
  2484. function unicodeToArray(string) {
  2485. return string.match(reUnicode) || [];
  2486. }
  2487. /**
  2488. * Splits a Unicode `string` into an array of its words.
  2489. *
  2490. * @private
  2491. * @param {string} The string to inspect.
  2492. * @returns {Array} Returns the words of `string`.
  2493. */
  2494. function unicodeWords(string) {
  2495. return string.match(reUnicodeWord) || [];
  2496. }
  2497. /*--------------------------------------------------------------------------*/
  2498. /**
  2499. * Create a new pristine `lodash` function using the `context` object.
  2500. *
  2501. * @static
  2502. * @memberOf _
  2503. * @since 1.1.0
  2504. * @category Util
  2505. * @param {Object} [context=root] The context object.
  2506. * @returns {Function} Returns a new `lodash` function.
  2507. * @example
  2508. *
  2509. * _.mixin({ 'foo': _.constant('foo') });
  2510. *
  2511. * var lodash = _.runInContext();
  2512. * lodash.mixin({ 'bar': lodash.constant('bar') });
  2513. *
  2514. * _.isFunction(_.foo);
  2515. * // => true
  2516. * _.isFunction(_.bar);
  2517. * // => false
  2518. *
  2519. * lodash.isFunction(lodash.foo);
  2520. * // => false
  2521. * lodash.isFunction(lodash.bar);
  2522. * // => true
  2523. *
  2524. * // Create a suped-up `defer` in Node.js.
  2525. * var defer = _.runInContext({ 'setTimeout': setImmediate }).defer;
  2526. */
  2527. var runInContext = (function runInContext(context) {
  2528. context = context == null ? root : _.defaults(root.Object(), context, _.pick(root, contextProps));
  2529. /** Built-in constructor references. */
  2530. var Array = context.Array,
  2531. Date = context.Date,
  2532. Error = context.Error,
  2533. Function = context.Function,
  2534. Math = context.Math,
  2535. Object = context.Object,
  2536. RegExp = context.RegExp,
  2537. String = context.String,
  2538. TypeError = context.TypeError;
  2539. /** Used for built-in method references. */
  2540. var arrayProto = Array.prototype,
  2541. funcProto = Function.prototype,
  2542. objectProto = Object.prototype;
  2543. /** Used to detect overreaching core-js shims. */
  2544. var coreJsData = context['__core-js_shared__'];
  2545. /** Used to resolve the decompiled source of functions. */
  2546. var funcToString = funcProto.toString;
  2547. /** Used to check objects for own properties. */
  2548. var hasOwnProperty = objectProto.hasOwnProperty;
  2549. /** Used to generate unique IDs. */
  2550. var idCounter = 0;
  2551. /** Used to detect methods masquerading as native. */
  2552. var maskSrcKey = (function() {
  2553. var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || '');
  2554. return uid ? ('Symbol(src)_1.' + uid) : '';
  2555. }());
  2556. /**
  2557. * Used to resolve the
  2558. * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
  2559. * of values.
  2560. */
  2561. var nativeObjectToString = objectProto.toString;
  2562. /** Used to infer the `Object` constructor. */
  2563. var objectCtorString = funcToString.call(Object);
  2564. /** Used to restore the original `_` reference in `_.noConflict`. */
  2565. var oldDash = root._;
  2566. /** Used to detect if a method is native. */
  2567. var reIsNative = RegExp('^' +
  2568. funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\$&')
  2569. .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$'
  2570. );
  2571. /** Built-in value references. */
  2572. var Buffer = moduleExports ? context.Buffer : undefined,
  2573. Symbol = context.Symbol,
  2574. Uint8Array = context.Uint8Array,
  2575. allocUnsafe = Buffer ? Buffer.allocUnsafe : undefined,
  2576. getPrototype = overArg(Object.getPrototypeOf, Object),
  2577. objectCreate = Object.create,
  2578. propertyIsEnumerable = objectProto.propertyIsEnumerable,
  2579. splice = arrayProto.splice,
  2580. spreadableSymbol = Symbol ? Symbol.isConcatSpreadable : undefined,
  2581. symIterator = Symbol ? Symbol.iterator : undefined,
  2582. symToStringTag = Symbol ? Symbol.toStringTag : undefined;
  2583. var defineProperty = (function() {
  2584. try {
  2585. var func = getNative(Object, 'defineProperty');
  2586. func({}, '', {});
  2587. return func;
  2588. } catch (e) {}
  2589. }());
  2590. /** Mocked built-ins. */
  2591. var ctxClearTimeout = context.clearTimeout !== root.clearTimeout && context.clearTimeout,
  2592. ctxNow = Date && Date.now !== root.Date.now && Date.now,
  2593. ctxSetTimeout = context.setTimeout !== root.setTimeout && context.setTimeout;
  2594. /* Built-in method references for those with the same name as other `lodash` methods. */
  2595. var nativeCeil = Math.ceil,
  2596. nativeFloor = Math.floor,
  2597. nativeGetSymbols = Object.getOwnPropertySymbols,
  2598. nativeIsBuffer = Buffer ? Buffer.isBuffer : undefined,
  2599. nativeIsFinite = context.isFinite,
  2600. nativeJoin = arrayProto.join,
  2601. nativeKeys = overArg(Object.keys, Object),
  2602. nativeMax = Math.max,
  2603. nativeMin = Math.min,
  2604. nativeNow = Date.now,
  2605. nativeParseInt = context.parseInt,
  2606. nativeRandom = Math.random,
  2607. nativeReverse = arrayProto.reverse;
  2608. /* Built-in method references that are verified to be native. */
  2609. var DataView = getNative(context, 'DataView'),
  2610. Map = getNative(context, 'Map'),
  2611. Promise = getNative(context, 'Promise'),
  2612. Set = getNative(context, 'Set'),
  2613. WeakMap = getNative(context, 'WeakMap'),
  2614. nativeCreate = getNative(Object, 'create');
  2615. /** Used to store function metadata. */
  2616. var metaMap = WeakMap && new WeakMap;
  2617. /** Used to lookup unminified function names. */
  2618. var realNames = {};
  2619. /** Used to detect maps, sets, and weakmaps. */
  2620. var dataViewCtorString = toSource(DataView),
  2621. mapCtorString = toSource(Map),
  2622. promiseCtorString = toSource(Promise),
  2623. setCtorString = toSource(Set),
  2624. weakMapCtorString = toSource(WeakMap);
  2625. /** Used to convert symbols to primitives and strings. */
  2626. var symbolProto = Symbol ? Symbol.prototype : undefined,
  2627. symbolValueOf = symbolProto ? symbolProto.valueOf : undefined,
  2628. symbolToString = symbolProto ? symbolProto.toString : undefined;
  2629. /*------------------------------------------------------------------------*/
  2630. /**
  2631. * Creates a `lodash` object which wraps `value` to enable implicit method
  2632. * chain sequences. Methods that operate on and return arrays, collections,
  2633. * and functions can be chained together. Methods that retrieve a single value
  2634. * or may return a primitive value will automatically end the chain sequence
  2635. * and return the unwrapped value. Otherwise, the value must be unwrapped
  2636. * with `_#value`.
  2637. *
  2638. * Explicit chain sequences, which must be unwrapped with `_#value`, may be
  2639. * enabled using `_.chain`.
  2640. *
  2641. * The execution of chained methods is lazy, that is, it's deferred until
  2642. * `_#value` is implicitly or explicitly called.
  2643. *
  2644. * Lazy evaluation allows several methods to support shortcut fusion.
  2645. * Shortcut fusion is an optimization to merge iteratee calls; this avoids
  2646. * the creation of intermediate arrays and can greatly reduce the number of
  2647. * iteratee executions. Sections of a chain sequence qualify for shortcut
  2648. * fusion if the section is applied to an array and iteratees accept only
  2649. * one argument. The heuristic for whether a section qualifies for shortcut
  2650. * fusion is subject to change.
  2651. *
  2652. * Chaining is supported in custom builds as long as the `_#value` method is
  2653. * directly or indirectly included in the build.
  2654. *
  2655. * In addition to lodash methods, wrappers have `Array` and `String` methods.
  2656. *
  2657. * The wrapper `Array` methods are:
  2658. * `concat`, `join`, `pop`, `push`, `shift`, `sort`, `splice`, and `unshift`
  2659. *
  2660. * The wrapper `String` methods are:
  2661. * `replace` and `split`
  2662. *
  2663. * The wrapper methods that support shortcut fusion are:
  2664. * `at`, `compact`, `drop`, `dropRight`, `dropWhile`, `filter`, `find`,
  2665. * `findLast`, `head`, `initial`, `last`, `map`, `reject`, `reverse`, `slice`,
  2666. * `tail`, `take`, `takeRight`, `takeRightWhile`, `takeWhile`, and `toArray`
  2667. *
  2668. * The chainable wrapper methods are:
  2669. * `after`, `ary`, `assign`, `assignIn`, `assignInWith`, `assignWith`, `at`,
  2670. * `before`, `bind`, `bindAll`, `bindKey`, `castArray`, `chain`, `chunk`,
  2671. * `commit`, `compact`, `concat`, `conforms`, `constant`, `countBy`, `create`,
  2672. * `curry`, `debounce`, `defaults`, `defaultsDeep`, `defer`, `delay`,
  2673. * `difference`, `differenceBy`, `differenceWith`, `drop`, `dropRight`,
  2674. * `dropRightWhile`, `dropWhile`, `extend`, `extendWith`, `fill`, `filter`,
  2675. * `flatMap`, `flatMapDeep`, `flatMapDepth`, `flatten`, `flattenDeep`,
  2676. * `flattenDepth`, `flip`, `flow`, `flowRight`, `fromPairs`, `functions`,
  2677. * `functionsIn`, `groupBy`, `initial`, `intersection`, `intersectionBy`,
  2678. * `intersectionWith`, `invert`, `invertBy`, `invokeMap`, `iteratee`, `keyBy`,
  2679. * `keys`, `keysIn`, `map`, `mapKeys`, `mapValues`, `matches`, `matchesProperty`,
  2680. * `memoize`, `merge`, `mergeWith`, `method`, `methodOf`, `mixin`, `negate`,
  2681. * `nthArg`, `omit`, `omitBy`, `once`, `orderBy`, `over`, `overArgs`,
  2682. * `overEvery`, `overSome`, `partial`, `partialRight`, `partition`, `pick`,
  2683. * `pickBy`, `plant`, `property`, `propertyOf`, `pull`, `pullAll`, `pullAllBy`,
  2684. * `pullAllWith`, `pullAt`, `push`, `range`, `rangeRight`, `rearg`, `reject`,
  2685. * `remove`, `rest`, `reverse`, `sampleSize`, `set`, `setWith`, `shuffle`,
  2686. * `slice`, `sort`, `sortBy`, `splice`, `spread`, `tail`, `take`, `takeRight`,
  2687. * `takeRightWhile`, `takeWhile`, `tap`, `throttle`, `thru`, `toArray`,
  2688. * `toPairs`, `toPairsIn`, `toPath`, `toPlainObject`, `transform`, `unary`,
  2689. * `union`, `unionBy`, `unionWith`, `uniq`, `uniqBy`, `uniqWith`, `unset`,
  2690. * `unshift`, `unzip`, `unzipWith`, `update`, `updateWith`, `values`,
  2691. * `valuesIn`, `without`, `wrap`, `xor`, `xorBy`, `xorWith`, `zip`,
  2692. * `zipObject`, `zipObjectDeep`, and `zipWith`
  2693. *
  2694. * The wrapper methods that are **not** chainable by default are:
  2695. * `add`, `attempt`, `camelCase`, `capitalize`, `ceil`, `clamp`, `clone`,
  2696. * `cloneDeep`, `cloneDeepWith`, `cloneWith`, `conformsTo`, `deburr`,
  2697. * `defaultTo`, `divide`, `each`, `eachRight`, `endsWith`, `eq`, `escape`,
  2698. * `escapeRegExp`, `every`, `find`, `findIndex`, `findKey`, `findLast`,
  2699. * `findLastIndex`, `findLastKey`, `first`, `floor`, `forEach`, `forEachRight`,
  2700. * `forIn`, `forInRight`, `forOwn`, `forOwnRight`, `get`, `gt`, `gte`, `has`,
  2701. * `hasIn`, `head`, `identity`, `includes`, `indexOf`, `inRange`, `invoke`,
  2702. * `isArguments`, `isArray`, `isArrayBuffer`, `isArrayLike`, `isArrayLikeObject`,
  2703. * `isBoolean`, `isBuffer`, `isDate`, `isElement`, `isEmpty`, `isEqual`,
  2704. * `isEqualWith`, `isError`, `isFinite`, `isFunction`, `isInteger`, `isLength`,
  2705. * `isMap`, `isMatch`, `isMatchWith`, `isNaN`, `isNative`, `isNil`, `isNull`,
  2706. * `isNumber`, `isObject`, `isObjectLike`, `isPlainObject`, `isRegExp`,
  2707. * `isSafeInteger`, `isSet`, `isString`, `isUndefined`, `isTypedArray`,
  2708. * `isWeakMap`, `isWeakSet`, `join`, `kebabCase`, `last`, `lastIndexOf`,
  2709. * `lowerCase`, `lowerFirst`, `lt`, `lte`, `max`, `maxBy`, `mean`, `meanBy`,
  2710. * `min`, `minBy`, `multiply`, `noConflict`, `noop`, `now`, `nth`, `pad`,
  2711. * `padEnd`, `padStart`, `parseInt`, `pop`, `random`, `reduce`, `reduceRight`,
  2712. * `repeat`, `result`, `round`, `runInContext`, `sample`, `shift`, `size`,
  2713. * `snakeCase`, `some`, `sortedIndex`, `sortedIndexBy`, `sortedLastIndex`,
  2714. * `sortedLastIndexBy`, `startCase`, `startsWith`, `stubArray`, `stubFalse`,
  2715. * `stubObject`, `stubString`, `stubTrue`, `subtract`, `sum`, `sumBy`,
  2716. * `template`, `times`, `toFinite`, `toInteger`, `toJSON`, `toLength`,
  2717. * `toLower`, `toNumber`, `toSafeInteger`, `toString`, `toUpper`, `trim`,
  2718. * `trimEnd`, `trimStart`, `truncate`, `unescape`, `uniqueId`, `upperCase`,
  2719. * `upperFirst`, `value`, and `words`
  2720. *
  2721. * @name _
  2722. * @constructor
  2723. * @category Seq
  2724. * @param {*} value The value to wrap in a `lodash` instance.
  2725. * @returns {Object} Returns the new `lodash` wrapper instance.
  2726. * @example
  2727. *
  2728. * function square(n) {
  2729. * return n * n;
  2730. * }
  2731. *
  2732. * var wrapped = _([1, 2, 3]);
  2733. *
  2734. * // Returns an unwrapped value.
  2735. * wrapped.reduce(_.add);
  2736. * // => 6
  2737. *
  2738. * // Returns a wrapped value.
  2739. * var squares = wrapped.map(square);
  2740. *
  2741. * _.isArray(squares);
  2742. * // => false
  2743. *
  2744. * _.isArray(squares.value());
  2745. * // => true
  2746. */
  2747. function lodash(value) {
  2748. if (isObjectLike(value) && !isArray(value) && !(value instanceof LazyWrapper)) {
  2749. if (value instanceof LodashWrapper) {
  2750. return value;
  2751. }
  2752. if (hasOwnProperty.call(value, '__wrapped__')) {
  2753. return wrapperClone(value);
  2754. }
  2755. }
  2756. return new LodashWrapper(value);
  2757. }
  2758. /**
  2759. * The base implementation of `_.create` without support for assigning
  2760. * properties to the created object.
  2761. *
  2762. * @private
  2763. * @param {Object} proto The object to inherit from.
  2764. * @returns {Object} Returns the new object.
  2765. */
  2766. var baseCreate = (function() {
  2767. function object() {}
  2768. return function(proto) {
  2769. if (!isObject(proto)) {
  2770. return {};
  2771. }
  2772. if (objectCreate) {
  2773. return objectCreate(proto);
  2774. }
  2775. object.prototype = proto;
  2776. var result = new object;
  2777. object.prototype = undefined;
  2778. return result;
  2779. };
  2780. }());
  2781. /**
  2782. * The function whose prototype chain sequence wrappers inherit from.
  2783. *
  2784. * @private
  2785. */
  2786. function baseLodash() {
  2787. // No operation performed.
  2788. }
  2789. /**
  2790. * The base constructor for creating `lodash` wrapper objects.
  2791. *
  2792. * @private
  2793. * @param {*} value The value to wrap.
  2794. * @param {boolean} [chainAll] Enable explicit method chain sequences.
  2795. */
  2796. function LodashWrapper(value, chainAll) {
  2797. this.__wrapped__ = value;
  2798. this.__actions__ = [];
  2799. this.__chain__ = !!chainAll;
  2800. this.__index__ = 0;
  2801. this.__values__ = undefined;
  2802. }
  2803. /**
  2804. * By default, the template delimiters used by lodash are like those in
  2805. * embedded Ruby (ERB) as well as ES2015 template strings. Change the
  2806. * following template settings to use alternative delimiters.
  2807. *
  2808. * @static
  2809. * @memberOf _
  2810. * @type {Object}
  2811. */
  2812. lodash.templateSettings = {
  2813. /**
  2814. * Used to detect `data` property values to be HTML-escaped.
  2815. *
  2816. * @memberOf _.templateSettings
  2817. * @type {RegExp}
  2818. */
  2819. 'escape': reEscape,
  2820. /**
  2821. * Used to detect code to be evaluated.
  2822. *
  2823. * @memberOf _.templateSettings
  2824. * @type {RegExp}
  2825. */
  2826. 'evaluate': reEvaluate,
  2827. /**
  2828. * Used to detect `data` property values to inject.
  2829. *
  2830. * @memberOf _.templateSettings
  2831. * @type {RegExp}
  2832. */
  2833. 'interpolate': reInterpolate,
  2834. /**
  2835. * Used to reference the data object in the template text.
  2836. *
  2837. * @memberOf _.templateSettings
  2838. * @type {string}
  2839. */
  2840. 'variable': '',
  2841. /**
  2842. * Used to import variables into the compiled template.
  2843. *
  2844. * @memberOf _.templateSettings
  2845. * @type {Object}
  2846. */
  2847. 'imports': {
  2848. /**
  2849. * A reference to the `lodash` function.
  2850. *
  2851. * @memberOf _.templateSettings.imports
  2852. * @type {Function}
  2853. */
  2854. '_': lodash
  2855. }
  2856. };
  2857. // Ensure wrappers are instances of `baseLodash`.
  2858. lodash.prototype = baseLodash.prototype;
  2859. lodash.prototype.constructor = lodash;
  2860. LodashWrapper.prototype = baseCreate(baseLodash.prototype);
  2861. LodashWrapper.prototype.constructor = LodashWrapper;
  2862. /*------------------------------------------------------------------------*/
  2863. /**
  2864. * Creates a lazy wrapper object which wraps `value` to enable lazy evaluation.
  2865. *
  2866. * @private
  2867. * @constructor
  2868. * @param {*} value The value to wrap.
  2869. */
  2870. function LazyWrapper(value) {
  2871. this.__wrapped__ = value;
  2872. this.__actions__ = [];
  2873. this.__dir__ = 1;
  2874. this.__filtered__ = false;
  2875. this.__iteratees__ = [];
  2876. this.__takeCount__ = MAX_ARRAY_LENGTH;
  2877. this.__views__ = [];
  2878. }
  2879. /**
  2880. * Creates a clone of the lazy wrapper object.
  2881. *
  2882. * @private
  2883. * @name clone
  2884. * @memberOf LazyWrapper
  2885. * @returns {Object} Returns the cloned `LazyWrapper` object.
  2886. */
  2887. function lazyClone() {
  2888. var result = new LazyWrapper(this.__wrapped__);
  2889. result.__actions__ = copyArray(this.__actions__);
  2890. result.__dir__ = this.__dir__;
  2891. result.__filtered__ = this.__filtered__;
  2892. result.__iteratees__ = copyArray(this.__iteratees__);
  2893. result.__takeCount__ = this.__takeCount__;
  2894. result.__views__ = copyArray(this.__views__);
  2895. return result;
  2896. }
  2897. /**
  2898. * Reverses the direction of lazy iteration.
  2899. *
  2900. * @private
  2901. * @name reverse
  2902. * @memberOf LazyWrapper
  2903. * @returns {Object} Returns the new reversed `LazyWrapper` object.
  2904. */
  2905. function lazyReverse() {
  2906. if (this.__filtered__) {
  2907. var result = new LazyWrapper(this);
  2908. result.__dir__ = -1;
  2909. result.__filtered__ = true;
  2910. } else {
  2911. result = this.clone();
  2912. result.__dir__ *= -1;
  2913. }
  2914. return result;
  2915. }
  2916. /**
  2917. * Extracts the unwrapped value from its lazy wrapper.
  2918. *
  2919. * @private
  2920. * @name value
  2921. * @memberOf LazyWrapper
  2922. * @returns {*} Returns the unwrapped value.
  2923. */
  2924. function lazyValue() {
  2925. var array = this.__wrapped__.value(),
  2926. dir = this.__dir__,
  2927. isArr = isArray(array),
  2928. isRight = dir < 0,
  2929. arrLength = isArr ? array.length : 0,
  2930. view = getView(0, arrLength, this.__views__),
  2931. start = view.start,
  2932. end = view.end,
  2933. length = end - start,
  2934. index = isRight ? end : (start - 1),
  2935. iteratees = this.__iteratees__,
  2936. iterLength = iteratees.length,
  2937. resIndex = 0,
  2938. takeCount = nativeMin(length, this.__takeCount__);
  2939. if (!isArr || (!isRight && arrLength == length && takeCount == length)) {
  2940. return baseWrapperValue(array, this.__actions__);
  2941. }
  2942. var result = [];
  2943. outer:
  2944. while (length-- && resIndex < takeCount) {
  2945. index += dir;
  2946. var iterIndex = -1,
  2947. value = array[index];
  2948. while (++iterIndex < iterLength) {
  2949. var data = iteratees[iterIndex],
  2950. iteratee = data.iteratee,
  2951. type = data.type,
  2952. computed = iteratee(value);
  2953. if (type == LAZY_MAP_FLAG) {
  2954. value = computed;
  2955. } else if (!computed) {
  2956. if (type == LAZY_FILTER_FLAG) {
  2957. continue outer;
  2958. } else {
  2959. break outer;
  2960. }
  2961. }
  2962. }
  2963. result[resIndex++] = value;
  2964. }
  2965. return result;
  2966. }
  2967. // Ensure `LazyWrapper` is an instance of `baseLodash`.
  2968. LazyWrapper.prototype = baseCreate(baseLodash.prototype);
  2969. LazyWrapper.prototype.constructor = LazyWrapper;
  2970. /*------------------------------------------------------------------------*/
  2971. /**
  2972. * Creates a hash object.
  2973. *
  2974. * @private
  2975. * @constructor
  2976. * @param {Array} [entries] The key-value pairs to cache.
  2977. */
  2978. function Hash(entries) {
  2979. var index = -1,
  2980. length = entries == null ? 0 : entries.length;
  2981. this.clear();
  2982. while (++index < length) {
  2983. var entry = entries[index];
  2984. this.set(entry[0], entry[1]);
  2985. }
  2986. }
  2987. /**
  2988. * Removes all key-value entries from the hash.
  2989. *
  2990. * @private
  2991. * @name clear
  2992. * @memberOf Hash
  2993. */
  2994. function hashClear() {
  2995. this.__data__ = nativeCreate ? nativeCreate(null) : {};
  2996. this.size = 0;
  2997. }
  2998. /**
  2999. * Removes `key` and its value from the hash.
  3000. *
  3001. * @private
  3002. * @name delete
  3003. * @memberOf Hash
  3004. * @param {Object} hash The hash to modify.
  3005. * @param {string} key The key of the value to remove.
  3006. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  3007. */
  3008. function hashDelete(key) {
  3009. var result = this.has(key) && delete this.__data__[key];
  3010. this.size -= result ? 1 : 0;
  3011. return result;
  3012. }
  3013. /**
  3014. * Gets the hash value for `key`.
  3015. *
  3016. * @private
  3017. * @name get
  3018. * @memberOf Hash
  3019. * @param {string} key The key of the value to get.
  3020. * @returns {*} Returns the entry value.
  3021. */
  3022. function hashGet(key) {
  3023. var data = this.__data__;
  3024. if (nativeCreate) {
  3025. var result = data[key];
  3026. return result === HASH_UNDEFINED ? undefined : result;
  3027. }
  3028. return hasOwnProperty.call(data, key) ? data[key] : undefined;
  3029. }
  3030. /**
  3031. * Checks if a hash value for `key` exists.
  3032. *
  3033. * @private
  3034. * @name has
  3035. * @memberOf Hash
  3036. * @param {string} key The key of the entry to check.
  3037. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  3038. */
  3039. function hashHas(key) {
  3040. var data = this.__data__;
  3041. return nativeCreate ? (data[key] !== undefined) : hasOwnProperty.call(data, key);
  3042. }
  3043. /**
  3044. * Sets the hash `key` to `value`.
  3045. *
  3046. * @private
  3047. * @name set
  3048. * @memberOf Hash
  3049. * @param {string} key The key of the value to set.
  3050. * @param {*} value The value to set.
  3051. * @returns {Object} Returns the hash instance.
  3052. */
  3053. function hashSet(key, value) {
  3054. var data = this.__data__;
  3055. this.size += this.has(key) ? 0 : 1;
  3056. data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value;
  3057. return this;
  3058. }
  3059. // Add methods to `Hash`.
  3060. Hash.prototype.clear = hashClear;
  3061. Hash.prototype['delete'] = hashDelete;
  3062. Hash.prototype.get = hashGet;
  3063. Hash.prototype.has = hashHas;
  3064. Hash.prototype.set = hashSet;
  3065. /*------------------------------------------------------------------------*/
  3066. /**
  3067. * Creates an list cache object.
  3068. *
  3069. * @private
  3070. * @constructor
  3071. * @param {Array} [entries] The key-value pairs to cache.
  3072. */
  3073. function ListCache(entries) {
  3074. var index = -1,
  3075. length = entries == null ? 0 : entries.length;
  3076. this.clear();
  3077. while (++index < length) {
  3078. var entry = entries[index];
  3079. this.set(entry[0], entry[1]);
  3080. }
  3081. }
  3082. /**
  3083. * Removes all key-value entries from the list cache.
  3084. *
  3085. * @private
  3086. * @name clear
  3087. * @memberOf ListCache
  3088. */
  3089. function listCacheClear() {
  3090. this.__data__ = [];
  3091. this.size = 0;
  3092. }
  3093. /**
  3094. * Removes `key` and its value from the list cache.
  3095. *
  3096. * @private
  3097. * @name delete
  3098. * @memberOf ListCache
  3099. * @param {string} key The key of the value to remove.
  3100. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  3101. */
  3102. function listCacheDelete(key) {
  3103. var data = this.__data__,
  3104. index = assocIndexOf(data, key);
  3105. if (index < 0) {
  3106. return false;
  3107. }
  3108. var lastIndex = data.length - 1;
  3109. if (index == lastIndex) {
  3110. data.pop();
  3111. } else {
  3112. splice.call(data, index, 1);
  3113. }
  3114. --this.size;
  3115. return true;
  3116. }
  3117. /**
  3118. * Gets the list cache value for `key`.
  3119. *
  3120. * @private
  3121. * @name get
  3122. * @memberOf ListCache
  3123. * @param {string} key The key of the value to get.
  3124. * @returns {*} Returns the entry value.
  3125. */
  3126. function listCacheGet(key) {
  3127. var data = this.__data__,
  3128. index = assocIndexOf(data, key);
  3129. return index < 0 ? undefined : data[index][1];
  3130. }
  3131. /**
  3132. * Checks if a list cache value for `key` exists.
  3133. *
  3134. * @private
  3135. * @name has
  3136. * @memberOf ListCache
  3137. * @param {string} key The key of the entry to check.
  3138. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  3139. */
  3140. function listCacheHas(key) {
  3141. return assocIndexOf(this.__data__, key) > -1;
  3142. }
  3143. /**
  3144. * Sets the list cache `key` to `value`.
  3145. *
  3146. * @private
  3147. * @name set
  3148. * @memberOf ListCache
  3149. * @param {string} key The key of the value to set.
  3150. * @param {*} value The value to set.
  3151. * @returns {Object} Returns the list cache instance.
  3152. */
  3153. function listCacheSet(key, value) {
  3154. var data = this.__data__,
  3155. index = assocIndexOf(data, key);
  3156. if (index < 0) {
  3157. ++this.size;
  3158. data.push([key, value]);
  3159. } else {
  3160. data[index][1] = value;
  3161. }
  3162. return this;
  3163. }
  3164. // Add methods to `ListCache`.
  3165. ListCache.prototype.clear = listCacheClear;
  3166. ListCache.prototype['delete'] = listCacheDelete;
  3167. ListCache.prototype.get = listCacheGet;
  3168. ListCache.prototype.has = listCacheHas;
  3169. ListCache.prototype.set = listCacheSet;
  3170. /*------------------------------------------------------------------------*/
  3171. /**
  3172. * Creates a map cache object to store key-value pairs.
  3173. *
  3174. * @private
  3175. * @constructor
  3176. * @param {Array} [entries] The key-value pairs to cache.
  3177. */
  3178. function MapCache(entries) {
  3179. var index = -1,
  3180. length = entries == null ? 0 : entries.length;
  3181. this.clear();
  3182. while (++index < length) {
  3183. var entry = entries[index];
  3184. this.set(entry[0], entry[1]);
  3185. }
  3186. }
  3187. /**
  3188. * Removes all key-value entries from the map.
  3189. *
  3190. * @private
  3191. * @name clear
  3192. * @memberOf MapCache
  3193. */
  3194. function mapCacheClear() {
  3195. this.size = 0;
  3196. this.__data__ = {
  3197. 'hash': new Hash,
  3198. 'map': new (Map || ListCache),
  3199. 'string': new Hash
  3200. };
  3201. }
  3202. /**
  3203. * Removes `key` and its value from the map.
  3204. *
  3205. * @private
  3206. * @name delete
  3207. * @memberOf MapCache
  3208. * @param {string} key The key of the value to remove.
  3209. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  3210. */
  3211. function mapCacheDelete(key) {
  3212. var result = getMapData(this, key)['delete'](key);
  3213. this.size -= result ? 1 : 0;
  3214. return result;
  3215. }
  3216. /**
  3217. * Gets the map value for `key`.
  3218. *
  3219. * @private
  3220. * @name get
  3221. * @memberOf MapCache
  3222. * @param {string} key The key of the value to get.
  3223. * @returns {*} Returns the entry value.
  3224. */
  3225. function mapCacheGet(key) {
  3226. return getMapData(this, key).get(key);
  3227. }
  3228. /**
  3229. * Checks if a map value for `key` exists.
  3230. *
  3231. * @private
  3232. * @name has
  3233. * @memberOf MapCache
  3234. * @param {string} key The key of the entry to check.
  3235. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  3236. */
  3237. function mapCacheHas(key) {
  3238. return getMapData(this, key).has(key);
  3239. }
  3240. /**
  3241. * Sets the map `key` to `value`.
  3242. *
  3243. * @private
  3244. * @name set
  3245. * @memberOf MapCache
  3246. * @param {string} key The key of the value to set.
  3247. * @param {*} value The value to set.
  3248. * @returns {Object} Returns the map cache instance.
  3249. */
  3250. function mapCacheSet(key, value) {
  3251. var data = getMapData(this, key),
  3252. size = data.size;
  3253. data.set(key, value);
  3254. this.size += data.size == size ? 0 : 1;
  3255. return this;
  3256. }
  3257. // Add methods to `MapCache`.
  3258. MapCache.prototype.clear = mapCacheClear;
  3259. MapCache.prototype['delete'] = mapCacheDelete;
  3260. MapCache.prototype.get = mapCacheGet;
  3261. MapCache.prototype.has = mapCacheHas;
  3262. MapCache.prototype.set = mapCacheSet;
  3263. /*------------------------------------------------------------------------*/
  3264. /**
  3265. *
  3266. * Creates an array cache object to store unique values.
  3267. *
  3268. * @private
  3269. * @constructor
  3270. * @param {Array} [values] The values to cache.
  3271. */
  3272. function SetCache(values) {
  3273. var index = -1,
  3274. length = values == null ? 0 : values.length;
  3275. this.__data__ = new MapCache;
  3276. while (++index < length) {
  3277. this.add(values[index]);
  3278. }
  3279. }
  3280. /**
  3281. * Adds `value` to the array cache.
  3282. *
  3283. * @private
  3284. * @name add
  3285. * @memberOf SetCache
  3286. * @alias push
  3287. * @param {*} value The value to cache.
  3288. * @returns {Object} Returns the cache instance.
  3289. */
  3290. function setCacheAdd(value) {
  3291. this.__data__.set(value, HASH_UNDEFINED);
  3292. return this;
  3293. }
  3294. /**
  3295. * Checks if `value` is in the array cache.
  3296. *
  3297. * @private
  3298. * @name has
  3299. * @memberOf SetCache
  3300. * @param {*} value The value to search for.
  3301. * @returns {number} Returns `true` if `value` is found, else `false`.
  3302. */
  3303. function setCacheHas(value) {
  3304. return this.__data__.has(value);
  3305. }
  3306. // Add methods to `SetCache`.
  3307. SetCache.prototype.add = SetCache.prototype.push = setCacheAdd;
  3308. SetCache.prototype.has = setCacheHas;
  3309. /*------------------------------------------------------------------------*/
  3310. /**
  3311. * Creates a stack cache object to store key-value pairs.
  3312. *
  3313. * @private
  3314. * @constructor
  3315. * @param {Array} [entries] The key-value pairs to cache.
  3316. */
  3317. function Stack(entries) {
  3318. var data = this.__data__ = new ListCache(entries);
  3319. this.size = data.size;
  3320. }
  3321. /**
  3322. * Removes all key-value entries from the stack.
  3323. *
  3324. * @private
  3325. * @name clear
  3326. * @memberOf Stack
  3327. */
  3328. function stackClear() {
  3329. this.__data__ = new ListCache;
  3330. this.size = 0;
  3331. }
  3332. /**
  3333. * Removes `key` and its value from the stack.
  3334. *
  3335. * @private
  3336. * @name delete
  3337. * @memberOf Stack
  3338. * @param {string} key The key of the value to remove.
  3339. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  3340. */
  3341. function stackDelete(key) {
  3342. var data = this.__data__,
  3343. result = data['delete'](key);
  3344. this.size = data.size;
  3345. return result;
  3346. }
  3347. /**
  3348. * Gets the stack value for `key`.
  3349. *
  3350. * @private
  3351. * @name get
  3352. * @memberOf Stack
  3353. * @param {string} key The key of the value to get.
  3354. * @returns {*} Returns the entry value.
  3355. */
  3356. function stackGet(key) {
  3357. return this.__data__.get(key);
  3358. }
  3359. /**
  3360. * Checks if a stack value for `key` exists.
  3361. *
  3362. * @private
  3363. * @name has
  3364. * @memberOf Stack
  3365. * @param {string} key The key of the entry to check.
  3366. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  3367. */
  3368. function stackHas(key) {
  3369. return this.__data__.has(key);
  3370. }
  3371. /**
  3372. * Sets the stack `key` to `value`.
  3373. *
  3374. * @private
  3375. * @name set
  3376. * @memberOf Stack
  3377. * @param {string} key The key of the value to set.
  3378. * @param {*} value The value to set.
  3379. * @returns {Object} Returns the stack cache instance.
  3380. */
  3381. function stackSet(key, value) {
  3382. var data = this.__data__;
  3383. if (data instanceof ListCache) {
  3384. var pairs = data.__data__;
  3385. if (!Map || (pairs.length < LARGE_ARRAY_SIZE - 1)) {
  3386. pairs.push([key, value]);
  3387. this.size = ++data.size;
  3388. return this;
  3389. }
  3390. data = this.__data__ = new MapCache(pairs);
  3391. }
  3392. data.set(key, value);
  3393. this.size = data.size;
  3394. return this;
  3395. }
  3396. // Add methods to `Stack`.
  3397. Stack.prototype.clear = stackClear;
  3398. Stack.prototype['delete'] = stackDelete;
  3399. Stack.prototype.get = stackGet;
  3400. Stack.prototype.has = stackHas;
  3401. Stack.prototype.set = stackSet;
  3402. /*------------------------------------------------------------------------*/
  3403. /**
  3404. * Creates an array of the enumerable property names of the array-like `value`.
  3405. *
  3406. * @private
  3407. * @param {*} value The value to query.
  3408. * @param {boolean} inherited Specify returning inherited property names.
  3409. * @returns {Array} Returns the array of property names.
  3410. */
  3411. function arrayLikeKeys(value, inherited) {
  3412. var isArr = isArray(value),
  3413. isArg = !isArr && isArguments(value),
  3414. isBuff = !isArr && !isArg && isBuffer(value),
  3415. isType = !isArr && !isArg && !isBuff && isTypedArray(value),
  3416. skipIndexes = isArr || isArg || isBuff || isType,
  3417. result = skipIndexes ? baseTimes(value.length, String) : [],
  3418. length = result.length;
  3419. for (var key in value) {
  3420. if ((inherited || hasOwnProperty.call(value, key)) &&
  3421. !(skipIndexes && (
  3422. // Safari 9 has enumerable `arguments.length` in strict mode.
  3423. key == 'length' ||
  3424. // Node.js 0.10 has enumerable non-index properties on buffers.
  3425. (isBuff && (key == 'offset' || key == 'parent')) ||
  3426. // PhantomJS 2 has enumerable non-index properties on typed arrays.
  3427. (isType && (key == 'buffer' || key == 'byteLength' || key == 'byteOffset')) ||
  3428. // Skip index properties.
  3429. isIndex(key, length)
  3430. ))) {
  3431. result.push(key);
  3432. }
  3433. }
  3434. return result;
  3435. }
  3436. /**
  3437. * A specialized version of `_.sample` for arrays.
  3438. *
  3439. * @private
  3440. * @param {Array} array The array to sample.
  3441. * @returns {*} Returns the random element.
  3442. */
  3443. function arraySample(array) {
  3444. var length = array.length;
  3445. return length ? array[baseRandom(0, length - 1)] : undefined;
  3446. }
  3447. /**
  3448. * A specialized version of `_.sampleSize` for arrays.
  3449. *
  3450. * @private
  3451. * @param {Array} array The array to sample.
  3452. * @param {number} n The number of elements to sample.
  3453. * @returns {Array} Returns the random elements.
  3454. */
  3455. function arraySampleSize(array, n) {
  3456. return shuffleSelf(copyArray(array), baseClamp(n, 0, array.length));
  3457. }
  3458. /**
  3459. * A specialized version of `_.shuffle` for arrays.
  3460. *
  3461. * @private
  3462. * @param {Array} array The array to shuffle.
  3463. * @returns {Array} Returns the new shuffled array.
  3464. */
  3465. function arrayShuffle(array) {
  3466. return shuffleSelf(copyArray(array));
  3467. }
  3468. /**
  3469. * This function is like `assignValue` except that it doesn't assign
  3470. * `undefined` values.
  3471. *
  3472. * @private
  3473. * @param {Object} object The object to modify.
  3474. * @param {string} key The key of the property to assign.
  3475. * @param {*} value The value to assign.
  3476. */
  3477. function assignMergeValue(object, key, value) {
  3478. if ((value !== undefined && !eq(object[key], value)) ||
  3479. (value === undefined && !(key in object))) {
  3480. baseAssignValue(object, key, value);
  3481. }
  3482. }
  3483. /**
  3484. * Assigns `value` to `key` of `object` if the existing value is not equivalent
  3485. * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  3486. * for equality comparisons.
  3487. *
  3488. * @private
  3489. * @param {Object} object The object to modify.
  3490. * @param {string} key The key of the property to assign.
  3491. * @param {*} value The value to assign.
  3492. */
  3493. function assignValue(object, key, value) {
  3494. var objValue = object[key];
  3495. if (!(hasOwnProperty.call(object, key) && eq(objValue, value)) ||
  3496. (value === undefined && !(key in object))) {
  3497. baseAssignValue(object, key, value);
  3498. }
  3499. }
  3500. /**
  3501. * Gets the index at which the `key` is found in `array` of key-value pairs.
  3502. *
  3503. * @private
  3504. * @param {Array} array The array to inspect.
  3505. * @param {*} key The key to search for.
  3506. * @returns {number} Returns the index of the matched value, else `-1`.
  3507. */
  3508. function assocIndexOf(array, key) {
  3509. var length = array.length;
  3510. while (length--) {
  3511. if (eq(array[length][0], key)) {
  3512. return length;
  3513. }
  3514. }
  3515. return -1;
  3516. }
  3517. /**
  3518. * Aggregates elements of `collection` on `accumulator` with keys transformed
  3519. * by `iteratee` and values set by `setter`.
  3520. *
  3521. * @private
  3522. * @param {Array|Object} collection The collection to iterate over.
  3523. * @param {Function} setter The function to set `accumulator` values.
  3524. * @param {Function} iteratee The iteratee to transform keys.
  3525. * @param {Object} accumulator The initial aggregated object.
  3526. * @returns {Function} Returns `accumulator`.
  3527. */
  3528. function baseAggregator(collection, setter, iteratee, accumulator) {
  3529. baseEach(collection, function(value, key, collection) {
  3530. setter(accumulator, value, iteratee(value), collection);
  3531. });
  3532. return accumulator;
  3533. }
  3534. /**
  3535. * The base implementation of `_.assign` without support for multiple sources
  3536. * or `customizer` functions.
  3537. *
  3538. * @private
  3539. * @param {Object} object The destination object.
  3540. * @param {Object} source The source object.
  3541. * @returns {Object} Returns `object`.
  3542. */
  3543. function baseAssign(object, source) {
  3544. return object && copyObject(source, keys(source), object);
  3545. }
  3546. /**
  3547. * The base implementation of `_.assignIn` without support for multiple sources
  3548. * or `customizer` functions.
  3549. *
  3550. * @private
  3551. * @param {Object} object The destination object.
  3552. * @param {Object} source The source object.
  3553. * @returns {Object} Returns `object`.
  3554. */
  3555. function baseAssignIn(object, source) {
  3556. return object && copyObject(source, keysIn(source), object);
  3557. }
  3558. /**
  3559. * The base implementation of `assignValue` and `assignMergeValue` without
  3560. * value checks.
  3561. *
  3562. * @private
  3563. * @param {Object} object The object to modify.
  3564. * @param {string} key The key of the property to assign.
  3565. * @param {*} value The value to assign.
  3566. */
  3567. function baseAssignValue(object, key, value) {
  3568. if (key == '__proto__' && defineProperty) {
  3569. defineProperty(object, key, {
  3570. 'configurable': true,
  3571. 'enumerable': true,
  3572. 'value': value,
  3573. 'writable': true
  3574. });
  3575. } else {
  3576. object[key] = value;
  3577. }
  3578. }
  3579. /**
  3580. * The base implementation of `_.at` without support for individual paths.
  3581. *
  3582. * @private
  3583. * @param {Object} object The object to iterate over.
  3584. * @param {string[]} paths The property paths to pick.
  3585. * @returns {Array} Returns the picked elements.
  3586. */
  3587. function baseAt(object, paths) {
  3588. var index = -1,
  3589. length = paths.length,
  3590. result = Array(length),
  3591. skip = object == null;
  3592. while (++index < length) {
  3593. result[index] = skip ? undefined : get(object, paths[index]);
  3594. }
  3595. return result;
  3596. }
  3597. /**
  3598. * The base implementation of `_.clamp` which doesn't coerce arguments.
  3599. *
  3600. * @private
  3601. * @param {number} number The number to clamp.
  3602. * @param {number} [lower] The lower bound.
  3603. * @param {number} upper The upper bound.
  3604. * @returns {number} Returns the clamped number.
  3605. */
  3606. function baseClamp(number, lower, upper) {
  3607. if (number === number) {
  3608. if (upper !== undefined) {
  3609. number = number <= upper ? number : upper;
  3610. }
  3611. if (lower !== undefined) {
  3612. number = number >= lower ? number : lower;
  3613. }
  3614. }
  3615. return number;
  3616. }
  3617. /**
  3618. * The base implementation of `_.clone` and `_.cloneDeep` which tracks
  3619. * traversed objects.
  3620. *
  3621. * @private
  3622. * @param {*} value The value to clone.
  3623. * @param {boolean} bitmask The bitmask flags.
  3624. * 1 - Deep clone
  3625. * 2 - Flatten inherited properties
  3626. * 4 - Clone symbols
  3627. * @param {Function} [customizer] The function to customize cloning.
  3628. * @param {string} [key] The key of `value`.
  3629. * @param {Object} [object] The parent object of `value`.
  3630. * @param {Object} [stack] Tracks traversed objects and their clone counterparts.
  3631. * @returns {*} Returns the cloned value.
  3632. */
  3633. function baseClone(value, bitmask, customizer, key, object, stack) {
  3634. var result,
  3635. isDeep = bitmask & CLONE_DEEP_FLAG,
  3636. isFlat = bitmask & CLONE_FLAT_FLAG,
  3637. isFull = bitmask & CLONE_SYMBOLS_FLAG;
  3638. if (customizer) {
  3639. result = object ? customizer(value, key, object, stack) : customizer(value);
  3640. }
  3641. if (result !== undefined) {
  3642. return result;
  3643. }
  3644. if (!isObject(value)) {
  3645. return value;
  3646. }
  3647. var isArr = isArray(value);
  3648. if (isArr) {
  3649. result = initCloneArray(value);
  3650. if (!isDeep) {
  3651. return copyArray(value, result);
  3652. }
  3653. } else {
  3654. var tag = getTag(value),
  3655. isFunc = tag == funcTag || tag == genTag;
  3656. if (isBuffer(value)) {
  3657. return cloneBuffer(value, isDeep);
  3658. }
  3659. if (tag == objectTag || tag == argsTag || (isFunc && !object)) {
  3660. result = (isFlat || isFunc) ? {} : initCloneObject(value);
  3661. if (!isDeep) {
  3662. return isFlat
  3663. ? copySymbolsIn(value, baseAssignIn(result, value))
  3664. : copySymbols(value, baseAssign(result, value));
  3665. }
  3666. } else {
  3667. if (!cloneableTags[tag]) {
  3668. return object ? value : {};
  3669. }
  3670. result = initCloneByTag(value, tag, isDeep);
  3671. }
  3672. }
  3673. // Check for circular references and return its corresponding clone.
  3674. stack || (stack = new Stack);
  3675. var stacked = stack.get(value);
  3676. if (stacked) {
  3677. return stacked;
  3678. }
  3679. stack.set(value, result);
  3680. if (isSet(value)) {
  3681. value.forEach(function(subValue) {
  3682. result.add(baseClone(subValue, bitmask, customizer, subValue, value, stack));
  3683. });
  3684. } else if (isMap(value)) {
  3685. value.forEach(function(subValue, key) {
  3686. result.set(key, baseClone(subValue, bitmask, customizer, key, value, stack));
  3687. });
  3688. }
  3689. var keysFunc = isFull
  3690. ? (isFlat ? getAllKeysIn : getAllKeys)
  3691. : (isFlat ? keysIn : keys);
  3692. var props = isArr ? undefined : keysFunc(value);
  3693. arrayEach(props || value, function(subValue, key) {
  3694. if (props) {
  3695. key = subValue;
  3696. subValue = value[key];
  3697. }
  3698. // Recursively populate clone (susceptible to call stack limits).
  3699. assignValue(result, key, baseClone(subValue, bitmask, customizer, key, value, stack));
  3700. });
  3701. return result;
  3702. }
  3703. /**
  3704. * The base implementation of `_.conforms` which doesn't clone `source`.
  3705. *
  3706. * @private
  3707. * @param {Object} source The object of property predicates to conform to.
  3708. * @returns {Function} Returns the new spec function.
  3709. */
  3710. function baseConforms(source) {
  3711. var props = keys(source);
  3712. return function(object) {
  3713. return baseConformsTo(object, source, props);
  3714. };
  3715. }
  3716. /**
  3717. * The base implementation of `_.conformsTo` which accepts `props` to check.
  3718. *
  3719. * @private
  3720. * @param {Object} object The object to inspect.
  3721. * @param {Object} source The object of property predicates to conform to.
  3722. * @returns {boolean} Returns `true` if `object` conforms, else `false`.
  3723. */
  3724. function baseConformsTo(object, source, props) {
  3725. var length = props.length;
  3726. if (object == null) {
  3727. return !length;
  3728. }
  3729. object = Object(object);
  3730. while (length--) {
  3731. var key = props[length],
  3732. predicate = source[key],
  3733. value = object[key];
  3734. if ((value === undefined && !(key in object)) || !predicate(value)) {
  3735. return false;
  3736. }
  3737. }
  3738. return true;
  3739. }
  3740. /**
  3741. * The base implementation of `_.delay` and `_.defer` which accepts `args`
  3742. * to provide to `func`.
  3743. *
  3744. * @private
  3745. * @param {Function} func The function to delay.
  3746. * @param {number} wait The number of milliseconds to delay invocation.
  3747. * @param {Array} args The arguments to provide to `func`.
  3748. * @returns {number|Object} Returns the timer id or timeout object.
  3749. */
  3750. function baseDelay(func, wait, args) {
  3751. if (typeof func != 'function') {
  3752. throw new TypeError(FUNC_ERROR_TEXT);
  3753. }
  3754. return setTimeout(function() { func.apply(undefined, args); }, wait);
  3755. }
  3756. /**
  3757. * The base implementation of methods like `_.difference` without support
  3758. * for excluding multiple arrays or iteratee shorthands.
  3759. *
  3760. * @private
  3761. * @param {Array} array The array to inspect.
  3762. * @param {Array} values The values to exclude.
  3763. * @param {Function} [iteratee] The iteratee invoked per element.
  3764. * @param {Function} [comparator] The comparator invoked per element.
  3765. * @returns {Array} Returns the new array of filtered values.
  3766. */
  3767. function baseDifference(array, values, iteratee, comparator) {
  3768. var index = -1,
  3769. includes = arrayIncludes,
  3770. isCommon = true,
  3771. length = array.length,
  3772. result = [],
  3773. valuesLength = values.length;
  3774. if (!length) {
  3775. return result;
  3776. }
  3777. if (iteratee) {
  3778. values = arrayMap(values, baseUnary(iteratee));
  3779. }
  3780. if (comparator) {
  3781. includes = arrayIncludesWith;
  3782. isCommon = false;
  3783. }
  3784. else if (values.length >= LARGE_ARRAY_SIZE) {
  3785. includes = cacheHas;
  3786. isCommon = false;
  3787. values = new SetCache(values);
  3788. }
  3789. outer:
  3790. while (++index < length) {
  3791. var value = array[index],
  3792. computed = iteratee == null ? value : iteratee(value);
  3793. value = (comparator || value !== 0) ? value : 0;
  3794. if (isCommon && computed === computed) {
  3795. var valuesIndex = valuesLength;
  3796. while (valuesIndex--) {
  3797. if (values[valuesIndex] === computed) {
  3798. continue outer;
  3799. }
  3800. }
  3801. result.push(value);
  3802. }
  3803. else if (!includes(values, computed, comparator)) {
  3804. result.push(value);
  3805. }
  3806. }
  3807. return result;
  3808. }
  3809. /**
  3810. * The base implementation of `_.forEach` without support for iteratee shorthands.
  3811. *
  3812. * @private
  3813. * @param {Array|Object} collection The collection to iterate over.
  3814. * @param {Function} iteratee The function invoked per iteration.
  3815. * @returns {Array|Object} Returns `collection`.
  3816. */
  3817. var baseEach = createBaseEach(baseForOwn);
  3818. /**
  3819. * The base implementation of `_.forEachRight` without support for iteratee shorthands.
  3820. *
  3821. * @private
  3822. * @param {Array|Object} collection The collection to iterate over.
  3823. * @param {Function} iteratee The function invoked per iteration.
  3824. * @returns {Array|Object} Returns `collection`.
  3825. */
  3826. var baseEachRight = createBaseEach(baseForOwnRight, true);
  3827. /**
  3828. * The base implementation of `_.every` without support for iteratee shorthands.
  3829. *
  3830. * @private
  3831. * @param {Array|Object} collection The collection to iterate over.
  3832. * @param {Function} predicate The function invoked per iteration.
  3833. * @returns {boolean} Returns `true` if all elements pass the predicate check,
  3834. * else `false`
  3835. */
  3836. function baseEvery(collection, predicate) {
  3837. var result = true;
  3838. baseEach(collection, function(value, index, collection) {
  3839. result = !!predicate(value, index, collection);
  3840. return result;
  3841. });
  3842. return result;
  3843. }
  3844. /**
  3845. * The base implementation of methods like `_.max` and `_.min` which accepts a
  3846. * `comparator` to determine the extremum value.
  3847. *
  3848. * @private
  3849. * @param {Array} array The array to iterate over.
  3850. * @param {Function} iteratee The iteratee invoked per iteration.
  3851. * @param {Function} comparator The comparator used to compare values.
  3852. * @returns {*} Returns the extremum value.
  3853. */
  3854. function baseExtremum(array, iteratee, comparator) {
  3855. var index = -1,
  3856. length = array.length;
  3857. while (++index < length) {
  3858. var value = array[index],
  3859. current = iteratee(value);
  3860. if (current != null && (computed === undefined
  3861. ? (current === current && !isSymbol(current))
  3862. : comparator(current, computed)
  3863. )) {
  3864. var computed = current,
  3865. result = value;
  3866. }
  3867. }
  3868. return result;
  3869. }
  3870. /**
  3871. * The base implementation of `_.fill` without an iteratee call guard.
  3872. *
  3873. * @private
  3874. * @param {Array} array The array to fill.
  3875. * @param {*} value The value to fill `array` with.
  3876. * @param {number} [start=0] The start position.
  3877. * @param {number} [end=array.length] The end position.
  3878. * @returns {Array} Returns `array`.
  3879. */
  3880. function baseFill(array, value, start, end) {
  3881. var length = array.length;
  3882. start = toInteger(start);
  3883. if (start < 0) {
  3884. start = -start > length ? 0 : (length + start);
  3885. }
  3886. end = (end === undefined || end > length) ? length : toInteger(end);
  3887. if (end < 0) {
  3888. end += length;
  3889. }
  3890. end = start > end ? 0 : toLength(end);
  3891. while (start < end) {
  3892. array[start++] = value;
  3893. }
  3894. return array;
  3895. }
  3896. /**
  3897. * The base implementation of `_.filter` without support for iteratee shorthands.
  3898. *
  3899. * @private
  3900. * @param {Array|Object} collection The collection to iterate over.
  3901. * @param {Function} predicate The function invoked per iteration.
  3902. * @returns {Array} Returns the new filtered array.
  3903. */
  3904. function baseFilter(collection, predicate) {
  3905. var result = [];
  3906. baseEach(collection, function(value, index, collection) {
  3907. if (predicate(value, index, collection)) {
  3908. result.push(value);
  3909. }
  3910. });
  3911. return result;
  3912. }
  3913. /**
  3914. * The base implementation of `_.flatten` with support for restricting flattening.
  3915. *
  3916. * @private
  3917. * @param {Array} array The array to flatten.
  3918. * @param {number} depth The maximum recursion depth.
  3919. * @param {boolean} [predicate=isFlattenable] The function invoked per iteration.
  3920. * @param {boolean} [isStrict] Restrict to values that pass `predicate` checks.
  3921. * @param {Array} [result=[]] The initial result value.
  3922. * @returns {Array} Returns the new flattened array.
  3923. */
  3924. function baseFlatten(array, depth, predicate, isStrict, result) {
  3925. var index = -1,
  3926. length = array.length;
  3927. predicate || (predicate = isFlattenable);
  3928. result || (result = []);
  3929. while (++index < length) {
  3930. var value = array[index];
  3931. if (depth > 0 && predicate(value)) {
  3932. if (depth > 1) {
  3933. // Recursively flatten arrays (susceptible to call stack limits).
  3934. baseFlatten(value, depth - 1, predicate, isStrict, result);
  3935. } else {
  3936. arrayPush(result, value);
  3937. }
  3938. } else if (!isStrict) {
  3939. result[result.length] = value;
  3940. }
  3941. }
  3942. return result;
  3943. }
  3944. /**
  3945. * The base implementation of `baseForOwn` which iterates over `object`
  3946. * properties returned by `keysFunc` and invokes `iteratee` for each property.
  3947. * Iteratee functions may exit iteration early by explicitly returning `false`.
  3948. *
  3949. * @private
  3950. * @param {Object} object The object to iterate over.
  3951. * @param {Function} iteratee The function invoked per iteration.
  3952. * @param {Function} keysFunc The function to get the keys of `object`.
  3953. * @returns {Object} Returns `object`.
  3954. */
  3955. var baseFor = createBaseFor();
  3956. /**
  3957. * This function is like `baseFor` except that it iterates over properties
  3958. * in the opposite order.
  3959. *
  3960. * @private
  3961. * @param {Object} object The object to iterate over.
  3962. * @param {Function} iteratee The function invoked per iteration.
  3963. * @param {Function} keysFunc The function to get the keys of `object`.
  3964. * @returns {Object} Returns `object`.
  3965. */
  3966. var baseForRight = createBaseFor(true);
  3967. /**
  3968. * The base implementation of `_.forOwn` without support for iteratee shorthands.
  3969. *
  3970. * @private
  3971. * @param {Object} object The object to iterate over.
  3972. * @param {Function} iteratee The function invoked per iteration.
  3973. * @returns {Object} Returns `object`.
  3974. */
  3975. function baseForOwn(object, iteratee) {
  3976. return object && baseFor(object, iteratee, keys);
  3977. }
  3978. /**
  3979. * The base implementation of `_.forOwnRight` without support for iteratee shorthands.
  3980. *
  3981. * @private
  3982. * @param {Object} object The object to iterate over.
  3983. * @param {Function} iteratee The function invoked per iteration.
  3984. * @returns {Object} Returns `object`.
  3985. */
  3986. function baseForOwnRight(object, iteratee) {
  3987. return object && baseForRight(object, iteratee, keys);
  3988. }
  3989. /**
  3990. * The base implementation of `_.functions` which creates an array of
  3991. * `object` function property names filtered from `props`.
  3992. *
  3993. * @private
  3994. * @param {Object} object The object to inspect.
  3995. * @param {Array} props The property names to filter.
  3996. * @returns {Array} Returns the function names.
  3997. */
  3998. function baseFunctions(object, props) {
  3999. return arrayFilter(props, function(key) {
  4000. return isFunction(object[key]);
  4001. });
  4002. }
  4003. /**
  4004. * The base implementation of `_.get` without support for default values.
  4005. *
  4006. * @private
  4007. * @param {Object} object The object to query.
  4008. * @param {Array|string} path The path of the property to get.
  4009. * @returns {*} Returns the resolved value.
  4010. */
  4011. function baseGet(object, path) {
  4012. path = castPath(path, object);
  4013. var index = 0,
  4014. length = path.length;
  4015. while (object != null && index < length) {
  4016. object = object[toKey(path[index++])];
  4017. }
  4018. return (index && index == length) ? object : undefined;
  4019. }
  4020. /**
  4021. * The base implementation of `getAllKeys` and `getAllKeysIn` which uses
  4022. * `keysFunc` and `symbolsFunc` to get the enumerable property names and
  4023. * symbols of `object`.
  4024. *
  4025. * @private
  4026. * @param {Object} object The object to query.
  4027. * @param {Function} keysFunc The function to get the keys of `object`.
  4028. * @param {Function} symbolsFunc The function to get the symbols of `object`.
  4029. * @returns {Array} Returns the array of property names and symbols.
  4030. */
  4031. function baseGetAllKeys(object, keysFunc, symbolsFunc) {
  4032. var result = keysFunc(object);
  4033. return isArray(object) ? result : arrayPush(result, symbolsFunc(object));
  4034. }
  4035. /**
  4036. * The base implementation of `getTag` without fallbacks for buggy environments.
  4037. *
  4038. * @private
  4039. * @param {*} value The value to query.
  4040. * @returns {string} Returns the `toStringTag`.
  4041. */
  4042. function baseGetTag(value) {
  4043. if (value == null) {
  4044. return value === undefined ? undefinedTag : nullTag;
  4045. }
  4046. return (symToStringTag && symToStringTag in Object(value))
  4047. ? getRawTag(value)
  4048. : objectToString(value);
  4049. }
  4050. /**
  4051. * The base implementation of `_.gt` which doesn't coerce arguments.
  4052. *
  4053. * @private
  4054. * @param {*} value The value to compare.
  4055. * @param {*} other The other value to compare.
  4056. * @returns {boolean} Returns `true` if `value` is greater than `other`,
  4057. * else `false`.
  4058. */
  4059. function baseGt(value, other) {
  4060. return value > other;
  4061. }
  4062. /**
  4063. * The base implementation of `_.has` without support for deep paths.
  4064. *
  4065. * @private
  4066. * @param {Object} [object] The object to query.
  4067. * @param {Array|string} key The key to check.
  4068. * @returns {boolean} Returns `true` if `key` exists, else `false`.
  4069. */
  4070. function baseHas(object, key) {
  4071. return object != null && hasOwnProperty.call(object, key);
  4072. }
  4073. /**
  4074. * The base implementation of `_.hasIn` without support for deep paths.
  4075. *
  4076. * @private
  4077. * @param {Object} [object] The object to query.
  4078. * @param {Array|string} key The key to check.
  4079. * @returns {boolean} Returns `true` if `key` exists, else `false`.
  4080. */
  4081. function baseHasIn(object, key) {
  4082. return object != null && key in Object(object);
  4083. }
  4084. /**
  4085. * The base implementation of `_.inRange` which doesn't coerce arguments.
  4086. *
  4087. * @private
  4088. * @param {number} number The number to check.
  4089. * @param {number} start The start of the range.
  4090. * @param {number} end The end of the range.
  4091. * @returns {boolean} Returns `true` if `number` is in the range, else `false`.
  4092. */
  4093. function baseInRange(number, start, end) {
  4094. return number >= nativeMin(start, end) && number < nativeMax(start, end);
  4095. }
  4096. /**
  4097. * The base implementation of methods like `_.intersection`, without support
  4098. * for iteratee shorthands, that accepts an array of arrays to inspect.
  4099. *
  4100. * @private
  4101. * @param {Array} arrays The arrays to inspect.
  4102. * @param {Function} [iteratee] The iteratee invoked per element.
  4103. * @param {Function} [comparator] The comparator invoked per element.
  4104. * @returns {Array} Returns the new array of shared values.
  4105. */
  4106. function baseIntersection(arrays, iteratee, comparator) {
  4107. var includes = comparator ? arrayIncludesWith : arrayIncludes,
  4108. length = arrays[0].length,
  4109. othLength = arrays.length,
  4110. othIndex = othLength,
  4111. caches = Array(othLength),
  4112. maxLength = Infinity,
  4113. result = [];
  4114. while (othIndex--) {
  4115. var array = arrays[othIndex];
  4116. if (othIndex && iteratee) {
  4117. array = arrayMap(array, baseUnary(iteratee));
  4118. }
  4119. maxLength = nativeMin(array.length, maxLength);
  4120. caches[othIndex] = !comparator && (iteratee || (length >= 120 && array.length >= 120))
  4121. ? new SetCache(othIndex && array)
  4122. : undefined;
  4123. }
  4124. array = arrays[0];
  4125. var index = -1,
  4126. seen = caches[0];
  4127. outer:
  4128. while (++index < length && result.length < maxLength) {
  4129. var value = array[index],
  4130. computed = iteratee ? iteratee(value) : value;
  4131. value = (comparator || value !== 0) ? value : 0;
  4132. if (!(seen
  4133. ? cacheHas(seen, computed)
  4134. : includes(result, computed, comparator)
  4135. )) {
  4136. othIndex = othLength;
  4137. while (--othIndex) {
  4138. var cache = caches[othIndex];
  4139. if (!(cache
  4140. ? cacheHas(cache, computed)
  4141. : includes(arrays[othIndex], computed, comparator))
  4142. ) {
  4143. continue outer;
  4144. }
  4145. }
  4146. if (seen) {
  4147. seen.push(computed);
  4148. }
  4149. result.push(value);
  4150. }
  4151. }
  4152. return result;
  4153. }
  4154. /**
  4155. * The base implementation of `_.invert` and `_.invertBy` which inverts
  4156. * `object` with values transformed by `iteratee` and set by `setter`.
  4157. *
  4158. * @private
  4159. * @param {Object} object The object to iterate over.
  4160. * @param {Function} setter The function to set `accumulator` values.
  4161. * @param {Function} iteratee The iteratee to transform values.
  4162. * @param {Object} accumulator The initial inverted object.
  4163. * @returns {Function} Returns `accumulator`.
  4164. */
  4165. function baseInverter(object, setter, iteratee, accumulator) {
  4166. baseForOwn(object, function(value, key, object) {
  4167. setter(accumulator, iteratee(value), key, object);
  4168. });
  4169. return accumulator;
  4170. }
  4171. /**
  4172. * The base implementation of `_.invoke` without support for individual
  4173. * method arguments.
  4174. *
  4175. * @private
  4176. * @param {Object} object The object to query.
  4177. * @param {Array|string} path The path of the method to invoke.
  4178. * @param {Array} args The arguments to invoke the method with.
  4179. * @returns {*} Returns the result of the invoked method.
  4180. */
  4181. function baseInvoke(object, path, args) {
  4182. path = castPath(path, object);
  4183. object = parent(object, path);
  4184. var func = object == null ? object : object[toKey(last(path))];
  4185. return func == null ? undefined : apply(func, object, args);
  4186. }
  4187. /**
  4188. * The base implementation of `_.isArguments`.
  4189. *
  4190. * @private
  4191. * @param {*} value The value to check.
  4192. * @returns {boolean} Returns `true` if `value` is an `arguments` object,
  4193. */
  4194. function baseIsArguments(value) {
  4195. return isObjectLike(value) && baseGetTag(value) == argsTag;
  4196. }
  4197. /**
  4198. * The base implementation of `_.isArrayBuffer` without Node.js optimizations.
  4199. *
  4200. * @private
  4201. * @param {*} value The value to check.
  4202. * @returns {boolean} Returns `true` if `value` is an array buffer, else `false`.
  4203. */
  4204. function baseIsArrayBuffer(value) {
  4205. return isObjectLike(value) && baseGetTag(value) == arrayBufferTag;
  4206. }
  4207. /**
  4208. * The base implementation of `_.isDate` without Node.js optimizations.
  4209. *
  4210. * @private
  4211. * @param {*} value The value to check.
  4212. * @returns {boolean} Returns `true` if `value` is a date object, else `false`.
  4213. */
  4214. function baseIsDate(value) {
  4215. return isObjectLike(value) && baseGetTag(value) == dateTag;
  4216. }
  4217. /**
  4218. * The base implementation of `_.isEqual` which supports partial comparisons
  4219. * and tracks traversed objects.
  4220. *
  4221. * @private
  4222. * @param {*} value The value to compare.
  4223. * @param {*} other The other value to compare.
  4224. * @param {boolean} bitmask The bitmask flags.
  4225. * 1 - Unordered comparison
  4226. * 2 - Partial comparison
  4227. * @param {Function} [customizer] The function to customize comparisons.
  4228. * @param {Object} [stack] Tracks traversed `value` and `other` objects.
  4229. * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
  4230. */
  4231. function baseIsEqual(value, other, bitmask, customizer, stack) {
  4232. if (value === other) {
  4233. return true;
  4234. }
  4235. if (value == null || other == null || (!isObjectLike(value) && !isObjectLike(other))) {
  4236. return value !== value && other !== other;
  4237. }
  4238. return baseIsEqualDeep(value, other, bitmask, customizer, baseIsEqual, stack);
  4239. }
  4240. /**
  4241. * A specialized version of `baseIsEqual` for arrays and objects which performs
  4242. * deep comparisons and tracks traversed objects enabling objects with circular
  4243. * references to be compared.
  4244. *
  4245. * @private
  4246. * @param {Object} object The object to compare.
  4247. * @param {Object} other The other object to compare.
  4248. * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
  4249. * @param {Function} customizer The function to customize comparisons.
  4250. * @param {Function} equalFunc The function to determine equivalents of values.
  4251. * @param {Object} [stack] Tracks traversed `object` and `other` objects.
  4252. * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
  4253. */
  4254. function baseIsEqualDeep(object, other, bitmask, customizer, equalFunc, stack) {
  4255. var objIsArr = isArray(object),
  4256. othIsArr = isArray(other),
  4257. objTag = objIsArr ? arrayTag : getTag(object),
  4258. othTag = othIsArr ? arrayTag : getTag(other);
  4259. objTag = objTag == argsTag ? objectTag : objTag;
  4260. othTag = othTag == argsTag ? objectTag : othTag;
  4261. var objIsObj = objTag == objectTag,
  4262. othIsObj = othTag == objectTag,
  4263. isSameTag = objTag == othTag;
  4264. if (isSameTag && isBuffer(object)) {
  4265. if (!isBuffer(other)) {
  4266. return false;
  4267. }
  4268. objIsArr = true;
  4269. objIsObj = false;
  4270. }
  4271. if (isSameTag && !objIsObj) {
  4272. stack || (stack = new Stack);
  4273. return (objIsArr || isTypedArray(object))
  4274. ? equalArrays(object, other, bitmask, customizer, equalFunc, stack)
  4275. : equalByTag(object, other, objTag, bitmask, customizer, equalFunc, stack);
  4276. }
  4277. if (!(bitmask & COMPARE_PARTIAL_FLAG)) {
  4278. var objIsWrapped = objIsObj && hasOwnProperty.call(object, '__wrapped__'),
  4279. othIsWrapped = othIsObj && hasOwnProperty.call(other, '__wrapped__');
  4280. if (objIsWrapped || othIsWrapped) {
  4281. var objUnwrapped = objIsWrapped ? object.value() : object,
  4282. othUnwrapped = othIsWrapped ? other.value() : other;
  4283. stack || (stack = new Stack);
  4284. return equalFunc(objUnwrapped, othUnwrapped, bitmask, customizer, stack);
  4285. }
  4286. }
  4287. if (!isSameTag) {
  4288. return false;
  4289. }
  4290. stack || (stack = new Stack);
  4291. return equalObjects(object, other, bitmask, customizer, equalFunc, stack);
  4292. }
  4293. /**
  4294. * The base implementation of `_.isMap` without Node.js optimizations.
  4295. *
  4296. * @private
  4297. * @param {*} value The value to check.
  4298. * @returns {boolean} Returns `true` if `value` is a map, else `false`.
  4299. */
  4300. function baseIsMap(value) {
  4301. return isObjectLike(value) && getTag(value) == mapTag;
  4302. }
  4303. /**
  4304. * The base implementation of `_.isMatch` without support for iteratee shorthands.
  4305. *
  4306. * @private
  4307. * @param {Object} object The object to inspect.
  4308. * @param {Object} source The object of property values to match.
  4309. * @param {Array} matchData The property names, values, and compare flags to match.
  4310. * @param {Function} [customizer] The function to customize comparisons.
  4311. * @returns {boolean} Returns `true` if `object` is a match, else `false`.
  4312. */
  4313. function baseIsMatch(object, source, matchData, customizer) {
  4314. var index = matchData.length,
  4315. length = index,
  4316. noCustomizer = !customizer;
  4317. if (object == null) {
  4318. return !length;
  4319. }
  4320. object = Object(object);
  4321. while (index--) {
  4322. var data = matchData[index];
  4323. if ((noCustomizer && data[2])
  4324. ? data[1] !== object[data[0]]
  4325. : !(data[0] in object)
  4326. ) {
  4327. return false;
  4328. }
  4329. }
  4330. while (++index < length) {
  4331. data = matchData[index];
  4332. var key = data[0],
  4333. objValue = object[key],
  4334. srcValue = data[1];
  4335. if (noCustomizer && data[2]) {
  4336. if (objValue === undefined && !(key in object)) {
  4337. return false;
  4338. }
  4339. } else {
  4340. var stack = new Stack;
  4341. if (customizer) {
  4342. var result = customizer(objValue, srcValue, key, object, source, stack);
  4343. }
  4344. if (!(result === undefined
  4345. ? baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG, customizer, stack)
  4346. : result
  4347. )) {
  4348. return false;
  4349. }
  4350. }
  4351. }
  4352. return true;
  4353. }
  4354. /**
  4355. * The base implementation of `_.isNative` without bad shim checks.
  4356. *
  4357. * @private
  4358. * @param {*} value The value to check.
  4359. * @returns {boolean} Returns `true` if `value` is a native function,
  4360. * else `false`.
  4361. */
  4362. function baseIsNative(value) {
  4363. if (!isObject(value) || isMasked(value)) {
  4364. return false;
  4365. }
  4366. var pattern = isFunction(value) ? reIsNative : reIsHostCtor;
  4367. return pattern.test(toSource(value));
  4368. }
  4369. /**
  4370. * The base implementation of `_.isRegExp` without Node.js optimizations.
  4371. *
  4372. * @private
  4373. * @param {*} value The value to check.
  4374. * @returns {boolean} Returns `true` if `value` is a regexp, else `false`.
  4375. */
  4376. function baseIsRegExp(value) {
  4377. return isObjectLike(value) && baseGetTag(value) == regexpTag;
  4378. }
  4379. /**
  4380. * The base implementation of `_.isSet` without Node.js optimizations.
  4381. *
  4382. * @private
  4383. * @param {*} value The value to check.
  4384. * @returns {boolean} Returns `true` if `value` is a set, else `false`.
  4385. */
  4386. function baseIsSet(value) {
  4387. return isObjectLike(value) && getTag(value) == setTag;
  4388. }
  4389. /**
  4390. * The base implementation of `_.isTypedArray` without Node.js optimizations.
  4391. *
  4392. * @private
  4393. * @param {*} value The value to check.
  4394. * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.
  4395. */
  4396. function baseIsTypedArray(value) {
  4397. return isObjectLike(value) &&
  4398. isLength(value.length) && !!typedArrayTags[baseGetTag(value)];
  4399. }
  4400. /**
  4401. * The base implementation of `_.iteratee`.
  4402. *
  4403. * @private
  4404. * @param {*} [value=_.identity] The value to convert to an iteratee.
  4405. * @returns {Function} Returns the iteratee.
  4406. */
  4407. function baseIteratee(value) {
  4408. // Don't store the `typeof` result in a variable to avoid a JIT bug in Safari 9.
  4409. // See https://bugs.webkit.org/show_bug.cgi?id=156034 for more details.
  4410. if (typeof value == 'function') {
  4411. return value;
  4412. }
  4413. if (value == null) {
  4414. return identity;
  4415. }
  4416. if (typeof value == 'object') {
  4417. return isArray(value)
  4418. ? baseMatchesProperty(value[0], value[1])
  4419. : baseMatches(value);
  4420. }
  4421. return property(value);
  4422. }
  4423. /**
  4424. * The base implementation of `_.keys` which doesn't treat sparse arrays as dense.
  4425. *
  4426. * @private
  4427. * @param {Object} object The object to query.
  4428. * @returns {Array} Returns the array of property names.
  4429. */
  4430. function baseKeys(object) {
  4431. if (!isPrototype(object)) {
  4432. return nativeKeys(object);
  4433. }
  4434. var result = [];
  4435. for (var key in Object(object)) {
  4436. if (hasOwnProperty.call(object, key) && key != 'constructor') {
  4437. result.push(key);
  4438. }
  4439. }
  4440. return result;
  4441. }
  4442. /**
  4443. * The base implementation of `_.keysIn` which doesn't treat sparse arrays as dense.
  4444. *
  4445. * @private
  4446. * @param {Object} object The object to query.
  4447. * @returns {Array} Returns the array of property names.
  4448. */
  4449. function baseKeysIn(object) {
  4450. if (!isObject(object)) {
  4451. return nativeKeysIn(object);
  4452. }
  4453. var isProto = isPrototype(object),
  4454. result = [];
  4455. for (var key in object) {
  4456. if (!(key == 'constructor' && (isProto || !hasOwnProperty.call(object, key)))) {
  4457. result.push(key);
  4458. }
  4459. }
  4460. return result;
  4461. }
  4462. /**
  4463. * The base implementation of `_.lt` which doesn't coerce arguments.
  4464. *
  4465. * @private
  4466. * @param {*} value The value to compare.
  4467. * @param {*} other The other value to compare.
  4468. * @returns {boolean} Returns `true` if `value` is less than `other`,
  4469. * else `false`.
  4470. */
  4471. function baseLt(value, other) {
  4472. return value < other;
  4473. }
  4474. /**
  4475. * The base implementation of `_.map` without support for iteratee shorthands.
  4476. *
  4477. * @private
  4478. * @param {Array|Object} collection The collection to iterate over.
  4479. * @param {Function} iteratee The function invoked per iteration.
  4480. * @returns {Array} Returns the new mapped array.
  4481. */
  4482. function baseMap(collection, iteratee) {
  4483. var index = -1,
  4484. result = isArrayLike(collection) ? Array(collection.length) : [];
  4485. baseEach(collection, function(value, key, collection) {
  4486. result[++index] = iteratee(value, key, collection);
  4487. });
  4488. return result;
  4489. }
  4490. /**
  4491. * The base implementation of `_.matches` which doesn't clone `source`.
  4492. *
  4493. * @private
  4494. * @param {Object} source The object of property values to match.
  4495. * @returns {Function} Returns the new spec function.
  4496. */
  4497. function baseMatches(source) {
  4498. var matchData = getMatchData(source);
  4499. if (matchData.length == 1 && matchData[0][2]) {
  4500. return matchesStrictComparable(matchData[0][0], matchData[0][1]);
  4501. }
  4502. return function(object) {
  4503. return object === source || baseIsMatch(object, source, matchData);
  4504. };
  4505. }
  4506. /**
  4507. * The base implementation of `_.matchesProperty` which doesn't clone `srcValue`.
  4508. *
  4509. * @private
  4510. * @param {string} path The path of the property to get.
  4511. * @param {*} srcValue The value to match.
  4512. * @returns {Function} Returns the new spec function.
  4513. */
  4514. function baseMatchesProperty(path, srcValue) {
  4515. if (isKey(path) && isStrictComparable(srcValue)) {
  4516. return matchesStrictComparable(toKey(path), srcValue);
  4517. }
  4518. return function(object) {
  4519. var objValue = get(object, path);
  4520. return (objValue === undefined && objValue === srcValue)
  4521. ? hasIn(object, path)
  4522. : baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG);
  4523. };
  4524. }
  4525. /**
  4526. * The base implementation of `_.merge` without support for multiple sources.
  4527. *
  4528. * @private
  4529. * @param {Object} object The destination object.
  4530. * @param {Object} source The source object.
  4531. * @param {number} srcIndex The index of `source`.
  4532. * @param {Function} [customizer] The function to customize merged values.
  4533. * @param {Object} [stack] Tracks traversed source values and their merged
  4534. * counterparts.
  4535. */
  4536. function baseMerge(object, source, srcIndex, customizer, stack) {
  4537. if (object === source) {
  4538. return;
  4539. }
  4540. baseFor(source, function(srcValue, key) {
  4541. stack || (stack = new Stack);
  4542. if (isObject(srcValue)) {
  4543. baseMergeDeep(object, source, key, srcIndex, baseMerge, customizer, stack);
  4544. }
  4545. else {
  4546. var newValue = customizer
  4547. ? customizer(safeGet(object, key), srcValue, (key + ''), object, source, stack)
  4548. : undefined;
  4549. if (newValue === undefined) {
  4550. newValue = srcValue;
  4551. }
  4552. assignMergeValue(object, key, newValue);
  4553. }
  4554. }, keysIn);
  4555. }
  4556. /**
  4557. * A specialized version of `baseMerge` for arrays and objects which performs
  4558. * deep merges and tracks traversed objects enabling objects with circular
  4559. * references to be merged.
  4560. *
  4561. * @private
  4562. * @param {Object} object The destination object.
  4563. * @param {Object} source The source object.
  4564. * @param {string} key The key of the value to merge.
  4565. * @param {number} srcIndex The index of `source`.
  4566. * @param {Function} mergeFunc The function to merge values.
  4567. * @param {Function} [customizer] The function to customize assigned values.
  4568. * @param {Object} [stack] Tracks traversed source values and their merged
  4569. * counterparts.
  4570. */
  4571. function baseMergeDeep(object, source, key, srcIndex, mergeFunc, customizer, stack) {
  4572. var objValue = safeGet(object, key),
  4573. srcValue = safeGet(source, key),
  4574. stacked = stack.get(srcValue);
  4575. if (stacked) {
  4576. assignMergeValue(object, key, stacked);
  4577. return;
  4578. }
  4579. var newValue = customizer
  4580. ? customizer(objValue, srcValue, (key + ''), object, source, stack)
  4581. : undefined;
  4582. var isCommon = newValue === undefined;
  4583. if (isCommon) {
  4584. var isArr = isArray(srcValue),
  4585. isBuff = !isArr && isBuffer(srcValue),
  4586. isTyped = !isArr && !isBuff && isTypedArray(srcValue);
  4587. newValue = srcValue;
  4588. if (isArr || isBuff || isTyped) {
  4589. if (isArray(objValue)) {
  4590. newValue = objValue;
  4591. }
  4592. else if (isArrayLikeObject(objValue)) {
  4593. newValue = copyArray(objValue);
  4594. }
  4595. else if (isBuff) {
  4596. isCommon = false;
  4597. newValue = cloneBuffer(srcValue, true);
  4598. }
  4599. else if (isTyped) {
  4600. isCommon = false;
  4601. newValue = cloneTypedArray(srcValue, true);
  4602. }
  4603. else {
  4604. newValue = [];
  4605. }
  4606. }
  4607. else if (isPlainObject(srcValue) || isArguments(srcValue)) {
  4608. newValue = objValue;
  4609. if (isArguments(objValue)) {
  4610. newValue = toPlainObject(objValue);
  4611. }
  4612. else if (!isObject(objValue) || isFunction(objValue)) {
  4613. newValue = initCloneObject(srcValue);
  4614. }
  4615. }
  4616. else {
  4617. isCommon = false;
  4618. }
  4619. }
  4620. if (isCommon) {
  4621. // Recursively merge objects and arrays (susceptible to call stack limits).
  4622. stack.set(srcValue, newValue);
  4623. mergeFunc(newValue, srcValue, srcIndex, customizer, stack);
  4624. stack['delete'](srcValue);
  4625. }
  4626. assignMergeValue(object, key, newValue);
  4627. }
  4628. /**
  4629. * The base implementation of `_.nth` which doesn't coerce arguments.
  4630. *
  4631. * @private
  4632. * @param {Array} array The array to query.
  4633. * @param {number} n The index of the element to return.
  4634. * @returns {*} Returns the nth element of `array`.
  4635. */
  4636. function baseNth(array, n) {
  4637. var length = array.length;
  4638. if (!length) {
  4639. return;
  4640. }
  4641. n += n < 0 ? length : 0;
  4642. return isIndex(n, length) ? array[n] : undefined;
  4643. }
  4644. /**
  4645. * The base implementation of `_.orderBy` without param guards.
  4646. *
  4647. * @private
  4648. * @param {Array|Object} collection The collection to iterate over.
  4649. * @param {Function[]|Object[]|string[]} iteratees The iteratees to sort by.
  4650. * @param {string[]} orders The sort orders of `iteratees`.
  4651. * @returns {Array} Returns the new sorted array.
  4652. */
  4653. function baseOrderBy(collection, iteratees, orders) {
  4654. if (iteratees.length) {
  4655. iteratees = arrayMap(iteratees, function(iteratee) {
  4656. if (isArray(iteratee)) {
  4657. return function(value) {
  4658. return baseGet(value, iteratee.length === 1 ? iteratee[0] : iteratee);
  4659. }
  4660. }
  4661. return iteratee;
  4662. });
  4663. } else {
  4664. iteratees = [identity];
  4665. }
  4666. var index = -1;
  4667. iteratees = arrayMap(iteratees, baseUnary(getIteratee()));
  4668. var result = baseMap(collection, function(value, key, collection) {
  4669. var criteria = arrayMap(iteratees, function(iteratee) {
  4670. return iteratee(value);
  4671. });
  4672. return { 'criteria': criteria, 'index': ++index, 'value': value };
  4673. });
  4674. return baseSortBy(result, function(object, other) {
  4675. return compareMultiple(object, other, orders);
  4676. });
  4677. }
  4678. /**
  4679. * The base implementation of `_.pick` without support for individual
  4680. * property identifiers.
  4681. *
  4682. * @private
  4683. * @param {Object} object The source object.
  4684. * @param {string[]} paths The property paths to pick.
  4685. * @returns {Object} Returns the new object.
  4686. */
  4687. function basePick(object, paths) {
  4688. return basePickBy(object, paths, function(value, path) {
  4689. return hasIn(object, path);
  4690. });
  4691. }
  4692. /**
  4693. * The base implementation of `_.pickBy` without support for iteratee shorthands.
  4694. *
  4695. * @private
  4696. * @param {Object} object The source object.
  4697. * @param {string[]} paths The property paths to pick.
  4698. * @param {Function} predicate The function invoked per property.
  4699. * @returns {Object} Returns the new object.
  4700. */
  4701. function basePickBy(object, paths, predicate) {
  4702. var index = -1,
  4703. length = paths.length,
  4704. result = {};
  4705. while (++index < length) {
  4706. var path = paths[index],
  4707. value = baseGet(object, path);
  4708. if (predicate(value, path)) {
  4709. baseSet(result, castPath(path, object), value);
  4710. }
  4711. }
  4712. return result;
  4713. }
  4714. /**
  4715. * A specialized version of `baseProperty` which supports deep paths.
  4716. *
  4717. * @private
  4718. * @param {Array|string} path The path of the property to get.
  4719. * @returns {Function} Returns the new accessor function.
  4720. */
  4721. function basePropertyDeep(path) {
  4722. return function(object) {
  4723. return baseGet(object, path);
  4724. };
  4725. }
  4726. /**
  4727. * The base implementation of `_.pullAllBy` without support for iteratee
  4728. * shorthands.
  4729. *
  4730. * @private
  4731. * @param {Array} array The array to modify.
  4732. * @param {Array} values The values to remove.
  4733. * @param {Function} [iteratee] The iteratee invoked per element.
  4734. * @param {Function} [comparator] The comparator invoked per element.
  4735. * @returns {Array} Returns `array`.
  4736. */
  4737. function basePullAll(array, values, iteratee, comparator) {
  4738. var indexOf = comparator ? baseIndexOfWith : baseIndexOf,
  4739. index = -1,
  4740. length = values.length,
  4741. seen = array;
  4742. if (array === values) {
  4743. values = copyArray(values);
  4744. }
  4745. if (iteratee) {
  4746. seen = arrayMap(array, baseUnary(iteratee));
  4747. }
  4748. while (++index < length) {
  4749. var fromIndex = 0,
  4750. value = values[index],
  4751. computed = iteratee ? iteratee(value) : value;
  4752. while ((fromIndex = indexOf(seen, computed, fromIndex, comparator)) > -1) {
  4753. if (seen !== array) {
  4754. splice.call(seen, fromIndex, 1);
  4755. }
  4756. splice.call(array, fromIndex, 1);
  4757. }
  4758. }
  4759. return array;
  4760. }
  4761. /**
  4762. * The base implementation of `_.pullAt` without support for individual
  4763. * indexes or capturing the removed elements.
  4764. *
  4765. * @private
  4766. * @param {Array} array The array to modify.
  4767. * @param {number[]} indexes The indexes of elements to remove.
  4768. * @returns {Array} Returns `array`.
  4769. */
  4770. function basePullAt(array, indexes) {
  4771. var length = array ? indexes.length : 0,
  4772. lastIndex = length - 1;
  4773. while (length--) {
  4774. var index = indexes[length];
  4775. if (length == lastIndex || index !== previous) {
  4776. var previous = index;
  4777. if (isIndex(index)) {
  4778. splice.call(array, index, 1);
  4779. } else {
  4780. baseUnset(array, index);
  4781. }
  4782. }
  4783. }
  4784. return array;
  4785. }
  4786. /**
  4787. * The base implementation of `_.random` without support for returning
  4788. * floating-point numbers.
  4789. *
  4790. * @private
  4791. * @param {number} lower The lower bound.
  4792. * @param {number} upper The upper bound.
  4793. * @returns {number} Returns the random number.
  4794. */
  4795. function baseRandom(lower, upper) {
  4796. return lower + nativeFloor(nativeRandom() * (upper - lower + 1));
  4797. }
  4798. /**
  4799. * The base implementation of `_.range` and `_.rangeRight` which doesn't
  4800. * coerce arguments.
  4801. *
  4802. * @private
  4803. * @param {number} start The start of the range.
  4804. * @param {number} end The end of the range.
  4805. * @param {number} step The value to increment or decrement by.
  4806. * @param {boolean} [fromRight] Specify iterating from right to left.
  4807. * @returns {Array} Returns the range of numbers.
  4808. */
  4809. function baseRange(start, end, step, fromRight) {
  4810. var index = -1,
  4811. length = nativeMax(nativeCeil((end - start) / (step || 1)), 0),
  4812. result = Array(length);
  4813. while (length--) {
  4814. result[fromRight ? length : ++index] = start;
  4815. start += step;
  4816. }
  4817. return result;
  4818. }
  4819. /**
  4820. * The base implementation of `_.repeat` which doesn't coerce arguments.
  4821. *
  4822. * @private
  4823. * @param {string} string The string to repeat.
  4824. * @param {number} n The number of times to repeat the string.
  4825. * @returns {string} Returns the repeated string.
  4826. */
  4827. function baseRepeat(string, n) {
  4828. var result = '';
  4829. if (!string || n < 1 || n > MAX_SAFE_INTEGER) {
  4830. return result;
  4831. }
  4832. // Leverage the exponentiation by squaring algorithm for a faster repeat.
  4833. // See https://en.wikipedia.org/wiki/Exponentiation_by_squaring for more details.
  4834. do {
  4835. if (n % 2) {
  4836. result += string;
  4837. }
  4838. n = nativeFloor(n / 2);
  4839. if (n) {
  4840. string += string;
  4841. }
  4842. } while (n);
  4843. return result;
  4844. }
  4845. /**
  4846. * The base implementation of `_.rest` which doesn't validate or coerce arguments.
  4847. *
  4848. * @private
  4849. * @param {Function} func The function to apply a rest parameter to.
  4850. * @param {number} [start=func.length-1] The start position of the rest parameter.
  4851. * @returns {Function} Returns the new function.
  4852. */
  4853. function baseRest(func, start) {
  4854. return setToString(overRest(func, start, identity), func + '');
  4855. }
  4856. /**
  4857. * The base implementation of `_.sample`.
  4858. *
  4859. * @private
  4860. * @param {Array|Object} collection The collection to sample.
  4861. * @returns {*} Returns the random element.
  4862. */
  4863. function baseSample(collection) {
  4864. return arraySample(values(collection));
  4865. }
  4866. /**
  4867. * The base implementation of `_.sampleSize` without param guards.
  4868. *
  4869. * @private
  4870. * @param {Array|Object} collection The collection to sample.
  4871. * @param {number} n The number of elements to sample.
  4872. * @returns {Array} Returns the random elements.
  4873. */
  4874. function baseSampleSize(collection, n) {
  4875. var array = values(collection);
  4876. return shuffleSelf(array, baseClamp(n, 0, array.length));
  4877. }
  4878. /**
  4879. * The base implementation of `_.set`.
  4880. *
  4881. * @private
  4882. * @param {Object} object The object to modify.
  4883. * @param {Array|string} path The path of the property to set.
  4884. * @param {*} value The value to set.
  4885. * @param {Function} [customizer] The function to customize path creation.
  4886. * @returns {Object} Returns `object`.
  4887. */
  4888. function baseSet(object, path, value, customizer) {
  4889. if (!isObject(object)) {
  4890. return object;
  4891. }
  4892. path = castPath(path, object);
  4893. var index = -1,
  4894. length = path.length,
  4895. lastIndex = length - 1,
  4896. nested = object;
  4897. while (nested != null && ++index < length) {
  4898. var key = toKey(path[index]),
  4899. newValue = value;
  4900. if (key === '__proto__' || key === 'constructor' || key === 'prototype') {
  4901. return object;
  4902. }
  4903. if (index != lastIndex) {
  4904. var objValue = nested[key];
  4905. newValue = customizer ? customizer(objValue, key, nested) : undefined;
  4906. if (newValue === undefined) {
  4907. newValue = isObject(objValue)
  4908. ? objValue
  4909. : (isIndex(path[index + 1]) ? [] : {});
  4910. }
  4911. }
  4912. assignValue(nested, key, newValue);
  4913. nested = nested[key];
  4914. }
  4915. return object;
  4916. }
  4917. /**
  4918. * The base implementation of `setData` without support for hot loop shorting.
  4919. *
  4920. * @private
  4921. * @param {Function} func The function to associate metadata with.
  4922. * @param {*} data The metadata.
  4923. * @returns {Function} Returns `func`.
  4924. */
  4925. var baseSetData = !metaMap ? identity : function(func, data) {
  4926. metaMap.set(func, data);
  4927. return func;
  4928. };
  4929. /**
  4930. * The base implementation of `setToString` without support for hot loop shorting.
  4931. *
  4932. * @private
  4933. * @param {Function} func The function to modify.
  4934. * @param {Function} string The `toString` result.
  4935. * @returns {Function} Returns `func`.
  4936. */
  4937. var baseSetToString = !defineProperty ? identity : function(func, string) {
  4938. return defineProperty(func, 'toString', {
  4939. 'configurable': true,
  4940. 'enumerable': false,
  4941. 'value': constant(string),
  4942. 'writable': true
  4943. });
  4944. };
  4945. /**
  4946. * The base implementation of `_.shuffle`.
  4947. *
  4948. * @private
  4949. * @param {Array|Object} collection The collection to shuffle.
  4950. * @returns {Array} Returns the new shuffled array.
  4951. */
  4952. function baseShuffle(collection) {
  4953. return shuffleSelf(values(collection));
  4954. }
  4955. /**
  4956. * The base implementation of `_.slice` without an iteratee call guard.
  4957. *
  4958. * @private
  4959. * @param {Array} array The array to slice.
  4960. * @param {number} [start=0] The start position.
  4961. * @param {number} [end=array.length] The end position.
  4962. * @returns {Array} Returns the slice of `array`.
  4963. */
  4964. function baseSlice(array, start, end) {
  4965. var index = -1,
  4966. length = array.length;
  4967. if (start < 0) {
  4968. start = -start > length ? 0 : (length + start);
  4969. }
  4970. end = end > length ? length : end;
  4971. if (end < 0) {
  4972. end += length;
  4973. }
  4974. length = start > end ? 0 : ((end - start) >>> 0);
  4975. start >>>= 0;
  4976. var result = Array(length);
  4977. while (++index < length) {
  4978. result[index] = array[index + start];
  4979. }
  4980. return result;
  4981. }
  4982. /**
  4983. * The base implementation of `_.some` without support for iteratee shorthands.
  4984. *
  4985. * @private
  4986. * @param {Array|Object} collection The collection to iterate over.
  4987. * @param {Function} predicate The function invoked per iteration.
  4988. * @returns {boolean} Returns `true` if any element passes the predicate check,
  4989. * else `false`.
  4990. */
  4991. function baseSome(collection, predicate) {
  4992. var result;
  4993. baseEach(collection, function(value, index, collection) {
  4994. result = predicate(value, index, collection);
  4995. return !result;
  4996. });
  4997. return !!result;
  4998. }
  4999. /**
  5000. * The base implementation of `_.sortedIndex` and `_.sortedLastIndex` which
  5001. * performs a binary search of `array` to determine the index at which `value`
  5002. * should be inserted into `array` in order to maintain its sort order.
  5003. *
  5004. * @private
  5005. * @param {Array} array The sorted array to inspect.
  5006. * @param {*} value The value to evaluate.
  5007. * @param {boolean} [retHighest] Specify returning the highest qualified index.
  5008. * @returns {number} Returns the index at which `value` should be inserted
  5009. * into `array`.
  5010. */
  5011. function baseSortedIndex(array, value, retHighest) {
  5012. var low = 0,
  5013. high = array == null ? low : array.length;
  5014. if (typeof value == 'number' && value === value && high <= HALF_MAX_ARRAY_LENGTH) {
  5015. while (low < high) {
  5016. var mid = (low + high) >>> 1,
  5017. computed = array[mid];
  5018. if (computed !== null && !isSymbol(computed) &&
  5019. (retHighest ? (computed <= value) : (computed < value))) {
  5020. low = mid + 1;
  5021. } else {
  5022. high = mid;
  5023. }
  5024. }
  5025. return high;
  5026. }
  5027. return baseSortedIndexBy(array, value, identity, retHighest);
  5028. }
  5029. /**
  5030. * The base implementation of `_.sortedIndexBy` and `_.sortedLastIndexBy`
  5031. * which invokes `iteratee` for `value` and each element of `array` to compute
  5032. * their sort ranking. The iteratee is invoked with one argument; (value).
  5033. *
  5034. * @private
  5035. * @param {Array} array The sorted array to inspect.
  5036. * @param {*} value The value to evaluate.
  5037. * @param {Function} iteratee The iteratee invoked per element.
  5038. * @param {boolean} [retHighest] Specify returning the highest qualified index.
  5039. * @returns {number} Returns the index at which `value` should be inserted
  5040. * into `array`.
  5041. */
  5042. function baseSortedIndexBy(array, value, iteratee, retHighest) {
  5043. var low = 0,
  5044. high = array == null ? 0 : array.length;
  5045. if (high === 0) {
  5046. return 0;
  5047. }
  5048. value = iteratee(value);
  5049. var valIsNaN = value !== value,
  5050. valIsNull = value === null,
  5051. valIsSymbol = isSymbol(value),
  5052. valIsUndefined = value === undefined;
  5053. while (low < high) {
  5054. var mid = nativeFloor((low + high) / 2),
  5055. computed = iteratee(array[mid]),
  5056. othIsDefined = computed !== undefined,
  5057. othIsNull = computed === null,
  5058. othIsReflexive = computed === computed,
  5059. othIsSymbol = isSymbol(computed);
  5060. if (valIsNaN) {
  5061. var setLow = retHighest || othIsReflexive;
  5062. } else if (valIsUndefined) {
  5063. setLow = othIsReflexive && (retHighest || othIsDefined);
  5064. } else if (valIsNull) {
  5065. setLow = othIsReflexive && othIsDefined && (retHighest || !othIsNull);
  5066. } else if (valIsSymbol) {
  5067. setLow = othIsReflexive && othIsDefined && !othIsNull && (retHighest || !othIsSymbol);
  5068. } else if (othIsNull || othIsSymbol) {
  5069. setLow = false;
  5070. } else {
  5071. setLow = retHighest ? (computed <= value) : (computed < value);
  5072. }
  5073. if (setLow) {
  5074. low = mid + 1;
  5075. } else {
  5076. high = mid;
  5077. }
  5078. }
  5079. return nativeMin(high, MAX_ARRAY_INDEX);
  5080. }
  5081. /**
  5082. * The base implementation of `_.sortedUniq` and `_.sortedUniqBy` without
  5083. * support for iteratee shorthands.
  5084. *
  5085. * @private
  5086. * @param {Array} array The array to inspect.
  5087. * @param {Function} [iteratee] The iteratee invoked per element.
  5088. * @returns {Array} Returns the new duplicate free array.
  5089. */
  5090. function baseSortedUniq(array, iteratee) {
  5091. var index = -1,
  5092. length = array.length,
  5093. resIndex = 0,
  5094. result = [];
  5095. while (++index < length) {
  5096. var value = array[index],
  5097. computed = iteratee ? iteratee(value) : value;
  5098. if (!index || !eq(computed, seen)) {
  5099. var seen = computed;
  5100. result[resIndex++] = value === 0 ? 0 : value;
  5101. }
  5102. }
  5103. return result;
  5104. }
  5105. /**
  5106. * The base implementation of `_.toNumber` which doesn't ensure correct
  5107. * conversions of binary, hexadecimal, or octal string values.
  5108. *
  5109. * @private
  5110. * @param {*} value The value to process.
  5111. * @returns {number} Returns the number.
  5112. */
  5113. function baseToNumber(value) {
  5114. if (typeof value == 'number') {
  5115. return value;
  5116. }
  5117. if (isSymbol(value)) {
  5118. return NAN;
  5119. }
  5120. return +value;
  5121. }
  5122. /**
  5123. * The base implementation of `_.toString` which doesn't convert nullish
  5124. * values to empty strings.
  5125. *
  5126. * @private
  5127. * @param {*} value The value to process.
  5128. * @returns {string} Returns the string.
  5129. */
  5130. function baseToString(value) {
  5131. // Exit early for strings to avoid a performance hit in some environments.
  5132. if (typeof value == 'string') {
  5133. return value;
  5134. }
  5135. if (isArray(value)) {
  5136. // Recursively convert values (susceptible to call stack limits).
  5137. return arrayMap(value, baseToString) + '';
  5138. }
  5139. if (isSymbol(value)) {
  5140. return symbolToString ? symbolToString.call(value) : '';
  5141. }
  5142. var result = (value + '');
  5143. return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;
  5144. }
  5145. /**
  5146. * The base implementation of `_.uniqBy` without support for iteratee shorthands.
  5147. *
  5148. * @private
  5149. * @param {Array} array The array to inspect.
  5150. * @param {Function} [iteratee] The iteratee invoked per element.
  5151. * @param {Function} [comparator] The comparator invoked per element.
  5152. * @returns {Array} Returns the new duplicate free array.
  5153. */
  5154. function baseUniq(array, iteratee, comparator) {
  5155. var index = -1,
  5156. includes = arrayIncludes,
  5157. length = array.length,
  5158. isCommon = true,
  5159. result = [],
  5160. seen = result;
  5161. if (comparator) {
  5162. isCommon = false;
  5163. includes = arrayIncludesWith;
  5164. }
  5165. else if (length >= LARGE_ARRAY_SIZE) {
  5166. var set = iteratee ? null : createSet(array);
  5167. if (set) {
  5168. return setToArray(set);
  5169. }
  5170. isCommon = false;
  5171. includes = cacheHas;
  5172. seen = new SetCache;
  5173. }
  5174. else {
  5175. seen = iteratee ? [] : result;
  5176. }
  5177. outer:
  5178. while (++index < length) {
  5179. var value = array[index],
  5180. computed = iteratee ? iteratee(value) : value;
  5181. value = (comparator || value !== 0) ? value : 0;
  5182. if (isCommon && computed === computed) {
  5183. var seenIndex = seen.length;
  5184. while (seenIndex--) {
  5185. if (seen[seenIndex] === computed) {
  5186. continue outer;
  5187. }
  5188. }
  5189. if (iteratee) {
  5190. seen.push(computed);
  5191. }
  5192. result.push(value);
  5193. }
  5194. else if (!includes(seen, computed, comparator)) {
  5195. if (seen !== result) {
  5196. seen.push(computed);
  5197. }
  5198. result.push(value);
  5199. }
  5200. }
  5201. return result;
  5202. }
  5203. /**
  5204. * The base implementation of `_.unset`.
  5205. *
  5206. * @private
  5207. * @param {Object} object The object to modify.
  5208. * @param {Array|string} path The property path to unset.
  5209. * @returns {boolean} Returns `true` if the property is deleted, else `false`.
  5210. */
  5211. function baseUnset(object, path) {
  5212. path = castPath(path, object);
  5213. object = parent(object, path);
  5214. return object == null || delete object[toKey(last(path))];
  5215. }
  5216. /**
  5217. * The base implementation of `_.update`.
  5218. *
  5219. * @private
  5220. * @param {Object} object The object to modify.
  5221. * @param {Array|string} path The path of the property to update.
  5222. * @param {Function} updater The function to produce the updated value.
  5223. * @param {Function} [customizer] The function to customize path creation.
  5224. * @returns {Object} Returns `object`.
  5225. */
  5226. function baseUpdate(object, path, updater, customizer) {
  5227. return baseSet(object, path, updater(baseGet(object, path)), customizer);
  5228. }
  5229. /**
  5230. * The base implementation of methods like `_.dropWhile` and `_.takeWhile`
  5231. * without support for iteratee shorthands.
  5232. *
  5233. * @private
  5234. * @param {Array} array The array to query.
  5235. * @param {Function} predicate The function invoked per iteration.
  5236. * @param {boolean} [isDrop] Specify dropping elements instead of taking them.
  5237. * @param {boolean} [fromRight] Specify iterating from right to left.
  5238. * @returns {Array} Returns the slice of `array`.
  5239. */
  5240. function baseWhile(array, predicate, isDrop, fromRight) {
  5241. var length = array.length,
  5242. index = fromRight ? length : -1;
  5243. while ((fromRight ? index-- : ++index < length) &&
  5244. predicate(array[index], index, array)) {}
  5245. return isDrop
  5246. ? baseSlice(array, (fromRight ? 0 : index), (fromRight ? index + 1 : length))
  5247. : baseSlice(array, (fromRight ? index + 1 : 0), (fromRight ? length : index));
  5248. }
  5249. /**
  5250. * The base implementation of `wrapperValue` which returns the result of
  5251. * performing a sequence of actions on the unwrapped `value`, where each
  5252. * successive action is supplied the return value of the previous.
  5253. *
  5254. * @private
  5255. * @param {*} value The unwrapped value.
  5256. * @param {Array} actions Actions to perform to resolve the unwrapped value.
  5257. * @returns {*} Returns the resolved value.
  5258. */
  5259. function baseWrapperValue(value, actions) {
  5260. var result = value;
  5261. if (result instanceof LazyWrapper) {
  5262. result = result.value();
  5263. }
  5264. return arrayReduce(actions, function(result, action) {
  5265. return action.func.apply(action.thisArg, arrayPush([result], action.args));
  5266. }, result);
  5267. }
  5268. /**
  5269. * The base implementation of methods like `_.xor`, without support for
  5270. * iteratee shorthands, that accepts an array of arrays to inspect.
  5271. *
  5272. * @private
  5273. * @param {Array} arrays The arrays to inspect.
  5274. * @param {Function} [iteratee] The iteratee invoked per element.
  5275. * @param {Function} [comparator] The comparator invoked per element.
  5276. * @returns {Array} Returns the new array of values.
  5277. */
  5278. function baseXor(arrays, iteratee, comparator) {
  5279. var length = arrays.length;
  5280. if (length < 2) {
  5281. return length ? baseUniq(arrays[0]) : [];
  5282. }
  5283. var index = -1,
  5284. result = Array(length);
  5285. while (++index < length) {
  5286. var array = arrays[index],
  5287. othIndex = -1;
  5288. while (++othIndex < length) {
  5289. if (othIndex != index) {
  5290. result[index] = baseDifference(result[index] || array, arrays[othIndex], iteratee, comparator);
  5291. }
  5292. }
  5293. }
  5294. return baseUniq(baseFlatten(result, 1), iteratee, comparator);
  5295. }
  5296. /**
  5297. * This base implementation of `_.zipObject` which assigns values using `assignFunc`.
  5298. *
  5299. * @private
  5300. * @param {Array} props The property identifiers.
  5301. * @param {Array} values The property values.
  5302. * @param {Function} assignFunc The function to assign values.
  5303. * @returns {Object} Returns the new object.
  5304. */
  5305. function baseZipObject(props, values, assignFunc) {
  5306. var index = -1,
  5307. length = props.length,
  5308. valsLength = values.length,
  5309. result = {};
  5310. while (++index < length) {
  5311. var value = index < valsLength ? values[index] : undefined;
  5312. assignFunc(result, props[index], value);
  5313. }
  5314. return result;
  5315. }
  5316. /**
  5317. * Casts `value` to an empty array if it's not an array like object.
  5318. *
  5319. * @private
  5320. * @param {*} value The value to inspect.
  5321. * @returns {Array|Object} Returns the cast array-like object.
  5322. */
  5323. function castArrayLikeObject(value) {
  5324. return isArrayLikeObject(value) ? value : [];
  5325. }
  5326. /**
  5327. * Casts `value` to `identity` if it's not a function.
  5328. *
  5329. * @private
  5330. * @param {*} value The value to inspect.
  5331. * @returns {Function} Returns cast function.
  5332. */
  5333. function castFunction(value) {
  5334. return typeof value == 'function' ? value : identity;
  5335. }
  5336. /**
  5337. * Casts `value` to a path array if it's not one.
  5338. *
  5339. * @private
  5340. * @param {*} value The value to inspect.
  5341. * @param {Object} [object] The object to query keys on.
  5342. * @returns {Array} Returns the cast property path array.
  5343. */
  5344. function castPath(value, object) {
  5345. if (isArray(value)) {
  5346. return value;
  5347. }
  5348. return isKey(value, object) ? [value] : stringToPath(toString(value));
  5349. }
  5350. /**
  5351. * A `baseRest` alias which can be replaced with `identity` by module
  5352. * replacement plugins.
  5353. *
  5354. * @private
  5355. * @type {Function}
  5356. * @param {Function} func The function to apply a rest parameter to.
  5357. * @returns {Function} Returns the new function.
  5358. */
  5359. var castRest = baseRest;
  5360. /**
  5361. * Casts `array` to a slice if it's needed.
  5362. *
  5363. * @private
  5364. * @param {Array} array The array to inspect.
  5365. * @param {number} start The start position.
  5366. * @param {number} [end=array.length] The end position.
  5367. * @returns {Array} Returns the cast slice.
  5368. */
  5369. function castSlice(array, start, end) {
  5370. var length = array.length;
  5371. end = end === undefined ? length : end;
  5372. return (!start && end >= length) ? array : baseSlice(array, start, end);
  5373. }
  5374. /**
  5375. * A simple wrapper around the global [`clearTimeout`](https://mdn.io/clearTimeout).
  5376. *
  5377. * @private
  5378. * @param {number|Object} id The timer id or timeout object of the timer to clear.
  5379. */
  5380. var clearTimeout = ctxClearTimeout || function(id) {
  5381. return root.clearTimeout(id);
  5382. };
  5383. /**
  5384. * Creates a clone of `buffer`.
  5385. *
  5386. * @private
  5387. * @param {Buffer} buffer The buffer to clone.
  5388. * @param {boolean} [isDeep] Specify a deep clone.
  5389. * @returns {Buffer} Returns the cloned buffer.
  5390. */
  5391. function cloneBuffer(buffer, isDeep) {
  5392. if (isDeep) {
  5393. return buffer.slice();
  5394. }
  5395. var length = buffer.length,
  5396. result = allocUnsafe ? allocUnsafe(length) : new buffer.constructor(length);
  5397. buffer.copy(result);
  5398. return result;
  5399. }
  5400. /**
  5401. * Creates a clone of `arrayBuffer`.
  5402. *
  5403. * @private
  5404. * @param {ArrayBuffer} arrayBuffer The array buffer to clone.
  5405. * @returns {ArrayBuffer} Returns the cloned array buffer.
  5406. */
  5407. function cloneArrayBuffer(arrayBuffer) {
  5408. var result = new arrayBuffer.constructor(arrayBuffer.byteLength);
  5409. new Uint8Array(result).set(new Uint8Array(arrayBuffer));
  5410. return result;
  5411. }
  5412. /**
  5413. * Creates a clone of `dataView`.
  5414. *
  5415. * @private
  5416. * @param {Object} dataView The data view to clone.
  5417. * @param {boolean} [isDeep] Specify a deep clone.
  5418. * @returns {Object} Returns the cloned data view.
  5419. */
  5420. function cloneDataView(dataView, isDeep) {
  5421. var buffer = isDeep ? cloneArrayBuffer(dataView.buffer) : dataView.buffer;
  5422. return new dataView.constructor(buffer, dataView.byteOffset, dataView.byteLength);
  5423. }
  5424. /**
  5425. * Creates a clone of `regexp`.
  5426. *
  5427. * @private
  5428. * @param {Object} regexp The regexp to clone.
  5429. * @returns {Object} Returns the cloned regexp.
  5430. */
  5431. function cloneRegExp(regexp) {
  5432. var result = new regexp.constructor(regexp.source, reFlags.exec(regexp));
  5433. result.lastIndex = regexp.lastIndex;
  5434. return result;
  5435. }
  5436. /**
  5437. * Creates a clone of the `symbol` object.
  5438. *
  5439. * @private
  5440. * @param {Object} symbol The symbol object to clone.
  5441. * @returns {Object} Returns the cloned symbol object.
  5442. */
  5443. function cloneSymbol(symbol) {
  5444. return symbolValueOf ? Object(symbolValueOf.call(symbol)) : {};
  5445. }
  5446. /**
  5447. * Creates a clone of `typedArray`.
  5448. *
  5449. * @private
  5450. * @param {Object} typedArray The typed array to clone.
  5451. * @param {boolean} [isDeep] Specify a deep clone.
  5452. * @returns {Object} Returns the cloned typed array.
  5453. */
  5454. function cloneTypedArray(typedArray, isDeep) {
  5455. var buffer = isDeep ? cloneArrayBuffer(typedArray.buffer) : typedArray.buffer;
  5456. return new typedArray.constructor(buffer, typedArray.byteOffset, typedArray.length);
  5457. }
  5458. /**
  5459. * Compares values to sort them in ascending order.
  5460. *
  5461. * @private
  5462. * @param {*} value The value to compare.
  5463. * @param {*} other The other value to compare.
  5464. * @returns {number} Returns the sort order indicator for `value`.
  5465. */
  5466. function compareAscending(value, other) {
  5467. if (value !== other) {
  5468. var valIsDefined = value !== undefined,
  5469. valIsNull = value === null,
  5470. valIsReflexive = value === value,
  5471. valIsSymbol = isSymbol(value);
  5472. var othIsDefined = other !== undefined,
  5473. othIsNull = other === null,
  5474. othIsReflexive = other === other,
  5475. othIsSymbol = isSymbol(other);
  5476. if ((!othIsNull && !othIsSymbol && !valIsSymbol && value > other) ||
  5477. (valIsSymbol && othIsDefined && othIsReflexive && !othIsNull && !othIsSymbol) ||
  5478. (valIsNull && othIsDefined && othIsReflexive) ||
  5479. (!valIsDefined && othIsReflexive) ||
  5480. !valIsReflexive) {
  5481. return 1;
  5482. }
  5483. if ((!valIsNull && !valIsSymbol && !othIsSymbol && value < other) ||
  5484. (othIsSymbol && valIsDefined && valIsReflexive && !valIsNull && !valIsSymbol) ||
  5485. (othIsNull && valIsDefined && valIsReflexive) ||
  5486. (!othIsDefined && valIsReflexive) ||
  5487. !othIsReflexive) {
  5488. return -1;
  5489. }
  5490. }
  5491. return 0;
  5492. }
  5493. /**
  5494. * Used by `_.orderBy` to compare multiple properties of a value to another
  5495. * and stable sort them.
  5496. *
  5497. * If `orders` is unspecified, all values are sorted in ascending order. Otherwise,
  5498. * specify an order of "desc" for descending or "asc" for ascending sort order
  5499. * of corresponding values.
  5500. *
  5501. * @private
  5502. * @param {Object} object The object to compare.
  5503. * @param {Object} other The other object to compare.
  5504. * @param {boolean[]|string[]} orders The order to sort by for each property.
  5505. * @returns {number} Returns the sort order indicator for `object`.
  5506. */
  5507. function compareMultiple(object, other, orders) {
  5508. var index = -1,
  5509. objCriteria = object.criteria,
  5510. othCriteria = other.criteria,
  5511. length = objCriteria.length,
  5512. ordersLength = orders.length;
  5513. while (++index < length) {
  5514. var result = compareAscending(objCriteria[index], othCriteria[index]);
  5515. if (result) {
  5516. if (index >= ordersLength) {
  5517. return result;
  5518. }
  5519. var order = orders[index];
  5520. return result * (order == 'desc' ? -1 : 1);
  5521. }
  5522. }
  5523. // Fixes an `Array#sort` bug in the JS engine embedded in Adobe applications
  5524. // that causes it, under certain circumstances, to provide the same value for
  5525. // `object` and `other`. See https://github.com/jashkenas/underscore/pull/1247
  5526. // for more details.
  5527. //
  5528. // This also ensures a stable sort in V8 and other engines.
  5529. // See https://bugs.chromium.org/p/v8/issues/detail?id=90 for more details.
  5530. return object.index - other.index;
  5531. }
  5532. /**
  5533. * Creates an array that is the composition of partially applied arguments,
  5534. * placeholders, and provided arguments into a single array of arguments.
  5535. *
  5536. * @private
  5537. * @param {Array} args The provided arguments.
  5538. * @param {Array} partials The arguments to prepend to those provided.
  5539. * @param {Array} holders The `partials` placeholder indexes.
  5540. * @params {boolean} [isCurried] Specify composing for a curried function.
  5541. * @returns {Array} Returns the new array of composed arguments.
  5542. */
  5543. function composeArgs(args, partials, holders, isCurried) {
  5544. var argsIndex = -1,
  5545. argsLength = args.length,
  5546. holdersLength = holders.length,
  5547. leftIndex = -1,
  5548. leftLength = partials.length,
  5549. rangeLength = nativeMax(argsLength - holdersLength, 0),
  5550. result = Array(leftLength + rangeLength),
  5551. isUncurried = !isCurried;
  5552. while (++leftIndex < leftLength) {
  5553. result[leftIndex] = partials[leftIndex];
  5554. }
  5555. while (++argsIndex < holdersLength) {
  5556. if (isUncurried || argsIndex < argsLength) {
  5557. result[holders[argsIndex]] = args[argsIndex];
  5558. }
  5559. }
  5560. while (rangeLength--) {
  5561. result[leftIndex++] = args[argsIndex++];
  5562. }
  5563. return result;
  5564. }
  5565. /**
  5566. * This function is like `composeArgs` except that the arguments composition
  5567. * is tailored for `_.partialRight`.
  5568. *
  5569. * @private
  5570. * @param {Array} args The provided arguments.
  5571. * @param {Array} partials The arguments to append to those provided.
  5572. * @param {Array} holders The `partials` placeholder indexes.
  5573. * @params {boolean} [isCurried] Specify composing for a curried function.
  5574. * @returns {Array} Returns the new array of composed arguments.
  5575. */
  5576. function composeArgsRight(args, partials, holders, isCurried) {
  5577. var argsIndex = -1,
  5578. argsLength = args.length,
  5579. holdersIndex = -1,
  5580. holdersLength = holders.length,
  5581. rightIndex = -1,
  5582. rightLength = partials.length,
  5583. rangeLength = nativeMax(argsLength - holdersLength, 0),
  5584. result = Array(rangeLength + rightLength),
  5585. isUncurried = !isCurried;
  5586. while (++argsIndex < rangeLength) {
  5587. result[argsIndex] = args[argsIndex];
  5588. }
  5589. var offset = argsIndex;
  5590. while (++rightIndex < rightLength) {
  5591. result[offset + rightIndex] = partials[rightIndex];
  5592. }
  5593. while (++holdersIndex < holdersLength) {
  5594. if (isUncurried || argsIndex < argsLength) {
  5595. result[offset + holders[holdersIndex]] = args[argsIndex++];
  5596. }
  5597. }
  5598. return result;
  5599. }
  5600. /**
  5601. * Copies the values of `source` to `array`.
  5602. *
  5603. * @private
  5604. * @param {Array} source The array to copy values from.
  5605. * @param {Array} [array=[]] The array to copy values to.
  5606. * @returns {Array} Returns `array`.
  5607. */
  5608. function copyArray(source, array) {
  5609. var index = -1,
  5610. length = source.length;
  5611. array || (array = Array(length));
  5612. while (++index < length) {
  5613. array[index] = source[index];
  5614. }
  5615. return array;
  5616. }
  5617. /**
  5618. * Copies properties of `source` to `object`.
  5619. *
  5620. * @private
  5621. * @param {Object} source The object to copy properties from.
  5622. * @param {Array} props The property identifiers to copy.
  5623. * @param {Object} [object={}] The object to copy properties to.
  5624. * @param {Function} [customizer] The function to customize copied values.
  5625. * @returns {Object} Returns `object`.
  5626. */
  5627. function copyObject(source, props, object, customizer) {
  5628. var isNew = !object;
  5629. object || (object = {});
  5630. var index = -1,
  5631. length = props.length;
  5632. while (++index < length) {
  5633. var key = props[index];
  5634. var newValue = customizer
  5635. ? customizer(object[key], source[key], key, object, source)
  5636. : undefined;
  5637. if (newValue === undefined) {
  5638. newValue = source[key];
  5639. }
  5640. if (isNew) {
  5641. baseAssignValue(object, key, newValue);
  5642. } else {
  5643. assignValue(object, key, newValue);
  5644. }
  5645. }
  5646. return object;
  5647. }
  5648. /**
  5649. * Copies own symbols of `source` to `object`.
  5650. *
  5651. * @private
  5652. * @param {Object} source The object to copy symbols from.
  5653. * @param {Object} [object={}] The object to copy symbols to.
  5654. * @returns {Object} Returns `object`.
  5655. */
  5656. function copySymbols(source, object) {
  5657. return copyObject(source, getSymbols(source), object);
  5658. }
  5659. /**
  5660. * Copies own and inherited symbols of `source` to `object`.
  5661. *
  5662. * @private
  5663. * @param {Object} source The object to copy symbols from.
  5664. * @param {Object} [object={}] The object to copy symbols to.
  5665. * @returns {Object} Returns `object`.
  5666. */
  5667. function copySymbolsIn(source, object) {
  5668. return copyObject(source, getSymbolsIn(source), object);
  5669. }
  5670. /**
  5671. * Creates a function like `_.groupBy`.
  5672. *
  5673. * @private
  5674. * @param {Function} setter The function to set accumulator values.
  5675. * @param {Function} [initializer] The accumulator object initializer.
  5676. * @returns {Function} Returns the new aggregator function.
  5677. */
  5678. function createAggregator(setter, initializer) {
  5679. return function(collection, iteratee) {
  5680. var func = isArray(collection) ? arrayAggregator : baseAggregator,
  5681. accumulator = initializer ? initializer() : {};
  5682. return func(collection, setter, getIteratee(iteratee, 2), accumulator);
  5683. };
  5684. }
  5685. /**
  5686. * Creates a function like `_.assign`.
  5687. *
  5688. * @private
  5689. * @param {Function} assigner The function to assign values.
  5690. * @returns {Function} Returns the new assigner function.
  5691. */
  5692. function createAssigner(assigner) {
  5693. return baseRest(function(object, sources) {
  5694. var index = -1,
  5695. length = sources.length,
  5696. customizer = length > 1 ? sources[length - 1] : undefined,
  5697. guard = length > 2 ? sources[2] : undefined;
  5698. customizer = (assigner.length > 3 && typeof customizer == 'function')
  5699. ? (length--, customizer)
  5700. : undefined;
  5701. if (guard && isIterateeCall(sources[0], sources[1], guard)) {
  5702. customizer = length < 3 ? undefined : customizer;
  5703. length = 1;
  5704. }
  5705. object = Object(object);
  5706. while (++index < length) {
  5707. var source = sources[index];
  5708. if (source) {
  5709. assigner(object, source, index, customizer);
  5710. }
  5711. }
  5712. return object;
  5713. });
  5714. }
  5715. /**
  5716. * Creates a `baseEach` or `baseEachRight` function.
  5717. *
  5718. * @private
  5719. * @param {Function} eachFunc The function to iterate over a collection.
  5720. * @param {boolean} [fromRight] Specify iterating from right to left.
  5721. * @returns {Function} Returns the new base function.
  5722. */
  5723. function createBaseEach(eachFunc, fromRight) {
  5724. return function(collection, iteratee) {
  5725. if (collection == null) {
  5726. return collection;
  5727. }
  5728. if (!isArrayLike(collection)) {
  5729. return eachFunc(collection, iteratee);
  5730. }
  5731. var length = collection.length,
  5732. index = fromRight ? length : -1,
  5733. iterable = Object(collection);
  5734. while ((fromRight ? index-- : ++index < length)) {
  5735. if (iteratee(iterable[index], index, iterable) === false) {
  5736. break;
  5737. }
  5738. }
  5739. return collection;
  5740. };
  5741. }
  5742. /**
  5743. * Creates a base function for methods like `_.forIn` and `_.forOwn`.
  5744. *
  5745. * @private
  5746. * @param {boolean} [fromRight] Specify iterating from right to left.
  5747. * @returns {Function} Returns the new base function.
  5748. */
  5749. function createBaseFor(fromRight) {
  5750. return function(object, iteratee, keysFunc) {
  5751. var index = -1,
  5752. iterable = Object(object),
  5753. props = keysFunc(object),
  5754. length = props.length;
  5755. while (length--) {
  5756. var key = props[fromRight ? length : ++index];
  5757. if (iteratee(iterable[key], key, iterable) === false) {
  5758. break;
  5759. }
  5760. }
  5761. return object;
  5762. };
  5763. }
  5764. /**
  5765. * Creates a function that wraps `func` to invoke it with the optional `this`
  5766. * binding of `thisArg`.
  5767. *
  5768. * @private
  5769. * @param {Function} func The function to wrap.
  5770. * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
  5771. * @param {*} [thisArg] The `this` binding of `func`.
  5772. * @returns {Function} Returns the new wrapped function.
  5773. */
  5774. function createBind(func, bitmask, thisArg) {
  5775. var isBind = bitmask & WRAP_BIND_FLAG,
  5776. Ctor = createCtor(func);
  5777. function wrapper() {
  5778. var fn = (this && this !== root && this instanceof wrapper) ? Ctor : func;
  5779. return fn.apply(isBind ? thisArg : this, arguments);
  5780. }
  5781. return wrapper;
  5782. }
  5783. /**
  5784. * Creates a function like `_.lowerFirst`.
  5785. *
  5786. * @private
  5787. * @param {string} methodName The name of the `String` case method to use.
  5788. * @returns {Function} Returns the new case function.
  5789. */
  5790. function createCaseFirst(methodName) {
  5791. return function(string) {
  5792. string = toString(string);
  5793. var strSymbols = hasUnicode(string)
  5794. ? stringToArray(string)
  5795. : undefined;
  5796. var chr = strSymbols
  5797. ? strSymbols[0]
  5798. : string.charAt(0);
  5799. var trailing = strSymbols
  5800. ? castSlice(strSymbols, 1).join('')
  5801. : string.slice(1);
  5802. return chr[methodName]() + trailing;
  5803. };
  5804. }
  5805. /**
  5806. * Creates a function like `_.camelCase`.
  5807. *
  5808. * @private
  5809. * @param {Function} callback The function to combine each word.
  5810. * @returns {Function} Returns the new compounder function.
  5811. */
  5812. function createCompounder(callback) {
  5813. return function(string) {
  5814. return arrayReduce(words(deburr(string).replace(reApos, '')), callback, '');
  5815. };
  5816. }
  5817. /**
  5818. * Creates a function that produces an instance of `Ctor` regardless of
  5819. * whether it was invoked as part of a `new` expression or by `call` or `apply`.
  5820. *
  5821. * @private
  5822. * @param {Function} Ctor The constructor to wrap.
  5823. * @returns {Function} Returns the new wrapped function.
  5824. */
  5825. function createCtor(Ctor) {
  5826. return function() {
  5827. // Use a `switch` statement to work with class constructors. See
  5828. // http://ecma-international.org/ecma-262/7.0/#sec-ecmascript-function-objects-call-thisargument-argumentslist
  5829. // for more details.
  5830. var args = arguments;
  5831. switch (args.length) {
  5832. case 0: return new Ctor;
  5833. case 1: return new Ctor(args[0]);
  5834. case 2: return new Ctor(args[0], args[1]);
  5835. case 3: return new Ctor(args[0], args[1], args[2]);
  5836. case 4: return new Ctor(args[0], args[1], args[2], args[3]);
  5837. case 5: return new Ctor(args[0], args[1], args[2], args[3], args[4]);
  5838. case 6: return new Ctor(args[0], args[1], args[2], args[3], args[4], args[5]);
  5839. case 7: return new Ctor(args[0], args[1], args[2], args[3], args[4], args[5], args[6]);
  5840. }
  5841. var thisBinding = baseCreate(Ctor.prototype),
  5842. result = Ctor.apply(thisBinding, args);
  5843. // Mimic the constructor's `return` behavior.
  5844. // See https://es5.github.io/#x13.2.2 for more details.
  5845. return isObject(result) ? result : thisBinding;
  5846. };
  5847. }
  5848. /**
  5849. * Creates a function that wraps `func` to enable currying.
  5850. *
  5851. * @private
  5852. * @param {Function} func The function to wrap.
  5853. * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
  5854. * @param {number} arity The arity of `func`.
  5855. * @returns {Function} Returns the new wrapped function.
  5856. */
  5857. function createCurry(func, bitmask, arity) {
  5858. var Ctor = createCtor(func);
  5859. function wrapper() {
  5860. var length = arguments.length,
  5861. args = Array(length),
  5862. index = length,
  5863. placeholder = getHolder(wrapper);
  5864. while (index--) {
  5865. args[index] = arguments[index];
  5866. }
  5867. var holders = (length < 3 && args[0] !== placeholder && args[length - 1] !== placeholder)
  5868. ? []
  5869. : replaceHolders(args, placeholder);
  5870. length -= holders.length;
  5871. if (length < arity) {
  5872. return createRecurry(
  5873. func, bitmask, createHybrid, wrapper.placeholder, undefined,
  5874. args, holders, undefined, undefined, arity - length);
  5875. }
  5876. var fn = (this && this !== root && this instanceof wrapper) ? Ctor : func;
  5877. return apply(fn, this, args);
  5878. }
  5879. return wrapper;
  5880. }
  5881. /**
  5882. * Creates a `_.find` or `_.findLast` function.
  5883. *
  5884. * @private
  5885. * @param {Function} findIndexFunc The function to find the collection index.
  5886. * @returns {Function} Returns the new find function.
  5887. */
  5888. function createFind(findIndexFunc) {
  5889. return function(collection, predicate, fromIndex) {
  5890. var iterable = Object(collection);
  5891. if (!isArrayLike(collection)) {
  5892. var iteratee = getIteratee(predicate, 3);
  5893. collection = keys(collection);
  5894. predicate = function(key) { return iteratee(iterable[key], key, iterable); };
  5895. }
  5896. var index = findIndexFunc(collection, predicate, fromIndex);
  5897. return index > -1 ? iterable[iteratee ? collection[index] : index] : undefined;
  5898. };
  5899. }
  5900. /**
  5901. * Creates a `_.flow` or `_.flowRight` function.
  5902. *
  5903. * @private
  5904. * @param {boolean} [fromRight] Specify iterating from right to left.
  5905. * @returns {Function} Returns the new flow function.
  5906. */
  5907. function createFlow(fromRight) {
  5908. return flatRest(function(funcs) {
  5909. var length = funcs.length,
  5910. index = length,
  5911. prereq = LodashWrapper.prototype.thru;
  5912. if (fromRight) {
  5913. funcs.reverse();
  5914. }
  5915. while (index--) {
  5916. var func = funcs[index];
  5917. if (typeof func != 'function') {
  5918. throw new TypeError(FUNC_ERROR_TEXT);
  5919. }
  5920. if (prereq && !wrapper && getFuncName(func) == 'wrapper') {
  5921. var wrapper = new LodashWrapper([], true);
  5922. }
  5923. }
  5924. index = wrapper ? index : length;
  5925. while (++index < length) {
  5926. func = funcs[index];
  5927. var funcName = getFuncName(func),
  5928. data = funcName == 'wrapper' ? getData(func) : undefined;
  5929. if (data && isLaziable(data[0]) &&
  5930. data[1] == (WRAP_ARY_FLAG | WRAP_CURRY_FLAG | WRAP_PARTIAL_FLAG | WRAP_REARG_FLAG) &&
  5931. !data[4].length && data[9] == 1
  5932. ) {
  5933. wrapper = wrapper[getFuncName(data[0])].apply(wrapper, data[3]);
  5934. } else {
  5935. wrapper = (func.length == 1 && isLaziable(func))
  5936. ? wrapper[funcName]()
  5937. : wrapper.thru(func);
  5938. }
  5939. }
  5940. return function() {
  5941. var args = arguments,
  5942. value = args[0];
  5943. if (wrapper && args.length == 1 && isArray(value)) {
  5944. return wrapper.plant(value).value();
  5945. }
  5946. var index = 0,
  5947. result = length ? funcs[index].apply(this, args) : value;
  5948. while (++index < length) {
  5949. result = funcs[index].call(this, result);
  5950. }
  5951. return result;
  5952. };
  5953. });
  5954. }
  5955. /**
  5956. * Creates a function that wraps `func` to invoke it with optional `this`
  5957. * binding of `thisArg`, partial application, and currying.
  5958. *
  5959. * @private
  5960. * @param {Function|string} func The function or method name to wrap.
  5961. * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
  5962. * @param {*} [thisArg] The `this` binding of `func`.
  5963. * @param {Array} [partials] The arguments to prepend to those provided to
  5964. * the new function.
  5965. * @param {Array} [holders] The `partials` placeholder indexes.
  5966. * @param {Array} [partialsRight] The arguments to append to those provided
  5967. * to the new function.
  5968. * @param {Array} [holdersRight] The `partialsRight` placeholder indexes.
  5969. * @param {Array} [argPos] The argument positions of the new function.
  5970. * @param {number} [ary] The arity cap of `func`.
  5971. * @param {number} [arity] The arity of `func`.
  5972. * @returns {Function} Returns the new wrapped function.
  5973. */
  5974. function createHybrid(func, bitmask, thisArg, partials, holders, partialsRight, holdersRight, argPos, ary, arity) {
  5975. var isAry = bitmask & WRAP_ARY_FLAG,
  5976. isBind = bitmask & WRAP_BIND_FLAG,
  5977. isBindKey = bitmask & WRAP_BIND_KEY_FLAG,
  5978. isCurried = bitmask & (WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG),
  5979. isFlip = bitmask & WRAP_FLIP_FLAG,
  5980. Ctor = isBindKey ? undefined : createCtor(func);
  5981. function wrapper() {
  5982. var length = arguments.length,
  5983. args = Array(length),
  5984. index = length;
  5985. while (index--) {
  5986. args[index] = arguments[index];
  5987. }
  5988. if (isCurried) {
  5989. var placeholder = getHolder(wrapper),
  5990. holdersCount = countHolders(args, placeholder);
  5991. }
  5992. if (partials) {
  5993. args = composeArgs(args, partials, holders, isCurried);
  5994. }
  5995. if (partialsRight) {
  5996. args = composeArgsRight(args, partialsRight, holdersRight, isCurried);
  5997. }
  5998. length -= holdersCount;
  5999. if (isCurried && length < arity) {
  6000. var newHolders = replaceHolders(args, placeholder);
  6001. return createRecurry(
  6002. func, bitmask, createHybrid, wrapper.placeholder, thisArg,
  6003. args, newHolders, argPos, ary, arity - length
  6004. );
  6005. }
  6006. var thisBinding = isBind ? thisArg : this,
  6007. fn = isBindKey ? thisBinding[func] : func;
  6008. length = args.length;
  6009. if (argPos) {
  6010. args = reorder(args, argPos);
  6011. } else if (isFlip && length > 1) {
  6012. args.reverse();
  6013. }
  6014. if (isAry && ary < length) {
  6015. args.length = ary;
  6016. }
  6017. if (this && this !== root && this instanceof wrapper) {
  6018. fn = Ctor || createCtor(fn);
  6019. }
  6020. return fn.apply(thisBinding, args);
  6021. }
  6022. return wrapper;
  6023. }
  6024. /**
  6025. * Creates a function like `_.invertBy`.
  6026. *
  6027. * @private
  6028. * @param {Function} setter The function to set accumulator values.
  6029. * @param {Function} toIteratee The function to resolve iteratees.
  6030. * @returns {Function} Returns the new inverter function.
  6031. */
  6032. function createInverter(setter, toIteratee) {
  6033. return function(object, iteratee) {
  6034. return baseInverter(object, setter, toIteratee(iteratee), {});
  6035. };
  6036. }
  6037. /**
  6038. * Creates a function that performs a mathematical operation on two values.
  6039. *
  6040. * @private
  6041. * @param {Function} operator The function to perform the operation.
  6042. * @param {number} [defaultValue] The value used for `undefined` arguments.
  6043. * @returns {Function} Returns the new mathematical operation function.
  6044. */
  6045. function createMathOperation(operator, defaultValue) {
  6046. return function(value, other) {
  6047. var result;
  6048. if (value === undefined && other === undefined) {
  6049. return defaultValue;
  6050. }
  6051. if (value !== undefined) {
  6052. result = value;
  6053. }
  6054. if (other !== undefined) {
  6055. if (result === undefined) {
  6056. return other;
  6057. }
  6058. if (typeof value == 'string' || typeof other == 'string') {
  6059. value = baseToString(value);
  6060. other = baseToString(other);
  6061. } else {
  6062. value = baseToNumber(value);
  6063. other = baseToNumber(other);
  6064. }
  6065. result = operator(value, other);
  6066. }
  6067. return result;
  6068. };
  6069. }
  6070. /**
  6071. * Creates a function like `_.over`.
  6072. *
  6073. * @private
  6074. * @param {Function} arrayFunc The function to iterate over iteratees.
  6075. * @returns {Function} Returns the new over function.
  6076. */
  6077. function createOver(arrayFunc) {
  6078. return flatRest(function(iteratees) {
  6079. iteratees = arrayMap(iteratees, baseUnary(getIteratee()));
  6080. return baseRest(function(args) {
  6081. var thisArg = this;
  6082. return arrayFunc(iteratees, function(iteratee) {
  6083. return apply(iteratee, thisArg, args);
  6084. });
  6085. });
  6086. });
  6087. }
  6088. /**
  6089. * Creates the padding for `string` based on `length`. The `chars` string
  6090. * is truncated if the number of characters exceeds `length`.
  6091. *
  6092. * @private
  6093. * @param {number} length The padding length.
  6094. * @param {string} [chars=' '] The string used as padding.
  6095. * @returns {string} Returns the padding for `string`.
  6096. */
  6097. function createPadding(length, chars) {
  6098. chars = chars === undefined ? ' ' : baseToString(chars);
  6099. var charsLength = chars.length;
  6100. if (charsLength < 2) {
  6101. return charsLength ? baseRepeat(chars, length) : chars;
  6102. }
  6103. var result = baseRepeat(chars, nativeCeil(length / stringSize(chars)));
  6104. return hasUnicode(chars)
  6105. ? castSlice(stringToArray(result), 0, length).join('')
  6106. : result.slice(0, length);
  6107. }
  6108. /**
  6109. * Creates a function that wraps `func` to invoke it with the `this` binding
  6110. * of `thisArg` and `partials` prepended to the arguments it receives.
  6111. *
  6112. * @private
  6113. * @param {Function} func The function to wrap.
  6114. * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
  6115. * @param {*} thisArg The `this` binding of `func`.
  6116. * @param {Array} partials The arguments to prepend to those provided to
  6117. * the new function.
  6118. * @returns {Function} Returns the new wrapped function.
  6119. */
  6120. function createPartial(func, bitmask, thisArg, partials) {
  6121. var isBind = bitmask & WRAP_BIND_FLAG,
  6122. Ctor = createCtor(func);
  6123. function wrapper() {
  6124. var argsIndex = -1,
  6125. argsLength = arguments.length,
  6126. leftIndex = -1,
  6127. leftLength = partials.length,
  6128. args = Array(leftLength + argsLength),
  6129. fn = (this && this !== root && this instanceof wrapper) ? Ctor : func;
  6130. while (++leftIndex < leftLength) {
  6131. args[leftIndex] = partials[leftIndex];
  6132. }
  6133. while (argsLength--) {
  6134. args[leftIndex++] = arguments[++argsIndex];
  6135. }
  6136. return apply(fn, isBind ? thisArg : this, args);
  6137. }
  6138. return wrapper;
  6139. }
  6140. /**
  6141. * Creates a `_.range` or `_.rangeRight` function.
  6142. *
  6143. * @private
  6144. * @param {boolean} [fromRight] Specify iterating from right to left.
  6145. * @returns {Function} Returns the new range function.
  6146. */
  6147. function createRange(fromRight) {
  6148. return function(start, end, step) {
  6149. if (step && typeof step != 'number' && isIterateeCall(start, end, step)) {
  6150. end = step = undefined;
  6151. }
  6152. // Ensure the sign of `-0` is preserved.
  6153. start = toFinite(start);
  6154. if (end === undefined) {
  6155. end = start;
  6156. start = 0;
  6157. } else {
  6158. end = toFinite(end);
  6159. }
  6160. step = step === undefined ? (start < end ? 1 : -1) : toFinite(step);
  6161. return baseRange(start, end, step, fromRight);
  6162. };
  6163. }
  6164. /**
  6165. * Creates a function that performs a relational operation on two values.
  6166. *
  6167. * @private
  6168. * @param {Function} operator The function to perform the operation.
  6169. * @returns {Function} Returns the new relational operation function.
  6170. */
  6171. function createRelationalOperation(operator) {
  6172. return function(value, other) {
  6173. if (!(typeof value == 'string' && typeof other == 'string')) {
  6174. value = toNumber(value);
  6175. other = toNumber(other);
  6176. }
  6177. return operator(value, other);
  6178. };
  6179. }
  6180. /**
  6181. * Creates a function that wraps `func` to continue currying.
  6182. *
  6183. * @private
  6184. * @param {Function} func The function to wrap.
  6185. * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
  6186. * @param {Function} wrapFunc The function to create the `func` wrapper.
  6187. * @param {*} placeholder The placeholder value.
  6188. * @param {*} [thisArg] The `this` binding of `func`.
  6189. * @param {Array} [partials] The arguments to prepend to those provided to
  6190. * the new function.
  6191. * @param {Array} [holders] The `partials` placeholder indexes.
  6192. * @param {Array} [argPos] The argument positions of the new function.
  6193. * @param {number} [ary] The arity cap of `func`.
  6194. * @param {number} [arity] The arity of `func`.
  6195. * @returns {Function} Returns the new wrapped function.
  6196. */
  6197. function createRecurry(func, bitmask, wrapFunc, placeholder, thisArg, partials, holders, argPos, ary, arity) {
  6198. var isCurry = bitmask & WRAP_CURRY_FLAG,
  6199. newHolders = isCurry ? holders : undefined,
  6200. newHoldersRight = isCurry ? undefined : holders,
  6201. newPartials = isCurry ? partials : undefined,
  6202. newPartialsRight = isCurry ? undefined : partials;
  6203. bitmask |= (isCurry ? WRAP_PARTIAL_FLAG : WRAP_PARTIAL_RIGHT_FLAG);
  6204. bitmask &= ~(isCurry ? WRAP_PARTIAL_RIGHT_FLAG : WRAP_PARTIAL_FLAG);
  6205. if (!(bitmask & WRAP_CURRY_BOUND_FLAG)) {
  6206. bitmask &= ~(WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG);
  6207. }
  6208. var newData = [
  6209. func, bitmask, thisArg, newPartials, newHolders, newPartialsRight,
  6210. newHoldersRight, argPos, ary, arity
  6211. ];
  6212. var result = wrapFunc.apply(undefined, newData);
  6213. if (isLaziable(func)) {
  6214. setData(result, newData);
  6215. }
  6216. result.placeholder = placeholder;
  6217. return setWrapToString(result, func, bitmask);
  6218. }
  6219. /**
  6220. * Creates a function like `_.round`.
  6221. *
  6222. * @private
  6223. * @param {string} methodName The name of the `Math` method to use when rounding.
  6224. * @returns {Function} Returns the new round function.
  6225. */
  6226. function createRound(methodName) {
  6227. var func = Math[methodName];
  6228. return function(number, precision) {
  6229. number = toNumber(number);
  6230. precision = precision == null ? 0 : nativeMin(toInteger(precision), 292);
  6231. if (precision && nativeIsFinite(number)) {
  6232. // Shift with exponential notation to avoid floating-point issues.
  6233. // See [MDN](https://mdn.io/round#Examples) for more details.
  6234. var pair = (toString(number) + 'e').split('e'),
  6235. value = func(pair[0] + 'e' + (+pair[1] + precision));
  6236. pair = (toString(value) + 'e').split('e');
  6237. return +(pair[0] + 'e' + (+pair[1] - precision));
  6238. }
  6239. return func(number);
  6240. };
  6241. }
  6242. /**
  6243. * Creates a set object of `values`.
  6244. *
  6245. * @private
  6246. * @param {Array} values The values to add to the set.
  6247. * @returns {Object} Returns the new set.
  6248. */
  6249. var createSet = !(Set && (1 / setToArray(new Set([,-0]))[1]) == INFINITY) ? noop : function(values) {
  6250. return new Set(values);
  6251. };
  6252. /**
  6253. * Creates a `_.toPairs` or `_.toPairsIn` function.
  6254. *
  6255. * @private
  6256. * @param {Function} keysFunc The function to get the keys of a given object.
  6257. * @returns {Function} Returns the new pairs function.
  6258. */
  6259. function createToPairs(keysFunc) {
  6260. return function(object) {
  6261. var tag = getTag(object);
  6262. if (tag == mapTag) {
  6263. return mapToArray(object);
  6264. }
  6265. if (tag == setTag) {
  6266. return setToPairs(object);
  6267. }
  6268. return baseToPairs(object, keysFunc(object));
  6269. };
  6270. }
  6271. /**
  6272. * Creates a function that either curries or invokes `func` with optional
  6273. * `this` binding and partially applied arguments.
  6274. *
  6275. * @private
  6276. * @param {Function|string} func The function or method name to wrap.
  6277. * @param {number} bitmask The bitmask flags.
  6278. * 1 - `_.bind`
  6279. * 2 - `_.bindKey`
  6280. * 4 - `_.curry` or `_.curryRight` of a bound function
  6281. * 8 - `_.curry`
  6282. * 16 - `_.curryRight`
  6283. * 32 - `_.partial`
  6284. * 64 - `_.partialRight`
  6285. * 128 - `_.rearg`
  6286. * 256 - `_.ary`
  6287. * 512 - `_.flip`
  6288. * @param {*} [thisArg] The `this` binding of `func`.
  6289. * @param {Array} [partials] The arguments to be partially applied.
  6290. * @param {Array} [holders] The `partials` placeholder indexes.
  6291. * @param {Array} [argPos] The argument positions of the new function.
  6292. * @param {number} [ary] The arity cap of `func`.
  6293. * @param {number} [arity] The arity of `func`.
  6294. * @returns {Function} Returns the new wrapped function.
  6295. */
  6296. function createWrap(func, bitmask, thisArg, partials, holders, argPos, ary, arity) {
  6297. var isBindKey = bitmask & WRAP_BIND_KEY_FLAG;
  6298. if (!isBindKey && typeof func != 'function') {
  6299. throw new TypeError(FUNC_ERROR_TEXT);
  6300. }
  6301. var length = partials ? partials.length : 0;
  6302. if (!length) {
  6303. bitmask &= ~(WRAP_PARTIAL_FLAG | WRAP_PARTIAL_RIGHT_FLAG);
  6304. partials = holders = undefined;
  6305. }
  6306. ary = ary === undefined ? ary : nativeMax(toInteger(ary), 0);
  6307. arity = arity === undefined ? arity : toInteger(arity);
  6308. length -= holders ? holders.length : 0;
  6309. if (bitmask & WRAP_PARTIAL_RIGHT_FLAG) {
  6310. var partialsRight = partials,
  6311. holdersRight = holders;
  6312. partials = holders = undefined;
  6313. }
  6314. var data = isBindKey ? undefined : getData(func);
  6315. var newData = [
  6316. func, bitmask, thisArg, partials, holders, partialsRight, holdersRight,
  6317. argPos, ary, arity
  6318. ];
  6319. if (data) {
  6320. mergeData(newData, data);
  6321. }
  6322. func = newData[0];
  6323. bitmask = newData[1];
  6324. thisArg = newData[2];
  6325. partials = newData[3];
  6326. holders = newData[4];
  6327. arity = newData[9] = newData[9] === undefined
  6328. ? (isBindKey ? 0 : func.length)
  6329. : nativeMax(newData[9] - length, 0);
  6330. if (!arity && bitmask & (WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG)) {
  6331. bitmask &= ~(WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG);
  6332. }
  6333. if (!bitmask || bitmask == WRAP_BIND_FLAG) {
  6334. var result = createBind(func, bitmask, thisArg);
  6335. } else if (bitmask == WRAP_CURRY_FLAG || bitmask == WRAP_CURRY_RIGHT_FLAG) {
  6336. result = createCurry(func, bitmask, arity);
  6337. } else if ((bitmask == WRAP_PARTIAL_FLAG || bitmask == (WRAP_BIND_FLAG | WRAP_PARTIAL_FLAG)) && !holders.length) {
  6338. result = createPartial(func, bitmask, thisArg, partials);
  6339. } else {
  6340. result = createHybrid.apply(undefined, newData);
  6341. }
  6342. var setter = data ? baseSetData : setData;
  6343. return setWrapToString(setter(result, newData), func, bitmask);
  6344. }
  6345. /**
  6346. * Used by `_.defaults` to customize its `_.assignIn` use to assign properties
  6347. * of source objects to the destination object for all destination properties
  6348. * that resolve to `undefined`.
  6349. *
  6350. * @private
  6351. * @param {*} objValue The destination value.
  6352. * @param {*} srcValue The source value.
  6353. * @param {string} key The key of the property to assign.
  6354. * @param {Object} object The parent object of `objValue`.
  6355. * @returns {*} Returns the value to assign.
  6356. */
  6357. function customDefaultsAssignIn(objValue, srcValue, key, object) {
  6358. if (objValue === undefined ||
  6359. (eq(objValue, objectProto[key]) && !hasOwnProperty.call(object, key))) {
  6360. return srcValue;
  6361. }
  6362. return objValue;
  6363. }
  6364. /**
  6365. * Used by `_.defaultsDeep` to customize its `_.merge` use to merge source
  6366. * objects into destination objects that are passed thru.
  6367. *
  6368. * @private
  6369. * @param {*} objValue The destination value.
  6370. * @param {*} srcValue The source value.
  6371. * @param {string} key The key of the property to merge.
  6372. * @param {Object} object The parent object of `objValue`.
  6373. * @param {Object} source The parent object of `srcValue`.
  6374. * @param {Object} [stack] Tracks traversed source values and their merged
  6375. * counterparts.
  6376. * @returns {*} Returns the value to assign.
  6377. */
  6378. function customDefaultsMerge(objValue, srcValue, key, object, source, stack) {
  6379. if (isObject(objValue) && isObject(srcValue)) {
  6380. // Recursively merge objects and arrays (susceptible to call stack limits).
  6381. stack.set(srcValue, objValue);
  6382. baseMerge(objValue, srcValue, undefined, customDefaultsMerge, stack);
  6383. stack['delete'](srcValue);
  6384. }
  6385. return objValue;
  6386. }
  6387. /**
  6388. * Used by `_.omit` to customize its `_.cloneDeep` use to only clone plain
  6389. * objects.
  6390. *
  6391. * @private
  6392. * @param {*} value The value to inspect.
  6393. * @param {string} key The key of the property to inspect.
  6394. * @returns {*} Returns the uncloned value or `undefined` to defer cloning to `_.cloneDeep`.
  6395. */
  6396. function customOmitClone(value) {
  6397. return isPlainObject(value) ? undefined : value;
  6398. }
  6399. /**
  6400. * A specialized version of `baseIsEqualDeep` for arrays with support for
  6401. * partial deep comparisons.
  6402. *
  6403. * @private
  6404. * @param {Array} array The array to compare.
  6405. * @param {Array} other The other array to compare.
  6406. * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
  6407. * @param {Function} customizer The function to customize comparisons.
  6408. * @param {Function} equalFunc The function to determine equivalents of values.
  6409. * @param {Object} stack Tracks traversed `array` and `other` objects.
  6410. * @returns {boolean} Returns `true` if the arrays are equivalent, else `false`.
  6411. */
  6412. function equalArrays(array, other, bitmask, customizer, equalFunc, stack) {
  6413. var isPartial = bitmask & COMPARE_PARTIAL_FLAG,
  6414. arrLength = array.length,
  6415. othLength = other.length;
  6416. if (arrLength != othLength && !(isPartial && othLength > arrLength)) {
  6417. return false;
  6418. }
  6419. // Check that cyclic values are equal.
  6420. var arrStacked = stack.get(array);
  6421. var othStacked = stack.get(other);
  6422. if (arrStacked && othStacked) {
  6423. return arrStacked == other && othStacked == array;
  6424. }
  6425. var index = -1,
  6426. result = true,
  6427. seen = (bitmask & COMPARE_UNORDERED_FLAG) ? new SetCache : undefined;
  6428. stack.set(array, other);
  6429. stack.set(other, array);
  6430. // Ignore non-index properties.
  6431. while (++index < arrLength) {
  6432. var arrValue = array[index],
  6433. othValue = other[index];
  6434. if (customizer) {
  6435. var compared = isPartial
  6436. ? customizer(othValue, arrValue, index, other, array, stack)
  6437. : customizer(arrValue, othValue, index, array, other, stack);
  6438. }
  6439. if (compared !== undefined) {
  6440. if (compared) {
  6441. continue;
  6442. }
  6443. result = false;
  6444. break;
  6445. }
  6446. // Recursively compare arrays (susceptible to call stack limits).
  6447. if (seen) {
  6448. if (!arraySome(other, function(othValue, othIndex) {
  6449. if (!cacheHas(seen, othIndex) &&
  6450. (arrValue === othValue || equalFunc(arrValue, othValue, bitmask, customizer, stack))) {
  6451. return seen.push(othIndex);
  6452. }
  6453. })) {
  6454. result = false;
  6455. break;
  6456. }
  6457. } else if (!(
  6458. arrValue === othValue ||
  6459. equalFunc(arrValue, othValue, bitmask, customizer, stack)
  6460. )) {
  6461. result = false;
  6462. break;
  6463. }
  6464. }
  6465. stack['delete'](array);
  6466. stack['delete'](other);
  6467. return result;
  6468. }
  6469. /**
  6470. * A specialized version of `baseIsEqualDeep` for comparing objects of
  6471. * the same `toStringTag`.
  6472. *
  6473. * **Note:** This function only supports comparing values with tags of
  6474. * `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`.
  6475. *
  6476. * @private
  6477. * @param {Object} object The object to compare.
  6478. * @param {Object} other The other object to compare.
  6479. * @param {string} tag The `toStringTag` of the objects to compare.
  6480. * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
  6481. * @param {Function} customizer The function to customize comparisons.
  6482. * @param {Function} equalFunc The function to determine equivalents of values.
  6483. * @param {Object} stack Tracks traversed `object` and `other` objects.
  6484. * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
  6485. */
  6486. function equalByTag(object, other, tag, bitmask, customizer, equalFunc, stack) {
  6487. switch (tag) {
  6488. case dataViewTag:
  6489. if ((object.byteLength != other.byteLength) ||
  6490. (object.byteOffset != other.byteOffset)) {
  6491. return false;
  6492. }
  6493. object = object.buffer;
  6494. other = other.buffer;
  6495. case arrayBufferTag:
  6496. if ((object.byteLength != other.byteLength) ||
  6497. !equalFunc(new Uint8Array(object), new Uint8Array(other))) {
  6498. return false;
  6499. }
  6500. return true;
  6501. case boolTag:
  6502. case dateTag:
  6503. case numberTag:
  6504. // Coerce booleans to `1` or `0` and dates to milliseconds.
  6505. // Invalid dates are coerced to `NaN`.
  6506. return eq(+object, +other);
  6507. case errorTag:
  6508. return object.name == other.name && object.message == other.message;
  6509. case regexpTag:
  6510. case stringTag:
  6511. // Coerce regexes to strings and treat strings, primitives and objects,
  6512. // as equal. See http://www.ecma-international.org/ecma-262/7.0/#sec-regexp.prototype.tostring
  6513. // for more details.
  6514. return object == (other + '');
  6515. case mapTag:
  6516. var convert = mapToArray;
  6517. case setTag:
  6518. var isPartial = bitmask & COMPARE_PARTIAL_FLAG;
  6519. convert || (convert = setToArray);
  6520. if (object.size != other.size && !isPartial) {
  6521. return false;
  6522. }
  6523. // Assume cyclic values are equal.
  6524. var stacked = stack.get(object);
  6525. if (stacked) {
  6526. return stacked == other;
  6527. }
  6528. bitmask |= COMPARE_UNORDERED_FLAG;
  6529. // Recursively compare objects (susceptible to call stack limits).
  6530. stack.set(object, other);
  6531. var result = equalArrays(convert(object), convert(other), bitmask, customizer, equalFunc, stack);
  6532. stack['delete'](object);
  6533. return result;
  6534. case symbolTag:
  6535. if (symbolValueOf) {
  6536. return symbolValueOf.call(object) == symbolValueOf.call(other);
  6537. }
  6538. }
  6539. return false;
  6540. }
  6541. /**
  6542. * A specialized version of `baseIsEqualDeep` for objects with support for
  6543. * partial deep comparisons.
  6544. *
  6545. * @private
  6546. * @param {Object} object The object to compare.
  6547. * @param {Object} other The other object to compare.
  6548. * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
  6549. * @param {Function} customizer The function to customize comparisons.
  6550. * @param {Function} equalFunc The function to determine equivalents of values.
  6551. * @param {Object} stack Tracks traversed `object` and `other` objects.
  6552. * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
  6553. */
  6554. function equalObjects(object, other, bitmask, customizer, equalFunc, stack) {
  6555. var isPartial = bitmask & COMPARE_PARTIAL_FLAG,
  6556. objProps = getAllKeys(object),
  6557. objLength = objProps.length,
  6558. othProps = getAllKeys(other),
  6559. othLength = othProps.length;
  6560. if (objLength != othLength && !isPartial) {
  6561. return false;
  6562. }
  6563. var index = objLength;
  6564. while (index--) {
  6565. var key = objProps[index];
  6566. if (!(isPartial ? key in other : hasOwnProperty.call(other, key))) {
  6567. return false;
  6568. }
  6569. }
  6570. // Check that cyclic values are equal.
  6571. var objStacked = stack.get(object);
  6572. var othStacked = stack.get(other);
  6573. if (objStacked && othStacked) {
  6574. return objStacked == other && othStacked == object;
  6575. }
  6576. var result = true;
  6577. stack.set(object, other);
  6578. stack.set(other, object);
  6579. var skipCtor = isPartial;
  6580. while (++index < objLength) {
  6581. key = objProps[index];
  6582. var objValue = object[key],
  6583. othValue = other[key];
  6584. if (customizer) {
  6585. var compared = isPartial
  6586. ? customizer(othValue, objValue, key, other, object, stack)
  6587. : customizer(objValue, othValue, key, object, other, stack);
  6588. }
  6589. // Recursively compare objects (susceptible to call stack limits).
  6590. if (!(compared === undefined
  6591. ? (objValue === othValue || equalFunc(objValue, othValue, bitmask, customizer, stack))
  6592. : compared
  6593. )) {
  6594. result = false;
  6595. break;
  6596. }
  6597. skipCtor || (skipCtor = key == 'constructor');
  6598. }
  6599. if (result && !skipCtor) {
  6600. var objCtor = object.constructor,
  6601. othCtor = other.constructor;
  6602. // Non `Object` object instances with different constructors are not equal.
  6603. if (objCtor != othCtor &&
  6604. ('constructor' in object && 'constructor' in other) &&
  6605. !(typeof objCtor == 'function' && objCtor instanceof objCtor &&
  6606. typeof othCtor == 'function' && othCtor instanceof othCtor)) {
  6607. result = false;
  6608. }
  6609. }
  6610. stack['delete'](object);
  6611. stack['delete'](other);
  6612. return result;
  6613. }
  6614. /**
  6615. * A specialized version of `baseRest` which flattens the rest array.
  6616. *
  6617. * @private
  6618. * @param {Function} func The function to apply a rest parameter to.
  6619. * @returns {Function} Returns the new function.
  6620. */
  6621. function flatRest(func) {
  6622. return setToString(overRest(func, undefined, flatten), func + '');
  6623. }
  6624. /**
  6625. * Creates an array of own enumerable property names and symbols of `object`.
  6626. *
  6627. * @private
  6628. * @param {Object} object The object to query.
  6629. * @returns {Array} Returns the array of property names and symbols.
  6630. */
  6631. function getAllKeys(object) {
  6632. return baseGetAllKeys(object, keys, getSymbols);
  6633. }
  6634. /**
  6635. * Creates an array of own and inherited enumerable property names and
  6636. * symbols of `object`.
  6637. *
  6638. * @private
  6639. * @param {Object} object The object to query.
  6640. * @returns {Array} Returns the array of property names and symbols.
  6641. */
  6642. function getAllKeysIn(object) {
  6643. return baseGetAllKeys(object, keysIn, getSymbolsIn);
  6644. }
  6645. /**
  6646. * Gets metadata for `func`.
  6647. *
  6648. * @private
  6649. * @param {Function} func The function to query.
  6650. * @returns {*} Returns the metadata for `func`.
  6651. */
  6652. var getData = !metaMap ? noop : function(func) {
  6653. return metaMap.get(func);
  6654. };
  6655. /**
  6656. * Gets the name of `func`.
  6657. *
  6658. * @private
  6659. * @param {Function} func The function to query.
  6660. * @returns {string} Returns the function name.
  6661. */
  6662. function getFuncName(func) {
  6663. var result = (func.name + ''),
  6664. array = realNames[result],
  6665. length = hasOwnProperty.call(realNames, result) ? array.length : 0;
  6666. while (length--) {
  6667. var data = array[length],
  6668. otherFunc = data.func;
  6669. if (otherFunc == null || otherFunc == func) {
  6670. return data.name;
  6671. }
  6672. }
  6673. return result;
  6674. }
  6675. /**
  6676. * Gets the argument placeholder value for `func`.
  6677. *
  6678. * @private
  6679. * @param {Function} func The function to inspect.
  6680. * @returns {*} Returns the placeholder value.
  6681. */
  6682. function getHolder(func) {
  6683. var object = hasOwnProperty.call(lodash, 'placeholder') ? lodash : func;
  6684. return object.placeholder;
  6685. }
  6686. /**
  6687. * Gets the appropriate "iteratee" function. If `_.iteratee` is customized,
  6688. * this function returns the custom method, otherwise it returns `baseIteratee`.
  6689. * If arguments are provided, the chosen function is invoked with them and
  6690. * its result is returned.
  6691. *
  6692. * @private
  6693. * @param {*} [value] The value to convert to an iteratee.
  6694. * @param {number} [arity] The arity of the created iteratee.
  6695. * @returns {Function} Returns the chosen function or its result.
  6696. */
  6697. function getIteratee() {
  6698. var result = lodash.iteratee || iteratee;
  6699. result = result === iteratee ? baseIteratee : result;
  6700. return arguments.length ? result(arguments[0], arguments[1]) : result;
  6701. }
  6702. /**
  6703. * Gets the data for `map`.
  6704. *
  6705. * @private
  6706. * @param {Object} map The map to query.
  6707. * @param {string} key The reference key.
  6708. * @returns {*} Returns the map data.
  6709. */
  6710. function getMapData(map, key) {
  6711. var data = map.__data__;
  6712. return isKeyable(key)
  6713. ? data[typeof key == 'string' ? 'string' : 'hash']
  6714. : data.map;
  6715. }
  6716. /**
  6717. * Gets the property names, values, and compare flags of `object`.
  6718. *
  6719. * @private
  6720. * @param {Object} object The object to query.
  6721. * @returns {Array} Returns the match data of `object`.
  6722. */
  6723. function getMatchData(object) {
  6724. var result = keys(object),
  6725. length = result.length;
  6726. while (length--) {
  6727. var key = result[length],
  6728. value = object[key];
  6729. result[length] = [key, value, isStrictComparable(value)];
  6730. }
  6731. return result;
  6732. }
  6733. /**
  6734. * Gets the native function at `key` of `object`.
  6735. *
  6736. * @private
  6737. * @param {Object} object The object to query.
  6738. * @param {string} key The key of the method to get.
  6739. * @returns {*} Returns the function if it's native, else `undefined`.
  6740. */
  6741. function getNative(object, key) {
  6742. var value = getValue(object, key);
  6743. return baseIsNative(value) ? value : undefined;
  6744. }
  6745. /**
  6746. * A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values.
  6747. *
  6748. * @private
  6749. * @param {*} value The value to query.
  6750. * @returns {string} Returns the raw `toStringTag`.
  6751. */
  6752. function getRawTag(value) {
  6753. var isOwn = hasOwnProperty.call(value, symToStringTag),
  6754. tag = value[symToStringTag];
  6755. try {
  6756. value[symToStringTag] = undefined;
  6757. var unmasked = true;
  6758. } catch (e) {}
  6759. var result = nativeObjectToString.call(value);
  6760. if (unmasked) {
  6761. if (isOwn) {
  6762. value[symToStringTag] = tag;
  6763. } else {
  6764. delete value[symToStringTag];
  6765. }
  6766. }
  6767. return result;
  6768. }
  6769. /**
  6770. * Creates an array of the own enumerable symbols of `object`.
  6771. *
  6772. * @private
  6773. * @param {Object} object The object to query.
  6774. * @returns {Array} Returns the array of symbols.
  6775. */
  6776. var getSymbols = !nativeGetSymbols ? stubArray : function(object) {
  6777. if (object == null) {
  6778. return [];
  6779. }
  6780. object = Object(object);
  6781. return arrayFilter(nativeGetSymbols(object), function(symbol) {
  6782. return propertyIsEnumerable.call(object, symbol);
  6783. });
  6784. };
  6785. /**
  6786. * Creates an array of the own and inherited enumerable symbols of `object`.
  6787. *
  6788. * @private
  6789. * @param {Object} object The object to query.
  6790. * @returns {Array} Returns the array of symbols.
  6791. */
  6792. var getSymbolsIn = !nativeGetSymbols ? stubArray : function(object) {
  6793. var result = [];
  6794. while (object) {
  6795. arrayPush(result, getSymbols(object));
  6796. object = getPrototype(object);
  6797. }
  6798. return result;
  6799. };
  6800. /**
  6801. * Gets the `toStringTag` of `value`.
  6802. *
  6803. * @private
  6804. * @param {*} value The value to query.
  6805. * @returns {string} Returns the `toStringTag`.
  6806. */
  6807. var getTag = baseGetTag;
  6808. // Fallback for data views, maps, sets, and weak maps in IE 11 and promises in Node.js < 6.
  6809. if ((DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag) ||
  6810. (Map && getTag(new Map) != mapTag) ||
  6811. (Promise && getTag(Promise.resolve()) != promiseTag) ||
  6812. (Set && getTag(new Set) != setTag) ||
  6813. (WeakMap && getTag(new WeakMap) != weakMapTag)) {
  6814. getTag = function(value) {
  6815. var result = baseGetTag(value),
  6816. Ctor = result == objectTag ? value.constructor : undefined,
  6817. ctorString = Ctor ? toSource(Ctor) : '';
  6818. if (ctorString) {
  6819. switch (ctorString) {
  6820. case dataViewCtorString: return dataViewTag;
  6821. case mapCtorString: return mapTag;
  6822. case promiseCtorString: return promiseTag;
  6823. case setCtorString: return setTag;
  6824. case weakMapCtorString: return weakMapTag;
  6825. }
  6826. }
  6827. return result;
  6828. };
  6829. }
  6830. /**
  6831. * Gets the view, applying any `transforms` to the `start` and `end` positions.
  6832. *
  6833. * @private
  6834. * @param {number} start The start of the view.
  6835. * @param {number} end The end of the view.
  6836. * @param {Array} transforms The transformations to apply to the view.
  6837. * @returns {Object} Returns an object containing the `start` and `end`
  6838. * positions of the view.
  6839. */
  6840. function getView(start, end, transforms) {
  6841. var index = -1,
  6842. length = transforms.length;
  6843. while (++index < length) {
  6844. var data = transforms[index],
  6845. size = data.size;
  6846. switch (data.type) {
  6847. case 'drop': start += size; break;
  6848. case 'dropRight': end -= size; break;
  6849. case 'take': end = nativeMin(end, start + size); break;
  6850. case 'takeRight': start = nativeMax(start, end - size); break;
  6851. }
  6852. }
  6853. return { 'start': start, 'end': end };
  6854. }
  6855. /**
  6856. * Extracts wrapper details from the `source` body comment.
  6857. *
  6858. * @private
  6859. * @param {string} source The source to inspect.
  6860. * @returns {Array} Returns the wrapper details.
  6861. */
  6862. function getWrapDetails(source) {
  6863. var match = source.match(reWrapDetails);
  6864. return match ? match[1].split(reSplitDetails) : [];
  6865. }
  6866. /**
  6867. * Checks if `path` exists on `object`.
  6868. *
  6869. * @private
  6870. * @param {Object} object The object to query.
  6871. * @param {Array|string} path The path to check.
  6872. * @param {Function} hasFunc The function to check properties.
  6873. * @returns {boolean} Returns `true` if `path` exists, else `false`.
  6874. */
  6875. function hasPath(object, path, hasFunc) {
  6876. path = castPath(path, object);
  6877. var index = -1,
  6878. length = path.length,
  6879. result = false;
  6880. while (++index < length) {
  6881. var key = toKey(path[index]);
  6882. if (!(result = object != null && hasFunc(object, key))) {
  6883. break;
  6884. }
  6885. object = object[key];
  6886. }
  6887. if (result || ++index != length) {
  6888. return result;
  6889. }
  6890. length = object == null ? 0 : object.length;
  6891. return !!length && isLength(length) && isIndex(key, length) &&
  6892. (isArray(object) || isArguments(object));
  6893. }
  6894. /**
  6895. * Initializes an array clone.
  6896. *
  6897. * @private
  6898. * @param {Array} array The array to clone.
  6899. * @returns {Array} Returns the initialized clone.
  6900. */
  6901. function initCloneArray(array) {
  6902. var length = array.length,
  6903. result = new array.constructor(length);
  6904. // Add properties assigned by `RegExp#exec`.
  6905. if (length && typeof array[0] == 'string' && hasOwnProperty.call(array, 'index')) {
  6906. result.index = array.index;
  6907. result.input = array.input;
  6908. }
  6909. return result;
  6910. }
  6911. /**
  6912. * Initializes an object clone.
  6913. *
  6914. * @private
  6915. * @param {Object} object The object to clone.
  6916. * @returns {Object} Returns the initialized clone.
  6917. */
  6918. function initCloneObject(object) {
  6919. return (typeof object.constructor == 'function' && !isPrototype(object))
  6920. ? baseCreate(getPrototype(object))
  6921. : {};
  6922. }
  6923. /**
  6924. * Initializes an object clone based on its `toStringTag`.
  6925. *
  6926. * **Note:** This function only supports cloning values with tags of
  6927. * `Boolean`, `Date`, `Error`, `Map`, `Number`, `RegExp`, `Set`, or `String`.
  6928. *
  6929. * @private
  6930. * @param {Object} object The object to clone.
  6931. * @param {string} tag The `toStringTag` of the object to clone.
  6932. * @param {boolean} [isDeep] Specify a deep clone.
  6933. * @returns {Object} Returns the initialized clone.
  6934. */
  6935. function initCloneByTag(object, tag, isDeep) {
  6936. var Ctor = object.constructor;
  6937. switch (tag) {
  6938. case arrayBufferTag:
  6939. return cloneArrayBuffer(object);
  6940. case boolTag:
  6941. case dateTag:
  6942. return new Ctor(+object);
  6943. case dataViewTag:
  6944. return cloneDataView(object, isDeep);
  6945. case float32Tag: case float64Tag:
  6946. case int8Tag: case int16Tag: case int32Tag:
  6947. case uint8Tag: case uint8ClampedTag: case uint16Tag: case uint32Tag:
  6948. return cloneTypedArray(object, isDeep);
  6949. case mapTag:
  6950. return new Ctor;
  6951. case numberTag:
  6952. case stringTag:
  6953. return new Ctor(object);
  6954. case regexpTag:
  6955. return cloneRegExp(object);
  6956. case setTag:
  6957. return new Ctor;
  6958. case symbolTag:
  6959. return cloneSymbol(object);
  6960. }
  6961. }
  6962. /**
  6963. * Inserts wrapper `details` in a comment at the top of the `source` body.
  6964. *
  6965. * @private
  6966. * @param {string} source The source to modify.
  6967. * @returns {Array} details The details to insert.
  6968. * @returns {string} Returns the modified source.
  6969. */
  6970. function insertWrapDetails(source, details) {
  6971. var length = details.length;
  6972. if (!length) {
  6973. return source;
  6974. }
  6975. var lastIndex = length - 1;
  6976. details[lastIndex] = (length > 1 ? '& ' : '') + details[lastIndex];
  6977. details = details.join(length > 2 ? ', ' : ' ');
  6978. return source.replace(reWrapComment, '{\n/* [wrapped with ' + details + '] */\n');
  6979. }
  6980. /**
  6981. * Checks if `value` is a flattenable `arguments` object or array.
  6982. *
  6983. * @private
  6984. * @param {*} value The value to check.
  6985. * @returns {boolean} Returns `true` if `value` is flattenable, else `false`.
  6986. */
  6987. function isFlattenable(value) {
  6988. return isArray(value) || isArguments(value) ||
  6989. !!(spreadableSymbol && value && value[spreadableSymbol]);
  6990. }
  6991. /**
  6992. * Checks if `value` is a valid array-like index.
  6993. *
  6994. * @private
  6995. * @param {*} value The value to check.
  6996. * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.
  6997. * @returns {boolean} Returns `true` if `value` is a valid index, else `false`.
  6998. */
  6999. function isIndex(value, length) {
  7000. var type = typeof value;
  7001. length = length == null ? MAX_SAFE_INTEGER : length;
  7002. return !!length &&
  7003. (type == 'number' ||
  7004. (type != 'symbol' && reIsUint.test(value))) &&
  7005. (value > -1 && value % 1 == 0 && value < length);
  7006. }
  7007. /**
  7008. * Checks if the given arguments are from an iteratee call.
  7009. *
  7010. * @private
  7011. * @param {*} value The potential iteratee value argument.
  7012. * @param {*} index The potential iteratee index or key argument.
  7013. * @param {*} object The potential iteratee object argument.
  7014. * @returns {boolean} Returns `true` if the arguments are from an iteratee call,
  7015. * else `false`.
  7016. */
  7017. function isIterateeCall(value, index, object) {
  7018. if (!isObject(object)) {
  7019. return false;
  7020. }
  7021. var type = typeof index;
  7022. if (type == 'number'
  7023. ? (isArrayLike(object) && isIndex(index, object.length))
  7024. : (type == 'string' && index in object)
  7025. ) {
  7026. return eq(object[index], value);
  7027. }
  7028. return false;
  7029. }
  7030. /**
  7031. * Checks if `value` is a property name and not a property path.
  7032. *
  7033. * @private
  7034. * @param {*} value The value to check.
  7035. * @param {Object} [object] The object to query keys on.
  7036. * @returns {boolean} Returns `true` if `value` is a property name, else `false`.
  7037. */
  7038. function isKey(value, object) {
  7039. if (isArray(value)) {
  7040. return false;
  7041. }
  7042. var type = typeof value;
  7043. if (type == 'number' || type == 'symbol' || type == 'boolean' ||
  7044. value == null || isSymbol(value)) {
  7045. return true;
  7046. }
  7047. return reIsPlainProp.test(value) || !reIsDeepProp.test(value) ||
  7048. (object != null && value in Object(object));
  7049. }
  7050. /**
  7051. * Checks if `value` is suitable for use as unique object key.
  7052. *
  7053. * @private
  7054. * @param {*} value The value to check.
  7055. * @returns {boolean} Returns `true` if `value` is suitable, else `false`.
  7056. */
  7057. function isKeyable(value) {
  7058. var type = typeof value;
  7059. return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean')
  7060. ? (value !== '__proto__')
  7061. : (value === null);
  7062. }
  7063. /**
  7064. * Checks if `func` has a lazy counterpart.
  7065. *
  7066. * @private
  7067. * @param {Function} func The function to check.
  7068. * @returns {boolean} Returns `true` if `func` has a lazy counterpart,
  7069. * else `false`.
  7070. */
  7071. function isLaziable(func) {
  7072. var funcName = getFuncName(func),
  7073. other = lodash[funcName];
  7074. if (typeof other != 'function' || !(funcName in LazyWrapper.prototype)) {
  7075. return false;
  7076. }
  7077. if (func === other) {
  7078. return true;
  7079. }
  7080. var data = getData(other);
  7081. return !!data && func === data[0];
  7082. }
  7083. /**
  7084. * Checks if `func` has its source masked.
  7085. *
  7086. * @private
  7087. * @param {Function} func The function to check.
  7088. * @returns {boolean} Returns `true` if `func` is masked, else `false`.
  7089. */
  7090. function isMasked(func) {
  7091. return !!maskSrcKey && (maskSrcKey in func);
  7092. }
  7093. /**
  7094. * Checks if `func` is capable of being masked.
  7095. *
  7096. * @private
  7097. * @param {*} value The value to check.
  7098. * @returns {boolean} Returns `true` if `func` is maskable, else `false`.
  7099. */
  7100. var isMaskable = coreJsData ? isFunction : stubFalse;
  7101. /**
  7102. * Checks if `value` is likely a prototype object.
  7103. *
  7104. * @private
  7105. * @param {*} value The value to check.
  7106. * @returns {boolean} Returns `true` if `value` is a prototype, else `false`.
  7107. */
  7108. function isPrototype(value) {
  7109. var Ctor = value && value.constructor,
  7110. proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto;
  7111. return value === proto;
  7112. }
  7113. /**
  7114. * Checks if `value` is suitable for strict equality comparisons, i.e. `===`.
  7115. *
  7116. * @private
  7117. * @param {*} value The value to check.
  7118. * @returns {boolean} Returns `true` if `value` if suitable for strict
  7119. * equality comparisons, else `false`.
  7120. */
  7121. function isStrictComparable(value) {
  7122. return value === value && !isObject(value);
  7123. }
  7124. /**
  7125. * A specialized version of `matchesProperty` for source values suitable
  7126. * for strict equality comparisons, i.e. `===`.
  7127. *
  7128. * @private
  7129. * @param {string} key The key of the property to get.
  7130. * @param {*} srcValue The value to match.
  7131. * @returns {Function} Returns the new spec function.
  7132. */
  7133. function matchesStrictComparable(key, srcValue) {
  7134. return function(object) {
  7135. if (object == null) {
  7136. return false;
  7137. }
  7138. return object[key] === srcValue &&
  7139. (srcValue !== undefined || (key in Object(object)));
  7140. };
  7141. }
  7142. /**
  7143. * A specialized version of `_.memoize` which clears the memoized function's
  7144. * cache when it exceeds `MAX_MEMOIZE_SIZE`.
  7145. *
  7146. * @private
  7147. * @param {Function} func The function to have its output memoized.
  7148. * @returns {Function} Returns the new memoized function.
  7149. */
  7150. function memoizeCapped(func) {
  7151. var result = memoize(func, function(key) {
  7152. if (cache.size === MAX_MEMOIZE_SIZE) {
  7153. cache.clear();
  7154. }
  7155. return key;
  7156. });
  7157. var cache = result.cache;
  7158. return result;
  7159. }
  7160. /**
  7161. * Merges the function metadata of `source` into `data`.
  7162. *
  7163. * Merging metadata reduces the number of wrappers used to invoke a function.
  7164. * This is possible because methods like `_.bind`, `_.curry`, and `_.partial`
  7165. * may be applied regardless of execution order. Methods like `_.ary` and
  7166. * `_.rearg` modify function arguments, making the order in which they are
  7167. * executed important, preventing the merging of metadata. However, we make
  7168. * an exception for a safe combined case where curried functions have `_.ary`
  7169. * and or `_.rearg` applied.
  7170. *
  7171. * @private
  7172. * @param {Array} data The destination metadata.
  7173. * @param {Array} source The source metadata.
  7174. * @returns {Array} Returns `data`.
  7175. */
  7176. function mergeData(data, source) {
  7177. var bitmask = data[1],
  7178. srcBitmask = source[1],
  7179. newBitmask = bitmask | srcBitmask,
  7180. isCommon = newBitmask < (WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG | WRAP_ARY_FLAG);
  7181. var isCombo =
  7182. ((srcBitmask == WRAP_ARY_FLAG) && (bitmask == WRAP_CURRY_FLAG)) ||
  7183. ((srcBitmask == WRAP_ARY_FLAG) && (bitmask == WRAP_REARG_FLAG) && (data[7].length <= source[8])) ||
  7184. ((srcBitmask == (WRAP_ARY_FLAG | WRAP_REARG_FLAG)) && (source[7].length <= source[8]) && (bitmask == WRAP_CURRY_FLAG));
  7185. // Exit early if metadata can't be merged.
  7186. if (!(isCommon || isCombo)) {
  7187. return data;
  7188. }
  7189. // Use source `thisArg` if available.
  7190. if (srcBitmask & WRAP_BIND_FLAG) {
  7191. data[2] = source[2];
  7192. // Set when currying a bound function.
  7193. newBitmask |= bitmask & WRAP_BIND_FLAG ? 0 : WRAP_CURRY_BOUND_FLAG;
  7194. }
  7195. // Compose partial arguments.
  7196. var value = source[3];
  7197. if (value) {
  7198. var partials = data[3];
  7199. data[3] = partials ? composeArgs(partials, value, source[4]) : value;
  7200. data[4] = partials ? replaceHolders(data[3], PLACEHOLDER) : source[4];
  7201. }
  7202. // Compose partial right arguments.
  7203. value = source[5];
  7204. if (value) {
  7205. partials = data[5];
  7206. data[5] = partials ? composeArgsRight(partials, value, source[6]) : value;
  7207. data[6] = partials ? replaceHolders(data[5], PLACEHOLDER) : source[6];
  7208. }
  7209. // Use source `argPos` if available.
  7210. value = source[7];
  7211. if (value) {
  7212. data[7] = value;
  7213. }
  7214. // Use source `ary` if it's smaller.
  7215. if (srcBitmask & WRAP_ARY_FLAG) {
  7216. data[8] = data[8] == null ? source[8] : nativeMin(data[8], source[8]);
  7217. }
  7218. // Use source `arity` if one is not provided.
  7219. if (data[9] == null) {
  7220. data[9] = source[9];
  7221. }
  7222. // Use source `func` and merge bitmasks.
  7223. data[0] = source[0];
  7224. data[1] = newBitmask;
  7225. return data;
  7226. }
  7227. /**
  7228. * This function is like
  7229. * [`Object.keys`](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)
  7230. * except that it includes inherited enumerable properties.
  7231. *
  7232. * @private
  7233. * @param {Object} object The object to query.
  7234. * @returns {Array} Returns the array of property names.
  7235. */
  7236. function nativeKeysIn(object) {
  7237. var result = [];
  7238. if (object != null) {
  7239. for (var key in Object(object)) {
  7240. result.push(key);
  7241. }
  7242. }
  7243. return result;
  7244. }
  7245. /**
  7246. * Converts `value` to a string using `Object.prototype.toString`.
  7247. *
  7248. * @private
  7249. * @param {*} value The value to convert.
  7250. * @returns {string} Returns the converted string.
  7251. */
  7252. function objectToString(value) {
  7253. return nativeObjectToString.call(value);
  7254. }
  7255. /**
  7256. * A specialized version of `baseRest` which transforms the rest array.
  7257. *
  7258. * @private
  7259. * @param {Function} func The function to apply a rest parameter to.
  7260. * @param {number} [start=func.length-1] The start position of the rest parameter.
  7261. * @param {Function} transform The rest array transform.
  7262. * @returns {Function} Returns the new function.
  7263. */
  7264. function overRest(func, start, transform) {
  7265. start = nativeMax(start === undefined ? (func.length - 1) : start, 0);
  7266. return function() {
  7267. var args = arguments,
  7268. index = -1,
  7269. length = nativeMax(args.length - start, 0),
  7270. array = Array(length);
  7271. while (++index < length) {
  7272. array[index] = args[start + index];
  7273. }
  7274. index = -1;
  7275. var otherArgs = Array(start + 1);
  7276. while (++index < start) {
  7277. otherArgs[index] = args[index];
  7278. }
  7279. otherArgs[start] = transform(array);
  7280. return apply(func, this, otherArgs);
  7281. };
  7282. }
  7283. /**
  7284. * Gets the parent value at `path` of `object`.
  7285. *
  7286. * @private
  7287. * @param {Object} object The object to query.
  7288. * @param {Array} path The path to get the parent value of.
  7289. * @returns {*} Returns the parent value.
  7290. */
  7291. function parent(object, path) {
  7292. return path.length < 2 ? object : baseGet(object, baseSlice(path, 0, -1));
  7293. }
  7294. /**
  7295. * Reorder `array` according to the specified indexes where the element at
  7296. * the first index is assigned as the first element, the element at
  7297. * the second index is assigned as the second element, and so on.
  7298. *
  7299. * @private
  7300. * @param {Array} array The array to reorder.
  7301. * @param {Array} indexes The arranged array indexes.
  7302. * @returns {Array} Returns `array`.
  7303. */
  7304. function reorder(array, indexes) {
  7305. var arrLength = array.length,
  7306. length = nativeMin(indexes.length, arrLength),
  7307. oldArray = copyArray(array);
  7308. while (length--) {
  7309. var index = indexes[length];
  7310. array[length] = isIndex(index, arrLength) ? oldArray[index] : undefined;
  7311. }
  7312. return array;
  7313. }
  7314. /**
  7315. * Gets the value at `key`, unless `key` is "__proto__" or "constructor".
  7316. *
  7317. * @private
  7318. * @param {Object} object The object to query.
  7319. * @param {string} key The key of the property to get.
  7320. * @returns {*} Returns the property value.
  7321. */
  7322. function safeGet(object, key) {
  7323. if (key === 'constructor' && typeof object[key] === 'function') {
  7324. return;
  7325. }
  7326. if (key == '__proto__') {
  7327. return;
  7328. }
  7329. return object[key];
  7330. }
  7331. /**
  7332. * Sets metadata for `func`.
  7333. *
  7334. * **Note:** If this function becomes hot, i.e. is invoked a lot in a short
  7335. * period of time, it will trip its breaker and transition to an identity
  7336. * function to avoid garbage collection pauses in V8. See
  7337. * [V8 issue 2070](https://bugs.chromium.org/p/v8/issues/detail?id=2070)
  7338. * for more details.
  7339. *
  7340. * @private
  7341. * @param {Function} func The function to associate metadata with.
  7342. * @param {*} data The metadata.
  7343. * @returns {Function} Returns `func`.
  7344. */
  7345. var setData = shortOut(baseSetData);
  7346. /**
  7347. * A simple wrapper around the global [`setTimeout`](https://mdn.io/setTimeout).
  7348. *
  7349. * @private
  7350. * @param {Function} func The function to delay.
  7351. * @param {number} wait The number of milliseconds to delay invocation.
  7352. * @returns {number|Object} Returns the timer id or timeout object.
  7353. */
  7354. var setTimeout = ctxSetTimeout || function(func, wait) {
  7355. return root.setTimeout(func, wait);
  7356. };
  7357. /**
  7358. * Sets the `toString` method of `func` to return `string`.
  7359. *
  7360. * @private
  7361. * @param {Function} func The function to modify.
  7362. * @param {Function} string The `toString` result.
  7363. * @returns {Function} Returns `func`.
  7364. */
  7365. var setToString = shortOut(baseSetToString);
  7366. /**
  7367. * Sets the `toString` method of `wrapper` to mimic the source of `reference`
  7368. * with wrapper details in a comment at the top of the source body.
  7369. *
  7370. * @private
  7371. * @param {Function} wrapper The function to modify.
  7372. * @param {Function} reference The reference function.
  7373. * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
  7374. * @returns {Function} Returns `wrapper`.
  7375. */
  7376. function setWrapToString(wrapper, reference, bitmask) {
  7377. var source = (reference + '');
  7378. return setToString(wrapper, insertWrapDetails(source, updateWrapDetails(getWrapDetails(source), bitmask)));
  7379. }
  7380. /**
  7381. * Creates a function that'll short out and invoke `identity` instead
  7382. * of `func` when it's called `HOT_COUNT` or more times in `HOT_SPAN`
  7383. * milliseconds.
  7384. *
  7385. * @private
  7386. * @param {Function} func The function to restrict.
  7387. * @returns {Function} Returns the new shortable function.
  7388. */
  7389. function shortOut(func) {
  7390. var count = 0,
  7391. lastCalled = 0;
  7392. return function() {
  7393. var stamp = nativeNow(),
  7394. remaining = HOT_SPAN - (stamp - lastCalled);
  7395. lastCalled = stamp;
  7396. if (remaining > 0) {
  7397. if (++count >= HOT_COUNT) {
  7398. return arguments[0];
  7399. }
  7400. } else {
  7401. count = 0;
  7402. }
  7403. return func.apply(undefined, arguments);
  7404. };
  7405. }
  7406. /**
  7407. * A specialized version of `_.shuffle` which mutates and sets the size of `array`.
  7408. *
  7409. * @private
  7410. * @param {Array} array The array to shuffle.
  7411. * @param {number} [size=array.length] The size of `array`.
  7412. * @returns {Array} Returns `array`.
  7413. */
  7414. function shuffleSelf(array, size) {
  7415. var index = -1,
  7416. length = array.length,
  7417. lastIndex = length - 1;
  7418. size = size === undefined ? length : size;
  7419. while (++index < size) {
  7420. var rand = baseRandom(index, lastIndex),
  7421. value = array[rand];
  7422. array[rand] = array[index];
  7423. array[index] = value;
  7424. }
  7425. array.length = size;
  7426. return array;
  7427. }
  7428. /**
  7429. * Converts `string` to a property path array.
  7430. *
  7431. * @private
  7432. * @param {string} string The string to convert.
  7433. * @returns {Array} Returns the property path array.
  7434. */
  7435. var stringToPath = memoizeCapped(function(string) {
  7436. var result = [];
  7437. if (string.charCodeAt(0) === 46 /* . */) {
  7438. result.push('');
  7439. }
  7440. string.replace(rePropName, function(match, number, quote, subString) {
  7441. result.push(quote ? subString.replace(reEscapeChar, '$1') : (number || match));
  7442. });
  7443. return result;
  7444. });
  7445. /**
  7446. * Converts `value` to a string key if it's not a string or symbol.
  7447. *
  7448. * @private
  7449. * @param {*} value The value to inspect.
  7450. * @returns {string|symbol} Returns the key.
  7451. */
  7452. function toKey(value) {
  7453. if (typeof value == 'string' || isSymbol(value)) {
  7454. return value;
  7455. }
  7456. var result = (value + '');
  7457. return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;
  7458. }
  7459. /**
  7460. * Converts `func` to its source code.
  7461. *
  7462. * @private
  7463. * @param {Function} func The function to convert.
  7464. * @returns {string} Returns the source code.
  7465. */
  7466. function toSource(func) {
  7467. if (func != null) {
  7468. try {
  7469. return funcToString.call(func);
  7470. } catch (e) {}
  7471. try {
  7472. return (func + '');
  7473. } catch (e) {}
  7474. }
  7475. return '';
  7476. }
  7477. /**
  7478. * Updates wrapper `details` based on `bitmask` flags.
  7479. *
  7480. * @private
  7481. * @returns {Array} details The details to modify.
  7482. * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
  7483. * @returns {Array} Returns `details`.
  7484. */
  7485. function updateWrapDetails(details, bitmask) {
  7486. arrayEach(wrapFlags, function(pair) {
  7487. var value = '_.' + pair[0];
  7488. if ((bitmask & pair[1]) && !arrayIncludes(details, value)) {
  7489. details.push(value);
  7490. }
  7491. });
  7492. return details.sort();
  7493. }
  7494. /**
  7495. * Creates a clone of `wrapper`.
  7496. *
  7497. * @private
  7498. * @param {Object} wrapper The wrapper to clone.
  7499. * @returns {Object} Returns the cloned wrapper.
  7500. */
  7501. function wrapperClone(wrapper) {
  7502. if (wrapper instanceof LazyWrapper) {
  7503. return wrapper.clone();
  7504. }
  7505. var result = new LodashWrapper(wrapper.__wrapped__, wrapper.__chain__);
  7506. result.__actions__ = copyArray(wrapper.__actions__);
  7507. result.__index__ = wrapper.__index__;
  7508. result.__values__ = wrapper.__values__;
  7509. return result;
  7510. }
  7511. /*------------------------------------------------------------------------*/
  7512. /**
  7513. * Creates an array of elements split into groups the length of `size`.
  7514. * If `array` can't be split evenly, the final chunk will be the remaining
  7515. * elements.
  7516. *
  7517. * @static
  7518. * @memberOf _
  7519. * @since 3.0.0
  7520. * @category Array
  7521. * @param {Array} array The array to process.
  7522. * @param {number} [size=1] The length of each chunk
  7523. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  7524. * @returns {Array} Returns the new array of chunks.
  7525. * @example
  7526. *
  7527. * _.chunk(['a', 'b', 'c', 'd'], 2);
  7528. * // => [['a', 'b'], ['c', 'd']]
  7529. *
  7530. * _.chunk(['a', 'b', 'c', 'd'], 3);
  7531. * // => [['a', 'b', 'c'], ['d']]
  7532. */
  7533. function chunk(array, size, guard) {
  7534. if ((guard ? isIterateeCall(array, size, guard) : size === undefined)) {
  7535. size = 1;
  7536. } else {
  7537. size = nativeMax(toInteger(size), 0);
  7538. }
  7539. var length = array == null ? 0 : array.length;
  7540. if (!length || size < 1) {
  7541. return [];
  7542. }
  7543. var index = 0,
  7544. resIndex = 0,
  7545. result = Array(nativeCeil(length / size));
  7546. while (index < length) {
  7547. result[resIndex++] = baseSlice(array, index, (index += size));
  7548. }
  7549. return result;
  7550. }
  7551. /**
  7552. * Creates an array with all falsey values removed. The values `false`, `null`,
  7553. * `0`, `""`, `undefined`, and `NaN` are falsey.
  7554. *
  7555. * @static
  7556. * @memberOf _
  7557. * @since 0.1.0
  7558. * @category Array
  7559. * @param {Array} array The array to compact.
  7560. * @returns {Array} Returns the new array of filtered values.
  7561. * @example
  7562. *
  7563. * _.compact([0, 1, false, 2, '', 3]);
  7564. * // => [1, 2, 3]
  7565. */
  7566. function compact(array) {
  7567. var index = -1,
  7568. length = array == null ? 0 : array.length,
  7569. resIndex = 0,
  7570. result = [];
  7571. while (++index < length) {
  7572. var value = array[index];
  7573. if (value) {
  7574. result[resIndex++] = value;
  7575. }
  7576. }
  7577. return result;
  7578. }
  7579. /**
  7580. * Creates a new array concatenating `array` with any additional arrays
  7581. * and/or values.
  7582. *
  7583. * @static
  7584. * @memberOf _
  7585. * @since 4.0.0
  7586. * @category Array
  7587. * @param {Array} array The array to concatenate.
  7588. * @param {...*} [values] The values to concatenate.
  7589. * @returns {Array} Returns the new concatenated array.
  7590. * @example
  7591. *
  7592. * var array = [1];
  7593. * var other = _.concat(array, 2, [3], [[4]]);
  7594. *
  7595. * console.log(other);
  7596. * // => [1, 2, 3, [4]]
  7597. *
  7598. * console.log(array);
  7599. * // => [1]
  7600. */
  7601. function concat() {
  7602. var length = arguments.length;
  7603. if (!length) {
  7604. return [];
  7605. }
  7606. var args = Array(length - 1),
  7607. array = arguments[0],
  7608. index = length;
  7609. while (index--) {
  7610. args[index - 1] = arguments[index];
  7611. }
  7612. return arrayPush(isArray(array) ? copyArray(array) : [array], baseFlatten(args, 1));
  7613. }
  7614. /**
  7615. * Creates an array of `array` values not included in the other given arrays
  7616. * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  7617. * for equality comparisons. The order and references of result values are
  7618. * determined by the first array.
  7619. *
  7620. * **Note:** Unlike `_.pullAll`, this method returns a new array.
  7621. *
  7622. * @static
  7623. * @memberOf _
  7624. * @since 0.1.0
  7625. * @category Array
  7626. * @param {Array} array The array to inspect.
  7627. * @param {...Array} [values] The values to exclude.
  7628. * @returns {Array} Returns the new array of filtered values.
  7629. * @see _.without, _.xor
  7630. * @example
  7631. *
  7632. * _.difference([2, 1], [2, 3]);
  7633. * // => [1]
  7634. */
  7635. var difference = baseRest(function(array, values) {
  7636. return isArrayLikeObject(array)
  7637. ? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true))
  7638. : [];
  7639. });
  7640. /**
  7641. * This method is like `_.difference` except that it accepts `iteratee` which
  7642. * is invoked for each element of `array` and `values` to generate the criterion
  7643. * by which they're compared. The order and references of result values are
  7644. * determined by the first array. The iteratee is invoked with one argument:
  7645. * (value).
  7646. *
  7647. * **Note:** Unlike `_.pullAllBy`, this method returns a new array.
  7648. *
  7649. * @static
  7650. * @memberOf _
  7651. * @since 4.0.0
  7652. * @category Array
  7653. * @param {Array} array The array to inspect.
  7654. * @param {...Array} [values] The values to exclude.
  7655. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  7656. * @returns {Array} Returns the new array of filtered values.
  7657. * @example
  7658. *
  7659. * _.differenceBy([2.1, 1.2], [2.3, 3.4], Math.floor);
  7660. * // => [1.2]
  7661. *
  7662. * // The `_.property` iteratee shorthand.
  7663. * _.differenceBy([{ 'x': 2 }, { 'x': 1 }], [{ 'x': 1 }], 'x');
  7664. * // => [{ 'x': 2 }]
  7665. */
  7666. var differenceBy = baseRest(function(array, values) {
  7667. var iteratee = last(values);
  7668. if (isArrayLikeObject(iteratee)) {
  7669. iteratee = undefined;
  7670. }
  7671. return isArrayLikeObject(array)
  7672. ? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true), getIteratee(iteratee, 2))
  7673. : [];
  7674. });
  7675. /**
  7676. * This method is like `_.difference` except that it accepts `comparator`
  7677. * which is invoked to compare elements of `array` to `values`. The order and
  7678. * references of result values are determined by the first array. The comparator
  7679. * is invoked with two arguments: (arrVal, othVal).
  7680. *
  7681. * **Note:** Unlike `_.pullAllWith`, this method returns a new array.
  7682. *
  7683. * @static
  7684. * @memberOf _
  7685. * @since 4.0.0
  7686. * @category Array
  7687. * @param {Array} array The array to inspect.
  7688. * @param {...Array} [values] The values to exclude.
  7689. * @param {Function} [comparator] The comparator invoked per element.
  7690. * @returns {Array} Returns the new array of filtered values.
  7691. * @example
  7692. *
  7693. * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }];
  7694. *
  7695. * _.differenceWith(objects, [{ 'x': 1, 'y': 2 }], _.isEqual);
  7696. * // => [{ 'x': 2, 'y': 1 }]
  7697. */
  7698. var differenceWith = baseRest(function(array, values) {
  7699. var comparator = last(values);
  7700. if (isArrayLikeObject(comparator)) {
  7701. comparator = undefined;
  7702. }
  7703. return isArrayLikeObject(array)
  7704. ? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true), undefined, comparator)
  7705. : [];
  7706. });
  7707. /**
  7708. * Creates a slice of `array` with `n` elements dropped from the beginning.
  7709. *
  7710. * @static
  7711. * @memberOf _
  7712. * @since 0.5.0
  7713. * @category Array
  7714. * @param {Array} array The array to query.
  7715. * @param {number} [n=1] The number of elements to drop.
  7716. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  7717. * @returns {Array} Returns the slice of `array`.
  7718. * @example
  7719. *
  7720. * _.drop([1, 2, 3]);
  7721. * // => [2, 3]
  7722. *
  7723. * _.drop([1, 2, 3], 2);
  7724. * // => [3]
  7725. *
  7726. * _.drop([1, 2, 3], 5);
  7727. * // => []
  7728. *
  7729. * _.drop([1, 2, 3], 0);
  7730. * // => [1, 2, 3]
  7731. */
  7732. function drop(array, n, guard) {
  7733. var length = array == null ? 0 : array.length;
  7734. if (!length) {
  7735. return [];
  7736. }
  7737. n = (guard || n === undefined) ? 1 : toInteger(n);
  7738. return baseSlice(array, n < 0 ? 0 : n, length);
  7739. }
  7740. /**
  7741. * Creates a slice of `array` with `n` elements dropped from the end.
  7742. *
  7743. * @static
  7744. * @memberOf _
  7745. * @since 3.0.0
  7746. * @category Array
  7747. * @param {Array} array The array to query.
  7748. * @param {number} [n=1] The number of elements to drop.
  7749. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  7750. * @returns {Array} Returns the slice of `array`.
  7751. * @example
  7752. *
  7753. * _.dropRight([1, 2, 3]);
  7754. * // => [1, 2]
  7755. *
  7756. * _.dropRight([1, 2, 3], 2);
  7757. * // => [1]
  7758. *
  7759. * _.dropRight([1, 2, 3], 5);
  7760. * // => []
  7761. *
  7762. * _.dropRight([1, 2, 3], 0);
  7763. * // => [1, 2, 3]
  7764. */
  7765. function dropRight(array, n, guard) {
  7766. var length = array == null ? 0 : array.length;
  7767. if (!length) {
  7768. return [];
  7769. }
  7770. n = (guard || n === undefined) ? 1 : toInteger(n);
  7771. n = length - n;
  7772. return baseSlice(array, 0, n < 0 ? 0 : n);
  7773. }
  7774. /**
  7775. * Creates a slice of `array` excluding elements dropped from the end.
  7776. * Elements are dropped until `predicate` returns falsey. The predicate is
  7777. * invoked with three arguments: (value, index, array).
  7778. *
  7779. * @static
  7780. * @memberOf _
  7781. * @since 3.0.0
  7782. * @category Array
  7783. * @param {Array} array The array to query.
  7784. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  7785. * @returns {Array} Returns the slice of `array`.
  7786. * @example
  7787. *
  7788. * var users = [
  7789. * { 'user': 'barney', 'active': true },
  7790. * { 'user': 'fred', 'active': false },
  7791. * { 'user': 'pebbles', 'active': false }
  7792. * ];
  7793. *
  7794. * _.dropRightWhile(users, function(o) { return !o.active; });
  7795. * // => objects for ['barney']
  7796. *
  7797. * // The `_.matches` iteratee shorthand.
  7798. * _.dropRightWhile(users, { 'user': 'pebbles', 'active': false });
  7799. * // => objects for ['barney', 'fred']
  7800. *
  7801. * // The `_.matchesProperty` iteratee shorthand.
  7802. * _.dropRightWhile(users, ['active', false]);
  7803. * // => objects for ['barney']
  7804. *
  7805. * // The `_.property` iteratee shorthand.
  7806. * _.dropRightWhile(users, 'active');
  7807. * // => objects for ['barney', 'fred', 'pebbles']
  7808. */
  7809. function dropRightWhile(array, predicate) {
  7810. return (array && array.length)
  7811. ? baseWhile(array, getIteratee(predicate, 3), true, true)
  7812. : [];
  7813. }
  7814. /**
  7815. * Creates a slice of `array` excluding elements dropped from the beginning.
  7816. * Elements are dropped until `predicate` returns falsey. The predicate is
  7817. * invoked with three arguments: (value, index, array).
  7818. *
  7819. * @static
  7820. * @memberOf _
  7821. * @since 3.0.0
  7822. * @category Array
  7823. * @param {Array} array The array to query.
  7824. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  7825. * @returns {Array} Returns the slice of `array`.
  7826. * @example
  7827. *
  7828. * var users = [
  7829. * { 'user': 'barney', 'active': false },
  7830. * { 'user': 'fred', 'active': false },
  7831. * { 'user': 'pebbles', 'active': true }
  7832. * ];
  7833. *
  7834. * _.dropWhile(users, function(o) { return !o.active; });
  7835. * // => objects for ['pebbles']
  7836. *
  7837. * // The `_.matches` iteratee shorthand.
  7838. * _.dropWhile(users, { 'user': 'barney', 'active': false });
  7839. * // => objects for ['fred', 'pebbles']
  7840. *
  7841. * // The `_.matchesProperty` iteratee shorthand.
  7842. * _.dropWhile(users, ['active', false]);
  7843. * // => objects for ['pebbles']
  7844. *
  7845. * // The `_.property` iteratee shorthand.
  7846. * _.dropWhile(users, 'active');
  7847. * // => objects for ['barney', 'fred', 'pebbles']
  7848. */
  7849. function dropWhile(array, predicate) {
  7850. return (array && array.length)
  7851. ? baseWhile(array, getIteratee(predicate, 3), true)
  7852. : [];
  7853. }
  7854. /**
  7855. * Fills elements of `array` with `value` from `start` up to, but not
  7856. * including, `end`.
  7857. *
  7858. * **Note:** This method mutates `array`.
  7859. *
  7860. * @static
  7861. * @memberOf _
  7862. * @since 3.2.0
  7863. * @category Array
  7864. * @param {Array} array The array to fill.
  7865. * @param {*} value The value to fill `array` with.
  7866. * @param {number} [start=0] The start position.
  7867. * @param {number} [end=array.length] The end position.
  7868. * @returns {Array} Returns `array`.
  7869. * @example
  7870. *
  7871. * var array = [1, 2, 3];
  7872. *
  7873. * _.fill(array, 'a');
  7874. * console.log(array);
  7875. * // => ['a', 'a', 'a']
  7876. *
  7877. * _.fill(Array(3), 2);
  7878. * // => [2, 2, 2]
  7879. *
  7880. * _.fill([4, 6, 8, 10], '*', 1, 3);
  7881. * // => [4, '*', '*', 10]
  7882. */
  7883. function fill(array, value, start, end) {
  7884. var length = array == null ? 0 : array.length;
  7885. if (!length) {
  7886. return [];
  7887. }
  7888. if (start && typeof start != 'number' && isIterateeCall(array, value, start)) {
  7889. start = 0;
  7890. end = length;
  7891. }
  7892. return baseFill(array, value, start, end);
  7893. }
  7894. /**
  7895. * This method is like `_.find` except that it returns the index of the first
  7896. * element `predicate` returns truthy for instead of the element itself.
  7897. *
  7898. * @static
  7899. * @memberOf _
  7900. * @since 1.1.0
  7901. * @category Array
  7902. * @param {Array} array The array to inspect.
  7903. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  7904. * @param {number} [fromIndex=0] The index to search from.
  7905. * @returns {number} Returns the index of the found element, else `-1`.
  7906. * @example
  7907. *
  7908. * var users = [
  7909. * { 'user': 'barney', 'active': false },
  7910. * { 'user': 'fred', 'active': false },
  7911. * { 'user': 'pebbles', 'active': true }
  7912. * ];
  7913. *
  7914. * _.findIndex(users, function(o) { return o.user == 'barney'; });
  7915. * // => 0
  7916. *
  7917. * // The `_.matches` iteratee shorthand.
  7918. * _.findIndex(users, { 'user': 'fred', 'active': false });
  7919. * // => 1
  7920. *
  7921. * // The `_.matchesProperty` iteratee shorthand.
  7922. * _.findIndex(users, ['active', false]);
  7923. * // => 0
  7924. *
  7925. * // The `_.property` iteratee shorthand.
  7926. * _.findIndex(users, 'active');
  7927. * // => 2
  7928. */
  7929. function findIndex(array, predicate, fromIndex) {
  7930. var length = array == null ? 0 : array.length;
  7931. if (!length) {
  7932. return -1;
  7933. }
  7934. var index = fromIndex == null ? 0 : toInteger(fromIndex);
  7935. if (index < 0) {
  7936. index = nativeMax(length + index, 0);
  7937. }
  7938. return baseFindIndex(array, getIteratee(predicate, 3), index);
  7939. }
  7940. /**
  7941. * This method is like `_.findIndex` except that it iterates over elements
  7942. * of `collection` from right to left.
  7943. *
  7944. * @static
  7945. * @memberOf _
  7946. * @since 2.0.0
  7947. * @category Array
  7948. * @param {Array} array The array to inspect.
  7949. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  7950. * @param {number} [fromIndex=array.length-1] The index to search from.
  7951. * @returns {number} Returns the index of the found element, else `-1`.
  7952. * @example
  7953. *
  7954. * var users = [
  7955. * { 'user': 'barney', 'active': true },
  7956. * { 'user': 'fred', 'active': false },
  7957. * { 'user': 'pebbles', 'active': false }
  7958. * ];
  7959. *
  7960. * _.findLastIndex(users, function(o) { return o.user == 'pebbles'; });
  7961. * // => 2
  7962. *
  7963. * // The `_.matches` iteratee shorthand.
  7964. * _.findLastIndex(users, { 'user': 'barney', 'active': true });
  7965. * // => 0
  7966. *
  7967. * // The `_.matchesProperty` iteratee shorthand.
  7968. * _.findLastIndex(users, ['active', false]);
  7969. * // => 2
  7970. *
  7971. * // The `_.property` iteratee shorthand.
  7972. * _.findLastIndex(users, 'active');
  7973. * // => 0
  7974. */
  7975. function findLastIndex(array, predicate, fromIndex) {
  7976. var length = array == null ? 0 : array.length;
  7977. if (!length) {
  7978. return -1;
  7979. }
  7980. var index = length - 1;
  7981. if (fromIndex !== undefined) {
  7982. index = toInteger(fromIndex);
  7983. index = fromIndex < 0
  7984. ? nativeMax(length + index, 0)
  7985. : nativeMin(index, length - 1);
  7986. }
  7987. return baseFindIndex(array, getIteratee(predicate, 3), index, true);
  7988. }
  7989. /**
  7990. * Flattens `array` a single level deep.
  7991. *
  7992. * @static
  7993. * @memberOf _
  7994. * @since 0.1.0
  7995. * @category Array
  7996. * @param {Array} array The array to flatten.
  7997. * @returns {Array} Returns the new flattened array.
  7998. * @example
  7999. *
  8000. * _.flatten([1, [2, [3, [4]], 5]]);
  8001. * // => [1, 2, [3, [4]], 5]
  8002. */
  8003. function flatten(array) {
  8004. var length = array == null ? 0 : array.length;
  8005. return length ? baseFlatten(array, 1) : [];
  8006. }
  8007. /**
  8008. * Recursively flattens `array`.
  8009. *
  8010. * @static
  8011. * @memberOf _
  8012. * @since 3.0.0
  8013. * @category Array
  8014. * @param {Array} array The array to flatten.
  8015. * @returns {Array} Returns the new flattened array.
  8016. * @example
  8017. *
  8018. * _.flattenDeep([1, [2, [3, [4]], 5]]);
  8019. * // => [1, 2, 3, 4, 5]
  8020. */
  8021. function flattenDeep(array) {
  8022. var length = array == null ? 0 : array.length;
  8023. return length ? baseFlatten(array, INFINITY) : [];
  8024. }
  8025. /**
  8026. * Recursively flatten `array` up to `depth` times.
  8027. *
  8028. * @static
  8029. * @memberOf _
  8030. * @since 4.4.0
  8031. * @category Array
  8032. * @param {Array} array The array to flatten.
  8033. * @param {number} [depth=1] The maximum recursion depth.
  8034. * @returns {Array} Returns the new flattened array.
  8035. * @example
  8036. *
  8037. * var array = [1, [2, [3, [4]], 5]];
  8038. *
  8039. * _.flattenDepth(array, 1);
  8040. * // => [1, 2, [3, [4]], 5]
  8041. *
  8042. * _.flattenDepth(array, 2);
  8043. * // => [1, 2, 3, [4], 5]
  8044. */
  8045. function flattenDepth(array, depth) {
  8046. var length = array == null ? 0 : array.length;
  8047. if (!length) {
  8048. return [];
  8049. }
  8050. depth = depth === undefined ? 1 : toInteger(depth);
  8051. return baseFlatten(array, depth);
  8052. }
  8053. /**
  8054. * The inverse of `_.toPairs`; this method returns an object composed
  8055. * from key-value `pairs`.
  8056. *
  8057. * @static
  8058. * @memberOf _
  8059. * @since 4.0.0
  8060. * @category Array
  8061. * @param {Array} pairs The key-value pairs.
  8062. * @returns {Object} Returns the new object.
  8063. * @example
  8064. *
  8065. * _.fromPairs([['a', 1], ['b', 2]]);
  8066. * // => { 'a': 1, 'b': 2 }
  8067. */
  8068. function fromPairs(pairs) {
  8069. var index = -1,
  8070. length = pairs == null ? 0 : pairs.length,
  8071. result = {};
  8072. while (++index < length) {
  8073. var pair = pairs[index];
  8074. result[pair[0]] = pair[1];
  8075. }
  8076. return result;
  8077. }
  8078. /**
  8079. * Gets the first element of `array`.
  8080. *
  8081. * @static
  8082. * @memberOf _
  8083. * @since 0.1.0
  8084. * @alias first
  8085. * @category Array
  8086. * @param {Array} array The array to query.
  8087. * @returns {*} Returns the first element of `array`.
  8088. * @example
  8089. *
  8090. * _.head([1, 2, 3]);
  8091. * // => 1
  8092. *
  8093. * _.head([]);
  8094. * // => undefined
  8095. */
  8096. function head(array) {
  8097. return (array && array.length) ? array[0] : undefined;
  8098. }
  8099. /**
  8100. * Gets the index at which the first occurrence of `value` is found in `array`
  8101. * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  8102. * for equality comparisons. If `fromIndex` is negative, it's used as the
  8103. * offset from the end of `array`.
  8104. *
  8105. * @static
  8106. * @memberOf _
  8107. * @since 0.1.0
  8108. * @category Array
  8109. * @param {Array} array The array to inspect.
  8110. * @param {*} value The value to search for.
  8111. * @param {number} [fromIndex=0] The index to search from.
  8112. * @returns {number} Returns the index of the matched value, else `-1`.
  8113. * @example
  8114. *
  8115. * _.indexOf([1, 2, 1, 2], 2);
  8116. * // => 1
  8117. *
  8118. * // Search from the `fromIndex`.
  8119. * _.indexOf([1, 2, 1, 2], 2, 2);
  8120. * // => 3
  8121. */
  8122. function indexOf(array, value, fromIndex) {
  8123. var length = array == null ? 0 : array.length;
  8124. if (!length) {
  8125. return -1;
  8126. }
  8127. var index = fromIndex == null ? 0 : toInteger(fromIndex);
  8128. if (index < 0) {
  8129. index = nativeMax(length + index, 0);
  8130. }
  8131. return baseIndexOf(array, value, index);
  8132. }
  8133. /**
  8134. * Gets all but the last element of `array`.
  8135. *
  8136. * @static
  8137. * @memberOf _
  8138. * @since 0.1.0
  8139. * @category Array
  8140. * @param {Array} array The array to query.
  8141. * @returns {Array} Returns the slice of `array`.
  8142. * @example
  8143. *
  8144. * _.initial([1, 2, 3]);
  8145. * // => [1, 2]
  8146. */
  8147. function initial(array) {
  8148. var length = array == null ? 0 : array.length;
  8149. return length ? baseSlice(array, 0, -1) : [];
  8150. }
  8151. /**
  8152. * Creates an array of unique values that are included in all given arrays
  8153. * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  8154. * for equality comparisons. The order and references of result values are
  8155. * determined by the first array.
  8156. *
  8157. * @static
  8158. * @memberOf _
  8159. * @since 0.1.0
  8160. * @category Array
  8161. * @param {...Array} [arrays] The arrays to inspect.
  8162. * @returns {Array} Returns the new array of intersecting values.
  8163. * @example
  8164. *
  8165. * _.intersection([2, 1], [2, 3]);
  8166. * // => [2]
  8167. */
  8168. var intersection = baseRest(function(arrays) {
  8169. var mapped = arrayMap(arrays, castArrayLikeObject);
  8170. return (mapped.length && mapped[0] === arrays[0])
  8171. ? baseIntersection(mapped)
  8172. : [];
  8173. });
  8174. /**
  8175. * This method is like `_.intersection` except that it accepts `iteratee`
  8176. * which is invoked for each element of each `arrays` to generate the criterion
  8177. * by which they're compared. The order and references of result values are
  8178. * determined by the first array. The iteratee is invoked with one argument:
  8179. * (value).
  8180. *
  8181. * @static
  8182. * @memberOf _
  8183. * @since 4.0.0
  8184. * @category Array
  8185. * @param {...Array} [arrays] The arrays to inspect.
  8186. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  8187. * @returns {Array} Returns the new array of intersecting values.
  8188. * @example
  8189. *
  8190. * _.intersectionBy([2.1, 1.2], [2.3, 3.4], Math.floor);
  8191. * // => [2.1]
  8192. *
  8193. * // The `_.property` iteratee shorthand.
  8194. * _.intersectionBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x');
  8195. * // => [{ 'x': 1 }]
  8196. */
  8197. var intersectionBy = baseRest(function(arrays) {
  8198. var iteratee = last(arrays),
  8199. mapped = arrayMap(arrays, castArrayLikeObject);
  8200. if (iteratee === last(mapped)) {
  8201. iteratee = undefined;
  8202. } else {
  8203. mapped.pop();
  8204. }
  8205. return (mapped.length && mapped[0] === arrays[0])
  8206. ? baseIntersection(mapped, getIteratee(iteratee, 2))
  8207. : [];
  8208. });
  8209. /**
  8210. * This method is like `_.intersection` except that it accepts `comparator`
  8211. * which is invoked to compare elements of `arrays`. The order and references
  8212. * of result values are determined by the first array. The comparator is
  8213. * invoked with two arguments: (arrVal, othVal).
  8214. *
  8215. * @static
  8216. * @memberOf _
  8217. * @since 4.0.0
  8218. * @category Array
  8219. * @param {...Array} [arrays] The arrays to inspect.
  8220. * @param {Function} [comparator] The comparator invoked per element.
  8221. * @returns {Array} Returns the new array of intersecting values.
  8222. * @example
  8223. *
  8224. * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }];
  8225. * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }];
  8226. *
  8227. * _.intersectionWith(objects, others, _.isEqual);
  8228. * // => [{ 'x': 1, 'y': 2 }]
  8229. */
  8230. var intersectionWith = baseRest(function(arrays) {
  8231. var comparator = last(arrays),
  8232. mapped = arrayMap(arrays, castArrayLikeObject);
  8233. comparator = typeof comparator == 'function' ? comparator : undefined;
  8234. if (comparator) {
  8235. mapped.pop();
  8236. }
  8237. return (mapped.length && mapped[0] === arrays[0])
  8238. ? baseIntersection(mapped, undefined, comparator)
  8239. : [];
  8240. });
  8241. /**
  8242. * Converts all elements in `array` into a string separated by `separator`.
  8243. *
  8244. * @static
  8245. * @memberOf _
  8246. * @since 4.0.0
  8247. * @category Array
  8248. * @param {Array} array The array to convert.
  8249. * @param {string} [separator=','] The element separator.
  8250. * @returns {string} Returns the joined string.
  8251. * @example
  8252. *
  8253. * _.join(['a', 'b', 'c'], '~');
  8254. * // => 'a~b~c'
  8255. */
  8256. function join(array, separator) {
  8257. return array == null ? '' : nativeJoin.call(array, separator);
  8258. }
  8259. /**
  8260. * Gets the last element of `array`.
  8261. *
  8262. * @static
  8263. * @memberOf _
  8264. * @since 0.1.0
  8265. * @category Array
  8266. * @param {Array} array The array to query.
  8267. * @returns {*} Returns the last element of `array`.
  8268. * @example
  8269. *
  8270. * _.last([1, 2, 3]);
  8271. * // => 3
  8272. */
  8273. function last(array) {
  8274. var length = array == null ? 0 : array.length;
  8275. return length ? array[length - 1] : undefined;
  8276. }
  8277. /**
  8278. * This method is like `_.indexOf` except that it iterates over elements of
  8279. * `array` from right to left.
  8280. *
  8281. * @static
  8282. * @memberOf _
  8283. * @since 0.1.0
  8284. * @category Array
  8285. * @param {Array} array The array to inspect.
  8286. * @param {*} value The value to search for.
  8287. * @param {number} [fromIndex=array.length-1] The index to search from.
  8288. * @returns {number} Returns the index of the matched value, else `-1`.
  8289. * @example
  8290. *
  8291. * _.lastIndexOf([1, 2, 1, 2], 2);
  8292. * // => 3
  8293. *
  8294. * // Search from the `fromIndex`.
  8295. * _.lastIndexOf([1, 2, 1, 2], 2, 2);
  8296. * // => 1
  8297. */
  8298. function lastIndexOf(array, value, fromIndex) {
  8299. var length = array == null ? 0 : array.length;
  8300. if (!length) {
  8301. return -1;
  8302. }
  8303. var index = length;
  8304. if (fromIndex !== undefined) {
  8305. index = toInteger(fromIndex);
  8306. index = index < 0 ? nativeMax(length + index, 0) : nativeMin(index, length - 1);
  8307. }
  8308. return value === value
  8309. ? strictLastIndexOf(array, value, index)
  8310. : baseFindIndex(array, baseIsNaN, index, true);
  8311. }
  8312. /**
  8313. * Gets the element at index `n` of `array`. If `n` is negative, the nth
  8314. * element from the end is returned.
  8315. *
  8316. * @static
  8317. * @memberOf _
  8318. * @since 4.11.0
  8319. * @category Array
  8320. * @param {Array} array The array to query.
  8321. * @param {number} [n=0] The index of the element to return.
  8322. * @returns {*} Returns the nth element of `array`.
  8323. * @example
  8324. *
  8325. * var array = ['a', 'b', 'c', 'd'];
  8326. *
  8327. * _.nth(array, 1);
  8328. * // => 'b'
  8329. *
  8330. * _.nth(array, -2);
  8331. * // => 'c';
  8332. */
  8333. function nth(array, n) {
  8334. return (array && array.length) ? baseNth(array, toInteger(n)) : undefined;
  8335. }
  8336. /**
  8337. * Removes all given values from `array` using
  8338. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  8339. * for equality comparisons.
  8340. *
  8341. * **Note:** Unlike `_.without`, this method mutates `array`. Use `_.remove`
  8342. * to remove elements from an array by predicate.
  8343. *
  8344. * @static
  8345. * @memberOf _
  8346. * @since 2.0.0
  8347. * @category Array
  8348. * @param {Array} array The array to modify.
  8349. * @param {...*} [values] The values to remove.
  8350. * @returns {Array} Returns `array`.
  8351. * @example
  8352. *
  8353. * var array = ['a', 'b', 'c', 'a', 'b', 'c'];
  8354. *
  8355. * _.pull(array, 'a', 'c');
  8356. * console.log(array);
  8357. * // => ['b', 'b']
  8358. */
  8359. var pull = baseRest(pullAll);
  8360. /**
  8361. * This method is like `_.pull` except that it accepts an array of values to remove.
  8362. *
  8363. * **Note:** Unlike `_.difference`, this method mutates `array`.
  8364. *
  8365. * @static
  8366. * @memberOf _
  8367. * @since 4.0.0
  8368. * @category Array
  8369. * @param {Array} array The array to modify.
  8370. * @param {Array} values The values to remove.
  8371. * @returns {Array} Returns `array`.
  8372. * @example
  8373. *
  8374. * var array = ['a', 'b', 'c', 'a', 'b', 'c'];
  8375. *
  8376. * _.pullAll(array, ['a', 'c']);
  8377. * console.log(array);
  8378. * // => ['b', 'b']
  8379. */
  8380. function pullAll(array, values) {
  8381. return (array && array.length && values && values.length)
  8382. ? basePullAll(array, values)
  8383. : array;
  8384. }
  8385. /**
  8386. * This method is like `_.pullAll` except that it accepts `iteratee` which is
  8387. * invoked for each element of `array` and `values` to generate the criterion
  8388. * by which they're compared. The iteratee is invoked with one argument: (value).
  8389. *
  8390. * **Note:** Unlike `_.differenceBy`, this method mutates `array`.
  8391. *
  8392. * @static
  8393. * @memberOf _
  8394. * @since 4.0.0
  8395. * @category Array
  8396. * @param {Array} array The array to modify.
  8397. * @param {Array} values The values to remove.
  8398. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  8399. * @returns {Array} Returns `array`.
  8400. * @example
  8401. *
  8402. * var array = [{ 'x': 1 }, { 'x': 2 }, { 'x': 3 }, { 'x': 1 }];
  8403. *
  8404. * _.pullAllBy(array, [{ 'x': 1 }, { 'x': 3 }], 'x');
  8405. * console.log(array);
  8406. * // => [{ 'x': 2 }]
  8407. */
  8408. function pullAllBy(array, values, iteratee) {
  8409. return (array && array.length && values && values.length)
  8410. ? basePullAll(array, values, getIteratee(iteratee, 2))
  8411. : array;
  8412. }
  8413. /**
  8414. * This method is like `_.pullAll` except that it accepts `comparator` which
  8415. * is invoked to compare elements of `array` to `values`. The comparator is
  8416. * invoked with two arguments: (arrVal, othVal).
  8417. *
  8418. * **Note:** Unlike `_.differenceWith`, this method mutates `array`.
  8419. *
  8420. * @static
  8421. * @memberOf _
  8422. * @since 4.6.0
  8423. * @category Array
  8424. * @param {Array} array The array to modify.
  8425. * @param {Array} values The values to remove.
  8426. * @param {Function} [comparator] The comparator invoked per element.
  8427. * @returns {Array} Returns `array`.
  8428. * @example
  8429. *
  8430. * var array = [{ 'x': 1, 'y': 2 }, { 'x': 3, 'y': 4 }, { 'x': 5, 'y': 6 }];
  8431. *
  8432. * _.pullAllWith(array, [{ 'x': 3, 'y': 4 }], _.isEqual);
  8433. * console.log(array);
  8434. * // => [{ 'x': 1, 'y': 2 }, { 'x': 5, 'y': 6 }]
  8435. */
  8436. function pullAllWith(array, values, comparator) {
  8437. return (array && array.length && values && values.length)
  8438. ? basePullAll(array, values, undefined, comparator)
  8439. : array;
  8440. }
  8441. /**
  8442. * Removes elements from `array` corresponding to `indexes` and returns an
  8443. * array of removed elements.
  8444. *
  8445. * **Note:** Unlike `_.at`, this method mutates `array`.
  8446. *
  8447. * @static
  8448. * @memberOf _
  8449. * @since 3.0.0
  8450. * @category Array
  8451. * @param {Array} array The array to modify.
  8452. * @param {...(number|number[])} [indexes] The indexes of elements to remove.
  8453. * @returns {Array} Returns the new array of removed elements.
  8454. * @example
  8455. *
  8456. * var array = ['a', 'b', 'c', 'd'];
  8457. * var pulled = _.pullAt(array, [1, 3]);
  8458. *
  8459. * console.log(array);
  8460. * // => ['a', 'c']
  8461. *
  8462. * console.log(pulled);
  8463. * // => ['b', 'd']
  8464. */
  8465. var pullAt = flatRest(function(array, indexes) {
  8466. var length = array == null ? 0 : array.length,
  8467. result = baseAt(array, indexes);
  8468. basePullAt(array, arrayMap(indexes, function(index) {
  8469. return isIndex(index, length) ? +index : index;
  8470. }).sort(compareAscending));
  8471. return result;
  8472. });
  8473. /**
  8474. * Removes all elements from `array` that `predicate` returns truthy for
  8475. * and returns an array of the removed elements. The predicate is invoked
  8476. * with three arguments: (value, index, array).
  8477. *
  8478. * **Note:** Unlike `_.filter`, this method mutates `array`. Use `_.pull`
  8479. * to pull elements from an array by value.
  8480. *
  8481. * @static
  8482. * @memberOf _
  8483. * @since 2.0.0
  8484. * @category Array
  8485. * @param {Array} array The array to modify.
  8486. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  8487. * @returns {Array} Returns the new array of removed elements.
  8488. * @example
  8489. *
  8490. * var array = [1, 2, 3, 4];
  8491. * var evens = _.remove(array, function(n) {
  8492. * return n % 2 == 0;
  8493. * });
  8494. *
  8495. * console.log(array);
  8496. * // => [1, 3]
  8497. *
  8498. * console.log(evens);
  8499. * // => [2, 4]
  8500. */
  8501. function remove(array, predicate) {
  8502. var result = [];
  8503. if (!(array && array.length)) {
  8504. return result;
  8505. }
  8506. var index = -1,
  8507. indexes = [],
  8508. length = array.length;
  8509. predicate = getIteratee(predicate, 3);
  8510. while (++index < length) {
  8511. var value = array[index];
  8512. if (predicate(value, index, array)) {
  8513. result.push(value);
  8514. indexes.push(index);
  8515. }
  8516. }
  8517. basePullAt(array, indexes);
  8518. return result;
  8519. }
  8520. /**
  8521. * Reverses `array` so that the first element becomes the last, the second
  8522. * element becomes the second to last, and so on.
  8523. *
  8524. * **Note:** This method mutates `array` and is based on
  8525. * [`Array#reverse`](https://mdn.io/Array/reverse).
  8526. *
  8527. * @static
  8528. * @memberOf _
  8529. * @since 4.0.0
  8530. * @category Array
  8531. * @param {Array} array The array to modify.
  8532. * @returns {Array} Returns `array`.
  8533. * @example
  8534. *
  8535. * var array = [1, 2, 3];
  8536. *
  8537. * _.reverse(array);
  8538. * // => [3, 2, 1]
  8539. *
  8540. * console.log(array);
  8541. * // => [3, 2, 1]
  8542. */
  8543. function reverse(array) {
  8544. return array == null ? array : nativeReverse.call(array);
  8545. }
  8546. /**
  8547. * Creates a slice of `array` from `start` up to, but not including, `end`.
  8548. *
  8549. * **Note:** This method is used instead of
  8550. * [`Array#slice`](https://mdn.io/Array/slice) to ensure dense arrays are
  8551. * returned.
  8552. *
  8553. * @static
  8554. * @memberOf _
  8555. * @since 3.0.0
  8556. * @category Array
  8557. * @param {Array} array The array to slice.
  8558. * @param {number} [start=0] The start position.
  8559. * @param {number} [end=array.length] The end position.
  8560. * @returns {Array} Returns the slice of `array`.
  8561. */
  8562. function slice(array, start, end) {
  8563. var length = array == null ? 0 : array.length;
  8564. if (!length) {
  8565. return [];
  8566. }
  8567. if (end && typeof end != 'number' && isIterateeCall(array, start, end)) {
  8568. start = 0;
  8569. end = length;
  8570. }
  8571. else {
  8572. start = start == null ? 0 : toInteger(start);
  8573. end = end === undefined ? length : toInteger(end);
  8574. }
  8575. return baseSlice(array, start, end);
  8576. }
  8577. /**
  8578. * Uses a binary search to determine the lowest index at which `value`
  8579. * should be inserted into `array` in order to maintain its sort order.
  8580. *
  8581. * @static
  8582. * @memberOf _
  8583. * @since 0.1.0
  8584. * @category Array
  8585. * @param {Array} array The sorted array to inspect.
  8586. * @param {*} value The value to evaluate.
  8587. * @returns {number} Returns the index at which `value` should be inserted
  8588. * into `array`.
  8589. * @example
  8590. *
  8591. * _.sortedIndex([30, 50], 40);
  8592. * // => 1
  8593. */
  8594. function sortedIndex(array, value) {
  8595. return baseSortedIndex(array, value);
  8596. }
  8597. /**
  8598. * This method is like `_.sortedIndex` except that it accepts `iteratee`
  8599. * which is invoked for `value` and each element of `array` to compute their
  8600. * sort ranking. The iteratee is invoked with one argument: (value).
  8601. *
  8602. * @static
  8603. * @memberOf _
  8604. * @since 4.0.0
  8605. * @category Array
  8606. * @param {Array} array The sorted array to inspect.
  8607. * @param {*} value The value to evaluate.
  8608. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  8609. * @returns {number} Returns the index at which `value` should be inserted
  8610. * into `array`.
  8611. * @example
  8612. *
  8613. * var objects = [{ 'x': 4 }, { 'x': 5 }];
  8614. *
  8615. * _.sortedIndexBy(objects, { 'x': 4 }, function(o) { return o.x; });
  8616. * // => 0
  8617. *
  8618. * // The `_.property` iteratee shorthand.
  8619. * _.sortedIndexBy(objects, { 'x': 4 }, 'x');
  8620. * // => 0
  8621. */
  8622. function sortedIndexBy(array, value, iteratee) {
  8623. return baseSortedIndexBy(array, value, getIteratee(iteratee, 2));
  8624. }
  8625. /**
  8626. * This method is like `_.indexOf` except that it performs a binary
  8627. * search on a sorted `array`.
  8628. *
  8629. * @static
  8630. * @memberOf _
  8631. * @since 4.0.0
  8632. * @category Array
  8633. * @param {Array} array The array to inspect.
  8634. * @param {*} value The value to search for.
  8635. * @returns {number} Returns the index of the matched value, else `-1`.
  8636. * @example
  8637. *
  8638. * _.sortedIndexOf([4, 5, 5, 5, 6], 5);
  8639. * // => 1
  8640. */
  8641. function sortedIndexOf(array, value) {
  8642. var length = array == null ? 0 : array.length;
  8643. if (length) {
  8644. var index = baseSortedIndex(array, value);
  8645. if (index < length && eq(array[index], value)) {
  8646. return index;
  8647. }
  8648. }
  8649. return -1;
  8650. }
  8651. /**
  8652. * This method is like `_.sortedIndex` except that it returns the highest
  8653. * index at which `value` should be inserted into `array` in order to
  8654. * maintain its sort order.
  8655. *
  8656. * @static
  8657. * @memberOf _
  8658. * @since 3.0.0
  8659. * @category Array
  8660. * @param {Array} array The sorted array to inspect.
  8661. * @param {*} value The value to evaluate.
  8662. * @returns {number} Returns the index at which `value` should be inserted
  8663. * into `array`.
  8664. * @example
  8665. *
  8666. * _.sortedLastIndex([4, 5, 5, 5, 6], 5);
  8667. * // => 4
  8668. */
  8669. function sortedLastIndex(array, value) {
  8670. return baseSortedIndex(array, value, true);
  8671. }
  8672. /**
  8673. * This method is like `_.sortedLastIndex` except that it accepts `iteratee`
  8674. * which is invoked for `value` and each element of `array` to compute their
  8675. * sort ranking. The iteratee is invoked with one argument: (value).
  8676. *
  8677. * @static
  8678. * @memberOf _
  8679. * @since 4.0.0
  8680. * @category Array
  8681. * @param {Array} array The sorted array to inspect.
  8682. * @param {*} value The value to evaluate.
  8683. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  8684. * @returns {number} Returns the index at which `value` should be inserted
  8685. * into `array`.
  8686. * @example
  8687. *
  8688. * var objects = [{ 'x': 4 }, { 'x': 5 }];
  8689. *
  8690. * _.sortedLastIndexBy(objects, { 'x': 4 }, function(o) { return o.x; });
  8691. * // => 1
  8692. *
  8693. * // The `_.property` iteratee shorthand.
  8694. * _.sortedLastIndexBy(objects, { 'x': 4 }, 'x');
  8695. * // => 1
  8696. */
  8697. function sortedLastIndexBy(array, value, iteratee) {
  8698. return baseSortedIndexBy(array, value, getIteratee(iteratee, 2), true);
  8699. }
  8700. /**
  8701. * This method is like `_.lastIndexOf` except that it performs a binary
  8702. * search on a sorted `array`.
  8703. *
  8704. * @static
  8705. * @memberOf _
  8706. * @since 4.0.0
  8707. * @category Array
  8708. * @param {Array} array The array to inspect.
  8709. * @param {*} value The value to search for.
  8710. * @returns {number} Returns the index of the matched value, else `-1`.
  8711. * @example
  8712. *
  8713. * _.sortedLastIndexOf([4, 5, 5, 5, 6], 5);
  8714. * // => 3
  8715. */
  8716. function sortedLastIndexOf(array, value) {
  8717. var length = array == null ? 0 : array.length;
  8718. if (length) {
  8719. var index = baseSortedIndex(array, value, true) - 1;
  8720. if (eq(array[index], value)) {
  8721. return index;
  8722. }
  8723. }
  8724. return -1;
  8725. }
  8726. /**
  8727. * This method is like `_.uniq` except that it's designed and optimized
  8728. * for sorted arrays.
  8729. *
  8730. * @static
  8731. * @memberOf _
  8732. * @since 4.0.0
  8733. * @category Array
  8734. * @param {Array} array The array to inspect.
  8735. * @returns {Array} Returns the new duplicate free array.
  8736. * @example
  8737. *
  8738. * _.sortedUniq([1, 1, 2]);
  8739. * // => [1, 2]
  8740. */
  8741. function sortedUniq(array) {
  8742. return (array && array.length)
  8743. ? baseSortedUniq(array)
  8744. : [];
  8745. }
  8746. /**
  8747. * This method is like `_.uniqBy` except that it's designed and optimized
  8748. * for sorted arrays.
  8749. *
  8750. * @static
  8751. * @memberOf _
  8752. * @since 4.0.0
  8753. * @category Array
  8754. * @param {Array} array The array to inspect.
  8755. * @param {Function} [iteratee] The iteratee invoked per element.
  8756. * @returns {Array} Returns the new duplicate free array.
  8757. * @example
  8758. *
  8759. * _.sortedUniqBy([1.1, 1.2, 2.3, 2.4], Math.floor);
  8760. * // => [1.1, 2.3]
  8761. */
  8762. function sortedUniqBy(array, iteratee) {
  8763. return (array && array.length)
  8764. ? baseSortedUniq(array, getIteratee(iteratee, 2))
  8765. : [];
  8766. }
  8767. /**
  8768. * Gets all but the first element of `array`.
  8769. *
  8770. * @static
  8771. * @memberOf _
  8772. * @since 4.0.0
  8773. * @category Array
  8774. * @param {Array} array The array to query.
  8775. * @returns {Array} Returns the slice of `array`.
  8776. * @example
  8777. *
  8778. * _.tail([1, 2, 3]);
  8779. * // => [2, 3]
  8780. */
  8781. function tail(array) {
  8782. var length = array == null ? 0 : array.length;
  8783. return length ? baseSlice(array, 1, length) : [];
  8784. }
  8785. /**
  8786. * Creates a slice of `array` with `n` elements taken from the beginning.
  8787. *
  8788. * @static
  8789. * @memberOf _
  8790. * @since 0.1.0
  8791. * @category Array
  8792. * @param {Array} array The array to query.
  8793. * @param {number} [n=1] The number of elements to take.
  8794. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  8795. * @returns {Array} Returns the slice of `array`.
  8796. * @example
  8797. *
  8798. * _.take([1, 2, 3]);
  8799. * // => [1]
  8800. *
  8801. * _.take([1, 2, 3], 2);
  8802. * // => [1, 2]
  8803. *
  8804. * _.take([1, 2, 3], 5);
  8805. * // => [1, 2, 3]
  8806. *
  8807. * _.take([1, 2, 3], 0);
  8808. * // => []
  8809. */
  8810. function take(array, n, guard) {
  8811. if (!(array && array.length)) {
  8812. return [];
  8813. }
  8814. n = (guard || n === undefined) ? 1 : toInteger(n);
  8815. return baseSlice(array, 0, n < 0 ? 0 : n);
  8816. }
  8817. /**
  8818. * Creates a slice of `array` with `n` elements taken from the end.
  8819. *
  8820. * @static
  8821. * @memberOf _
  8822. * @since 3.0.0
  8823. * @category Array
  8824. * @param {Array} array The array to query.
  8825. * @param {number} [n=1] The number of elements to take.
  8826. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  8827. * @returns {Array} Returns the slice of `array`.
  8828. * @example
  8829. *
  8830. * _.takeRight([1, 2, 3]);
  8831. * // => [3]
  8832. *
  8833. * _.takeRight([1, 2, 3], 2);
  8834. * // => [2, 3]
  8835. *
  8836. * _.takeRight([1, 2, 3], 5);
  8837. * // => [1, 2, 3]
  8838. *
  8839. * _.takeRight([1, 2, 3], 0);
  8840. * // => []
  8841. */
  8842. function takeRight(array, n, guard) {
  8843. var length = array == null ? 0 : array.length;
  8844. if (!length) {
  8845. return [];
  8846. }
  8847. n = (guard || n === undefined) ? 1 : toInteger(n);
  8848. n = length - n;
  8849. return baseSlice(array, n < 0 ? 0 : n, length);
  8850. }
  8851. /**
  8852. * Creates a slice of `array` with elements taken from the end. Elements are
  8853. * taken until `predicate` returns falsey. The predicate is invoked with
  8854. * three arguments: (value, index, array).
  8855. *
  8856. * @static
  8857. * @memberOf _
  8858. * @since 3.0.0
  8859. * @category Array
  8860. * @param {Array} array The array to query.
  8861. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  8862. * @returns {Array} Returns the slice of `array`.
  8863. * @example
  8864. *
  8865. * var users = [
  8866. * { 'user': 'barney', 'active': true },
  8867. * { 'user': 'fred', 'active': false },
  8868. * { 'user': 'pebbles', 'active': false }
  8869. * ];
  8870. *
  8871. * _.takeRightWhile(users, function(o) { return !o.active; });
  8872. * // => objects for ['fred', 'pebbles']
  8873. *
  8874. * // The `_.matches` iteratee shorthand.
  8875. * _.takeRightWhile(users, { 'user': 'pebbles', 'active': false });
  8876. * // => objects for ['pebbles']
  8877. *
  8878. * // The `_.matchesProperty` iteratee shorthand.
  8879. * _.takeRightWhile(users, ['active', false]);
  8880. * // => objects for ['fred', 'pebbles']
  8881. *
  8882. * // The `_.property` iteratee shorthand.
  8883. * _.takeRightWhile(users, 'active');
  8884. * // => []
  8885. */
  8886. function takeRightWhile(array, predicate) {
  8887. return (array && array.length)
  8888. ? baseWhile(array, getIteratee(predicate, 3), false, true)
  8889. : [];
  8890. }
  8891. /**
  8892. * Creates a slice of `array` with elements taken from the beginning. Elements
  8893. * are taken until `predicate` returns falsey. The predicate is invoked with
  8894. * three arguments: (value, index, array).
  8895. *
  8896. * @static
  8897. * @memberOf _
  8898. * @since 3.0.0
  8899. * @category Array
  8900. * @param {Array} array The array to query.
  8901. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  8902. * @returns {Array} Returns the slice of `array`.
  8903. * @example
  8904. *
  8905. * var users = [
  8906. * { 'user': 'barney', 'active': false },
  8907. * { 'user': 'fred', 'active': false },
  8908. * { 'user': 'pebbles', 'active': true }
  8909. * ];
  8910. *
  8911. * _.takeWhile(users, function(o) { return !o.active; });
  8912. * // => objects for ['barney', 'fred']
  8913. *
  8914. * // The `_.matches` iteratee shorthand.
  8915. * _.takeWhile(users, { 'user': 'barney', 'active': false });
  8916. * // => objects for ['barney']
  8917. *
  8918. * // The `_.matchesProperty` iteratee shorthand.
  8919. * _.takeWhile(users, ['active', false]);
  8920. * // => objects for ['barney', 'fred']
  8921. *
  8922. * // The `_.property` iteratee shorthand.
  8923. * _.takeWhile(users, 'active');
  8924. * // => []
  8925. */
  8926. function takeWhile(array, predicate) {
  8927. return (array && array.length)
  8928. ? baseWhile(array, getIteratee(predicate, 3))
  8929. : [];
  8930. }
  8931. /**
  8932. * Creates an array of unique values, in order, from all given arrays using
  8933. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  8934. * for equality comparisons.
  8935. *
  8936. * @static
  8937. * @memberOf _
  8938. * @since 0.1.0
  8939. * @category Array
  8940. * @param {...Array} [arrays] The arrays to inspect.
  8941. * @returns {Array} Returns the new array of combined values.
  8942. * @example
  8943. *
  8944. * _.union([2], [1, 2]);
  8945. * // => [2, 1]
  8946. */
  8947. var union = baseRest(function(arrays) {
  8948. return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true));
  8949. });
  8950. /**
  8951. * This method is like `_.union` except that it accepts `iteratee` which is
  8952. * invoked for each element of each `arrays` to generate the criterion by
  8953. * which uniqueness is computed. Result values are chosen from the first
  8954. * array in which the value occurs. The iteratee is invoked with one argument:
  8955. * (value).
  8956. *
  8957. * @static
  8958. * @memberOf _
  8959. * @since 4.0.0
  8960. * @category Array
  8961. * @param {...Array} [arrays] The arrays to inspect.
  8962. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  8963. * @returns {Array} Returns the new array of combined values.
  8964. * @example
  8965. *
  8966. * _.unionBy([2.1], [1.2, 2.3], Math.floor);
  8967. * // => [2.1, 1.2]
  8968. *
  8969. * // The `_.property` iteratee shorthand.
  8970. * _.unionBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x');
  8971. * // => [{ 'x': 1 }, { 'x': 2 }]
  8972. */
  8973. var unionBy = baseRest(function(arrays) {
  8974. var iteratee = last(arrays);
  8975. if (isArrayLikeObject(iteratee)) {
  8976. iteratee = undefined;
  8977. }
  8978. return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true), getIteratee(iteratee, 2));
  8979. });
  8980. /**
  8981. * This method is like `_.union` except that it accepts `comparator` which
  8982. * is invoked to compare elements of `arrays`. Result values are chosen from
  8983. * the first array in which the value occurs. The comparator is invoked
  8984. * with two arguments: (arrVal, othVal).
  8985. *
  8986. * @static
  8987. * @memberOf _
  8988. * @since 4.0.0
  8989. * @category Array
  8990. * @param {...Array} [arrays] The arrays to inspect.
  8991. * @param {Function} [comparator] The comparator invoked per element.
  8992. * @returns {Array} Returns the new array of combined values.
  8993. * @example
  8994. *
  8995. * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }];
  8996. * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }];
  8997. *
  8998. * _.unionWith(objects, others, _.isEqual);
  8999. * // => [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }, { 'x': 1, 'y': 1 }]
  9000. */
  9001. var unionWith = baseRest(function(arrays) {
  9002. var comparator = last(arrays);
  9003. comparator = typeof comparator == 'function' ? comparator : undefined;
  9004. return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true), undefined, comparator);
  9005. });
  9006. /**
  9007. * Creates a duplicate-free version of an array, using
  9008. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  9009. * for equality comparisons, in which only the first occurrence of each element
  9010. * is kept. The order of result values is determined by the order they occur
  9011. * in the array.
  9012. *
  9013. * @static
  9014. * @memberOf _
  9015. * @since 0.1.0
  9016. * @category Array
  9017. * @param {Array} array The array to inspect.
  9018. * @returns {Array} Returns the new duplicate free array.
  9019. * @example
  9020. *
  9021. * _.uniq([2, 1, 2]);
  9022. * // => [2, 1]
  9023. */
  9024. function uniq(array) {
  9025. return (array && array.length) ? baseUniq(array) : [];
  9026. }
  9027. /**
  9028. * This method is like `_.uniq` except that it accepts `iteratee` which is
  9029. * invoked for each element in `array` to generate the criterion by which
  9030. * uniqueness is computed. The order of result values is determined by the
  9031. * order they occur in the array. The iteratee is invoked with one argument:
  9032. * (value).
  9033. *
  9034. * @static
  9035. * @memberOf _
  9036. * @since 4.0.0
  9037. * @category Array
  9038. * @param {Array} array The array to inspect.
  9039. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  9040. * @returns {Array} Returns the new duplicate free array.
  9041. * @example
  9042. *
  9043. * _.uniqBy([2.1, 1.2, 2.3], Math.floor);
  9044. * // => [2.1, 1.2]
  9045. *
  9046. * // The `_.property` iteratee shorthand.
  9047. * _.uniqBy([{ 'x': 1 }, { 'x': 2 }, { 'x': 1 }], 'x');
  9048. * // => [{ 'x': 1 }, { 'x': 2 }]
  9049. */
  9050. function uniqBy(array, iteratee) {
  9051. return (array && array.length) ? baseUniq(array, getIteratee(iteratee, 2)) : [];
  9052. }
  9053. /**
  9054. * This method is like `_.uniq` except that it accepts `comparator` which
  9055. * is invoked to compare elements of `array`. The order of result values is
  9056. * determined by the order they occur in the array.The comparator is invoked
  9057. * with two arguments: (arrVal, othVal).
  9058. *
  9059. * @static
  9060. * @memberOf _
  9061. * @since 4.0.0
  9062. * @category Array
  9063. * @param {Array} array The array to inspect.
  9064. * @param {Function} [comparator] The comparator invoked per element.
  9065. * @returns {Array} Returns the new duplicate free array.
  9066. * @example
  9067. *
  9068. * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }, { 'x': 1, 'y': 2 }];
  9069. *
  9070. * _.uniqWith(objects, _.isEqual);
  9071. * // => [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }]
  9072. */
  9073. function uniqWith(array, comparator) {
  9074. comparator = typeof comparator == 'function' ? comparator : undefined;
  9075. return (array && array.length) ? baseUniq(array, undefined, comparator) : [];
  9076. }
  9077. /**
  9078. * This method is like `_.zip` except that it accepts an array of grouped
  9079. * elements and creates an array regrouping the elements to their pre-zip
  9080. * configuration.
  9081. *
  9082. * @static
  9083. * @memberOf _
  9084. * @since 1.2.0
  9085. * @category Array
  9086. * @param {Array} array The array of grouped elements to process.
  9087. * @returns {Array} Returns the new array of regrouped elements.
  9088. * @example
  9089. *
  9090. * var zipped = _.zip(['a', 'b'], [1, 2], [true, false]);
  9091. * // => [['a', 1, true], ['b', 2, false]]
  9092. *
  9093. * _.unzip(zipped);
  9094. * // => [['a', 'b'], [1, 2], [true, false]]
  9095. */
  9096. function unzip(array) {
  9097. if (!(array && array.length)) {
  9098. return [];
  9099. }
  9100. var length = 0;
  9101. array = arrayFilter(array, function(group) {
  9102. if (isArrayLikeObject(group)) {
  9103. length = nativeMax(group.length, length);
  9104. return true;
  9105. }
  9106. });
  9107. return baseTimes(length, function(index) {
  9108. return arrayMap(array, baseProperty(index));
  9109. });
  9110. }
  9111. /**
  9112. * This method is like `_.unzip` except that it accepts `iteratee` to specify
  9113. * how regrouped values should be combined. The iteratee is invoked with the
  9114. * elements of each group: (...group).
  9115. *
  9116. * @static
  9117. * @memberOf _
  9118. * @since 3.8.0
  9119. * @category Array
  9120. * @param {Array} array The array of grouped elements to process.
  9121. * @param {Function} [iteratee=_.identity] The function to combine
  9122. * regrouped values.
  9123. * @returns {Array} Returns the new array of regrouped elements.
  9124. * @example
  9125. *
  9126. * var zipped = _.zip([1, 2], [10, 20], [100, 200]);
  9127. * // => [[1, 10, 100], [2, 20, 200]]
  9128. *
  9129. * _.unzipWith(zipped, _.add);
  9130. * // => [3, 30, 300]
  9131. */
  9132. function unzipWith(array, iteratee) {
  9133. if (!(array && array.length)) {
  9134. return [];
  9135. }
  9136. var result = unzip(array);
  9137. if (iteratee == null) {
  9138. return result;
  9139. }
  9140. return arrayMap(result, function(group) {
  9141. return apply(iteratee, undefined, group);
  9142. });
  9143. }
  9144. /**
  9145. * Creates an array excluding all given values using
  9146. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  9147. * for equality comparisons.
  9148. *
  9149. * **Note:** Unlike `_.pull`, this method returns a new array.
  9150. *
  9151. * @static
  9152. * @memberOf _
  9153. * @since 0.1.0
  9154. * @category Array
  9155. * @param {Array} array The array to inspect.
  9156. * @param {...*} [values] The values to exclude.
  9157. * @returns {Array} Returns the new array of filtered values.
  9158. * @see _.difference, _.xor
  9159. * @example
  9160. *
  9161. * _.without([2, 1, 2, 3], 1, 2);
  9162. * // => [3]
  9163. */
  9164. var without = baseRest(function(array, values) {
  9165. return isArrayLikeObject(array)
  9166. ? baseDifference(array, values)
  9167. : [];
  9168. });
  9169. /**
  9170. * Creates an array of unique values that is the
  9171. * [symmetric difference](https://en.wikipedia.org/wiki/Symmetric_difference)
  9172. * of the given arrays. The order of result values is determined by the order
  9173. * they occur in the arrays.
  9174. *
  9175. * @static
  9176. * @memberOf _
  9177. * @since 2.4.0
  9178. * @category Array
  9179. * @param {...Array} [arrays] The arrays to inspect.
  9180. * @returns {Array} Returns the new array of filtered values.
  9181. * @see _.difference, _.without
  9182. * @example
  9183. *
  9184. * _.xor([2, 1], [2, 3]);
  9185. * // => [1, 3]
  9186. */
  9187. var xor = baseRest(function(arrays) {
  9188. return baseXor(arrayFilter(arrays, isArrayLikeObject));
  9189. });
  9190. /**
  9191. * This method is like `_.xor` except that it accepts `iteratee` which is
  9192. * invoked for each element of each `arrays` to generate the criterion by
  9193. * which by which they're compared. The order of result values is determined
  9194. * by the order they occur in the arrays. The iteratee is invoked with one
  9195. * argument: (value).
  9196. *
  9197. * @static
  9198. * @memberOf _
  9199. * @since 4.0.0
  9200. * @category Array
  9201. * @param {...Array} [arrays] The arrays to inspect.
  9202. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  9203. * @returns {Array} Returns the new array of filtered values.
  9204. * @example
  9205. *
  9206. * _.xorBy([2.1, 1.2], [2.3, 3.4], Math.floor);
  9207. * // => [1.2, 3.4]
  9208. *
  9209. * // The `_.property` iteratee shorthand.
  9210. * _.xorBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x');
  9211. * // => [{ 'x': 2 }]
  9212. */
  9213. var xorBy = baseRest(function(arrays) {
  9214. var iteratee = last(arrays);
  9215. if (isArrayLikeObject(iteratee)) {
  9216. iteratee = undefined;
  9217. }
  9218. return baseXor(arrayFilter(arrays, isArrayLikeObject), getIteratee(iteratee, 2));
  9219. });
  9220. /**
  9221. * This method is like `_.xor` except that it accepts `comparator` which is
  9222. * invoked to compare elements of `arrays`. The order of result values is
  9223. * determined by the order they occur in the arrays. The comparator is invoked
  9224. * with two arguments: (arrVal, othVal).
  9225. *
  9226. * @static
  9227. * @memberOf _
  9228. * @since 4.0.0
  9229. * @category Array
  9230. * @param {...Array} [arrays] The arrays to inspect.
  9231. * @param {Function} [comparator] The comparator invoked per element.
  9232. * @returns {Array} Returns the new array of filtered values.
  9233. * @example
  9234. *
  9235. * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }];
  9236. * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }];
  9237. *
  9238. * _.xorWith(objects, others, _.isEqual);
  9239. * // => [{ 'x': 2, 'y': 1 }, { 'x': 1, 'y': 1 }]
  9240. */
  9241. var xorWith = baseRest(function(arrays) {
  9242. var comparator = last(arrays);
  9243. comparator = typeof comparator == 'function' ? comparator : undefined;
  9244. return baseXor(arrayFilter(arrays, isArrayLikeObject), undefined, comparator);
  9245. });
  9246. /**
  9247. * Creates an array of grouped elements, the first of which contains the
  9248. * first elements of the given arrays, the second of which contains the
  9249. * second elements of the given arrays, and so on.
  9250. *
  9251. * @static
  9252. * @memberOf _
  9253. * @since 0.1.0
  9254. * @category Array
  9255. * @param {...Array} [arrays] The arrays to process.
  9256. * @returns {Array} Returns the new array of grouped elements.
  9257. * @example
  9258. *
  9259. * _.zip(['a', 'b'], [1, 2], [true, false]);
  9260. * // => [['a', 1, true], ['b', 2, false]]
  9261. */
  9262. var zip = baseRest(unzip);
  9263. /**
  9264. * This method is like `_.fromPairs` except that it accepts two arrays,
  9265. * one of property identifiers and one of corresponding values.
  9266. *
  9267. * @static
  9268. * @memberOf _
  9269. * @since 0.4.0
  9270. * @category Array
  9271. * @param {Array} [props=[]] The property identifiers.
  9272. * @param {Array} [values=[]] The property values.
  9273. * @returns {Object} Returns the new object.
  9274. * @example
  9275. *
  9276. * _.zipObject(['a', 'b'], [1, 2]);
  9277. * // => { 'a': 1, 'b': 2 }
  9278. */
  9279. function zipObject(props, values) {
  9280. return baseZipObject(props || [], values || [], assignValue);
  9281. }
  9282. /**
  9283. * This method is like `_.zipObject` except that it supports property paths.
  9284. *
  9285. * @static
  9286. * @memberOf _
  9287. * @since 4.1.0
  9288. * @category Array
  9289. * @param {Array} [props=[]] The property identifiers.
  9290. * @param {Array} [values=[]] The property values.
  9291. * @returns {Object} Returns the new object.
  9292. * @example
  9293. *
  9294. * _.zipObjectDeep(['a.b[0].c', 'a.b[1].d'], [1, 2]);
  9295. * // => { 'a': { 'b': [{ 'c': 1 }, { 'd': 2 }] } }
  9296. */
  9297. function zipObjectDeep(props, values) {
  9298. return baseZipObject(props || [], values || [], baseSet);
  9299. }
  9300. /**
  9301. * This method is like `_.zip` except that it accepts `iteratee` to specify
  9302. * how grouped values should be combined. The iteratee is invoked with the
  9303. * elements of each group: (...group).
  9304. *
  9305. * @static
  9306. * @memberOf _
  9307. * @since 3.8.0
  9308. * @category Array
  9309. * @param {...Array} [arrays] The arrays to process.
  9310. * @param {Function} [iteratee=_.identity] The function to combine
  9311. * grouped values.
  9312. * @returns {Array} Returns the new array of grouped elements.
  9313. * @example
  9314. *
  9315. * _.zipWith([1, 2], [10, 20], [100, 200], function(a, b, c) {
  9316. * return a + b + c;
  9317. * });
  9318. * // => [111, 222]
  9319. */
  9320. var zipWith = baseRest(function(arrays) {
  9321. var length = arrays.length,
  9322. iteratee = length > 1 ? arrays[length - 1] : undefined;
  9323. iteratee = typeof iteratee == 'function' ? (arrays.pop(), iteratee) : undefined;
  9324. return unzipWith(arrays, iteratee);
  9325. });
  9326. /*------------------------------------------------------------------------*/
  9327. /**
  9328. * Creates a `lodash` wrapper instance that wraps `value` with explicit method
  9329. * chain sequences enabled. The result of such sequences must be unwrapped
  9330. * with `_#value`.
  9331. *
  9332. * @static
  9333. * @memberOf _
  9334. * @since 1.3.0
  9335. * @category Seq
  9336. * @param {*} value The value to wrap.
  9337. * @returns {Object} Returns the new `lodash` wrapper instance.
  9338. * @example
  9339. *
  9340. * var users = [
  9341. * { 'user': 'barney', 'age': 36 },
  9342. * { 'user': 'fred', 'age': 40 },
  9343. * { 'user': 'pebbles', 'age': 1 }
  9344. * ];
  9345. *
  9346. * var youngest = _
  9347. * .chain(users)
  9348. * .sortBy('age')
  9349. * .map(function(o) {
  9350. * return o.user + ' is ' + o.age;
  9351. * })
  9352. * .head()
  9353. * .value();
  9354. * // => 'pebbles is 1'
  9355. */
  9356. function chain(value) {
  9357. var result = lodash(value);
  9358. result.__chain__ = true;
  9359. return result;
  9360. }
  9361. /**
  9362. * This method invokes `interceptor` and returns `value`. The interceptor
  9363. * is invoked with one argument; (value). The purpose of this method is to
  9364. * "tap into" a method chain sequence in order to modify intermediate results.
  9365. *
  9366. * @static
  9367. * @memberOf _
  9368. * @since 0.1.0
  9369. * @category Seq
  9370. * @param {*} value The value to provide to `interceptor`.
  9371. * @param {Function} interceptor The function to invoke.
  9372. * @returns {*} Returns `value`.
  9373. * @example
  9374. *
  9375. * _([1, 2, 3])
  9376. * .tap(function(array) {
  9377. * // Mutate input array.
  9378. * array.pop();
  9379. * })
  9380. * .reverse()
  9381. * .value();
  9382. * // => [2, 1]
  9383. */
  9384. function tap(value, interceptor) {
  9385. interceptor(value);
  9386. return value;
  9387. }
  9388. /**
  9389. * This method is like `_.tap` except that it returns the result of `interceptor`.
  9390. * The purpose of this method is to "pass thru" values replacing intermediate
  9391. * results in a method chain sequence.
  9392. *
  9393. * @static
  9394. * @memberOf _
  9395. * @since 3.0.0
  9396. * @category Seq
  9397. * @param {*} value The value to provide to `interceptor`.
  9398. * @param {Function} interceptor The function to invoke.
  9399. * @returns {*} Returns the result of `interceptor`.
  9400. * @example
  9401. *
  9402. * _(' abc ')
  9403. * .chain()
  9404. * .trim()
  9405. * .thru(function(value) {
  9406. * return [value];
  9407. * })
  9408. * .value();
  9409. * // => ['abc']
  9410. */
  9411. function thru(value, interceptor) {
  9412. return interceptor(value);
  9413. }
  9414. /**
  9415. * This method is the wrapper version of `_.at`.
  9416. *
  9417. * @name at
  9418. * @memberOf _
  9419. * @since 1.0.0
  9420. * @category Seq
  9421. * @param {...(string|string[])} [paths] The property paths to pick.
  9422. * @returns {Object} Returns the new `lodash` wrapper instance.
  9423. * @example
  9424. *
  9425. * var object = { 'a': [{ 'b': { 'c': 3 } }, 4] };
  9426. *
  9427. * _(object).at(['a[0].b.c', 'a[1]']).value();
  9428. * // => [3, 4]
  9429. */
  9430. var wrapperAt = flatRest(function(paths) {
  9431. var length = paths.length,
  9432. start = length ? paths[0] : 0,
  9433. value = this.__wrapped__,
  9434. interceptor = function(object) { return baseAt(object, paths); };
  9435. if (length > 1 || this.__actions__.length ||
  9436. !(value instanceof LazyWrapper) || !isIndex(start)) {
  9437. return this.thru(interceptor);
  9438. }
  9439. value = value.slice(start, +start + (length ? 1 : 0));
  9440. value.__actions__.push({
  9441. 'func': thru,
  9442. 'args': [interceptor],
  9443. 'thisArg': undefined
  9444. });
  9445. return new LodashWrapper(value, this.__chain__).thru(function(array) {
  9446. if (length && !array.length) {
  9447. array.push(undefined);
  9448. }
  9449. return array;
  9450. });
  9451. });
  9452. /**
  9453. * Creates a `lodash` wrapper instance with explicit method chain sequences enabled.
  9454. *
  9455. * @name chain
  9456. * @memberOf _
  9457. * @since 0.1.0
  9458. * @category Seq
  9459. * @returns {Object} Returns the new `lodash` wrapper instance.
  9460. * @example
  9461. *
  9462. * var users = [
  9463. * { 'user': 'barney', 'age': 36 },
  9464. * { 'user': 'fred', 'age': 40 }
  9465. * ];
  9466. *
  9467. * // A sequence without explicit chaining.
  9468. * _(users).head();
  9469. * // => { 'user': 'barney', 'age': 36 }
  9470. *
  9471. * // A sequence with explicit chaining.
  9472. * _(users)
  9473. * .chain()
  9474. * .head()
  9475. * .pick('user')
  9476. * .value();
  9477. * // => { 'user': 'barney' }
  9478. */
  9479. function wrapperChain() {
  9480. return chain(this);
  9481. }
  9482. /**
  9483. * Executes the chain sequence and returns the wrapped result.
  9484. *
  9485. * @name commit
  9486. * @memberOf _
  9487. * @since 3.2.0
  9488. * @category Seq
  9489. * @returns {Object} Returns the new `lodash` wrapper instance.
  9490. * @example
  9491. *
  9492. * var array = [1, 2];
  9493. * var wrapped = _(array).push(3);
  9494. *
  9495. * console.log(array);
  9496. * // => [1, 2]
  9497. *
  9498. * wrapped = wrapped.commit();
  9499. * console.log(array);
  9500. * // => [1, 2, 3]
  9501. *
  9502. * wrapped.last();
  9503. * // => 3
  9504. *
  9505. * console.log(array);
  9506. * // => [1, 2, 3]
  9507. */
  9508. function wrapperCommit() {
  9509. return new LodashWrapper(this.value(), this.__chain__);
  9510. }
  9511. /**
  9512. * Gets the next value on a wrapped object following the
  9513. * [iterator protocol](https://mdn.io/iteration_protocols#iterator).
  9514. *
  9515. * @name next
  9516. * @memberOf _
  9517. * @since 4.0.0
  9518. * @category Seq
  9519. * @returns {Object} Returns the next iterator value.
  9520. * @example
  9521. *
  9522. * var wrapped = _([1, 2]);
  9523. *
  9524. * wrapped.next();
  9525. * // => { 'done': false, 'value': 1 }
  9526. *
  9527. * wrapped.next();
  9528. * // => { 'done': false, 'value': 2 }
  9529. *
  9530. * wrapped.next();
  9531. * // => { 'done': true, 'value': undefined }
  9532. */
  9533. function wrapperNext() {
  9534. if (this.__values__ === undefined) {
  9535. this.__values__ = toArray(this.value());
  9536. }
  9537. var done = this.__index__ >= this.__values__.length,
  9538. value = done ? undefined : this.__values__[this.__index__++];
  9539. return { 'done': done, 'value': value };
  9540. }
  9541. /**
  9542. * Enables the wrapper to be iterable.
  9543. *
  9544. * @name Symbol.iterator
  9545. * @memberOf _
  9546. * @since 4.0.0
  9547. * @category Seq
  9548. * @returns {Object} Returns the wrapper object.
  9549. * @example
  9550. *
  9551. * var wrapped = _([1, 2]);
  9552. *
  9553. * wrapped[Symbol.iterator]() === wrapped;
  9554. * // => true
  9555. *
  9556. * Array.from(wrapped);
  9557. * // => [1, 2]
  9558. */
  9559. function wrapperToIterator() {
  9560. return this;
  9561. }
  9562. /**
  9563. * Creates a clone of the chain sequence planting `value` as the wrapped value.
  9564. *
  9565. * @name plant
  9566. * @memberOf _
  9567. * @since 3.2.0
  9568. * @category Seq
  9569. * @param {*} value The value to plant.
  9570. * @returns {Object} Returns the new `lodash` wrapper instance.
  9571. * @example
  9572. *
  9573. * function square(n) {
  9574. * return n * n;
  9575. * }
  9576. *
  9577. * var wrapped = _([1, 2]).map(square);
  9578. * var other = wrapped.plant([3, 4]);
  9579. *
  9580. * other.value();
  9581. * // => [9, 16]
  9582. *
  9583. * wrapped.value();
  9584. * // => [1, 4]
  9585. */
  9586. function wrapperPlant(value) {
  9587. var result,
  9588. parent = this;
  9589. while (parent instanceof baseLodash) {
  9590. var clone = wrapperClone(parent);
  9591. clone.__index__ = 0;
  9592. clone.__values__ = undefined;
  9593. if (result) {
  9594. previous.__wrapped__ = clone;
  9595. } else {
  9596. result = clone;
  9597. }
  9598. var previous = clone;
  9599. parent = parent.__wrapped__;
  9600. }
  9601. previous.__wrapped__ = value;
  9602. return result;
  9603. }
  9604. /**
  9605. * This method is the wrapper version of `_.reverse`.
  9606. *
  9607. * **Note:** This method mutates the wrapped array.
  9608. *
  9609. * @name reverse
  9610. * @memberOf _
  9611. * @since 0.1.0
  9612. * @category Seq
  9613. * @returns {Object} Returns the new `lodash` wrapper instance.
  9614. * @example
  9615. *
  9616. * var array = [1, 2, 3];
  9617. *
  9618. * _(array).reverse().value()
  9619. * // => [3, 2, 1]
  9620. *
  9621. * console.log(array);
  9622. * // => [3, 2, 1]
  9623. */
  9624. function wrapperReverse() {
  9625. var value = this.__wrapped__;
  9626. if (value instanceof LazyWrapper) {
  9627. var wrapped = value;
  9628. if (this.__actions__.length) {
  9629. wrapped = new LazyWrapper(this);
  9630. }
  9631. wrapped = wrapped.reverse();
  9632. wrapped.__actions__.push({
  9633. 'func': thru,
  9634. 'args': [reverse],
  9635. 'thisArg': undefined
  9636. });
  9637. return new LodashWrapper(wrapped, this.__chain__);
  9638. }
  9639. return this.thru(reverse);
  9640. }
  9641. /**
  9642. * Executes the chain sequence to resolve the unwrapped value.
  9643. *
  9644. * @name value
  9645. * @memberOf _
  9646. * @since 0.1.0
  9647. * @alias toJSON, valueOf
  9648. * @category Seq
  9649. * @returns {*} Returns the resolved unwrapped value.
  9650. * @example
  9651. *
  9652. * _([1, 2, 3]).value();
  9653. * // => [1, 2, 3]
  9654. */
  9655. function wrapperValue() {
  9656. return baseWrapperValue(this.__wrapped__, this.__actions__);
  9657. }
  9658. /*------------------------------------------------------------------------*/
  9659. /**
  9660. * Creates an object composed of keys generated from the results of running
  9661. * each element of `collection` thru `iteratee`. The corresponding value of
  9662. * each key is the number of times the key was returned by `iteratee`. The
  9663. * iteratee is invoked with one argument: (value).
  9664. *
  9665. * @static
  9666. * @memberOf _
  9667. * @since 0.5.0
  9668. * @category Collection
  9669. * @param {Array|Object} collection The collection to iterate over.
  9670. * @param {Function} [iteratee=_.identity] The iteratee to transform keys.
  9671. * @returns {Object} Returns the composed aggregate object.
  9672. * @example
  9673. *
  9674. * _.countBy([6.1, 4.2, 6.3], Math.floor);
  9675. * // => { '4': 1, '6': 2 }
  9676. *
  9677. * // The `_.property` iteratee shorthand.
  9678. * _.countBy(['one', 'two', 'three'], 'length');
  9679. * // => { '3': 2, '5': 1 }
  9680. */
  9681. var countBy = createAggregator(function(result, value, key) {
  9682. if (hasOwnProperty.call(result, key)) {
  9683. ++result[key];
  9684. } else {
  9685. baseAssignValue(result, key, 1);
  9686. }
  9687. });
  9688. /**
  9689. * Checks if `predicate` returns truthy for **all** elements of `collection`.
  9690. * Iteration is stopped once `predicate` returns falsey. The predicate is
  9691. * invoked with three arguments: (value, index|key, collection).
  9692. *
  9693. * **Note:** This method returns `true` for
  9694. * [empty collections](https://en.wikipedia.org/wiki/Empty_set) because
  9695. * [everything is true](https://en.wikipedia.org/wiki/Vacuous_truth) of
  9696. * elements of empty collections.
  9697. *
  9698. * @static
  9699. * @memberOf _
  9700. * @since 0.1.0
  9701. * @category Collection
  9702. * @param {Array|Object} collection The collection to iterate over.
  9703. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  9704. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  9705. * @returns {boolean} Returns `true` if all elements pass the predicate check,
  9706. * else `false`.
  9707. * @example
  9708. *
  9709. * _.every([true, 1, null, 'yes'], Boolean);
  9710. * // => false
  9711. *
  9712. * var users = [
  9713. * { 'user': 'barney', 'age': 36, 'active': false },
  9714. * { 'user': 'fred', 'age': 40, 'active': false }
  9715. * ];
  9716. *
  9717. * // The `_.matches` iteratee shorthand.
  9718. * _.every(users, { 'user': 'barney', 'active': false });
  9719. * // => false
  9720. *
  9721. * // The `_.matchesProperty` iteratee shorthand.
  9722. * _.every(users, ['active', false]);
  9723. * // => true
  9724. *
  9725. * // The `_.property` iteratee shorthand.
  9726. * _.every(users, 'active');
  9727. * // => false
  9728. */
  9729. function every(collection, predicate, guard) {
  9730. var func = isArray(collection) ? arrayEvery : baseEvery;
  9731. if (guard && isIterateeCall(collection, predicate, guard)) {
  9732. predicate = undefined;
  9733. }
  9734. return func(collection, getIteratee(predicate, 3));
  9735. }
  9736. /**
  9737. * Iterates over elements of `collection`, returning an array of all elements
  9738. * `predicate` returns truthy for. The predicate is invoked with three
  9739. * arguments: (value, index|key, collection).
  9740. *
  9741. * **Note:** Unlike `_.remove`, this method returns a new array.
  9742. *
  9743. * @static
  9744. * @memberOf _
  9745. * @since 0.1.0
  9746. * @category Collection
  9747. * @param {Array|Object} collection The collection to iterate over.
  9748. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  9749. * @returns {Array} Returns the new filtered array.
  9750. * @see _.reject
  9751. * @example
  9752. *
  9753. * var users = [
  9754. * { 'user': 'barney', 'age': 36, 'active': true },
  9755. * { 'user': 'fred', 'age': 40, 'active': false }
  9756. * ];
  9757. *
  9758. * _.filter(users, function(o) { return !o.active; });
  9759. * // => objects for ['fred']
  9760. *
  9761. * // The `_.matches` iteratee shorthand.
  9762. * _.filter(users, { 'age': 36, 'active': true });
  9763. * // => objects for ['barney']
  9764. *
  9765. * // The `_.matchesProperty` iteratee shorthand.
  9766. * _.filter(users, ['active', false]);
  9767. * // => objects for ['fred']
  9768. *
  9769. * // The `_.property` iteratee shorthand.
  9770. * _.filter(users, 'active');
  9771. * // => objects for ['barney']
  9772. *
  9773. * // Combining several predicates using `_.overEvery` or `_.overSome`.
  9774. * _.filter(users, _.overSome([{ 'age': 36 }, ['age', 40]]));
  9775. * // => objects for ['fred', 'barney']
  9776. */
  9777. function filter(collection, predicate) {
  9778. var func = isArray(collection) ? arrayFilter : baseFilter;
  9779. return func(collection, getIteratee(predicate, 3));
  9780. }
  9781. /**
  9782. * Iterates over elements of `collection`, returning the first element
  9783. * `predicate` returns truthy for. The predicate is invoked with three
  9784. * arguments: (value, index|key, collection).
  9785. *
  9786. * @static
  9787. * @memberOf _
  9788. * @since 0.1.0
  9789. * @category Collection
  9790. * @param {Array|Object} collection The collection to inspect.
  9791. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  9792. * @param {number} [fromIndex=0] The index to search from.
  9793. * @returns {*} Returns the matched element, else `undefined`.
  9794. * @example
  9795. *
  9796. * var users = [
  9797. * { 'user': 'barney', 'age': 36, 'active': true },
  9798. * { 'user': 'fred', 'age': 40, 'active': false },
  9799. * { 'user': 'pebbles', 'age': 1, 'active': true }
  9800. * ];
  9801. *
  9802. * _.find(users, function(o) { return o.age < 40; });
  9803. * // => object for 'barney'
  9804. *
  9805. * // The `_.matches` iteratee shorthand.
  9806. * _.find(users, { 'age': 1, 'active': true });
  9807. * // => object for 'pebbles'
  9808. *
  9809. * // The `_.matchesProperty` iteratee shorthand.
  9810. * _.find(users, ['active', false]);
  9811. * // => object for 'fred'
  9812. *
  9813. * // The `_.property` iteratee shorthand.
  9814. * _.find(users, 'active');
  9815. * // => object for 'barney'
  9816. */
  9817. var find = createFind(findIndex);
  9818. /**
  9819. * This method is like `_.find` except that it iterates over elements of
  9820. * `collection` from right to left.
  9821. *
  9822. * @static
  9823. * @memberOf _
  9824. * @since 2.0.0
  9825. * @category Collection
  9826. * @param {Array|Object} collection The collection to inspect.
  9827. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  9828. * @param {number} [fromIndex=collection.length-1] The index to search from.
  9829. * @returns {*} Returns the matched element, else `undefined`.
  9830. * @example
  9831. *
  9832. * _.findLast([1, 2, 3, 4], function(n) {
  9833. * return n % 2 == 1;
  9834. * });
  9835. * // => 3
  9836. */
  9837. var findLast = createFind(findLastIndex);
  9838. /**
  9839. * Creates a flattened array of values by running each element in `collection`
  9840. * thru `iteratee` and flattening the mapped results. The iteratee is invoked
  9841. * with three arguments: (value, index|key, collection).
  9842. *
  9843. * @static
  9844. * @memberOf _
  9845. * @since 4.0.0
  9846. * @category Collection
  9847. * @param {Array|Object} collection The collection to iterate over.
  9848. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  9849. * @returns {Array} Returns the new flattened array.
  9850. * @example
  9851. *
  9852. * function duplicate(n) {
  9853. * return [n, n];
  9854. * }
  9855. *
  9856. * _.flatMap([1, 2], duplicate);
  9857. * // => [1, 1, 2, 2]
  9858. */
  9859. function flatMap(collection, iteratee) {
  9860. return baseFlatten(map(collection, iteratee), 1);
  9861. }
  9862. /**
  9863. * This method is like `_.flatMap` except that it recursively flattens the
  9864. * mapped results.
  9865. *
  9866. * @static
  9867. * @memberOf _
  9868. * @since 4.7.0
  9869. * @category Collection
  9870. * @param {Array|Object} collection The collection to iterate over.
  9871. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  9872. * @returns {Array} Returns the new flattened array.
  9873. * @example
  9874. *
  9875. * function duplicate(n) {
  9876. * return [[[n, n]]];
  9877. * }
  9878. *
  9879. * _.flatMapDeep([1, 2], duplicate);
  9880. * // => [1, 1, 2, 2]
  9881. */
  9882. function flatMapDeep(collection, iteratee) {
  9883. return baseFlatten(map(collection, iteratee), INFINITY);
  9884. }
  9885. /**
  9886. * This method is like `_.flatMap` except that it recursively flattens the
  9887. * mapped results up to `depth` times.
  9888. *
  9889. * @static
  9890. * @memberOf _
  9891. * @since 4.7.0
  9892. * @category Collection
  9893. * @param {Array|Object} collection The collection to iterate over.
  9894. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  9895. * @param {number} [depth=1] The maximum recursion depth.
  9896. * @returns {Array} Returns the new flattened array.
  9897. * @example
  9898. *
  9899. * function duplicate(n) {
  9900. * return [[[n, n]]];
  9901. * }
  9902. *
  9903. * _.flatMapDepth([1, 2], duplicate, 2);
  9904. * // => [[1, 1], [2, 2]]
  9905. */
  9906. function flatMapDepth(collection, iteratee, depth) {
  9907. depth = depth === undefined ? 1 : toInteger(depth);
  9908. return baseFlatten(map(collection, iteratee), depth);
  9909. }
  9910. /**
  9911. * Iterates over elements of `collection` and invokes `iteratee` for each element.
  9912. * The iteratee is invoked with three arguments: (value, index|key, collection).
  9913. * Iteratee functions may exit iteration early by explicitly returning `false`.
  9914. *
  9915. * **Note:** As with other "Collections" methods, objects with a "length"
  9916. * property are iterated like arrays. To avoid this behavior use `_.forIn`
  9917. * or `_.forOwn` for object iteration.
  9918. *
  9919. * @static
  9920. * @memberOf _
  9921. * @since 0.1.0
  9922. * @alias each
  9923. * @category Collection
  9924. * @param {Array|Object} collection The collection to iterate over.
  9925. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  9926. * @returns {Array|Object} Returns `collection`.
  9927. * @see _.forEachRight
  9928. * @example
  9929. *
  9930. * _.forEach([1, 2], function(value) {
  9931. * console.log(value);
  9932. * });
  9933. * // => Logs `1` then `2`.
  9934. *
  9935. * _.forEach({ 'a': 1, 'b': 2 }, function(value, key) {
  9936. * console.log(key);
  9937. * });
  9938. * // => Logs 'a' then 'b' (iteration order is not guaranteed).
  9939. */
  9940. function forEach(collection, iteratee) {
  9941. var func = isArray(collection) ? arrayEach : baseEach;
  9942. return func(collection, getIteratee(iteratee, 3));
  9943. }
  9944. /**
  9945. * This method is like `_.forEach` except that it iterates over elements of
  9946. * `collection` from right to left.
  9947. *
  9948. * @static
  9949. * @memberOf _
  9950. * @since 2.0.0
  9951. * @alias eachRight
  9952. * @category Collection
  9953. * @param {Array|Object} collection The collection to iterate over.
  9954. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  9955. * @returns {Array|Object} Returns `collection`.
  9956. * @see _.forEach
  9957. * @example
  9958. *
  9959. * _.forEachRight([1, 2], function(value) {
  9960. * console.log(value);
  9961. * });
  9962. * // => Logs `2` then `1`.
  9963. */
  9964. function forEachRight(collection, iteratee) {
  9965. var func = isArray(collection) ? arrayEachRight : baseEachRight;
  9966. return func(collection, getIteratee(iteratee, 3));
  9967. }
  9968. /**
  9969. * Creates an object composed of keys generated from the results of running
  9970. * each element of `collection` thru `iteratee`. The order of grouped values
  9971. * is determined by the order they occur in `collection`. The corresponding
  9972. * value of each key is an array of elements responsible for generating the
  9973. * key. The iteratee is invoked with one argument: (value).
  9974. *
  9975. * @static
  9976. * @memberOf _
  9977. * @since 0.1.0
  9978. * @category Collection
  9979. * @param {Array|Object} collection The collection to iterate over.
  9980. * @param {Function} [iteratee=_.identity] The iteratee to transform keys.
  9981. * @returns {Object} Returns the composed aggregate object.
  9982. * @example
  9983. *
  9984. * _.groupBy([6.1, 4.2, 6.3], Math.floor);
  9985. * // => { '4': [4.2], '6': [6.1, 6.3] }
  9986. *
  9987. * // The `_.property` iteratee shorthand.
  9988. * _.groupBy(['one', 'two', 'three'], 'length');
  9989. * // => { '3': ['one', 'two'], '5': ['three'] }
  9990. */
  9991. var groupBy = createAggregator(function(result, value, key) {
  9992. if (hasOwnProperty.call(result, key)) {
  9993. result[key].push(value);
  9994. } else {
  9995. baseAssignValue(result, key, [value]);
  9996. }
  9997. });
  9998. /**
  9999. * Checks if `value` is in `collection`. If `collection` is a string, it's
  10000. * checked for a substring of `value`, otherwise
  10001. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  10002. * is used for equality comparisons. If `fromIndex` is negative, it's used as
  10003. * the offset from the end of `collection`.
  10004. *
  10005. * @static
  10006. * @memberOf _
  10007. * @since 0.1.0
  10008. * @category Collection
  10009. * @param {Array|Object|string} collection The collection to inspect.
  10010. * @param {*} value The value to search for.
  10011. * @param {number} [fromIndex=0] The index to search from.
  10012. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.reduce`.
  10013. * @returns {boolean} Returns `true` if `value` is found, else `false`.
  10014. * @example
  10015. *
  10016. * _.includes([1, 2, 3], 1);
  10017. * // => true
  10018. *
  10019. * _.includes([1, 2, 3], 1, 2);
  10020. * // => false
  10021. *
  10022. * _.includes({ 'a': 1, 'b': 2 }, 1);
  10023. * // => true
  10024. *
  10025. * _.includes('abcd', 'bc');
  10026. * // => true
  10027. */
  10028. function includes(collection, value, fromIndex, guard) {
  10029. collection = isArrayLike(collection) ? collection : values(collection);
  10030. fromIndex = (fromIndex && !guard) ? toInteger(fromIndex) : 0;
  10031. var length = collection.length;
  10032. if (fromIndex < 0) {
  10033. fromIndex = nativeMax(length + fromIndex, 0);
  10034. }
  10035. return isString(collection)
  10036. ? (fromIndex <= length && collection.indexOf(value, fromIndex) > -1)
  10037. : (!!length && baseIndexOf(collection, value, fromIndex) > -1);
  10038. }
  10039. /**
  10040. * Invokes the method at `path` of each element in `collection`, returning
  10041. * an array of the results of each invoked method. Any additional arguments
  10042. * are provided to each invoked method. If `path` is a function, it's invoked
  10043. * for, and `this` bound to, each element in `collection`.
  10044. *
  10045. * @static
  10046. * @memberOf _
  10047. * @since 4.0.0
  10048. * @category Collection
  10049. * @param {Array|Object} collection The collection to iterate over.
  10050. * @param {Array|Function|string} path The path of the method to invoke or
  10051. * the function invoked per iteration.
  10052. * @param {...*} [args] The arguments to invoke each method with.
  10053. * @returns {Array} Returns the array of results.
  10054. * @example
  10055. *
  10056. * _.invokeMap([[5, 1, 7], [3, 2, 1]], 'sort');
  10057. * // => [[1, 5, 7], [1, 2, 3]]
  10058. *
  10059. * _.invokeMap([123, 456], String.prototype.split, '');
  10060. * // => [['1', '2', '3'], ['4', '5', '6']]
  10061. */
  10062. var invokeMap = baseRest(function(collection, path, args) {
  10063. var index = -1,
  10064. isFunc = typeof path == 'function',
  10065. result = isArrayLike(collection) ? Array(collection.length) : [];
  10066. baseEach(collection, function(value) {
  10067. result[++index] = isFunc ? apply(path, value, args) : baseInvoke(value, path, args);
  10068. });
  10069. return result;
  10070. });
  10071. /**
  10072. * Creates an object composed of keys generated from the results of running
  10073. * each element of `collection` thru `iteratee`. The corresponding value of
  10074. * each key is the last element responsible for generating the key. The
  10075. * iteratee is invoked with one argument: (value).
  10076. *
  10077. * @static
  10078. * @memberOf _
  10079. * @since 4.0.0
  10080. * @category Collection
  10081. * @param {Array|Object} collection The collection to iterate over.
  10082. * @param {Function} [iteratee=_.identity] The iteratee to transform keys.
  10083. * @returns {Object} Returns the composed aggregate object.
  10084. * @example
  10085. *
  10086. * var array = [
  10087. * { 'dir': 'left', 'code': 97 },
  10088. * { 'dir': 'right', 'code': 100 }
  10089. * ];
  10090. *
  10091. * _.keyBy(array, function(o) {
  10092. * return String.fromCharCode(o.code);
  10093. * });
  10094. * // => { 'a': { 'dir': 'left', 'code': 97 }, 'd': { 'dir': 'right', 'code': 100 } }
  10095. *
  10096. * _.keyBy(array, 'dir');
  10097. * // => { 'left': { 'dir': 'left', 'code': 97 }, 'right': { 'dir': 'right', 'code': 100 } }
  10098. */
  10099. var keyBy = createAggregator(function(result, value, key) {
  10100. baseAssignValue(result, key, value);
  10101. });
  10102. /**
  10103. * Creates an array of values by running each element in `collection` thru
  10104. * `iteratee`. The iteratee is invoked with three arguments:
  10105. * (value, index|key, collection).
  10106. *
  10107. * Many lodash methods are guarded to work as iteratees for methods like
  10108. * `_.every`, `_.filter`, `_.map`, `_.mapValues`, `_.reject`, and `_.some`.
  10109. *
  10110. * The guarded methods are:
  10111. * `ary`, `chunk`, `curry`, `curryRight`, `drop`, `dropRight`, `every`,
  10112. * `fill`, `invert`, `parseInt`, `random`, `range`, `rangeRight`, `repeat`,
  10113. * `sampleSize`, `slice`, `some`, `sortBy`, `split`, `take`, `takeRight`,
  10114. * `template`, `trim`, `trimEnd`, `trimStart`, and `words`
  10115. *
  10116. * @static
  10117. * @memberOf _
  10118. * @since 0.1.0
  10119. * @category Collection
  10120. * @param {Array|Object} collection The collection to iterate over.
  10121. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  10122. * @returns {Array} Returns the new mapped array.
  10123. * @example
  10124. *
  10125. * function square(n) {
  10126. * return n * n;
  10127. * }
  10128. *
  10129. * _.map([4, 8], square);
  10130. * // => [16, 64]
  10131. *
  10132. * _.map({ 'a': 4, 'b': 8 }, square);
  10133. * // => [16, 64] (iteration order is not guaranteed)
  10134. *
  10135. * var users = [
  10136. * { 'user': 'barney' },
  10137. * { 'user': 'fred' }
  10138. * ];
  10139. *
  10140. * // The `_.property` iteratee shorthand.
  10141. * _.map(users, 'user');
  10142. * // => ['barney', 'fred']
  10143. */
  10144. function map(collection, iteratee) {
  10145. var func = isArray(collection) ? arrayMap : baseMap;
  10146. return func(collection, getIteratee(iteratee, 3));
  10147. }
  10148. /**
  10149. * This method is like `_.sortBy` except that it allows specifying the sort
  10150. * orders of the iteratees to sort by. If `orders` is unspecified, all values
  10151. * are sorted in ascending order. Otherwise, specify an order of "desc" for
  10152. * descending or "asc" for ascending sort order of corresponding values.
  10153. *
  10154. * @static
  10155. * @memberOf _
  10156. * @since 4.0.0
  10157. * @category Collection
  10158. * @param {Array|Object} collection The collection to iterate over.
  10159. * @param {Array[]|Function[]|Object[]|string[]} [iteratees=[_.identity]]
  10160. * The iteratees to sort by.
  10161. * @param {string[]} [orders] The sort orders of `iteratees`.
  10162. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.reduce`.
  10163. * @returns {Array} Returns the new sorted array.
  10164. * @example
  10165. *
  10166. * var users = [
  10167. * { 'user': 'fred', 'age': 48 },
  10168. * { 'user': 'barney', 'age': 34 },
  10169. * { 'user': 'fred', 'age': 40 },
  10170. * { 'user': 'barney', 'age': 36 }
  10171. * ];
  10172. *
  10173. * // Sort by `user` in ascending order and by `age` in descending order.
  10174. * _.orderBy(users, ['user', 'age'], ['asc', 'desc']);
  10175. * // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 40]]
  10176. */
  10177. function orderBy(collection, iteratees, orders, guard) {
  10178. if (collection == null) {
  10179. return [];
  10180. }
  10181. if (!isArray(iteratees)) {
  10182. iteratees = iteratees == null ? [] : [iteratees];
  10183. }
  10184. orders = guard ? undefined : orders;
  10185. if (!isArray(orders)) {
  10186. orders = orders == null ? [] : [orders];
  10187. }
  10188. return baseOrderBy(collection, iteratees, orders);
  10189. }
  10190. /**
  10191. * Creates an array of elements split into two groups, the first of which
  10192. * contains elements `predicate` returns truthy for, the second of which
  10193. * contains elements `predicate` returns falsey for. The predicate is
  10194. * invoked with one argument: (value).
  10195. *
  10196. * @static
  10197. * @memberOf _
  10198. * @since 3.0.0
  10199. * @category Collection
  10200. * @param {Array|Object} collection The collection to iterate over.
  10201. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  10202. * @returns {Array} Returns the array of grouped elements.
  10203. * @example
  10204. *
  10205. * var users = [
  10206. * { 'user': 'barney', 'age': 36, 'active': false },
  10207. * { 'user': 'fred', 'age': 40, 'active': true },
  10208. * { 'user': 'pebbles', 'age': 1, 'active': false }
  10209. * ];
  10210. *
  10211. * _.partition(users, function(o) { return o.active; });
  10212. * // => objects for [['fred'], ['barney', 'pebbles']]
  10213. *
  10214. * // The `_.matches` iteratee shorthand.
  10215. * _.partition(users, { 'age': 1, 'active': false });
  10216. * // => objects for [['pebbles'], ['barney', 'fred']]
  10217. *
  10218. * // The `_.matchesProperty` iteratee shorthand.
  10219. * _.partition(users, ['active', false]);
  10220. * // => objects for [['barney', 'pebbles'], ['fred']]
  10221. *
  10222. * // The `_.property` iteratee shorthand.
  10223. * _.partition(users, 'active');
  10224. * // => objects for [['fred'], ['barney', 'pebbles']]
  10225. */
  10226. var partition = createAggregator(function(result, value, key) {
  10227. result[key ? 0 : 1].push(value);
  10228. }, function() { return [[], []]; });
  10229. /**
  10230. * Reduces `collection` to a value which is the accumulated result of running
  10231. * each element in `collection` thru `iteratee`, where each successive
  10232. * invocation is supplied the return value of the previous. If `accumulator`
  10233. * is not given, the first element of `collection` is used as the initial
  10234. * value. The iteratee is invoked with four arguments:
  10235. * (accumulator, value, index|key, collection).
  10236. *
  10237. * Many lodash methods are guarded to work as iteratees for methods like
  10238. * `_.reduce`, `_.reduceRight`, and `_.transform`.
  10239. *
  10240. * The guarded methods are:
  10241. * `assign`, `defaults`, `defaultsDeep`, `includes`, `merge`, `orderBy`,
  10242. * and `sortBy`
  10243. *
  10244. * @static
  10245. * @memberOf _
  10246. * @since 0.1.0
  10247. * @category Collection
  10248. * @param {Array|Object} collection The collection to iterate over.
  10249. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  10250. * @param {*} [accumulator] The initial value.
  10251. * @returns {*} Returns the accumulated value.
  10252. * @see _.reduceRight
  10253. * @example
  10254. *
  10255. * _.reduce([1, 2], function(sum, n) {
  10256. * return sum + n;
  10257. * }, 0);
  10258. * // => 3
  10259. *
  10260. * _.reduce({ 'a': 1, 'b': 2, 'c': 1 }, function(result, value, key) {
  10261. * (result[value] || (result[value] = [])).push(key);
  10262. * return result;
  10263. * }, {});
  10264. * // => { '1': ['a', 'c'], '2': ['b'] } (iteration order is not guaranteed)
  10265. */
  10266. function reduce(collection, iteratee, accumulator) {
  10267. var func = isArray(collection) ? arrayReduce : baseReduce,
  10268. initAccum = arguments.length < 3;
  10269. return func(collection, getIteratee(iteratee, 4), accumulator, initAccum, baseEach);
  10270. }
  10271. /**
  10272. * This method is like `_.reduce` except that it iterates over elements of
  10273. * `collection` from right to left.
  10274. *
  10275. * @static
  10276. * @memberOf _
  10277. * @since 0.1.0
  10278. * @category Collection
  10279. * @param {Array|Object} collection The collection to iterate over.
  10280. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  10281. * @param {*} [accumulator] The initial value.
  10282. * @returns {*} Returns the accumulated value.
  10283. * @see _.reduce
  10284. * @example
  10285. *
  10286. * var array = [[0, 1], [2, 3], [4, 5]];
  10287. *
  10288. * _.reduceRight(array, function(flattened, other) {
  10289. * return flattened.concat(other);
  10290. * }, []);
  10291. * // => [4, 5, 2, 3, 0, 1]
  10292. */
  10293. function reduceRight(collection, iteratee, accumulator) {
  10294. var func = isArray(collection) ? arrayReduceRight : baseReduce,
  10295. initAccum = arguments.length < 3;
  10296. return func(collection, getIteratee(iteratee, 4), accumulator, initAccum, baseEachRight);
  10297. }
  10298. /**
  10299. * The opposite of `_.filter`; this method returns the elements of `collection`
  10300. * that `predicate` does **not** return truthy for.
  10301. *
  10302. * @static
  10303. * @memberOf _
  10304. * @since 0.1.0
  10305. * @category Collection
  10306. * @param {Array|Object} collection The collection to iterate over.
  10307. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  10308. * @returns {Array} Returns the new filtered array.
  10309. * @see _.filter
  10310. * @example
  10311. *
  10312. * var users = [
  10313. * { 'user': 'barney', 'age': 36, 'active': false },
  10314. * { 'user': 'fred', 'age': 40, 'active': true }
  10315. * ];
  10316. *
  10317. * _.reject(users, function(o) { return !o.active; });
  10318. * // => objects for ['fred']
  10319. *
  10320. * // The `_.matches` iteratee shorthand.
  10321. * _.reject(users, { 'age': 40, 'active': true });
  10322. * // => objects for ['barney']
  10323. *
  10324. * // The `_.matchesProperty` iteratee shorthand.
  10325. * _.reject(users, ['active', false]);
  10326. * // => objects for ['fred']
  10327. *
  10328. * // The `_.property` iteratee shorthand.
  10329. * _.reject(users, 'active');
  10330. * // => objects for ['barney']
  10331. */
  10332. function reject(collection, predicate) {
  10333. var func = isArray(collection) ? arrayFilter : baseFilter;
  10334. return func(collection, negate(getIteratee(predicate, 3)));
  10335. }
  10336. /**
  10337. * Gets a random element from `collection`.
  10338. *
  10339. * @static
  10340. * @memberOf _
  10341. * @since 2.0.0
  10342. * @category Collection
  10343. * @param {Array|Object} collection The collection to sample.
  10344. * @returns {*} Returns the random element.
  10345. * @example
  10346. *
  10347. * _.sample([1, 2, 3, 4]);
  10348. * // => 2
  10349. */
  10350. function sample(collection) {
  10351. var func = isArray(collection) ? arraySample : baseSample;
  10352. return func(collection);
  10353. }
  10354. /**
  10355. * Gets `n` random elements at unique keys from `collection` up to the
  10356. * size of `collection`.
  10357. *
  10358. * @static
  10359. * @memberOf _
  10360. * @since 4.0.0
  10361. * @category Collection
  10362. * @param {Array|Object} collection The collection to sample.
  10363. * @param {number} [n=1] The number of elements to sample.
  10364. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  10365. * @returns {Array} Returns the random elements.
  10366. * @example
  10367. *
  10368. * _.sampleSize([1, 2, 3], 2);
  10369. * // => [3, 1]
  10370. *
  10371. * _.sampleSize([1, 2, 3], 4);
  10372. * // => [2, 3, 1]
  10373. */
  10374. function sampleSize(collection, n, guard) {
  10375. if ((guard ? isIterateeCall(collection, n, guard) : n === undefined)) {
  10376. n = 1;
  10377. } else {
  10378. n = toInteger(n);
  10379. }
  10380. var func = isArray(collection) ? arraySampleSize : baseSampleSize;
  10381. return func(collection, n);
  10382. }
  10383. /**
  10384. * Creates an array of shuffled values, using a version of the
  10385. * [Fisher-Yates shuffle](https://en.wikipedia.org/wiki/Fisher-Yates_shuffle).
  10386. *
  10387. * @static
  10388. * @memberOf _
  10389. * @since 0.1.0
  10390. * @category Collection
  10391. * @param {Array|Object} collection The collection to shuffle.
  10392. * @returns {Array} Returns the new shuffled array.
  10393. * @example
  10394. *
  10395. * _.shuffle([1, 2, 3, 4]);
  10396. * // => [4, 1, 3, 2]
  10397. */
  10398. function shuffle(collection) {
  10399. var func = isArray(collection) ? arrayShuffle : baseShuffle;
  10400. return func(collection);
  10401. }
  10402. /**
  10403. * Gets the size of `collection` by returning its length for array-like
  10404. * values or the number of own enumerable string keyed properties for objects.
  10405. *
  10406. * @static
  10407. * @memberOf _
  10408. * @since 0.1.0
  10409. * @category Collection
  10410. * @param {Array|Object|string} collection The collection to inspect.
  10411. * @returns {number} Returns the collection size.
  10412. * @example
  10413. *
  10414. * _.size([1, 2, 3]);
  10415. * // => 3
  10416. *
  10417. * _.size({ 'a': 1, 'b': 2 });
  10418. * // => 2
  10419. *
  10420. * _.size('pebbles');
  10421. * // => 7
  10422. */
  10423. function size(collection) {
  10424. if (collection == null) {
  10425. return 0;
  10426. }
  10427. if (isArrayLike(collection)) {
  10428. return isString(collection) ? stringSize(collection) : collection.length;
  10429. }
  10430. var tag = getTag(collection);
  10431. if (tag == mapTag || tag == setTag) {
  10432. return collection.size;
  10433. }
  10434. return baseKeys(collection).length;
  10435. }
  10436. /**
  10437. * Checks if `predicate` returns truthy for **any** element of `collection`.
  10438. * Iteration is stopped once `predicate` returns truthy. The predicate is
  10439. * invoked with three arguments: (value, index|key, collection).
  10440. *
  10441. * @static
  10442. * @memberOf _
  10443. * @since 0.1.0
  10444. * @category Collection
  10445. * @param {Array|Object} collection The collection to iterate over.
  10446. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  10447. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  10448. * @returns {boolean} Returns `true` if any element passes the predicate check,
  10449. * else `false`.
  10450. * @example
  10451. *
  10452. * _.some([null, 0, 'yes', false], Boolean);
  10453. * // => true
  10454. *
  10455. * var users = [
  10456. * { 'user': 'barney', 'active': true },
  10457. * { 'user': 'fred', 'active': false }
  10458. * ];
  10459. *
  10460. * // The `_.matches` iteratee shorthand.
  10461. * _.some(users, { 'user': 'barney', 'active': false });
  10462. * // => false
  10463. *
  10464. * // The `_.matchesProperty` iteratee shorthand.
  10465. * _.some(users, ['active', false]);
  10466. * // => true
  10467. *
  10468. * // The `_.property` iteratee shorthand.
  10469. * _.some(users, 'active');
  10470. * // => true
  10471. */
  10472. function some(collection, predicate, guard) {
  10473. var func = isArray(collection) ? arraySome : baseSome;
  10474. if (guard && isIterateeCall(collection, predicate, guard)) {
  10475. predicate = undefined;
  10476. }
  10477. return func(collection, getIteratee(predicate, 3));
  10478. }
  10479. /**
  10480. * Creates an array of elements, sorted in ascending order by the results of
  10481. * running each element in a collection thru each iteratee. This method
  10482. * performs a stable sort, that is, it preserves the original sort order of
  10483. * equal elements. The iteratees are invoked with one argument: (value).
  10484. *
  10485. * @static
  10486. * @memberOf _
  10487. * @since 0.1.0
  10488. * @category Collection
  10489. * @param {Array|Object} collection The collection to iterate over.
  10490. * @param {...(Function|Function[])} [iteratees=[_.identity]]
  10491. * The iteratees to sort by.
  10492. * @returns {Array} Returns the new sorted array.
  10493. * @example
  10494. *
  10495. * var users = [
  10496. * { 'user': 'fred', 'age': 48 },
  10497. * { 'user': 'barney', 'age': 36 },
  10498. * { 'user': 'fred', 'age': 30 },
  10499. * { 'user': 'barney', 'age': 34 }
  10500. * ];
  10501. *
  10502. * _.sortBy(users, [function(o) { return o.user; }]);
  10503. * // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 30]]
  10504. *
  10505. * _.sortBy(users, ['user', 'age']);
  10506. * // => objects for [['barney', 34], ['barney', 36], ['fred', 30], ['fred', 48]]
  10507. */
  10508. var sortBy = baseRest(function(collection, iteratees) {
  10509. if (collection == null) {
  10510. return [];
  10511. }
  10512. var length = iteratees.length;
  10513. if (length > 1 && isIterateeCall(collection, iteratees[0], iteratees[1])) {
  10514. iteratees = [];
  10515. } else if (length > 2 && isIterateeCall(iteratees[0], iteratees[1], iteratees[2])) {
  10516. iteratees = [iteratees[0]];
  10517. }
  10518. return baseOrderBy(collection, baseFlatten(iteratees, 1), []);
  10519. });
  10520. /*------------------------------------------------------------------------*/
  10521. /**
  10522. * Gets the timestamp of the number of milliseconds that have elapsed since
  10523. * the Unix epoch (1 January 1970 00:00:00 UTC).
  10524. *
  10525. * @static
  10526. * @memberOf _
  10527. * @since 2.4.0
  10528. * @category Date
  10529. * @returns {number} Returns the timestamp.
  10530. * @example
  10531. *
  10532. * _.defer(function(stamp) {
  10533. * console.log(_.now() - stamp);
  10534. * }, _.now());
  10535. * // => Logs the number of milliseconds it took for the deferred invocation.
  10536. */
  10537. var now = ctxNow || function() {
  10538. return root.Date.now();
  10539. };
  10540. /*------------------------------------------------------------------------*/
  10541. /**
  10542. * The opposite of `_.before`; this method creates a function that invokes
  10543. * `func` once it's called `n` or more times.
  10544. *
  10545. * @static
  10546. * @memberOf _
  10547. * @since 0.1.0
  10548. * @category Function
  10549. * @param {number} n The number of calls before `func` is invoked.
  10550. * @param {Function} func The function to restrict.
  10551. * @returns {Function} Returns the new restricted function.
  10552. * @example
  10553. *
  10554. * var saves = ['profile', 'settings'];
  10555. *
  10556. * var done = _.after(saves.length, function() {
  10557. * console.log('done saving!');
  10558. * });
  10559. *
  10560. * _.forEach(saves, function(type) {
  10561. * asyncSave({ 'type': type, 'complete': done });
  10562. * });
  10563. * // => Logs 'done saving!' after the two async saves have completed.
  10564. */
  10565. function after(n, func) {
  10566. if (typeof func != 'function') {
  10567. throw new TypeError(FUNC_ERROR_TEXT);
  10568. }
  10569. n = toInteger(n);
  10570. return function() {
  10571. if (--n < 1) {
  10572. return func.apply(this, arguments);
  10573. }
  10574. };
  10575. }
  10576. /**
  10577. * Creates a function that invokes `func`, with up to `n` arguments,
  10578. * ignoring any additional arguments.
  10579. *
  10580. * @static
  10581. * @memberOf _
  10582. * @since 3.0.0
  10583. * @category Function
  10584. * @param {Function} func The function to cap arguments for.
  10585. * @param {number} [n=func.length] The arity cap.
  10586. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  10587. * @returns {Function} Returns the new capped function.
  10588. * @example
  10589. *
  10590. * _.map(['6', '8', '10'], _.ary(parseInt, 1));
  10591. * // => [6, 8, 10]
  10592. */
  10593. function ary(func, n, guard) {
  10594. n = guard ? undefined : n;
  10595. n = (func && n == null) ? func.length : n;
  10596. return createWrap(func, WRAP_ARY_FLAG, undefined, undefined, undefined, undefined, n);
  10597. }
  10598. /**
  10599. * Creates a function that invokes `func`, with the `this` binding and arguments
  10600. * of the created function, while it's called less than `n` times. Subsequent
  10601. * calls to the created function return the result of the last `func` invocation.
  10602. *
  10603. * @static
  10604. * @memberOf _
  10605. * @since 3.0.0
  10606. * @category Function
  10607. * @param {number} n The number of calls at which `func` is no longer invoked.
  10608. * @param {Function} func The function to restrict.
  10609. * @returns {Function} Returns the new restricted function.
  10610. * @example
  10611. *
  10612. * jQuery(element).on('click', _.before(5, addContactToList));
  10613. * // => Allows adding up to 4 contacts to the list.
  10614. */
  10615. function before(n, func) {
  10616. var result;
  10617. if (typeof func != 'function') {
  10618. throw new TypeError(FUNC_ERROR_TEXT);
  10619. }
  10620. n = toInteger(n);
  10621. return function() {
  10622. if (--n > 0) {
  10623. result = func.apply(this, arguments);
  10624. }
  10625. if (n <= 1) {
  10626. func = undefined;
  10627. }
  10628. return result;
  10629. };
  10630. }
  10631. /**
  10632. * Creates a function that invokes `func` with the `this` binding of `thisArg`
  10633. * and `partials` prepended to the arguments it receives.
  10634. *
  10635. * The `_.bind.placeholder` value, which defaults to `_` in monolithic builds,
  10636. * may be used as a placeholder for partially applied arguments.
  10637. *
  10638. * **Note:** Unlike native `Function#bind`, this method doesn't set the "length"
  10639. * property of bound functions.
  10640. *
  10641. * @static
  10642. * @memberOf _
  10643. * @since 0.1.0
  10644. * @category Function
  10645. * @param {Function} func The function to bind.
  10646. * @param {*} thisArg The `this` binding of `func`.
  10647. * @param {...*} [partials] The arguments to be partially applied.
  10648. * @returns {Function} Returns the new bound function.
  10649. * @example
  10650. *
  10651. * function greet(greeting, punctuation) {
  10652. * return greeting + ' ' + this.user + punctuation;
  10653. * }
  10654. *
  10655. * var object = { 'user': 'fred' };
  10656. *
  10657. * var bound = _.bind(greet, object, 'hi');
  10658. * bound('!');
  10659. * // => 'hi fred!'
  10660. *
  10661. * // Bound with placeholders.
  10662. * var bound = _.bind(greet, object, _, '!');
  10663. * bound('hi');
  10664. * // => 'hi fred!'
  10665. */
  10666. var bind = baseRest(function(func, thisArg, partials) {
  10667. var bitmask = WRAP_BIND_FLAG;
  10668. if (partials.length) {
  10669. var holders = replaceHolders(partials, getHolder(bind));
  10670. bitmask |= WRAP_PARTIAL_FLAG;
  10671. }
  10672. return createWrap(func, bitmask, thisArg, partials, holders);
  10673. });
  10674. /**
  10675. * Creates a function that invokes the method at `object[key]` with `partials`
  10676. * prepended to the arguments it receives.
  10677. *
  10678. * This method differs from `_.bind` by allowing bound functions to reference
  10679. * methods that may be redefined or don't yet exist. See
  10680. * [Peter Michaux's article](http://peter.michaux.ca/articles/lazy-function-definition-pattern)
  10681. * for more details.
  10682. *
  10683. * The `_.bindKey.placeholder` value, which defaults to `_` in monolithic
  10684. * builds, may be used as a placeholder for partially applied arguments.
  10685. *
  10686. * @static
  10687. * @memberOf _
  10688. * @since 0.10.0
  10689. * @category Function
  10690. * @param {Object} object The object to invoke the method on.
  10691. * @param {string} key The key of the method.
  10692. * @param {...*} [partials] The arguments to be partially applied.
  10693. * @returns {Function} Returns the new bound function.
  10694. * @example
  10695. *
  10696. * var object = {
  10697. * 'user': 'fred',
  10698. * 'greet': function(greeting, punctuation) {
  10699. * return greeting + ' ' + this.user + punctuation;
  10700. * }
  10701. * };
  10702. *
  10703. * var bound = _.bindKey(object, 'greet', 'hi');
  10704. * bound('!');
  10705. * // => 'hi fred!'
  10706. *
  10707. * object.greet = function(greeting, punctuation) {
  10708. * return greeting + 'ya ' + this.user + punctuation;
  10709. * };
  10710. *
  10711. * bound('!');
  10712. * // => 'hiya fred!'
  10713. *
  10714. * // Bound with placeholders.
  10715. * var bound = _.bindKey(object, 'greet', _, '!');
  10716. * bound('hi');
  10717. * // => 'hiya fred!'
  10718. */
  10719. var bindKey = baseRest(function(object, key, partials) {
  10720. var bitmask = WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG;
  10721. if (partials.length) {
  10722. var holders = replaceHolders(partials, getHolder(bindKey));
  10723. bitmask |= WRAP_PARTIAL_FLAG;
  10724. }
  10725. return createWrap(key, bitmask, object, partials, holders);
  10726. });
  10727. /**
  10728. * Creates a function that accepts arguments of `func` and either invokes
  10729. * `func` returning its result, if at least `arity` number of arguments have
  10730. * been provided, or returns a function that accepts the remaining `func`
  10731. * arguments, and so on. The arity of `func` may be specified if `func.length`
  10732. * is not sufficient.
  10733. *
  10734. * The `_.curry.placeholder` value, which defaults to `_` in monolithic builds,
  10735. * may be used as a placeholder for provided arguments.
  10736. *
  10737. * **Note:** This method doesn't set the "length" property of curried functions.
  10738. *
  10739. * @static
  10740. * @memberOf _
  10741. * @since 2.0.0
  10742. * @category Function
  10743. * @param {Function} func The function to curry.
  10744. * @param {number} [arity=func.length] The arity of `func`.
  10745. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  10746. * @returns {Function} Returns the new curried function.
  10747. * @example
  10748. *
  10749. * var abc = function(a, b, c) {
  10750. * return [a, b, c];
  10751. * };
  10752. *
  10753. * var curried = _.curry(abc);
  10754. *
  10755. * curried(1)(2)(3);
  10756. * // => [1, 2, 3]
  10757. *
  10758. * curried(1, 2)(3);
  10759. * // => [1, 2, 3]
  10760. *
  10761. * curried(1, 2, 3);
  10762. * // => [1, 2, 3]
  10763. *
  10764. * // Curried with placeholders.
  10765. * curried(1)(_, 3)(2);
  10766. * // => [1, 2, 3]
  10767. */
  10768. function curry(func, arity, guard) {
  10769. arity = guard ? undefined : arity;
  10770. var result = createWrap(func, WRAP_CURRY_FLAG, undefined, undefined, undefined, undefined, undefined, arity);
  10771. result.placeholder = curry.placeholder;
  10772. return result;
  10773. }
  10774. /**
  10775. * This method is like `_.curry` except that arguments are applied to `func`
  10776. * in the manner of `_.partialRight` instead of `_.partial`.
  10777. *
  10778. * The `_.curryRight.placeholder` value, which defaults to `_` in monolithic
  10779. * builds, may be used as a placeholder for provided arguments.
  10780. *
  10781. * **Note:** This method doesn't set the "length" property of curried functions.
  10782. *
  10783. * @static
  10784. * @memberOf _
  10785. * @since 3.0.0
  10786. * @category Function
  10787. * @param {Function} func The function to curry.
  10788. * @param {number} [arity=func.length] The arity of `func`.
  10789. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  10790. * @returns {Function} Returns the new curried function.
  10791. * @example
  10792. *
  10793. * var abc = function(a, b, c) {
  10794. * return [a, b, c];
  10795. * };
  10796. *
  10797. * var curried = _.curryRight(abc);
  10798. *
  10799. * curried(3)(2)(1);
  10800. * // => [1, 2, 3]
  10801. *
  10802. * curried(2, 3)(1);
  10803. * // => [1, 2, 3]
  10804. *
  10805. * curried(1, 2, 3);
  10806. * // => [1, 2, 3]
  10807. *
  10808. * // Curried with placeholders.
  10809. * curried(3)(1, _)(2);
  10810. * // => [1, 2, 3]
  10811. */
  10812. function curryRight(func, arity, guard) {
  10813. arity = guard ? undefined : arity;
  10814. var result = createWrap(func, WRAP_CURRY_RIGHT_FLAG, undefined, undefined, undefined, undefined, undefined, arity);
  10815. result.placeholder = curryRight.placeholder;
  10816. return result;
  10817. }
  10818. /**
  10819. * Creates a debounced function that delays invoking `func` until after `wait`
  10820. * milliseconds have elapsed since the last time the debounced function was
  10821. * invoked. The debounced function comes with a `cancel` method to cancel
  10822. * delayed `func` invocations and a `flush` method to immediately invoke them.
  10823. * Provide `options` to indicate whether `func` should be invoked on the
  10824. * leading and/or trailing edge of the `wait` timeout. The `func` is invoked
  10825. * with the last arguments provided to the debounced function. Subsequent
  10826. * calls to the debounced function return the result of the last `func`
  10827. * invocation.
  10828. *
  10829. * **Note:** If `leading` and `trailing` options are `true`, `func` is
  10830. * invoked on the trailing edge of the timeout only if the debounced function
  10831. * is invoked more than once during the `wait` timeout.
  10832. *
  10833. * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred
  10834. * until to the next tick, similar to `setTimeout` with a timeout of `0`.
  10835. *
  10836. * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/)
  10837. * for details over the differences between `_.debounce` and `_.throttle`.
  10838. *
  10839. * @static
  10840. * @memberOf _
  10841. * @since 0.1.0
  10842. * @category Function
  10843. * @param {Function} func The function to debounce.
  10844. * @param {number} [wait=0] The number of milliseconds to delay.
  10845. * @param {Object} [options={}] The options object.
  10846. * @param {boolean} [options.leading=false]
  10847. * Specify invoking on the leading edge of the timeout.
  10848. * @param {number} [options.maxWait]
  10849. * The maximum time `func` is allowed to be delayed before it's invoked.
  10850. * @param {boolean} [options.trailing=true]
  10851. * Specify invoking on the trailing edge of the timeout.
  10852. * @returns {Function} Returns the new debounced function.
  10853. * @example
  10854. *
  10855. * // Avoid costly calculations while the window size is in flux.
  10856. * jQuery(window).on('resize', _.debounce(calculateLayout, 150));
  10857. *
  10858. * // Invoke `sendMail` when clicked, debouncing subsequent calls.
  10859. * jQuery(element).on('click', _.debounce(sendMail, 300, {
  10860. * 'leading': true,
  10861. * 'trailing': false
  10862. * }));
  10863. *
  10864. * // Ensure `batchLog` is invoked once after 1 second of debounced calls.
  10865. * var debounced = _.debounce(batchLog, 250, { 'maxWait': 1000 });
  10866. * var source = new EventSource('/stream');
  10867. * jQuery(source).on('message', debounced);
  10868. *
  10869. * // Cancel the trailing debounced invocation.
  10870. * jQuery(window).on('popstate', debounced.cancel);
  10871. */
  10872. function debounce(func, wait, options) {
  10873. var lastArgs,
  10874. lastThis,
  10875. maxWait,
  10876. result,
  10877. timerId,
  10878. lastCallTime,
  10879. lastInvokeTime = 0,
  10880. leading = false,
  10881. maxing = false,
  10882. trailing = true;
  10883. if (typeof func != 'function') {
  10884. throw new TypeError(FUNC_ERROR_TEXT);
  10885. }
  10886. wait = toNumber(wait) || 0;
  10887. if (isObject(options)) {
  10888. leading = !!options.leading;
  10889. maxing = 'maxWait' in options;
  10890. maxWait = maxing ? nativeMax(toNumber(options.maxWait) || 0, wait) : maxWait;
  10891. trailing = 'trailing' in options ? !!options.trailing : trailing;
  10892. }
  10893. function invokeFunc(time) {
  10894. var args = lastArgs,
  10895. thisArg = lastThis;
  10896. lastArgs = lastThis = undefined;
  10897. lastInvokeTime = time;
  10898. result = func.apply(thisArg, args);
  10899. return result;
  10900. }
  10901. function leadingEdge(time) {
  10902. // Reset any `maxWait` timer.
  10903. lastInvokeTime = time;
  10904. // Start the timer for the trailing edge.
  10905. timerId = setTimeout(timerExpired, wait);
  10906. // Invoke the leading edge.
  10907. return leading ? invokeFunc(time) : result;
  10908. }
  10909. function remainingWait(time) {
  10910. var timeSinceLastCall = time - lastCallTime,
  10911. timeSinceLastInvoke = time - lastInvokeTime,
  10912. timeWaiting = wait - timeSinceLastCall;
  10913. return maxing
  10914. ? nativeMin(timeWaiting, maxWait - timeSinceLastInvoke)
  10915. : timeWaiting;
  10916. }
  10917. function shouldInvoke(time) {
  10918. var timeSinceLastCall = time - lastCallTime,
  10919. timeSinceLastInvoke = time - lastInvokeTime;
  10920. // Either this is the first call, activity has stopped and we're at the
  10921. // trailing edge, the system time has gone backwards and we're treating
  10922. // it as the trailing edge, or we've hit the `maxWait` limit.
  10923. return (lastCallTime === undefined || (timeSinceLastCall >= wait) ||
  10924. (timeSinceLastCall < 0) || (maxing && timeSinceLastInvoke >= maxWait));
  10925. }
  10926. function timerExpired() {
  10927. var time = now();
  10928. if (shouldInvoke(time)) {
  10929. return trailingEdge(time);
  10930. }
  10931. // Restart the timer.
  10932. timerId = setTimeout(timerExpired, remainingWait(time));
  10933. }
  10934. function trailingEdge(time) {
  10935. timerId = undefined;
  10936. // Only invoke if we have `lastArgs` which means `func` has been
  10937. // debounced at least once.
  10938. if (trailing && lastArgs) {
  10939. return invokeFunc(time);
  10940. }
  10941. lastArgs = lastThis = undefined;
  10942. return result;
  10943. }
  10944. function cancel() {
  10945. if (timerId !== undefined) {
  10946. clearTimeout(timerId);
  10947. }
  10948. lastInvokeTime = 0;
  10949. lastArgs = lastCallTime = lastThis = timerId = undefined;
  10950. }
  10951. function flush() {
  10952. return timerId === undefined ? result : trailingEdge(now());
  10953. }
  10954. function debounced() {
  10955. var time = now(),
  10956. isInvoking = shouldInvoke(time);
  10957. lastArgs = arguments;
  10958. lastThis = this;
  10959. lastCallTime = time;
  10960. if (isInvoking) {
  10961. if (timerId === undefined) {
  10962. return leadingEdge(lastCallTime);
  10963. }
  10964. if (maxing) {
  10965. // Handle invocations in a tight loop.
  10966. clearTimeout(timerId);
  10967. timerId = setTimeout(timerExpired, wait);
  10968. return invokeFunc(lastCallTime);
  10969. }
  10970. }
  10971. if (timerId === undefined) {
  10972. timerId = setTimeout(timerExpired, wait);
  10973. }
  10974. return result;
  10975. }
  10976. debounced.cancel = cancel;
  10977. debounced.flush = flush;
  10978. return debounced;
  10979. }
  10980. /**
  10981. * Defers invoking the `func` until the current call stack has cleared. Any
  10982. * additional arguments are provided to `func` when it's invoked.
  10983. *
  10984. * @static
  10985. * @memberOf _
  10986. * @since 0.1.0
  10987. * @category Function
  10988. * @param {Function} func The function to defer.
  10989. * @param {...*} [args] The arguments to invoke `func` with.
  10990. * @returns {number} Returns the timer id.
  10991. * @example
  10992. *
  10993. * _.defer(function(text) {
  10994. * console.log(text);
  10995. * }, 'deferred');
  10996. * // => Logs 'deferred' after one millisecond.
  10997. */
  10998. var defer = baseRest(function(func, args) {
  10999. return baseDelay(func, 1, args);
  11000. });
  11001. /**
  11002. * Invokes `func` after `wait` milliseconds. Any additional arguments are
  11003. * provided to `func` when it's invoked.
  11004. *
  11005. * @static
  11006. * @memberOf _
  11007. * @since 0.1.0
  11008. * @category Function
  11009. * @param {Function} func The function to delay.
  11010. * @param {number} wait The number of milliseconds to delay invocation.
  11011. * @param {...*} [args] The arguments to invoke `func` with.
  11012. * @returns {number} Returns the timer id.
  11013. * @example
  11014. *
  11015. * _.delay(function(text) {
  11016. * console.log(text);
  11017. * }, 1000, 'later');
  11018. * // => Logs 'later' after one second.
  11019. */
  11020. var delay = baseRest(function(func, wait, args) {
  11021. return baseDelay(func, toNumber(wait) || 0, args);
  11022. });
  11023. /**
  11024. * Creates a function that invokes `func` with arguments reversed.
  11025. *
  11026. * @static
  11027. * @memberOf _
  11028. * @since 4.0.0
  11029. * @category Function
  11030. * @param {Function} func The function to flip arguments for.
  11031. * @returns {Function} Returns the new flipped function.
  11032. * @example
  11033. *
  11034. * var flipped = _.flip(function() {
  11035. * return _.toArray(arguments);
  11036. * });
  11037. *
  11038. * flipped('a', 'b', 'c', 'd');
  11039. * // => ['d', 'c', 'b', 'a']
  11040. */
  11041. function flip(func) {
  11042. return createWrap(func, WRAP_FLIP_FLAG);
  11043. }
  11044. /**
  11045. * Creates a function that memoizes the result of `func`. If `resolver` is
  11046. * provided, it determines the cache key for storing the result based on the
  11047. * arguments provided to the memoized function. By default, the first argument
  11048. * provided to the memoized function is used as the map cache key. The `func`
  11049. * is invoked with the `this` binding of the memoized function.
  11050. *
  11051. * **Note:** The cache is exposed as the `cache` property on the memoized
  11052. * function. Its creation may be customized by replacing the `_.memoize.Cache`
  11053. * constructor with one whose instances implement the
  11054. * [`Map`](http://ecma-international.org/ecma-262/7.0/#sec-properties-of-the-map-prototype-object)
  11055. * method interface of `clear`, `delete`, `get`, `has`, and `set`.
  11056. *
  11057. * @static
  11058. * @memberOf _
  11059. * @since 0.1.0
  11060. * @category Function
  11061. * @param {Function} func The function to have its output memoized.
  11062. * @param {Function} [resolver] The function to resolve the cache key.
  11063. * @returns {Function} Returns the new memoized function.
  11064. * @example
  11065. *
  11066. * var object = { 'a': 1, 'b': 2 };
  11067. * var other = { 'c': 3, 'd': 4 };
  11068. *
  11069. * var values = _.memoize(_.values);
  11070. * values(object);
  11071. * // => [1, 2]
  11072. *
  11073. * values(other);
  11074. * // => [3, 4]
  11075. *
  11076. * object.a = 2;
  11077. * values(object);
  11078. * // => [1, 2]
  11079. *
  11080. * // Modify the result cache.
  11081. * values.cache.set(object, ['a', 'b']);
  11082. * values(object);
  11083. * // => ['a', 'b']
  11084. *
  11085. * // Replace `_.memoize.Cache`.
  11086. * _.memoize.Cache = WeakMap;
  11087. */
  11088. function memoize(func, resolver) {
  11089. if (typeof func != 'function' || (resolver != null && typeof resolver != 'function')) {
  11090. throw new TypeError(FUNC_ERROR_TEXT);
  11091. }
  11092. var memoized = function() {
  11093. var args = arguments,
  11094. key = resolver ? resolver.apply(this, args) : args[0],
  11095. cache = memoized.cache;
  11096. if (cache.has(key)) {
  11097. return cache.get(key);
  11098. }
  11099. var result = func.apply(this, args);
  11100. memoized.cache = cache.set(key, result) || cache;
  11101. return result;
  11102. };
  11103. memoized.cache = new (memoize.Cache || MapCache);
  11104. return memoized;
  11105. }
  11106. // Expose `MapCache`.
  11107. memoize.Cache = MapCache;
  11108. /**
  11109. * Creates a function that negates the result of the predicate `func`. The
  11110. * `func` predicate is invoked with the `this` binding and arguments of the
  11111. * created function.
  11112. *
  11113. * @static
  11114. * @memberOf _
  11115. * @since 3.0.0
  11116. * @category Function
  11117. * @param {Function} predicate The predicate to negate.
  11118. * @returns {Function} Returns the new negated function.
  11119. * @example
  11120. *
  11121. * function isEven(n) {
  11122. * return n % 2 == 0;
  11123. * }
  11124. *
  11125. * _.filter([1, 2, 3, 4, 5, 6], _.negate(isEven));
  11126. * // => [1, 3, 5]
  11127. */
  11128. function negate(predicate) {
  11129. if (typeof predicate != 'function') {
  11130. throw new TypeError(FUNC_ERROR_TEXT);
  11131. }
  11132. return function() {
  11133. var args = arguments;
  11134. switch (args.length) {
  11135. case 0: return !predicate.call(this);
  11136. case 1: return !predicate.call(this, args[0]);
  11137. case 2: return !predicate.call(this, args[0], args[1]);
  11138. case 3: return !predicate.call(this, args[0], args[1], args[2]);
  11139. }
  11140. return !predicate.apply(this, args);
  11141. };
  11142. }
  11143. /**
  11144. * Creates a function that is restricted to invoking `func` once. Repeat calls
  11145. * to the function return the value of the first invocation. The `func` is
  11146. * invoked with the `this` binding and arguments of the created function.
  11147. *
  11148. * @static
  11149. * @memberOf _
  11150. * @since 0.1.0
  11151. * @category Function
  11152. * @param {Function} func The function to restrict.
  11153. * @returns {Function} Returns the new restricted function.
  11154. * @example
  11155. *
  11156. * var initialize = _.once(createApplication);
  11157. * initialize();
  11158. * initialize();
  11159. * // => `createApplication` is invoked once
  11160. */
  11161. function once(func) {
  11162. return before(2, func);
  11163. }
  11164. /**
  11165. * Creates a function that invokes `func` with its arguments transformed.
  11166. *
  11167. * @static
  11168. * @since 4.0.0
  11169. * @memberOf _
  11170. * @category Function
  11171. * @param {Function} func The function to wrap.
  11172. * @param {...(Function|Function[])} [transforms=[_.identity]]
  11173. * The argument transforms.
  11174. * @returns {Function} Returns the new function.
  11175. * @example
  11176. *
  11177. * function doubled(n) {
  11178. * return n * 2;
  11179. * }
  11180. *
  11181. * function square(n) {
  11182. * return n * n;
  11183. * }
  11184. *
  11185. * var func = _.overArgs(function(x, y) {
  11186. * return [x, y];
  11187. * }, [square, doubled]);
  11188. *
  11189. * func(9, 3);
  11190. * // => [81, 6]
  11191. *
  11192. * func(10, 5);
  11193. * // => [100, 10]
  11194. */
  11195. var overArgs = castRest(function(func, transforms) {
  11196. transforms = (transforms.length == 1 && isArray(transforms[0]))
  11197. ? arrayMap(transforms[0], baseUnary(getIteratee()))
  11198. : arrayMap(baseFlatten(transforms, 1), baseUnary(getIteratee()));
  11199. var funcsLength = transforms.length;
  11200. return baseRest(function(args) {
  11201. var index = -1,
  11202. length = nativeMin(args.length, funcsLength);
  11203. while (++index < length) {
  11204. args[index] = transforms[index].call(this, args[index]);
  11205. }
  11206. return apply(func, this, args);
  11207. });
  11208. });
  11209. /**
  11210. * Creates a function that invokes `func` with `partials` prepended to the
  11211. * arguments it receives. This method is like `_.bind` except it does **not**
  11212. * alter the `this` binding.
  11213. *
  11214. * The `_.partial.placeholder` value, which defaults to `_` in monolithic
  11215. * builds, may be used as a placeholder for partially applied arguments.
  11216. *
  11217. * **Note:** This method doesn't set the "length" property of partially
  11218. * applied functions.
  11219. *
  11220. * @static
  11221. * @memberOf _
  11222. * @since 0.2.0
  11223. * @category Function
  11224. * @param {Function} func The function to partially apply arguments to.
  11225. * @param {...*} [partials] The arguments to be partially applied.
  11226. * @returns {Function} Returns the new partially applied function.
  11227. * @example
  11228. *
  11229. * function greet(greeting, name) {
  11230. * return greeting + ' ' + name;
  11231. * }
  11232. *
  11233. * var sayHelloTo = _.partial(greet, 'hello');
  11234. * sayHelloTo('fred');
  11235. * // => 'hello fred'
  11236. *
  11237. * // Partially applied with placeholders.
  11238. * var greetFred = _.partial(greet, _, 'fred');
  11239. * greetFred('hi');
  11240. * // => 'hi fred'
  11241. */
  11242. var partial = baseRest(function(func, partials) {
  11243. var holders = replaceHolders(partials, getHolder(partial));
  11244. return createWrap(func, WRAP_PARTIAL_FLAG, undefined, partials, holders);
  11245. });
  11246. /**
  11247. * This method is like `_.partial` except that partially applied arguments
  11248. * are appended to the arguments it receives.
  11249. *
  11250. * The `_.partialRight.placeholder` value, which defaults to `_` in monolithic
  11251. * builds, may be used as a placeholder for partially applied arguments.
  11252. *
  11253. * **Note:** This method doesn't set the "length" property of partially
  11254. * applied functions.
  11255. *
  11256. * @static
  11257. * @memberOf _
  11258. * @since 1.0.0
  11259. * @category Function
  11260. * @param {Function} func The function to partially apply arguments to.
  11261. * @param {...*} [partials] The arguments to be partially applied.
  11262. * @returns {Function} Returns the new partially applied function.
  11263. * @example
  11264. *
  11265. * function greet(greeting, name) {
  11266. * return greeting + ' ' + name;
  11267. * }
  11268. *
  11269. * var greetFred = _.partialRight(greet, 'fred');
  11270. * greetFred('hi');
  11271. * // => 'hi fred'
  11272. *
  11273. * // Partially applied with placeholders.
  11274. * var sayHelloTo = _.partialRight(greet, 'hello', _);
  11275. * sayHelloTo('fred');
  11276. * // => 'hello fred'
  11277. */
  11278. var partialRight = baseRest(function(func, partials) {
  11279. var holders = replaceHolders(partials, getHolder(partialRight));
  11280. return createWrap(func, WRAP_PARTIAL_RIGHT_FLAG, undefined, partials, holders);
  11281. });
  11282. /**
  11283. * Creates a function that invokes `func` with arguments arranged according
  11284. * to the specified `indexes` where the argument value at the first index is
  11285. * provided as the first argument, the argument value at the second index is
  11286. * provided as the second argument, and so on.
  11287. *
  11288. * @static
  11289. * @memberOf _
  11290. * @since 3.0.0
  11291. * @category Function
  11292. * @param {Function} func The function to rearrange arguments for.
  11293. * @param {...(number|number[])} indexes The arranged argument indexes.
  11294. * @returns {Function} Returns the new function.
  11295. * @example
  11296. *
  11297. * var rearged = _.rearg(function(a, b, c) {
  11298. * return [a, b, c];
  11299. * }, [2, 0, 1]);
  11300. *
  11301. * rearged('b', 'c', 'a')
  11302. * // => ['a', 'b', 'c']
  11303. */
  11304. var rearg = flatRest(function(func, indexes) {
  11305. return createWrap(func, WRAP_REARG_FLAG, undefined, undefined, undefined, indexes);
  11306. });
  11307. /**
  11308. * Creates a function that invokes `func` with the `this` binding of the
  11309. * created function and arguments from `start` and beyond provided as
  11310. * an array.
  11311. *
  11312. * **Note:** This method is based on the
  11313. * [rest parameter](https://mdn.io/rest_parameters).
  11314. *
  11315. * @static
  11316. * @memberOf _
  11317. * @since 4.0.0
  11318. * @category Function
  11319. * @param {Function} func The function to apply a rest parameter to.
  11320. * @param {number} [start=func.length-1] The start position of the rest parameter.
  11321. * @returns {Function} Returns the new function.
  11322. * @example
  11323. *
  11324. * var say = _.rest(function(what, names) {
  11325. * return what + ' ' + _.initial(names).join(', ') +
  11326. * (_.size(names) > 1 ? ', & ' : '') + _.last(names);
  11327. * });
  11328. *
  11329. * say('hello', 'fred', 'barney', 'pebbles');
  11330. * // => 'hello fred, barney, & pebbles'
  11331. */
  11332. function rest(func, start) {
  11333. if (typeof func != 'function') {
  11334. throw new TypeError(FUNC_ERROR_TEXT);
  11335. }
  11336. start = start === undefined ? start : toInteger(start);
  11337. return baseRest(func, start);
  11338. }
  11339. /**
  11340. * Creates a function that invokes `func` with the `this` binding of the
  11341. * create function and an array of arguments much like
  11342. * [`Function#apply`](http://www.ecma-international.org/ecma-262/7.0/#sec-function.prototype.apply).
  11343. *
  11344. * **Note:** This method is based on the
  11345. * [spread operator](https://mdn.io/spread_operator).
  11346. *
  11347. * @static
  11348. * @memberOf _
  11349. * @since 3.2.0
  11350. * @category Function
  11351. * @param {Function} func The function to spread arguments over.
  11352. * @param {number} [start=0] The start position of the spread.
  11353. * @returns {Function} Returns the new function.
  11354. * @example
  11355. *
  11356. * var say = _.spread(function(who, what) {
  11357. * return who + ' says ' + what;
  11358. * });
  11359. *
  11360. * say(['fred', 'hello']);
  11361. * // => 'fred says hello'
  11362. *
  11363. * var numbers = Promise.all([
  11364. * Promise.resolve(40),
  11365. * Promise.resolve(36)
  11366. * ]);
  11367. *
  11368. * numbers.then(_.spread(function(x, y) {
  11369. * return x + y;
  11370. * }));
  11371. * // => a Promise of 76
  11372. */
  11373. function spread(func, start) {
  11374. if (typeof func != 'function') {
  11375. throw new TypeError(FUNC_ERROR_TEXT);
  11376. }
  11377. start = start == null ? 0 : nativeMax(toInteger(start), 0);
  11378. return baseRest(function(args) {
  11379. var array = args[start],
  11380. otherArgs = castSlice(args, 0, start);
  11381. if (array) {
  11382. arrayPush(otherArgs, array);
  11383. }
  11384. return apply(func, this, otherArgs);
  11385. });
  11386. }
  11387. /**
  11388. * Creates a throttled function that only invokes `func` at most once per
  11389. * every `wait` milliseconds. The throttled function comes with a `cancel`
  11390. * method to cancel delayed `func` invocations and a `flush` method to
  11391. * immediately invoke them. Provide `options` to indicate whether `func`
  11392. * should be invoked on the leading and/or trailing edge of the `wait`
  11393. * timeout. The `func` is invoked with the last arguments provided to the
  11394. * throttled function. Subsequent calls to the throttled function return the
  11395. * result of the last `func` invocation.
  11396. *
  11397. * **Note:** If `leading` and `trailing` options are `true`, `func` is
  11398. * invoked on the trailing edge of the timeout only if the throttled function
  11399. * is invoked more than once during the `wait` timeout.
  11400. *
  11401. * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred
  11402. * until to the next tick, similar to `setTimeout` with a timeout of `0`.
  11403. *
  11404. * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/)
  11405. * for details over the differences between `_.throttle` and `_.debounce`.
  11406. *
  11407. * @static
  11408. * @memberOf _
  11409. * @since 0.1.0
  11410. * @category Function
  11411. * @param {Function} func The function to throttle.
  11412. * @param {number} [wait=0] The number of milliseconds to throttle invocations to.
  11413. * @param {Object} [options={}] The options object.
  11414. * @param {boolean} [options.leading=true]
  11415. * Specify invoking on the leading edge of the timeout.
  11416. * @param {boolean} [options.trailing=true]
  11417. * Specify invoking on the trailing edge of the timeout.
  11418. * @returns {Function} Returns the new throttled function.
  11419. * @example
  11420. *
  11421. * // Avoid excessively updating the position while scrolling.
  11422. * jQuery(window).on('scroll', _.throttle(updatePosition, 100));
  11423. *
  11424. * // Invoke `renewToken` when the click event is fired, but not more than once every 5 minutes.
  11425. * var throttled = _.throttle(renewToken, 300000, { 'trailing': false });
  11426. * jQuery(element).on('click', throttled);
  11427. *
  11428. * // Cancel the trailing throttled invocation.
  11429. * jQuery(window).on('popstate', throttled.cancel);
  11430. */
  11431. function throttle(func, wait, options) {
  11432. var leading = true,
  11433. trailing = true;
  11434. if (typeof func != 'function') {
  11435. throw new TypeError(FUNC_ERROR_TEXT);
  11436. }
  11437. if (isObject(options)) {
  11438. leading = 'leading' in options ? !!options.leading : leading;
  11439. trailing = 'trailing' in options ? !!options.trailing : trailing;
  11440. }
  11441. return debounce(func, wait, {
  11442. 'leading': leading,
  11443. 'maxWait': wait,
  11444. 'trailing': trailing
  11445. });
  11446. }
  11447. /**
  11448. * Creates a function that accepts up to one argument, ignoring any
  11449. * additional arguments.
  11450. *
  11451. * @static
  11452. * @memberOf _
  11453. * @since 4.0.0
  11454. * @category Function
  11455. * @param {Function} func The function to cap arguments for.
  11456. * @returns {Function} Returns the new capped function.
  11457. * @example
  11458. *
  11459. * _.map(['6', '8', '10'], _.unary(parseInt));
  11460. * // => [6, 8, 10]
  11461. */
  11462. function unary(func) {
  11463. return ary(func, 1);
  11464. }
  11465. /**
  11466. * Creates a function that provides `value` to `wrapper` as its first
  11467. * argument. Any additional arguments provided to the function are appended
  11468. * to those provided to the `wrapper`. The wrapper is invoked with the `this`
  11469. * binding of the created function.
  11470. *
  11471. * @static
  11472. * @memberOf _
  11473. * @since 0.1.0
  11474. * @category Function
  11475. * @param {*} value The value to wrap.
  11476. * @param {Function} [wrapper=identity] The wrapper function.
  11477. * @returns {Function} Returns the new function.
  11478. * @example
  11479. *
  11480. * var p = _.wrap(_.escape, function(func, text) {
  11481. * return '<p>' + func(text) + '</p>';
  11482. * });
  11483. *
  11484. * p('fred, barney, & pebbles');
  11485. * // => '<p>fred, barney, &amp; pebbles</p>'
  11486. */
  11487. function wrap(value, wrapper) {
  11488. return partial(castFunction(wrapper), value);
  11489. }
  11490. /*------------------------------------------------------------------------*/
  11491. /**
  11492. * Casts `value` as an array if it's not one.
  11493. *
  11494. * @static
  11495. * @memberOf _
  11496. * @since 4.4.0
  11497. * @category Lang
  11498. * @param {*} value The value to inspect.
  11499. * @returns {Array} Returns the cast array.
  11500. * @example
  11501. *
  11502. * _.castArray(1);
  11503. * // => [1]
  11504. *
  11505. * _.castArray({ 'a': 1 });
  11506. * // => [{ 'a': 1 }]
  11507. *
  11508. * _.castArray('abc');
  11509. * // => ['abc']
  11510. *
  11511. * _.castArray(null);
  11512. * // => [null]
  11513. *
  11514. * _.castArray(undefined);
  11515. * // => [undefined]
  11516. *
  11517. * _.castArray();
  11518. * // => []
  11519. *
  11520. * var array = [1, 2, 3];
  11521. * console.log(_.castArray(array) === array);
  11522. * // => true
  11523. */
  11524. function castArray() {
  11525. if (!arguments.length) {
  11526. return [];
  11527. }
  11528. var value = arguments[0];
  11529. return isArray(value) ? value : [value];
  11530. }
  11531. /**
  11532. * Creates a shallow clone of `value`.
  11533. *
  11534. * **Note:** This method is loosely based on the
  11535. * [structured clone algorithm](https://mdn.io/Structured_clone_algorithm)
  11536. * and supports cloning arrays, array buffers, booleans, date objects, maps,
  11537. * numbers, `Object` objects, regexes, sets, strings, symbols, and typed
  11538. * arrays. The own enumerable properties of `arguments` objects are cloned
  11539. * as plain objects. An empty object is returned for uncloneable values such
  11540. * as error objects, functions, DOM nodes, and WeakMaps.
  11541. *
  11542. * @static
  11543. * @memberOf _
  11544. * @since 0.1.0
  11545. * @category Lang
  11546. * @param {*} value The value to clone.
  11547. * @returns {*} Returns the cloned value.
  11548. * @see _.cloneDeep
  11549. * @example
  11550. *
  11551. * var objects = [{ 'a': 1 }, { 'b': 2 }];
  11552. *
  11553. * var shallow = _.clone(objects);
  11554. * console.log(shallow[0] === objects[0]);
  11555. * // => true
  11556. */
  11557. function clone(value) {
  11558. return baseClone(value, CLONE_SYMBOLS_FLAG);
  11559. }
  11560. /**
  11561. * This method is like `_.clone` except that it accepts `customizer` which
  11562. * is invoked to produce the cloned value. If `customizer` returns `undefined`,
  11563. * cloning is handled by the method instead. The `customizer` is invoked with
  11564. * up to four arguments; (value [, index|key, object, stack]).
  11565. *
  11566. * @static
  11567. * @memberOf _
  11568. * @since 4.0.0
  11569. * @category Lang
  11570. * @param {*} value The value to clone.
  11571. * @param {Function} [customizer] The function to customize cloning.
  11572. * @returns {*} Returns the cloned value.
  11573. * @see _.cloneDeepWith
  11574. * @example
  11575. *
  11576. * function customizer(value) {
  11577. * if (_.isElement(value)) {
  11578. * return value.cloneNode(false);
  11579. * }
  11580. * }
  11581. *
  11582. * var el = _.cloneWith(document.body, customizer);
  11583. *
  11584. * console.log(el === document.body);
  11585. * // => false
  11586. * console.log(el.nodeName);
  11587. * // => 'BODY'
  11588. * console.log(el.childNodes.length);
  11589. * // => 0
  11590. */
  11591. function cloneWith(value, customizer) {
  11592. customizer = typeof customizer == 'function' ? customizer : undefined;
  11593. return baseClone(value, CLONE_SYMBOLS_FLAG, customizer);
  11594. }
  11595. /**
  11596. * This method is like `_.clone` except that it recursively clones `value`.
  11597. *
  11598. * @static
  11599. * @memberOf _
  11600. * @since 1.0.0
  11601. * @category Lang
  11602. * @param {*} value The value to recursively clone.
  11603. * @returns {*} Returns the deep cloned value.
  11604. * @see _.clone
  11605. * @example
  11606. *
  11607. * var objects = [{ 'a': 1 }, { 'b': 2 }];
  11608. *
  11609. * var deep = _.cloneDeep(objects);
  11610. * console.log(deep[0] === objects[0]);
  11611. * // => false
  11612. */
  11613. function cloneDeep(value) {
  11614. return baseClone(value, CLONE_DEEP_FLAG | CLONE_SYMBOLS_FLAG);
  11615. }
  11616. /**
  11617. * This method is like `_.cloneWith` except that it recursively clones `value`.
  11618. *
  11619. * @static
  11620. * @memberOf _
  11621. * @since 4.0.0
  11622. * @category Lang
  11623. * @param {*} value The value to recursively clone.
  11624. * @param {Function} [customizer] The function to customize cloning.
  11625. * @returns {*} Returns the deep cloned value.
  11626. * @see _.cloneWith
  11627. * @example
  11628. *
  11629. * function customizer(value) {
  11630. * if (_.isElement(value)) {
  11631. * return value.cloneNode(true);
  11632. * }
  11633. * }
  11634. *
  11635. * var el = _.cloneDeepWith(document.body, customizer);
  11636. *
  11637. * console.log(el === document.body);
  11638. * // => false
  11639. * console.log(el.nodeName);
  11640. * // => 'BODY'
  11641. * console.log(el.childNodes.length);
  11642. * // => 20
  11643. */
  11644. function cloneDeepWith(value, customizer) {
  11645. customizer = typeof customizer == 'function' ? customizer : undefined;
  11646. return baseClone(value, CLONE_DEEP_FLAG | CLONE_SYMBOLS_FLAG, customizer);
  11647. }
  11648. /**
  11649. * Checks if `object` conforms to `source` by invoking the predicate
  11650. * properties of `source` with the corresponding property values of `object`.
  11651. *
  11652. * **Note:** This method is equivalent to `_.conforms` when `source` is
  11653. * partially applied.
  11654. *
  11655. * @static
  11656. * @memberOf _
  11657. * @since 4.14.0
  11658. * @category Lang
  11659. * @param {Object} object The object to inspect.
  11660. * @param {Object} source The object of property predicates to conform to.
  11661. * @returns {boolean} Returns `true` if `object` conforms, else `false`.
  11662. * @example
  11663. *
  11664. * var object = { 'a': 1, 'b': 2 };
  11665. *
  11666. * _.conformsTo(object, { 'b': function(n) { return n > 1; } });
  11667. * // => true
  11668. *
  11669. * _.conformsTo(object, { 'b': function(n) { return n > 2; } });
  11670. * // => false
  11671. */
  11672. function conformsTo(object, source) {
  11673. return source == null || baseConformsTo(object, source, keys(source));
  11674. }
  11675. /**
  11676. * Performs a
  11677. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  11678. * comparison between two values to determine if they are equivalent.
  11679. *
  11680. * @static
  11681. * @memberOf _
  11682. * @since 4.0.0
  11683. * @category Lang
  11684. * @param {*} value The value to compare.
  11685. * @param {*} other The other value to compare.
  11686. * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
  11687. * @example
  11688. *
  11689. * var object = { 'a': 1 };
  11690. * var other = { 'a': 1 };
  11691. *
  11692. * _.eq(object, object);
  11693. * // => true
  11694. *
  11695. * _.eq(object, other);
  11696. * // => false
  11697. *
  11698. * _.eq('a', 'a');
  11699. * // => true
  11700. *
  11701. * _.eq('a', Object('a'));
  11702. * // => false
  11703. *
  11704. * _.eq(NaN, NaN);
  11705. * // => true
  11706. */
  11707. function eq(value, other) {
  11708. return value === other || (value !== value && other !== other);
  11709. }
  11710. /**
  11711. * Checks if `value` is greater than `other`.
  11712. *
  11713. * @static
  11714. * @memberOf _
  11715. * @since 3.9.0
  11716. * @category Lang
  11717. * @param {*} value The value to compare.
  11718. * @param {*} other The other value to compare.
  11719. * @returns {boolean} Returns `true` if `value` is greater than `other`,
  11720. * else `false`.
  11721. * @see _.lt
  11722. * @example
  11723. *
  11724. * _.gt(3, 1);
  11725. * // => true
  11726. *
  11727. * _.gt(3, 3);
  11728. * // => false
  11729. *
  11730. * _.gt(1, 3);
  11731. * // => false
  11732. */
  11733. var gt = createRelationalOperation(baseGt);
  11734. /**
  11735. * Checks if `value` is greater than or equal to `other`.
  11736. *
  11737. * @static
  11738. * @memberOf _
  11739. * @since 3.9.0
  11740. * @category Lang
  11741. * @param {*} value The value to compare.
  11742. * @param {*} other The other value to compare.
  11743. * @returns {boolean} Returns `true` if `value` is greater than or equal to
  11744. * `other`, else `false`.
  11745. * @see _.lte
  11746. * @example
  11747. *
  11748. * _.gte(3, 1);
  11749. * // => true
  11750. *
  11751. * _.gte(3, 3);
  11752. * // => true
  11753. *
  11754. * _.gte(1, 3);
  11755. * // => false
  11756. */
  11757. var gte = createRelationalOperation(function(value, other) {
  11758. return value >= other;
  11759. });
  11760. /**
  11761. * Checks if `value` is likely an `arguments` object.
  11762. *
  11763. * @static
  11764. * @memberOf _
  11765. * @since 0.1.0
  11766. * @category Lang
  11767. * @param {*} value The value to check.
  11768. * @returns {boolean} Returns `true` if `value` is an `arguments` object,
  11769. * else `false`.
  11770. * @example
  11771. *
  11772. * _.isArguments(function() { return arguments; }());
  11773. * // => true
  11774. *
  11775. * _.isArguments([1, 2, 3]);
  11776. * // => false
  11777. */
  11778. var isArguments = baseIsArguments(function() { return arguments; }()) ? baseIsArguments : function(value) {
  11779. return isObjectLike(value) && hasOwnProperty.call(value, 'callee') &&
  11780. !propertyIsEnumerable.call(value, 'callee');
  11781. };
  11782. /**
  11783. * Checks if `value` is classified as an `Array` object.
  11784. *
  11785. * @static
  11786. * @memberOf _
  11787. * @since 0.1.0
  11788. * @category Lang
  11789. * @param {*} value The value to check.
  11790. * @returns {boolean} Returns `true` if `value` is an array, else `false`.
  11791. * @example
  11792. *
  11793. * _.isArray([1, 2, 3]);
  11794. * // => true
  11795. *
  11796. * _.isArray(document.body.children);
  11797. * // => false
  11798. *
  11799. * _.isArray('abc');
  11800. * // => false
  11801. *
  11802. * _.isArray(_.noop);
  11803. * // => false
  11804. */
  11805. var isArray = Array.isArray;
  11806. /**
  11807. * Checks if `value` is classified as an `ArrayBuffer` object.
  11808. *
  11809. * @static
  11810. * @memberOf _
  11811. * @since 4.3.0
  11812. * @category Lang
  11813. * @param {*} value The value to check.
  11814. * @returns {boolean} Returns `true` if `value` is an array buffer, else `false`.
  11815. * @example
  11816. *
  11817. * _.isArrayBuffer(new ArrayBuffer(2));
  11818. * // => true
  11819. *
  11820. * _.isArrayBuffer(new Array(2));
  11821. * // => false
  11822. */
  11823. var isArrayBuffer = nodeIsArrayBuffer ? baseUnary(nodeIsArrayBuffer) : baseIsArrayBuffer;
  11824. /**
  11825. * Checks if `value` is array-like. A value is considered array-like if it's
  11826. * not a function and has a `value.length` that's an integer greater than or
  11827. * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`.
  11828. *
  11829. * @static
  11830. * @memberOf _
  11831. * @since 4.0.0
  11832. * @category Lang
  11833. * @param {*} value The value to check.
  11834. * @returns {boolean} Returns `true` if `value` is array-like, else `false`.
  11835. * @example
  11836. *
  11837. * _.isArrayLike([1, 2, 3]);
  11838. * // => true
  11839. *
  11840. * _.isArrayLike(document.body.children);
  11841. * // => true
  11842. *
  11843. * _.isArrayLike('abc');
  11844. * // => true
  11845. *
  11846. * _.isArrayLike(_.noop);
  11847. * // => false
  11848. */
  11849. function isArrayLike(value) {
  11850. return value != null && isLength(value.length) && !isFunction(value);
  11851. }
  11852. /**
  11853. * This method is like `_.isArrayLike` except that it also checks if `value`
  11854. * is an object.
  11855. *
  11856. * @static
  11857. * @memberOf _
  11858. * @since 4.0.0
  11859. * @category Lang
  11860. * @param {*} value The value to check.
  11861. * @returns {boolean} Returns `true` if `value` is an array-like object,
  11862. * else `false`.
  11863. * @example
  11864. *
  11865. * _.isArrayLikeObject([1, 2, 3]);
  11866. * // => true
  11867. *
  11868. * _.isArrayLikeObject(document.body.children);
  11869. * // => true
  11870. *
  11871. * _.isArrayLikeObject('abc');
  11872. * // => false
  11873. *
  11874. * _.isArrayLikeObject(_.noop);
  11875. * // => false
  11876. */
  11877. function isArrayLikeObject(value) {
  11878. return isObjectLike(value) && isArrayLike(value);
  11879. }
  11880. /**
  11881. * Checks if `value` is classified as a boolean primitive or object.
  11882. *
  11883. * @static
  11884. * @memberOf _
  11885. * @since 0.1.0
  11886. * @category Lang
  11887. * @param {*} value The value to check.
  11888. * @returns {boolean} Returns `true` if `value` is a boolean, else `false`.
  11889. * @example
  11890. *
  11891. * _.isBoolean(false);
  11892. * // => true
  11893. *
  11894. * _.isBoolean(null);
  11895. * // => false
  11896. */
  11897. function isBoolean(value) {
  11898. return value === true || value === false ||
  11899. (isObjectLike(value) && baseGetTag(value) == boolTag);
  11900. }
  11901. /**
  11902. * Checks if `value` is a buffer.
  11903. *
  11904. * @static
  11905. * @memberOf _
  11906. * @since 4.3.0
  11907. * @category Lang
  11908. * @param {*} value The value to check.
  11909. * @returns {boolean} Returns `true` if `value` is a buffer, else `false`.
  11910. * @example
  11911. *
  11912. * _.isBuffer(new Buffer(2));
  11913. * // => true
  11914. *
  11915. * _.isBuffer(new Uint8Array(2));
  11916. * // => false
  11917. */
  11918. var isBuffer = nativeIsBuffer || stubFalse;
  11919. /**
  11920. * Checks if `value` is classified as a `Date` object.
  11921. *
  11922. * @static
  11923. * @memberOf _
  11924. * @since 0.1.0
  11925. * @category Lang
  11926. * @param {*} value The value to check.
  11927. * @returns {boolean} Returns `true` if `value` is a date object, else `false`.
  11928. * @example
  11929. *
  11930. * _.isDate(new Date);
  11931. * // => true
  11932. *
  11933. * _.isDate('Mon April 23 2012');
  11934. * // => false
  11935. */
  11936. var isDate = nodeIsDate ? baseUnary(nodeIsDate) : baseIsDate;
  11937. /**
  11938. * Checks if `value` is likely a DOM element.
  11939. *
  11940. * @static
  11941. * @memberOf _
  11942. * @since 0.1.0
  11943. * @category Lang
  11944. * @param {*} value The value to check.
  11945. * @returns {boolean} Returns `true` if `value` is a DOM element, else `false`.
  11946. * @example
  11947. *
  11948. * _.isElement(document.body);
  11949. * // => true
  11950. *
  11951. * _.isElement('<body>');
  11952. * // => false
  11953. */
  11954. function isElement(value) {
  11955. return isObjectLike(value) && value.nodeType === 1 && !isPlainObject(value);
  11956. }
  11957. /**
  11958. * Checks if `value` is an empty object, collection, map, or set.
  11959. *
  11960. * Objects are considered empty if they have no own enumerable string keyed
  11961. * properties.
  11962. *
  11963. * Array-like values such as `arguments` objects, arrays, buffers, strings, or
  11964. * jQuery-like collections are considered empty if they have a `length` of `0`.
  11965. * Similarly, maps and sets are considered empty if they have a `size` of `0`.
  11966. *
  11967. * @static
  11968. * @memberOf _
  11969. * @since 0.1.0
  11970. * @category Lang
  11971. * @param {*} value The value to check.
  11972. * @returns {boolean} Returns `true` if `value` is empty, else `false`.
  11973. * @example
  11974. *
  11975. * _.isEmpty(null);
  11976. * // => true
  11977. *
  11978. * _.isEmpty(true);
  11979. * // => true
  11980. *
  11981. * _.isEmpty(1);
  11982. * // => true
  11983. *
  11984. * _.isEmpty([1, 2, 3]);
  11985. * // => false
  11986. *
  11987. * _.isEmpty({ 'a': 1 });
  11988. * // => false
  11989. */
  11990. function isEmpty(value) {
  11991. if (value == null) {
  11992. return true;
  11993. }
  11994. if (isArrayLike(value) &&
  11995. (isArray(value) || typeof value == 'string' || typeof value.splice == 'function' ||
  11996. isBuffer(value) || isTypedArray(value) || isArguments(value))) {
  11997. return !value.length;
  11998. }
  11999. var tag = getTag(value);
  12000. if (tag == mapTag || tag == setTag) {
  12001. return !value.size;
  12002. }
  12003. if (isPrototype(value)) {
  12004. return !baseKeys(value).length;
  12005. }
  12006. for (var key in value) {
  12007. if (hasOwnProperty.call(value, key)) {
  12008. return false;
  12009. }
  12010. }
  12011. return true;
  12012. }
  12013. /**
  12014. * Performs a deep comparison between two values to determine if they are
  12015. * equivalent.
  12016. *
  12017. * **Note:** This method supports comparing arrays, array buffers, booleans,
  12018. * date objects, error objects, maps, numbers, `Object` objects, regexes,
  12019. * sets, strings, symbols, and typed arrays. `Object` objects are compared
  12020. * by their own, not inherited, enumerable properties. Functions and DOM
  12021. * nodes are compared by strict equality, i.e. `===`.
  12022. *
  12023. * @static
  12024. * @memberOf _
  12025. * @since 0.1.0
  12026. * @category Lang
  12027. * @param {*} value The value to compare.
  12028. * @param {*} other The other value to compare.
  12029. * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
  12030. * @example
  12031. *
  12032. * var object = { 'a': 1 };
  12033. * var other = { 'a': 1 };
  12034. *
  12035. * _.isEqual(object, other);
  12036. * // => true
  12037. *
  12038. * object === other;
  12039. * // => false
  12040. */
  12041. function isEqual(value, other) {
  12042. return baseIsEqual(value, other);
  12043. }
  12044. /**
  12045. * This method is like `_.isEqual` except that it accepts `customizer` which
  12046. * is invoked to compare values. If `customizer` returns `undefined`, comparisons
  12047. * are handled by the method instead. The `customizer` is invoked with up to
  12048. * six arguments: (objValue, othValue [, index|key, object, other, stack]).
  12049. *
  12050. * @static
  12051. * @memberOf _
  12052. * @since 4.0.0
  12053. * @category Lang
  12054. * @param {*} value The value to compare.
  12055. * @param {*} other The other value to compare.
  12056. * @param {Function} [customizer] The function to customize comparisons.
  12057. * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
  12058. * @example
  12059. *
  12060. * function isGreeting(value) {
  12061. * return /^h(?:i|ello)$/.test(value);
  12062. * }
  12063. *
  12064. * function customizer(objValue, othValue) {
  12065. * if (isGreeting(objValue) && isGreeting(othValue)) {
  12066. * return true;
  12067. * }
  12068. * }
  12069. *
  12070. * var array = ['hello', 'goodbye'];
  12071. * var other = ['hi', 'goodbye'];
  12072. *
  12073. * _.isEqualWith(array, other, customizer);
  12074. * // => true
  12075. */
  12076. function isEqualWith(value, other, customizer) {
  12077. customizer = typeof customizer == 'function' ? customizer : undefined;
  12078. var result = customizer ? customizer(value, other) : undefined;
  12079. return result === undefined ? baseIsEqual(value, other, undefined, customizer) : !!result;
  12080. }
  12081. /**
  12082. * Checks if `value` is an `Error`, `EvalError`, `RangeError`, `ReferenceError`,
  12083. * `SyntaxError`, `TypeError`, or `URIError` object.
  12084. *
  12085. * @static
  12086. * @memberOf _
  12087. * @since 3.0.0
  12088. * @category Lang
  12089. * @param {*} value The value to check.
  12090. * @returns {boolean} Returns `true` if `value` is an error object, else `false`.
  12091. * @example
  12092. *
  12093. * _.isError(new Error);
  12094. * // => true
  12095. *
  12096. * _.isError(Error);
  12097. * // => false
  12098. */
  12099. function isError(value) {
  12100. if (!isObjectLike(value)) {
  12101. return false;
  12102. }
  12103. var tag = baseGetTag(value);
  12104. return tag == errorTag || tag == domExcTag ||
  12105. (typeof value.message == 'string' && typeof value.name == 'string' && !isPlainObject(value));
  12106. }
  12107. /**
  12108. * Checks if `value` is a finite primitive number.
  12109. *
  12110. * **Note:** This method is based on
  12111. * [`Number.isFinite`](https://mdn.io/Number/isFinite).
  12112. *
  12113. * @static
  12114. * @memberOf _
  12115. * @since 0.1.0
  12116. * @category Lang
  12117. * @param {*} value The value to check.
  12118. * @returns {boolean} Returns `true` if `value` is a finite number, else `false`.
  12119. * @example
  12120. *
  12121. * _.isFinite(3);
  12122. * // => true
  12123. *
  12124. * _.isFinite(Number.MIN_VALUE);
  12125. * // => true
  12126. *
  12127. * _.isFinite(Infinity);
  12128. * // => false
  12129. *
  12130. * _.isFinite('3');
  12131. * // => false
  12132. */
  12133. function isFinite(value) {
  12134. return typeof value == 'number' && nativeIsFinite(value);
  12135. }
  12136. /**
  12137. * Checks if `value` is classified as a `Function` object.
  12138. *
  12139. * @static
  12140. * @memberOf _
  12141. * @since 0.1.0
  12142. * @category Lang
  12143. * @param {*} value The value to check.
  12144. * @returns {boolean} Returns `true` if `value` is a function, else `false`.
  12145. * @example
  12146. *
  12147. * _.isFunction(_);
  12148. * // => true
  12149. *
  12150. * _.isFunction(/abc/);
  12151. * // => false
  12152. */
  12153. function isFunction(value) {
  12154. if (!isObject(value)) {
  12155. return false;
  12156. }
  12157. // The use of `Object#toString` avoids issues with the `typeof` operator
  12158. // in Safari 9 which returns 'object' for typed arrays and other constructors.
  12159. var tag = baseGetTag(value);
  12160. return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag;
  12161. }
  12162. /**
  12163. * Checks if `value` is an integer.
  12164. *
  12165. * **Note:** This method is based on
  12166. * [`Number.isInteger`](https://mdn.io/Number/isInteger).
  12167. *
  12168. * @static
  12169. * @memberOf _
  12170. * @since 4.0.0
  12171. * @category Lang
  12172. * @param {*} value The value to check.
  12173. * @returns {boolean} Returns `true` if `value` is an integer, else `false`.
  12174. * @example
  12175. *
  12176. * _.isInteger(3);
  12177. * // => true
  12178. *
  12179. * _.isInteger(Number.MIN_VALUE);
  12180. * // => false
  12181. *
  12182. * _.isInteger(Infinity);
  12183. * // => false
  12184. *
  12185. * _.isInteger('3');
  12186. * // => false
  12187. */
  12188. function isInteger(value) {
  12189. return typeof value == 'number' && value == toInteger(value);
  12190. }
  12191. /**
  12192. * Checks if `value` is a valid array-like length.
  12193. *
  12194. * **Note:** This method is loosely based on
  12195. * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).
  12196. *
  12197. * @static
  12198. * @memberOf _
  12199. * @since 4.0.0
  12200. * @category Lang
  12201. * @param {*} value The value to check.
  12202. * @returns {boolean} Returns `true` if `value` is a valid length, else `false`.
  12203. * @example
  12204. *
  12205. * _.isLength(3);
  12206. * // => true
  12207. *
  12208. * _.isLength(Number.MIN_VALUE);
  12209. * // => false
  12210. *
  12211. * _.isLength(Infinity);
  12212. * // => false
  12213. *
  12214. * _.isLength('3');
  12215. * // => false
  12216. */
  12217. function isLength(value) {
  12218. return typeof value == 'number' &&
  12219. value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;
  12220. }
  12221. /**
  12222. * Checks if `value` is the
  12223. * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)
  12224. * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
  12225. *
  12226. * @static
  12227. * @memberOf _
  12228. * @since 0.1.0
  12229. * @category Lang
  12230. * @param {*} value The value to check.
  12231. * @returns {boolean} Returns `true` if `value` is an object, else `false`.
  12232. * @example
  12233. *
  12234. * _.isObject({});
  12235. * // => true
  12236. *
  12237. * _.isObject([1, 2, 3]);
  12238. * // => true
  12239. *
  12240. * _.isObject(_.noop);
  12241. * // => true
  12242. *
  12243. * _.isObject(null);
  12244. * // => false
  12245. */
  12246. function isObject(value) {
  12247. var type = typeof value;
  12248. return value != null && (type == 'object' || type == 'function');
  12249. }
  12250. /**
  12251. * Checks if `value` is object-like. A value is object-like if it's not `null`
  12252. * and has a `typeof` result of "object".
  12253. *
  12254. * @static
  12255. * @memberOf _
  12256. * @since 4.0.0
  12257. * @category Lang
  12258. * @param {*} value The value to check.
  12259. * @returns {boolean} Returns `true` if `value` is object-like, else `false`.
  12260. * @example
  12261. *
  12262. * _.isObjectLike({});
  12263. * // => true
  12264. *
  12265. * _.isObjectLike([1, 2, 3]);
  12266. * // => true
  12267. *
  12268. * _.isObjectLike(_.noop);
  12269. * // => false
  12270. *
  12271. * _.isObjectLike(null);
  12272. * // => false
  12273. */
  12274. function isObjectLike(value) {
  12275. return value != null && typeof value == 'object';
  12276. }
  12277. /**
  12278. * Checks if `value` is classified as a `Map` object.
  12279. *
  12280. * @static
  12281. * @memberOf _
  12282. * @since 4.3.0
  12283. * @category Lang
  12284. * @param {*} value The value to check.
  12285. * @returns {boolean} Returns `true` if `value` is a map, else `false`.
  12286. * @example
  12287. *
  12288. * _.isMap(new Map);
  12289. * // => true
  12290. *
  12291. * _.isMap(new WeakMap);
  12292. * // => false
  12293. */
  12294. var isMap = nodeIsMap ? baseUnary(nodeIsMap) : baseIsMap;
  12295. /**
  12296. * Performs a partial deep comparison between `object` and `source` to
  12297. * determine if `object` contains equivalent property values.
  12298. *
  12299. * **Note:** This method is equivalent to `_.matches` when `source` is
  12300. * partially applied.
  12301. *
  12302. * Partial comparisons will match empty array and empty object `source`
  12303. * values against any array or object value, respectively. See `_.isEqual`
  12304. * for a list of supported value comparisons.
  12305. *
  12306. * @static
  12307. * @memberOf _
  12308. * @since 3.0.0
  12309. * @category Lang
  12310. * @param {Object} object The object to inspect.
  12311. * @param {Object} source The object of property values to match.
  12312. * @returns {boolean} Returns `true` if `object` is a match, else `false`.
  12313. * @example
  12314. *
  12315. * var object = { 'a': 1, 'b': 2 };
  12316. *
  12317. * _.isMatch(object, { 'b': 2 });
  12318. * // => true
  12319. *
  12320. * _.isMatch(object, { 'b': 1 });
  12321. * // => false
  12322. */
  12323. function isMatch(object, source) {
  12324. return object === source || baseIsMatch(object, source, getMatchData(source));
  12325. }
  12326. /**
  12327. * This method is like `_.isMatch` except that it accepts `customizer` which
  12328. * is invoked to compare values. If `customizer` returns `undefined`, comparisons
  12329. * are handled by the method instead. The `customizer` is invoked with five
  12330. * arguments: (objValue, srcValue, index|key, object, source).
  12331. *
  12332. * @static
  12333. * @memberOf _
  12334. * @since 4.0.0
  12335. * @category Lang
  12336. * @param {Object} object The object to inspect.
  12337. * @param {Object} source The object of property values to match.
  12338. * @param {Function} [customizer] The function to customize comparisons.
  12339. * @returns {boolean} Returns `true` if `object` is a match, else `false`.
  12340. * @example
  12341. *
  12342. * function isGreeting(value) {
  12343. * return /^h(?:i|ello)$/.test(value);
  12344. * }
  12345. *
  12346. * function customizer(objValue, srcValue) {
  12347. * if (isGreeting(objValue) && isGreeting(srcValue)) {
  12348. * return true;
  12349. * }
  12350. * }
  12351. *
  12352. * var object = { 'greeting': 'hello' };
  12353. * var source = { 'greeting': 'hi' };
  12354. *
  12355. * _.isMatchWith(object, source, customizer);
  12356. * // => true
  12357. */
  12358. function isMatchWith(object, source, customizer) {
  12359. customizer = typeof customizer == 'function' ? customizer : undefined;
  12360. return baseIsMatch(object, source, getMatchData(source), customizer);
  12361. }
  12362. /**
  12363. * Checks if `value` is `NaN`.
  12364. *
  12365. * **Note:** This method is based on
  12366. * [`Number.isNaN`](https://mdn.io/Number/isNaN) and is not the same as
  12367. * global [`isNaN`](https://mdn.io/isNaN) which returns `true` for
  12368. * `undefined` and other non-number values.
  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 `NaN`, else `false`.
  12376. * @example
  12377. *
  12378. * _.isNaN(NaN);
  12379. * // => true
  12380. *
  12381. * _.isNaN(new Number(NaN));
  12382. * // => true
  12383. *
  12384. * isNaN(undefined);
  12385. * // => true
  12386. *
  12387. * _.isNaN(undefined);
  12388. * // => false
  12389. */
  12390. function isNaN(value) {
  12391. // An `NaN` primitive is the only value that is not equal to itself.
  12392. // Perform the `toStringTag` check first to avoid errors with some
  12393. // ActiveX objects in IE.
  12394. return isNumber(value) && value != +value;
  12395. }
  12396. /**
  12397. * Checks if `value` is a pristine native function.
  12398. *
  12399. * **Note:** This method can't reliably detect native functions in the presence
  12400. * of the core-js package because core-js circumvents this kind of detection.
  12401. * Despite multiple requests, the core-js maintainer has made it clear: any
  12402. * attempt to fix the detection will be obstructed. As a result, we're left
  12403. * with little choice but to throw an error. Unfortunately, this also affects
  12404. * packages, like [babel-polyfill](https://www.npmjs.com/package/babel-polyfill),
  12405. * which rely on core-js.
  12406. *
  12407. * @static
  12408. * @memberOf _
  12409. * @since 3.0.0
  12410. * @category Lang
  12411. * @param {*} value The value to check.
  12412. * @returns {boolean} Returns `true` if `value` is a native function,
  12413. * else `false`.
  12414. * @example
  12415. *
  12416. * _.isNative(Array.prototype.push);
  12417. * // => true
  12418. *
  12419. * _.isNative(_);
  12420. * // => false
  12421. */
  12422. function isNative(value) {
  12423. if (isMaskable(value)) {
  12424. throw new Error(CORE_ERROR_TEXT);
  12425. }
  12426. return baseIsNative(value);
  12427. }
  12428. /**
  12429. * Checks if `value` is `null`.
  12430. *
  12431. * @static
  12432. * @memberOf _
  12433. * @since 0.1.0
  12434. * @category Lang
  12435. * @param {*} value The value to check.
  12436. * @returns {boolean} Returns `true` if `value` is `null`, else `false`.
  12437. * @example
  12438. *
  12439. * _.isNull(null);
  12440. * // => true
  12441. *
  12442. * _.isNull(void 0);
  12443. * // => false
  12444. */
  12445. function isNull(value) {
  12446. return value === null;
  12447. }
  12448. /**
  12449. * Checks if `value` is `null` or `undefined`.
  12450. *
  12451. * @static
  12452. * @memberOf _
  12453. * @since 4.0.0
  12454. * @category Lang
  12455. * @param {*} value The value to check.
  12456. * @returns {boolean} Returns `true` if `value` is nullish, else `false`.
  12457. * @example
  12458. *
  12459. * _.isNil(null);
  12460. * // => true
  12461. *
  12462. * _.isNil(void 0);
  12463. * // => true
  12464. *
  12465. * _.isNil(NaN);
  12466. * // => false
  12467. */
  12468. function isNil(value) {
  12469. return value == null;
  12470. }
  12471. /**
  12472. * Checks if `value` is classified as a `Number` primitive or object.
  12473. *
  12474. * **Note:** To exclude `Infinity`, `-Infinity`, and `NaN`, which are
  12475. * classified as numbers, use the `_.isFinite` method.
  12476. *
  12477. * @static
  12478. * @memberOf _
  12479. * @since 0.1.0
  12480. * @category Lang
  12481. * @param {*} value The value to check.
  12482. * @returns {boolean} Returns `true` if `value` is a number, else `false`.
  12483. * @example
  12484. *
  12485. * _.isNumber(3);
  12486. * // => true
  12487. *
  12488. * _.isNumber(Number.MIN_VALUE);
  12489. * // => true
  12490. *
  12491. * _.isNumber(Infinity);
  12492. * // => true
  12493. *
  12494. * _.isNumber('3');
  12495. * // => false
  12496. */
  12497. function isNumber(value) {
  12498. return typeof value == 'number' ||
  12499. (isObjectLike(value) && baseGetTag(value) == numberTag);
  12500. }
  12501. /**
  12502. * Checks if `value` is a plain object, that is, an object created by the
  12503. * `Object` constructor or one with a `[[Prototype]]` of `null`.
  12504. *
  12505. * @static
  12506. * @memberOf _
  12507. * @since 0.8.0
  12508. * @category Lang
  12509. * @param {*} value The value to check.
  12510. * @returns {boolean} Returns `true` if `value` is a plain object, else `false`.
  12511. * @example
  12512. *
  12513. * function Foo() {
  12514. * this.a = 1;
  12515. * }
  12516. *
  12517. * _.isPlainObject(new Foo);
  12518. * // => false
  12519. *
  12520. * _.isPlainObject([1, 2, 3]);
  12521. * // => false
  12522. *
  12523. * _.isPlainObject({ 'x': 0, 'y': 0 });
  12524. * // => true
  12525. *
  12526. * _.isPlainObject(Object.create(null));
  12527. * // => true
  12528. */
  12529. function isPlainObject(value) {
  12530. if (!isObjectLike(value) || baseGetTag(value) != objectTag) {
  12531. return false;
  12532. }
  12533. var proto = getPrototype(value);
  12534. if (proto === null) {
  12535. return true;
  12536. }
  12537. var Ctor = hasOwnProperty.call(proto, 'constructor') && proto.constructor;
  12538. return typeof Ctor == 'function' && Ctor instanceof Ctor &&
  12539. funcToString.call(Ctor) == objectCtorString;
  12540. }
  12541. /**
  12542. * Checks if `value` is classified as a `RegExp` object.
  12543. *
  12544. * @static
  12545. * @memberOf _
  12546. * @since 0.1.0
  12547. * @category Lang
  12548. * @param {*} value The value to check.
  12549. * @returns {boolean} Returns `true` if `value` is a regexp, else `false`.
  12550. * @example
  12551. *
  12552. * _.isRegExp(/abc/);
  12553. * // => true
  12554. *
  12555. * _.isRegExp('/abc/');
  12556. * // => false
  12557. */
  12558. var isRegExp = nodeIsRegExp ? baseUnary(nodeIsRegExp) : baseIsRegExp;
  12559. /**
  12560. * Checks if `value` is a safe integer. An integer is safe if it's an IEEE-754
  12561. * double precision number which isn't the result of a rounded unsafe integer.
  12562. *
  12563. * **Note:** This method is based on
  12564. * [`Number.isSafeInteger`](https://mdn.io/Number/isSafeInteger).
  12565. *
  12566. * @static
  12567. * @memberOf _
  12568. * @since 4.0.0
  12569. * @category Lang
  12570. * @param {*} value The value to check.
  12571. * @returns {boolean} Returns `true` if `value` is a safe integer, else `false`.
  12572. * @example
  12573. *
  12574. * _.isSafeInteger(3);
  12575. * // => true
  12576. *
  12577. * _.isSafeInteger(Number.MIN_VALUE);
  12578. * // => false
  12579. *
  12580. * _.isSafeInteger(Infinity);
  12581. * // => false
  12582. *
  12583. * _.isSafeInteger('3');
  12584. * // => false
  12585. */
  12586. function isSafeInteger(value) {
  12587. return isInteger(value) && value >= -MAX_SAFE_INTEGER && value <= MAX_SAFE_INTEGER;
  12588. }
  12589. /**
  12590. * Checks if `value` is classified as a `Set` object.
  12591. *
  12592. * @static
  12593. * @memberOf _
  12594. * @since 4.3.0
  12595. * @category Lang
  12596. * @param {*} value The value to check.
  12597. * @returns {boolean} Returns `true` if `value` is a set, else `false`.
  12598. * @example
  12599. *
  12600. * _.isSet(new Set);
  12601. * // => true
  12602. *
  12603. * _.isSet(new WeakSet);
  12604. * // => false
  12605. */
  12606. var isSet = nodeIsSet ? baseUnary(nodeIsSet) : baseIsSet;
  12607. /**
  12608. * Checks if `value` is classified as a `String` primitive or object.
  12609. *
  12610. * @static
  12611. * @since 0.1.0
  12612. * @memberOf _
  12613. * @category Lang
  12614. * @param {*} value The value to check.
  12615. * @returns {boolean} Returns `true` if `value` is a string, else `false`.
  12616. * @example
  12617. *
  12618. * _.isString('abc');
  12619. * // => true
  12620. *
  12621. * _.isString(1);
  12622. * // => false
  12623. */
  12624. function isString(value) {
  12625. return typeof value == 'string' ||
  12626. (!isArray(value) && isObjectLike(value) && baseGetTag(value) == stringTag);
  12627. }
  12628. /**
  12629. * Checks if `value` is classified as a `Symbol` primitive or object.
  12630. *
  12631. * @static
  12632. * @memberOf _
  12633. * @since 4.0.0
  12634. * @category Lang
  12635. * @param {*} value The value to check.
  12636. * @returns {boolean} Returns `true` if `value` is a symbol, else `false`.
  12637. * @example
  12638. *
  12639. * _.isSymbol(Symbol.iterator);
  12640. * // => true
  12641. *
  12642. * _.isSymbol('abc');
  12643. * // => false
  12644. */
  12645. function isSymbol(value) {
  12646. return typeof value == 'symbol' ||
  12647. (isObjectLike(value) && baseGetTag(value) == symbolTag);
  12648. }
  12649. /**
  12650. * Checks if `value` is classified as a typed array.
  12651. *
  12652. * @static
  12653. * @memberOf _
  12654. * @since 3.0.0
  12655. * @category Lang
  12656. * @param {*} value The value to check.
  12657. * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.
  12658. * @example
  12659. *
  12660. * _.isTypedArray(new Uint8Array);
  12661. * // => true
  12662. *
  12663. * _.isTypedArray([]);
  12664. * // => false
  12665. */
  12666. var isTypedArray = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray;
  12667. /**
  12668. * Checks if `value` is `undefined`.
  12669. *
  12670. * @static
  12671. * @since 0.1.0
  12672. * @memberOf _
  12673. * @category Lang
  12674. * @param {*} value The value to check.
  12675. * @returns {boolean} Returns `true` if `value` is `undefined`, else `false`.
  12676. * @example
  12677. *
  12678. * _.isUndefined(void 0);
  12679. * // => true
  12680. *
  12681. * _.isUndefined(null);
  12682. * // => false
  12683. */
  12684. function isUndefined(value) {
  12685. return value === undefined;
  12686. }
  12687. /**
  12688. * Checks if `value` is classified as a `WeakMap` object.
  12689. *
  12690. * @static
  12691. * @memberOf _
  12692. * @since 4.3.0
  12693. * @category Lang
  12694. * @param {*} value The value to check.
  12695. * @returns {boolean} Returns `true` if `value` is a weak map, else `false`.
  12696. * @example
  12697. *
  12698. * _.isWeakMap(new WeakMap);
  12699. * // => true
  12700. *
  12701. * _.isWeakMap(new Map);
  12702. * // => false
  12703. */
  12704. function isWeakMap(value) {
  12705. return isObjectLike(value) && getTag(value) == weakMapTag;
  12706. }
  12707. /**
  12708. * Checks if `value` is classified as a `WeakSet` object.
  12709. *
  12710. * @static
  12711. * @memberOf _
  12712. * @since 4.3.0
  12713. * @category Lang
  12714. * @param {*} value The value to check.
  12715. * @returns {boolean} Returns `true` if `value` is a weak set, else `false`.
  12716. * @example
  12717. *
  12718. * _.isWeakSet(new WeakSet);
  12719. * // => true
  12720. *
  12721. * _.isWeakSet(new Set);
  12722. * // => false
  12723. */
  12724. function isWeakSet(value) {
  12725. return isObjectLike(value) && baseGetTag(value) == weakSetTag;
  12726. }
  12727. /**
  12728. * Checks if `value` is less than `other`.
  12729. *
  12730. * @static
  12731. * @memberOf _
  12732. * @since 3.9.0
  12733. * @category Lang
  12734. * @param {*} value The value to compare.
  12735. * @param {*} other The other value to compare.
  12736. * @returns {boolean} Returns `true` if `value` is less than `other`,
  12737. * else `false`.
  12738. * @see _.gt
  12739. * @example
  12740. *
  12741. * _.lt(1, 3);
  12742. * // => true
  12743. *
  12744. * _.lt(3, 3);
  12745. * // => false
  12746. *
  12747. * _.lt(3, 1);
  12748. * // => false
  12749. */
  12750. var lt = createRelationalOperation(baseLt);
  12751. /**
  12752. * Checks if `value` is less than or equal to `other`.
  12753. *
  12754. * @static
  12755. * @memberOf _
  12756. * @since 3.9.0
  12757. * @category Lang
  12758. * @param {*} value The value to compare.
  12759. * @param {*} other The other value to compare.
  12760. * @returns {boolean} Returns `true` if `value` is less than or equal to
  12761. * `other`, else `false`.
  12762. * @see _.gte
  12763. * @example
  12764. *
  12765. * _.lte(1, 3);
  12766. * // => true
  12767. *
  12768. * _.lte(3, 3);
  12769. * // => true
  12770. *
  12771. * _.lte(3, 1);
  12772. * // => false
  12773. */
  12774. var lte = createRelationalOperation(function(value, other) {
  12775. return value <= other;
  12776. });
  12777. /**
  12778. * Converts `value` to an array.
  12779. *
  12780. * @static
  12781. * @since 0.1.0
  12782. * @memberOf _
  12783. * @category Lang
  12784. * @param {*} value The value to convert.
  12785. * @returns {Array} Returns the converted array.
  12786. * @example
  12787. *
  12788. * _.toArray({ 'a': 1, 'b': 2 });
  12789. * // => [1, 2]
  12790. *
  12791. * _.toArray('abc');
  12792. * // => ['a', 'b', 'c']
  12793. *
  12794. * _.toArray(1);
  12795. * // => []
  12796. *
  12797. * _.toArray(null);
  12798. * // => []
  12799. */
  12800. function toArray(value) {
  12801. if (!value) {
  12802. return [];
  12803. }
  12804. if (isArrayLike(value)) {
  12805. return isString(value) ? stringToArray(value) : copyArray(value);
  12806. }
  12807. if (symIterator && value[symIterator]) {
  12808. return iteratorToArray(value[symIterator]());
  12809. }
  12810. var tag = getTag(value),
  12811. func = tag == mapTag ? mapToArray : (tag == setTag ? setToArray : values);
  12812. return func(value);
  12813. }
  12814. /**
  12815. * Converts `value` to a finite number.
  12816. *
  12817. * @static
  12818. * @memberOf _
  12819. * @since 4.12.0
  12820. * @category Lang
  12821. * @param {*} value The value to convert.
  12822. * @returns {number} Returns the converted number.
  12823. * @example
  12824. *
  12825. * _.toFinite(3.2);
  12826. * // => 3.2
  12827. *
  12828. * _.toFinite(Number.MIN_VALUE);
  12829. * // => 5e-324
  12830. *
  12831. * _.toFinite(Infinity);
  12832. * // => 1.7976931348623157e+308
  12833. *
  12834. * _.toFinite('3.2');
  12835. * // => 3.2
  12836. */
  12837. function toFinite(value) {
  12838. if (!value) {
  12839. return value === 0 ? value : 0;
  12840. }
  12841. value = toNumber(value);
  12842. if (value === INFINITY || value === -INFINITY) {
  12843. var sign = (value < 0 ? -1 : 1);
  12844. return sign * MAX_INTEGER;
  12845. }
  12846. return value === value ? value : 0;
  12847. }
  12848. /**
  12849. * Converts `value` to an integer.
  12850. *
  12851. * **Note:** This method is loosely based on
  12852. * [`ToInteger`](http://www.ecma-international.org/ecma-262/7.0/#sec-tointeger).
  12853. *
  12854. * @static
  12855. * @memberOf _
  12856. * @since 4.0.0
  12857. * @category Lang
  12858. * @param {*} value The value to convert.
  12859. * @returns {number} Returns the converted integer.
  12860. * @example
  12861. *
  12862. * _.toInteger(3.2);
  12863. * // => 3
  12864. *
  12865. * _.toInteger(Number.MIN_VALUE);
  12866. * // => 0
  12867. *
  12868. * _.toInteger(Infinity);
  12869. * // => 1.7976931348623157e+308
  12870. *
  12871. * _.toInteger('3.2');
  12872. * // => 3
  12873. */
  12874. function toInteger(value) {
  12875. var result = toFinite(value),
  12876. remainder = result % 1;
  12877. return result === result ? (remainder ? result - remainder : result) : 0;
  12878. }
  12879. /**
  12880. * Converts `value` to an integer suitable for use as the length of an
  12881. * array-like object.
  12882. *
  12883. * **Note:** This method is based on
  12884. * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).
  12885. *
  12886. * @static
  12887. * @memberOf _
  12888. * @since 4.0.0
  12889. * @category Lang
  12890. * @param {*} value The value to convert.
  12891. * @returns {number} Returns the converted integer.
  12892. * @example
  12893. *
  12894. * _.toLength(3.2);
  12895. * // => 3
  12896. *
  12897. * _.toLength(Number.MIN_VALUE);
  12898. * // => 0
  12899. *
  12900. * _.toLength(Infinity);
  12901. * // => 4294967295
  12902. *
  12903. * _.toLength('3.2');
  12904. * // => 3
  12905. */
  12906. function toLength(value) {
  12907. return value ? baseClamp(toInteger(value), 0, MAX_ARRAY_LENGTH) : 0;
  12908. }
  12909. /**
  12910. * Converts `value` to a number.
  12911. *
  12912. * @static
  12913. * @memberOf _
  12914. * @since 4.0.0
  12915. * @category Lang
  12916. * @param {*} value The value to process.
  12917. * @returns {number} Returns the number.
  12918. * @example
  12919. *
  12920. * _.toNumber(3.2);
  12921. * // => 3.2
  12922. *
  12923. * _.toNumber(Number.MIN_VALUE);
  12924. * // => 5e-324
  12925. *
  12926. * _.toNumber(Infinity);
  12927. * // => Infinity
  12928. *
  12929. * _.toNumber('3.2');
  12930. * // => 3.2
  12931. */
  12932. function toNumber(value) {
  12933. if (typeof value == 'number') {
  12934. return value;
  12935. }
  12936. if (isSymbol(value)) {
  12937. return NAN;
  12938. }
  12939. if (isObject(value)) {
  12940. var other = typeof value.valueOf == 'function' ? value.valueOf() : value;
  12941. value = isObject(other) ? (other + '') : other;
  12942. }
  12943. if (typeof value != 'string') {
  12944. return value === 0 ? value : +value;
  12945. }
  12946. value = baseTrim(value);
  12947. var isBinary = reIsBinary.test(value);
  12948. return (isBinary || reIsOctal.test(value))
  12949. ? freeParseInt(value.slice(2), isBinary ? 2 : 8)
  12950. : (reIsBadHex.test(value) ? NAN : +value);
  12951. }
  12952. /**
  12953. * Converts `value` to a plain object flattening inherited enumerable string
  12954. * keyed properties of `value` to own properties of the plain object.
  12955. *
  12956. * @static
  12957. * @memberOf _
  12958. * @since 3.0.0
  12959. * @category Lang
  12960. * @param {*} value The value to convert.
  12961. * @returns {Object} Returns the converted plain object.
  12962. * @example
  12963. *
  12964. * function Foo() {
  12965. * this.b = 2;
  12966. * }
  12967. *
  12968. * Foo.prototype.c = 3;
  12969. *
  12970. * _.assign({ 'a': 1 }, new Foo);
  12971. * // => { 'a': 1, 'b': 2 }
  12972. *
  12973. * _.assign({ 'a': 1 }, _.toPlainObject(new Foo));
  12974. * // => { 'a': 1, 'b': 2, 'c': 3 }
  12975. */
  12976. function toPlainObject(value) {
  12977. return copyObject(value, keysIn(value));
  12978. }
  12979. /**
  12980. * Converts `value` to a safe integer. A safe integer can be compared and
  12981. * represented correctly.
  12982. *
  12983. * @static
  12984. * @memberOf _
  12985. * @since 4.0.0
  12986. * @category Lang
  12987. * @param {*} value The value to convert.
  12988. * @returns {number} Returns the converted integer.
  12989. * @example
  12990. *
  12991. * _.toSafeInteger(3.2);
  12992. * // => 3
  12993. *
  12994. * _.toSafeInteger(Number.MIN_VALUE);
  12995. * // => 0
  12996. *
  12997. * _.toSafeInteger(Infinity);
  12998. * // => 9007199254740991
  12999. *
  13000. * _.toSafeInteger('3.2');
  13001. * // => 3
  13002. */
  13003. function toSafeInteger(value) {
  13004. return value
  13005. ? baseClamp(toInteger(value), -MAX_SAFE_INTEGER, MAX_SAFE_INTEGER)
  13006. : (value === 0 ? value : 0);
  13007. }
  13008. /**
  13009. * Converts `value` to a string. An empty string is returned for `null`
  13010. * and `undefined` values. The sign of `-0` is preserved.
  13011. *
  13012. * @static
  13013. * @memberOf _
  13014. * @since 4.0.0
  13015. * @category Lang
  13016. * @param {*} value The value to convert.
  13017. * @returns {string} Returns the converted string.
  13018. * @example
  13019. *
  13020. * _.toString(null);
  13021. * // => ''
  13022. *
  13023. * _.toString(-0);
  13024. * // => '-0'
  13025. *
  13026. * _.toString([1, 2, 3]);
  13027. * // => '1,2,3'
  13028. */
  13029. function toString(value) {
  13030. return value == null ? '' : baseToString(value);
  13031. }
  13032. /*------------------------------------------------------------------------*/
  13033. /**
  13034. * Assigns own enumerable string keyed properties of source objects to the
  13035. * destination object. Source objects are applied from left to right.
  13036. * Subsequent sources overwrite property assignments of previous sources.
  13037. *
  13038. * **Note:** This method mutates `object` and is loosely based on
  13039. * [`Object.assign`](https://mdn.io/Object/assign).
  13040. *
  13041. * @static
  13042. * @memberOf _
  13043. * @since 0.10.0
  13044. * @category Object
  13045. * @param {Object} object The destination object.
  13046. * @param {...Object} [sources] The source objects.
  13047. * @returns {Object} Returns `object`.
  13048. * @see _.assignIn
  13049. * @example
  13050. *
  13051. * function Foo() {
  13052. * this.a = 1;
  13053. * }
  13054. *
  13055. * function Bar() {
  13056. * this.c = 3;
  13057. * }
  13058. *
  13059. * Foo.prototype.b = 2;
  13060. * Bar.prototype.d = 4;
  13061. *
  13062. * _.assign({ 'a': 0 }, new Foo, new Bar);
  13063. * // => { 'a': 1, 'c': 3 }
  13064. */
  13065. var assign = createAssigner(function(object, source) {
  13066. if (isPrototype(source) || isArrayLike(source)) {
  13067. copyObject(source, keys(source), object);
  13068. return;
  13069. }
  13070. for (var key in source) {
  13071. if (hasOwnProperty.call(source, key)) {
  13072. assignValue(object, key, source[key]);
  13073. }
  13074. }
  13075. });
  13076. /**
  13077. * This method is like `_.assign` except that it iterates over own and
  13078. * inherited source properties.
  13079. *
  13080. * **Note:** This method mutates `object`.
  13081. *
  13082. * @static
  13083. * @memberOf _
  13084. * @since 4.0.0
  13085. * @alias extend
  13086. * @category Object
  13087. * @param {Object} object The destination object.
  13088. * @param {...Object} [sources] The source objects.
  13089. * @returns {Object} Returns `object`.
  13090. * @see _.assign
  13091. * @example
  13092. *
  13093. * function Foo() {
  13094. * this.a = 1;
  13095. * }
  13096. *
  13097. * function Bar() {
  13098. * this.c = 3;
  13099. * }
  13100. *
  13101. * Foo.prototype.b = 2;
  13102. * Bar.prototype.d = 4;
  13103. *
  13104. * _.assignIn({ 'a': 0 }, new Foo, new Bar);
  13105. * // => { 'a': 1, 'b': 2, 'c': 3, 'd': 4 }
  13106. */
  13107. var assignIn = createAssigner(function(object, source) {
  13108. copyObject(source, keysIn(source), object);
  13109. });
  13110. /**
  13111. * This method is like `_.assignIn` except that it accepts `customizer`
  13112. * which is invoked to produce the assigned values. If `customizer` returns
  13113. * `undefined`, assignment is handled by the method instead. The `customizer`
  13114. * is invoked with five arguments: (objValue, srcValue, key, object, source).
  13115. *
  13116. * **Note:** This method mutates `object`.
  13117. *
  13118. * @static
  13119. * @memberOf _
  13120. * @since 4.0.0
  13121. * @alias extendWith
  13122. * @category Object
  13123. * @param {Object} object The destination object.
  13124. * @param {...Object} sources The source objects.
  13125. * @param {Function} [customizer] The function to customize assigned values.
  13126. * @returns {Object} Returns `object`.
  13127. * @see _.assignWith
  13128. * @example
  13129. *
  13130. * function customizer(objValue, srcValue) {
  13131. * return _.isUndefined(objValue) ? srcValue : objValue;
  13132. * }
  13133. *
  13134. * var defaults = _.partialRight(_.assignInWith, customizer);
  13135. *
  13136. * defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 });
  13137. * // => { 'a': 1, 'b': 2 }
  13138. */
  13139. var assignInWith = createAssigner(function(object, source, srcIndex, customizer) {
  13140. copyObject(source, keysIn(source), object, customizer);
  13141. });
  13142. /**
  13143. * This method is like `_.assign` except that it accepts `customizer`
  13144. * which is invoked to produce the assigned values. If `customizer` returns
  13145. * `undefined`, assignment is handled by the method instead. The `customizer`
  13146. * is invoked with five arguments: (objValue, srcValue, key, object, source).
  13147. *
  13148. * **Note:** This method mutates `object`.
  13149. *
  13150. * @static
  13151. * @memberOf _
  13152. * @since 4.0.0
  13153. * @category Object
  13154. * @param {Object} object The destination object.
  13155. * @param {...Object} sources The source objects.
  13156. * @param {Function} [customizer] The function to customize assigned values.
  13157. * @returns {Object} Returns `object`.
  13158. * @see _.assignInWith
  13159. * @example
  13160. *
  13161. * function customizer(objValue, srcValue) {
  13162. * return _.isUndefined(objValue) ? srcValue : objValue;
  13163. * }
  13164. *
  13165. * var defaults = _.partialRight(_.assignWith, customizer);
  13166. *
  13167. * defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 });
  13168. * // => { 'a': 1, 'b': 2 }
  13169. */
  13170. var assignWith = createAssigner(function(object, source, srcIndex, customizer) {
  13171. copyObject(source, keys(source), object, customizer);
  13172. });
  13173. /**
  13174. * Creates an array of values corresponding to `paths` of `object`.
  13175. *
  13176. * @static
  13177. * @memberOf _
  13178. * @since 1.0.0
  13179. * @category Object
  13180. * @param {Object} object The object to iterate over.
  13181. * @param {...(string|string[])} [paths] The property paths to pick.
  13182. * @returns {Array} Returns the picked values.
  13183. * @example
  13184. *
  13185. * var object = { 'a': [{ 'b': { 'c': 3 } }, 4] };
  13186. *
  13187. * _.at(object, ['a[0].b.c', 'a[1]']);
  13188. * // => [3, 4]
  13189. */
  13190. var at = flatRest(baseAt);
  13191. /**
  13192. * Creates an object that inherits from the `prototype` object. If a
  13193. * `properties` object is given, its own enumerable string keyed properties
  13194. * are assigned to the created object.
  13195. *
  13196. * @static
  13197. * @memberOf _
  13198. * @since 2.3.0
  13199. * @category Object
  13200. * @param {Object} prototype The object to inherit from.
  13201. * @param {Object} [properties] The properties to assign to the object.
  13202. * @returns {Object} Returns the new object.
  13203. * @example
  13204. *
  13205. * function Shape() {
  13206. * this.x = 0;
  13207. * this.y = 0;
  13208. * }
  13209. *
  13210. * function Circle() {
  13211. * Shape.call(this);
  13212. * }
  13213. *
  13214. * Circle.prototype = _.create(Shape.prototype, {
  13215. * 'constructor': Circle
  13216. * });
  13217. *
  13218. * var circle = new Circle;
  13219. * circle instanceof Circle;
  13220. * // => true
  13221. *
  13222. * circle instanceof Shape;
  13223. * // => true
  13224. */
  13225. function create(prototype, properties) {
  13226. var result = baseCreate(prototype);
  13227. return properties == null ? result : baseAssign(result, properties);
  13228. }
  13229. /**
  13230. * Assigns own and inherited enumerable string keyed properties of source
  13231. * objects to the destination object for all destination properties that
  13232. * resolve to `undefined`. Source objects are applied from left to right.
  13233. * Once a property is set, additional values of the same property are ignored.
  13234. *
  13235. * **Note:** This method mutates `object`.
  13236. *
  13237. * @static
  13238. * @since 0.1.0
  13239. * @memberOf _
  13240. * @category Object
  13241. * @param {Object} object The destination object.
  13242. * @param {...Object} [sources] The source objects.
  13243. * @returns {Object} Returns `object`.
  13244. * @see _.defaultsDeep
  13245. * @example
  13246. *
  13247. * _.defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 });
  13248. * // => { 'a': 1, 'b': 2 }
  13249. */
  13250. var defaults = baseRest(function(object, sources) {
  13251. object = Object(object);
  13252. var index = -1;
  13253. var length = sources.length;
  13254. var guard = length > 2 ? sources[2] : undefined;
  13255. if (guard && isIterateeCall(sources[0], sources[1], guard)) {
  13256. length = 1;
  13257. }
  13258. while (++index < length) {
  13259. var source = sources[index];
  13260. var props = keysIn(source);
  13261. var propsIndex = -1;
  13262. var propsLength = props.length;
  13263. while (++propsIndex < propsLength) {
  13264. var key = props[propsIndex];
  13265. var value = object[key];
  13266. if (value === undefined ||
  13267. (eq(value, objectProto[key]) && !hasOwnProperty.call(object, key))) {
  13268. object[key] = source[key];
  13269. }
  13270. }
  13271. }
  13272. return object;
  13273. });
  13274. /**
  13275. * This method is like `_.defaults` except that it recursively assigns
  13276. * default properties.
  13277. *
  13278. * **Note:** This method mutates `object`.
  13279. *
  13280. * @static
  13281. * @memberOf _
  13282. * @since 3.10.0
  13283. * @category Object
  13284. * @param {Object} object The destination object.
  13285. * @param {...Object} [sources] The source objects.
  13286. * @returns {Object} Returns `object`.
  13287. * @see _.defaults
  13288. * @example
  13289. *
  13290. * _.defaultsDeep({ 'a': { 'b': 2 } }, { 'a': { 'b': 1, 'c': 3 } });
  13291. * // => { 'a': { 'b': 2, 'c': 3 } }
  13292. */
  13293. var defaultsDeep = baseRest(function(args) {
  13294. args.push(undefined, customDefaultsMerge);
  13295. return apply(mergeWith, undefined, args);
  13296. });
  13297. /**
  13298. * This method is like `_.find` except that it returns the key of the first
  13299. * element `predicate` returns truthy for instead of the element itself.
  13300. *
  13301. * @static
  13302. * @memberOf _
  13303. * @since 1.1.0
  13304. * @category Object
  13305. * @param {Object} object The object to inspect.
  13306. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  13307. * @returns {string|undefined} Returns the key of the matched element,
  13308. * else `undefined`.
  13309. * @example
  13310. *
  13311. * var users = {
  13312. * 'barney': { 'age': 36, 'active': true },
  13313. * 'fred': { 'age': 40, 'active': false },
  13314. * 'pebbles': { 'age': 1, 'active': true }
  13315. * };
  13316. *
  13317. * _.findKey(users, function(o) { return o.age < 40; });
  13318. * // => 'barney' (iteration order is not guaranteed)
  13319. *
  13320. * // The `_.matches` iteratee shorthand.
  13321. * _.findKey(users, { 'age': 1, 'active': true });
  13322. * // => 'pebbles'
  13323. *
  13324. * // The `_.matchesProperty` iteratee shorthand.
  13325. * _.findKey(users, ['active', false]);
  13326. * // => 'fred'
  13327. *
  13328. * // The `_.property` iteratee shorthand.
  13329. * _.findKey(users, 'active');
  13330. * // => 'barney'
  13331. */
  13332. function findKey(object, predicate) {
  13333. return baseFindKey(object, getIteratee(predicate, 3), baseForOwn);
  13334. }
  13335. /**
  13336. * This method is like `_.findKey` except that it iterates over elements of
  13337. * a collection in the opposite order.
  13338. *
  13339. * @static
  13340. * @memberOf _
  13341. * @since 2.0.0
  13342. * @category Object
  13343. * @param {Object} object The object to inspect.
  13344. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  13345. * @returns {string|undefined} Returns the key of the matched element,
  13346. * else `undefined`.
  13347. * @example
  13348. *
  13349. * var users = {
  13350. * 'barney': { 'age': 36, 'active': true },
  13351. * 'fred': { 'age': 40, 'active': false },
  13352. * 'pebbles': { 'age': 1, 'active': true }
  13353. * };
  13354. *
  13355. * _.findLastKey(users, function(o) { return o.age < 40; });
  13356. * // => returns 'pebbles' assuming `_.findKey` returns 'barney'
  13357. *
  13358. * // The `_.matches` iteratee shorthand.
  13359. * _.findLastKey(users, { 'age': 36, 'active': true });
  13360. * // => 'barney'
  13361. *
  13362. * // The `_.matchesProperty` iteratee shorthand.
  13363. * _.findLastKey(users, ['active', false]);
  13364. * // => 'fred'
  13365. *
  13366. * // The `_.property` iteratee shorthand.
  13367. * _.findLastKey(users, 'active');
  13368. * // => 'pebbles'
  13369. */
  13370. function findLastKey(object, predicate) {
  13371. return baseFindKey(object, getIteratee(predicate, 3), baseForOwnRight);
  13372. }
  13373. /**
  13374. * Iterates over own and inherited enumerable string keyed properties of an
  13375. * object and invokes `iteratee` for each property. The iteratee is invoked
  13376. * with three arguments: (value, key, object). Iteratee functions may exit
  13377. * iteration early by explicitly returning `false`.
  13378. *
  13379. * @static
  13380. * @memberOf _
  13381. * @since 0.3.0
  13382. * @category Object
  13383. * @param {Object} object The object to iterate over.
  13384. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  13385. * @returns {Object} Returns `object`.
  13386. * @see _.forInRight
  13387. * @example
  13388. *
  13389. * function Foo() {
  13390. * this.a = 1;
  13391. * this.b = 2;
  13392. * }
  13393. *
  13394. * Foo.prototype.c = 3;
  13395. *
  13396. * _.forIn(new Foo, function(value, key) {
  13397. * console.log(key);
  13398. * });
  13399. * // => Logs 'a', 'b', then 'c' (iteration order is not guaranteed).
  13400. */
  13401. function forIn(object, iteratee) {
  13402. return object == null
  13403. ? object
  13404. : baseFor(object, getIteratee(iteratee, 3), keysIn);
  13405. }
  13406. /**
  13407. * This method is like `_.forIn` except that it iterates over properties of
  13408. * `object` in the opposite order.
  13409. *
  13410. * @static
  13411. * @memberOf _
  13412. * @since 2.0.0
  13413. * @category Object
  13414. * @param {Object} object The object to iterate over.
  13415. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  13416. * @returns {Object} Returns `object`.
  13417. * @see _.forIn
  13418. * @example
  13419. *
  13420. * function Foo() {
  13421. * this.a = 1;
  13422. * this.b = 2;
  13423. * }
  13424. *
  13425. * Foo.prototype.c = 3;
  13426. *
  13427. * _.forInRight(new Foo, function(value, key) {
  13428. * console.log(key);
  13429. * });
  13430. * // => Logs 'c', 'b', then 'a' assuming `_.forIn` logs 'a', 'b', then 'c'.
  13431. */
  13432. function forInRight(object, iteratee) {
  13433. return object == null
  13434. ? object
  13435. : baseForRight(object, getIteratee(iteratee, 3), keysIn);
  13436. }
  13437. /**
  13438. * Iterates over own enumerable string keyed properties of an object and
  13439. * invokes `iteratee` for each property. The iteratee is invoked with three
  13440. * arguments: (value, key, object). Iteratee functions may exit iteration
  13441. * early by explicitly returning `false`.
  13442. *
  13443. * @static
  13444. * @memberOf _
  13445. * @since 0.3.0
  13446. * @category Object
  13447. * @param {Object} object The object to iterate over.
  13448. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  13449. * @returns {Object} Returns `object`.
  13450. * @see _.forOwnRight
  13451. * @example
  13452. *
  13453. * function Foo() {
  13454. * this.a = 1;
  13455. * this.b = 2;
  13456. * }
  13457. *
  13458. * Foo.prototype.c = 3;
  13459. *
  13460. * _.forOwn(new Foo, function(value, key) {
  13461. * console.log(key);
  13462. * });
  13463. * // => Logs 'a' then 'b' (iteration order is not guaranteed).
  13464. */
  13465. function forOwn(object, iteratee) {
  13466. return object && baseForOwn(object, getIteratee(iteratee, 3));
  13467. }
  13468. /**
  13469. * This method is like `_.forOwn` except that it iterates over properties of
  13470. * `object` in the opposite order.
  13471. *
  13472. * @static
  13473. * @memberOf _
  13474. * @since 2.0.0
  13475. * @category Object
  13476. * @param {Object} object The object to iterate over.
  13477. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  13478. * @returns {Object} Returns `object`.
  13479. * @see _.forOwn
  13480. * @example
  13481. *
  13482. * function Foo() {
  13483. * this.a = 1;
  13484. * this.b = 2;
  13485. * }
  13486. *
  13487. * Foo.prototype.c = 3;
  13488. *
  13489. * _.forOwnRight(new Foo, function(value, key) {
  13490. * console.log(key);
  13491. * });
  13492. * // => Logs 'b' then 'a' assuming `_.forOwn` logs 'a' then 'b'.
  13493. */
  13494. function forOwnRight(object, iteratee) {
  13495. return object && baseForOwnRight(object, getIteratee(iteratee, 3));
  13496. }
  13497. /**
  13498. * Creates an array of function property names from own enumerable properties
  13499. * of `object`.
  13500. *
  13501. * @static
  13502. * @since 0.1.0
  13503. * @memberOf _
  13504. * @category Object
  13505. * @param {Object} object The object to inspect.
  13506. * @returns {Array} Returns the function names.
  13507. * @see _.functionsIn
  13508. * @example
  13509. *
  13510. * function Foo() {
  13511. * this.a = _.constant('a');
  13512. * this.b = _.constant('b');
  13513. * }
  13514. *
  13515. * Foo.prototype.c = _.constant('c');
  13516. *
  13517. * _.functions(new Foo);
  13518. * // => ['a', 'b']
  13519. */
  13520. function functions(object) {
  13521. return object == null ? [] : baseFunctions(object, keys(object));
  13522. }
  13523. /**
  13524. * Creates an array of function property names from own and inherited
  13525. * enumerable properties of `object`.
  13526. *
  13527. * @static
  13528. * @memberOf _
  13529. * @since 4.0.0
  13530. * @category Object
  13531. * @param {Object} object The object to inspect.
  13532. * @returns {Array} Returns the function names.
  13533. * @see _.functions
  13534. * @example
  13535. *
  13536. * function Foo() {
  13537. * this.a = _.constant('a');
  13538. * this.b = _.constant('b');
  13539. * }
  13540. *
  13541. * Foo.prototype.c = _.constant('c');
  13542. *
  13543. * _.functionsIn(new Foo);
  13544. * // => ['a', 'b', 'c']
  13545. */
  13546. function functionsIn(object) {
  13547. return object == null ? [] : baseFunctions(object, keysIn(object));
  13548. }
  13549. /**
  13550. * Gets the value at `path` of `object`. If the resolved value is
  13551. * `undefined`, the `defaultValue` is returned in its place.
  13552. *
  13553. * @static
  13554. * @memberOf _
  13555. * @since 3.7.0
  13556. * @category Object
  13557. * @param {Object} object The object to query.
  13558. * @param {Array|string} path The path of the property to get.
  13559. * @param {*} [defaultValue] The value returned for `undefined` resolved values.
  13560. * @returns {*} Returns the resolved value.
  13561. * @example
  13562. *
  13563. * var object = { 'a': [{ 'b': { 'c': 3 } }] };
  13564. *
  13565. * _.get(object, 'a[0].b.c');
  13566. * // => 3
  13567. *
  13568. * _.get(object, ['a', '0', 'b', 'c']);
  13569. * // => 3
  13570. *
  13571. * _.get(object, 'a.b.c', 'default');
  13572. * // => 'default'
  13573. */
  13574. function get(object, path, defaultValue) {
  13575. var result = object == null ? undefined : baseGet(object, path);
  13576. return result === undefined ? defaultValue : result;
  13577. }
  13578. /**
  13579. * Checks if `path` is a direct property of `object`.
  13580. *
  13581. * @static
  13582. * @since 0.1.0
  13583. * @memberOf _
  13584. * @category Object
  13585. * @param {Object} object The object to query.
  13586. * @param {Array|string} path The path to check.
  13587. * @returns {boolean} Returns `true` if `path` exists, else `false`.
  13588. * @example
  13589. *
  13590. * var object = { 'a': { 'b': 2 } };
  13591. * var other = _.create({ 'a': _.create({ 'b': 2 }) });
  13592. *
  13593. * _.has(object, 'a');
  13594. * // => true
  13595. *
  13596. * _.has(object, 'a.b');
  13597. * // => true
  13598. *
  13599. * _.has(object, ['a', 'b']);
  13600. * // => true
  13601. *
  13602. * _.has(other, 'a');
  13603. * // => false
  13604. */
  13605. function has(object, path) {
  13606. return object != null && hasPath(object, path, baseHas);
  13607. }
  13608. /**
  13609. * Checks if `path` is a direct or inherited property of `object`.
  13610. *
  13611. * @static
  13612. * @memberOf _
  13613. * @since 4.0.0
  13614. * @category Object
  13615. * @param {Object} object The object to query.
  13616. * @param {Array|string} path The path to check.
  13617. * @returns {boolean} Returns `true` if `path` exists, else `false`.
  13618. * @example
  13619. *
  13620. * var object = _.create({ 'a': _.create({ 'b': 2 }) });
  13621. *
  13622. * _.hasIn(object, 'a');
  13623. * // => true
  13624. *
  13625. * _.hasIn(object, 'a.b');
  13626. * // => true
  13627. *
  13628. * _.hasIn(object, ['a', 'b']);
  13629. * // => true
  13630. *
  13631. * _.hasIn(object, 'b');
  13632. * // => false
  13633. */
  13634. function hasIn(object, path) {
  13635. return object != null && hasPath(object, path, baseHasIn);
  13636. }
  13637. /**
  13638. * Creates an object composed of the inverted keys and values of `object`.
  13639. * If `object` contains duplicate values, subsequent values overwrite
  13640. * property assignments of previous values.
  13641. *
  13642. * @static
  13643. * @memberOf _
  13644. * @since 0.7.0
  13645. * @category Object
  13646. * @param {Object} object The object to invert.
  13647. * @returns {Object} Returns the new inverted object.
  13648. * @example
  13649. *
  13650. * var object = { 'a': 1, 'b': 2, 'c': 1 };
  13651. *
  13652. * _.invert(object);
  13653. * // => { '1': 'c', '2': 'b' }
  13654. */
  13655. var invert = createInverter(function(result, value, key) {
  13656. if (value != null &&
  13657. typeof value.toString != 'function') {
  13658. value = nativeObjectToString.call(value);
  13659. }
  13660. result[value] = key;
  13661. }, constant(identity));
  13662. /**
  13663. * This method is like `_.invert` except that the inverted object is generated
  13664. * from the results of running each element of `object` thru `iteratee`. The
  13665. * corresponding inverted value of each inverted key is an array of keys
  13666. * responsible for generating the inverted value. The iteratee is invoked
  13667. * with one argument: (value).
  13668. *
  13669. * @static
  13670. * @memberOf _
  13671. * @since 4.1.0
  13672. * @category Object
  13673. * @param {Object} object The object to invert.
  13674. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  13675. * @returns {Object} Returns the new inverted object.
  13676. * @example
  13677. *
  13678. * var object = { 'a': 1, 'b': 2, 'c': 1 };
  13679. *
  13680. * _.invertBy(object);
  13681. * // => { '1': ['a', 'c'], '2': ['b'] }
  13682. *
  13683. * _.invertBy(object, function(value) {
  13684. * return 'group' + value;
  13685. * });
  13686. * // => { 'group1': ['a', 'c'], 'group2': ['b'] }
  13687. */
  13688. var invertBy = createInverter(function(result, value, key) {
  13689. if (value != null &&
  13690. typeof value.toString != 'function') {
  13691. value = nativeObjectToString.call(value);
  13692. }
  13693. if (hasOwnProperty.call(result, value)) {
  13694. result[value].push(key);
  13695. } else {
  13696. result[value] = [key];
  13697. }
  13698. }, getIteratee);
  13699. /**
  13700. * Invokes the method at `path` of `object`.
  13701. *
  13702. * @static
  13703. * @memberOf _
  13704. * @since 4.0.0
  13705. * @category Object
  13706. * @param {Object} object The object to query.
  13707. * @param {Array|string} path The path of the method to invoke.
  13708. * @param {...*} [args] The arguments to invoke the method with.
  13709. * @returns {*} Returns the result of the invoked method.
  13710. * @example
  13711. *
  13712. * var object = { 'a': [{ 'b': { 'c': [1, 2, 3, 4] } }] };
  13713. *
  13714. * _.invoke(object, 'a[0].b.c.slice', 1, 3);
  13715. * // => [2, 3]
  13716. */
  13717. var invoke = baseRest(baseInvoke);
  13718. /**
  13719. * Creates an array of the own enumerable property names of `object`.
  13720. *
  13721. * **Note:** Non-object values are coerced to objects. See the
  13722. * [ES spec](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)
  13723. * for more details.
  13724. *
  13725. * @static
  13726. * @since 0.1.0
  13727. * @memberOf _
  13728. * @category Object
  13729. * @param {Object} object The object to query.
  13730. * @returns {Array} Returns the array of property names.
  13731. * @example
  13732. *
  13733. * function Foo() {
  13734. * this.a = 1;
  13735. * this.b = 2;
  13736. * }
  13737. *
  13738. * Foo.prototype.c = 3;
  13739. *
  13740. * _.keys(new Foo);
  13741. * // => ['a', 'b'] (iteration order is not guaranteed)
  13742. *
  13743. * _.keys('hi');
  13744. * // => ['0', '1']
  13745. */
  13746. function keys(object) {
  13747. return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object);
  13748. }
  13749. /**
  13750. * Creates an array of the own and inherited enumerable property names of `object`.
  13751. *
  13752. * **Note:** Non-object values are coerced to objects.
  13753. *
  13754. * @static
  13755. * @memberOf _
  13756. * @since 3.0.0
  13757. * @category Object
  13758. * @param {Object} object The object to query.
  13759. * @returns {Array} Returns the array of property names.
  13760. * @example
  13761. *
  13762. * function Foo() {
  13763. * this.a = 1;
  13764. * this.b = 2;
  13765. * }
  13766. *
  13767. * Foo.prototype.c = 3;
  13768. *
  13769. * _.keysIn(new Foo);
  13770. * // => ['a', 'b', 'c'] (iteration order is not guaranteed)
  13771. */
  13772. function keysIn(object) {
  13773. return isArrayLike(object) ? arrayLikeKeys(object, true) : baseKeysIn(object);
  13774. }
  13775. /**
  13776. * The opposite of `_.mapValues`; this method creates an object with the
  13777. * same values as `object` and keys generated by running each own enumerable
  13778. * string keyed property of `object` thru `iteratee`. The iteratee is invoked
  13779. * with three arguments: (value, key, object).
  13780. *
  13781. * @static
  13782. * @memberOf _
  13783. * @since 3.8.0
  13784. * @category Object
  13785. * @param {Object} object The object to iterate over.
  13786. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  13787. * @returns {Object} Returns the new mapped object.
  13788. * @see _.mapValues
  13789. * @example
  13790. *
  13791. * _.mapKeys({ 'a': 1, 'b': 2 }, function(value, key) {
  13792. * return key + value;
  13793. * });
  13794. * // => { 'a1': 1, 'b2': 2 }
  13795. */
  13796. function mapKeys(object, iteratee) {
  13797. var result = {};
  13798. iteratee = getIteratee(iteratee, 3);
  13799. baseForOwn(object, function(value, key, object) {
  13800. baseAssignValue(result, iteratee(value, key, object), value);
  13801. });
  13802. return result;
  13803. }
  13804. /**
  13805. * Creates an object with the same keys as `object` and values generated
  13806. * by running each own enumerable string keyed property of `object` thru
  13807. * `iteratee`. The iteratee is invoked with three arguments:
  13808. * (value, key, object).
  13809. *
  13810. * @static
  13811. * @memberOf _
  13812. * @since 2.4.0
  13813. * @category Object
  13814. * @param {Object} object The object to iterate over.
  13815. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  13816. * @returns {Object} Returns the new mapped object.
  13817. * @see _.mapKeys
  13818. * @example
  13819. *
  13820. * var users = {
  13821. * 'fred': { 'user': 'fred', 'age': 40 },
  13822. * 'pebbles': { 'user': 'pebbles', 'age': 1 }
  13823. * };
  13824. *
  13825. * _.mapValues(users, function(o) { return o.age; });
  13826. * // => { 'fred': 40, 'pebbles': 1 } (iteration order is not guaranteed)
  13827. *
  13828. * // The `_.property` iteratee shorthand.
  13829. * _.mapValues(users, 'age');
  13830. * // => { 'fred': 40, 'pebbles': 1 } (iteration order is not guaranteed)
  13831. */
  13832. function mapValues(object, iteratee) {
  13833. var result = {};
  13834. iteratee = getIteratee(iteratee, 3);
  13835. baseForOwn(object, function(value, key, object) {
  13836. baseAssignValue(result, key, iteratee(value, key, object));
  13837. });
  13838. return result;
  13839. }
  13840. /**
  13841. * This method is like `_.assign` except that it recursively merges own and
  13842. * inherited enumerable string keyed properties of source objects into the
  13843. * destination object. Source properties that resolve to `undefined` are
  13844. * skipped if a destination value exists. Array and plain object properties
  13845. * are merged recursively. Other objects and value types are overridden by
  13846. * assignment. Source objects are applied from left to right. Subsequent
  13847. * sources overwrite property assignments of previous sources.
  13848. *
  13849. * **Note:** This method mutates `object`.
  13850. *
  13851. * @static
  13852. * @memberOf _
  13853. * @since 0.5.0
  13854. * @category Object
  13855. * @param {Object} object The destination object.
  13856. * @param {...Object} [sources] The source objects.
  13857. * @returns {Object} Returns `object`.
  13858. * @example
  13859. *
  13860. * var object = {
  13861. * 'a': [{ 'b': 2 }, { 'd': 4 }]
  13862. * };
  13863. *
  13864. * var other = {
  13865. * 'a': [{ 'c': 3 }, { 'e': 5 }]
  13866. * };
  13867. *
  13868. * _.merge(object, other);
  13869. * // => { 'a': [{ 'b': 2, 'c': 3 }, { 'd': 4, 'e': 5 }] }
  13870. */
  13871. var merge = createAssigner(function(object, source, srcIndex) {
  13872. baseMerge(object, source, srcIndex);
  13873. });
  13874. /**
  13875. * This method is like `_.merge` except that it accepts `customizer` which
  13876. * is invoked to produce the merged values of the destination and source
  13877. * properties. If `customizer` returns `undefined`, merging is handled by the
  13878. * method instead. The `customizer` is invoked with six arguments:
  13879. * (objValue, srcValue, key, object, source, stack).
  13880. *
  13881. * **Note:** This method mutates `object`.
  13882. *
  13883. * @static
  13884. * @memberOf _
  13885. * @since 4.0.0
  13886. * @category Object
  13887. * @param {Object} object The destination object.
  13888. * @param {...Object} sources The source objects.
  13889. * @param {Function} customizer The function to customize assigned values.
  13890. * @returns {Object} Returns `object`.
  13891. * @example
  13892. *
  13893. * function customizer(objValue, srcValue) {
  13894. * if (_.isArray(objValue)) {
  13895. * return objValue.concat(srcValue);
  13896. * }
  13897. * }
  13898. *
  13899. * var object = { 'a': [1], 'b': [2] };
  13900. * var other = { 'a': [3], 'b': [4] };
  13901. *
  13902. * _.mergeWith(object, other, customizer);
  13903. * // => { 'a': [1, 3], 'b': [2, 4] }
  13904. */
  13905. var mergeWith = createAssigner(function(object, source, srcIndex, customizer) {
  13906. baseMerge(object, source, srcIndex, customizer);
  13907. });
  13908. /**
  13909. * The opposite of `_.pick`; this method creates an object composed of the
  13910. * own and inherited enumerable property paths of `object` that are not omitted.
  13911. *
  13912. * **Note:** This method is considerably slower than `_.pick`.
  13913. *
  13914. * @static
  13915. * @since 0.1.0
  13916. * @memberOf _
  13917. * @category Object
  13918. * @param {Object} object The source object.
  13919. * @param {...(string|string[])} [paths] The property paths to omit.
  13920. * @returns {Object} Returns the new object.
  13921. * @example
  13922. *
  13923. * var object = { 'a': 1, 'b': '2', 'c': 3 };
  13924. *
  13925. * _.omit(object, ['a', 'c']);
  13926. * // => { 'b': '2' }
  13927. */
  13928. var omit = flatRest(function(object, paths) {
  13929. var result = {};
  13930. if (object == null) {
  13931. return result;
  13932. }
  13933. var isDeep = false;
  13934. paths = arrayMap(paths, function(path) {
  13935. path = castPath(path, object);
  13936. isDeep || (isDeep = path.length > 1);
  13937. return path;
  13938. });
  13939. copyObject(object, getAllKeysIn(object), result);
  13940. if (isDeep) {
  13941. result = baseClone(result, CLONE_DEEP_FLAG | CLONE_FLAT_FLAG | CLONE_SYMBOLS_FLAG, customOmitClone);
  13942. }
  13943. var length = paths.length;
  13944. while (length--) {
  13945. baseUnset(result, paths[length]);
  13946. }
  13947. return result;
  13948. });
  13949. /**
  13950. * The opposite of `_.pickBy`; this method creates an object composed of
  13951. * the own and inherited enumerable string keyed properties of `object` that
  13952. * `predicate` doesn't return truthy for. The predicate is invoked with two
  13953. * arguments: (value, key).
  13954. *
  13955. * @static
  13956. * @memberOf _
  13957. * @since 4.0.0
  13958. * @category Object
  13959. * @param {Object} object The source object.
  13960. * @param {Function} [predicate=_.identity] The function invoked per property.
  13961. * @returns {Object} Returns the new object.
  13962. * @example
  13963. *
  13964. * var object = { 'a': 1, 'b': '2', 'c': 3 };
  13965. *
  13966. * _.omitBy(object, _.isNumber);
  13967. * // => { 'b': '2' }
  13968. */
  13969. function omitBy(object, predicate) {
  13970. return pickBy(object, negate(getIteratee(predicate)));
  13971. }
  13972. /**
  13973. * Creates an object composed of the picked `object` properties.
  13974. *
  13975. * @static
  13976. * @since 0.1.0
  13977. * @memberOf _
  13978. * @category Object
  13979. * @param {Object} object The source object.
  13980. * @param {...(string|string[])} [paths] The property paths to pick.
  13981. * @returns {Object} Returns the new object.
  13982. * @example
  13983. *
  13984. * var object = { 'a': 1, 'b': '2', 'c': 3 };
  13985. *
  13986. * _.pick(object, ['a', 'c']);
  13987. * // => { 'a': 1, 'c': 3 }
  13988. */
  13989. var pick = flatRest(function(object, paths) {
  13990. return object == null ? {} : basePick(object, paths);
  13991. });
  13992. /**
  13993. * Creates an object composed of the `object` properties `predicate` returns
  13994. * truthy for. The predicate is invoked with two arguments: (value, key).
  13995. *
  13996. * @static
  13997. * @memberOf _
  13998. * @since 4.0.0
  13999. * @category Object
  14000. * @param {Object} object The source object.
  14001. * @param {Function} [predicate=_.identity] The function invoked per property.
  14002. * @returns {Object} Returns the new object.
  14003. * @example
  14004. *
  14005. * var object = { 'a': 1, 'b': '2', 'c': 3 };
  14006. *
  14007. * _.pickBy(object, _.isNumber);
  14008. * // => { 'a': 1, 'c': 3 }
  14009. */
  14010. function pickBy(object, predicate) {
  14011. if (object == null) {
  14012. return {};
  14013. }
  14014. var props = arrayMap(getAllKeysIn(object), function(prop) {
  14015. return [prop];
  14016. });
  14017. predicate = getIteratee(predicate);
  14018. return basePickBy(object, props, function(value, path) {
  14019. return predicate(value, path[0]);
  14020. });
  14021. }
  14022. /**
  14023. * This method is like `_.get` except that if the resolved value is a
  14024. * function it's invoked with the `this` binding of its parent object and
  14025. * its result is returned.
  14026. *
  14027. * @static
  14028. * @since 0.1.0
  14029. * @memberOf _
  14030. * @category Object
  14031. * @param {Object} object The object to query.
  14032. * @param {Array|string} path The path of the property to resolve.
  14033. * @param {*} [defaultValue] The value returned for `undefined` resolved values.
  14034. * @returns {*} Returns the resolved value.
  14035. * @example
  14036. *
  14037. * var object = { 'a': [{ 'b': { 'c1': 3, 'c2': _.constant(4) } }] };
  14038. *
  14039. * _.result(object, 'a[0].b.c1');
  14040. * // => 3
  14041. *
  14042. * _.result(object, 'a[0].b.c2');
  14043. * // => 4
  14044. *
  14045. * _.result(object, 'a[0].b.c3', 'default');
  14046. * // => 'default'
  14047. *
  14048. * _.result(object, 'a[0].b.c3', _.constant('default'));
  14049. * // => 'default'
  14050. */
  14051. function result(object, path, defaultValue) {
  14052. path = castPath(path, object);
  14053. var index = -1,
  14054. length = path.length;
  14055. // Ensure the loop is entered when path is empty.
  14056. if (!length) {
  14057. length = 1;
  14058. object = undefined;
  14059. }
  14060. while (++index < length) {
  14061. var value = object == null ? undefined : object[toKey(path[index])];
  14062. if (value === undefined) {
  14063. index = length;
  14064. value = defaultValue;
  14065. }
  14066. object = isFunction(value) ? value.call(object) : value;
  14067. }
  14068. return object;
  14069. }
  14070. /**
  14071. * Sets the value at `path` of `object`. If a portion of `path` doesn't exist,
  14072. * it's created. Arrays are created for missing index properties while objects
  14073. * are created for all other missing properties. Use `_.setWith` to customize
  14074. * `path` creation.
  14075. *
  14076. * **Note:** This method mutates `object`.
  14077. *
  14078. * @static
  14079. * @memberOf _
  14080. * @since 3.7.0
  14081. * @category Object
  14082. * @param {Object} object The object to modify.
  14083. * @param {Array|string} path The path of the property to set.
  14084. * @param {*} value The value to set.
  14085. * @returns {Object} Returns `object`.
  14086. * @example
  14087. *
  14088. * var object = { 'a': [{ 'b': { 'c': 3 } }] };
  14089. *
  14090. * _.set(object, 'a[0].b.c', 4);
  14091. * console.log(object.a[0].b.c);
  14092. * // => 4
  14093. *
  14094. * _.set(object, ['x', '0', 'y', 'z'], 5);
  14095. * console.log(object.x[0].y.z);
  14096. * // => 5
  14097. */
  14098. function set(object, path, value) {
  14099. return object == null ? object : baseSet(object, path, value);
  14100. }
  14101. /**
  14102. * This method is like `_.set` except that it accepts `customizer` which is
  14103. * invoked to produce the objects of `path`. If `customizer` returns `undefined`
  14104. * path creation is handled by the method instead. The `customizer` is invoked
  14105. * with three arguments: (nsValue, key, nsObject).
  14106. *
  14107. * **Note:** This method mutates `object`.
  14108. *
  14109. * @static
  14110. * @memberOf _
  14111. * @since 4.0.0
  14112. * @category Object
  14113. * @param {Object} object The object to modify.
  14114. * @param {Array|string} path The path of the property to set.
  14115. * @param {*} value The value to set.
  14116. * @param {Function} [customizer] The function to customize assigned values.
  14117. * @returns {Object} Returns `object`.
  14118. * @example
  14119. *
  14120. * var object = {};
  14121. *
  14122. * _.setWith(object, '[0][1]', 'a', Object);
  14123. * // => { '0': { '1': 'a' } }
  14124. */
  14125. function setWith(object, path, value, customizer) {
  14126. customizer = typeof customizer == 'function' ? customizer : undefined;
  14127. return object == null ? object : baseSet(object, path, value, customizer);
  14128. }
  14129. /**
  14130. * Creates an array of own enumerable string keyed-value pairs for `object`
  14131. * which can be consumed by `_.fromPairs`. If `object` is a map or set, its
  14132. * entries are returned.
  14133. *
  14134. * @static
  14135. * @memberOf _
  14136. * @since 4.0.0
  14137. * @alias entries
  14138. * @category Object
  14139. * @param {Object} object The object to query.
  14140. * @returns {Array} Returns the key-value pairs.
  14141. * @example
  14142. *
  14143. * function Foo() {
  14144. * this.a = 1;
  14145. * this.b = 2;
  14146. * }
  14147. *
  14148. * Foo.prototype.c = 3;
  14149. *
  14150. * _.toPairs(new Foo);
  14151. * // => [['a', 1], ['b', 2]] (iteration order is not guaranteed)
  14152. */
  14153. var toPairs = createToPairs(keys);
  14154. /**
  14155. * Creates an array of own and inherited enumerable string keyed-value pairs
  14156. * for `object` which can be consumed by `_.fromPairs`. If `object` is a map
  14157. * or set, its entries are returned.
  14158. *
  14159. * @static
  14160. * @memberOf _
  14161. * @since 4.0.0
  14162. * @alias entriesIn
  14163. * @category Object
  14164. * @param {Object} object The object to query.
  14165. * @returns {Array} Returns the key-value pairs.
  14166. * @example
  14167. *
  14168. * function Foo() {
  14169. * this.a = 1;
  14170. * this.b = 2;
  14171. * }
  14172. *
  14173. * Foo.prototype.c = 3;
  14174. *
  14175. * _.toPairsIn(new Foo);
  14176. * // => [['a', 1], ['b', 2], ['c', 3]] (iteration order is not guaranteed)
  14177. */
  14178. var toPairsIn = createToPairs(keysIn);
  14179. /**
  14180. * An alternative to `_.reduce`; this method transforms `object` to a new
  14181. * `accumulator` object which is the result of running each of its own
  14182. * enumerable string keyed properties thru `iteratee`, with each invocation
  14183. * potentially mutating the `accumulator` object. If `accumulator` is not
  14184. * provided, a new object with the same `[[Prototype]]` will be used. The
  14185. * iteratee is invoked with four arguments: (accumulator, value, key, object).
  14186. * Iteratee functions may exit iteration early by explicitly returning `false`.
  14187. *
  14188. * @static
  14189. * @memberOf _
  14190. * @since 1.3.0
  14191. * @category Object
  14192. * @param {Object} object The object to iterate over.
  14193. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  14194. * @param {*} [accumulator] The custom accumulator value.
  14195. * @returns {*} Returns the accumulated value.
  14196. * @example
  14197. *
  14198. * _.transform([2, 3, 4], function(result, n) {
  14199. * result.push(n *= n);
  14200. * return n % 2 == 0;
  14201. * }, []);
  14202. * // => [4, 9]
  14203. *
  14204. * _.transform({ 'a': 1, 'b': 2, 'c': 1 }, function(result, value, key) {
  14205. * (result[value] || (result[value] = [])).push(key);
  14206. * }, {});
  14207. * // => { '1': ['a', 'c'], '2': ['b'] }
  14208. */
  14209. function transform(object, iteratee, accumulator) {
  14210. var isArr = isArray(object),
  14211. isArrLike = isArr || isBuffer(object) || isTypedArray(object);
  14212. iteratee = getIteratee(iteratee, 4);
  14213. if (accumulator == null) {
  14214. var Ctor = object && object.constructor;
  14215. if (isArrLike) {
  14216. accumulator = isArr ? new Ctor : [];
  14217. }
  14218. else if (isObject(object)) {
  14219. accumulator = isFunction(Ctor) ? baseCreate(getPrototype(object)) : {};
  14220. }
  14221. else {
  14222. accumulator = {};
  14223. }
  14224. }
  14225. (isArrLike ? arrayEach : baseForOwn)(object, function(value, index, object) {
  14226. return iteratee(accumulator, value, index, object);
  14227. });
  14228. return accumulator;
  14229. }
  14230. /**
  14231. * Removes the property at `path` of `object`.
  14232. *
  14233. * **Note:** This method mutates `object`.
  14234. *
  14235. * @static
  14236. * @memberOf _
  14237. * @since 4.0.0
  14238. * @category Object
  14239. * @param {Object} object The object to modify.
  14240. * @param {Array|string} path The path of the property to unset.
  14241. * @returns {boolean} Returns `true` if the property is deleted, else `false`.
  14242. * @example
  14243. *
  14244. * var object = { 'a': [{ 'b': { 'c': 7 } }] };
  14245. * _.unset(object, 'a[0].b.c');
  14246. * // => true
  14247. *
  14248. * console.log(object);
  14249. * // => { 'a': [{ 'b': {} }] };
  14250. *
  14251. * _.unset(object, ['a', '0', 'b', 'c']);
  14252. * // => true
  14253. *
  14254. * console.log(object);
  14255. * // => { 'a': [{ 'b': {} }] };
  14256. */
  14257. function unset(object, path) {
  14258. return object == null ? true : baseUnset(object, path);
  14259. }
  14260. /**
  14261. * This method is like `_.set` except that accepts `updater` to produce the
  14262. * value to set. Use `_.updateWith` to customize `path` creation. The `updater`
  14263. * is invoked with one argument: (value).
  14264. *
  14265. * **Note:** This method mutates `object`.
  14266. *
  14267. * @static
  14268. * @memberOf _
  14269. * @since 4.6.0
  14270. * @category Object
  14271. * @param {Object} object The object to modify.
  14272. * @param {Array|string} path The path of the property to set.
  14273. * @param {Function} updater The function to produce the updated value.
  14274. * @returns {Object} Returns `object`.
  14275. * @example
  14276. *
  14277. * var object = { 'a': [{ 'b': { 'c': 3 } }] };
  14278. *
  14279. * _.update(object, 'a[0].b.c', function(n) { return n * n; });
  14280. * console.log(object.a[0].b.c);
  14281. * // => 9
  14282. *
  14283. * _.update(object, 'x[0].y.z', function(n) { return n ? n + 1 : 0; });
  14284. * console.log(object.x[0].y.z);
  14285. * // => 0
  14286. */
  14287. function update(object, path, updater) {
  14288. return object == null ? object : baseUpdate(object, path, castFunction(updater));
  14289. }
  14290. /**
  14291. * This method is like `_.update` except that it accepts `customizer` which is
  14292. * invoked to produce the objects of `path`. If `customizer` returns `undefined`
  14293. * path creation is handled by the method instead. The `customizer` is invoked
  14294. * with three arguments: (nsValue, key, nsObject).
  14295. *
  14296. * **Note:** This method mutates `object`.
  14297. *
  14298. * @static
  14299. * @memberOf _
  14300. * @since 4.6.0
  14301. * @category Object
  14302. * @param {Object} object The object to modify.
  14303. * @param {Array|string} path The path of the property to set.
  14304. * @param {Function} updater The function to produce the updated value.
  14305. * @param {Function} [customizer] The function to customize assigned values.
  14306. * @returns {Object} Returns `object`.
  14307. * @example
  14308. *
  14309. * var object = {};
  14310. *
  14311. * _.updateWith(object, '[0][1]', _.constant('a'), Object);
  14312. * // => { '0': { '1': 'a' } }
  14313. */
  14314. function updateWith(object, path, updater, customizer) {
  14315. customizer = typeof customizer == 'function' ? customizer : undefined;
  14316. return object == null ? object : baseUpdate(object, path, castFunction(updater), customizer);
  14317. }
  14318. /**
  14319. * Creates an array of the own enumerable string keyed property values of `object`.
  14320. *
  14321. * **Note:** Non-object values are coerced to objects.
  14322. *
  14323. * @static
  14324. * @since 0.1.0
  14325. * @memberOf _
  14326. * @category Object
  14327. * @param {Object} object The object to query.
  14328. * @returns {Array} Returns the array of property values.
  14329. * @example
  14330. *
  14331. * function Foo() {
  14332. * this.a = 1;
  14333. * this.b = 2;
  14334. * }
  14335. *
  14336. * Foo.prototype.c = 3;
  14337. *
  14338. * _.values(new Foo);
  14339. * // => [1, 2] (iteration order is not guaranteed)
  14340. *
  14341. * _.values('hi');
  14342. * // => ['h', 'i']
  14343. */
  14344. function values(object) {
  14345. return object == null ? [] : baseValues(object, keys(object));
  14346. }
  14347. /**
  14348. * Creates an array of the own and inherited enumerable string keyed property
  14349. * values of `object`.
  14350. *
  14351. * **Note:** Non-object values are coerced to objects.
  14352. *
  14353. * @static
  14354. * @memberOf _
  14355. * @since 3.0.0
  14356. * @category Object
  14357. * @param {Object} object The object to query.
  14358. * @returns {Array} Returns the array of property values.
  14359. * @example
  14360. *
  14361. * function Foo() {
  14362. * this.a = 1;
  14363. * this.b = 2;
  14364. * }
  14365. *
  14366. * Foo.prototype.c = 3;
  14367. *
  14368. * _.valuesIn(new Foo);
  14369. * // => [1, 2, 3] (iteration order is not guaranteed)
  14370. */
  14371. function valuesIn(object) {
  14372. return object == null ? [] : baseValues(object, keysIn(object));
  14373. }
  14374. /*------------------------------------------------------------------------*/
  14375. /**
  14376. * Clamps `number` within the inclusive `lower` and `upper` bounds.
  14377. *
  14378. * @static
  14379. * @memberOf _
  14380. * @since 4.0.0
  14381. * @category Number
  14382. * @param {number} number The number to clamp.
  14383. * @param {number} [lower] The lower bound.
  14384. * @param {number} upper The upper bound.
  14385. * @returns {number} Returns the clamped number.
  14386. * @example
  14387. *
  14388. * _.clamp(-10, -5, 5);
  14389. * // => -5
  14390. *
  14391. * _.clamp(10, -5, 5);
  14392. * // => 5
  14393. */
  14394. function clamp(number, lower, upper) {
  14395. if (upper === undefined) {
  14396. upper = lower;
  14397. lower = undefined;
  14398. }
  14399. if (upper !== undefined) {
  14400. upper = toNumber(upper);
  14401. upper = upper === upper ? upper : 0;
  14402. }
  14403. if (lower !== undefined) {
  14404. lower = toNumber(lower);
  14405. lower = lower === lower ? lower : 0;
  14406. }
  14407. return baseClamp(toNumber(number), lower, upper);
  14408. }
  14409. /**
  14410. * Checks if `n` is between `start` and up to, but not including, `end`. If
  14411. * `end` is not specified, it's set to `start` with `start` then set to `0`.
  14412. * If `start` is greater than `end` the params are swapped to support
  14413. * negative ranges.
  14414. *
  14415. * @static
  14416. * @memberOf _
  14417. * @since 3.3.0
  14418. * @category Number
  14419. * @param {number} number The number to check.
  14420. * @param {number} [start=0] The start of the range.
  14421. * @param {number} end The end of the range.
  14422. * @returns {boolean} Returns `true` if `number` is in the range, else `false`.
  14423. * @see _.range, _.rangeRight
  14424. * @example
  14425. *
  14426. * _.inRange(3, 2, 4);
  14427. * // => true
  14428. *
  14429. * _.inRange(4, 8);
  14430. * // => true
  14431. *
  14432. * _.inRange(4, 2);
  14433. * // => false
  14434. *
  14435. * _.inRange(2, 2);
  14436. * // => false
  14437. *
  14438. * _.inRange(1.2, 2);
  14439. * // => true
  14440. *
  14441. * _.inRange(5.2, 4);
  14442. * // => false
  14443. *
  14444. * _.inRange(-3, -2, -6);
  14445. * // => true
  14446. */
  14447. function inRange(number, start, end) {
  14448. start = toFinite(start);
  14449. if (end === undefined) {
  14450. end = start;
  14451. start = 0;
  14452. } else {
  14453. end = toFinite(end);
  14454. }
  14455. number = toNumber(number);
  14456. return baseInRange(number, start, end);
  14457. }
  14458. /**
  14459. * Produces a random number between the inclusive `lower` and `upper` bounds.
  14460. * If only one argument is provided a number between `0` and the given number
  14461. * is returned. If `floating` is `true`, or either `lower` or `upper` are
  14462. * floats, a floating-point number is returned instead of an integer.
  14463. *
  14464. * **Note:** JavaScript follows the IEEE-754 standard for resolving
  14465. * floating-point values which can produce unexpected results.
  14466. *
  14467. * @static
  14468. * @memberOf _
  14469. * @since 0.7.0
  14470. * @category Number
  14471. * @param {number} [lower=0] The lower bound.
  14472. * @param {number} [upper=1] The upper bound.
  14473. * @param {boolean} [floating] Specify returning a floating-point number.
  14474. * @returns {number} Returns the random number.
  14475. * @example
  14476. *
  14477. * _.random(0, 5);
  14478. * // => an integer between 0 and 5
  14479. *
  14480. * _.random(5);
  14481. * // => also an integer between 0 and 5
  14482. *
  14483. * _.random(5, true);
  14484. * // => a floating-point number between 0 and 5
  14485. *
  14486. * _.random(1.2, 5.2);
  14487. * // => a floating-point number between 1.2 and 5.2
  14488. */
  14489. function random(lower, upper, floating) {
  14490. if (floating && typeof floating != 'boolean' && isIterateeCall(lower, upper, floating)) {
  14491. upper = floating = undefined;
  14492. }
  14493. if (floating === undefined) {
  14494. if (typeof upper == 'boolean') {
  14495. floating = upper;
  14496. upper = undefined;
  14497. }
  14498. else if (typeof lower == 'boolean') {
  14499. floating = lower;
  14500. lower = undefined;
  14501. }
  14502. }
  14503. if (lower === undefined && upper === undefined) {
  14504. lower = 0;
  14505. upper = 1;
  14506. }
  14507. else {
  14508. lower = toFinite(lower);
  14509. if (upper === undefined) {
  14510. upper = lower;
  14511. lower = 0;
  14512. } else {
  14513. upper = toFinite(upper);
  14514. }
  14515. }
  14516. if (lower > upper) {
  14517. var temp = lower;
  14518. lower = upper;
  14519. upper = temp;
  14520. }
  14521. if (floating || lower % 1 || upper % 1) {
  14522. var rand = nativeRandom();
  14523. return nativeMin(lower + (rand * (upper - lower + freeParseFloat('1e-' + ((rand + '').length - 1)))), upper);
  14524. }
  14525. return baseRandom(lower, upper);
  14526. }
  14527. /*------------------------------------------------------------------------*/
  14528. /**
  14529. * Converts `string` to [camel case](https://en.wikipedia.org/wiki/CamelCase).
  14530. *
  14531. * @static
  14532. * @memberOf _
  14533. * @since 3.0.0
  14534. * @category String
  14535. * @param {string} [string=''] The string to convert.
  14536. * @returns {string} Returns the camel cased string.
  14537. * @example
  14538. *
  14539. * _.camelCase('Foo Bar');
  14540. * // => 'fooBar'
  14541. *
  14542. * _.camelCase('--foo-bar--');
  14543. * // => 'fooBar'
  14544. *
  14545. * _.camelCase('__FOO_BAR__');
  14546. * // => 'fooBar'
  14547. */
  14548. var camelCase = createCompounder(function(result, word, index) {
  14549. word = word.toLowerCase();
  14550. return result + (index ? capitalize(word) : word);
  14551. });
  14552. /**
  14553. * Converts the first character of `string` to upper case and the remaining
  14554. * to lower case.
  14555. *
  14556. * @static
  14557. * @memberOf _
  14558. * @since 3.0.0
  14559. * @category String
  14560. * @param {string} [string=''] The string to capitalize.
  14561. * @returns {string} Returns the capitalized string.
  14562. * @example
  14563. *
  14564. * _.capitalize('FRED');
  14565. * // => 'Fred'
  14566. */
  14567. function capitalize(string) {
  14568. return upperFirst(toString(string).toLowerCase());
  14569. }
  14570. /**
  14571. * Deburrs `string` by converting
  14572. * [Latin-1 Supplement](https://en.wikipedia.org/wiki/Latin-1_Supplement_(Unicode_block)#Character_table)
  14573. * and [Latin Extended-A](https://en.wikipedia.org/wiki/Latin_Extended-A)
  14574. * letters to basic Latin letters and removing
  14575. * [combining diacritical marks](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks).
  14576. *
  14577. * @static
  14578. * @memberOf _
  14579. * @since 3.0.0
  14580. * @category String
  14581. * @param {string} [string=''] The string to deburr.
  14582. * @returns {string} Returns the deburred string.
  14583. * @example
  14584. *
  14585. * _.deburr('déjà vu');
  14586. * // => 'deja vu'
  14587. */
  14588. function deburr(string) {
  14589. string = toString(string);
  14590. return string && string.replace(reLatin, deburrLetter).replace(reComboMark, '');
  14591. }
  14592. /**
  14593. * Checks if `string` ends with the given target string.
  14594. *
  14595. * @static
  14596. * @memberOf _
  14597. * @since 3.0.0
  14598. * @category String
  14599. * @param {string} [string=''] The string to inspect.
  14600. * @param {string} [target] The string to search for.
  14601. * @param {number} [position=string.length] The position to search up to.
  14602. * @returns {boolean} Returns `true` if `string` ends with `target`,
  14603. * else `false`.
  14604. * @example
  14605. *
  14606. * _.endsWith('abc', 'c');
  14607. * // => true
  14608. *
  14609. * _.endsWith('abc', 'b');
  14610. * // => false
  14611. *
  14612. * _.endsWith('abc', 'b', 2);
  14613. * // => true
  14614. */
  14615. function endsWith(string, target, position) {
  14616. string = toString(string);
  14617. target = baseToString(target);
  14618. var length = string.length;
  14619. position = position === undefined
  14620. ? length
  14621. : baseClamp(toInteger(position), 0, length);
  14622. var end = position;
  14623. position -= target.length;
  14624. return position >= 0 && string.slice(position, end) == target;
  14625. }
  14626. /**
  14627. * Converts the characters "&", "<", ">", '"', and "'" in `string` to their
  14628. * corresponding HTML entities.
  14629. *
  14630. * **Note:** No other characters are escaped. To escape additional
  14631. * characters use a third-party library like [_he_](https://mths.be/he).
  14632. *
  14633. * Though the ">" character is escaped for symmetry, characters like
  14634. * ">" and "/" don't need escaping in HTML and have no special meaning
  14635. * unless they're part of a tag or unquoted attribute value. See
  14636. * [Mathias Bynens's article](https://mathiasbynens.be/notes/ambiguous-ampersands)
  14637. * (under "semi-related fun fact") for more details.
  14638. *
  14639. * When working with HTML you should always
  14640. * [quote attribute values](http://wonko.com/post/html-escaping) to reduce
  14641. * XSS vectors.
  14642. *
  14643. * @static
  14644. * @since 0.1.0
  14645. * @memberOf _
  14646. * @category String
  14647. * @param {string} [string=''] The string to escape.
  14648. * @returns {string} Returns the escaped string.
  14649. * @example
  14650. *
  14651. * _.escape('fred, barney, & pebbles');
  14652. * // => 'fred, barney, &amp; pebbles'
  14653. */
  14654. function escape(string) {
  14655. string = toString(string);
  14656. return (string && reHasUnescapedHtml.test(string))
  14657. ? string.replace(reUnescapedHtml, escapeHtmlChar)
  14658. : string;
  14659. }
  14660. /**
  14661. * Escapes the `RegExp` special characters "^", "$", "\", ".", "*", "+",
  14662. * "?", "(", ")", "[", "]", "{", "}", and "|" in `string`.
  14663. *
  14664. * @static
  14665. * @memberOf _
  14666. * @since 3.0.0
  14667. * @category String
  14668. * @param {string} [string=''] The string to escape.
  14669. * @returns {string} Returns the escaped string.
  14670. * @example
  14671. *
  14672. * _.escapeRegExp('[lodash](https://lodash.com/)');
  14673. * // => '\[lodash\]\(https://lodash\.com/\)'
  14674. */
  14675. function escapeRegExp(string) {
  14676. string = toString(string);
  14677. return (string && reHasRegExpChar.test(string))
  14678. ? string.replace(reRegExpChar, '\\$&')
  14679. : string;
  14680. }
  14681. /**
  14682. * Converts `string` to
  14683. * [kebab case](https://en.wikipedia.org/wiki/Letter_case#Special_case_styles).
  14684. *
  14685. * @static
  14686. * @memberOf _
  14687. * @since 3.0.0
  14688. * @category String
  14689. * @param {string} [string=''] The string to convert.
  14690. * @returns {string} Returns the kebab cased string.
  14691. * @example
  14692. *
  14693. * _.kebabCase('Foo Bar');
  14694. * // => 'foo-bar'
  14695. *
  14696. * _.kebabCase('fooBar');
  14697. * // => 'foo-bar'
  14698. *
  14699. * _.kebabCase('__FOO_BAR__');
  14700. * // => 'foo-bar'
  14701. */
  14702. var kebabCase = createCompounder(function(result, word, index) {
  14703. return result + (index ? '-' : '') + word.toLowerCase();
  14704. });
  14705. /**
  14706. * Converts `string`, as space separated words, to lower case.
  14707. *
  14708. * @static
  14709. * @memberOf _
  14710. * @since 4.0.0
  14711. * @category String
  14712. * @param {string} [string=''] The string to convert.
  14713. * @returns {string} Returns the lower cased string.
  14714. * @example
  14715. *
  14716. * _.lowerCase('--Foo-Bar--');
  14717. * // => 'foo bar'
  14718. *
  14719. * _.lowerCase('fooBar');
  14720. * // => 'foo bar'
  14721. *
  14722. * _.lowerCase('__FOO_BAR__');
  14723. * // => 'foo bar'
  14724. */
  14725. var lowerCase = createCompounder(function(result, word, index) {
  14726. return result + (index ? ' ' : '') + word.toLowerCase();
  14727. });
  14728. /**
  14729. * Converts the first character of `string` to lower case.
  14730. *
  14731. * @static
  14732. * @memberOf _
  14733. * @since 4.0.0
  14734. * @category String
  14735. * @param {string} [string=''] The string to convert.
  14736. * @returns {string} Returns the converted string.
  14737. * @example
  14738. *
  14739. * _.lowerFirst('Fred');
  14740. * // => 'fred'
  14741. *
  14742. * _.lowerFirst('FRED');
  14743. * // => 'fRED'
  14744. */
  14745. var lowerFirst = createCaseFirst('toLowerCase');
  14746. /**
  14747. * Pads `string` on the left and right sides if it's shorter than `length`.
  14748. * Padding characters are truncated if they can't be evenly divided by `length`.
  14749. *
  14750. * @static
  14751. * @memberOf _
  14752. * @since 3.0.0
  14753. * @category String
  14754. * @param {string} [string=''] The string to pad.
  14755. * @param {number} [length=0] The padding length.
  14756. * @param {string} [chars=' '] The string used as padding.
  14757. * @returns {string} Returns the padded string.
  14758. * @example
  14759. *
  14760. * _.pad('abc', 8);
  14761. * // => ' abc '
  14762. *
  14763. * _.pad('abc', 8, '_-');
  14764. * // => '_-abc_-_'
  14765. *
  14766. * _.pad('abc', 3);
  14767. * // => 'abc'
  14768. */
  14769. function pad(string, length, chars) {
  14770. string = toString(string);
  14771. length = toInteger(length);
  14772. var strLength = length ? stringSize(string) : 0;
  14773. if (!length || strLength >= length) {
  14774. return string;
  14775. }
  14776. var mid = (length - strLength) / 2;
  14777. return (
  14778. createPadding(nativeFloor(mid), chars) +
  14779. string +
  14780. createPadding(nativeCeil(mid), chars)
  14781. );
  14782. }
  14783. /**
  14784. * Pads `string` on the right side if it's shorter than `length`. Padding
  14785. * characters are truncated if they exceed `length`.
  14786. *
  14787. * @static
  14788. * @memberOf _
  14789. * @since 4.0.0
  14790. * @category String
  14791. * @param {string} [string=''] The string to pad.
  14792. * @param {number} [length=0] The padding length.
  14793. * @param {string} [chars=' '] The string used as padding.
  14794. * @returns {string} Returns the padded string.
  14795. * @example
  14796. *
  14797. * _.padEnd('abc', 6);
  14798. * // => 'abc '
  14799. *
  14800. * _.padEnd('abc', 6, '_-');
  14801. * // => 'abc_-_'
  14802. *
  14803. * _.padEnd('abc', 3);
  14804. * // => 'abc'
  14805. */
  14806. function padEnd(string, length, chars) {
  14807. string = toString(string);
  14808. length = toInteger(length);
  14809. var strLength = length ? stringSize(string) : 0;
  14810. return (length && strLength < length)
  14811. ? (string + createPadding(length - strLength, chars))
  14812. : string;
  14813. }
  14814. /**
  14815. * Pads `string` on the left side if it's shorter than `length`. Padding
  14816. * characters are truncated if they exceed `length`.
  14817. *
  14818. * @static
  14819. * @memberOf _
  14820. * @since 4.0.0
  14821. * @category String
  14822. * @param {string} [string=''] The string to pad.
  14823. * @param {number} [length=0] The padding length.
  14824. * @param {string} [chars=' '] The string used as padding.
  14825. * @returns {string} Returns the padded string.
  14826. * @example
  14827. *
  14828. * _.padStart('abc', 6);
  14829. * // => ' abc'
  14830. *
  14831. * _.padStart('abc', 6, '_-');
  14832. * // => '_-_abc'
  14833. *
  14834. * _.padStart('abc', 3);
  14835. * // => 'abc'
  14836. */
  14837. function padStart(string, length, chars) {
  14838. string = toString(string);
  14839. length = toInteger(length);
  14840. var strLength = length ? stringSize(string) : 0;
  14841. return (length && strLength < length)
  14842. ? (createPadding(length - strLength, chars) + string)
  14843. : string;
  14844. }
  14845. /**
  14846. * Converts `string` to an integer of the specified radix. If `radix` is
  14847. * `undefined` or `0`, a `radix` of `10` is used unless `value` is a
  14848. * hexadecimal, in which case a `radix` of `16` is used.
  14849. *
  14850. * **Note:** This method aligns with the
  14851. * [ES5 implementation](https://es5.github.io/#x15.1.2.2) of `parseInt`.
  14852. *
  14853. * @static
  14854. * @memberOf _
  14855. * @since 1.1.0
  14856. * @category String
  14857. * @param {string} string The string to convert.
  14858. * @param {number} [radix=10] The radix to interpret `value` by.
  14859. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  14860. * @returns {number} Returns the converted integer.
  14861. * @example
  14862. *
  14863. * _.parseInt('08');
  14864. * // => 8
  14865. *
  14866. * _.map(['6', '08', '10'], _.parseInt);
  14867. * // => [6, 8, 10]
  14868. */
  14869. function parseInt(string, radix, guard) {
  14870. if (guard || radix == null) {
  14871. radix = 0;
  14872. } else if (radix) {
  14873. radix = +radix;
  14874. }
  14875. return nativeParseInt(toString(string).replace(reTrimStart, ''), radix || 0);
  14876. }
  14877. /**
  14878. * Repeats the given string `n` times.
  14879. *
  14880. * @static
  14881. * @memberOf _
  14882. * @since 3.0.0
  14883. * @category String
  14884. * @param {string} [string=''] The string to repeat.
  14885. * @param {number} [n=1] The number of times to repeat the string.
  14886. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  14887. * @returns {string} Returns the repeated string.
  14888. * @example
  14889. *
  14890. * _.repeat('*', 3);
  14891. * // => '***'
  14892. *
  14893. * _.repeat('abc', 2);
  14894. * // => 'abcabc'
  14895. *
  14896. * _.repeat('abc', 0);
  14897. * // => ''
  14898. */
  14899. function repeat(string, n, guard) {
  14900. if ((guard ? isIterateeCall(string, n, guard) : n === undefined)) {
  14901. n = 1;
  14902. } else {
  14903. n = toInteger(n);
  14904. }
  14905. return baseRepeat(toString(string), n);
  14906. }
  14907. /**
  14908. * Replaces matches for `pattern` in `string` with `replacement`.
  14909. *
  14910. * **Note:** This method is based on
  14911. * [`String#replace`](https://mdn.io/String/replace).
  14912. *
  14913. * @static
  14914. * @memberOf _
  14915. * @since 4.0.0
  14916. * @category String
  14917. * @param {string} [string=''] The string to modify.
  14918. * @param {RegExp|string} pattern The pattern to replace.
  14919. * @param {Function|string} replacement The match replacement.
  14920. * @returns {string} Returns the modified string.
  14921. * @example
  14922. *
  14923. * _.replace('Hi Fred', 'Fred', 'Barney');
  14924. * // => 'Hi Barney'
  14925. */
  14926. function replace() {
  14927. var args = arguments,
  14928. string = toString(args[0]);
  14929. return args.length < 3 ? string : string.replace(args[1], args[2]);
  14930. }
  14931. /**
  14932. * Converts `string` to
  14933. * [snake case](https://en.wikipedia.org/wiki/Snake_case).
  14934. *
  14935. * @static
  14936. * @memberOf _
  14937. * @since 3.0.0
  14938. * @category String
  14939. * @param {string} [string=''] The string to convert.
  14940. * @returns {string} Returns the snake cased string.
  14941. * @example
  14942. *
  14943. * _.snakeCase('Foo Bar');
  14944. * // => 'foo_bar'
  14945. *
  14946. * _.snakeCase('fooBar');
  14947. * // => 'foo_bar'
  14948. *
  14949. * _.snakeCase('--FOO-BAR--');
  14950. * // => 'foo_bar'
  14951. */
  14952. var snakeCase = createCompounder(function(result, word, index) {
  14953. return result + (index ? '_' : '') + word.toLowerCase();
  14954. });
  14955. /**
  14956. * Splits `string` by `separator`.
  14957. *
  14958. * **Note:** This method is based on
  14959. * [`String#split`](https://mdn.io/String/split).
  14960. *
  14961. * @static
  14962. * @memberOf _
  14963. * @since 4.0.0
  14964. * @category String
  14965. * @param {string} [string=''] The string to split.
  14966. * @param {RegExp|string} separator The separator pattern to split by.
  14967. * @param {number} [limit] The length to truncate results to.
  14968. * @returns {Array} Returns the string segments.
  14969. * @example
  14970. *
  14971. * _.split('a-b-c', '-', 2);
  14972. * // => ['a', 'b']
  14973. */
  14974. function split(string, separator, limit) {
  14975. if (limit && typeof limit != 'number' && isIterateeCall(string, separator, limit)) {
  14976. separator = limit = undefined;
  14977. }
  14978. limit = limit === undefined ? MAX_ARRAY_LENGTH : limit >>> 0;
  14979. if (!limit) {
  14980. return [];
  14981. }
  14982. string = toString(string);
  14983. if (string && (
  14984. typeof separator == 'string' ||
  14985. (separator != null && !isRegExp(separator))
  14986. )) {
  14987. separator = baseToString(separator);
  14988. if (!separator && hasUnicode(string)) {
  14989. return castSlice(stringToArray(string), 0, limit);
  14990. }
  14991. }
  14992. return string.split(separator, limit);
  14993. }
  14994. /**
  14995. * Converts `string` to
  14996. * [start case](https://en.wikipedia.org/wiki/Letter_case#Stylistic_or_specialised_usage).
  14997. *
  14998. * @static
  14999. * @memberOf _
  15000. * @since 3.1.0
  15001. * @category String
  15002. * @param {string} [string=''] The string to convert.
  15003. * @returns {string} Returns the start cased string.
  15004. * @example
  15005. *
  15006. * _.startCase('--foo-bar--');
  15007. * // => 'Foo Bar'
  15008. *
  15009. * _.startCase('fooBar');
  15010. * // => 'Foo Bar'
  15011. *
  15012. * _.startCase('__FOO_BAR__');
  15013. * // => 'FOO BAR'
  15014. */
  15015. var startCase = createCompounder(function(result, word, index) {
  15016. return result + (index ? ' ' : '') + upperFirst(word);
  15017. });
  15018. /**
  15019. * Checks if `string` starts with the given target string.
  15020. *
  15021. * @static
  15022. * @memberOf _
  15023. * @since 3.0.0
  15024. * @category String
  15025. * @param {string} [string=''] The string to inspect.
  15026. * @param {string} [target] The string to search for.
  15027. * @param {number} [position=0] The position to search from.
  15028. * @returns {boolean} Returns `true` if `string` starts with `target`,
  15029. * else `false`.
  15030. * @example
  15031. *
  15032. * _.startsWith('abc', 'a');
  15033. * // => true
  15034. *
  15035. * _.startsWith('abc', 'b');
  15036. * // => false
  15037. *
  15038. * _.startsWith('abc', 'b', 1);
  15039. * // => true
  15040. */
  15041. function startsWith(string, target, position) {
  15042. string = toString(string);
  15043. position = position == null
  15044. ? 0
  15045. : baseClamp(toInteger(position), 0, string.length);
  15046. target = baseToString(target);
  15047. return string.slice(position, position + target.length) == target;
  15048. }
  15049. /**
  15050. * Creates a compiled template function that can interpolate data properties
  15051. * in "interpolate" delimiters, HTML-escape interpolated data properties in
  15052. * "escape" delimiters, and execute JavaScript in "evaluate" delimiters. Data
  15053. * properties may be accessed as free variables in the template. If a setting
  15054. * object is given, it takes precedence over `_.templateSettings` values.
  15055. *
  15056. * **Note:** In the development build `_.template` utilizes
  15057. * [sourceURLs](http://www.html5rocks.com/en/tutorials/developertools/sourcemaps/#toc-sourceurl)
  15058. * for easier debugging.
  15059. *
  15060. * For more information on precompiling templates see
  15061. * [lodash's custom builds documentation](https://lodash.com/custom-builds).
  15062. *
  15063. * For more information on Chrome extension sandboxes see
  15064. * [Chrome's extensions documentation](https://developer.chrome.com/extensions/sandboxingEval).
  15065. *
  15066. * @static
  15067. * @since 0.1.0
  15068. * @memberOf _
  15069. * @category String
  15070. * @param {string} [string=''] The template string.
  15071. * @param {Object} [options={}] The options object.
  15072. * @param {RegExp} [options.escape=_.templateSettings.escape]
  15073. * The HTML "escape" delimiter.
  15074. * @param {RegExp} [options.evaluate=_.templateSettings.evaluate]
  15075. * The "evaluate" delimiter.
  15076. * @param {Object} [options.imports=_.templateSettings.imports]
  15077. * An object to import into the template as free variables.
  15078. * @param {RegExp} [options.interpolate=_.templateSettings.interpolate]
  15079. * The "interpolate" delimiter.
  15080. * @param {string} [options.sourceURL='lodash.templateSources[n]']
  15081. * The sourceURL of the compiled template.
  15082. * @param {string} [options.variable='obj']
  15083. * The data object variable name.
  15084. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  15085. * @returns {Function} Returns the compiled template function.
  15086. * @example
  15087. *
  15088. * // Use the "interpolate" delimiter to create a compiled template.
  15089. * var compiled = _.template('hello <%= user %>!');
  15090. * compiled({ 'user': 'fred' });
  15091. * // => 'hello fred!'
  15092. *
  15093. * // Use the HTML "escape" delimiter to escape data property values.
  15094. * var compiled = _.template('<b><%- value %></b>');
  15095. * compiled({ 'value': '<script>' });
  15096. * // => '<b>&lt;script&gt;</b>'
  15097. *
  15098. * // Use the "evaluate" delimiter to execute JavaScript and generate HTML.
  15099. * var compiled = _.template('<% _.forEach(users, function(user) { %><li><%- user %></li><% }); %>');
  15100. * compiled({ 'users': ['fred', 'barney'] });
  15101. * // => '<li>fred</li><li>barney</li>'
  15102. *
  15103. * // Use the internal `print` function in "evaluate" delimiters.
  15104. * var compiled = _.template('<% print("hello " + user); %>!');
  15105. * compiled({ 'user': 'barney' });
  15106. * // => 'hello barney!'
  15107. *
  15108. * // Use the ES template literal delimiter as an "interpolate" delimiter.
  15109. * // Disable support by replacing the "interpolate" delimiter.
  15110. * var compiled = _.template('hello ${ user }!');
  15111. * compiled({ 'user': 'pebbles' });
  15112. * // => 'hello pebbles!'
  15113. *
  15114. * // Use backslashes to treat delimiters as plain text.
  15115. * var compiled = _.template('<%= "\\<%- value %\\>" %>');
  15116. * compiled({ 'value': 'ignored' });
  15117. * // => '<%- value %>'
  15118. *
  15119. * // Use the `imports` option to import `jQuery` as `jq`.
  15120. * var text = '<% jq.each(users, function(user) { %><li><%- user %></li><% }); %>';
  15121. * var compiled = _.template(text, { 'imports': { 'jq': jQuery } });
  15122. * compiled({ 'users': ['fred', 'barney'] });
  15123. * // => '<li>fred</li><li>barney</li>'
  15124. *
  15125. * // Use the `sourceURL` option to specify a custom sourceURL for the template.
  15126. * var compiled = _.template('hello <%= user %>!', { 'sourceURL': '/basic/greeting.jst' });
  15127. * compiled(data);
  15128. * // => Find the source of "greeting.jst" under the Sources tab or Resources panel of the web inspector.
  15129. *
  15130. * // Use the `variable` option to ensure a with-statement isn't used in the compiled template.
  15131. * var compiled = _.template('hi <%= data.user %>!', { 'variable': 'data' });
  15132. * compiled.source;
  15133. * // => function(data) {
  15134. * // var __t, __p = '';
  15135. * // __p += 'hi ' + ((__t = ( data.user )) == null ? '' : __t) + '!';
  15136. * // return __p;
  15137. * // }
  15138. *
  15139. * // Use custom template delimiters.
  15140. * _.templateSettings.interpolate = /{{([\s\S]+?)}}/g;
  15141. * var compiled = _.template('hello {{ user }}!');
  15142. * compiled({ 'user': 'mustache' });
  15143. * // => 'hello mustache!'
  15144. *
  15145. * // Use the `source` property to inline compiled templates for meaningful
  15146. * // line numbers in error messages and stack traces.
  15147. * fs.writeFileSync(path.join(process.cwd(), 'jst.js'), '\
  15148. * var JST = {\
  15149. * "main": ' + _.template(mainText).source + '\
  15150. * };\
  15151. * ');
  15152. */
  15153. function template(string, options, guard) {
  15154. // Based on John Resig's `tmpl` implementation
  15155. // (http://ejohn.org/blog/javascript-micro-templating/)
  15156. // and Laura Doktorova's doT.js (https://github.com/olado/doT).
  15157. var settings = lodash.templateSettings;
  15158. if (guard && isIterateeCall(string, options, guard)) {
  15159. options = undefined;
  15160. }
  15161. string = toString(string);
  15162. options = assignInWith({}, options, settings, customDefaultsAssignIn);
  15163. var imports = assignInWith({}, options.imports, settings.imports, customDefaultsAssignIn),
  15164. importsKeys = keys(imports),
  15165. importsValues = baseValues(imports, importsKeys);
  15166. var isEscaping,
  15167. isEvaluating,
  15168. index = 0,
  15169. interpolate = options.interpolate || reNoMatch,
  15170. source = "__p += '";
  15171. // Compile the regexp to match each delimiter.
  15172. var reDelimiters = RegExp(
  15173. (options.escape || reNoMatch).source + '|' +
  15174. interpolate.source + '|' +
  15175. (interpolate === reInterpolate ? reEsTemplate : reNoMatch).source + '|' +
  15176. (options.evaluate || reNoMatch).source + '|$'
  15177. , 'g');
  15178. // Use a sourceURL for easier debugging.
  15179. // The sourceURL gets injected into the source that's eval-ed, so be careful
  15180. // to normalize all kinds of whitespace, so e.g. newlines (and unicode versions of it) can't sneak in
  15181. // and escape the comment, thus injecting code that gets evaled.
  15182. var sourceURL = '//# sourceURL=' +
  15183. (hasOwnProperty.call(options, 'sourceURL')
  15184. ? (options.sourceURL + '').replace(/\s/g, ' ')
  15185. : ('lodash.templateSources[' + (++templateCounter) + ']')
  15186. ) + '\n';
  15187. string.replace(reDelimiters, function(match, escapeValue, interpolateValue, esTemplateValue, evaluateValue, offset) {
  15188. interpolateValue || (interpolateValue = esTemplateValue);
  15189. // Escape characters that can't be included in string literals.
  15190. source += string.slice(index, offset).replace(reUnescapedString, escapeStringChar);
  15191. // Replace delimiters with snippets.
  15192. if (escapeValue) {
  15193. isEscaping = true;
  15194. source += "' +\n__e(" + escapeValue + ") +\n'";
  15195. }
  15196. if (evaluateValue) {
  15197. isEvaluating = true;
  15198. source += "';\n" + evaluateValue + ";\n__p += '";
  15199. }
  15200. if (interpolateValue) {
  15201. source += "' +\n((__t = (" + interpolateValue + ")) == null ? '' : __t) +\n'";
  15202. }
  15203. index = offset + match.length;
  15204. // The JS engine embedded in Adobe products needs `match` returned in
  15205. // order to produce the correct `offset` value.
  15206. return match;
  15207. });
  15208. source += "';\n";
  15209. // If `variable` is not specified wrap a with-statement around the generated
  15210. // code to add the data object to the top of the scope chain.
  15211. var variable = hasOwnProperty.call(options, 'variable') && options.variable;
  15212. if (!variable) {
  15213. source = 'with (obj) {\n' + source + '\n}\n';
  15214. }
  15215. // Throw an error if a forbidden character was found in `variable`, to prevent
  15216. // potential command injection attacks.
  15217. else if (reForbiddenIdentifierChars.test(variable)) {
  15218. throw new Error(INVALID_TEMPL_VAR_ERROR_TEXT);
  15219. }
  15220. // Cleanup code by stripping empty strings.
  15221. source = (isEvaluating ? source.replace(reEmptyStringLeading, '') : source)
  15222. .replace(reEmptyStringMiddle, '$1')
  15223. .replace(reEmptyStringTrailing, '$1;');
  15224. // Frame code as the function body.
  15225. source = 'function(' + (variable || 'obj') + ') {\n' +
  15226. (variable
  15227. ? ''
  15228. : 'obj || (obj = {});\n'
  15229. ) +
  15230. "var __t, __p = ''" +
  15231. (isEscaping
  15232. ? ', __e = _.escape'
  15233. : ''
  15234. ) +
  15235. (isEvaluating
  15236. ? ', __j = Array.prototype.join;\n' +
  15237. "function print() { __p += __j.call(arguments, '') }\n"
  15238. : ';\n'
  15239. ) +
  15240. source +
  15241. 'return __p\n}';
  15242. var result = attempt(function() {
  15243. return Function(importsKeys, sourceURL + 'return ' + source)
  15244. .apply(undefined, importsValues);
  15245. });
  15246. // Provide the compiled function's source by its `toString` method or
  15247. // the `source` property as a convenience for inlining compiled templates.
  15248. result.source = source;
  15249. if (isError(result)) {
  15250. throw result;
  15251. }
  15252. return result;
  15253. }
  15254. /**
  15255. * Converts `string`, as a whole, to lower case just like
  15256. * [String#toLowerCase](https://mdn.io/toLowerCase).
  15257. *
  15258. * @static
  15259. * @memberOf _
  15260. * @since 4.0.0
  15261. * @category String
  15262. * @param {string} [string=''] The string to convert.
  15263. * @returns {string} Returns the lower cased string.
  15264. * @example
  15265. *
  15266. * _.toLower('--Foo-Bar--');
  15267. * // => '--foo-bar--'
  15268. *
  15269. * _.toLower('fooBar');
  15270. * // => 'foobar'
  15271. *
  15272. * _.toLower('__FOO_BAR__');
  15273. * // => '__foo_bar__'
  15274. */
  15275. function toLower(value) {
  15276. return toString(value).toLowerCase();
  15277. }
  15278. /**
  15279. * Converts `string`, as a whole, to upper case just like
  15280. * [String#toUpperCase](https://mdn.io/toUpperCase).
  15281. *
  15282. * @static
  15283. * @memberOf _
  15284. * @since 4.0.0
  15285. * @category String
  15286. * @param {string} [string=''] The string to convert.
  15287. * @returns {string} Returns the upper cased string.
  15288. * @example
  15289. *
  15290. * _.toUpper('--foo-bar--');
  15291. * // => '--FOO-BAR--'
  15292. *
  15293. * _.toUpper('fooBar');
  15294. * // => 'FOOBAR'
  15295. *
  15296. * _.toUpper('__foo_bar__');
  15297. * // => '__FOO_BAR__'
  15298. */
  15299. function toUpper(value) {
  15300. return toString(value).toUpperCase();
  15301. }
  15302. /**
  15303. * Removes leading and trailing whitespace or specified characters from `string`.
  15304. *
  15305. * @static
  15306. * @memberOf _
  15307. * @since 3.0.0
  15308. * @category String
  15309. * @param {string} [string=''] The string to trim.
  15310. * @param {string} [chars=whitespace] The characters to trim.
  15311. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  15312. * @returns {string} Returns the trimmed string.
  15313. * @example
  15314. *
  15315. * _.trim(' abc ');
  15316. * // => 'abc'
  15317. *
  15318. * _.trim('-_-abc-_-', '_-');
  15319. * // => 'abc'
  15320. *
  15321. * _.map([' foo ', ' bar '], _.trim);
  15322. * // => ['foo', 'bar']
  15323. */
  15324. function trim(string, chars, guard) {
  15325. string = toString(string);
  15326. if (string && (guard || chars === undefined)) {
  15327. return baseTrim(string);
  15328. }
  15329. if (!string || !(chars = baseToString(chars))) {
  15330. return string;
  15331. }
  15332. var strSymbols = stringToArray(string),
  15333. chrSymbols = stringToArray(chars),
  15334. start = charsStartIndex(strSymbols, chrSymbols),
  15335. end = charsEndIndex(strSymbols, chrSymbols) + 1;
  15336. return castSlice(strSymbols, start, end).join('');
  15337. }
  15338. /**
  15339. * Removes trailing whitespace or specified characters from `string`.
  15340. *
  15341. * @static
  15342. * @memberOf _
  15343. * @since 4.0.0
  15344. * @category String
  15345. * @param {string} [string=''] The string to trim.
  15346. * @param {string} [chars=whitespace] The characters to trim.
  15347. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  15348. * @returns {string} Returns the trimmed string.
  15349. * @example
  15350. *
  15351. * _.trimEnd(' abc ');
  15352. * // => ' abc'
  15353. *
  15354. * _.trimEnd('-_-abc-_-', '_-');
  15355. * // => '-_-abc'
  15356. */
  15357. function trimEnd(string, chars, guard) {
  15358. string = toString(string);
  15359. if (string && (guard || chars === undefined)) {
  15360. return string.slice(0, trimmedEndIndex(string) + 1);
  15361. }
  15362. if (!string || !(chars = baseToString(chars))) {
  15363. return string;
  15364. }
  15365. var strSymbols = stringToArray(string),
  15366. end = charsEndIndex(strSymbols, stringToArray(chars)) + 1;
  15367. return castSlice(strSymbols, 0, end).join('');
  15368. }
  15369. /**
  15370. * Removes leading whitespace or specified characters from `string`.
  15371. *
  15372. * @static
  15373. * @memberOf _
  15374. * @since 4.0.0
  15375. * @category String
  15376. * @param {string} [string=''] The string to trim.
  15377. * @param {string} [chars=whitespace] The characters to trim.
  15378. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  15379. * @returns {string} Returns the trimmed string.
  15380. * @example
  15381. *
  15382. * _.trimStart(' abc ');
  15383. * // => 'abc '
  15384. *
  15385. * _.trimStart('-_-abc-_-', '_-');
  15386. * // => 'abc-_-'
  15387. */
  15388. function trimStart(string, chars, guard) {
  15389. string = toString(string);
  15390. if (string && (guard || chars === undefined)) {
  15391. return string.replace(reTrimStart, '');
  15392. }
  15393. if (!string || !(chars = baseToString(chars))) {
  15394. return string;
  15395. }
  15396. var strSymbols = stringToArray(string),
  15397. start = charsStartIndex(strSymbols, stringToArray(chars));
  15398. return castSlice(strSymbols, start).join('');
  15399. }
  15400. /**
  15401. * Truncates `string` if it's longer than the given maximum string length.
  15402. * The last characters of the truncated string are replaced with the omission
  15403. * string which defaults to "...".
  15404. *
  15405. * @static
  15406. * @memberOf _
  15407. * @since 4.0.0
  15408. * @category String
  15409. * @param {string} [string=''] The string to truncate.
  15410. * @param {Object} [options={}] The options object.
  15411. * @param {number} [options.length=30] The maximum string length.
  15412. * @param {string} [options.omission='...'] The string to indicate text is omitted.
  15413. * @param {RegExp|string} [options.separator] The separator pattern to truncate to.
  15414. * @returns {string} Returns the truncated string.
  15415. * @example
  15416. *
  15417. * _.truncate('hi-diddly-ho there, neighborino');
  15418. * // => 'hi-diddly-ho there, neighbo...'
  15419. *
  15420. * _.truncate('hi-diddly-ho there, neighborino', {
  15421. * 'length': 24,
  15422. * 'separator': ' '
  15423. * });
  15424. * // => 'hi-diddly-ho there,...'
  15425. *
  15426. * _.truncate('hi-diddly-ho there, neighborino', {
  15427. * 'length': 24,
  15428. * 'separator': /,? +/
  15429. * });
  15430. * // => 'hi-diddly-ho there...'
  15431. *
  15432. * _.truncate('hi-diddly-ho there, neighborino', {
  15433. * 'omission': ' [...]'
  15434. * });
  15435. * // => 'hi-diddly-ho there, neig [...]'
  15436. */
  15437. function truncate(string, options) {
  15438. var length = DEFAULT_TRUNC_LENGTH,
  15439. omission = DEFAULT_TRUNC_OMISSION;
  15440. if (isObject(options)) {
  15441. var separator = 'separator' in options ? options.separator : separator;
  15442. length = 'length' in options ? toInteger(options.length) : length;
  15443. omission = 'omission' in options ? baseToString(options.omission) : omission;
  15444. }
  15445. string = toString(string);
  15446. var strLength = string.length;
  15447. if (hasUnicode(string)) {
  15448. var strSymbols = stringToArray(string);
  15449. strLength = strSymbols.length;
  15450. }
  15451. if (length >= strLength) {
  15452. return string;
  15453. }
  15454. var end = length - stringSize(omission);
  15455. if (end < 1) {
  15456. return omission;
  15457. }
  15458. var result = strSymbols
  15459. ? castSlice(strSymbols, 0, end).join('')
  15460. : string.slice(0, end);
  15461. if (separator === undefined) {
  15462. return result + omission;
  15463. }
  15464. if (strSymbols) {
  15465. end += (result.length - end);
  15466. }
  15467. if (isRegExp(separator)) {
  15468. if (string.slice(end).search(separator)) {
  15469. var match,
  15470. substring = result;
  15471. if (!separator.global) {
  15472. separator = RegExp(separator.source, toString(reFlags.exec(separator)) + 'g');
  15473. }
  15474. separator.lastIndex = 0;
  15475. while ((match = separator.exec(substring))) {
  15476. var newEnd = match.index;
  15477. }
  15478. result = result.slice(0, newEnd === undefined ? end : newEnd);
  15479. }
  15480. } else if (string.indexOf(baseToString(separator), end) != end) {
  15481. var index = result.lastIndexOf(separator);
  15482. if (index > -1) {
  15483. result = result.slice(0, index);
  15484. }
  15485. }
  15486. return result + omission;
  15487. }
  15488. /**
  15489. * The inverse of `_.escape`; this method converts the HTML entities
  15490. * `&amp;`, `&lt;`, `&gt;`, `&quot;`, and `&#39;` in `string` to
  15491. * their corresponding characters.
  15492. *
  15493. * **Note:** No other HTML entities are unescaped. To unescape additional
  15494. * HTML entities use a third-party library like [_he_](https://mths.be/he).
  15495. *
  15496. * @static
  15497. * @memberOf _
  15498. * @since 0.6.0
  15499. * @category String
  15500. * @param {string} [string=''] The string to unescape.
  15501. * @returns {string} Returns the unescaped string.
  15502. * @example
  15503. *
  15504. * _.unescape('fred, barney, &amp; pebbles');
  15505. * // => 'fred, barney, & pebbles'
  15506. */
  15507. function unescape(string) {
  15508. string = toString(string);
  15509. return (string && reHasEscapedHtml.test(string))
  15510. ? string.replace(reEscapedHtml, unescapeHtmlChar)
  15511. : string;
  15512. }
  15513. /**
  15514. * Converts `string`, as space separated words, to upper case.
  15515. *
  15516. * @static
  15517. * @memberOf _
  15518. * @since 4.0.0
  15519. * @category String
  15520. * @param {string} [string=''] The string to convert.
  15521. * @returns {string} Returns the upper cased string.
  15522. * @example
  15523. *
  15524. * _.upperCase('--foo-bar');
  15525. * // => 'FOO BAR'
  15526. *
  15527. * _.upperCase('fooBar');
  15528. * // => 'FOO BAR'
  15529. *
  15530. * _.upperCase('__foo_bar__');
  15531. * // => 'FOO BAR'
  15532. */
  15533. var upperCase = createCompounder(function(result, word, index) {
  15534. return result + (index ? ' ' : '') + word.toUpperCase();
  15535. });
  15536. /**
  15537. * Converts the first character of `string` to upper case.
  15538. *
  15539. * @static
  15540. * @memberOf _
  15541. * @since 4.0.0
  15542. * @category String
  15543. * @param {string} [string=''] The string to convert.
  15544. * @returns {string} Returns the converted string.
  15545. * @example
  15546. *
  15547. * _.upperFirst('fred');
  15548. * // => 'Fred'
  15549. *
  15550. * _.upperFirst('FRED');
  15551. * // => 'FRED'
  15552. */
  15553. var upperFirst = createCaseFirst('toUpperCase');
  15554. /**
  15555. * Splits `string` into an array of its words.
  15556. *
  15557. * @static
  15558. * @memberOf _
  15559. * @since 3.0.0
  15560. * @category String
  15561. * @param {string} [string=''] The string to inspect.
  15562. * @param {RegExp|string} [pattern] The pattern to match words.
  15563. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  15564. * @returns {Array} Returns the words of `string`.
  15565. * @example
  15566. *
  15567. * _.words('fred, barney, & pebbles');
  15568. * // => ['fred', 'barney', 'pebbles']
  15569. *
  15570. * _.words('fred, barney, & pebbles', /[^, ]+/g);
  15571. * // => ['fred', 'barney', '&', 'pebbles']
  15572. */
  15573. function words(string, pattern, guard) {
  15574. string = toString(string);
  15575. pattern = guard ? undefined : pattern;
  15576. if (pattern === undefined) {
  15577. return hasUnicodeWord(string) ? unicodeWords(string) : asciiWords(string);
  15578. }
  15579. return string.match(pattern) || [];
  15580. }
  15581. /*------------------------------------------------------------------------*/
  15582. /**
  15583. * Attempts to invoke `func`, returning either the result or the caught error
  15584. * object. Any additional arguments are provided to `func` when it's invoked.
  15585. *
  15586. * @static
  15587. * @memberOf _
  15588. * @since 3.0.0
  15589. * @category Util
  15590. * @param {Function} func The function to attempt.
  15591. * @param {...*} [args] The arguments to invoke `func` with.
  15592. * @returns {*} Returns the `func` result or error object.
  15593. * @example
  15594. *
  15595. * // Avoid throwing errors for invalid selectors.
  15596. * var elements = _.attempt(function(selector) {
  15597. * return document.querySelectorAll(selector);
  15598. * }, '>_>');
  15599. *
  15600. * if (_.isError(elements)) {
  15601. * elements = [];
  15602. * }
  15603. */
  15604. var attempt = baseRest(function(func, args) {
  15605. try {
  15606. return apply(func, undefined, args);
  15607. } catch (e) {
  15608. return isError(e) ? e : new Error(e);
  15609. }
  15610. });
  15611. /**
  15612. * Binds methods of an object to the object itself, overwriting the existing
  15613. * method.
  15614. *
  15615. * **Note:** This method doesn't set the "length" property of bound functions.
  15616. *
  15617. * @static
  15618. * @since 0.1.0
  15619. * @memberOf _
  15620. * @category Util
  15621. * @param {Object} object The object to bind and assign the bound methods to.
  15622. * @param {...(string|string[])} methodNames The object method names to bind.
  15623. * @returns {Object} Returns `object`.
  15624. * @example
  15625. *
  15626. * var view = {
  15627. * 'label': 'docs',
  15628. * 'click': function() {
  15629. * console.log('clicked ' + this.label);
  15630. * }
  15631. * };
  15632. *
  15633. * _.bindAll(view, ['click']);
  15634. * jQuery(element).on('click', view.click);
  15635. * // => Logs 'clicked docs' when clicked.
  15636. */
  15637. var bindAll = flatRest(function(object, methodNames) {
  15638. arrayEach(methodNames, function(key) {
  15639. key = toKey(key);
  15640. baseAssignValue(object, key, bind(object[key], object));
  15641. });
  15642. return object;
  15643. });
  15644. /**
  15645. * Creates a function that iterates over `pairs` and invokes the corresponding
  15646. * function of the first predicate to return truthy. The predicate-function
  15647. * pairs are invoked with the `this` binding and arguments of the created
  15648. * function.
  15649. *
  15650. * @static
  15651. * @memberOf _
  15652. * @since 4.0.0
  15653. * @category Util
  15654. * @param {Array} pairs The predicate-function pairs.
  15655. * @returns {Function} Returns the new composite function.
  15656. * @example
  15657. *
  15658. * var func = _.cond([
  15659. * [_.matches({ 'a': 1 }), _.constant('matches A')],
  15660. * [_.conforms({ 'b': _.isNumber }), _.constant('matches B')],
  15661. * [_.stubTrue, _.constant('no match')]
  15662. * ]);
  15663. *
  15664. * func({ 'a': 1, 'b': 2 });
  15665. * // => 'matches A'
  15666. *
  15667. * func({ 'a': 0, 'b': 1 });
  15668. * // => 'matches B'
  15669. *
  15670. * func({ 'a': '1', 'b': '2' });
  15671. * // => 'no match'
  15672. */
  15673. function cond(pairs) {
  15674. var length = pairs == null ? 0 : pairs.length,
  15675. toIteratee = getIteratee();
  15676. pairs = !length ? [] : arrayMap(pairs, function(pair) {
  15677. if (typeof pair[1] != 'function') {
  15678. throw new TypeError(FUNC_ERROR_TEXT);
  15679. }
  15680. return [toIteratee(pair[0]), pair[1]];
  15681. });
  15682. return baseRest(function(args) {
  15683. var index = -1;
  15684. while (++index < length) {
  15685. var pair = pairs[index];
  15686. if (apply(pair[0], this, args)) {
  15687. return apply(pair[1], this, args);
  15688. }
  15689. }
  15690. });
  15691. }
  15692. /**
  15693. * Creates a function that invokes the predicate properties of `source` with
  15694. * the corresponding property values of a given object, returning `true` if
  15695. * all predicates return truthy, else `false`.
  15696. *
  15697. * **Note:** The created function is equivalent to `_.conformsTo` with
  15698. * `source` partially applied.
  15699. *
  15700. * @static
  15701. * @memberOf _
  15702. * @since 4.0.0
  15703. * @category Util
  15704. * @param {Object} source The object of property predicates to conform to.
  15705. * @returns {Function} Returns the new spec function.
  15706. * @example
  15707. *
  15708. * var objects = [
  15709. * { 'a': 2, 'b': 1 },
  15710. * { 'a': 1, 'b': 2 }
  15711. * ];
  15712. *
  15713. * _.filter(objects, _.conforms({ 'b': function(n) { return n > 1; } }));
  15714. * // => [{ 'a': 1, 'b': 2 }]
  15715. */
  15716. function conforms(source) {
  15717. return baseConforms(baseClone(source, CLONE_DEEP_FLAG));
  15718. }
  15719. /**
  15720. * Creates a function that returns `value`.
  15721. *
  15722. * @static
  15723. * @memberOf _
  15724. * @since 2.4.0
  15725. * @category Util
  15726. * @param {*} value The value to return from the new function.
  15727. * @returns {Function} Returns the new constant function.
  15728. * @example
  15729. *
  15730. * var objects = _.times(2, _.constant({ 'a': 1 }));
  15731. *
  15732. * console.log(objects);
  15733. * // => [{ 'a': 1 }, { 'a': 1 }]
  15734. *
  15735. * console.log(objects[0] === objects[1]);
  15736. * // => true
  15737. */
  15738. function constant(value) {
  15739. return function() {
  15740. return value;
  15741. };
  15742. }
  15743. /**
  15744. * Checks `value` to determine whether a default value should be returned in
  15745. * its place. The `defaultValue` is returned if `value` is `NaN`, `null`,
  15746. * or `undefined`.
  15747. *
  15748. * @static
  15749. * @memberOf _
  15750. * @since 4.14.0
  15751. * @category Util
  15752. * @param {*} value The value to check.
  15753. * @param {*} defaultValue The default value.
  15754. * @returns {*} Returns the resolved value.
  15755. * @example
  15756. *
  15757. * _.defaultTo(1, 10);
  15758. * // => 1
  15759. *
  15760. * _.defaultTo(undefined, 10);
  15761. * // => 10
  15762. */
  15763. function defaultTo(value, defaultValue) {
  15764. return (value == null || value !== value) ? defaultValue : value;
  15765. }
  15766. /**
  15767. * Creates a function that returns the result of invoking the given functions
  15768. * with the `this` binding of the created function, where each successive
  15769. * invocation is supplied the return value of the previous.
  15770. *
  15771. * @static
  15772. * @memberOf _
  15773. * @since 3.0.0
  15774. * @category Util
  15775. * @param {...(Function|Function[])} [funcs] The functions to invoke.
  15776. * @returns {Function} Returns the new composite function.
  15777. * @see _.flowRight
  15778. * @example
  15779. *
  15780. * function square(n) {
  15781. * return n * n;
  15782. * }
  15783. *
  15784. * var addSquare = _.flow([_.add, square]);
  15785. * addSquare(1, 2);
  15786. * // => 9
  15787. */
  15788. var flow = createFlow();
  15789. /**
  15790. * This method is like `_.flow` except that it creates a function that
  15791. * invokes the given functions from right to left.
  15792. *
  15793. * @static
  15794. * @since 3.0.0
  15795. * @memberOf _
  15796. * @category Util
  15797. * @param {...(Function|Function[])} [funcs] The functions to invoke.
  15798. * @returns {Function} Returns the new composite function.
  15799. * @see _.flow
  15800. * @example
  15801. *
  15802. * function square(n) {
  15803. * return n * n;
  15804. * }
  15805. *
  15806. * var addSquare = _.flowRight([square, _.add]);
  15807. * addSquare(1, 2);
  15808. * // => 9
  15809. */
  15810. var flowRight = createFlow(true);
  15811. /**
  15812. * This method returns the first argument it receives.
  15813. *
  15814. * @static
  15815. * @since 0.1.0
  15816. * @memberOf _
  15817. * @category Util
  15818. * @param {*} value Any value.
  15819. * @returns {*} Returns `value`.
  15820. * @example
  15821. *
  15822. * var object = { 'a': 1 };
  15823. *
  15824. * console.log(_.identity(object) === object);
  15825. * // => true
  15826. */
  15827. function identity(value) {
  15828. return value;
  15829. }
  15830. /**
  15831. * Creates a function that invokes `func` with the arguments of the created
  15832. * function. If `func` is a property name, the created function returns the
  15833. * property value for a given element. If `func` is an array or object, the
  15834. * created function returns `true` for elements that contain the equivalent
  15835. * source properties, otherwise it returns `false`.
  15836. *
  15837. * @static
  15838. * @since 4.0.0
  15839. * @memberOf _
  15840. * @category Util
  15841. * @param {*} [func=_.identity] The value to convert to a callback.
  15842. * @returns {Function} Returns the callback.
  15843. * @example
  15844. *
  15845. * var users = [
  15846. * { 'user': 'barney', 'age': 36, 'active': true },
  15847. * { 'user': 'fred', 'age': 40, 'active': false }
  15848. * ];
  15849. *
  15850. * // The `_.matches` iteratee shorthand.
  15851. * _.filter(users, _.iteratee({ 'user': 'barney', 'active': true }));
  15852. * // => [{ 'user': 'barney', 'age': 36, 'active': true }]
  15853. *
  15854. * // The `_.matchesProperty` iteratee shorthand.
  15855. * _.filter(users, _.iteratee(['user', 'fred']));
  15856. * // => [{ 'user': 'fred', 'age': 40 }]
  15857. *
  15858. * // The `_.property` iteratee shorthand.
  15859. * _.map(users, _.iteratee('user'));
  15860. * // => ['barney', 'fred']
  15861. *
  15862. * // Create custom iteratee shorthands.
  15863. * _.iteratee = _.wrap(_.iteratee, function(iteratee, func) {
  15864. * return !_.isRegExp(func) ? iteratee(func) : function(string) {
  15865. * return func.test(string);
  15866. * };
  15867. * });
  15868. *
  15869. * _.filter(['abc', 'def'], /ef/);
  15870. * // => ['def']
  15871. */
  15872. function iteratee(func) {
  15873. return baseIteratee(typeof func == 'function' ? func : baseClone(func, CLONE_DEEP_FLAG));
  15874. }
  15875. /**
  15876. * Creates a function that performs a partial deep comparison between a given
  15877. * object and `source`, returning `true` if the given object has equivalent
  15878. * property values, else `false`.
  15879. *
  15880. * **Note:** The created function is equivalent to `_.isMatch` with `source`
  15881. * partially applied.
  15882. *
  15883. * Partial comparisons will match empty array and empty object `source`
  15884. * values against any array or object value, respectively. See `_.isEqual`
  15885. * for a list of supported value comparisons.
  15886. *
  15887. * **Note:** Multiple values can be checked by combining several matchers
  15888. * using `_.overSome`
  15889. *
  15890. * @static
  15891. * @memberOf _
  15892. * @since 3.0.0
  15893. * @category Util
  15894. * @param {Object} source The object of property values to match.
  15895. * @returns {Function} Returns the new spec function.
  15896. * @example
  15897. *
  15898. * var objects = [
  15899. * { 'a': 1, 'b': 2, 'c': 3 },
  15900. * { 'a': 4, 'b': 5, 'c': 6 }
  15901. * ];
  15902. *
  15903. * _.filter(objects, _.matches({ 'a': 4, 'c': 6 }));
  15904. * // => [{ 'a': 4, 'b': 5, 'c': 6 }]
  15905. *
  15906. * // Checking for several possible values
  15907. * _.filter(objects, _.overSome([_.matches({ 'a': 1 }), _.matches({ 'a': 4 })]));
  15908. * // => [{ 'a': 1, 'b': 2, 'c': 3 }, { 'a': 4, 'b': 5, 'c': 6 }]
  15909. */
  15910. function matches(source) {
  15911. return baseMatches(baseClone(source, CLONE_DEEP_FLAG));
  15912. }
  15913. /**
  15914. * Creates a function that performs a partial deep comparison between the
  15915. * value at `path` of a given object to `srcValue`, returning `true` if the
  15916. * object value is equivalent, else `false`.
  15917. *
  15918. * **Note:** Partial comparisons will match empty array and empty object
  15919. * `srcValue` values against any array or object value, respectively. See
  15920. * `_.isEqual` for a list of supported value comparisons.
  15921. *
  15922. * **Note:** Multiple values can be checked by combining several matchers
  15923. * using `_.overSome`
  15924. *
  15925. * @static
  15926. * @memberOf _
  15927. * @since 3.2.0
  15928. * @category Util
  15929. * @param {Array|string} path The path of the property to get.
  15930. * @param {*} srcValue The value to match.
  15931. * @returns {Function} Returns the new spec function.
  15932. * @example
  15933. *
  15934. * var objects = [
  15935. * { 'a': 1, 'b': 2, 'c': 3 },
  15936. * { 'a': 4, 'b': 5, 'c': 6 }
  15937. * ];
  15938. *
  15939. * _.find(objects, _.matchesProperty('a', 4));
  15940. * // => { 'a': 4, 'b': 5, 'c': 6 }
  15941. *
  15942. * // Checking for several possible values
  15943. * _.filter(objects, _.overSome([_.matchesProperty('a', 1), _.matchesProperty('a', 4)]));
  15944. * // => [{ 'a': 1, 'b': 2, 'c': 3 }, { 'a': 4, 'b': 5, 'c': 6 }]
  15945. */
  15946. function matchesProperty(path, srcValue) {
  15947. return baseMatchesProperty(path, baseClone(srcValue, CLONE_DEEP_FLAG));
  15948. }
  15949. /**
  15950. * Creates a function that invokes the method at `path` of a given object.
  15951. * Any additional arguments are provided to the invoked method.
  15952. *
  15953. * @static
  15954. * @memberOf _
  15955. * @since 3.7.0
  15956. * @category Util
  15957. * @param {Array|string} path The path of the method to invoke.
  15958. * @param {...*} [args] The arguments to invoke the method with.
  15959. * @returns {Function} Returns the new invoker function.
  15960. * @example
  15961. *
  15962. * var objects = [
  15963. * { 'a': { 'b': _.constant(2) } },
  15964. * { 'a': { 'b': _.constant(1) } }
  15965. * ];
  15966. *
  15967. * _.map(objects, _.method('a.b'));
  15968. * // => [2, 1]
  15969. *
  15970. * _.map(objects, _.method(['a', 'b']));
  15971. * // => [2, 1]
  15972. */
  15973. var method = baseRest(function(path, args) {
  15974. return function(object) {
  15975. return baseInvoke(object, path, args);
  15976. };
  15977. });
  15978. /**
  15979. * The opposite of `_.method`; this method creates a function that invokes
  15980. * the method at a given path of `object`. Any additional arguments are
  15981. * provided to the invoked method.
  15982. *
  15983. * @static
  15984. * @memberOf _
  15985. * @since 3.7.0
  15986. * @category Util
  15987. * @param {Object} object The object to query.
  15988. * @param {...*} [args] The arguments to invoke the method with.
  15989. * @returns {Function} Returns the new invoker function.
  15990. * @example
  15991. *
  15992. * var array = _.times(3, _.constant),
  15993. * object = { 'a': array, 'b': array, 'c': array };
  15994. *
  15995. * _.map(['a[2]', 'c[0]'], _.methodOf(object));
  15996. * // => [2, 0]
  15997. *
  15998. * _.map([['a', '2'], ['c', '0']], _.methodOf(object));
  15999. * // => [2, 0]
  16000. */
  16001. var methodOf = baseRest(function(object, args) {
  16002. return function(path) {
  16003. return baseInvoke(object, path, args);
  16004. };
  16005. });
  16006. /**
  16007. * Adds all own enumerable string keyed function properties of a source
  16008. * object to the destination object. If `object` is a function, then methods
  16009. * are added to its prototype as well.
  16010. *
  16011. * **Note:** Use `_.runInContext` to create a pristine `lodash` function to
  16012. * avoid conflicts caused by modifying the original.
  16013. *
  16014. * @static
  16015. * @since 0.1.0
  16016. * @memberOf _
  16017. * @category Util
  16018. * @param {Function|Object} [object=lodash] The destination object.
  16019. * @param {Object} source The object of functions to add.
  16020. * @param {Object} [options={}] The options object.
  16021. * @param {boolean} [options.chain=true] Specify whether mixins are chainable.
  16022. * @returns {Function|Object} Returns `object`.
  16023. * @example
  16024. *
  16025. * function vowels(string) {
  16026. * return _.filter(string, function(v) {
  16027. * return /[aeiou]/i.test(v);
  16028. * });
  16029. * }
  16030. *
  16031. * _.mixin({ 'vowels': vowels });
  16032. * _.vowels('fred');
  16033. * // => ['e']
  16034. *
  16035. * _('fred').vowels().value();
  16036. * // => ['e']
  16037. *
  16038. * _.mixin({ 'vowels': vowels }, { 'chain': false });
  16039. * _('fred').vowels();
  16040. * // => ['e']
  16041. */
  16042. function mixin(object, source, options) {
  16043. var props = keys(source),
  16044. methodNames = baseFunctions(source, props);
  16045. if (options == null &&
  16046. !(isObject(source) && (methodNames.length || !props.length))) {
  16047. options = source;
  16048. source = object;
  16049. object = this;
  16050. methodNames = baseFunctions(source, keys(source));
  16051. }
  16052. var chain = !(isObject(options) && 'chain' in options) || !!options.chain,
  16053. isFunc = isFunction(object);
  16054. arrayEach(methodNames, function(methodName) {
  16055. var func = source[methodName];
  16056. object[methodName] = func;
  16057. if (isFunc) {
  16058. object.prototype[methodName] = function() {
  16059. var chainAll = this.__chain__;
  16060. if (chain || chainAll) {
  16061. var result = object(this.__wrapped__),
  16062. actions = result.__actions__ = copyArray(this.__actions__);
  16063. actions.push({ 'func': func, 'args': arguments, 'thisArg': object });
  16064. result.__chain__ = chainAll;
  16065. return result;
  16066. }
  16067. return func.apply(object, arrayPush([this.value()], arguments));
  16068. };
  16069. }
  16070. });
  16071. return object;
  16072. }
  16073. /**
  16074. * Reverts the `_` variable to its previous value and returns a reference to
  16075. * the `lodash` function.
  16076. *
  16077. * @static
  16078. * @since 0.1.0
  16079. * @memberOf _
  16080. * @category Util
  16081. * @returns {Function} Returns the `lodash` function.
  16082. * @example
  16083. *
  16084. * var lodash = _.noConflict();
  16085. */
  16086. function noConflict() {
  16087. if (root._ === this) {
  16088. root._ = oldDash;
  16089. }
  16090. return this;
  16091. }
  16092. /**
  16093. * This method returns `undefined`.
  16094. *
  16095. * @static
  16096. * @memberOf _
  16097. * @since 2.3.0
  16098. * @category Util
  16099. * @example
  16100. *
  16101. * _.times(2, _.noop);
  16102. * // => [undefined, undefined]
  16103. */
  16104. function noop() {
  16105. // No operation performed.
  16106. }
  16107. /**
  16108. * Creates a function that gets the argument at index `n`. If `n` is negative,
  16109. * the nth argument from the end is returned.
  16110. *
  16111. * @static
  16112. * @memberOf _
  16113. * @since 4.0.0
  16114. * @category Util
  16115. * @param {number} [n=0] The index of the argument to return.
  16116. * @returns {Function} Returns the new pass-thru function.
  16117. * @example
  16118. *
  16119. * var func = _.nthArg(1);
  16120. * func('a', 'b', 'c', 'd');
  16121. * // => 'b'
  16122. *
  16123. * var func = _.nthArg(-2);
  16124. * func('a', 'b', 'c', 'd');
  16125. * // => 'c'
  16126. */
  16127. function nthArg(n) {
  16128. n = toInteger(n);
  16129. return baseRest(function(args) {
  16130. return baseNth(args, n);
  16131. });
  16132. }
  16133. /**
  16134. * Creates a function that invokes `iteratees` with the arguments it receives
  16135. * and returns their results.
  16136. *
  16137. * @static
  16138. * @memberOf _
  16139. * @since 4.0.0
  16140. * @category Util
  16141. * @param {...(Function|Function[])} [iteratees=[_.identity]]
  16142. * The iteratees to invoke.
  16143. * @returns {Function} Returns the new function.
  16144. * @example
  16145. *
  16146. * var func = _.over([Math.max, Math.min]);
  16147. *
  16148. * func(1, 2, 3, 4);
  16149. * // => [4, 1]
  16150. */
  16151. var over = createOver(arrayMap);
  16152. /**
  16153. * Creates a function that checks if **all** of the `predicates` return
  16154. * truthy when invoked with the arguments it receives.
  16155. *
  16156. * Following shorthands are possible for providing predicates.
  16157. * Pass an `Object` and it will be used as an parameter for `_.matches` to create the predicate.
  16158. * Pass an `Array` of parameters for `_.matchesProperty` and the predicate will be created using them.
  16159. *
  16160. * @static
  16161. * @memberOf _
  16162. * @since 4.0.0
  16163. * @category Util
  16164. * @param {...(Function|Function[])} [predicates=[_.identity]]
  16165. * The predicates to check.
  16166. * @returns {Function} Returns the new function.
  16167. * @example
  16168. *
  16169. * var func = _.overEvery([Boolean, isFinite]);
  16170. *
  16171. * func('1');
  16172. * // => true
  16173. *
  16174. * func(null);
  16175. * // => false
  16176. *
  16177. * func(NaN);
  16178. * // => false
  16179. */
  16180. var overEvery = createOver(arrayEvery);
  16181. /**
  16182. * Creates a function that checks if **any** of the `predicates` return
  16183. * truthy when invoked with the arguments it receives.
  16184. *
  16185. * Following shorthands are possible for providing predicates.
  16186. * Pass an `Object` and it will be used as an parameter for `_.matches` to create the predicate.
  16187. * Pass an `Array` of parameters for `_.matchesProperty` and the predicate will be created using them.
  16188. *
  16189. * @static
  16190. * @memberOf _
  16191. * @since 4.0.0
  16192. * @category Util
  16193. * @param {...(Function|Function[])} [predicates=[_.identity]]
  16194. * The predicates to check.
  16195. * @returns {Function} Returns the new function.
  16196. * @example
  16197. *
  16198. * var func = _.overSome([Boolean, isFinite]);
  16199. *
  16200. * func('1');
  16201. * // => true
  16202. *
  16203. * func(null);
  16204. * // => true
  16205. *
  16206. * func(NaN);
  16207. * // => false
  16208. *
  16209. * var matchesFunc = _.overSome([{ 'a': 1 }, { 'a': 2 }])
  16210. * var matchesPropertyFunc = _.overSome([['a', 1], ['a', 2]])
  16211. */
  16212. var overSome = createOver(arraySome);
  16213. /**
  16214. * Creates a function that returns the value at `path` of a given object.
  16215. *
  16216. * @static
  16217. * @memberOf _
  16218. * @since 2.4.0
  16219. * @category Util
  16220. * @param {Array|string} path The path of the property to get.
  16221. * @returns {Function} Returns the new accessor function.
  16222. * @example
  16223. *
  16224. * var objects = [
  16225. * { 'a': { 'b': 2 } },
  16226. * { 'a': { 'b': 1 } }
  16227. * ];
  16228. *
  16229. * _.map(objects, _.property('a.b'));
  16230. * // => [2, 1]
  16231. *
  16232. * _.map(_.sortBy(objects, _.property(['a', 'b'])), 'a.b');
  16233. * // => [1, 2]
  16234. */
  16235. function property(path) {
  16236. return isKey(path) ? baseProperty(toKey(path)) : basePropertyDeep(path);
  16237. }
  16238. /**
  16239. * The opposite of `_.property`; this method creates a function that returns
  16240. * the value at a given path of `object`.
  16241. *
  16242. * @static
  16243. * @memberOf _
  16244. * @since 3.0.0
  16245. * @category Util
  16246. * @param {Object} object The object to query.
  16247. * @returns {Function} Returns the new accessor function.
  16248. * @example
  16249. *
  16250. * var array = [0, 1, 2],
  16251. * object = { 'a': array, 'b': array, 'c': array };
  16252. *
  16253. * _.map(['a[2]', 'c[0]'], _.propertyOf(object));
  16254. * // => [2, 0]
  16255. *
  16256. * _.map([['a', '2'], ['c', '0']], _.propertyOf(object));
  16257. * // => [2, 0]
  16258. */
  16259. function propertyOf(object) {
  16260. return function(path) {
  16261. return object == null ? undefined : baseGet(object, path);
  16262. };
  16263. }
  16264. /**
  16265. * Creates an array of numbers (positive and/or negative) progressing from
  16266. * `start` up to, but not including, `end`. A step of `-1` is used if a negative
  16267. * `start` is specified without an `end` or `step`. If `end` is not specified,
  16268. * it's set to `start` with `start` then set to `0`.
  16269. *
  16270. * **Note:** JavaScript follows the IEEE-754 standard for resolving
  16271. * floating-point values which can produce unexpected results.
  16272. *
  16273. * @static
  16274. * @since 0.1.0
  16275. * @memberOf _
  16276. * @category Util
  16277. * @param {number} [start=0] The start of the range.
  16278. * @param {number} end The end of the range.
  16279. * @param {number} [step=1] The value to increment or decrement by.
  16280. * @returns {Array} Returns the range of numbers.
  16281. * @see _.inRange, _.rangeRight
  16282. * @example
  16283. *
  16284. * _.range(4);
  16285. * // => [0, 1, 2, 3]
  16286. *
  16287. * _.range(-4);
  16288. * // => [0, -1, -2, -3]
  16289. *
  16290. * _.range(1, 5);
  16291. * // => [1, 2, 3, 4]
  16292. *
  16293. * _.range(0, 20, 5);
  16294. * // => [0, 5, 10, 15]
  16295. *
  16296. * _.range(0, -4, -1);
  16297. * // => [0, -1, -2, -3]
  16298. *
  16299. * _.range(1, 4, 0);
  16300. * // => [1, 1, 1]
  16301. *
  16302. * _.range(0);
  16303. * // => []
  16304. */
  16305. var range = createRange();
  16306. /**
  16307. * This method is like `_.range` except that it populates values in
  16308. * descending order.
  16309. *
  16310. * @static
  16311. * @memberOf _
  16312. * @since 4.0.0
  16313. * @category Util
  16314. * @param {number} [start=0] The start of the range.
  16315. * @param {number} end The end of the range.
  16316. * @param {number} [step=1] The value to increment or decrement by.
  16317. * @returns {Array} Returns the range of numbers.
  16318. * @see _.inRange, _.range
  16319. * @example
  16320. *
  16321. * _.rangeRight(4);
  16322. * // => [3, 2, 1, 0]
  16323. *
  16324. * _.rangeRight(-4);
  16325. * // => [-3, -2, -1, 0]
  16326. *
  16327. * _.rangeRight(1, 5);
  16328. * // => [4, 3, 2, 1]
  16329. *
  16330. * _.rangeRight(0, 20, 5);
  16331. * // => [15, 10, 5, 0]
  16332. *
  16333. * _.rangeRight(0, -4, -1);
  16334. * // => [-3, -2, -1, 0]
  16335. *
  16336. * _.rangeRight(1, 4, 0);
  16337. * // => [1, 1, 1]
  16338. *
  16339. * _.rangeRight(0);
  16340. * // => []
  16341. */
  16342. var rangeRight = createRange(true);
  16343. /**
  16344. * This method returns a new empty array.
  16345. *
  16346. * @static
  16347. * @memberOf _
  16348. * @since 4.13.0
  16349. * @category Util
  16350. * @returns {Array} Returns the new empty array.
  16351. * @example
  16352. *
  16353. * var arrays = _.times(2, _.stubArray);
  16354. *
  16355. * console.log(arrays);
  16356. * // => [[], []]
  16357. *
  16358. * console.log(arrays[0] === arrays[1]);
  16359. * // => false
  16360. */
  16361. function stubArray() {
  16362. return [];
  16363. }
  16364. /**
  16365. * This method returns `false`.
  16366. *
  16367. * @static
  16368. * @memberOf _
  16369. * @since 4.13.0
  16370. * @category Util
  16371. * @returns {boolean} Returns `false`.
  16372. * @example
  16373. *
  16374. * _.times(2, _.stubFalse);
  16375. * // => [false, false]
  16376. */
  16377. function stubFalse() {
  16378. return false;
  16379. }
  16380. /**
  16381. * This method returns a new empty object.
  16382. *
  16383. * @static
  16384. * @memberOf _
  16385. * @since 4.13.0
  16386. * @category Util
  16387. * @returns {Object} Returns the new empty object.
  16388. * @example
  16389. *
  16390. * var objects = _.times(2, _.stubObject);
  16391. *
  16392. * console.log(objects);
  16393. * // => [{}, {}]
  16394. *
  16395. * console.log(objects[0] === objects[1]);
  16396. * // => false
  16397. */
  16398. function stubObject() {
  16399. return {};
  16400. }
  16401. /**
  16402. * This method returns an empty string.
  16403. *
  16404. * @static
  16405. * @memberOf _
  16406. * @since 4.13.0
  16407. * @category Util
  16408. * @returns {string} Returns the empty string.
  16409. * @example
  16410. *
  16411. * _.times(2, _.stubString);
  16412. * // => ['', '']
  16413. */
  16414. function stubString() {
  16415. return '';
  16416. }
  16417. /**
  16418. * This method returns `true`.
  16419. *
  16420. * @static
  16421. * @memberOf _
  16422. * @since 4.13.0
  16423. * @category Util
  16424. * @returns {boolean} Returns `true`.
  16425. * @example
  16426. *
  16427. * _.times(2, _.stubTrue);
  16428. * // => [true, true]
  16429. */
  16430. function stubTrue() {
  16431. return true;
  16432. }
  16433. /**
  16434. * Invokes the iteratee `n` times, returning an array of the results of
  16435. * each invocation. The iteratee is invoked with one argument; (index).
  16436. *
  16437. * @static
  16438. * @since 0.1.0
  16439. * @memberOf _
  16440. * @category Util
  16441. * @param {number} n The number of times to invoke `iteratee`.
  16442. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  16443. * @returns {Array} Returns the array of results.
  16444. * @example
  16445. *
  16446. * _.times(3, String);
  16447. * // => ['0', '1', '2']
  16448. *
  16449. * _.times(4, _.constant(0));
  16450. * // => [0, 0, 0, 0]
  16451. */
  16452. function times(n, iteratee) {
  16453. n = toInteger(n);
  16454. if (n < 1 || n > MAX_SAFE_INTEGER) {
  16455. return [];
  16456. }
  16457. var index = MAX_ARRAY_LENGTH,
  16458. length = nativeMin(n, MAX_ARRAY_LENGTH);
  16459. iteratee = getIteratee(iteratee);
  16460. n -= MAX_ARRAY_LENGTH;
  16461. var result = baseTimes(length, iteratee);
  16462. while (++index < n) {
  16463. iteratee(index);
  16464. }
  16465. return result;
  16466. }
  16467. /**
  16468. * Converts `value` to a property path array.
  16469. *
  16470. * @static
  16471. * @memberOf _
  16472. * @since 4.0.0
  16473. * @category Util
  16474. * @param {*} value The value to convert.
  16475. * @returns {Array} Returns the new property path array.
  16476. * @example
  16477. *
  16478. * _.toPath('a.b.c');
  16479. * // => ['a', 'b', 'c']
  16480. *
  16481. * _.toPath('a[0].b.c');
  16482. * // => ['a', '0', 'b', 'c']
  16483. */
  16484. function toPath(value) {
  16485. if (isArray(value)) {
  16486. return arrayMap(value, toKey);
  16487. }
  16488. return isSymbol(value) ? [value] : copyArray(stringToPath(toString(value)));
  16489. }
  16490. /**
  16491. * Generates a unique ID. If `prefix` is given, the ID is appended to it.
  16492. *
  16493. * @static
  16494. * @since 0.1.0
  16495. * @memberOf _
  16496. * @category Util
  16497. * @param {string} [prefix=''] The value to prefix the ID with.
  16498. * @returns {string} Returns the unique ID.
  16499. * @example
  16500. *
  16501. * _.uniqueId('contact_');
  16502. * // => 'contact_104'
  16503. *
  16504. * _.uniqueId();
  16505. * // => '105'
  16506. */
  16507. function uniqueId(prefix) {
  16508. var id = ++idCounter;
  16509. return toString(prefix) + id;
  16510. }
  16511. /*------------------------------------------------------------------------*/
  16512. /**
  16513. * Adds two numbers.
  16514. *
  16515. * @static
  16516. * @memberOf _
  16517. * @since 3.4.0
  16518. * @category Math
  16519. * @param {number} augend The first number in an addition.
  16520. * @param {number} addend The second number in an addition.
  16521. * @returns {number} Returns the total.
  16522. * @example
  16523. *
  16524. * _.add(6, 4);
  16525. * // => 10
  16526. */
  16527. var add = createMathOperation(function(augend, addend) {
  16528. return augend + addend;
  16529. }, 0);
  16530. /**
  16531. * Computes `number` rounded up to `precision`.
  16532. *
  16533. * @static
  16534. * @memberOf _
  16535. * @since 3.10.0
  16536. * @category Math
  16537. * @param {number} number The number to round up.
  16538. * @param {number} [precision=0] The precision to round up to.
  16539. * @returns {number} Returns the rounded up number.
  16540. * @example
  16541. *
  16542. * _.ceil(4.006);
  16543. * // => 5
  16544. *
  16545. * _.ceil(6.004, 2);
  16546. * // => 6.01
  16547. *
  16548. * _.ceil(6040, -2);
  16549. * // => 6100
  16550. */
  16551. var ceil = createRound('ceil');
  16552. /**
  16553. * Divide two numbers.
  16554. *
  16555. * @static
  16556. * @memberOf _
  16557. * @since 4.7.0
  16558. * @category Math
  16559. * @param {number} dividend The first number in a division.
  16560. * @param {number} divisor The second number in a division.
  16561. * @returns {number} Returns the quotient.
  16562. * @example
  16563. *
  16564. * _.divide(6, 4);
  16565. * // => 1.5
  16566. */
  16567. var divide = createMathOperation(function(dividend, divisor) {
  16568. return dividend / divisor;
  16569. }, 1);
  16570. /**
  16571. * Computes `number` rounded down to `precision`.
  16572. *
  16573. * @static
  16574. * @memberOf _
  16575. * @since 3.10.0
  16576. * @category Math
  16577. * @param {number} number The number to round down.
  16578. * @param {number} [precision=0] The precision to round down to.
  16579. * @returns {number} Returns the rounded down number.
  16580. * @example
  16581. *
  16582. * _.floor(4.006);
  16583. * // => 4
  16584. *
  16585. * _.floor(0.046, 2);
  16586. * // => 0.04
  16587. *
  16588. * _.floor(4060, -2);
  16589. * // => 4000
  16590. */
  16591. var floor = createRound('floor');
  16592. /**
  16593. * Computes the maximum value of `array`. If `array` is empty or falsey,
  16594. * `undefined` is returned.
  16595. *
  16596. * @static
  16597. * @since 0.1.0
  16598. * @memberOf _
  16599. * @category Math
  16600. * @param {Array} array The array to iterate over.
  16601. * @returns {*} Returns the maximum value.
  16602. * @example
  16603. *
  16604. * _.max([4, 2, 8, 6]);
  16605. * // => 8
  16606. *
  16607. * _.max([]);
  16608. * // => undefined
  16609. */
  16610. function max(array) {
  16611. return (array && array.length)
  16612. ? baseExtremum(array, identity, baseGt)
  16613. : undefined;
  16614. }
  16615. /**
  16616. * This method is like `_.max` except that it accepts `iteratee` which is
  16617. * invoked for each element in `array` to generate the criterion by which
  16618. * the value is ranked. The iteratee is invoked with one argument: (value).
  16619. *
  16620. * @static
  16621. * @memberOf _
  16622. * @since 4.0.0
  16623. * @category Math
  16624. * @param {Array} array The array to iterate over.
  16625. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  16626. * @returns {*} Returns the maximum value.
  16627. * @example
  16628. *
  16629. * var objects = [{ 'n': 1 }, { 'n': 2 }];
  16630. *
  16631. * _.maxBy(objects, function(o) { return o.n; });
  16632. * // => { 'n': 2 }
  16633. *
  16634. * // The `_.property` iteratee shorthand.
  16635. * _.maxBy(objects, 'n');
  16636. * // => { 'n': 2 }
  16637. */
  16638. function maxBy(array, iteratee) {
  16639. return (array && array.length)
  16640. ? baseExtremum(array, getIteratee(iteratee, 2), baseGt)
  16641. : undefined;
  16642. }
  16643. /**
  16644. * Computes the mean of the values in `array`.
  16645. *
  16646. * @static
  16647. * @memberOf _
  16648. * @since 4.0.0
  16649. * @category Math
  16650. * @param {Array} array The array to iterate over.
  16651. * @returns {number} Returns the mean.
  16652. * @example
  16653. *
  16654. * _.mean([4, 2, 8, 6]);
  16655. * // => 5
  16656. */
  16657. function mean(array) {
  16658. return baseMean(array, identity);
  16659. }
  16660. /**
  16661. * This method is like `_.mean` except that it accepts `iteratee` which is
  16662. * invoked for each element in `array` to generate the value to be averaged.
  16663. * The iteratee is invoked with one argument: (value).
  16664. *
  16665. * @static
  16666. * @memberOf _
  16667. * @since 4.7.0
  16668. * @category Math
  16669. * @param {Array} array The array to iterate over.
  16670. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  16671. * @returns {number} Returns the mean.
  16672. * @example
  16673. *
  16674. * var objects = [{ 'n': 4 }, { 'n': 2 }, { 'n': 8 }, { 'n': 6 }];
  16675. *
  16676. * _.meanBy(objects, function(o) { return o.n; });
  16677. * // => 5
  16678. *
  16679. * // The `_.property` iteratee shorthand.
  16680. * _.meanBy(objects, 'n');
  16681. * // => 5
  16682. */
  16683. function meanBy(array, iteratee) {
  16684. return baseMean(array, getIteratee(iteratee, 2));
  16685. }
  16686. /**
  16687. * Computes the minimum value of `array`. If `array` is empty or falsey,
  16688. * `undefined` is returned.
  16689. *
  16690. * @static
  16691. * @since 0.1.0
  16692. * @memberOf _
  16693. * @category Math
  16694. * @param {Array} array The array to iterate over.
  16695. * @returns {*} Returns the minimum value.
  16696. * @example
  16697. *
  16698. * _.min([4, 2, 8, 6]);
  16699. * // => 2
  16700. *
  16701. * _.min([]);
  16702. * // => undefined
  16703. */
  16704. function min(array) {
  16705. return (array && array.length)
  16706. ? baseExtremum(array, identity, baseLt)
  16707. : undefined;
  16708. }
  16709. /**
  16710. * This method is like `_.min` except that it accepts `iteratee` which is
  16711. * invoked for each element in `array` to generate the criterion by which
  16712. * the value is ranked. The iteratee is invoked with one argument: (value).
  16713. *
  16714. * @static
  16715. * @memberOf _
  16716. * @since 4.0.0
  16717. * @category Math
  16718. * @param {Array} array The array to iterate over.
  16719. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  16720. * @returns {*} Returns the minimum value.
  16721. * @example
  16722. *
  16723. * var objects = [{ 'n': 1 }, { 'n': 2 }];
  16724. *
  16725. * _.minBy(objects, function(o) { return o.n; });
  16726. * // => { 'n': 1 }
  16727. *
  16728. * // The `_.property` iteratee shorthand.
  16729. * _.minBy(objects, 'n');
  16730. * // => { 'n': 1 }
  16731. */
  16732. function minBy(array, iteratee) {
  16733. return (array && array.length)
  16734. ? baseExtremum(array, getIteratee(iteratee, 2), baseLt)
  16735. : undefined;
  16736. }
  16737. /**
  16738. * Multiply two numbers.
  16739. *
  16740. * @static
  16741. * @memberOf _
  16742. * @since 4.7.0
  16743. * @category Math
  16744. * @param {number} multiplier The first number in a multiplication.
  16745. * @param {number} multiplicand The second number in a multiplication.
  16746. * @returns {number} Returns the product.
  16747. * @example
  16748. *
  16749. * _.multiply(6, 4);
  16750. * // => 24
  16751. */
  16752. var multiply = createMathOperation(function(multiplier, multiplicand) {
  16753. return multiplier * multiplicand;
  16754. }, 1);
  16755. /**
  16756. * Computes `number` rounded to `precision`.
  16757. *
  16758. * @static
  16759. * @memberOf _
  16760. * @since 3.10.0
  16761. * @category Math
  16762. * @param {number} number The number to round.
  16763. * @param {number} [precision=0] The precision to round to.
  16764. * @returns {number} Returns the rounded number.
  16765. * @example
  16766. *
  16767. * _.round(4.006);
  16768. * // => 4
  16769. *
  16770. * _.round(4.006, 2);
  16771. * // => 4.01
  16772. *
  16773. * _.round(4060, -2);
  16774. * // => 4100
  16775. */
  16776. var round = createRound('round');
  16777. /**
  16778. * Subtract two numbers.
  16779. *
  16780. * @static
  16781. * @memberOf _
  16782. * @since 4.0.0
  16783. * @category Math
  16784. * @param {number} minuend The first number in a subtraction.
  16785. * @param {number} subtrahend The second number in a subtraction.
  16786. * @returns {number} Returns the difference.
  16787. * @example
  16788. *
  16789. * _.subtract(6, 4);
  16790. * // => 2
  16791. */
  16792. var subtract = createMathOperation(function(minuend, subtrahend) {
  16793. return minuend - subtrahend;
  16794. }, 0);
  16795. /**
  16796. * Computes the sum of the values in `array`.
  16797. *
  16798. * @static
  16799. * @memberOf _
  16800. * @since 3.4.0
  16801. * @category Math
  16802. * @param {Array} array The array to iterate over.
  16803. * @returns {number} Returns the sum.
  16804. * @example
  16805. *
  16806. * _.sum([4, 2, 8, 6]);
  16807. * // => 20
  16808. */
  16809. function sum(array) {
  16810. return (array && array.length)
  16811. ? baseSum(array, identity)
  16812. : 0;
  16813. }
  16814. /**
  16815. * This method is like `_.sum` except that it accepts `iteratee` which is
  16816. * invoked for each element in `array` to generate the value to be summed.
  16817. * The iteratee is invoked with one argument: (value).
  16818. *
  16819. * @static
  16820. * @memberOf _
  16821. * @since 4.0.0
  16822. * @category Math
  16823. * @param {Array} array The array to iterate over.
  16824. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  16825. * @returns {number} Returns the sum.
  16826. * @example
  16827. *
  16828. * var objects = [{ 'n': 4 }, { 'n': 2 }, { 'n': 8 }, { 'n': 6 }];
  16829. *
  16830. * _.sumBy(objects, function(o) { return o.n; });
  16831. * // => 20
  16832. *
  16833. * // The `_.property` iteratee shorthand.
  16834. * _.sumBy(objects, 'n');
  16835. * // => 20
  16836. */
  16837. function sumBy(array, iteratee) {
  16838. return (array && array.length)
  16839. ? baseSum(array, getIteratee(iteratee, 2))
  16840. : 0;
  16841. }
  16842. /*------------------------------------------------------------------------*/
  16843. // Add methods that return wrapped values in chain sequences.
  16844. lodash.after = after;
  16845. lodash.ary = ary;
  16846. lodash.assign = assign;
  16847. lodash.assignIn = assignIn;
  16848. lodash.assignInWith = assignInWith;
  16849. lodash.assignWith = assignWith;
  16850. lodash.at = at;
  16851. lodash.before = before;
  16852. lodash.bind = bind;
  16853. lodash.bindAll = bindAll;
  16854. lodash.bindKey = bindKey;
  16855. lodash.castArray = castArray;
  16856. lodash.chain = chain;
  16857. lodash.chunk = chunk;
  16858. lodash.compact = compact;
  16859. lodash.concat = concat;
  16860. lodash.cond = cond;
  16861. lodash.conforms = conforms;
  16862. lodash.constant = constant;
  16863. lodash.countBy = countBy;
  16864. lodash.create = create;
  16865. lodash.curry = curry;
  16866. lodash.curryRight = curryRight;
  16867. lodash.debounce = debounce;
  16868. lodash.defaults = defaults;
  16869. lodash.defaultsDeep = defaultsDeep;
  16870. lodash.defer = defer;
  16871. lodash.delay = delay;
  16872. lodash.difference = difference;
  16873. lodash.differenceBy = differenceBy;
  16874. lodash.differenceWith = differenceWith;
  16875. lodash.drop = drop;
  16876. lodash.dropRight = dropRight;
  16877. lodash.dropRightWhile = dropRightWhile;
  16878. lodash.dropWhile = dropWhile;
  16879. lodash.fill = fill;
  16880. lodash.filter = filter;
  16881. lodash.flatMap = flatMap;
  16882. lodash.flatMapDeep = flatMapDeep;
  16883. lodash.flatMapDepth = flatMapDepth;
  16884. lodash.flatten = flatten;
  16885. lodash.flattenDeep = flattenDeep;
  16886. lodash.flattenDepth = flattenDepth;
  16887. lodash.flip = flip;
  16888. lodash.flow = flow;
  16889. lodash.flowRight = flowRight;
  16890. lodash.fromPairs = fromPairs;
  16891. lodash.functions = functions;
  16892. lodash.functionsIn = functionsIn;
  16893. lodash.groupBy = groupBy;
  16894. lodash.initial = initial;
  16895. lodash.intersection = intersection;
  16896. lodash.intersectionBy = intersectionBy;
  16897. lodash.intersectionWith = intersectionWith;
  16898. lodash.invert = invert;
  16899. lodash.invertBy = invertBy;
  16900. lodash.invokeMap = invokeMap;
  16901. lodash.iteratee = iteratee;
  16902. lodash.keyBy = keyBy;
  16903. lodash.keys = keys;
  16904. lodash.keysIn = keysIn;
  16905. lodash.map = map;
  16906. lodash.mapKeys = mapKeys;
  16907. lodash.mapValues = mapValues;
  16908. lodash.matches = matches;
  16909. lodash.matchesProperty = matchesProperty;
  16910. lodash.memoize = memoize;
  16911. lodash.merge = merge;
  16912. lodash.mergeWith = mergeWith;
  16913. lodash.method = method;
  16914. lodash.methodOf = methodOf;
  16915. lodash.mixin = mixin;
  16916. lodash.negate = negate;
  16917. lodash.nthArg = nthArg;
  16918. lodash.omit = omit;
  16919. lodash.omitBy = omitBy;
  16920. lodash.once = once;
  16921. lodash.orderBy = orderBy;
  16922. lodash.over = over;
  16923. lodash.overArgs = overArgs;
  16924. lodash.overEvery = overEvery;
  16925. lodash.overSome = overSome;
  16926. lodash.partial = partial;
  16927. lodash.partialRight = partialRight;
  16928. lodash.partition = partition;
  16929. lodash.pick = pick;
  16930. lodash.pickBy = pickBy;
  16931. lodash.property = property;
  16932. lodash.propertyOf = propertyOf;
  16933. lodash.pull = pull;
  16934. lodash.pullAll = pullAll;
  16935. lodash.pullAllBy = pullAllBy;
  16936. lodash.pullAllWith = pullAllWith;
  16937. lodash.pullAt = pullAt;
  16938. lodash.range = range;
  16939. lodash.rangeRight = rangeRight;
  16940. lodash.rearg = rearg;
  16941. lodash.reject = reject;
  16942. lodash.remove = remove;
  16943. lodash.rest = rest;
  16944. lodash.reverse = reverse;
  16945. lodash.sampleSize = sampleSize;
  16946. lodash.set = set;
  16947. lodash.setWith = setWith;
  16948. lodash.shuffle = shuffle;
  16949. lodash.slice = slice;
  16950. lodash.sortBy = sortBy;
  16951. lodash.sortedUniq = sortedUniq;
  16952. lodash.sortedUniqBy = sortedUniqBy;
  16953. lodash.split = split;
  16954. lodash.spread = spread;
  16955. lodash.tail = tail;
  16956. lodash.take = take;
  16957. lodash.takeRight = takeRight;
  16958. lodash.takeRightWhile = takeRightWhile;
  16959. lodash.takeWhile = takeWhile;
  16960. lodash.tap = tap;
  16961. lodash.throttle = throttle;
  16962. lodash.thru = thru;
  16963. lodash.toArray = toArray;
  16964. lodash.toPairs = toPairs;
  16965. lodash.toPairsIn = toPairsIn;
  16966. lodash.toPath = toPath;
  16967. lodash.toPlainObject = toPlainObject;
  16968. lodash.transform = transform;
  16969. lodash.unary = unary;
  16970. lodash.union = union;
  16971. lodash.unionBy = unionBy;
  16972. lodash.unionWith = unionWith;
  16973. lodash.uniq = uniq;
  16974. lodash.uniqBy = uniqBy;
  16975. lodash.uniqWith = uniqWith;
  16976. lodash.unset = unset;
  16977. lodash.unzip = unzip;
  16978. lodash.unzipWith = unzipWith;
  16979. lodash.update = update;
  16980. lodash.updateWith = updateWith;
  16981. lodash.values = values;
  16982. lodash.valuesIn = valuesIn;
  16983. lodash.without = without;
  16984. lodash.words = words;
  16985. lodash.wrap = wrap;
  16986. lodash.xor = xor;
  16987. lodash.xorBy = xorBy;
  16988. lodash.xorWith = xorWith;
  16989. lodash.zip = zip;
  16990. lodash.zipObject = zipObject;
  16991. lodash.zipObjectDeep = zipObjectDeep;
  16992. lodash.zipWith = zipWith;
  16993. // Add aliases.
  16994. lodash.entries = toPairs;
  16995. lodash.entriesIn = toPairsIn;
  16996. lodash.extend = assignIn;
  16997. lodash.extendWith = assignInWith;
  16998. // Add methods to `lodash.prototype`.
  16999. mixin(lodash, lodash);
  17000. /*------------------------------------------------------------------------*/
  17001. // Add methods that return unwrapped values in chain sequences.
  17002. lodash.add = add;
  17003. lodash.attempt = attempt;
  17004. lodash.camelCase = camelCase;
  17005. lodash.capitalize = capitalize;
  17006. lodash.ceil = ceil;
  17007. lodash.clamp = clamp;
  17008. lodash.clone = clone;
  17009. lodash.cloneDeep = cloneDeep;
  17010. lodash.cloneDeepWith = cloneDeepWith;
  17011. lodash.cloneWith = cloneWith;
  17012. lodash.conformsTo = conformsTo;
  17013. lodash.deburr = deburr;
  17014. lodash.defaultTo = defaultTo;
  17015. lodash.divide = divide;
  17016. lodash.endsWith = endsWith;
  17017. lodash.eq = eq;
  17018. lodash.escape = escape;
  17019. lodash.escapeRegExp = escapeRegExp;
  17020. lodash.every = every;
  17021. lodash.find = find;
  17022. lodash.findIndex = findIndex;
  17023. lodash.findKey = findKey;
  17024. lodash.findLast = findLast;
  17025. lodash.findLastIndex = findLastIndex;
  17026. lodash.findLastKey = findLastKey;
  17027. lodash.floor = floor;
  17028. lodash.forEach = forEach;
  17029. lodash.forEachRight = forEachRight;
  17030. lodash.forIn = forIn;
  17031. lodash.forInRight = forInRight;
  17032. lodash.forOwn = forOwn;
  17033. lodash.forOwnRight = forOwnRight;
  17034. lodash.get = get;
  17035. lodash.gt = gt;
  17036. lodash.gte = gte;
  17037. lodash.has = has;
  17038. lodash.hasIn = hasIn;
  17039. lodash.head = head;
  17040. lodash.identity = identity;
  17041. lodash.includes = includes;
  17042. lodash.indexOf = indexOf;
  17043. lodash.inRange = inRange;
  17044. lodash.invoke = invoke;
  17045. lodash.isArguments = isArguments;
  17046. lodash.isArray = isArray;
  17047. lodash.isArrayBuffer = isArrayBuffer;
  17048. lodash.isArrayLike = isArrayLike;
  17049. lodash.isArrayLikeObject = isArrayLikeObject;
  17050. lodash.isBoolean = isBoolean;
  17051. lodash.isBuffer = isBuffer;
  17052. lodash.isDate = isDate;
  17053. lodash.isElement = isElement;
  17054. lodash.isEmpty = isEmpty;
  17055. lodash.isEqual = isEqual;
  17056. lodash.isEqualWith = isEqualWith;
  17057. lodash.isError = isError;
  17058. lodash.isFinite = isFinite;
  17059. lodash.isFunction = isFunction;
  17060. lodash.isInteger = isInteger;
  17061. lodash.isLength = isLength;
  17062. lodash.isMap = isMap;
  17063. lodash.isMatch = isMatch;
  17064. lodash.isMatchWith = isMatchWith;
  17065. lodash.isNaN = isNaN;
  17066. lodash.isNative = isNative;
  17067. lodash.isNil = isNil;
  17068. lodash.isNull = isNull;
  17069. lodash.isNumber = isNumber;
  17070. lodash.isObject = isObject;
  17071. lodash.isObjectLike = isObjectLike;
  17072. lodash.isPlainObject = isPlainObject;
  17073. lodash.isRegExp = isRegExp;
  17074. lodash.isSafeInteger = isSafeInteger;
  17075. lodash.isSet = isSet;
  17076. lodash.isString = isString;
  17077. lodash.isSymbol = isSymbol;
  17078. lodash.isTypedArray = isTypedArray;
  17079. lodash.isUndefined = isUndefined;
  17080. lodash.isWeakMap = isWeakMap;
  17081. lodash.isWeakSet = isWeakSet;
  17082. lodash.join = join;
  17083. lodash.kebabCase = kebabCase;
  17084. lodash.last = last;
  17085. lodash.lastIndexOf = lastIndexOf;
  17086. lodash.lowerCase = lowerCase;
  17087. lodash.lowerFirst = lowerFirst;
  17088. lodash.lt = lt;
  17089. lodash.lte = lte;
  17090. lodash.max = max;
  17091. lodash.maxBy = maxBy;
  17092. lodash.mean = mean;
  17093. lodash.meanBy = meanBy;
  17094. lodash.min = min;
  17095. lodash.minBy = minBy;
  17096. lodash.stubArray = stubArray;
  17097. lodash.stubFalse = stubFalse;
  17098. lodash.stubObject = stubObject;
  17099. lodash.stubString = stubString;
  17100. lodash.stubTrue = stubTrue;
  17101. lodash.multiply = multiply;
  17102. lodash.nth = nth;
  17103. lodash.noConflict = noConflict;
  17104. lodash.noop = noop;
  17105. lodash.now = now;
  17106. lodash.pad = pad;
  17107. lodash.padEnd = padEnd;
  17108. lodash.padStart = padStart;
  17109. lodash.parseInt = parseInt;
  17110. lodash.random = random;
  17111. lodash.reduce = reduce;
  17112. lodash.reduceRight = reduceRight;
  17113. lodash.repeat = repeat;
  17114. lodash.replace = replace;
  17115. lodash.result = result;
  17116. lodash.round = round;
  17117. lodash.runInContext = runInContext;
  17118. lodash.sample = sample;
  17119. lodash.size = size;
  17120. lodash.snakeCase = snakeCase;
  17121. lodash.some = some;
  17122. lodash.sortedIndex = sortedIndex;
  17123. lodash.sortedIndexBy = sortedIndexBy;
  17124. lodash.sortedIndexOf = sortedIndexOf;
  17125. lodash.sortedLastIndex = sortedLastIndex;
  17126. lodash.sortedLastIndexBy = sortedLastIndexBy;
  17127. lodash.sortedLastIndexOf = sortedLastIndexOf;
  17128. lodash.startCase = startCase;
  17129. lodash.startsWith = startsWith;
  17130. lodash.subtract = subtract;
  17131. lodash.sum = sum;
  17132. lodash.sumBy = sumBy;
  17133. lodash.template = template;
  17134. lodash.times = times;
  17135. lodash.toFinite = toFinite;
  17136. lodash.toInteger = toInteger;
  17137. lodash.toLength = toLength;
  17138. lodash.toLower = toLower;
  17139. lodash.toNumber = toNumber;
  17140. lodash.toSafeInteger = toSafeInteger;
  17141. lodash.toString = toString;
  17142. lodash.toUpper = toUpper;
  17143. lodash.trim = trim;
  17144. lodash.trimEnd = trimEnd;
  17145. lodash.trimStart = trimStart;
  17146. lodash.truncate = truncate;
  17147. lodash.unescape = unescape;
  17148. lodash.uniqueId = uniqueId;
  17149. lodash.upperCase = upperCase;
  17150. lodash.upperFirst = upperFirst;
  17151. // Add aliases.
  17152. lodash.each = forEach;
  17153. lodash.eachRight = forEachRight;
  17154. lodash.first = head;
  17155. mixin(lodash, (function() {
  17156. var source = {};
  17157. baseForOwn(lodash, function(func, methodName) {
  17158. if (!hasOwnProperty.call(lodash.prototype, methodName)) {
  17159. source[methodName] = func;
  17160. }
  17161. });
  17162. return source;
  17163. }()), { 'chain': false });
  17164. /*------------------------------------------------------------------------*/
  17165. /**
  17166. * The semantic version number.
  17167. *
  17168. * @static
  17169. * @memberOf _
  17170. * @type {string}
  17171. */
  17172. lodash.VERSION = VERSION;
  17173. // Assign default placeholders.
  17174. arrayEach(['bind', 'bindKey', 'curry', 'curryRight', 'partial', 'partialRight'], function(methodName) {
  17175. lodash[methodName].placeholder = lodash;
  17176. });
  17177. // Add `LazyWrapper` methods for `_.drop` and `_.take` variants.
  17178. arrayEach(['drop', 'take'], function(methodName, index) {
  17179. LazyWrapper.prototype[methodName] = function(n) {
  17180. n = n === undefined ? 1 : nativeMax(toInteger(n), 0);
  17181. var result = (this.__filtered__ && !index)
  17182. ? new LazyWrapper(this)
  17183. : this.clone();
  17184. if (result.__filtered__) {
  17185. result.__takeCount__ = nativeMin(n, result.__takeCount__);
  17186. } else {
  17187. result.__views__.push({
  17188. 'size': nativeMin(n, MAX_ARRAY_LENGTH),
  17189. 'type': methodName + (result.__dir__ < 0 ? 'Right' : '')
  17190. });
  17191. }
  17192. return result;
  17193. };
  17194. LazyWrapper.prototype[methodName + 'Right'] = function(n) {
  17195. return this.reverse()[methodName](n).reverse();
  17196. };
  17197. });
  17198. // Add `LazyWrapper` methods that accept an `iteratee` value.
  17199. arrayEach(['filter', 'map', 'takeWhile'], function(methodName, index) {
  17200. var type = index + 1,
  17201. isFilter = type == LAZY_FILTER_FLAG || type == LAZY_WHILE_FLAG;
  17202. LazyWrapper.prototype[methodName] = function(iteratee) {
  17203. var result = this.clone();
  17204. result.__iteratees__.push({
  17205. 'iteratee': getIteratee(iteratee, 3),
  17206. 'type': type
  17207. });
  17208. result.__filtered__ = result.__filtered__ || isFilter;
  17209. return result;
  17210. };
  17211. });
  17212. // Add `LazyWrapper` methods for `_.head` and `_.last`.
  17213. arrayEach(['head', 'last'], function(methodName, index) {
  17214. var takeName = 'take' + (index ? 'Right' : '');
  17215. LazyWrapper.prototype[methodName] = function() {
  17216. return this[takeName](1).value()[0];
  17217. };
  17218. });
  17219. // Add `LazyWrapper` methods for `_.initial` and `_.tail`.
  17220. arrayEach(['initial', 'tail'], function(methodName, index) {
  17221. var dropName = 'drop' + (index ? '' : 'Right');
  17222. LazyWrapper.prototype[methodName] = function() {
  17223. return this.__filtered__ ? new LazyWrapper(this) : this[dropName](1);
  17224. };
  17225. });
  17226. LazyWrapper.prototype.compact = function() {
  17227. return this.filter(identity);
  17228. };
  17229. LazyWrapper.prototype.find = function(predicate) {
  17230. return this.filter(predicate).head();
  17231. };
  17232. LazyWrapper.prototype.findLast = function(predicate) {
  17233. return this.reverse().find(predicate);
  17234. };
  17235. LazyWrapper.prototype.invokeMap = baseRest(function(path, args) {
  17236. if (typeof path == 'function') {
  17237. return new LazyWrapper(this);
  17238. }
  17239. return this.map(function(value) {
  17240. return baseInvoke(value, path, args);
  17241. });
  17242. });
  17243. LazyWrapper.prototype.reject = function(predicate) {
  17244. return this.filter(negate(getIteratee(predicate)));
  17245. };
  17246. LazyWrapper.prototype.slice = function(start, end) {
  17247. start = toInteger(start);
  17248. var result = this;
  17249. if (result.__filtered__ && (start > 0 || end < 0)) {
  17250. return new LazyWrapper(result);
  17251. }
  17252. if (start < 0) {
  17253. result = result.takeRight(-start);
  17254. } else if (start) {
  17255. result = result.drop(start);
  17256. }
  17257. if (end !== undefined) {
  17258. end = toInteger(end);
  17259. result = end < 0 ? result.dropRight(-end) : result.take(end - start);
  17260. }
  17261. return result;
  17262. };
  17263. LazyWrapper.prototype.takeRightWhile = function(predicate) {
  17264. return this.reverse().takeWhile(predicate).reverse();
  17265. };
  17266. LazyWrapper.prototype.toArray = function() {
  17267. return this.take(MAX_ARRAY_LENGTH);
  17268. };
  17269. // Add `LazyWrapper` methods to `lodash.prototype`.
  17270. baseForOwn(LazyWrapper.prototype, function(func, methodName) {
  17271. var checkIteratee = /^(?:filter|find|map|reject)|While$/.test(methodName),
  17272. isTaker = /^(?:head|last)$/.test(methodName),
  17273. lodashFunc = lodash[isTaker ? ('take' + (methodName == 'last' ? 'Right' : '')) : methodName],
  17274. retUnwrapped = isTaker || /^find/.test(methodName);
  17275. if (!lodashFunc) {
  17276. return;
  17277. }
  17278. lodash.prototype[methodName] = function() {
  17279. var value = this.__wrapped__,
  17280. args = isTaker ? [1] : arguments,
  17281. isLazy = value instanceof LazyWrapper,
  17282. iteratee = args[0],
  17283. useLazy = isLazy || isArray(value);
  17284. var interceptor = function(value) {
  17285. var result = lodashFunc.apply(lodash, arrayPush([value], args));
  17286. return (isTaker && chainAll) ? result[0] : result;
  17287. };
  17288. if (useLazy && checkIteratee && typeof iteratee == 'function' && iteratee.length != 1) {
  17289. // Avoid lazy use if the iteratee has a "length" value other than `1`.
  17290. isLazy = useLazy = false;
  17291. }
  17292. var chainAll = this.__chain__,
  17293. isHybrid = !!this.__actions__.length,
  17294. isUnwrapped = retUnwrapped && !chainAll,
  17295. onlyLazy = isLazy && !isHybrid;
  17296. if (!retUnwrapped && useLazy) {
  17297. value = onlyLazy ? value : new LazyWrapper(this);
  17298. var result = func.apply(value, args);
  17299. result.__actions__.push({ 'func': thru, 'args': [interceptor], 'thisArg': undefined });
  17300. return new LodashWrapper(result, chainAll);
  17301. }
  17302. if (isUnwrapped && onlyLazy) {
  17303. return func.apply(this, args);
  17304. }
  17305. result = this.thru(interceptor);
  17306. return isUnwrapped ? (isTaker ? result.value()[0] : result.value()) : result;
  17307. };
  17308. });
  17309. // Add `Array` methods to `lodash.prototype`.
  17310. arrayEach(['pop', 'push', 'shift', 'sort', 'splice', 'unshift'], function(methodName) {
  17311. var func = arrayProto[methodName],
  17312. chainName = /^(?:push|sort|unshift)$/.test(methodName) ? 'tap' : 'thru',
  17313. retUnwrapped = /^(?:pop|shift)$/.test(methodName);
  17314. lodash.prototype[methodName] = function() {
  17315. var args = arguments;
  17316. if (retUnwrapped && !this.__chain__) {
  17317. var value = this.value();
  17318. return func.apply(isArray(value) ? value : [], args);
  17319. }
  17320. return this[chainName](function(value) {
  17321. return func.apply(isArray(value) ? value : [], args);
  17322. });
  17323. };
  17324. });
  17325. // Map minified method names to their real names.
  17326. baseForOwn(LazyWrapper.prototype, function(func, methodName) {
  17327. var lodashFunc = lodash[methodName];
  17328. if (lodashFunc) {
  17329. var key = lodashFunc.name + '';
  17330. if (!hasOwnProperty.call(realNames, key)) {
  17331. realNames[key] = [];
  17332. }
  17333. realNames[key].push({ 'name': methodName, 'func': lodashFunc });
  17334. }
  17335. });
  17336. realNames[createHybrid(undefined, WRAP_BIND_KEY_FLAG).name] = [{
  17337. 'name': 'wrapper',
  17338. 'func': undefined
  17339. }];
  17340. // Add methods to `LazyWrapper`.
  17341. LazyWrapper.prototype.clone = lazyClone;
  17342. LazyWrapper.prototype.reverse = lazyReverse;
  17343. LazyWrapper.prototype.value = lazyValue;
  17344. // Add chain sequence methods to the `lodash` wrapper.
  17345. lodash.prototype.at = wrapperAt;
  17346. lodash.prototype.chain = wrapperChain;
  17347. lodash.prototype.commit = wrapperCommit;
  17348. lodash.prototype.next = wrapperNext;
  17349. lodash.prototype.plant = wrapperPlant;
  17350. lodash.prototype.reverse = wrapperReverse;
  17351. lodash.prototype.toJSON = lodash.prototype.valueOf = lodash.prototype.value = wrapperValue;
  17352. // Add lazy aliases.
  17353. lodash.prototype.first = lodash.prototype.head;
  17354. if (symIterator) {
  17355. lodash.prototype[symIterator] = wrapperToIterator;
  17356. }
  17357. return lodash;
  17358. });
  17359. /*--------------------------------------------------------------------------*/
  17360. // Export lodash.
  17361. var _ = runInContext();
  17362. // Some AMD build optimizers, like r.js, check for condition patterns like:
  17363. if (true) {
  17364. // Expose Lodash on the global object to prevent errors when Lodash is
  17365. // loaded by a script tag in the presence of an AMD loader.
  17366. // See http://requirejs.org/docs/errors.html#mismatch for more details.
  17367. // Use `_.noConflict` to remove Lodash from the global object.
  17368. root._ = _;
  17369. // Define as an anonymous module so, through path mapping, it can be
  17370. // referenced as the "underscore" module.
  17371. !(__WEBPACK_AMD_DEFINE_RESULT__ = (function() {
  17372. return _;
  17373. }).call(exports, __webpack_require__, exports, module),
  17374. __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
  17375. }
  17376. // Check for `exports` after `define` in case a build optimizer adds it.
  17377. else {}
  17378. }.call(this));
  17379. /***/ }),
  17380. /***/ "./node_modules/style-loader/dist/cjs.js!./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/layouts/Dashboard/Components/Sidebar.vue?vue&type=style&index=0&id=5b49aa22&lang=scss&scoped=true":
  17381. /*!*******************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  17382. !*** ./node_modules/style-loader/dist/cjs.js!./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/layouts/Dashboard/Components/Sidebar.vue?vue&type=style&index=0&id=5b49aa22&lang=scss&scoped=true ***!
  17383. \*******************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  17384. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17385. "use strict";
  17386. __webpack_require__.r(__webpack_exports__);
  17387. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17388. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17389. /* harmony export */ });
  17390. /* harmony import */ var _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");
  17391. /* 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__);
  17392. /* harmony import */ var _node_modules_css_loader_dist_cjs_js_clonedRuleSet_11_use_1_node_modules_vue_loader_dist_stylePostLoader_js_node_modules_postcss_loader_dist_cjs_js_clonedRuleSet_11_use_2_node_modules_sass_loader_dist_cjs_js_clonedRuleSet_11_use_3_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_Sidebar_vue_vue_type_style_index_0_id_5b49aa22_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! !!../../../../../node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!../../../../../node_modules/vue-loader/dist/stylePostLoader.js!../../../../../node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!../../../../../node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!../../../../../node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./Sidebar.vue?vue&type=style&index=0&id=5b49aa22&lang=scss&scoped=true */ "./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/layouts/Dashboard/Components/Sidebar.vue?vue&type=style&index=0&id=5b49aa22&lang=scss&scoped=true");
  17393. var options = {};
  17394. options.insert = "head";
  17395. options.singleton = false;
  17396. var update = _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default()(_node_modules_css_loader_dist_cjs_js_clonedRuleSet_11_use_1_node_modules_vue_loader_dist_stylePostLoader_js_node_modules_postcss_loader_dist_cjs_js_clonedRuleSet_11_use_2_node_modules_sass_loader_dist_cjs_js_clonedRuleSet_11_use_3_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_Sidebar_vue_vue_type_style_index_0_id_5b49aa22_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_1__["default"], options);
  17397. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (_node_modules_css_loader_dist_cjs_js_clonedRuleSet_11_use_1_node_modules_vue_loader_dist_stylePostLoader_js_node_modules_postcss_loader_dist_cjs_js_clonedRuleSet_11_use_2_node_modules_sass_loader_dist_cjs_js_clonedRuleSet_11_use_3_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_Sidebar_vue_vue_type_style_index_0_id_5b49aa22_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_1__["default"].locals || {});
  17398. /***/ }),
  17399. /***/ "./node_modules/style-loader/dist/cjs.js!./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/layouts/Dashboard/Components/SubSidebar.vue?vue&type=style&index=0&id=b1b23eb4&lang=scss&scoped=true":
  17400. /*!**********************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  17401. !*** ./node_modules/style-loader/dist/cjs.js!./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/layouts/Dashboard/Components/SubSidebar.vue?vue&type=style&index=0&id=b1b23eb4&lang=scss&scoped=true ***!
  17402. \**********************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  17403. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17404. "use strict";
  17405. __webpack_require__.r(__webpack_exports__);
  17406. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17407. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17408. /* harmony export */ });
  17409. /* 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");
  17410. /* 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__);
  17411. /* harmony import */ var _node_modules_css_loader_dist_cjs_js_clonedRuleSet_11_use_1_node_modules_vue_loader_dist_stylePostLoader_js_node_modules_postcss_loader_dist_cjs_js_clonedRuleSet_11_use_2_node_modules_sass_loader_dist_cjs_js_clonedRuleSet_11_use_3_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_SubSidebar_vue_vue_type_style_index_0_id_b1b23eb4_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! !!../../../../../node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!../../../../../node_modules/vue-loader/dist/stylePostLoader.js!../../../../../node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!../../../../../node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!../../../../../node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./SubSidebar.vue?vue&type=style&index=0&id=b1b23eb4&lang=scss&scoped=true */ "./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/layouts/Dashboard/Components/SubSidebar.vue?vue&type=style&index=0&id=b1b23eb4&lang=scss&scoped=true");
  17412. var options = {};
  17413. options.insert = "head";
  17414. options.singleton = false;
  17415. var update = _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default()(_node_modules_css_loader_dist_cjs_js_clonedRuleSet_11_use_1_node_modules_vue_loader_dist_stylePostLoader_js_node_modules_postcss_loader_dist_cjs_js_clonedRuleSet_11_use_2_node_modules_sass_loader_dist_cjs_js_clonedRuleSet_11_use_3_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_SubSidebar_vue_vue_type_style_index_0_id_b1b23eb4_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_1__["default"], options);
  17416. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (_node_modules_css_loader_dist_cjs_js_clonedRuleSet_11_use_1_node_modules_vue_loader_dist_stylePostLoader_js_node_modules_postcss_loader_dist_cjs_js_clonedRuleSet_11_use_2_node_modules_sass_loader_dist_cjs_js_clonedRuleSet_11_use_3_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_SubSidebar_vue_vue_type_style_index_0_id_b1b23eb4_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_1__["default"].locals || {});
  17417. /***/ }),
  17418. /***/ "./node_modules/style-loader/dist/cjs.js!./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/layouts/Dashboard/Components/TopBar.vue?vue&type=style&index=0&id=0b7edbb0&lang=scss&scoped=true":
  17419. /*!******************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  17420. !*** ./node_modules/style-loader/dist/cjs.js!./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/layouts/Dashboard/Components/TopBar.vue?vue&type=style&index=0&id=0b7edbb0&lang=scss&scoped=true ***!
  17421. \******************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  17422. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17423. "use strict";
  17424. __webpack_require__.r(__webpack_exports__);
  17425. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17426. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17427. /* harmony export */ });
  17428. /* 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");
  17429. /* 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__);
  17430. /* harmony import */ var _node_modules_css_loader_dist_cjs_js_clonedRuleSet_11_use_1_node_modules_vue_loader_dist_stylePostLoader_js_node_modules_postcss_loader_dist_cjs_js_clonedRuleSet_11_use_2_node_modules_sass_loader_dist_cjs_js_clonedRuleSet_11_use_3_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_TopBar_vue_vue_type_style_index_0_id_0b7edbb0_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! !!../../../../../node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!../../../../../node_modules/vue-loader/dist/stylePostLoader.js!../../../../../node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!../../../../../node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!../../../../../node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./TopBar.vue?vue&type=style&index=0&id=0b7edbb0&lang=scss&scoped=true */ "./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/layouts/Dashboard/Components/TopBar.vue?vue&type=style&index=0&id=0b7edbb0&lang=scss&scoped=true");
  17431. var options = {};
  17432. options.insert = "head";
  17433. options.singleton = false;
  17434. var update = _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default()(_node_modules_css_loader_dist_cjs_js_clonedRuleSet_11_use_1_node_modules_vue_loader_dist_stylePostLoader_js_node_modules_postcss_loader_dist_cjs_js_clonedRuleSet_11_use_2_node_modules_sass_loader_dist_cjs_js_clonedRuleSet_11_use_3_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_TopBar_vue_vue_type_style_index_0_id_0b7edbb0_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_1__["default"], options);
  17435. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (_node_modules_css_loader_dist_cjs_js_clonedRuleSet_11_use_1_node_modules_vue_loader_dist_stylePostLoader_js_node_modules_postcss_loader_dist_cjs_js_clonedRuleSet_11_use_2_node_modules_sass_loader_dist_cjs_js_clonedRuleSet_11_use_3_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_TopBar_vue_vue_type_style_index_0_id_0b7edbb0_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_1__["default"].locals || {});
  17436. /***/ }),
  17437. /***/ "./node_modules/style-loader/dist/cjs.js!./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/layouts/Dashboard/DashboardLayout.vue?vue&type=style&index=0&id=1d279fe2&lang=scss&scoped=true":
  17438. /*!****************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  17439. !*** ./node_modules/style-loader/dist/cjs.js!./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/layouts/Dashboard/DashboardLayout.vue?vue&type=style&index=0&id=1d279fe2&lang=scss&scoped=true ***!
  17440. \****************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  17441. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17442. "use strict";
  17443. __webpack_require__.r(__webpack_exports__);
  17444. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17445. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17446. /* harmony export */ });
  17447. /* 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");
  17448. /* 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__);
  17449. /* harmony import */ var _node_modules_css_loader_dist_cjs_js_clonedRuleSet_11_use_1_node_modules_vue_loader_dist_stylePostLoader_js_node_modules_postcss_loader_dist_cjs_js_clonedRuleSet_11_use_2_node_modules_sass_loader_dist_cjs_js_clonedRuleSet_11_use_3_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_DashboardLayout_vue_vue_type_style_index_0_id_1d279fe2_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! !!../../../../node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!../../../../node_modules/vue-loader/dist/stylePostLoader.js!../../../../node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!../../../../node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!../../../../node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./DashboardLayout.vue?vue&type=style&index=0&id=1d279fe2&lang=scss&scoped=true */ "./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/layouts/Dashboard/DashboardLayout.vue?vue&type=style&index=0&id=1d279fe2&lang=scss&scoped=true");
  17450. var options = {};
  17451. options.insert = "head";
  17452. options.singleton = false;
  17453. var update = _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default()(_node_modules_css_loader_dist_cjs_js_clonedRuleSet_11_use_1_node_modules_vue_loader_dist_stylePostLoader_js_node_modules_postcss_loader_dist_cjs_js_clonedRuleSet_11_use_2_node_modules_sass_loader_dist_cjs_js_clonedRuleSet_11_use_3_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_DashboardLayout_vue_vue_type_style_index_0_id_1d279fe2_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_1__["default"], options);
  17454. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (_node_modules_css_loader_dist_cjs_js_clonedRuleSet_11_use_1_node_modules_vue_loader_dist_stylePostLoader_js_node_modules_postcss_loader_dist_cjs_js_clonedRuleSet_11_use_2_node_modules_sass_loader_dist_cjs_js_clonedRuleSet_11_use_3_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_DashboardLayout_vue_vue_type_style_index_0_id_1d279fe2_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_1__["default"].locals || {});
  17455. /***/ }),
  17456. /***/ "./node_modules/vue-loader/dist/exportHelper.js":
  17457. /*!******************************************************!*\
  17458. !*** ./node_modules/vue-loader/dist/exportHelper.js ***!
  17459. \******************************************************/
  17460. /***/ ((__unused_webpack_module, exports) => {
  17461. "use strict";
  17462. Object.defineProperty(exports, "__esModule", ({ value: true }));
  17463. // runtime helper for setting properties on components
  17464. // in a tree-shakable way
  17465. exports["default"] = (sfc, props) => {
  17466. const target = sfc.__vccOpts || sfc;
  17467. for (const [key, val] of props) {
  17468. target[key] = val;
  17469. }
  17470. return target;
  17471. };
  17472. /***/ }),
  17473. /***/ "./resources/js/components/AppButtonLink.vue":
  17474. /*!***************************************************!*\
  17475. !*** ./resources/js/components/AppButtonLink.vue ***!
  17476. \***************************************************/
  17477. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17478. "use strict";
  17479. __webpack_require__.r(__webpack_exports__);
  17480. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17481. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17482. /* harmony export */ });
  17483. /* 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");
  17484. /* 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");
  17485. /* 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");
  17486. ;
  17487. 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"]])
  17488. /* hot reload */
  17489. if (false) {}
  17490. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__);
  17491. /***/ }),
  17492. /***/ "./resources/js/components/AppMessage.vue":
  17493. /*!************************************************!*\
  17494. !*** ./resources/js/components/AppMessage.vue ***!
  17495. \************************************************/
  17496. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17497. "use strict";
  17498. __webpack_require__.r(__webpack_exports__);
  17499. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17500. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17501. /* harmony export */ });
  17502. /* 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");
  17503. /* 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");
  17504. /* 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");
  17505. ;
  17506. 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"]])
  17507. /* hot reload */
  17508. if (false) {}
  17509. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__);
  17510. /***/ }),
  17511. /***/ "./resources/js/components/AppPagination.vue":
  17512. /*!***************************************************!*\
  17513. !*** ./resources/js/components/AppPagination.vue ***!
  17514. \***************************************************/
  17515. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17516. "use strict";
  17517. __webpack_require__.r(__webpack_exports__);
  17518. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17519. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17520. /* harmony export */ });
  17521. /* 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");
  17522. /* 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");
  17523. /* 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");
  17524. ;
  17525. 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"]])
  17526. /* hot reload */
  17527. if (false) {}
  17528. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__);
  17529. /***/ }),
  17530. /***/ "./resources/js/components/AppSearch.vue":
  17531. /*!***********************************************!*\
  17532. !*** ./resources/js/components/AppSearch.vue ***!
  17533. \***********************************************/
  17534. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17535. "use strict";
  17536. __webpack_require__.r(__webpack_exports__);
  17537. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17538. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17539. /* harmony export */ });
  17540. /* harmony import */ var _AppSearch_vue_vue_type_template_id_5b9fdcce__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./AppSearch.vue?vue&type=template&id=5b9fdcce */ "./resources/js/components/AppSearch.vue?vue&type=template&id=5b9fdcce");
  17541. /* harmony import */ var _AppSearch_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./AppSearch.vue?vue&type=script&setup=true&lang=js */ "./resources/js/components/AppSearch.vue?vue&type=script&setup=true&lang=js");
  17542. /* 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");
  17543. ;
  17544. const __exports__ = /*#__PURE__*/(0,_media_dijitalcode_3ad9c6e0_4296_4a57_b136_144df49e7bb8_Projects_cahaya_agung_node_modules_vue_loader_dist_exportHelper_js__WEBPACK_IMPORTED_MODULE_2__["default"])(_AppSearch_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_1__["default"], [['render',_AppSearch_vue_vue_type_template_id_5b9fdcce__WEBPACK_IMPORTED_MODULE_0__.render],['__file',"resources/js/components/AppSearch.vue"]])
  17545. /* hot reload */
  17546. if (false) {}
  17547. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__);
  17548. /***/ }),
  17549. /***/ "./resources/js/layouts/Dashboard/Components/Footer.vue":
  17550. /*!**************************************************************!*\
  17551. !*** ./resources/js/layouts/Dashboard/Components/Footer.vue ***!
  17552. \**************************************************************/
  17553. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17554. "use strict";
  17555. __webpack_require__.r(__webpack_exports__);
  17556. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17557. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17558. /* harmony export */ });
  17559. /* harmony import */ var _Footer_vue_vue_type_template_id_dbb3aa76__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./Footer.vue?vue&type=template&id=dbb3aa76 */ "./resources/js/layouts/Dashboard/Components/Footer.vue?vue&type=template&id=dbb3aa76");
  17560. /* harmony import */ var _media_dijitalcode_3ad9c6e0_4296_4a57_b136_144df49e7bb8_Projects_cahaya_agung_node_modules_vue_loader_dist_exportHelper_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./node_modules/vue-loader/dist/exportHelper.js */ "./node_modules/vue-loader/dist/exportHelper.js");
  17561. const script = {}
  17562. ;
  17563. const __exports__ = /*#__PURE__*/(0,_media_dijitalcode_3ad9c6e0_4296_4a57_b136_144df49e7bb8_Projects_cahaya_agung_node_modules_vue_loader_dist_exportHelper_js__WEBPACK_IMPORTED_MODULE_1__["default"])(script, [['render',_Footer_vue_vue_type_template_id_dbb3aa76__WEBPACK_IMPORTED_MODULE_0__.render],['__file',"resources/js/layouts/Dashboard/Components/Footer.vue"]])
  17564. /* hot reload */
  17565. if (false) {}
  17566. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__);
  17567. /***/ }),
  17568. /***/ "./resources/js/layouts/Dashboard/Components/Sidebar.vue":
  17569. /*!***************************************************************!*\
  17570. !*** ./resources/js/layouts/Dashboard/Components/Sidebar.vue ***!
  17571. \***************************************************************/
  17572. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17573. "use strict";
  17574. __webpack_require__.r(__webpack_exports__);
  17575. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17576. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17577. /* harmony export */ });
  17578. /* harmony import */ var _Sidebar_vue_vue_type_template_id_5b49aa22_scoped_true__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./Sidebar.vue?vue&type=template&id=5b49aa22&scoped=true */ "./resources/js/layouts/Dashboard/Components/Sidebar.vue?vue&type=template&id=5b49aa22&scoped=true");
  17579. /* harmony import */ var _Sidebar_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./Sidebar.vue?vue&type=script&setup=true&lang=js */ "./resources/js/layouts/Dashboard/Components/Sidebar.vue?vue&type=script&setup=true&lang=js");
  17580. /* harmony import */ var _Sidebar_vue_vue_type_style_index_0_id_5b49aa22_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./Sidebar.vue?vue&type=style&index=0&id=5b49aa22&lang=scss&scoped=true */ "./resources/js/layouts/Dashboard/Components/Sidebar.vue?vue&type=style&index=0&id=5b49aa22&lang=scss&scoped=true");
  17581. /* 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");
  17582. ;
  17583. const __exports__ = /*#__PURE__*/(0,_media_dijitalcode_3ad9c6e0_4296_4a57_b136_144df49e7bb8_Projects_cahaya_agung_node_modules_vue_loader_dist_exportHelper_js__WEBPACK_IMPORTED_MODULE_3__["default"])(_Sidebar_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_1__["default"], [['render',_Sidebar_vue_vue_type_template_id_5b49aa22_scoped_true__WEBPACK_IMPORTED_MODULE_0__.render],['__scopeId',"data-v-5b49aa22"],['__file',"resources/js/layouts/Dashboard/Components/Sidebar.vue"]])
  17584. /* hot reload */
  17585. if (false) {}
  17586. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__);
  17587. /***/ }),
  17588. /***/ "./resources/js/layouts/Dashboard/Components/SubSidebar.vue":
  17589. /*!******************************************************************!*\
  17590. !*** ./resources/js/layouts/Dashboard/Components/SubSidebar.vue ***!
  17591. \******************************************************************/
  17592. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17593. "use strict";
  17594. __webpack_require__.r(__webpack_exports__);
  17595. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17596. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17597. /* harmony export */ });
  17598. /* harmony import */ var _SubSidebar_vue_vue_type_template_id_b1b23eb4_scoped_true__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./SubSidebar.vue?vue&type=template&id=b1b23eb4&scoped=true */ "./resources/js/layouts/Dashboard/Components/SubSidebar.vue?vue&type=template&id=b1b23eb4&scoped=true");
  17599. /* harmony import */ var _SubSidebar_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./SubSidebar.vue?vue&type=script&setup=true&lang=js */ "./resources/js/layouts/Dashboard/Components/SubSidebar.vue?vue&type=script&setup=true&lang=js");
  17600. /* harmony import */ var _SubSidebar_vue_vue_type_style_index_0_id_b1b23eb4_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./SubSidebar.vue?vue&type=style&index=0&id=b1b23eb4&lang=scss&scoped=true */ "./resources/js/layouts/Dashboard/Components/SubSidebar.vue?vue&type=style&index=0&id=b1b23eb4&lang=scss&scoped=true");
  17601. /* 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");
  17602. ;
  17603. const __exports__ = /*#__PURE__*/(0,_media_dijitalcode_3ad9c6e0_4296_4a57_b136_144df49e7bb8_Projects_cahaya_agung_node_modules_vue_loader_dist_exportHelper_js__WEBPACK_IMPORTED_MODULE_3__["default"])(_SubSidebar_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_1__["default"], [['render',_SubSidebar_vue_vue_type_template_id_b1b23eb4_scoped_true__WEBPACK_IMPORTED_MODULE_0__.render],['__scopeId',"data-v-b1b23eb4"],['__file',"resources/js/layouts/Dashboard/Components/SubSidebar.vue"]])
  17604. /* hot reload */
  17605. if (false) {}
  17606. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__);
  17607. /***/ }),
  17608. /***/ "./resources/js/layouts/Dashboard/Components/TopBar.vue":
  17609. /*!**************************************************************!*\
  17610. !*** ./resources/js/layouts/Dashboard/Components/TopBar.vue ***!
  17611. \**************************************************************/
  17612. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17613. "use strict";
  17614. __webpack_require__.r(__webpack_exports__);
  17615. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17616. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17617. /* harmony export */ });
  17618. /* harmony import */ var _TopBar_vue_vue_type_template_id_0b7edbb0_scoped_true__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./TopBar.vue?vue&type=template&id=0b7edbb0&scoped=true */ "./resources/js/layouts/Dashboard/Components/TopBar.vue?vue&type=template&id=0b7edbb0&scoped=true");
  17619. /* harmony import */ var _TopBar_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./TopBar.vue?vue&type=script&setup=true&lang=js */ "./resources/js/layouts/Dashboard/Components/TopBar.vue?vue&type=script&setup=true&lang=js");
  17620. /* harmony import */ var _TopBar_vue_vue_type_style_index_0_id_0b7edbb0_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./TopBar.vue?vue&type=style&index=0&id=0b7edbb0&lang=scss&scoped=true */ "./resources/js/layouts/Dashboard/Components/TopBar.vue?vue&type=style&index=0&id=0b7edbb0&lang=scss&scoped=true");
  17621. /* 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");
  17622. ;
  17623. const __exports__ = /*#__PURE__*/(0,_media_dijitalcode_3ad9c6e0_4296_4a57_b136_144df49e7bb8_Projects_cahaya_agung_node_modules_vue_loader_dist_exportHelper_js__WEBPACK_IMPORTED_MODULE_3__["default"])(_TopBar_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_1__["default"], [['render',_TopBar_vue_vue_type_template_id_0b7edbb0_scoped_true__WEBPACK_IMPORTED_MODULE_0__.render],['__scopeId',"data-v-0b7edbb0"],['__file',"resources/js/layouts/Dashboard/Components/TopBar.vue"]])
  17624. /* hot reload */
  17625. if (false) {}
  17626. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__);
  17627. /***/ }),
  17628. /***/ "./resources/js/layouts/Dashboard/DashboardLayout.vue":
  17629. /*!************************************************************!*\
  17630. !*** ./resources/js/layouts/Dashboard/DashboardLayout.vue ***!
  17631. \************************************************************/
  17632. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17633. "use strict";
  17634. __webpack_require__.r(__webpack_exports__);
  17635. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17636. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17637. /* harmony export */ });
  17638. /* harmony import */ var _DashboardLayout_vue_vue_type_template_id_1d279fe2_scoped_true__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./DashboardLayout.vue?vue&type=template&id=1d279fe2&scoped=true */ "./resources/js/layouts/Dashboard/DashboardLayout.vue?vue&type=template&id=1d279fe2&scoped=true");
  17639. /* harmony import */ var _DashboardLayout_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./DashboardLayout.vue?vue&type=script&setup=true&lang=js */ "./resources/js/layouts/Dashboard/DashboardLayout.vue?vue&type=script&setup=true&lang=js");
  17640. /* harmony import */ var _DashboardLayout_vue_vue_type_style_index_0_id_1d279fe2_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./DashboardLayout.vue?vue&type=style&index=0&id=1d279fe2&lang=scss&scoped=true */ "./resources/js/layouts/Dashboard/DashboardLayout.vue?vue&type=style&index=0&id=1d279fe2&lang=scss&scoped=true");
  17641. /* 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");
  17642. ;
  17643. const __exports__ = /*#__PURE__*/(0,_media_dijitalcode_3ad9c6e0_4296_4a57_b136_144df49e7bb8_Projects_cahaya_agung_node_modules_vue_loader_dist_exportHelper_js__WEBPACK_IMPORTED_MODULE_3__["default"])(_DashboardLayout_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_1__["default"], [['render',_DashboardLayout_vue_vue_type_template_id_1d279fe2_scoped_true__WEBPACK_IMPORTED_MODULE_0__.render],['__scopeId',"data-v-1d279fe2"],['__file',"resources/js/layouts/Dashboard/DashboardLayout.vue"]])
  17644. /* hot reload */
  17645. if (false) {}
  17646. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__);
  17647. /***/ }),
  17648. /***/ "./resources/js/pages/Users/Index.vue":
  17649. /*!********************************************!*\
  17650. !*** ./resources/js/pages/Users/Index.vue ***!
  17651. \********************************************/
  17652. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17653. "use strict";
  17654. __webpack_require__.r(__webpack_exports__);
  17655. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17656. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17657. /* harmony export */ });
  17658. /* harmony import */ var _Index_vue_vue_type_template_id_203afd1c__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./Index.vue?vue&type=template&id=203afd1c */ "./resources/js/pages/Users/Index.vue?vue&type=template&id=203afd1c");
  17659. /* 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/Users/Index.vue?vue&type=script&setup=true&lang=js");
  17660. /* 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");
  17661. ;
  17662. 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_203afd1c__WEBPACK_IMPORTED_MODULE_0__.render],['__file',"resources/js/pages/Users/Index.vue"]])
  17663. /* hot reload */
  17664. if (false) {}
  17665. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__);
  17666. /***/ }),
  17667. /***/ "./resources/js/components/AppButtonLink.vue?vue&type=script&setup=true&lang=js":
  17668. /*!**************************************************************************************!*\
  17669. !*** ./resources/js/components/AppButtonLink.vue?vue&type=script&setup=true&lang=js ***!
  17670. \**************************************************************************************/
  17671. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17672. "use strict";
  17673. __webpack_require__.r(__webpack_exports__);
  17674. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17675. /* 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"])
  17676. /* harmony export */ });
  17677. /* 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");
  17678. /***/ }),
  17679. /***/ "./resources/js/components/AppMessage.vue?vue&type=script&setup=true&lang=js":
  17680. /*!***********************************************************************************!*\
  17681. !*** ./resources/js/components/AppMessage.vue?vue&type=script&setup=true&lang=js ***!
  17682. \***********************************************************************************/
  17683. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17684. "use strict";
  17685. __webpack_require__.r(__webpack_exports__);
  17686. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17687. /* harmony export */ "default": () => (/* reexport safe */ _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_AppMessage_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_0__["default"])
  17688. /* harmony export */ });
  17689. /* harmony import */ var _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_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");
  17690. /***/ }),
  17691. /***/ "./resources/js/components/AppPagination.vue?vue&type=script&setup=true&lang=js":
  17692. /*!**************************************************************************************!*\
  17693. !*** ./resources/js/components/AppPagination.vue?vue&type=script&setup=true&lang=js ***!
  17694. \**************************************************************************************/
  17695. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17696. "use strict";
  17697. __webpack_require__.r(__webpack_exports__);
  17698. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17699. /* harmony export */ "default": () => (/* reexport safe */ _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_AppPagination_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_0__["default"])
  17700. /* harmony export */ });
  17701. /* harmony import */ var _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_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");
  17702. /***/ }),
  17703. /***/ "./resources/js/components/AppSearch.vue?vue&type=script&setup=true&lang=js":
  17704. /*!**********************************************************************************!*\
  17705. !*** ./resources/js/components/AppSearch.vue?vue&type=script&setup=true&lang=js ***!
  17706. \**********************************************************************************/
  17707. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17708. "use strict";
  17709. __webpack_require__.r(__webpack_exports__);
  17710. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17711. /* harmony export */ "default": () => (/* reexport safe */ _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_AppSearch_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_0__["default"])
  17712. /* harmony export */ });
  17713. /* harmony import */ var _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_AppSearch_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!../../../node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./AppSearch.vue?vue&type=script&setup=true&lang=js */ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppSearch.vue?vue&type=script&setup=true&lang=js");
  17714. /***/ }),
  17715. /***/ "./resources/js/layouts/Dashboard/Components/Sidebar.vue?vue&type=script&setup=true&lang=js":
  17716. /*!**************************************************************************************************!*\
  17717. !*** ./resources/js/layouts/Dashboard/Components/Sidebar.vue?vue&type=script&setup=true&lang=js ***!
  17718. \**************************************************************************************************/
  17719. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17720. "use strict";
  17721. __webpack_require__.r(__webpack_exports__);
  17722. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17723. /* harmony export */ "default": () => (/* reexport safe */ _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_Sidebar_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_0__["default"])
  17724. /* harmony export */ });
  17725. /* harmony import */ var _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_Sidebar_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../../../node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!../../../../../node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./Sidebar.vue?vue&type=script&setup=true&lang=js */ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/layouts/Dashboard/Components/Sidebar.vue?vue&type=script&setup=true&lang=js");
  17726. /***/ }),
  17727. /***/ "./resources/js/layouts/Dashboard/Components/SubSidebar.vue?vue&type=script&setup=true&lang=js":
  17728. /*!*****************************************************************************************************!*\
  17729. !*** ./resources/js/layouts/Dashboard/Components/SubSidebar.vue?vue&type=script&setup=true&lang=js ***!
  17730. \*****************************************************************************************************/
  17731. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17732. "use strict";
  17733. __webpack_require__.r(__webpack_exports__);
  17734. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17735. /* harmony export */ "default": () => (/* reexport safe */ _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_SubSidebar_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_0__["default"])
  17736. /* harmony export */ });
  17737. /* harmony import */ var _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_SubSidebar_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../../../node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!../../../../../node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./SubSidebar.vue?vue&type=script&setup=true&lang=js */ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/layouts/Dashboard/Components/SubSidebar.vue?vue&type=script&setup=true&lang=js");
  17738. /***/ }),
  17739. /***/ "./resources/js/layouts/Dashboard/Components/TopBar.vue?vue&type=script&setup=true&lang=js":
  17740. /*!*************************************************************************************************!*\
  17741. !*** ./resources/js/layouts/Dashboard/Components/TopBar.vue?vue&type=script&setup=true&lang=js ***!
  17742. \*************************************************************************************************/
  17743. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17744. "use strict";
  17745. __webpack_require__.r(__webpack_exports__);
  17746. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17747. /* harmony export */ "default": () => (/* reexport safe */ _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_TopBar_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_0__["default"])
  17748. /* harmony export */ });
  17749. /* harmony import */ var _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_TopBar_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../../../node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!../../../../../node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./TopBar.vue?vue&type=script&setup=true&lang=js */ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/layouts/Dashboard/Components/TopBar.vue?vue&type=script&setup=true&lang=js");
  17750. /***/ }),
  17751. /***/ "./resources/js/layouts/Dashboard/DashboardLayout.vue?vue&type=script&setup=true&lang=js":
  17752. /*!***********************************************************************************************!*\
  17753. !*** ./resources/js/layouts/Dashboard/DashboardLayout.vue?vue&type=script&setup=true&lang=js ***!
  17754. \***********************************************************************************************/
  17755. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17756. "use strict";
  17757. __webpack_require__.r(__webpack_exports__);
  17758. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17759. /* harmony export */ "default": () => (/* reexport safe */ _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_DashboardLayout_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_0__["default"])
  17760. /* harmony export */ });
  17761. /* harmony import */ var _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_DashboardLayout_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../../node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!../../../../node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./DashboardLayout.vue?vue&type=script&setup=true&lang=js */ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/layouts/Dashboard/DashboardLayout.vue?vue&type=script&setup=true&lang=js");
  17762. /***/ }),
  17763. /***/ "./resources/js/pages/Users/Index.vue?vue&type=script&setup=true&lang=js":
  17764. /*!*******************************************************************************!*\
  17765. !*** ./resources/js/pages/Users/Index.vue?vue&type=script&setup=true&lang=js ***!
  17766. \*******************************************************************************/
  17767. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17768. "use strict";
  17769. __webpack_require__.r(__webpack_exports__);
  17770. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17771. /* harmony export */ "default": () => (/* reexport safe */ _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_Index_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_0__["default"])
  17772. /* harmony export */ });
  17773. /* harmony import */ var _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_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/Users/Index.vue?vue&type=script&setup=true&lang=js");
  17774. /***/ }),
  17775. /***/ "./resources/js/components/AppButtonLink.vue?vue&type=template&id=c3621f1c":
  17776. /*!*********************************************************************************!*\
  17777. !*** ./resources/js/components/AppButtonLink.vue?vue&type=template&id=c3621f1c ***!
  17778. \*********************************************************************************/
  17779. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17780. "use strict";
  17781. __webpack_require__.r(__webpack_exports__);
  17782. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17783. /* harmony export */ "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)
  17784. /* harmony export */ });
  17785. /* 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");
  17786. /***/ }),
  17787. /***/ "./resources/js/components/AppMessage.vue?vue&type=template&id=07159051":
  17788. /*!******************************************************************************!*\
  17789. !*** ./resources/js/components/AppMessage.vue?vue&type=template&id=07159051 ***!
  17790. \******************************************************************************/
  17791. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17792. "use strict";
  17793. __webpack_require__.r(__webpack_exports__);
  17794. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17795. /* harmony export */ "render": () => (/* reexport safe */ _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_templateLoader_js_ruleSet_1_rules_2_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_AppMessage_vue_vue_type_template_id_07159051__WEBPACK_IMPORTED_MODULE_0__.render)
  17796. /* harmony export */ });
  17797. /* harmony import */ var _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_templateLoader_js_ruleSet_1_rules_2_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_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");
  17798. /***/ }),
  17799. /***/ "./resources/js/components/AppPagination.vue?vue&type=template&id=4da56ec0":
  17800. /*!*********************************************************************************!*\
  17801. !*** ./resources/js/components/AppPagination.vue?vue&type=template&id=4da56ec0 ***!
  17802. \*********************************************************************************/
  17803. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17804. "use strict";
  17805. __webpack_require__.r(__webpack_exports__);
  17806. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17807. /* harmony export */ "render": () => (/* reexport safe */ _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_templateLoader_js_ruleSet_1_rules_2_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_AppPagination_vue_vue_type_template_id_4da56ec0__WEBPACK_IMPORTED_MODULE_0__.render)
  17808. /* harmony export */ });
  17809. /* harmony import */ var _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_templateLoader_js_ruleSet_1_rules_2_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_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");
  17810. /***/ }),
  17811. /***/ "./resources/js/components/AppSearch.vue?vue&type=template&id=5b9fdcce":
  17812. /*!*****************************************************************************!*\
  17813. !*** ./resources/js/components/AppSearch.vue?vue&type=template&id=5b9fdcce ***!
  17814. \*****************************************************************************/
  17815. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17816. "use strict";
  17817. __webpack_require__.r(__webpack_exports__);
  17818. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17819. /* harmony export */ "render": () => (/* reexport safe */ _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_templateLoader_js_ruleSet_1_rules_2_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_AppSearch_vue_vue_type_template_id_5b9fdcce__WEBPACK_IMPORTED_MODULE_0__.render)
  17820. /* harmony export */ });
  17821. /* harmony import */ var _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_templateLoader_js_ruleSet_1_rules_2_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_AppSearch_vue_vue_type_template_id_5b9fdcce__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!../../../node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!../../../node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./AppSearch.vue?vue&type=template&id=5b9fdcce */ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppSearch.vue?vue&type=template&id=5b9fdcce");
  17822. /***/ }),
  17823. /***/ "./resources/js/layouts/Dashboard/Components/Footer.vue?vue&type=template&id=dbb3aa76":
  17824. /*!********************************************************************************************!*\
  17825. !*** ./resources/js/layouts/Dashboard/Components/Footer.vue?vue&type=template&id=dbb3aa76 ***!
  17826. \********************************************************************************************/
  17827. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17828. "use strict";
  17829. __webpack_require__.r(__webpack_exports__);
  17830. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17831. /* harmony export */ "render": () => (/* reexport safe */ _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_templateLoader_js_ruleSet_1_rules_2_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_Footer_vue_vue_type_template_id_dbb3aa76__WEBPACK_IMPORTED_MODULE_0__.render)
  17832. /* harmony export */ });
  17833. /* harmony import */ var _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_templateLoader_js_ruleSet_1_rules_2_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_Footer_vue_vue_type_template_id_dbb3aa76__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../../../node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!../../../../../node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!../../../../../node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./Footer.vue?vue&type=template&id=dbb3aa76 */ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/layouts/Dashboard/Components/Footer.vue?vue&type=template&id=dbb3aa76");
  17834. /***/ }),
  17835. /***/ "./resources/js/layouts/Dashboard/Components/Sidebar.vue?vue&type=template&id=5b49aa22&scoped=true":
  17836. /*!*********************************************************************************************************!*\
  17837. !*** ./resources/js/layouts/Dashboard/Components/Sidebar.vue?vue&type=template&id=5b49aa22&scoped=true ***!
  17838. \*********************************************************************************************************/
  17839. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17840. "use strict";
  17841. __webpack_require__.r(__webpack_exports__);
  17842. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17843. /* harmony export */ "render": () => (/* reexport safe */ _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_templateLoader_js_ruleSet_1_rules_2_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_Sidebar_vue_vue_type_template_id_5b49aa22_scoped_true__WEBPACK_IMPORTED_MODULE_0__.render)
  17844. /* harmony export */ });
  17845. /* harmony import */ var _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_templateLoader_js_ruleSet_1_rules_2_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_Sidebar_vue_vue_type_template_id_5b49aa22_scoped_true__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../../../node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!../../../../../node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!../../../../../node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./Sidebar.vue?vue&type=template&id=5b49aa22&scoped=true */ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/layouts/Dashboard/Components/Sidebar.vue?vue&type=template&id=5b49aa22&scoped=true");
  17846. /***/ }),
  17847. /***/ "./resources/js/layouts/Dashboard/Components/SubSidebar.vue?vue&type=template&id=b1b23eb4&scoped=true":
  17848. /*!************************************************************************************************************!*\
  17849. !*** ./resources/js/layouts/Dashboard/Components/SubSidebar.vue?vue&type=template&id=b1b23eb4&scoped=true ***!
  17850. \************************************************************************************************************/
  17851. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17852. "use strict";
  17853. __webpack_require__.r(__webpack_exports__);
  17854. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17855. /* harmony export */ "render": () => (/* reexport safe */ _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_templateLoader_js_ruleSet_1_rules_2_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_SubSidebar_vue_vue_type_template_id_b1b23eb4_scoped_true__WEBPACK_IMPORTED_MODULE_0__.render)
  17856. /* harmony export */ });
  17857. /* harmony import */ var _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_templateLoader_js_ruleSet_1_rules_2_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_SubSidebar_vue_vue_type_template_id_b1b23eb4_scoped_true__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../../../node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!../../../../../node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!../../../../../node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./SubSidebar.vue?vue&type=template&id=b1b23eb4&scoped=true */ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/layouts/Dashboard/Components/SubSidebar.vue?vue&type=template&id=b1b23eb4&scoped=true");
  17858. /***/ }),
  17859. /***/ "./resources/js/layouts/Dashboard/Components/TopBar.vue?vue&type=template&id=0b7edbb0&scoped=true":
  17860. /*!********************************************************************************************************!*\
  17861. !*** ./resources/js/layouts/Dashboard/Components/TopBar.vue?vue&type=template&id=0b7edbb0&scoped=true ***!
  17862. \********************************************************************************************************/
  17863. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17864. "use strict";
  17865. __webpack_require__.r(__webpack_exports__);
  17866. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17867. /* harmony export */ "render": () => (/* reexport safe */ _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_templateLoader_js_ruleSet_1_rules_2_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_TopBar_vue_vue_type_template_id_0b7edbb0_scoped_true__WEBPACK_IMPORTED_MODULE_0__.render)
  17868. /* harmony export */ });
  17869. /* harmony import */ var _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_templateLoader_js_ruleSet_1_rules_2_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_TopBar_vue_vue_type_template_id_0b7edbb0_scoped_true__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../../../node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!../../../../../node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!../../../../../node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./TopBar.vue?vue&type=template&id=0b7edbb0&scoped=true */ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/layouts/Dashboard/Components/TopBar.vue?vue&type=template&id=0b7edbb0&scoped=true");
  17870. /***/ }),
  17871. /***/ "./resources/js/layouts/Dashboard/DashboardLayout.vue?vue&type=template&id=1d279fe2&scoped=true":
  17872. /*!******************************************************************************************************!*\
  17873. !*** ./resources/js/layouts/Dashboard/DashboardLayout.vue?vue&type=template&id=1d279fe2&scoped=true ***!
  17874. \******************************************************************************************************/
  17875. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17876. "use strict";
  17877. __webpack_require__.r(__webpack_exports__);
  17878. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17879. /* harmony export */ "render": () => (/* reexport safe */ _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_templateLoader_js_ruleSet_1_rules_2_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_DashboardLayout_vue_vue_type_template_id_1d279fe2_scoped_true__WEBPACK_IMPORTED_MODULE_0__.render)
  17880. /* harmony export */ });
  17881. /* harmony import */ var _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_templateLoader_js_ruleSet_1_rules_2_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_DashboardLayout_vue_vue_type_template_id_1d279fe2_scoped_true__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../../node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!../../../../node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!../../../../node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./DashboardLayout.vue?vue&type=template&id=1d279fe2&scoped=true */ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/layouts/Dashboard/DashboardLayout.vue?vue&type=template&id=1d279fe2&scoped=true");
  17882. /***/ }),
  17883. /***/ "./resources/js/pages/Users/Index.vue?vue&type=template&id=203afd1c":
  17884. /*!**************************************************************************!*\
  17885. !*** ./resources/js/pages/Users/Index.vue?vue&type=template&id=203afd1c ***!
  17886. \**************************************************************************/
  17887. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17888. "use strict";
  17889. __webpack_require__.r(__webpack_exports__);
  17890. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17891. /* harmony export */ "render": () => (/* reexport safe */ _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_templateLoader_js_ruleSet_1_rules_2_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_Index_vue_vue_type_template_id_203afd1c__WEBPACK_IMPORTED_MODULE_0__.render)
  17892. /* harmony export */ });
  17893. /* harmony import */ var _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_templateLoader_js_ruleSet_1_rules_2_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_Index_vue_vue_type_template_id_203afd1c__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=203afd1c */ "./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/Users/Index.vue?vue&type=template&id=203afd1c");
  17894. /***/ }),
  17895. /***/ "./resources/js/layouts/Dashboard/Components/Sidebar.vue?vue&type=style&index=0&id=5b49aa22&lang=scss&scoped=true":
  17896. /*!************************************************************************************************************************!*\
  17897. !*** ./resources/js/layouts/Dashboard/Components/Sidebar.vue?vue&type=style&index=0&id=5b49aa22&lang=scss&scoped=true ***!
  17898. \************************************************************************************************************************/
  17899. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17900. "use strict";
  17901. __webpack_require__.r(__webpack_exports__);
  17902. /* harmony import */ var _node_modules_style_loader_dist_cjs_js_node_modules_css_loader_dist_cjs_js_clonedRuleSet_11_use_1_node_modules_vue_loader_dist_stylePostLoader_js_node_modules_postcss_loader_dist_cjs_js_clonedRuleSet_11_use_2_node_modules_sass_loader_dist_cjs_js_clonedRuleSet_11_use_3_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_Sidebar_vue_vue_type_style_index_0_id_5b49aa22_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../../../node_modules/style-loader/dist/cjs.js!../../../../../node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!../../../../../node_modules/vue-loader/dist/stylePostLoader.js!../../../../../node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!../../../../../node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!../../../../../node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./Sidebar.vue?vue&type=style&index=0&id=5b49aa22&lang=scss&scoped=true */ "./node_modules/style-loader/dist/cjs.js!./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/layouts/Dashboard/Components/Sidebar.vue?vue&type=style&index=0&id=5b49aa22&lang=scss&scoped=true");
  17903. /***/ }),
  17904. /***/ "./resources/js/layouts/Dashboard/Components/SubSidebar.vue?vue&type=style&index=0&id=b1b23eb4&lang=scss&scoped=true":
  17905. /*!***************************************************************************************************************************!*\
  17906. !*** ./resources/js/layouts/Dashboard/Components/SubSidebar.vue?vue&type=style&index=0&id=b1b23eb4&lang=scss&scoped=true ***!
  17907. \***************************************************************************************************************************/
  17908. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17909. "use strict";
  17910. __webpack_require__.r(__webpack_exports__);
  17911. /* harmony import */ var _node_modules_style_loader_dist_cjs_js_node_modules_css_loader_dist_cjs_js_clonedRuleSet_11_use_1_node_modules_vue_loader_dist_stylePostLoader_js_node_modules_postcss_loader_dist_cjs_js_clonedRuleSet_11_use_2_node_modules_sass_loader_dist_cjs_js_clonedRuleSet_11_use_3_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_SubSidebar_vue_vue_type_style_index_0_id_b1b23eb4_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../../../node_modules/style-loader/dist/cjs.js!../../../../../node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!../../../../../node_modules/vue-loader/dist/stylePostLoader.js!../../../../../node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!../../../../../node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!../../../../../node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./SubSidebar.vue?vue&type=style&index=0&id=b1b23eb4&lang=scss&scoped=true */ "./node_modules/style-loader/dist/cjs.js!./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/layouts/Dashboard/Components/SubSidebar.vue?vue&type=style&index=0&id=b1b23eb4&lang=scss&scoped=true");
  17912. /***/ }),
  17913. /***/ "./resources/js/layouts/Dashboard/Components/TopBar.vue?vue&type=style&index=0&id=0b7edbb0&lang=scss&scoped=true":
  17914. /*!***********************************************************************************************************************!*\
  17915. !*** ./resources/js/layouts/Dashboard/Components/TopBar.vue?vue&type=style&index=0&id=0b7edbb0&lang=scss&scoped=true ***!
  17916. \***********************************************************************************************************************/
  17917. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17918. "use strict";
  17919. __webpack_require__.r(__webpack_exports__);
  17920. /* harmony import */ var _node_modules_style_loader_dist_cjs_js_node_modules_css_loader_dist_cjs_js_clonedRuleSet_11_use_1_node_modules_vue_loader_dist_stylePostLoader_js_node_modules_postcss_loader_dist_cjs_js_clonedRuleSet_11_use_2_node_modules_sass_loader_dist_cjs_js_clonedRuleSet_11_use_3_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_TopBar_vue_vue_type_style_index_0_id_0b7edbb0_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../../../node_modules/style-loader/dist/cjs.js!../../../../../node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!../../../../../node_modules/vue-loader/dist/stylePostLoader.js!../../../../../node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!../../../../../node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!../../../../../node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./TopBar.vue?vue&type=style&index=0&id=0b7edbb0&lang=scss&scoped=true */ "./node_modules/style-loader/dist/cjs.js!./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/layouts/Dashboard/Components/TopBar.vue?vue&type=style&index=0&id=0b7edbb0&lang=scss&scoped=true");
  17921. /***/ }),
  17922. /***/ "./resources/js/layouts/Dashboard/DashboardLayout.vue?vue&type=style&index=0&id=1d279fe2&lang=scss&scoped=true":
  17923. /*!*********************************************************************************************************************!*\
  17924. !*** ./resources/js/layouts/Dashboard/DashboardLayout.vue?vue&type=style&index=0&id=1d279fe2&lang=scss&scoped=true ***!
  17925. \*********************************************************************************************************************/
  17926. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17927. "use strict";
  17928. __webpack_require__.r(__webpack_exports__);
  17929. /* harmony import */ var _node_modules_style_loader_dist_cjs_js_node_modules_css_loader_dist_cjs_js_clonedRuleSet_11_use_1_node_modules_vue_loader_dist_stylePostLoader_js_node_modules_postcss_loader_dist_cjs_js_clonedRuleSet_11_use_2_node_modules_sass_loader_dist_cjs_js_clonedRuleSet_11_use_3_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_DashboardLayout_vue_vue_type_style_index_0_id_1d279fe2_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../../node_modules/style-loader/dist/cjs.js!../../../../node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!../../../../node_modules/vue-loader/dist/stylePostLoader.js!../../../../node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!../../../../node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!../../../../node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./DashboardLayout.vue?vue&type=style&index=0&id=1d279fe2&lang=scss&scoped=true */ "./node_modules/style-loader/dist/cjs.js!./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/layouts/Dashboard/DashboardLayout.vue?vue&type=style&index=0&id=1d279fe2&lang=scss&scoped=true");
  17930. /***/ })
  17931. }]);