resources_js_pages_Users_Index_vue.js 680KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316531753185319532053215322532353245325532653275328532953305331533253335334533553365337533853395340534153425343534453455346534753485349535053515352535353545355535653575358535953605361536253635364536553665367536853695370537153725373537453755376537753785379538053815382538353845385538653875388538953905391539253935394539553965397539853995400540154025403540454055406540754085409541054115412541354145415541654175418541954205421542254235424542554265427542854295430543154325433543454355436543754385439544054415442544354445445544654475448544954505451545254535454545554565457545854595460546154625463546454655466546754685469547054715472547354745475547654775478547954805481548254835484548554865487548854895490549154925493549454955496549754985499550055015502550355045505550655075508550955105511551255135514551555165517551855195520552155225523552455255526552755285529553055315532553355345535553655375538553955405541554255435544554555465547554855495550555155525553555455555556555755585559556055615562556355645565556655675568556955705571557255735574557555765577557855795580558155825583558455855586558755885589559055915592559355945595559655975598559956005601560256035604560556065607560856095610561156125613561456155616561756185619562056215622562356245625562656275628562956305631563256335634563556365637563856395640564156425643564456455646564756485649565056515652565356545655565656575658565956605661566256635664566556665667566856695670567156725673567456755676567756785679568056815682568356845685568656875688568956905691569256935694569556965697569856995700570157025703570457055706570757085709571057115712571357145715571657175718571957205721572257235724572557265727572857295730573157325733573457355736573757385739574057415742574357445745574657475748574957505751575257535754575557565757575857595760576157625763576457655766576757685769577057715772577357745775577657775778577957805781578257835784578557865787578857895790579157925793579457955796579757985799580058015802580358045805580658075808580958105811581258135814581558165817581858195820582158225823582458255826582758285829583058315832583358345835583658375838583958405841584258435844584558465847584858495850585158525853585458555856585758585859586058615862586358645865586658675868586958705871587258735874587558765877587858795880588158825883588458855886588758885889589058915892589358945895589658975898589959005901590259035904590559065907590859095910591159125913591459155916591759185919592059215922592359245925592659275928592959305931593259335934593559365937593859395940594159425943594459455946594759485949595059515952595359545955595659575958595959605961596259635964596559665967596859695970597159725973597459755976597759785979598059815982598359845985598659875988598959905991599259935994599559965997599859996000600160026003600460056006600760086009601060116012601360146015601660176018601960206021602260236024602560266027602860296030603160326033603460356036603760386039604060416042604360446045604660476048604960506051605260536054605560566057605860596060606160626063606460656066606760686069607060716072607360746075607660776078607960806081608260836084608560866087608860896090609160926093609460956096609760986099610061016102610361046105610661076108610961106111611261136114611561166117611861196120612161226123612461256126612761286129613061316132613361346135613661376138613961406141614261436144614561466147614861496150615161526153615461556156615761586159616061616162616361646165616661676168616961706171617261736174617561766177617861796180618161826183618461856186618761886189619061916192619361946195619661976198619962006201620262036204620562066207620862096210621162126213621462156216621762186219622062216222622362246225622662276228622962306231623262336234623562366237623862396240624162426243624462456246624762486249625062516252625362546255625662576258625962606261626262636264626562666267626862696270627162726273627462756276627762786279628062816282628362846285628662876288628962906291629262936294629562966297629862996300630163026303630463056306630763086309631063116312631363146315631663176318631963206321632263236324632563266327632863296330633163326333633463356336633763386339634063416342634363446345634663476348634963506351635263536354635563566357635863596360636163626363636463656366636763686369637063716372637363746375637663776378637963806381638263836384638563866387638863896390639163926393639463956396639763986399640064016402640364046405640664076408640964106411641264136414641564166417641864196420642164226423642464256426642764286429643064316432643364346435643664376438643964406441644264436444644564466447644864496450645164526453645464556456645764586459646064616462646364646465646664676468646964706471647264736474647564766477647864796480648164826483648464856486648764886489649064916492649364946495649664976498649965006501650265036504650565066507650865096510651165126513651465156516651765186519652065216522652365246525652665276528652965306531653265336534653565366537653865396540654165426543654465456546654765486549655065516552655365546555655665576558655965606561656265636564656565666567656865696570657165726573657465756576657765786579658065816582658365846585658665876588658965906591659265936594659565966597659865996600660166026603660466056606660766086609661066116612661366146615661666176618661966206621662266236624662566266627662866296630663166326633663466356636663766386639664066416642664366446645664666476648664966506651665266536654665566566657665866596660666166626663666466656666666766686669667066716672667366746675667666776678667966806681668266836684668566866687668866896690669166926693669466956696669766986699670067016702670367046705670667076708670967106711671267136714671567166717671867196720672167226723672467256726672767286729673067316732673367346735673667376738673967406741674267436744674567466747674867496750675167526753675467556756675767586759676067616762676367646765676667676768676967706771677267736774677567766777677867796780678167826783678467856786678767886789679067916792679367946795679667976798679968006801680268036804680568066807680868096810681168126813681468156816681768186819682068216822682368246825682668276828682968306831683268336834683568366837683868396840684168426843684468456846684768486849685068516852685368546855685668576858685968606861686268636864686568666867686868696870687168726873687468756876687768786879688068816882688368846885688668876888688968906891689268936894689568966897689868996900690169026903690469056906690769086909691069116912691369146915691669176918691969206921692269236924692569266927692869296930693169326933693469356936693769386939694069416942694369446945694669476948694969506951695269536954695569566957695869596960696169626963696469656966696769686969697069716972697369746975697669776978697969806981698269836984698569866987698869896990699169926993699469956996699769986999700070017002700370047005700670077008700970107011701270137014701570167017701870197020702170227023702470257026702770287029703070317032703370347035703670377038703970407041704270437044704570467047704870497050705170527053705470557056705770587059706070617062706370647065706670677068706970707071707270737074707570767077707870797080708170827083708470857086708770887089709070917092709370947095709670977098709971007101710271037104710571067107710871097110711171127113711471157116711771187119712071217122712371247125712671277128712971307131713271337134713571367137713871397140714171427143714471457146714771487149715071517152715371547155715671577158715971607161716271637164716571667167716871697170717171727173717471757176717771787179718071817182718371847185718671877188718971907191719271937194719571967197719871997200720172027203720472057206720772087209721072117212721372147215721672177218721972207221722272237224722572267227722872297230723172327233723472357236723772387239724072417242724372447245724672477248724972507251725272537254725572567257725872597260726172627263726472657266726772687269727072717272727372747275727672777278727972807281728272837284728572867287728872897290729172927293729472957296729772987299730073017302730373047305730673077308730973107311731273137314731573167317731873197320732173227323732473257326732773287329733073317332733373347335733673377338733973407341734273437344734573467347734873497350735173527353735473557356735773587359736073617362736373647365736673677368736973707371737273737374737573767377737873797380738173827383738473857386738773887389739073917392739373947395739673977398739974007401740274037404740574067407740874097410741174127413741474157416741774187419742074217422742374247425742674277428742974307431743274337434743574367437743874397440744174427443744474457446744774487449745074517452745374547455745674577458745974607461746274637464746574667467746874697470747174727473747474757476747774787479748074817482748374847485748674877488748974907491749274937494749574967497749874997500750175027503750475057506750775087509751075117512751375147515751675177518751975207521752275237524752575267527752875297530753175327533753475357536753775387539754075417542754375447545754675477548754975507551755275537554755575567557755875597560756175627563756475657566756775687569757075717572757375747575757675777578757975807581758275837584758575867587758875897590759175927593759475957596759775987599760076017602760376047605760676077608760976107611761276137614761576167617761876197620762176227623762476257626762776287629763076317632763376347635763676377638763976407641764276437644764576467647764876497650765176527653765476557656765776587659766076617662766376647665766676677668766976707671767276737674767576767677767876797680768176827683768476857686768776887689769076917692769376947695769676977698769977007701770277037704770577067707770877097710771177127713771477157716771777187719772077217722772377247725772677277728772977307731773277337734773577367737773877397740774177427743774477457746774777487749775077517752775377547755775677577758775977607761776277637764776577667767776877697770777177727773777477757776777777787779778077817782778377847785778677877788778977907791779277937794779577967797779877997800780178027803780478057806780778087809781078117812781378147815781678177818781978207821782278237824782578267827782878297830783178327833783478357836783778387839784078417842784378447845784678477848784978507851785278537854785578567857785878597860786178627863786478657866786778687869787078717872787378747875787678777878787978807881788278837884788578867887788878897890789178927893789478957896789778987899790079017902790379047905790679077908790979107911791279137914791579167917791879197920792179227923792479257926792779287929793079317932793379347935793679377938793979407941794279437944794579467947794879497950795179527953795479557956795779587959796079617962796379647965796679677968796979707971797279737974797579767977797879797980798179827983798479857986798779887989799079917992799379947995799679977998799980008001800280038004800580068007800880098010801180128013801480158016801780188019802080218022802380248025802680278028802980308031803280338034803580368037803880398040804180428043804480458046804780488049805080518052805380548055805680578058805980608061806280638064806580668067806880698070807180728073807480758076807780788079808080818082808380848085808680878088808980908091809280938094809580968097809880998100810181028103810481058106810781088109811081118112811381148115811681178118811981208121812281238124812581268127812881298130813181328133813481358136813781388139814081418142814381448145814681478148814981508151815281538154815581568157815881598160816181628163816481658166816781688169817081718172817381748175817681778178817981808181818281838184818581868187818881898190819181928193819481958196819781988199820082018202820382048205820682078208820982108211821282138214821582168217821882198220822182228223822482258226822782288229823082318232823382348235823682378238823982408241824282438244824582468247824882498250825182528253825482558256825782588259826082618262826382648265826682678268826982708271827282738274827582768277827882798280828182828283828482858286828782888289829082918292829382948295829682978298829983008301830283038304830583068307830883098310831183128313831483158316831783188319832083218322832383248325832683278328832983308331833283338334833583368337833883398340834183428343834483458346834783488349835083518352835383548355835683578358835983608361836283638364836583668367836883698370837183728373837483758376837783788379838083818382838383848385838683878388838983908391839283938394839583968397839883998400840184028403840484058406840784088409841084118412841384148415841684178418841984208421842284238424842584268427842884298430843184328433843484358436843784388439844084418442844384448445844684478448844984508451845284538454845584568457845884598460846184628463846484658466846784688469847084718472847384748475847684778478847984808481848284838484848584868487848884898490849184928493849484958496849784988499850085018502850385048505850685078508850985108511851285138514851585168517851885198520852185228523852485258526852785288529853085318532853385348535853685378538853985408541854285438544854585468547854885498550855185528553855485558556855785588559856085618562856385648565856685678568856985708571857285738574857585768577857885798580858185828583858485858586858785888589859085918592859385948595859685978598859986008601860286038604860586068607860886098610861186128613861486158616861786188619862086218622862386248625862686278628862986308631863286338634863586368637863886398640864186428643864486458646864786488649865086518652865386548655865686578658865986608661866286638664866586668667866886698670867186728673867486758676867786788679868086818682868386848685868686878688868986908691869286938694869586968697869886998700870187028703870487058706870787088709871087118712871387148715871687178718871987208721872287238724872587268727872887298730873187328733873487358736873787388739874087418742874387448745874687478748874987508751875287538754875587568757875887598760876187628763876487658766876787688769877087718772877387748775877687778778877987808781878287838784878587868787878887898790879187928793879487958796879787988799880088018802880388048805880688078808880988108811881288138814881588168817881888198820882188228823882488258826882788288829883088318832883388348835883688378838883988408841884288438844884588468847884888498850885188528853885488558856885788588859886088618862886388648865886688678868886988708871887288738874887588768877887888798880888188828883888488858886888788888889889088918892889388948895889688978898889989008901890289038904890589068907890889098910891189128913891489158916891789188919892089218922892389248925892689278928892989308931893289338934893589368937893889398940894189428943894489458946894789488949895089518952895389548955895689578958895989608961896289638964896589668967896889698970897189728973897489758976897789788979898089818982898389848985898689878988898989908991899289938994899589968997899889999000900190029003900490059006900790089009901090119012901390149015901690179018901990209021902290239024902590269027902890299030903190329033903490359036903790389039904090419042904390449045904690479048904990509051905290539054905590569057905890599060906190629063906490659066906790689069907090719072907390749075907690779078907990809081908290839084908590869087908890899090909190929093909490959096909790989099910091019102910391049105910691079108910991109111911291139114911591169117911891199120912191229123912491259126912791289129913091319132913391349135913691379138913991409141914291439144914591469147914891499150915191529153915491559156915791589159916091619162916391649165916691679168916991709171917291739174917591769177917891799180918191829183918491859186918791889189919091919192919391949195919691979198919992009201920292039204920592069207920892099210921192129213921492159216921792189219922092219222922392249225922692279228922992309231923292339234923592369237923892399240924192429243924492459246924792489249925092519252925392549255925692579258925992609261926292639264926592669267926892699270927192729273927492759276927792789279928092819282928392849285928692879288928992909291929292939294929592969297929892999300930193029303930493059306930793089309931093119312931393149315931693179318931993209321932293239324932593269327932893299330933193329333933493359336933793389339934093419342934393449345934693479348934993509351935293539354935593569357935893599360936193629363936493659366936793689369937093719372937393749375937693779378937993809381938293839384938593869387938893899390939193929393939493959396939793989399940094019402940394049405940694079408940994109411941294139414941594169417941894199420942194229423942494259426942794289429943094319432943394349435943694379438943994409441944294439444944594469447944894499450945194529453945494559456945794589459946094619462946394649465946694679468946994709471947294739474947594769477947894799480948194829483948494859486948794889489949094919492949394949495949694979498949995009501950295039504950595069507950895099510951195129513951495159516951795189519952095219522952395249525952695279528952995309531953295339534953595369537953895399540954195429543954495459546954795489549955095519552955395549555955695579558955995609561956295639564956595669567956895699570957195729573957495759576957795789579958095819582958395849585958695879588958995909591959295939594959595969597959895999600960196029603960496059606960796089609961096119612961396149615961696179618961996209621962296239624962596269627962896299630963196329633963496359636963796389639964096419642964396449645964696479648964996509651965296539654965596569657965896599660966196629663966496659666966796689669967096719672967396749675967696779678967996809681968296839684968596869687968896899690969196929693969496959696969796989699970097019702970397049705970697079708970997109711971297139714971597169717971897199720972197229723972497259726972797289729973097319732973397349735973697379738973997409741974297439744974597469747974897499750975197529753975497559756975797589759976097619762976397649765976697679768976997709771977297739774977597769777977897799780978197829783978497859786978797889789979097919792979397949795979697979798979998009801980298039804980598069807980898099810981198129813981498159816981798189819982098219822982398249825982698279828982998309831983298339834983598369837983898399840984198429843984498459846984798489849985098519852985398549855985698579858985998609861986298639864986598669867986898699870987198729873987498759876987798789879988098819882988398849885988698879888988998909891989298939894989598969897989898999900990199029903990499059906990799089909991099119912991399149915991699179918991999209921992299239924992599269927992899299930993199329933993499359936993799389939994099419942994399449945994699479948994999509951995299539954995599569957995899599960996199629963996499659966996799689969997099719972997399749975997699779978997999809981998299839984998599869987998899899990999199929993999499959996999799989999100001000110002100031000410005100061000710008100091001010011100121001310014100151001610017100181001910020100211002210023100241002510026100271002810029100301003110032100331003410035100361003710038100391004010041100421004310044100451004610047100481004910050100511005210053100541005510056100571005810059100601006110062100631006410065100661006710068100691007010071100721007310074100751007610077100781007910080100811008210083100841008510086100871008810089100901009110092100931009410095100961009710098100991010010101101021010310104101051010610107101081010910110101111011210113101141011510116101171011810119101201012110122101231012410125101261012710128101291013010131101321013310134101351013610137101381013910140101411014210143101441014510146101471014810149101501015110152101531015410155101561015710158101591016010161101621016310164101651016610167101681016910170101711017210173101741017510176101771017810179101801018110182101831018410185101861018710188101891019010191101921019310194101951019610197101981019910200102011020210203102041020510206102071020810209102101021110212102131021410215102161021710218102191022010221102221022310224102251022610227102281022910230102311023210233102341023510236102371023810239102401024110242102431024410245102461024710248102491025010251102521025310254102551025610257102581025910260102611026210263102641026510266102671026810269102701027110272102731027410275102761027710278102791028010281102821028310284102851028610287102881028910290102911029210293102941029510296102971029810299103001030110302103031030410305103061030710308103091031010311103121031310314103151031610317103181031910320103211032210323103241032510326103271032810329103301033110332103331033410335103361033710338103391034010341103421034310344103451034610347103481034910350103511035210353103541035510356103571035810359103601036110362103631036410365103661036710368103691037010371103721037310374103751037610377103781037910380103811038210383103841038510386103871038810389103901039110392103931039410395103961039710398103991040010401104021040310404104051040610407104081040910410104111041210413104141041510416104171041810419104201042110422104231042410425104261042710428104291043010431104321043310434104351043610437104381043910440104411044210443104441044510446104471044810449104501045110452104531045410455104561045710458104591046010461104621046310464104651046610467104681046910470104711047210473104741047510476104771047810479104801048110482104831048410485104861048710488104891049010491104921049310494104951049610497104981049910500105011050210503105041050510506105071050810509105101051110512105131051410515105161051710518105191052010521105221052310524105251052610527105281052910530105311053210533105341053510536105371053810539105401054110542105431054410545105461054710548105491055010551105521055310554105551055610557105581055910560105611056210563105641056510566105671056810569105701057110572105731057410575105761057710578105791058010581105821058310584105851058610587105881058910590105911059210593105941059510596105971059810599106001060110602106031060410605106061060710608106091061010611106121061310614106151061610617106181061910620106211062210623106241062510626106271062810629106301063110632106331063410635106361063710638106391064010641106421064310644106451064610647106481064910650106511065210653106541065510656106571065810659106601066110662106631066410665106661066710668106691067010671106721067310674106751067610677106781067910680106811068210683106841068510686106871068810689106901069110692106931069410695106961069710698106991070010701107021070310704107051070610707107081070910710107111071210713107141071510716107171071810719107201072110722107231072410725107261072710728107291073010731107321073310734107351073610737107381073910740107411074210743107441074510746107471074810749107501075110752107531075410755107561075710758107591076010761107621076310764107651076610767107681076910770107711077210773107741077510776107771077810779107801078110782107831078410785107861078710788107891079010791107921079310794107951079610797107981079910800108011080210803108041080510806108071080810809108101081110812108131081410815108161081710818108191082010821108221082310824108251082610827108281082910830108311083210833108341083510836108371083810839108401084110842108431084410845108461084710848108491085010851108521085310854108551085610857108581085910860108611086210863108641086510866108671086810869108701087110872108731087410875108761087710878108791088010881108821088310884108851088610887108881088910890108911089210893108941089510896108971089810899109001090110902109031090410905109061090710908109091091010911109121091310914109151091610917109181091910920109211092210923109241092510926109271092810929109301093110932109331093410935109361093710938109391094010941109421094310944109451094610947109481094910950109511095210953109541095510956109571095810959109601096110962109631096410965109661096710968109691097010971109721097310974109751097610977109781097910980109811098210983109841098510986109871098810989109901099110992109931099410995109961099710998109991100011001110021100311004110051100611007110081100911010110111101211013110141101511016110171101811019110201102111022110231102411025110261102711028110291103011031110321103311034110351103611037110381103911040110411104211043110441104511046110471104811049110501105111052110531105411055110561105711058110591106011061110621106311064110651106611067110681106911070110711107211073110741107511076110771107811079110801108111082110831108411085110861108711088110891109011091110921109311094110951109611097110981109911100111011110211103111041110511106111071110811109111101111111112111131111411115111161111711118111191112011121111221112311124111251112611127111281112911130111311113211133111341113511136111371113811139111401114111142111431114411145111461114711148111491115011151111521115311154111551115611157111581115911160111611116211163111641116511166111671116811169111701117111172111731117411175111761117711178111791118011181111821118311184111851118611187111881118911190111911119211193111941119511196111971119811199112001120111202112031120411205112061120711208112091121011211112121121311214112151121611217112181121911220112211122211223112241122511226112271122811229112301123111232112331123411235112361123711238112391124011241112421124311244112451124611247112481124911250112511125211253112541125511256112571125811259112601126111262112631126411265112661126711268112691127011271112721127311274112751127611277112781127911280112811128211283112841128511286112871128811289112901129111292112931129411295112961129711298112991130011301113021130311304113051130611307113081130911310113111131211313113141131511316113171131811319113201132111322113231132411325113261132711328113291133011331113321133311334113351133611337113381133911340113411134211343113441134511346113471134811349113501135111352113531135411355113561135711358113591136011361113621136311364113651136611367113681136911370113711137211373113741137511376113771137811379113801138111382113831138411385113861138711388113891139011391113921139311394113951139611397113981139911400114011140211403114041140511406114071140811409114101141111412114131141411415114161141711418114191142011421114221142311424114251142611427114281142911430114311143211433114341143511436114371143811439114401144111442114431144411445114461144711448114491145011451114521145311454114551145611457114581145911460114611146211463114641146511466114671146811469114701147111472114731147411475114761147711478114791148011481114821148311484114851148611487114881148911490114911149211493114941149511496114971149811499115001150111502115031150411505115061150711508115091151011511115121151311514115151151611517115181151911520115211152211523115241152511526115271152811529115301153111532115331153411535115361153711538115391154011541115421154311544115451154611547115481154911550115511155211553115541155511556115571155811559115601156111562115631156411565115661156711568115691157011571115721157311574115751157611577115781157911580115811158211583115841158511586115871158811589115901159111592115931159411595115961159711598115991160011601116021160311604116051160611607116081160911610116111161211613116141161511616116171161811619116201162111622116231162411625116261162711628116291163011631116321163311634116351163611637116381163911640116411164211643116441164511646116471164811649116501165111652116531165411655116561165711658116591166011661116621166311664116651166611667116681166911670116711167211673116741167511676116771167811679116801168111682116831168411685116861168711688116891169011691116921169311694116951169611697116981169911700117011170211703117041170511706117071170811709117101171111712117131171411715117161171711718117191172011721117221172311724117251172611727117281172911730117311173211733117341173511736117371173811739117401174111742117431174411745117461174711748117491175011751117521175311754117551175611757117581175911760117611176211763117641176511766117671176811769117701177111772117731177411775117761177711778117791178011781117821178311784117851178611787117881178911790117911179211793117941179511796117971179811799118001180111802118031180411805118061180711808118091181011811118121181311814118151181611817118181181911820118211182211823118241182511826118271182811829118301183111832118331183411835118361183711838118391184011841118421184311844118451184611847118481184911850118511185211853118541185511856118571185811859118601186111862118631186411865118661186711868118691187011871118721187311874118751187611877118781187911880118811188211883118841188511886118871188811889118901189111892118931189411895118961189711898118991190011901119021190311904119051190611907119081190911910119111191211913119141191511916119171191811919119201192111922119231192411925119261192711928119291193011931119321193311934119351193611937119381193911940119411194211943119441194511946119471194811949119501195111952119531195411955119561195711958119591196011961119621196311964119651196611967119681196911970119711197211973119741197511976119771197811979119801198111982119831198411985119861198711988119891199011991119921199311994119951199611997119981199912000120011200212003120041200512006120071200812009120101201112012120131201412015120161201712018120191202012021120221202312024120251202612027120281202912030120311203212033120341203512036120371203812039120401204112042120431204412045120461204712048120491205012051120521205312054120551205612057120581205912060120611206212063120641206512066120671206812069120701207112072120731207412075120761207712078120791208012081120821208312084120851208612087120881208912090120911209212093120941209512096120971209812099121001210112102121031210412105121061210712108121091211012111121121211312114121151211612117121181211912120121211212212123121241212512126121271212812129121301213112132121331213412135121361213712138121391214012141121421214312144121451214612147121481214912150121511215212153121541215512156121571215812159121601216112162121631216412165121661216712168121691217012171121721217312174121751217612177121781217912180121811218212183121841218512186121871218812189121901219112192121931219412195121961219712198121991220012201122021220312204122051220612207122081220912210122111221212213122141221512216122171221812219122201222112222122231222412225122261222712228122291223012231122321223312234122351223612237122381223912240122411224212243122441224512246122471224812249122501225112252122531225412255122561225712258122591226012261122621226312264122651226612267122681226912270122711227212273122741227512276122771227812279122801228112282122831228412285122861228712288122891229012291122921229312294122951229612297122981229912300123011230212303123041230512306123071230812309123101231112312123131231412315123161231712318123191232012321123221232312324123251232612327123281232912330123311233212333123341233512336123371233812339123401234112342123431234412345123461234712348123491235012351123521235312354123551235612357123581235912360123611236212363123641236512366123671236812369123701237112372123731237412375123761237712378123791238012381123821238312384123851238612387123881238912390123911239212393123941239512396123971239812399124001240112402124031240412405124061240712408124091241012411124121241312414124151241612417124181241912420124211242212423124241242512426124271242812429124301243112432124331243412435124361243712438124391244012441124421244312444124451244612447124481244912450124511245212453124541245512456124571245812459124601246112462124631246412465124661246712468124691247012471124721247312474124751247612477124781247912480124811248212483124841248512486124871248812489124901249112492124931249412495124961249712498124991250012501125021250312504125051250612507125081250912510125111251212513125141251512516125171251812519125201252112522125231252412525125261252712528125291253012531125321253312534125351253612537125381253912540125411254212543125441254512546125471254812549125501255112552125531255412555125561255712558125591256012561125621256312564125651256612567125681256912570125711257212573125741257512576125771257812579125801258112582125831258412585125861258712588125891259012591125921259312594125951259612597125981259912600126011260212603126041260512606126071260812609126101261112612126131261412615126161261712618126191262012621126221262312624126251262612627126281262912630126311263212633126341263512636126371263812639126401264112642126431264412645126461264712648126491265012651126521265312654126551265612657126581265912660126611266212663126641266512666126671266812669126701267112672126731267412675126761267712678126791268012681126821268312684126851268612687126881268912690126911269212693126941269512696126971269812699127001270112702127031270412705127061270712708127091271012711127121271312714127151271612717127181271912720127211272212723127241272512726127271272812729127301273112732127331273412735127361273712738127391274012741127421274312744127451274612747127481274912750127511275212753127541275512756127571275812759127601276112762127631276412765127661276712768127691277012771127721277312774127751277612777127781277912780127811278212783127841278512786127871278812789127901279112792127931279412795127961279712798127991280012801128021280312804128051280612807128081280912810128111281212813128141281512816128171281812819128201282112822128231282412825128261282712828128291283012831128321283312834128351283612837128381283912840128411284212843128441284512846128471284812849128501285112852128531285412855128561285712858128591286012861128621286312864128651286612867128681286912870128711287212873128741287512876128771287812879128801288112882128831288412885128861288712888128891289012891128921289312894128951289612897128981289912900129011290212903129041290512906129071290812909129101291112912129131291412915129161291712918129191292012921129221292312924129251292612927129281292912930129311293212933129341293512936129371293812939129401294112942129431294412945129461294712948129491295012951129521295312954129551295612957129581295912960129611296212963129641296512966129671296812969129701297112972129731297412975129761297712978129791298012981129821298312984129851298612987129881298912990129911299212993129941299512996129971299812999130001300113002130031300413005130061300713008130091301013011130121301313014130151301613017130181301913020130211302213023130241302513026130271302813029130301303113032130331303413035130361303713038130391304013041130421304313044130451304613047130481304913050130511305213053130541305513056130571305813059130601306113062130631306413065130661306713068130691307013071130721307313074130751307613077130781307913080130811308213083130841308513086130871308813089130901309113092130931309413095130961309713098130991310013101131021310313104131051310613107131081310913110131111311213113131141311513116131171311813119131201312113122131231312413125131261312713128131291313013131131321313313134131351313613137131381313913140131411314213143131441314513146131471314813149131501315113152131531315413155131561315713158131591316013161131621316313164131651316613167131681316913170131711317213173131741317513176131771317813179131801318113182131831318413185131861318713188131891319013191131921319313194131951319613197131981319913200132011320213203132041320513206132071320813209132101321113212132131321413215132161321713218132191322013221132221322313224132251322613227132281322913230132311323213233132341323513236132371323813239132401324113242132431324413245132461324713248132491325013251132521325313254132551325613257132581325913260132611326213263132641326513266132671326813269132701327113272132731327413275132761327713278132791328013281132821328313284132851328613287132881328913290132911329213293132941329513296132971329813299133001330113302133031330413305133061330713308133091331013311133121331313314133151331613317133181331913320133211332213323133241332513326133271332813329133301333113332133331333413335133361333713338133391334013341133421334313344133451334613347133481334913350133511335213353133541335513356133571335813359133601336113362133631336413365133661336713368133691337013371133721337313374133751337613377133781337913380133811338213383133841338513386133871338813389133901339113392133931339413395133961339713398133991340013401134021340313404134051340613407134081340913410134111341213413134141341513416134171341813419134201342113422134231342413425134261342713428134291343013431134321343313434134351343613437134381343913440134411344213443134441344513446134471344813449134501345113452134531345413455134561345713458134591346013461134621346313464134651346613467134681346913470134711347213473134741347513476134771347813479134801348113482134831348413485134861348713488134891349013491134921349313494134951349613497134981349913500135011350213503135041350513506135071350813509135101351113512135131351413515135161351713518135191352013521135221352313524135251352613527135281352913530135311353213533135341353513536135371353813539135401354113542135431354413545135461354713548135491355013551135521355313554135551355613557135581355913560135611356213563135641356513566135671356813569135701357113572135731357413575135761357713578135791358013581135821358313584135851358613587135881358913590135911359213593135941359513596135971359813599136001360113602136031360413605136061360713608136091361013611136121361313614136151361613617136181361913620136211362213623136241362513626136271362813629136301363113632136331363413635136361363713638136391364013641136421364313644136451364613647136481364913650136511365213653136541365513656136571365813659136601366113662136631366413665136661366713668136691367013671136721367313674136751367613677136781367913680136811368213683136841368513686136871368813689136901369113692136931369413695136961369713698136991370013701137021370313704137051370613707137081370913710137111371213713137141371513716137171371813719137201372113722137231372413725137261372713728137291373013731137321373313734137351373613737137381373913740137411374213743137441374513746137471374813749137501375113752137531375413755137561375713758137591376013761137621376313764137651376613767137681376913770137711377213773137741377513776137771377813779137801378113782137831378413785137861378713788137891379013791137921379313794137951379613797137981379913800138011380213803138041380513806138071380813809138101381113812138131381413815138161381713818138191382013821138221382313824138251382613827138281382913830138311383213833138341383513836138371383813839138401384113842138431384413845138461384713848138491385013851138521385313854138551385613857138581385913860138611386213863138641386513866138671386813869138701387113872138731387413875138761387713878138791388013881138821388313884138851388613887138881388913890138911389213893138941389513896138971389813899139001390113902139031390413905139061390713908139091391013911139121391313914139151391613917139181391913920139211392213923139241392513926139271392813929139301393113932139331393413935139361393713938139391394013941139421394313944139451394613947139481394913950139511395213953139541395513956139571395813959139601396113962139631396413965139661396713968139691397013971139721397313974139751397613977139781397913980139811398213983139841398513986139871398813989139901399113992139931399413995139961399713998139991400014001140021400314004140051400614007140081400914010140111401214013140141401514016140171401814019140201402114022140231402414025140261402714028140291403014031140321403314034140351403614037140381403914040140411404214043140441404514046140471404814049140501405114052140531405414055140561405714058140591406014061140621406314064140651406614067140681406914070140711407214073140741407514076140771407814079140801408114082140831408414085140861408714088140891409014091140921409314094140951409614097140981409914100141011410214103141041410514106141071410814109141101411114112141131411414115141161411714118141191412014121141221412314124141251412614127141281412914130141311413214133141341413514136141371413814139141401414114142141431414414145141461414714148141491415014151141521415314154141551415614157141581415914160141611416214163141641416514166141671416814169141701417114172141731417414175141761417714178141791418014181141821418314184141851418614187141881418914190141911419214193141941419514196141971419814199142001420114202142031420414205142061420714208142091421014211142121421314214142151421614217142181421914220142211422214223142241422514226142271422814229142301423114232142331423414235142361423714238142391424014241142421424314244142451424614247142481424914250142511425214253142541425514256142571425814259142601426114262142631426414265142661426714268142691427014271142721427314274142751427614277142781427914280142811428214283142841428514286142871428814289142901429114292142931429414295142961429714298142991430014301143021430314304143051430614307143081430914310143111431214313143141431514316143171431814319143201432114322143231432414325143261432714328143291433014331143321433314334143351433614337143381433914340143411434214343143441434514346143471434814349143501435114352143531435414355143561435714358143591436014361143621436314364143651436614367143681436914370143711437214373143741437514376143771437814379143801438114382143831438414385143861438714388143891439014391143921439314394143951439614397143981439914400144011440214403144041440514406144071440814409144101441114412144131441414415144161441714418144191442014421144221442314424144251442614427144281442914430144311443214433144341443514436144371443814439144401444114442144431444414445144461444714448144491445014451144521445314454144551445614457144581445914460144611446214463144641446514466144671446814469144701447114472144731447414475144761447714478144791448014481144821448314484144851448614487144881448914490144911449214493144941449514496144971449814499145001450114502145031450414505145061450714508145091451014511145121451314514145151451614517145181451914520145211452214523145241452514526145271452814529145301453114532145331453414535145361453714538145391454014541145421454314544145451454614547145481454914550145511455214553145541455514556145571455814559145601456114562145631456414565145661456714568145691457014571145721457314574145751457614577145781457914580145811458214583145841458514586145871458814589145901459114592145931459414595145961459714598145991460014601146021460314604146051460614607146081460914610146111461214613146141461514616146171461814619146201462114622146231462414625146261462714628146291463014631146321463314634146351463614637146381463914640146411464214643146441464514646146471464814649146501465114652146531465414655146561465714658146591466014661146621466314664146651466614667146681466914670146711467214673146741467514676146771467814679146801468114682146831468414685146861468714688146891469014691146921469314694146951469614697146981469914700147011470214703147041470514706147071470814709147101471114712147131471414715147161471714718147191472014721147221472314724147251472614727147281472914730147311473214733147341473514736147371473814739147401474114742147431474414745147461474714748147491475014751147521475314754147551475614757147581475914760147611476214763147641476514766147671476814769147701477114772147731477414775147761477714778147791478014781147821478314784147851478614787147881478914790147911479214793147941479514796147971479814799148001480114802148031480414805148061480714808148091481014811148121481314814148151481614817148181481914820148211482214823148241482514826148271482814829148301483114832148331483414835148361483714838148391484014841148421484314844148451484614847148481484914850148511485214853148541485514856148571485814859148601486114862148631486414865148661486714868148691487014871148721487314874148751487614877148781487914880148811488214883148841488514886148871488814889148901489114892148931489414895148961489714898148991490014901149021490314904149051490614907149081490914910149111491214913149141491514916149171491814919149201492114922149231492414925149261492714928149291493014931149321493314934149351493614937149381493914940149411494214943149441494514946149471494814949149501495114952149531495414955149561495714958149591496014961149621496314964149651496614967149681496914970149711497214973149741497514976149771497814979149801498114982149831498414985149861498714988149891499014991149921499314994149951499614997149981499915000150011500215003150041500515006150071500815009150101501115012150131501415015150161501715018150191502015021150221502315024150251502615027150281502915030150311503215033150341503515036150371503815039150401504115042150431504415045150461504715048150491505015051150521505315054150551505615057150581505915060150611506215063150641506515066150671506815069150701507115072150731507415075150761507715078150791508015081150821508315084150851508615087150881508915090150911509215093150941509515096150971509815099151001510115102151031510415105151061510715108151091511015111151121511315114151151511615117151181511915120151211512215123151241512515126151271512815129151301513115132151331513415135151361513715138151391514015141151421514315144151451514615147151481514915150151511515215153151541515515156151571515815159151601516115162151631516415165151661516715168151691517015171151721517315174151751517615177151781517915180151811518215183151841518515186151871518815189151901519115192151931519415195151961519715198151991520015201152021520315204152051520615207152081520915210152111521215213152141521515216152171521815219152201522115222152231522415225152261522715228152291523015231152321523315234152351523615237152381523915240152411524215243152441524515246152471524815249152501525115252152531525415255152561525715258152591526015261152621526315264152651526615267152681526915270152711527215273152741527515276152771527815279152801528115282152831528415285152861528715288152891529015291152921529315294152951529615297152981529915300153011530215303153041530515306153071530815309153101531115312153131531415315153161531715318153191532015321153221532315324153251532615327153281532915330153311533215333153341533515336153371533815339153401534115342153431534415345153461534715348153491535015351153521535315354153551535615357153581535915360153611536215363153641536515366153671536815369153701537115372153731537415375153761537715378153791538015381153821538315384153851538615387153881538915390153911539215393153941539515396153971539815399154001540115402154031540415405154061540715408154091541015411154121541315414154151541615417154181541915420154211542215423154241542515426154271542815429154301543115432154331543415435154361543715438154391544015441154421544315444154451544615447154481544915450154511545215453154541545515456154571545815459154601546115462154631546415465154661546715468154691547015471154721547315474154751547615477154781547915480154811548215483154841548515486154871548815489154901549115492154931549415495154961549715498154991550015501155021550315504155051550615507155081550915510155111551215513155141551515516155171551815519155201552115522155231552415525155261552715528155291553015531155321553315534155351553615537155381553915540155411554215543155441554515546155471554815549155501555115552155531555415555155561555715558155591556015561155621556315564155651556615567155681556915570155711557215573155741557515576155771557815579155801558115582155831558415585155861558715588155891559015591155921559315594155951559615597155981559915600156011560215603156041560515606156071560815609156101561115612156131561415615156161561715618156191562015621156221562315624156251562615627156281562915630156311563215633156341563515636156371563815639156401564115642156431564415645156461564715648156491565015651156521565315654156551565615657156581565915660156611566215663156641566515666156671566815669156701567115672156731567415675156761567715678156791568015681156821568315684156851568615687156881568915690156911569215693156941569515696156971569815699157001570115702157031570415705157061570715708157091571015711157121571315714157151571615717157181571915720157211572215723157241572515726157271572815729157301573115732157331573415735157361573715738157391574015741157421574315744157451574615747157481574915750157511575215753157541575515756157571575815759157601576115762157631576415765157661576715768157691577015771157721577315774157751577615777157781577915780157811578215783157841578515786157871578815789157901579115792157931579415795157961579715798157991580015801158021580315804158051580615807158081580915810158111581215813158141581515816158171581815819158201582115822158231582415825158261582715828158291583015831158321583315834158351583615837158381583915840158411584215843158441584515846158471584815849158501585115852158531585415855158561585715858158591586015861158621586315864158651586615867158681586915870158711587215873158741587515876158771587815879158801588115882158831588415885158861588715888158891589015891158921589315894158951589615897158981589915900159011590215903159041590515906159071590815909159101591115912159131591415915159161591715918159191592015921159221592315924159251592615927159281592915930159311593215933159341593515936159371593815939159401594115942159431594415945159461594715948159491595015951159521595315954159551595615957159581595915960159611596215963159641596515966159671596815969159701597115972159731597415975159761597715978159791598015981159821598315984159851598615987159881598915990159911599215993159941599515996159971599815999160001600116002160031600416005160061600716008160091601016011160121601316014160151601616017160181601916020160211602216023160241602516026160271602816029160301603116032160331603416035160361603716038160391604016041160421604316044160451604616047160481604916050160511605216053160541605516056160571605816059160601606116062160631606416065160661606716068160691607016071160721607316074160751607616077160781607916080160811608216083160841608516086160871608816089160901609116092160931609416095160961609716098160991610016101161021610316104161051610616107161081610916110161111611216113161141611516116161171611816119161201612116122161231612416125161261612716128161291613016131161321613316134161351613616137161381613916140161411614216143161441614516146161471614816149161501615116152161531615416155161561615716158161591616016161161621616316164161651616616167161681616916170161711617216173161741617516176161771617816179161801618116182161831618416185161861618716188161891619016191161921619316194161951619616197161981619916200162011620216203162041620516206162071620816209162101621116212162131621416215162161621716218162191622016221162221622316224162251622616227162281622916230162311623216233162341623516236162371623816239162401624116242162431624416245162461624716248162491625016251162521625316254162551625616257162581625916260162611626216263162641626516266162671626816269162701627116272162731627416275162761627716278162791628016281162821628316284162851628616287162881628916290162911629216293162941629516296162971629816299163001630116302163031630416305163061630716308163091631016311163121631316314163151631616317163181631916320163211632216323163241632516326163271632816329163301633116332163331633416335163361633716338163391634016341163421634316344163451634616347163481634916350163511635216353163541635516356163571635816359163601636116362163631636416365163661636716368163691637016371163721637316374163751637616377163781637916380163811638216383163841638516386163871638816389163901639116392163931639416395163961639716398163991640016401164021640316404164051640616407164081640916410164111641216413164141641516416164171641816419164201642116422164231642416425164261642716428164291643016431164321643316434164351643616437164381643916440164411644216443164441644516446164471644816449164501645116452164531645416455164561645716458164591646016461164621646316464164651646616467164681646916470164711647216473164741647516476164771647816479164801648116482164831648416485164861648716488164891649016491164921649316494164951649616497164981649916500165011650216503165041650516506165071650816509165101651116512165131651416515165161651716518165191652016521165221652316524165251652616527165281652916530165311653216533165341653516536165371653816539165401654116542165431654416545165461654716548165491655016551165521655316554165551655616557165581655916560165611656216563165641656516566165671656816569165701657116572165731657416575165761657716578165791658016581165821658316584165851658616587165881658916590165911659216593165941659516596165971659816599166001660116602166031660416605166061660716608166091661016611166121661316614166151661616617166181661916620166211662216623166241662516626166271662816629166301663116632166331663416635166361663716638166391664016641166421664316644166451664616647166481664916650166511665216653166541665516656166571665816659166601666116662166631666416665166661666716668166691667016671166721667316674166751667616677166781667916680166811668216683166841668516686166871668816689166901669116692166931669416695166961669716698166991670016701167021670316704167051670616707167081670916710167111671216713167141671516716167171671816719167201672116722167231672416725167261672716728167291673016731167321673316734167351673616737167381673916740167411674216743167441674516746167471674816749167501675116752167531675416755167561675716758167591676016761167621676316764167651676616767167681676916770167711677216773167741677516776167771677816779167801678116782167831678416785167861678716788167891679016791167921679316794167951679616797167981679916800168011680216803168041680516806168071680816809168101681116812168131681416815168161681716818168191682016821168221682316824168251682616827168281682916830168311683216833168341683516836168371683816839168401684116842168431684416845168461684716848168491685016851168521685316854168551685616857168581685916860168611686216863168641686516866168671686816869168701687116872168731687416875168761687716878168791688016881168821688316884168851688616887168881688916890168911689216893168941689516896168971689816899169001690116902169031690416905169061690716908169091691016911169121691316914169151691616917169181691916920169211692216923169241692516926169271692816929169301693116932169331693416935169361693716938169391694016941169421694316944169451694616947169481694916950169511695216953169541695516956169571695816959169601696116962169631696416965169661696716968169691697016971169721697316974169751697616977169781697916980169811698216983169841698516986169871698816989169901699116992169931699416995169961699716998169991700017001170021700317004170051700617007170081700917010170111701217013170141701517016170171701817019170201702117022170231702417025170261702717028170291703017031170321703317034170351703617037170381703917040170411704217043170441704517046170471704817049170501705117052170531705417055170561705717058170591706017061170621706317064170651706617067170681706917070170711707217073170741707517076170771707817079170801708117082170831708417085170861708717088170891709017091170921709317094170951709617097170981709917100171011710217103171041710517106171071710817109171101711117112171131711417115171161711717118171191712017121171221712317124171251712617127171281712917130171311713217133171341713517136171371713817139171401714117142171431714417145171461714717148171491715017151171521715317154171551715617157171581715917160171611716217163171641716517166171671716817169171701717117172171731717417175171761717717178171791718017181171821718317184171851718617187171881718917190171911719217193171941719517196171971719817199172001720117202172031720417205172061720717208172091721017211172121721317214172151721617217172181721917220172211722217223172241722517226172271722817229172301723117232172331723417235172361723717238172391724017241172421724317244172451724617247172481724917250172511725217253172541725517256172571725817259172601726117262172631726417265172661726717268172691727017271172721727317274172751727617277172781727917280172811728217283172841728517286172871728817289172901729117292172931729417295172961729717298172991730017301173021730317304173051730617307173081730917310173111731217313173141731517316173171731817319173201732117322173231732417325173261732717328173291733017331173321733317334173351733617337173381733917340173411734217343173441734517346173471734817349173501735117352173531735417355173561735717358173591736017361173621736317364173651736617367173681736917370173711737217373173741737517376173771737817379173801738117382173831738417385173861738717388173891739017391173921739317394173951739617397173981739917400174011740217403174041740517406174071740817409174101741117412174131741417415174161741717418174191742017421174221742317424174251742617427174281742917430174311743217433174341743517436174371743817439174401744117442174431744417445174461744717448174491745017451174521745317454174551745617457174581745917460174611746217463174641746517466174671746817469174701747117472174731747417475174761747717478174791748017481174821748317484174851748617487174881748917490174911749217493174941749517496174971749817499175001750117502175031750417505175061750717508175091751017511175121751317514175151751617517175181751917520175211752217523175241752517526175271752817529175301753117532175331753417535175361753717538175391754017541175421754317544175451754617547175481754917550175511755217553175541755517556175571755817559175601756117562175631756417565175661756717568175691757017571175721757317574175751757617577175781757917580175811758217583175841758517586175871758817589175901759117592175931759417595175961759717598175991760017601176021760317604176051760617607176081760917610176111761217613176141761517616176171761817619176201762117622176231762417625176261762717628176291763017631176321763317634176351763617637176381763917640176411764217643176441764517646176471764817649176501765117652176531765417655176561765717658176591766017661176621766317664176651766617667176681766917670176711767217673176741767517676176771767817679176801768117682176831768417685176861768717688176891769017691176921769317694176951769617697176981769917700177011770217703177041770517706177071770817709177101771117712177131771417715177161771717718177191772017721177221772317724177251772617727177281772917730177311773217733177341773517736177371773817739177401774117742177431774417745177461774717748177491775017751177521775317754177551775617757177581775917760177611776217763177641776517766177671776817769177701777117772177731777417775177761777717778177791778017781177821778317784177851778617787177881778917790177911779217793177941779517796177971779817799178001780117802178031780417805178061780717808178091781017811178121781317814178151781617817178181781917820178211782217823178241782517826178271782817829178301783117832178331783417835178361783717838178391784017841178421784317844178451784617847178481784917850178511785217853178541785517856178571785817859178601786117862178631786417865178661786717868178691787017871178721787317874178751787617877178781787917880178811788217883178841788517886178871788817889178901789117892178931789417895178961789717898178991790017901179021790317904179051790617907179081790917910179111791217913179141791517916179171791817919179201792117922179231792417925179261792717928179291793017931179321793317934179351793617937179381793917940179411794217943179441794517946179471794817949179501795117952179531795417955179561795717958179591796017961179621796317964179651796617967179681796917970179711797217973179741797517976179771797817979179801798117982179831798417985179861798717988179891799017991179921799317994179951799617997179981799918000180011800218003180041800518006180071800818009180101801118012180131801418015180161801718018180191802018021180221802318024180251802618027180281802918030180311803218033180341803518036180371803818039180401804118042180431804418045180461804718048180491805018051180521805318054180551805618057180581805918060180611806218063180641806518066180671806818069180701807118072180731807418075180761807718078180791808018081180821808318084180851808618087180881808918090180911809218093180941809518096180971809818099181001810118102181031810418105181061810718108181091811018111181121811318114181151811618117181181811918120181211812218123181241812518126181271812818129181301813118132181331813418135181361813718138181391814018141181421814318144181451814618147181481814918150181511815218153181541815518156181571815818159181601816118162181631816418165181661816718168181691817018171181721817318174181751817618177181781817918180181811818218183181841818518186181871818818189181901819118192181931819418195181961819718198181991820018201182021820318204182051820618207182081820918210182111821218213182141821518216182171821818219182201822118222182231822418225182261822718228182291823018231182321823318234182351823618237182381823918240182411824218243182441824518246182471824818249182501825118252182531825418255182561825718258182591826018261182621826318264182651826618267182681826918270182711827218273182741827518276182771827818279182801828118282182831828418285182861828718288182891829018291182921829318294182951829618297182981829918300183011830218303183041830518306183071830818309183101831118312183131831418315183161831718318183191832018321183221832318324183251832618327183281832918330183311833218333183341833518336183371833818339183401834118342183431834418345183461834718348183491835018351183521835318354183551835618357183581835918360183611836218363183641836518366183671836818369183701837118372183731837418375183761837718378183791838018381183821838318384183851838618387183881838918390183911839218393183941839518396183971839818399184001840118402184031840418405184061840718408184091841018411184121841318414184151841618417184181841918420184211842218423184241842518426184271842818429184301843118432184331843418435184361843718438184391844018441184421844318444184451844618447184481844918450184511845218453184541845518456184571845818459184601846118462184631846418465184661846718468184691847018471184721847318474184751847618477184781847918480184811848218483184841848518486184871848818489184901849118492184931849418495184961849718498184991850018501185021850318504185051850618507185081850918510185111851218513185141851518516185171851818519185201852118522185231852418525185261852718528185291853018531185321853318534185351853618537185381853918540185411854218543185441854518546185471854818549185501855118552185531855418555185561855718558185591856018561185621856318564185651856618567185681856918570185711857218573185741857518576185771857818579185801858118582185831858418585185861858718588185891859018591185921859318594185951859618597185981859918600186011860218603186041860518606186071860818609186101861118612186131861418615186161861718618186191862018621186221862318624186251862618627186281862918630186311863218633186341863518636186371863818639186401864118642186431864418645186461864718648186491865018651186521865318654186551865618657186581865918660186611866218663186641866518666186671866818669186701867118672186731867418675186761867718678186791868018681186821868318684186851868618687186881868918690186911869218693186941869518696186971869818699187001870118702187031870418705187061870718708187091871018711187121871318714187151871618717187181871918720187211872218723187241872518726187271872818729187301873118732187331873418735187361873718738187391874018741187421874318744187451874618747187481874918750187511875218753187541875518756187571875818759187601876118762187631876418765187661876718768187691877018771187721877318774187751877618777187781877918780187811878218783187841878518786187871878818789187901879118792187931879418795187961879718798187991880018801188021880318804188051880618807188081880918810188111881218813188141881518816188171881818819188201882118822188231882418825188261882718828188291883018831188321883318834188351883618837188381883918840188411884218843188441884518846188471884818849188501885118852188531885418855188561885718858188591886018861188621886318864188651886618867188681886918870188711887218873188741887518876188771887818879188801888118882188831888418885188861888718888188891889018891188921889318894188951889618897188981889918900189011890218903189041890518906189071890818909189101891118912189131891418915189161891718918189191892018921189221892318924189251892618927189281892918930189311893218933189341893518936189371893818939189401894118942189431894418945189461894718948189491895018951189521895318954189551895618957189581895918960189611896218963189641896518966189671896818969189701897118972189731897418975189761897718978189791898018981189821898318984189851898618987189881898918990189911899218993189941899518996189971899818999190001900119002190031900419005190061900719008190091901019011190121901319014190151901619017190181901919020190211902219023190241902519026190271902819029190301903119032190331903419035190361903719038190391904019041190421904319044190451904619047190481904919050190511905219053190541905519056190571905819059190601906119062190631906419065190661906719068190691907019071190721907319074190751907619077190781907919080190811908219083190841908519086190871908819089190901909119092190931909419095190961909719098190991910019101191021910319104191051910619107191081910919110191111911219113191141911519116191171911819119191201912119122191231912419125191261912719128191291913019131191321913319134191351913619137191381913919140191411914219143191441914519146191471914819149191501915119152191531915419155191561915719158191591916019161191621916319164191651916619167191681916919170191711917219173191741917519176191771917819179191801918119182191831918419185191861918719188191891919019191191921919319194191951919619197191981919919200192011920219203192041920519206192071920819209192101921119212192131921419215
  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/AppSidebar.vue?vue&type=script&setup=true&lang=js":
  104. /*!***************************************************************************************************************************************************************************************************************!*\
  105. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppSidebar.vue?vue&type=script&setup=true&lang=js ***!
  106. \***************************************************************************************************************************************************************************************************************/
  107. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  108. "use strict";
  109. __webpack_require__.r(__webpack_exports__);
  110. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  111. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  112. /* harmony export */ });
  113. /* harmony import */ var _components_AppSubSidebar_vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @/components/AppSubSidebar.vue */ "./resources/js/components/AppSubSidebar.vue");
  114. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
  115. __name: 'AppSidebar',
  116. props: {
  117. menu: Array
  118. },
  119. setup: function setup(__props, _ref) {
  120. var expose = _ref.expose;
  121. expose();
  122. var __returned__ = {
  123. AppSubSidebar: _components_AppSubSidebar_vue__WEBPACK_IMPORTED_MODULE_0__["default"]
  124. };
  125. Object.defineProperty(__returned__, '__isScriptSetup', {
  126. enumerable: false,
  127. value: true
  128. });
  129. return __returned__;
  130. }
  131. });
  132. /***/ }),
  133. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppSubSidebar.vue?vue&type=script&setup=true&lang=js":
  134. /*!******************************************************************************************************************************************************************************************************************!*\
  135. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppSubSidebar.vue?vue&type=script&setup=true&lang=js ***!
  136. \******************************************************************************************************************************************************************************************************************/
  137. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  138. "use strict";
  139. __webpack_require__.r(__webpack_exports__);
  140. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  141. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  142. /* harmony export */ });
  143. /* harmony import */ var _inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @inertiajs/inertia-vue3 */ "./node_modules/@inertiajs/inertia-vue3/dist/index.js");
  144. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
  145. __name: 'AppSubSidebar',
  146. props: {
  147. items: Array,
  148. root: {
  149. type: Boolean,
  150. "default": false
  151. }
  152. },
  153. setup: function setup(__props, _ref) {
  154. var expose = _ref.expose;
  155. expose();
  156. var __returned__ = {
  157. Link: _inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_0__.Link
  158. };
  159. Object.defineProperty(__returned__, '__isScriptSetup', {
  160. enumerable: false,
  161. value: true
  162. });
  163. return __returned__;
  164. }
  165. });
  166. /***/ }),
  167. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppTopBar.vue?vue&type=script&setup=true&lang=js":
  168. /*!**************************************************************************************************************************************************************************************************************!*\
  169. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppTopBar.vue?vue&type=script&setup=true&lang=js ***!
  170. \**************************************************************************************************************************************************************************************************************/
  171. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  172. "use strict";
  173. __webpack_require__.r(__webpack_exports__);
  174. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  175. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  176. /* harmony export */ });
  177. /* harmony import */ var _inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @inertiajs/inertia-vue3 */ "./node_modules/@inertiajs/inertia-vue3/dist/index.js");
  178. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
  179. __name: 'AppTopBar',
  180. emits: ['menu-toggle'],
  181. setup: function setup(__props, _ref) {
  182. var expose = _ref.expose;
  183. expose();
  184. var __returned__ = {
  185. Link: _inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_0__.Link
  186. };
  187. Object.defineProperty(__returned__, '__isScriptSetup', {
  188. enumerable: false,
  189. value: true
  190. });
  191. return __returned__;
  192. }
  193. });
  194. /***/ }),
  195. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/layouts/DashboardLayout.vue?vue&type=script&setup=true&lang=js":
  196. /*!*****************************************************************************************************************************************************************************************************************!*\
  197. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/layouts/DashboardLayout.vue?vue&type=script&setup=true&lang=js ***!
  198. \*****************************************************************************************************************************************************************************************************************/
  199. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  200. "use strict";
  201. __webpack_require__.r(__webpack_exports__);
  202. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  203. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  204. /* harmony export */ });
  205. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  206. /* harmony import */ var _components_AppTopBar_vue__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @/components/AppTopBar.vue */ "./resources/js/components/AppTopBar.vue");
  207. /* harmony import */ var _components_AppSidebar_vue__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @/components/AppSidebar.vue */ "./resources/js/components/AppSidebar.vue");
  208. /* harmony import */ var _components_AppMessage_vue__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @/components/AppMessage.vue */ "./resources/js/components/AppMessage.vue");
  209. /* harmony import */ var _utils_menu__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @/utils/menu */ "./resources/js/utils/menu.js");
  210. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
  211. __name: 'DashboardLayout',
  212. setup: function setup(__props, _ref) {
  213. var expose = _ref.expose;
  214. expose();
  215. var mobileMenuActive = (0,vue__WEBPACK_IMPORTED_MODULE_0__.ref)(false);
  216. var staticMenuInactive = (0,vue__WEBPACK_IMPORTED_MODULE_0__.ref)(false);
  217. var menuClick = (0,vue__WEBPACK_IMPORTED_MODULE_0__.ref)(false);
  218. var isDesktop = function isDesktop() {
  219. return window.innerWidth >= 992;
  220. };
  221. var containerClass = (0,vue__WEBPACK_IMPORTED_MODULE_0__.computed)(function () {
  222. return ['layout-wrapper', {
  223. 'layout-static-sidebar-inactive': staticMenuInactive.value,
  224. 'layout-mobile-sidebar-active': mobileMenuActive.value
  225. }];
  226. });
  227. var onWrapperClick = function onWrapperClick() {
  228. if (!menuClick.value) {
  229. mobileMenuActive.value = false;
  230. }
  231. menuClick.value = false;
  232. };
  233. var onMenuToggle = function onMenuToggle(event) {
  234. menuClick.value = true;
  235. if (isDesktop()) {
  236. staticMenuInactive.value = !staticMenuInactive.value;
  237. } else {
  238. mobileMenuActive.value = !mobileMenuActive.value;
  239. }
  240. event.preventDefault();
  241. };
  242. var __returned__ = {
  243. mobileMenuActive: mobileMenuActive,
  244. staticMenuInactive: staticMenuInactive,
  245. menuClick: menuClick,
  246. isDesktop: isDesktop,
  247. containerClass: containerClass,
  248. onWrapperClick: onWrapperClick,
  249. onMenuToggle: onMenuToggle,
  250. ref: vue__WEBPACK_IMPORTED_MODULE_0__.ref,
  251. computed: vue__WEBPACK_IMPORTED_MODULE_0__.computed,
  252. AppTopBar: _components_AppTopBar_vue__WEBPACK_IMPORTED_MODULE_1__["default"],
  253. AppSidebar: _components_AppSidebar_vue__WEBPACK_IMPORTED_MODULE_2__["default"],
  254. AppMessage: _components_AppMessage_vue__WEBPACK_IMPORTED_MODULE_3__["default"],
  255. menu: _utils_menu__WEBPACK_IMPORTED_MODULE_4__["default"]
  256. };
  257. Object.defineProperty(__returned__, '__isScriptSetup', {
  258. enumerable: false,
  259. value: true
  260. });
  261. return __returned__;
  262. }
  263. });
  264. /***/ }),
  265. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/pages/Users/Index.vue?vue&type=script&setup=true&lang=js":
  266. /*!***********************************************************************************************************************************************************************************************************!*\
  267. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/pages/Users/Index.vue?vue&type=script&setup=true&lang=js ***!
  268. \***********************************************************************************************************************************************************************************************************/
  269. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  270. "use strict";
  271. __webpack_require__.r(__webpack_exports__);
  272. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  273. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  274. /* harmony export */ });
  275. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  276. /* harmony import */ var _inertiajs_inertia__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @inertiajs/inertia */ "./node_modules/@inertiajs/inertia/dist/index.js");
  277. /* harmony import */ var _inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @inertiajs/inertia-vue3 */ "./node_modules/@inertiajs/inertia-vue3/dist/index.js");
  278. /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! lodash */ "./node_modules/lodash/lodash.js");
  279. /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_3__);
  280. /* harmony import */ var primevue_useconfirm__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! primevue/useconfirm */ "./node_modules/primevue/useconfirm/useconfirm.esm.js");
  281. /* harmony import */ var _tableHeader__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./tableHeader */ "./resources/js/pages/Users/tableHeader.js");
  282. /* harmony import */ var _components_useSearchText__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @/components/useSearchText */ "./resources/js/components/useSearchText.js");
  283. /* harmony import */ var _layouts_DashboardLayout_vue__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @/layouts/DashboardLayout.vue */ "./resources/js/layouts/DashboardLayout.vue");
  284. /* harmony import */ var _components_AppButtonLink_vue__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @/components/AppButtonLink.vue */ "./resources/js/components/AppButtonLink.vue");
  285. /* harmony import */ var _components_AppPagination_vue__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @/components/AppPagination.vue */ "./resources/js/components/AppPagination.vue");
  286. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
  287. __name: 'Index',
  288. props: {
  289. users: Object,
  290. initialSearch: String
  291. },
  292. setup: function setup(__props, _ref) {
  293. var expose = _ref.expose;
  294. expose();
  295. var props = __props;
  296. var _useSearchText = (0,_components_useSearchText__WEBPACK_IMPORTED_MODULE_6__.useSearchText)(props),
  297. search = _useSearchText.search;
  298. (0,vue__WEBPACK_IMPORTED_MODULE_0__.watch)(search, function () {
  299. _inertiajs_inertia__WEBPACK_IMPORTED_MODULE_1__.Inertia.get('/users', (0,lodash__WEBPACK_IMPORTED_MODULE_3__.pickBy)({
  300. search: search.value
  301. }), {
  302. preserveState: true
  303. });
  304. });
  305. var resetConfirm = (0,primevue_useconfirm__WEBPACK_IMPORTED_MODULE_4__.useConfirm)();
  306. var onResetPassword = function onResetPassword(data) {
  307. resetConfirm.require({
  308. message: "Yakin mereset kata sandi (".concat(data.name, ") ?"),
  309. header: 'Reset Kata Sandi',
  310. acceptLabel: 'Iya',
  311. rejectLabel: 'Tidak',
  312. accept: function accept() {
  313. _inertiajs_inertia__WEBPACK_IMPORTED_MODULE_1__.Inertia.put(route('users.reset-password', data.id));
  314. },
  315. reject: function reject() {
  316. resetConfirm.close();
  317. }
  318. });
  319. };
  320. var __returned__ = {
  321. props: props,
  322. search: search,
  323. resetConfirm: resetConfirm,
  324. onResetPassword: onResetPassword,
  325. watch: vue__WEBPACK_IMPORTED_MODULE_0__.watch,
  326. Inertia: _inertiajs_inertia__WEBPACK_IMPORTED_MODULE_1__.Inertia,
  327. Head: _inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_2__.Head,
  328. pickBy: lodash__WEBPACK_IMPORTED_MODULE_3__.pickBy,
  329. useConfirm: primevue_useconfirm__WEBPACK_IMPORTED_MODULE_4__.useConfirm,
  330. tableHeader: _tableHeader__WEBPACK_IMPORTED_MODULE_5__["default"],
  331. useSearchText: _components_useSearchText__WEBPACK_IMPORTED_MODULE_6__.useSearchText,
  332. DashboardLayout: _layouts_DashboardLayout_vue__WEBPACK_IMPORTED_MODULE_7__["default"],
  333. AppButtonLink: _components_AppButtonLink_vue__WEBPACK_IMPORTED_MODULE_8__["default"],
  334. AppPagination: _components_AppPagination_vue__WEBPACK_IMPORTED_MODULE_9__["default"]
  335. };
  336. Object.defineProperty(__returned__, '__isScriptSetup', {
  337. enumerable: false,
  338. value: true
  339. });
  340. return __returned__;
  341. }
  342. });
  343. /***/ }),
  344. /***/ "./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":
  345. /*!***********************************************************************************************************************************************************************************************************************************************************************************!*\
  346. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppButtonLink.vue?vue&type=template&id=c3621f1c ***!
  347. \***********************************************************************************************************************************************************************************************************************************************************************************/
  348. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  349. "use strict";
  350. __webpack_require__.r(__webpack_exports__);
  351. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  352. /* harmony export */ "render": () => (/* binding */ render)
  353. /* harmony export */ });
  354. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  355. var _hoisted_1 = {
  356. key: 1,
  357. "class": "p-button-label"
  358. };
  359. var _hoisted_2 = {
  360. key: 1,
  361. "class": "p-button p-component"
  362. };
  363. var _hoisted_3 = {
  364. key: 1,
  365. "class": "p-button-label"
  366. };
  367. function render(_ctx, _cache, $props, $setup, $data, $options) {
  368. return $props.inertiaLink ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createBlock)($setup["Link"], {
  369. key: 0,
  370. "class": "p-button p-component",
  371. as: "button",
  372. type: "button"
  373. }, {
  374. "default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  375. return [$props.icon ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)("span", {
  376. key: 0,
  377. "class": (0,vue__WEBPACK_IMPORTED_MODULE_0__.normalizeClass)(["p-button-icon p-button-icon-left", $props.icon])
  378. }, null, 2
  379. /* CLASS */
  380. )) : (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
  381. /* TEXT */
  382. )) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true)];
  383. }),
  384. _: 1
  385. /* STABLE */
  386. })) : ((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", {
  387. key: 0,
  388. "class": (0,vue__WEBPACK_IMPORTED_MODULE_0__.normalizeClass)(["p-button-icon p-button-icon-left", $props.icon])
  389. }, null, 2
  390. /* CLASS */
  391. )) : (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
  392. /* TEXT */
  393. )) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true)]));
  394. }
  395. /***/ }),
  396. /***/ "./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":
  397. /*!********************************************************************************************************************************************************************************************************************************************************************************!*\
  398. !*** ./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 ***!
  399. \********************************************************************************************************************************************************************************************************************************************************************************/
  400. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  401. "use strict";
  402. __webpack_require__.r(__webpack_exports__);
  403. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  404. /* harmony export */ "render": () => (/* binding */ render)
  405. /* harmony export */ });
  406. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  407. var _hoisted_1 = {
  408. key: 0
  409. };
  410. var _hoisted_2 = {
  411. key: 1
  412. };
  413. function render(_ctx, _cache, $props, $setup, $data, $options) {
  414. var _component_Message = (0,vue__WEBPACK_IMPORTED_MODULE_0__.resolveComponent)("Message");
  415. 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, {
  416. key: 0,
  417. severity: "success",
  418. onClose: $setup.onClose
  419. }, {
  420. "default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  421. return [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createTextVNode)((0,vue__WEBPACK_IMPORTED_MODULE_0__.toDisplayString)(_ctx.$page.props.flash.success), 1
  422. /* TEXT */
  423. )];
  424. }),
  425. _: 1
  426. /* STABLE */
  427. })) : (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, {
  428. key: 1,
  429. severity: "error",
  430. onClose: $setup.onClose
  431. }, {
  432. "default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  433. return [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createTextVNode)((0,vue__WEBPACK_IMPORTED_MODULE_0__.toDisplayString)(_ctx.$page.props.flash.error), 1
  434. /* TEXT */
  435. )];
  436. }),
  437. _: 1
  438. /* STABLE */
  439. })) : (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, {
  440. key: 2,
  441. severity: "error",
  442. onClose: $setup.onClose
  443. }, {
  444. "default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  445. 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
  446. /* TEXT */
  447. ))];
  448. }),
  449. _: 1
  450. /* STABLE */
  451. })) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true)], 64
  452. /* STABLE_FRAGMENT */
  453. );
  454. }
  455. /***/ }),
  456. /***/ "./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":
  457. /*!***********************************************************************************************************************************************************************************************************************************************************************************!*\
  458. !*** ./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 ***!
  459. \***********************************************************************************************************************************************************************************************************************************************************************************/
  460. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  461. "use strict";
  462. __webpack_require__.r(__webpack_exports__);
  463. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  464. /* harmony export */ "render": () => (/* binding */ render)
  465. /* harmony export */ });
  466. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  467. var _hoisted_1 = {
  468. key: 0,
  469. "class": "p-paginator p-component flex justify-content-start"
  470. };
  471. var _hoisted_2 = {
  472. "class": "p-paginator-pages"
  473. };
  474. var _hoisted_3 = ["innerHTML"];
  475. function render(_ctx, _cache, $props, $setup, $data, $options) {
  476. 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) {
  477. 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", {
  478. key: "link-".concat(key),
  479. "class": (0,vue__WEBPACK_IMPORTED_MODULE_0__.normalizeClass)(["p-paginator-page p-paginator-element p-link", {
  480. 'p-disabled': link
  481. }]),
  482. innerHTML: link.label
  483. }, null, 10
  484. /* CLASS, PROPS */
  485. , _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"], {
  486. key: "link-".concat(key),
  487. href: link.url,
  488. "class": (0,vue__WEBPACK_IMPORTED_MODULE_0__.normalizeClass)([{
  489. 'p-highlight': link.active
  490. }, "p-paginator-page p-paginator-element p-link"]),
  491. innerHTML: link.label
  492. }, null, 8
  493. /* PROPS */
  494. , ["href", "class", "innerHTML"])) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true)], 64
  495. /* STABLE_FRAGMENT */
  496. );
  497. }), 256
  498. /* UNKEYED_FRAGMENT */
  499. ))])])) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true);
  500. }
  501. /***/ }),
  502. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppSidebar.vue?vue&type=template&id=22a4e926&scoped=true":
  503. /*!********************************************************************************************************************************************************************************************************************************************************************************************!*\
  504. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppSidebar.vue?vue&type=template&id=22a4e926&scoped=true ***!
  505. \********************************************************************************************************************************************************************************************************************************************************************************************/
  506. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  507. "use strict";
  508. __webpack_require__.r(__webpack_exports__);
  509. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  510. /* harmony export */ "render": () => (/* binding */ render)
  511. /* harmony export */ });
  512. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  513. function render(_ctx, _cache, $props, $setup, $data, $options) {
  514. return (0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)("div", null, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)($setup["AppSubSidebar"], {
  515. "class": "layout-menu",
  516. items: $props.menu,
  517. root: true
  518. }, null, 8
  519. /* PROPS */
  520. , ["items"])]);
  521. }
  522. /***/ }),
  523. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppSubSidebar.vue?vue&type=template&id=0addd9bc&scoped=true":
  524. /*!***********************************************************************************************************************************************************************************************************************************************************************************************!*\
  525. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppSubSidebar.vue?vue&type=template&id=0addd9bc&scoped=true ***!
  526. \***********************************************************************************************************************************************************************************************************************************************************************************************/
  527. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  528. "use strict";
  529. __webpack_require__.r(__webpack_exports__);
  530. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  531. /* harmony export */ "render": () => (/* binding */ render)
  532. /* harmony export */ });
  533. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  534. var _withScopeId = function _withScopeId(n) {
  535. return (0,vue__WEBPACK_IMPORTED_MODULE_0__.pushScopeId)("data-v-0addd9bc"), n = n(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.popScopeId)(), n;
  536. };
  537. var _hoisted_1 = {
  538. key: 0
  539. };
  540. var _hoisted_2 = ["aria-label"];
  541. var _hoisted_3 = ["aria-label"];
  542. function render(_ctx, _cache, $props, $setup, $data, $options) {
  543. var _component_AppSubSidebar = (0,vue__WEBPACK_IMPORTED_MODULE_0__.resolveComponent)("AppSubSidebar", true);
  544. 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) {
  545. 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", {
  546. key: i,
  547. "class": (0,vue__WEBPACK_IMPORTED_MODULE_0__.normalizeClass)([{
  548. 'layout-menuitem-category': $props.root
  549. }]),
  550. role: "none"
  551. }, [$props.root ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)(vue__WEBPACK_IMPORTED_MODULE_0__.Fragment, {
  552. key: 0
  553. }, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("div", {
  554. "class": "layout-menuitem-root-text",
  555. "aria-label": item.label
  556. }, (0,vue__WEBPACK_IMPORTED_MODULE_0__.toDisplayString)(item.label), 9
  557. /* TEXT, PROPS */
  558. , _hoisted_2), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(_component_AppSubSidebar, {
  559. items: item.items
  560. }, null, 8
  561. /* PROPS */
  562. , ["items"])], 64
  563. /* STABLE_FRAGMENT */
  564. )) : ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)(vue__WEBPACK_IMPORTED_MODULE_0__.Fragment, {
  565. key: 1
  566. }, [item.to ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createBlock)($setup["Link"], {
  567. key: 0,
  568. role: "menuitem",
  569. href: item.to,
  570. "class": (0,vue__WEBPACK_IMPORTED_MODULE_0__.normalizeClass)([{
  571. 'router-link-active': _ctx.$page.component.startsWith(item.component) || _ctx.$page.url.startsWith(item.to),
  572. 'router-link-exact-active': _ctx.$page.component.startsWith(item.component) || _ctx.$page.url.startsWith(item.to)
  573. }]),
  574. "aria-label": item.label
  575. }, {
  576. "default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  577. return [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("i", {
  578. "class": (0,vue__WEBPACK_IMPORTED_MODULE_0__.normalizeClass)(item.icon)
  579. }, null, 2
  580. /* CLASS */
  581. ), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("span", null, (0,vue__WEBPACK_IMPORTED_MODULE_0__.toDisplayString)(item.label), 1
  582. /* TEXT */
  583. )];
  584. }),
  585. _: 2
  586. /* DYNAMIC */
  587. }, 1032
  588. /* PROPS, DYNAMIC_SLOTS */
  589. , ["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", {
  590. key: 1,
  591. href: "#",
  592. role: "menuitem",
  593. "aria-label": item.label
  594. }, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("i", {
  595. "class": (0,vue__WEBPACK_IMPORTED_MODULE_0__.normalizeClass)(item.icon)
  596. }, null, 2
  597. /* CLASS */
  598. ), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("span", null, (0,vue__WEBPACK_IMPORTED_MODULE_0__.toDisplayString)(item.label), 1
  599. /* TEXT */
  600. )], 8
  601. /* PROPS */
  602. , _hoisted_3)) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(_component_AppSubSidebar, {
  603. items: item.items
  604. }, null, 8
  605. /* PROPS */
  606. , ["items"])], 64
  607. /* STABLE_FRAGMENT */
  608. ))], 2
  609. /* CLASS */
  610. )) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true)], 64
  611. /* STABLE_FRAGMENT */
  612. );
  613. }), 256
  614. /* UNKEYED_FRAGMENT */
  615. ))])) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true);
  616. }
  617. /***/ }),
  618. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppTopBar.vue?vue&type=template&id=42bf62a4&scoped=true":
  619. /*!*******************************************************************************************************************************************************************************************************************************************************************************************!*\
  620. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppTopBar.vue?vue&type=template&id=42bf62a4&scoped=true ***!
  621. \*******************************************************************************************************************************************************************************************************************************************************************************************/
  622. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  623. "use strict";
  624. __webpack_require__.r(__webpack_exports__);
  625. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  626. /* harmony export */ "render": () => (/* binding */ render)
  627. /* harmony export */ });
  628. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  629. var _withScopeId = function _withScopeId(n) {
  630. return (0,vue__WEBPACK_IMPORTED_MODULE_0__.pushScopeId)("data-v-42bf62a4"), n = n(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.popScopeId)(), n;
  631. };
  632. var _hoisted_1 = {
  633. "class": "layout-topbar"
  634. };
  635. var _hoisted_2 = /*#__PURE__*/_withScopeId(function () {
  636. return /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("img", {
  637. alt: "Brand Logo",
  638. src: "/images/logo.svg",
  639. "class": "md:mr-3"
  640. }, null, -1
  641. /* HOISTED */
  642. );
  643. });
  644. var _hoisted_3 = /*#__PURE__*/_withScopeId(function () {
  645. return /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("span", null, "Cahaya Agung", -1
  646. /* HOISTED */
  647. );
  648. });
  649. var _hoisted_4 = /*#__PURE__*/_withScopeId(function () {
  650. return /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("i", {
  651. "class": "pi pi-bars"
  652. }, null, -1
  653. /* HOISTED */
  654. );
  655. });
  656. var _hoisted_5 = [_hoisted_4];
  657. var _hoisted_6 = {
  658. "class": "p-link layout-topbar-menu-button layout-topbar-button"
  659. };
  660. var _hoisted_7 = /*#__PURE__*/_withScopeId(function () {
  661. return /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("i", {
  662. "class": "pi pi-ellipsis-v"
  663. }, null, -1
  664. /* HOISTED */
  665. );
  666. });
  667. var _hoisted_8 = [_hoisted_7];
  668. var _hoisted_9 = {
  669. "class": "layout-topbar-menu hidden lg:flex origin-top"
  670. };
  671. var _hoisted_10 = {
  672. "class": "align-self-center"
  673. };
  674. var _hoisted_11 = {
  675. "class": "hidden lg:inline"
  676. };
  677. var _hoisted_12 = /*#__PURE__*/_withScopeId(function () {
  678. return /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("i", {
  679. "class": "pi pi-user"
  680. }, null, -1
  681. /* HOISTED */
  682. );
  683. });
  684. var _hoisted_13 = /*#__PURE__*/_withScopeId(function () {
  685. return /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("span", null, "Ubah Profil", -1
  686. /* HOISTED */
  687. );
  688. });
  689. var _hoisted_14 = /*#__PURE__*/_withScopeId(function () {
  690. return /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("i", {
  691. "class": "pi pi-sign-out"
  692. }, null, -1
  693. /* HOISTED */
  694. );
  695. });
  696. var _hoisted_15 = /*#__PURE__*/_withScopeId(function () {
  697. return /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("span", null, "Keluar", -1
  698. /* HOISTED */
  699. );
  700. });
  701. function render(_ctx, _cache, $props, $setup, $data, $options) {
  702. var _directive_styleclass = (0,vue__WEBPACK_IMPORTED_MODULE_0__.resolveDirective)("styleclass");
  703. var _directive_tooltip = (0,vue__WEBPACK_IMPORTED_MODULE_0__.resolveDirective)("tooltip");
  704. 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"], {
  705. href: "/",
  706. "class": "layout-topbar-logo"
  707. }, {
  708. "default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  709. return [_hoisted_2, _hoisted_3];
  710. }),
  711. _: 1
  712. /* STABLE */
  713. }), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("button", {
  714. "class": "p-link layout-menu-button layout-topbar-button",
  715. onClick: _cache[0] || (_cache[0] = function ($event) {
  716. return _ctx.$emit('menu-toggle', $event);
  717. })
  718. }, _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, {
  719. selector: '@next',
  720. enterClass: 'hidden',
  721. enterActiveClass: 'scalein',
  722. leaveToClass: 'hidden',
  723. leaveActiveClass: 'fadeout',
  724. hideOnOutsideClick: true
  725. }]]), (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
  726. /* TEXT */
  727. )]), (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"], {
  728. href: _ctx.route('users.show', _ctx.$page.props.auth.user.id),
  729. "class": "p-link layout-topbar-button"
  730. }, {
  731. "default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  732. return [_hoisted_12, _hoisted_13];
  733. }),
  734. _: 1
  735. /* STABLE */
  736. }, 8
  737. /* PROPS */
  738. , ["href"])), [[_directive_tooltip, {
  739. value: 'Ubah Profil',
  740. "class": 'layout-topbar-menu-tooltip'
  741. }, void 0, {
  742. bottom: true
  743. }]])]), (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"], {
  744. href: _ctx.route('logout'),
  745. as: "button",
  746. method: "post",
  747. "class": "p-link layout-topbar-button"
  748. }, {
  749. "default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  750. return [_hoisted_14, _hoisted_15];
  751. }),
  752. _: 1
  753. /* STABLE */
  754. }, 8
  755. /* PROPS */
  756. , ["href"])), [[_directive_tooltip, {
  757. value: 'Keluar',
  758. "class": 'layout-topbar-menu-tooltip'
  759. }, void 0, {
  760. bottom: true
  761. }]])])])]);
  762. }
  763. /***/ }),
  764. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/layouts/DashboardLayout.vue?vue&type=template&id=549bf5ac&scoped=true":
  765. /*!**********************************************************************************************************************************************************************************************************************************************************************************************!*\
  766. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/layouts/DashboardLayout.vue?vue&type=template&id=549bf5ac&scoped=true ***!
  767. \**********************************************************************************************************************************************************************************************************************************************************************************************/
  768. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  769. "use strict";
  770. __webpack_require__.r(__webpack_exports__);
  771. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  772. /* harmony export */ "render": () => (/* binding */ render)
  773. /* harmony export */ });
  774. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  775. var _withScopeId = function _withScopeId(n) {
  776. return (0,vue__WEBPACK_IMPORTED_MODULE_0__.pushScopeId)("data-v-549bf5ac"), n = n(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.popScopeId)(), n;
  777. };
  778. var _hoisted_1 = {
  779. "class": "layout-sidebar"
  780. };
  781. var _hoisted_2 = {
  782. "class": "layout-main-container"
  783. };
  784. var _hoisted_3 = {
  785. "class": "layout-main"
  786. };
  787. var _hoisted_4 = /*#__PURE__*/_withScopeId(function () {
  788. return /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("div", {
  789. "class": "layout-footer"
  790. }, [/*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createTextVNode)(" Developed by "), /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("a", {
  791. href: "https://dijitalcode.com",
  792. target: "_blank",
  793. "class": "font-medium ml-2"
  794. }, "DijitalCODE")], -1
  795. /* HOISTED */
  796. );
  797. });
  798. var _hoisted_5 = {
  799. key: 0,
  800. "class": "layout-mask p-component-overlay"
  801. };
  802. function render(_ctx, _cache, $props, $setup, $data, $options) {
  803. return (0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)("div", {
  804. "class": (0,vue__WEBPACK_IMPORTED_MODULE_0__.normalizeClass)($setup.containerClass),
  805. onClick: $setup.onWrapperClick
  806. }, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)($setup["AppTopBar"], {
  807. onMenuToggle: $setup.onMenuToggle
  808. }), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("div", _hoisted_1, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)($setup["AppSidebar"], {
  809. menu: $setup.menu[_ctx.$page.props.auth.user.role_id]
  810. }, null, 8
  811. /* PROPS */
  812. , ["menu"])]), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("div", _hoisted_2, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("div", _hoisted_3, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)($setup["AppMessage"]), (0,vue__WEBPACK_IMPORTED_MODULE_0__.renderSlot)(_ctx.$slots, "default", {}, undefined, true)]), _hoisted_4]), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(vue__WEBPACK_IMPORTED_MODULE_0__.Transition, {
  813. name: "layout-mask"
  814. }, {
  815. "default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  816. return [$setup.mobileMenuActive ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)("div", _hoisted_5)) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true)];
  817. }),
  818. _: 1
  819. /* STABLE */
  820. })], 2
  821. /* CLASS */
  822. );
  823. }
  824. /***/ }),
  825. /***/ "./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":
  826. /*!****************************************************************************************************************************************************************************************************************************************************************************!*\
  827. !*** ./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 ***!
  828. \****************************************************************************************************************************************************************************************************************************************************************************/
  829. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  830. "use strict";
  831. __webpack_require__.r(__webpack_exports__);
  832. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  833. /* harmony export */ "render": () => (/* binding */ render)
  834. /* harmony export */ });
  835. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  836. var _hoisted_1 = /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("h1", null, "User", -1
  837. /* HOISTED */
  838. );
  839. var _hoisted_2 = {
  840. "class": "grid"
  841. };
  842. var _hoisted_3 = {
  843. "class": "col-12 md:col-8"
  844. };
  845. var _hoisted_4 = {
  846. "class": "flex align-items-center"
  847. };
  848. var _hoisted_5 = {
  849. "class": "col-12 md:col-4 flex flex-column md:flex-row justify-content-end"
  850. };
  851. function render(_ctx, _cache, $props, $setup, $data, $options) {
  852. var _component_ConfirmDialog = (0,vue__WEBPACK_IMPORTED_MODULE_0__.resolveComponent)("ConfirmDialog");
  853. var _component_InputText = (0,vue__WEBPACK_IMPORTED_MODULE_0__.resolveComponent)("InputText");
  854. var _component_Column = (0,vue__WEBPACK_IMPORTED_MODULE_0__.resolveComponent)("Column");
  855. var _component_Button = (0,vue__WEBPACK_IMPORTED_MODULE_0__.resolveComponent)("Button");
  856. var _component_DataTable = (0,vue__WEBPACK_IMPORTED_MODULE_0__.resolveComponent)("DataTable");
  857. var _directive_tooltip = (0,vue__WEBPACK_IMPORTED_MODULE_0__.resolveDirective)("tooltip");
  858. 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"], {
  859. title: "Daftar User"
  860. }), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)($setup["DashboardLayout"], null, {
  861. "default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  862. return [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(_component_ConfirmDialog), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(_component_DataTable, {
  863. responsiveLayout: "scroll",
  864. columnResizeMode: "expand",
  865. value: $props.users.data,
  866. rowHover: true,
  867. stripedRows: true
  868. }, {
  869. header: (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  870. return [_hoisted_1, (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("div", _hoisted_2, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("div", _hoisted_3, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("div", _hoisted_4, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(_component_InputText, {
  871. "class": "w-full md:w-27rem",
  872. placeholder: "cari, contoh: tina",
  873. modelValue: $setup.search,
  874. "onUpdate:modelValue": _cache[0] || (_cache[0] = function ($event) {
  875. return $setup.search = $event;
  876. })
  877. }, null, 8
  878. /* PROPS */
  879. , ["modelValue"])])]), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("div", _hoisted_5, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)($setup["AppButtonLink"], {
  880. label: "Tambah User",
  881. icon: "pi pi-pencil",
  882. "class": "p-button-outlined",
  883. href: _ctx.route('users.create')
  884. }, null, 8
  885. /* PROPS */
  886. , ["href"])])])];
  887. }),
  888. "default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  889. return [((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(true), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)(vue__WEBPACK_IMPORTED_MODULE_0__.Fragment, null, (0,vue__WEBPACK_IMPORTED_MODULE_0__.renderList)($setup.tableHeader, function (value) {
  890. return (0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createBlock)(_component_Column, {
  891. field: value.field,
  892. header: value.header,
  893. key: value.field
  894. }, null, 8
  895. /* PROPS */
  896. , ["field", "header"]);
  897. }), 128
  898. /* KEYED_FRAGMENT */
  899. )), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(_component_Column, null, {
  900. body: (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function (_ref) {
  901. var data = _ref.data;
  902. return [(0,vue__WEBPACK_IMPORTED_MODULE_0__.withDirectives)((0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)($setup["AppButtonLink"], {
  903. icon: "pi pi-pencil",
  904. "class": "p-button-icon-only p-button-rounded p-button-text",
  905. href: _ctx.route('users.edit', data.id)
  906. }, null, 8
  907. /* PROPS */
  908. , ["href"]), [[_directive_tooltip, 'Ubah User', void 0, {
  909. bottom: true
  910. }]]), 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, {
  911. key: 0,
  912. icon: "pi pi-key",
  913. "class": "p-button-icon-only p-button-rounded p-button-text",
  914. onClick: function onClick($event) {
  915. return $setup.onResetPassword(data);
  916. }
  917. }, null, 8
  918. /* PROPS */
  919. , ["onClick"])), [[_directive_tooltip, 'Reset Kata Sandi', void 0, {
  920. bottom: true
  921. }]]) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true)];
  922. }),
  923. _: 1
  924. /* STABLE */
  925. })];
  926. }),
  927. _: 1
  928. /* STABLE */
  929. }, 8
  930. /* PROPS */
  931. , ["value"]), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)($setup["AppPagination"], {
  932. links: $props.users.links
  933. }, null, 8
  934. /* PROPS */
  935. , ["links"])];
  936. }),
  937. _: 1
  938. /* STABLE */
  939. })], 64
  940. /* STABLE_FRAGMENT */
  941. );
  942. }
  943. /***/ }),
  944. /***/ "./resources/js/components/useSearchText.js":
  945. /*!**************************************************!*\
  946. !*** ./resources/js/components/useSearchText.js ***!
  947. \**************************************************/
  948. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  949. "use strict";
  950. __webpack_require__.r(__webpack_exports__);
  951. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  952. /* harmony export */ "useSearchText": () => (/* binding */ useSearchText)
  953. /* harmony export */ });
  954. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  955. function useSearchText(props) {
  956. var search = (0,vue__WEBPACK_IMPORTED_MODULE_0__.ref)(props.initialSearch);
  957. return {
  958. search: search
  959. };
  960. }
  961. /***/ }),
  962. /***/ "./resources/js/pages/Users/tableHeader.js":
  963. /*!*************************************************!*\
  964. !*** ./resources/js/pages/Users/tableHeader.js ***!
  965. \*************************************************/
  966. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  967. "use strict";
  968. __webpack_require__.r(__webpack_exports__);
  969. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  970. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  971. /* harmony export */ });
  972. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ([{
  973. field: 'name',
  974. header: 'Nama'
  975. }, {
  976. field: 'username',
  977. header: 'Nama Pengguna'
  978. }, {
  979. field: 'role',
  980. header: 'Hak Akses'
  981. }, {
  982. field: 'status',
  983. header: 'Status'
  984. }]);
  985. /***/ }),
  986. /***/ "./resources/js/utils/menu.js":
  987. /*!************************************!*\
  988. !*** ./resources/js/utils/menu.js ***!
  989. \************************************/
  990. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  991. "use strict";
  992. __webpack_require__.r(__webpack_exports__);
  993. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  994. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  995. /* harmony export */ });
  996. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
  997. // Admin
  998. 1: [{
  999. label: 'Home',
  1000. items: [{
  1001. label: 'Dashboard',
  1002. icon: 'pi pi-chart-bar',
  1003. to: '/dashboards',
  1004. component: 'Dashboards/Index'
  1005. }]
  1006. }, {
  1007. label: 'Laporan',
  1008. items: []
  1009. }, {
  1010. label: 'Master',
  1011. items: [{
  1012. label: 'User',
  1013. icon: 'pi pi-user',
  1014. to: '/users',
  1015. component: 'Users/Index'
  1016. }]
  1017. }],
  1018. // Supervisor
  1019. 2: [{
  1020. label: 'Home',
  1021. items: [{
  1022. label: 'Dashboard',
  1023. icon: 'pi pi-chart-bar',
  1024. to: '/dashboards',
  1025. component: 'Dashboards/Index'
  1026. }]
  1027. }, {
  1028. label: 'Master',
  1029. items: [{
  1030. label: 'Pelanggan',
  1031. icon: 'pi pi-users',
  1032. to: '/customers',
  1033. component: 'Customers/Index'
  1034. }, {
  1035. label: 'Pembelian',
  1036. icon: 'pi pi-shopping-cart',
  1037. to: '/purchases',
  1038. component: 'Purchases/Index'
  1039. }, {
  1040. label: 'Penjualan',
  1041. icon: 'pi pi-tag',
  1042. to: '/sales',
  1043. component: 'Sales/Index'
  1044. }, {
  1045. label: 'Produk',
  1046. icon: 'pi pi-th-large',
  1047. to: '/products',
  1048. component: 'Products/Index'
  1049. }]
  1050. }],
  1051. // Operator
  1052. 3: [{
  1053. label: 'Home',
  1054. items: [{
  1055. label: 'Dashboard',
  1056. icon: 'pi pi-chart-bar',
  1057. to: '/dashboards',
  1058. component: 'Dashboards/Index'
  1059. }]
  1060. }, {
  1061. label: 'Master',
  1062. items: [{
  1063. label: 'Supplier',
  1064. icon: 'pi pi-shopping-cart',
  1065. to: '/suppliers',
  1066. component: 'Suppliers/Index'
  1067. }, {
  1068. label: 'Stok Barang',
  1069. icon: 'pi pi-box',
  1070. to: '/stock-products',
  1071. component: 'StockProducts/Index'
  1072. }]
  1073. }]
  1074. });
  1075. /***/ }),
  1076. /***/ "./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppSidebar.vue?vue&type=style&index=0&id=22a4e926&lang=scss&scoped=true":
  1077. /*!************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  1078. !*** ./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppSidebar.vue?vue&type=style&index=0&id=22a4e926&lang=scss&scoped=true ***!
  1079. \************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  1080. /***/ ((module, __webpack_exports__, __webpack_require__) => {
  1081. "use strict";
  1082. __webpack_require__.r(__webpack_exports__);
  1083. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  1084. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  1085. /* harmony export */ });
  1086. /* 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");
  1087. /* 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__);
  1088. // Imports
  1089. var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_0___default()(function(i){return i[1]});
  1090. // Module
  1091. ___CSS_LOADER_EXPORT___.push([module.id, ".layout-menu[data-v-22a4e926] {\n list-style-type: none;\n margin: 0;\n padding: 0;\n}", ""]);
  1092. // Exports
  1093. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);
  1094. /***/ }),
  1095. /***/ "./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppSubSidebar.vue?vue&type=style&index=0&id=0addd9bc&lang=scss&scoped=true":
  1096. /*!***************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  1097. !*** ./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppSubSidebar.vue?vue&type=style&index=0&id=0addd9bc&lang=scss&scoped=true ***!
  1098. \***************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  1099. /***/ ((module, __webpack_exports__, __webpack_require__) => {
  1100. "use strict";
  1101. __webpack_require__.r(__webpack_exports__);
  1102. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  1103. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  1104. /* harmony export */ });
  1105. /* 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");
  1106. /* 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__);
  1107. // Imports
  1108. var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_0___default()(function(i){return i[1]});
  1109. // Module
  1110. ___CSS_LOADER_EXPORT___.push([module.id, "li.layout-menuitem-category[data-v-0addd9bc] {\n margin-top: 0.75rem;\n}\nli.layout-menuitem-category[data-v-0addd9bc]:first-child {\n margin-top: 0;\n}\nli .layout-menuitem-root-text[data-v-0addd9bc] {\n text-transform: uppercase;\n color: var(--surface-900);\n font-weight: 600;\n margin-bottom: 0.5rem;\n font-size: 0.875rem;\n}\nli a[data-v-0addd9bc] {\n cursor: pointer;\n text-decoration: none;\n display: flex;\n align-items: center;\n color: var(--text-color);\n transition: color 0.2s;\n border-radius: 12px;\n padding: 0.75rem 1rem;\n transition: background-color 0.15s;\n}\nli a span[data-v-0addd9bc] {\n margin-left: 0.5rem;\n}\nli a .menuitem-toggle-icon[data-v-0addd9bc] {\n margin-left: auto;\n}\nli a[data-v-0addd9bc]:focus {\n outline: 0 none;\n outline-offset: 0;\n transition: box-shadow 0.2s;\n box-shadow: inset var(--focus-ring);\n}\nli a[data-v-0addd9bc]:hover {\n background-color: var(--surface-hover);\n}\nli a.router-link-exact-active[data-v-0addd9bc] {\n font-weight: 700;\n color: var(--primary-color);\n}\nli ul[data-v-0addd9bc] {\n list-style-type: none;\n margin: 0;\n padding: 0;\n}\nli ul ul[data-v-0addd9bc] {\n padding-left: 1rem;\n}", ""]);
  1111. // Exports
  1112. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);
  1113. /***/ }),
  1114. /***/ "./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppTopBar.vue?vue&type=style&index=0&id=42bf62a4&lang=scss&scoped=true":
  1115. /*!***********************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  1116. !*** ./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppTopBar.vue?vue&type=style&index=0&id=42bf62a4&lang=scss&scoped=true ***!
  1117. \***********************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  1118. /***/ ((module, __webpack_exports__, __webpack_require__) => {
  1119. "use strict";
  1120. __webpack_require__.r(__webpack_exports__);
  1121. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  1122. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  1123. /* harmony export */ });
  1124. /* 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");
  1125. /* 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__);
  1126. // Imports
  1127. var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_0___default()(function(i){return i[1]});
  1128. // Module
  1129. ___CSS_LOADER_EXPORT___.push([module.id, ".layout-topbar[data-v-42bf62a4] {\n position: fixed;\n height: 5rem;\n z-index: 994;\n left: 0;\n top: 0;\n width: 100%;\n padding: 0 2rem;\n background-color: var(--surface-card);\n transition: left 0.2s;\n display: flex;\n align-items: center;\n box-shadow: 0px 3px 5px rgba(0, 0, 0, 0.02), 0px 0px 2px rgba(0, 0, 0, 0.05), 0px 1px 4px rgba(0, 0, 0, 0.08);\n}\n.layout-topbar .layout-topbar-logo[data-v-42bf62a4] {\n display: flex;\n align-items: center;\n color: var(--surface-900);\n font-size: 1.5rem;\n font-weight: 500;\n width: 300px;\n border-radius: 12px;\n}\n.layout-topbar .layout-topbar-logo img[data-v-42bf62a4] {\n height: 2.5rem;\n margin-right: 0.5rem;\n}\n.layout-topbar .layout-topbar-logo[data-v-42bf62a4]:focus {\n outline: 0 none;\n outline-offset: 0;\n transition: box-shadow 0.2s;\n box-shadow: var(--focus-ring);\n}\n.layout-topbar .layout-topbar-button[data-v-42bf62a4] {\n display: inline-flex;\n justify-content: center;\n align-items: center;\n position: relative;\n color: var(--text-color-secondary);\n border-radius: 50%;\n width: 3rem;\n height: 3rem;\n cursor: pointer;\n transition: background-color 0.2s;\n}\n.layout-topbar .layout-topbar-button[data-v-42bf62a4]:hover {\n color: var(--text-color);\n background-color: var(--surface-hover);\n}\n.layout-topbar .layout-topbar-button[data-v-42bf62a4]:focus {\n outline: 0 none;\n outline-offset: 0;\n transition: box-shadow 0.2s;\n box-shadow: var(--focus-ring);\n}\n.layout-topbar .layout-topbar-button i[data-v-42bf62a4] {\n font-size: 1.5rem;\n}\n.layout-topbar .layout-topbar-button span[data-v-42bf62a4] {\n font-size: 1rem;\n display: none;\n}\n.layout-topbar .layout-menu-button[data-v-42bf62a4] {\n margin-left: 2rem;\n}\n.layout-topbar .layout-topbar-menu-button[data-v-42bf62a4] {\n display: none;\n}\n.layout-topbar .layout-topbar-menu-button i[data-v-42bf62a4] {\n font-size: 1.25rem;\n}\n.layout-topbar .layout-topbar-menu[data-v-42bf62a4] {\n margin: 0 0 0 auto;\n padding: 0;\n list-style: none;\n display: flex;\n}\n.layout-topbar .layout-topbar-menu .layout-topbar-button[data-v-42bf62a4] {\n margin-left: 1rem;\n}\n@media (max-width: 991px) {\n.layout-topbar[data-v-42bf62a4] {\n justify-content: space-between;\n}\n.layout-topbar .layout-topbar-logo[data-v-42bf62a4] {\n width: auto;\n order: 2;\n}\n.layout-topbar .layout-menu-button[data-v-42bf62a4] {\n margin-left: 0;\n order: 1;\n}\n.layout-topbar .layout-topbar-menu-button[data-v-42bf62a4] {\n display: inline-flex;\n margin-left: 0;\n order: 3;\n}\n.layout-topbar .layout-topbar-menu[data-v-42bf62a4] {\n margin-left: 0;\n position: absolute;\n flex-direction: column;\n background-color: var(--surface-overlay);\n box-shadow: 0px 3px 5px rgba(0, 0, 0, 0.02), 0px 0px 2px rgba(0, 0, 0, 0.05), 0px 1px 4px rgba(0, 0, 0, 0.08);\n border-radius: 4px;\n padding: 1rem;\n right: 2rem;\n top: 5.5rem;\n min-width: 15rem;\n}\n.layout-topbar .layout-topbar-menu .layout-topbar-button[data-v-42bf62a4] {\n margin-left: 0;\n display: flex;\n width: 100%;\n height: auto;\n justify-content: flex-start;\n border-radius: 12px;\n padding: 1rem;\n}\n.layout-topbar .layout-topbar-menu .layout-topbar-button i[data-v-42bf62a4] {\n font-size: 1rem;\n margin-right: 0.5rem;\n}\n.layout-topbar .layout-topbar-menu .layout-topbar-button span[data-v-42bf62a4] {\n font-weight: medium;\n display: block;\n}\n}", ""]);
  1130. // Exports
  1131. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);
  1132. /***/ }),
  1133. /***/ "./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/layouts/DashboardLayout.vue?vue&type=style&index=0&id=549bf5ac&lang=scss&scoped=true":
  1134. /*!**************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  1135. !*** ./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/layouts/DashboardLayout.vue?vue&type=style&index=0&id=549bf5ac&lang=scss&scoped=true ***!
  1136. \**************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  1137. /***/ ((module, __webpack_exports__, __webpack_require__) => {
  1138. "use strict";
  1139. __webpack_require__.r(__webpack_exports__);
  1140. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  1141. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  1142. /* harmony export */ });
  1143. /* 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");
  1144. /* 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__);
  1145. // Imports
  1146. var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_0___default()(function(i){return i[1]});
  1147. // Module
  1148. ___CSS_LOADER_EXPORT___.push([module.id, ".layout-sidebar[data-v-549bf5ac] {\n position: fixed;\n width: 300px;\n height: calc(100vh - 9rem);\n z-index: 996;\n overflow-y: auto;\n -webkit-user-select: none;\n -moz-user-select: none;\n -ms-user-select: none;\n user-select: none;\n top: 7rem;\n left: 2rem;\n transition: transform 0.2s, left 0.2s;\n background-color: var(--surface-overlay);\n border-radius: 4px;\n padding: 1.5rem;\n box-shadow: 0px 3px 5px rgba(0, 0, 0, 0.02), 0px 0px 2px rgba(0, 0, 0, 0.05), 0px 1px 4px rgba(0, 0, 0, 0.08);\n}\n.layout-main-container[data-v-549bf5ac] {\n display: flex;\n flex-direction: column;\n min-height: 100vh;\n justify-content: space-between;\n padding: 7rem 2rem 2rem 4rem;\n transition: margin-left 0.2s;\n}\n.layout-main[data-v-549bf5ac] {\n flex: 1 1 auto;\n}\n.layout-footer[data-v-549bf5ac] {\n transition: margin-left 0.2s;\n display: flex;\n align-items: center;\n justify-content: center;\n padding-top: 1rem;\n border-top: 1px solid var(--surface-border);\n}\n@media (min-width: 992px) {\n.layout-wrapper .layout-main-container[data-v-549bf5ac] {\n margin-left: 300px;\n}\n.layout-wrapper.layout-static-sidebar-inactive .layout-sidebar[data-v-549bf5ac] {\n transform: translateX(-100%);\n left: 0;\n}\n.layout-wrapper.layout-static-sidebar-inactive .layout-main-container[data-v-549bf5ac] {\n margin-left: 0;\n padding-left: 2rem;\n}\n.layout-wrapper .layout-mask[data-v-549bf5ac] {\n display: none;\n}\n}\n@media (max-width: 991px) {\n.layout-wrapper .layout-main-container[data-v-549bf5ac] {\n margin-left: 0;\n padding-left: 2rem;\n}\n.layout-wrapper .layout-sidebar[data-v-549bf5ac] {\n transform: translateX(-100%);\n left: 0;\n top: 0;\n height: 100vh;\n border-top-left-radius: 0;\n border-bottom-left-radius: 0;\n}\n.layout-wrapper .layout-mask[data-v-549bf5ac] {\n z-index: 995;\n background-color: var(--maskbg);\n}\n.layout-wrapper .layout-mask.layout-mask-enter-from[data-v-549bf5ac], .layout-wrapper .layout-mask.layout-mask-leave-to[data-v-549bf5ac] {\n background-color: transparent;\n}\n.layout-wrapper.layout-mobile-sidebar-active .layout-sidebar[data-v-549bf5ac] {\n transform: translateX(0);\n}\n.layout-wrapper.layout-mobile-sidebar-active .layout-mask[data-v-549bf5ac] {\n display: block;\n}\n}", ""]);
  1149. // Exports
  1150. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);
  1151. /***/ }),
  1152. /***/ "./node_modules/lodash/lodash.js":
  1153. /*!***************************************!*\
  1154. !*** ./node_modules/lodash/lodash.js ***!
  1155. \***************************************/
  1156. /***/ (function(module, exports, __webpack_require__) {
  1157. /* module decorator */ module = __webpack_require__.nmd(module);
  1158. var __WEBPACK_AMD_DEFINE_RESULT__;/**
  1159. * @license
  1160. * Lodash <https://lodash.com/>
  1161. * Copyright OpenJS Foundation and other contributors <https://openjsf.org/>
  1162. * Released under MIT license <https://lodash.com/license>
  1163. * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
  1164. * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
  1165. */
  1166. ;(function() {
  1167. /** Used as a safe reference for `undefined` in pre-ES5 environments. */
  1168. var undefined;
  1169. /** Used as the semantic version number. */
  1170. var VERSION = '4.17.21';
  1171. /** Used as the size to enable large array optimizations. */
  1172. var LARGE_ARRAY_SIZE = 200;
  1173. /** Error message constants. */
  1174. var CORE_ERROR_TEXT = 'Unsupported core-js use. Try https://npms.io/search?q=ponyfill.',
  1175. FUNC_ERROR_TEXT = 'Expected a function',
  1176. INVALID_TEMPL_VAR_ERROR_TEXT = 'Invalid `variable` option passed into `_.template`';
  1177. /** Used to stand-in for `undefined` hash values. */
  1178. var HASH_UNDEFINED = '__lodash_hash_undefined__';
  1179. /** Used as the maximum memoize cache size. */
  1180. var MAX_MEMOIZE_SIZE = 500;
  1181. /** Used as the internal argument placeholder. */
  1182. var PLACEHOLDER = '__lodash_placeholder__';
  1183. /** Used to compose bitmasks for cloning. */
  1184. var CLONE_DEEP_FLAG = 1,
  1185. CLONE_FLAT_FLAG = 2,
  1186. CLONE_SYMBOLS_FLAG = 4;
  1187. /** Used to compose bitmasks for value comparisons. */
  1188. var COMPARE_PARTIAL_FLAG = 1,
  1189. COMPARE_UNORDERED_FLAG = 2;
  1190. /** Used to compose bitmasks for function metadata. */
  1191. var WRAP_BIND_FLAG = 1,
  1192. WRAP_BIND_KEY_FLAG = 2,
  1193. WRAP_CURRY_BOUND_FLAG = 4,
  1194. WRAP_CURRY_FLAG = 8,
  1195. WRAP_CURRY_RIGHT_FLAG = 16,
  1196. WRAP_PARTIAL_FLAG = 32,
  1197. WRAP_PARTIAL_RIGHT_FLAG = 64,
  1198. WRAP_ARY_FLAG = 128,
  1199. WRAP_REARG_FLAG = 256,
  1200. WRAP_FLIP_FLAG = 512;
  1201. /** Used as default options for `_.truncate`. */
  1202. var DEFAULT_TRUNC_LENGTH = 30,
  1203. DEFAULT_TRUNC_OMISSION = '...';
  1204. /** Used to detect hot functions by number of calls within a span of milliseconds. */
  1205. var HOT_COUNT = 800,
  1206. HOT_SPAN = 16;
  1207. /** Used to indicate the type of lazy iteratees. */
  1208. var LAZY_FILTER_FLAG = 1,
  1209. LAZY_MAP_FLAG = 2,
  1210. LAZY_WHILE_FLAG = 3;
  1211. /** Used as references for various `Number` constants. */
  1212. var INFINITY = 1 / 0,
  1213. MAX_SAFE_INTEGER = 9007199254740991,
  1214. MAX_INTEGER = 1.7976931348623157e+308,
  1215. NAN = 0 / 0;
  1216. /** Used as references for the maximum length and index of an array. */
  1217. var MAX_ARRAY_LENGTH = 4294967295,
  1218. MAX_ARRAY_INDEX = MAX_ARRAY_LENGTH - 1,
  1219. HALF_MAX_ARRAY_LENGTH = MAX_ARRAY_LENGTH >>> 1;
  1220. /** Used to associate wrap methods with their bit flags. */
  1221. var wrapFlags = [
  1222. ['ary', WRAP_ARY_FLAG],
  1223. ['bind', WRAP_BIND_FLAG],
  1224. ['bindKey', WRAP_BIND_KEY_FLAG],
  1225. ['curry', WRAP_CURRY_FLAG],
  1226. ['curryRight', WRAP_CURRY_RIGHT_FLAG],
  1227. ['flip', WRAP_FLIP_FLAG],
  1228. ['partial', WRAP_PARTIAL_FLAG],
  1229. ['partialRight', WRAP_PARTIAL_RIGHT_FLAG],
  1230. ['rearg', WRAP_REARG_FLAG]
  1231. ];
  1232. /** `Object#toString` result references. */
  1233. var argsTag = '[object Arguments]',
  1234. arrayTag = '[object Array]',
  1235. asyncTag = '[object AsyncFunction]',
  1236. boolTag = '[object Boolean]',
  1237. dateTag = '[object Date]',
  1238. domExcTag = '[object DOMException]',
  1239. errorTag = '[object Error]',
  1240. funcTag = '[object Function]',
  1241. genTag = '[object GeneratorFunction]',
  1242. mapTag = '[object Map]',
  1243. numberTag = '[object Number]',
  1244. nullTag = '[object Null]',
  1245. objectTag = '[object Object]',
  1246. promiseTag = '[object Promise]',
  1247. proxyTag = '[object Proxy]',
  1248. regexpTag = '[object RegExp]',
  1249. setTag = '[object Set]',
  1250. stringTag = '[object String]',
  1251. symbolTag = '[object Symbol]',
  1252. undefinedTag = '[object Undefined]',
  1253. weakMapTag = '[object WeakMap]',
  1254. weakSetTag = '[object WeakSet]';
  1255. var arrayBufferTag = '[object ArrayBuffer]',
  1256. dataViewTag = '[object DataView]',
  1257. float32Tag = '[object Float32Array]',
  1258. float64Tag = '[object Float64Array]',
  1259. int8Tag = '[object Int8Array]',
  1260. int16Tag = '[object Int16Array]',
  1261. int32Tag = '[object Int32Array]',
  1262. uint8Tag = '[object Uint8Array]',
  1263. uint8ClampedTag = '[object Uint8ClampedArray]',
  1264. uint16Tag = '[object Uint16Array]',
  1265. uint32Tag = '[object Uint32Array]';
  1266. /** Used to match empty string literals in compiled template source. */
  1267. var reEmptyStringLeading = /\b__p \+= '';/g,
  1268. reEmptyStringMiddle = /\b(__p \+=) '' \+/g,
  1269. reEmptyStringTrailing = /(__e\(.*?\)|\b__t\)) \+\n'';/g;
  1270. /** Used to match HTML entities and HTML characters. */
  1271. var reEscapedHtml = /&(?:amp|lt|gt|quot|#39);/g,
  1272. reUnescapedHtml = /[&<>"']/g,
  1273. reHasEscapedHtml = RegExp(reEscapedHtml.source),
  1274. reHasUnescapedHtml = RegExp(reUnescapedHtml.source);
  1275. /** Used to match template delimiters. */
  1276. var reEscape = /<%-([\s\S]+?)%>/g,
  1277. reEvaluate = /<%([\s\S]+?)%>/g,
  1278. reInterpolate = /<%=([\s\S]+?)%>/g;
  1279. /** Used to match property names within property paths. */
  1280. var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,
  1281. reIsPlainProp = /^\w*$/,
  1282. rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g;
  1283. /**
  1284. * Used to match `RegExp`
  1285. * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).
  1286. */
  1287. var reRegExpChar = /[\\^$.*+?()[\]{}|]/g,
  1288. reHasRegExpChar = RegExp(reRegExpChar.source);
  1289. /** Used to match leading whitespace. */
  1290. var reTrimStart = /^\s+/;
  1291. /** Used to match a single whitespace character. */
  1292. var reWhitespace = /\s/;
  1293. /** Used to match wrap detail comments. */
  1294. var reWrapComment = /\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,
  1295. reWrapDetails = /\{\n\/\* \[wrapped with (.+)\] \*/,
  1296. reSplitDetails = /,? & /;
  1297. /** Used to match words composed of alphanumeric characters. */
  1298. var reAsciiWord = /[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;
  1299. /**
  1300. * Used to validate the `validate` option in `_.template` variable.
  1301. *
  1302. * Forbids characters which could potentially change the meaning of the function argument definition:
  1303. * - "()," (modification of function parameters)
  1304. * - "=" (default value)
  1305. * - "[]{}" (destructuring of function parameters)
  1306. * - "/" (beginning of a comment)
  1307. * - whitespace
  1308. */
  1309. var reForbiddenIdentifierChars = /[()=,{}\[\]\/\s]/;
  1310. /** Used to match backslashes in property paths. */
  1311. var reEscapeChar = /\\(\\)?/g;
  1312. /**
  1313. * Used to match
  1314. * [ES template delimiters](http://ecma-international.org/ecma-262/7.0/#sec-template-literal-lexical-components).
  1315. */
  1316. var reEsTemplate = /\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g;
  1317. /** Used to match `RegExp` flags from their coerced string values. */
  1318. var reFlags = /\w*$/;
  1319. /** Used to detect bad signed hexadecimal string values. */
  1320. var reIsBadHex = /^[-+]0x[0-9a-f]+$/i;
  1321. /** Used to detect binary string values. */
  1322. var reIsBinary = /^0b[01]+$/i;
  1323. /** Used to detect host constructors (Safari). */
  1324. var reIsHostCtor = /^\[object .+?Constructor\]$/;
  1325. /** Used to detect octal string values. */
  1326. var reIsOctal = /^0o[0-7]+$/i;
  1327. /** Used to detect unsigned integer values. */
  1328. var reIsUint = /^(?:0|[1-9]\d*)$/;
  1329. /** Used to match Latin Unicode letters (excluding mathematical operators). */
  1330. var reLatin = /[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g;
  1331. /** Used to ensure capturing order of template delimiters. */
  1332. var reNoMatch = /($^)/;
  1333. /** Used to match unescaped characters in compiled string literals. */
  1334. var reUnescapedString = /['\n\r\u2028\u2029\\]/g;
  1335. /** Used to compose unicode character classes. */
  1336. var rsAstralRange = '\\ud800-\\udfff',
  1337. rsComboMarksRange = '\\u0300-\\u036f',
  1338. reComboHalfMarksRange = '\\ufe20-\\ufe2f',
  1339. rsComboSymbolsRange = '\\u20d0-\\u20ff',
  1340. rsComboRange = rsComboMarksRange + reComboHalfMarksRange + rsComboSymbolsRange,
  1341. rsDingbatRange = '\\u2700-\\u27bf',
  1342. rsLowerRange = 'a-z\\xdf-\\xf6\\xf8-\\xff',
  1343. rsMathOpRange = '\\xac\\xb1\\xd7\\xf7',
  1344. rsNonCharRange = '\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf',
  1345. rsPunctuationRange = '\\u2000-\\u206f',
  1346. 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',
  1347. rsUpperRange = 'A-Z\\xc0-\\xd6\\xd8-\\xde',
  1348. rsVarRange = '\\ufe0e\\ufe0f',
  1349. rsBreakRange = rsMathOpRange + rsNonCharRange + rsPunctuationRange + rsSpaceRange;
  1350. /** Used to compose unicode capture groups. */
  1351. var rsApos = "['\u2019]",
  1352. rsAstral = '[' + rsAstralRange + ']',
  1353. rsBreak = '[' + rsBreakRange + ']',
  1354. rsCombo = '[' + rsComboRange + ']',
  1355. rsDigits = '\\d+',
  1356. rsDingbat = '[' + rsDingbatRange + ']',
  1357. rsLower = '[' + rsLowerRange + ']',
  1358. rsMisc = '[^' + rsAstralRange + rsBreakRange + rsDigits + rsDingbatRange + rsLowerRange + rsUpperRange + ']',
  1359. rsFitz = '\\ud83c[\\udffb-\\udfff]',
  1360. rsModifier = '(?:' + rsCombo + '|' + rsFitz + ')',
  1361. rsNonAstral = '[^' + rsAstralRange + ']',
  1362. rsRegional = '(?:\\ud83c[\\udde6-\\uddff]){2}',
  1363. rsSurrPair = '[\\ud800-\\udbff][\\udc00-\\udfff]',
  1364. rsUpper = '[' + rsUpperRange + ']',
  1365. rsZWJ = '\\u200d';
  1366. /** Used to compose unicode regexes. */
  1367. var rsMiscLower = '(?:' + rsLower + '|' + rsMisc + ')',
  1368. rsMiscUpper = '(?:' + rsUpper + '|' + rsMisc + ')',
  1369. rsOptContrLower = '(?:' + rsApos + '(?:d|ll|m|re|s|t|ve))?',
  1370. rsOptContrUpper = '(?:' + rsApos + '(?:D|LL|M|RE|S|T|VE))?',
  1371. reOptMod = rsModifier + '?',
  1372. rsOptVar = '[' + rsVarRange + ']?',
  1373. rsOptJoin = '(?:' + rsZWJ + '(?:' + [rsNonAstral, rsRegional, rsSurrPair].join('|') + ')' + rsOptVar + reOptMod + ')*',
  1374. rsOrdLower = '\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])',
  1375. rsOrdUpper = '\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])',
  1376. rsSeq = rsOptVar + reOptMod + rsOptJoin,
  1377. rsEmoji = '(?:' + [rsDingbat, rsRegional, rsSurrPair].join('|') + ')' + rsSeq,
  1378. rsSymbol = '(?:' + [rsNonAstral + rsCombo + '?', rsCombo, rsRegional, rsSurrPair, rsAstral].join('|') + ')';
  1379. /** Used to match apostrophes. */
  1380. var reApos = RegExp(rsApos, 'g');
  1381. /**
  1382. * Used to match [combining diacritical marks](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks) and
  1383. * [combining diacritical marks for symbols](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks_for_Symbols).
  1384. */
  1385. var reComboMark = RegExp(rsCombo, 'g');
  1386. /** Used to match [string symbols](https://mathiasbynens.be/notes/javascript-unicode). */
  1387. var reUnicode = RegExp(rsFitz + '(?=' + rsFitz + ')|' + rsSymbol + rsSeq, 'g');
  1388. /** Used to match complex or compound words. */
  1389. var reUnicodeWord = RegExp([
  1390. rsUpper + '?' + rsLower + '+' + rsOptContrLower + '(?=' + [rsBreak, rsUpper, '$'].join('|') + ')',
  1391. rsMiscUpper + '+' + rsOptContrUpper + '(?=' + [rsBreak, rsUpper + rsMiscLower, '$'].join('|') + ')',
  1392. rsUpper + '?' + rsMiscLower + '+' + rsOptContrLower,
  1393. rsUpper + '+' + rsOptContrUpper,
  1394. rsOrdUpper,
  1395. rsOrdLower,
  1396. rsDigits,
  1397. rsEmoji
  1398. ].join('|'), 'g');
  1399. /** 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/). */
  1400. var reHasUnicode = RegExp('[' + rsZWJ + rsAstralRange + rsComboRange + rsVarRange + ']');
  1401. /** Used to detect strings that need a more robust regexp to match words. */
  1402. 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 ]/;
  1403. /** Used to assign default `context` object properties. */
  1404. var contextProps = [
  1405. 'Array', 'Buffer', 'DataView', 'Date', 'Error', 'Float32Array', 'Float64Array',
  1406. 'Function', 'Int8Array', 'Int16Array', 'Int32Array', 'Map', 'Math', 'Object',
  1407. 'Promise', 'RegExp', 'Set', 'String', 'Symbol', 'TypeError', 'Uint8Array',
  1408. 'Uint8ClampedArray', 'Uint16Array', 'Uint32Array', 'WeakMap',
  1409. '_', 'clearTimeout', 'isFinite', 'parseInt', 'setTimeout'
  1410. ];
  1411. /** Used to make template sourceURLs easier to identify. */
  1412. var templateCounter = -1;
  1413. /** Used to identify `toStringTag` values of typed arrays. */
  1414. var typedArrayTags = {};
  1415. typedArrayTags[float32Tag] = typedArrayTags[float64Tag] =
  1416. typedArrayTags[int8Tag] = typedArrayTags[int16Tag] =
  1417. typedArrayTags[int32Tag] = typedArrayTags[uint8Tag] =
  1418. typedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] =
  1419. typedArrayTags[uint32Tag] = true;
  1420. typedArrayTags[argsTag] = typedArrayTags[arrayTag] =
  1421. typedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] =
  1422. typedArrayTags[dataViewTag] = typedArrayTags[dateTag] =
  1423. typedArrayTags[errorTag] = typedArrayTags[funcTag] =
  1424. typedArrayTags[mapTag] = typedArrayTags[numberTag] =
  1425. typedArrayTags[objectTag] = typedArrayTags[regexpTag] =
  1426. typedArrayTags[setTag] = typedArrayTags[stringTag] =
  1427. typedArrayTags[weakMapTag] = false;
  1428. /** Used to identify `toStringTag` values supported by `_.clone`. */
  1429. var cloneableTags = {};
  1430. cloneableTags[argsTag] = cloneableTags[arrayTag] =
  1431. cloneableTags[arrayBufferTag] = cloneableTags[dataViewTag] =
  1432. cloneableTags[boolTag] = cloneableTags[dateTag] =
  1433. cloneableTags[float32Tag] = cloneableTags[float64Tag] =
  1434. cloneableTags[int8Tag] = cloneableTags[int16Tag] =
  1435. cloneableTags[int32Tag] = cloneableTags[mapTag] =
  1436. cloneableTags[numberTag] = cloneableTags[objectTag] =
  1437. cloneableTags[regexpTag] = cloneableTags[setTag] =
  1438. cloneableTags[stringTag] = cloneableTags[symbolTag] =
  1439. cloneableTags[uint8Tag] = cloneableTags[uint8ClampedTag] =
  1440. cloneableTags[uint16Tag] = cloneableTags[uint32Tag] = true;
  1441. cloneableTags[errorTag] = cloneableTags[funcTag] =
  1442. cloneableTags[weakMapTag] = false;
  1443. /** Used to map Latin Unicode letters to basic Latin letters. */
  1444. var deburredLetters = {
  1445. // Latin-1 Supplement block.
  1446. '\xc0': 'A', '\xc1': 'A', '\xc2': 'A', '\xc3': 'A', '\xc4': 'A', '\xc5': 'A',
  1447. '\xe0': 'a', '\xe1': 'a', '\xe2': 'a', '\xe3': 'a', '\xe4': 'a', '\xe5': 'a',
  1448. '\xc7': 'C', '\xe7': 'c',
  1449. '\xd0': 'D', '\xf0': 'd',
  1450. '\xc8': 'E', '\xc9': 'E', '\xca': 'E', '\xcb': 'E',
  1451. '\xe8': 'e', '\xe9': 'e', '\xea': 'e', '\xeb': 'e',
  1452. '\xcc': 'I', '\xcd': 'I', '\xce': 'I', '\xcf': 'I',
  1453. '\xec': 'i', '\xed': 'i', '\xee': 'i', '\xef': 'i',
  1454. '\xd1': 'N', '\xf1': 'n',
  1455. '\xd2': 'O', '\xd3': 'O', '\xd4': 'O', '\xd5': 'O', '\xd6': 'O', '\xd8': 'O',
  1456. '\xf2': 'o', '\xf3': 'o', '\xf4': 'o', '\xf5': 'o', '\xf6': 'o', '\xf8': 'o',
  1457. '\xd9': 'U', '\xda': 'U', '\xdb': 'U', '\xdc': 'U',
  1458. '\xf9': 'u', '\xfa': 'u', '\xfb': 'u', '\xfc': 'u',
  1459. '\xdd': 'Y', '\xfd': 'y', '\xff': 'y',
  1460. '\xc6': 'Ae', '\xe6': 'ae',
  1461. '\xde': 'Th', '\xfe': 'th',
  1462. '\xdf': 'ss',
  1463. // Latin Extended-A block.
  1464. '\u0100': 'A', '\u0102': 'A', '\u0104': 'A',
  1465. '\u0101': 'a', '\u0103': 'a', '\u0105': 'a',
  1466. '\u0106': 'C', '\u0108': 'C', '\u010a': 'C', '\u010c': 'C',
  1467. '\u0107': 'c', '\u0109': 'c', '\u010b': 'c', '\u010d': 'c',
  1468. '\u010e': 'D', '\u0110': 'D', '\u010f': 'd', '\u0111': 'd',
  1469. '\u0112': 'E', '\u0114': 'E', '\u0116': 'E', '\u0118': 'E', '\u011a': 'E',
  1470. '\u0113': 'e', '\u0115': 'e', '\u0117': 'e', '\u0119': 'e', '\u011b': 'e',
  1471. '\u011c': 'G', '\u011e': 'G', '\u0120': 'G', '\u0122': 'G',
  1472. '\u011d': 'g', '\u011f': 'g', '\u0121': 'g', '\u0123': 'g',
  1473. '\u0124': 'H', '\u0126': 'H', '\u0125': 'h', '\u0127': 'h',
  1474. '\u0128': 'I', '\u012a': 'I', '\u012c': 'I', '\u012e': 'I', '\u0130': 'I',
  1475. '\u0129': 'i', '\u012b': 'i', '\u012d': 'i', '\u012f': 'i', '\u0131': 'i',
  1476. '\u0134': 'J', '\u0135': 'j',
  1477. '\u0136': 'K', '\u0137': 'k', '\u0138': 'k',
  1478. '\u0139': 'L', '\u013b': 'L', '\u013d': 'L', '\u013f': 'L', '\u0141': 'L',
  1479. '\u013a': 'l', '\u013c': 'l', '\u013e': 'l', '\u0140': 'l', '\u0142': 'l',
  1480. '\u0143': 'N', '\u0145': 'N', '\u0147': 'N', '\u014a': 'N',
  1481. '\u0144': 'n', '\u0146': 'n', '\u0148': 'n', '\u014b': 'n',
  1482. '\u014c': 'O', '\u014e': 'O', '\u0150': 'O',
  1483. '\u014d': 'o', '\u014f': 'o', '\u0151': 'o',
  1484. '\u0154': 'R', '\u0156': 'R', '\u0158': 'R',
  1485. '\u0155': 'r', '\u0157': 'r', '\u0159': 'r',
  1486. '\u015a': 'S', '\u015c': 'S', '\u015e': 'S', '\u0160': 'S',
  1487. '\u015b': 's', '\u015d': 's', '\u015f': 's', '\u0161': 's',
  1488. '\u0162': 'T', '\u0164': 'T', '\u0166': 'T',
  1489. '\u0163': 't', '\u0165': 't', '\u0167': 't',
  1490. '\u0168': 'U', '\u016a': 'U', '\u016c': 'U', '\u016e': 'U', '\u0170': 'U', '\u0172': 'U',
  1491. '\u0169': 'u', '\u016b': 'u', '\u016d': 'u', '\u016f': 'u', '\u0171': 'u', '\u0173': 'u',
  1492. '\u0174': 'W', '\u0175': 'w',
  1493. '\u0176': 'Y', '\u0177': 'y', '\u0178': 'Y',
  1494. '\u0179': 'Z', '\u017b': 'Z', '\u017d': 'Z',
  1495. '\u017a': 'z', '\u017c': 'z', '\u017e': 'z',
  1496. '\u0132': 'IJ', '\u0133': 'ij',
  1497. '\u0152': 'Oe', '\u0153': 'oe',
  1498. '\u0149': "'n", '\u017f': 's'
  1499. };
  1500. /** Used to map characters to HTML entities. */
  1501. var htmlEscapes = {
  1502. '&': '&amp;',
  1503. '<': '&lt;',
  1504. '>': '&gt;',
  1505. '"': '&quot;',
  1506. "'": '&#39;'
  1507. };
  1508. /** Used to map HTML entities to characters. */
  1509. var htmlUnescapes = {
  1510. '&amp;': '&',
  1511. '&lt;': '<',
  1512. '&gt;': '>',
  1513. '&quot;': '"',
  1514. '&#39;': "'"
  1515. };
  1516. /** Used to escape characters for inclusion in compiled string literals. */
  1517. var stringEscapes = {
  1518. '\\': '\\',
  1519. "'": "'",
  1520. '\n': 'n',
  1521. '\r': 'r',
  1522. '\u2028': 'u2028',
  1523. '\u2029': 'u2029'
  1524. };
  1525. /** Built-in method references without a dependency on `root`. */
  1526. var freeParseFloat = parseFloat,
  1527. freeParseInt = parseInt;
  1528. /** Detect free variable `global` from Node.js. */
  1529. var freeGlobal = typeof __webpack_require__.g == 'object' && __webpack_require__.g && __webpack_require__.g.Object === Object && __webpack_require__.g;
  1530. /** Detect free variable `self`. */
  1531. var freeSelf = typeof self == 'object' && self && self.Object === Object && self;
  1532. /** Used as a reference to the global object. */
  1533. var root = freeGlobal || freeSelf || Function('return this')();
  1534. /** Detect free variable `exports`. */
  1535. var freeExports = true && exports && !exports.nodeType && exports;
  1536. /** Detect free variable `module`. */
  1537. var freeModule = freeExports && "object" == 'object' && module && !module.nodeType && module;
  1538. /** Detect the popular CommonJS extension `module.exports`. */
  1539. var moduleExports = freeModule && freeModule.exports === freeExports;
  1540. /** Detect free variable `process` from Node.js. */
  1541. var freeProcess = moduleExports && freeGlobal.process;
  1542. /** Used to access faster Node.js helpers. */
  1543. var nodeUtil = (function() {
  1544. try {
  1545. // Use `util.types` for Node.js 10+.
  1546. var types = freeModule && freeModule.require && freeModule.require('util').types;
  1547. if (types) {
  1548. return types;
  1549. }
  1550. // Legacy `process.binding('util')` for Node.js < 10.
  1551. return freeProcess && freeProcess.binding && freeProcess.binding('util');
  1552. } catch (e) {}
  1553. }());
  1554. /* Node.js helper references. */
  1555. var nodeIsArrayBuffer = nodeUtil && nodeUtil.isArrayBuffer,
  1556. nodeIsDate = nodeUtil && nodeUtil.isDate,
  1557. nodeIsMap = nodeUtil && nodeUtil.isMap,
  1558. nodeIsRegExp = nodeUtil && nodeUtil.isRegExp,
  1559. nodeIsSet = nodeUtil && nodeUtil.isSet,
  1560. nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray;
  1561. /*--------------------------------------------------------------------------*/
  1562. /**
  1563. * A faster alternative to `Function#apply`, this function invokes `func`
  1564. * with the `this` binding of `thisArg` and the arguments of `args`.
  1565. *
  1566. * @private
  1567. * @param {Function} func The function to invoke.
  1568. * @param {*} thisArg The `this` binding of `func`.
  1569. * @param {Array} args The arguments to invoke `func` with.
  1570. * @returns {*} Returns the result of `func`.
  1571. */
  1572. function apply(func, thisArg, args) {
  1573. switch (args.length) {
  1574. case 0: return func.call(thisArg);
  1575. case 1: return func.call(thisArg, args[0]);
  1576. case 2: return func.call(thisArg, args[0], args[1]);
  1577. case 3: return func.call(thisArg, args[0], args[1], args[2]);
  1578. }
  1579. return func.apply(thisArg, args);
  1580. }
  1581. /**
  1582. * A specialized version of `baseAggregator` for arrays.
  1583. *
  1584. * @private
  1585. * @param {Array} [array] The array to iterate over.
  1586. * @param {Function} setter The function to set `accumulator` values.
  1587. * @param {Function} iteratee The iteratee to transform keys.
  1588. * @param {Object} accumulator The initial aggregated object.
  1589. * @returns {Function} Returns `accumulator`.
  1590. */
  1591. function arrayAggregator(array, setter, iteratee, accumulator) {
  1592. var index = -1,
  1593. length = array == null ? 0 : array.length;
  1594. while (++index < length) {
  1595. var value = array[index];
  1596. setter(accumulator, value, iteratee(value), array);
  1597. }
  1598. return accumulator;
  1599. }
  1600. /**
  1601. * A specialized version of `_.forEach` for arrays without support for
  1602. * iteratee shorthands.
  1603. *
  1604. * @private
  1605. * @param {Array} [array] The array to iterate over.
  1606. * @param {Function} iteratee The function invoked per iteration.
  1607. * @returns {Array} Returns `array`.
  1608. */
  1609. function arrayEach(array, iteratee) {
  1610. var index = -1,
  1611. length = array == null ? 0 : array.length;
  1612. while (++index < length) {
  1613. if (iteratee(array[index], index, array) === false) {
  1614. break;
  1615. }
  1616. }
  1617. return array;
  1618. }
  1619. /**
  1620. * A specialized version of `_.forEachRight` for arrays without support for
  1621. * iteratee shorthands.
  1622. *
  1623. * @private
  1624. * @param {Array} [array] The array to iterate over.
  1625. * @param {Function} iteratee The function invoked per iteration.
  1626. * @returns {Array} Returns `array`.
  1627. */
  1628. function arrayEachRight(array, iteratee) {
  1629. var length = array == null ? 0 : array.length;
  1630. while (length--) {
  1631. if (iteratee(array[length], length, array) === false) {
  1632. break;
  1633. }
  1634. }
  1635. return array;
  1636. }
  1637. /**
  1638. * A specialized version of `_.every` for arrays without support for
  1639. * iteratee shorthands.
  1640. *
  1641. * @private
  1642. * @param {Array} [array] The array to iterate over.
  1643. * @param {Function} predicate The function invoked per iteration.
  1644. * @returns {boolean} Returns `true` if all elements pass the predicate check,
  1645. * else `false`.
  1646. */
  1647. function arrayEvery(array, predicate) {
  1648. var index = -1,
  1649. length = array == null ? 0 : array.length;
  1650. while (++index < length) {
  1651. if (!predicate(array[index], index, array)) {
  1652. return false;
  1653. }
  1654. }
  1655. return true;
  1656. }
  1657. /**
  1658. * A specialized version of `_.filter` for arrays without support for
  1659. * iteratee shorthands.
  1660. *
  1661. * @private
  1662. * @param {Array} [array] The array to iterate over.
  1663. * @param {Function} predicate The function invoked per iteration.
  1664. * @returns {Array} Returns the new filtered array.
  1665. */
  1666. function arrayFilter(array, predicate) {
  1667. var index = -1,
  1668. length = array == null ? 0 : array.length,
  1669. resIndex = 0,
  1670. result = [];
  1671. while (++index < length) {
  1672. var value = array[index];
  1673. if (predicate(value, index, array)) {
  1674. result[resIndex++] = value;
  1675. }
  1676. }
  1677. return result;
  1678. }
  1679. /**
  1680. * A specialized version of `_.includes` for arrays without support for
  1681. * specifying an index to search from.
  1682. *
  1683. * @private
  1684. * @param {Array} [array] The array to inspect.
  1685. * @param {*} target The value to search for.
  1686. * @returns {boolean} Returns `true` if `target` is found, else `false`.
  1687. */
  1688. function arrayIncludes(array, value) {
  1689. var length = array == null ? 0 : array.length;
  1690. return !!length && baseIndexOf(array, value, 0) > -1;
  1691. }
  1692. /**
  1693. * This function is like `arrayIncludes` except that it accepts a comparator.
  1694. *
  1695. * @private
  1696. * @param {Array} [array] The array to inspect.
  1697. * @param {*} target The value to search for.
  1698. * @param {Function} comparator The comparator invoked per element.
  1699. * @returns {boolean} Returns `true` if `target` is found, else `false`.
  1700. */
  1701. function arrayIncludesWith(array, value, comparator) {
  1702. var index = -1,
  1703. length = array == null ? 0 : array.length;
  1704. while (++index < length) {
  1705. if (comparator(value, array[index])) {
  1706. return true;
  1707. }
  1708. }
  1709. return false;
  1710. }
  1711. /**
  1712. * A specialized version of `_.map` for arrays without support for iteratee
  1713. * shorthands.
  1714. *
  1715. * @private
  1716. * @param {Array} [array] The array to iterate over.
  1717. * @param {Function} iteratee The function invoked per iteration.
  1718. * @returns {Array} Returns the new mapped array.
  1719. */
  1720. function arrayMap(array, iteratee) {
  1721. var index = -1,
  1722. length = array == null ? 0 : array.length,
  1723. result = Array(length);
  1724. while (++index < length) {
  1725. result[index] = iteratee(array[index], index, array);
  1726. }
  1727. return result;
  1728. }
  1729. /**
  1730. * Appends the elements of `values` to `array`.
  1731. *
  1732. * @private
  1733. * @param {Array} array The array to modify.
  1734. * @param {Array} values The values to append.
  1735. * @returns {Array} Returns `array`.
  1736. */
  1737. function arrayPush(array, values) {
  1738. var index = -1,
  1739. length = values.length,
  1740. offset = array.length;
  1741. while (++index < length) {
  1742. array[offset + index] = values[index];
  1743. }
  1744. return array;
  1745. }
  1746. /**
  1747. * A specialized version of `_.reduce` for arrays without support for
  1748. * iteratee shorthands.
  1749. *
  1750. * @private
  1751. * @param {Array} [array] The array to iterate over.
  1752. * @param {Function} iteratee The function invoked per iteration.
  1753. * @param {*} [accumulator] The initial value.
  1754. * @param {boolean} [initAccum] Specify using the first element of `array` as
  1755. * the initial value.
  1756. * @returns {*} Returns the accumulated value.
  1757. */
  1758. function arrayReduce(array, iteratee, accumulator, initAccum) {
  1759. var index = -1,
  1760. length = array == null ? 0 : array.length;
  1761. if (initAccum && length) {
  1762. accumulator = array[++index];
  1763. }
  1764. while (++index < length) {
  1765. accumulator = iteratee(accumulator, array[index], index, array);
  1766. }
  1767. return accumulator;
  1768. }
  1769. /**
  1770. * A specialized version of `_.reduceRight` for arrays without support for
  1771. * iteratee shorthands.
  1772. *
  1773. * @private
  1774. * @param {Array} [array] The array to iterate over.
  1775. * @param {Function} iteratee The function invoked per iteration.
  1776. * @param {*} [accumulator] The initial value.
  1777. * @param {boolean} [initAccum] Specify using the last element of `array` as
  1778. * the initial value.
  1779. * @returns {*} Returns the accumulated value.
  1780. */
  1781. function arrayReduceRight(array, iteratee, accumulator, initAccum) {
  1782. var length = array == null ? 0 : array.length;
  1783. if (initAccum && length) {
  1784. accumulator = array[--length];
  1785. }
  1786. while (length--) {
  1787. accumulator = iteratee(accumulator, array[length], length, array);
  1788. }
  1789. return accumulator;
  1790. }
  1791. /**
  1792. * A specialized version of `_.some` for arrays without support for iteratee
  1793. * shorthands.
  1794. *
  1795. * @private
  1796. * @param {Array} [array] The array to iterate over.
  1797. * @param {Function} predicate The function invoked per iteration.
  1798. * @returns {boolean} Returns `true` if any element passes the predicate check,
  1799. * else `false`.
  1800. */
  1801. function arraySome(array, predicate) {
  1802. var index = -1,
  1803. length = array == null ? 0 : array.length;
  1804. while (++index < length) {
  1805. if (predicate(array[index], index, array)) {
  1806. return true;
  1807. }
  1808. }
  1809. return false;
  1810. }
  1811. /**
  1812. * Gets the size of an ASCII `string`.
  1813. *
  1814. * @private
  1815. * @param {string} string The string inspect.
  1816. * @returns {number} Returns the string size.
  1817. */
  1818. var asciiSize = baseProperty('length');
  1819. /**
  1820. * Converts an ASCII `string` to an array.
  1821. *
  1822. * @private
  1823. * @param {string} string The string to convert.
  1824. * @returns {Array} Returns the converted array.
  1825. */
  1826. function asciiToArray(string) {
  1827. return string.split('');
  1828. }
  1829. /**
  1830. * Splits an ASCII `string` into an array of its words.
  1831. *
  1832. * @private
  1833. * @param {string} The string to inspect.
  1834. * @returns {Array} Returns the words of `string`.
  1835. */
  1836. function asciiWords(string) {
  1837. return string.match(reAsciiWord) || [];
  1838. }
  1839. /**
  1840. * The base implementation of methods like `_.findKey` and `_.findLastKey`,
  1841. * without support for iteratee shorthands, which iterates over `collection`
  1842. * using `eachFunc`.
  1843. *
  1844. * @private
  1845. * @param {Array|Object} collection The collection to inspect.
  1846. * @param {Function} predicate The function invoked per iteration.
  1847. * @param {Function} eachFunc The function to iterate over `collection`.
  1848. * @returns {*} Returns the found element or its key, else `undefined`.
  1849. */
  1850. function baseFindKey(collection, predicate, eachFunc) {
  1851. var result;
  1852. eachFunc(collection, function(value, key, collection) {
  1853. if (predicate(value, key, collection)) {
  1854. result = key;
  1855. return false;
  1856. }
  1857. });
  1858. return result;
  1859. }
  1860. /**
  1861. * The base implementation of `_.findIndex` and `_.findLastIndex` without
  1862. * support for iteratee shorthands.
  1863. *
  1864. * @private
  1865. * @param {Array} array The array to inspect.
  1866. * @param {Function} predicate The function invoked per iteration.
  1867. * @param {number} fromIndex The index to search from.
  1868. * @param {boolean} [fromRight] Specify iterating from right to left.
  1869. * @returns {number} Returns the index of the matched value, else `-1`.
  1870. */
  1871. function baseFindIndex(array, predicate, fromIndex, fromRight) {
  1872. var length = array.length,
  1873. index = fromIndex + (fromRight ? 1 : -1);
  1874. while ((fromRight ? index-- : ++index < length)) {
  1875. if (predicate(array[index], index, array)) {
  1876. return index;
  1877. }
  1878. }
  1879. return -1;
  1880. }
  1881. /**
  1882. * The base implementation of `_.indexOf` without `fromIndex` bounds checks.
  1883. *
  1884. * @private
  1885. * @param {Array} array The array to inspect.
  1886. * @param {*} value The value to search for.
  1887. * @param {number} fromIndex The index to search from.
  1888. * @returns {number} Returns the index of the matched value, else `-1`.
  1889. */
  1890. function baseIndexOf(array, value, fromIndex) {
  1891. return value === value
  1892. ? strictIndexOf(array, value, fromIndex)
  1893. : baseFindIndex(array, baseIsNaN, fromIndex);
  1894. }
  1895. /**
  1896. * This function is like `baseIndexOf` except that it accepts a comparator.
  1897. *
  1898. * @private
  1899. * @param {Array} array The array to inspect.
  1900. * @param {*} value The value to search for.
  1901. * @param {number} fromIndex The index to search from.
  1902. * @param {Function} comparator The comparator invoked per element.
  1903. * @returns {number} Returns the index of the matched value, else `-1`.
  1904. */
  1905. function baseIndexOfWith(array, value, fromIndex, comparator) {
  1906. var index = fromIndex - 1,
  1907. length = array.length;
  1908. while (++index < length) {
  1909. if (comparator(array[index], value)) {
  1910. return index;
  1911. }
  1912. }
  1913. return -1;
  1914. }
  1915. /**
  1916. * The base implementation of `_.isNaN` without support for number objects.
  1917. *
  1918. * @private
  1919. * @param {*} value The value to check.
  1920. * @returns {boolean} Returns `true` if `value` is `NaN`, else `false`.
  1921. */
  1922. function baseIsNaN(value) {
  1923. return value !== value;
  1924. }
  1925. /**
  1926. * The base implementation of `_.mean` and `_.meanBy` without support for
  1927. * iteratee shorthands.
  1928. *
  1929. * @private
  1930. * @param {Array} array The array to iterate over.
  1931. * @param {Function} iteratee The function invoked per iteration.
  1932. * @returns {number} Returns the mean.
  1933. */
  1934. function baseMean(array, iteratee) {
  1935. var length = array == null ? 0 : array.length;
  1936. return length ? (baseSum(array, iteratee) / length) : NAN;
  1937. }
  1938. /**
  1939. * The base implementation of `_.property` without support for deep paths.
  1940. *
  1941. * @private
  1942. * @param {string} key The key of the property to get.
  1943. * @returns {Function} Returns the new accessor function.
  1944. */
  1945. function baseProperty(key) {
  1946. return function(object) {
  1947. return object == null ? undefined : object[key];
  1948. };
  1949. }
  1950. /**
  1951. * The base implementation of `_.propertyOf` without support for deep paths.
  1952. *
  1953. * @private
  1954. * @param {Object} object The object to query.
  1955. * @returns {Function} Returns the new accessor function.
  1956. */
  1957. function basePropertyOf(object) {
  1958. return function(key) {
  1959. return object == null ? undefined : object[key];
  1960. };
  1961. }
  1962. /**
  1963. * The base implementation of `_.reduce` and `_.reduceRight`, without support
  1964. * for iteratee shorthands, which iterates over `collection` using `eachFunc`.
  1965. *
  1966. * @private
  1967. * @param {Array|Object} collection The collection to iterate over.
  1968. * @param {Function} iteratee The function invoked per iteration.
  1969. * @param {*} accumulator The initial value.
  1970. * @param {boolean} initAccum Specify using the first or last element of
  1971. * `collection` as the initial value.
  1972. * @param {Function} eachFunc The function to iterate over `collection`.
  1973. * @returns {*} Returns the accumulated value.
  1974. */
  1975. function baseReduce(collection, iteratee, accumulator, initAccum, eachFunc) {
  1976. eachFunc(collection, function(value, index, collection) {
  1977. accumulator = initAccum
  1978. ? (initAccum = false, value)
  1979. : iteratee(accumulator, value, index, collection);
  1980. });
  1981. return accumulator;
  1982. }
  1983. /**
  1984. * The base implementation of `_.sortBy` which uses `comparer` to define the
  1985. * sort order of `array` and replaces criteria objects with their corresponding
  1986. * values.
  1987. *
  1988. * @private
  1989. * @param {Array} array The array to sort.
  1990. * @param {Function} comparer The function to define sort order.
  1991. * @returns {Array} Returns `array`.
  1992. */
  1993. function baseSortBy(array, comparer) {
  1994. var length = array.length;
  1995. array.sort(comparer);
  1996. while (length--) {
  1997. array[length] = array[length].value;
  1998. }
  1999. return array;
  2000. }
  2001. /**
  2002. * The base implementation of `_.sum` and `_.sumBy` without support for
  2003. * iteratee shorthands.
  2004. *
  2005. * @private
  2006. * @param {Array} array The array to iterate over.
  2007. * @param {Function} iteratee The function invoked per iteration.
  2008. * @returns {number} Returns the sum.
  2009. */
  2010. function baseSum(array, iteratee) {
  2011. var result,
  2012. index = -1,
  2013. length = array.length;
  2014. while (++index < length) {
  2015. var current = iteratee(array[index]);
  2016. if (current !== undefined) {
  2017. result = result === undefined ? current : (result + current);
  2018. }
  2019. }
  2020. return result;
  2021. }
  2022. /**
  2023. * The base implementation of `_.times` without support for iteratee shorthands
  2024. * or max array length checks.
  2025. *
  2026. * @private
  2027. * @param {number} n The number of times to invoke `iteratee`.
  2028. * @param {Function} iteratee The function invoked per iteration.
  2029. * @returns {Array} Returns the array of results.
  2030. */
  2031. function baseTimes(n, iteratee) {
  2032. var index = -1,
  2033. result = Array(n);
  2034. while (++index < n) {
  2035. result[index] = iteratee(index);
  2036. }
  2037. return result;
  2038. }
  2039. /**
  2040. * The base implementation of `_.toPairs` and `_.toPairsIn` which creates an array
  2041. * of key-value pairs for `object` corresponding to the property names of `props`.
  2042. *
  2043. * @private
  2044. * @param {Object} object The object to query.
  2045. * @param {Array} props The property names to get values for.
  2046. * @returns {Object} Returns the key-value pairs.
  2047. */
  2048. function baseToPairs(object, props) {
  2049. return arrayMap(props, function(key) {
  2050. return [key, object[key]];
  2051. });
  2052. }
  2053. /**
  2054. * The base implementation of `_.trim`.
  2055. *
  2056. * @private
  2057. * @param {string} string The string to trim.
  2058. * @returns {string} Returns the trimmed string.
  2059. */
  2060. function baseTrim(string) {
  2061. return string
  2062. ? string.slice(0, trimmedEndIndex(string) + 1).replace(reTrimStart, '')
  2063. : string;
  2064. }
  2065. /**
  2066. * The base implementation of `_.unary` without support for storing metadata.
  2067. *
  2068. * @private
  2069. * @param {Function} func The function to cap arguments for.
  2070. * @returns {Function} Returns the new capped function.
  2071. */
  2072. function baseUnary(func) {
  2073. return function(value) {
  2074. return func(value);
  2075. };
  2076. }
  2077. /**
  2078. * The base implementation of `_.values` and `_.valuesIn` which creates an
  2079. * array of `object` property values corresponding to the property names
  2080. * of `props`.
  2081. *
  2082. * @private
  2083. * @param {Object} object The object to query.
  2084. * @param {Array} props The property names to get values for.
  2085. * @returns {Object} Returns the array of property values.
  2086. */
  2087. function baseValues(object, props) {
  2088. return arrayMap(props, function(key) {
  2089. return object[key];
  2090. });
  2091. }
  2092. /**
  2093. * Checks if a `cache` value for `key` exists.
  2094. *
  2095. * @private
  2096. * @param {Object} cache The cache to query.
  2097. * @param {string} key The key of the entry to check.
  2098. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  2099. */
  2100. function cacheHas(cache, key) {
  2101. return cache.has(key);
  2102. }
  2103. /**
  2104. * Used by `_.trim` and `_.trimStart` to get the index of the first string symbol
  2105. * that is not found in the character symbols.
  2106. *
  2107. * @private
  2108. * @param {Array} strSymbols The string symbols to inspect.
  2109. * @param {Array} chrSymbols The character symbols to find.
  2110. * @returns {number} Returns the index of the first unmatched string symbol.
  2111. */
  2112. function charsStartIndex(strSymbols, chrSymbols) {
  2113. var index = -1,
  2114. length = strSymbols.length;
  2115. while (++index < length && baseIndexOf(chrSymbols, strSymbols[index], 0) > -1) {}
  2116. return index;
  2117. }
  2118. /**
  2119. * Used by `_.trim` and `_.trimEnd` to get the index of the last string symbol
  2120. * that is not found in the character symbols.
  2121. *
  2122. * @private
  2123. * @param {Array} strSymbols The string symbols to inspect.
  2124. * @param {Array} chrSymbols The character symbols to find.
  2125. * @returns {number} Returns the index of the last unmatched string symbol.
  2126. */
  2127. function charsEndIndex(strSymbols, chrSymbols) {
  2128. var index = strSymbols.length;
  2129. while (index-- && baseIndexOf(chrSymbols, strSymbols[index], 0) > -1) {}
  2130. return index;
  2131. }
  2132. /**
  2133. * Gets the number of `placeholder` occurrences in `array`.
  2134. *
  2135. * @private
  2136. * @param {Array} array The array to inspect.
  2137. * @param {*} placeholder The placeholder to search for.
  2138. * @returns {number} Returns the placeholder count.
  2139. */
  2140. function countHolders(array, placeholder) {
  2141. var length = array.length,
  2142. result = 0;
  2143. while (length--) {
  2144. if (array[length] === placeholder) {
  2145. ++result;
  2146. }
  2147. }
  2148. return result;
  2149. }
  2150. /**
  2151. * Used by `_.deburr` to convert Latin-1 Supplement and Latin Extended-A
  2152. * letters to basic Latin letters.
  2153. *
  2154. * @private
  2155. * @param {string} letter The matched letter to deburr.
  2156. * @returns {string} Returns the deburred letter.
  2157. */
  2158. var deburrLetter = basePropertyOf(deburredLetters);
  2159. /**
  2160. * Used by `_.escape` to convert characters to HTML entities.
  2161. *
  2162. * @private
  2163. * @param {string} chr The matched character to escape.
  2164. * @returns {string} Returns the escaped character.
  2165. */
  2166. var escapeHtmlChar = basePropertyOf(htmlEscapes);
  2167. /**
  2168. * Used by `_.template` to escape characters for inclusion in compiled string literals.
  2169. *
  2170. * @private
  2171. * @param {string} chr The matched character to escape.
  2172. * @returns {string} Returns the escaped character.
  2173. */
  2174. function escapeStringChar(chr) {
  2175. return '\\' + stringEscapes[chr];
  2176. }
  2177. /**
  2178. * Gets the value at `key` of `object`.
  2179. *
  2180. * @private
  2181. * @param {Object} [object] The object to query.
  2182. * @param {string} key The key of the property to get.
  2183. * @returns {*} Returns the property value.
  2184. */
  2185. function getValue(object, key) {
  2186. return object == null ? undefined : object[key];
  2187. }
  2188. /**
  2189. * Checks if `string` contains Unicode symbols.
  2190. *
  2191. * @private
  2192. * @param {string} string The string to inspect.
  2193. * @returns {boolean} Returns `true` if a symbol is found, else `false`.
  2194. */
  2195. function hasUnicode(string) {
  2196. return reHasUnicode.test(string);
  2197. }
  2198. /**
  2199. * Checks if `string` contains a word composed of Unicode symbols.
  2200. *
  2201. * @private
  2202. * @param {string} string The string to inspect.
  2203. * @returns {boolean} Returns `true` if a word is found, else `false`.
  2204. */
  2205. function hasUnicodeWord(string) {
  2206. return reHasUnicodeWord.test(string);
  2207. }
  2208. /**
  2209. * Converts `iterator` to an array.
  2210. *
  2211. * @private
  2212. * @param {Object} iterator The iterator to convert.
  2213. * @returns {Array} Returns the converted array.
  2214. */
  2215. function iteratorToArray(iterator) {
  2216. var data,
  2217. result = [];
  2218. while (!(data = iterator.next()).done) {
  2219. result.push(data.value);
  2220. }
  2221. return result;
  2222. }
  2223. /**
  2224. * Converts `map` to its key-value pairs.
  2225. *
  2226. * @private
  2227. * @param {Object} map The map to convert.
  2228. * @returns {Array} Returns the key-value pairs.
  2229. */
  2230. function mapToArray(map) {
  2231. var index = -1,
  2232. result = Array(map.size);
  2233. map.forEach(function(value, key) {
  2234. result[++index] = [key, value];
  2235. });
  2236. return result;
  2237. }
  2238. /**
  2239. * Creates a unary function that invokes `func` with its argument transformed.
  2240. *
  2241. * @private
  2242. * @param {Function} func The function to wrap.
  2243. * @param {Function} transform The argument transform.
  2244. * @returns {Function} Returns the new function.
  2245. */
  2246. function overArg(func, transform) {
  2247. return function(arg) {
  2248. return func(transform(arg));
  2249. };
  2250. }
  2251. /**
  2252. * Replaces all `placeholder` elements in `array` with an internal placeholder
  2253. * and returns an array of their indexes.
  2254. *
  2255. * @private
  2256. * @param {Array} array The array to modify.
  2257. * @param {*} placeholder The placeholder to replace.
  2258. * @returns {Array} Returns the new array of placeholder indexes.
  2259. */
  2260. function replaceHolders(array, placeholder) {
  2261. var index = -1,
  2262. length = array.length,
  2263. resIndex = 0,
  2264. result = [];
  2265. while (++index < length) {
  2266. var value = array[index];
  2267. if (value === placeholder || value === PLACEHOLDER) {
  2268. array[index] = PLACEHOLDER;
  2269. result[resIndex++] = index;
  2270. }
  2271. }
  2272. return result;
  2273. }
  2274. /**
  2275. * Converts `set` to an array of its values.
  2276. *
  2277. * @private
  2278. * @param {Object} set The set to convert.
  2279. * @returns {Array} Returns the values.
  2280. */
  2281. function setToArray(set) {
  2282. var index = -1,
  2283. result = Array(set.size);
  2284. set.forEach(function(value) {
  2285. result[++index] = value;
  2286. });
  2287. return result;
  2288. }
  2289. /**
  2290. * Converts `set` to its value-value pairs.
  2291. *
  2292. * @private
  2293. * @param {Object} set The set to convert.
  2294. * @returns {Array} Returns the value-value pairs.
  2295. */
  2296. function setToPairs(set) {
  2297. var index = -1,
  2298. result = Array(set.size);
  2299. set.forEach(function(value) {
  2300. result[++index] = [value, value];
  2301. });
  2302. return result;
  2303. }
  2304. /**
  2305. * A specialized version of `_.indexOf` which performs strict equality
  2306. * comparisons of values, i.e. `===`.
  2307. *
  2308. * @private
  2309. * @param {Array} array The array to inspect.
  2310. * @param {*} value The value to search for.
  2311. * @param {number} fromIndex The index to search from.
  2312. * @returns {number} Returns the index of the matched value, else `-1`.
  2313. */
  2314. function strictIndexOf(array, value, fromIndex) {
  2315. var index = fromIndex - 1,
  2316. length = array.length;
  2317. while (++index < length) {
  2318. if (array[index] === value) {
  2319. return index;
  2320. }
  2321. }
  2322. return -1;
  2323. }
  2324. /**
  2325. * A specialized version of `_.lastIndexOf` which performs strict equality
  2326. * comparisons of values, i.e. `===`.
  2327. *
  2328. * @private
  2329. * @param {Array} array The array to inspect.
  2330. * @param {*} value The value to search for.
  2331. * @param {number} fromIndex The index to search from.
  2332. * @returns {number} Returns the index of the matched value, else `-1`.
  2333. */
  2334. function strictLastIndexOf(array, value, fromIndex) {
  2335. var index = fromIndex + 1;
  2336. while (index--) {
  2337. if (array[index] === value) {
  2338. return index;
  2339. }
  2340. }
  2341. return index;
  2342. }
  2343. /**
  2344. * Gets the number of symbols in `string`.
  2345. *
  2346. * @private
  2347. * @param {string} string The string to inspect.
  2348. * @returns {number} Returns the string size.
  2349. */
  2350. function stringSize(string) {
  2351. return hasUnicode(string)
  2352. ? unicodeSize(string)
  2353. : asciiSize(string);
  2354. }
  2355. /**
  2356. * Converts `string` to an array.
  2357. *
  2358. * @private
  2359. * @param {string} string The string to convert.
  2360. * @returns {Array} Returns the converted array.
  2361. */
  2362. function stringToArray(string) {
  2363. return hasUnicode(string)
  2364. ? unicodeToArray(string)
  2365. : asciiToArray(string);
  2366. }
  2367. /**
  2368. * Used by `_.trim` and `_.trimEnd` to get the index of the last non-whitespace
  2369. * character of `string`.
  2370. *
  2371. * @private
  2372. * @param {string} string The string to inspect.
  2373. * @returns {number} Returns the index of the last non-whitespace character.
  2374. */
  2375. function trimmedEndIndex(string) {
  2376. var index = string.length;
  2377. while (index-- && reWhitespace.test(string.charAt(index))) {}
  2378. return index;
  2379. }
  2380. /**
  2381. * Used by `_.unescape` to convert HTML entities to characters.
  2382. *
  2383. * @private
  2384. * @param {string} chr The matched character to unescape.
  2385. * @returns {string} Returns the unescaped character.
  2386. */
  2387. var unescapeHtmlChar = basePropertyOf(htmlUnescapes);
  2388. /**
  2389. * Gets the size of a Unicode `string`.
  2390. *
  2391. * @private
  2392. * @param {string} string The string inspect.
  2393. * @returns {number} Returns the string size.
  2394. */
  2395. function unicodeSize(string) {
  2396. var result = reUnicode.lastIndex = 0;
  2397. while (reUnicode.test(string)) {
  2398. ++result;
  2399. }
  2400. return result;
  2401. }
  2402. /**
  2403. * Converts a Unicode `string` to an array.
  2404. *
  2405. * @private
  2406. * @param {string} string The string to convert.
  2407. * @returns {Array} Returns the converted array.
  2408. */
  2409. function unicodeToArray(string) {
  2410. return string.match(reUnicode) || [];
  2411. }
  2412. /**
  2413. * Splits a Unicode `string` into an array of its words.
  2414. *
  2415. * @private
  2416. * @param {string} The string to inspect.
  2417. * @returns {Array} Returns the words of `string`.
  2418. */
  2419. function unicodeWords(string) {
  2420. return string.match(reUnicodeWord) || [];
  2421. }
  2422. /*--------------------------------------------------------------------------*/
  2423. /**
  2424. * Create a new pristine `lodash` function using the `context` object.
  2425. *
  2426. * @static
  2427. * @memberOf _
  2428. * @since 1.1.0
  2429. * @category Util
  2430. * @param {Object} [context=root] The context object.
  2431. * @returns {Function} Returns a new `lodash` function.
  2432. * @example
  2433. *
  2434. * _.mixin({ 'foo': _.constant('foo') });
  2435. *
  2436. * var lodash = _.runInContext();
  2437. * lodash.mixin({ 'bar': lodash.constant('bar') });
  2438. *
  2439. * _.isFunction(_.foo);
  2440. * // => true
  2441. * _.isFunction(_.bar);
  2442. * // => false
  2443. *
  2444. * lodash.isFunction(lodash.foo);
  2445. * // => false
  2446. * lodash.isFunction(lodash.bar);
  2447. * // => true
  2448. *
  2449. * // Create a suped-up `defer` in Node.js.
  2450. * var defer = _.runInContext({ 'setTimeout': setImmediate }).defer;
  2451. */
  2452. var runInContext = (function runInContext(context) {
  2453. context = context == null ? root : _.defaults(root.Object(), context, _.pick(root, contextProps));
  2454. /** Built-in constructor references. */
  2455. var Array = context.Array,
  2456. Date = context.Date,
  2457. Error = context.Error,
  2458. Function = context.Function,
  2459. Math = context.Math,
  2460. Object = context.Object,
  2461. RegExp = context.RegExp,
  2462. String = context.String,
  2463. TypeError = context.TypeError;
  2464. /** Used for built-in method references. */
  2465. var arrayProto = Array.prototype,
  2466. funcProto = Function.prototype,
  2467. objectProto = Object.prototype;
  2468. /** Used to detect overreaching core-js shims. */
  2469. var coreJsData = context['__core-js_shared__'];
  2470. /** Used to resolve the decompiled source of functions. */
  2471. var funcToString = funcProto.toString;
  2472. /** Used to check objects for own properties. */
  2473. var hasOwnProperty = objectProto.hasOwnProperty;
  2474. /** Used to generate unique IDs. */
  2475. var idCounter = 0;
  2476. /** Used to detect methods masquerading as native. */
  2477. var maskSrcKey = (function() {
  2478. var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || '');
  2479. return uid ? ('Symbol(src)_1.' + uid) : '';
  2480. }());
  2481. /**
  2482. * Used to resolve the
  2483. * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
  2484. * of values.
  2485. */
  2486. var nativeObjectToString = objectProto.toString;
  2487. /** Used to infer the `Object` constructor. */
  2488. var objectCtorString = funcToString.call(Object);
  2489. /** Used to restore the original `_` reference in `_.noConflict`. */
  2490. var oldDash = root._;
  2491. /** Used to detect if a method is native. */
  2492. var reIsNative = RegExp('^' +
  2493. funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\$&')
  2494. .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$'
  2495. );
  2496. /** Built-in value references. */
  2497. var Buffer = moduleExports ? context.Buffer : undefined,
  2498. Symbol = context.Symbol,
  2499. Uint8Array = context.Uint8Array,
  2500. allocUnsafe = Buffer ? Buffer.allocUnsafe : undefined,
  2501. getPrototype = overArg(Object.getPrototypeOf, Object),
  2502. objectCreate = Object.create,
  2503. propertyIsEnumerable = objectProto.propertyIsEnumerable,
  2504. splice = arrayProto.splice,
  2505. spreadableSymbol = Symbol ? Symbol.isConcatSpreadable : undefined,
  2506. symIterator = Symbol ? Symbol.iterator : undefined,
  2507. symToStringTag = Symbol ? Symbol.toStringTag : undefined;
  2508. var defineProperty = (function() {
  2509. try {
  2510. var func = getNative(Object, 'defineProperty');
  2511. func({}, '', {});
  2512. return func;
  2513. } catch (e) {}
  2514. }());
  2515. /** Mocked built-ins. */
  2516. var ctxClearTimeout = context.clearTimeout !== root.clearTimeout && context.clearTimeout,
  2517. ctxNow = Date && Date.now !== root.Date.now && Date.now,
  2518. ctxSetTimeout = context.setTimeout !== root.setTimeout && context.setTimeout;
  2519. /* Built-in method references for those with the same name as other `lodash` methods. */
  2520. var nativeCeil = Math.ceil,
  2521. nativeFloor = Math.floor,
  2522. nativeGetSymbols = Object.getOwnPropertySymbols,
  2523. nativeIsBuffer = Buffer ? Buffer.isBuffer : undefined,
  2524. nativeIsFinite = context.isFinite,
  2525. nativeJoin = arrayProto.join,
  2526. nativeKeys = overArg(Object.keys, Object),
  2527. nativeMax = Math.max,
  2528. nativeMin = Math.min,
  2529. nativeNow = Date.now,
  2530. nativeParseInt = context.parseInt,
  2531. nativeRandom = Math.random,
  2532. nativeReverse = arrayProto.reverse;
  2533. /* Built-in method references that are verified to be native. */
  2534. var DataView = getNative(context, 'DataView'),
  2535. Map = getNative(context, 'Map'),
  2536. Promise = getNative(context, 'Promise'),
  2537. Set = getNative(context, 'Set'),
  2538. WeakMap = getNative(context, 'WeakMap'),
  2539. nativeCreate = getNative(Object, 'create');
  2540. /** Used to store function metadata. */
  2541. var metaMap = WeakMap && new WeakMap;
  2542. /** Used to lookup unminified function names. */
  2543. var realNames = {};
  2544. /** Used to detect maps, sets, and weakmaps. */
  2545. var dataViewCtorString = toSource(DataView),
  2546. mapCtorString = toSource(Map),
  2547. promiseCtorString = toSource(Promise),
  2548. setCtorString = toSource(Set),
  2549. weakMapCtorString = toSource(WeakMap);
  2550. /** Used to convert symbols to primitives and strings. */
  2551. var symbolProto = Symbol ? Symbol.prototype : undefined,
  2552. symbolValueOf = symbolProto ? symbolProto.valueOf : undefined,
  2553. symbolToString = symbolProto ? symbolProto.toString : undefined;
  2554. /*------------------------------------------------------------------------*/
  2555. /**
  2556. * Creates a `lodash` object which wraps `value` to enable implicit method
  2557. * chain sequences. Methods that operate on and return arrays, collections,
  2558. * and functions can be chained together. Methods that retrieve a single value
  2559. * or may return a primitive value will automatically end the chain sequence
  2560. * and return the unwrapped value. Otherwise, the value must be unwrapped
  2561. * with `_#value`.
  2562. *
  2563. * Explicit chain sequences, which must be unwrapped with `_#value`, may be
  2564. * enabled using `_.chain`.
  2565. *
  2566. * The execution of chained methods is lazy, that is, it's deferred until
  2567. * `_#value` is implicitly or explicitly called.
  2568. *
  2569. * Lazy evaluation allows several methods to support shortcut fusion.
  2570. * Shortcut fusion is an optimization to merge iteratee calls; this avoids
  2571. * the creation of intermediate arrays and can greatly reduce the number of
  2572. * iteratee executions. Sections of a chain sequence qualify for shortcut
  2573. * fusion if the section is applied to an array and iteratees accept only
  2574. * one argument. The heuristic for whether a section qualifies for shortcut
  2575. * fusion is subject to change.
  2576. *
  2577. * Chaining is supported in custom builds as long as the `_#value` method is
  2578. * directly or indirectly included in the build.
  2579. *
  2580. * In addition to lodash methods, wrappers have `Array` and `String` methods.
  2581. *
  2582. * The wrapper `Array` methods are:
  2583. * `concat`, `join`, `pop`, `push`, `shift`, `sort`, `splice`, and `unshift`
  2584. *
  2585. * The wrapper `String` methods are:
  2586. * `replace` and `split`
  2587. *
  2588. * The wrapper methods that support shortcut fusion are:
  2589. * `at`, `compact`, `drop`, `dropRight`, `dropWhile`, `filter`, `find`,
  2590. * `findLast`, `head`, `initial`, `last`, `map`, `reject`, `reverse`, `slice`,
  2591. * `tail`, `take`, `takeRight`, `takeRightWhile`, `takeWhile`, and `toArray`
  2592. *
  2593. * The chainable wrapper methods are:
  2594. * `after`, `ary`, `assign`, `assignIn`, `assignInWith`, `assignWith`, `at`,
  2595. * `before`, `bind`, `bindAll`, `bindKey`, `castArray`, `chain`, `chunk`,
  2596. * `commit`, `compact`, `concat`, `conforms`, `constant`, `countBy`, `create`,
  2597. * `curry`, `debounce`, `defaults`, `defaultsDeep`, `defer`, `delay`,
  2598. * `difference`, `differenceBy`, `differenceWith`, `drop`, `dropRight`,
  2599. * `dropRightWhile`, `dropWhile`, `extend`, `extendWith`, `fill`, `filter`,
  2600. * `flatMap`, `flatMapDeep`, `flatMapDepth`, `flatten`, `flattenDeep`,
  2601. * `flattenDepth`, `flip`, `flow`, `flowRight`, `fromPairs`, `functions`,
  2602. * `functionsIn`, `groupBy`, `initial`, `intersection`, `intersectionBy`,
  2603. * `intersectionWith`, `invert`, `invertBy`, `invokeMap`, `iteratee`, `keyBy`,
  2604. * `keys`, `keysIn`, `map`, `mapKeys`, `mapValues`, `matches`, `matchesProperty`,
  2605. * `memoize`, `merge`, `mergeWith`, `method`, `methodOf`, `mixin`, `negate`,
  2606. * `nthArg`, `omit`, `omitBy`, `once`, `orderBy`, `over`, `overArgs`,
  2607. * `overEvery`, `overSome`, `partial`, `partialRight`, `partition`, `pick`,
  2608. * `pickBy`, `plant`, `property`, `propertyOf`, `pull`, `pullAll`, `pullAllBy`,
  2609. * `pullAllWith`, `pullAt`, `push`, `range`, `rangeRight`, `rearg`, `reject`,
  2610. * `remove`, `rest`, `reverse`, `sampleSize`, `set`, `setWith`, `shuffle`,
  2611. * `slice`, `sort`, `sortBy`, `splice`, `spread`, `tail`, `take`, `takeRight`,
  2612. * `takeRightWhile`, `takeWhile`, `tap`, `throttle`, `thru`, `toArray`,
  2613. * `toPairs`, `toPairsIn`, `toPath`, `toPlainObject`, `transform`, `unary`,
  2614. * `union`, `unionBy`, `unionWith`, `uniq`, `uniqBy`, `uniqWith`, `unset`,
  2615. * `unshift`, `unzip`, `unzipWith`, `update`, `updateWith`, `values`,
  2616. * `valuesIn`, `without`, `wrap`, `xor`, `xorBy`, `xorWith`, `zip`,
  2617. * `zipObject`, `zipObjectDeep`, and `zipWith`
  2618. *
  2619. * The wrapper methods that are **not** chainable by default are:
  2620. * `add`, `attempt`, `camelCase`, `capitalize`, `ceil`, `clamp`, `clone`,
  2621. * `cloneDeep`, `cloneDeepWith`, `cloneWith`, `conformsTo`, `deburr`,
  2622. * `defaultTo`, `divide`, `each`, `eachRight`, `endsWith`, `eq`, `escape`,
  2623. * `escapeRegExp`, `every`, `find`, `findIndex`, `findKey`, `findLast`,
  2624. * `findLastIndex`, `findLastKey`, `first`, `floor`, `forEach`, `forEachRight`,
  2625. * `forIn`, `forInRight`, `forOwn`, `forOwnRight`, `get`, `gt`, `gte`, `has`,
  2626. * `hasIn`, `head`, `identity`, `includes`, `indexOf`, `inRange`, `invoke`,
  2627. * `isArguments`, `isArray`, `isArrayBuffer`, `isArrayLike`, `isArrayLikeObject`,
  2628. * `isBoolean`, `isBuffer`, `isDate`, `isElement`, `isEmpty`, `isEqual`,
  2629. * `isEqualWith`, `isError`, `isFinite`, `isFunction`, `isInteger`, `isLength`,
  2630. * `isMap`, `isMatch`, `isMatchWith`, `isNaN`, `isNative`, `isNil`, `isNull`,
  2631. * `isNumber`, `isObject`, `isObjectLike`, `isPlainObject`, `isRegExp`,
  2632. * `isSafeInteger`, `isSet`, `isString`, `isUndefined`, `isTypedArray`,
  2633. * `isWeakMap`, `isWeakSet`, `join`, `kebabCase`, `last`, `lastIndexOf`,
  2634. * `lowerCase`, `lowerFirst`, `lt`, `lte`, `max`, `maxBy`, `mean`, `meanBy`,
  2635. * `min`, `minBy`, `multiply`, `noConflict`, `noop`, `now`, `nth`, `pad`,
  2636. * `padEnd`, `padStart`, `parseInt`, `pop`, `random`, `reduce`, `reduceRight`,
  2637. * `repeat`, `result`, `round`, `runInContext`, `sample`, `shift`, `size`,
  2638. * `snakeCase`, `some`, `sortedIndex`, `sortedIndexBy`, `sortedLastIndex`,
  2639. * `sortedLastIndexBy`, `startCase`, `startsWith`, `stubArray`, `stubFalse`,
  2640. * `stubObject`, `stubString`, `stubTrue`, `subtract`, `sum`, `sumBy`,
  2641. * `template`, `times`, `toFinite`, `toInteger`, `toJSON`, `toLength`,
  2642. * `toLower`, `toNumber`, `toSafeInteger`, `toString`, `toUpper`, `trim`,
  2643. * `trimEnd`, `trimStart`, `truncate`, `unescape`, `uniqueId`, `upperCase`,
  2644. * `upperFirst`, `value`, and `words`
  2645. *
  2646. * @name _
  2647. * @constructor
  2648. * @category Seq
  2649. * @param {*} value The value to wrap in a `lodash` instance.
  2650. * @returns {Object} Returns the new `lodash` wrapper instance.
  2651. * @example
  2652. *
  2653. * function square(n) {
  2654. * return n * n;
  2655. * }
  2656. *
  2657. * var wrapped = _([1, 2, 3]);
  2658. *
  2659. * // Returns an unwrapped value.
  2660. * wrapped.reduce(_.add);
  2661. * // => 6
  2662. *
  2663. * // Returns a wrapped value.
  2664. * var squares = wrapped.map(square);
  2665. *
  2666. * _.isArray(squares);
  2667. * // => false
  2668. *
  2669. * _.isArray(squares.value());
  2670. * // => true
  2671. */
  2672. function lodash(value) {
  2673. if (isObjectLike(value) && !isArray(value) && !(value instanceof LazyWrapper)) {
  2674. if (value instanceof LodashWrapper) {
  2675. return value;
  2676. }
  2677. if (hasOwnProperty.call(value, '__wrapped__')) {
  2678. return wrapperClone(value);
  2679. }
  2680. }
  2681. return new LodashWrapper(value);
  2682. }
  2683. /**
  2684. * The base implementation of `_.create` without support for assigning
  2685. * properties to the created object.
  2686. *
  2687. * @private
  2688. * @param {Object} proto The object to inherit from.
  2689. * @returns {Object} Returns the new object.
  2690. */
  2691. var baseCreate = (function() {
  2692. function object() {}
  2693. return function(proto) {
  2694. if (!isObject(proto)) {
  2695. return {};
  2696. }
  2697. if (objectCreate) {
  2698. return objectCreate(proto);
  2699. }
  2700. object.prototype = proto;
  2701. var result = new object;
  2702. object.prototype = undefined;
  2703. return result;
  2704. };
  2705. }());
  2706. /**
  2707. * The function whose prototype chain sequence wrappers inherit from.
  2708. *
  2709. * @private
  2710. */
  2711. function baseLodash() {
  2712. // No operation performed.
  2713. }
  2714. /**
  2715. * The base constructor for creating `lodash` wrapper objects.
  2716. *
  2717. * @private
  2718. * @param {*} value The value to wrap.
  2719. * @param {boolean} [chainAll] Enable explicit method chain sequences.
  2720. */
  2721. function LodashWrapper(value, chainAll) {
  2722. this.__wrapped__ = value;
  2723. this.__actions__ = [];
  2724. this.__chain__ = !!chainAll;
  2725. this.__index__ = 0;
  2726. this.__values__ = undefined;
  2727. }
  2728. /**
  2729. * By default, the template delimiters used by lodash are like those in
  2730. * embedded Ruby (ERB) as well as ES2015 template strings. Change the
  2731. * following template settings to use alternative delimiters.
  2732. *
  2733. * @static
  2734. * @memberOf _
  2735. * @type {Object}
  2736. */
  2737. lodash.templateSettings = {
  2738. /**
  2739. * Used to detect `data` property values to be HTML-escaped.
  2740. *
  2741. * @memberOf _.templateSettings
  2742. * @type {RegExp}
  2743. */
  2744. 'escape': reEscape,
  2745. /**
  2746. * Used to detect code to be evaluated.
  2747. *
  2748. * @memberOf _.templateSettings
  2749. * @type {RegExp}
  2750. */
  2751. 'evaluate': reEvaluate,
  2752. /**
  2753. * Used to detect `data` property values to inject.
  2754. *
  2755. * @memberOf _.templateSettings
  2756. * @type {RegExp}
  2757. */
  2758. 'interpolate': reInterpolate,
  2759. /**
  2760. * Used to reference the data object in the template text.
  2761. *
  2762. * @memberOf _.templateSettings
  2763. * @type {string}
  2764. */
  2765. 'variable': '',
  2766. /**
  2767. * Used to import variables into the compiled template.
  2768. *
  2769. * @memberOf _.templateSettings
  2770. * @type {Object}
  2771. */
  2772. 'imports': {
  2773. /**
  2774. * A reference to the `lodash` function.
  2775. *
  2776. * @memberOf _.templateSettings.imports
  2777. * @type {Function}
  2778. */
  2779. '_': lodash
  2780. }
  2781. };
  2782. // Ensure wrappers are instances of `baseLodash`.
  2783. lodash.prototype = baseLodash.prototype;
  2784. lodash.prototype.constructor = lodash;
  2785. LodashWrapper.prototype = baseCreate(baseLodash.prototype);
  2786. LodashWrapper.prototype.constructor = LodashWrapper;
  2787. /*------------------------------------------------------------------------*/
  2788. /**
  2789. * Creates a lazy wrapper object which wraps `value` to enable lazy evaluation.
  2790. *
  2791. * @private
  2792. * @constructor
  2793. * @param {*} value The value to wrap.
  2794. */
  2795. function LazyWrapper(value) {
  2796. this.__wrapped__ = value;
  2797. this.__actions__ = [];
  2798. this.__dir__ = 1;
  2799. this.__filtered__ = false;
  2800. this.__iteratees__ = [];
  2801. this.__takeCount__ = MAX_ARRAY_LENGTH;
  2802. this.__views__ = [];
  2803. }
  2804. /**
  2805. * Creates a clone of the lazy wrapper object.
  2806. *
  2807. * @private
  2808. * @name clone
  2809. * @memberOf LazyWrapper
  2810. * @returns {Object} Returns the cloned `LazyWrapper` object.
  2811. */
  2812. function lazyClone() {
  2813. var result = new LazyWrapper(this.__wrapped__);
  2814. result.__actions__ = copyArray(this.__actions__);
  2815. result.__dir__ = this.__dir__;
  2816. result.__filtered__ = this.__filtered__;
  2817. result.__iteratees__ = copyArray(this.__iteratees__);
  2818. result.__takeCount__ = this.__takeCount__;
  2819. result.__views__ = copyArray(this.__views__);
  2820. return result;
  2821. }
  2822. /**
  2823. * Reverses the direction of lazy iteration.
  2824. *
  2825. * @private
  2826. * @name reverse
  2827. * @memberOf LazyWrapper
  2828. * @returns {Object} Returns the new reversed `LazyWrapper` object.
  2829. */
  2830. function lazyReverse() {
  2831. if (this.__filtered__) {
  2832. var result = new LazyWrapper(this);
  2833. result.__dir__ = -1;
  2834. result.__filtered__ = true;
  2835. } else {
  2836. result = this.clone();
  2837. result.__dir__ *= -1;
  2838. }
  2839. return result;
  2840. }
  2841. /**
  2842. * Extracts the unwrapped value from its lazy wrapper.
  2843. *
  2844. * @private
  2845. * @name value
  2846. * @memberOf LazyWrapper
  2847. * @returns {*} Returns the unwrapped value.
  2848. */
  2849. function lazyValue() {
  2850. var array = this.__wrapped__.value(),
  2851. dir = this.__dir__,
  2852. isArr = isArray(array),
  2853. isRight = dir < 0,
  2854. arrLength = isArr ? array.length : 0,
  2855. view = getView(0, arrLength, this.__views__),
  2856. start = view.start,
  2857. end = view.end,
  2858. length = end - start,
  2859. index = isRight ? end : (start - 1),
  2860. iteratees = this.__iteratees__,
  2861. iterLength = iteratees.length,
  2862. resIndex = 0,
  2863. takeCount = nativeMin(length, this.__takeCount__);
  2864. if (!isArr || (!isRight && arrLength == length && takeCount == length)) {
  2865. return baseWrapperValue(array, this.__actions__);
  2866. }
  2867. var result = [];
  2868. outer:
  2869. while (length-- && resIndex < takeCount) {
  2870. index += dir;
  2871. var iterIndex = -1,
  2872. value = array[index];
  2873. while (++iterIndex < iterLength) {
  2874. var data = iteratees[iterIndex],
  2875. iteratee = data.iteratee,
  2876. type = data.type,
  2877. computed = iteratee(value);
  2878. if (type == LAZY_MAP_FLAG) {
  2879. value = computed;
  2880. } else if (!computed) {
  2881. if (type == LAZY_FILTER_FLAG) {
  2882. continue outer;
  2883. } else {
  2884. break outer;
  2885. }
  2886. }
  2887. }
  2888. result[resIndex++] = value;
  2889. }
  2890. return result;
  2891. }
  2892. // Ensure `LazyWrapper` is an instance of `baseLodash`.
  2893. LazyWrapper.prototype = baseCreate(baseLodash.prototype);
  2894. LazyWrapper.prototype.constructor = LazyWrapper;
  2895. /*------------------------------------------------------------------------*/
  2896. /**
  2897. * Creates a hash object.
  2898. *
  2899. * @private
  2900. * @constructor
  2901. * @param {Array} [entries] The key-value pairs to cache.
  2902. */
  2903. function Hash(entries) {
  2904. var index = -1,
  2905. length = entries == null ? 0 : entries.length;
  2906. this.clear();
  2907. while (++index < length) {
  2908. var entry = entries[index];
  2909. this.set(entry[0], entry[1]);
  2910. }
  2911. }
  2912. /**
  2913. * Removes all key-value entries from the hash.
  2914. *
  2915. * @private
  2916. * @name clear
  2917. * @memberOf Hash
  2918. */
  2919. function hashClear() {
  2920. this.__data__ = nativeCreate ? nativeCreate(null) : {};
  2921. this.size = 0;
  2922. }
  2923. /**
  2924. * Removes `key` and its value from the hash.
  2925. *
  2926. * @private
  2927. * @name delete
  2928. * @memberOf Hash
  2929. * @param {Object} hash The hash to modify.
  2930. * @param {string} key The key of the value to remove.
  2931. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  2932. */
  2933. function hashDelete(key) {
  2934. var result = this.has(key) && delete this.__data__[key];
  2935. this.size -= result ? 1 : 0;
  2936. return result;
  2937. }
  2938. /**
  2939. * Gets the hash value for `key`.
  2940. *
  2941. * @private
  2942. * @name get
  2943. * @memberOf Hash
  2944. * @param {string} key The key of the value to get.
  2945. * @returns {*} Returns the entry value.
  2946. */
  2947. function hashGet(key) {
  2948. var data = this.__data__;
  2949. if (nativeCreate) {
  2950. var result = data[key];
  2951. return result === HASH_UNDEFINED ? undefined : result;
  2952. }
  2953. return hasOwnProperty.call(data, key) ? data[key] : undefined;
  2954. }
  2955. /**
  2956. * Checks if a hash value for `key` exists.
  2957. *
  2958. * @private
  2959. * @name has
  2960. * @memberOf Hash
  2961. * @param {string} key The key of the entry to check.
  2962. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  2963. */
  2964. function hashHas(key) {
  2965. var data = this.__data__;
  2966. return nativeCreate ? (data[key] !== undefined) : hasOwnProperty.call(data, key);
  2967. }
  2968. /**
  2969. * Sets the hash `key` to `value`.
  2970. *
  2971. * @private
  2972. * @name set
  2973. * @memberOf Hash
  2974. * @param {string} key The key of the value to set.
  2975. * @param {*} value The value to set.
  2976. * @returns {Object} Returns the hash instance.
  2977. */
  2978. function hashSet(key, value) {
  2979. var data = this.__data__;
  2980. this.size += this.has(key) ? 0 : 1;
  2981. data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value;
  2982. return this;
  2983. }
  2984. // Add methods to `Hash`.
  2985. Hash.prototype.clear = hashClear;
  2986. Hash.prototype['delete'] = hashDelete;
  2987. Hash.prototype.get = hashGet;
  2988. Hash.prototype.has = hashHas;
  2989. Hash.prototype.set = hashSet;
  2990. /*------------------------------------------------------------------------*/
  2991. /**
  2992. * Creates an list cache object.
  2993. *
  2994. * @private
  2995. * @constructor
  2996. * @param {Array} [entries] The key-value pairs to cache.
  2997. */
  2998. function ListCache(entries) {
  2999. var index = -1,
  3000. length = entries == null ? 0 : entries.length;
  3001. this.clear();
  3002. while (++index < length) {
  3003. var entry = entries[index];
  3004. this.set(entry[0], entry[1]);
  3005. }
  3006. }
  3007. /**
  3008. * Removes all key-value entries from the list cache.
  3009. *
  3010. * @private
  3011. * @name clear
  3012. * @memberOf ListCache
  3013. */
  3014. function listCacheClear() {
  3015. this.__data__ = [];
  3016. this.size = 0;
  3017. }
  3018. /**
  3019. * Removes `key` and its value from the list cache.
  3020. *
  3021. * @private
  3022. * @name delete
  3023. * @memberOf ListCache
  3024. * @param {string} key The key of the value to remove.
  3025. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  3026. */
  3027. function listCacheDelete(key) {
  3028. var data = this.__data__,
  3029. index = assocIndexOf(data, key);
  3030. if (index < 0) {
  3031. return false;
  3032. }
  3033. var lastIndex = data.length - 1;
  3034. if (index == lastIndex) {
  3035. data.pop();
  3036. } else {
  3037. splice.call(data, index, 1);
  3038. }
  3039. --this.size;
  3040. return true;
  3041. }
  3042. /**
  3043. * Gets the list cache value for `key`.
  3044. *
  3045. * @private
  3046. * @name get
  3047. * @memberOf ListCache
  3048. * @param {string} key The key of the value to get.
  3049. * @returns {*} Returns the entry value.
  3050. */
  3051. function listCacheGet(key) {
  3052. var data = this.__data__,
  3053. index = assocIndexOf(data, key);
  3054. return index < 0 ? undefined : data[index][1];
  3055. }
  3056. /**
  3057. * Checks if a list cache value for `key` exists.
  3058. *
  3059. * @private
  3060. * @name has
  3061. * @memberOf ListCache
  3062. * @param {string} key The key of the entry to check.
  3063. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  3064. */
  3065. function listCacheHas(key) {
  3066. return assocIndexOf(this.__data__, key) > -1;
  3067. }
  3068. /**
  3069. * Sets the list cache `key` to `value`.
  3070. *
  3071. * @private
  3072. * @name set
  3073. * @memberOf ListCache
  3074. * @param {string} key The key of the value to set.
  3075. * @param {*} value The value to set.
  3076. * @returns {Object} Returns the list cache instance.
  3077. */
  3078. function listCacheSet(key, value) {
  3079. var data = this.__data__,
  3080. index = assocIndexOf(data, key);
  3081. if (index < 0) {
  3082. ++this.size;
  3083. data.push([key, value]);
  3084. } else {
  3085. data[index][1] = value;
  3086. }
  3087. return this;
  3088. }
  3089. // Add methods to `ListCache`.
  3090. ListCache.prototype.clear = listCacheClear;
  3091. ListCache.prototype['delete'] = listCacheDelete;
  3092. ListCache.prototype.get = listCacheGet;
  3093. ListCache.prototype.has = listCacheHas;
  3094. ListCache.prototype.set = listCacheSet;
  3095. /*------------------------------------------------------------------------*/
  3096. /**
  3097. * Creates a map cache object to store key-value pairs.
  3098. *
  3099. * @private
  3100. * @constructor
  3101. * @param {Array} [entries] The key-value pairs to cache.
  3102. */
  3103. function MapCache(entries) {
  3104. var index = -1,
  3105. length = entries == null ? 0 : entries.length;
  3106. this.clear();
  3107. while (++index < length) {
  3108. var entry = entries[index];
  3109. this.set(entry[0], entry[1]);
  3110. }
  3111. }
  3112. /**
  3113. * Removes all key-value entries from the map.
  3114. *
  3115. * @private
  3116. * @name clear
  3117. * @memberOf MapCache
  3118. */
  3119. function mapCacheClear() {
  3120. this.size = 0;
  3121. this.__data__ = {
  3122. 'hash': new Hash,
  3123. 'map': new (Map || ListCache),
  3124. 'string': new Hash
  3125. };
  3126. }
  3127. /**
  3128. * Removes `key` and its value from the map.
  3129. *
  3130. * @private
  3131. * @name delete
  3132. * @memberOf MapCache
  3133. * @param {string} key The key of the value to remove.
  3134. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  3135. */
  3136. function mapCacheDelete(key) {
  3137. var result = getMapData(this, key)['delete'](key);
  3138. this.size -= result ? 1 : 0;
  3139. return result;
  3140. }
  3141. /**
  3142. * Gets the map value for `key`.
  3143. *
  3144. * @private
  3145. * @name get
  3146. * @memberOf MapCache
  3147. * @param {string} key The key of the value to get.
  3148. * @returns {*} Returns the entry value.
  3149. */
  3150. function mapCacheGet(key) {
  3151. return getMapData(this, key).get(key);
  3152. }
  3153. /**
  3154. * Checks if a map value for `key` exists.
  3155. *
  3156. * @private
  3157. * @name has
  3158. * @memberOf MapCache
  3159. * @param {string} key The key of the entry to check.
  3160. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  3161. */
  3162. function mapCacheHas(key) {
  3163. return getMapData(this, key).has(key);
  3164. }
  3165. /**
  3166. * Sets the map `key` to `value`.
  3167. *
  3168. * @private
  3169. * @name set
  3170. * @memberOf MapCache
  3171. * @param {string} key The key of the value to set.
  3172. * @param {*} value The value to set.
  3173. * @returns {Object} Returns the map cache instance.
  3174. */
  3175. function mapCacheSet(key, value) {
  3176. var data = getMapData(this, key),
  3177. size = data.size;
  3178. data.set(key, value);
  3179. this.size += data.size == size ? 0 : 1;
  3180. return this;
  3181. }
  3182. // Add methods to `MapCache`.
  3183. MapCache.prototype.clear = mapCacheClear;
  3184. MapCache.prototype['delete'] = mapCacheDelete;
  3185. MapCache.prototype.get = mapCacheGet;
  3186. MapCache.prototype.has = mapCacheHas;
  3187. MapCache.prototype.set = mapCacheSet;
  3188. /*------------------------------------------------------------------------*/
  3189. /**
  3190. *
  3191. * Creates an array cache object to store unique values.
  3192. *
  3193. * @private
  3194. * @constructor
  3195. * @param {Array} [values] The values to cache.
  3196. */
  3197. function SetCache(values) {
  3198. var index = -1,
  3199. length = values == null ? 0 : values.length;
  3200. this.__data__ = new MapCache;
  3201. while (++index < length) {
  3202. this.add(values[index]);
  3203. }
  3204. }
  3205. /**
  3206. * Adds `value` to the array cache.
  3207. *
  3208. * @private
  3209. * @name add
  3210. * @memberOf SetCache
  3211. * @alias push
  3212. * @param {*} value The value to cache.
  3213. * @returns {Object} Returns the cache instance.
  3214. */
  3215. function setCacheAdd(value) {
  3216. this.__data__.set(value, HASH_UNDEFINED);
  3217. return this;
  3218. }
  3219. /**
  3220. * Checks if `value` is in the array cache.
  3221. *
  3222. * @private
  3223. * @name has
  3224. * @memberOf SetCache
  3225. * @param {*} value The value to search for.
  3226. * @returns {number} Returns `true` if `value` is found, else `false`.
  3227. */
  3228. function setCacheHas(value) {
  3229. return this.__data__.has(value);
  3230. }
  3231. // Add methods to `SetCache`.
  3232. SetCache.prototype.add = SetCache.prototype.push = setCacheAdd;
  3233. SetCache.prototype.has = setCacheHas;
  3234. /*------------------------------------------------------------------------*/
  3235. /**
  3236. * Creates a stack cache object to store key-value pairs.
  3237. *
  3238. * @private
  3239. * @constructor
  3240. * @param {Array} [entries] The key-value pairs to cache.
  3241. */
  3242. function Stack(entries) {
  3243. var data = this.__data__ = new ListCache(entries);
  3244. this.size = data.size;
  3245. }
  3246. /**
  3247. * Removes all key-value entries from the stack.
  3248. *
  3249. * @private
  3250. * @name clear
  3251. * @memberOf Stack
  3252. */
  3253. function stackClear() {
  3254. this.__data__ = new ListCache;
  3255. this.size = 0;
  3256. }
  3257. /**
  3258. * Removes `key` and its value from the stack.
  3259. *
  3260. * @private
  3261. * @name delete
  3262. * @memberOf Stack
  3263. * @param {string} key The key of the value to remove.
  3264. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  3265. */
  3266. function stackDelete(key) {
  3267. var data = this.__data__,
  3268. result = data['delete'](key);
  3269. this.size = data.size;
  3270. return result;
  3271. }
  3272. /**
  3273. * Gets the stack value for `key`.
  3274. *
  3275. * @private
  3276. * @name get
  3277. * @memberOf Stack
  3278. * @param {string} key The key of the value to get.
  3279. * @returns {*} Returns the entry value.
  3280. */
  3281. function stackGet(key) {
  3282. return this.__data__.get(key);
  3283. }
  3284. /**
  3285. * Checks if a stack value for `key` exists.
  3286. *
  3287. * @private
  3288. * @name has
  3289. * @memberOf Stack
  3290. * @param {string} key The key of the entry to check.
  3291. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  3292. */
  3293. function stackHas(key) {
  3294. return this.__data__.has(key);
  3295. }
  3296. /**
  3297. * Sets the stack `key` to `value`.
  3298. *
  3299. * @private
  3300. * @name set
  3301. * @memberOf Stack
  3302. * @param {string} key The key of the value to set.
  3303. * @param {*} value The value to set.
  3304. * @returns {Object} Returns the stack cache instance.
  3305. */
  3306. function stackSet(key, value) {
  3307. var data = this.__data__;
  3308. if (data instanceof ListCache) {
  3309. var pairs = data.__data__;
  3310. if (!Map || (pairs.length < LARGE_ARRAY_SIZE - 1)) {
  3311. pairs.push([key, value]);
  3312. this.size = ++data.size;
  3313. return this;
  3314. }
  3315. data = this.__data__ = new MapCache(pairs);
  3316. }
  3317. data.set(key, value);
  3318. this.size = data.size;
  3319. return this;
  3320. }
  3321. // Add methods to `Stack`.
  3322. Stack.prototype.clear = stackClear;
  3323. Stack.prototype['delete'] = stackDelete;
  3324. Stack.prototype.get = stackGet;
  3325. Stack.prototype.has = stackHas;
  3326. Stack.prototype.set = stackSet;
  3327. /*------------------------------------------------------------------------*/
  3328. /**
  3329. * Creates an array of the enumerable property names of the array-like `value`.
  3330. *
  3331. * @private
  3332. * @param {*} value The value to query.
  3333. * @param {boolean} inherited Specify returning inherited property names.
  3334. * @returns {Array} Returns the array of property names.
  3335. */
  3336. function arrayLikeKeys(value, inherited) {
  3337. var isArr = isArray(value),
  3338. isArg = !isArr && isArguments(value),
  3339. isBuff = !isArr && !isArg && isBuffer(value),
  3340. isType = !isArr && !isArg && !isBuff && isTypedArray(value),
  3341. skipIndexes = isArr || isArg || isBuff || isType,
  3342. result = skipIndexes ? baseTimes(value.length, String) : [],
  3343. length = result.length;
  3344. for (var key in value) {
  3345. if ((inherited || hasOwnProperty.call(value, key)) &&
  3346. !(skipIndexes && (
  3347. // Safari 9 has enumerable `arguments.length` in strict mode.
  3348. key == 'length' ||
  3349. // Node.js 0.10 has enumerable non-index properties on buffers.
  3350. (isBuff && (key == 'offset' || key == 'parent')) ||
  3351. // PhantomJS 2 has enumerable non-index properties on typed arrays.
  3352. (isType && (key == 'buffer' || key == 'byteLength' || key == 'byteOffset')) ||
  3353. // Skip index properties.
  3354. isIndex(key, length)
  3355. ))) {
  3356. result.push(key);
  3357. }
  3358. }
  3359. return result;
  3360. }
  3361. /**
  3362. * A specialized version of `_.sample` for arrays.
  3363. *
  3364. * @private
  3365. * @param {Array} array The array to sample.
  3366. * @returns {*} Returns the random element.
  3367. */
  3368. function arraySample(array) {
  3369. var length = array.length;
  3370. return length ? array[baseRandom(0, length - 1)] : undefined;
  3371. }
  3372. /**
  3373. * A specialized version of `_.sampleSize` for arrays.
  3374. *
  3375. * @private
  3376. * @param {Array} array The array to sample.
  3377. * @param {number} n The number of elements to sample.
  3378. * @returns {Array} Returns the random elements.
  3379. */
  3380. function arraySampleSize(array, n) {
  3381. return shuffleSelf(copyArray(array), baseClamp(n, 0, array.length));
  3382. }
  3383. /**
  3384. * A specialized version of `_.shuffle` for arrays.
  3385. *
  3386. * @private
  3387. * @param {Array} array The array to shuffle.
  3388. * @returns {Array} Returns the new shuffled array.
  3389. */
  3390. function arrayShuffle(array) {
  3391. return shuffleSelf(copyArray(array));
  3392. }
  3393. /**
  3394. * This function is like `assignValue` except that it doesn't assign
  3395. * `undefined` values.
  3396. *
  3397. * @private
  3398. * @param {Object} object The object to modify.
  3399. * @param {string} key The key of the property to assign.
  3400. * @param {*} value The value to assign.
  3401. */
  3402. function assignMergeValue(object, key, value) {
  3403. if ((value !== undefined && !eq(object[key], value)) ||
  3404. (value === undefined && !(key in object))) {
  3405. baseAssignValue(object, key, value);
  3406. }
  3407. }
  3408. /**
  3409. * Assigns `value` to `key` of `object` if the existing value is not equivalent
  3410. * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  3411. * for equality comparisons.
  3412. *
  3413. * @private
  3414. * @param {Object} object The object to modify.
  3415. * @param {string} key The key of the property to assign.
  3416. * @param {*} value The value to assign.
  3417. */
  3418. function assignValue(object, key, value) {
  3419. var objValue = object[key];
  3420. if (!(hasOwnProperty.call(object, key) && eq(objValue, value)) ||
  3421. (value === undefined && !(key in object))) {
  3422. baseAssignValue(object, key, value);
  3423. }
  3424. }
  3425. /**
  3426. * Gets the index at which the `key` is found in `array` of key-value pairs.
  3427. *
  3428. * @private
  3429. * @param {Array} array The array to inspect.
  3430. * @param {*} key The key to search for.
  3431. * @returns {number} Returns the index of the matched value, else `-1`.
  3432. */
  3433. function assocIndexOf(array, key) {
  3434. var length = array.length;
  3435. while (length--) {
  3436. if (eq(array[length][0], key)) {
  3437. return length;
  3438. }
  3439. }
  3440. return -1;
  3441. }
  3442. /**
  3443. * Aggregates elements of `collection` on `accumulator` with keys transformed
  3444. * by `iteratee` and values set by `setter`.
  3445. *
  3446. * @private
  3447. * @param {Array|Object} collection The collection to iterate over.
  3448. * @param {Function} setter The function to set `accumulator` values.
  3449. * @param {Function} iteratee The iteratee to transform keys.
  3450. * @param {Object} accumulator The initial aggregated object.
  3451. * @returns {Function} Returns `accumulator`.
  3452. */
  3453. function baseAggregator(collection, setter, iteratee, accumulator) {
  3454. baseEach(collection, function(value, key, collection) {
  3455. setter(accumulator, value, iteratee(value), collection);
  3456. });
  3457. return accumulator;
  3458. }
  3459. /**
  3460. * The base implementation of `_.assign` without support for multiple sources
  3461. * or `customizer` functions.
  3462. *
  3463. * @private
  3464. * @param {Object} object The destination object.
  3465. * @param {Object} source The source object.
  3466. * @returns {Object} Returns `object`.
  3467. */
  3468. function baseAssign(object, source) {
  3469. return object && copyObject(source, keys(source), object);
  3470. }
  3471. /**
  3472. * The base implementation of `_.assignIn` without support for multiple sources
  3473. * or `customizer` functions.
  3474. *
  3475. * @private
  3476. * @param {Object} object The destination object.
  3477. * @param {Object} source The source object.
  3478. * @returns {Object} Returns `object`.
  3479. */
  3480. function baseAssignIn(object, source) {
  3481. return object && copyObject(source, keysIn(source), object);
  3482. }
  3483. /**
  3484. * The base implementation of `assignValue` and `assignMergeValue` without
  3485. * value checks.
  3486. *
  3487. * @private
  3488. * @param {Object} object The object to modify.
  3489. * @param {string} key The key of the property to assign.
  3490. * @param {*} value The value to assign.
  3491. */
  3492. function baseAssignValue(object, key, value) {
  3493. if (key == '__proto__' && defineProperty) {
  3494. defineProperty(object, key, {
  3495. 'configurable': true,
  3496. 'enumerable': true,
  3497. 'value': value,
  3498. 'writable': true
  3499. });
  3500. } else {
  3501. object[key] = value;
  3502. }
  3503. }
  3504. /**
  3505. * The base implementation of `_.at` without support for individual paths.
  3506. *
  3507. * @private
  3508. * @param {Object} object The object to iterate over.
  3509. * @param {string[]} paths The property paths to pick.
  3510. * @returns {Array} Returns the picked elements.
  3511. */
  3512. function baseAt(object, paths) {
  3513. var index = -1,
  3514. length = paths.length,
  3515. result = Array(length),
  3516. skip = object == null;
  3517. while (++index < length) {
  3518. result[index] = skip ? undefined : get(object, paths[index]);
  3519. }
  3520. return result;
  3521. }
  3522. /**
  3523. * The base implementation of `_.clamp` which doesn't coerce arguments.
  3524. *
  3525. * @private
  3526. * @param {number} number The number to clamp.
  3527. * @param {number} [lower] The lower bound.
  3528. * @param {number} upper The upper bound.
  3529. * @returns {number} Returns the clamped number.
  3530. */
  3531. function baseClamp(number, lower, upper) {
  3532. if (number === number) {
  3533. if (upper !== undefined) {
  3534. number = number <= upper ? number : upper;
  3535. }
  3536. if (lower !== undefined) {
  3537. number = number >= lower ? number : lower;
  3538. }
  3539. }
  3540. return number;
  3541. }
  3542. /**
  3543. * The base implementation of `_.clone` and `_.cloneDeep` which tracks
  3544. * traversed objects.
  3545. *
  3546. * @private
  3547. * @param {*} value The value to clone.
  3548. * @param {boolean} bitmask The bitmask flags.
  3549. * 1 - Deep clone
  3550. * 2 - Flatten inherited properties
  3551. * 4 - Clone symbols
  3552. * @param {Function} [customizer] The function to customize cloning.
  3553. * @param {string} [key] The key of `value`.
  3554. * @param {Object} [object] The parent object of `value`.
  3555. * @param {Object} [stack] Tracks traversed objects and their clone counterparts.
  3556. * @returns {*} Returns the cloned value.
  3557. */
  3558. function baseClone(value, bitmask, customizer, key, object, stack) {
  3559. var result,
  3560. isDeep = bitmask & CLONE_DEEP_FLAG,
  3561. isFlat = bitmask & CLONE_FLAT_FLAG,
  3562. isFull = bitmask & CLONE_SYMBOLS_FLAG;
  3563. if (customizer) {
  3564. result = object ? customizer(value, key, object, stack) : customizer(value);
  3565. }
  3566. if (result !== undefined) {
  3567. return result;
  3568. }
  3569. if (!isObject(value)) {
  3570. return value;
  3571. }
  3572. var isArr = isArray(value);
  3573. if (isArr) {
  3574. result = initCloneArray(value);
  3575. if (!isDeep) {
  3576. return copyArray(value, result);
  3577. }
  3578. } else {
  3579. var tag = getTag(value),
  3580. isFunc = tag == funcTag || tag == genTag;
  3581. if (isBuffer(value)) {
  3582. return cloneBuffer(value, isDeep);
  3583. }
  3584. if (tag == objectTag || tag == argsTag || (isFunc && !object)) {
  3585. result = (isFlat || isFunc) ? {} : initCloneObject(value);
  3586. if (!isDeep) {
  3587. return isFlat
  3588. ? copySymbolsIn(value, baseAssignIn(result, value))
  3589. : copySymbols(value, baseAssign(result, value));
  3590. }
  3591. } else {
  3592. if (!cloneableTags[tag]) {
  3593. return object ? value : {};
  3594. }
  3595. result = initCloneByTag(value, tag, isDeep);
  3596. }
  3597. }
  3598. // Check for circular references and return its corresponding clone.
  3599. stack || (stack = new Stack);
  3600. var stacked = stack.get(value);
  3601. if (stacked) {
  3602. return stacked;
  3603. }
  3604. stack.set(value, result);
  3605. if (isSet(value)) {
  3606. value.forEach(function(subValue) {
  3607. result.add(baseClone(subValue, bitmask, customizer, subValue, value, stack));
  3608. });
  3609. } else if (isMap(value)) {
  3610. value.forEach(function(subValue, key) {
  3611. result.set(key, baseClone(subValue, bitmask, customizer, key, value, stack));
  3612. });
  3613. }
  3614. var keysFunc = isFull
  3615. ? (isFlat ? getAllKeysIn : getAllKeys)
  3616. : (isFlat ? keysIn : keys);
  3617. var props = isArr ? undefined : keysFunc(value);
  3618. arrayEach(props || value, function(subValue, key) {
  3619. if (props) {
  3620. key = subValue;
  3621. subValue = value[key];
  3622. }
  3623. // Recursively populate clone (susceptible to call stack limits).
  3624. assignValue(result, key, baseClone(subValue, bitmask, customizer, key, value, stack));
  3625. });
  3626. return result;
  3627. }
  3628. /**
  3629. * The base implementation of `_.conforms` which doesn't clone `source`.
  3630. *
  3631. * @private
  3632. * @param {Object} source The object of property predicates to conform to.
  3633. * @returns {Function} Returns the new spec function.
  3634. */
  3635. function baseConforms(source) {
  3636. var props = keys(source);
  3637. return function(object) {
  3638. return baseConformsTo(object, source, props);
  3639. };
  3640. }
  3641. /**
  3642. * The base implementation of `_.conformsTo` which accepts `props` to check.
  3643. *
  3644. * @private
  3645. * @param {Object} object The object to inspect.
  3646. * @param {Object} source The object of property predicates to conform to.
  3647. * @returns {boolean} Returns `true` if `object` conforms, else `false`.
  3648. */
  3649. function baseConformsTo(object, source, props) {
  3650. var length = props.length;
  3651. if (object == null) {
  3652. return !length;
  3653. }
  3654. object = Object(object);
  3655. while (length--) {
  3656. var key = props[length],
  3657. predicate = source[key],
  3658. value = object[key];
  3659. if ((value === undefined && !(key in object)) || !predicate(value)) {
  3660. return false;
  3661. }
  3662. }
  3663. return true;
  3664. }
  3665. /**
  3666. * The base implementation of `_.delay` and `_.defer` which accepts `args`
  3667. * to provide to `func`.
  3668. *
  3669. * @private
  3670. * @param {Function} func The function to delay.
  3671. * @param {number} wait The number of milliseconds to delay invocation.
  3672. * @param {Array} args The arguments to provide to `func`.
  3673. * @returns {number|Object} Returns the timer id or timeout object.
  3674. */
  3675. function baseDelay(func, wait, args) {
  3676. if (typeof func != 'function') {
  3677. throw new TypeError(FUNC_ERROR_TEXT);
  3678. }
  3679. return setTimeout(function() { func.apply(undefined, args); }, wait);
  3680. }
  3681. /**
  3682. * The base implementation of methods like `_.difference` without support
  3683. * for excluding multiple arrays or iteratee shorthands.
  3684. *
  3685. * @private
  3686. * @param {Array} array The array to inspect.
  3687. * @param {Array} values The values to exclude.
  3688. * @param {Function} [iteratee] The iteratee invoked per element.
  3689. * @param {Function} [comparator] The comparator invoked per element.
  3690. * @returns {Array} Returns the new array of filtered values.
  3691. */
  3692. function baseDifference(array, values, iteratee, comparator) {
  3693. var index = -1,
  3694. includes = arrayIncludes,
  3695. isCommon = true,
  3696. length = array.length,
  3697. result = [],
  3698. valuesLength = values.length;
  3699. if (!length) {
  3700. return result;
  3701. }
  3702. if (iteratee) {
  3703. values = arrayMap(values, baseUnary(iteratee));
  3704. }
  3705. if (comparator) {
  3706. includes = arrayIncludesWith;
  3707. isCommon = false;
  3708. }
  3709. else if (values.length >= LARGE_ARRAY_SIZE) {
  3710. includes = cacheHas;
  3711. isCommon = false;
  3712. values = new SetCache(values);
  3713. }
  3714. outer:
  3715. while (++index < length) {
  3716. var value = array[index],
  3717. computed = iteratee == null ? value : iteratee(value);
  3718. value = (comparator || value !== 0) ? value : 0;
  3719. if (isCommon && computed === computed) {
  3720. var valuesIndex = valuesLength;
  3721. while (valuesIndex--) {
  3722. if (values[valuesIndex] === computed) {
  3723. continue outer;
  3724. }
  3725. }
  3726. result.push(value);
  3727. }
  3728. else if (!includes(values, computed, comparator)) {
  3729. result.push(value);
  3730. }
  3731. }
  3732. return result;
  3733. }
  3734. /**
  3735. * The base implementation of `_.forEach` without support for iteratee shorthands.
  3736. *
  3737. * @private
  3738. * @param {Array|Object} collection The collection to iterate over.
  3739. * @param {Function} iteratee The function invoked per iteration.
  3740. * @returns {Array|Object} Returns `collection`.
  3741. */
  3742. var baseEach = createBaseEach(baseForOwn);
  3743. /**
  3744. * The base implementation of `_.forEachRight` without support for iteratee shorthands.
  3745. *
  3746. * @private
  3747. * @param {Array|Object} collection The collection to iterate over.
  3748. * @param {Function} iteratee The function invoked per iteration.
  3749. * @returns {Array|Object} Returns `collection`.
  3750. */
  3751. var baseEachRight = createBaseEach(baseForOwnRight, true);
  3752. /**
  3753. * The base implementation of `_.every` without support for iteratee shorthands.
  3754. *
  3755. * @private
  3756. * @param {Array|Object} collection The collection to iterate over.
  3757. * @param {Function} predicate The function invoked per iteration.
  3758. * @returns {boolean} Returns `true` if all elements pass the predicate check,
  3759. * else `false`
  3760. */
  3761. function baseEvery(collection, predicate) {
  3762. var result = true;
  3763. baseEach(collection, function(value, index, collection) {
  3764. result = !!predicate(value, index, collection);
  3765. return result;
  3766. });
  3767. return result;
  3768. }
  3769. /**
  3770. * The base implementation of methods like `_.max` and `_.min` which accepts a
  3771. * `comparator` to determine the extremum value.
  3772. *
  3773. * @private
  3774. * @param {Array} array The array to iterate over.
  3775. * @param {Function} iteratee The iteratee invoked per iteration.
  3776. * @param {Function} comparator The comparator used to compare values.
  3777. * @returns {*} Returns the extremum value.
  3778. */
  3779. function baseExtremum(array, iteratee, comparator) {
  3780. var index = -1,
  3781. length = array.length;
  3782. while (++index < length) {
  3783. var value = array[index],
  3784. current = iteratee(value);
  3785. if (current != null && (computed === undefined
  3786. ? (current === current && !isSymbol(current))
  3787. : comparator(current, computed)
  3788. )) {
  3789. var computed = current,
  3790. result = value;
  3791. }
  3792. }
  3793. return result;
  3794. }
  3795. /**
  3796. * The base implementation of `_.fill` without an iteratee call guard.
  3797. *
  3798. * @private
  3799. * @param {Array} array The array to fill.
  3800. * @param {*} value The value to fill `array` with.
  3801. * @param {number} [start=0] The start position.
  3802. * @param {number} [end=array.length] The end position.
  3803. * @returns {Array} Returns `array`.
  3804. */
  3805. function baseFill(array, value, start, end) {
  3806. var length = array.length;
  3807. start = toInteger(start);
  3808. if (start < 0) {
  3809. start = -start > length ? 0 : (length + start);
  3810. }
  3811. end = (end === undefined || end > length) ? length : toInteger(end);
  3812. if (end < 0) {
  3813. end += length;
  3814. }
  3815. end = start > end ? 0 : toLength(end);
  3816. while (start < end) {
  3817. array[start++] = value;
  3818. }
  3819. return array;
  3820. }
  3821. /**
  3822. * The base implementation of `_.filter` without support for iteratee shorthands.
  3823. *
  3824. * @private
  3825. * @param {Array|Object} collection The collection to iterate over.
  3826. * @param {Function} predicate The function invoked per iteration.
  3827. * @returns {Array} Returns the new filtered array.
  3828. */
  3829. function baseFilter(collection, predicate) {
  3830. var result = [];
  3831. baseEach(collection, function(value, index, collection) {
  3832. if (predicate(value, index, collection)) {
  3833. result.push(value);
  3834. }
  3835. });
  3836. return result;
  3837. }
  3838. /**
  3839. * The base implementation of `_.flatten` with support for restricting flattening.
  3840. *
  3841. * @private
  3842. * @param {Array} array The array to flatten.
  3843. * @param {number} depth The maximum recursion depth.
  3844. * @param {boolean} [predicate=isFlattenable] The function invoked per iteration.
  3845. * @param {boolean} [isStrict] Restrict to values that pass `predicate` checks.
  3846. * @param {Array} [result=[]] The initial result value.
  3847. * @returns {Array} Returns the new flattened array.
  3848. */
  3849. function baseFlatten(array, depth, predicate, isStrict, result) {
  3850. var index = -1,
  3851. length = array.length;
  3852. predicate || (predicate = isFlattenable);
  3853. result || (result = []);
  3854. while (++index < length) {
  3855. var value = array[index];
  3856. if (depth > 0 && predicate(value)) {
  3857. if (depth > 1) {
  3858. // Recursively flatten arrays (susceptible to call stack limits).
  3859. baseFlatten(value, depth - 1, predicate, isStrict, result);
  3860. } else {
  3861. arrayPush(result, value);
  3862. }
  3863. } else if (!isStrict) {
  3864. result[result.length] = value;
  3865. }
  3866. }
  3867. return result;
  3868. }
  3869. /**
  3870. * The base implementation of `baseForOwn` which iterates over `object`
  3871. * properties returned by `keysFunc` and invokes `iteratee` for each property.
  3872. * Iteratee functions may exit iteration early by explicitly returning `false`.
  3873. *
  3874. * @private
  3875. * @param {Object} object The object to iterate over.
  3876. * @param {Function} iteratee The function invoked per iteration.
  3877. * @param {Function} keysFunc The function to get the keys of `object`.
  3878. * @returns {Object} Returns `object`.
  3879. */
  3880. var baseFor = createBaseFor();
  3881. /**
  3882. * This function is like `baseFor` except that it iterates over properties
  3883. * in the opposite order.
  3884. *
  3885. * @private
  3886. * @param {Object} object The object to iterate over.
  3887. * @param {Function} iteratee The function invoked per iteration.
  3888. * @param {Function} keysFunc The function to get the keys of `object`.
  3889. * @returns {Object} Returns `object`.
  3890. */
  3891. var baseForRight = createBaseFor(true);
  3892. /**
  3893. * The base implementation of `_.forOwn` without support for iteratee shorthands.
  3894. *
  3895. * @private
  3896. * @param {Object} object The object to iterate over.
  3897. * @param {Function} iteratee The function invoked per iteration.
  3898. * @returns {Object} Returns `object`.
  3899. */
  3900. function baseForOwn(object, iteratee) {
  3901. return object && baseFor(object, iteratee, keys);
  3902. }
  3903. /**
  3904. * The base implementation of `_.forOwnRight` without support for iteratee shorthands.
  3905. *
  3906. * @private
  3907. * @param {Object} object The object to iterate over.
  3908. * @param {Function} iteratee The function invoked per iteration.
  3909. * @returns {Object} Returns `object`.
  3910. */
  3911. function baseForOwnRight(object, iteratee) {
  3912. return object && baseForRight(object, iteratee, keys);
  3913. }
  3914. /**
  3915. * The base implementation of `_.functions` which creates an array of
  3916. * `object` function property names filtered from `props`.
  3917. *
  3918. * @private
  3919. * @param {Object} object The object to inspect.
  3920. * @param {Array} props The property names to filter.
  3921. * @returns {Array} Returns the function names.
  3922. */
  3923. function baseFunctions(object, props) {
  3924. return arrayFilter(props, function(key) {
  3925. return isFunction(object[key]);
  3926. });
  3927. }
  3928. /**
  3929. * The base implementation of `_.get` without support for default values.
  3930. *
  3931. * @private
  3932. * @param {Object} object The object to query.
  3933. * @param {Array|string} path The path of the property to get.
  3934. * @returns {*} Returns the resolved value.
  3935. */
  3936. function baseGet(object, path) {
  3937. path = castPath(path, object);
  3938. var index = 0,
  3939. length = path.length;
  3940. while (object != null && index < length) {
  3941. object = object[toKey(path[index++])];
  3942. }
  3943. return (index && index == length) ? object : undefined;
  3944. }
  3945. /**
  3946. * The base implementation of `getAllKeys` and `getAllKeysIn` which uses
  3947. * `keysFunc` and `symbolsFunc` to get the enumerable property names and
  3948. * symbols of `object`.
  3949. *
  3950. * @private
  3951. * @param {Object} object The object to query.
  3952. * @param {Function} keysFunc The function to get the keys of `object`.
  3953. * @param {Function} symbolsFunc The function to get the symbols of `object`.
  3954. * @returns {Array} Returns the array of property names and symbols.
  3955. */
  3956. function baseGetAllKeys(object, keysFunc, symbolsFunc) {
  3957. var result = keysFunc(object);
  3958. return isArray(object) ? result : arrayPush(result, symbolsFunc(object));
  3959. }
  3960. /**
  3961. * The base implementation of `getTag` without fallbacks for buggy environments.
  3962. *
  3963. * @private
  3964. * @param {*} value The value to query.
  3965. * @returns {string} Returns the `toStringTag`.
  3966. */
  3967. function baseGetTag(value) {
  3968. if (value == null) {
  3969. return value === undefined ? undefinedTag : nullTag;
  3970. }
  3971. return (symToStringTag && symToStringTag in Object(value))
  3972. ? getRawTag(value)
  3973. : objectToString(value);
  3974. }
  3975. /**
  3976. * The base implementation of `_.gt` which doesn't coerce arguments.
  3977. *
  3978. * @private
  3979. * @param {*} value The value to compare.
  3980. * @param {*} other The other value to compare.
  3981. * @returns {boolean} Returns `true` if `value` is greater than `other`,
  3982. * else `false`.
  3983. */
  3984. function baseGt(value, other) {
  3985. return value > other;
  3986. }
  3987. /**
  3988. * The base implementation of `_.has` without support for deep paths.
  3989. *
  3990. * @private
  3991. * @param {Object} [object] The object to query.
  3992. * @param {Array|string} key The key to check.
  3993. * @returns {boolean} Returns `true` if `key` exists, else `false`.
  3994. */
  3995. function baseHas(object, key) {
  3996. return object != null && hasOwnProperty.call(object, key);
  3997. }
  3998. /**
  3999. * The base implementation of `_.hasIn` without support for deep paths.
  4000. *
  4001. * @private
  4002. * @param {Object} [object] The object to query.
  4003. * @param {Array|string} key The key to check.
  4004. * @returns {boolean} Returns `true` if `key` exists, else `false`.
  4005. */
  4006. function baseHasIn(object, key) {
  4007. return object != null && key in Object(object);
  4008. }
  4009. /**
  4010. * The base implementation of `_.inRange` which doesn't coerce arguments.
  4011. *
  4012. * @private
  4013. * @param {number} number The number to check.
  4014. * @param {number} start The start of the range.
  4015. * @param {number} end The end of the range.
  4016. * @returns {boolean} Returns `true` if `number` is in the range, else `false`.
  4017. */
  4018. function baseInRange(number, start, end) {
  4019. return number >= nativeMin(start, end) && number < nativeMax(start, end);
  4020. }
  4021. /**
  4022. * The base implementation of methods like `_.intersection`, without support
  4023. * for iteratee shorthands, that accepts an array of arrays to inspect.
  4024. *
  4025. * @private
  4026. * @param {Array} arrays The arrays to inspect.
  4027. * @param {Function} [iteratee] The iteratee invoked per element.
  4028. * @param {Function} [comparator] The comparator invoked per element.
  4029. * @returns {Array} Returns the new array of shared values.
  4030. */
  4031. function baseIntersection(arrays, iteratee, comparator) {
  4032. var includes = comparator ? arrayIncludesWith : arrayIncludes,
  4033. length = arrays[0].length,
  4034. othLength = arrays.length,
  4035. othIndex = othLength,
  4036. caches = Array(othLength),
  4037. maxLength = Infinity,
  4038. result = [];
  4039. while (othIndex--) {
  4040. var array = arrays[othIndex];
  4041. if (othIndex && iteratee) {
  4042. array = arrayMap(array, baseUnary(iteratee));
  4043. }
  4044. maxLength = nativeMin(array.length, maxLength);
  4045. caches[othIndex] = !comparator && (iteratee || (length >= 120 && array.length >= 120))
  4046. ? new SetCache(othIndex && array)
  4047. : undefined;
  4048. }
  4049. array = arrays[0];
  4050. var index = -1,
  4051. seen = caches[0];
  4052. outer:
  4053. while (++index < length && result.length < maxLength) {
  4054. var value = array[index],
  4055. computed = iteratee ? iteratee(value) : value;
  4056. value = (comparator || value !== 0) ? value : 0;
  4057. if (!(seen
  4058. ? cacheHas(seen, computed)
  4059. : includes(result, computed, comparator)
  4060. )) {
  4061. othIndex = othLength;
  4062. while (--othIndex) {
  4063. var cache = caches[othIndex];
  4064. if (!(cache
  4065. ? cacheHas(cache, computed)
  4066. : includes(arrays[othIndex], computed, comparator))
  4067. ) {
  4068. continue outer;
  4069. }
  4070. }
  4071. if (seen) {
  4072. seen.push(computed);
  4073. }
  4074. result.push(value);
  4075. }
  4076. }
  4077. return result;
  4078. }
  4079. /**
  4080. * The base implementation of `_.invert` and `_.invertBy` which inverts
  4081. * `object` with values transformed by `iteratee` and set by `setter`.
  4082. *
  4083. * @private
  4084. * @param {Object} object The object to iterate over.
  4085. * @param {Function} setter The function to set `accumulator` values.
  4086. * @param {Function} iteratee The iteratee to transform values.
  4087. * @param {Object} accumulator The initial inverted object.
  4088. * @returns {Function} Returns `accumulator`.
  4089. */
  4090. function baseInverter(object, setter, iteratee, accumulator) {
  4091. baseForOwn(object, function(value, key, object) {
  4092. setter(accumulator, iteratee(value), key, object);
  4093. });
  4094. return accumulator;
  4095. }
  4096. /**
  4097. * The base implementation of `_.invoke` without support for individual
  4098. * method arguments.
  4099. *
  4100. * @private
  4101. * @param {Object} object The object to query.
  4102. * @param {Array|string} path The path of the method to invoke.
  4103. * @param {Array} args The arguments to invoke the method with.
  4104. * @returns {*} Returns the result of the invoked method.
  4105. */
  4106. function baseInvoke(object, path, args) {
  4107. path = castPath(path, object);
  4108. object = parent(object, path);
  4109. var func = object == null ? object : object[toKey(last(path))];
  4110. return func == null ? undefined : apply(func, object, args);
  4111. }
  4112. /**
  4113. * The base implementation of `_.isArguments`.
  4114. *
  4115. * @private
  4116. * @param {*} value The value to check.
  4117. * @returns {boolean} Returns `true` if `value` is an `arguments` object,
  4118. */
  4119. function baseIsArguments(value) {
  4120. return isObjectLike(value) && baseGetTag(value) == argsTag;
  4121. }
  4122. /**
  4123. * The base implementation of `_.isArrayBuffer` without Node.js optimizations.
  4124. *
  4125. * @private
  4126. * @param {*} value The value to check.
  4127. * @returns {boolean} Returns `true` if `value` is an array buffer, else `false`.
  4128. */
  4129. function baseIsArrayBuffer(value) {
  4130. return isObjectLike(value) && baseGetTag(value) == arrayBufferTag;
  4131. }
  4132. /**
  4133. * The base implementation of `_.isDate` without Node.js optimizations.
  4134. *
  4135. * @private
  4136. * @param {*} value The value to check.
  4137. * @returns {boolean} Returns `true` if `value` is a date object, else `false`.
  4138. */
  4139. function baseIsDate(value) {
  4140. return isObjectLike(value) && baseGetTag(value) == dateTag;
  4141. }
  4142. /**
  4143. * The base implementation of `_.isEqual` which supports partial comparisons
  4144. * and tracks traversed objects.
  4145. *
  4146. * @private
  4147. * @param {*} value The value to compare.
  4148. * @param {*} other The other value to compare.
  4149. * @param {boolean} bitmask The bitmask flags.
  4150. * 1 - Unordered comparison
  4151. * 2 - Partial comparison
  4152. * @param {Function} [customizer] The function to customize comparisons.
  4153. * @param {Object} [stack] Tracks traversed `value` and `other` objects.
  4154. * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
  4155. */
  4156. function baseIsEqual(value, other, bitmask, customizer, stack) {
  4157. if (value === other) {
  4158. return true;
  4159. }
  4160. if (value == null || other == null || (!isObjectLike(value) && !isObjectLike(other))) {
  4161. return value !== value && other !== other;
  4162. }
  4163. return baseIsEqualDeep(value, other, bitmask, customizer, baseIsEqual, stack);
  4164. }
  4165. /**
  4166. * A specialized version of `baseIsEqual` for arrays and objects which performs
  4167. * deep comparisons and tracks traversed objects enabling objects with circular
  4168. * references to be compared.
  4169. *
  4170. * @private
  4171. * @param {Object} object The object to compare.
  4172. * @param {Object} other The other object to compare.
  4173. * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
  4174. * @param {Function} customizer The function to customize comparisons.
  4175. * @param {Function} equalFunc The function to determine equivalents of values.
  4176. * @param {Object} [stack] Tracks traversed `object` and `other` objects.
  4177. * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
  4178. */
  4179. function baseIsEqualDeep(object, other, bitmask, customizer, equalFunc, stack) {
  4180. var objIsArr = isArray(object),
  4181. othIsArr = isArray(other),
  4182. objTag = objIsArr ? arrayTag : getTag(object),
  4183. othTag = othIsArr ? arrayTag : getTag(other);
  4184. objTag = objTag == argsTag ? objectTag : objTag;
  4185. othTag = othTag == argsTag ? objectTag : othTag;
  4186. var objIsObj = objTag == objectTag,
  4187. othIsObj = othTag == objectTag,
  4188. isSameTag = objTag == othTag;
  4189. if (isSameTag && isBuffer(object)) {
  4190. if (!isBuffer(other)) {
  4191. return false;
  4192. }
  4193. objIsArr = true;
  4194. objIsObj = false;
  4195. }
  4196. if (isSameTag && !objIsObj) {
  4197. stack || (stack = new Stack);
  4198. return (objIsArr || isTypedArray(object))
  4199. ? equalArrays(object, other, bitmask, customizer, equalFunc, stack)
  4200. : equalByTag(object, other, objTag, bitmask, customizer, equalFunc, stack);
  4201. }
  4202. if (!(bitmask & COMPARE_PARTIAL_FLAG)) {
  4203. var objIsWrapped = objIsObj && hasOwnProperty.call(object, '__wrapped__'),
  4204. othIsWrapped = othIsObj && hasOwnProperty.call(other, '__wrapped__');
  4205. if (objIsWrapped || othIsWrapped) {
  4206. var objUnwrapped = objIsWrapped ? object.value() : object,
  4207. othUnwrapped = othIsWrapped ? other.value() : other;
  4208. stack || (stack = new Stack);
  4209. return equalFunc(objUnwrapped, othUnwrapped, bitmask, customizer, stack);
  4210. }
  4211. }
  4212. if (!isSameTag) {
  4213. return false;
  4214. }
  4215. stack || (stack = new Stack);
  4216. return equalObjects(object, other, bitmask, customizer, equalFunc, stack);
  4217. }
  4218. /**
  4219. * The base implementation of `_.isMap` without Node.js optimizations.
  4220. *
  4221. * @private
  4222. * @param {*} value The value to check.
  4223. * @returns {boolean} Returns `true` if `value` is a map, else `false`.
  4224. */
  4225. function baseIsMap(value) {
  4226. return isObjectLike(value) && getTag(value) == mapTag;
  4227. }
  4228. /**
  4229. * The base implementation of `_.isMatch` without support for iteratee shorthands.
  4230. *
  4231. * @private
  4232. * @param {Object} object The object to inspect.
  4233. * @param {Object} source The object of property values to match.
  4234. * @param {Array} matchData The property names, values, and compare flags to match.
  4235. * @param {Function} [customizer] The function to customize comparisons.
  4236. * @returns {boolean} Returns `true` if `object` is a match, else `false`.
  4237. */
  4238. function baseIsMatch(object, source, matchData, customizer) {
  4239. var index = matchData.length,
  4240. length = index,
  4241. noCustomizer = !customizer;
  4242. if (object == null) {
  4243. return !length;
  4244. }
  4245. object = Object(object);
  4246. while (index--) {
  4247. var data = matchData[index];
  4248. if ((noCustomizer && data[2])
  4249. ? data[1] !== object[data[0]]
  4250. : !(data[0] in object)
  4251. ) {
  4252. return false;
  4253. }
  4254. }
  4255. while (++index < length) {
  4256. data = matchData[index];
  4257. var key = data[0],
  4258. objValue = object[key],
  4259. srcValue = data[1];
  4260. if (noCustomizer && data[2]) {
  4261. if (objValue === undefined && !(key in object)) {
  4262. return false;
  4263. }
  4264. } else {
  4265. var stack = new Stack;
  4266. if (customizer) {
  4267. var result = customizer(objValue, srcValue, key, object, source, stack);
  4268. }
  4269. if (!(result === undefined
  4270. ? baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG, customizer, stack)
  4271. : result
  4272. )) {
  4273. return false;
  4274. }
  4275. }
  4276. }
  4277. return true;
  4278. }
  4279. /**
  4280. * The base implementation of `_.isNative` without bad shim checks.
  4281. *
  4282. * @private
  4283. * @param {*} value The value to check.
  4284. * @returns {boolean} Returns `true` if `value` is a native function,
  4285. * else `false`.
  4286. */
  4287. function baseIsNative(value) {
  4288. if (!isObject(value) || isMasked(value)) {
  4289. return false;
  4290. }
  4291. var pattern = isFunction(value) ? reIsNative : reIsHostCtor;
  4292. return pattern.test(toSource(value));
  4293. }
  4294. /**
  4295. * The base implementation of `_.isRegExp` without Node.js optimizations.
  4296. *
  4297. * @private
  4298. * @param {*} value The value to check.
  4299. * @returns {boolean} Returns `true` if `value` is a regexp, else `false`.
  4300. */
  4301. function baseIsRegExp(value) {
  4302. return isObjectLike(value) && baseGetTag(value) == regexpTag;
  4303. }
  4304. /**
  4305. * The base implementation of `_.isSet` without Node.js optimizations.
  4306. *
  4307. * @private
  4308. * @param {*} value The value to check.
  4309. * @returns {boolean} Returns `true` if `value` is a set, else `false`.
  4310. */
  4311. function baseIsSet(value) {
  4312. return isObjectLike(value) && getTag(value) == setTag;
  4313. }
  4314. /**
  4315. * The base implementation of `_.isTypedArray` without Node.js optimizations.
  4316. *
  4317. * @private
  4318. * @param {*} value The value to check.
  4319. * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.
  4320. */
  4321. function baseIsTypedArray(value) {
  4322. return isObjectLike(value) &&
  4323. isLength(value.length) && !!typedArrayTags[baseGetTag(value)];
  4324. }
  4325. /**
  4326. * The base implementation of `_.iteratee`.
  4327. *
  4328. * @private
  4329. * @param {*} [value=_.identity] The value to convert to an iteratee.
  4330. * @returns {Function} Returns the iteratee.
  4331. */
  4332. function baseIteratee(value) {
  4333. // Don't store the `typeof` result in a variable to avoid a JIT bug in Safari 9.
  4334. // See https://bugs.webkit.org/show_bug.cgi?id=156034 for more details.
  4335. if (typeof value == 'function') {
  4336. return value;
  4337. }
  4338. if (value == null) {
  4339. return identity;
  4340. }
  4341. if (typeof value == 'object') {
  4342. return isArray(value)
  4343. ? baseMatchesProperty(value[0], value[1])
  4344. : baseMatches(value);
  4345. }
  4346. return property(value);
  4347. }
  4348. /**
  4349. * The base implementation of `_.keys` which doesn't treat sparse arrays as dense.
  4350. *
  4351. * @private
  4352. * @param {Object} object The object to query.
  4353. * @returns {Array} Returns the array of property names.
  4354. */
  4355. function baseKeys(object) {
  4356. if (!isPrototype(object)) {
  4357. return nativeKeys(object);
  4358. }
  4359. var result = [];
  4360. for (var key in Object(object)) {
  4361. if (hasOwnProperty.call(object, key) && key != 'constructor') {
  4362. result.push(key);
  4363. }
  4364. }
  4365. return result;
  4366. }
  4367. /**
  4368. * The base implementation of `_.keysIn` which doesn't treat sparse arrays as dense.
  4369. *
  4370. * @private
  4371. * @param {Object} object The object to query.
  4372. * @returns {Array} Returns the array of property names.
  4373. */
  4374. function baseKeysIn(object) {
  4375. if (!isObject(object)) {
  4376. return nativeKeysIn(object);
  4377. }
  4378. var isProto = isPrototype(object),
  4379. result = [];
  4380. for (var key in object) {
  4381. if (!(key == 'constructor' && (isProto || !hasOwnProperty.call(object, key)))) {
  4382. result.push(key);
  4383. }
  4384. }
  4385. return result;
  4386. }
  4387. /**
  4388. * The base implementation of `_.lt` which doesn't coerce arguments.
  4389. *
  4390. * @private
  4391. * @param {*} value The value to compare.
  4392. * @param {*} other The other value to compare.
  4393. * @returns {boolean} Returns `true` if `value` is less than `other`,
  4394. * else `false`.
  4395. */
  4396. function baseLt(value, other) {
  4397. return value < other;
  4398. }
  4399. /**
  4400. * The base implementation of `_.map` without support for iteratee shorthands.
  4401. *
  4402. * @private
  4403. * @param {Array|Object} collection The collection to iterate over.
  4404. * @param {Function} iteratee The function invoked per iteration.
  4405. * @returns {Array} Returns the new mapped array.
  4406. */
  4407. function baseMap(collection, iteratee) {
  4408. var index = -1,
  4409. result = isArrayLike(collection) ? Array(collection.length) : [];
  4410. baseEach(collection, function(value, key, collection) {
  4411. result[++index] = iteratee(value, key, collection);
  4412. });
  4413. return result;
  4414. }
  4415. /**
  4416. * The base implementation of `_.matches` which doesn't clone `source`.
  4417. *
  4418. * @private
  4419. * @param {Object} source The object of property values to match.
  4420. * @returns {Function} Returns the new spec function.
  4421. */
  4422. function baseMatches(source) {
  4423. var matchData = getMatchData(source);
  4424. if (matchData.length == 1 && matchData[0][2]) {
  4425. return matchesStrictComparable(matchData[0][0], matchData[0][1]);
  4426. }
  4427. return function(object) {
  4428. return object === source || baseIsMatch(object, source, matchData);
  4429. };
  4430. }
  4431. /**
  4432. * The base implementation of `_.matchesProperty` which doesn't clone `srcValue`.
  4433. *
  4434. * @private
  4435. * @param {string} path The path of the property to get.
  4436. * @param {*} srcValue The value to match.
  4437. * @returns {Function} Returns the new spec function.
  4438. */
  4439. function baseMatchesProperty(path, srcValue) {
  4440. if (isKey(path) && isStrictComparable(srcValue)) {
  4441. return matchesStrictComparable(toKey(path), srcValue);
  4442. }
  4443. return function(object) {
  4444. var objValue = get(object, path);
  4445. return (objValue === undefined && objValue === srcValue)
  4446. ? hasIn(object, path)
  4447. : baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG);
  4448. };
  4449. }
  4450. /**
  4451. * The base implementation of `_.merge` without support for multiple sources.
  4452. *
  4453. * @private
  4454. * @param {Object} object The destination object.
  4455. * @param {Object} source The source object.
  4456. * @param {number} srcIndex The index of `source`.
  4457. * @param {Function} [customizer] The function to customize merged values.
  4458. * @param {Object} [stack] Tracks traversed source values and their merged
  4459. * counterparts.
  4460. */
  4461. function baseMerge(object, source, srcIndex, customizer, stack) {
  4462. if (object === source) {
  4463. return;
  4464. }
  4465. baseFor(source, function(srcValue, key) {
  4466. stack || (stack = new Stack);
  4467. if (isObject(srcValue)) {
  4468. baseMergeDeep(object, source, key, srcIndex, baseMerge, customizer, stack);
  4469. }
  4470. else {
  4471. var newValue = customizer
  4472. ? customizer(safeGet(object, key), srcValue, (key + ''), object, source, stack)
  4473. : undefined;
  4474. if (newValue === undefined) {
  4475. newValue = srcValue;
  4476. }
  4477. assignMergeValue(object, key, newValue);
  4478. }
  4479. }, keysIn);
  4480. }
  4481. /**
  4482. * A specialized version of `baseMerge` for arrays and objects which performs
  4483. * deep merges and tracks traversed objects enabling objects with circular
  4484. * references to be merged.
  4485. *
  4486. * @private
  4487. * @param {Object} object The destination object.
  4488. * @param {Object} source The source object.
  4489. * @param {string} key The key of the value to merge.
  4490. * @param {number} srcIndex The index of `source`.
  4491. * @param {Function} mergeFunc The function to merge values.
  4492. * @param {Function} [customizer] The function to customize assigned values.
  4493. * @param {Object} [stack] Tracks traversed source values and their merged
  4494. * counterparts.
  4495. */
  4496. function baseMergeDeep(object, source, key, srcIndex, mergeFunc, customizer, stack) {
  4497. var objValue = safeGet(object, key),
  4498. srcValue = safeGet(source, key),
  4499. stacked = stack.get(srcValue);
  4500. if (stacked) {
  4501. assignMergeValue(object, key, stacked);
  4502. return;
  4503. }
  4504. var newValue = customizer
  4505. ? customizer(objValue, srcValue, (key + ''), object, source, stack)
  4506. : undefined;
  4507. var isCommon = newValue === undefined;
  4508. if (isCommon) {
  4509. var isArr = isArray(srcValue),
  4510. isBuff = !isArr && isBuffer(srcValue),
  4511. isTyped = !isArr && !isBuff && isTypedArray(srcValue);
  4512. newValue = srcValue;
  4513. if (isArr || isBuff || isTyped) {
  4514. if (isArray(objValue)) {
  4515. newValue = objValue;
  4516. }
  4517. else if (isArrayLikeObject(objValue)) {
  4518. newValue = copyArray(objValue);
  4519. }
  4520. else if (isBuff) {
  4521. isCommon = false;
  4522. newValue = cloneBuffer(srcValue, true);
  4523. }
  4524. else if (isTyped) {
  4525. isCommon = false;
  4526. newValue = cloneTypedArray(srcValue, true);
  4527. }
  4528. else {
  4529. newValue = [];
  4530. }
  4531. }
  4532. else if (isPlainObject(srcValue) || isArguments(srcValue)) {
  4533. newValue = objValue;
  4534. if (isArguments(objValue)) {
  4535. newValue = toPlainObject(objValue);
  4536. }
  4537. else if (!isObject(objValue) || isFunction(objValue)) {
  4538. newValue = initCloneObject(srcValue);
  4539. }
  4540. }
  4541. else {
  4542. isCommon = false;
  4543. }
  4544. }
  4545. if (isCommon) {
  4546. // Recursively merge objects and arrays (susceptible to call stack limits).
  4547. stack.set(srcValue, newValue);
  4548. mergeFunc(newValue, srcValue, srcIndex, customizer, stack);
  4549. stack['delete'](srcValue);
  4550. }
  4551. assignMergeValue(object, key, newValue);
  4552. }
  4553. /**
  4554. * The base implementation of `_.nth` which doesn't coerce arguments.
  4555. *
  4556. * @private
  4557. * @param {Array} array The array to query.
  4558. * @param {number} n The index of the element to return.
  4559. * @returns {*} Returns the nth element of `array`.
  4560. */
  4561. function baseNth(array, n) {
  4562. var length = array.length;
  4563. if (!length) {
  4564. return;
  4565. }
  4566. n += n < 0 ? length : 0;
  4567. return isIndex(n, length) ? array[n] : undefined;
  4568. }
  4569. /**
  4570. * The base implementation of `_.orderBy` without param guards.
  4571. *
  4572. * @private
  4573. * @param {Array|Object} collection The collection to iterate over.
  4574. * @param {Function[]|Object[]|string[]} iteratees The iteratees to sort by.
  4575. * @param {string[]} orders The sort orders of `iteratees`.
  4576. * @returns {Array} Returns the new sorted array.
  4577. */
  4578. function baseOrderBy(collection, iteratees, orders) {
  4579. if (iteratees.length) {
  4580. iteratees = arrayMap(iteratees, function(iteratee) {
  4581. if (isArray(iteratee)) {
  4582. return function(value) {
  4583. return baseGet(value, iteratee.length === 1 ? iteratee[0] : iteratee);
  4584. }
  4585. }
  4586. return iteratee;
  4587. });
  4588. } else {
  4589. iteratees = [identity];
  4590. }
  4591. var index = -1;
  4592. iteratees = arrayMap(iteratees, baseUnary(getIteratee()));
  4593. var result = baseMap(collection, function(value, key, collection) {
  4594. var criteria = arrayMap(iteratees, function(iteratee) {
  4595. return iteratee(value);
  4596. });
  4597. return { 'criteria': criteria, 'index': ++index, 'value': value };
  4598. });
  4599. return baseSortBy(result, function(object, other) {
  4600. return compareMultiple(object, other, orders);
  4601. });
  4602. }
  4603. /**
  4604. * The base implementation of `_.pick` without support for individual
  4605. * property identifiers.
  4606. *
  4607. * @private
  4608. * @param {Object} object The source object.
  4609. * @param {string[]} paths The property paths to pick.
  4610. * @returns {Object} Returns the new object.
  4611. */
  4612. function basePick(object, paths) {
  4613. return basePickBy(object, paths, function(value, path) {
  4614. return hasIn(object, path);
  4615. });
  4616. }
  4617. /**
  4618. * The base implementation of `_.pickBy` without support for iteratee shorthands.
  4619. *
  4620. * @private
  4621. * @param {Object} object The source object.
  4622. * @param {string[]} paths The property paths to pick.
  4623. * @param {Function} predicate The function invoked per property.
  4624. * @returns {Object} Returns the new object.
  4625. */
  4626. function basePickBy(object, paths, predicate) {
  4627. var index = -1,
  4628. length = paths.length,
  4629. result = {};
  4630. while (++index < length) {
  4631. var path = paths[index],
  4632. value = baseGet(object, path);
  4633. if (predicate(value, path)) {
  4634. baseSet(result, castPath(path, object), value);
  4635. }
  4636. }
  4637. return result;
  4638. }
  4639. /**
  4640. * A specialized version of `baseProperty` which supports deep paths.
  4641. *
  4642. * @private
  4643. * @param {Array|string} path The path of the property to get.
  4644. * @returns {Function} Returns the new accessor function.
  4645. */
  4646. function basePropertyDeep(path) {
  4647. return function(object) {
  4648. return baseGet(object, path);
  4649. };
  4650. }
  4651. /**
  4652. * The base implementation of `_.pullAllBy` without support for iteratee
  4653. * shorthands.
  4654. *
  4655. * @private
  4656. * @param {Array} array The array to modify.
  4657. * @param {Array} values The values to remove.
  4658. * @param {Function} [iteratee] The iteratee invoked per element.
  4659. * @param {Function} [comparator] The comparator invoked per element.
  4660. * @returns {Array} Returns `array`.
  4661. */
  4662. function basePullAll(array, values, iteratee, comparator) {
  4663. var indexOf = comparator ? baseIndexOfWith : baseIndexOf,
  4664. index = -1,
  4665. length = values.length,
  4666. seen = array;
  4667. if (array === values) {
  4668. values = copyArray(values);
  4669. }
  4670. if (iteratee) {
  4671. seen = arrayMap(array, baseUnary(iteratee));
  4672. }
  4673. while (++index < length) {
  4674. var fromIndex = 0,
  4675. value = values[index],
  4676. computed = iteratee ? iteratee(value) : value;
  4677. while ((fromIndex = indexOf(seen, computed, fromIndex, comparator)) > -1) {
  4678. if (seen !== array) {
  4679. splice.call(seen, fromIndex, 1);
  4680. }
  4681. splice.call(array, fromIndex, 1);
  4682. }
  4683. }
  4684. return array;
  4685. }
  4686. /**
  4687. * The base implementation of `_.pullAt` without support for individual
  4688. * indexes or capturing the removed elements.
  4689. *
  4690. * @private
  4691. * @param {Array} array The array to modify.
  4692. * @param {number[]} indexes The indexes of elements to remove.
  4693. * @returns {Array} Returns `array`.
  4694. */
  4695. function basePullAt(array, indexes) {
  4696. var length = array ? indexes.length : 0,
  4697. lastIndex = length - 1;
  4698. while (length--) {
  4699. var index = indexes[length];
  4700. if (length == lastIndex || index !== previous) {
  4701. var previous = index;
  4702. if (isIndex(index)) {
  4703. splice.call(array, index, 1);
  4704. } else {
  4705. baseUnset(array, index);
  4706. }
  4707. }
  4708. }
  4709. return array;
  4710. }
  4711. /**
  4712. * The base implementation of `_.random` without support for returning
  4713. * floating-point numbers.
  4714. *
  4715. * @private
  4716. * @param {number} lower The lower bound.
  4717. * @param {number} upper The upper bound.
  4718. * @returns {number} Returns the random number.
  4719. */
  4720. function baseRandom(lower, upper) {
  4721. return lower + nativeFloor(nativeRandom() * (upper - lower + 1));
  4722. }
  4723. /**
  4724. * The base implementation of `_.range` and `_.rangeRight` which doesn't
  4725. * coerce arguments.
  4726. *
  4727. * @private
  4728. * @param {number} start The start of the range.
  4729. * @param {number} end The end of the range.
  4730. * @param {number} step The value to increment or decrement by.
  4731. * @param {boolean} [fromRight] Specify iterating from right to left.
  4732. * @returns {Array} Returns the range of numbers.
  4733. */
  4734. function baseRange(start, end, step, fromRight) {
  4735. var index = -1,
  4736. length = nativeMax(nativeCeil((end - start) / (step || 1)), 0),
  4737. result = Array(length);
  4738. while (length--) {
  4739. result[fromRight ? length : ++index] = start;
  4740. start += step;
  4741. }
  4742. return result;
  4743. }
  4744. /**
  4745. * The base implementation of `_.repeat` which doesn't coerce arguments.
  4746. *
  4747. * @private
  4748. * @param {string} string The string to repeat.
  4749. * @param {number} n The number of times to repeat the string.
  4750. * @returns {string} Returns the repeated string.
  4751. */
  4752. function baseRepeat(string, n) {
  4753. var result = '';
  4754. if (!string || n < 1 || n > MAX_SAFE_INTEGER) {
  4755. return result;
  4756. }
  4757. // Leverage the exponentiation by squaring algorithm for a faster repeat.
  4758. // See https://en.wikipedia.org/wiki/Exponentiation_by_squaring for more details.
  4759. do {
  4760. if (n % 2) {
  4761. result += string;
  4762. }
  4763. n = nativeFloor(n / 2);
  4764. if (n) {
  4765. string += string;
  4766. }
  4767. } while (n);
  4768. return result;
  4769. }
  4770. /**
  4771. * The base implementation of `_.rest` which doesn't validate or coerce arguments.
  4772. *
  4773. * @private
  4774. * @param {Function} func The function to apply a rest parameter to.
  4775. * @param {number} [start=func.length-1] The start position of the rest parameter.
  4776. * @returns {Function} Returns the new function.
  4777. */
  4778. function baseRest(func, start) {
  4779. return setToString(overRest(func, start, identity), func + '');
  4780. }
  4781. /**
  4782. * The base implementation of `_.sample`.
  4783. *
  4784. * @private
  4785. * @param {Array|Object} collection The collection to sample.
  4786. * @returns {*} Returns the random element.
  4787. */
  4788. function baseSample(collection) {
  4789. return arraySample(values(collection));
  4790. }
  4791. /**
  4792. * The base implementation of `_.sampleSize` without param guards.
  4793. *
  4794. * @private
  4795. * @param {Array|Object} collection The collection to sample.
  4796. * @param {number} n The number of elements to sample.
  4797. * @returns {Array} Returns the random elements.
  4798. */
  4799. function baseSampleSize(collection, n) {
  4800. var array = values(collection);
  4801. return shuffleSelf(array, baseClamp(n, 0, array.length));
  4802. }
  4803. /**
  4804. * The base implementation of `_.set`.
  4805. *
  4806. * @private
  4807. * @param {Object} object The object to modify.
  4808. * @param {Array|string} path The path of the property to set.
  4809. * @param {*} value The value to set.
  4810. * @param {Function} [customizer] The function to customize path creation.
  4811. * @returns {Object} Returns `object`.
  4812. */
  4813. function baseSet(object, path, value, customizer) {
  4814. if (!isObject(object)) {
  4815. return object;
  4816. }
  4817. path = castPath(path, object);
  4818. var index = -1,
  4819. length = path.length,
  4820. lastIndex = length - 1,
  4821. nested = object;
  4822. while (nested != null && ++index < length) {
  4823. var key = toKey(path[index]),
  4824. newValue = value;
  4825. if (key === '__proto__' || key === 'constructor' || key === 'prototype') {
  4826. return object;
  4827. }
  4828. if (index != lastIndex) {
  4829. var objValue = nested[key];
  4830. newValue = customizer ? customizer(objValue, key, nested) : undefined;
  4831. if (newValue === undefined) {
  4832. newValue = isObject(objValue)
  4833. ? objValue
  4834. : (isIndex(path[index + 1]) ? [] : {});
  4835. }
  4836. }
  4837. assignValue(nested, key, newValue);
  4838. nested = nested[key];
  4839. }
  4840. return object;
  4841. }
  4842. /**
  4843. * The base implementation of `setData` without support for hot loop shorting.
  4844. *
  4845. * @private
  4846. * @param {Function} func The function to associate metadata with.
  4847. * @param {*} data The metadata.
  4848. * @returns {Function} Returns `func`.
  4849. */
  4850. var baseSetData = !metaMap ? identity : function(func, data) {
  4851. metaMap.set(func, data);
  4852. return func;
  4853. };
  4854. /**
  4855. * The base implementation of `setToString` without support for hot loop shorting.
  4856. *
  4857. * @private
  4858. * @param {Function} func The function to modify.
  4859. * @param {Function} string The `toString` result.
  4860. * @returns {Function} Returns `func`.
  4861. */
  4862. var baseSetToString = !defineProperty ? identity : function(func, string) {
  4863. return defineProperty(func, 'toString', {
  4864. 'configurable': true,
  4865. 'enumerable': false,
  4866. 'value': constant(string),
  4867. 'writable': true
  4868. });
  4869. };
  4870. /**
  4871. * The base implementation of `_.shuffle`.
  4872. *
  4873. * @private
  4874. * @param {Array|Object} collection The collection to shuffle.
  4875. * @returns {Array} Returns the new shuffled array.
  4876. */
  4877. function baseShuffle(collection) {
  4878. return shuffleSelf(values(collection));
  4879. }
  4880. /**
  4881. * The base implementation of `_.slice` without an iteratee call guard.
  4882. *
  4883. * @private
  4884. * @param {Array} array The array to slice.
  4885. * @param {number} [start=0] The start position.
  4886. * @param {number} [end=array.length] The end position.
  4887. * @returns {Array} Returns the slice of `array`.
  4888. */
  4889. function baseSlice(array, start, end) {
  4890. var index = -1,
  4891. length = array.length;
  4892. if (start < 0) {
  4893. start = -start > length ? 0 : (length + start);
  4894. }
  4895. end = end > length ? length : end;
  4896. if (end < 0) {
  4897. end += length;
  4898. }
  4899. length = start > end ? 0 : ((end - start) >>> 0);
  4900. start >>>= 0;
  4901. var result = Array(length);
  4902. while (++index < length) {
  4903. result[index] = array[index + start];
  4904. }
  4905. return result;
  4906. }
  4907. /**
  4908. * The base implementation of `_.some` without support for iteratee shorthands.
  4909. *
  4910. * @private
  4911. * @param {Array|Object} collection The collection to iterate over.
  4912. * @param {Function} predicate The function invoked per iteration.
  4913. * @returns {boolean} Returns `true` if any element passes the predicate check,
  4914. * else `false`.
  4915. */
  4916. function baseSome(collection, predicate) {
  4917. var result;
  4918. baseEach(collection, function(value, index, collection) {
  4919. result = predicate(value, index, collection);
  4920. return !result;
  4921. });
  4922. return !!result;
  4923. }
  4924. /**
  4925. * The base implementation of `_.sortedIndex` and `_.sortedLastIndex` which
  4926. * performs a binary search of `array` to determine the index at which `value`
  4927. * should be inserted into `array` in order to maintain its sort order.
  4928. *
  4929. * @private
  4930. * @param {Array} array The sorted array to inspect.
  4931. * @param {*} value The value to evaluate.
  4932. * @param {boolean} [retHighest] Specify returning the highest qualified index.
  4933. * @returns {number} Returns the index at which `value` should be inserted
  4934. * into `array`.
  4935. */
  4936. function baseSortedIndex(array, value, retHighest) {
  4937. var low = 0,
  4938. high = array == null ? low : array.length;
  4939. if (typeof value == 'number' && value === value && high <= HALF_MAX_ARRAY_LENGTH) {
  4940. while (low < high) {
  4941. var mid = (low + high) >>> 1,
  4942. computed = array[mid];
  4943. if (computed !== null && !isSymbol(computed) &&
  4944. (retHighest ? (computed <= value) : (computed < value))) {
  4945. low = mid + 1;
  4946. } else {
  4947. high = mid;
  4948. }
  4949. }
  4950. return high;
  4951. }
  4952. return baseSortedIndexBy(array, value, identity, retHighest);
  4953. }
  4954. /**
  4955. * The base implementation of `_.sortedIndexBy` and `_.sortedLastIndexBy`
  4956. * which invokes `iteratee` for `value` and each element of `array` to compute
  4957. * their sort ranking. The iteratee is invoked with one argument; (value).
  4958. *
  4959. * @private
  4960. * @param {Array} array The sorted array to inspect.
  4961. * @param {*} value The value to evaluate.
  4962. * @param {Function} iteratee The iteratee invoked per element.
  4963. * @param {boolean} [retHighest] Specify returning the highest qualified index.
  4964. * @returns {number} Returns the index at which `value` should be inserted
  4965. * into `array`.
  4966. */
  4967. function baseSortedIndexBy(array, value, iteratee, retHighest) {
  4968. var low = 0,
  4969. high = array == null ? 0 : array.length;
  4970. if (high === 0) {
  4971. return 0;
  4972. }
  4973. value = iteratee(value);
  4974. var valIsNaN = value !== value,
  4975. valIsNull = value === null,
  4976. valIsSymbol = isSymbol(value),
  4977. valIsUndefined = value === undefined;
  4978. while (low < high) {
  4979. var mid = nativeFloor((low + high) / 2),
  4980. computed = iteratee(array[mid]),
  4981. othIsDefined = computed !== undefined,
  4982. othIsNull = computed === null,
  4983. othIsReflexive = computed === computed,
  4984. othIsSymbol = isSymbol(computed);
  4985. if (valIsNaN) {
  4986. var setLow = retHighest || othIsReflexive;
  4987. } else if (valIsUndefined) {
  4988. setLow = othIsReflexive && (retHighest || othIsDefined);
  4989. } else if (valIsNull) {
  4990. setLow = othIsReflexive && othIsDefined && (retHighest || !othIsNull);
  4991. } else if (valIsSymbol) {
  4992. setLow = othIsReflexive && othIsDefined && !othIsNull && (retHighest || !othIsSymbol);
  4993. } else if (othIsNull || othIsSymbol) {
  4994. setLow = false;
  4995. } else {
  4996. setLow = retHighest ? (computed <= value) : (computed < value);
  4997. }
  4998. if (setLow) {
  4999. low = mid + 1;
  5000. } else {
  5001. high = mid;
  5002. }
  5003. }
  5004. return nativeMin(high, MAX_ARRAY_INDEX);
  5005. }
  5006. /**
  5007. * The base implementation of `_.sortedUniq` and `_.sortedUniqBy` without
  5008. * support for iteratee shorthands.
  5009. *
  5010. * @private
  5011. * @param {Array} array The array to inspect.
  5012. * @param {Function} [iteratee] The iteratee invoked per element.
  5013. * @returns {Array} Returns the new duplicate free array.
  5014. */
  5015. function baseSortedUniq(array, iteratee) {
  5016. var index = -1,
  5017. length = array.length,
  5018. resIndex = 0,
  5019. result = [];
  5020. while (++index < length) {
  5021. var value = array[index],
  5022. computed = iteratee ? iteratee(value) : value;
  5023. if (!index || !eq(computed, seen)) {
  5024. var seen = computed;
  5025. result[resIndex++] = value === 0 ? 0 : value;
  5026. }
  5027. }
  5028. return result;
  5029. }
  5030. /**
  5031. * The base implementation of `_.toNumber` which doesn't ensure correct
  5032. * conversions of binary, hexadecimal, or octal string values.
  5033. *
  5034. * @private
  5035. * @param {*} value The value to process.
  5036. * @returns {number} Returns the number.
  5037. */
  5038. function baseToNumber(value) {
  5039. if (typeof value == 'number') {
  5040. return value;
  5041. }
  5042. if (isSymbol(value)) {
  5043. return NAN;
  5044. }
  5045. return +value;
  5046. }
  5047. /**
  5048. * The base implementation of `_.toString` which doesn't convert nullish
  5049. * values to empty strings.
  5050. *
  5051. * @private
  5052. * @param {*} value The value to process.
  5053. * @returns {string} Returns the string.
  5054. */
  5055. function baseToString(value) {
  5056. // Exit early for strings to avoid a performance hit in some environments.
  5057. if (typeof value == 'string') {
  5058. return value;
  5059. }
  5060. if (isArray(value)) {
  5061. // Recursively convert values (susceptible to call stack limits).
  5062. return arrayMap(value, baseToString) + '';
  5063. }
  5064. if (isSymbol(value)) {
  5065. return symbolToString ? symbolToString.call(value) : '';
  5066. }
  5067. var result = (value + '');
  5068. return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;
  5069. }
  5070. /**
  5071. * The base implementation of `_.uniqBy` without support for iteratee shorthands.
  5072. *
  5073. * @private
  5074. * @param {Array} array The array to inspect.
  5075. * @param {Function} [iteratee] The iteratee invoked per element.
  5076. * @param {Function} [comparator] The comparator invoked per element.
  5077. * @returns {Array} Returns the new duplicate free array.
  5078. */
  5079. function baseUniq(array, iteratee, comparator) {
  5080. var index = -1,
  5081. includes = arrayIncludes,
  5082. length = array.length,
  5083. isCommon = true,
  5084. result = [],
  5085. seen = result;
  5086. if (comparator) {
  5087. isCommon = false;
  5088. includes = arrayIncludesWith;
  5089. }
  5090. else if (length >= LARGE_ARRAY_SIZE) {
  5091. var set = iteratee ? null : createSet(array);
  5092. if (set) {
  5093. return setToArray(set);
  5094. }
  5095. isCommon = false;
  5096. includes = cacheHas;
  5097. seen = new SetCache;
  5098. }
  5099. else {
  5100. seen = iteratee ? [] : result;
  5101. }
  5102. outer:
  5103. while (++index < length) {
  5104. var value = array[index],
  5105. computed = iteratee ? iteratee(value) : value;
  5106. value = (comparator || value !== 0) ? value : 0;
  5107. if (isCommon && computed === computed) {
  5108. var seenIndex = seen.length;
  5109. while (seenIndex--) {
  5110. if (seen[seenIndex] === computed) {
  5111. continue outer;
  5112. }
  5113. }
  5114. if (iteratee) {
  5115. seen.push(computed);
  5116. }
  5117. result.push(value);
  5118. }
  5119. else if (!includes(seen, computed, comparator)) {
  5120. if (seen !== result) {
  5121. seen.push(computed);
  5122. }
  5123. result.push(value);
  5124. }
  5125. }
  5126. return result;
  5127. }
  5128. /**
  5129. * The base implementation of `_.unset`.
  5130. *
  5131. * @private
  5132. * @param {Object} object The object to modify.
  5133. * @param {Array|string} path The property path to unset.
  5134. * @returns {boolean} Returns `true` if the property is deleted, else `false`.
  5135. */
  5136. function baseUnset(object, path) {
  5137. path = castPath(path, object);
  5138. object = parent(object, path);
  5139. return object == null || delete object[toKey(last(path))];
  5140. }
  5141. /**
  5142. * The base implementation of `_.update`.
  5143. *
  5144. * @private
  5145. * @param {Object} object The object to modify.
  5146. * @param {Array|string} path The path of the property to update.
  5147. * @param {Function} updater The function to produce the updated value.
  5148. * @param {Function} [customizer] The function to customize path creation.
  5149. * @returns {Object} Returns `object`.
  5150. */
  5151. function baseUpdate(object, path, updater, customizer) {
  5152. return baseSet(object, path, updater(baseGet(object, path)), customizer);
  5153. }
  5154. /**
  5155. * The base implementation of methods like `_.dropWhile` and `_.takeWhile`
  5156. * without support for iteratee shorthands.
  5157. *
  5158. * @private
  5159. * @param {Array} array The array to query.
  5160. * @param {Function} predicate The function invoked per iteration.
  5161. * @param {boolean} [isDrop] Specify dropping elements instead of taking them.
  5162. * @param {boolean} [fromRight] Specify iterating from right to left.
  5163. * @returns {Array} Returns the slice of `array`.
  5164. */
  5165. function baseWhile(array, predicate, isDrop, fromRight) {
  5166. var length = array.length,
  5167. index = fromRight ? length : -1;
  5168. while ((fromRight ? index-- : ++index < length) &&
  5169. predicate(array[index], index, array)) {}
  5170. return isDrop
  5171. ? baseSlice(array, (fromRight ? 0 : index), (fromRight ? index + 1 : length))
  5172. : baseSlice(array, (fromRight ? index + 1 : 0), (fromRight ? length : index));
  5173. }
  5174. /**
  5175. * The base implementation of `wrapperValue` which returns the result of
  5176. * performing a sequence of actions on the unwrapped `value`, where each
  5177. * successive action is supplied the return value of the previous.
  5178. *
  5179. * @private
  5180. * @param {*} value The unwrapped value.
  5181. * @param {Array} actions Actions to perform to resolve the unwrapped value.
  5182. * @returns {*} Returns the resolved value.
  5183. */
  5184. function baseWrapperValue(value, actions) {
  5185. var result = value;
  5186. if (result instanceof LazyWrapper) {
  5187. result = result.value();
  5188. }
  5189. return arrayReduce(actions, function(result, action) {
  5190. return action.func.apply(action.thisArg, arrayPush([result], action.args));
  5191. }, result);
  5192. }
  5193. /**
  5194. * The base implementation of methods like `_.xor`, without support for
  5195. * iteratee shorthands, that accepts an array of arrays to inspect.
  5196. *
  5197. * @private
  5198. * @param {Array} arrays The arrays to inspect.
  5199. * @param {Function} [iteratee] The iteratee invoked per element.
  5200. * @param {Function} [comparator] The comparator invoked per element.
  5201. * @returns {Array} Returns the new array of values.
  5202. */
  5203. function baseXor(arrays, iteratee, comparator) {
  5204. var length = arrays.length;
  5205. if (length < 2) {
  5206. return length ? baseUniq(arrays[0]) : [];
  5207. }
  5208. var index = -1,
  5209. result = Array(length);
  5210. while (++index < length) {
  5211. var array = arrays[index],
  5212. othIndex = -1;
  5213. while (++othIndex < length) {
  5214. if (othIndex != index) {
  5215. result[index] = baseDifference(result[index] || array, arrays[othIndex], iteratee, comparator);
  5216. }
  5217. }
  5218. }
  5219. return baseUniq(baseFlatten(result, 1), iteratee, comparator);
  5220. }
  5221. /**
  5222. * This base implementation of `_.zipObject` which assigns values using `assignFunc`.
  5223. *
  5224. * @private
  5225. * @param {Array} props The property identifiers.
  5226. * @param {Array} values The property values.
  5227. * @param {Function} assignFunc The function to assign values.
  5228. * @returns {Object} Returns the new object.
  5229. */
  5230. function baseZipObject(props, values, assignFunc) {
  5231. var index = -1,
  5232. length = props.length,
  5233. valsLength = values.length,
  5234. result = {};
  5235. while (++index < length) {
  5236. var value = index < valsLength ? values[index] : undefined;
  5237. assignFunc(result, props[index], value);
  5238. }
  5239. return result;
  5240. }
  5241. /**
  5242. * Casts `value` to an empty array if it's not an array like object.
  5243. *
  5244. * @private
  5245. * @param {*} value The value to inspect.
  5246. * @returns {Array|Object} Returns the cast array-like object.
  5247. */
  5248. function castArrayLikeObject(value) {
  5249. return isArrayLikeObject(value) ? value : [];
  5250. }
  5251. /**
  5252. * Casts `value` to `identity` if it's not a function.
  5253. *
  5254. * @private
  5255. * @param {*} value The value to inspect.
  5256. * @returns {Function} Returns cast function.
  5257. */
  5258. function castFunction(value) {
  5259. return typeof value == 'function' ? value : identity;
  5260. }
  5261. /**
  5262. * Casts `value` to a path array if it's not one.
  5263. *
  5264. * @private
  5265. * @param {*} value The value to inspect.
  5266. * @param {Object} [object] The object to query keys on.
  5267. * @returns {Array} Returns the cast property path array.
  5268. */
  5269. function castPath(value, object) {
  5270. if (isArray(value)) {
  5271. return value;
  5272. }
  5273. return isKey(value, object) ? [value] : stringToPath(toString(value));
  5274. }
  5275. /**
  5276. * A `baseRest` alias which can be replaced with `identity` by module
  5277. * replacement plugins.
  5278. *
  5279. * @private
  5280. * @type {Function}
  5281. * @param {Function} func The function to apply a rest parameter to.
  5282. * @returns {Function} Returns the new function.
  5283. */
  5284. var castRest = baseRest;
  5285. /**
  5286. * Casts `array` to a slice if it's needed.
  5287. *
  5288. * @private
  5289. * @param {Array} array The array to inspect.
  5290. * @param {number} start The start position.
  5291. * @param {number} [end=array.length] The end position.
  5292. * @returns {Array} Returns the cast slice.
  5293. */
  5294. function castSlice(array, start, end) {
  5295. var length = array.length;
  5296. end = end === undefined ? length : end;
  5297. return (!start && end >= length) ? array : baseSlice(array, start, end);
  5298. }
  5299. /**
  5300. * A simple wrapper around the global [`clearTimeout`](https://mdn.io/clearTimeout).
  5301. *
  5302. * @private
  5303. * @param {number|Object} id The timer id or timeout object of the timer to clear.
  5304. */
  5305. var clearTimeout = ctxClearTimeout || function(id) {
  5306. return root.clearTimeout(id);
  5307. };
  5308. /**
  5309. * Creates a clone of `buffer`.
  5310. *
  5311. * @private
  5312. * @param {Buffer} buffer The buffer to clone.
  5313. * @param {boolean} [isDeep] Specify a deep clone.
  5314. * @returns {Buffer} Returns the cloned buffer.
  5315. */
  5316. function cloneBuffer(buffer, isDeep) {
  5317. if (isDeep) {
  5318. return buffer.slice();
  5319. }
  5320. var length = buffer.length,
  5321. result = allocUnsafe ? allocUnsafe(length) : new buffer.constructor(length);
  5322. buffer.copy(result);
  5323. return result;
  5324. }
  5325. /**
  5326. * Creates a clone of `arrayBuffer`.
  5327. *
  5328. * @private
  5329. * @param {ArrayBuffer} arrayBuffer The array buffer to clone.
  5330. * @returns {ArrayBuffer} Returns the cloned array buffer.
  5331. */
  5332. function cloneArrayBuffer(arrayBuffer) {
  5333. var result = new arrayBuffer.constructor(arrayBuffer.byteLength);
  5334. new Uint8Array(result).set(new Uint8Array(arrayBuffer));
  5335. return result;
  5336. }
  5337. /**
  5338. * Creates a clone of `dataView`.
  5339. *
  5340. * @private
  5341. * @param {Object} dataView The data view to clone.
  5342. * @param {boolean} [isDeep] Specify a deep clone.
  5343. * @returns {Object} Returns the cloned data view.
  5344. */
  5345. function cloneDataView(dataView, isDeep) {
  5346. var buffer = isDeep ? cloneArrayBuffer(dataView.buffer) : dataView.buffer;
  5347. return new dataView.constructor(buffer, dataView.byteOffset, dataView.byteLength);
  5348. }
  5349. /**
  5350. * Creates a clone of `regexp`.
  5351. *
  5352. * @private
  5353. * @param {Object} regexp The regexp to clone.
  5354. * @returns {Object} Returns the cloned regexp.
  5355. */
  5356. function cloneRegExp(regexp) {
  5357. var result = new regexp.constructor(regexp.source, reFlags.exec(regexp));
  5358. result.lastIndex = regexp.lastIndex;
  5359. return result;
  5360. }
  5361. /**
  5362. * Creates a clone of the `symbol` object.
  5363. *
  5364. * @private
  5365. * @param {Object} symbol The symbol object to clone.
  5366. * @returns {Object} Returns the cloned symbol object.
  5367. */
  5368. function cloneSymbol(symbol) {
  5369. return symbolValueOf ? Object(symbolValueOf.call(symbol)) : {};
  5370. }
  5371. /**
  5372. * Creates a clone of `typedArray`.
  5373. *
  5374. * @private
  5375. * @param {Object} typedArray The typed array to clone.
  5376. * @param {boolean} [isDeep] Specify a deep clone.
  5377. * @returns {Object} Returns the cloned typed array.
  5378. */
  5379. function cloneTypedArray(typedArray, isDeep) {
  5380. var buffer = isDeep ? cloneArrayBuffer(typedArray.buffer) : typedArray.buffer;
  5381. return new typedArray.constructor(buffer, typedArray.byteOffset, typedArray.length);
  5382. }
  5383. /**
  5384. * Compares values to sort them in ascending order.
  5385. *
  5386. * @private
  5387. * @param {*} value The value to compare.
  5388. * @param {*} other The other value to compare.
  5389. * @returns {number} Returns the sort order indicator for `value`.
  5390. */
  5391. function compareAscending(value, other) {
  5392. if (value !== other) {
  5393. var valIsDefined = value !== undefined,
  5394. valIsNull = value === null,
  5395. valIsReflexive = value === value,
  5396. valIsSymbol = isSymbol(value);
  5397. var othIsDefined = other !== undefined,
  5398. othIsNull = other === null,
  5399. othIsReflexive = other === other,
  5400. othIsSymbol = isSymbol(other);
  5401. if ((!othIsNull && !othIsSymbol && !valIsSymbol && value > other) ||
  5402. (valIsSymbol && othIsDefined && othIsReflexive && !othIsNull && !othIsSymbol) ||
  5403. (valIsNull && othIsDefined && othIsReflexive) ||
  5404. (!valIsDefined && othIsReflexive) ||
  5405. !valIsReflexive) {
  5406. return 1;
  5407. }
  5408. if ((!valIsNull && !valIsSymbol && !othIsSymbol && value < other) ||
  5409. (othIsSymbol && valIsDefined && valIsReflexive && !valIsNull && !valIsSymbol) ||
  5410. (othIsNull && valIsDefined && valIsReflexive) ||
  5411. (!othIsDefined && valIsReflexive) ||
  5412. !othIsReflexive) {
  5413. return -1;
  5414. }
  5415. }
  5416. return 0;
  5417. }
  5418. /**
  5419. * Used by `_.orderBy` to compare multiple properties of a value to another
  5420. * and stable sort them.
  5421. *
  5422. * If `orders` is unspecified, all values are sorted in ascending order. Otherwise,
  5423. * specify an order of "desc" for descending or "asc" for ascending sort order
  5424. * of corresponding values.
  5425. *
  5426. * @private
  5427. * @param {Object} object The object to compare.
  5428. * @param {Object} other The other object to compare.
  5429. * @param {boolean[]|string[]} orders The order to sort by for each property.
  5430. * @returns {number} Returns the sort order indicator for `object`.
  5431. */
  5432. function compareMultiple(object, other, orders) {
  5433. var index = -1,
  5434. objCriteria = object.criteria,
  5435. othCriteria = other.criteria,
  5436. length = objCriteria.length,
  5437. ordersLength = orders.length;
  5438. while (++index < length) {
  5439. var result = compareAscending(objCriteria[index], othCriteria[index]);
  5440. if (result) {
  5441. if (index >= ordersLength) {
  5442. return result;
  5443. }
  5444. var order = orders[index];
  5445. return result * (order == 'desc' ? -1 : 1);
  5446. }
  5447. }
  5448. // Fixes an `Array#sort` bug in the JS engine embedded in Adobe applications
  5449. // that causes it, under certain circumstances, to provide the same value for
  5450. // `object` and `other`. See https://github.com/jashkenas/underscore/pull/1247
  5451. // for more details.
  5452. //
  5453. // This also ensures a stable sort in V8 and other engines.
  5454. // See https://bugs.chromium.org/p/v8/issues/detail?id=90 for more details.
  5455. return object.index - other.index;
  5456. }
  5457. /**
  5458. * Creates an array that is the composition of partially applied arguments,
  5459. * placeholders, and provided arguments into a single array of arguments.
  5460. *
  5461. * @private
  5462. * @param {Array} args The provided arguments.
  5463. * @param {Array} partials The arguments to prepend to those provided.
  5464. * @param {Array} holders The `partials` placeholder indexes.
  5465. * @params {boolean} [isCurried] Specify composing for a curried function.
  5466. * @returns {Array} Returns the new array of composed arguments.
  5467. */
  5468. function composeArgs(args, partials, holders, isCurried) {
  5469. var argsIndex = -1,
  5470. argsLength = args.length,
  5471. holdersLength = holders.length,
  5472. leftIndex = -1,
  5473. leftLength = partials.length,
  5474. rangeLength = nativeMax(argsLength - holdersLength, 0),
  5475. result = Array(leftLength + rangeLength),
  5476. isUncurried = !isCurried;
  5477. while (++leftIndex < leftLength) {
  5478. result[leftIndex] = partials[leftIndex];
  5479. }
  5480. while (++argsIndex < holdersLength) {
  5481. if (isUncurried || argsIndex < argsLength) {
  5482. result[holders[argsIndex]] = args[argsIndex];
  5483. }
  5484. }
  5485. while (rangeLength--) {
  5486. result[leftIndex++] = args[argsIndex++];
  5487. }
  5488. return result;
  5489. }
  5490. /**
  5491. * This function is like `composeArgs` except that the arguments composition
  5492. * is tailored for `_.partialRight`.
  5493. *
  5494. * @private
  5495. * @param {Array} args The provided arguments.
  5496. * @param {Array} partials The arguments to append to those provided.
  5497. * @param {Array} holders The `partials` placeholder indexes.
  5498. * @params {boolean} [isCurried] Specify composing for a curried function.
  5499. * @returns {Array} Returns the new array of composed arguments.
  5500. */
  5501. function composeArgsRight(args, partials, holders, isCurried) {
  5502. var argsIndex = -1,
  5503. argsLength = args.length,
  5504. holdersIndex = -1,
  5505. holdersLength = holders.length,
  5506. rightIndex = -1,
  5507. rightLength = partials.length,
  5508. rangeLength = nativeMax(argsLength - holdersLength, 0),
  5509. result = Array(rangeLength + rightLength),
  5510. isUncurried = !isCurried;
  5511. while (++argsIndex < rangeLength) {
  5512. result[argsIndex] = args[argsIndex];
  5513. }
  5514. var offset = argsIndex;
  5515. while (++rightIndex < rightLength) {
  5516. result[offset + rightIndex] = partials[rightIndex];
  5517. }
  5518. while (++holdersIndex < holdersLength) {
  5519. if (isUncurried || argsIndex < argsLength) {
  5520. result[offset + holders[holdersIndex]] = args[argsIndex++];
  5521. }
  5522. }
  5523. return result;
  5524. }
  5525. /**
  5526. * Copies the values of `source` to `array`.
  5527. *
  5528. * @private
  5529. * @param {Array} source The array to copy values from.
  5530. * @param {Array} [array=[]] The array to copy values to.
  5531. * @returns {Array} Returns `array`.
  5532. */
  5533. function copyArray(source, array) {
  5534. var index = -1,
  5535. length = source.length;
  5536. array || (array = Array(length));
  5537. while (++index < length) {
  5538. array[index] = source[index];
  5539. }
  5540. return array;
  5541. }
  5542. /**
  5543. * Copies properties of `source` to `object`.
  5544. *
  5545. * @private
  5546. * @param {Object} source The object to copy properties from.
  5547. * @param {Array} props The property identifiers to copy.
  5548. * @param {Object} [object={}] The object to copy properties to.
  5549. * @param {Function} [customizer] The function to customize copied values.
  5550. * @returns {Object} Returns `object`.
  5551. */
  5552. function copyObject(source, props, object, customizer) {
  5553. var isNew = !object;
  5554. object || (object = {});
  5555. var index = -1,
  5556. length = props.length;
  5557. while (++index < length) {
  5558. var key = props[index];
  5559. var newValue = customizer
  5560. ? customizer(object[key], source[key], key, object, source)
  5561. : undefined;
  5562. if (newValue === undefined) {
  5563. newValue = source[key];
  5564. }
  5565. if (isNew) {
  5566. baseAssignValue(object, key, newValue);
  5567. } else {
  5568. assignValue(object, key, newValue);
  5569. }
  5570. }
  5571. return object;
  5572. }
  5573. /**
  5574. * Copies own symbols of `source` to `object`.
  5575. *
  5576. * @private
  5577. * @param {Object} source The object to copy symbols from.
  5578. * @param {Object} [object={}] The object to copy symbols to.
  5579. * @returns {Object} Returns `object`.
  5580. */
  5581. function copySymbols(source, object) {
  5582. return copyObject(source, getSymbols(source), object);
  5583. }
  5584. /**
  5585. * Copies own and inherited symbols of `source` to `object`.
  5586. *
  5587. * @private
  5588. * @param {Object} source The object to copy symbols from.
  5589. * @param {Object} [object={}] The object to copy symbols to.
  5590. * @returns {Object} Returns `object`.
  5591. */
  5592. function copySymbolsIn(source, object) {
  5593. return copyObject(source, getSymbolsIn(source), object);
  5594. }
  5595. /**
  5596. * Creates a function like `_.groupBy`.
  5597. *
  5598. * @private
  5599. * @param {Function} setter The function to set accumulator values.
  5600. * @param {Function} [initializer] The accumulator object initializer.
  5601. * @returns {Function} Returns the new aggregator function.
  5602. */
  5603. function createAggregator(setter, initializer) {
  5604. return function(collection, iteratee) {
  5605. var func = isArray(collection) ? arrayAggregator : baseAggregator,
  5606. accumulator = initializer ? initializer() : {};
  5607. return func(collection, setter, getIteratee(iteratee, 2), accumulator);
  5608. };
  5609. }
  5610. /**
  5611. * Creates a function like `_.assign`.
  5612. *
  5613. * @private
  5614. * @param {Function} assigner The function to assign values.
  5615. * @returns {Function} Returns the new assigner function.
  5616. */
  5617. function createAssigner(assigner) {
  5618. return baseRest(function(object, sources) {
  5619. var index = -1,
  5620. length = sources.length,
  5621. customizer = length > 1 ? sources[length - 1] : undefined,
  5622. guard = length > 2 ? sources[2] : undefined;
  5623. customizer = (assigner.length > 3 && typeof customizer == 'function')
  5624. ? (length--, customizer)
  5625. : undefined;
  5626. if (guard && isIterateeCall(sources[0], sources[1], guard)) {
  5627. customizer = length < 3 ? undefined : customizer;
  5628. length = 1;
  5629. }
  5630. object = Object(object);
  5631. while (++index < length) {
  5632. var source = sources[index];
  5633. if (source) {
  5634. assigner(object, source, index, customizer);
  5635. }
  5636. }
  5637. return object;
  5638. });
  5639. }
  5640. /**
  5641. * Creates a `baseEach` or `baseEachRight` function.
  5642. *
  5643. * @private
  5644. * @param {Function} eachFunc The function to iterate over a collection.
  5645. * @param {boolean} [fromRight] Specify iterating from right to left.
  5646. * @returns {Function} Returns the new base function.
  5647. */
  5648. function createBaseEach(eachFunc, fromRight) {
  5649. return function(collection, iteratee) {
  5650. if (collection == null) {
  5651. return collection;
  5652. }
  5653. if (!isArrayLike(collection)) {
  5654. return eachFunc(collection, iteratee);
  5655. }
  5656. var length = collection.length,
  5657. index = fromRight ? length : -1,
  5658. iterable = Object(collection);
  5659. while ((fromRight ? index-- : ++index < length)) {
  5660. if (iteratee(iterable[index], index, iterable) === false) {
  5661. break;
  5662. }
  5663. }
  5664. return collection;
  5665. };
  5666. }
  5667. /**
  5668. * Creates a base function for methods like `_.forIn` and `_.forOwn`.
  5669. *
  5670. * @private
  5671. * @param {boolean} [fromRight] Specify iterating from right to left.
  5672. * @returns {Function} Returns the new base function.
  5673. */
  5674. function createBaseFor(fromRight) {
  5675. return function(object, iteratee, keysFunc) {
  5676. var index = -1,
  5677. iterable = Object(object),
  5678. props = keysFunc(object),
  5679. length = props.length;
  5680. while (length--) {
  5681. var key = props[fromRight ? length : ++index];
  5682. if (iteratee(iterable[key], key, iterable) === false) {
  5683. break;
  5684. }
  5685. }
  5686. return object;
  5687. };
  5688. }
  5689. /**
  5690. * Creates a function that wraps `func` to invoke it with the optional `this`
  5691. * binding of `thisArg`.
  5692. *
  5693. * @private
  5694. * @param {Function} func The function to wrap.
  5695. * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
  5696. * @param {*} [thisArg] The `this` binding of `func`.
  5697. * @returns {Function} Returns the new wrapped function.
  5698. */
  5699. function createBind(func, bitmask, thisArg) {
  5700. var isBind = bitmask & WRAP_BIND_FLAG,
  5701. Ctor = createCtor(func);
  5702. function wrapper() {
  5703. var fn = (this && this !== root && this instanceof wrapper) ? Ctor : func;
  5704. return fn.apply(isBind ? thisArg : this, arguments);
  5705. }
  5706. return wrapper;
  5707. }
  5708. /**
  5709. * Creates a function like `_.lowerFirst`.
  5710. *
  5711. * @private
  5712. * @param {string} methodName The name of the `String` case method to use.
  5713. * @returns {Function} Returns the new case function.
  5714. */
  5715. function createCaseFirst(methodName) {
  5716. return function(string) {
  5717. string = toString(string);
  5718. var strSymbols = hasUnicode(string)
  5719. ? stringToArray(string)
  5720. : undefined;
  5721. var chr = strSymbols
  5722. ? strSymbols[0]
  5723. : string.charAt(0);
  5724. var trailing = strSymbols
  5725. ? castSlice(strSymbols, 1).join('')
  5726. : string.slice(1);
  5727. return chr[methodName]() + trailing;
  5728. };
  5729. }
  5730. /**
  5731. * Creates a function like `_.camelCase`.
  5732. *
  5733. * @private
  5734. * @param {Function} callback The function to combine each word.
  5735. * @returns {Function} Returns the new compounder function.
  5736. */
  5737. function createCompounder(callback) {
  5738. return function(string) {
  5739. return arrayReduce(words(deburr(string).replace(reApos, '')), callback, '');
  5740. };
  5741. }
  5742. /**
  5743. * Creates a function that produces an instance of `Ctor` regardless of
  5744. * whether it was invoked as part of a `new` expression or by `call` or `apply`.
  5745. *
  5746. * @private
  5747. * @param {Function} Ctor The constructor to wrap.
  5748. * @returns {Function} Returns the new wrapped function.
  5749. */
  5750. function createCtor(Ctor) {
  5751. return function() {
  5752. // Use a `switch` statement to work with class constructors. See
  5753. // http://ecma-international.org/ecma-262/7.0/#sec-ecmascript-function-objects-call-thisargument-argumentslist
  5754. // for more details.
  5755. var args = arguments;
  5756. switch (args.length) {
  5757. case 0: return new Ctor;
  5758. case 1: return new Ctor(args[0]);
  5759. case 2: return new Ctor(args[0], args[1]);
  5760. case 3: return new Ctor(args[0], args[1], args[2]);
  5761. case 4: return new Ctor(args[0], args[1], args[2], args[3]);
  5762. case 5: return new Ctor(args[0], args[1], args[2], args[3], args[4]);
  5763. case 6: return new Ctor(args[0], args[1], args[2], args[3], args[4], args[5]);
  5764. case 7: return new Ctor(args[0], args[1], args[2], args[3], args[4], args[5], args[6]);
  5765. }
  5766. var thisBinding = baseCreate(Ctor.prototype),
  5767. result = Ctor.apply(thisBinding, args);
  5768. // Mimic the constructor's `return` behavior.
  5769. // See https://es5.github.io/#x13.2.2 for more details.
  5770. return isObject(result) ? result : thisBinding;
  5771. };
  5772. }
  5773. /**
  5774. * Creates a function that wraps `func` to enable currying.
  5775. *
  5776. * @private
  5777. * @param {Function} func The function to wrap.
  5778. * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
  5779. * @param {number} arity The arity of `func`.
  5780. * @returns {Function} Returns the new wrapped function.
  5781. */
  5782. function createCurry(func, bitmask, arity) {
  5783. var Ctor = createCtor(func);
  5784. function wrapper() {
  5785. var length = arguments.length,
  5786. args = Array(length),
  5787. index = length,
  5788. placeholder = getHolder(wrapper);
  5789. while (index--) {
  5790. args[index] = arguments[index];
  5791. }
  5792. var holders = (length < 3 && args[0] !== placeholder && args[length - 1] !== placeholder)
  5793. ? []
  5794. : replaceHolders(args, placeholder);
  5795. length -= holders.length;
  5796. if (length < arity) {
  5797. return createRecurry(
  5798. func, bitmask, createHybrid, wrapper.placeholder, undefined,
  5799. args, holders, undefined, undefined, arity - length);
  5800. }
  5801. var fn = (this && this !== root && this instanceof wrapper) ? Ctor : func;
  5802. return apply(fn, this, args);
  5803. }
  5804. return wrapper;
  5805. }
  5806. /**
  5807. * Creates a `_.find` or `_.findLast` function.
  5808. *
  5809. * @private
  5810. * @param {Function} findIndexFunc The function to find the collection index.
  5811. * @returns {Function} Returns the new find function.
  5812. */
  5813. function createFind(findIndexFunc) {
  5814. return function(collection, predicate, fromIndex) {
  5815. var iterable = Object(collection);
  5816. if (!isArrayLike(collection)) {
  5817. var iteratee = getIteratee(predicate, 3);
  5818. collection = keys(collection);
  5819. predicate = function(key) { return iteratee(iterable[key], key, iterable); };
  5820. }
  5821. var index = findIndexFunc(collection, predicate, fromIndex);
  5822. return index > -1 ? iterable[iteratee ? collection[index] : index] : undefined;
  5823. };
  5824. }
  5825. /**
  5826. * Creates a `_.flow` or `_.flowRight` function.
  5827. *
  5828. * @private
  5829. * @param {boolean} [fromRight] Specify iterating from right to left.
  5830. * @returns {Function} Returns the new flow function.
  5831. */
  5832. function createFlow(fromRight) {
  5833. return flatRest(function(funcs) {
  5834. var length = funcs.length,
  5835. index = length,
  5836. prereq = LodashWrapper.prototype.thru;
  5837. if (fromRight) {
  5838. funcs.reverse();
  5839. }
  5840. while (index--) {
  5841. var func = funcs[index];
  5842. if (typeof func != 'function') {
  5843. throw new TypeError(FUNC_ERROR_TEXT);
  5844. }
  5845. if (prereq && !wrapper && getFuncName(func) == 'wrapper') {
  5846. var wrapper = new LodashWrapper([], true);
  5847. }
  5848. }
  5849. index = wrapper ? index : length;
  5850. while (++index < length) {
  5851. func = funcs[index];
  5852. var funcName = getFuncName(func),
  5853. data = funcName == 'wrapper' ? getData(func) : undefined;
  5854. if (data && isLaziable(data[0]) &&
  5855. data[1] == (WRAP_ARY_FLAG | WRAP_CURRY_FLAG | WRAP_PARTIAL_FLAG | WRAP_REARG_FLAG) &&
  5856. !data[4].length && data[9] == 1
  5857. ) {
  5858. wrapper = wrapper[getFuncName(data[0])].apply(wrapper, data[3]);
  5859. } else {
  5860. wrapper = (func.length == 1 && isLaziable(func))
  5861. ? wrapper[funcName]()
  5862. : wrapper.thru(func);
  5863. }
  5864. }
  5865. return function() {
  5866. var args = arguments,
  5867. value = args[0];
  5868. if (wrapper && args.length == 1 && isArray(value)) {
  5869. return wrapper.plant(value).value();
  5870. }
  5871. var index = 0,
  5872. result = length ? funcs[index].apply(this, args) : value;
  5873. while (++index < length) {
  5874. result = funcs[index].call(this, result);
  5875. }
  5876. return result;
  5877. };
  5878. });
  5879. }
  5880. /**
  5881. * Creates a function that wraps `func` to invoke it with optional `this`
  5882. * binding of `thisArg`, partial application, and currying.
  5883. *
  5884. * @private
  5885. * @param {Function|string} func The function or method name to wrap.
  5886. * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
  5887. * @param {*} [thisArg] The `this` binding of `func`.
  5888. * @param {Array} [partials] The arguments to prepend to those provided to
  5889. * the new function.
  5890. * @param {Array} [holders] The `partials` placeholder indexes.
  5891. * @param {Array} [partialsRight] The arguments to append to those provided
  5892. * to the new function.
  5893. * @param {Array} [holdersRight] The `partialsRight` placeholder indexes.
  5894. * @param {Array} [argPos] The argument positions of the new function.
  5895. * @param {number} [ary] The arity cap of `func`.
  5896. * @param {number} [arity] The arity of `func`.
  5897. * @returns {Function} Returns the new wrapped function.
  5898. */
  5899. function createHybrid(func, bitmask, thisArg, partials, holders, partialsRight, holdersRight, argPos, ary, arity) {
  5900. var isAry = bitmask & WRAP_ARY_FLAG,
  5901. isBind = bitmask & WRAP_BIND_FLAG,
  5902. isBindKey = bitmask & WRAP_BIND_KEY_FLAG,
  5903. isCurried = bitmask & (WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG),
  5904. isFlip = bitmask & WRAP_FLIP_FLAG,
  5905. Ctor = isBindKey ? undefined : createCtor(func);
  5906. function wrapper() {
  5907. var length = arguments.length,
  5908. args = Array(length),
  5909. index = length;
  5910. while (index--) {
  5911. args[index] = arguments[index];
  5912. }
  5913. if (isCurried) {
  5914. var placeholder = getHolder(wrapper),
  5915. holdersCount = countHolders(args, placeholder);
  5916. }
  5917. if (partials) {
  5918. args = composeArgs(args, partials, holders, isCurried);
  5919. }
  5920. if (partialsRight) {
  5921. args = composeArgsRight(args, partialsRight, holdersRight, isCurried);
  5922. }
  5923. length -= holdersCount;
  5924. if (isCurried && length < arity) {
  5925. var newHolders = replaceHolders(args, placeholder);
  5926. return createRecurry(
  5927. func, bitmask, createHybrid, wrapper.placeholder, thisArg,
  5928. args, newHolders, argPos, ary, arity - length
  5929. );
  5930. }
  5931. var thisBinding = isBind ? thisArg : this,
  5932. fn = isBindKey ? thisBinding[func] : func;
  5933. length = args.length;
  5934. if (argPos) {
  5935. args = reorder(args, argPos);
  5936. } else if (isFlip && length > 1) {
  5937. args.reverse();
  5938. }
  5939. if (isAry && ary < length) {
  5940. args.length = ary;
  5941. }
  5942. if (this && this !== root && this instanceof wrapper) {
  5943. fn = Ctor || createCtor(fn);
  5944. }
  5945. return fn.apply(thisBinding, args);
  5946. }
  5947. return wrapper;
  5948. }
  5949. /**
  5950. * Creates a function like `_.invertBy`.
  5951. *
  5952. * @private
  5953. * @param {Function} setter The function to set accumulator values.
  5954. * @param {Function} toIteratee The function to resolve iteratees.
  5955. * @returns {Function} Returns the new inverter function.
  5956. */
  5957. function createInverter(setter, toIteratee) {
  5958. return function(object, iteratee) {
  5959. return baseInverter(object, setter, toIteratee(iteratee), {});
  5960. };
  5961. }
  5962. /**
  5963. * Creates a function that performs a mathematical operation on two values.
  5964. *
  5965. * @private
  5966. * @param {Function} operator The function to perform the operation.
  5967. * @param {number} [defaultValue] The value used for `undefined` arguments.
  5968. * @returns {Function} Returns the new mathematical operation function.
  5969. */
  5970. function createMathOperation(operator, defaultValue) {
  5971. return function(value, other) {
  5972. var result;
  5973. if (value === undefined && other === undefined) {
  5974. return defaultValue;
  5975. }
  5976. if (value !== undefined) {
  5977. result = value;
  5978. }
  5979. if (other !== undefined) {
  5980. if (result === undefined) {
  5981. return other;
  5982. }
  5983. if (typeof value == 'string' || typeof other == 'string') {
  5984. value = baseToString(value);
  5985. other = baseToString(other);
  5986. } else {
  5987. value = baseToNumber(value);
  5988. other = baseToNumber(other);
  5989. }
  5990. result = operator(value, other);
  5991. }
  5992. return result;
  5993. };
  5994. }
  5995. /**
  5996. * Creates a function like `_.over`.
  5997. *
  5998. * @private
  5999. * @param {Function} arrayFunc The function to iterate over iteratees.
  6000. * @returns {Function} Returns the new over function.
  6001. */
  6002. function createOver(arrayFunc) {
  6003. return flatRest(function(iteratees) {
  6004. iteratees = arrayMap(iteratees, baseUnary(getIteratee()));
  6005. return baseRest(function(args) {
  6006. var thisArg = this;
  6007. return arrayFunc(iteratees, function(iteratee) {
  6008. return apply(iteratee, thisArg, args);
  6009. });
  6010. });
  6011. });
  6012. }
  6013. /**
  6014. * Creates the padding for `string` based on `length`. The `chars` string
  6015. * is truncated if the number of characters exceeds `length`.
  6016. *
  6017. * @private
  6018. * @param {number} length The padding length.
  6019. * @param {string} [chars=' '] The string used as padding.
  6020. * @returns {string} Returns the padding for `string`.
  6021. */
  6022. function createPadding(length, chars) {
  6023. chars = chars === undefined ? ' ' : baseToString(chars);
  6024. var charsLength = chars.length;
  6025. if (charsLength < 2) {
  6026. return charsLength ? baseRepeat(chars, length) : chars;
  6027. }
  6028. var result = baseRepeat(chars, nativeCeil(length / stringSize(chars)));
  6029. return hasUnicode(chars)
  6030. ? castSlice(stringToArray(result), 0, length).join('')
  6031. : result.slice(0, length);
  6032. }
  6033. /**
  6034. * Creates a function that wraps `func` to invoke it with the `this` binding
  6035. * of `thisArg` and `partials` prepended to the arguments it receives.
  6036. *
  6037. * @private
  6038. * @param {Function} func The function to wrap.
  6039. * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
  6040. * @param {*} thisArg The `this` binding of `func`.
  6041. * @param {Array} partials The arguments to prepend to those provided to
  6042. * the new function.
  6043. * @returns {Function} Returns the new wrapped function.
  6044. */
  6045. function createPartial(func, bitmask, thisArg, partials) {
  6046. var isBind = bitmask & WRAP_BIND_FLAG,
  6047. Ctor = createCtor(func);
  6048. function wrapper() {
  6049. var argsIndex = -1,
  6050. argsLength = arguments.length,
  6051. leftIndex = -1,
  6052. leftLength = partials.length,
  6053. args = Array(leftLength + argsLength),
  6054. fn = (this && this !== root && this instanceof wrapper) ? Ctor : func;
  6055. while (++leftIndex < leftLength) {
  6056. args[leftIndex] = partials[leftIndex];
  6057. }
  6058. while (argsLength--) {
  6059. args[leftIndex++] = arguments[++argsIndex];
  6060. }
  6061. return apply(fn, isBind ? thisArg : this, args);
  6062. }
  6063. return wrapper;
  6064. }
  6065. /**
  6066. * Creates a `_.range` or `_.rangeRight` function.
  6067. *
  6068. * @private
  6069. * @param {boolean} [fromRight] Specify iterating from right to left.
  6070. * @returns {Function} Returns the new range function.
  6071. */
  6072. function createRange(fromRight) {
  6073. return function(start, end, step) {
  6074. if (step && typeof step != 'number' && isIterateeCall(start, end, step)) {
  6075. end = step = undefined;
  6076. }
  6077. // Ensure the sign of `-0` is preserved.
  6078. start = toFinite(start);
  6079. if (end === undefined) {
  6080. end = start;
  6081. start = 0;
  6082. } else {
  6083. end = toFinite(end);
  6084. }
  6085. step = step === undefined ? (start < end ? 1 : -1) : toFinite(step);
  6086. return baseRange(start, end, step, fromRight);
  6087. };
  6088. }
  6089. /**
  6090. * Creates a function that performs a relational operation on two values.
  6091. *
  6092. * @private
  6093. * @param {Function} operator The function to perform the operation.
  6094. * @returns {Function} Returns the new relational operation function.
  6095. */
  6096. function createRelationalOperation(operator) {
  6097. return function(value, other) {
  6098. if (!(typeof value == 'string' && typeof other == 'string')) {
  6099. value = toNumber(value);
  6100. other = toNumber(other);
  6101. }
  6102. return operator(value, other);
  6103. };
  6104. }
  6105. /**
  6106. * Creates a function that wraps `func` to continue currying.
  6107. *
  6108. * @private
  6109. * @param {Function} func The function to wrap.
  6110. * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
  6111. * @param {Function} wrapFunc The function to create the `func` wrapper.
  6112. * @param {*} placeholder The placeholder value.
  6113. * @param {*} [thisArg] The `this` binding of `func`.
  6114. * @param {Array} [partials] The arguments to prepend to those provided to
  6115. * the new function.
  6116. * @param {Array} [holders] The `partials` placeholder indexes.
  6117. * @param {Array} [argPos] The argument positions of the new function.
  6118. * @param {number} [ary] The arity cap of `func`.
  6119. * @param {number} [arity] The arity of `func`.
  6120. * @returns {Function} Returns the new wrapped function.
  6121. */
  6122. function createRecurry(func, bitmask, wrapFunc, placeholder, thisArg, partials, holders, argPos, ary, arity) {
  6123. var isCurry = bitmask & WRAP_CURRY_FLAG,
  6124. newHolders = isCurry ? holders : undefined,
  6125. newHoldersRight = isCurry ? undefined : holders,
  6126. newPartials = isCurry ? partials : undefined,
  6127. newPartialsRight = isCurry ? undefined : partials;
  6128. bitmask |= (isCurry ? WRAP_PARTIAL_FLAG : WRAP_PARTIAL_RIGHT_FLAG);
  6129. bitmask &= ~(isCurry ? WRAP_PARTIAL_RIGHT_FLAG : WRAP_PARTIAL_FLAG);
  6130. if (!(bitmask & WRAP_CURRY_BOUND_FLAG)) {
  6131. bitmask &= ~(WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG);
  6132. }
  6133. var newData = [
  6134. func, bitmask, thisArg, newPartials, newHolders, newPartialsRight,
  6135. newHoldersRight, argPos, ary, arity
  6136. ];
  6137. var result = wrapFunc.apply(undefined, newData);
  6138. if (isLaziable(func)) {
  6139. setData(result, newData);
  6140. }
  6141. result.placeholder = placeholder;
  6142. return setWrapToString(result, func, bitmask);
  6143. }
  6144. /**
  6145. * Creates a function like `_.round`.
  6146. *
  6147. * @private
  6148. * @param {string} methodName The name of the `Math` method to use when rounding.
  6149. * @returns {Function} Returns the new round function.
  6150. */
  6151. function createRound(methodName) {
  6152. var func = Math[methodName];
  6153. return function(number, precision) {
  6154. number = toNumber(number);
  6155. precision = precision == null ? 0 : nativeMin(toInteger(precision), 292);
  6156. if (precision && nativeIsFinite(number)) {
  6157. // Shift with exponential notation to avoid floating-point issues.
  6158. // See [MDN](https://mdn.io/round#Examples) for more details.
  6159. var pair = (toString(number) + 'e').split('e'),
  6160. value = func(pair[0] + 'e' + (+pair[1] + precision));
  6161. pair = (toString(value) + 'e').split('e');
  6162. return +(pair[0] + 'e' + (+pair[1] - precision));
  6163. }
  6164. return func(number);
  6165. };
  6166. }
  6167. /**
  6168. * Creates a set object of `values`.
  6169. *
  6170. * @private
  6171. * @param {Array} values The values to add to the set.
  6172. * @returns {Object} Returns the new set.
  6173. */
  6174. var createSet = !(Set && (1 / setToArray(new Set([,-0]))[1]) == INFINITY) ? noop : function(values) {
  6175. return new Set(values);
  6176. };
  6177. /**
  6178. * Creates a `_.toPairs` or `_.toPairsIn` function.
  6179. *
  6180. * @private
  6181. * @param {Function} keysFunc The function to get the keys of a given object.
  6182. * @returns {Function} Returns the new pairs function.
  6183. */
  6184. function createToPairs(keysFunc) {
  6185. return function(object) {
  6186. var tag = getTag(object);
  6187. if (tag == mapTag) {
  6188. return mapToArray(object);
  6189. }
  6190. if (tag == setTag) {
  6191. return setToPairs(object);
  6192. }
  6193. return baseToPairs(object, keysFunc(object));
  6194. };
  6195. }
  6196. /**
  6197. * Creates a function that either curries or invokes `func` with optional
  6198. * `this` binding and partially applied arguments.
  6199. *
  6200. * @private
  6201. * @param {Function|string} func The function or method name to wrap.
  6202. * @param {number} bitmask The bitmask flags.
  6203. * 1 - `_.bind`
  6204. * 2 - `_.bindKey`
  6205. * 4 - `_.curry` or `_.curryRight` of a bound function
  6206. * 8 - `_.curry`
  6207. * 16 - `_.curryRight`
  6208. * 32 - `_.partial`
  6209. * 64 - `_.partialRight`
  6210. * 128 - `_.rearg`
  6211. * 256 - `_.ary`
  6212. * 512 - `_.flip`
  6213. * @param {*} [thisArg] The `this` binding of `func`.
  6214. * @param {Array} [partials] The arguments to be partially applied.
  6215. * @param {Array} [holders] The `partials` placeholder indexes.
  6216. * @param {Array} [argPos] The argument positions of the new function.
  6217. * @param {number} [ary] The arity cap of `func`.
  6218. * @param {number} [arity] The arity of `func`.
  6219. * @returns {Function} Returns the new wrapped function.
  6220. */
  6221. function createWrap(func, bitmask, thisArg, partials, holders, argPos, ary, arity) {
  6222. var isBindKey = bitmask & WRAP_BIND_KEY_FLAG;
  6223. if (!isBindKey && typeof func != 'function') {
  6224. throw new TypeError(FUNC_ERROR_TEXT);
  6225. }
  6226. var length = partials ? partials.length : 0;
  6227. if (!length) {
  6228. bitmask &= ~(WRAP_PARTIAL_FLAG | WRAP_PARTIAL_RIGHT_FLAG);
  6229. partials = holders = undefined;
  6230. }
  6231. ary = ary === undefined ? ary : nativeMax(toInteger(ary), 0);
  6232. arity = arity === undefined ? arity : toInteger(arity);
  6233. length -= holders ? holders.length : 0;
  6234. if (bitmask & WRAP_PARTIAL_RIGHT_FLAG) {
  6235. var partialsRight = partials,
  6236. holdersRight = holders;
  6237. partials = holders = undefined;
  6238. }
  6239. var data = isBindKey ? undefined : getData(func);
  6240. var newData = [
  6241. func, bitmask, thisArg, partials, holders, partialsRight, holdersRight,
  6242. argPos, ary, arity
  6243. ];
  6244. if (data) {
  6245. mergeData(newData, data);
  6246. }
  6247. func = newData[0];
  6248. bitmask = newData[1];
  6249. thisArg = newData[2];
  6250. partials = newData[3];
  6251. holders = newData[4];
  6252. arity = newData[9] = newData[9] === undefined
  6253. ? (isBindKey ? 0 : func.length)
  6254. : nativeMax(newData[9] - length, 0);
  6255. if (!arity && bitmask & (WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG)) {
  6256. bitmask &= ~(WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG);
  6257. }
  6258. if (!bitmask || bitmask == WRAP_BIND_FLAG) {
  6259. var result = createBind(func, bitmask, thisArg);
  6260. } else if (bitmask == WRAP_CURRY_FLAG || bitmask == WRAP_CURRY_RIGHT_FLAG) {
  6261. result = createCurry(func, bitmask, arity);
  6262. } else if ((bitmask == WRAP_PARTIAL_FLAG || bitmask == (WRAP_BIND_FLAG | WRAP_PARTIAL_FLAG)) && !holders.length) {
  6263. result = createPartial(func, bitmask, thisArg, partials);
  6264. } else {
  6265. result = createHybrid.apply(undefined, newData);
  6266. }
  6267. var setter = data ? baseSetData : setData;
  6268. return setWrapToString(setter(result, newData), func, bitmask);
  6269. }
  6270. /**
  6271. * Used by `_.defaults` to customize its `_.assignIn` use to assign properties
  6272. * of source objects to the destination object for all destination properties
  6273. * that resolve to `undefined`.
  6274. *
  6275. * @private
  6276. * @param {*} objValue The destination value.
  6277. * @param {*} srcValue The source value.
  6278. * @param {string} key The key of the property to assign.
  6279. * @param {Object} object The parent object of `objValue`.
  6280. * @returns {*} Returns the value to assign.
  6281. */
  6282. function customDefaultsAssignIn(objValue, srcValue, key, object) {
  6283. if (objValue === undefined ||
  6284. (eq(objValue, objectProto[key]) && !hasOwnProperty.call(object, key))) {
  6285. return srcValue;
  6286. }
  6287. return objValue;
  6288. }
  6289. /**
  6290. * Used by `_.defaultsDeep` to customize its `_.merge` use to merge source
  6291. * objects into destination objects that are passed thru.
  6292. *
  6293. * @private
  6294. * @param {*} objValue The destination value.
  6295. * @param {*} srcValue The source value.
  6296. * @param {string} key The key of the property to merge.
  6297. * @param {Object} object The parent object of `objValue`.
  6298. * @param {Object} source The parent object of `srcValue`.
  6299. * @param {Object} [stack] Tracks traversed source values and their merged
  6300. * counterparts.
  6301. * @returns {*} Returns the value to assign.
  6302. */
  6303. function customDefaultsMerge(objValue, srcValue, key, object, source, stack) {
  6304. if (isObject(objValue) && isObject(srcValue)) {
  6305. // Recursively merge objects and arrays (susceptible to call stack limits).
  6306. stack.set(srcValue, objValue);
  6307. baseMerge(objValue, srcValue, undefined, customDefaultsMerge, stack);
  6308. stack['delete'](srcValue);
  6309. }
  6310. return objValue;
  6311. }
  6312. /**
  6313. * Used by `_.omit` to customize its `_.cloneDeep` use to only clone plain
  6314. * objects.
  6315. *
  6316. * @private
  6317. * @param {*} value The value to inspect.
  6318. * @param {string} key The key of the property to inspect.
  6319. * @returns {*} Returns the uncloned value or `undefined` to defer cloning to `_.cloneDeep`.
  6320. */
  6321. function customOmitClone(value) {
  6322. return isPlainObject(value) ? undefined : value;
  6323. }
  6324. /**
  6325. * A specialized version of `baseIsEqualDeep` for arrays with support for
  6326. * partial deep comparisons.
  6327. *
  6328. * @private
  6329. * @param {Array} array The array to compare.
  6330. * @param {Array} other The other array to compare.
  6331. * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
  6332. * @param {Function} customizer The function to customize comparisons.
  6333. * @param {Function} equalFunc The function to determine equivalents of values.
  6334. * @param {Object} stack Tracks traversed `array` and `other` objects.
  6335. * @returns {boolean} Returns `true` if the arrays are equivalent, else `false`.
  6336. */
  6337. function equalArrays(array, other, bitmask, customizer, equalFunc, stack) {
  6338. var isPartial = bitmask & COMPARE_PARTIAL_FLAG,
  6339. arrLength = array.length,
  6340. othLength = other.length;
  6341. if (arrLength != othLength && !(isPartial && othLength > arrLength)) {
  6342. return false;
  6343. }
  6344. // Check that cyclic values are equal.
  6345. var arrStacked = stack.get(array);
  6346. var othStacked = stack.get(other);
  6347. if (arrStacked && othStacked) {
  6348. return arrStacked == other && othStacked == array;
  6349. }
  6350. var index = -1,
  6351. result = true,
  6352. seen = (bitmask & COMPARE_UNORDERED_FLAG) ? new SetCache : undefined;
  6353. stack.set(array, other);
  6354. stack.set(other, array);
  6355. // Ignore non-index properties.
  6356. while (++index < arrLength) {
  6357. var arrValue = array[index],
  6358. othValue = other[index];
  6359. if (customizer) {
  6360. var compared = isPartial
  6361. ? customizer(othValue, arrValue, index, other, array, stack)
  6362. : customizer(arrValue, othValue, index, array, other, stack);
  6363. }
  6364. if (compared !== undefined) {
  6365. if (compared) {
  6366. continue;
  6367. }
  6368. result = false;
  6369. break;
  6370. }
  6371. // Recursively compare arrays (susceptible to call stack limits).
  6372. if (seen) {
  6373. if (!arraySome(other, function(othValue, othIndex) {
  6374. if (!cacheHas(seen, othIndex) &&
  6375. (arrValue === othValue || equalFunc(arrValue, othValue, bitmask, customizer, stack))) {
  6376. return seen.push(othIndex);
  6377. }
  6378. })) {
  6379. result = false;
  6380. break;
  6381. }
  6382. } else if (!(
  6383. arrValue === othValue ||
  6384. equalFunc(arrValue, othValue, bitmask, customizer, stack)
  6385. )) {
  6386. result = false;
  6387. break;
  6388. }
  6389. }
  6390. stack['delete'](array);
  6391. stack['delete'](other);
  6392. return result;
  6393. }
  6394. /**
  6395. * A specialized version of `baseIsEqualDeep` for comparing objects of
  6396. * the same `toStringTag`.
  6397. *
  6398. * **Note:** This function only supports comparing values with tags of
  6399. * `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`.
  6400. *
  6401. * @private
  6402. * @param {Object} object The object to compare.
  6403. * @param {Object} other The other object to compare.
  6404. * @param {string} tag The `toStringTag` of the objects to compare.
  6405. * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
  6406. * @param {Function} customizer The function to customize comparisons.
  6407. * @param {Function} equalFunc The function to determine equivalents of values.
  6408. * @param {Object} stack Tracks traversed `object` and `other` objects.
  6409. * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
  6410. */
  6411. function equalByTag(object, other, tag, bitmask, customizer, equalFunc, stack) {
  6412. switch (tag) {
  6413. case dataViewTag:
  6414. if ((object.byteLength != other.byteLength) ||
  6415. (object.byteOffset != other.byteOffset)) {
  6416. return false;
  6417. }
  6418. object = object.buffer;
  6419. other = other.buffer;
  6420. case arrayBufferTag:
  6421. if ((object.byteLength != other.byteLength) ||
  6422. !equalFunc(new Uint8Array(object), new Uint8Array(other))) {
  6423. return false;
  6424. }
  6425. return true;
  6426. case boolTag:
  6427. case dateTag:
  6428. case numberTag:
  6429. // Coerce booleans to `1` or `0` and dates to milliseconds.
  6430. // Invalid dates are coerced to `NaN`.
  6431. return eq(+object, +other);
  6432. case errorTag:
  6433. return object.name == other.name && object.message == other.message;
  6434. case regexpTag:
  6435. case stringTag:
  6436. // Coerce regexes to strings and treat strings, primitives and objects,
  6437. // as equal. See http://www.ecma-international.org/ecma-262/7.0/#sec-regexp.prototype.tostring
  6438. // for more details.
  6439. return object == (other + '');
  6440. case mapTag:
  6441. var convert = mapToArray;
  6442. case setTag:
  6443. var isPartial = bitmask & COMPARE_PARTIAL_FLAG;
  6444. convert || (convert = setToArray);
  6445. if (object.size != other.size && !isPartial) {
  6446. return false;
  6447. }
  6448. // Assume cyclic values are equal.
  6449. var stacked = stack.get(object);
  6450. if (stacked) {
  6451. return stacked == other;
  6452. }
  6453. bitmask |= COMPARE_UNORDERED_FLAG;
  6454. // Recursively compare objects (susceptible to call stack limits).
  6455. stack.set(object, other);
  6456. var result = equalArrays(convert(object), convert(other), bitmask, customizer, equalFunc, stack);
  6457. stack['delete'](object);
  6458. return result;
  6459. case symbolTag:
  6460. if (symbolValueOf) {
  6461. return symbolValueOf.call(object) == symbolValueOf.call(other);
  6462. }
  6463. }
  6464. return false;
  6465. }
  6466. /**
  6467. * A specialized version of `baseIsEqualDeep` for objects with support for
  6468. * partial deep comparisons.
  6469. *
  6470. * @private
  6471. * @param {Object} object The object to compare.
  6472. * @param {Object} other The other object to compare.
  6473. * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
  6474. * @param {Function} customizer The function to customize comparisons.
  6475. * @param {Function} equalFunc The function to determine equivalents of values.
  6476. * @param {Object} stack Tracks traversed `object` and `other` objects.
  6477. * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
  6478. */
  6479. function equalObjects(object, other, bitmask, customizer, equalFunc, stack) {
  6480. var isPartial = bitmask & COMPARE_PARTIAL_FLAG,
  6481. objProps = getAllKeys(object),
  6482. objLength = objProps.length,
  6483. othProps = getAllKeys(other),
  6484. othLength = othProps.length;
  6485. if (objLength != othLength && !isPartial) {
  6486. return false;
  6487. }
  6488. var index = objLength;
  6489. while (index--) {
  6490. var key = objProps[index];
  6491. if (!(isPartial ? key in other : hasOwnProperty.call(other, key))) {
  6492. return false;
  6493. }
  6494. }
  6495. // Check that cyclic values are equal.
  6496. var objStacked = stack.get(object);
  6497. var othStacked = stack.get(other);
  6498. if (objStacked && othStacked) {
  6499. return objStacked == other && othStacked == object;
  6500. }
  6501. var result = true;
  6502. stack.set(object, other);
  6503. stack.set(other, object);
  6504. var skipCtor = isPartial;
  6505. while (++index < objLength) {
  6506. key = objProps[index];
  6507. var objValue = object[key],
  6508. othValue = other[key];
  6509. if (customizer) {
  6510. var compared = isPartial
  6511. ? customizer(othValue, objValue, key, other, object, stack)
  6512. : customizer(objValue, othValue, key, object, other, stack);
  6513. }
  6514. // Recursively compare objects (susceptible to call stack limits).
  6515. if (!(compared === undefined
  6516. ? (objValue === othValue || equalFunc(objValue, othValue, bitmask, customizer, stack))
  6517. : compared
  6518. )) {
  6519. result = false;
  6520. break;
  6521. }
  6522. skipCtor || (skipCtor = key == 'constructor');
  6523. }
  6524. if (result && !skipCtor) {
  6525. var objCtor = object.constructor,
  6526. othCtor = other.constructor;
  6527. // Non `Object` object instances with different constructors are not equal.
  6528. if (objCtor != othCtor &&
  6529. ('constructor' in object && 'constructor' in other) &&
  6530. !(typeof objCtor == 'function' && objCtor instanceof objCtor &&
  6531. typeof othCtor == 'function' && othCtor instanceof othCtor)) {
  6532. result = false;
  6533. }
  6534. }
  6535. stack['delete'](object);
  6536. stack['delete'](other);
  6537. return result;
  6538. }
  6539. /**
  6540. * A specialized version of `baseRest` which flattens the rest array.
  6541. *
  6542. * @private
  6543. * @param {Function} func The function to apply a rest parameter to.
  6544. * @returns {Function} Returns the new function.
  6545. */
  6546. function flatRest(func) {
  6547. return setToString(overRest(func, undefined, flatten), func + '');
  6548. }
  6549. /**
  6550. * Creates an array of own enumerable property names and symbols of `object`.
  6551. *
  6552. * @private
  6553. * @param {Object} object The object to query.
  6554. * @returns {Array} Returns the array of property names and symbols.
  6555. */
  6556. function getAllKeys(object) {
  6557. return baseGetAllKeys(object, keys, getSymbols);
  6558. }
  6559. /**
  6560. * Creates an array of own and inherited enumerable property names and
  6561. * symbols of `object`.
  6562. *
  6563. * @private
  6564. * @param {Object} object The object to query.
  6565. * @returns {Array} Returns the array of property names and symbols.
  6566. */
  6567. function getAllKeysIn(object) {
  6568. return baseGetAllKeys(object, keysIn, getSymbolsIn);
  6569. }
  6570. /**
  6571. * Gets metadata for `func`.
  6572. *
  6573. * @private
  6574. * @param {Function} func The function to query.
  6575. * @returns {*} Returns the metadata for `func`.
  6576. */
  6577. var getData = !metaMap ? noop : function(func) {
  6578. return metaMap.get(func);
  6579. };
  6580. /**
  6581. * Gets the name of `func`.
  6582. *
  6583. * @private
  6584. * @param {Function} func The function to query.
  6585. * @returns {string} Returns the function name.
  6586. */
  6587. function getFuncName(func) {
  6588. var result = (func.name + ''),
  6589. array = realNames[result],
  6590. length = hasOwnProperty.call(realNames, result) ? array.length : 0;
  6591. while (length--) {
  6592. var data = array[length],
  6593. otherFunc = data.func;
  6594. if (otherFunc == null || otherFunc == func) {
  6595. return data.name;
  6596. }
  6597. }
  6598. return result;
  6599. }
  6600. /**
  6601. * Gets the argument placeholder value for `func`.
  6602. *
  6603. * @private
  6604. * @param {Function} func The function to inspect.
  6605. * @returns {*} Returns the placeholder value.
  6606. */
  6607. function getHolder(func) {
  6608. var object = hasOwnProperty.call(lodash, 'placeholder') ? lodash : func;
  6609. return object.placeholder;
  6610. }
  6611. /**
  6612. * Gets the appropriate "iteratee" function. If `_.iteratee` is customized,
  6613. * this function returns the custom method, otherwise it returns `baseIteratee`.
  6614. * If arguments are provided, the chosen function is invoked with them and
  6615. * its result is returned.
  6616. *
  6617. * @private
  6618. * @param {*} [value] The value to convert to an iteratee.
  6619. * @param {number} [arity] The arity of the created iteratee.
  6620. * @returns {Function} Returns the chosen function or its result.
  6621. */
  6622. function getIteratee() {
  6623. var result = lodash.iteratee || iteratee;
  6624. result = result === iteratee ? baseIteratee : result;
  6625. return arguments.length ? result(arguments[0], arguments[1]) : result;
  6626. }
  6627. /**
  6628. * Gets the data for `map`.
  6629. *
  6630. * @private
  6631. * @param {Object} map The map to query.
  6632. * @param {string} key The reference key.
  6633. * @returns {*} Returns the map data.
  6634. */
  6635. function getMapData(map, key) {
  6636. var data = map.__data__;
  6637. return isKeyable(key)
  6638. ? data[typeof key == 'string' ? 'string' : 'hash']
  6639. : data.map;
  6640. }
  6641. /**
  6642. * Gets the property names, values, and compare flags of `object`.
  6643. *
  6644. * @private
  6645. * @param {Object} object The object to query.
  6646. * @returns {Array} Returns the match data of `object`.
  6647. */
  6648. function getMatchData(object) {
  6649. var result = keys(object),
  6650. length = result.length;
  6651. while (length--) {
  6652. var key = result[length],
  6653. value = object[key];
  6654. result[length] = [key, value, isStrictComparable(value)];
  6655. }
  6656. return result;
  6657. }
  6658. /**
  6659. * Gets the native function at `key` of `object`.
  6660. *
  6661. * @private
  6662. * @param {Object} object The object to query.
  6663. * @param {string} key The key of the method to get.
  6664. * @returns {*} Returns the function if it's native, else `undefined`.
  6665. */
  6666. function getNative(object, key) {
  6667. var value = getValue(object, key);
  6668. return baseIsNative(value) ? value : undefined;
  6669. }
  6670. /**
  6671. * A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values.
  6672. *
  6673. * @private
  6674. * @param {*} value The value to query.
  6675. * @returns {string} Returns the raw `toStringTag`.
  6676. */
  6677. function getRawTag(value) {
  6678. var isOwn = hasOwnProperty.call(value, symToStringTag),
  6679. tag = value[symToStringTag];
  6680. try {
  6681. value[symToStringTag] = undefined;
  6682. var unmasked = true;
  6683. } catch (e) {}
  6684. var result = nativeObjectToString.call(value);
  6685. if (unmasked) {
  6686. if (isOwn) {
  6687. value[symToStringTag] = tag;
  6688. } else {
  6689. delete value[symToStringTag];
  6690. }
  6691. }
  6692. return result;
  6693. }
  6694. /**
  6695. * Creates an array of the own enumerable symbols of `object`.
  6696. *
  6697. * @private
  6698. * @param {Object} object The object to query.
  6699. * @returns {Array} Returns the array of symbols.
  6700. */
  6701. var getSymbols = !nativeGetSymbols ? stubArray : function(object) {
  6702. if (object == null) {
  6703. return [];
  6704. }
  6705. object = Object(object);
  6706. return arrayFilter(nativeGetSymbols(object), function(symbol) {
  6707. return propertyIsEnumerable.call(object, symbol);
  6708. });
  6709. };
  6710. /**
  6711. * Creates an array of the own and inherited enumerable symbols of `object`.
  6712. *
  6713. * @private
  6714. * @param {Object} object The object to query.
  6715. * @returns {Array} Returns the array of symbols.
  6716. */
  6717. var getSymbolsIn = !nativeGetSymbols ? stubArray : function(object) {
  6718. var result = [];
  6719. while (object) {
  6720. arrayPush(result, getSymbols(object));
  6721. object = getPrototype(object);
  6722. }
  6723. return result;
  6724. };
  6725. /**
  6726. * Gets the `toStringTag` of `value`.
  6727. *
  6728. * @private
  6729. * @param {*} value The value to query.
  6730. * @returns {string} Returns the `toStringTag`.
  6731. */
  6732. var getTag = baseGetTag;
  6733. // Fallback for data views, maps, sets, and weak maps in IE 11 and promises in Node.js < 6.
  6734. if ((DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag) ||
  6735. (Map && getTag(new Map) != mapTag) ||
  6736. (Promise && getTag(Promise.resolve()) != promiseTag) ||
  6737. (Set && getTag(new Set) != setTag) ||
  6738. (WeakMap && getTag(new WeakMap) != weakMapTag)) {
  6739. getTag = function(value) {
  6740. var result = baseGetTag(value),
  6741. Ctor = result == objectTag ? value.constructor : undefined,
  6742. ctorString = Ctor ? toSource(Ctor) : '';
  6743. if (ctorString) {
  6744. switch (ctorString) {
  6745. case dataViewCtorString: return dataViewTag;
  6746. case mapCtorString: return mapTag;
  6747. case promiseCtorString: return promiseTag;
  6748. case setCtorString: return setTag;
  6749. case weakMapCtorString: return weakMapTag;
  6750. }
  6751. }
  6752. return result;
  6753. };
  6754. }
  6755. /**
  6756. * Gets the view, applying any `transforms` to the `start` and `end` positions.
  6757. *
  6758. * @private
  6759. * @param {number} start The start of the view.
  6760. * @param {number} end The end of the view.
  6761. * @param {Array} transforms The transformations to apply to the view.
  6762. * @returns {Object} Returns an object containing the `start` and `end`
  6763. * positions of the view.
  6764. */
  6765. function getView(start, end, transforms) {
  6766. var index = -1,
  6767. length = transforms.length;
  6768. while (++index < length) {
  6769. var data = transforms[index],
  6770. size = data.size;
  6771. switch (data.type) {
  6772. case 'drop': start += size; break;
  6773. case 'dropRight': end -= size; break;
  6774. case 'take': end = nativeMin(end, start + size); break;
  6775. case 'takeRight': start = nativeMax(start, end - size); break;
  6776. }
  6777. }
  6778. return { 'start': start, 'end': end };
  6779. }
  6780. /**
  6781. * Extracts wrapper details from the `source` body comment.
  6782. *
  6783. * @private
  6784. * @param {string} source The source to inspect.
  6785. * @returns {Array} Returns the wrapper details.
  6786. */
  6787. function getWrapDetails(source) {
  6788. var match = source.match(reWrapDetails);
  6789. return match ? match[1].split(reSplitDetails) : [];
  6790. }
  6791. /**
  6792. * Checks if `path` exists on `object`.
  6793. *
  6794. * @private
  6795. * @param {Object} object The object to query.
  6796. * @param {Array|string} path The path to check.
  6797. * @param {Function} hasFunc The function to check properties.
  6798. * @returns {boolean} Returns `true` if `path` exists, else `false`.
  6799. */
  6800. function hasPath(object, path, hasFunc) {
  6801. path = castPath(path, object);
  6802. var index = -1,
  6803. length = path.length,
  6804. result = false;
  6805. while (++index < length) {
  6806. var key = toKey(path[index]);
  6807. if (!(result = object != null && hasFunc(object, key))) {
  6808. break;
  6809. }
  6810. object = object[key];
  6811. }
  6812. if (result || ++index != length) {
  6813. return result;
  6814. }
  6815. length = object == null ? 0 : object.length;
  6816. return !!length && isLength(length) && isIndex(key, length) &&
  6817. (isArray(object) || isArguments(object));
  6818. }
  6819. /**
  6820. * Initializes an array clone.
  6821. *
  6822. * @private
  6823. * @param {Array} array The array to clone.
  6824. * @returns {Array} Returns the initialized clone.
  6825. */
  6826. function initCloneArray(array) {
  6827. var length = array.length,
  6828. result = new array.constructor(length);
  6829. // Add properties assigned by `RegExp#exec`.
  6830. if (length && typeof array[0] == 'string' && hasOwnProperty.call(array, 'index')) {
  6831. result.index = array.index;
  6832. result.input = array.input;
  6833. }
  6834. return result;
  6835. }
  6836. /**
  6837. * Initializes an object clone.
  6838. *
  6839. * @private
  6840. * @param {Object} object The object to clone.
  6841. * @returns {Object} Returns the initialized clone.
  6842. */
  6843. function initCloneObject(object) {
  6844. return (typeof object.constructor == 'function' && !isPrototype(object))
  6845. ? baseCreate(getPrototype(object))
  6846. : {};
  6847. }
  6848. /**
  6849. * Initializes an object clone based on its `toStringTag`.
  6850. *
  6851. * **Note:** This function only supports cloning values with tags of
  6852. * `Boolean`, `Date`, `Error`, `Map`, `Number`, `RegExp`, `Set`, or `String`.
  6853. *
  6854. * @private
  6855. * @param {Object} object The object to clone.
  6856. * @param {string} tag The `toStringTag` of the object to clone.
  6857. * @param {boolean} [isDeep] Specify a deep clone.
  6858. * @returns {Object} Returns the initialized clone.
  6859. */
  6860. function initCloneByTag(object, tag, isDeep) {
  6861. var Ctor = object.constructor;
  6862. switch (tag) {
  6863. case arrayBufferTag:
  6864. return cloneArrayBuffer(object);
  6865. case boolTag:
  6866. case dateTag:
  6867. return new Ctor(+object);
  6868. case dataViewTag:
  6869. return cloneDataView(object, isDeep);
  6870. case float32Tag: case float64Tag:
  6871. case int8Tag: case int16Tag: case int32Tag:
  6872. case uint8Tag: case uint8ClampedTag: case uint16Tag: case uint32Tag:
  6873. return cloneTypedArray(object, isDeep);
  6874. case mapTag:
  6875. return new Ctor;
  6876. case numberTag:
  6877. case stringTag:
  6878. return new Ctor(object);
  6879. case regexpTag:
  6880. return cloneRegExp(object);
  6881. case setTag:
  6882. return new Ctor;
  6883. case symbolTag:
  6884. return cloneSymbol(object);
  6885. }
  6886. }
  6887. /**
  6888. * Inserts wrapper `details` in a comment at the top of the `source` body.
  6889. *
  6890. * @private
  6891. * @param {string} source The source to modify.
  6892. * @returns {Array} details The details to insert.
  6893. * @returns {string} Returns the modified source.
  6894. */
  6895. function insertWrapDetails(source, details) {
  6896. var length = details.length;
  6897. if (!length) {
  6898. return source;
  6899. }
  6900. var lastIndex = length - 1;
  6901. details[lastIndex] = (length > 1 ? '& ' : '') + details[lastIndex];
  6902. details = details.join(length > 2 ? ', ' : ' ');
  6903. return source.replace(reWrapComment, '{\n/* [wrapped with ' + details + '] */\n');
  6904. }
  6905. /**
  6906. * Checks if `value` is a flattenable `arguments` object or array.
  6907. *
  6908. * @private
  6909. * @param {*} value The value to check.
  6910. * @returns {boolean} Returns `true` if `value` is flattenable, else `false`.
  6911. */
  6912. function isFlattenable(value) {
  6913. return isArray(value) || isArguments(value) ||
  6914. !!(spreadableSymbol && value && value[spreadableSymbol]);
  6915. }
  6916. /**
  6917. * Checks if `value` is a valid array-like index.
  6918. *
  6919. * @private
  6920. * @param {*} value The value to check.
  6921. * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.
  6922. * @returns {boolean} Returns `true` if `value` is a valid index, else `false`.
  6923. */
  6924. function isIndex(value, length) {
  6925. var type = typeof value;
  6926. length = length == null ? MAX_SAFE_INTEGER : length;
  6927. return !!length &&
  6928. (type == 'number' ||
  6929. (type != 'symbol' && reIsUint.test(value))) &&
  6930. (value > -1 && value % 1 == 0 && value < length);
  6931. }
  6932. /**
  6933. * Checks if the given arguments are from an iteratee call.
  6934. *
  6935. * @private
  6936. * @param {*} value The potential iteratee value argument.
  6937. * @param {*} index The potential iteratee index or key argument.
  6938. * @param {*} object The potential iteratee object argument.
  6939. * @returns {boolean} Returns `true` if the arguments are from an iteratee call,
  6940. * else `false`.
  6941. */
  6942. function isIterateeCall(value, index, object) {
  6943. if (!isObject(object)) {
  6944. return false;
  6945. }
  6946. var type = typeof index;
  6947. if (type == 'number'
  6948. ? (isArrayLike(object) && isIndex(index, object.length))
  6949. : (type == 'string' && index in object)
  6950. ) {
  6951. return eq(object[index], value);
  6952. }
  6953. return false;
  6954. }
  6955. /**
  6956. * Checks if `value` is a property name and not a property path.
  6957. *
  6958. * @private
  6959. * @param {*} value The value to check.
  6960. * @param {Object} [object] The object to query keys on.
  6961. * @returns {boolean} Returns `true` if `value` is a property name, else `false`.
  6962. */
  6963. function isKey(value, object) {
  6964. if (isArray(value)) {
  6965. return false;
  6966. }
  6967. var type = typeof value;
  6968. if (type == 'number' || type == 'symbol' || type == 'boolean' ||
  6969. value == null || isSymbol(value)) {
  6970. return true;
  6971. }
  6972. return reIsPlainProp.test(value) || !reIsDeepProp.test(value) ||
  6973. (object != null && value in Object(object));
  6974. }
  6975. /**
  6976. * Checks if `value` is suitable for use as unique object key.
  6977. *
  6978. * @private
  6979. * @param {*} value The value to check.
  6980. * @returns {boolean} Returns `true` if `value` is suitable, else `false`.
  6981. */
  6982. function isKeyable(value) {
  6983. var type = typeof value;
  6984. return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean')
  6985. ? (value !== '__proto__')
  6986. : (value === null);
  6987. }
  6988. /**
  6989. * Checks if `func` has a lazy counterpart.
  6990. *
  6991. * @private
  6992. * @param {Function} func The function to check.
  6993. * @returns {boolean} Returns `true` if `func` has a lazy counterpart,
  6994. * else `false`.
  6995. */
  6996. function isLaziable(func) {
  6997. var funcName = getFuncName(func),
  6998. other = lodash[funcName];
  6999. if (typeof other != 'function' || !(funcName in LazyWrapper.prototype)) {
  7000. return false;
  7001. }
  7002. if (func === other) {
  7003. return true;
  7004. }
  7005. var data = getData(other);
  7006. return !!data && func === data[0];
  7007. }
  7008. /**
  7009. * Checks if `func` has its source masked.
  7010. *
  7011. * @private
  7012. * @param {Function} func The function to check.
  7013. * @returns {boolean} Returns `true` if `func` is masked, else `false`.
  7014. */
  7015. function isMasked(func) {
  7016. return !!maskSrcKey && (maskSrcKey in func);
  7017. }
  7018. /**
  7019. * Checks if `func` is capable of being masked.
  7020. *
  7021. * @private
  7022. * @param {*} value The value to check.
  7023. * @returns {boolean} Returns `true` if `func` is maskable, else `false`.
  7024. */
  7025. var isMaskable = coreJsData ? isFunction : stubFalse;
  7026. /**
  7027. * Checks if `value` is likely a prototype object.
  7028. *
  7029. * @private
  7030. * @param {*} value The value to check.
  7031. * @returns {boolean} Returns `true` if `value` is a prototype, else `false`.
  7032. */
  7033. function isPrototype(value) {
  7034. var Ctor = value && value.constructor,
  7035. proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto;
  7036. return value === proto;
  7037. }
  7038. /**
  7039. * Checks if `value` is suitable for strict equality comparisons, i.e. `===`.
  7040. *
  7041. * @private
  7042. * @param {*} value The value to check.
  7043. * @returns {boolean} Returns `true` if `value` if suitable for strict
  7044. * equality comparisons, else `false`.
  7045. */
  7046. function isStrictComparable(value) {
  7047. return value === value && !isObject(value);
  7048. }
  7049. /**
  7050. * A specialized version of `matchesProperty` for source values suitable
  7051. * for strict equality comparisons, i.e. `===`.
  7052. *
  7053. * @private
  7054. * @param {string} key The key of the property to get.
  7055. * @param {*} srcValue The value to match.
  7056. * @returns {Function} Returns the new spec function.
  7057. */
  7058. function matchesStrictComparable(key, srcValue) {
  7059. return function(object) {
  7060. if (object == null) {
  7061. return false;
  7062. }
  7063. return object[key] === srcValue &&
  7064. (srcValue !== undefined || (key in Object(object)));
  7065. };
  7066. }
  7067. /**
  7068. * A specialized version of `_.memoize` which clears the memoized function's
  7069. * cache when it exceeds `MAX_MEMOIZE_SIZE`.
  7070. *
  7071. * @private
  7072. * @param {Function} func The function to have its output memoized.
  7073. * @returns {Function} Returns the new memoized function.
  7074. */
  7075. function memoizeCapped(func) {
  7076. var result = memoize(func, function(key) {
  7077. if (cache.size === MAX_MEMOIZE_SIZE) {
  7078. cache.clear();
  7079. }
  7080. return key;
  7081. });
  7082. var cache = result.cache;
  7083. return result;
  7084. }
  7085. /**
  7086. * Merges the function metadata of `source` into `data`.
  7087. *
  7088. * Merging metadata reduces the number of wrappers used to invoke a function.
  7089. * This is possible because methods like `_.bind`, `_.curry`, and `_.partial`
  7090. * may be applied regardless of execution order. Methods like `_.ary` and
  7091. * `_.rearg` modify function arguments, making the order in which they are
  7092. * executed important, preventing the merging of metadata. However, we make
  7093. * an exception for a safe combined case where curried functions have `_.ary`
  7094. * and or `_.rearg` applied.
  7095. *
  7096. * @private
  7097. * @param {Array} data The destination metadata.
  7098. * @param {Array} source The source metadata.
  7099. * @returns {Array} Returns `data`.
  7100. */
  7101. function mergeData(data, source) {
  7102. var bitmask = data[1],
  7103. srcBitmask = source[1],
  7104. newBitmask = bitmask | srcBitmask,
  7105. isCommon = newBitmask < (WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG | WRAP_ARY_FLAG);
  7106. var isCombo =
  7107. ((srcBitmask == WRAP_ARY_FLAG) && (bitmask == WRAP_CURRY_FLAG)) ||
  7108. ((srcBitmask == WRAP_ARY_FLAG) && (bitmask == WRAP_REARG_FLAG) && (data[7].length <= source[8])) ||
  7109. ((srcBitmask == (WRAP_ARY_FLAG | WRAP_REARG_FLAG)) && (source[7].length <= source[8]) && (bitmask == WRAP_CURRY_FLAG));
  7110. // Exit early if metadata can't be merged.
  7111. if (!(isCommon || isCombo)) {
  7112. return data;
  7113. }
  7114. // Use source `thisArg` if available.
  7115. if (srcBitmask & WRAP_BIND_FLAG) {
  7116. data[2] = source[2];
  7117. // Set when currying a bound function.
  7118. newBitmask |= bitmask & WRAP_BIND_FLAG ? 0 : WRAP_CURRY_BOUND_FLAG;
  7119. }
  7120. // Compose partial arguments.
  7121. var value = source[3];
  7122. if (value) {
  7123. var partials = data[3];
  7124. data[3] = partials ? composeArgs(partials, value, source[4]) : value;
  7125. data[4] = partials ? replaceHolders(data[3], PLACEHOLDER) : source[4];
  7126. }
  7127. // Compose partial right arguments.
  7128. value = source[5];
  7129. if (value) {
  7130. partials = data[5];
  7131. data[5] = partials ? composeArgsRight(partials, value, source[6]) : value;
  7132. data[6] = partials ? replaceHolders(data[5], PLACEHOLDER) : source[6];
  7133. }
  7134. // Use source `argPos` if available.
  7135. value = source[7];
  7136. if (value) {
  7137. data[7] = value;
  7138. }
  7139. // Use source `ary` if it's smaller.
  7140. if (srcBitmask & WRAP_ARY_FLAG) {
  7141. data[8] = data[8] == null ? source[8] : nativeMin(data[8], source[8]);
  7142. }
  7143. // Use source `arity` if one is not provided.
  7144. if (data[9] == null) {
  7145. data[9] = source[9];
  7146. }
  7147. // Use source `func` and merge bitmasks.
  7148. data[0] = source[0];
  7149. data[1] = newBitmask;
  7150. return data;
  7151. }
  7152. /**
  7153. * This function is like
  7154. * [`Object.keys`](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)
  7155. * except that it includes inherited enumerable properties.
  7156. *
  7157. * @private
  7158. * @param {Object} object The object to query.
  7159. * @returns {Array} Returns the array of property names.
  7160. */
  7161. function nativeKeysIn(object) {
  7162. var result = [];
  7163. if (object != null) {
  7164. for (var key in Object(object)) {
  7165. result.push(key);
  7166. }
  7167. }
  7168. return result;
  7169. }
  7170. /**
  7171. * Converts `value` to a string using `Object.prototype.toString`.
  7172. *
  7173. * @private
  7174. * @param {*} value The value to convert.
  7175. * @returns {string} Returns the converted string.
  7176. */
  7177. function objectToString(value) {
  7178. return nativeObjectToString.call(value);
  7179. }
  7180. /**
  7181. * A specialized version of `baseRest` which transforms the rest array.
  7182. *
  7183. * @private
  7184. * @param {Function} func The function to apply a rest parameter to.
  7185. * @param {number} [start=func.length-1] The start position of the rest parameter.
  7186. * @param {Function} transform The rest array transform.
  7187. * @returns {Function} Returns the new function.
  7188. */
  7189. function overRest(func, start, transform) {
  7190. start = nativeMax(start === undefined ? (func.length - 1) : start, 0);
  7191. return function() {
  7192. var args = arguments,
  7193. index = -1,
  7194. length = nativeMax(args.length - start, 0),
  7195. array = Array(length);
  7196. while (++index < length) {
  7197. array[index] = args[start + index];
  7198. }
  7199. index = -1;
  7200. var otherArgs = Array(start + 1);
  7201. while (++index < start) {
  7202. otherArgs[index] = args[index];
  7203. }
  7204. otherArgs[start] = transform(array);
  7205. return apply(func, this, otherArgs);
  7206. };
  7207. }
  7208. /**
  7209. * Gets the parent value at `path` of `object`.
  7210. *
  7211. * @private
  7212. * @param {Object} object The object to query.
  7213. * @param {Array} path The path to get the parent value of.
  7214. * @returns {*} Returns the parent value.
  7215. */
  7216. function parent(object, path) {
  7217. return path.length < 2 ? object : baseGet(object, baseSlice(path, 0, -1));
  7218. }
  7219. /**
  7220. * Reorder `array` according to the specified indexes where the element at
  7221. * the first index is assigned as the first element, the element at
  7222. * the second index is assigned as the second element, and so on.
  7223. *
  7224. * @private
  7225. * @param {Array} array The array to reorder.
  7226. * @param {Array} indexes The arranged array indexes.
  7227. * @returns {Array} Returns `array`.
  7228. */
  7229. function reorder(array, indexes) {
  7230. var arrLength = array.length,
  7231. length = nativeMin(indexes.length, arrLength),
  7232. oldArray = copyArray(array);
  7233. while (length--) {
  7234. var index = indexes[length];
  7235. array[length] = isIndex(index, arrLength) ? oldArray[index] : undefined;
  7236. }
  7237. return array;
  7238. }
  7239. /**
  7240. * Gets the value at `key`, unless `key` is "__proto__" or "constructor".
  7241. *
  7242. * @private
  7243. * @param {Object} object The object to query.
  7244. * @param {string} key The key of the property to get.
  7245. * @returns {*} Returns the property value.
  7246. */
  7247. function safeGet(object, key) {
  7248. if (key === 'constructor' && typeof object[key] === 'function') {
  7249. return;
  7250. }
  7251. if (key == '__proto__') {
  7252. return;
  7253. }
  7254. return object[key];
  7255. }
  7256. /**
  7257. * Sets metadata for `func`.
  7258. *
  7259. * **Note:** If this function becomes hot, i.e. is invoked a lot in a short
  7260. * period of time, it will trip its breaker and transition to an identity
  7261. * function to avoid garbage collection pauses in V8. See
  7262. * [V8 issue 2070](https://bugs.chromium.org/p/v8/issues/detail?id=2070)
  7263. * for more details.
  7264. *
  7265. * @private
  7266. * @param {Function} func The function to associate metadata with.
  7267. * @param {*} data The metadata.
  7268. * @returns {Function} Returns `func`.
  7269. */
  7270. var setData = shortOut(baseSetData);
  7271. /**
  7272. * A simple wrapper around the global [`setTimeout`](https://mdn.io/setTimeout).
  7273. *
  7274. * @private
  7275. * @param {Function} func The function to delay.
  7276. * @param {number} wait The number of milliseconds to delay invocation.
  7277. * @returns {number|Object} Returns the timer id or timeout object.
  7278. */
  7279. var setTimeout = ctxSetTimeout || function(func, wait) {
  7280. return root.setTimeout(func, wait);
  7281. };
  7282. /**
  7283. * Sets the `toString` method of `func` to return `string`.
  7284. *
  7285. * @private
  7286. * @param {Function} func The function to modify.
  7287. * @param {Function} string The `toString` result.
  7288. * @returns {Function} Returns `func`.
  7289. */
  7290. var setToString = shortOut(baseSetToString);
  7291. /**
  7292. * Sets the `toString` method of `wrapper` to mimic the source of `reference`
  7293. * with wrapper details in a comment at the top of the source body.
  7294. *
  7295. * @private
  7296. * @param {Function} wrapper The function to modify.
  7297. * @param {Function} reference The reference function.
  7298. * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
  7299. * @returns {Function} Returns `wrapper`.
  7300. */
  7301. function setWrapToString(wrapper, reference, bitmask) {
  7302. var source = (reference + '');
  7303. return setToString(wrapper, insertWrapDetails(source, updateWrapDetails(getWrapDetails(source), bitmask)));
  7304. }
  7305. /**
  7306. * Creates a function that'll short out and invoke `identity` instead
  7307. * of `func` when it's called `HOT_COUNT` or more times in `HOT_SPAN`
  7308. * milliseconds.
  7309. *
  7310. * @private
  7311. * @param {Function} func The function to restrict.
  7312. * @returns {Function} Returns the new shortable function.
  7313. */
  7314. function shortOut(func) {
  7315. var count = 0,
  7316. lastCalled = 0;
  7317. return function() {
  7318. var stamp = nativeNow(),
  7319. remaining = HOT_SPAN - (stamp - lastCalled);
  7320. lastCalled = stamp;
  7321. if (remaining > 0) {
  7322. if (++count >= HOT_COUNT) {
  7323. return arguments[0];
  7324. }
  7325. } else {
  7326. count = 0;
  7327. }
  7328. return func.apply(undefined, arguments);
  7329. };
  7330. }
  7331. /**
  7332. * A specialized version of `_.shuffle` which mutates and sets the size of `array`.
  7333. *
  7334. * @private
  7335. * @param {Array} array The array to shuffle.
  7336. * @param {number} [size=array.length] The size of `array`.
  7337. * @returns {Array} Returns `array`.
  7338. */
  7339. function shuffleSelf(array, size) {
  7340. var index = -1,
  7341. length = array.length,
  7342. lastIndex = length - 1;
  7343. size = size === undefined ? length : size;
  7344. while (++index < size) {
  7345. var rand = baseRandom(index, lastIndex),
  7346. value = array[rand];
  7347. array[rand] = array[index];
  7348. array[index] = value;
  7349. }
  7350. array.length = size;
  7351. return array;
  7352. }
  7353. /**
  7354. * Converts `string` to a property path array.
  7355. *
  7356. * @private
  7357. * @param {string} string The string to convert.
  7358. * @returns {Array} Returns the property path array.
  7359. */
  7360. var stringToPath = memoizeCapped(function(string) {
  7361. var result = [];
  7362. if (string.charCodeAt(0) === 46 /* . */) {
  7363. result.push('');
  7364. }
  7365. string.replace(rePropName, function(match, number, quote, subString) {
  7366. result.push(quote ? subString.replace(reEscapeChar, '$1') : (number || match));
  7367. });
  7368. return result;
  7369. });
  7370. /**
  7371. * Converts `value` to a string key if it's not a string or symbol.
  7372. *
  7373. * @private
  7374. * @param {*} value The value to inspect.
  7375. * @returns {string|symbol} Returns the key.
  7376. */
  7377. function toKey(value) {
  7378. if (typeof value == 'string' || isSymbol(value)) {
  7379. return value;
  7380. }
  7381. var result = (value + '');
  7382. return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;
  7383. }
  7384. /**
  7385. * Converts `func` to its source code.
  7386. *
  7387. * @private
  7388. * @param {Function} func The function to convert.
  7389. * @returns {string} Returns the source code.
  7390. */
  7391. function toSource(func) {
  7392. if (func != null) {
  7393. try {
  7394. return funcToString.call(func);
  7395. } catch (e) {}
  7396. try {
  7397. return (func + '');
  7398. } catch (e) {}
  7399. }
  7400. return '';
  7401. }
  7402. /**
  7403. * Updates wrapper `details` based on `bitmask` flags.
  7404. *
  7405. * @private
  7406. * @returns {Array} details The details to modify.
  7407. * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
  7408. * @returns {Array} Returns `details`.
  7409. */
  7410. function updateWrapDetails(details, bitmask) {
  7411. arrayEach(wrapFlags, function(pair) {
  7412. var value = '_.' + pair[0];
  7413. if ((bitmask & pair[1]) && !arrayIncludes(details, value)) {
  7414. details.push(value);
  7415. }
  7416. });
  7417. return details.sort();
  7418. }
  7419. /**
  7420. * Creates a clone of `wrapper`.
  7421. *
  7422. * @private
  7423. * @param {Object} wrapper The wrapper to clone.
  7424. * @returns {Object} Returns the cloned wrapper.
  7425. */
  7426. function wrapperClone(wrapper) {
  7427. if (wrapper instanceof LazyWrapper) {
  7428. return wrapper.clone();
  7429. }
  7430. var result = new LodashWrapper(wrapper.__wrapped__, wrapper.__chain__);
  7431. result.__actions__ = copyArray(wrapper.__actions__);
  7432. result.__index__ = wrapper.__index__;
  7433. result.__values__ = wrapper.__values__;
  7434. return result;
  7435. }
  7436. /*------------------------------------------------------------------------*/
  7437. /**
  7438. * Creates an array of elements split into groups the length of `size`.
  7439. * If `array` can't be split evenly, the final chunk will be the remaining
  7440. * elements.
  7441. *
  7442. * @static
  7443. * @memberOf _
  7444. * @since 3.0.0
  7445. * @category Array
  7446. * @param {Array} array The array to process.
  7447. * @param {number} [size=1] The length of each chunk
  7448. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  7449. * @returns {Array} Returns the new array of chunks.
  7450. * @example
  7451. *
  7452. * _.chunk(['a', 'b', 'c', 'd'], 2);
  7453. * // => [['a', 'b'], ['c', 'd']]
  7454. *
  7455. * _.chunk(['a', 'b', 'c', 'd'], 3);
  7456. * // => [['a', 'b', 'c'], ['d']]
  7457. */
  7458. function chunk(array, size, guard) {
  7459. if ((guard ? isIterateeCall(array, size, guard) : size === undefined)) {
  7460. size = 1;
  7461. } else {
  7462. size = nativeMax(toInteger(size), 0);
  7463. }
  7464. var length = array == null ? 0 : array.length;
  7465. if (!length || size < 1) {
  7466. return [];
  7467. }
  7468. var index = 0,
  7469. resIndex = 0,
  7470. result = Array(nativeCeil(length / size));
  7471. while (index < length) {
  7472. result[resIndex++] = baseSlice(array, index, (index += size));
  7473. }
  7474. return result;
  7475. }
  7476. /**
  7477. * Creates an array with all falsey values removed. The values `false`, `null`,
  7478. * `0`, `""`, `undefined`, and `NaN` are falsey.
  7479. *
  7480. * @static
  7481. * @memberOf _
  7482. * @since 0.1.0
  7483. * @category Array
  7484. * @param {Array} array The array to compact.
  7485. * @returns {Array} Returns the new array of filtered values.
  7486. * @example
  7487. *
  7488. * _.compact([0, 1, false, 2, '', 3]);
  7489. * // => [1, 2, 3]
  7490. */
  7491. function compact(array) {
  7492. var index = -1,
  7493. length = array == null ? 0 : array.length,
  7494. resIndex = 0,
  7495. result = [];
  7496. while (++index < length) {
  7497. var value = array[index];
  7498. if (value) {
  7499. result[resIndex++] = value;
  7500. }
  7501. }
  7502. return result;
  7503. }
  7504. /**
  7505. * Creates a new array concatenating `array` with any additional arrays
  7506. * and/or values.
  7507. *
  7508. * @static
  7509. * @memberOf _
  7510. * @since 4.0.0
  7511. * @category Array
  7512. * @param {Array} array The array to concatenate.
  7513. * @param {...*} [values] The values to concatenate.
  7514. * @returns {Array} Returns the new concatenated array.
  7515. * @example
  7516. *
  7517. * var array = [1];
  7518. * var other = _.concat(array, 2, [3], [[4]]);
  7519. *
  7520. * console.log(other);
  7521. * // => [1, 2, 3, [4]]
  7522. *
  7523. * console.log(array);
  7524. * // => [1]
  7525. */
  7526. function concat() {
  7527. var length = arguments.length;
  7528. if (!length) {
  7529. return [];
  7530. }
  7531. var args = Array(length - 1),
  7532. array = arguments[0],
  7533. index = length;
  7534. while (index--) {
  7535. args[index - 1] = arguments[index];
  7536. }
  7537. return arrayPush(isArray(array) ? copyArray(array) : [array], baseFlatten(args, 1));
  7538. }
  7539. /**
  7540. * Creates an array of `array` values not included in the other given arrays
  7541. * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  7542. * for equality comparisons. The order and references of result values are
  7543. * determined by the first array.
  7544. *
  7545. * **Note:** Unlike `_.pullAll`, this method returns a new array.
  7546. *
  7547. * @static
  7548. * @memberOf _
  7549. * @since 0.1.0
  7550. * @category Array
  7551. * @param {Array} array The array to inspect.
  7552. * @param {...Array} [values] The values to exclude.
  7553. * @returns {Array} Returns the new array of filtered values.
  7554. * @see _.without, _.xor
  7555. * @example
  7556. *
  7557. * _.difference([2, 1], [2, 3]);
  7558. * // => [1]
  7559. */
  7560. var difference = baseRest(function(array, values) {
  7561. return isArrayLikeObject(array)
  7562. ? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true))
  7563. : [];
  7564. });
  7565. /**
  7566. * This method is like `_.difference` except that it accepts `iteratee` which
  7567. * is invoked for each element of `array` and `values` to generate the criterion
  7568. * by which they're compared. The order and references of result values are
  7569. * determined by the first array. The iteratee is invoked with one argument:
  7570. * (value).
  7571. *
  7572. * **Note:** Unlike `_.pullAllBy`, this method returns a new array.
  7573. *
  7574. * @static
  7575. * @memberOf _
  7576. * @since 4.0.0
  7577. * @category Array
  7578. * @param {Array} array The array to inspect.
  7579. * @param {...Array} [values] The values to exclude.
  7580. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  7581. * @returns {Array} Returns the new array of filtered values.
  7582. * @example
  7583. *
  7584. * _.differenceBy([2.1, 1.2], [2.3, 3.4], Math.floor);
  7585. * // => [1.2]
  7586. *
  7587. * // The `_.property` iteratee shorthand.
  7588. * _.differenceBy([{ 'x': 2 }, { 'x': 1 }], [{ 'x': 1 }], 'x');
  7589. * // => [{ 'x': 2 }]
  7590. */
  7591. var differenceBy = baseRest(function(array, values) {
  7592. var iteratee = last(values);
  7593. if (isArrayLikeObject(iteratee)) {
  7594. iteratee = undefined;
  7595. }
  7596. return isArrayLikeObject(array)
  7597. ? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true), getIteratee(iteratee, 2))
  7598. : [];
  7599. });
  7600. /**
  7601. * This method is like `_.difference` except that it accepts `comparator`
  7602. * which is invoked to compare elements of `array` to `values`. The order and
  7603. * references of result values are determined by the first array. The comparator
  7604. * is invoked with two arguments: (arrVal, othVal).
  7605. *
  7606. * **Note:** Unlike `_.pullAllWith`, this method returns a new array.
  7607. *
  7608. * @static
  7609. * @memberOf _
  7610. * @since 4.0.0
  7611. * @category Array
  7612. * @param {Array} array The array to inspect.
  7613. * @param {...Array} [values] The values to exclude.
  7614. * @param {Function} [comparator] The comparator invoked per element.
  7615. * @returns {Array} Returns the new array of filtered values.
  7616. * @example
  7617. *
  7618. * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }];
  7619. *
  7620. * _.differenceWith(objects, [{ 'x': 1, 'y': 2 }], _.isEqual);
  7621. * // => [{ 'x': 2, 'y': 1 }]
  7622. */
  7623. var differenceWith = baseRest(function(array, values) {
  7624. var comparator = last(values);
  7625. if (isArrayLikeObject(comparator)) {
  7626. comparator = undefined;
  7627. }
  7628. return isArrayLikeObject(array)
  7629. ? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true), undefined, comparator)
  7630. : [];
  7631. });
  7632. /**
  7633. * Creates a slice of `array` with `n` elements dropped from the beginning.
  7634. *
  7635. * @static
  7636. * @memberOf _
  7637. * @since 0.5.0
  7638. * @category Array
  7639. * @param {Array} array The array to query.
  7640. * @param {number} [n=1] The number of elements to drop.
  7641. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  7642. * @returns {Array} Returns the slice of `array`.
  7643. * @example
  7644. *
  7645. * _.drop([1, 2, 3]);
  7646. * // => [2, 3]
  7647. *
  7648. * _.drop([1, 2, 3], 2);
  7649. * // => [3]
  7650. *
  7651. * _.drop([1, 2, 3], 5);
  7652. * // => []
  7653. *
  7654. * _.drop([1, 2, 3], 0);
  7655. * // => [1, 2, 3]
  7656. */
  7657. function drop(array, n, guard) {
  7658. var length = array == null ? 0 : array.length;
  7659. if (!length) {
  7660. return [];
  7661. }
  7662. n = (guard || n === undefined) ? 1 : toInteger(n);
  7663. return baseSlice(array, n < 0 ? 0 : n, length);
  7664. }
  7665. /**
  7666. * Creates a slice of `array` with `n` elements dropped from the end.
  7667. *
  7668. * @static
  7669. * @memberOf _
  7670. * @since 3.0.0
  7671. * @category Array
  7672. * @param {Array} array The array to query.
  7673. * @param {number} [n=1] The number of elements to drop.
  7674. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  7675. * @returns {Array} Returns the slice of `array`.
  7676. * @example
  7677. *
  7678. * _.dropRight([1, 2, 3]);
  7679. * // => [1, 2]
  7680. *
  7681. * _.dropRight([1, 2, 3], 2);
  7682. * // => [1]
  7683. *
  7684. * _.dropRight([1, 2, 3], 5);
  7685. * // => []
  7686. *
  7687. * _.dropRight([1, 2, 3], 0);
  7688. * // => [1, 2, 3]
  7689. */
  7690. function dropRight(array, n, guard) {
  7691. var length = array == null ? 0 : array.length;
  7692. if (!length) {
  7693. return [];
  7694. }
  7695. n = (guard || n === undefined) ? 1 : toInteger(n);
  7696. n = length - n;
  7697. return baseSlice(array, 0, n < 0 ? 0 : n);
  7698. }
  7699. /**
  7700. * Creates a slice of `array` excluding elements dropped from the end.
  7701. * Elements are dropped until `predicate` returns falsey. The predicate is
  7702. * invoked with three arguments: (value, index, array).
  7703. *
  7704. * @static
  7705. * @memberOf _
  7706. * @since 3.0.0
  7707. * @category Array
  7708. * @param {Array} array The array to query.
  7709. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  7710. * @returns {Array} Returns the slice of `array`.
  7711. * @example
  7712. *
  7713. * var users = [
  7714. * { 'user': 'barney', 'active': true },
  7715. * { 'user': 'fred', 'active': false },
  7716. * { 'user': 'pebbles', 'active': false }
  7717. * ];
  7718. *
  7719. * _.dropRightWhile(users, function(o) { return !o.active; });
  7720. * // => objects for ['barney']
  7721. *
  7722. * // The `_.matches` iteratee shorthand.
  7723. * _.dropRightWhile(users, { 'user': 'pebbles', 'active': false });
  7724. * // => objects for ['barney', 'fred']
  7725. *
  7726. * // The `_.matchesProperty` iteratee shorthand.
  7727. * _.dropRightWhile(users, ['active', false]);
  7728. * // => objects for ['barney']
  7729. *
  7730. * // The `_.property` iteratee shorthand.
  7731. * _.dropRightWhile(users, 'active');
  7732. * // => objects for ['barney', 'fred', 'pebbles']
  7733. */
  7734. function dropRightWhile(array, predicate) {
  7735. return (array && array.length)
  7736. ? baseWhile(array, getIteratee(predicate, 3), true, true)
  7737. : [];
  7738. }
  7739. /**
  7740. * Creates a slice of `array` excluding elements dropped from the beginning.
  7741. * Elements are dropped until `predicate` returns falsey. The predicate is
  7742. * invoked with three arguments: (value, index, array).
  7743. *
  7744. * @static
  7745. * @memberOf _
  7746. * @since 3.0.0
  7747. * @category Array
  7748. * @param {Array} array The array to query.
  7749. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  7750. * @returns {Array} Returns the slice of `array`.
  7751. * @example
  7752. *
  7753. * var users = [
  7754. * { 'user': 'barney', 'active': false },
  7755. * { 'user': 'fred', 'active': false },
  7756. * { 'user': 'pebbles', 'active': true }
  7757. * ];
  7758. *
  7759. * _.dropWhile(users, function(o) { return !o.active; });
  7760. * // => objects for ['pebbles']
  7761. *
  7762. * // The `_.matches` iteratee shorthand.
  7763. * _.dropWhile(users, { 'user': 'barney', 'active': false });
  7764. * // => objects for ['fred', 'pebbles']
  7765. *
  7766. * // The `_.matchesProperty` iteratee shorthand.
  7767. * _.dropWhile(users, ['active', false]);
  7768. * // => objects for ['pebbles']
  7769. *
  7770. * // The `_.property` iteratee shorthand.
  7771. * _.dropWhile(users, 'active');
  7772. * // => objects for ['barney', 'fred', 'pebbles']
  7773. */
  7774. function dropWhile(array, predicate) {
  7775. return (array && array.length)
  7776. ? baseWhile(array, getIteratee(predicate, 3), true)
  7777. : [];
  7778. }
  7779. /**
  7780. * Fills elements of `array` with `value` from `start` up to, but not
  7781. * including, `end`.
  7782. *
  7783. * **Note:** This method mutates `array`.
  7784. *
  7785. * @static
  7786. * @memberOf _
  7787. * @since 3.2.0
  7788. * @category Array
  7789. * @param {Array} array The array to fill.
  7790. * @param {*} value The value to fill `array` with.
  7791. * @param {number} [start=0] The start position.
  7792. * @param {number} [end=array.length] The end position.
  7793. * @returns {Array} Returns `array`.
  7794. * @example
  7795. *
  7796. * var array = [1, 2, 3];
  7797. *
  7798. * _.fill(array, 'a');
  7799. * console.log(array);
  7800. * // => ['a', 'a', 'a']
  7801. *
  7802. * _.fill(Array(3), 2);
  7803. * // => [2, 2, 2]
  7804. *
  7805. * _.fill([4, 6, 8, 10], '*', 1, 3);
  7806. * // => [4, '*', '*', 10]
  7807. */
  7808. function fill(array, value, start, end) {
  7809. var length = array == null ? 0 : array.length;
  7810. if (!length) {
  7811. return [];
  7812. }
  7813. if (start && typeof start != 'number' && isIterateeCall(array, value, start)) {
  7814. start = 0;
  7815. end = length;
  7816. }
  7817. return baseFill(array, value, start, end);
  7818. }
  7819. /**
  7820. * This method is like `_.find` except that it returns the index of the first
  7821. * element `predicate` returns truthy for instead of the element itself.
  7822. *
  7823. * @static
  7824. * @memberOf _
  7825. * @since 1.1.0
  7826. * @category Array
  7827. * @param {Array} array The array to inspect.
  7828. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  7829. * @param {number} [fromIndex=0] The index to search from.
  7830. * @returns {number} Returns the index of the found element, else `-1`.
  7831. * @example
  7832. *
  7833. * var users = [
  7834. * { 'user': 'barney', 'active': false },
  7835. * { 'user': 'fred', 'active': false },
  7836. * { 'user': 'pebbles', 'active': true }
  7837. * ];
  7838. *
  7839. * _.findIndex(users, function(o) { return o.user == 'barney'; });
  7840. * // => 0
  7841. *
  7842. * // The `_.matches` iteratee shorthand.
  7843. * _.findIndex(users, { 'user': 'fred', 'active': false });
  7844. * // => 1
  7845. *
  7846. * // The `_.matchesProperty` iteratee shorthand.
  7847. * _.findIndex(users, ['active', false]);
  7848. * // => 0
  7849. *
  7850. * // The `_.property` iteratee shorthand.
  7851. * _.findIndex(users, 'active');
  7852. * // => 2
  7853. */
  7854. function findIndex(array, predicate, fromIndex) {
  7855. var length = array == null ? 0 : array.length;
  7856. if (!length) {
  7857. return -1;
  7858. }
  7859. var index = fromIndex == null ? 0 : toInteger(fromIndex);
  7860. if (index < 0) {
  7861. index = nativeMax(length + index, 0);
  7862. }
  7863. return baseFindIndex(array, getIteratee(predicate, 3), index);
  7864. }
  7865. /**
  7866. * This method is like `_.findIndex` except that it iterates over elements
  7867. * of `collection` from right to left.
  7868. *
  7869. * @static
  7870. * @memberOf _
  7871. * @since 2.0.0
  7872. * @category Array
  7873. * @param {Array} array The array to inspect.
  7874. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  7875. * @param {number} [fromIndex=array.length-1] The index to search from.
  7876. * @returns {number} Returns the index of the found element, else `-1`.
  7877. * @example
  7878. *
  7879. * var users = [
  7880. * { 'user': 'barney', 'active': true },
  7881. * { 'user': 'fred', 'active': false },
  7882. * { 'user': 'pebbles', 'active': false }
  7883. * ];
  7884. *
  7885. * _.findLastIndex(users, function(o) { return o.user == 'pebbles'; });
  7886. * // => 2
  7887. *
  7888. * // The `_.matches` iteratee shorthand.
  7889. * _.findLastIndex(users, { 'user': 'barney', 'active': true });
  7890. * // => 0
  7891. *
  7892. * // The `_.matchesProperty` iteratee shorthand.
  7893. * _.findLastIndex(users, ['active', false]);
  7894. * // => 2
  7895. *
  7896. * // The `_.property` iteratee shorthand.
  7897. * _.findLastIndex(users, 'active');
  7898. * // => 0
  7899. */
  7900. function findLastIndex(array, predicate, fromIndex) {
  7901. var length = array == null ? 0 : array.length;
  7902. if (!length) {
  7903. return -1;
  7904. }
  7905. var index = length - 1;
  7906. if (fromIndex !== undefined) {
  7907. index = toInteger(fromIndex);
  7908. index = fromIndex < 0
  7909. ? nativeMax(length + index, 0)
  7910. : nativeMin(index, length - 1);
  7911. }
  7912. return baseFindIndex(array, getIteratee(predicate, 3), index, true);
  7913. }
  7914. /**
  7915. * Flattens `array` a single level deep.
  7916. *
  7917. * @static
  7918. * @memberOf _
  7919. * @since 0.1.0
  7920. * @category Array
  7921. * @param {Array} array The array to flatten.
  7922. * @returns {Array} Returns the new flattened array.
  7923. * @example
  7924. *
  7925. * _.flatten([1, [2, [3, [4]], 5]]);
  7926. * // => [1, 2, [3, [4]], 5]
  7927. */
  7928. function flatten(array) {
  7929. var length = array == null ? 0 : array.length;
  7930. return length ? baseFlatten(array, 1) : [];
  7931. }
  7932. /**
  7933. * Recursively flattens `array`.
  7934. *
  7935. * @static
  7936. * @memberOf _
  7937. * @since 3.0.0
  7938. * @category Array
  7939. * @param {Array} array The array to flatten.
  7940. * @returns {Array} Returns the new flattened array.
  7941. * @example
  7942. *
  7943. * _.flattenDeep([1, [2, [3, [4]], 5]]);
  7944. * // => [1, 2, 3, 4, 5]
  7945. */
  7946. function flattenDeep(array) {
  7947. var length = array == null ? 0 : array.length;
  7948. return length ? baseFlatten(array, INFINITY) : [];
  7949. }
  7950. /**
  7951. * Recursively flatten `array` up to `depth` times.
  7952. *
  7953. * @static
  7954. * @memberOf _
  7955. * @since 4.4.0
  7956. * @category Array
  7957. * @param {Array} array The array to flatten.
  7958. * @param {number} [depth=1] The maximum recursion depth.
  7959. * @returns {Array} Returns the new flattened array.
  7960. * @example
  7961. *
  7962. * var array = [1, [2, [3, [4]], 5]];
  7963. *
  7964. * _.flattenDepth(array, 1);
  7965. * // => [1, 2, [3, [4]], 5]
  7966. *
  7967. * _.flattenDepth(array, 2);
  7968. * // => [1, 2, 3, [4], 5]
  7969. */
  7970. function flattenDepth(array, depth) {
  7971. var length = array == null ? 0 : array.length;
  7972. if (!length) {
  7973. return [];
  7974. }
  7975. depth = depth === undefined ? 1 : toInteger(depth);
  7976. return baseFlatten(array, depth);
  7977. }
  7978. /**
  7979. * The inverse of `_.toPairs`; this method returns an object composed
  7980. * from key-value `pairs`.
  7981. *
  7982. * @static
  7983. * @memberOf _
  7984. * @since 4.0.0
  7985. * @category Array
  7986. * @param {Array} pairs The key-value pairs.
  7987. * @returns {Object} Returns the new object.
  7988. * @example
  7989. *
  7990. * _.fromPairs([['a', 1], ['b', 2]]);
  7991. * // => { 'a': 1, 'b': 2 }
  7992. */
  7993. function fromPairs(pairs) {
  7994. var index = -1,
  7995. length = pairs == null ? 0 : pairs.length,
  7996. result = {};
  7997. while (++index < length) {
  7998. var pair = pairs[index];
  7999. result[pair[0]] = pair[1];
  8000. }
  8001. return result;
  8002. }
  8003. /**
  8004. * Gets the first element of `array`.
  8005. *
  8006. * @static
  8007. * @memberOf _
  8008. * @since 0.1.0
  8009. * @alias first
  8010. * @category Array
  8011. * @param {Array} array The array to query.
  8012. * @returns {*} Returns the first element of `array`.
  8013. * @example
  8014. *
  8015. * _.head([1, 2, 3]);
  8016. * // => 1
  8017. *
  8018. * _.head([]);
  8019. * // => undefined
  8020. */
  8021. function head(array) {
  8022. return (array && array.length) ? array[0] : undefined;
  8023. }
  8024. /**
  8025. * Gets the index at which the first occurrence of `value` is found in `array`
  8026. * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  8027. * for equality comparisons. If `fromIndex` is negative, it's used as the
  8028. * offset from the end of `array`.
  8029. *
  8030. * @static
  8031. * @memberOf _
  8032. * @since 0.1.0
  8033. * @category Array
  8034. * @param {Array} array The array to inspect.
  8035. * @param {*} value The value to search for.
  8036. * @param {number} [fromIndex=0] The index to search from.
  8037. * @returns {number} Returns the index of the matched value, else `-1`.
  8038. * @example
  8039. *
  8040. * _.indexOf([1, 2, 1, 2], 2);
  8041. * // => 1
  8042. *
  8043. * // Search from the `fromIndex`.
  8044. * _.indexOf([1, 2, 1, 2], 2, 2);
  8045. * // => 3
  8046. */
  8047. function indexOf(array, value, fromIndex) {
  8048. var length = array == null ? 0 : array.length;
  8049. if (!length) {
  8050. return -1;
  8051. }
  8052. var index = fromIndex == null ? 0 : toInteger(fromIndex);
  8053. if (index < 0) {
  8054. index = nativeMax(length + index, 0);
  8055. }
  8056. return baseIndexOf(array, value, index);
  8057. }
  8058. /**
  8059. * Gets all but the last element of `array`.
  8060. *
  8061. * @static
  8062. * @memberOf _
  8063. * @since 0.1.0
  8064. * @category Array
  8065. * @param {Array} array The array to query.
  8066. * @returns {Array} Returns the slice of `array`.
  8067. * @example
  8068. *
  8069. * _.initial([1, 2, 3]);
  8070. * // => [1, 2]
  8071. */
  8072. function initial(array) {
  8073. var length = array == null ? 0 : array.length;
  8074. return length ? baseSlice(array, 0, -1) : [];
  8075. }
  8076. /**
  8077. * Creates an array of unique values that are included in all given arrays
  8078. * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  8079. * for equality comparisons. The order and references of result values are
  8080. * determined by the first array.
  8081. *
  8082. * @static
  8083. * @memberOf _
  8084. * @since 0.1.0
  8085. * @category Array
  8086. * @param {...Array} [arrays] The arrays to inspect.
  8087. * @returns {Array} Returns the new array of intersecting values.
  8088. * @example
  8089. *
  8090. * _.intersection([2, 1], [2, 3]);
  8091. * // => [2]
  8092. */
  8093. var intersection = baseRest(function(arrays) {
  8094. var mapped = arrayMap(arrays, castArrayLikeObject);
  8095. return (mapped.length && mapped[0] === arrays[0])
  8096. ? baseIntersection(mapped)
  8097. : [];
  8098. });
  8099. /**
  8100. * This method is like `_.intersection` except that it accepts `iteratee`
  8101. * which is invoked for each element of each `arrays` to generate the criterion
  8102. * by which they're compared. The order and references of result values are
  8103. * determined by the first array. The iteratee is invoked with one argument:
  8104. * (value).
  8105. *
  8106. * @static
  8107. * @memberOf _
  8108. * @since 4.0.0
  8109. * @category Array
  8110. * @param {...Array} [arrays] The arrays to inspect.
  8111. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  8112. * @returns {Array} Returns the new array of intersecting values.
  8113. * @example
  8114. *
  8115. * _.intersectionBy([2.1, 1.2], [2.3, 3.4], Math.floor);
  8116. * // => [2.1]
  8117. *
  8118. * // The `_.property` iteratee shorthand.
  8119. * _.intersectionBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x');
  8120. * // => [{ 'x': 1 }]
  8121. */
  8122. var intersectionBy = baseRest(function(arrays) {
  8123. var iteratee = last(arrays),
  8124. mapped = arrayMap(arrays, castArrayLikeObject);
  8125. if (iteratee === last(mapped)) {
  8126. iteratee = undefined;
  8127. } else {
  8128. mapped.pop();
  8129. }
  8130. return (mapped.length && mapped[0] === arrays[0])
  8131. ? baseIntersection(mapped, getIteratee(iteratee, 2))
  8132. : [];
  8133. });
  8134. /**
  8135. * This method is like `_.intersection` except that it accepts `comparator`
  8136. * which is invoked to compare elements of `arrays`. The order and references
  8137. * of result values are determined by the first array. The comparator is
  8138. * invoked with two arguments: (arrVal, othVal).
  8139. *
  8140. * @static
  8141. * @memberOf _
  8142. * @since 4.0.0
  8143. * @category Array
  8144. * @param {...Array} [arrays] The arrays to inspect.
  8145. * @param {Function} [comparator] The comparator invoked per element.
  8146. * @returns {Array} Returns the new array of intersecting values.
  8147. * @example
  8148. *
  8149. * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }];
  8150. * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }];
  8151. *
  8152. * _.intersectionWith(objects, others, _.isEqual);
  8153. * // => [{ 'x': 1, 'y': 2 }]
  8154. */
  8155. var intersectionWith = baseRest(function(arrays) {
  8156. var comparator = last(arrays),
  8157. mapped = arrayMap(arrays, castArrayLikeObject);
  8158. comparator = typeof comparator == 'function' ? comparator : undefined;
  8159. if (comparator) {
  8160. mapped.pop();
  8161. }
  8162. return (mapped.length && mapped[0] === arrays[0])
  8163. ? baseIntersection(mapped, undefined, comparator)
  8164. : [];
  8165. });
  8166. /**
  8167. * Converts all elements in `array` into a string separated by `separator`.
  8168. *
  8169. * @static
  8170. * @memberOf _
  8171. * @since 4.0.0
  8172. * @category Array
  8173. * @param {Array} array The array to convert.
  8174. * @param {string} [separator=','] The element separator.
  8175. * @returns {string} Returns the joined string.
  8176. * @example
  8177. *
  8178. * _.join(['a', 'b', 'c'], '~');
  8179. * // => 'a~b~c'
  8180. */
  8181. function join(array, separator) {
  8182. return array == null ? '' : nativeJoin.call(array, separator);
  8183. }
  8184. /**
  8185. * Gets the last element of `array`.
  8186. *
  8187. * @static
  8188. * @memberOf _
  8189. * @since 0.1.0
  8190. * @category Array
  8191. * @param {Array} array The array to query.
  8192. * @returns {*} Returns the last element of `array`.
  8193. * @example
  8194. *
  8195. * _.last([1, 2, 3]);
  8196. * // => 3
  8197. */
  8198. function last(array) {
  8199. var length = array == null ? 0 : array.length;
  8200. return length ? array[length - 1] : undefined;
  8201. }
  8202. /**
  8203. * This method is like `_.indexOf` except that it iterates over elements of
  8204. * `array` from right to left.
  8205. *
  8206. * @static
  8207. * @memberOf _
  8208. * @since 0.1.0
  8209. * @category Array
  8210. * @param {Array} array The array to inspect.
  8211. * @param {*} value The value to search for.
  8212. * @param {number} [fromIndex=array.length-1] The index to search from.
  8213. * @returns {number} Returns the index of the matched value, else `-1`.
  8214. * @example
  8215. *
  8216. * _.lastIndexOf([1, 2, 1, 2], 2);
  8217. * // => 3
  8218. *
  8219. * // Search from the `fromIndex`.
  8220. * _.lastIndexOf([1, 2, 1, 2], 2, 2);
  8221. * // => 1
  8222. */
  8223. function lastIndexOf(array, value, fromIndex) {
  8224. var length = array == null ? 0 : array.length;
  8225. if (!length) {
  8226. return -1;
  8227. }
  8228. var index = length;
  8229. if (fromIndex !== undefined) {
  8230. index = toInteger(fromIndex);
  8231. index = index < 0 ? nativeMax(length + index, 0) : nativeMin(index, length - 1);
  8232. }
  8233. return value === value
  8234. ? strictLastIndexOf(array, value, index)
  8235. : baseFindIndex(array, baseIsNaN, index, true);
  8236. }
  8237. /**
  8238. * Gets the element at index `n` of `array`. If `n` is negative, the nth
  8239. * element from the end is returned.
  8240. *
  8241. * @static
  8242. * @memberOf _
  8243. * @since 4.11.0
  8244. * @category Array
  8245. * @param {Array} array The array to query.
  8246. * @param {number} [n=0] The index of the element to return.
  8247. * @returns {*} Returns the nth element of `array`.
  8248. * @example
  8249. *
  8250. * var array = ['a', 'b', 'c', 'd'];
  8251. *
  8252. * _.nth(array, 1);
  8253. * // => 'b'
  8254. *
  8255. * _.nth(array, -2);
  8256. * // => 'c';
  8257. */
  8258. function nth(array, n) {
  8259. return (array && array.length) ? baseNth(array, toInteger(n)) : undefined;
  8260. }
  8261. /**
  8262. * Removes all given values from `array` using
  8263. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  8264. * for equality comparisons.
  8265. *
  8266. * **Note:** Unlike `_.without`, this method mutates `array`. Use `_.remove`
  8267. * to remove elements from an array by predicate.
  8268. *
  8269. * @static
  8270. * @memberOf _
  8271. * @since 2.0.0
  8272. * @category Array
  8273. * @param {Array} array The array to modify.
  8274. * @param {...*} [values] The values to remove.
  8275. * @returns {Array} Returns `array`.
  8276. * @example
  8277. *
  8278. * var array = ['a', 'b', 'c', 'a', 'b', 'c'];
  8279. *
  8280. * _.pull(array, 'a', 'c');
  8281. * console.log(array);
  8282. * // => ['b', 'b']
  8283. */
  8284. var pull = baseRest(pullAll);
  8285. /**
  8286. * This method is like `_.pull` except that it accepts an array of values to remove.
  8287. *
  8288. * **Note:** Unlike `_.difference`, this method mutates `array`.
  8289. *
  8290. * @static
  8291. * @memberOf _
  8292. * @since 4.0.0
  8293. * @category Array
  8294. * @param {Array} array The array to modify.
  8295. * @param {Array} values The values to remove.
  8296. * @returns {Array} Returns `array`.
  8297. * @example
  8298. *
  8299. * var array = ['a', 'b', 'c', 'a', 'b', 'c'];
  8300. *
  8301. * _.pullAll(array, ['a', 'c']);
  8302. * console.log(array);
  8303. * // => ['b', 'b']
  8304. */
  8305. function pullAll(array, values) {
  8306. return (array && array.length && values && values.length)
  8307. ? basePullAll(array, values)
  8308. : array;
  8309. }
  8310. /**
  8311. * This method is like `_.pullAll` except that it accepts `iteratee` which is
  8312. * invoked for each element of `array` and `values` to generate the criterion
  8313. * by which they're compared. The iteratee is invoked with one argument: (value).
  8314. *
  8315. * **Note:** Unlike `_.differenceBy`, this method mutates `array`.
  8316. *
  8317. * @static
  8318. * @memberOf _
  8319. * @since 4.0.0
  8320. * @category Array
  8321. * @param {Array} array The array to modify.
  8322. * @param {Array} values The values to remove.
  8323. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  8324. * @returns {Array} Returns `array`.
  8325. * @example
  8326. *
  8327. * var array = [{ 'x': 1 }, { 'x': 2 }, { 'x': 3 }, { 'x': 1 }];
  8328. *
  8329. * _.pullAllBy(array, [{ 'x': 1 }, { 'x': 3 }], 'x');
  8330. * console.log(array);
  8331. * // => [{ 'x': 2 }]
  8332. */
  8333. function pullAllBy(array, values, iteratee) {
  8334. return (array && array.length && values && values.length)
  8335. ? basePullAll(array, values, getIteratee(iteratee, 2))
  8336. : array;
  8337. }
  8338. /**
  8339. * This method is like `_.pullAll` except that it accepts `comparator` which
  8340. * is invoked to compare elements of `array` to `values`. The comparator is
  8341. * invoked with two arguments: (arrVal, othVal).
  8342. *
  8343. * **Note:** Unlike `_.differenceWith`, this method mutates `array`.
  8344. *
  8345. * @static
  8346. * @memberOf _
  8347. * @since 4.6.0
  8348. * @category Array
  8349. * @param {Array} array The array to modify.
  8350. * @param {Array} values The values to remove.
  8351. * @param {Function} [comparator] The comparator invoked per element.
  8352. * @returns {Array} Returns `array`.
  8353. * @example
  8354. *
  8355. * var array = [{ 'x': 1, 'y': 2 }, { 'x': 3, 'y': 4 }, { 'x': 5, 'y': 6 }];
  8356. *
  8357. * _.pullAllWith(array, [{ 'x': 3, 'y': 4 }], _.isEqual);
  8358. * console.log(array);
  8359. * // => [{ 'x': 1, 'y': 2 }, { 'x': 5, 'y': 6 }]
  8360. */
  8361. function pullAllWith(array, values, comparator) {
  8362. return (array && array.length && values && values.length)
  8363. ? basePullAll(array, values, undefined, comparator)
  8364. : array;
  8365. }
  8366. /**
  8367. * Removes elements from `array` corresponding to `indexes` and returns an
  8368. * array of removed elements.
  8369. *
  8370. * **Note:** Unlike `_.at`, this method mutates `array`.
  8371. *
  8372. * @static
  8373. * @memberOf _
  8374. * @since 3.0.0
  8375. * @category Array
  8376. * @param {Array} array The array to modify.
  8377. * @param {...(number|number[])} [indexes] The indexes of elements to remove.
  8378. * @returns {Array} Returns the new array of removed elements.
  8379. * @example
  8380. *
  8381. * var array = ['a', 'b', 'c', 'd'];
  8382. * var pulled = _.pullAt(array, [1, 3]);
  8383. *
  8384. * console.log(array);
  8385. * // => ['a', 'c']
  8386. *
  8387. * console.log(pulled);
  8388. * // => ['b', 'd']
  8389. */
  8390. var pullAt = flatRest(function(array, indexes) {
  8391. var length = array == null ? 0 : array.length,
  8392. result = baseAt(array, indexes);
  8393. basePullAt(array, arrayMap(indexes, function(index) {
  8394. return isIndex(index, length) ? +index : index;
  8395. }).sort(compareAscending));
  8396. return result;
  8397. });
  8398. /**
  8399. * Removes all elements from `array` that `predicate` returns truthy for
  8400. * and returns an array of the removed elements. The predicate is invoked
  8401. * with three arguments: (value, index, array).
  8402. *
  8403. * **Note:** Unlike `_.filter`, this method mutates `array`. Use `_.pull`
  8404. * to pull elements from an array by value.
  8405. *
  8406. * @static
  8407. * @memberOf _
  8408. * @since 2.0.0
  8409. * @category Array
  8410. * @param {Array} array The array to modify.
  8411. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  8412. * @returns {Array} Returns the new array of removed elements.
  8413. * @example
  8414. *
  8415. * var array = [1, 2, 3, 4];
  8416. * var evens = _.remove(array, function(n) {
  8417. * return n % 2 == 0;
  8418. * });
  8419. *
  8420. * console.log(array);
  8421. * // => [1, 3]
  8422. *
  8423. * console.log(evens);
  8424. * // => [2, 4]
  8425. */
  8426. function remove(array, predicate) {
  8427. var result = [];
  8428. if (!(array && array.length)) {
  8429. return result;
  8430. }
  8431. var index = -1,
  8432. indexes = [],
  8433. length = array.length;
  8434. predicate = getIteratee(predicate, 3);
  8435. while (++index < length) {
  8436. var value = array[index];
  8437. if (predicate(value, index, array)) {
  8438. result.push(value);
  8439. indexes.push(index);
  8440. }
  8441. }
  8442. basePullAt(array, indexes);
  8443. return result;
  8444. }
  8445. /**
  8446. * Reverses `array` so that the first element becomes the last, the second
  8447. * element becomes the second to last, and so on.
  8448. *
  8449. * **Note:** This method mutates `array` and is based on
  8450. * [`Array#reverse`](https://mdn.io/Array/reverse).
  8451. *
  8452. * @static
  8453. * @memberOf _
  8454. * @since 4.0.0
  8455. * @category Array
  8456. * @param {Array} array The array to modify.
  8457. * @returns {Array} Returns `array`.
  8458. * @example
  8459. *
  8460. * var array = [1, 2, 3];
  8461. *
  8462. * _.reverse(array);
  8463. * // => [3, 2, 1]
  8464. *
  8465. * console.log(array);
  8466. * // => [3, 2, 1]
  8467. */
  8468. function reverse(array) {
  8469. return array == null ? array : nativeReverse.call(array);
  8470. }
  8471. /**
  8472. * Creates a slice of `array` from `start` up to, but not including, `end`.
  8473. *
  8474. * **Note:** This method is used instead of
  8475. * [`Array#slice`](https://mdn.io/Array/slice) to ensure dense arrays are
  8476. * returned.
  8477. *
  8478. * @static
  8479. * @memberOf _
  8480. * @since 3.0.0
  8481. * @category Array
  8482. * @param {Array} array The array to slice.
  8483. * @param {number} [start=0] The start position.
  8484. * @param {number} [end=array.length] The end position.
  8485. * @returns {Array} Returns the slice of `array`.
  8486. */
  8487. function slice(array, start, end) {
  8488. var length = array == null ? 0 : array.length;
  8489. if (!length) {
  8490. return [];
  8491. }
  8492. if (end && typeof end != 'number' && isIterateeCall(array, start, end)) {
  8493. start = 0;
  8494. end = length;
  8495. }
  8496. else {
  8497. start = start == null ? 0 : toInteger(start);
  8498. end = end === undefined ? length : toInteger(end);
  8499. }
  8500. return baseSlice(array, start, end);
  8501. }
  8502. /**
  8503. * Uses a binary search to determine the lowest index at which `value`
  8504. * should be inserted into `array` in order to maintain its sort order.
  8505. *
  8506. * @static
  8507. * @memberOf _
  8508. * @since 0.1.0
  8509. * @category Array
  8510. * @param {Array} array The sorted array to inspect.
  8511. * @param {*} value The value to evaluate.
  8512. * @returns {number} Returns the index at which `value` should be inserted
  8513. * into `array`.
  8514. * @example
  8515. *
  8516. * _.sortedIndex([30, 50], 40);
  8517. * // => 1
  8518. */
  8519. function sortedIndex(array, value) {
  8520. return baseSortedIndex(array, value);
  8521. }
  8522. /**
  8523. * This method is like `_.sortedIndex` except that it accepts `iteratee`
  8524. * which is invoked for `value` and each element of `array` to compute their
  8525. * sort ranking. The iteratee is invoked with one argument: (value).
  8526. *
  8527. * @static
  8528. * @memberOf _
  8529. * @since 4.0.0
  8530. * @category Array
  8531. * @param {Array} array The sorted array to inspect.
  8532. * @param {*} value The value to evaluate.
  8533. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  8534. * @returns {number} Returns the index at which `value` should be inserted
  8535. * into `array`.
  8536. * @example
  8537. *
  8538. * var objects = [{ 'x': 4 }, { 'x': 5 }];
  8539. *
  8540. * _.sortedIndexBy(objects, { 'x': 4 }, function(o) { return o.x; });
  8541. * // => 0
  8542. *
  8543. * // The `_.property` iteratee shorthand.
  8544. * _.sortedIndexBy(objects, { 'x': 4 }, 'x');
  8545. * // => 0
  8546. */
  8547. function sortedIndexBy(array, value, iteratee) {
  8548. return baseSortedIndexBy(array, value, getIteratee(iteratee, 2));
  8549. }
  8550. /**
  8551. * This method is like `_.indexOf` except that it performs a binary
  8552. * search on a sorted `array`.
  8553. *
  8554. * @static
  8555. * @memberOf _
  8556. * @since 4.0.0
  8557. * @category Array
  8558. * @param {Array} array The array to inspect.
  8559. * @param {*} value The value to search for.
  8560. * @returns {number} Returns the index of the matched value, else `-1`.
  8561. * @example
  8562. *
  8563. * _.sortedIndexOf([4, 5, 5, 5, 6], 5);
  8564. * // => 1
  8565. */
  8566. function sortedIndexOf(array, value) {
  8567. var length = array == null ? 0 : array.length;
  8568. if (length) {
  8569. var index = baseSortedIndex(array, value);
  8570. if (index < length && eq(array[index], value)) {
  8571. return index;
  8572. }
  8573. }
  8574. return -1;
  8575. }
  8576. /**
  8577. * This method is like `_.sortedIndex` except that it returns the highest
  8578. * index at which `value` should be inserted into `array` in order to
  8579. * maintain its sort order.
  8580. *
  8581. * @static
  8582. * @memberOf _
  8583. * @since 3.0.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. * _.sortedLastIndex([4, 5, 5, 5, 6], 5);
  8592. * // => 4
  8593. */
  8594. function sortedLastIndex(array, value) {
  8595. return baseSortedIndex(array, value, true);
  8596. }
  8597. /**
  8598. * This method is like `_.sortedLastIndex` 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. * _.sortedLastIndexBy(objects, { 'x': 4 }, function(o) { return o.x; });
  8616. * // => 1
  8617. *
  8618. * // The `_.property` iteratee shorthand.
  8619. * _.sortedLastIndexBy(objects, { 'x': 4 }, 'x');
  8620. * // => 1
  8621. */
  8622. function sortedLastIndexBy(array, value, iteratee) {
  8623. return baseSortedIndexBy(array, value, getIteratee(iteratee, 2), true);
  8624. }
  8625. /**
  8626. * This method is like `_.lastIndexOf` 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. * _.sortedLastIndexOf([4, 5, 5, 5, 6], 5);
  8639. * // => 3
  8640. */
  8641. function sortedLastIndexOf(array, value) {
  8642. var length = array == null ? 0 : array.length;
  8643. if (length) {
  8644. var index = baseSortedIndex(array, value, true) - 1;
  8645. if (eq(array[index], value)) {
  8646. return index;
  8647. }
  8648. }
  8649. return -1;
  8650. }
  8651. /**
  8652. * This method is like `_.uniq` except that it's designed and optimized
  8653. * for sorted arrays.
  8654. *
  8655. * @static
  8656. * @memberOf _
  8657. * @since 4.0.0
  8658. * @category Array
  8659. * @param {Array} array The array to inspect.
  8660. * @returns {Array} Returns the new duplicate free array.
  8661. * @example
  8662. *
  8663. * _.sortedUniq([1, 1, 2]);
  8664. * // => [1, 2]
  8665. */
  8666. function sortedUniq(array) {
  8667. return (array && array.length)
  8668. ? baseSortedUniq(array)
  8669. : [];
  8670. }
  8671. /**
  8672. * This method is like `_.uniqBy` except that it's designed and optimized
  8673. * for sorted arrays.
  8674. *
  8675. * @static
  8676. * @memberOf _
  8677. * @since 4.0.0
  8678. * @category Array
  8679. * @param {Array} array The array to inspect.
  8680. * @param {Function} [iteratee] The iteratee invoked per element.
  8681. * @returns {Array} Returns the new duplicate free array.
  8682. * @example
  8683. *
  8684. * _.sortedUniqBy([1.1, 1.2, 2.3, 2.4], Math.floor);
  8685. * // => [1.1, 2.3]
  8686. */
  8687. function sortedUniqBy(array, iteratee) {
  8688. return (array && array.length)
  8689. ? baseSortedUniq(array, getIteratee(iteratee, 2))
  8690. : [];
  8691. }
  8692. /**
  8693. * Gets all but the first element of `array`.
  8694. *
  8695. * @static
  8696. * @memberOf _
  8697. * @since 4.0.0
  8698. * @category Array
  8699. * @param {Array} array The array to query.
  8700. * @returns {Array} Returns the slice of `array`.
  8701. * @example
  8702. *
  8703. * _.tail([1, 2, 3]);
  8704. * // => [2, 3]
  8705. */
  8706. function tail(array) {
  8707. var length = array == null ? 0 : array.length;
  8708. return length ? baseSlice(array, 1, length) : [];
  8709. }
  8710. /**
  8711. * Creates a slice of `array` with `n` elements taken from the beginning.
  8712. *
  8713. * @static
  8714. * @memberOf _
  8715. * @since 0.1.0
  8716. * @category Array
  8717. * @param {Array} array The array to query.
  8718. * @param {number} [n=1] The number of elements to take.
  8719. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  8720. * @returns {Array} Returns the slice of `array`.
  8721. * @example
  8722. *
  8723. * _.take([1, 2, 3]);
  8724. * // => [1]
  8725. *
  8726. * _.take([1, 2, 3], 2);
  8727. * // => [1, 2]
  8728. *
  8729. * _.take([1, 2, 3], 5);
  8730. * // => [1, 2, 3]
  8731. *
  8732. * _.take([1, 2, 3], 0);
  8733. * // => []
  8734. */
  8735. function take(array, n, guard) {
  8736. if (!(array && array.length)) {
  8737. return [];
  8738. }
  8739. n = (guard || n === undefined) ? 1 : toInteger(n);
  8740. return baseSlice(array, 0, n < 0 ? 0 : n);
  8741. }
  8742. /**
  8743. * Creates a slice of `array` with `n` elements taken from the end.
  8744. *
  8745. * @static
  8746. * @memberOf _
  8747. * @since 3.0.0
  8748. * @category Array
  8749. * @param {Array} array The array to query.
  8750. * @param {number} [n=1] The number of elements to take.
  8751. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  8752. * @returns {Array} Returns the slice of `array`.
  8753. * @example
  8754. *
  8755. * _.takeRight([1, 2, 3]);
  8756. * // => [3]
  8757. *
  8758. * _.takeRight([1, 2, 3], 2);
  8759. * // => [2, 3]
  8760. *
  8761. * _.takeRight([1, 2, 3], 5);
  8762. * // => [1, 2, 3]
  8763. *
  8764. * _.takeRight([1, 2, 3], 0);
  8765. * // => []
  8766. */
  8767. function takeRight(array, n, guard) {
  8768. var length = array == null ? 0 : array.length;
  8769. if (!length) {
  8770. return [];
  8771. }
  8772. n = (guard || n === undefined) ? 1 : toInteger(n);
  8773. n = length - n;
  8774. return baseSlice(array, n < 0 ? 0 : n, length);
  8775. }
  8776. /**
  8777. * Creates a slice of `array` with elements taken from the end. Elements are
  8778. * taken until `predicate` returns falsey. The predicate is invoked with
  8779. * three arguments: (value, index, array).
  8780. *
  8781. * @static
  8782. * @memberOf _
  8783. * @since 3.0.0
  8784. * @category Array
  8785. * @param {Array} array The array to query.
  8786. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  8787. * @returns {Array} Returns the slice of `array`.
  8788. * @example
  8789. *
  8790. * var users = [
  8791. * { 'user': 'barney', 'active': true },
  8792. * { 'user': 'fred', 'active': false },
  8793. * { 'user': 'pebbles', 'active': false }
  8794. * ];
  8795. *
  8796. * _.takeRightWhile(users, function(o) { return !o.active; });
  8797. * // => objects for ['fred', 'pebbles']
  8798. *
  8799. * // The `_.matches` iteratee shorthand.
  8800. * _.takeRightWhile(users, { 'user': 'pebbles', 'active': false });
  8801. * // => objects for ['pebbles']
  8802. *
  8803. * // The `_.matchesProperty` iteratee shorthand.
  8804. * _.takeRightWhile(users, ['active', false]);
  8805. * // => objects for ['fred', 'pebbles']
  8806. *
  8807. * // The `_.property` iteratee shorthand.
  8808. * _.takeRightWhile(users, 'active');
  8809. * // => []
  8810. */
  8811. function takeRightWhile(array, predicate) {
  8812. return (array && array.length)
  8813. ? baseWhile(array, getIteratee(predicate, 3), false, true)
  8814. : [];
  8815. }
  8816. /**
  8817. * Creates a slice of `array` with elements taken from the beginning. Elements
  8818. * are taken until `predicate` returns falsey. The predicate is invoked with
  8819. * three arguments: (value, index, array).
  8820. *
  8821. * @static
  8822. * @memberOf _
  8823. * @since 3.0.0
  8824. * @category Array
  8825. * @param {Array} array The array to query.
  8826. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  8827. * @returns {Array} Returns the slice of `array`.
  8828. * @example
  8829. *
  8830. * var users = [
  8831. * { 'user': 'barney', 'active': false },
  8832. * { 'user': 'fred', 'active': false },
  8833. * { 'user': 'pebbles', 'active': true }
  8834. * ];
  8835. *
  8836. * _.takeWhile(users, function(o) { return !o.active; });
  8837. * // => objects for ['barney', 'fred']
  8838. *
  8839. * // The `_.matches` iteratee shorthand.
  8840. * _.takeWhile(users, { 'user': 'barney', 'active': false });
  8841. * // => objects for ['barney']
  8842. *
  8843. * // The `_.matchesProperty` iteratee shorthand.
  8844. * _.takeWhile(users, ['active', false]);
  8845. * // => objects for ['barney', 'fred']
  8846. *
  8847. * // The `_.property` iteratee shorthand.
  8848. * _.takeWhile(users, 'active');
  8849. * // => []
  8850. */
  8851. function takeWhile(array, predicate) {
  8852. return (array && array.length)
  8853. ? baseWhile(array, getIteratee(predicate, 3))
  8854. : [];
  8855. }
  8856. /**
  8857. * Creates an array of unique values, in order, from all given arrays using
  8858. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  8859. * for equality comparisons.
  8860. *
  8861. * @static
  8862. * @memberOf _
  8863. * @since 0.1.0
  8864. * @category Array
  8865. * @param {...Array} [arrays] The arrays to inspect.
  8866. * @returns {Array} Returns the new array of combined values.
  8867. * @example
  8868. *
  8869. * _.union([2], [1, 2]);
  8870. * // => [2, 1]
  8871. */
  8872. var union = baseRest(function(arrays) {
  8873. return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true));
  8874. });
  8875. /**
  8876. * This method is like `_.union` except that it accepts `iteratee` which is
  8877. * invoked for each element of each `arrays` to generate the criterion by
  8878. * which uniqueness is computed. Result values are chosen from the first
  8879. * array in which the value occurs. The iteratee is invoked with one argument:
  8880. * (value).
  8881. *
  8882. * @static
  8883. * @memberOf _
  8884. * @since 4.0.0
  8885. * @category Array
  8886. * @param {...Array} [arrays] The arrays to inspect.
  8887. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  8888. * @returns {Array} Returns the new array of combined values.
  8889. * @example
  8890. *
  8891. * _.unionBy([2.1], [1.2, 2.3], Math.floor);
  8892. * // => [2.1, 1.2]
  8893. *
  8894. * // The `_.property` iteratee shorthand.
  8895. * _.unionBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x');
  8896. * // => [{ 'x': 1 }, { 'x': 2 }]
  8897. */
  8898. var unionBy = baseRest(function(arrays) {
  8899. var iteratee = last(arrays);
  8900. if (isArrayLikeObject(iteratee)) {
  8901. iteratee = undefined;
  8902. }
  8903. return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true), getIteratee(iteratee, 2));
  8904. });
  8905. /**
  8906. * This method is like `_.union` except that it accepts `comparator` which
  8907. * is invoked to compare elements of `arrays`. Result values are chosen from
  8908. * the first array in which the value occurs. The comparator is invoked
  8909. * with two arguments: (arrVal, othVal).
  8910. *
  8911. * @static
  8912. * @memberOf _
  8913. * @since 4.0.0
  8914. * @category Array
  8915. * @param {...Array} [arrays] The arrays to inspect.
  8916. * @param {Function} [comparator] The comparator invoked per element.
  8917. * @returns {Array} Returns the new array of combined values.
  8918. * @example
  8919. *
  8920. * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }];
  8921. * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }];
  8922. *
  8923. * _.unionWith(objects, others, _.isEqual);
  8924. * // => [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }, { 'x': 1, 'y': 1 }]
  8925. */
  8926. var unionWith = baseRest(function(arrays) {
  8927. var comparator = last(arrays);
  8928. comparator = typeof comparator == 'function' ? comparator : undefined;
  8929. return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true), undefined, comparator);
  8930. });
  8931. /**
  8932. * Creates a duplicate-free version of an array, using
  8933. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  8934. * for equality comparisons, in which only the first occurrence of each element
  8935. * is kept. The order of result values is determined by the order they occur
  8936. * in the array.
  8937. *
  8938. * @static
  8939. * @memberOf _
  8940. * @since 0.1.0
  8941. * @category Array
  8942. * @param {Array} array The array to inspect.
  8943. * @returns {Array} Returns the new duplicate free array.
  8944. * @example
  8945. *
  8946. * _.uniq([2, 1, 2]);
  8947. * // => [2, 1]
  8948. */
  8949. function uniq(array) {
  8950. return (array && array.length) ? baseUniq(array) : [];
  8951. }
  8952. /**
  8953. * This method is like `_.uniq` except that it accepts `iteratee` which is
  8954. * invoked for each element in `array` to generate the criterion by which
  8955. * uniqueness is computed. The order of result values is determined by the
  8956. * order they occur in the array. The iteratee is invoked with one argument:
  8957. * (value).
  8958. *
  8959. * @static
  8960. * @memberOf _
  8961. * @since 4.0.0
  8962. * @category Array
  8963. * @param {Array} array The array to inspect.
  8964. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  8965. * @returns {Array} Returns the new duplicate free array.
  8966. * @example
  8967. *
  8968. * _.uniqBy([2.1, 1.2, 2.3], Math.floor);
  8969. * // => [2.1, 1.2]
  8970. *
  8971. * // The `_.property` iteratee shorthand.
  8972. * _.uniqBy([{ 'x': 1 }, { 'x': 2 }, { 'x': 1 }], 'x');
  8973. * // => [{ 'x': 1 }, { 'x': 2 }]
  8974. */
  8975. function uniqBy(array, iteratee) {
  8976. return (array && array.length) ? baseUniq(array, getIteratee(iteratee, 2)) : [];
  8977. }
  8978. /**
  8979. * This method is like `_.uniq` except that it accepts `comparator` which
  8980. * is invoked to compare elements of `array`. The order of result values is
  8981. * determined by the order they occur in the array.The comparator is invoked
  8982. * with two arguments: (arrVal, othVal).
  8983. *
  8984. * @static
  8985. * @memberOf _
  8986. * @since 4.0.0
  8987. * @category Array
  8988. * @param {Array} array The array to inspect.
  8989. * @param {Function} [comparator] The comparator invoked per element.
  8990. * @returns {Array} Returns the new duplicate free array.
  8991. * @example
  8992. *
  8993. * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }, { 'x': 1, 'y': 2 }];
  8994. *
  8995. * _.uniqWith(objects, _.isEqual);
  8996. * // => [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }]
  8997. */
  8998. function uniqWith(array, comparator) {
  8999. comparator = typeof comparator == 'function' ? comparator : undefined;
  9000. return (array && array.length) ? baseUniq(array, undefined, comparator) : [];
  9001. }
  9002. /**
  9003. * This method is like `_.zip` except that it accepts an array of grouped
  9004. * elements and creates an array regrouping the elements to their pre-zip
  9005. * configuration.
  9006. *
  9007. * @static
  9008. * @memberOf _
  9009. * @since 1.2.0
  9010. * @category Array
  9011. * @param {Array} array The array of grouped elements to process.
  9012. * @returns {Array} Returns the new array of regrouped elements.
  9013. * @example
  9014. *
  9015. * var zipped = _.zip(['a', 'b'], [1, 2], [true, false]);
  9016. * // => [['a', 1, true], ['b', 2, false]]
  9017. *
  9018. * _.unzip(zipped);
  9019. * // => [['a', 'b'], [1, 2], [true, false]]
  9020. */
  9021. function unzip(array) {
  9022. if (!(array && array.length)) {
  9023. return [];
  9024. }
  9025. var length = 0;
  9026. array = arrayFilter(array, function(group) {
  9027. if (isArrayLikeObject(group)) {
  9028. length = nativeMax(group.length, length);
  9029. return true;
  9030. }
  9031. });
  9032. return baseTimes(length, function(index) {
  9033. return arrayMap(array, baseProperty(index));
  9034. });
  9035. }
  9036. /**
  9037. * This method is like `_.unzip` except that it accepts `iteratee` to specify
  9038. * how regrouped values should be combined. The iteratee is invoked with the
  9039. * elements of each group: (...group).
  9040. *
  9041. * @static
  9042. * @memberOf _
  9043. * @since 3.8.0
  9044. * @category Array
  9045. * @param {Array} array The array of grouped elements to process.
  9046. * @param {Function} [iteratee=_.identity] The function to combine
  9047. * regrouped values.
  9048. * @returns {Array} Returns the new array of regrouped elements.
  9049. * @example
  9050. *
  9051. * var zipped = _.zip([1, 2], [10, 20], [100, 200]);
  9052. * // => [[1, 10, 100], [2, 20, 200]]
  9053. *
  9054. * _.unzipWith(zipped, _.add);
  9055. * // => [3, 30, 300]
  9056. */
  9057. function unzipWith(array, iteratee) {
  9058. if (!(array && array.length)) {
  9059. return [];
  9060. }
  9061. var result = unzip(array);
  9062. if (iteratee == null) {
  9063. return result;
  9064. }
  9065. return arrayMap(result, function(group) {
  9066. return apply(iteratee, undefined, group);
  9067. });
  9068. }
  9069. /**
  9070. * Creates an array excluding all given values using
  9071. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  9072. * for equality comparisons.
  9073. *
  9074. * **Note:** Unlike `_.pull`, this method returns a new array.
  9075. *
  9076. * @static
  9077. * @memberOf _
  9078. * @since 0.1.0
  9079. * @category Array
  9080. * @param {Array} array The array to inspect.
  9081. * @param {...*} [values] The values to exclude.
  9082. * @returns {Array} Returns the new array of filtered values.
  9083. * @see _.difference, _.xor
  9084. * @example
  9085. *
  9086. * _.without([2, 1, 2, 3], 1, 2);
  9087. * // => [3]
  9088. */
  9089. var without = baseRest(function(array, values) {
  9090. return isArrayLikeObject(array)
  9091. ? baseDifference(array, values)
  9092. : [];
  9093. });
  9094. /**
  9095. * Creates an array of unique values that is the
  9096. * [symmetric difference](https://en.wikipedia.org/wiki/Symmetric_difference)
  9097. * of the given arrays. The order of result values is determined by the order
  9098. * they occur in the arrays.
  9099. *
  9100. * @static
  9101. * @memberOf _
  9102. * @since 2.4.0
  9103. * @category Array
  9104. * @param {...Array} [arrays] The arrays to inspect.
  9105. * @returns {Array} Returns the new array of filtered values.
  9106. * @see _.difference, _.without
  9107. * @example
  9108. *
  9109. * _.xor([2, 1], [2, 3]);
  9110. * // => [1, 3]
  9111. */
  9112. var xor = baseRest(function(arrays) {
  9113. return baseXor(arrayFilter(arrays, isArrayLikeObject));
  9114. });
  9115. /**
  9116. * This method is like `_.xor` except that it accepts `iteratee` which is
  9117. * invoked for each element of each `arrays` to generate the criterion by
  9118. * which by which they're compared. The order of result values is determined
  9119. * by the order they occur in the arrays. The iteratee is invoked with one
  9120. * argument: (value).
  9121. *
  9122. * @static
  9123. * @memberOf _
  9124. * @since 4.0.0
  9125. * @category Array
  9126. * @param {...Array} [arrays] The arrays to inspect.
  9127. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  9128. * @returns {Array} Returns the new array of filtered values.
  9129. * @example
  9130. *
  9131. * _.xorBy([2.1, 1.2], [2.3, 3.4], Math.floor);
  9132. * // => [1.2, 3.4]
  9133. *
  9134. * // The `_.property` iteratee shorthand.
  9135. * _.xorBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x');
  9136. * // => [{ 'x': 2 }]
  9137. */
  9138. var xorBy = baseRest(function(arrays) {
  9139. var iteratee = last(arrays);
  9140. if (isArrayLikeObject(iteratee)) {
  9141. iteratee = undefined;
  9142. }
  9143. return baseXor(arrayFilter(arrays, isArrayLikeObject), getIteratee(iteratee, 2));
  9144. });
  9145. /**
  9146. * This method is like `_.xor` except that it accepts `comparator` which is
  9147. * invoked to compare elements of `arrays`. The order of result values is
  9148. * determined by the order they occur in the arrays. The comparator is invoked
  9149. * with two arguments: (arrVal, othVal).
  9150. *
  9151. * @static
  9152. * @memberOf _
  9153. * @since 4.0.0
  9154. * @category Array
  9155. * @param {...Array} [arrays] The arrays to inspect.
  9156. * @param {Function} [comparator] The comparator invoked per element.
  9157. * @returns {Array} Returns the new array of filtered values.
  9158. * @example
  9159. *
  9160. * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }];
  9161. * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }];
  9162. *
  9163. * _.xorWith(objects, others, _.isEqual);
  9164. * // => [{ 'x': 2, 'y': 1 }, { 'x': 1, 'y': 1 }]
  9165. */
  9166. var xorWith = baseRest(function(arrays) {
  9167. var comparator = last(arrays);
  9168. comparator = typeof comparator == 'function' ? comparator : undefined;
  9169. return baseXor(arrayFilter(arrays, isArrayLikeObject), undefined, comparator);
  9170. });
  9171. /**
  9172. * Creates an array of grouped elements, the first of which contains the
  9173. * first elements of the given arrays, the second of which contains the
  9174. * second elements of the given arrays, and so on.
  9175. *
  9176. * @static
  9177. * @memberOf _
  9178. * @since 0.1.0
  9179. * @category Array
  9180. * @param {...Array} [arrays] The arrays to process.
  9181. * @returns {Array} Returns the new array of grouped elements.
  9182. * @example
  9183. *
  9184. * _.zip(['a', 'b'], [1, 2], [true, false]);
  9185. * // => [['a', 1, true], ['b', 2, false]]
  9186. */
  9187. var zip = baseRest(unzip);
  9188. /**
  9189. * This method is like `_.fromPairs` except that it accepts two arrays,
  9190. * one of property identifiers and one of corresponding values.
  9191. *
  9192. * @static
  9193. * @memberOf _
  9194. * @since 0.4.0
  9195. * @category Array
  9196. * @param {Array} [props=[]] The property identifiers.
  9197. * @param {Array} [values=[]] The property values.
  9198. * @returns {Object} Returns the new object.
  9199. * @example
  9200. *
  9201. * _.zipObject(['a', 'b'], [1, 2]);
  9202. * // => { 'a': 1, 'b': 2 }
  9203. */
  9204. function zipObject(props, values) {
  9205. return baseZipObject(props || [], values || [], assignValue);
  9206. }
  9207. /**
  9208. * This method is like `_.zipObject` except that it supports property paths.
  9209. *
  9210. * @static
  9211. * @memberOf _
  9212. * @since 4.1.0
  9213. * @category Array
  9214. * @param {Array} [props=[]] The property identifiers.
  9215. * @param {Array} [values=[]] The property values.
  9216. * @returns {Object} Returns the new object.
  9217. * @example
  9218. *
  9219. * _.zipObjectDeep(['a.b[0].c', 'a.b[1].d'], [1, 2]);
  9220. * // => { 'a': { 'b': [{ 'c': 1 }, { 'd': 2 }] } }
  9221. */
  9222. function zipObjectDeep(props, values) {
  9223. return baseZipObject(props || [], values || [], baseSet);
  9224. }
  9225. /**
  9226. * This method is like `_.zip` except that it accepts `iteratee` to specify
  9227. * how grouped values should be combined. The iteratee is invoked with the
  9228. * elements of each group: (...group).
  9229. *
  9230. * @static
  9231. * @memberOf _
  9232. * @since 3.8.0
  9233. * @category Array
  9234. * @param {...Array} [arrays] The arrays to process.
  9235. * @param {Function} [iteratee=_.identity] The function to combine
  9236. * grouped values.
  9237. * @returns {Array} Returns the new array of grouped elements.
  9238. * @example
  9239. *
  9240. * _.zipWith([1, 2], [10, 20], [100, 200], function(a, b, c) {
  9241. * return a + b + c;
  9242. * });
  9243. * // => [111, 222]
  9244. */
  9245. var zipWith = baseRest(function(arrays) {
  9246. var length = arrays.length,
  9247. iteratee = length > 1 ? arrays[length - 1] : undefined;
  9248. iteratee = typeof iteratee == 'function' ? (arrays.pop(), iteratee) : undefined;
  9249. return unzipWith(arrays, iteratee);
  9250. });
  9251. /*------------------------------------------------------------------------*/
  9252. /**
  9253. * Creates a `lodash` wrapper instance that wraps `value` with explicit method
  9254. * chain sequences enabled. The result of such sequences must be unwrapped
  9255. * with `_#value`.
  9256. *
  9257. * @static
  9258. * @memberOf _
  9259. * @since 1.3.0
  9260. * @category Seq
  9261. * @param {*} value The value to wrap.
  9262. * @returns {Object} Returns the new `lodash` wrapper instance.
  9263. * @example
  9264. *
  9265. * var users = [
  9266. * { 'user': 'barney', 'age': 36 },
  9267. * { 'user': 'fred', 'age': 40 },
  9268. * { 'user': 'pebbles', 'age': 1 }
  9269. * ];
  9270. *
  9271. * var youngest = _
  9272. * .chain(users)
  9273. * .sortBy('age')
  9274. * .map(function(o) {
  9275. * return o.user + ' is ' + o.age;
  9276. * })
  9277. * .head()
  9278. * .value();
  9279. * // => 'pebbles is 1'
  9280. */
  9281. function chain(value) {
  9282. var result = lodash(value);
  9283. result.__chain__ = true;
  9284. return result;
  9285. }
  9286. /**
  9287. * This method invokes `interceptor` and returns `value`. The interceptor
  9288. * is invoked with one argument; (value). The purpose of this method is to
  9289. * "tap into" a method chain sequence in order to modify intermediate results.
  9290. *
  9291. * @static
  9292. * @memberOf _
  9293. * @since 0.1.0
  9294. * @category Seq
  9295. * @param {*} value The value to provide to `interceptor`.
  9296. * @param {Function} interceptor The function to invoke.
  9297. * @returns {*} Returns `value`.
  9298. * @example
  9299. *
  9300. * _([1, 2, 3])
  9301. * .tap(function(array) {
  9302. * // Mutate input array.
  9303. * array.pop();
  9304. * })
  9305. * .reverse()
  9306. * .value();
  9307. * // => [2, 1]
  9308. */
  9309. function tap(value, interceptor) {
  9310. interceptor(value);
  9311. return value;
  9312. }
  9313. /**
  9314. * This method is like `_.tap` except that it returns the result of `interceptor`.
  9315. * The purpose of this method is to "pass thru" values replacing intermediate
  9316. * results in a method chain sequence.
  9317. *
  9318. * @static
  9319. * @memberOf _
  9320. * @since 3.0.0
  9321. * @category Seq
  9322. * @param {*} value The value to provide to `interceptor`.
  9323. * @param {Function} interceptor The function to invoke.
  9324. * @returns {*} Returns the result of `interceptor`.
  9325. * @example
  9326. *
  9327. * _(' abc ')
  9328. * .chain()
  9329. * .trim()
  9330. * .thru(function(value) {
  9331. * return [value];
  9332. * })
  9333. * .value();
  9334. * // => ['abc']
  9335. */
  9336. function thru(value, interceptor) {
  9337. return interceptor(value);
  9338. }
  9339. /**
  9340. * This method is the wrapper version of `_.at`.
  9341. *
  9342. * @name at
  9343. * @memberOf _
  9344. * @since 1.0.0
  9345. * @category Seq
  9346. * @param {...(string|string[])} [paths] The property paths to pick.
  9347. * @returns {Object} Returns the new `lodash` wrapper instance.
  9348. * @example
  9349. *
  9350. * var object = { 'a': [{ 'b': { 'c': 3 } }, 4] };
  9351. *
  9352. * _(object).at(['a[0].b.c', 'a[1]']).value();
  9353. * // => [3, 4]
  9354. */
  9355. var wrapperAt = flatRest(function(paths) {
  9356. var length = paths.length,
  9357. start = length ? paths[0] : 0,
  9358. value = this.__wrapped__,
  9359. interceptor = function(object) { return baseAt(object, paths); };
  9360. if (length > 1 || this.__actions__.length ||
  9361. !(value instanceof LazyWrapper) || !isIndex(start)) {
  9362. return this.thru(interceptor);
  9363. }
  9364. value = value.slice(start, +start + (length ? 1 : 0));
  9365. value.__actions__.push({
  9366. 'func': thru,
  9367. 'args': [interceptor],
  9368. 'thisArg': undefined
  9369. });
  9370. return new LodashWrapper(value, this.__chain__).thru(function(array) {
  9371. if (length && !array.length) {
  9372. array.push(undefined);
  9373. }
  9374. return array;
  9375. });
  9376. });
  9377. /**
  9378. * Creates a `lodash` wrapper instance with explicit method chain sequences enabled.
  9379. *
  9380. * @name chain
  9381. * @memberOf _
  9382. * @since 0.1.0
  9383. * @category Seq
  9384. * @returns {Object} Returns the new `lodash` wrapper instance.
  9385. * @example
  9386. *
  9387. * var users = [
  9388. * { 'user': 'barney', 'age': 36 },
  9389. * { 'user': 'fred', 'age': 40 }
  9390. * ];
  9391. *
  9392. * // A sequence without explicit chaining.
  9393. * _(users).head();
  9394. * // => { 'user': 'barney', 'age': 36 }
  9395. *
  9396. * // A sequence with explicit chaining.
  9397. * _(users)
  9398. * .chain()
  9399. * .head()
  9400. * .pick('user')
  9401. * .value();
  9402. * // => { 'user': 'barney' }
  9403. */
  9404. function wrapperChain() {
  9405. return chain(this);
  9406. }
  9407. /**
  9408. * Executes the chain sequence and returns the wrapped result.
  9409. *
  9410. * @name commit
  9411. * @memberOf _
  9412. * @since 3.2.0
  9413. * @category Seq
  9414. * @returns {Object} Returns the new `lodash` wrapper instance.
  9415. * @example
  9416. *
  9417. * var array = [1, 2];
  9418. * var wrapped = _(array).push(3);
  9419. *
  9420. * console.log(array);
  9421. * // => [1, 2]
  9422. *
  9423. * wrapped = wrapped.commit();
  9424. * console.log(array);
  9425. * // => [1, 2, 3]
  9426. *
  9427. * wrapped.last();
  9428. * // => 3
  9429. *
  9430. * console.log(array);
  9431. * // => [1, 2, 3]
  9432. */
  9433. function wrapperCommit() {
  9434. return new LodashWrapper(this.value(), this.__chain__);
  9435. }
  9436. /**
  9437. * Gets the next value on a wrapped object following the
  9438. * [iterator protocol](https://mdn.io/iteration_protocols#iterator).
  9439. *
  9440. * @name next
  9441. * @memberOf _
  9442. * @since 4.0.0
  9443. * @category Seq
  9444. * @returns {Object} Returns the next iterator value.
  9445. * @example
  9446. *
  9447. * var wrapped = _([1, 2]);
  9448. *
  9449. * wrapped.next();
  9450. * // => { 'done': false, 'value': 1 }
  9451. *
  9452. * wrapped.next();
  9453. * // => { 'done': false, 'value': 2 }
  9454. *
  9455. * wrapped.next();
  9456. * // => { 'done': true, 'value': undefined }
  9457. */
  9458. function wrapperNext() {
  9459. if (this.__values__ === undefined) {
  9460. this.__values__ = toArray(this.value());
  9461. }
  9462. var done = this.__index__ >= this.__values__.length,
  9463. value = done ? undefined : this.__values__[this.__index__++];
  9464. return { 'done': done, 'value': value };
  9465. }
  9466. /**
  9467. * Enables the wrapper to be iterable.
  9468. *
  9469. * @name Symbol.iterator
  9470. * @memberOf _
  9471. * @since 4.0.0
  9472. * @category Seq
  9473. * @returns {Object} Returns the wrapper object.
  9474. * @example
  9475. *
  9476. * var wrapped = _([1, 2]);
  9477. *
  9478. * wrapped[Symbol.iterator]() === wrapped;
  9479. * // => true
  9480. *
  9481. * Array.from(wrapped);
  9482. * // => [1, 2]
  9483. */
  9484. function wrapperToIterator() {
  9485. return this;
  9486. }
  9487. /**
  9488. * Creates a clone of the chain sequence planting `value` as the wrapped value.
  9489. *
  9490. * @name plant
  9491. * @memberOf _
  9492. * @since 3.2.0
  9493. * @category Seq
  9494. * @param {*} value The value to plant.
  9495. * @returns {Object} Returns the new `lodash` wrapper instance.
  9496. * @example
  9497. *
  9498. * function square(n) {
  9499. * return n * n;
  9500. * }
  9501. *
  9502. * var wrapped = _([1, 2]).map(square);
  9503. * var other = wrapped.plant([3, 4]);
  9504. *
  9505. * other.value();
  9506. * // => [9, 16]
  9507. *
  9508. * wrapped.value();
  9509. * // => [1, 4]
  9510. */
  9511. function wrapperPlant(value) {
  9512. var result,
  9513. parent = this;
  9514. while (parent instanceof baseLodash) {
  9515. var clone = wrapperClone(parent);
  9516. clone.__index__ = 0;
  9517. clone.__values__ = undefined;
  9518. if (result) {
  9519. previous.__wrapped__ = clone;
  9520. } else {
  9521. result = clone;
  9522. }
  9523. var previous = clone;
  9524. parent = parent.__wrapped__;
  9525. }
  9526. previous.__wrapped__ = value;
  9527. return result;
  9528. }
  9529. /**
  9530. * This method is the wrapper version of `_.reverse`.
  9531. *
  9532. * **Note:** This method mutates the wrapped array.
  9533. *
  9534. * @name reverse
  9535. * @memberOf _
  9536. * @since 0.1.0
  9537. * @category Seq
  9538. * @returns {Object} Returns the new `lodash` wrapper instance.
  9539. * @example
  9540. *
  9541. * var array = [1, 2, 3];
  9542. *
  9543. * _(array).reverse().value()
  9544. * // => [3, 2, 1]
  9545. *
  9546. * console.log(array);
  9547. * // => [3, 2, 1]
  9548. */
  9549. function wrapperReverse() {
  9550. var value = this.__wrapped__;
  9551. if (value instanceof LazyWrapper) {
  9552. var wrapped = value;
  9553. if (this.__actions__.length) {
  9554. wrapped = new LazyWrapper(this);
  9555. }
  9556. wrapped = wrapped.reverse();
  9557. wrapped.__actions__.push({
  9558. 'func': thru,
  9559. 'args': [reverse],
  9560. 'thisArg': undefined
  9561. });
  9562. return new LodashWrapper(wrapped, this.__chain__);
  9563. }
  9564. return this.thru(reverse);
  9565. }
  9566. /**
  9567. * Executes the chain sequence to resolve the unwrapped value.
  9568. *
  9569. * @name value
  9570. * @memberOf _
  9571. * @since 0.1.0
  9572. * @alias toJSON, valueOf
  9573. * @category Seq
  9574. * @returns {*} Returns the resolved unwrapped value.
  9575. * @example
  9576. *
  9577. * _([1, 2, 3]).value();
  9578. * // => [1, 2, 3]
  9579. */
  9580. function wrapperValue() {
  9581. return baseWrapperValue(this.__wrapped__, this.__actions__);
  9582. }
  9583. /*------------------------------------------------------------------------*/
  9584. /**
  9585. * Creates an object composed of keys generated from the results of running
  9586. * each element of `collection` thru `iteratee`. The corresponding value of
  9587. * each key is the number of times the key was returned by `iteratee`. The
  9588. * iteratee is invoked with one argument: (value).
  9589. *
  9590. * @static
  9591. * @memberOf _
  9592. * @since 0.5.0
  9593. * @category Collection
  9594. * @param {Array|Object} collection The collection to iterate over.
  9595. * @param {Function} [iteratee=_.identity] The iteratee to transform keys.
  9596. * @returns {Object} Returns the composed aggregate object.
  9597. * @example
  9598. *
  9599. * _.countBy([6.1, 4.2, 6.3], Math.floor);
  9600. * // => { '4': 1, '6': 2 }
  9601. *
  9602. * // The `_.property` iteratee shorthand.
  9603. * _.countBy(['one', 'two', 'three'], 'length');
  9604. * // => { '3': 2, '5': 1 }
  9605. */
  9606. var countBy = createAggregator(function(result, value, key) {
  9607. if (hasOwnProperty.call(result, key)) {
  9608. ++result[key];
  9609. } else {
  9610. baseAssignValue(result, key, 1);
  9611. }
  9612. });
  9613. /**
  9614. * Checks if `predicate` returns truthy for **all** elements of `collection`.
  9615. * Iteration is stopped once `predicate` returns falsey. The predicate is
  9616. * invoked with three arguments: (value, index|key, collection).
  9617. *
  9618. * **Note:** This method returns `true` for
  9619. * [empty collections](https://en.wikipedia.org/wiki/Empty_set) because
  9620. * [everything is true](https://en.wikipedia.org/wiki/Vacuous_truth) of
  9621. * elements of empty collections.
  9622. *
  9623. * @static
  9624. * @memberOf _
  9625. * @since 0.1.0
  9626. * @category Collection
  9627. * @param {Array|Object} collection The collection to iterate over.
  9628. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  9629. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  9630. * @returns {boolean} Returns `true` if all elements pass the predicate check,
  9631. * else `false`.
  9632. * @example
  9633. *
  9634. * _.every([true, 1, null, 'yes'], Boolean);
  9635. * // => false
  9636. *
  9637. * var users = [
  9638. * { 'user': 'barney', 'age': 36, 'active': false },
  9639. * { 'user': 'fred', 'age': 40, 'active': false }
  9640. * ];
  9641. *
  9642. * // The `_.matches` iteratee shorthand.
  9643. * _.every(users, { 'user': 'barney', 'active': false });
  9644. * // => false
  9645. *
  9646. * // The `_.matchesProperty` iteratee shorthand.
  9647. * _.every(users, ['active', false]);
  9648. * // => true
  9649. *
  9650. * // The `_.property` iteratee shorthand.
  9651. * _.every(users, 'active');
  9652. * // => false
  9653. */
  9654. function every(collection, predicate, guard) {
  9655. var func = isArray(collection) ? arrayEvery : baseEvery;
  9656. if (guard && isIterateeCall(collection, predicate, guard)) {
  9657. predicate = undefined;
  9658. }
  9659. return func(collection, getIteratee(predicate, 3));
  9660. }
  9661. /**
  9662. * Iterates over elements of `collection`, returning an array of all elements
  9663. * `predicate` returns truthy for. The predicate is invoked with three
  9664. * arguments: (value, index|key, collection).
  9665. *
  9666. * **Note:** Unlike `_.remove`, this method returns a new array.
  9667. *
  9668. * @static
  9669. * @memberOf _
  9670. * @since 0.1.0
  9671. * @category Collection
  9672. * @param {Array|Object} collection The collection to iterate over.
  9673. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  9674. * @returns {Array} Returns the new filtered array.
  9675. * @see _.reject
  9676. * @example
  9677. *
  9678. * var users = [
  9679. * { 'user': 'barney', 'age': 36, 'active': true },
  9680. * { 'user': 'fred', 'age': 40, 'active': false }
  9681. * ];
  9682. *
  9683. * _.filter(users, function(o) { return !o.active; });
  9684. * // => objects for ['fred']
  9685. *
  9686. * // The `_.matches` iteratee shorthand.
  9687. * _.filter(users, { 'age': 36, 'active': true });
  9688. * // => objects for ['barney']
  9689. *
  9690. * // The `_.matchesProperty` iteratee shorthand.
  9691. * _.filter(users, ['active', false]);
  9692. * // => objects for ['fred']
  9693. *
  9694. * // The `_.property` iteratee shorthand.
  9695. * _.filter(users, 'active');
  9696. * // => objects for ['barney']
  9697. *
  9698. * // Combining several predicates using `_.overEvery` or `_.overSome`.
  9699. * _.filter(users, _.overSome([{ 'age': 36 }, ['age', 40]]));
  9700. * // => objects for ['fred', 'barney']
  9701. */
  9702. function filter(collection, predicate) {
  9703. var func = isArray(collection) ? arrayFilter : baseFilter;
  9704. return func(collection, getIteratee(predicate, 3));
  9705. }
  9706. /**
  9707. * Iterates over elements of `collection`, returning the first element
  9708. * `predicate` returns truthy for. The predicate is invoked with three
  9709. * arguments: (value, index|key, collection).
  9710. *
  9711. * @static
  9712. * @memberOf _
  9713. * @since 0.1.0
  9714. * @category Collection
  9715. * @param {Array|Object} collection The collection to inspect.
  9716. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  9717. * @param {number} [fromIndex=0] The index to search from.
  9718. * @returns {*} Returns the matched element, else `undefined`.
  9719. * @example
  9720. *
  9721. * var users = [
  9722. * { 'user': 'barney', 'age': 36, 'active': true },
  9723. * { 'user': 'fred', 'age': 40, 'active': false },
  9724. * { 'user': 'pebbles', 'age': 1, 'active': true }
  9725. * ];
  9726. *
  9727. * _.find(users, function(o) { return o.age < 40; });
  9728. * // => object for 'barney'
  9729. *
  9730. * // The `_.matches` iteratee shorthand.
  9731. * _.find(users, { 'age': 1, 'active': true });
  9732. * // => object for 'pebbles'
  9733. *
  9734. * // The `_.matchesProperty` iteratee shorthand.
  9735. * _.find(users, ['active', false]);
  9736. * // => object for 'fred'
  9737. *
  9738. * // The `_.property` iteratee shorthand.
  9739. * _.find(users, 'active');
  9740. * // => object for 'barney'
  9741. */
  9742. var find = createFind(findIndex);
  9743. /**
  9744. * This method is like `_.find` except that it iterates over elements of
  9745. * `collection` from right to left.
  9746. *
  9747. * @static
  9748. * @memberOf _
  9749. * @since 2.0.0
  9750. * @category Collection
  9751. * @param {Array|Object} collection The collection to inspect.
  9752. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  9753. * @param {number} [fromIndex=collection.length-1] The index to search from.
  9754. * @returns {*} Returns the matched element, else `undefined`.
  9755. * @example
  9756. *
  9757. * _.findLast([1, 2, 3, 4], function(n) {
  9758. * return n % 2 == 1;
  9759. * });
  9760. * // => 3
  9761. */
  9762. var findLast = createFind(findLastIndex);
  9763. /**
  9764. * Creates a flattened array of values by running each element in `collection`
  9765. * thru `iteratee` and flattening the mapped results. The iteratee is invoked
  9766. * with three arguments: (value, index|key, collection).
  9767. *
  9768. * @static
  9769. * @memberOf _
  9770. * @since 4.0.0
  9771. * @category Collection
  9772. * @param {Array|Object} collection The collection to iterate over.
  9773. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  9774. * @returns {Array} Returns the new flattened array.
  9775. * @example
  9776. *
  9777. * function duplicate(n) {
  9778. * return [n, n];
  9779. * }
  9780. *
  9781. * _.flatMap([1, 2], duplicate);
  9782. * // => [1, 1, 2, 2]
  9783. */
  9784. function flatMap(collection, iteratee) {
  9785. return baseFlatten(map(collection, iteratee), 1);
  9786. }
  9787. /**
  9788. * This method is like `_.flatMap` except that it recursively flattens the
  9789. * mapped results.
  9790. *
  9791. * @static
  9792. * @memberOf _
  9793. * @since 4.7.0
  9794. * @category Collection
  9795. * @param {Array|Object} collection The collection to iterate over.
  9796. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  9797. * @returns {Array} Returns the new flattened array.
  9798. * @example
  9799. *
  9800. * function duplicate(n) {
  9801. * return [[[n, n]]];
  9802. * }
  9803. *
  9804. * _.flatMapDeep([1, 2], duplicate);
  9805. * // => [1, 1, 2, 2]
  9806. */
  9807. function flatMapDeep(collection, iteratee) {
  9808. return baseFlatten(map(collection, iteratee), INFINITY);
  9809. }
  9810. /**
  9811. * This method is like `_.flatMap` except that it recursively flattens the
  9812. * mapped results up to `depth` times.
  9813. *
  9814. * @static
  9815. * @memberOf _
  9816. * @since 4.7.0
  9817. * @category Collection
  9818. * @param {Array|Object} collection The collection to iterate over.
  9819. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  9820. * @param {number} [depth=1] The maximum recursion depth.
  9821. * @returns {Array} Returns the new flattened array.
  9822. * @example
  9823. *
  9824. * function duplicate(n) {
  9825. * return [[[n, n]]];
  9826. * }
  9827. *
  9828. * _.flatMapDepth([1, 2], duplicate, 2);
  9829. * // => [[1, 1], [2, 2]]
  9830. */
  9831. function flatMapDepth(collection, iteratee, depth) {
  9832. depth = depth === undefined ? 1 : toInteger(depth);
  9833. return baseFlatten(map(collection, iteratee), depth);
  9834. }
  9835. /**
  9836. * Iterates over elements of `collection` and invokes `iteratee` for each element.
  9837. * The iteratee is invoked with three arguments: (value, index|key, collection).
  9838. * Iteratee functions may exit iteration early by explicitly returning `false`.
  9839. *
  9840. * **Note:** As with other "Collections" methods, objects with a "length"
  9841. * property are iterated like arrays. To avoid this behavior use `_.forIn`
  9842. * or `_.forOwn` for object iteration.
  9843. *
  9844. * @static
  9845. * @memberOf _
  9846. * @since 0.1.0
  9847. * @alias each
  9848. * @category Collection
  9849. * @param {Array|Object} collection The collection to iterate over.
  9850. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  9851. * @returns {Array|Object} Returns `collection`.
  9852. * @see _.forEachRight
  9853. * @example
  9854. *
  9855. * _.forEach([1, 2], function(value) {
  9856. * console.log(value);
  9857. * });
  9858. * // => Logs `1` then `2`.
  9859. *
  9860. * _.forEach({ 'a': 1, 'b': 2 }, function(value, key) {
  9861. * console.log(key);
  9862. * });
  9863. * // => Logs 'a' then 'b' (iteration order is not guaranteed).
  9864. */
  9865. function forEach(collection, iteratee) {
  9866. var func = isArray(collection) ? arrayEach : baseEach;
  9867. return func(collection, getIteratee(iteratee, 3));
  9868. }
  9869. /**
  9870. * This method is like `_.forEach` except that it iterates over elements of
  9871. * `collection` from right to left.
  9872. *
  9873. * @static
  9874. * @memberOf _
  9875. * @since 2.0.0
  9876. * @alias eachRight
  9877. * @category Collection
  9878. * @param {Array|Object} collection The collection to iterate over.
  9879. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  9880. * @returns {Array|Object} Returns `collection`.
  9881. * @see _.forEach
  9882. * @example
  9883. *
  9884. * _.forEachRight([1, 2], function(value) {
  9885. * console.log(value);
  9886. * });
  9887. * // => Logs `2` then `1`.
  9888. */
  9889. function forEachRight(collection, iteratee) {
  9890. var func = isArray(collection) ? arrayEachRight : baseEachRight;
  9891. return func(collection, getIteratee(iteratee, 3));
  9892. }
  9893. /**
  9894. * Creates an object composed of keys generated from the results of running
  9895. * each element of `collection` thru `iteratee`. The order of grouped values
  9896. * is determined by the order they occur in `collection`. The corresponding
  9897. * value of each key is an array of elements responsible for generating the
  9898. * key. The iteratee is invoked with one argument: (value).
  9899. *
  9900. * @static
  9901. * @memberOf _
  9902. * @since 0.1.0
  9903. * @category Collection
  9904. * @param {Array|Object} collection The collection to iterate over.
  9905. * @param {Function} [iteratee=_.identity] The iteratee to transform keys.
  9906. * @returns {Object} Returns the composed aggregate object.
  9907. * @example
  9908. *
  9909. * _.groupBy([6.1, 4.2, 6.3], Math.floor);
  9910. * // => { '4': [4.2], '6': [6.1, 6.3] }
  9911. *
  9912. * // The `_.property` iteratee shorthand.
  9913. * _.groupBy(['one', 'two', 'three'], 'length');
  9914. * // => { '3': ['one', 'two'], '5': ['three'] }
  9915. */
  9916. var groupBy = createAggregator(function(result, value, key) {
  9917. if (hasOwnProperty.call(result, key)) {
  9918. result[key].push(value);
  9919. } else {
  9920. baseAssignValue(result, key, [value]);
  9921. }
  9922. });
  9923. /**
  9924. * Checks if `value` is in `collection`. If `collection` is a string, it's
  9925. * checked for a substring of `value`, otherwise
  9926. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  9927. * is used for equality comparisons. If `fromIndex` is negative, it's used as
  9928. * the offset from the end of `collection`.
  9929. *
  9930. * @static
  9931. * @memberOf _
  9932. * @since 0.1.0
  9933. * @category Collection
  9934. * @param {Array|Object|string} collection The collection to inspect.
  9935. * @param {*} value The value to search for.
  9936. * @param {number} [fromIndex=0] The index to search from.
  9937. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.reduce`.
  9938. * @returns {boolean} Returns `true` if `value` is found, else `false`.
  9939. * @example
  9940. *
  9941. * _.includes([1, 2, 3], 1);
  9942. * // => true
  9943. *
  9944. * _.includes([1, 2, 3], 1, 2);
  9945. * // => false
  9946. *
  9947. * _.includes({ 'a': 1, 'b': 2 }, 1);
  9948. * // => true
  9949. *
  9950. * _.includes('abcd', 'bc');
  9951. * // => true
  9952. */
  9953. function includes(collection, value, fromIndex, guard) {
  9954. collection = isArrayLike(collection) ? collection : values(collection);
  9955. fromIndex = (fromIndex && !guard) ? toInteger(fromIndex) : 0;
  9956. var length = collection.length;
  9957. if (fromIndex < 0) {
  9958. fromIndex = nativeMax(length + fromIndex, 0);
  9959. }
  9960. return isString(collection)
  9961. ? (fromIndex <= length && collection.indexOf(value, fromIndex) > -1)
  9962. : (!!length && baseIndexOf(collection, value, fromIndex) > -1);
  9963. }
  9964. /**
  9965. * Invokes the method at `path` of each element in `collection`, returning
  9966. * an array of the results of each invoked method. Any additional arguments
  9967. * are provided to each invoked method. If `path` is a function, it's invoked
  9968. * for, and `this` bound to, each element in `collection`.
  9969. *
  9970. * @static
  9971. * @memberOf _
  9972. * @since 4.0.0
  9973. * @category Collection
  9974. * @param {Array|Object} collection The collection to iterate over.
  9975. * @param {Array|Function|string} path The path of the method to invoke or
  9976. * the function invoked per iteration.
  9977. * @param {...*} [args] The arguments to invoke each method with.
  9978. * @returns {Array} Returns the array of results.
  9979. * @example
  9980. *
  9981. * _.invokeMap([[5, 1, 7], [3, 2, 1]], 'sort');
  9982. * // => [[1, 5, 7], [1, 2, 3]]
  9983. *
  9984. * _.invokeMap([123, 456], String.prototype.split, '');
  9985. * // => [['1', '2', '3'], ['4', '5', '6']]
  9986. */
  9987. var invokeMap = baseRest(function(collection, path, args) {
  9988. var index = -1,
  9989. isFunc = typeof path == 'function',
  9990. result = isArrayLike(collection) ? Array(collection.length) : [];
  9991. baseEach(collection, function(value) {
  9992. result[++index] = isFunc ? apply(path, value, args) : baseInvoke(value, path, args);
  9993. });
  9994. return result;
  9995. });
  9996. /**
  9997. * Creates an object composed of keys generated from the results of running
  9998. * each element of `collection` thru `iteratee`. The corresponding value of
  9999. * each key is the last element responsible for generating the key. The
  10000. * iteratee is invoked with one argument: (value).
  10001. *
  10002. * @static
  10003. * @memberOf _
  10004. * @since 4.0.0
  10005. * @category Collection
  10006. * @param {Array|Object} collection The collection to iterate over.
  10007. * @param {Function} [iteratee=_.identity] The iteratee to transform keys.
  10008. * @returns {Object} Returns the composed aggregate object.
  10009. * @example
  10010. *
  10011. * var array = [
  10012. * { 'dir': 'left', 'code': 97 },
  10013. * { 'dir': 'right', 'code': 100 }
  10014. * ];
  10015. *
  10016. * _.keyBy(array, function(o) {
  10017. * return String.fromCharCode(o.code);
  10018. * });
  10019. * // => { 'a': { 'dir': 'left', 'code': 97 }, 'd': { 'dir': 'right', 'code': 100 } }
  10020. *
  10021. * _.keyBy(array, 'dir');
  10022. * // => { 'left': { 'dir': 'left', 'code': 97 }, 'right': { 'dir': 'right', 'code': 100 } }
  10023. */
  10024. var keyBy = createAggregator(function(result, value, key) {
  10025. baseAssignValue(result, key, value);
  10026. });
  10027. /**
  10028. * Creates an array of values by running each element in `collection` thru
  10029. * `iteratee`. The iteratee is invoked with three arguments:
  10030. * (value, index|key, collection).
  10031. *
  10032. * Many lodash methods are guarded to work as iteratees for methods like
  10033. * `_.every`, `_.filter`, `_.map`, `_.mapValues`, `_.reject`, and `_.some`.
  10034. *
  10035. * The guarded methods are:
  10036. * `ary`, `chunk`, `curry`, `curryRight`, `drop`, `dropRight`, `every`,
  10037. * `fill`, `invert`, `parseInt`, `random`, `range`, `rangeRight`, `repeat`,
  10038. * `sampleSize`, `slice`, `some`, `sortBy`, `split`, `take`, `takeRight`,
  10039. * `template`, `trim`, `trimEnd`, `trimStart`, and `words`
  10040. *
  10041. * @static
  10042. * @memberOf _
  10043. * @since 0.1.0
  10044. * @category Collection
  10045. * @param {Array|Object} collection The collection to iterate over.
  10046. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  10047. * @returns {Array} Returns the new mapped array.
  10048. * @example
  10049. *
  10050. * function square(n) {
  10051. * return n * n;
  10052. * }
  10053. *
  10054. * _.map([4, 8], square);
  10055. * // => [16, 64]
  10056. *
  10057. * _.map({ 'a': 4, 'b': 8 }, square);
  10058. * // => [16, 64] (iteration order is not guaranteed)
  10059. *
  10060. * var users = [
  10061. * { 'user': 'barney' },
  10062. * { 'user': 'fred' }
  10063. * ];
  10064. *
  10065. * // The `_.property` iteratee shorthand.
  10066. * _.map(users, 'user');
  10067. * // => ['barney', 'fred']
  10068. */
  10069. function map(collection, iteratee) {
  10070. var func = isArray(collection) ? arrayMap : baseMap;
  10071. return func(collection, getIteratee(iteratee, 3));
  10072. }
  10073. /**
  10074. * This method is like `_.sortBy` except that it allows specifying the sort
  10075. * orders of the iteratees to sort by. If `orders` is unspecified, all values
  10076. * are sorted in ascending order. Otherwise, specify an order of "desc" for
  10077. * descending or "asc" for ascending sort order of corresponding values.
  10078. *
  10079. * @static
  10080. * @memberOf _
  10081. * @since 4.0.0
  10082. * @category Collection
  10083. * @param {Array|Object} collection The collection to iterate over.
  10084. * @param {Array[]|Function[]|Object[]|string[]} [iteratees=[_.identity]]
  10085. * The iteratees to sort by.
  10086. * @param {string[]} [orders] The sort orders of `iteratees`.
  10087. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.reduce`.
  10088. * @returns {Array} Returns the new sorted array.
  10089. * @example
  10090. *
  10091. * var users = [
  10092. * { 'user': 'fred', 'age': 48 },
  10093. * { 'user': 'barney', 'age': 34 },
  10094. * { 'user': 'fred', 'age': 40 },
  10095. * { 'user': 'barney', 'age': 36 }
  10096. * ];
  10097. *
  10098. * // Sort by `user` in ascending order and by `age` in descending order.
  10099. * _.orderBy(users, ['user', 'age'], ['asc', 'desc']);
  10100. * // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 40]]
  10101. */
  10102. function orderBy(collection, iteratees, orders, guard) {
  10103. if (collection == null) {
  10104. return [];
  10105. }
  10106. if (!isArray(iteratees)) {
  10107. iteratees = iteratees == null ? [] : [iteratees];
  10108. }
  10109. orders = guard ? undefined : orders;
  10110. if (!isArray(orders)) {
  10111. orders = orders == null ? [] : [orders];
  10112. }
  10113. return baseOrderBy(collection, iteratees, orders);
  10114. }
  10115. /**
  10116. * Creates an array of elements split into two groups, the first of which
  10117. * contains elements `predicate` returns truthy for, the second of which
  10118. * contains elements `predicate` returns falsey for. The predicate is
  10119. * invoked with one argument: (value).
  10120. *
  10121. * @static
  10122. * @memberOf _
  10123. * @since 3.0.0
  10124. * @category Collection
  10125. * @param {Array|Object} collection The collection to iterate over.
  10126. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  10127. * @returns {Array} Returns the array of grouped elements.
  10128. * @example
  10129. *
  10130. * var users = [
  10131. * { 'user': 'barney', 'age': 36, 'active': false },
  10132. * { 'user': 'fred', 'age': 40, 'active': true },
  10133. * { 'user': 'pebbles', 'age': 1, 'active': false }
  10134. * ];
  10135. *
  10136. * _.partition(users, function(o) { return o.active; });
  10137. * // => objects for [['fred'], ['barney', 'pebbles']]
  10138. *
  10139. * // The `_.matches` iteratee shorthand.
  10140. * _.partition(users, { 'age': 1, 'active': false });
  10141. * // => objects for [['pebbles'], ['barney', 'fred']]
  10142. *
  10143. * // The `_.matchesProperty` iteratee shorthand.
  10144. * _.partition(users, ['active', false]);
  10145. * // => objects for [['barney', 'pebbles'], ['fred']]
  10146. *
  10147. * // The `_.property` iteratee shorthand.
  10148. * _.partition(users, 'active');
  10149. * // => objects for [['fred'], ['barney', 'pebbles']]
  10150. */
  10151. var partition = createAggregator(function(result, value, key) {
  10152. result[key ? 0 : 1].push(value);
  10153. }, function() { return [[], []]; });
  10154. /**
  10155. * Reduces `collection` to a value which is the accumulated result of running
  10156. * each element in `collection` thru `iteratee`, where each successive
  10157. * invocation is supplied the return value of the previous. If `accumulator`
  10158. * is not given, the first element of `collection` is used as the initial
  10159. * value. The iteratee is invoked with four arguments:
  10160. * (accumulator, value, index|key, collection).
  10161. *
  10162. * Many lodash methods are guarded to work as iteratees for methods like
  10163. * `_.reduce`, `_.reduceRight`, and `_.transform`.
  10164. *
  10165. * The guarded methods are:
  10166. * `assign`, `defaults`, `defaultsDeep`, `includes`, `merge`, `orderBy`,
  10167. * and `sortBy`
  10168. *
  10169. * @static
  10170. * @memberOf _
  10171. * @since 0.1.0
  10172. * @category Collection
  10173. * @param {Array|Object} collection The collection to iterate over.
  10174. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  10175. * @param {*} [accumulator] The initial value.
  10176. * @returns {*} Returns the accumulated value.
  10177. * @see _.reduceRight
  10178. * @example
  10179. *
  10180. * _.reduce([1, 2], function(sum, n) {
  10181. * return sum + n;
  10182. * }, 0);
  10183. * // => 3
  10184. *
  10185. * _.reduce({ 'a': 1, 'b': 2, 'c': 1 }, function(result, value, key) {
  10186. * (result[value] || (result[value] = [])).push(key);
  10187. * return result;
  10188. * }, {});
  10189. * // => { '1': ['a', 'c'], '2': ['b'] } (iteration order is not guaranteed)
  10190. */
  10191. function reduce(collection, iteratee, accumulator) {
  10192. var func = isArray(collection) ? arrayReduce : baseReduce,
  10193. initAccum = arguments.length < 3;
  10194. return func(collection, getIteratee(iteratee, 4), accumulator, initAccum, baseEach);
  10195. }
  10196. /**
  10197. * This method is like `_.reduce` except that it iterates over elements of
  10198. * `collection` from right to left.
  10199. *
  10200. * @static
  10201. * @memberOf _
  10202. * @since 0.1.0
  10203. * @category Collection
  10204. * @param {Array|Object} collection The collection to iterate over.
  10205. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  10206. * @param {*} [accumulator] The initial value.
  10207. * @returns {*} Returns the accumulated value.
  10208. * @see _.reduce
  10209. * @example
  10210. *
  10211. * var array = [[0, 1], [2, 3], [4, 5]];
  10212. *
  10213. * _.reduceRight(array, function(flattened, other) {
  10214. * return flattened.concat(other);
  10215. * }, []);
  10216. * // => [4, 5, 2, 3, 0, 1]
  10217. */
  10218. function reduceRight(collection, iteratee, accumulator) {
  10219. var func = isArray(collection) ? arrayReduceRight : baseReduce,
  10220. initAccum = arguments.length < 3;
  10221. return func(collection, getIteratee(iteratee, 4), accumulator, initAccum, baseEachRight);
  10222. }
  10223. /**
  10224. * The opposite of `_.filter`; this method returns the elements of `collection`
  10225. * that `predicate` does **not** return truthy for.
  10226. *
  10227. * @static
  10228. * @memberOf _
  10229. * @since 0.1.0
  10230. * @category Collection
  10231. * @param {Array|Object} collection The collection to iterate over.
  10232. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  10233. * @returns {Array} Returns the new filtered array.
  10234. * @see _.filter
  10235. * @example
  10236. *
  10237. * var users = [
  10238. * { 'user': 'barney', 'age': 36, 'active': false },
  10239. * { 'user': 'fred', 'age': 40, 'active': true }
  10240. * ];
  10241. *
  10242. * _.reject(users, function(o) { return !o.active; });
  10243. * // => objects for ['fred']
  10244. *
  10245. * // The `_.matches` iteratee shorthand.
  10246. * _.reject(users, { 'age': 40, 'active': true });
  10247. * // => objects for ['barney']
  10248. *
  10249. * // The `_.matchesProperty` iteratee shorthand.
  10250. * _.reject(users, ['active', false]);
  10251. * // => objects for ['fred']
  10252. *
  10253. * // The `_.property` iteratee shorthand.
  10254. * _.reject(users, 'active');
  10255. * // => objects for ['barney']
  10256. */
  10257. function reject(collection, predicate) {
  10258. var func = isArray(collection) ? arrayFilter : baseFilter;
  10259. return func(collection, negate(getIteratee(predicate, 3)));
  10260. }
  10261. /**
  10262. * Gets a random element from `collection`.
  10263. *
  10264. * @static
  10265. * @memberOf _
  10266. * @since 2.0.0
  10267. * @category Collection
  10268. * @param {Array|Object} collection The collection to sample.
  10269. * @returns {*} Returns the random element.
  10270. * @example
  10271. *
  10272. * _.sample([1, 2, 3, 4]);
  10273. * // => 2
  10274. */
  10275. function sample(collection) {
  10276. var func = isArray(collection) ? arraySample : baseSample;
  10277. return func(collection);
  10278. }
  10279. /**
  10280. * Gets `n` random elements at unique keys from `collection` up to the
  10281. * size of `collection`.
  10282. *
  10283. * @static
  10284. * @memberOf _
  10285. * @since 4.0.0
  10286. * @category Collection
  10287. * @param {Array|Object} collection The collection to sample.
  10288. * @param {number} [n=1] The number of elements to sample.
  10289. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  10290. * @returns {Array} Returns the random elements.
  10291. * @example
  10292. *
  10293. * _.sampleSize([1, 2, 3], 2);
  10294. * // => [3, 1]
  10295. *
  10296. * _.sampleSize([1, 2, 3], 4);
  10297. * // => [2, 3, 1]
  10298. */
  10299. function sampleSize(collection, n, guard) {
  10300. if ((guard ? isIterateeCall(collection, n, guard) : n === undefined)) {
  10301. n = 1;
  10302. } else {
  10303. n = toInteger(n);
  10304. }
  10305. var func = isArray(collection) ? arraySampleSize : baseSampleSize;
  10306. return func(collection, n);
  10307. }
  10308. /**
  10309. * Creates an array of shuffled values, using a version of the
  10310. * [Fisher-Yates shuffle](https://en.wikipedia.org/wiki/Fisher-Yates_shuffle).
  10311. *
  10312. * @static
  10313. * @memberOf _
  10314. * @since 0.1.0
  10315. * @category Collection
  10316. * @param {Array|Object} collection The collection to shuffle.
  10317. * @returns {Array} Returns the new shuffled array.
  10318. * @example
  10319. *
  10320. * _.shuffle([1, 2, 3, 4]);
  10321. * // => [4, 1, 3, 2]
  10322. */
  10323. function shuffle(collection) {
  10324. var func = isArray(collection) ? arrayShuffle : baseShuffle;
  10325. return func(collection);
  10326. }
  10327. /**
  10328. * Gets the size of `collection` by returning its length for array-like
  10329. * values or the number of own enumerable string keyed properties for objects.
  10330. *
  10331. * @static
  10332. * @memberOf _
  10333. * @since 0.1.0
  10334. * @category Collection
  10335. * @param {Array|Object|string} collection The collection to inspect.
  10336. * @returns {number} Returns the collection size.
  10337. * @example
  10338. *
  10339. * _.size([1, 2, 3]);
  10340. * // => 3
  10341. *
  10342. * _.size({ 'a': 1, 'b': 2 });
  10343. * // => 2
  10344. *
  10345. * _.size('pebbles');
  10346. * // => 7
  10347. */
  10348. function size(collection) {
  10349. if (collection == null) {
  10350. return 0;
  10351. }
  10352. if (isArrayLike(collection)) {
  10353. return isString(collection) ? stringSize(collection) : collection.length;
  10354. }
  10355. var tag = getTag(collection);
  10356. if (tag == mapTag || tag == setTag) {
  10357. return collection.size;
  10358. }
  10359. return baseKeys(collection).length;
  10360. }
  10361. /**
  10362. * Checks if `predicate` returns truthy for **any** element of `collection`.
  10363. * Iteration is stopped once `predicate` returns truthy. The predicate is
  10364. * invoked with three arguments: (value, index|key, collection).
  10365. *
  10366. * @static
  10367. * @memberOf _
  10368. * @since 0.1.0
  10369. * @category Collection
  10370. * @param {Array|Object} collection The collection to iterate over.
  10371. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  10372. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  10373. * @returns {boolean} Returns `true` if any element passes the predicate check,
  10374. * else `false`.
  10375. * @example
  10376. *
  10377. * _.some([null, 0, 'yes', false], Boolean);
  10378. * // => true
  10379. *
  10380. * var users = [
  10381. * { 'user': 'barney', 'active': true },
  10382. * { 'user': 'fred', 'active': false }
  10383. * ];
  10384. *
  10385. * // The `_.matches` iteratee shorthand.
  10386. * _.some(users, { 'user': 'barney', 'active': false });
  10387. * // => false
  10388. *
  10389. * // The `_.matchesProperty` iteratee shorthand.
  10390. * _.some(users, ['active', false]);
  10391. * // => true
  10392. *
  10393. * // The `_.property` iteratee shorthand.
  10394. * _.some(users, 'active');
  10395. * // => true
  10396. */
  10397. function some(collection, predicate, guard) {
  10398. var func = isArray(collection) ? arraySome : baseSome;
  10399. if (guard && isIterateeCall(collection, predicate, guard)) {
  10400. predicate = undefined;
  10401. }
  10402. return func(collection, getIteratee(predicate, 3));
  10403. }
  10404. /**
  10405. * Creates an array of elements, sorted in ascending order by the results of
  10406. * running each element in a collection thru each iteratee. This method
  10407. * performs a stable sort, that is, it preserves the original sort order of
  10408. * equal elements. The iteratees are invoked with one argument: (value).
  10409. *
  10410. * @static
  10411. * @memberOf _
  10412. * @since 0.1.0
  10413. * @category Collection
  10414. * @param {Array|Object} collection The collection to iterate over.
  10415. * @param {...(Function|Function[])} [iteratees=[_.identity]]
  10416. * The iteratees to sort by.
  10417. * @returns {Array} Returns the new sorted array.
  10418. * @example
  10419. *
  10420. * var users = [
  10421. * { 'user': 'fred', 'age': 48 },
  10422. * { 'user': 'barney', 'age': 36 },
  10423. * { 'user': 'fred', 'age': 30 },
  10424. * { 'user': 'barney', 'age': 34 }
  10425. * ];
  10426. *
  10427. * _.sortBy(users, [function(o) { return o.user; }]);
  10428. * // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 30]]
  10429. *
  10430. * _.sortBy(users, ['user', 'age']);
  10431. * // => objects for [['barney', 34], ['barney', 36], ['fred', 30], ['fred', 48]]
  10432. */
  10433. var sortBy = baseRest(function(collection, iteratees) {
  10434. if (collection == null) {
  10435. return [];
  10436. }
  10437. var length = iteratees.length;
  10438. if (length > 1 && isIterateeCall(collection, iteratees[0], iteratees[1])) {
  10439. iteratees = [];
  10440. } else if (length > 2 && isIterateeCall(iteratees[0], iteratees[1], iteratees[2])) {
  10441. iteratees = [iteratees[0]];
  10442. }
  10443. return baseOrderBy(collection, baseFlatten(iteratees, 1), []);
  10444. });
  10445. /*------------------------------------------------------------------------*/
  10446. /**
  10447. * Gets the timestamp of the number of milliseconds that have elapsed since
  10448. * the Unix epoch (1 January 1970 00:00:00 UTC).
  10449. *
  10450. * @static
  10451. * @memberOf _
  10452. * @since 2.4.0
  10453. * @category Date
  10454. * @returns {number} Returns the timestamp.
  10455. * @example
  10456. *
  10457. * _.defer(function(stamp) {
  10458. * console.log(_.now() - stamp);
  10459. * }, _.now());
  10460. * // => Logs the number of milliseconds it took for the deferred invocation.
  10461. */
  10462. var now = ctxNow || function() {
  10463. return root.Date.now();
  10464. };
  10465. /*------------------------------------------------------------------------*/
  10466. /**
  10467. * The opposite of `_.before`; this method creates a function that invokes
  10468. * `func` once it's called `n` or more times.
  10469. *
  10470. * @static
  10471. * @memberOf _
  10472. * @since 0.1.0
  10473. * @category Function
  10474. * @param {number} n The number of calls before `func` is invoked.
  10475. * @param {Function} func The function to restrict.
  10476. * @returns {Function} Returns the new restricted function.
  10477. * @example
  10478. *
  10479. * var saves = ['profile', 'settings'];
  10480. *
  10481. * var done = _.after(saves.length, function() {
  10482. * console.log('done saving!');
  10483. * });
  10484. *
  10485. * _.forEach(saves, function(type) {
  10486. * asyncSave({ 'type': type, 'complete': done });
  10487. * });
  10488. * // => Logs 'done saving!' after the two async saves have completed.
  10489. */
  10490. function after(n, func) {
  10491. if (typeof func != 'function') {
  10492. throw new TypeError(FUNC_ERROR_TEXT);
  10493. }
  10494. n = toInteger(n);
  10495. return function() {
  10496. if (--n < 1) {
  10497. return func.apply(this, arguments);
  10498. }
  10499. };
  10500. }
  10501. /**
  10502. * Creates a function that invokes `func`, with up to `n` arguments,
  10503. * ignoring any additional arguments.
  10504. *
  10505. * @static
  10506. * @memberOf _
  10507. * @since 3.0.0
  10508. * @category Function
  10509. * @param {Function} func The function to cap arguments for.
  10510. * @param {number} [n=func.length] The arity cap.
  10511. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  10512. * @returns {Function} Returns the new capped function.
  10513. * @example
  10514. *
  10515. * _.map(['6', '8', '10'], _.ary(parseInt, 1));
  10516. * // => [6, 8, 10]
  10517. */
  10518. function ary(func, n, guard) {
  10519. n = guard ? undefined : n;
  10520. n = (func && n == null) ? func.length : n;
  10521. return createWrap(func, WRAP_ARY_FLAG, undefined, undefined, undefined, undefined, n);
  10522. }
  10523. /**
  10524. * Creates a function that invokes `func`, with the `this` binding and arguments
  10525. * of the created function, while it's called less than `n` times. Subsequent
  10526. * calls to the created function return the result of the last `func` invocation.
  10527. *
  10528. * @static
  10529. * @memberOf _
  10530. * @since 3.0.0
  10531. * @category Function
  10532. * @param {number} n The number of calls at which `func` is no longer invoked.
  10533. * @param {Function} func The function to restrict.
  10534. * @returns {Function} Returns the new restricted function.
  10535. * @example
  10536. *
  10537. * jQuery(element).on('click', _.before(5, addContactToList));
  10538. * // => Allows adding up to 4 contacts to the list.
  10539. */
  10540. function before(n, func) {
  10541. var result;
  10542. if (typeof func != 'function') {
  10543. throw new TypeError(FUNC_ERROR_TEXT);
  10544. }
  10545. n = toInteger(n);
  10546. return function() {
  10547. if (--n > 0) {
  10548. result = func.apply(this, arguments);
  10549. }
  10550. if (n <= 1) {
  10551. func = undefined;
  10552. }
  10553. return result;
  10554. };
  10555. }
  10556. /**
  10557. * Creates a function that invokes `func` with the `this` binding of `thisArg`
  10558. * and `partials` prepended to the arguments it receives.
  10559. *
  10560. * The `_.bind.placeholder` value, which defaults to `_` in monolithic builds,
  10561. * may be used as a placeholder for partially applied arguments.
  10562. *
  10563. * **Note:** Unlike native `Function#bind`, this method doesn't set the "length"
  10564. * property of bound functions.
  10565. *
  10566. * @static
  10567. * @memberOf _
  10568. * @since 0.1.0
  10569. * @category Function
  10570. * @param {Function} func The function to bind.
  10571. * @param {*} thisArg The `this` binding of `func`.
  10572. * @param {...*} [partials] The arguments to be partially applied.
  10573. * @returns {Function} Returns the new bound function.
  10574. * @example
  10575. *
  10576. * function greet(greeting, punctuation) {
  10577. * return greeting + ' ' + this.user + punctuation;
  10578. * }
  10579. *
  10580. * var object = { 'user': 'fred' };
  10581. *
  10582. * var bound = _.bind(greet, object, 'hi');
  10583. * bound('!');
  10584. * // => 'hi fred!'
  10585. *
  10586. * // Bound with placeholders.
  10587. * var bound = _.bind(greet, object, _, '!');
  10588. * bound('hi');
  10589. * // => 'hi fred!'
  10590. */
  10591. var bind = baseRest(function(func, thisArg, partials) {
  10592. var bitmask = WRAP_BIND_FLAG;
  10593. if (partials.length) {
  10594. var holders = replaceHolders(partials, getHolder(bind));
  10595. bitmask |= WRAP_PARTIAL_FLAG;
  10596. }
  10597. return createWrap(func, bitmask, thisArg, partials, holders);
  10598. });
  10599. /**
  10600. * Creates a function that invokes the method at `object[key]` with `partials`
  10601. * prepended to the arguments it receives.
  10602. *
  10603. * This method differs from `_.bind` by allowing bound functions to reference
  10604. * methods that may be redefined or don't yet exist. See
  10605. * [Peter Michaux's article](http://peter.michaux.ca/articles/lazy-function-definition-pattern)
  10606. * for more details.
  10607. *
  10608. * The `_.bindKey.placeholder` value, which defaults to `_` in monolithic
  10609. * builds, may be used as a placeholder for partially applied arguments.
  10610. *
  10611. * @static
  10612. * @memberOf _
  10613. * @since 0.10.0
  10614. * @category Function
  10615. * @param {Object} object The object to invoke the method on.
  10616. * @param {string} key The key of the method.
  10617. * @param {...*} [partials] The arguments to be partially applied.
  10618. * @returns {Function} Returns the new bound function.
  10619. * @example
  10620. *
  10621. * var object = {
  10622. * 'user': 'fred',
  10623. * 'greet': function(greeting, punctuation) {
  10624. * return greeting + ' ' + this.user + punctuation;
  10625. * }
  10626. * };
  10627. *
  10628. * var bound = _.bindKey(object, 'greet', 'hi');
  10629. * bound('!');
  10630. * // => 'hi fred!'
  10631. *
  10632. * object.greet = function(greeting, punctuation) {
  10633. * return greeting + 'ya ' + this.user + punctuation;
  10634. * };
  10635. *
  10636. * bound('!');
  10637. * // => 'hiya fred!'
  10638. *
  10639. * // Bound with placeholders.
  10640. * var bound = _.bindKey(object, 'greet', _, '!');
  10641. * bound('hi');
  10642. * // => 'hiya fred!'
  10643. */
  10644. var bindKey = baseRest(function(object, key, partials) {
  10645. var bitmask = WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG;
  10646. if (partials.length) {
  10647. var holders = replaceHolders(partials, getHolder(bindKey));
  10648. bitmask |= WRAP_PARTIAL_FLAG;
  10649. }
  10650. return createWrap(key, bitmask, object, partials, holders);
  10651. });
  10652. /**
  10653. * Creates a function that accepts arguments of `func` and either invokes
  10654. * `func` returning its result, if at least `arity` number of arguments have
  10655. * been provided, or returns a function that accepts the remaining `func`
  10656. * arguments, and so on. The arity of `func` may be specified if `func.length`
  10657. * is not sufficient.
  10658. *
  10659. * The `_.curry.placeholder` value, which defaults to `_` in monolithic builds,
  10660. * may be used as a placeholder for provided arguments.
  10661. *
  10662. * **Note:** This method doesn't set the "length" property of curried functions.
  10663. *
  10664. * @static
  10665. * @memberOf _
  10666. * @since 2.0.0
  10667. * @category Function
  10668. * @param {Function} func The function to curry.
  10669. * @param {number} [arity=func.length] The arity of `func`.
  10670. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  10671. * @returns {Function} Returns the new curried function.
  10672. * @example
  10673. *
  10674. * var abc = function(a, b, c) {
  10675. * return [a, b, c];
  10676. * };
  10677. *
  10678. * var curried = _.curry(abc);
  10679. *
  10680. * curried(1)(2)(3);
  10681. * // => [1, 2, 3]
  10682. *
  10683. * curried(1, 2)(3);
  10684. * // => [1, 2, 3]
  10685. *
  10686. * curried(1, 2, 3);
  10687. * // => [1, 2, 3]
  10688. *
  10689. * // Curried with placeholders.
  10690. * curried(1)(_, 3)(2);
  10691. * // => [1, 2, 3]
  10692. */
  10693. function curry(func, arity, guard) {
  10694. arity = guard ? undefined : arity;
  10695. var result = createWrap(func, WRAP_CURRY_FLAG, undefined, undefined, undefined, undefined, undefined, arity);
  10696. result.placeholder = curry.placeholder;
  10697. return result;
  10698. }
  10699. /**
  10700. * This method is like `_.curry` except that arguments are applied to `func`
  10701. * in the manner of `_.partialRight` instead of `_.partial`.
  10702. *
  10703. * The `_.curryRight.placeholder` value, which defaults to `_` in monolithic
  10704. * builds, may be used as a placeholder for provided arguments.
  10705. *
  10706. * **Note:** This method doesn't set the "length" property of curried functions.
  10707. *
  10708. * @static
  10709. * @memberOf _
  10710. * @since 3.0.0
  10711. * @category Function
  10712. * @param {Function} func The function to curry.
  10713. * @param {number} [arity=func.length] The arity of `func`.
  10714. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  10715. * @returns {Function} Returns the new curried function.
  10716. * @example
  10717. *
  10718. * var abc = function(a, b, c) {
  10719. * return [a, b, c];
  10720. * };
  10721. *
  10722. * var curried = _.curryRight(abc);
  10723. *
  10724. * curried(3)(2)(1);
  10725. * // => [1, 2, 3]
  10726. *
  10727. * curried(2, 3)(1);
  10728. * // => [1, 2, 3]
  10729. *
  10730. * curried(1, 2, 3);
  10731. * // => [1, 2, 3]
  10732. *
  10733. * // Curried with placeholders.
  10734. * curried(3)(1, _)(2);
  10735. * // => [1, 2, 3]
  10736. */
  10737. function curryRight(func, arity, guard) {
  10738. arity = guard ? undefined : arity;
  10739. var result = createWrap(func, WRAP_CURRY_RIGHT_FLAG, undefined, undefined, undefined, undefined, undefined, arity);
  10740. result.placeholder = curryRight.placeholder;
  10741. return result;
  10742. }
  10743. /**
  10744. * Creates a debounced function that delays invoking `func` until after `wait`
  10745. * milliseconds have elapsed since the last time the debounced function was
  10746. * invoked. The debounced function comes with a `cancel` method to cancel
  10747. * delayed `func` invocations and a `flush` method to immediately invoke them.
  10748. * Provide `options` to indicate whether `func` should be invoked on the
  10749. * leading and/or trailing edge of the `wait` timeout. The `func` is invoked
  10750. * with the last arguments provided to the debounced function. Subsequent
  10751. * calls to the debounced function return the result of the last `func`
  10752. * invocation.
  10753. *
  10754. * **Note:** If `leading` and `trailing` options are `true`, `func` is
  10755. * invoked on the trailing edge of the timeout only if the debounced function
  10756. * is invoked more than once during the `wait` timeout.
  10757. *
  10758. * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred
  10759. * until to the next tick, similar to `setTimeout` with a timeout of `0`.
  10760. *
  10761. * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/)
  10762. * for details over the differences between `_.debounce` and `_.throttle`.
  10763. *
  10764. * @static
  10765. * @memberOf _
  10766. * @since 0.1.0
  10767. * @category Function
  10768. * @param {Function} func The function to debounce.
  10769. * @param {number} [wait=0] The number of milliseconds to delay.
  10770. * @param {Object} [options={}] The options object.
  10771. * @param {boolean} [options.leading=false]
  10772. * Specify invoking on the leading edge of the timeout.
  10773. * @param {number} [options.maxWait]
  10774. * The maximum time `func` is allowed to be delayed before it's invoked.
  10775. * @param {boolean} [options.trailing=true]
  10776. * Specify invoking on the trailing edge of the timeout.
  10777. * @returns {Function} Returns the new debounced function.
  10778. * @example
  10779. *
  10780. * // Avoid costly calculations while the window size is in flux.
  10781. * jQuery(window).on('resize', _.debounce(calculateLayout, 150));
  10782. *
  10783. * // Invoke `sendMail` when clicked, debouncing subsequent calls.
  10784. * jQuery(element).on('click', _.debounce(sendMail, 300, {
  10785. * 'leading': true,
  10786. * 'trailing': false
  10787. * }));
  10788. *
  10789. * // Ensure `batchLog` is invoked once after 1 second of debounced calls.
  10790. * var debounced = _.debounce(batchLog, 250, { 'maxWait': 1000 });
  10791. * var source = new EventSource('/stream');
  10792. * jQuery(source).on('message', debounced);
  10793. *
  10794. * // Cancel the trailing debounced invocation.
  10795. * jQuery(window).on('popstate', debounced.cancel);
  10796. */
  10797. function debounce(func, wait, options) {
  10798. var lastArgs,
  10799. lastThis,
  10800. maxWait,
  10801. result,
  10802. timerId,
  10803. lastCallTime,
  10804. lastInvokeTime = 0,
  10805. leading = false,
  10806. maxing = false,
  10807. trailing = true;
  10808. if (typeof func != 'function') {
  10809. throw new TypeError(FUNC_ERROR_TEXT);
  10810. }
  10811. wait = toNumber(wait) || 0;
  10812. if (isObject(options)) {
  10813. leading = !!options.leading;
  10814. maxing = 'maxWait' in options;
  10815. maxWait = maxing ? nativeMax(toNumber(options.maxWait) || 0, wait) : maxWait;
  10816. trailing = 'trailing' in options ? !!options.trailing : trailing;
  10817. }
  10818. function invokeFunc(time) {
  10819. var args = lastArgs,
  10820. thisArg = lastThis;
  10821. lastArgs = lastThis = undefined;
  10822. lastInvokeTime = time;
  10823. result = func.apply(thisArg, args);
  10824. return result;
  10825. }
  10826. function leadingEdge(time) {
  10827. // Reset any `maxWait` timer.
  10828. lastInvokeTime = time;
  10829. // Start the timer for the trailing edge.
  10830. timerId = setTimeout(timerExpired, wait);
  10831. // Invoke the leading edge.
  10832. return leading ? invokeFunc(time) : result;
  10833. }
  10834. function remainingWait(time) {
  10835. var timeSinceLastCall = time - lastCallTime,
  10836. timeSinceLastInvoke = time - lastInvokeTime,
  10837. timeWaiting = wait - timeSinceLastCall;
  10838. return maxing
  10839. ? nativeMin(timeWaiting, maxWait - timeSinceLastInvoke)
  10840. : timeWaiting;
  10841. }
  10842. function shouldInvoke(time) {
  10843. var timeSinceLastCall = time - lastCallTime,
  10844. timeSinceLastInvoke = time - lastInvokeTime;
  10845. // Either this is the first call, activity has stopped and we're at the
  10846. // trailing edge, the system time has gone backwards and we're treating
  10847. // it as the trailing edge, or we've hit the `maxWait` limit.
  10848. return (lastCallTime === undefined || (timeSinceLastCall >= wait) ||
  10849. (timeSinceLastCall < 0) || (maxing && timeSinceLastInvoke >= maxWait));
  10850. }
  10851. function timerExpired() {
  10852. var time = now();
  10853. if (shouldInvoke(time)) {
  10854. return trailingEdge(time);
  10855. }
  10856. // Restart the timer.
  10857. timerId = setTimeout(timerExpired, remainingWait(time));
  10858. }
  10859. function trailingEdge(time) {
  10860. timerId = undefined;
  10861. // Only invoke if we have `lastArgs` which means `func` has been
  10862. // debounced at least once.
  10863. if (trailing && lastArgs) {
  10864. return invokeFunc(time);
  10865. }
  10866. lastArgs = lastThis = undefined;
  10867. return result;
  10868. }
  10869. function cancel() {
  10870. if (timerId !== undefined) {
  10871. clearTimeout(timerId);
  10872. }
  10873. lastInvokeTime = 0;
  10874. lastArgs = lastCallTime = lastThis = timerId = undefined;
  10875. }
  10876. function flush() {
  10877. return timerId === undefined ? result : trailingEdge(now());
  10878. }
  10879. function debounced() {
  10880. var time = now(),
  10881. isInvoking = shouldInvoke(time);
  10882. lastArgs = arguments;
  10883. lastThis = this;
  10884. lastCallTime = time;
  10885. if (isInvoking) {
  10886. if (timerId === undefined) {
  10887. return leadingEdge(lastCallTime);
  10888. }
  10889. if (maxing) {
  10890. // Handle invocations in a tight loop.
  10891. clearTimeout(timerId);
  10892. timerId = setTimeout(timerExpired, wait);
  10893. return invokeFunc(lastCallTime);
  10894. }
  10895. }
  10896. if (timerId === undefined) {
  10897. timerId = setTimeout(timerExpired, wait);
  10898. }
  10899. return result;
  10900. }
  10901. debounced.cancel = cancel;
  10902. debounced.flush = flush;
  10903. return debounced;
  10904. }
  10905. /**
  10906. * Defers invoking the `func` until the current call stack has cleared. Any
  10907. * additional arguments are provided to `func` when it's invoked.
  10908. *
  10909. * @static
  10910. * @memberOf _
  10911. * @since 0.1.0
  10912. * @category Function
  10913. * @param {Function} func The function to defer.
  10914. * @param {...*} [args] The arguments to invoke `func` with.
  10915. * @returns {number} Returns the timer id.
  10916. * @example
  10917. *
  10918. * _.defer(function(text) {
  10919. * console.log(text);
  10920. * }, 'deferred');
  10921. * // => Logs 'deferred' after one millisecond.
  10922. */
  10923. var defer = baseRest(function(func, args) {
  10924. return baseDelay(func, 1, args);
  10925. });
  10926. /**
  10927. * Invokes `func` after `wait` milliseconds. Any additional arguments are
  10928. * provided to `func` when it's invoked.
  10929. *
  10930. * @static
  10931. * @memberOf _
  10932. * @since 0.1.0
  10933. * @category Function
  10934. * @param {Function} func The function to delay.
  10935. * @param {number} wait The number of milliseconds to delay invocation.
  10936. * @param {...*} [args] The arguments to invoke `func` with.
  10937. * @returns {number} Returns the timer id.
  10938. * @example
  10939. *
  10940. * _.delay(function(text) {
  10941. * console.log(text);
  10942. * }, 1000, 'later');
  10943. * // => Logs 'later' after one second.
  10944. */
  10945. var delay = baseRest(function(func, wait, args) {
  10946. return baseDelay(func, toNumber(wait) || 0, args);
  10947. });
  10948. /**
  10949. * Creates a function that invokes `func` with arguments reversed.
  10950. *
  10951. * @static
  10952. * @memberOf _
  10953. * @since 4.0.0
  10954. * @category Function
  10955. * @param {Function} func The function to flip arguments for.
  10956. * @returns {Function} Returns the new flipped function.
  10957. * @example
  10958. *
  10959. * var flipped = _.flip(function() {
  10960. * return _.toArray(arguments);
  10961. * });
  10962. *
  10963. * flipped('a', 'b', 'c', 'd');
  10964. * // => ['d', 'c', 'b', 'a']
  10965. */
  10966. function flip(func) {
  10967. return createWrap(func, WRAP_FLIP_FLAG);
  10968. }
  10969. /**
  10970. * Creates a function that memoizes the result of `func`. If `resolver` is
  10971. * provided, it determines the cache key for storing the result based on the
  10972. * arguments provided to the memoized function. By default, the first argument
  10973. * provided to the memoized function is used as the map cache key. The `func`
  10974. * is invoked with the `this` binding of the memoized function.
  10975. *
  10976. * **Note:** The cache is exposed as the `cache` property on the memoized
  10977. * function. Its creation may be customized by replacing the `_.memoize.Cache`
  10978. * constructor with one whose instances implement the
  10979. * [`Map`](http://ecma-international.org/ecma-262/7.0/#sec-properties-of-the-map-prototype-object)
  10980. * method interface of `clear`, `delete`, `get`, `has`, and `set`.
  10981. *
  10982. * @static
  10983. * @memberOf _
  10984. * @since 0.1.0
  10985. * @category Function
  10986. * @param {Function} func The function to have its output memoized.
  10987. * @param {Function} [resolver] The function to resolve the cache key.
  10988. * @returns {Function} Returns the new memoized function.
  10989. * @example
  10990. *
  10991. * var object = { 'a': 1, 'b': 2 };
  10992. * var other = { 'c': 3, 'd': 4 };
  10993. *
  10994. * var values = _.memoize(_.values);
  10995. * values(object);
  10996. * // => [1, 2]
  10997. *
  10998. * values(other);
  10999. * // => [3, 4]
  11000. *
  11001. * object.a = 2;
  11002. * values(object);
  11003. * // => [1, 2]
  11004. *
  11005. * // Modify the result cache.
  11006. * values.cache.set(object, ['a', 'b']);
  11007. * values(object);
  11008. * // => ['a', 'b']
  11009. *
  11010. * // Replace `_.memoize.Cache`.
  11011. * _.memoize.Cache = WeakMap;
  11012. */
  11013. function memoize(func, resolver) {
  11014. if (typeof func != 'function' || (resolver != null && typeof resolver != 'function')) {
  11015. throw new TypeError(FUNC_ERROR_TEXT);
  11016. }
  11017. var memoized = function() {
  11018. var args = arguments,
  11019. key = resolver ? resolver.apply(this, args) : args[0],
  11020. cache = memoized.cache;
  11021. if (cache.has(key)) {
  11022. return cache.get(key);
  11023. }
  11024. var result = func.apply(this, args);
  11025. memoized.cache = cache.set(key, result) || cache;
  11026. return result;
  11027. };
  11028. memoized.cache = new (memoize.Cache || MapCache);
  11029. return memoized;
  11030. }
  11031. // Expose `MapCache`.
  11032. memoize.Cache = MapCache;
  11033. /**
  11034. * Creates a function that negates the result of the predicate `func`. The
  11035. * `func` predicate is invoked with the `this` binding and arguments of the
  11036. * created function.
  11037. *
  11038. * @static
  11039. * @memberOf _
  11040. * @since 3.0.0
  11041. * @category Function
  11042. * @param {Function} predicate The predicate to negate.
  11043. * @returns {Function} Returns the new negated function.
  11044. * @example
  11045. *
  11046. * function isEven(n) {
  11047. * return n % 2 == 0;
  11048. * }
  11049. *
  11050. * _.filter([1, 2, 3, 4, 5, 6], _.negate(isEven));
  11051. * // => [1, 3, 5]
  11052. */
  11053. function negate(predicate) {
  11054. if (typeof predicate != 'function') {
  11055. throw new TypeError(FUNC_ERROR_TEXT);
  11056. }
  11057. return function() {
  11058. var args = arguments;
  11059. switch (args.length) {
  11060. case 0: return !predicate.call(this);
  11061. case 1: return !predicate.call(this, args[0]);
  11062. case 2: return !predicate.call(this, args[0], args[1]);
  11063. case 3: return !predicate.call(this, args[0], args[1], args[2]);
  11064. }
  11065. return !predicate.apply(this, args);
  11066. };
  11067. }
  11068. /**
  11069. * Creates a function that is restricted to invoking `func` once. Repeat calls
  11070. * to the function return the value of the first invocation. The `func` is
  11071. * invoked with the `this` binding and arguments of the created function.
  11072. *
  11073. * @static
  11074. * @memberOf _
  11075. * @since 0.1.0
  11076. * @category Function
  11077. * @param {Function} func The function to restrict.
  11078. * @returns {Function} Returns the new restricted function.
  11079. * @example
  11080. *
  11081. * var initialize = _.once(createApplication);
  11082. * initialize();
  11083. * initialize();
  11084. * // => `createApplication` is invoked once
  11085. */
  11086. function once(func) {
  11087. return before(2, func);
  11088. }
  11089. /**
  11090. * Creates a function that invokes `func` with its arguments transformed.
  11091. *
  11092. * @static
  11093. * @since 4.0.0
  11094. * @memberOf _
  11095. * @category Function
  11096. * @param {Function} func The function to wrap.
  11097. * @param {...(Function|Function[])} [transforms=[_.identity]]
  11098. * The argument transforms.
  11099. * @returns {Function} Returns the new function.
  11100. * @example
  11101. *
  11102. * function doubled(n) {
  11103. * return n * 2;
  11104. * }
  11105. *
  11106. * function square(n) {
  11107. * return n * n;
  11108. * }
  11109. *
  11110. * var func = _.overArgs(function(x, y) {
  11111. * return [x, y];
  11112. * }, [square, doubled]);
  11113. *
  11114. * func(9, 3);
  11115. * // => [81, 6]
  11116. *
  11117. * func(10, 5);
  11118. * // => [100, 10]
  11119. */
  11120. var overArgs = castRest(function(func, transforms) {
  11121. transforms = (transforms.length == 1 && isArray(transforms[0]))
  11122. ? arrayMap(transforms[0], baseUnary(getIteratee()))
  11123. : arrayMap(baseFlatten(transforms, 1), baseUnary(getIteratee()));
  11124. var funcsLength = transforms.length;
  11125. return baseRest(function(args) {
  11126. var index = -1,
  11127. length = nativeMin(args.length, funcsLength);
  11128. while (++index < length) {
  11129. args[index] = transforms[index].call(this, args[index]);
  11130. }
  11131. return apply(func, this, args);
  11132. });
  11133. });
  11134. /**
  11135. * Creates a function that invokes `func` with `partials` prepended to the
  11136. * arguments it receives. This method is like `_.bind` except it does **not**
  11137. * alter the `this` binding.
  11138. *
  11139. * The `_.partial.placeholder` value, which defaults to `_` in monolithic
  11140. * builds, may be used as a placeholder for partially applied arguments.
  11141. *
  11142. * **Note:** This method doesn't set the "length" property of partially
  11143. * applied functions.
  11144. *
  11145. * @static
  11146. * @memberOf _
  11147. * @since 0.2.0
  11148. * @category Function
  11149. * @param {Function} func The function to partially apply arguments to.
  11150. * @param {...*} [partials] The arguments to be partially applied.
  11151. * @returns {Function} Returns the new partially applied function.
  11152. * @example
  11153. *
  11154. * function greet(greeting, name) {
  11155. * return greeting + ' ' + name;
  11156. * }
  11157. *
  11158. * var sayHelloTo = _.partial(greet, 'hello');
  11159. * sayHelloTo('fred');
  11160. * // => 'hello fred'
  11161. *
  11162. * // Partially applied with placeholders.
  11163. * var greetFred = _.partial(greet, _, 'fred');
  11164. * greetFred('hi');
  11165. * // => 'hi fred'
  11166. */
  11167. var partial = baseRest(function(func, partials) {
  11168. var holders = replaceHolders(partials, getHolder(partial));
  11169. return createWrap(func, WRAP_PARTIAL_FLAG, undefined, partials, holders);
  11170. });
  11171. /**
  11172. * This method is like `_.partial` except that partially applied arguments
  11173. * are appended to the arguments it receives.
  11174. *
  11175. * The `_.partialRight.placeholder` value, which defaults to `_` in monolithic
  11176. * builds, may be used as a placeholder for partially applied arguments.
  11177. *
  11178. * **Note:** This method doesn't set the "length" property of partially
  11179. * applied functions.
  11180. *
  11181. * @static
  11182. * @memberOf _
  11183. * @since 1.0.0
  11184. * @category Function
  11185. * @param {Function} func The function to partially apply arguments to.
  11186. * @param {...*} [partials] The arguments to be partially applied.
  11187. * @returns {Function} Returns the new partially applied function.
  11188. * @example
  11189. *
  11190. * function greet(greeting, name) {
  11191. * return greeting + ' ' + name;
  11192. * }
  11193. *
  11194. * var greetFred = _.partialRight(greet, 'fred');
  11195. * greetFred('hi');
  11196. * // => 'hi fred'
  11197. *
  11198. * // Partially applied with placeholders.
  11199. * var sayHelloTo = _.partialRight(greet, 'hello', _);
  11200. * sayHelloTo('fred');
  11201. * // => 'hello fred'
  11202. */
  11203. var partialRight = baseRest(function(func, partials) {
  11204. var holders = replaceHolders(partials, getHolder(partialRight));
  11205. return createWrap(func, WRAP_PARTIAL_RIGHT_FLAG, undefined, partials, holders);
  11206. });
  11207. /**
  11208. * Creates a function that invokes `func` with arguments arranged according
  11209. * to the specified `indexes` where the argument value at the first index is
  11210. * provided as the first argument, the argument value at the second index is
  11211. * provided as the second argument, and so on.
  11212. *
  11213. * @static
  11214. * @memberOf _
  11215. * @since 3.0.0
  11216. * @category Function
  11217. * @param {Function} func The function to rearrange arguments for.
  11218. * @param {...(number|number[])} indexes The arranged argument indexes.
  11219. * @returns {Function} Returns the new function.
  11220. * @example
  11221. *
  11222. * var rearged = _.rearg(function(a, b, c) {
  11223. * return [a, b, c];
  11224. * }, [2, 0, 1]);
  11225. *
  11226. * rearged('b', 'c', 'a')
  11227. * // => ['a', 'b', 'c']
  11228. */
  11229. var rearg = flatRest(function(func, indexes) {
  11230. return createWrap(func, WRAP_REARG_FLAG, undefined, undefined, undefined, indexes);
  11231. });
  11232. /**
  11233. * Creates a function that invokes `func` with the `this` binding of the
  11234. * created function and arguments from `start` and beyond provided as
  11235. * an array.
  11236. *
  11237. * **Note:** This method is based on the
  11238. * [rest parameter](https://mdn.io/rest_parameters).
  11239. *
  11240. * @static
  11241. * @memberOf _
  11242. * @since 4.0.0
  11243. * @category Function
  11244. * @param {Function} func The function to apply a rest parameter to.
  11245. * @param {number} [start=func.length-1] The start position of the rest parameter.
  11246. * @returns {Function} Returns the new function.
  11247. * @example
  11248. *
  11249. * var say = _.rest(function(what, names) {
  11250. * return what + ' ' + _.initial(names).join(', ') +
  11251. * (_.size(names) > 1 ? ', & ' : '') + _.last(names);
  11252. * });
  11253. *
  11254. * say('hello', 'fred', 'barney', 'pebbles');
  11255. * // => 'hello fred, barney, & pebbles'
  11256. */
  11257. function rest(func, start) {
  11258. if (typeof func != 'function') {
  11259. throw new TypeError(FUNC_ERROR_TEXT);
  11260. }
  11261. start = start === undefined ? start : toInteger(start);
  11262. return baseRest(func, start);
  11263. }
  11264. /**
  11265. * Creates a function that invokes `func` with the `this` binding of the
  11266. * create function and an array of arguments much like
  11267. * [`Function#apply`](http://www.ecma-international.org/ecma-262/7.0/#sec-function.prototype.apply).
  11268. *
  11269. * **Note:** This method is based on the
  11270. * [spread operator](https://mdn.io/spread_operator).
  11271. *
  11272. * @static
  11273. * @memberOf _
  11274. * @since 3.2.0
  11275. * @category Function
  11276. * @param {Function} func The function to spread arguments over.
  11277. * @param {number} [start=0] The start position of the spread.
  11278. * @returns {Function} Returns the new function.
  11279. * @example
  11280. *
  11281. * var say = _.spread(function(who, what) {
  11282. * return who + ' says ' + what;
  11283. * });
  11284. *
  11285. * say(['fred', 'hello']);
  11286. * // => 'fred says hello'
  11287. *
  11288. * var numbers = Promise.all([
  11289. * Promise.resolve(40),
  11290. * Promise.resolve(36)
  11291. * ]);
  11292. *
  11293. * numbers.then(_.spread(function(x, y) {
  11294. * return x + y;
  11295. * }));
  11296. * // => a Promise of 76
  11297. */
  11298. function spread(func, start) {
  11299. if (typeof func != 'function') {
  11300. throw new TypeError(FUNC_ERROR_TEXT);
  11301. }
  11302. start = start == null ? 0 : nativeMax(toInteger(start), 0);
  11303. return baseRest(function(args) {
  11304. var array = args[start],
  11305. otherArgs = castSlice(args, 0, start);
  11306. if (array) {
  11307. arrayPush(otherArgs, array);
  11308. }
  11309. return apply(func, this, otherArgs);
  11310. });
  11311. }
  11312. /**
  11313. * Creates a throttled function that only invokes `func` at most once per
  11314. * every `wait` milliseconds. The throttled function comes with a `cancel`
  11315. * method to cancel delayed `func` invocations and a `flush` method to
  11316. * immediately invoke them. Provide `options` to indicate whether `func`
  11317. * should be invoked on the leading and/or trailing edge of the `wait`
  11318. * timeout. The `func` is invoked with the last arguments provided to the
  11319. * throttled function. Subsequent calls to the throttled function return the
  11320. * result of the last `func` invocation.
  11321. *
  11322. * **Note:** If `leading` and `trailing` options are `true`, `func` is
  11323. * invoked on the trailing edge of the timeout only if the throttled function
  11324. * is invoked more than once during the `wait` timeout.
  11325. *
  11326. * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred
  11327. * until to the next tick, similar to `setTimeout` with a timeout of `0`.
  11328. *
  11329. * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/)
  11330. * for details over the differences between `_.throttle` and `_.debounce`.
  11331. *
  11332. * @static
  11333. * @memberOf _
  11334. * @since 0.1.0
  11335. * @category Function
  11336. * @param {Function} func The function to throttle.
  11337. * @param {number} [wait=0] The number of milliseconds to throttle invocations to.
  11338. * @param {Object} [options={}] The options object.
  11339. * @param {boolean} [options.leading=true]
  11340. * Specify invoking on the leading edge of the timeout.
  11341. * @param {boolean} [options.trailing=true]
  11342. * Specify invoking on the trailing edge of the timeout.
  11343. * @returns {Function} Returns the new throttled function.
  11344. * @example
  11345. *
  11346. * // Avoid excessively updating the position while scrolling.
  11347. * jQuery(window).on('scroll', _.throttle(updatePosition, 100));
  11348. *
  11349. * // Invoke `renewToken` when the click event is fired, but not more than once every 5 minutes.
  11350. * var throttled = _.throttle(renewToken, 300000, { 'trailing': false });
  11351. * jQuery(element).on('click', throttled);
  11352. *
  11353. * // Cancel the trailing throttled invocation.
  11354. * jQuery(window).on('popstate', throttled.cancel);
  11355. */
  11356. function throttle(func, wait, options) {
  11357. var leading = true,
  11358. trailing = true;
  11359. if (typeof func != 'function') {
  11360. throw new TypeError(FUNC_ERROR_TEXT);
  11361. }
  11362. if (isObject(options)) {
  11363. leading = 'leading' in options ? !!options.leading : leading;
  11364. trailing = 'trailing' in options ? !!options.trailing : trailing;
  11365. }
  11366. return debounce(func, wait, {
  11367. 'leading': leading,
  11368. 'maxWait': wait,
  11369. 'trailing': trailing
  11370. });
  11371. }
  11372. /**
  11373. * Creates a function that accepts up to one argument, ignoring any
  11374. * additional arguments.
  11375. *
  11376. * @static
  11377. * @memberOf _
  11378. * @since 4.0.0
  11379. * @category Function
  11380. * @param {Function} func The function to cap arguments for.
  11381. * @returns {Function} Returns the new capped function.
  11382. * @example
  11383. *
  11384. * _.map(['6', '8', '10'], _.unary(parseInt));
  11385. * // => [6, 8, 10]
  11386. */
  11387. function unary(func) {
  11388. return ary(func, 1);
  11389. }
  11390. /**
  11391. * Creates a function that provides `value` to `wrapper` as its first
  11392. * argument. Any additional arguments provided to the function are appended
  11393. * to those provided to the `wrapper`. The wrapper is invoked with the `this`
  11394. * binding of the created function.
  11395. *
  11396. * @static
  11397. * @memberOf _
  11398. * @since 0.1.0
  11399. * @category Function
  11400. * @param {*} value The value to wrap.
  11401. * @param {Function} [wrapper=identity] The wrapper function.
  11402. * @returns {Function} Returns the new function.
  11403. * @example
  11404. *
  11405. * var p = _.wrap(_.escape, function(func, text) {
  11406. * return '<p>' + func(text) + '</p>';
  11407. * });
  11408. *
  11409. * p('fred, barney, & pebbles');
  11410. * // => '<p>fred, barney, &amp; pebbles</p>'
  11411. */
  11412. function wrap(value, wrapper) {
  11413. return partial(castFunction(wrapper), value);
  11414. }
  11415. /*------------------------------------------------------------------------*/
  11416. /**
  11417. * Casts `value` as an array if it's not one.
  11418. *
  11419. * @static
  11420. * @memberOf _
  11421. * @since 4.4.0
  11422. * @category Lang
  11423. * @param {*} value The value to inspect.
  11424. * @returns {Array} Returns the cast array.
  11425. * @example
  11426. *
  11427. * _.castArray(1);
  11428. * // => [1]
  11429. *
  11430. * _.castArray({ 'a': 1 });
  11431. * // => [{ 'a': 1 }]
  11432. *
  11433. * _.castArray('abc');
  11434. * // => ['abc']
  11435. *
  11436. * _.castArray(null);
  11437. * // => [null]
  11438. *
  11439. * _.castArray(undefined);
  11440. * // => [undefined]
  11441. *
  11442. * _.castArray();
  11443. * // => []
  11444. *
  11445. * var array = [1, 2, 3];
  11446. * console.log(_.castArray(array) === array);
  11447. * // => true
  11448. */
  11449. function castArray() {
  11450. if (!arguments.length) {
  11451. return [];
  11452. }
  11453. var value = arguments[0];
  11454. return isArray(value) ? value : [value];
  11455. }
  11456. /**
  11457. * Creates a shallow clone of `value`.
  11458. *
  11459. * **Note:** This method is loosely based on the
  11460. * [structured clone algorithm](https://mdn.io/Structured_clone_algorithm)
  11461. * and supports cloning arrays, array buffers, booleans, date objects, maps,
  11462. * numbers, `Object` objects, regexes, sets, strings, symbols, and typed
  11463. * arrays. The own enumerable properties of `arguments` objects are cloned
  11464. * as plain objects. An empty object is returned for uncloneable values such
  11465. * as error objects, functions, DOM nodes, and WeakMaps.
  11466. *
  11467. * @static
  11468. * @memberOf _
  11469. * @since 0.1.0
  11470. * @category Lang
  11471. * @param {*} value The value to clone.
  11472. * @returns {*} Returns the cloned value.
  11473. * @see _.cloneDeep
  11474. * @example
  11475. *
  11476. * var objects = [{ 'a': 1 }, { 'b': 2 }];
  11477. *
  11478. * var shallow = _.clone(objects);
  11479. * console.log(shallow[0] === objects[0]);
  11480. * // => true
  11481. */
  11482. function clone(value) {
  11483. return baseClone(value, CLONE_SYMBOLS_FLAG);
  11484. }
  11485. /**
  11486. * This method is like `_.clone` except that it accepts `customizer` which
  11487. * is invoked to produce the cloned value. If `customizer` returns `undefined`,
  11488. * cloning is handled by the method instead. The `customizer` is invoked with
  11489. * up to four arguments; (value [, index|key, object, stack]).
  11490. *
  11491. * @static
  11492. * @memberOf _
  11493. * @since 4.0.0
  11494. * @category Lang
  11495. * @param {*} value The value to clone.
  11496. * @param {Function} [customizer] The function to customize cloning.
  11497. * @returns {*} Returns the cloned value.
  11498. * @see _.cloneDeepWith
  11499. * @example
  11500. *
  11501. * function customizer(value) {
  11502. * if (_.isElement(value)) {
  11503. * return value.cloneNode(false);
  11504. * }
  11505. * }
  11506. *
  11507. * var el = _.cloneWith(document.body, customizer);
  11508. *
  11509. * console.log(el === document.body);
  11510. * // => false
  11511. * console.log(el.nodeName);
  11512. * // => 'BODY'
  11513. * console.log(el.childNodes.length);
  11514. * // => 0
  11515. */
  11516. function cloneWith(value, customizer) {
  11517. customizer = typeof customizer == 'function' ? customizer : undefined;
  11518. return baseClone(value, CLONE_SYMBOLS_FLAG, customizer);
  11519. }
  11520. /**
  11521. * This method is like `_.clone` except that it recursively clones `value`.
  11522. *
  11523. * @static
  11524. * @memberOf _
  11525. * @since 1.0.0
  11526. * @category Lang
  11527. * @param {*} value The value to recursively clone.
  11528. * @returns {*} Returns the deep cloned value.
  11529. * @see _.clone
  11530. * @example
  11531. *
  11532. * var objects = [{ 'a': 1 }, { 'b': 2 }];
  11533. *
  11534. * var deep = _.cloneDeep(objects);
  11535. * console.log(deep[0] === objects[0]);
  11536. * // => false
  11537. */
  11538. function cloneDeep(value) {
  11539. return baseClone(value, CLONE_DEEP_FLAG | CLONE_SYMBOLS_FLAG);
  11540. }
  11541. /**
  11542. * This method is like `_.cloneWith` except that it recursively clones `value`.
  11543. *
  11544. * @static
  11545. * @memberOf _
  11546. * @since 4.0.0
  11547. * @category Lang
  11548. * @param {*} value The value to recursively clone.
  11549. * @param {Function} [customizer] The function to customize cloning.
  11550. * @returns {*} Returns the deep cloned value.
  11551. * @see _.cloneWith
  11552. * @example
  11553. *
  11554. * function customizer(value) {
  11555. * if (_.isElement(value)) {
  11556. * return value.cloneNode(true);
  11557. * }
  11558. * }
  11559. *
  11560. * var el = _.cloneDeepWith(document.body, customizer);
  11561. *
  11562. * console.log(el === document.body);
  11563. * // => false
  11564. * console.log(el.nodeName);
  11565. * // => 'BODY'
  11566. * console.log(el.childNodes.length);
  11567. * // => 20
  11568. */
  11569. function cloneDeepWith(value, customizer) {
  11570. customizer = typeof customizer == 'function' ? customizer : undefined;
  11571. return baseClone(value, CLONE_DEEP_FLAG | CLONE_SYMBOLS_FLAG, customizer);
  11572. }
  11573. /**
  11574. * Checks if `object` conforms to `source` by invoking the predicate
  11575. * properties of `source` with the corresponding property values of `object`.
  11576. *
  11577. * **Note:** This method is equivalent to `_.conforms` when `source` is
  11578. * partially applied.
  11579. *
  11580. * @static
  11581. * @memberOf _
  11582. * @since 4.14.0
  11583. * @category Lang
  11584. * @param {Object} object The object to inspect.
  11585. * @param {Object} source The object of property predicates to conform to.
  11586. * @returns {boolean} Returns `true` if `object` conforms, else `false`.
  11587. * @example
  11588. *
  11589. * var object = { 'a': 1, 'b': 2 };
  11590. *
  11591. * _.conformsTo(object, { 'b': function(n) { return n > 1; } });
  11592. * // => true
  11593. *
  11594. * _.conformsTo(object, { 'b': function(n) { return n > 2; } });
  11595. * // => false
  11596. */
  11597. function conformsTo(object, source) {
  11598. return source == null || baseConformsTo(object, source, keys(source));
  11599. }
  11600. /**
  11601. * Performs a
  11602. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  11603. * comparison between two values to determine if they are equivalent.
  11604. *
  11605. * @static
  11606. * @memberOf _
  11607. * @since 4.0.0
  11608. * @category Lang
  11609. * @param {*} value The value to compare.
  11610. * @param {*} other The other value to compare.
  11611. * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
  11612. * @example
  11613. *
  11614. * var object = { 'a': 1 };
  11615. * var other = { 'a': 1 };
  11616. *
  11617. * _.eq(object, object);
  11618. * // => true
  11619. *
  11620. * _.eq(object, other);
  11621. * // => false
  11622. *
  11623. * _.eq('a', 'a');
  11624. * // => true
  11625. *
  11626. * _.eq('a', Object('a'));
  11627. * // => false
  11628. *
  11629. * _.eq(NaN, NaN);
  11630. * // => true
  11631. */
  11632. function eq(value, other) {
  11633. return value === other || (value !== value && other !== other);
  11634. }
  11635. /**
  11636. * Checks if `value` is greater than `other`.
  11637. *
  11638. * @static
  11639. * @memberOf _
  11640. * @since 3.9.0
  11641. * @category Lang
  11642. * @param {*} value The value to compare.
  11643. * @param {*} other The other value to compare.
  11644. * @returns {boolean} Returns `true` if `value` is greater than `other`,
  11645. * else `false`.
  11646. * @see _.lt
  11647. * @example
  11648. *
  11649. * _.gt(3, 1);
  11650. * // => true
  11651. *
  11652. * _.gt(3, 3);
  11653. * // => false
  11654. *
  11655. * _.gt(1, 3);
  11656. * // => false
  11657. */
  11658. var gt = createRelationalOperation(baseGt);
  11659. /**
  11660. * Checks if `value` is greater than or equal to `other`.
  11661. *
  11662. * @static
  11663. * @memberOf _
  11664. * @since 3.9.0
  11665. * @category Lang
  11666. * @param {*} value The value to compare.
  11667. * @param {*} other The other value to compare.
  11668. * @returns {boolean} Returns `true` if `value` is greater than or equal to
  11669. * `other`, else `false`.
  11670. * @see _.lte
  11671. * @example
  11672. *
  11673. * _.gte(3, 1);
  11674. * // => true
  11675. *
  11676. * _.gte(3, 3);
  11677. * // => true
  11678. *
  11679. * _.gte(1, 3);
  11680. * // => false
  11681. */
  11682. var gte = createRelationalOperation(function(value, other) {
  11683. return value >= other;
  11684. });
  11685. /**
  11686. * Checks if `value` is likely an `arguments` object.
  11687. *
  11688. * @static
  11689. * @memberOf _
  11690. * @since 0.1.0
  11691. * @category Lang
  11692. * @param {*} value The value to check.
  11693. * @returns {boolean} Returns `true` if `value` is an `arguments` object,
  11694. * else `false`.
  11695. * @example
  11696. *
  11697. * _.isArguments(function() { return arguments; }());
  11698. * // => true
  11699. *
  11700. * _.isArguments([1, 2, 3]);
  11701. * // => false
  11702. */
  11703. var isArguments = baseIsArguments(function() { return arguments; }()) ? baseIsArguments : function(value) {
  11704. return isObjectLike(value) && hasOwnProperty.call(value, 'callee') &&
  11705. !propertyIsEnumerable.call(value, 'callee');
  11706. };
  11707. /**
  11708. * Checks if `value` is classified as an `Array` object.
  11709. *
  11710. * @static
  11711. * @memberOf _
  11712. * @since 0.1.0
  11713. * @category Lang
  11714. * @param {*} value The value to check.
  11715. * @returns {boolean} Returns `true` if `value` is an array, else `false`.
  11716. * @example
  11717. *
  11718. * _.isArray([1, 2, 3]);
  11719. * // => true
  11720. *
  11721. * _.isArray(document.body.children);
  11722. * // => false
  11723. *
  11724. * _.isArray('abc');
  11725. * // => false
  11726. *
  11727. * _.isArray(_.noop);
  11728. * // => false
  11729. */
  11730. var isArray = Array.isArray;
  11731. /**
  11732. * Checks if `value` is classified as an `ArrayBuffer` object.
  11733. *
  11734. * @static
  11735. * @memberOf _
  11736. * @since 4.3.0
  11737. * @category Lang
  11738. * @param {*} value The value to check.
  11739. * @returns {boolean} Returns `true` if `value` is an array buffer, else `false`.
  11740. * @example
  11741. *
  11742. * _.isArrayBuffer(new ArrayBuffer(2));
  11743. * // => true
  11744. *
  11745. * _.isArrayBuffer(new Array(2));
  11746. * // => false
  11747. */
  11748. var isArrayBuffer = nodeIsArrayBuffer ? baseUnary(nodeIsArrayBuffer) : baseIsArrayBuffer;
  11749. /**
  11750. * Checks if `value` is array-like. A value is considered array-like if it's
  11751. * not a function and has a `value.length` that's an integer greater than or
  11752. * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`.
  11753. *
  11754. * @static
  11755. * @memberOf _
  11756. * @since 4.0.0
  11757. * @category Lang
  11758. * @param {*} value The value to check.
  11759. * @returns {boolean} Returns `true` if `value` is array-like, else `false`.
  11760. * @example
  11761. *
  11762. * _.isArrayLike([1, 2, 3]);
  11763. * // => true
  11764. *
  11765. * _.isArrayLike(document.body.children);
  11766. * // => true
  11767. *
  11768. * _.isArrayLike('abc');
  11769. * // => true
  11770. *
  11771. * _.isArrayLike(_.noop);
  11772. * // => false
  11773. */
  11774. function isArrayLike(value) {
  11775. return value != null && isLength(value.length) && !isFunction(value);
  11776. }
  11777. /**
  11778. * This method is like `_.isArrayLike` except that it also checks if `value`
  11779. * is an object.
  11780. *
  11781. * @static
  11782. * @memberOf _
  11783. * @since 4.0.0
  11784. * @category Lang
  11785. * @param {*} value The value to check.
  11786. * @returns {boolean} Returns `true` if `value` is an array-like object,
  11787. * else `false`.
  11788. * @example
  11789. *
  11790. * _.isArrayLikeObject([1, 2, 3]);
  11791. * // => true
  11792. *
  11793. * _.isArrayLikeObject(document.body.children);
  11794. * // => true
  11795. *
  11796. * _.isArrayLikeObject('abc');
  11797. * // => false
  11798. *
  11799. * _.isArrayLikeObject(_.noop);
  11800. * // => false
  11801. */
  11802. function isArrayLikeObject(value) {
  11803. return isObjectLike(value) && isArrayLike(value);
  11804. }
  11805. /**
  11806. * Checks if `value` is classified as a boolean primitive or object.
  11807. *
  11808. * @static
  11809. * @memberOf _
  11810. * @since 0.1.0
  11811. * @category Lang
  11812. * @param {*} value The value to check.
  11813. * @returns {boolean} Returns `true` if `value` is a boolean, else `false`.
  11814. * @example
  11815. *
  11816. * _.isBoolean(false);
  11817. * // => true
  11818. *
  11819. * _.isBoolean(null);
  11820. * // => false
  11821. */
  11822. function isBoolean(value) {
  11823. return value === true || value === false ||
  11824. (isObjectLike(value) && baseGetTag(value) == boolTag);
  11825. }
  11826. /**
  11827. * Checks if `value` is a buffer.
  11828. *
  11829. * @static
  11830. * @memberOf _
  11831. * @since 4.3.0
  11832. * @category Lang
  11833. * @param {*} value The value to check.
  11834. * @returns {boolean} Returns `true` if `value` is a buffer, else `false`.
  11835. * @example
  11836. *
  11837. * _.isBuffer(new Buffer(2));
  11838. * // => true
  11839. *
  11840. * _.isBuffer(new Uint8Array(2));
  11841. * // => false
  11842. */
  11843. var isBuffer = nativeIsBuffer || stubFalse;
  11844. /**
  11845. * Checks if `value` is classified as a `Date` object.
  11846. *
  11847. * @static
  11848. * @memberOf _
  11849. * @since 0.1.0
  11850. * @category Lang
  11851. * @param {*} value The value to check.
  11852. * @returns {boolean} Returns `true` if `value` is a date object, else `false`.
  11853. * @example
  11854. *
  11855. * _.isDate(new Date);
  11856. * // => true
  11857. *
  11858. * _.isDate('Mon April 23 2012');
  11859. * // => false
  11860. */
  11861. var isDate = nodeIsDate ? baseUnary(nodeIsDate) : baseIsDate;
  11862. /**
  11863. * Checks if `value` is likely a DOM element.
  11864. *
  11865. * @static
  11866. * @memberOf _
  11867. * @since 0.1.0
  11868. * @category Lang
  11869. * @param {*} value The value to check.
  11870. * @returns {boolean} Returns `true` if `value` is a DOM element, else `false`.
  11871. * @example
  11872. *
  11873. * _.isElement(document.body);
  11874. * // => true
  11875. *
  11876. * _.isElement('<body>');
  11877. * // => false
  11878. */
  11879. function isElement(value) {
  11880. return isObjectLike(value) && value.nodeType === 1 && !isPlainObject(value);
  11881. }
  11882. /**
  11883. * Checks if `value` is an empty object, collection, map, or set.
  11884. *
  11885. * Objects are considered empty if they have no own enumerable string keyed
  11886. * properties.
  11887. *
  11888. * Array-like values such as `arguments` objects, arrays, buffers, strings, or
  11889. * jQuery-like collections are considered empty if they have a `length` of `0`.
  11890. * Similarly, maps and sets are considered empty if they have a `size` of `0`.
  11891. *
  11892. * @static
  11893. * @memberOf _
  11894. * @since 0.1.0
  11895. * @category Lang
  11896. * @param {*} value The value to check.
  11897. * @returns {boolean} Returns `true` if `value` is empty, else `false`.
  11898. * @example
  11899. *
  11900. * _.isEmpty(null);
  11901. * // => true
  11902. *
  11903. * _.isEmpty(true);
  11904. * // => true
  11905. *
  11906. * _.isEmpty(1);
  11907. * // => true
  11908. *
  11909. * _.isEmpty([1, 2, 3]);
  11910. * // => false
  11911. *
  11912. * _.isEmpty({ 'a': 1 });
  11913. * // => false
  11914. */
  11915. function isEmpty(value) {
  11916. if (value == null) {
  11917. return true;
  11918. }
  11919. if (isArrayLike(value) &&
  11920. (isArray(value) || typeof value == 'string' || typeof value.splice == 'function' ||
  11921. isBuffer(value) || isTypedArray(value) || isArguments(value))) {
  11922. return !value.length;
  11923. }
  11924. var tag = getTag(value);
  11925. if (tag == mapTag || tag == setTag) {
  11926. return !value.size;
  11927. }
  11928. if (isPrototype(value)) {
  11929. return !baseKeys(value).length;
  11930. }
  11931. for (var key in value) {
  11932. if (hasOwnProperty.call(value, key)) {
  11933. return false;
  11934. }
  11935. }
  11936. return true;
  11937. }
  11938. /**
  11939. * Performs a deep comparison between two values to determine if they are
  11940. * equivalent.
  11941. *
  11942. * **Note:** This method supports comparing arrays, array buffers, booleans,
  11943. * date objects, error objects, maps, numbers, `Object` objects, regexes,
  11944. * sets, strings, symbols, and typed arrays. `Object` objects are compared
  11945. * by their own, not inherited, enumerable properties. Functions and DOM
  11946. * nodes are compared by strict equality, i.e. `===`.
  11947. *
  11948. * @static
  11949. * @memberOf _
  11950. * @since 0.1.0
  11951. * @category Lang
  11952. * @param {*} value The value to compare.
  11953. * @param {*} other The other value to compare.
  11954. * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
  11955. * @example
  11956. *
  11957. * var object = { 'a': 1 };
  11958. * var other = { 'a': 1 };
  11959. *
  11960. * _.isEqual(object, other);
  11961. * // => true
  11962. *
  11963. * object === other;
  11964. * // => false
  11965. */
  11966. function isEqual(value, other) {
  11967. return baseIsEqual(value, other);
  11968. }
  11969. /**
  11970. * This method is like `_.isEqual` except that it accepts `customizer` which
  11971. * is invoked to compare values. If `customizer` returns `undefined`, comparisons
  11972. * are handled by the method instead. The `customizer` is invoked with up to
  11973. * six arguments: (objValue, othValue [, index|key, object, other, stack]).
  11974. *
  11975. * @static
  11976. * @memberOf _
  11977. * @since 4.0.0
  11978. * @category Lang
  11979. * @param {*} value The value to compare.
  11980. * @param {*} other The other value to compare.
  11981. * @param {Function} [customizer] The function to customize comparisons.
  11982. * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
  11983. * @example
  11984. *
  11985. * function isGreeting(value) {
  11986. * return /^h(?:i|ello)$/.test(value);
  11987. * }
  11988. *
  11989. * function customizer(objValue, othValue) {
  11990. * if (isGreeting(objValue) && isGreeting(othValue)) {
  11991. * return true;
  11992. * }
  11993. * }
  11994. *
  11995. * var array = ['hello', 'goodbye'];
  11996. * var other = ['hi', 'goodbye'];
  11997. *
  11998. * _.isEqualWith(array, other, customizer);
  11999. * // => true
  12000. */
  12001. function isEqualWith(value, other, customizer) {
  12002. customizer = typeof customizer == 'function' ? customizer : undefined;
  12003. var result = customizer ? customizer(value, other) : undefined;
  12004. return result === undefined ? baseIsEqual(value, other, undefined, customizer) : !!result;
  12005. }
  12006. /**
  12007. * Checks if `value` is an `Error`, `EvalError`, `RangeError`, `ReferenceError`,
  12008. * `SyntaxError`, `TypeError`, or `URIError` object.
  12009. *
  12010. * @static
  12011. * @memberOf _
  12012. * @since 3.0.0
  12013. * @category Lang
  12014. * @param {*} value The value to check.
  12015. * @returns {boolean} Returns `true` if `value` is an error object, else `false`.
  12016. * @example
  12017. *
  12018. * _.isError(new Error);
  12019. * // => true
  12020. *
  12021. * _.isError(Error);
  12022. * // => false
  12023. */
  12024. function isError(value) {
  12025. if (!isObjectLike(value)) {
  12026. return false;
  12027. }
  12028. var tag = baseGetTag(value);
  12029. return tag == errorTag || tag == domExcTag ||
  12030. (typeof value.message == 'string' && typeof value.name == 'string' && !isPlainObject(value));
  12031. }
  12032. /**
  12033. * Checks if `value` is a finite primitive number.
  12034. *
  12035. * **Note:** This method is based on
  12036. * [`Number.isFinite`](https://mdn.io/Number/isFinite).
  12037. *
  12038. * @static
  12039. * @memberOf _
  12040. * @since 0.1.0
  12041. * @category Lang
  12042. * @param {*} value The value to check.
  12043. * @returns {boolean} Returns `true` if `value` is a finite number, else `false`.
  12044. * @example
  12045. *
  12046. * _.isFinite(3);
  12047. * // => true
  12048. *
  12049. * _.isFinite(Number.MIN_VALUE);
  12050. * // => true
  12051. *
  12052. * _.isFinite(Infinity);
  12053. * // => false
  12054. *
  12055. * _.isFinite('3');
  12056. * // => false
  12057. */
  12058. function isFinite(value) {
  12059. return typeof value == 'number' && nativeIsFinite(value);
  12060. }
  12061. /**
  12062. * Checks if `value` is classified as a `Function` object.
  12063. *
  12064. * @static
  12065. * @memberOf _
  12066. * @since 0.1.0
  12067. * @category Lang
  12068. * @param {*} value The value to check.
  12069. * @returns {boolean} Returns `true` if `value` is a function, else `false`.
  12070. * @example
  12071. *
  12072. * _.isFunction(_);
  12073. * // => true
  12074. *
  12075. * _.isFunction(/abc/);
  12076. * // => false
  12077. */
  12078. function isFunction(value) {
  12079. if (!isObject(value)) {
  12080. return false;
  12081. }
  12082. // The use of `Object#toString` avoids issues with the `typeof` operator
  12083. // in Safari 9 which returns 'object' for typed arrays and other constructors.
  12084. var tag = baseGetTag(value);
  12085. return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag;
  12086. }
  12087. /**
  12088. * Checks if `value` is an integer.
  12089. *
  12090. * **Note:** This method is based on
  12091. * [`Number.isInteger`](https://mdn.io/Number/isInteger).
  12092. *
  12093. * @static
  12094. * @memberOf _
  12095. * @since 4.0.0
  12096. * @category Lang
  12097. * @param {*} value The value to check.
  12098. * @returns {boolean} Returns `true` if `value` is an integer, else `false`.
  12099. * @example
  12100. *
  12101. * _.isInteger(3);
  12102. * // => true
  12103. *
  12104. * _.isInteger(Number.MIN_VALUE);
  12105. * // => false
  12106. *
  12107. * _.isInteger(Infinity);
  12108. * // => false
  12109. *
  12110. * _.isInteger('3');
  12111. * // => false
  12112. */
  12113. function isInteger(value) {
  12114. return typeof value == 'number' && value == toInteger(value);
  12115. }
  12116. /**
  12117. * Checks if `value` is a valid array-like length.
  12118. *
  12119. * **Note:** This method is loosely based on
  12120. * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).
  12121. *
  12122. * @static
  12123. * @memberOf _
  12124. * @since 4.0.0
  12125. * @category Lang
  12126. * @param {*} value The value to check.
  12127. * @returns {boolean} Returns `true` if `value` is a valid length, else `false`.
  12128. * @example
  12129. *
  12130. * _.isLength(3);
  12131. * // => true
  12132. *
  12133. * _.isLength(Number.MIN_VALUE);
  12134. * // => false
  12135. *
  12136. * _.isLength(Infinity);
  12137. * // => false
  12138. *
  12139. * _.isLength('3');
  12140. * // => false
  12141. */
  12142. function isLength(value) {
  12143. return typeof value == 'number' &&
  12144. value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;
  12145. }
  12146. /**
  12147. * Checks if `value` is the
  12148. * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)
  12149. * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
  12150. *
  12151. * @static
  12152. * @memberOf _
  12153. * @since 0.1.0
  12154. * @category Lang
  12155. * @param {*} value The value to check.
  12156. * @returns {boolean} Returns `true` if `value` is an object, else `false`.
  12157. * @example
  12158. *
  12159. * _.isObject({});
  12160. * // => true
  12161. *
  12162. * _.isObject([1, 2, 3]);
  12163. * // => true
  12164. *
  12165. * _.isObject(_.noop);
  12166. * // => true
  12167. *
  12168. * _.isObject(null);
  12169. * // => false
  12170. */
  12171. function isObject(value) {
  12172. var type = typeof value;
  12173. return value != null && (type == 'object' || type == 'function');
  12174. }
  12175. /**
  12176. * Checks if `value` is object-like. A value is object-like if it's not `null`
  12177. * and has a `typeof` result of "object".
  12178. *
  12179. * @static
  12180. * @memberOf _
  12181. * @since 4.0.0
  12182. * @category Lang
  12183. * @param {*} value The value to check.
  12184. * @returns {boolean} Returns `true` if `value` is object-like, else `false`.
  12185. * @example
  12186. *
  12187. * _.isObjectLike({});
  12188. * // => true
  12189. *
  12190. * _.isObjectLike([1, 2, 3]);
  12191. * // => true
  12192. *
  12193. * _.isObjectLike(_.noop);
  12194. * // => false
  12195. *
  12196. * _.isObjectLike(null);
  12197. * // => false
  12198. */
  12199. function isObjectLike(value) {
  12200. return value != null && typeof value == 'object';
  12201. }
  12202. /**
  12203. * Checks if `value` is classified as a `Map` object.
  12204. *
  12205. * @static
  12206. * @memberOf _
  12207. * @since 4.3.0
  12208. * @category Lang
  12209. * @param {*} value The value to check.
  12210. * @returns {boolean} Returns `true` if `value` is a map, else `false`.
  12211. * @example
  12212. *
  12213. * _.isMap(new Map);
  12214. * // => true
  12215. *
  12216. * _.isMap(new WeakMap);
  12217. * // => false
  12218. */
  12219. var isMap = nodeIsMap ? baseUnary(nodeIsMap) : baseIsMap;
  12220. /**
  12221. * Performs a partial deep comparison between `object` and `source` to
  12222. * determine if `object` contains equivalent property values.
  12223. *
  12224. * **Note:** This method is equivalent to `_.matches` when `source` is
  12225. * partially applied.
  12226. *
  12227. * Partial comparisons will match empty array and empty object `source`
  12228. * values against any array or object value, respectively. See `_.isEqual`
  12229. * for a list of supported value comparisons.
  12230. *
  12231. * @static
  12232. * @memberOf _
  12233. * @since 3.0.0
  12234. * @category Lang
  12235. * @param {Object} object The object to inspect.
  12236. * @param {Object} source The object of property values to match.
  12237. * @returns {boolean} Returns `true` if `object` is a match, else `false`.
  12238. * @example
  12239. *
  12240. * var object = { 'a': 1, 'b': 2 };
  12241. *
  12242. * _.isMatch(object, { 'b': 2 });
  12243. * // => true
  12244. *
  12245. * _.isMatch(object, { 'b': 1 });
  12246. * // => false
  12247. */
  12248. function isMatch(object, source) {
  12249. return object === source || baseIsMatch(object, source, getMatchData(source));
  12250. }
  12251. /**
  12252. * This method is like `_.isMatch` except that it accepts `customizer` which
  12253. * is invoked to compare values. If `customizer` returns `undefined`, comparisons
  12254. * are handled by the method instead. The `customizer` is invoked with five
  12255. * arguments: (objValue, srcValue, index|key, object, source).
  12256. *
  12257. * @static
  12258. * @memberOf _
  12259. * @since 4.0.0
  12260. * @category Lang
  12261. * @param {Object} object The object to inspect.
  12262. * @param {Object} source The object of property values to match.
  12263. * @param {Function} [customizer] The function to customize comparisons.
  12264. * @returns {boolean} Returns `true` if `object` is a match, else `false`.
  12265. * @example
  12266. *
  12267. * function isGreeting(value) {
  12268. * return /^h(?:i|ello)$/.test(value);
  12269. * }
  12270. *
  12271. * function customizer(objValue, srcValue) {
  12272. * if (isGreeting(objValue) && isGreeting(srcValue)) {
  12273. * return true;
  12274. * }
  12275. * }
  12276. *
  12277. * var object = { 'greeting': 'hello' };
  12278. * var source = { 'greeting': 'hi' };
  12279. *
  12280. * _.isMatchWith(object, source, customizer);
  12281. * // => true
  12282. */
  12283. function isMatchWith(object, source, customizer) {
  12284. customizer = typeof customizer == 'function' ? customizer : undefined;
  12285. return baseIsMatch(object, source, getMatchData(source), customizer);
  12286. }
  12287. /**
  12288. * Checks if `value` is `NaN`.
  12289. *
  12290. * **Note:** This method is based on
  12291. * [`Number.isNaN`](https://mdn.io/Number/isNaN) and is not the same as
  12292. * global [`isNaN`](https://mdn.io/isNaN) which returns `true` for
  12293. * `undefined` and other non-number values.
  12294. *
  12295. * @static
  12296. * @memberOf _
  12297. * @since 0.1.0
  12298. * @category Lang
  12299. * @param {*} value The value to check.
  12300. * @returns {boolean} Returns `true` if `value` is `NaN`, else `false`.
  12301. * @example
  12302. *
  12303. * _.isNaN(NaN);
  12304. * // => true
  12305. *
  12306. * _.isNaN(new Number(NaN));
  12307. * // => true
  12308. *
  12309. * isNaN(undefined);
  12310. * // => true
  12311. *
  12312. * _.isNaN(undefined);
  12313. * // => false
  12314. */
  12315. function isNaN(value) {
  12316. // An `NaN` primitive is the only value that is not equal to itself.
  12317. // Perform the `toStringTag` check first to avoid errors with some
  12318. // ActiveX objects in IE.
  12319. return isNumber(value) && value != +value;
  12320. }
  12321. /**
  12322. * Checks if `value` is a pristine native function.
  12323. *
  12324. * **Note:** This method can't reliably detect native functions in the presence
  12325. * of the core-js package because core-js circumvents this kind of detection.
  12326. * Despite multiple requests, the core-js maintainer has made it clear: any
  12327. * attempt to fix the detection will be obstructed. As a result, we're left
  12328. * with little choice but to throw an error. Unfortunately, this also affects
  12329. * packages, like [babel-polyfill](https://www.npmjs.com/package/babel-polyfill),
  12330. * which rely on core-js.
  12331. *
  12332. * @static
  12333. * @memberOf _
  12334. * @since 3.0.0
  12335. * @category Lang
  12336. * @param {*} value The value to check.
  12337. * @returns {boolean} Returns `true` if `value` is a native function,
  12338. * else `false`.
  12339. * @example
  12340. *
  12341. * _.isNative(Array.prototype.push);
  12342. * // => true
  12343. *
  12344. * _.isNative(_);
  12345. * // => false
  12346. */
  12347. function isNative(value) {
  12348. if (isMaskable(value)) {
  12349. throw new Error(CORE_ERROR_TEXT);
  12350. }
  12351. return baseIsNative(value);
  12352. }
  12353. /**
  12354. * Checks if `value` is `null`.
  12355. *
  12356. * @static
  12357. * @memberOf _
  12358. * @since 0.1.0
  12359. * @category Lang
  12360. * @param {*} value The value to check.
  12361. * @returns {boolean} Returns `true` if `value` is `null`, else `false`.
  12362. * @example
  12363. *
  12364. * _.isNull(null);
  12365. * // => true
  12366. *
  12367. * _.isNull(void 0);
  12368. * // => false
  12369. */
  12370. function isNull(value) {
  12371. return value === null;
  12372. }
  12373. /**
  12374. * Checks if `value` is `null` or `undefined`.
  12375. *
  12376. * @static
  12377. * @memberOf _
  12378. * @since 4.0.0
  12379. * @category Lang
  12380. * @param {*} value The value to check.
  12381. * @returns {boolean} Returns `true` if `value` is nullish, else `false`.
  12382. * @example
  12383. *
  12384. * _.isNil(null);
  12385. * // => true
  12386. *
  12387. * _.isNil(void 0);
  12388. * // => true
  12389. *
  12390. * _.isNil(NaN);
  12391. * // => false
  12392. */
  12393. function isNil(value) {
  12394. return value == null;
  12395. }
  12396. /**
  12397. * Checks if `value` is classified as a `Number` primitive or object.
  12398. *
  12399. * **Note:** To exclude `Infinity`, `-Infinity`, and `NaN`, which are
  12400. * classified as numbers, use the `_.isFinite` method.
  12401. *
  12402. * @static
  12403. * @memberOf _
  12404. * @since 0.1.0
  12405. * @category Lang
  12406. * @param {*} value The value to check.
  12407. * @returns {boolean} Returns `true` if `value` is a number, else `false`.
  12408. * @example
  12409. *
  12410. * _.isNumber(3);
  12411. * // => true
  12412. *
  12413. * _.isNumber(Number.MIN_VALUE);
  12414. * // => true
  12415. *
  12416. * _.isNumber(Infinity);
  12417. * // => true
  12418. *
  12419. * _.isNumber('3');
  12420. * // => false
  12421. */
  12422. function isNumber(value) {
  12423. return typeof value == 'number' ||
  12424. (isObjectLike(value) && baseGetTag(value) == numberTag);
  12425. }
  12426. /**
  12427. * Checks if `value` is a plain object, that is, an object created by the
  12428. * `Object` constructor or one with a `[[Prototype]]` of `null`.
  12429. *
  12430. * @static
  12431. * @memberOf _
  12432. * @since 0.8.0
  12433. * @category Lang
  12434. * @param {*} value The value to check.
  12435. * @returns {boolean} Returns `true` if `value` is a plain object, else `false`.
  12436. * @example
  12437. *
  12438. * function Foo() {
  12439. * this.a = 1;
  12440. * }
  12441. *
  12442. * _.isPlainObject(new Foo);
  12443. * // => false
  12444. *
  12445. * _.isPlainObject([1, 2, 3]);
  12446. * // => false
  12447. *
  12448. * _.isPlainObject({ 'x': 0, 'y': 0 });
  12449. * // => true
  12450. *
  12451. * _.isPlainObject(Object.create(null));
  12452. * // => true
  12453. */
  12454. function isPlainObject(value) {
  12455. if (!isObjectLike(value) || baseGetTag(value) != objectTag) {
  12456. return false;
  12457. }
  12458. var proto = getPrototype(value);
  12459. if (proto === null) {
  12460. return true;
  12461. }
  12462. var Ctor = hasOwnProperty.call(proto, 'constructor') && proto.constructor;
  12463. return typeof Ctor == 'function' && Ctor instanceof Ctor &&
  12464. funcToString.call(Ctor) == objectCtorString;
  12465. }
  12466. /**
  12467. * Checks if `value` is classified as a `RegExp` object.
  12468. *
  12469. * @static
  12470. * @memberOf _
  12471. * @since 0.1.0
  12472. * @category Lang
  12473. * @param {*} value The value to check.
  12474. * @returns {boolean} Returns `true` if `value` is a regexp, else `false`.
  12475. * @example
  12476. *
  12477. * _.isRegExp(/abc/);
  12478. * // => true
  12479. *
  12480. * _.isRegExp('/abc/');
  12481. * // => false
  12482. */
  12483. var isRegExp = nodeIsRegExp ? baseUnary(nodeIsRegExp) : baseIsRegExp;
  12484. /**
  12485. * Checks if `value` is a safe integer. An integer is safe if it's an IEEE-754
  12486. * double precision number which isn't the result of a rounded unsafe integer.
  12487. *
  12488. * **Note:** This method is based on
  12489. * [`Number.isSafeInteger`](https://mdn.io/Number/isSafeInteger).
  12490. *
  12491. * @static
  12492. * @memberOf _
  12493. * @since 4.0.0
  12494. * @category Lang
  12495. * @param {*} value The value to check.
  12496. * @returns {boolean} Returns `true` if `value` is a safe integer, else `false`.
  12497. * @example
  12498. *
  12499. * _.isSafeInteger(3);
  12500. * // => true
  12501. *
  12502. * _.isSafeInteger(Number.MIN_VALUE);
  12503. * // => false
  12504. *
  12505. * _.isSafeInteger(Infinity);
  12506. * // => false
  12507. *
  12508. * _.isSafeInteger('3');
  12509. * // => false
  12510. */
  12511. function isSafeInteger(value) {
  12512. return isInteger(value) && value >= -MAX_SAFE_INTEGER && value <= MAX_SAFE_INTEGER;
  12513. }
  12514. /**
  12515. * Checks if `value` is classified as a `Set` object.
  12516. *
  12517. * @static
  12518. * @memberOf _
  12519. * @since 4.3.0
  12520. * @category Lang
  12521. * @param {*} value The value to check.
  12522. * @returns {boolean} Returns `true` if `value` is a set, else `false`.
  12523. * @example
  12524. *
  12525. * _.isSet(new Set);
  12526. * // => true
  12527. *
  12528. * _.isSet(new WeakSet);
  12529. * // => false
  12530. */
  12531. var isSet = nodeIsSet ? baseUnary(nodeIsSet) : baseIsSet;
  12532. /**
  12533. * Checks if `value` is classified as a `String` primitive or object.
  12534. *
  12535. * @static
  12536. * @since 0.1.0
  12537. * @memberOf _
  12538. * @category Lang
  12539. * @param {*} value The value to check.
  12540. * @returns {boolean} Returns `true` if `value` is a string, else `false`.
  12541. * @example
  12542. *
  12543. * _.isString('abc');
  12544. * // => true
  12545. *
  12546. * _.isString(1);
  12547. * // => false
  12548. */
  12549. function isString(value) {
  12550. return typeof value == 'string' ||
  12551. (!isArray(value) && isObjectLike(value) && baseGetTag(value) == stringTag);
  12552. }
  12553. /**
  12554. * Checks if `value` is classified as a `Symbol` primitive or object.
  12555. *
  12556. * @static
  12557. * @memberOf _
  12558. * @since 4.0.0
  12559. * @category Lang
  12560. * @param {*} value The value to check.
  12561. * @returns {boolean} Returns `true` if `value` is a symbol, else `false`.
  12562. * @example
  12563. *
  12564. * _.isSymbol(Symbol.iterator);
  12565. * // => true
  12566. *
  12567. * _.isSymbol('abc');
  12568. * // => false
  12569. */
  12570. function isSymbol(value) {
  12571. return typeof value == 'symbol' ||
  12572. (isObjectLike(value) && baseGetTag(value) == symbolTag);
  12573. }
  12574. /**
  12575. * Checks if `value` is classified as a typed array.
  12576. *
  12577. * @static
  12578. * @memberOf _
  12579. * @since 3.0.0
  12580. * @category Lang
  12581. * @param {*} value The value to check.
  12582. * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.
  12583. * @example
  12584. *
  12585. * _.isTypedArray(new Uint8Array);
  12586. * // => true
  12587. *
  12588. * _.isTypedArray([]);
  12589. * // => false
  12590. */
  12591. var isTypedArray = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray;
  12592. /**
  12593. * Checks if `value` is `undefined`.
  12594. *
  12595. * @static
  12596. * @since 0.1.0
  12597. * @memberOf _
  12598. * @category Lang
  12599. * @param {*} value The value to check.
  12600. * @returns {boolean} Returns `true` if `value` is `undefined`, else `false`.
  12601. * @example
  12602. *
  12603. * _.isUndefined(void 0);
  12604. * // => true
  12605. *
  12606. * _.isUndefined(null);
  12607. * // => false
  12608. */
  12609. function isUndefined(value) {
  12610. return value === undefined;
  12611. }
  12612. /**
  12613. * Checks if `value` is classified as a `WeakMap` object.
  12614. *
  12615. * @static
  12616. * @memberOf _
  12617. * @since 4.3.0
  12618. * @category Lang
  12619. * @param {*} value The value to check.
  12620. * @returns {boolean} Returns `true` if `value` is a weak map, else `false`.
  12621. * @example
  12622. *
  12623. * _.isWeakMap(new WeakMap);
  12624. * // => true
  12625. *
  12626. * _.isWeakMap(new Map);
  12627. * // => false
  12628. */
  12629. function isWeakMap(value) {
  12630. return isObjectLike(value) && getTag(value) == weakMapTag;
  12631. }
  12632. /**
  12633. * Checks if `value` is classified as a `WeakSet` object.
  12634. *
  12635. * @static
  12636. * @memberOf _
  12637. * @since 4.3.0
  12638. * @category Lang
  12639. * @param {*} value The value to check.
  12640. * @returns {boolean} Returns `true` if `value` is a weak set, else `false`.
  12641. * @example
  12642. *
  12643. * _.isWeakSet(new WeakSet);
  12644. * // => true
  12645. *
  12646. * _.isWeakSet(new Set);
  12647. * // => false
  12648. */
  12649. function isWeakSet(value) {
  12650. return isObjectLike(value) && baseGetTag(value) == weakSetTag;
  12651. }
  12652. /**
  12653. * Checks if `value` is less than `other`.
  12654. *
  12655. * @static
  12656. * @memberOf _
  12657. * @since 3.9.0
  12658. * @category Lang
  12659. * @param {*} value The value to compare.
  12660. * @param {*} other The other value to compare.
  12661. * @returns {boolean} Returns `true` if `value` is less than `other`,
  12662. * else `false`.
  12663. * @see _.gt
  12664. * @example
  12665. *
  12666. * _.lt(1, 3);
  12667. * // => true
  12668. *
  12669. * _.lt(3, 3);
  12670. * // => false
  12671. *
  12672. * _.lt(3, 1);
  12673. * // => false
  12674. */
  12675. var lt = createRelationalOperation(baseLt);
  12676. /**
  12677. * Checks if `value` is less than or equal to `other`.
  12678. *
  12679. * @static
  12680. * @memberOf _
  12681. * @since 3.9.0
  12682. * @category Lang
  12683. * @param {*} value The value to compare.
  12684. * @param {*} other The other value to compare.
  12685. * @returns {boolean} Returns `true` if `value` is less than or equal to
  12686. * `other`, else `false`.
  12687. * @see _.gte
  12688. * @example
  12689. *
  12690. * _.lte(1, 3);
  12691. * // => true
  12692. *
  12693. * _.lte(3, 3);
  12694. * // => true
  12695. *
  12696. * _.lte(3, 1);
  12697. * // => false
  12698. */
  12699. var lte = createRelationalOperation(function(value, other) {
  12700. return value <= other;
  12701. });
  12702. /**
  12703. * Converts `value` to an array.
  12704. *
  12705. * @static
  12706. * @since 0.1.0
  12707. * @memberOf _
  12708. * @category Lang
  12709. * @param {*} value The value to convert.
  12710. * @returns {Array} Returns the converted array.
  12711. * @example
  12712. *
  12713. * _.toArray({ 'a': 1, 'b': 2 });
  12714. * // => [1, 2]
  12715. *
  12716. * _.toArray('abc');
  12717. * // => ['a', 'b', 'c']
  12718. *
  12719. * _.toArray(1);
  12720. * // => []
  12721. *
  12722. * _.toArray(null);
  12723. * // => []
  12724. */
  12725. function toArray(value) {
  12726. if (!value) {
  12727. return [];
  12728. }
  12729. if (isArrayLike(value)) {
  12730. return isString(value) ? stringToArray(value) : copyArray(value);
  12731. }
  12732. if (symIterator && value[symIterator]) {
  12733. return iteratorToArray(value[symIterator]());
  12734. }
  12735. var tag = getTag(value),
  12736. func = tag == mapTag ? mapToArray : (tag == setTag ? setToArray : values);
  12737. return func(value);
  12738. }
  12739. /**
  12740. * Converts `value` to a finite number.
  12741. *
  12742. * @static
  12743. * @memberOf _
  12744. * @since 4.12.0
  12745. * @category Lang
  12746. * @param {*} value The value to convert.
  12747. * @returns {number} Returns the converted number.
  12748. * @example
  12749. *
  12750. * _.toFinite(3.2);
  12751. * // => 3.2
  12752. *
  12753. * _.toFinite(Number.MIN_VALUE);
  12754. * // => 5e-324
  12755. *
  12756. * _.toFinite(Infinity);
  12757. * // => 1.7976931348623157e+308
  12758. *
  12759. * _.toFinite('3.2');
  12760. * // => 3.2
  12761. */
  12762. function toFinite(value) {
  12763. if (!value) {
  12764. return value === 0 ? value : 0;
  12765. }
  12766. value = toNumber(value);
  12767. if (value === INFINITY || value === -INFINITY) {
  12768. var sign = (value < 0 ? -1 : 1);
  12769. return sign * MAX_INTEGER;
  12770. }
  12771. return value === value ? value : 0;
  12772. }
  12773. /**
  12774. * Converts `value` to an integer.
  12775. *
  12776. * **Note:** This method is loosely based on
  12777. * [`ToInteger`](http://www.ecma-international.org/ecma-262/7.0/#sec-tointeger).
  12778. *
  12779. * @static
  12780. * @memberOf _
  12781. * @since 4.0.0
  12782. * @category Lang
  12783. * @param {*} value The value to convert.
  12784. * @returns {number} Returns the converted integer.
  12785. * @example
  12786. *
  12787. * _.toInteger(3.2);
  12788. * // => 3
  12789. *
  12790. * _.toInteger(Number.MIN_VALUE);
  12791. * // => 0
  12792. *
  12793. * _.toInteger(Infinity);
  12794. * // => 1.7976931348623157e+308
  12795. *
  12796. * _.toInteger('3.2');
  12797. * // => 3
  12798. */
  12799. function toInteger(value) {
  12800. var result = toFinite(value),
  12801. remainder = result % 1;
  12802. return result === result ? (remainder ? result - remainder : result) : 0;
  12803. }
  12804. /**
  12805. * Converts `value` to an integer suitable for use as the length of an
  12806. * array-like object.
  12807. *
  12808. * **Note:** This method is based on
  12809. * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).
  12810. *
  12811. * @static
  12812. * @memberOf _
  12813. * @since 4.0.0
  12814. * @category Lang
  12815. * @param {*} value The value to convert.
  12816. * @returns {number} Returns the converted integer.
  12817. * @example
  12818. *
  12819. * _.toLength(3.2);
  12820. * // => 3
  12821. *
  12822. * _.toLength(Number.MIN_VALUE);
  12823. * // => 0
  12824. *
  12825. * _.toLength(Infinity);
  12826. * // => 4294967295
  12827. *
  12828. * _.toLength('3.2');
  12829. * // => 3
  12830. */
  12831. function toLength(value) {
  12832. return value ? baseClamp(toInteger(value), 0, MAX_ARRAY_LENGTH) : 0;
  12833. }
  12834. /**
  12835. * Converts `value` to a number.
  12836. *
  12837. * @static
  12838. * @memberOf _
  12839. * @since 4.0.0
  12840. * @category Lang
  12841. * @param {*} value The value to process.
  12842. * @returns {number} Returns the number.
  12843. * @example
  12844. *
  12845. * _.toNumber(3.2);
  12846. * // => 3.2
  12847. *
  12848. * _.toNumber(Number.MIN_VALUE);
  12849. * // => 5e-324
  12850. *
  12851. * _.toNumber(Infinity);
  12852. * // => Infinity
  12853. *
  12854. * _.toNumber('3.2');
  12855. * // => 3.2
  12856. */
  12857. function toNumber(value) {
  12858. if (typeof value == 'number') {
  12859. return value;
  12860. }
  12861. if (isSymbol(value)) {
  12862. return NAN;
  12863. }
  12864. if (isObject(value)) {
  12865. var other = typeof value.valueOf == 'function' ? value.valueOf() : value;
  12866. value = isObject(other) ? (other + '') : other;
  12867. }
  12868. if (typeof value != 'string') {
  12869. return value === 0 ? value : +value;
  12870. }
  12871. value = baseTrim(value);
  12872. var isBinary = reIsBinary.test(value);
  12873. return (isBinary || reIsOctal.test(value))
  12874. ? freeParseInt(value.slice(2), isBinary ? 2 : 8)
  12875. : (reIsBadHex.test(value) ? NAN : +value);
  12876. }
  12877. /**
  12878. * Converts `value` to a plain object flattening inherited enumerable string
  12879. * keyed properties of `value` to own properties of the plain object.
  12880. *
  12881. * @static
  12882. * @memberOf _
  12883. * @since 3.0.0
  12884. * @category Lang
  12885. * @param {*} value The value to convert.
  12886. * @returns {Object} Returns the converted plain object.
  12887. * @example
  12888. *
  12889. * function Foo() {
  12890. * this.b = 2;
  12891. * }
  12892. *
  12893. * Foo.prototype.c = 3;
  12894. *
  12895. * _.assign({ 'a': 1 }, new Foo);
  12896. * // => { 'a': 1, 'b': 2 }
  12897. *
  12898. * _.assign({ 'a': 1 }, _.toPlainObject(new Foo));
  12899. * // => { 'a': 1, 'b': 2, 'c': 3 }
  12900. */
  12901. function toPlainObject(value) {
  12902. return copyObject(value, keysIn(value));
  12903. }
  12904. /**
  12905. * Converts `value` to a safe integer. A safe integer can be compared and
  12906. * represented correctly.
  12907. *
  12908. * @static
  12909. * @memberOf _
  12910. * @since 4.0.0
  12911. * @category Lang
  12912. * @param {*} value The value to convert.
  12913. * @returns {number} Returns the converted integer.
  12914. * @example
  12915. *
  12916. * _.toSafeInteger(3.2);
  12917. * // => 3
  12918. *
  12919. * _.toSafeInteger(Number.MIN_VALUE);
  12920. * // => 0
  12921. *
  12922. * _.toSafeInteger(Infinity);
  12923. * // => 9007199254740991
  12924. *
  12925. * _.toSafeInteger('3.2');
  12926. * // => 3
  12927. */
  12928. function toSafeInteger(value) {
  12929. return value
  12930. ? baseClamp(toInteger(value), -MAX_SAFE_INTEGER, MAX_SAFE_INTEGER)
  12931. : (value === 0 ? value : 0);
  12932. }
  12933. /**
  12934. * Converts `value` to a string. An empty string is returned for `null`
  12935. * and `undefined` values. The sign of `-0` is preserved.
  12936. *
  12937. * @static
  12938. * @memberOf _
  12939. * @since 4.0.0
  12940. * @category Lang
  12941. * @param {*} value The value to convert.
  12942. * @returns {string} Returns the converted string.
  12943. * @example
  12944. *
  12945. * _.toString(null);
  12946. * // => ''
  12947. *
  12948. * _.toString(-0);
  12949. * // => '-0'
  12950. *
  12951. * _.toString([1, 2, 3]);
  12952. * // => '1,2,3'
  12953. */
  12954. function toString(value) {
  12955. return value == null ? '' : baseToString(value);
  12956. }
  12957. /*------------------------------------------------------------------------*/
  12958. /**
  12959. * Assigns own enumerable string keyed properties of source objects to the
  12960. * destination object. Source objects are applied from left to right.
  12961. * Subsequent sources overwrite property assignments of previous sources.
  12962. *
  12963. * **Note:** This method mutates `object` and is loosely based on
  12964. * [`Object.assign`](https://mdn.io/Object/assign).
  12965. *
  12966. * @static
  12967. * @memberOf _
  12968. * @since 0.10.0
  12969. * @category Object
  12970. * @param {Object} object The destination object.
  12971. * @param {...Object} [sources] The source objects.
  12972. * @returns {Object} Returns `object`.
  12973. * @see _.assignIn
  12974. * @example
  12975. *
  12976. * function Foo() {
  12977. * this.a = 1;
  12978. * }
  12979. *
  12980. * function Bar() {
  12981. * this.c = 3;
  12982. * }
  12983. *
  12984. * Foo.prototype.b = 2;
  12985. * Bar.prototype.d = 4;
  12986. *
  12987. * _.assign({ 'a': 0 }, new Foo, new Bar);
  12988. * // => { 'a': 1, 'c': 3 }
  12989. */
  12990. var assign = createAssigner(function(object, source) {
  12991. if (isPrototype(source) || isArrayLike(source)) {
  12992. copyObject(source, keys(source), object);
  12993. return;
  12994. }
  12995. for (var key in source) {
  12996. if (hasOwnProperty.call(source, key)) {
  12997. assignValue(object, key, source[key]);
  12998. }
  12999. }
  13000. });
  13001. /**
  13002. * This method is like `_.assign` except that it iterates over own and
  13003. * inherited source properties.
  13004. *
  13005. * **Note:** This method mutates `object`.
  13006. *
  13007. * @static
  13008. * @memberOf _
  13009. * @since 4.0.0
  13010. * @alias extend
  13011. * @category Object
  13012. * @param {Object} object The destination object.
  13013. * @param {...Object} [sources] The source objects.
  13014. * @returns {Object} Returns `object`.
  13015. * @see _.assign
  13016. * @example
  13017. *
  13018. * function Foo() {
  13019. * this.a = 1;
  13020. * }
  13021. *
  13022. * function Bar() {
  13023. * this.c = 3;
  13024. * }
  13025. *
  13026. * Foo.prototype.b = 2;
  13027. * Bar.prototype.d = 4;
  13028. *
  13029. * _.assignIn({ 'a': 0 }, new Foo, new Bar);
  13030. * // => { 'a': 1, 'b': 2, 'c': 3, 'd': 4 }
  13031. */
  13032. var assignIn = createAssigner(function(object, source) {
  13033. copyObject(source, keysIn(source), object);
  13034. });
  13035. /**
  13036. * This method is like `_.assignIn` except that it accepts `customizer`
  13037. * which is invoked to produce the assigned values. If `customizer` returns
  13038. * `undefined`, assignment is handled by the method instead. The `customizer`
  13039. * is invoked with five arguments: (objValue, srcValue, key, object, source).
  13040. *
  13041. * **Note:** This method mutates `object`.
  13042. *
  13043. * @static
  13044. * @memberOf _
  13045. * @since 4.0.0
  13046. * @alias extendWith
  13047. * @category Object
  13048. * @param {Object} object The destination object.
  13049. * @param {...Object} sources The source objects.
  13050. * @param {Function} [customizer] The function to customize assigned values.
  13051. * @returns {Object} Returns `object`.
  13052. * @see _.assignWith
  13053. * @example
  13054. *
  13055. * function customizer(objValue, srcValue) {
  13056. * return _.isUndefined(objValue) ? srcValue : objValue;
  13057. * }
  13058. *
  13059. * var defaults = _.partialRight(_.assignInWith, customizer);
  13060. *
  13061. * defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 });
  13062. * // => { 'a': 1, 'b': 2 }
  13063. */
  13064. var assignInWith = createAssigner(function(object, source, srcIndex, customizer) {
  13065. copyObject(source, keysIn(source), object, customizer);
  13066. });
  13067. /**
  13068. * This method is like `_.assign` except that it accepts `customizer`
  13069. * which is invoked to produce the assigned values. If `customizer` returns
  13070. * `undefined`, assignment is handled by the method instead. The `customizer`
  13071. * is invoked with five arguments: (objValue, srcValue, key, object, source).
  13072. *
  13073. * **Note:** This method mutates `object`.
  13074. *
  13075. * @static
  13076. * @memberOf _
  13077. * @since 4.0.0
  13078. * @category Object
  13079. * @param {Object} object The destination object.
  13080. * @param {...Object} sources The source objects.
  13081. * @param {Function} [customizer] The function to customize assigned values.
  13082. * @returns {Object} Returns `object`.
  13083. * @see _.assignInWith
  13084. * @example
  13085. *
  13086. * function customizer(objValue, srcValue) {
  13087. * return _.isUndefined(objValue) ? srcValue : objValue;
  13088. * }
  13089. *
  13090. * var defaults = _.partialRight(_.assignWith, customizer);
  13091. *
  13092. * defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 });
  13093. * // => { 'a': 1, 'b': 2 }
  13094. */
  13095. var assignWith = createAssigner(function(object, source, srcIndex, customizer) {
  13096. copyObject(source, keys(source), object, customizer);
  13097. });
  13098. /**
  13099. * Creates an array of values corresponding to `paths` of `object`.
  13100. *
  13101. * @static
  13102. * @memberOf _
  13103. * @since 1.0.0
  13104. * @category Object
  13105. * @param {Object} object The object to iterate over.
  13106. * @param {...(string|string[])} [paths] The property paths to pick.
  13107. * @returns {Array} Returns the picked values.
  13108. * @example
  13109. *
  13110. * var object = { 'a': [{ 'b': { 'c': 3 } }, 4] };
  13111. *
  13112. * _.at(object, ['a[0].b.c', 'a[1]']);
  13113. * // => [3, 4]
  13114. */
  13115. var at = flatRest(baseAt);
  13116. /**
  13117. * Creates an object that inherits from the `prototype` object. If a
  13118. * `properties` object is given, its own enumerable string keyed properties
  13119. * are assigned to the created object.
  13120. *
  13121. * @static
  13122. * @memberOf _
  13123. * @since 2.3.0
  13124. * @category Object
  13125. * @param {Object} prototype The object to inherit from.
  13126. * @param {Object} [properties] The properties to assign to the object.
  13127. * @returns {Object} Returns the new object.
  13128. * @example
  13129. *
  13130. * function Shape() {
  13131. * this.x = 0;
  13132. * this.y = 0;
  13133. * }
  13134. *
  13135. * function Circle() {
  13136. * Shape.call(this);
  13137. * }
  13138. *
  13139. * Circle.prototype = _.create(Shape.prototype, {
  13140. * 'constructor': Circle
  13141. * });
  13142. *
  13143. * var circle = new Circle;
  13144. * circle instanceof Circle;
  13145. * // => true
  13146. *
  13147. * circle instanceof Shape;
  13148. * // => true
  13149. */
  13150. function create(prototype, properties) {
  13151. var result = baseCreate(prototype);
  13152. return properties == null ? result : baseAssign(result, properties);
  13153. }
  13154. /**
  13155. * Assigns own and inherited enumerable string keyed properties of source
  13156. * objects to the destination object for all destination properties that
  13157. * resolve to `undefined`. Source objects are applied from left to right.
  13158. * Once a property is set, additional values of the same property are ignored.
  13159. *
  13160. * **Note:** This method mutates `object`.
  13161. *
  13162. * @static
  13163. * @since 0.1.0
  13164. * @memberOf _
  13165. * @category Object
  13166. * @param {Object} object The destination object.
  13167. * @param {...Object} [sources] The source objects.
  13168. * @returns {Object} Returns `object`.
  13169. * @see _.defaultsDeep
  13170. * @example
  13171. *
  13172. * _.defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 });
  13173. * // => { 'a': 1, 'b': 2 }
  13174. */
  13175. var defaults = baseRest(function(object, sources) {
  13176. object = Object(object);
  13177. var index = -1;
  13178. var length = sources.length;
  13179. var guard = length > 2 ? sources[2] : undefined;
  13180. if (guard && isIterateeCall(sources[0], sources[1], guard)) {
  13181. length = 1;
  13182. }
  13183. while (++index < length) {
  13184. var source = sources[index];
  13185. var props = keysIn(source);
  13186. var propsIndex = -1;
  13187. var propsLength = props.length;
  13188. while (++propsIndex < propsLength) {
  13189. var key = props[propsIndex];
  13190. var value = object[key];
  13191. if (value === undefined ||
  13192. (eq(value, objectProto[key]) && !hasOwnProperty.call(object, key))) {
  13193. object[key] = source[key];
  13194. }
  13195. }
  13196. }
  13197. return object;
  13198. });
  13199. /**
  13200. * This method is like `_.defaults` except that it recursively assigns
  13201. * default properties.
  13202. *
  13203. * **Note:** This method mutates `object`.
  13204. *
  13205. * @static
  13206. * @memberOf _
  13207. * @since 3.10.0
  13208. * @category Object
  13209. * @param {Object} object The destination object.
  13210. * @param {...Object} [sources] The source objects.
  13211. * @returns {Object} Returns `object`.
  13212. * @see _.defaults
  13213. * @example
  13214. *
  13215. * _.defaultsDeep({ 'a': { 'b': 2 } }, { 'a': { 'b': 1, 'c': 3 } });
  13216. * // => { 'a': { 'b': 2, 'c': 3 } }
  13217. */
  13218. var defaultsDeep = baseRest(function(args) {
  13219. args.push(undefined, customDefaultsMerge);
  13220. return apply(mergeWith, undefined, args);
  13221. });
  13222. /**
  13223. * This method is like `_.find` except that it returns the key of the first
  13224. * element `predicate` returns truthy for instead of the element itself.
  13225. *
  13226. * @static
  13227. * @memberOf _
  13228. * @since 1.1.0
  13229. * @category Object
  13230. * @param {Object} object The object to inspect.
  13231. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  13232. * @returns {string|undefined} Returns the key of the matched element,
  13233. * else `undefined`.
  13234. * @example
  13235. *
  13236. * var users = {
  13237. * 'barney': { 'age': 36, 'active': true },
  13238. * 'fred': { 'age': 40, 'active': false },
  13239. * 'pebbles': { 'age': 1, 'active': true }
  13240. * };
  13241. *
  13242. * _.findKey(users, function(o) { return o.age < 40; });
  13243. * // => 'barney' (iteration order is not guaranteed)
  13244. *
  13245. * // The `_.matches` iteratee shorthand.
  13246. * _.findKey(users, { 'age': 1, 'active': true });
  13247. * // => 'pebbles'
  13248. *
  13249. * // The `_.matchesProperty` iteratee shorthand.
  13250. * _.findKey(users, ['active', false]);
  13251. * // => 'fred'
  13252. *
  13253. * // The `_.property` iteratee shorthand.
  13254. * _.findKey(users, 'active');
  13255. * // => 'barney'
  13256. */
  13257. function findKey(object, predicate) {
  13258. return baseFindKey(object, getIteratee(predicate, 3), baseForOwn);
  13259. }
  13260. /**
  13261. * This method is like `_.findKey` except that it iterates over elements of
  13262. * a collection in the opposite order.
  13263. *
  13264. * @static
  13265. * @memberOf _
  13266. * @since 2.0.0
  13267. * @category Object
  13268. * @param {Object} object The object to inspect.
  13269. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  13270. * @returns {string|undefined} Returns the key of the matched element,
  13271. * else `undefined`.
  13272. * @example
  13273. *
  13274. * var users = {
  13275. * 'barney': { 'age': 36, 'active': true },
  13276. * 'fred': { 'age': 40, 'active': false },
  13277. * 'pebbles': { 'age': 1, 'active': true }
  13278. * };
  13279. *
  13280. * _.findLastKey(users, function(o) { return o.age < 40; });
  13281. * // => returns 'pebbles' assuming `_.findKey` returns 'barney'
  13282. *
  13283. * // The `_.matches` iteratee shorthand.
  13284. * _.findLastKey(users, { 'age': 36, 'active': true });
  13285. * // => 'barney'
  13286. *
  13287. * // The `_.matchesProperty` iteratee shorthand.
  13288. * _.findLastKey(users, ['active', false]);
  13289. * // => 'fred'
  13290. *
  13291. * // The `_.property` iteratee shorthand.
  13292. * _.findLastKey(users, 'active');
  13293. * // => 'pebbles'
  13294. */
  13295. function findLastKey(object, predicate) {
  13296. return baseFindKey(object, getIteratee(predicate, 3), baseForOwnRight);
  13297. }
  13298. /**
  13299. * Iterates over own and inherited enumerable string keyed properties of an
  13300. * object and invokes `iteratee` for each property. The iteratee is invoked
  13301. * with three arguments: (value, key, object). Iteratee functions may exit
  13302. * iteration early by explicitly returning `false`.
  13303. *
  13304. * @static
  13305. * @memberOf _
  13306. * @since 0.3.0
  13307. * @category Object
  13308. * @param {Object} object The object to iterate over.
  13309. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  13310. * @returns {Object} Returns `object`.
  13311. * @see _.forInRight
  13312. * @example
  13313. *
  13314. * function Foo() {
  13315. * this.a = 1;
  13316. * this.b = 2;
  13317. * }
  13318. *
  13319. * Foo.prototype.c = 3;
  13320. *
  13321. * _.forIn(new Foo, function(value, key) {
  13322. * console.log(key);
  13323. * });
  13324. * // => Logs 'a', 'b', then 'c' (iteration order is not guaranteed).
  13325. */
  13326. function forIn(object, iteratee) {
  13327. return object == null
  13328. ? object
  13329. : baseFor(object, getIteratee(iteratee, 3), keysIn);
  13330. }
  13331. /**
  13332. * This method is like `_.forIn` except that it iterates over properties of
  13333. * `object` in the opposite order.
  13334. *
  13335. * @static
  13336. * @memberOf _
  13337. * @since 2.0.0
  13338. * @category Object
  13339. * @param {Object} object The object to iterate over.
  13340. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  13341. * @returns {Object} Returns `object`.
  13342. * @see _.forIn
  13343. * @example
  13344. *
  13345. * function Foo() {
  13346. * this.a = 1;
  13347. * this.b = 2;
  13348. * }
  13349. *
  13350. * Foo.prototype.c = 3;
  13351. *
  13352. * _.forInRight(new Foo, function(value, key) {
  13353. * console.log(key);
  13354. * });
  13355. * // => Logs 'c', 'b', then 'a' assuming `_.forIn` logs 'a', 'b', then 'c'.
  13356. */
  13357. function forInRight(object, iteratee) {
  13358. return object == null
  13359. ? object
  13360. : baseForRight(object, getIteratee(iteratee, 3), keysIn);
  13361. }
  13362. /**
  13363. * Iterates over own enumerable string keyed properties of an object and
  13364. * invokes `iteratee` for each property. The iteratee is invoked with three
  13365. * arguments: (value, key, object). Iteratee functions may exit iteration
  13366. * early by explicitly returning `false`.
  13367. *
  13368. * @static
  13369. * @memberOf _
  13370. * @since 0.3.0
  13371. * @category Object
  13372. * @param {Object} object The object to iterate over.
  13373. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  13374. * @returns {Object} Returns `object`.
  13375. * @see _.forOwnRight
  13376. * @example
  13377. *
  13378. * function Foo() {
  13379. * this.a = 1;
  13380. * this.b = 2;
  13381. * }
  13382. *
  13383. * Foo.prototype.c = 3;
  13384. *
  13385. * _.forOwn(new Foo, function(value, key) {
  13386. * console.log(key);
  13387. * });
  13388. * // => Logs 'a' then 'b' (iteration order is not guaranteed).
  13389. */
  13390. function forOwn(object, iteratee) {
  13391. return object && baseForOwn(object, getIteratee(iteratee, 3));
  13392. }
  13393. /**
  13394. * This method is like `_.forOwn` except that it iterates over properties of
  13395. * `object` in the opposite order.
  13396. *
  13397. * @static
  13398. * @memberOf _
  13399. * @since 2.0.0
  13400. * @category Object
  13401. * @param {Object} object The object to iterate over.
  13402. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  13403. * @returns {Object} Returns `object`.
  13404. * @see _.forOwn
  13405. * @example
  13406. *
  13407. * function Foo() {
  13408. * this.a = 1;
  13409. * this.b = 2;
  13410. * }
  13411. *
  13412. * Foo.prototype.c = 3;
  13413. *
  13414. * _.forOwnRight(new Foo, function(value, key) {
  13415. * console.log(key);
  13416. * });
  13417. * // => Logs 'b' then 'a' assuming `_.forOwn` logs 'a' then 'b'.
  13418. */
  13419. function forOwnRight(object, iteratee) {
  13420. return object && baseForOwnRight(object, getIteratee(iteratee, 3));
  13421. }
  13422. /**
  13423. * Creates an array of function property names from own enumerable properties
  13424. * of `object`.
  13425. *
  13426. * @static
  13427. * @since 0.1.0
  13428. * @memberOf _
  13429. * @category Object
  13430. * @param {Object} object The object to inspect.
  13431. * @returns {Array} Returns the function names.
  13432. * @see _.functionsIn
  13433. * @example
  13434. *
  13435. * function Foo() {
  13436. * this.a = _.constant('a');
  13437. * this.b = _.constant('b');
  13438. * }
  13439. *
  13440. * Foo.prototype.c = _.constant('c');
  13441. *
  13442. * _.functions(new Foo);
  13443. * // => ['a', 'b']
  13444. */
  13445. function functions(object) {
  13446. return object == null ? [] : baseFunctions(object, keys(object));
  13447. }
  13448. /**
  13449. * Creates an array of function property names from own and inherited
  13450. * enumerable properties of `object`.
  13451. *
  13452. * @static
  13453. * @memberOf _
  13454. * @since 4.0.0
  13455. * @category Object
  13456. * @param {Object} object The object to inspect.
  13457. * @returns {Array} Returns the function names.
  13458. * @see _.functions
  13459. * @example
  13460. *
  13461. * function Foo() {
  13462. * this.a = _.constant('a');
  13463. * this.b = _.constant('b');
  13464. * }
  13465. *
  13466. * Foo.prototype.c = _.constant('c');
  13467. *
  13468. * _.functionsIn(new Foo);
  13469. * // => ['a', 'b', 'c']
  13470. */
  13471. function functionsIn(object) {
  13472. return object == null ? [] : baseFunctions(object, keysIn(object));
  13473. }
  13474. /**
  13475. * Gets the value at `path` of `object`. If the resolved value is
  13476. * `undefined`, the `defaultValue` is returned in its place.
  13477. *
  13478. * @static
  13479. * @memberOf _
  13480. * @since 3.7.0
  13481. * @category Object
  13482. * @param {Object} object The object to query.
  13483. * @param {Array|string} path The path of the property to get.
  13484. * @param {*} [defaultValue] The value returned for `undefined` resolved values.
  13485. * @returns {*} Returns the resolved value.
  13486. * @example
  13487. *
  13488. * var object = { 'a': [{ 'b': { 'c': 3 } }] };
  13489. *
  13490. * _.get(object, 'a[0].b.c');
  13491. * // => 3
  13492. *
  13493. * _.get(object, ['a', '0', 'b', 'c']);
  13494. * // => 3
  13495. *
  13496. * _.get(object, 'a.b.c', 'default');
  13497. * // => 'default'
  13498. */
  13499. function get(object, path, defaultValue) {
  13500. var result = object == null ? undefined : baseGet(object, path);
  13501. return result === undefined ? defaultValue : result;
  13502. }
  13503. /**
  13504. * Checks if `path` is a direct property of `object`.
  13505. *
  13506. * @static
  13507. * @since 0.1.0
  13508. * @memberOf _
  13509. * @category Object
  13510. * @param {Object} object The object to query.
  13511. * @param {Array|string} path The path to check.
  13512. * @returns {boolean} Returns `true` if `path` exists, else `false`.
  13513. * @example
  13514. *
  13515. * var object = { 'a': { 'b': 2 } };
  13516. * var other = _.create({ 'a': _.create({ 'b': 2 }) });
  13517. *
  13518. * _.has(object, 'a');
  13519. * // => true
  13520. *
  13521. * _.has(object, 'a.b');
  13522. * // => true
  13523. *
  13524. * _.has(object, ['a', 'b']);
  13525. * // => true
  13526. *
  13527. * _.has(other, 'a');
  13528. * // => false
  13529. */
  13530. function has(object, path) {
  13531. return object != null && hasPath(object, path, baseHas);
  13532. }
  13533. /**
  13534. * Checks if `path` is a direct or inherited property of `object`.
  13535. *
  13536. * @static
  13537. * @memberOf _
  13538. * @since 4.0.0
  13539. * @category Object
  13540. * @param {Object} object The object to query.
  13541. * @param {Array|string} path The path to check.
  13542. * @returns {boolean} Returns `true` if `path` exists, else `false`.
  13543. * @example
  13544. *
  13545. * var object = _.create({ 'a': _.create({ 'b': 2 }) });
  13546. *
  13547. * _.hasIn(object, 'a');
  13548. * // => true
  13549. *
  13550. * _.hasIn(object, 'a.b');
  13551. * // => true
  13552. *
  13553. * _.hasIn(object, ['a', 'b']);
  13554. * // => true
  13555. *
  13556. * _.hasIn(object, 'b');
  13557. * // => false
  13558. */
  13559. function hasIn(object, path) {
  13560. return object != null && hasPath(object, path, baseHasIn);
  13561. }
  13562. /**
  13563. * Creates an object composed of the inverted keys and values of `object`.
  13564. * If `object` contains duplicate values, subsequent values overwrite
  13565. * property assignments of previous values.
  13566. *
  13567. * @static
  13568. * @memberOf _
  13569. * @since 0.7.0
  13570. * @category Object
  13571. * @param {Object} object The object to invert.
  13572. * @returns {Object} Returns the new inverted object.
  13573. * @example
  13574. *
  13575. * var object = { 'a': 1, 'b': 2, 'c': 1 };
  13576. *
  13577. * _.invert(object);
  13578. * // => { '1': 'c', '2': 'b' }
  13579. */
  13580. var invert = createInverter(function(result, value, key) {
  13581. if (value != null &&
  13582. typeof value.toString != 'function') {
  13583. value = nativeObjectToString.call(value);
  13584. }
  13585. result[value] = key;
  13586. }, constant(identity));
  13587. /**
  13588. * This method is like `_.invert` except that the inverted object is generated
  13589. * from the results of running each element of `object` thru `iteratee`. The
  13590. * corresponding inverted value of each inverted key is an array of keys
  13591. * responsible for generating the inverted value. The iteratee is invoked
  13592. * with one argument: (value).
  13593. *
  13594. * @static
  13595. * @memberOf _
  13596. * @since 4.1.0
  13597. * @category Object
  13598. * @param {Object} object The object to invert.
  13599. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  13600. * @returns {Object} Returns the new inverted object.
  13601. * @example
  13602. *
  13603. * var object = { 'a': 1, 'b': 2, 'c': 1 };
  13604. *
  13605. * _.invertBy(object);
  13606. * // => { '1': ['a', 'c'], '2': ['b'] }
  13607. *
  13608. * _.invertBy(object, function(value) {
  13609. * return 'group' + value;
  13610. * });
  13611. * // => { 'group1': ['a', 'c'], 'group2': ['b'] }
  13612. */
  13613. var invertBy = createInverter(function(result, value, key) {
  13614. if (value != null &&
  13615. typeof value.toString != 'function') {
  13616. value = nativeObjectToString.call(value);
  13617. }
  13618. if (hasOwnProperty.call(result, value)) {
  13619. result[value].push(key);
  13620. } else {
  13621. result[value] = [key];
  13622. }
  13623. }, getIteratee);
  13624. /**
  13625. * Invokes the method at `path` of `object`.
  13626. *
  13627. * @static
  13628. * @memberOf _
  13629. * @since 4.0.0
  13630. * @category Object
  13631. * @param {Object} object The object to query.
  13632. * @param {Array|string} path The path of the method to invoke.
  13633. * @param {...*} [args] The arguments to invoke the method with.
  13634. * @returns {*} Returns the result of the invoked method.
  13635. * @example
  13636. *
  13637. * var object = { 'a': [{ 'b': { 'c': [1, 2, 3, 4] } }] };
  13638. *
  13639. * _.invoke(object, 'a[0].b.c.slice', 1, 3);
  13640. * // => [2, 3]
  13641. */
  13642. var invoke = baseRest(baseInvoke);
  13643. /**
  13644. * Creates an array of the own enumerable property names of `object`.
  13645. *
  13646. * **Note:** Non-object values are coerced to objects. See the
  13647. * [ES spec](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)
  13648. * for more details.
  13649. *
  13650. * @static
  13651. * @since 0.1.0
  13652. * @memberOf _
  13653. * @category Object
  13654. * @param {Object} object The object to query.
  13655. * @returns {Array} Returns the array of property names.
  13656. * @example
  13657. *
  13658. * function Foo() {
  13659. * this.a = 1;
  13660. * this.b = 2;
  13661. * }
  13662. *
  13663. * Foo.prototype.c = 3;
  13664. *
  13665. * _.keys(new Foo);
  13666. * // => ['a', 'b'] (iteration order is not guaranteed)
  13667. *
  13668. * _.keys('hi');
  13669. * // => ['0', '1']
  13670. */
  13671. function keys(object) {
  13672. return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object);
  13673. }
  13674. /**
  13675. * Creates an array of the own and inherited enumerable property names of `object`.
  13676. *
  13677. * **Note:** Non-object values are coerced to objects.
  13678. *
  13679. * @static
  13680. * @memberOf _
  13681. * @since 3.0.0
  13682. * @category Object
  13683. * @param {Object} object The object to query.
  13684. * @returns {Array} Returns the array of property names.
  13685. * @example
  13686. *
  13687. * function Foo() {
  13688. * this.a = 1;
  13689. * this.b = 2;
  13690. * }
  13691. *
  13692. * Foo.prototype.c = 3;
  13693. *
  13694. * _.keysIn(new Foo);
  13695. * // => ['a', 'b', 'c'] (iteration order is not guaranteed)
  13696. */
  13697. function keysIn(object) {
  13698. return isArrayLike(object) ? arrayLikeKeys(object, true) : baseKeysIn(object);
  13699. }
  13700. /**
  13701. * The opposite of `_.mapValues`; this method creates an object with the
  13702. * same values as `object` and keys generated by running each own enumerable
  13703. * string keyed property of `object` thru `iteratee`. The iteratee is invoked
  13704. * with three arguments: (value, key, object).
  13705. *
  13706. * @static
  13707. * @memberOf _
  13708. * @since 3.8.0
  13709. * @category Object
  13710. * @param {Object} object The object to iterate over.
  13711. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  13712. * @returns {Object} Returns the new mapped object.
  13713. * @see _.mapValues
  13714. * @example
  13715. *
  13716. * _.mapKeys({ 'a': 1, 'b': 2 }, function(value, key) {
  13717. * return key + value;
  13718. * });
  13719. * // => { 'a1': 1, 'b2': 2 }
  13720. */
  13721. function mapKeys(object, iteratee) {
  13722. var result = {};
  13723. iteratee = getIteratee(iteratee, 3);
  13724. baseForOwn(object, function(value, key, object) {
  13725. baseAssignValue(result, iteratee(value, key, object), value);
  13726. });
  13727. return result;
  13728. }
  13729. /**
  13730. * Creates an object with the same keys as `object` and values generated
  13731. * by running each own enumerable string keyed property of `object` thru
  13732. * `iteratee`. The iteratee is invoked with three arguments:
  13733. * (value, key, object).
  13734. *
  13735. * @static
  13736. * @memberOf _
  13737. * @since 2.4.0
  13738. * @category Object
  13739. * @param {Object} object The object to iterate over.
  13740. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  13741. * @returns {Object} Returns the new mapped object.
  13742. * @see _.mapKeys
  13743. * @example
  13744. *
  13745. * var users = {
  13746. * 'fred': { 'user': 'fred', 'age': 40 },
  13747. * 'pebbles': { 'user': 'pebbles', 'age': 1 }
  13748. * };
  13749. *
  13750. * _.mapValues(users, function(o) { return o.age; });
  13751. * // => { 'fred': 40, 'pebbles': 1 } (iteration order is not guaranteed)
  13752. *
  13753. * // The `_.property` iteratee shorthand.
  13754. * _.mapValues(users, 'age');
  13755. * // => { 'fred': 40, 'pebbles': 1 } (iteration order is not guaranteed)
  13756. */
  13757. function mapValues(object, iteratee) {
  13758. var result = {};
  13759. iteratee = getIteratee(iteratee, 3);
  13760. baseForOwn(object, function(value, key, object) {
  13761. baseAssignValue(result, key, iteratee(value, key, object));
  13762. });
  13763. return result;
  13764. }
  13765. /**
  13766. * This method is like `_.assign` except that it recursively merges own and
  13767. * inherited enumerable string keyed properties of source objects into the
  13768. * destination object. Source properties that resolve to `undefined` are
  13769. * skipped if a destination value exists. Array and plain object properties
  13770. * are merged recursively. Other objects and value types are overridden by
  13771. * assignment. Source objects are applied from left to right. Subsequent
  13772. * sources overwrite property assignments of previous sources.
  13773. *
  13774. * **Note:** This method mutates `object`.
  13775. *
  13776. * @static
  13777. * @memberOf _
  13778. * @since 0.5.0
  13779. * @category Object
  13780. * @param {Object} object The destination object.
  13781. * @param {...Object} [sources] The source objects.
  13782. * @returns {Object} Returns `object`.
  13783. * @example
  13784. *
  13785. * var object = {
  13786. * 'a': [{ 'b': 2 }, { 'd': 4 }]
  13787. * };
  13788. *
  13789. * var other = {
  13790. * 'a': [{ 'c': 3 }, { 'e': 5 }]
  13791. * };
  13792. *
  13793. * _.merge(object, other);
  13794. * // => { 'a': [{ 'b': 2, 'c': 3 }, { 'd': 4, 'e': 5 }] }
  13795. */
  13796. var merge = createAssigner(function(object, source, srcIndex) {
  13797. baseMerge(object, source, srcIndex);
  13798. });
  13799. /**
  13800. * This method is like `_.merge` except that it accepts `customizer` which
  13801. * is invoked to produce the merged values of the destination and source
  13802. * properties. If `customizer` returns `undefined`, merging is handled by the
  13803. * method instead. The `customizer` is invoked with six arguments:
  13804. * (objValue, srcValue, key, object, source, stack).
  13805. *
  13806. * **Note:** This method mutates `object`.
  13807. *
  13808. * @static
  13809. * @memberOf _
  13810. * @since 4.0.0
  13811. * @category Object
  13812. * @param {Object} object The destination object.
  13813. * @param {...Object} sources The source objects.
  13814. * @param {Function} customizer The function to customize assigned values.
  13815. * @returns {Object} Returns `object`.
  13816. * @example
  13817. *
  13818. * function customizer(objValue, srcValue) {
  13819. * if (_.isArray(objValue)) {
  13820. * return objValue.concat(srcValue);
  13821. * }
  13822. * }
  13823. *
  13824. * var object = { 'a': [1], 'b': [2] };
  13825. * var other = { 'a': [3], 'b': [4] };
  13826. *
  13827. * _.mergeWith(object, other, customizer);
  13828. * // => { 'a': [1, 3], 'b': [2, 4] }
  13829. */
  13830. var mergeWith = createAssigner(function(object, source, srcIndex, customizer) {
  13831. baseMerge(object, source, srcIndex, customizer);
  13832. });
  13833. /**
  13834. * The opposite of `_.pick`; this method creates an object composed of the
  13835. * own and inherited enumerable property paths of `object` that are not omitted.
  13836. *
  13837. * **Note:** This method is considerably slower than `_.pick`.
  13838. *
  13839. * @static
  13840. * @since 0.1.0
  13841. * @memberOf _
  13842. * @category Object
  13843. * @param {Object} object The source object.
  13844. * @param {...(string|string[])} [paths] The property paths to omit.
  13845. * @returns {Object} Returns the new object.
  13846. * @example
  13847. *
  13848. * var object = { 'a': 1, 'b': '2', 'c': 3 };
  13849. *
  13850. * _.omit(object, ['a', 'c']);
  13851. * // => { 'b': '2' }
  13852. */
  13853. var omit = flatRest(function(object, paths) {
  13854. var result = {};
  13855. if (object == null) {
  13856. return result;
  13857. }
  13858. var isDeep = false;
  13859. paths = arrayMap(paths, function(path) {
  13860. path = castPath(path, object);
  13861. isDeep || (isDeep = path.length > 1);
  13862. return path;
  13863. });
  13864. copyObject(object, getAllKeysIn(object), result);
  13865. if (isDeep) {
  13866. result = baseClone(result, CLONE_DEEP_FLAG | CLONE_FLAT_FLAG | CLONE_SYMBOLS_FLAG, customOmitClone);
  13867. }
  13868. var length = paths.length;
  13869. while (length--) {
  13870. baseUnset(result, paths[length]);
  13871. }
  13872. return result;
  13873. });
  13874. /**
  13875. * The opposite of `_.pickBy`; this method creates an object composed of
  13876. * the own and inherited enumerable string keyed properties of `object` that
  13877. * `predicate` doesn't return truthy for. The predicate is invoked with two
  13878. * arguments: (value, key).
  13879. *
  13880. * @static
  13881. * @memberOf _
  13882. * @since 4.0.0
  13883. * @category Object
  13884. * @param {Object} object The source object.
  13885. * @param {Function} [predicate=_.identity] The function invoked per property.
  13886. * @returns {Object} Returns the new object.
  13887. * @example
  13888. *
  13889. * var object = { 'a': 1, 'b': '2', 'c': 3 };
  13890. *
  13891. * _.omitBy(object, _.isNumber);
  13892. * // => { 'b': '2' }
  13893. */
  13894. function omitBy(object, predicate) {
  13895. return pickBy(object, negate(getIteratee(predicate)));
  13896. }
  13897. /**
  13898. * Creates an object composed of the picked `object` properties.
  13899. *
  13900. * @static
  13901. * @since 0.1.0
  13902. * @memberOf _
  13903. * @category Object
  13904. * @param {Object} object The source object.
  13905. * @param {...(string|string[])} [paths] The property paths to pick.
  13906. * @returns {Object} Returns the new object.
  13907. * @example
  13908. *
  13909. * var object = { 'a': 1, 'b': '2', 'c': 3 };
  13910. *
  13911. * _.pick(object, ['a', 'c']);
  13912. * // => { 'a': 1, 'c': 3 }
  13913. */
  13914. var pick = flatRest(function(object, paths) {
  13915. return object == null ? {} : basePick(object, paths);
  13916. });
  13917. /**
  13918. * Creates an object composed of the `object` properties `predicate` returns
  13919. * truthy for. The predicate is invoked with two arguments: (value, key).
  13920. *
  13921. * @static
  13922. * @memberOf _
  13923. * @since 4.0.0
  13924. * @category Object
  13925. * @param {Object} object The source object.
  13926. * @param {Function} [predicate=_.identity] The function invoked per property.
  13927. * @returns {Object} Returns the new object.
  13928. * @example
  13929. *
  13930. * var object = { 'a': 1, 'b': '2', 'c': 3 };
  13931. *
  13932. * _.pickBy(object, _.isNumber);
  13933. * // => { 'a': 1, 'c': 3 }
  13934. */
  13935. function pickBy(object, predicate) {
  13936. if (object == null) {
  13937. return {};
  13938. }
  13939. var props = arrayMap(getAllKeysIn(object), function(prop) {
  13940. return [prop];
  13941. });
  13942. predicate = getIteratee(predicate);
  13943. return basePickBy(object, props, function(value, path) {
  13944. return predicate(value, path[0]);
  13945. });
  13946. }
  13947. /**
  13948. * This method is like `_.get` except that if the resolved value is a
  13949. * function it's invoked with the `this` binding of its parent object and
  13950. * its result is returned.
  13951. *
  13952. * @static
  13953. * @since 0.1.0
  13954. * @memberOf _
  13955. * @category Object
  13956. * @param {Object} object The object to query.
  13957. * @param {Array|string} path The path of the property to resolve.
  13958. * @param {*} [defaultValue] The value returned for `undefined` resolved values.
  13959. * @returns {*} Returns the resolved value.
  13960. * @example
  13961. *
  13962. * var object = { 'a': [{ 'b': { 'c1': 3, 'c2': _.constant(4) } }] };
  13963. *
  13964. * _.result(object, 'a[0].b.c1');
  13965. * // => 3
  13966. *
  13967. * _.result(object, 'a[0].b.c2');
  13968. * // => 4
  13969. *
  13970. * _.result(object, 'a[0].b.c3', 'default');
  13971. * // => 'default'
  13972. *
  13973. * _.result(object, 'a[0].b.c3', _.constant('default'));
  13974. * // => 'default'
  13975. */
  13976. function result(object, path, defaultValue) {
  13977. path = castPath(path, object);
  13978. var index = -1,
  13979. length = path.length;
  13980. // Ensure the loop is entered when path is empty.
  13981. if (!length) {
  13982. length = 1;
  13983. object = undefined;
  13984. }
  13985. while (++index < length) {
  13986. var value = object == null ? undefined : object[toKey(path[index])];
  13987. if (value === undefined) {
  13988. index = length;
  13989. value = defaultValue;
  13990. }
  13991. object = isFunction(value) ? value.call(object) : value;
  13992. }
  13993. return object;
  13994. }
  13995. /**
  13996. * Sets the value at `path` of `object`. If a portion of `path` doesn't exist,
  13997. * it's created. Arrays are created for missing index properties while objects
  13998. * are created for all other missing properties. Use `_.setWith` to customize
  13999. * `path` creation.
  14000. *
  14001. * **Note:** This method mutates `object`.
  14002. *
  14003. * @static
  14004. * @memberOf _
  14005. * @since 3.7.0
  14006. * @category Object
  14007. * @param {Object} object The object to modify.
  14008. * @param {Array|string} path The path of the property to set.
  14009. * @param {*} value The value to set.
  14010. * @returns {Object} Returns `object`.
  14011. * @example
  14012. *
  14013. * var object = { 'a': [{ 'b': { 'c': 3 } }] };
  14014. *
  14015. * _.set(object, 'a[0].b.c', 4);
  14016. * console.log(object.a[0].b.c);
  14017. * // => 4
  14018. *
  14019. * _.set(object, ['x', '0', 'y', 'z'], 5);
  14020. * console.log(object.x[0].y.z);
  14021. * // => 5
  14022. */
  14023. function set(object, path, value) {
  14024. return object == null ? object : baseSet(object, path, value);
  14025. }
  14026. /**
  14027. * This method is like `_.set` except that it accepts `customizer` which is
  14028. * invoked to produce the objects of `path`. If `customizer` returns `undefined`
  14029. * path creation is handled by the method instead. The `customizer` is invoked
  14030. * with three arguments: (nsValue, key, nsObject).
  14031. *
  14032. * **Note:** This method mutates `object`.
  14033. *
  14034. * @static
  14035. * @memberOf _
  14036. * @since 4.0.0
  14037. * @category Object
  14038. * @param {Object} object The object to modify.
  14039. * @param {Array|string} path The path of the property to set.
  14040. * @param {*} value The value to set.
  14041. * @param {Function} [customizer] The function to customize assigned values.
  14042. * @returns {Object} Returns `object`.
  14043. * @example
  14044. *
  14045. * var object = {};
  14046. *
  14047. * _.setWith(object, '[0][1]', 'a', Object);
  14048. * // => { '0': { '1': 'a' } }
  14049. */
  14050. function setWith(object, path, value, customizer) {
  14051. customizer = typeof customizer == 'function' ? customizer : undefined;
  14052. return object == null ? object : baseSet(object, path, value, customizer);
  14053. }
  14054. /**
  14055. * Creates an array of own enumerable string keyed-value pairs for `object`
  14056. * which can be consumed by `_.fromPairs`. If `object` is a map or set, its
  14057. * entries are returned.
  14058. *
  14059. * @static
  14060. * @memberOf _
  14061. * @since 4.0.0
  14062. * @alias entries
  14063. * @category Object
  14064. * @param {Object} object The object to query.
  14065. * @returns {Array} Returns the key-value pairs.
  14066. * @example
  14067. *
  14068. * function Foo() {
  14069. * this.a = 1;
  14070. * this.b = 2;
  14071. * }
  14072. *
  14073. * Foo.prototype.c = 3;
  14074. *
  14075. * _.toPairs(new Foo);
  14076. * // => [['a', 1], ['b', 2]] (iteration order is not guaranteed)
  14077. */
  14078. var toPairs = createToPairs(keys);
  14079. /**
  14080. * Creates an array of own and inherited enumerable string keyed-value pairs
  14081. * for `object` which can be consumed by `_.fromPairs`. If `object` is a map
  14082. * or set, its entries are returned.
  14083. *
  14084. * @static
  14085. * @memberOf _
  14086. * @since 4.0.0
  14087. * @alias entriesIn
  14088. * @category Object
  14089. * @param {Object} object The object to query.
  14090. * @returns {Array} Returns the key-value pairs.
  14091. * @example
  14092. *
  14093. * function Foo() {
  14094. * this.a = 1;
  14095. * this.b = 2;
  14096. * }
  14097. *
  14098. * Foo.prototype.c = 3;
  14099. *
  14100. * _.toPairsIn(new Foo);
  14101. * // => [['a', 1], ['b', 2], ['c', 3]] (iteration order is not guaranteed)
  14102. */
  14103. var toPairsIn = createToPairs(keysIn);
  14104. /**
  14105. * An alternative to `_.reduce`; this method transforms `object` to a new
  14106. * `accumulator` object which is the result of running each of its own
  14107. * enumerable string keyed properties thru `iteratee`, with each invocation
  14108. * potentially mutating the `accumulator` object. If `accumulator` is not
  14109. * provided, a new object with the same `[[Prototype]]` will be used. The
  14110. * iteratee is invoked with four arguments: (accumulator, value, key, object).
  14111. * Iteratee functions may exit iteration early by explicitly returning `false`.
  14112. *
  14113. * @static
  14114. * @memberOf _
  14115. * @since 1.3.0
  14116. * @category Object
  14117. * @param {Object} object The object to iterate over.
  14118. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  14119. * @param {*} [accumulator] The custom accumulator value.
  14120. * @returns {*} Returns the accumulated value.
  14121. * @example
  14122. *
  14123. * _.transform([2, 3, 4], function(result, n) {
  14124. * result.push(n *= n);
  14125. * return n % 2 == 0;
  14126. * }, []);
  14127. * // => [4, 9]
  14128. *
  14129. * _.transform({ 'a': 1, 'b': 2, 'c': 1 }, function(result, value, key) {
  14130. * (result[value] || (result[value] = [])).push(key);
  14131. * }, {});
  14132. * // => { '1': ['a', 'c'], '2': ['b'] }
  14133. */
  14134. function transform(object, iteratee, accumulator) {
  14135. var isArr = isArray(object),
  14136. isArrLike = isArr || isBuffer(object) || isTypedArray(object);
  14137. iteratee = getIteratee(iteratee, 4);
  14138. if (accumulator == null) {
  14139. var Ctor = object && object.constructor;
  14140. if (isArrLike) {
  14141. accumulator = isArr ? new Ctor : [];
  14142. }
  14143. else if (isObject(object)) {
  14144. accumulator = isFunction(Ctor) ? baseCreate(getPrototype(object)) : {};
  14145. }
  14146. else {
  14147. accumulator = {};
  14148. }
  14149. }
  14150. (isArrLike ? arrayEach : baseForOwn)(object, function(value, index, object) {
  14151. return iteratee(accumulator, value, index, object);
  14152. });
  14153. return accumulator;
  14154. }
  14155. /**
  14156. * Removes the property at `path` of `object`.
  14157. *
  14158. * **Note:** This method mutates `object`.
  14159. *
  14160. * @static
  14161. * @memberOf _
  14162. * @since 4.0.0
  14163. * @category Object
  14164. * @param {Object} object The object to modify.
  14165. * @param {Array|string} path The path of the property to unset.
  14166. * @returns {boolean} Returns `true` if the property is deleted, else `false`.
  14167. * @example
  14168. *
  14169. * var object = { 'a': [{ 'b': { 'c': 7 } }] };
  14170. * _.unset(object, 'a[0].b.c');
  14171. * // => true
  14172. *
  14173. * console.log(object);
  14174. * // => { 'a': [{ 'b': {} }] };
  14175. *
  14176. * _.unset(object, ['a', '0', 'b', 'c']);
  14177. * // => true
  14178. *
  14179. * console.log(object);
  14180. * // => { 'a': [{ 'b': {} }] };
  14181. */
  14182. function unset(object, path) {
  14183. return object == null ? true : baseUnset(object, path);
  14184. }
  14185. /**
  14186. * This method is like `_.set` except that accepts `updater` to produce the
  14187. * value to set. Use `_.updateWith` to customize `path` creation. The `updater`
  14188. * is invoked with one argument: (value).
  14189. *
  14190. * **Note:** This method mutates `object`.
  14191. *
  14192. * @static
  14193. * @memberOf _
  14194. * @since 4.6.0
  14195. * @category Object
  14196. * @param {Object} object The object to modify.
  14197. * @param {Array|string} path The path of the property to set.
  14198. * @param {Function} updater The function to produce the updated value.
  14199. * @returns {Object} Returns `object`.
  14200. * @example
  14201. *
  14202. * var object = { 'a': [{ 'b': { 'c': 3 } }] };
  14203. *
  14204. * _.update(object, 'a[0].b.c', function(n) { return n * n; });
  14205. * console.log(object.a[0].b.c);
  14206. * // => 9
  14207. *
  14208. * _.update(object, 'x[0].y.z', function(n) { return n ? n + 1 : 0; });
  14209. * console.log(object.x[0].y.z);
  14210. * // => 0
  14211. */
  14212. function update(object, path, updater) {
  14213. return object == null ? object : baseUpdate(object, path, castFunction(updater));
  14214. }
  14215. /**
  14216. * This method is like `_.update` except that it accepts `customizer` which is
  14217. * invoked to produce the objects of `path`. If `customizer` returns `undefined`
  14218. * path creation is handled by the method instead. The `customizer` is invoked
  14219. * with three arguments: (nsValue, key, nsObject).
  14220. *
  14221. * **Note:** This method mutates `object`.
  14222. *
  14223. * @static
  14224. * @memberOf _
  14225. * @since 4.6.0
  14226. * @category Object
  14227. * @param {Object} object The object to modify.
  14228. * @param {Array|string} path The path of the property to set.
  14229. * @param {Function} updater The function to produce the updated value.
  14230. * @param {Function} [customizer] The function to customize assigned values.
  14231. * @returns {Object} Returns `object`.
  14232. * @example
  14233. *
  14234. * var object = {};
  14235. *
  14236. * _.updateWith(object, '[0][1]', _.constant('a'), Object);
  14237. * // => { '0': { '1': 'a' } }
  14238. */
  14239. function updateWith(object, path, updater, customizer) {
  14240. customizer = typeof customizer == 'function' ? customizer : undefined;
  14241. return object == null ? object : baseUpdate(object, path, castFunction(updater), customizer);
  14242. }
  14243. /**
  14244. * Creates an array of the own enumerable string keyed property values of `object`.
  14245. *
  14246. * **Note:** Non-object values are coerced to objects.
  14247. *
  14248. * @static
  14249. * @since 0.1.0
  14250. * @memberOf _
  14251. * @category Object
  14252. * @param {Object} object The object to query.
  14253. * @returns {Array} Returns the array of property values.
  14254. * @example
  14255. *
  14256. * function Foo() {
  14257. * this.a = 1;
  14258. * this.b = 2;
  14259. * }
  14260. *
  14261. * Foo.prototype.c = 3;
  14262. *
  14263. * _.values(new Foo);
  14264. * // => [1, 2] (iteration order is not guaranteed)
  14265. *
  14266. * _.values('hi');
  14267. * // => ['h', 'i']
  14268. */
  14269. function values(object) {
  14270. return object == null ? [] : baseValues(object, keys(object));
  14271. }
  14272. /**
  14273. * Creates an array of the own and inherited enumerable string keyed property
  14274. * values of `object`.
  14275. *
  14276. * **Note:** Non-object values are coerced to objects.
  14277. *
  14278. * @static
  14279. * @memberOf _
  14280. * @since 3.0.0
  14281. * @category Object
  14282. * @param {Object} object The object to query.
  14283. * @returns {Array} Returns the array of property values.
  14284. * @example
  14285. *
  14286. * function Foo() {
  14287. * this.a = 1;
  14288. * this.b = 2;
  14289. * }
  14290. *
  14291. * Foo.prototype.c = 3;
  14292. *
  14293. * _.valuesIn(new Foo);
  14294. * // => [1, 2, 3] (iteration order is not guaranteed)
  14295. */
  14296. function valuesIn(object) {
  14297. return object == null ? [] : baseValues(object, keysIn(object));
  14298. }
  14299. /*------------------------------------------------------------------------*/
  14300. /**
  14301. * Clamps `number` within the inclusive `lower` and `upper` bounds.
  14302. *
  14303. * @static
  14304. * @memberOf _
  14305. * @since 4.0.0
  14306. * @category Number
  14307. * @param {number} number The number to clamp.
  14308. * @param {number} [lower] The lower bound.
  14309. * @param {number} upper The upper bound.
  14310. * @returns {number} Returns the clamped number.
  14311. * @example
  14312. *
  14313. * _.clamp(-10, -5, 5);
  14314. * // => -5
  14315. *
  14316. * _.clamp(10, -5, 5);
  14317. * // => 5
  14318. */
  14319. function clamp(number, lower, upper) {
  14320. if (upper === undefined) {
  14321. upper = lower;
  14322. lower = undefined;
  14323. }
  14324. if (upper !== undefined) {
  14325. upper = toNumber(upper);
  14326. upper = upper === upper ? upper : 0;
  14327. }
  14328. if (lower !== undefined) {
  14329. lower = toNumber(lower);
  14330. lower = lower === lower ? lower : 0;
  14331. }
  14332. return baseClamp(toNumber(number), lower, upper);
  14333. }
  14334. /**
  14335. * Checks if `n` is between `start` and up to, but not including, `end`. If
  14336. * `end` is not specified, it's set to `start` with `start` then set to `0`.
  14337. * If `start` is greater than `end` the params are swapped to support
  14338. * negative ranges.
  14339. *
  14340. * @static
  14341. * @memberOf _
  14342. * @since 3.3.0
  14343. * @category Number
  14344. * @param {number} number The number to check.
  14345. * @param {number} [start=0] The start of the range.
  14346. * @param {number} end The end of the range.
  14347. * @returns {boolean} Returns `true` if `number` is in the range, else `false`.
  14348. * @see _.range, _.rangeRight
  14349. * @example
  14350. *
  14351. * _.inRange(3, 2, 4);
  14352. * // => true
  14353. *
  14354. * _.inRange(4, 8);
  14355. * // => true
  14356. *
  14357. * _.inRange(4, 2);
  14358. * // => false
  14359. *
  14360. * _.inRange(2, 2);
  14361. * // => false
  14362. *
  14363. * _.inRange(1.2, 2);
  14364. * // => true
  14365. *
  14366. * _.inRange(5.2, 4);
  14367. * // => false
  14368. *
  14369. * _.inRange(-3, -2, -6);
  14370. * // => true
  14371. */
  14372. function inRange(number, start, end) {
  14373. start = toFinite(start);
  14374. if (end === undefined) {
  14375. end = start;
  14376. start = 0;
  14377. } else {
  14378. end = toFinite(end);
  14379. }
  14380. number = toNumber(number);
  14381. return baseInRange(number, start, end);
  14382. }
  14383. /**
  14384. * Produces a random number between the inclusive `lower` and `upper` bounds.
  14385. * If only one argument is provided a number between `0` and the given number
  14386. * is returned. If `floating` is `true`, or either `lower` or `upper` are
  14387. * floats, a floating-point number is returned instead of an integer.
  14388. *
  14389. * **Note:** JavaScript follows the IEEE-754 standard for resolving
  14390. * floating-point values which can produce unexpected results.
  14391. *
  14392. * @static
  14393. * @memberOf _
  14394. * @since 0.7.0
  14395. * @category Number
  14396. * @param {number} [lower=0] The lower bound.
  14397. * @param {number} [upper=1] The upper bound.
  14398. * @param {boolean} [floating] Specify returning a floating-point number.
  14399. * @returns {number} Returns the random number.
  14400. * @example
  14401. *
  14402. * _.random(0, 5);
  14403. * // => an integer between 0 and 5
  14404. *
  14405. * _.random(5);
  14406. * // => also an integer between 0 and 5
  14407. *
  14408. * _.random(5, true);
  14409. * // => a floating-point number between 0 and 5
  14410. *
  14411. * _.random(1.2, 5.2);
  14412. * // => a floating-point number between 1.2 and 5.2
  14413. */
  14414. function random(lower, upper, floating) {
  14415. if (floating && typeof floating != 'boolean' && isIterateeCall(lower, upper, floating)) {
  14416. upper = floating = undefined;
  14417. }
  14418. if (floating === undefined) {
  14419. if (typeof upper == 'boolean') {
  14420. floating = upper;
  14421. upper = undefined;
  14422. }
  14423. else if (typeof lower == 'boolean') {
  14424. floating = lower;
  14425. lower = undefined;
  14426. }
  14427. }
  14428. if (lower === undefined && upper === undefined) {
  14429. lower = 0;
  14430. upper = 1;
  14431. }
  14432. else {
  14433. lower = toFinite(lower);
  14434. if (upper === undefined) {
  14435. upper = lower;
  14436. lower = 0;
  14437. } else {
  14438. upper = toFinite(upper);
  14439. }
  14440. }
  14441. if (lower > upper) {
  14442. var temp = lower;
  14443. lower = upper;
  14444. upper = temp;
  14445. }
  14446. if (floating || lower % 1 || upper % 1) {
  14447. var rand = nativeRandom();
  14448. return nativeMin(lower + (rand * (upper - lower + freeParseFloat('1e-' + ((rand + '').length - 1)))), upper);
  14449. }
  14450. return baseRandom(lower, upper);
  14451. }
  14452. /*------------------------------------------------------------------------*/
  14453. /**
  14454. * Converts `string` to [camel case](https://en.wikipedia.org/wiki/CamelCase).
  14455. *
  14456. * @static
  14457. * @memberOf _
  14458. * @since 3.0.0
  14459. * @category String
  14460. * @param {string} [string=''] The string to convert.
  14461. * @returns {string} Returns the camel cased string.
  14462. * @example
  14463. *
  14464. * _.camelCase('Foo Bar');
  14465. * // => 'fooBar'
  14466. *
  14467. * _.camelCase('--foo-bar--');
  14468. * // => 'fooBar'
  14469. *
  14470. * _.camelCase('__FOO_BAR__');
  14471. * // => 'fooBar'
  14472. */
  14473. var camelCase = createCompounder(function(result, word, index) {
  14474. word = word.toLowerCase();
  14475. return result + (index ? capitalize(word) : word);
  14476. });
  14477. /**
  14478. * Converts the first character of `string` to upper case and the remaining
  14479. * to lower case.
  14480. *
  14481. * @static
  14482. * @memberOf _
  14483. * @since 3.0.0
  14484. * @category String
  14485. * @param {string} [string=''] The string to capitalize.
  14486. * @returns {string} Returns the capitalized string.
  14487. * @example
  14488. *
  14489. * _.capitalize('FRED');
  14490. * // => 'Fred'
  14491. */
  14492. function capitalize(string) {
  14493. return upperFirst(toString(string).toLowerCase());
  14494. }
  14495. /**
  14496. * Deburrs `string` by converting
  14497. * [Latin-1 Supplement](https://en.wikipedia.org/wiki/Latin-1_Supplement_(Unicode_block)#Character_table)
  14498. * and [Latin Extended-A](https://en.wikipedia.org/wiki/Latin_Extended-A)
  14499. * letters to basic Latin letters and removing
  14500. * [combining diacritical marks](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks).
  14501. *
  14502. * @static
  14503. * @memberOf _
  14504. * @since 3.0.0
  14505. * @category String
  14506. * @param {string} [string=''] The string to deburr.
  14507. * @returns {string} Returns the deburred string.
  14508. * @example
  14509. *
  14510. * _.deburr('déjà vu');
  14511. * // => 'deja vu'
  14512. */
  14513. function deburr(string) {
  14514. string = toString(string);
  14515. return string && string.replace(reLatin, deburrLetter).replace(reComboMark, '');
  14516. }
  14517. /**
  14518. * Checks if `string` ends with the given target string.
  14519. *
  14520. * @static
  14521. * @memberOf _
  14522. * @since 3.0.0
  14523. * @category String
  14524. * @param {string} [string=''] The string to inspect.
  14525. * @param {string} [target] The string to search for.
  14526. * @param {number} [position=string.length] The position to search up to.
  14527. * @returns {boolean} Returns `true` if `string` ends with `target`,
  14528. * else `false`.
  14529. * @example
  14530. *
  14531. * _.endsWith('abc', 'c');
  14532. * // => true
  14533. *
  14534. * _.endsWith('abc', 'b');
  14535. * // => false
  14536. *
  14537. * _.endsWith('abc', 'b', 2);
  14538. * // => true
  14539. */
  14540. function endsWith(string, target, position) {
  14541. string = toString(string);
  14542. target = baseToString(target);
  14543. var length = string.length;
  14544. position = position === undefined
  14545. ? length
  14546. : baseClamp(toInteger(position), 0, length);
  14547. var end = position;
  14548. position -= target.length;
  14549. return position >= 0 && string.slice(position, end) == target;
  14550. }
  14551. /**
  14552. * Converts the characters "&", "<", ">", '"', and "'" in `string` to their
  14553. * corresponding HTML entities.
  14554. *
  14555. * **Note:** No other characters are escaped. To escape additional
  14556. * characters use a third-party library like [_he_](https://mths.be/he).
  14557. *
  14558. * Though the ">" character is escaped for symmetry, characters like
  14559. * ">" and "/" don't need escaping in HTML and have no special meaning
  14560. * unless they're part of a tag or unquoted attribute value. See
  14561. * [Mathias Bynens's article](https://mathiasbynens.be/notes/ambiguous-ampersands)
  14562. * (under "semi-related fun fact") for more details.
  14563. *
  14564. * When working with HTML you should always
  14565. * [quote attribute values](http://wonko.com/post/html-escaping) to reduce
  14566. * XSS vectors.
  14567. *
  14568. * @static
  14569. * @since 0.1.0
  14570. * @memberOf _
  14571. * @category String
  14572. * @param {string} [string=''] The string to escape.
  14573. * @returns {string} Returns the escaped string.
  14574. * @example
  14575. *
  14576. * _.escape('fred, barney, & pebbles');
  14577. * // => 'fred, barney, &amp; pebbles'
  14578. */
  14579. function escape(string) {
  14580. string = toString(string);
  14581. return (string && reHasUnescapedHtml.test(string))
  14582. ? string.replace(reUnescapedHtml, escapeHtmlChar)
  14583. : string;
  14584. }
  14585. /**
  14586. * Escapes the `RegExp` special characters "^", "$", "\", ".", "*", "+",
  14587. * "?", "(", ")", "[", "]", "{", "}", and "|" in `string`.
  14588. *
  14589. * @static
  14590. * @memberOf _
  14591. * @since 3.0.0
  14592. * @category String
  14593. * @param {string} [string=''] The string to escape.
  14594. * @returns {string} Returns the escaped string.
  14595. * @example
  14596. *
  14597. * _.escapeRegExp('[lodash](https://lodash.com/)');
  14598. * // => '\[lodash\]\(https://lodash\.com/\)'
  14599. */
  14600. function escapeRegExp(string) {
  14601. string = toString(string);
  14602. return (string && reHasRegExpChar.test(string))
  14603. ? string.replace(reRegExpChar, '\\$&')
  14604. : string;
  14605. }
  14606. /**
  14607. * Converts `string` to
  14608. * [kebab case](https://en.wikipedia.org/wiki/Letter_case#Special_case_styles).
  14609. *
  14610. * @static
  14611. * @memberOf _
  14612. * @since 3.0.0
  14613. * @category String
  14614. * @param {string} [string=''] The string to convert.
  14615. * @returns {string} Returns the kebab cased string.
  14616. * @example
  14617. *
  14618. * _.kebabCase('Foo Bar');
  14619. * // => 'foo-bar'
  14620. *
  14621. * _.kebabCase('fooBar');
  14622. * // => 'foo-bar'
  14623. *
  14624. * _.kebabCase('__FOO_BAR__');
  14625. * // => 'foo-bar'
  14626. */
  14627. var kebabCase = createCompounder(function(result, word, index) {
  14628. return result + (index ? '-' : '') + word.toLowerCase();
  14629. });
  14630. /**
  14631. * Converts `string`, as space separated words, to lower case.
  14632. *
  14633. * @static
  14634. * @memberOf _
  14635. * @since 4.0.0
  14636. * @category String
  14637. * @param {string} [string=''] The string to convert.
  14638. * @returns {string} Returns the lower cased string.
  14639. * @example
  14640. *
  14641. * _.lowerCase('--Foo-Bar--');
  14642. * // => 'foo bar'
  14643. *
  14644. * _.lowerCase('fooBar');
  14645. * // => 'foo bar'
  14646. *
  14647. * _.lowerCase('__FOO_BAR__');
  14648. * // => 'foo bar'
  14649. */
  14650. var lowerCase = createCompounder(function(result, word, index) {
  14651. return result + (index ? ' ' : '') + word.toLowerCase();
  14652. });
  14653. /**
  14654. * Converts the first character of `string` to lower case.
  14655. *
  14656. * @static
  14657. * @memberOf _
  14658. * @since 4.0.0
  14659. * @category String
  14660. * @param {string} [string=''] The string to convert.
  14661. * @returns {string} Returns the converted string.
  14662. * @example
  14663. *
  14664. * _.lowerFirst('Fred');
  14665. * // => 'fred'
  14666. *
  14667. * _.lowerFirst('FRED');
  14668. * // => 'fRED'
  14669. */
  14670. var lowerFirst = createCaseFirst('toLowerCase');
  14671. /**
  14672. * Pads `string` on the left and right sides if it's shorter than `length`.
  14673. * Padding characters are truncated if they can't be evenly divided by `length`.
  14674. *
  14675. * @static
  14676. * @memberOf _
  14677. * @since 3.0.0
  14678. * @category String
  14679. * @param {string} [string=''] The string to pad.
  14680. * @param {number} [length=0] The padding length.
  14681. * @param {string} [chars=' '] The string used as padding.
  14682. * @returns {string} Returns the padded string.
  14683. * @example
  14684. *
  14685. * _.pad('abc', 8);
  14686. * // => ' abc '
  14687. *
  14688. * _.pad('abc', 8, '_-');
  14689. * // => '_-abc_-_'
  14690. *
  14691. * _.pad('abc', 3);
  14692. * // => 'abc'
  14693. */
  14694. function pad(string, length, chars) {
  14695. string = toString(string);
  14696. length = toInteger(length);
  14697. var strLength = length ? stringSize(string) : 0;
  14698. if (!length || strLength >= length) {
  14699. return string;
  14700. }
  14701. var mid = (length - strLength) / 2;
  14702. return (
  14703. createPadding(nativeFloor(mid), chars) +
  14704. string +
  14705. createPadding(nativeCeil(mid), chars)
  14706. );
  14707. }
  14708. /**
  14709. * Pads `string` on the right side if it's shorter than `length`. Padding
  14710. * characters are truncated if they exceed `length`.
  14711. *
  14712. * @static
  14713. * @memberOf _
  14714. * @since 4.0.0
  14715. * @category String
  14716. * @param {string} [string=''] The string to pad.
  14717. * @param {number} [length=0] The padding length.
  14718. * @param {string} [chars=' '] The string used as padding.
  14719. * @returns {string} Returns the padded string.
  14720. * @example
  14721. *
  14722. * _.padEnd('abc', 6);
  14723. * // => 'abc '
  14724. *
  14725. * _.padEnd('abc', 6, '_-');
  14726. * // => 'abc_-_'
  14727. *
  14728. * _.padEnd('abc', 3);
  14729. * // => 'abc'
  14730. */
  14731. function padEnd(string, length, chars) {
  14732. string = toString(string);
  14733. length = toInteger(length);
  14734. var strLength = length ? stringSize(string) : 0;
  14735. return (length && strLength < length)
  14736. ? (string + createPadding(length - strLength, chars))
  14737. : string;
  14738. }
  14739. /**
  14740. * Pads `string` on the left side if it's shorter than `length`. Padding
  14741. * characters are truncated if they exceed `length`.
  14742. *
  14743. * @static
  14744. * @memberOf _
  14745. * @since 4.0.0
  14746. * @category String
  14747. * @param {string} [string=''] The string to pad.
  14748. * @param {number} [length=0] The padding length.
  14749. * @param {string} [chars=' '] The string used as padding.
  14750. * @returns {string} Returns the padded string.
  14751. * @example
  14752. *
  14753. * _.padStart('abc', 6);
  14754. * // => ' abc'
  14755. *
  14756. * _.padStart('abc', 6, '_-');
  14757. * // => '_-_abc'
  14758. *
  14759. * _.padStart('abc', 3);
  14760. * // => 'abc'
  14761. */
  14762. function padStart(string, length, chars) {
  14763. string = toString(string);
  14764. length = toInteger(length);
  14765. var strLength = length ? stringSize(string) : 0;
  14766. return (length && strLength < length)
  14767. ? (createPadding(length - strLength, chars) + string)
  14768. : string;
  14769. }
  14770. /**
  14771. * Converts `string` to an integer of the specified radix. If `radix` is
  14772. * `undefined` or `0`, a `radix` of `10` is used unless `value` is a
  14773. * hexadecimal, in which case a `radix` of `16` is used.
  14774. *
  14775. * **Note:** This method aligns with the
  14776. * [ES5 implementation](https://es5.github.io/#x15.1.2.2) of `parseInt`.
  14777. *
  14778. * @static
  14779. * @memberOf _
  14780. * @since 1.1.0
  14781. * @category String
  14782. * @param {string} string The string to convert.
  14783. * @param {number} [radix=10] The radix to interpret `value` by.
  14784. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  14785. * @returns {number} Returns the converted integer.
  14786. * @example
  14787. *
  14788. * _.parseInt('08');
  14789. * // => 8
  14790. *
  14791. * _.map(['6', '08', '10'], _.parseInt);
  14792. * // => [6, 8, 10]
  14793. */
  14794. function parseInt(string, radix, guard) {
  14795. if (guard || radix == null) {
  14796. radix = 0;
  14797. } else if (radix) {
  14798. radix = +radix;
  14799. }
  14800. return nativeParseInt(toString(string).replace(reTrimStart, ''), radix || 0);
  14801. }
  14802. /**
  14803. * Repeats the given string `n` times.
  14804. *
  14805. * @static
  14806. * @memberOf _
  14807. * @since 3.0.0
  14808. * @category String
  14809. * @param {string} [string=''] The string to repeat.
  14810. * @param {number} [n=1] The number of times to repeat the string.
  14811. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  14812. * @returns {string} Returns the repeated string.
  14813. * @example
  14814. *
  14815. * _.repeat('*', 3);
  14816. * // => '***'
  14817. *
  14818. * _.repeat('abc', 2);
  14819. * // => 'abcabc'
  14820. *
  14821. * _.repeat('abc', 0);
  14822. * // => ''
  14823. */
  14824. function repeat(string, n, guard) {
  14825. if ((guard ? isIterateeCall(string, n, guard) : n === undefined)) {
  14826. n = 1;
  14827. } else {
  14828. n = toInteger(n);
  14829. }
  14830. return baseRepeat(toString(string), n);
  14831. }
  14832. /**
  14833. * Replaces matches for `pattern` in `string` with `replacement`.
  14834. *
  14835. * **Note:** This method is based on
  14836. * [`String#replace`](https://mdn.io/String/replace).
  14837. *
  14838. * @static
  14839. * @memberOf _
  14840. * @since 4.0.0
  14841. * @category String
  14842. * @param {string} [string=''] The string to modify.
  14843. * @param {RegExp|string} pattern The pattern to replace.
  14844. * @param {Function|string} replacement The match replacement.
  14845. * @returns {string} Returns the modified string.
  14846. * @example
  14847. *
  14848. * _.replace('Hi Fred', 'Fred', 'Barney');
  14849. * // => 'Hi Barney'
  14850. */
  14851. function replace() {
  14852. var args = arguments,
  14853. string = toString(args[0]);
  14854. return args.length < 3 ? string : string.replace(args[1], args[2]);
  14855. }
  14856. /**
  14857. * Converts `string` to
  14858. * [snake case](https://en.wikipedia.org/wiki/Snake_case).
  14859. *
  14860. * @static
  14861. * @memberOf _
  14862. * @since 3.0.0
  14863. * @category String
  14864. * @param {string} [string=''] The string to convert.
  14865. * @returns {string} Returns the snake cased string.
  14866. * @example
  14867. *
  14868. * _.snakeCase('Foo Bar');
  14869. * // => 'foo_bar'
  14870. *
  14871. * _.snakeCase('fooBar');
  14872. * // => 'foo_bar'
  14873. *
  14874. * _.snakeCase('--FOO-BAR--');
  14875. * // => 'foo_bar'
  14876. */
  14877. var snakeCase = createCompounder(function(result, word, index) {
  14878. return result + (index ? '_' : '') + word.toLowerCase();
  14879. });
  14880. /**
  14881. * Splits `string` by `separator`.
  14882. *
  14883. * **Note:** This method is based on
  14884. * [`String#split`](https://mdn.io/String/split).
  14885. *
  14886. * @static
  14887. * @memberOf _
  14888. * @since 4.0.0
  14889. * @category String
  14890. * @param {string} [string=''] The string to split.
  14891. * @param {RegExp|string} separator The separator pattern to split by.
  14892. * @param {number} [limit] The length to truncate results to.
  14893. * @returns {Array} Returns the string segments.
  14894. * @example
  14895. *
  14896. * _.split('a-b-c', '-', 2);
  14897. * // => ['a', 'b']
  14898. */
  14899. function split(string, separator, limit) {
  14900. if (limit && typeof limit != 'number' && isIterateeCall(string, separator, limit)) {
  14901. separator = limit = undefined;
  14902. }
  14903. limit = limit === undefined ? MAX_ARRAY_LENGTH : limit >>> 0;
  14904. if (!limit) {
  14905. return [];
  14906. }
  14907. string = toString(string);
  14908. if (string && (
  14909. typeof separator == 'string' ||
  14910. (separator != null && !isRegExp(separator))
  14911. )) {
  14912. separator = baseToString(separator);
  14913. if (!separator && hasUnicode(string)) {
  14914. return castSlice(stringToArray(string), 0, limit);
  14915. }
  14916. }
  14917. return string.split(separator, limit);
  14918. }
  14919. /**
  14920. * Converts `string` to
  14921. * [start case](https://en.wikipedia.org/wiki/Letter_case#Stylistic_or_specialised_usage).
  14922. *
  14923. * @static
  14924. * @memberOf _
  14925. * @since 3.1.0
  14926. * @category String
  14927. * @param {string} [string=''] The string to convert.
  14928. * @returns {string} Returns the start cased string.
  14929. * @example
  14930. *
  14931. * _.startCase('--foo-bar--');
  14932. * // => 'Foo Bar'
  14933. *
  14934. * _.startCase('fooBar');
  14935. * // => 'Foo Bar'
  14936. *
  14937. * _.startCase('__FOO_BAR__');
  14938. * // => 'FOO BAR'
  14939. */
  14940. var startCase = createCompounder(function(result, word, index) {
  14941. return result + (index ? ' ' : '') + upperFirst(word);
  14942. });
  14943. /**
  14944. * Checks if `string` starts with the given target string.
  14945. *
  14946. * @static
  14947. * @memberOf _
  14948. * @since 3.0.0
  14949. * @category String
  14950. * @param {string} [string=''] The string to inspect.
  14951. * @param {string} [target] The string to search for.
  14952. * @param {number} [position=0] The position to search from.
  14953. * @returns {boolean} Returns `true` if `string` starts with `target`,
  14954. * else `false`.
  14955. * @example
  14956. *
  14957. * _.startsWith('abc', 'a');
  14958. * // => true
  14959. *
  14960. * _.startsWith('abc', 'b');
  14961. * // => false
  14962. *
  14963. * _.startsWith('abc', 'b', 1);
  14964. * // => true
  14965. */
  14966. function startsWith(string, target, position) {
  14967. string = toString(string);
  14968. position = position == null
  14969. ? 0
  14970. : baseClamp(toInteger(position), 0, string.length);
  14971. target = baseToString(target);
  14972. return string.slice(position, position + target.length) == target;
  14973. }
  14974. /**
  14975. * Creates a compiled template function that can interpolate data properties
  14976. * in "interpolate" delimiters, HTML-escape interpolated data properties in
  14977. * "escape" delimiters, and execute JavaScript in "evaluate" delimiters. Data
  14978. * properties may be accessed as free variables in the template. If a setting
  14979. * object is given, it takes precedence over `_.templateSettings` values.
  14980. *
  14981. * **Note:** In the development build `_.template` utilizes
  14982. * [sourceURLs](http://www.html5rocks.com/en/tutorials/developertools/sourcemaps/#toc-sourceurl)
  14983. * for easier debugging.
  14984. *
  14985. * For more information on precompiling templates see
  14986. * [lodash's custom builds documentation](https://lodash.com/custom-builds).
  14987. *
  14988. * For more information on Chrome extension sandboxes see
  14989. * [Chrome's extensions documentation](https://developer.chrome.com/extensions/sandboxingEval).
  14990. *
  14991. * @static
  14992. * @since 0.1.0
  14993. * @memberOf _
  14994. * @category String
  14995. * @param {string} [string=''] The template string.
  14996. * @param {Object} [options={}] The options object.
  14997. * @param {RegExp} [options.escape=_.templateSettings.escape]
  14998. * The HTML "escape" delimiter.
  14999. * @param {RegExp} [options.evaluate=_.templateSettings.evaluate]
  15000. * The "evaluate" delimiter.
  15001. * @param {Object} [options.imports=_.templateSettings.imports]
  15002. * An object to import into the template as free variables.
  15003. * @param {RegExp} [options.interpolate=_.templateSettings.interpolate]
  15004. * The "interpolate" delimiter.
  15005. * @param {string} [options.sourceURL='lodash.templateSources[n]']
  15006. * The sourceURL of the compiled template.
  15007. * @param {string} [options.variable='obj']
  15008. * The data object variable name.
  15009. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  15010. * @returns {Function} Returns the compiled template function.
  15011. * @example
  15012. *
  15013. * // Use the "interpolate" delimiter to create a compiled template.
  15014. * var compiled = _.template('hello <%= user %>!');
  15015. * compiled({ 'user': 'fred' });
  15016. * // => 'hello fred!'
  15017. *
  15018. * // Use the HTML "escape" delimiter to escape data property values.
  15019. * var compiled = _.template('<b><%- value %></b>');
  15020. * compiled({ 'value': '<script>' });
  15021. * // => '<b>&lt;script&gt;</b>'
  15022. *
  15023. * // Use the "evaluate" delimiter to execute JavaScript and generate HTML.
  15024. * var compiled = _.template('<% _.forEach(users, function(user) { %><li><%- user %></li><% }); %>');
  15025. * compiled({ 'users': ['fred', 'barney'] });
  15026. * // => '<li>fred</li><li>barney</li>'
  15027. *
  15028. * // Use the internal `print` function in "evaluate" delimiters.
  15029. * var compiled = _.template('<% print("hello " + user); %>!');
  15030. * compiled({ 'user': 'barney' });
  15031. * // => 'hello barney!'
  15032. *
  15033. * // Use the ES template literal delimiter as an "interpolate" delimiter.
  15034. * // Disable support by replacing the "interpolate" delimiter.
  15035. * var compiled = _.template('hello ${ user }!');
  15036. * compiled({ 'user': 'pebbles' });
  15037. * // => 'hello pebbles!'
  15038. *
  15039. * // Use backslashes to treat delimiters as plain text.
  15040. * var compiled = _.template('<%= "\\<%- value %\\>" %>');
  15041. * compiled({ 'value': 'ignored' });
  15042. * // => '<%- value %>'
  15043. *
  15044. * // Use the `imports` option to import `jQuery` as `jq`.
  15045. * var text = '<% jq.each(users, function(user) { %><li><%- user %></li><% }); %>';
  15046. * var compiled = _.template(text, { 'imports': { 'jq': jQuery } });
  15047. * compiled({ 'users': ['fred', 'barney'] });
  15048. * // => '<li>fred</li><li>barney</li>'
  15049. *
  15050. * // Use the `sourceURL` option to specify a custom sourceURL for the template.
  15051. * var compiled = _.template('hello <%= user %>!', { 'sourceURL': '/basic/greeting.jst' });
  15052. * compiled(data);
  15053. * // => Find the source of "greeting.jst" under the Sources tab or Resources panel of the web inspector.
  15054. *
  15055. * // Use the `variable` option to ensure a with-statement isn't used in the compiled template.
  15056. * var compiled = _.template('hi <%= data.user %>!', { 'variable': 'data' });
  15057. * compiled.source;
  15058. * // => function(data) {
  15059. * // var __t, __p = '';
  15060. * // __p += 'hi ' + ((__t = ( data.user )) == null ? '' : __t) + '!';
  15061. * // return __p;
  15062. * // }
  15063. *
  15064. * // Use custom template delimiters.
  15065. * _.templateSettings.interpolate = /{{([\s\S]+?)}}/g;
  15066. * var compiled = _.template('hello {{ user }}!');
  15067. * compiled({ 'user': 'mustache' });
  15068. * // => 'hello mustache!'
  15069. *
  15070. * // Use the `source` property to inline compiled templates for meaningful
  15071. * // line numbers in error messages and stack traces.
  15072. * fs.writeFileSync(path.join(process.cwd(), 'jst.js'), '\
  15073. * var JST = {\
  15074. * "main": ' + _.template(mainText).source + '\
  15075. * };\
  15076. * ');
  15077. */
  15078. function template(string, options, guard) {
  15079. // Based on John Resig's `tmpl` implementation
  15080. // (http://ejohn.org/blog/javascript-micro-templating/)
  15081. // and Laura Doktorova's doT.js (https://github.com/olado/doT).
  15082. var settings = lodash.templateSettings;
  15083. if (guard && isIterateeCall(string, options, guard)) {
  15084. options = undefined;
  15085. }
  15086. string = toString(string);
  15087. options = assignInWith({}, options, settings, customDefaultsAssignIn);
  15088. var imports = assignInWith({}, options.imports, settings.imports, customDefaultsAssignIn),
  15089. importsKeys = keys(imports),
  15090. importsValues = baseValues(imports, importsKeys);
  15091. var isEscaping,
  15092. isEvaluating,
  15093. index = 0,
  15094. interpolate = options.interpolate || reNoMatch,
  15095. source = "__p += '";
  15096. // Compile the regexp to match each delimiter.
  15097. var reDelimiters = RegExp(
  15098. (options.escape || reNoMatch).source + '|' +
  15099. interpolate.source + '|' +
  15100. (interpolate === reInterpolate ? reEsTemplate : reNoMatch).source + '|' +
  15101. (options.evaluate || reNoMatch).source + '|$'
  15102. , 'g');
  15103. // Use a sourceURL for easier debugging.
  15104. // The sourceURL gets injected into the source that's eval-ed, so be careful
  15105. // to normalize all kinds of whitespace, so e.g. newlines (and unicode versions of it) can't sneak in
  15106. // and escape the comment, thus injecting code that gets evaled.
  15107. var sourceURL = '//# sourceURL=' +
  15108. (hasOwnProperty.call(options, 'sourceURL')
  15109. ? (options.sourceURL + '').replace(/\s/g, ' ')
  15110. : ('lodash.templateSources[' + (++templateCounter) + ']')
  15111. ) + '\n';
  15112. string.replace(reDelimiters, function(match, escapeValue, interpolateValue, esTemplateValue, evaluateValue, offset) {
  15113. interpolateValue || (interpolateValue = esTemplateValue);
  15114. // Escape characters that can't be included in string literals.
  15115. source += string.slice(index, offset).replace(reUnescapedString, escapeStringChar);
  15116. // Replace delimiters with snippets.
  15117. if (escapeValue) {
  15118. isEscaping = true;
  15119. source += "' +\n__e(" + escapeValue + ") +\n'";
  15120. }
  15121. if (evaluateValue) {
  15122. isEvaluating = true;
  15123. source += "';\n" + evaluateValue + ";\n__p += '";
  15124. }
  15125. if (interpolateValue) {
  15126. source += "' +\n((__t = (" + interpolateValue + ")) == null ? '' : __t) +\n'";
  15127. }
  15128. index = offset + match.length;
  15129. // The JS engine embedded in Adobe products needs `match` returned in
  15130. // order to produce the correct `offset` value.
  15131. return match;
  15132. });
  15133. source += "';\n";
  15134. // If `variable` is not specified wrap a with-statement around the generated
  15135. // code to add the data object to the top of the scope chain.
  15136. var variable = hasOwnProperty.call(options, 'variable') && options.variable;
  15137. if (!variable) {
  15138. source = 'with (obj) {\n' + source + '\n}\n';
  15139. }
  15140. // Throw an error if a forbidden character was found in `variable`, to prevent
  15141. // potential command injection attacks.
  15142. else if (reForbiddenIdentifierChars.test(variable)) {
  15143. throw new Error(INVALID_TEMPL_VAR_ERROR_TEXT);
  15144. }
  15145. // Cleanup code by stripping empty strings.
  15146. source = (isEvaluating ? source.replace(reEmptyStringLeading, '') : source)
  15147. .replace(reEmptyStringMiddle, '$1')
  15148. .replace(reEmptyStringTrailing, '$1;');
  15149. // Frame code as the function body.
  15150. source = 'function(' + (variable || 'obj') + ') {\n' +
  15151. (variable
  15152. ? ''
  15153. : 'obj || (obj = {});\n'
  15154. ) +
  15155. "var __t, __p = ''" +
  15156. (isEscaping
  15157. ? ', __e = _.escape'
  15158. : ''
  15159. ) +
  15160. (isEvaluating
  15161. ? ', __j = Array.prototype.join;\n' +
  15162. "function print() { __p += __j.call(arguments, '') }\n"
  15163. : ';\n'
  15164. ) +
  15165. source +
  15166. 'return __p\n}';
  15167. var result = attempt(function() {
  15168. return Function(importsKeys, sourceURL + 'return ' + source)
  15169. .apply(undefined, importsValues);
  15170. });
  15171. // Provide the compiled function's source by its `toString` method or
  15172. // the `source` property as a convenience for inlining compiled templates.
  15173. result.source = source;
  15174. if (isError(result)) {
  15175. throw result;
  15176. }
  15177. return result;
  15178. }
  15179. /**
  15180. * Converts `string`, as a whole, to lower case just like
  15181. * [String#toLowerCase](https://mdn.io/toLowerCase).
  15182. *
  15183. * @static
  15184. * @memberOf _
  15185. * @since 4.0.0
  15186. * @category String
  15187. * @param {string} [string=''] The string to convert.
  15188. * @returns {string} Returns the lower cased string.
  15189. * @example
  15190. *
  15191. * _.toLower('--Foo-Bar--');
  15192. * // => '--foo-bar--'
  15193. *
  15194. * _.toLower('fooBar');
  15195. * // => 'foobar'
  15196. *
  15197. * _.toLower('__FOO_BAR__');
  15198. * // => '__foo_bar__'
  15199. */
  15200. function toLower(value) {
  15201. return toString(value).toLowerCase();
  15202. }
  15203. /**
  15204. * Converts `string`, as a whole, to upper case just like
  15205. * [String#toUpperCase](https://mdn.io/toUpperCase).
  15206. *
  15207. * @static
  15208. * @memberOf _
  15209. * @since 4.0.0
  15210. * @category String
  15211. * @param {string} [string=''] The string to convert.
  15212. * @returns {string} Returns the upper cased string.
  15213. * @example
  15214. *
  15215. * _.toUpper('--foo-bar--');
  15216. * // => '--FOO-BAR--'
  15217. *
  15218. * _.toUpper('fooBar');
  15219. * // => 'FOOBAR'
  15220. *
  15221. * _.toUpper('__foo_bar__');
  15222. * // => '__FOO_BAR__'
  15223. */
  15224. function toUpper(value) {
  15225. return toString(value).toUpperCase();
  15226. }
  15227. /**
  15228. * Removes leading and trailing whitespace or specified characters from `string`.
  15229. *
  15230. * @static
  15231. * @memberOf _
  15232. * @since 3.0.0
  15233. * @category String
  15234. * @param {string} [string=''] The string to trim.
  15235. * @param {string} [chars=whitespace] The characters to trim.
  15236. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  15237. * @returns {string} Returns the trimmed string.
  15238. * @example
  15239. *
  15240. * _.trim(' abc ');
  15241. * // => 'abc'
  15242. *
  15243. * _.trim('-_-abc-_-', '_-');
  15244. * // => 'abc'
  15245. *
  15246. * _.map([' foo ', ' bar '], _.trim);
  15247. * // => ['foo', 'bar']
  15248. */
  15249. function trim(string, chars, guard) {
  15250. string = toString(string);
  15251. if (string && (guard || chars === undefined)) {
  15252. return baseTrim(string);
  15253. }
  15254. if (!string || !(chars = baseToString(chars))) {
  15255. return string;
  15256. }
  15257. var strSymbols = stringToArray(string),
  15258. chrSymbols = stringToArray(chars),
  15259. start = charsStartIndex(strSymbols, chrSymbols),
  15260. end = charsEndIndex(strSymbols, chrSymbols) + 1;
  15261. return castSlice(strSymbols, start, end).join('');
  15262. }
  15263. /**
  15264. * Removes trailing whitespace or specified characters from `string`.
  15265. *
  15266. * @static
  15267. * @memberOf _
  15268. * @since 4.0.0
  15269. * @category String
  15270. * @param {string} [string=''] The string to trim.
  15271. * @param {string} [chars=whitespace] The characters to trim.
  15272. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  15273. * @returns {string} Returns the trimmed string.
  15274. * @example
  15275. *
  15276. * _.trimEnd(' abc ');
  15277. * // => ' abc'
  15278. *
  15279. * _.trimEnd('-_-abc-_-', '_-');
  15280. * // => '-_-abc'
  15281. */
  15282. function trimEnd(string, chars, guard) {
  15283. string = toString(string);
  15284. if (string && (guard || chars === undefined)) {
  15285. return string.slice(0, trimmedEndIndex(string) + 1);
  15286. }
  15287. if (!string || !(chars = baseToString(chars))) {
  15288. return string;
  15289. }
  15290. var strSymbols = stringToArray(string),
  15291. end = charsEndIndex(strSymbols, stringToArray(chars)) + 1;
  15292. return castSlice(strSymbols, 0, end).join('');
  15293. }
  15294. /**
  15295. * Removes leading whitespace or specified characters from `string`.
  15296. *
  15297. * @static
  15298. * @memberOf _
  15299. * @since 4.0.0
  15300. * @category String
  15301. * @param {string} [string=''] The string to trim.
  15302. * @param {string} [chars=whitespace] The characters to trim.
  15303. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  15304. * @returns {string} Returns the trimmed string.
  15305. * @example
  15306. *
  15307. * _.trimStart(' abc ');
  15308. * // => 'abc '
  15309. *
  15310. * _.trimStart('-_-abc-_-', '_-');
  15311. * // => 'abc-_-'
  15312. */
  15313. function trimStart(string, chars, guard) {
  15314. string = toString(string);
  15315. if (string && (guard || chars === undefined)) {
  15316. return string.replace(reTrimStart, '');
  15317. }
  15318. if (!string || !(chars = baseToString(chars))) {
  15319. return string;
  15320. }
  15321. var strSymbols = stringToArray(string),
  15322. start = charsStartIndex(strSymbols, stringToArray(chars));
  15323. return castSlice(strSymbols, start).join('');
  15324. }
  15325. /**
  15326. * Truncates `string` if it's longer than the given maximum string length.
  15327. * The last characters of the truncated string are replaced with the omission
  15328. * string which defaults to "...".
  15329. *
  15330. * @static
  15331. * @memberOf _
  15332. * @since 4.0.0
  15333. * @category String
  15334. * @param {string} [string=''] The string to truncate.
  15335. * @param {Object} [options={}] The options object.
  15336. * @param {number} [options.length=30] The maximum string length.
  15337. * @param {string} [options.omission='...'] The string to indicate text is omitted.
  15338. * @param {RegExp|string} [options.separator] The separator pattern to truncate to.
  15339. * @returns {string} Returns the truncated string.
  15340. * @example
  15341. *
  15342. * _.truncate('hi-diddly-ho there, neighborino');
  15343. * // => 'hi-diddly-ho there, neighbo...'
  15344. *
  15345. * _.truncate('hi-diddly-ho there, neighborino', {
  15346. * 'length': 24,
  15347. * 'separator': ' '
  15348. * });
  15349. * // => 'hi-diddly-ho there,...'
  15350. *
  15351. * _.truncate('hi-diddly-ho there, neighborino', {
  15352. * 'length': 24,
  15353. * 'separator': /,? +/
  15354. * });
  15355. * // => 'hi-diddly-ho there...'
  15356. *
  15357. * _.truncate('hi-diddly-ho there, neighborino', {
  15358. * 'omission': ' [...]'
  15359. * });
  15360. * // => 'hi-diddly-ho there, neig [...]'
  15361. */
  15362. function truncate(string, options) {
  15363. var length = DEFAULT_TRUNC_LENGTH,
  15364. omission = DEFAULT_TRUNC_OMISSION;
  15365. if (isObject(options)) {
  15366. var separator = 'separator' in options ? options.separator : separator;
  15367. length = 'length' in options ? toInteger(options.length) : length;
  15368. omission = 'omission' in options ? baseToString(options.omission) : omission;
  15369. }
  15370. string = toString(string);
  15371. var strLength = string.length;
  15372. if (hasUnicode(string)) {
  15373. var strSymbols = stringToArray(string);
  15374. strLength = strSymbols.length;
  15375. }
  15376. if (length >= strLength) {
  15377. return string;
  15378. }
  15379. var end = length - stringSize(omission);
  15380. if (end < 1) {
  15381. return omission;
  15382. }
  15383. var result = strSymbols
  15384. ? castSlice(strSymbols, 0, end).join('')
  15385. : string.slice(0, end);
  15386. if (separator === undefined) {
  15387. return result + omission;
  15388. }
  15389. if (strSymbols) {
  15390. end += (result.length - end);
  15391. }
  15392. if (isRegExp(separator)) {
  15393. if (string.slice(end).search(separator)) {
  15394. var match,
  15395. substring = result;
  15396. if (!separator.global) {
  15397. separator = RegExp(separator.source, toString(reFlags.exec(separator)) + 'g');
  15398. }
  15399. separator.lastIndex = 0;
  15400. while ((match = separator.exec(substring))) {
  15401. var newEnd = match.index;
  15402. }
  15403. result = result.slice(0, newEnd === undefined ? end : newEnd);
  15404. }
  15405. } else if (string.indexOf(baseToString(separator), end) != end) {
  15406. var index = result.lastIndexOf(separator);
  15407. if (index > -1) {
  15408. result = result.slice(0, index);
  15409. }
  15410. }
  15411. return result + omission;
  15412. }
  15413. /**
  15414. * The inverse of `_.escape`; this method converts the HTML entities
  15415. * `&amp;`, `&lt;`, `&gt;`, `&quot;`, and `&#39;` in `string` to
  15416. * their corresponding characters.
  15417. *
  15418. * **Note:** No other HTML entities are unescaped. To unescape additional
  15419. * HTML entities use a third-party library like [_he_](https://mths.be/he).
  15420. *
  15421. * @static
  15422. * @memberOf _
  15423. * @since 0.6.0
  15424. * @category String
  15425. * @param {string} [string=''] The string to unescape.
  15426. * @returns {string} Returns the unescaped string.
  15427. * @example
  15428. *
  15429. * _.unescape('fred, barney, &amp; pebbles');
  15430. * // => 'fred, barney, & pebbles'
  15431. */
  15432. function unescape(string) {
  15433. string = toString(string);
  15434. return (string && reHasEscapedHtml.test(string))
  15435. ? string.replace(reEscapedHtml, unescapeHtmlChar)
  15436. : string;
  15437. }
  15438. /**
  15439. * Converts `string`, as space separated words, to upper case.
  15440. *
  15441. * @static
  15442. * @memberOf _
  15443. * @since 4.0.0
  15444. * @category String
  15445. * @param {string} [string=''] The string to convert.
  15446. * @returns {string} Returns the upper cased string.
  15447. * @example
  15448. *
  15449. * _.upperCase('--foo-bar');
  15450. * // => 'FOO BAR'
  15451. *
  15452. * _.upperCase('fooBar');
  15453. * // => 'FOO BAR'
  15454. *
  15455. * _.upperCase('__foo_bar__');
  15456. * // => 'FOO BAR'
  15457. */
  15458. var upperCase = createCompounder(function(result, word, index) {
  15459. return result + (index ? ' ' : '') + word.toUpperCase();
  15460. });
  15461. /**
  15462. * Converts the first character of `string` to upper case.
  15463. *
  15464. * @static
  15465. * @memberOf _
  15466. * @since 4.0.0
  15467. * @category String
  15468. * @param {string} [string=''] The string to convert.
  15469. * @returns {string} Returns the converted string.
  15470. * @example
  15471. *
  15472. * _.upperFirst('fred');
  15473. * // => 'Fred'
  15474. *
  15475. * _.upperFirst('FRED');
  15476. * // => 'FRED'
  15477. */
  15478. var upperFirst = createCaseFirst('toUpperCase');
  15479. /**
  15480. * Splits `string` into an array of its words.
  15481. *
  15482. * @static
  15483. * @memberOf _
  15484. * @since 3.0.0
  15485. * @category String
  15486. * @param {string} [string=''] The string to inspect.
  15487. * @param {RegExp|string} [pattern] The pattern to match words.
  15488. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  15489. * @returns {Array} Returns the words of `string`.
  15490. * @example
  15491. *
  15492. * _.words('fred, barney, & pebbles');
  15493. * // => ['fred', 'barney', 'pebbles']
  15494. *
  15495. * _.words('fred, barney, & pebbles', /[^, ]+/g);
  15496. * // => ['fred', 'barney', '&', 'pebbles']
  15497. */
  15498. function words(string, pattern, guard) {
  15499. string = toString(string);
  15500. pattern = guard ? undefined : pattern;
  15501. if (pattern === undefined) {
  15502. return hasUnicodeWord(string) ? unicodeWords(string) : asciiWords(string);
  15503. }
  15504. return string.match(pattern) || [];
  15505. }
  15506. /*------------------------------------------------------------------------*/
  15507. /**
  15508. * Attempts to invoke `func`, returning either the result or the caught error
  15509. * object. Any additional arguments are provided to `func` when it's invoked.
  15510. *
  15511. * @static
  15512. * @memberOf _
  15513. * @since 3.0.0
  15514. * @category Util
  15515. * @param {Function} func The function to attempt.
  15516. * @param {...*} [args] The arguments to invoke `func` with.
  15517. * @returns {*} Returns the `func` result or error object.
  15518. * @example
  15519. *
  15520. * // Avoid throwing errors for invalid selectors.
  15521. * var elements = _.attempt(function(selector) {
  15522. * return document.querySelectorAll(selector);
  15523. * }, '>_>');
  15524. *
  15525. * if (_.isError(elements)) {
  15526. * elements = [];
  15527. * }
  15528. */
  15529. var attempt = baseRest(function(func, args) {
  15530. try {
  15531. return apply(func, undefined, args);
  15532. } catch (e) {
  15533. return isError(e) ? e : new Error(e);
  15534. }
  15535. });
  15536. /**
  15537. * Binds methods of an object to the object itself, overwriting the existing
  15538. * method.
  15539. *
  15540. * **Note:** This method doesn't set the "length" property of bound functions.
  15541. *
  15542. * @static
  15543. * @since 0.1.0
  15544. * @memberOf _
  15545. * @category Util
  15546. * @param {Object} object The object to bind and assign the bound methods to.
  15547. * @param {...(string|string[])} methodNames The object method names to bind.
  15548. * @returns {Object} Returns `object`.
  15549. * @example
  15550. *
  15551. * var view = {
  15552. * 'label': 'docs',
  15553. * 'click': function() {
  15554. * console.log('clicked ' + this.label);
  15555. * }
  15556. * };
  15557. *
  15558. * _.bindAll(view, ['click']);
  15559. * jQuery(element).on('click', view.click);
  15560. * // => Logs 'clicked docs' when clicked.
  15561. */
  15562. var bindAll = flatRest(function(object, methodNames) {
  15563. arrayEach(methodNames, function(key) {
  15564. key = toKey(key);
  15565. baseAssignValue(object, key, bind(object[key], object));
  15566. });
  15567. return object;
  15568. });
  15569. /**
  15570. * Creates a function that iterates over `pairs` and invokes the corresponding
  15571. * function of the first predicate to return truthy. The predicate-function
  15572. * pairs are invoked with the `this` binding and arguments of the created
  15573. * function.
  15574. *
  15575. * @static
  15576. * @memberOf _
  15577. * @since 4.0.0
  15578. * @category Util
  15579. * @param {Array} pairs The predicate-function pairs.
  15580. * @returns {Function} Returns the new composite function.
  15581. * @example
  15582. *
  15583. * var func = _.cond([
  15584. * [_.matches({ 'a': 1 }), _.constant('matches A')],
  15585. * [_.conforms({ 'b': _.isNumber }), _.constant('matches B')],
  15586. * [_.stubTrue, _.constant('no match')]
  15587. * ]);
  15588. *
  15589. * func({ 'a': 1, 'b': 2 });
  15590. * // => 'matches A'
  15591. *
  15592. * func({ 'a': 0, 'b': 1 });
  15593. * // => 'matches B'
  15594. *
  15595. * func({ 'a': '1', 'b': '2' });
  15596. * // => 'no match'
  15597. */
  15598. function cond(pairs) {
  15599. var length = pairs == null ? 0 : pairs.length,
  15600. toIteratee = getIteratee();
  15601. pairs = !length ? [] : arrayMap(pairs, function(pair) {
  15602. if (typeof pair[1] != 'function') {
  15603. throw new TypeError(FUNC_ERROR_TEXT);
  15604. }
  15605. return [toIteratee(pair[0]), pair[1]];
  15606. });
  15607. return baseRest(function(args) {
  15608. var index = -1;
  15609. while (++index < length) {
  15610. var pair = pairs[index];
  15611. if (apply(pair[0], this, args)) {
  15612. return apply(pair[1], this, args);
  15613. }
  15614. }
  15615. });
  15616. }
  15617. /**
  15618. * Creates a function that invokes the predicate properties of `source` with
  15619. * the corresponding property values of a given object, returning `true` if
  15620. * all predicates return truthy, else `false`.
  15621. *
  15622. * **Note:** The created function is equivalent to `_.conformsTo` with
  15623. * `source` partially applied.
  15624. *
  15625. * @static
  15626. * @memberOf _
  15627. * @since 4.0.0
  15628. * @category Util
  15629. * @param {Object} source The object of property predicates to conform to.
  15630. * @returns {Function} Returns the new spec function.
  15631. * @example
  15632. *
  15633. * var objects = [
  15634. * { 'a': 2, 'b': 1 },
  15635. * { 'a': 1, 'b': 2 }
  15636. * ];
  15637. *
  15638. * _.filter(objects, _.conforms({ 'b': function(n) { return n > 1; } }));
  15639. * // => [{ 'a': 1, 'b': 2 }]
  15640. */
  15641. function conforms(source) {
  15642. return baseConforms(baseClone(source, CLONE_DEEP_FLAG));
  15643. }
  15644. /**
  15645. * Creates a function that returns `value`.
  15646. *
  15647. * @static
  15648. * @memberOf _
  15649. * @since 2.4.0
  15650. * @category Util
  15651. * @param {*} value The value to return from the new function.
  15652. * @returns {Function} Returns the new constant function.
  15653. * @example
  15654. *
  15655. * var objects = _.times(2, _.constant({ 'a': 1 }));
  15656. *
  15657. * console.log(objects);
  15658. * // => [{ 'a': 1 }, { 'a': 1 }]
  15659. *
  15660. * console.log(objects[0] === objects[1]);
  15661. * // => true
  15662. */
  15663. function constant(value) {
  15664. return function() {
  15665. return value;
  15666. };
  15667. }
  15668. /**
  15669. * Checks `value` to determine whether a default value should be returned in
  15670. * its place. The `defaultValue` is returned if `value` is `NaN`, `null`,
  15671. * or `undefined`.
  15672. *
  15673. * @static
  15674. * @memberOf _
  15675. * @since 4.14.0
  15676. * @category Util
  15677. * @param {*} value The value to check.
  15678. * @param {*} defaultValue The default value.
  15679. * @returns {*} Returns the resolved value.
  15680. * @example
  15681. *
  15682. * _.defaultTo(1, 10);
  15683. * // => 1
  15684. *
  15685. * _.defaultTo(undefined, 10);
  15686. * // => 10
  15687. */
  15688. function defaultTo(value, defaultValue) {
  15689. return (value == null || value !== value) ? defaultValue : value;
  15690. }
  15691. /**
  15692. * Creates a function that returns the result of invoking the given functions
  15693. * with the `this` binding of the created function, where each successive
  15694. * invocation is supplied the return value of the previous.
  15695. *
  15696. * @static
  15697. * @memberOf _
  15698. * @since 3.0.0
  15699. * @category Util
  15700. * @param {...(Function|Function[])} [funcs] The functions to invoke.
  15701. * @returns {Function} Returns the new composite function.
  15702. * @see _.flowRight
  15703. * @example
  15704. *
  15705. * function square(n) {
  15706. * return n * n;
  15707. * }
  15708. *
  15709. * var addSquare = _.flow([_.add, square]);
  15710. * addSquare(1, 2);
  15711. * // => 9
  15712. */
  15713. var flow = createFlow();
  15714. /**
  15715. * This method is like `_.flow` except that it creates a function that
  15716. * invokes the given functions from right to left.
  15717. *
  15718. * @static
  15719. * @since 3.0.0
  15720. * @memberOf _
  15721. * @category Util
  15722. * @param {...(Function|Function[])} [funcs] The functions to invoke.
  15723. * @returns {Function} Returns the new composite function.
  15724. * @see _.flow
  15725. * @example
  15726. *
  15727. * function square(n) {
  15728. * return n * n;
  15729. * }
  15730. *
  15731. * var addSquare = _.flowRight([square, _.add]);
  15732. * addSquare(1, 2);
  15733. * // => 9
  15734. */
  15735. var flowRight = createFlow(true);
  15736. /**
  15737. * This method returns the first argument it receives.
  15738. *
  15739. * @static
  15740. * @since 0.1.0
  15741. * @memberOf _
  15742. * @category Util
  15743. * @param {*} value Any value.
  15744. * @returns {*} Returns `value`.
  15745. * @example
  15746. *
  15747. * var object = { 'a': 1 };
  15748. *
  15749. * console.log(_.identity(object) === object);
  15750. * // => true
  15751. */
  15752. function identity(value) {
  15753. return value;
  15754. }
  15755. /**
  15756. * Creates a function that invokes `func` with the arguments of the created
  15757. * function. If `func` is a property name, the created function returns the
  15758. * property value for a given element. If `func` is an array or object, the
  15759. * created function returns `true` for elements that contain the equivalent
  15760. * source properties, otherwise it returns `false`.
  15761. *
  15762. * @static
  15763. * @since 4.0.0
  15764. * @memberOf _
  15765. * @category Util
  15766. * @param {*} [func=_.identity] The value to convert to a callback.
  15767. * @returns {Function} Returns the callback.
  15768. * @example
  15769. *
  15770. * var users = [
  15771. * { 'user': 'barney', 'age': 36, 'active': true },
  15772. * { 'user': 'fred', 'age': 40, 'active': false }
  15773. * ];
  15774. *
  15775. * // The `_.matches` iteratee shorthand.
  15776. * _.filter(users, _.iteratee({ 'user': 'barney', 'active': true }));
  15777. * // => [{ 'user': 'barney', 'age': 36, 'active': true }]
  15778. *
  15779. * // The `_.matchesProperty` iteratee shorthand.
  15780. * _.filter(users, _.iteratee(['user', 'fred']));
  15781. * // => [{ 'user': 'fred', 'age': 40 }]
  15782. *
  15783. * // The `_.property` iteratee shorthand.
  15784. * _.map(users, _.iteratee('user'));
  15785. * // => ['barney', 'fred']
  15786. *
  15787. * // Create custom iteratee shorthands.
  15788. * _.iteratee = _.wrap(_.iteratee, function(iteratee, func) {
  15789. * return !_.isRegExp(func) ? iteratee(func) : function(string) {
  15790. * return func.test(string);
  15791. * };
  15792. * });
  15793. *
  15794. * _.filter(['abc', 'def'], /ef/);
  15795. * // => ['def']
  15796. */
  15797. function iteratee(func) {
  15798. return baseIteratee(typeof func == 'function' ? func : baseClone(func, CLONE_DEEP_FLAG));
  15799. }
  15800. /**
  15801. * Creates a function that performs a partial deep comparison between a given
  15802. * object and `source`, returning `true` if the given object has equivalent
  15803. * property values, else `false`.
  15804. *
  15805. * **Note:** The created function is equivalent to `_.isMatch` with `source`
  15806. * partially applied.
  15807. *
  15808. * Partial comparisons will match empty array and empty object `source`
  15809. * values against any array or object value, respectively. See `_.isEqual`
  15810. * for a list of supported value comparisons.
  15811. *
  15812. * **Note:** Multiple values can be checked by combining several matchers
  15813. * using `_.overSome`
  15814. *
  15815. * @static
  15816. * @memberOf _
  15817. * @since 3.0.0
  15818. * @category Util
  15819. * @param {Object} source The object of property values to match.
  15820. * @returns {Function} Returns the new spec function.
  15821. * @example
  15822. *
  15823. * var objects = [
  15824. * { 'a': 1, 'b': 2, 'c': 3 },
  15825. * { 'a': 4, 'b': 5, 'c': 6 }
  15826. * ];
  15827. *
  15828. * _.filter(objects, _.matches({ 'a': 4, 'c': 6 }));
  15829. * // => [{ 'a': 4, 'b': 5, 'c': 6 }]
  15830. *
  15831. * // Checking for several possible values
  15832. * _.filter(objects, _.overSome([_.matches({ 'a': 1 }), _.matches({ 'a': 4 })]));
  15833. * // => [{ 'a': 1, 'b': 2, 'c': 3 }, { 'a': 4, 'b': 5, 'c': 6 }]
  15834. */
  15835. function matches(source) {
  15836. return baseMatches(baseClone(source, CLONE_DEEP_FLAG));
  15837. }
  15838. /**
  15839. * Creates a function that performs a partial deep comparison between the
  15840. * value at `path` of a given object to `srcValue`, returning `true` if the
  15841. * object value is equivalent, else `false`.
  15842. *
  15843. * **Note:** Partial comparisons will match empty array and empty object
  15844. * `srcValue` values against any array or object value, respectively. See
  15845. * `_.isEqual` for a list of supported value comparisons.
  15846. *
  15847. * **Note:** Multiple values can be checked by combining several matchers
  15848. * using `_.overSome`
  15849. *
  15850. * @static
  15851. * @memberOf _
  15852. * @since 3.2.0
  15853. * @category Util
  15854. * @param {Array|string} path The path of the property to get.
  15855. * @param {*} srcValue The value to match.
  15856. * @returns {Function} Returns the new spec function.
  15857. * @example
  15858. *
  15859. * var objects = [
  15860. * { 'a': 1, 'b': 2, 'c': 3 },
  15861. * { 'a': 4, 'b': 5, 'c': 6 }
  15862. * ];
  15863. *
  15864. * _.find(objects, _.matchesProperty('a', 4));
  15865. * // => { 'a': 4, 'b': 5, 'c': 6 }
  15866. *
  15867. * // Checking for several possible values
  15868. * _.filter(objects, _.overSome([_.matchesProperty('a', 1), _.matchesProperty('a', 4)]));
  15869. * // => [{ 'a': 1, 'b': 2, 'c': 3 }, { 'a': 4, 'b': 5, 'c': 6 }]
  15870. */
  15871. function matchesProperty(path, srcValue) {
  15872. return baseMatchesProperty(path, baseClone(srcValue, CLONE_DEEP_FLAG));
  15873. }
  15874. /**
  15875. * Creates a function that invokes the method at `path` of a given object.
  15876. * Any additional arguments are provided to the invoked method.
  15877. *
  15878. * @static
  15879. * @memberOf _
  15880. * @since 3.7.0
  15881. * @category Util
  15882. * @param {Array|string} path The path of the method to invoke.
  15883. * @param {...*} [args] The arguments to invoke the method with.
  15884. * @returns {Function} Returns the new invoker function.
  15885. * @example
  15886. *
  15887. * var objects = [
  15888. * { 'a': { 'b': _.constant(2) } },
  15889. * { 'a': { 'b': _.constant(1) } }
  15890. * ];
  15891. *
  15892. * _.map(objects, _.method('a.b'));
  15893. * // => [2, 1]
  15894. *
  15895. * _.map(objects, _.method(['a', 'b']));
  15896. * // => [2, 1]
  15897. */
  15898. var method = baseRest(function(path, args) {
  15899. return function(object) {
  15900. return baseInvoke(object, path, args);
  15901. };
  15902. });
  15903. /**
  15904. * The opposite of `_.method`; this method creates a function that invokes
  15905. * the method at a given path of `object`. Any additional arguments are
  15906. * provided to the invoked method.
  15907. *
  15908. * @static
  15909. * @memberOf _
  15910. * @since 3.7.0
  15911. * @category Util
  15912. * @param {Object} object The object to query.
  15913. * @param {...*} [args] The arguments to invoke the method with.
  15914. * @returns {Function} Returns the new invoker function.
  15915. * @example
  15916. *
  15917. * var array = _.times(3, _.constant),
  15918. * object = { 'a': array, 'b': array, 'c': array };
  15919. *
  15920. * _.map(['a[2]', 'c[0]'], _.methodOf(object));
  15921. * // => [2, 0]
  15922. *
  15923. * _.map([['a', '2'], ['c', '0']], _.methodOf(object));
  15924. * // => [2, 0]
  15925. */
  15926. var methodOf = baseRest(function(object, args) {
  15927. return function(path) {
  15928. return baseInvoke(object, path, args);
  15929. };
  15930. });
  15931. /**
  15932. * Adds all own enumerable string keyed function properties of a source
  15933. * object to the destination object. If `object` is a function, then methods
  15934. * are added to its prototype as well.
  15935. *
  15936. * **Note:** Use `_.runInContext` to create a pristine `lodash` function to
  15937. * avoid conflicts caused by modifying the original.
  15938. *
  15939. * @static
  15940. * @since 0.1.0
  15941. * @memberOf _
  15942. * @category Util
  15943. * @param {Function|Object} [object=lodash] The destination object.
  15944. * @param {Object} source The object of functions to add.
  15945. * @param {Object} [options={}] The options object.
  15946. * @param {boolean} [options.chain=true] Specify whether mixins are chainable.
  15947. * @returns {Function|Object} Returns `object`.
  15948. * @example
  15949. *
  15950. * function vowels(string) {
  15951. * return _.filter(string, function(v) {
  15952. * return /[aeiou]/i.test(v);
  15953. * });
  15954. * }
  15955. *
  15956. * _.mixin({ 'vowels': vowels });
  15957. * _.vowels('fred');
  15958. * // => ['e']
  15959. *
  15960. * _('fred').vowels().value();
  15961. * // => ['e']
  15962. *
  15963. * _.mixin({ 'vowels': vowels }, { 'chain': false });
  15964. * _('fred').vowels();
  15965. * // => ['e']
  15966. */
  15967. function mixin(object, source, options) {
  15968. var props = keys(source),
  15969. methodNames = baseFunctions(source, props);
  15970. if (options == null &&
  15971. !(isObject(source) && (methodNames.length || !props.length))) {
  15972. options = source;
  15973. source = object;
  15974. object = this;
  15975. methodNames = baseFunctions(source, keys(source));
  15976. }
  15977. var chain = !(isObject(options) && 'chain' in options) || !!options.chain,
  15978. isFunc = isFunction(object);
  15979. arrayEach(methodNames, function(methodName) {
  15980. var func = source[methodName];
  15981. object[methodName] = func;
  15982. if (isFunc) {
  15983. object.prototype[methodName] = function() {
  15984. var chainAll = this.__chain__;
  15985. if (chain || chainAll) {
  15986. var result = object(this.__wrapped__),
  15987. actions = result.__actions__ = copyArray(this.__actions__);
  15988. actions.push({ 'func': func, 'args': arguments, 'thisArg': object });
  15989. result.__chain__ = chainAll;
  15990. return result;
  15991. }
  15992. return func.apply(object, arrayPush([this.value()], arguments));
  15993. };
  15994. }
  15995. });
  15996. return object;
  15997. }
  15998. /**
  15999. * Reverts the `_` variable to its previous value and returns a reference to
  16000. * the `lodash` function.
  16001. *
  16002. * @static
  16003. * @since 0.1.0
  16004. * @memberOf _
  16005. * @category Util
  16006. * @returns {Function} Returns the `lodash` function.
  16007. * @example
  16008. *
  16009. * var lodash = _.noConflict();
  16010. */
  16011. function noConflict() {
  16012. if (root._ === this) {
  16013. root._ = oldDash;
  16014. }
  16015. return this;
  16016. }
  16017. /**
  16018. * This method returns `undefined`.
  16019. *
  16020. * @static
  16021. * @memberOf _
  16022. * @since 2.3.0
  16023. * @category Util
  16024. * @example
  16025. *
  16026. * _.times(2, _.noop);
  16027. * // => [undefined, undefined]
  16028. */
  16029. function noop() {
  16030. // No operation performed.
  16031. }
  16032. /**
  16033. * Creates a function that gets the argument at index `n`. If `n` is negative,
  16034. * the nth argument from the end is returned.
  16035. *
  16036. * @static
  16037. * @memberOf _
  16038. * @since 4.0.0
  16039. * @category Util
  16040. * @param {number} [n=0] The index of the argument to return.
  16041. * @returns {Function} Returns the new pass-thru function.
  16042. * @example
  16043. *
  16044. * var func = _.nthArg(1);
  16045. * func('a', 'b', 'c', 'd');
  16046. * // => 'b'
  16047. *
  16048. * var func = _.nthArg(-2);
  16049. * func('a', 'b', 'c', 'd');
  16050. * // => 'c'
  16051. */
  16052. function nthArg(n) {
  16053. n = toInteger(n);
  16054. return baseRest(function(args) {
  16055. return baseNth(args, n);
  16056. });
  16057. }
  16058. /**
  16059. * Creates a function that invokes `iteratees` with the arguments it receives
  16060. * and returns their results.
  16061. *
  16062. * @static
  16063. * @memberOf _
  16064. * @since 4.0.0
  16065. * @category Util
  16066. * @param {...(Function|Function[])} [iteratees=[_.identity]]
  16067. * The iteratees to invoke.
  16068. * @returns {Function} Returns the new function.
  16069. * @example
  16070. *
  16071. * var func = _.over([Math.max, Math.min]);
  16072. *
  16073. * func(1, 2, 3, 4);
  16074. * // => [4, 1]
  16075. */
  16076. var over = createOver(arrayMap);
  16077. /**
  16078. * Creates a function that checks if **all** of the `predicates` return
  16079. * truthy when invoked with the arguments it receives.
  16080. *
  16081. * Following shorthands are possible for providing predicates.
  16082. * Pass an `Object` and it will be used as an parameter for `_.matches` to create the predicate.
  16083. * Pass an `Array` of parameters for `_.matchesProperty` and the predicate will be created using them.
  16084. *
  16085. * @static
  16086. * @memberOf _
  16087. * @since 4.0.0
  16088. * @category Util
  16089. * @param {...(Function|Function[])} [predicates=[_.identity]]
  16090. * The predicates to check.
  16091. * @returns {Function} Returns the new function.
  16092. * @example
  16093. *
  16094. * var func = _.overEvery([Boolean, isFinite]);
  16095. *
  16096. * func('1');
  16097. * // => true
  16098. *
  16099. * func(null);
  16100. * // => false
  16101. *
  16102. * func(NaN);
  16103. * // => false
  16104. */
  16105. var overEvery = createOver(arrayEvery);
  16106. /**
  16107. * Creates a function that checks if **any** of the `predicates` return
  16108. * truthy when invoked with the arguments it receives.
  16109. *
  16110. * Following shorthands are possible for providing predicates.
  16111. * Pass an `Object` and it will be used as an parameter for `_.matches` to create the predicate.
  16112. * Pass an `Array` of parameters for `_.matchesProperty` and the predicate will be created using them.
  16113. *
  16114. * @static
  16115. * @memberOf _
  16116. * @since 4.0.0
  16117. * @category Util
  16118. * @param {...(Function|Function[])} [predicates=[_.identity]]
  16119. * The predicates to check.
  16120. * @returns {Function} Returns the new function.
  16121. * @example
  16122. *
  16123. * var func = _.overSome([Boolean, isFinite]);
  16124. *
  16125. * func('1');
  16126. * // => true
  16127. *
  16128. * func(null);
  16129. * // => true
  16130. *
  16131. * func(NaN);
  16132. * // => false
  16133. *
  16134. * var matchesFunc = _.overSome([{ 'a': 1 }, { 'a': 2 }])
  16135. * var matchesPropertyFunc = _.overSome([['a', 1], ['a', 2]])
  16136. */
  16137. var overSome = createOver(arraySome);
  16138. /**
  16139. * Creates a function that returns the value at `path` of a given object.
  16140. *
  16141. * @static
  16142. * @memberOf _
  16143. * @since 2.4.0
  16144. * @category Util
  16145. * @param {Array|string} path The path of the property to get.
  16146. * @returns {Function} Returns the new accessor function.
  16147. * @example
  16148. *
  16149. * var objects = [
  16150. * { 'a': { 'b': 2 } },
  16151. * { 'a': { 'b': 1 } }
  16152. * ];
  16153. *
  16154. * _.map(objects, _.property('a.b'));
  16155. * // => [2, 1]
  16156. *
  16157. * _.map(_.sortBy(objects, _.property(['a', 'b'])), 'a.b');
  16158. * // => [1, 2]
  16159. */
  16160. function property(path) {
  16161. return isKey(path) ? baseProperty(toKey(path)) : basePropertyDeep(path);
  16162. }
  16163. /**
  16164. * The opposite of `_.property`; this method creates a function that returns
  16165. * the value at a given path of `object`.
  16166. *
  16167. * @static
  16168. * @memberOf _
  16169. * @since 3.0.0
  16170. * @category Util
  16171. * @param {Object} object The object to query.
  16172. * @returns {Function} Returns the new accessor function.
  16173. * @example
  16174. *
  16175. * var array = [0, 1, 2],
  16176. * object = { 'a': array, 'b': array, 'c': array };
  16177. *
  16178. * _.map(['a[2]', 'c[0]'], _.propertyOf(object));
  16179. * // => [2, 0]
  16180. *
  16181. * _.map([['a', '2'], ['c', '0']], _.propertyOf(object));
  16182. * // => [2, 0]
  16183. */
  16184. function propertyOf(object) {
  16185. return function(path) {
  16186. return object == null ? undefined : baseGet(object, path);
  16187. };
  16188. }
  16189. /**
  16190. * Creates an array of numbers (positive and/or negative) progressing from
  16191. * `start` up to, but not including, `end`. A step of `-1` is used if a negative
  16192. * `start` is specified without an `end` or `step`. If `end` is not specified,
  16193. * it's set to `start` with `start` then set to `0`.
  16194. *
  16195. * **Note:** JavaScript follows the IEEE-754 standard for resolving
  16196. * floating-point values which can produce unexpected results.
  16197. *
  16198. * @static
  16199. * @since 0.1.0
  16200. * @memberOf _
  16201. * @category Util
  16202. * @param {number} [start=0] The start of the range.
  16203. * @param {number} end The end of the range.
  16204. * @param {number} [step=1] The value to increment or decrement by.
  16205. * @returns {Array} Returns the range of numbers.
  16206. * @see _.inRange, _.rangeRight
  16207. * @example
  16208. *
  16209. * _.range(4);
  16210. * // => [0, 1, 2, 3]
  16211. *
  16212. * _.range(-4);
  16213. * // => [0, -1, -2, -3]
  16214. *
  16215. * _.range(1, 5);
  16216. * // => [1, 2, 3, 4]
  16217. *
  16218. * _.range(0, 20, 5);
  16219. * // => [0, 5, 10, 15]
  16220. *
  16221. * _.range(0, -4, -1);
  16222. * // => [0, -1, -2, -3]
  16223. *
  16224. * _.range(1, 4, 0);
  16225. * // => [1, 1, 1]
  16226. *
  16227. * _.range(0);
  16228. * // => []
  16229. */
  16230. var range = createRange();
  16231. /**
  16232. * This method is like `_.range` except that it populates values in
  16233. * descending order.
  16234. *
  16235. * @static
  16236. * @memberOf _
  16237. * @since 4.0.0
  16238. * @category Util
  16239. * @param {number} [start=0] The start of the range.
  16240. * @param {number} end The end of the range.
  16241. * @param {number} [step=1] The value to increment or decrement by.
  16242. * @returns {Array} Returns the range of numbers.
  16243. * @see _.inRange, _.range
  16244. * @example
  16245. *
  16246. * _.rangeRight(4);
  16247. * // => [3, 2, 1, 0]
  16248. *
  16249. * _.rangeRight(-4);
  16250. * // => [-3, -2, -1, 0]
  16251. *
  16252. * _.rangeRight(1, 5);
  16253. * // => [4, 3, 2, 1]
  16254. *
  16255. * _.rangeRight(0, 20, 5);
  16256. * // => [15, 10, 5, 0]
  16257. *
  16258. * _.rangeRight(0, -4, -1);
  16259. * // => [-3, -2, -1, 0]
  16260. *
  16261. * _.rangeRight(1, 4, 0);
  16262. * // => [1, 1, 1]
  16263. *
  16264. * _.rangeRight(0);
  16265. * // => []
  16266. */
  16267. var rangeRight = createRange(true);
  16268. /**
  16269. * This method returns a new empty array.
  16270. *
  16271. * @static
  16272. * @memberOf _
  16273. * @since 4.13.0
  16274. * @category Util
  16275. * @returns {Array} Returns the new empty array.
  16276. * @example
  16277. *
  16278. * var arrays = _.times(2, _.stubArray);
  16279. *
  16280. * console.log(arrays);
  16281. * // => [[], []]
  16282. *
  16283. * console.log(arrays[0] === arrays[1]);
  16284. * // => false
  16285. */
  16286. function stubArray() {
  16287. return [];
  16288. }
  16289. /**
  16290. * This method returns `false`.
  16291. *
  16292. * @static
  16293. * @memberOf _
  16294. * @since 4.13.0
  16295. * @category Util
  16296. * @returns {boolean} Returns `false`.
  16297. * @example
  16298. *
  16299. * _.times(2, _.stubFalse);
  16300. * // => [false, false]
  16301. */
  16302. function stubFalse() {
  16303. return false;
  16304. }
  16305. /**
  16306. * This method returns a new empty object.
  16307. *
  16308. * @static
  16309. * @memberOf _
  16310. * @since 4.13.0
  16311. * @category Util
  16312. * @returns {Object} Returns the new empty object.
  16313. * @example
  16314. *
  16315. * var objects = _.times(2, _.stubObject);
  16316. *
  16317. * console.log(objects);
  16318. * // => [{}, {}]
  16319. *
  16320. * console.log(objects[0] === objects[1]);
  16321. * // => false
  16322. */
  16323. function stubObject() {
  16324. return {};
  16325. }
  16326. /**
  16327. * This method returns an empty string.
  16328. *
  16329. * @static
  16330. * @memberOf _
  16331. * @since 4.13.0
  16332. * @category Util
  16333. * @returns {string} Returns the empty string.
  16334. * @example
  16335. *
  16336. * _.times(2, _.stubString);
  16337. * // => ['', '']
  16338. */
  16339. function stubString() {
  16340. return '';
  16341. }
  16342. /**
  16343. * This method returns `true`.
  16344. *
  16345. * @static
  16346. * @memberOf _
  16347. * @since 4.13.0
  16348. * @category Util
  16349. * @returns {boolean} Returns `true`.
  16350. * @example
  16351. *
  16352. * _.times(2, _.stubTrue);
  16353. * // => [true, true]
  16354. */
  16355. function stubTrue() {
  16356. return true;
  16357. }
  16358. /**
  16359. * Invokes the iteratee `n` times, returning an array of the results of
  16360. * each invocation. The iteratee is invoked with one argument; (index).
  16361. *
  16362. * @static
  16363. * @since 0.1.0
  16364. * @memberOf _
  16365. * @category Util
  16366. * @param {number} n The number of times to invoke `iteratee`.
  16367. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  16368. * @returns {Array} Returns the array of results.
  16369. * @example
  16370. *
  16371. * _.times(3, String);
  16372. * // => ['0', '1', '2']
  16373. *
  16374. * _.times(4, _.constant(0));
  16375. * // => [0, 0, 0, 0]
  16376. */
  16377. function times(n, iteratee) {
  16378. n = toInteger(n);
  16379. if (n < 1 || n > MAX_SAFE_INTEGER) {
  16380. return [];
  16381. }
  16382. var index = MAX_ARRAY_LENGTH,
  16383. length = nativeMin(n, MAX_ARRAY_LENGTH);
  16384. iteratee = getIteratee(iteratee);
  16385. n -= MAX_ARRAY_LENGTH;
  16386. var result = baseTimes(length, iteratee);
  16387. while (++index < n) {
  16388. iteratee(index);
  16389. }
  16390. return result;
  16391. }
  16392. /**
  16393. * Converts `value` to a property path array.
  16394. *
  16395. * @static
  16396. * @memberOf _
  16397. * @since 4.0.0
  16398. * @category Util
  16399. * @param {*} value The value to convert.
  16400. * @returns {Array} Returns the new property path array.
  16401. * @example
  16402. *
  16403. * _.toPath('a.b.c');
  16404. * // => ['a', 'b', 'c']
  16405. *
  16406. * _.toPath('a[0].b.c');
  16407. * // => ['a', '0', 'b', 'c']
  16408. */
  16409. function toPath(value) {
  16410. if (isArray(value)) {
  16411. return arrayMap(value, toKey);
  16412. }
  16413. return isSymbol(value) ? [value] : copyArray(stringToPath(toString(value)));
  16414. }
  16415. /**
  16416. * Generates a unique ID. If `prefix` is given, the ID is appended to it.
  16417. *
  16418. * @static
  16419. * @since 0.1.0
  16420. * @memberOf _
  16421. * @category Util
  16422. * @param {string} [prefix=''] The value to prefix the ID with.
  16423. * @returns {string} Returns the unique ID.
  16424. * @example
  16425. *
  16426. * _.uniqueId('contact_');
  16427. * // => 'contact_104'
  16428. *
  16429. * _.uniqueId();
  16430. * // => '105'
  16431. */
  16432. function uniqueId(prefix) {
  16433. var id = ++idCounter;
  16434. return toString(prefix) + id;
  16435. }
  16436. /*------------------------------------------------------------------------*/
  16437. /**
  16438. * Adds two numbers.
  16439. *
  16440. * @static
  16441. * @memberOf _
  16442. * @since 3.4.0
  16443. * @category Math
  16444. * @param {number} augend The first number in an addition.
  16445. * @param {number} addend The second number in an addition.
  16446. * @returns {number} Returns the total.
  16447. * @example
  16448. *
  16449. * _.add(6, 4);
  16450. * // => 10
  16451. */
  16452. var add = createMathOperation(function(augend, addend) {
  16453. return augend + addend;
  16454. }, 0);
  16455. /**
  16456. * Computes `number` rounded up to `precision`.
  16457. *
  16458. * @static
  16459. * @memberOf _
  16460. * @since 3.10.0
  16461. * @category Math
  16462. * @param {number} number The number to round up.
  16463. * @param {number} [precision=0] The precision to round up to.
  16464. * @returns {number} Returns the rounded up number.
  16465. * @example
  16466. *
  16467. * _.ceil(4.006);
  16468. * // => 5
  16469. *
  16470. * _.ceil(6.004, 2);
  16471. * // => 6.01
  16472. *
  16473. * _.ceil(6040, -2);
  16474. * // => 6100
  16475. */
  16476. var ceil = createRound('ceil');
  16477. /**
  16478. * Divide two numbers.
  16479. *
  16480. * @static
  16481. * @memberOf _
  16482. * @since 4.7.0
  16483. * @category Math
  16484. * @param {number} dividend The first number in a division.
  16485. * @param {number} divisor The second number in a division.
  16486. * @returns {number} Returns the quotient.
  16487. * @example
  16488. *
  16489. * _.divide(6, 4);
  16490. * // => 1.5
  16491. */
  16492. var divide = createMathOperation(function(dividend, divisor) {
  16493. return dividend / divisor;
  16494. }, 1);
  16495. /**
  16496. * Computes `number` rounded down to `precision`.
  16497. *
  16498. * @static
  16499. * @memberOf _
  16500. * @since 3.10.0
  16501. * @category Math
  16502. * @param {number} number The number to round down.
  16503. * @param {number} [precision=0] The precision to round down to.
  16504. * @returns {number} Returns the rounded down number.
  16505. * @example
  16506. *
  16507. * _.floor(4.006);
  16508. * // => 4
  16509. *
  16510. * _.floor(0.046, 2);
  16511. * // => 0.04
  16512. *
  16513. * _.floor(4060, -2);
  16514. * // => 4000
  16515. */
  16516. var floor = createRound('floor');
  16517. /**
  16518. * Computes the maximum value of `array`. If `array` is empty or falsey,
  16519. * `undefined` is returned.
  16520. *
  16521. * @static
  16522. * @since 0.1.0
  16523. * @memberOf _
  16524. * @category Math
  16525. * @param {Array} array The array to iterate over.
  16526. * @returns {*} Returns the maximum value.
  16527. * @example
  16528. *
  16529. * _.max([4, 2, 8, 6]);
  16530. * // => 8
  16531. *
  16532. * _.max([]);
  16533. * // => undefined
  16534. */
  16535. function max(array) {
  16536. return (array && array.length)
  16537. ? baseExtremum(array, identity, baseGt)
  16538. : undefined;
  16539. }
  16540. /**
  16541. * This method is like `_.max` except that it accepts `iteratee` which is
  16542. * invoked for each element in `array` to generate the criterion by which
  16543. * the value is ranked. The iteratee is invoked with one argument: (value).
  16544. *
  16545. * @static
  16546. * @memberOf _
  16547. * @since 4.0.0
  16548. * @category Math
  16549. * @param {Array} array The array to iterate over.
  16550. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  16551. * @returns {*} Returns the maximum value.
  16552. * @example
  16553. *
  16554. * var objects = [{ 'n': 1 }, { 'n': 2 }];
  16555. *
  16556. * _.maxBy(objects, function(o) { return o.n; });
  16557. * // => { 'n': 2 }
  16558. *
  16559. * // The `_.property` iteratee shorthand.
  16560. * _.maxBy(objects, 'n');
  16561. * // => { 'n': 2 }
  16562. */
  16563. function maxBy(array, iteratee) {
  16564. return (array && array.length)
  16565. ? baseExtremum(array, getIteratee(iteratee, 2), baseGt)
  16566. : undefined;
  16567. }
  16568. /**
  16569. * Computes the mean of the values in `array`.
  16570. *
  16571. * @static
  16572. * @memberOf _
  16573. * @since 4.0.0
  16574. * @category Math
  16575. * @param {Array} array The array to iterate over.
  16576. * @returns {number} Returns the mean.
  16577. * @example
  16578. *
  16579. * _.mean([4, 2, 8, 6]);
  16580. * // => 5
  16581. */
  16582. function mean(array) {
  16583. return baseMean(array, identity);
  16584. }
  16585. /**
  16586. * This method is like `_.mean` except that it accepts `iteratee` which is
  16587. * invoked for each element in `array` to generate the value to be averaged.
  16588. * The iteratee is invoked with one argument: (value).
  16589. *
  16590. * @static
  16591. * @memberOf _
  16592. * @since 4.7.0
  16593. * @category Math
  16594. * @param {Array} array The array to iterate over.
  16595. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  16596. * @returns {number} Returns the mean.
  16597. * @example
  16598. *
  16599. * var objects = [{ 'n': 4 }, { 'n': 2 }, { 'n': 8 }, { 'n': 6 }];
  16600. *
  16601. * _.meanBy(objects, function(o) { return o.n; });
  16602. * // => 5
  16603. *
  16604. * // The `_.property` iteratee shorthand.
  16605. * _.meanBy(objects, 'n');
  16606. * // => 5
  16607. */
  16608. function meanBy(array, iteratee) {
  16609. return baseMean(array, getIteratee(iteratee, 2));
  16610. }
  16611. /**
  16612. * Computes the minimum value of `array`. If `array` is empty or falsey,
  16613. * `undefined` is returned.
  16614. *
  16615. * @static
  16616. * @since 0.1.0
  16617. * @memberOf _
  16618. * @category Math
  16619. * @param {Array} array The array to iterate over.
  16620. * @returns {*} Returns the minimum value.
  16621. * @example
  16622. *
  16623. * _.min([4, 2, 8, 6]);
  16624. * // => 2
  16625. *
  16626. * _.min([]);
  16627. * // => undefined
  16628. */
  16629. function min(array) {
  16630. return (array && array.length)
  16631. ? baseExtremum(array, identity, baseLt)
  16632. : undefined;
  16633. }
  16634. /**
  16635. * This method is like `_.min` except that it accepts `iteratee` which is
  16636. * invoked for each element in `array` to generate the criterion by which
  16637. * the value is ranked. The iteratee is invoked with one argument: (value).
  16638. *
  16639. * @static
  16640. * @memberOf _
  16641. * @since 4.0.0
  16642. * @category Math
  16643. * @param {Array} array The array to iterate over.
  16644. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  16645. * @returns {*} Returns the minimum value.
  16646. * @example
  16647. *
  16648. * var objects = [{ 'n': 1 }, { 'n': 2 }];
  16649. *
  16650. * _.minBy(objects, function(o) { return o.n; });
  16651. * // => { 'n': 1 }
  16652. *
  16653. * // The `_.property` iteratee shorthand.
  16654. * _.minBy(objects, 'n');
  16655. * // => { 'n': 1 }
  16656. */
  16657. function minBy(array, iteratee) {
  16658. return (array && array.length)
  16659. ? baseExtremum(array, getIteratee(iteratee, 2), baseLt)
  16660. : undefined;
  16661. }
  16662. /**
  16663. * Multiply two numbers.
  16664. *
  16665. * @static
  16666. * @memberOf _
  16667. * @since 4.7.0
  16668. * @category Math
  16669. * @param {number} multiplier The first number in a multiplication.
  16670. * @param {number} multiplicand The second number in a multiplication.
  16671. * @returns {number} Returns the product.
  16672. * @example
  16673. *
  16674. * _.multiply(6, 4);
  16675. * // => 24
  16676. */
  16677. var multiply = createMathOperation(function(multiplier, multiplicand) {
  16678. return multiplier * multiplicand;
  16679. }, 1);
  16680. /**
  16681. * Computes `number` rounded to `precision`.
  16682. *
  16683. * @static
  16684. * @memberOf _
  16685. * @since 3.10.0
  16686. * @category Math
  16687. * @param {number} number The number to round.
  16688. * @param {number} [precision=0] The precision to round to.
  16689. * @returns {number} Returns the rounded number.
  16690. * @example
  16691. *
  16692. * _.round(4.006);
  16693. * // => 4
  16694. *
  16695. * _.round(4.006, 2);
  16696. * // => 4.01
  16697. *
  16698. * _.round(4060, -2);
  16699. * // => 4100
  16700. */
  16701. var round = createRound('round');
  16702. /**
  16703. * Subtract two numbers.
  16704. *
  16705. * @static
  16706. * @memberOf _
  16707. * @since 4.0.0
  16708. * @category Math
  16709. * @param {number} minuend The first number in a subtraction.
  16710. * @param {number} subtrahend The second number in a subtraction.
  16711. * @returns {number} Returns the difference.
  16712. * @example
  16713. *
  16714. * _.subtract(6, 4);
  16715. * // => 2
  16716. */
  16717. var subtract = createMathOperation(function(minuend, subtrahend) {
  16718. return minuend - subtrahend;
  16719. }, 0);
  16720. /**
  16721. * Computes the sum of the values in `array`.
  16722. *
  16723. * @static
  16724. * @memberOf _
  16725. * @since 3.4.0
  16726. * @category Math
  16727. * @param {Array} array The array to iterate over.
  16728. * @returns {number} Returns the sum.
  16729. * @example
  16730. *
  16731. * _.sum([4, 2, 8, 6]);
  16732. * // => 20
  16733. */
  16734. function sum(array) {
  16735. return (array && array.length)
  16736. ? baseSum(array, identity)
  16737. : 0;
  16738. }
  16739. /**
  16740. * This method is like `_.sum` except that it accepts `iteratee` which is
  16741. * invoked for each element in `array` to generate the value to be summed.
  16742. * The iteratee is invoked with one argument: (value).
  16743. *
  16744. * @static
  16745. * @memberOf _
  16746. * @since 4.0.0
  16747. * @category Math
  16748. * @param {Array} array The array to iterate over.
  16749. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  16750. * @returns {number} Returns the sum.
  16751. * @example
  16752. *
  16753. * var objects = [{ 'n': 4 }, { 'n': 2 }, { 'n': 8 }, { 'n': 6 }];
  16754. *
  16755. * _.sumBy(objects, function(o) { return o.n; });
  16756. * // => 20
  16757. *
  16758. * // The `_.property` iteratee shorthand.
  16759. * _.sumBy(objects, 'n');
  16760. * // => 20
  16761. */
  16762. function sumBy(array, iteratee) {
  16763. return (array && array.length)
  16764. ? baseSum(array, getIteratee(iteratee, 2))
  16765. : 0;
  16766. }
  16767. /*------------------------------------------------------------------------*/
  16768. // Add methods that return wrapped values in chain sequences.
  16769. lodash.after = after;
  16770. lodash.ary = ary;
  16771. lodash.assign = assign;
  16772. lodash.assignIn = assignIn;
  16773. lodash.assignInWith = assignInWith;
  16774. lodash.assignWith = assignWith;
  16775. lodash.at = at;
  16776. lodash.before = before;
  16777. lodash.bind = bind;
  16778. lodash.bindAll = bindAll;
  16779. lodash.bindKey = bindKey;
  16780. lodash.castArray = castArray;
  16781. lodash.chain = chain;
  16782. lodash.chunk = chunk;
  16783. lodash.compact = compact;
  16784. lodash.concat = concat;
  16785. lodash.cond = cond;
  16786. lodash.conforms = conforms;
  16787. lodash.constant = constant;
  16788. lodash.countBy = countBy;
  16789. lodash.create = create;
  16790. lodash.curry = curry;
  16791. lodash.curryRight = curryRight;
  16792. lodash.debounce = debounce;
  16793. lodash.defaults = defaults;
  16794. lodash.defaultsDeep = defaultsDeep;
  16795. lodash.defer = defer;
  16796. lodash.delay = delay;
  16797. lodash.difference = difference;
  16798. lodash.differenceBy = differenceBy;
  16799. lodash.differenceWith = differenceWith;
  16800. lodash.drop = drop;
  16801. lodash.dropRight = dropRight;
  16802. lodash.dropRightWhile = dropRightWhile;
  16803. lodash.dropWhile = dropWhile;
  16804. lodash.fill = fill;
  16805. lodash.filter = filter;
  16806. lodash.flatMap = flatMap;
  16807. lodash.flatMapDeep = flatMapDeep;
  16808. lodash.flatMapDepth = flatMapDepth;
  16809. lodash.flatten = flatten;
  16810. lodash.flattenDeep = flattenDeep;
  16811. lodash.flattenDepth = flattenDepth;
  16812. lodash.flip = flip;
  16813. lodash.flow = flow;
  16814. lodash.flowRight = flowRight;
  16815. lodash.fromPairs = fromPairs;
  16816. lodash.functions = functions;
  16817. lodash.functionsIn = functionsIn;
  16818. lodash.groupBy = groupBy;
  16819. lodash.initial = initial;
  16820. lodash.intersection = intersection;
  16821. lodash.intersectionBy = intersectionBy;
  16822. lodash.intersectionWith = intersectionWith;
  16823. lodash.invert = invert;
  16824. lodash.invertBy = invertBy;
  16825. lodash.invokeMap = invokeMap;
  16826. lodash.iteratee = iteratee;
  16827. lodash.keyBy = keyBy;
  16828. lodash.keys = keys;
  16829. lodash.keysIn = keysIn;
  16830. lodash.map = map;
  16831. lodash.mapKeys = mapKeys;
  16832. lodash.mapValues = mapValues;
  16833. lodash.matches = matches;
  16834. lodash.matchesProperty = matchesProperty;
  16835. lodash.memoize = memoize;
  16836. lodash.merge = merge;
  16837. lodash.mergeWith = mergeWith;
  16838. lodash.method = method;
  16839. lodash.methodOf = methodOf;
  16840. lodash.mixin = mixin;
  16841. lodash.negate = negate;
  16842. lodash.nthArg = nthArg;
  16843. lodash.omit = omit;
  16844. lodash.omitBy = omitBy;
  16845. lodash.once = once;
  16846. lodash.orderBy = orderBy;
  16847. lodash.over = over;
  16848. lodash.overArgs = overArgs;
  16849. lodash.overEvery = overEvery;
  16850. lodash.overSome = overSome;
  16851. lodash.partial = partial;
  16852. lodash.partialRight = partialRight;
  16853. lodash.partition = partition;
  16854. lodash.pick = pick;
  16855. lodash.pickBy = pickBy;
  16856. lodash.property = property;
  16857. lodash.propertyOf = propertyOf;
  16858. lodash.pull = pull;
  16859. lodash.pullAll = pullAll;
  16860. lodash.pullAllBy = pullAllBy;
  16861. lodash.pullAllWith = pullAllWith;
  16862. lodash.pullAt = pullAt;
  16863. lodash.range = range;
  16864. lodash.rangeRight = rangeRight;
  16865. lodash.rearg = rearg;
  16866. lodash.reject = reject;
  16867. lodash.remove = remove;
  16868. lodash.rest = rest;
  16869. lodash.reverse = reverse;
  16870. lodash.sampleSize = sampleSize;
  16871. lodash.set = set;
  16872. lodash.setWith = setWith;
  16873. lodash.shuffle = shuffle;
  16874. lodash.slice = slice;
  16875. lodash.sortBy = sortBy;
  16876. lodash.sortedUniq = sortedUniq;
  16877. lodash.sortedUniqBy = sortedUniqBy;
  16878. lodash.split = split;
  16879. lodash.spread = spread;
  16880. lodash.tail = tail;
  16881. lodash.take = take;
  16882. lodash.takeRight = takeRight;
  16883. lodash.takeRightWhile = takeRightWhile;
  16884. lodash.takeWhile = takeWhile;
  16885. lodash.tap = tap;
  16886. lodash.throttle = throttle;
  16887. lodash.thru = thru;
  16888. lodash.toArray = toArray;
  16889. lodash.toPairs = toPairs;
  16890. lodash.toPairsIn = toPairsIn;
  16891. lodash.toPath = toPath;
  16892. lodash.toPlainObject = toPlainObject;
  16893. lodash.transform = transform;
  16894. lodash.unary = unary;
  16895. lodash.union = union;
  16896. lodash.unionBy = unionBy;
  16897. lodash.unionWith = unionWith;
  16898. lodash.uniq = uniq;
  16899. lodash.uniqBy = uniqBy;
  16900. lodash.uniqWith = uniqWith;
  16901. lodash.unset = unset;
  16902. lodash.unzip = unzip;
  16903. lodash.unzipWith = unzipWith;
  16904. lodash.update = update;
  16905. lodash.updateWith = updateWith;
  16906. lodash.values = values;
  16907. lodash.valuesIn = valuesIn;
  16908. lodash.without = without;
  16909. lodash.words = words;
  16910. lodash.wrap = wrap;
  16911. lodash.xor = xor;
  16912. lodash.xorBy = xorBy;
  16913. lodash.xorWith = xorWith;
  16914. lodash.zip = zip;
  16915. lodash.zipObject = zipObject;
  16916. lodash.zipObjectDeep = zipObjectDeep;
  16917. lodash.zipWith = zipWith;
  16918. // Add aliases.
  16919. lodash.entries = toPairs;
  16920. lodash.entriesIn = toPairsIn;
  16921. lodash.extend = assignIn;
  16922. lodash.extendWith = assignInWith;
  16923. // Add methods to `lodash.prototype`.
  16924. mixin(lodash, lodash);
  16925. /*------------------------------------------------------------------------*/
  16926. // Add methods that return unwrapped values in chain sequences.
  16927. lodash.add = add;
  16928. lodash.attempt = attempt;
  16929. lodash.camelCase = camelCase;
  16930. lodash.capitalize = capitalize;
  16931. lodash.ceil = ceil;
  16932. lodash.clamp = clamp;
  16933. lodash.clone = clone;
  16934. lodash.cloneDeep = cloneDeep;
  16935. lodash.cloneDeepWith = cloneDeepWith;
  16936. lodash.cloneWith = cloneWith;
  16937. lodash.conformsTo = conformsTo;
  16938. lodash.deburr = deburr;
  16939. lodash.defaultTo = defaultTo;
  16940. lodash.divide = divide;
  16941. lodash.endsWith = endsWith;
  16942. lodash.eq = eq;
  16943. lodash.escape = escape;
  16944. lodash.escapeRegExp = escapeRegExp;
  16945. lodash.every = every;
  16946. lodash.find = find;
  16947. lodash.findIndex = findIndex;
  16948. lodash.findKey = findKey;
  16949. lodash.findLast = findLast;
  16950. lodash.findLastIndex = findLastIndex;
  16951. lodash.findLastKey = findLastKey;
  16952. lodash.floor = floor;
  16953. lodash.forEach = forEach;
  16954. lodash.forEachRight = forEachRight;
  16955. lodash.forIn = forIn;
  16956. lodash.forInRight = forInRight;
  16957. lodash.forOwn = forOwn;
  16958. lodash.forOwnRight = forOwnRight;
  16959. lodash.get = get;
  16960. lodash.gt = gt;
  16961. lodash.gte = gte;
  16962. lodash.has = has;
  16963. lodash.hasIn = hasIn;
  16964. lodash.head = head;
  16965. lodash.identity = identity;
  16966. lodash.includes = includes;
  16967. lodash.indexOf = indexOf;
  16968. lodash.inRange = inRange;
  16969. lodash.invoke = invoke;
  16970. lodash.isArguments = isArguments;
  16971. lodash.isArray = isArray;
  16972. lodash.isArrayBuffer = isArrayBuffer;
  16973. lodash.isArrayLike = isArrayLike;
  16974. lodash.isArrayLikeObject = isArrayLikeObject;
  16975. lodash.isBoolean = isBoolean;
  16976. lodash.isBuffer = isBuffer;
  16977. lodash.isDate = isDate;
  16978. lodash.isElement = isElement;
  16979. lodash.isEmpty = isEmpty;
  16980. lodash.isEqual = isEqual;
  16981. lodash.isEqualWith = isEqualWith;
  16982. lodash.isError = isError;
  16983. lodash.isFinite = isFinite;
  16984. lodash.isFunction = isFunction;
  16985. lodash.isInteger = isInteger;
  16986. lodash.isLength = isLength;
  16987. lodash.isMap = isMap;
  16988. lodash.isMatch = isMatch;
  16989. lodash.isMatchWith = isMatchWith;
  16990. lodash.isNaN = isNaN;
  16991. lodash.isNative = isNative;
  16992. lodash.isNil = isNil;
  16993. lodash.isNull = isNull;
  16994. lodash.isNumber = isNumber;
  16995. lodash.isObject = isObject;
  16996. lodash.isObjectLike = isObjectLike;
  16997. lodash.isPlainObject = isPlainObject;
  16998. lodash.isRegExp = isRegExp;
  16999. lodash.isSafeInteger = isSafeInteger;
  17000. lodash.isSet = isSet;
  17001. lodash.isString = isString;
  17002. lodash.isSymbol = isSymbol;
  17003. lodash.isTypedArray = isTypedArray;
  17004. lodash.isUndefined = isUndefined;
  17005. lodash.isWeakMap = isWeakMap;
  17006. lodash.isWeakSet = isWeakSet;
  17007. lodash.join = join;
  17008. lodash.kebabCase = kebabCase;
  17009. lodash.last = last;
  17010. lodash.lastIndexOf = lastIndexOf;
  17011. lodash.lowerCase = lowerCase;
  17012. lodash.lowerFirst = lowerFirst;
  17013. lodash.lt = lt;
  17014. lodash.lte = lte;
  17015. lodash.max = max;
  17016. lodash.maxBy = maxBy;
  17017. lodash.mean = mean;
  17018. lodash.meanBy = meanBy;
  17019. lodash.min = min;
  17020. lodash.minBy = minBy;
  17021. lodash.stubArray = stubArray;
  17022. lodash.stubFalse = stubFalse;
  17023. lodash.stubObject = stubObject;
  17024. lodash.stubString = stubString;
  17025. lodash.stubTrue = stubTrue;
  17026. lodash.multiply = multiply;
  17027. lodash.nth = nth;
  17028. lodash.noConflict = noConflict;
  17029. lodash.noop = noop;
  17030. lodash.now = now;
  17031. lodash.pad = pad;
  17032. lodash.padEnd = padEnd;
  17033. lodash.padStart = padStart;
  17034. lodash.parseInt = parseInt;
  17035. lodash.random = random;
  17036. lodash.reduce = reduce;
  17037. lodash.reduceRight = reduceRight;
  17038. lodash.repeat = repeat;
  17039. lodash.replace = replace;
  17040. lodash.result = result;
  17041. lodash.round = round;
  17042. lodash.runInContext = runInContext;
  17043. lodash.sample = sample;
  17044. lodash.size = size;
  17045. lodash.snakeCase = snakeCase;
  17046. lodash.some = some;
  17047. lodash.sortedIndex = sortedIndex;
  17048. lodash.sortedIndexBy = sortedIndexBy;
  17049. lodash.sortedIndexOf = sortedIndexOf;
  17050. lodash.sortedLastIndex = sortedLastIndex;
  17051. lodash.sortedLastIndexBy = sortedLastIndexBy;
  17052. lodash.sortedLastIndexOf = sortedLastIndexOf;
  17053. lodash.startCase = startCase;
  17054. lodash.startsWith = startsWith;
  17055. lodash.subtract = subtract;
  17056. lodash.sum = sum;
  17057. lodash.sumBy = sumBy;
  17058. lodash.template = template;
  17059. lodash.times = times;
  17060. lodash.toFinite = toFinite;
  17061. lodash.toInteger = toInteger;
  17062. lodash.toLength = toLength;
  17063. lodash.toLower = toLower;
  17064. lodash.toNumber = toNumber;
  17065. lodash.toSafeInteger = toSafeInteger;
  17066. lodash.toString = toString;
  17067. lodash.toUpper = toUpper;
  17068. lodash.trim = trim;
  17069. lodash.trimEnd = trimEnd;
  17070. lodash.trimStart = trimStart;
  17071. lodash.truncate = truncate;
  17072. lodash.unescape = unescape;
  17073. lodash.uniqueId = uniqueId;
  17074. lodash.upperCase = upperCase;
  17075. lodash.upperFirst = upperFirst;
  17076. // Add aliases.
  17077. lodash.each = forEach;
  17078. lodash.eachRight = forEachRight;
  17079. lodash.first = head;
  17080. mixin(lodash, (function() {
  17081. var source = {};
  17082. baseForOwn(lodash, function(func, methodName) {
  17083. if (!hasOwnProperty.call(lodash.prototype, methodName)) {
  17084. source[methodName] = func;
  17085. }
  17086. });
  17087. return source;
  17088. }()), { 'chain': false });
  17089. /*------------------------------------------------------------------------*/
  17090. /**
  17091. * The semantic version number.
  17092. *
  17093. * @static
  17094. * @memberOf _
  17095. * @type {string}
  17096. */
  17097. lodash.VERSION = VERSION;
  17098. // Assign default placeholders.
  17099. arrayEach(['bind', 'bindKey', 'curry', 'curryRight', 'partial', 'partialRight'], function(methodName) {
  17100. lodash[methodName].placeholder = lodash;
  17101. });
  17102. // Add `LazyWrapper` methods for `_.drop` and `_.take` variants.
  17103. arrayEach(['drop', 'take'], function(methodName, index) {
  17104. LazyWrapper.prototype[methodName] = function(n) {
  17105. n = n === undefined ? 1 : nativeMax(toInteger(n), 0);
  17106. var result = (this.__filtered__ && !index)
  17107. ? new LazyWrapper(this)
  17108. : this.clone();
  17109. if (result.__filtered__) {
  17110. result.__takeCount__ = nativeMin(n, result.__takeCount__);
  17111. } else {
  17112. result.__views__.push({
  17113. 'size': nativeMin(n, MAX_ARRAY_LENGTH),
  17114. 'type': methodName + (result.__dir__ < 0 ? 'Right' : '')
  17115. });
  17116. }
  17117. return result;
  17118. };
  17119. LazyWrapper.prototype[methodName + 'Right'] = function(n) {
  17120. return this.reverse()[methodName](n).reverse();
  17121. };
  17122. });
  17123. // Add `LazyWrapper` methods that accept an `iteratee` value.
  17124. arrayEach(['filter', 'map', 'takeWhile'], function(methodName, index) {
  17125. var type = index + 1,
  17126. isFilter = type == LAZY_FILTER_FLAG || type == LAZY_WHILE_FLAG;
  17127. LazyWrapper.prototype[methodName] = function(iteratee) {
  17128. var result = this.clone();
  17129. result.__iteratees__.push({
  17130. 'iteratee': getIteratee(iteratee, 3),
  17131. 'type': type
  17132. });
  17133. result.__filtered__ = result.__filtered__ || isFilter;
  17134. return result;
  17135. };
  17136. });
  17137. // Add `LazyWrapper` methods for `_.head` and `_.last`.
  17138. arrayEach(['head', 'last'], function(methodName, index) {
  17139. var takeName = 'take' + (index ? 'Right' : '');
  17140. LazyWrapper.prototype[methodName] = function() {
  17141. return this[takeName](1).value()[0];
  17142. };
  17143. });
  17144. // Add `LazyWrapper` methods for `_.initial` and `_.tail`.
  17145. arrayEach(['initial', 'tail'], function(methodName, index) {
  17146. var dropName = 'drop' + (index ? '' : 'Right');
  17147. LazyWrapper.prototype[methodName] = function() {
  17148. return this.__filtered__ ? new LazyWrapper(this) : this[dropName](1);
  17149. };
  17150. });
  17151. LazyWrapper.prototype.compact = function() {
  17152. return this.filter(identity);
  17153. };
  17154. LazyWrapper.prototype.find = function(predicate) {
  17155. return this.filter(predicate).head();
  17156. };
  17157. LazyWrapper.prototype.findLast = function(predicate) {
  17158. return this.reverse().find(predicate);
  17159. };
  17160. LazyWrapper.prototype.invokeMap = baseRest(function(path, args) {
  17161. if (typeof path == 'function') {
  17162. return new LazyWrapper(this);
  17163. }
  17164. return this.map(function(value) {
  17165. return baseInvoke(value, path, args);
  17166. });
  17167. });
  17168. LazyWrapper.prototype.reject = function(predicate) {
  17169. return this.filter(negate(getIteratee(predicate)));
  17170. };
  17171. LazyWrapper.prototype.slice = function(start, end) {
  17172. start = toInteger(start);
  17173. var result = this;
  17174. if (result.__filtered__ && (start > 0 || end < 0)) {
  17175. return new LazyWrapper(result);
  17176. }
  17177. if (start < 0) {
  17178. result = result.takeRight(-start);
  17179. } else if (start) {
  17180. result = result.drop(start);
  17181. }
  17182. if (end !== undefined) {
  17183. end = toInteger(end);
  17184. result = end < 0 ? result.dropRight(-end) : result.take(end - start);
  17185. }
  17186. return result;
  17187. };
  17188. LazyWrapper.prototype.takeRightWhile = function(predicate) {
  17189. return this.reverse().takeWhile(predicate).reverse();
  17190. };
  17191. LazyWrapper.prototype.toArray = function() {
  17192. return this.take(MAX_ARRAY_LENGTH);
  17193. };
  17194. // Add `LazyWrapper` methods to `lodash.prototype`.
  17195. baseForOwn(LazyWrapper.prototype, function(func, methodName) {
  17196. var checkIteratee = /^(?:filter|find|map|reject)|While$/.test(methodName),
  17197. isTaker = /^(?:head|last)$/.test(methodName),
  17198. lodashFunc = lodash[isTaker ? ('take' + (methodName == 'last' ? 'Right' : '')) : methodName],
  17199. retUnwrapped = isTaker || /^find/.test(methodName);
  17200. if (!lodashFunc) {
  17201. return;
  17202. }
  17203. lodash.prototype[methodName] = function() {
  17204. var value = this.__wrapped__,
  17205. args = isTaker ? [1] : arguments,
  17206. isLazy = value instanceof LazyWrapper,
  17207. iteratee = args[0],
  17208. useLazy = isLazy || isArray(value);
  17209. var interceptor = function(value) {
  17210. var result = lodashFunc.apply(lodash, arrayPush([value], args));
  17211. return (isTaker && chainAll) ? result[0] : result;
  17212. };
  17213. if (useLazy && checkIteratee && typeof iteratee == 'function' && iteratee.length != 1) {
  17214. // Avoid lazy use if the iteratee has a "length" value other than `1`.
  17215. isLazy = useLazy = false;
  17216. }
  17217. var chainAll = this.__chain__,
  17218. isHybrid = !!this.__actions__.length,
  17219. isUnwrapped = retUnwrapped && !chainAll,
  17220. onlyLazy = isLazy && !isHybrid;
  17221. if (!retUnwrapped && useLazy) {
  17222. value = onlyLazy ? value : new LazyWrapper(this);
  17223. var result = func.apply(value, args);
  17224. result.__actions__.push({ 'func': thru, 'args': [interceptor], 'thisArg': undefined });
  17225. return new LodashWrapper(result, chainAll);
  17226. }
  17227. if (isUnwrapped && onlyLazy) {
  17228. return func.apply(this, args);
  17229. }
  17230. result = this.thru(interceptor);
  17231. return isUnwrapped ? (isTaker ? result.value()[0] : result.value()) : result;
  17232. };
  17233. });
  17234. // Add `Array` methods to `lodash.prototype`.
  17235. arrayEach(['pop', 'push', 'shift', 'sort', 'splice', 'unshift'], function(methodName) {
  17236. var func = arrayProto[methodName],
  17237. chainName = /^(?:push|sort|unshift)$/.test(methodName) ? 'tap' : 'thru',
  17238. retUnwrapped = /^(?:pop|shift)$/.test(methodName);
  17239. lodash.prototype[methodName] = function() {
  17240. var args = arguments;
  17241. if (retUnwrapped && !this.__chain__) {
  17242. var value = this.value();
  17243. return func.apply(isArray(value) ? value : [], args);
  17244. }
  17245. return this[chainName](function(value) {
  17246. return func.apply(isArray(value) ? value : [], args);
  17247. });
  17248. };
  17249. });
  17250. // Map minified method names to their real names.
  17251. baseForOwn(LazyWrapper.prototype, function(func, methodName) {
  17252. var lodashFunc = lodash[methodName];
  17253. if (lodashFunc) {
  17254. var key = lodashFunc.name + '';
  17255. if (!hasOwnProperty.call(realNames, key)) {
  17256. realNames[key] = [];
  17257. }
  17258. realNames[key].push({ 'name': methodName, 'func': lodashFunc });
  17259. }
  17260. });
  17261. realNames[createHybrid(undefined, WRAP_BIND_KEY_FLAG).name] = [{
  17262. 'name': 'wrapper',
  17263. 'func': undefined
  17264. }];
  17265. // Add methods to `LazyWrapper`.
  17266. LazyWrapper.prototype.clone = lazyClone;
  17267. LazyWrapper.prototype.reverse = lazyReverse;
  17268. LazyWrapper.prototype.value = lazyValue;
  17269. // Add chain sequence methods to the `lodash` wrapper.
  17270. lodash.prototype.at = wrapperAt;
  17271. lodash.prototype.chain = wrapperChain;
  17272. lodash.prototype.commit = wrapperCommit;
  17273. lodash.prototype.next = wrapperNext;
  17274. lodash.prototype.plant = wrapperPlant;
  17275. lodash.prototype.reverse = wrapperReverse;
  17276. lodash.prototype.toJSON = lodash.prototype.valueOf = lodash.prototype.value = wrapperValue;
  17277. // Add lazy aliases.
  17278. lodash.prototype.first = lodash.prototype.head;
  17279. if (symIterator) {
  17280. lodash.prototype[symIterator] = wrapperToIterator;
  17281. }
  17282. return lodash;
  17283. });
  17284. /*--------------------------------------------------------------------------*/
  17285. // Export lodash.
  17286. var _ = runInContext();
  17287. // Some AMD build optimizers, like r.js, check for condition patterns like:
  17288. if (true) {
  17289. // Expose Lodash on the global object to prevent errors when Lodash is
  17290. // loaded by a script tag in the presence of an AMD loader.
  17291. // See http://requirejs.org/docs/errors.html#mismatch for more details.
  17292. // Use `_.noConflict` to remove Lodash from the global object.
  17293. root._ = _;
  17294. // Define as an anonymous module so, through path mapping, it can be
  17295. // referenced as the "underscore" module.
  17296. !(__WEBPACK_AMD_DEFINE_RESULT__ = (function() {
  17297. return _;
  17298. }).call(exports, __webpack_require__, exports, module),
  17299. __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
  17300. }
  17301. // Check for `exports` after `define` in case a build optimizer adds it.
  17302. else {}
  17303. }.call(this));
  17304. /***/ }),
  17305. /***/ "./node_modules/style-loader/dist/cjs.js!./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppSidebar.vue?vue&type=style&index=0&id=22a4e926&lang=scss&scoped=true":
  17306. /*!****************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  17307. !*** ./node_modules/style-loader/dist/cjs.js!./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppSidebar.vue?vue&type=style&index=0&id=22a4e926&lang=scss&scoped=true ***!
  17308. \****************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  17309. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17310. "use strict";
  17311. __webpack_require__.r(__webpack_exports__);
  17312. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17313. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17314. /* harmony export */ });
  17315. /* 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");
  17316. /* 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__);
  17317. /* harmony import */ var _node_modules_css_loader_dist_cjs_js_clonedRuleSet_11_use_1_node_modules_vue_loader_dist_stylePostLoader_js_node_modules_postcss_loader_dist_cjs_js_clonedRuleSet_11_use_2_node_modules_sass_loader_dist_cjs_js_clonedRuleSet_11_use_3_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_AppSidebar_vue_vue_type_style_index_0_id_22a4e926_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! !!../../../node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!../../../node_modules/vue-loader/dist/stylePostLoader.js!../../../node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!../../../node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!../../../node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./AppSidebar.vue?vue&type=style&index=0&id=22a4e926&lang=scss&scoped=true */ "./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppSidebar.vue?vue&type=style&index=0&id=22a4e926&lang=scss&scoped=true");
  17318. var options = {};
  17319. options.insert = "head";
  17320. options.singleton = false;
  17321. var update = _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default()(_node_modules_css_loader_dist_cjs_js_clonedRuleSet_11_use_1_node_modules_vue_loader_dist_stylePostLoader_js_node_modules_postcss_loader_dist_cjs_js_clonedRuleSet_11_use_2_node_modules_sass_loader_dist_cjs_js_clonedRuleSet_11_use_3_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_AppSidebar_vue_vue_type_style_index_0_id_22a4e926_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_1__["default"], options);
  17322. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (_node_modules_css_loader_dist_cjs_js_clonedRuleSet_11_use_1_node_modules_vue_loader_dist_stylePostLoader_js_node_modules_postcss_loader_dist_cjs_js_clonedRuleSet_11_use_2_node_modules_sass_loader_dist_cjs_js_clonedRuleSet_11_use_3_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_AppSidebar_vue_vue_type_style_index_0_id_22a4e926_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_1__["default"].locals || {});
  17323. /***/ }),
  17324. /***/ "./node_modules/style-loader/dist/cjs.js!./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppSubSidebar.vue?vue&type=style&index=0&id=0addd9bc&lang=scss&scoped=true":
  17325. /*!*******************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  17326. !*** ./node_modules/style-loader/dist/cjs.js!./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppSubSidebar.vue?vue&type=style&index=0&id=0addd9bc&lang=scss&scoped=true ***!
  17327. \*******************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  17328. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17329. "use strict";
  17330. __webpack_require__.r(__webpack_exports__);
  17331. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17332. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17333. /* harmony export */ });
  17334. /* 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");
  17335. /* 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__);
  17336. /* harmony import */ var _node_modules_css_loader_dist_cjs_js_clonedRuleSet_11_use_1_node_modules_vue_loader_dist_stylePostLoader_js_node_modules_postcss_loader_dist_cjs_js_clonedRuleSet_11_use_2_node_modules_sass_loader_dist_cjs_js_clonedRuleSet_11_use_3_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_AppSubSidebar_vue_vue_type_style_index_0_id_0addd9bc_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! !!../../../node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!../../../node_modules/vue-loader/dist/stylePostLoader.js!../../../node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!../../../node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!../../../node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./AppSubSidebar.vue?vue&type=style&index=0&id=0addd9bc&lang=scss&scoped=true */ "./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppSubSidebar.vue?vue&type=style&index=0&id=0addd9bc&lang=scss&scoped=true");
  17337. var options = {};
  17338. options.insert = "head";
  17339. options.singleton = false;
  17340. var update = _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default()(_node_modules_css_loader_dist_cjs_js_clonedRuleSet_11_use_1_node_modules_vue_loader_dist_stylePostLoader_js_node_modules_postcss_loader_dist_cjs_js_clonedRuleSet_11_use_2_node_modules_sass_loader_dist_cjs_js_clonedRuleSet_11_use_3_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_AppSubSidebar_vue_vue_type_style_index_0_id_0addd9bc_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_1__["default"], options);
  17341. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (_node_modules_css_loader_dist_cjs_js_clonedRuleSet_11_use_1_node_modules_vue_loader_dist_stylePostLoader_js_node_modules_postcss_loader_dist_cjs_js_clonedRuleSet_11_use_2_node_modules_sass_loader_dist_cjs_js_clonedRuleSet_11_use_3_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_AppSubSidebar_vue_vue_type_style_index_0_id_0addd9bc_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_1__["default"].locals || {});
  17342. /***/ }),
  17343. /***/ "./node_modules/style-loader/dist/cjs.js!./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppTopBar.vue?vue&type=style&index=0&id=42bf62a4&lang=scss&scoped=true":
  17344. /*!***************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  17345. !*** ./node_modules/style-loader/dist/cjs.js!./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppTopBar.vue?vue&type=style&index=0&id=42bf62a4&lang=scss&scoped=true ***!
  17346. \***************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  17347. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17348. "use strict";
  17349. __webpack_require__.r(__webpack_exports__);
  17350. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17351. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17352. /* harmony export */ });
  17353. /* 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");
  17354. /* 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__);
  17355. /* harmony import */ var _node_modules_css_loader_dist_cjs_js_clonedRuleSet_11_use_1_node_modules_vue_loader_dist_stylePostLoader_js_node_modules_postcss_loader_dist_cjs_js_clonedRuleSet_11_use_2_node_modules_sass_loader_dist_cjs_js_clonedRuleSet_11_use_3_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_AppTopBar_vue_vue_type_style_index_0_id_42bf62a4_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! !!../../../node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!../../../node_modules/vue-loader/dist/stylePostLoader.js!../../../node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!../../../node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!../../../node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./AppTopBar.vue?vue&type=style&index=0&id=42bf62a4&lang=scss&scoped=true */ "./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppTopBar.vue?vue&type=style&index=0&id=42bf62a4&lang=scss&scoped=true");
  17356. var options = {};
  17357. options.insert = "head";
  17358. options.singleton = false;
  17359. var update = _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default()(_node_modules_css_loader_dist_cjs_js_clonedRuleSet_11_use_1_node_modules_vue_loader_dist_stylePostLoader_js_node_modules_postcss_loader_dist_cjs_js_clonedRuleSet_11_use_2_node_modules_sass_loader_dist_cjs_js_clonedRuleSet_11_use_3_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_AppTopBar_vue_vue_type_style_index_0_id_42bf62a4_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_1__["default"], options);
  17360. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (_node_modules_css_loader_dist_cjs_js_clonedRuleSet_11_use_1_node_modules_vue_loader_dist_stylePostLoader_js_node_modules_postcss_loader_dist_cjs_js_clonedRuleSet_11_use_2_node_modules_sass_loader_dist_cjs_js_clonedRuleSet_11_use_3_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_AppTopBar_vue_vue_type_style_index_0_id_42bf62a4_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_1__["default"].locals || {});
  17361. /***/ }),
  17362. /***/ "./node_modules/style-loader/dist/cjs.js!./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/layouts/DashboardLayout.vue?vue&type=style&index=0&id=549bf5ac&lang=scss&scoped=true":
  17363. /*!******************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  17364. !*** ./node_modules/style-loader/dist/cjs.js!./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/layouts/DashboardLayout.vue?vue&type=style&index=0&id=549bf5ac&lang=scss&scoped=true ***!
  17365. \******************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  17366. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17367. "use strict";
  17368. __webpack_require__.r(__webpack_exports__);
  17369. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17370. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17371. /* harmony export */ });
  17372. /* 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");
  17373. /* 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__);
  17374. /* harmony import */ var _node_modules_css_loader_dist_cjs_js_clonedRuleSet_11_use_1_node_modules_vue_loader_dist_stylePostLoader_js_node_modules_postcss_loader_dist_cjs_js_clonedRuleSet_11_use_2_node_modules_sass_loader_dist_cjs_js_clonedRuleSet_11_use_3_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_DashboardLayout_vue_vue_type_style_index_0_id_549bf5ac_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! !!../../../node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!../../../node_modules/vue-loader/dist/stylePostLoader.js!../../../node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!../../../node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!../../../node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./DashboardLayout.vue?vue&type=style&index=0&id=549bf5ac&lang=scss&scoped=true */ "./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/layouts/DashboardLayout.vue?vue&type=style&index=0&id=549bf5ac&lang=scss&scoped=true");
  17375. var options = {};
  17376. options.insert = "head";
  17377. options.singleton = false;
  17378. var update = _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default()(_node_modules_css_loader_dist_cjs_js_clonedRuleSet_11_use_1_node_modules_vue_loader_dist_stylePostLoader_js_node_modules_postcss_loader_dist_cjs_js_clonedRuleSet_11_use_2_node_modules_sass_loader_dist_cjs_js_clonedRuleSet_11_use_3_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_DashboardLayout_vue_vue_type_style_index_0_id_549bf5ac_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_1__["default"], options);
  17379. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (_node_modules_css_loader_dist_cjs_js_clonedRuleSet_11_use_1_node_modules_vue_loader_dist_stylePostLoader_js_node_modules_postcss_loader_dist_cjs_js_clonedRuleSet_11_use_2_node_modules_sass_loader_dist_cjs_js_clonedRuleSet_11_use_3_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_DashboardLayout_vue_vue_type_style_index_0_id_549bf5ac_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_1__["default"].locals || {});
  17380. /***/ }),
  17381. /***/ "./node_modules/vue-loader/dist/exportHelper.js":
  17382. /*!******************************************************!*\
  17383. !*** ./node_modules/vue-loader/dist/exportHelper.js ***!
  17384. \******************************************************/
  17385. /***/ ((__unused_webpack_module, exports) => {
  17386. "use strict";
  17387. Object.defineProperty(exports, "__esModule", ({ value: true }));
  17388. // runtime helper for setting properties on components
  17389. // in a tree-shakable way
  17390. exports["default"] = (sfc, props) => {
  17391. const target = sfc.__vccOpts || sfc;
  17392. for (const [key, val] of props) {
  17393. target[key] = val;
  17394. }
  17395. return target;
  17396. };
  17397. /***/ }),
  17398. /***/ "./resources/js/components/AppButtonLink.vue":
  17399. /*!***************************************************!*\
  17400. !*** ./resources/js/components/AppButtonLink.vue ***!
  17401. \***************************************************/
  17402. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17403. "use strict";
  17404. __webpack_require__.r(__webpack_exports__);
  17405. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17406. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17407. /* harmony export */ });
  17408. /* 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");
  17409. /* 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");
  17410. /* 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");
  17411. ;
  17412. 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"]])
  17413. /* hot reload */
  17414. if (false) {}
  17415. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__);
  17416. /***/ }),
  17417. /***/ "./resources/js/components/AppMessage.vue":
  17418. /*!************************************************!*\
  17419. !*** ./resources/js/components/AppMessage.vue ***!
  17420. \************************************************/
  17421. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17422. "use strict";
  17423. __webpack_require__.r(__webpack_exports__);
  17424. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17425. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17426. /* harmony export */ });
  17427. /* 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");
  17428. /* 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");
  17429. /* 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");
  17430. ;
  17431. 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"]])
  17432. /* hot reload */
  17433. if (false) {}
  17434. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__);
  17435. /***/ }),
  17436. /***/ "./resources/js/components/AppPagination.vue":
  17437. /*!***************************************************!*\
  17438. !*** ./resources/js/components/AppPagination.vue ***!
  17439. \***************************************************/
  17440. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17441. "use strict";
  17442. __webpack_require__.r(__webpack_exports__);
  17443. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17444. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17445. /* harmony export */ });
  17446. /* 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");
  17447. /* 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");
  17448. /* 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");
  17449. ;
  17450. 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"]])
  17451. /* hot reload */
  17452. if (false) {}
  17453. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__);
  17454. /***/ }),
  17455. /***/ "./resources/js/components/AppSidebar.vue":
  17456. /*!************************************************!*\
  17457. !*** ./resources/js/components/AppSidebar.vue ***!
  17458. \************************************************/
  17459. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17460. "use strict";
  17461. __webpack_require__.r(__webpack_exports__);
  17462. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17463. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17464. /* harmony export */ });
  17465. /* harmony import */ var _AppSidebar_vue_vue_type_template_id_22a4e926_scoped_true__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./AppSidebar.vue?vue&type=template&id=22a4e926&scoped=true */ "./resources/js/components/AppSidebar.vue?vue&type=template&id=22a4e926&scoped=true");
  17466. /* harmony import */ var _AppSidebar_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./AppSidebar.vue?vue&type=script&setup=true&lang=js */ "./resources/js/components/AppSidebar.vue?vue&type=script&setup=true&lang=js");
  17467. /* harmony import */ var _AppSidebar_vue_vue_type_style_index_0_id_22a4e926_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./AppSidebar.vue?vue&type=style&index=0&id=22a4e926&lang=scss&scoped=true */ "./resources/js/components/AppSidebar.vue?vue&type=style&index=0&id=22a4e926&lang=scss&scoped=true");
  17468. /* 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");
  17469. ;
  17470. const __exports__ = /*#__PURE__*/(0,_media_dijitalcode_3ad9c6e0_4296_4a57_b136_144df49e7bb8_Projects_cahaya_agung_node_modules_vue_loader_dist_exportHelper_js__WEBPACK_IMPORTED_MODULE_3__["default"])(_AppSidebar_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_1__["default"], [['render',_AppSidebar_vue_vue_type_template_id_22a4e926_scoped_true__WEBPACK_IMPORTED_MODULE_0__.render],['__scopeId',"data-v-22a4e926"],['__file',"resources/js/components/AppSidebar.vue"]])
  17471. /* hot reload */
  17472. if (false) {}
  17473. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__);
  17474. /***/ }),
  17475. /***/ "./resources/js/components/AppSubSidebar.vue":
  17476. /*!***************************************************!*\
  17477. !*** ./resources/js/components/AppSubSidebar.vue ***!
  17478. \***************************************************/
  17479. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17480. "use strict";
  17481. __webpack_require__.r(__webpack_exports__);
  17482. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17483. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17484. /* harmony export */ });
  17485. /* harmony import */ var _AppSubSidebar_vue_vue_type_template_id_0addd9bc_scoped_true__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./AppSubSidebar.vue?vue&type=template&id=0addd9bc&scoped=true */ "./resources/js/components/AppSubSidebar.vue?vue&type=template&id=0addd9bc&scoped=true");
  17486. /* harmony import */ var _AppSubSidebar_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./AppSubSidebar.vue?vue&type=script&setup=true&lang=js */ "./resources/js/components/AppSubSidebar.vue?vue&type=script&setup=true&lang=js");
  17487. /* harmony import */ var _AppSubSidebar_vue_vue_type_style_index_0_id_0addd9bc_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./AppSubSidebar.vue?vue&type=style&index=0&id=0addd9bc&lang=scss&scoped=true */ "./resources/js/components/AppSubSidebar.vue?vue&type=style&index=0&id=0addd9bc&lang=scss&scoped=true");
  17488. /* 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");
  17489. ;
  17490. const __exports__ = /*#__PURE__*/(0,_media_dijitalcode_3ad9c6e0_4296_4a57_b136_144df49e7bb8_Projects_cahaya_agung_node_modules_vue_loader_dist_exportHelper_js__WEBPACK_IMPORTED_MODULE_3__["default"])(_AppSubSidebar_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_1__["default"], [['render',_AppSubSidebar_vue_vue_type_template_id_0addd9bc_scoped_true__WEBPACK_IMPORTED_MODULE_0__.render],['__scopeId',"data-v-0addd9bc"],['__file',"resources/js/components/AppSubSidebar.vue"]])
  17491. /* hot reload */
  17492. if (false) {}
  17493. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__);
  17494. /***/ }),
  17495. /***/ "./resources/js/components/AppTopBar.vue":
  17496. /*!***********************************************!*\
  17497. !*** ./resources/js/components/AppTopBar.vue ***!
  17498. \***********************************************/
  17499. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17500. "use strict";
  17501. __webpack_require__.r(__webpack_exports__);
  17502. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17503. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17504. /* harmony export */ });
  17505. /* harmony import */ var _AppTopBar_vue_vue_type_template_id_42bf62a4_scoped_true__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./AppTopBar.vue?vue&type=template&id=42bf62a4&scoped=true */ "./resources/js/components/AppTopBar.vue?vue&type=template&id=42bf62a4&scoped=true");
  17506. /* harmony import */ var _AppTopBar_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./AppTopBar.vue?vue&type=script&setup=true&lang=js */ "./resources/js/components/AppTopBar.vue?vue&type=script&setup=true&lang=js");
  17507. /* harmony import */ var _AppTopBar_vue_vue_type_style_index_0_id_42bf62a4_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./AppTopBar.vue?vue&type=style&index=0&id=42bf62a4&lang=scss&scoped=true */ "./resources/js/components/AppTopBar.vue?vue&type=style&index=0&id=42bf62a4&lang=scss&scoped=true");
  17508. /* 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");
  17509. ;
  17510. const __exports__ = /*#__PURE__*/(0,_media_dijitalcode_3ad9c6e0_4296_4a57_b136_144df49e7bb8_Projects_cahaya_agung_node_modules_vue_loader_dist_exportHelper_js__WEBPACK_IMPORTED_MODULE_3__["default"])(_AppTopBar_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_1__["default"], [['render',_AppTopBar_vue_vue_type_template_id_42bf62a4_scoped_true__WEBPACK_IMPORTED_MODULE_0__.render],['__scopeId',"data-v-42bf62a4"],['__file',"resources/js/components/AppTopBar.vue"]])
  17511. /* hot reload */
  17512. if (false) {}
  17513. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__);
  17514. /***/ }),
  17515. /***/ "./resources/js/layouts/DashboardLayout.vue":
  17516. /*!**************************************************!*\
  17517. !*** ./resources/js/layouts/DashboardLayout.vue ***!
  17518. \**************************************************/
  17519. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17520. "use strict";
  17521. __webpack_require__.r(__webpack_exports__);
  17522. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17523. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17524. /* harmony export */ });
  17525. /* harmony import */ var _DashboardLayout_vue_vue_type_template_id_549bf5ac_scoped_true__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./DashboardLayout.vue?vue&type=template&id=549bf5ac&scoped=true */ "./resources/js/layouts/DashboardLayout.vue?vue&type=template&id=549bf5ac&scoped=true");
  17526. /* harmony import */ var _DashboardLayout_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./DashboardLayout.vue?vue&type=script&setup=true&lang=js */ "./resources/js/layouts/DashboardLayout.vue?vue&type=script&setup=true&lang=js");
  17527. /* harmony import */ var _DashboardLayout_vue_vue_type_style_index_0_id_549bf5ac_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./DashboardLayout.vue?vue&type=style&index=0&id=549bf5ac&lang=scss&scoped=true */ "./resources/js/layouts/DashboardLayout.vue?vue&type=style&index=0&id=549bf5ac&lang=scss&scoped=true");
  17528. /* 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");
  17529. ;
  17530. const __exports__ = /*#__PURE__*/(0,_media_dijitalcode_3ad9c6e0_4296_4a57_b136_144df49e7bb8_Projects_cahaya_agung_node_modules_vue_loader_dist_exportHelper_js__WEBPACK_IMPORTED_MODULE_3__["default"])(_DashboardLayout_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_1__["default"], [['render',_DashboardLayout_vue_vue_type_template_id_549bf5ac_scoped_true__WEBPACK_IMPORTED_MODULE_0__.render],['__scopeId',"data-v-549bf5ac"],['__file',"resources/js/layouts/DashboardLayout.vue"]])
  17531. /* hot reload */
  17532. if (false) {}
  17533. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__);
  17534. /***/ }),
  17535. /***/ "./resources/js/pages/Users/Index.vue":
  17536. /*!********************************************!*\
  17537. !*** ./resources/js/pages/Users/Index.vue ***!
  17538. \********************************************/
  17539. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17540. "use strict";
  17541. __webpack_require__.r(__webpack_exports__);
  17542. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17543. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17544. /* harmony export */ });
  17545. /* 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");
  17546. /* 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");
  17547. /* 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");
  17548. ;
  17549. 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"]])
  17550. /* hot reload */
  17551. if (false) {}
  17552. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__);
  17553. /***/ }),
  17554. /***/ "./resources/js/components/AppButtonLink.vue?vue&type=script&setup=true&lang=js":
  17555. /*!**************************************************************************************!*\
  17556. !*** ./resources/js/components/AppButtonLink.vue?vue&type=script&setup=true&lang=js ***!
  17557. \**************************************************************************************/
  17558. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17559. "use strict";
  17560. __webpack_require__.r(__webpack_exports__);
  17561. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17562. /* 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"])
  17563. /* harmony export */ });
  17564. /* 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");
  17565. /***/ }),
  17566. /***/ "./resources/js/components/AppMessage.vue?vue&type=script&setup=true&lang=js":
  17567. /*!***********************************************************************************!*\
  17568. !*** ./resources/js/components/AppMessage.vue?vue&type=script&setup=true&lang=js ***!
  17569. \***********************************************************************************/
  17570. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17571. "use strict";
  17572. __webpack_require__.r(__webpack_exports__);
  17573. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17574. /* 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"])
  17575. /* harmony export */ });
  17576. /* 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");
  17577. /***/ }),
  17578. /***/ "./resources/js/components/AppPagination.vue?vue&type=script&setup=true&lang=js":
  17579. /*!**************************************************************************************!*\
  17580. !*** ./resources/js/components/AppPagination.vue?vue&type=script&setup=true&lang=js ***!
  17581. \**************************************************************************************/
  17582. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17583. "use strict";
  17584. __webpack_require__.r(__webpack_exports__);
  17585. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17586. /* 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"])
  17587. /* harmony export */ });
  17588. /* 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");
  17589. /***/ }),
  17590. /***/ "./resources/js/components/AppSidebar.vue?vue&type=script&setup=true&lang=js":
  17591. /*!***********************************************************************************!*\
  17592. !*** ./resources/js/components/AppSidebar.vue?vue&type=script&setup=true&lang=js ***!
  17593. \***********************************************************************************/
  17594. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17595. "use strict";
  17596. __webpack_require__.r(__webpack_exports__);
  17597. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17598. /* harmony export */ "default": () => (/* reexport safe */ _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_AppSidebar_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_0__["default"])
  17599. /* harmony export */ });
  17600. /* harmony import */ var _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_AppSidebar_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!../../../node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./AppSidebar.vue?vue&type=script&setup=true&lang=js */ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppSidebar.vue?vue&type=script&setup=true&lang=js");
  17601. /***/ }),
  17602. /***/ "./resources/js/components/AppSubSidebar.vue?vue&type=script&setup=true&lang=js":
  17603. /*!**************************************************************************************!*\
  17604. !*** ./resources/js/components/AppSubSidebar.vue?vue&type=script&setup=true&lang=js ***!
  17605. \**************************************************************************************/
  17606. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17607. "use strict";
  17608. __webpack_require__.r(__webpack_exports__);
  17609. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17610. /* harmony export */ "default": () => (/* reexport safe */ _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_AppSubSidebar_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_0__["default"])
  17611. /* harmony export */ });
  17612. /* harmony import */ var _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_AppSubSidebar_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!../../../node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./AppSubSidebar.vue?vue&type=script&setup=true&lang=js */ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppSubSidebar.vue?vue&type=script&setup=true&lang=js");
  17613. /***/ }),
  17614. /***/ "./resources/js/components/AppTopBar.vue?vue&type=script&setup=true&lang=js":
  17615. /*!**********************************************************************************!*\
  17616. !*** ./resources/js/components/AppTopBar.vue?vue&type=script&setup=true&lang=js ***!
  17617. \**********************************************************************************/
  17618. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17619. "use strict";
  17620. __webpack_require__.r(__webpack_exports__);
  17621. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17622. /* harmony export */ "default": () => (/* reexport safe */ _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_AppTopBar_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_0__["default"])
  17623. /* harmony export */ });
  17624. /* harmony import */ var _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_AppTopBar_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!../../../node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./AppTopBar.vue?vue&type=script&setup=true&lang=js */ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppTopBar.vue?vue&type=script&setup=true&lang=js");
  17625. /***/ }),
  17626. /***/ "./resources/js/layouts/DashboardLayout.vue?vue&type=script&setup=true&lang=js":
  17627. /*!*************************************************************************************!*\
  17628. !*** ./resources/js/layouts/DashboardLayout.vue?vue&type=script&setup=true&lang=js ***!
  17629. \*************************************************************************************/
  17630. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17631. "use strict";
  17632. __webpack_require__.r(__webpack_exports__);
  17633. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17634. /* 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"])
  17635. /* harmony export */ });
  17636. /* harmony import */ var _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_DashboardLayout_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!../../../node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./DashboardLayout.vue?vue&type=script&setup=true&lang=js */ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/layouts/DashboardLayout.vue?vue&type=script&setup=true&lang=js");
  17637. /***/ }),
  17638. /***/ "./resources/js/pages/Users/Index.vue?vue&type=script&setup=true&lang=js":
  17639. /*!*******************************************************************************!*\
  17640. !*** ./resources/js/pages/Users/Index.vue?vue&type=script&setup=true&lang=js ***!
  17641. \*******************************************************************************/
  17642. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17643. "use strict";
  17644. __webpack_require__.r(__webpack_exports__);
  17645. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17646. /* 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"])
  17647. /* harmony export */ });
  17648. /* 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");
  17649. /***/ }),
  17650. /***/ "./resources/js/components/AppButtonLink.vue?vue&type=template&id=c3621f1c":
  17651. /*!*********************************************************************************!*\
  17652. !*** ./resources/js/components/AppButtonLink.vue?vue&type=template&id=c3621f1c ***!
  17653. \*********************************************************************************/
  17654. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17655. "use strict";
  17656. __webpack_require__.r(__webpack_exports__);
  17657. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17658. /* 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)
  17659. /* harmony export */ });
  17660. /* 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");
  17661. /***/ }),
  17662. /***/ "./resources/js/components/AppMessage.vue?vue&type=template&id=07159051":
  17663. /*!******************************************************************************!*\
  17664. !*** ./resources/js/components/AppMessage.vue?vue&type=template&id=07159051 ***!
  17665. \******************************************************************************/
  17666. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17667. "use strict";
  17668. __webpack_require__.r(__webpack_exports__);
  17669. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17670. /* 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)
  17671. /* harmony export */ });
  17672. /* 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");
  17673. /***/ }),
  17674. /***/ "./resources/js/components/AppPagination.vue?vue&type=template&id=4da56ec0":
  17675. /*!*********************************************************************************!*\
  17676. !*** ./resources/js/components/AppPagination.vue?vue&type=template&id=4da56ec0 ***!
  17677. \*********************************************************************************/
  17678. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17679. "use strict";
  17680. __webpack_require__.r(__webpack_exports__);
  17681. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17682. /* 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)
  17683. /* harmony export */ });
  17684. /* 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");
  17685. /***/ }),
  17686. /***/ "./resources/js/components/AppSidebar.vue?vue&type=template&id=22a4e926&scoped=true":
  17687. /*!******************************************************************************************!*\
  17688. !*** ./resources/js/components/AppSidebar.vue?vue&type=template&id=22a4e926&scoped=true ***!
  17689. \******************************************************************************************/
  17690. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17691. "use strict";
  17692. __webpack_require__.r(__webpack_exports__);
  17693. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17694. /* harmony export */ "render": () => (/* reexport safe */ _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_templateLoader_js_ruleSet_1_rules_2_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_AppSidebar_vue_vue_type_template_id_22a4e926_scoped_true__WEBPACK_IMPORTED_MODULE_0__.render)
  17695. /* harmony export */ });
  17696. /* harmony import */ var _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_templateLoader_js_ruleSet_1_rules_2_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_AppSidebar_vue_vue_type_template_id_22a4e926_scoped_true__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!../../../node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!../../../node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./AppSidebar.vue?vue&type=template&id=22a4e926&scoped=true */ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppSidebar.vue?vue&type=template&id=22a4e926&scoped=true");
  17697. /***/ }),
  17698. /***/ "./resources/js/components/AppSubSidebar.vue?vue&type=template&id=0addd9bc&scoped=true":
  17699. /*!*********************************************************************************************!*\
  17700. !*** ./resources/js/components/AppSubSidebar.vue?vue&type=template&id=0addd9bc&scoped=true ***!
  17701. \*********************************************************************************************/
  17702. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17703. "use strict";
  17704. __webpack_require__.r(__webpack_exports__);
  17705. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17706. /* harmony export */ "render": () => (/* reexport safe */ _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_templateLoader_js_ruleSet_1_rules_2_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_AppSubSidebar_vue_vue_type_template_id_0addd9bc_scoped_true__WEBPACK_IMPORTED_MODULE_0__.render)
  17707. /* harmony export */ });
  17708. /* harmony import */ var _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_templateLoader_js_ruleSet_1_rules_2_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_AppSubSidebar_vue_vue_type_template_id_0addd9bc_scoped_true__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!../../../node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!../../../node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./AppSubSidebar.vue?vue&type=template&id=0addd9bc&scoped=true */ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppSubSidebar.vue?vue&type=template&id=0addd9bc&scoped=true");
  17709. /***/ }),
  17710. /***/ "./resources/js/components/AppTopBar.vue?vue&type=template&id=42bf62a4&scoped=true":
  17711. /*!*****************************************************************************************!*\
  17712. !*** ./resources/js/components/AppTopBar.vue?vue&type=template&id=42bf62a4&scoped=true ***!
  17713. \*****************************************************************************************/
  17714. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17715. "use strict";
  17716. __webpack_require__.r(__webpack_exports__);
  17717. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17718. /* harmony export */ "render": () => (/* reexport safe */ _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_templateLoader_js_ruleSet_1_rules_2_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_AppTopBar_vue_vue_type_template_id_42bf62a4_scoped_true__WEBPACK_IMPORTED_MODULE_0__.render)
  17719. /* harmony export */ });
  17720. /* harmony import */ var _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_templateLoader_js_ruleSet_1_rules_2_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_AppTopBar_vue_vue_type_template_id_42bf62a4_scoped_true__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!../../../node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!../../../node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./AppTopBar.vue?vue&type=template&id=42bf62a4&scoped=true */ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppTopBar.vue?vue&type=template&id=42bf62a4&scoped=true");
  17721. /***/ }),
  17722. /***/ "./resources/js/layouts/DashboardLayout.vue?vue&type=template&id=549bf5ac&scoped=true":
  17723. /*!********************************************************************************************!*\
  17724. !*** ./resources/js/layouts/DashboardLayout.vue?vue&type=template&id=549bf5ac&scoped=true ***!
  17725. \********************************************************************************************/
  17726. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17727. "use strict";
  17728. __webpack_require__.r(__webpack_exports__);
  17729. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17730. /* harmony export */ "render": () => (/* reexport safe */ _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_templateLoader_js_ruleSet_1_rules_2_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_DashboardLayout_vue_vue_type_template_id_549bf5ac_scoped_true__WEBPACK_IMPORTED_MODULE_0__.render)
  17731. /* harmony export */ });
  17732. /* harmony import */ var _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_templateLoader_js_ruleSet_1_rules_2_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_DashboardLayout_vue_vue_type_template_id_549bf5ac_scoped_true__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!../../../node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!../../../node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./DashboardLayout.vue?vue&type=template&id=549bf5ac&scoped=true */ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/layouts/DashboardLayout.vue?vue&type=template&id=549bf5ac&scoped=true");
  17733. /***/ }),
  17734. /***/ "./resources/js/pages/Users/Index.vue?vue&type=template&id=203afd1c":
  17735. /*!**************************************************************************!*\
  17736. !*** ./resources/js/pages/Users/Index.vue?vue&type=template&id=203afd1c ***!
  17737. \**************************************************************************/
  17738. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17739. "use strict";
  17740. __webpack_require__.r(__webpack_exports__);
  17741. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17742. /* 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)
  17743. /* harmony export */ });
  17744. /* 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");
  17745. /***/ }),
  17746. /***/ "./resources/js/components/AppSidebar.vue?vue&type=style&index=0&id=22a4e926&lang=scss&scoped=true":
  17747. /*!*********************************************************************************************************!*\
  17748. !*** ./resources/js/components/AppSidebar.vue?vue&type=style&index=0&id=22a4e926&lang=scss&scoped=true ***!
  17749. \*********************************************************************************************************/
  17750. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17751. "use strict";
  17752. __webpack_require__.r(__webpack_exports__);
  17753. /* harmony import */ var _node_modules_style_loader_dist_cjs_js_node_modules_css_loader_dist_cjs_js_clonedRuleSet_11_use_1_node_modules_vue_loader_dist_stylePostLoader_js_node_modules_postcss_loader_dist_cjs_js_clonedRuleSet_11_use_2_node_modules_sass_loader_dist_cjs_js_clonedRuleSet_11_use_3_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_AppSidebar_vue_vue_type_style_index_0_id_22a4e926_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../node_modules/style-loader/dist/cjs.js!../../../node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!../../../node_modules/vue-loader/dist/stylePostLoader.js!../../../node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!../../../node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!../../../node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./AppSidebar.vue?vue&type=style&index=0&id=22a4e926&lang=scss&scoped=true */ "./node_modules/style-loader/dist/cjs.js!./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppSidebar.vue?vue&type=style&index=0&id=22a4e926&lang=scss&scoped=true");
  17754. /***/ }),
  17755. /***/ "./resources/js/components/AppSubSidebar.vue?vue&type=style&index=0&id=0addd9bc&lang=scss&scoped=true":
  17756. /*!************************************************************************************************************!*\
  17757. !*** ./resources/js/components/AppSubSidebar.vue?vue&type=style&index=0&id=0addd9bc&lang=scss&scoped=true ***!
  17758. \************************************************************************************************************/
  17759. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17760. "use strict";
  17761. __webpack_require__.r(__webpack_exports__);
  17762. /* harmony import */ var _node_modules_style_loader_dist_cjs_js_node_modules_css_loader_dist_cjs_js_clonedRuleSet_11_use_1_node_modules_vue_loader_dist_stylePostLoader_js_node_modules_postcss_loader_dist_cjs_js_clonedRuleSet_11_use_2_node_modules_sass_loader_dist_cjs_js_clonedRuleSet_11_use_3_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_AppSubSidebar_vue_vue_type_style_index_0_id_0addd9bc_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../node_modules/style-loader/dist/cjs.js!../../../node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!../../../node_modules/vue-loader/dist/stylePostLoader.js!../../../node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!../../../node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!../../../node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./AppSubSidebar.vue?vue&type=style&index=0&id=0addd9bc&lang=scss&scoped=true */ "./node_modules/style-loader/dist/cjs.js!./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppSubSidebar.vue?vue&type=style&index=0&id=0addd9bc&lang=scss&scoped=true");
  17763. /***/ }),
  17764. /***/ "./resources/js/components/AppTopBar.vue?vue&type=style&index=0&id=42bf62a4&lang=scss&scoped=true":
  17765. /*!********************************************************************************************************!*\
  17766. !*** ./resources/js/components/AppTopBar.vue?vue&type=style&index=0&id=42bf62a4&lang=scss&scoped=true ***!
  17767. \********************************************************************************************************/
  17768. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17769. "use strict";
  17770. __webpack_require__.r(__webpack_exports__);
  17771. /* harmony import */ var _node_modules_style_loader_dist_cjs_js_node_modules_css_loader_dist_cjs_js_clonedRuleSet_11_use_1_node_modules_vue_loader_dist_stylePostLoader_js_node_modules_postcss_loader_dist_cjs_js_clonedRuleSet_11_use_2_node_modules_sass_loader_dist_cjs_js_clonedRuleSet_11_use_3_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_AppTopBar_vue_vue_type_style_index_0_id_42bf62a4_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../node_modules/style-loader/dist/cjs.js!../../../node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!../../../node_modules/vue-loader/dist/stylePostLoader.js!../../../node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!../../../node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!../../../node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./AppTopBar.vue?vue&type=style&index=0&id=42bf62a4&lang=scss&scoped=true */ "./node_modules/style-loader/dist/cjs.js!./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppTopBar.vue?vue&type=style&index=0&id=42bf62a4&lang=scss&scoped=true");
  17772. /***/ }),
  17773. /***/ "./resources/js/layouts/DashboardLayout.vue?vue&type=style&index=0&id=549bf5ac&lang=scss&scoped=true":
  17774. /*!***********************************************************************************************************!*\
  17775. !*** ./resources/js/layouts/DashboardLayout.vue?vue&type=style&index=0&id=549bf5ac&lang=scss&scoped=true ***!
  17776. \***********************************************************************************************************/
  17777. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17778. "use strict";
  17779. __webpack_require__.r(__webpack_exports__);
  17780. /* harmony import */ var _node_modules_style_loader_dist_cjs_js_node_modules_css_loader_dist_cjs_js_clonedRuleSet_11_use_1_node_modules_vue_loader_dist_stylePostLoader_js_node_modules_postcss_loader_dist_cjs_js_clonedRuleSet_11_use_2_node_modules_sass_loader_dist_cjs_js_clonedRuleSet_11_use_3_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_DashboardLayout_vue_vue_type_style_index_0_id_549bf5ac_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../node_modules/style-loader/dist/cjs.js!../../../node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!../../../node_modules/vue-loader/dist/stylePostLoader.js!../../../node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!../../../node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!../../../node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./DashboardLayout.vue?vue&type=style&index=0&id=549bf5ac&lang=scss&scoped=true */ "./node_modules/style-loader/dist/cjs.js!./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/layouts/DashboardLayout.vue?vue&type=style&index=0&id=549bf5ac&lang=scss&scoped=true");
  17781. /***/ })
  17782. }]);