resources_js_pages_Users_Index_vue.js 696KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418441944204421442244234424442544264427442844294430443144324433443444354436443744384439444044414442444344444445444644474448444944504451445244534454445544564457445844594460446144624463446444654466446744684469447044714472447344744475447644774478447944804481448244834484448544864487448844894490449144924493449444954496449744984499450045014502450345044505450645074508450945104511451245134514451545164517451845194520452145224523452445254526452745284529453045314532453345344535453645374538453945404541454245434544454545464547454845494550455145524553455445554556455745584559456045614562456345644565456645674568456945704571457245734574457545764577457845794580458145824583458445854586458745884589459045914592459345944595459645974598459946004601460246034604460546064607460846094610461146124613461446154616461746184619462046214622462346244625462646274628462946304631463246334634463546364637463846394640464146424643464446454646464746484649465046514652465346544655465646574658465946604661466246634664466546664667466846694670467146724673467446754676467746784679468046814682468346844685468646874688468946904691469246934694469546964697469846994700470147024703470447054706470747084709471047114712471347144715471647174718471947204721472247234724472547264727472847294730473147324733473447354736473747384739474047414742474347444745474647474748474947504751475247534754475547564757475847594760476147624763476447654766476747684769477047714772477347744775477647774778477947804781478247834784478547864787478847894790479147924793479447954796479747984799480048014802480348044805480648074808480948104811481248134814481548164817481848194820482148224823482448254826482748284829483048314832483348344835483648374838483948404841484248434844484548464847484848494850485148524853485448554856485748584859486048614862486348644865486648674868486948704871487248734874487548764877487848794880488148824883488448854886488748884889489048914892489348944895489648974898489949004901490249034904490549064907490849094910491149124913491449154916491749184919492049214922492349244925492649274928492949304931493249334934493549364937493849394940494149424943494449454946494749484949495049514952495349544955495649574958495949604961496249634964496549664967496849694970497149724973497449754976497749784979498049814982498349844985498649874988498949904991499249934994499549964997499849995000500150025003500450055006500750085009501050115012501350145015501650175018501950205021502250235024502550265027502850295030503150325033503450355036503750385039504050415042504350445045504650475048504950505051505250535054505550565057505850595060506150625063506450655066506750685069507050715072507350745075507650775078507950805081508250835084508550865087508850895090509150925093509450955096509750985099510051015102510351045105510651075108510951105111511251135114511551165117511851195120512151225123512451255126512751285129513051315132513351345135513651375138513951405141514251435144514551465147514851495150515151525153515451555156515751585159516051615162516351645165516651675168516951705171517251735174517551765177517851795180518151825183518451855186518751885189519051915192519351945195519651975198519952005201520252035204520552065207520852095210521152125213521452155216521752185219522052215222522352245225522652275228522952305231523252335234523552365237523852395240524152425243524452455246524752485249525052515252525352545255525652575258525952605261526252635264526552665267526852695270527152725273527452755276527752785279528052815282528352845285528652875288528952905291529252935294529552965297529852995300530153025303530453055306530753085309531053115312531353145315531653175318531953205321532253235324532553265327532853295330533153325333533453355336533753385339534053415342534353445345534653475348534953505351535253535354535553565357535853595360536153625363536453655366536753685369537053715372537353745375537653775378537953805381538253835384538553865387538853895390539153925393539453955396539753985399540054015402540354045405540654075408540954105411541254135414541554165417541854195420542154225423542454255426542754285429543054315432543354345435543654375438543954405441544254435444544554465447544854495450545154525453545454555456545754585459546054615462546354645465546654675468546954705471547254735474547554765477547854795480548154825483548454855486548754885489549054915492549354945495549654975498549955005501550255035504550555065507550855095510551155125513551455155516551755185519552055215522552355245525552655275528552955305531553255335534553555365537553855395540554155425543554455455546554755485549555055515552555355545555555655575558555955605561556255635564556555665567556855695570557155725573557455755576557755785579558055815582558355845585558655875588558955905591559255935594559555965597559855995600560156025603560456055606560756085609561056115612561356145615561656175618561956205621562256235624562556265627562856295630563156325633563456355636563756385639564056415642564356445645564656475648564956505651565256535654565556565657565856595660566156625663566456655666566756685669567056715672567356745675567656775678567956805681568256835684568556865687568856895690569156925693569456955696569756985699570057015702570357045705570657075708570957105711571257135714571557165717571857195720572157225723572457255726572757285729573057315732573357345735573657375738573957405741574257435744574557465747574857495750575157525753575457555756575757585759576057615762576357645765576657675768576957705771577257735774577557765777577857795780578157825783578457855786578757885789579057915792579357945795579657975798579958005801580258035804580558065807580858095810581158125813581458155816581758185819582058215822582358245825582658275828582958305831583258335834583558365837583858395840584158425843584458455846584758485849585058515852585358545855585658575858585958605861586258635864586558665867586858695870587158725873587458755876587758785879588058815882588358845885588658875888588958905891589258935894589558965897589858995900590159025903590459055906590759085909591059115912591359145915591659175918591959205921592259235924592559265927592859295930593159325933593459355936593759385939594059415942594359445945594659475948594959505951595259535954595559565957595859595960596159625963596459655966596759685969597059715972597359745975597659775978597959805981598259835984598559865987598859895990599159925993599459955996599759985999600060016002600360046005600660076008600960106011601260136014601560166017601860196020602160226023602460256026602760286029603060316032603360346035603660376038603960406041604260436044604560466047604860496050605160526053605460556056605760586059606060616062606360646065606660676068606960706071607260736074607560766077607860796080608160826083608460856086608760886089609060916092609360946095609660976098609961006101610261036104610561066107610861096110611161126113611461156116611761186119612061216122612361246125612661276128612961306131613261336134613561366137613861396140614161426143614461456146614761486149615061516152615361546155615661576158615961606161616261636164616561666167616861696170617161726173617461756176617761786179618061816182618361846185618661876188618961906191619261936194619561966197619861996200620162026203620462056206620762086209621062116212621362146215621662176218621962206221622262236224622562266227622862296230623162326233623462356236623762386239624062416242624362446245624662476248624962506251625262536254625562566257625862596260626162626263626462656266626762686269627062716272627362746275627662776278627962806281628262836284628562866287628862896290629162926293629462956296629762986299630063016302630363046305630663076308630963106311631263136314631563166317631863196320632163226323632463256326632763286329633063316332633363346335633663376338633963406341634263436344634563466347634863496350635163526353635463556356635763586359636063616362636363646365636663676368636963706371637263736374637563766377637863796380638163826383638463856386638763886389639063916392639363946395639663976398639964006401640264036404640564066407640864096410641164126413641464156416641764186419642064216422642364246425642664276428642964306431643264336434643564366437643864396440644164426443644464456446644764486449645064516452645364546455645664576458645964606461646264636464646564666467646864696470647164726473647464756476647764786479648064816482648364846485648664876488648964906491649264936494649564966497649864996500650165026503650465056506650765086509651065116512651365146515651665176518651965206521652265236524652565266527652865296530653165326533653465356536653765386539654065416542654365446545654665476548654965506551655265536554655565566557655865596560656165626563656465656566656765686569657065716572657365746575657665776578657965806581658265836584658565866587658865896590659165926593659465956596659765986599660066016602660366046605660666076608660966106611661266136614661566166617661866196620662166226623662466256626662766286629663066316632663366346635663666376638663966406641664266436644664566466647664866496650665166526653665466556656665766586659666066616662666366646665666666676668666966706671667266736674667566766677667866796680668166826683668466856686668766886689669066916692669366946695669666976698669967006701670267036704670567066707670867096710671167126713671467156716671767186719672067216722672367246725672667276728672967306731673267336734673567366737673867396740674167426743674467456746674767486749675067516752675367546755675667576758675967606761676267636764676567666767676867696770677167726773677467756776677767786779678067816782678367846785678667876788678967906791679267936794679567966797679867996800680168026803680468056806680768086809681068116812681368146815681668176818681968206821682268236824682568266827682868296830683168326833683468356836683768386839684068416842684368446845684668476848684968506851685268536854685568566857685868596860686168626863686468656866686768686869687068716872687368746875687668776878687968806881688268836884688568866887688868896890689168926893689468956896689768986899690069016902690369046905690669076908690969106911691269136914691569166917691869196920692169226923692469256926692769286929693069316932693369346935693669376938693969406941694269436944694569466947694869496950695169526953695469556956695769586959696069616962696369646965696669676968696969706971697269736974697569766977697869796980698169826983698469856986698769886989699069916992699369946995699669976998699970007001700270037004700570067007700870097010701170127013701470157016701770187019702070217022702370247025702670277028702970307031703270337034703570367037703870397040704170427043704470457046704770487049705070517052705370547055705670577058705970607061706270637064706570667067706870697070707170727073707470757076707770787079708070817082708370847085708670877088708970907091709270937094709570967097709870997100710171027103710471057106710771087109711071117112711371147115711671177118711971207121712271237124712571267127712871297130713171327133713471357136713771387139714071417142714371447145714671477148714971507151715271537154715571567157715871597160716171627163716471657166716771687169717071717172717371747175717671777178717971807181718271837184718571867187718871897190719171927193719471957196719771987199720072017202720372047205720672077208720972107211721272137214721572167217721872197220722172227223722472257226722772287229723072317232723372347235723672377238723972407241724272437244724572467247724872497250725172527253725472557256725772587259726072617262726372647265726672677268726972707271727272737274727572767277727872797280728172827283728472857286728772887289729072917292729372947295729672977298729973007301730273037304730573067307730873097310731173127313731473157316731773187319732073217322732373247325732673277328732973307331733273337334733573367337733873397340734173427343734473457346734773487349735073517352735373547355735673577358735973607361736273637364736573667367736873697370737173727373737473757376737773787379738073817382738373847385738673877388738973907391739273937394739573967397739873997400740174027403740474057406740774087409741074117412741374147415741674177418741974207421742274237424742574267427742874297430743174327433743474357436743774387439744074417442744374447445744674477448744974507451745274537454745574567457745874597460746174627463746474657466746774687469747074717472747374747475747674777478747974807481748274837484748574867487748874897490749174927493749474957496749774987499750075017502750375047505750675077508750975107511751275137514751575167517751875197520752175227523752475257526752775287529753075317532753375347535753675377538753975407541754275437544754575467547754875497550755175527553755475557556755775587559756075617562756375647565756675677568756975707571757275737574757575767577757875797580758175827583758475857586758775887589759075917592759375947595759675977598759976007601760276037604760576067607760876097610761176127613761476157616761776187619762076217622762376247625762676277628762976307631763276337634763576367637763876397640764176427643764476457646764776487649765076517652765376547655765676577658765976607661766276637664766576667667766876697670767176727673767476757676767776787679768076817682768376847685768676877688768976907691769276937694769576967697769876997700770177027703770477057706770777087709771077117712771377147715771677177718771977207721772277237724772577267727772877297730773177327733773477357736773777387739774077417742774377447745774677477748774977507751775277537754775577567757775877597760776177627763776477657766776777687769777077717772777377747775777677777778777977807781778277837784778577867787778877897790779177927793779477957796779777987799780078017802780378047805780678077808780978107811781278137814781578167817781878197820782178227823782478257826782778287829783078317832783378347835783678377838783978407841784278437844784578467847784878497850785178527853785478557856785778587859786078617862786378647865786678677868786978707871787278737874787578767877787878797880788178827883788478857886788778887889789078917892789378947895789678977898789979007901790279037904790579067907790879097910791179127913791479157916791779187919792079217922792379247925792679277928792979307931793279337934793579367937793879397940794179427943794479457946794779487949795079517952795379547955795679577958795979607961796279637964796579667967796879697970797179727973797479757976797779787979798079817982798379847985798679877988798979907991799279937994799579967997799879998000800180028003800480058006800780088009801080118012801380148015801680178018801980208021802280238024802580268027802880298030803180328033803480358036803780388039804080418042804380448045804680478048804980508051805280538054805580568057805880598060806180628063806480658066806780688069807080718072807380748075807680778078807980808081808280838084808580868087808880898090809180928093809480958096809780988099810081018102810381048105810681078108810981108111811281138114811581168117811881198120812181228123812481258126812781288129813081318132813381348135813681378138813981408141814281438144814581468147814881498150815181528153815481558156815781588159816081618162816381648165816681678168816981708171817281738174817581768177817881798180818181828183818481858186818781888189819081918192819381948195819681978198819982008201820282038204820582068207820882098210821182128213821482158216821782188219822082218222822382248225822682278228822982308231823282338234823582368237823882398240824182428243824482458246824782488249825082518252825382548255825682578258825982608261826282638264826582668267826882698270827182728273827482758276827782788279828082818282828382848285828682878288828982908291829282938294829582968297829882998300830183028303830483058306830783088309831083118312831383148315831683178318831983208321832283238324832583268327832883298330833183328333833483358336833783388339834083418342834383448345834683478348834983508351835283538354835583568357835883598360836183628363836483658366836783688369837083718372837383748375837683778378837983808381838283838384838583868387838883898390839183928393839483958396839783988399840084018402840384048405840684078408840984108411841284138414841584168417841884198420842184228423842484258426842784288429843084318432843384348435843684378438843984408441844284438444844584468447844884498450845184528453845484558456845784588459846084618462846384648465846684678468846984708471847284738474847584768477847884798480848184828483848484858486848784888489849084918492849384948495849684978498849985008501850285038504850585068507850885098510851185128513851485158516851785188519852085218522852385248525852685278528852985308531853285338534853585368537853885398540854185428543854485458546854785488549855085518552855385548555855685578558855985608561856285638564856585668567856885698570857185728573857485758576857785788579858085818582858385848585858685878588858985908591859285938594859585968597859885998600860186028603860486058606860786088609861086118612861386148615861686178618861986208621862286238624862586268627862886298630863186328633863486358636863786388639864086418642864386448645864686478648864986508651865286538654865586568657865886598660866186628663866486658666866786688669867086718672867386748675867686778678867986808681868286838684868586868687868886898690869186928693869486958696869786988699870087018702870387048705870687078708870987108711871287138714871587168717871887198720872187228723872487258726872787288729873087318732873387348735873687378738873987408741874287438744874587468747874887498750875187528753875487558756875787588759876087618762876387648765876687678768876987708771877287738774877587768777877887798780878187828783878487858786878787888789879087918792879387948795879687978798879988008801880288038804880588068807880888098810881188128813881488158816881788188819882088218822882388248825882688278828882988308831883288338834883588368837883888398840884188428843884488458846884788488849885088518852885388548855885688578858885988608861886288638864886588668867886888698870887188728873887488758876887788788879888088818882888388848885888688878888888988908891889288938894889588968897889888998900890189028903890489058906890789088909891089118912891389148915891689178918891989208921892289238924892589268927892889298930893189328933893489358936893789388939894089418942894389448945894689478948894989508951895289538954895589568957895889598960896189628963896489658966896789688969897089718972897389748975897689778978897989808981898289838984898589868987898889898990899189928993899489958996899789988999900090019002900390049005900690079008900990109011901290139014901590169017901890199020902190229023902490259026902790289029903090319032903390349035903690379038903990409041904290439044904590469047904890499050905190529053905490559056905790589059906090619062906390649065906690679068906990709071907290739074907590769077907890799080908190829083908490859086908790889089909090919092909390949095909690979098909991009101910291039104910591069107910891099110911191129113911491159116911791189119912091219122912391249125912691279128912991309131913291339134913591369137913891399140914191429143914491459146914791489149915091519152915391549155915691579158915991609161916291639164916591669167916891699170917191729173917491759176917791789179918091819182918391849185918691879188918991909191919291939194919591969197919891999200920192029203920492059206920792089209921092119212921392149215921692179218921992209221922292239224922592269227922892299230923192329233923492359236923792389239924092419242924392449245924692479248924992509251925292539254925592569257925892599260926192629263926492659266926792689269927092719272927392749275927692779278927992809281928292839284928592869287928892899290929192929293929492959296929792989299930093019302930393049305930693079308930993109311931293139314931593169317931893199320932193229323932493259326932793289329933093319332933393349335933693379338933993409341934293439344934593469347934893499350935193529353935493559356935793589359936093619362936393649365936693679368936993709371937293739374937593769377937893799380938193829383938493859386938793889389939093919392939393949395939693979398939994009401940294039404940594069407940894099410941194129413941494159416941794189419942094219422942394249425942694279428942994309431943294339434943594369437943894399440944194429443944494459446944794489449945094519452945394549455945694579458945994609461946294639464946594669467946894699470947194729473947494759476947794789479948094819482948394849485948694879488948994909491949294939494949594969497949894999500950195029503950495059506950795089509951095119512951395149515951695179518951995209521952295239524952595269527952895299530953195329533953495359536953795389539954095419542954395449545954695479548954995509551955295539554955595569557955895599560956195629563956495659566956795689569957095719572957395749575957695779578957995809581958295839584958595869587958895899590959195929593959495959596959795989599960096019602960396049605960696079608960996109611961296139614961596169617961896199620962196229623962496259626962796289629963096319632963396349635963696379638963996409641964296439644964596469647964896499650965196529653965496559656965796589659966096619662966396649665966696679668966996709671967296739674967596769677967896799680968196829683968496859686968796889689969096919692969396949695969696979698969997009701970297039704970597069707970897099710971197129713971497159716971797189719972097219722972397249725972697279728972997309731973297339734973597369737973897399740974197429743974497459746974797489749975097519752975397549755975697579758975997609761976297639764976597669767976897699770977197729773977497759776977797789779978097819782978397849785978697879788978997909791979297939794979597969797979897999800980198029803980498059806980798089809981098119812981398149815981698179818981998209821982298239824982598269827982898299830983198329833983498359836983798389839984098419842984398449845984698479848984998509851985298539854985598569857985898599860986198629863986498659866986798689869987098719872987398749875987698779878987998809881988298839884988598869887988898899890989198929893989498959896989798989899990099019902990399049905990699079908990999109911991299139914991599169917991899199920992199229923992499259926992799289929993099319932993399349935993699379938993999409941994299439944994599469947994899499950995199529953995499559956995799589959996099619962996399649965996699679968996999709971997299739974997599769977997899799980998199829983998499859986998799889989999099919992999399949995999699979998999910000100011000210003100041000510006100071000810009100101001110012100131001410015100161001710018100191002010021100221002310024100251002610027100281002910030100311003210033100341003510036100371003810039100401004110042100431004410045100461004710048100491005010051100521005310054100551005610057100581005910060100611006210063100641006510066100671006810069100701007110072100731007410075100761007710078100791008010081100821008310084100851008610087100881008910090100911009210093100941009510096100971009810099101001010110102101031010410105101061010710108101091011010111101121011310114101151011610117101181011910120101211012210123101241012510126101271012810129101301013110132101331013410135101361013710138101391014010141101421014310144101451014610147101481014910150101511015210153101541015510156101571015810159101601016110162101631016410165101661016710168101691017010171101721017310174101751017610177101781017910180101811018210183101841018510186101871018810189101901019110192101931019410195101961019710198101991020010201102021020310204102051020610207102081020910210102111021210213102141021510216102171021810219102201022110222102231022410225102261022710228102291023010231102321023310234102351023610237102381023910240102411024210243102441024510246102471024810249102501025110252102531025410255102561025710258102591026010261102621026310264102651026610267102681026910270102711027210273102741027510276102771027810279102801028110282102831028410285102861028710288102891029010291102921029310294102951029610297102981029910300103011030210303103041030510306103071030810309103101031110312103131031410315103161031710318103191032010321103221032310324103251032610327103281032910330103311033210333103341033510336103371033810339103401034110342103431034410345103461034710348103491035010351103521035310354103551035610357103581035910360103611036210363103641036510366103671036810369103701037110372103731037410375103761037710378103791038010381103821038310384103851038610387103881038910390103911039210393103941039510396103971039810399104001040110402104031040410405104061040710408104091041010411104121041310414104151041610417104181041910420104211042210423104241042510426104271042810429104301043110432104331043410435104361043710438104391044010441104421044310444104451044610447104481044910450104511045210453104541045510456104571045810459104601046110462104631046410465104661046710468104691047010471104721047310474104751047610477104781047910480104811048210483104841048510486104871048810489104901049110492104931049410495104961049710498104991050010501105021050310504105051050610507105081050910510105111051210513105141051510516105171051810519105201052110522105231052410525105261052710528105291053010531105321053310534105351053610537105381053910540105411054210543105441054510546105471054810549105501055110552105531055410555105561055710558105591056010561105621056310564105651056610567105681056910570105711057210573105741057510576105771057810579105801058110582105831058410585105861058710588105891059010591105921059310594105951059610597105981059910600106011060210603106041060510606106071060810609106101061110612106131061410615106161061710618106191062010621106221062310624106251062610627106281062910630106311063210633106341063510636106371063810639106401064110642106431064410645106461064710648106491065010651106521065310654106551065610657106581065910660106611066210663106641066510666106671066810669106701067110672106731067410675106761067710678106791068010681106821068310684106851068610687106881068910690106911069210693106941069510696106971069810699107001070110702107031070410705107061070710708107091071010711107121071310714107151071610717107181071910720107211072210723107241072510726107271072810729107301073110732107331073410735107361073710738107391074010741107421074310744107451074610747107481074910750107511075210753107541075510756107571075810759107601076110762107631076410765107661076710768107691077010771107721077310774107751077610777107781077910780107811078210783107841078510786107871078810789107901079110792107931079410795107961079710798107991080010801108021080310804108051080610807108081080910810108111081210813108141081510816108171081810819108201082110822108231082410825108261082710828108291083010831108321083310834108351083610837108381083910840108411084210843108441084510846108471084810849108501085110852108531085410855108561085710858108591086010861108621086310864108651086610867108681086910870108711087210873108741087510876108771087810879108801088110882108831088410885108861088710888108891089010891108921089310894108951089610897108981089910900109011090210903109041090510906109071090810909109101091110912109131091410915109161091710918109191092010921109221092310924109251092610927109281092910930109311093210933109341093510936109371093810939109401094110942109431094410945109461094710948109491095010951109521095310954109551095610957109581095910960109611096210963109641096510966109671096810969109701097110972109731097410975109761097710978109791098010981109821098310984109851098610987109881098910990109911099210993109941099510996109971099810999110001100111002110031100411005110061100711008110091101011011110121101311014110151101611017110181101911020110211102211023110241102511026110271102811029110301103111032110331103411035110361103711038110391104011041110421104311044110451104611047110481104911050110511105211053110541105511056110571105811059110601106111062110631106411065110661106711068110691107011071110721107311074110751107611077110781107911080110811108211083110841108511086110871108811089110901109111092110931109411095110961109711098110991110011101111021110311104111051110611107111081110911110111111111211113111141111511116111171111811119111201112111122111231112411125111261112711128111291113011131111321113311134111351113611137111381113911140111411114211143111441114511146111471114811149111501115111152111531115411155111561115711158111591116011161111621116311164111651116611167111681116911170111711117211173111741117511176111771117811179111801118111182111831118411185111861118711188111891119011191111921119311194111951119611197111981119911200112011120211203112041120511206112071120811209112101121111212112131121411215112161121711218112191122011221112221122311224112251122611227112281122911230112311123211233112341123511236112371123811239112401124111242112431124411245112461124711248112491125011251112521125311254112551125611257112581125911260112611126211263112641126511266112671126811269112701127111272112731127411275112761127711278112791128011281112821128311284112851128611287112881128911290112911129211293112941129511296112971129811299113001130111302113031130411305113061130711308113091131011311113121131311314113151131611317113181131911320113211132211323113241132511326113271132811329113301133111332113331133411335113361133711338113391134011341113421134311344113451134611347113481134911350113511135211353113541135511356113571135811359113601136111362113631136411365113661136711368113691137011371113721137311374113751137611377113781137911380113811138211383113841138511386113871138811389113901139111392113931139411395113961139711398113991140011401114021140311404114051140611407114081140911410114111141211413114141141511416114171141811419114201142111422114231142411425114261142711428114291143011431114321143311434114351143611437114381143911440114411144211443114441144511446114471144811449114501145111452114531145411455114561145711458114591146011461114621146311464114651146611467114681146911470114711147211473114741147511476114771147811479114801148111482114831148411485114861148711488114891149011491114921149311494114951149611497114981149911500115011150211503115041150511506115071150811509115101151111512115131151411515115161151711518115191152011521115221152311524115251152611527115281152911530115311153211533115341153511536115371153811539115401154111542115431154411545115461154711548115491155011551115521155311554115551155611557115581155911560115611156211563115641156511566115671156811569115701157111572115731157411575115761157711578115791158011581115821158311584115851158611587115881158911590115911159211593115941159511596115971159811599116001160111602116031160411605116061160711608116091161011611116121161311614116151161611617116181161911620116211162211623116241162511626116271162811629116301163111632116331163411635116361163711638116391164011641116421164311644116451164611647116481164911650116511165211653116541165511656116571165811659116601166111662116631166411665116661166711668116691167011671116721167311674116751167611677116781167911680116811168211683116841168511686116871168811689116901169111692116931169411695116961169711698116991170011701117021170311704117051170611707117081170911710117111171211713117141171511716117171171811719117201172111722117231172411725117261172711728117291173011731117321173311734117351173611737117381173911740117411174211743117441174511746117471174811749117501175111752117531175411755117561175711758117591176011761117621176311764117651176611767117681176911770117711177211773117741177511776117771177811779117801178111782117831178411785117861178711788117891179011791117921179311794117951179611797117981179911800118011180211803118041180511806118071180811809118101181111812118131181411815118161181711818118191182011821118221182311824118251182611827118281182911830118311183211833118341183511836118371183811839118401184111842118431184411845118461184711848118491185011851118521185311854118551185611857118581185911860118611186211863118641186511866118671186811869118701187111872118731187411875118761187711878118791188011881118821188311884118851188611887118881188911890118911189211893118941189511896118971189811899119001190111902119031190411905119061190711908119091191011911119121191311914119151191611917119181191911920119211192211923119241192511926119271192811929119301193111932119331193411935119361193711938119391194011941119421194311944119451194611947119481194911950119511195211953119541195511956119571195811959119601196111962119631196411965119661196711968119691197011971119721197311974119751197611977119781197911980119811198211983119841198511986119871198811989119901199111992119931199411995119961199711998119991200012001120021200312004120051200612007120081200912010120111201212013120141201512016120171201812019120201202112022120231202412025120261202712028120291203012031120321203312034120351203612037120381203912040120411204212043120441204512046120471204812049120501205112052120531205412055120561205712058120591206012061120621206312064120651206612067120681206912070120711207212073120741207512076120771207812079120801208112082120831208412085120861208712088120891209012091120921209312094120951209612097120981209912100121011210212103121041210512106121071210812109121101211112112121131211412115121161211712118121191212012121121221212312124121251212612127121281212912130121311213212133121341213512136121371213812139121401214112142121431214412145121461214712148121491215012151121521215312154121551215612157121581215912160121611216212163121641216512166121671216812169121701217112172121731217412175121761217712178121791218012181121821218312184121851218612187121881218912190121911219212193121941219512196121971219812199122001220112202122031220412205122061220712208122091221012211122121221312214122151221612217122181221912220122211222212223122241222512226122271222812229122301223112232122331223412235122361223712238122391224012241122421224312244122451224612247122481224912250122511225212253122541225512256122571225812259122601226112262122631226412265122661226712268122691227012271122721227312274122751227612277122781227912280122811228212283122841228512286122871228812289122901229112292122931229412295122961229712298122991230012301123021230312304123051230612307123081230912310123111231212313123141231512316123171231812319123201232112322123231232412325123261232712328123291233012331123321233312334123351233612337123381233912340123411234212343123441234512346123471234812349123501235112352123531235412355123561235712358123591236012361123621236312364123651236612367123681236912370123711237212373123741237512376123771237812379123801238112382123831238412385123861238712388123891239012391123921239312394123951239612397123981239912400124011240212403124041240512406124071240812409124101241112412124131241412415124161241712418124191242012421124221242312424124251242612427124281242912430124311243212433124341243512436124371243812439124401244112442124431244412445124461244712448124491245012451124521245312454124551245612457124581245912460124611246212463124641246512466124671246812469124701247112472124731247412475124761247712478124791248012481124821248312484124851248612487124881248912490124911249212493124941249512496124971249812499125001250112502125031250412505125061250712508125091251012511125121251312514125151251612517125181251912520125211252212523125241252512526125271252812529125301253112532125331253412535125361253712538125391254012541125421254312544125451254612547125481254912550125511255212553125541255512556125571255812559125601256112562125631256412565125661256712568125691257012571125721257312574125751257612577125781257912580125811258212583125841258512586125871258812589125901259112592125931259412595125961259712598125991260012601126021260312604126051260612607126081260912610126111261212613126141261512616126171261812619126201262112622126231262412625126261262712628126291263012631126321263312634126351263612637126381263912640126411264212643126441264512646126471264812649126501265112652126531265412655126561265712658126591266012661126621266312664126651266612667126681266912670126711267212673126741267512676126771267812679126801268112682126831268412685126861268712688126891269012691126921269312694126951269612697126981269912700127011270212703127041270512706127071270812709127101271112712127131271412715127161271712718127191272012721127221272312724127251272612727127281272912730127311273212733127341273512736127371273812739127401274112742127431274412745127461274712748127491275012751127521275312754127551275612757127581275912760127611276212763127641276512766127671276812769127701277112772127731277412775127761277712778127791278012781127821278312784127851278612787127881278912790127911279212793127941279512796127971279812799128001280112802128031280412805128061280712808128091281012811128121281312814128151281612817128181281912820128211282212823128241282512826128271282812829128301283112832128331283412835128361283712838128391284012841128421284312844128451284612847128481284912850128511285212853128541285512856128571285812859128601286112862128631286412865128661286712868128691287012871128721287312874128751287612877128781287912880128811288212883128841288512886128871288812889128901289112892128931289412895128961289712898128991290012901129021290312904129051290612907129081290912910129111291212913129141291512916129171291812919129201292112922129231292412925129261292712928129291293012931129321293312934129351293612937129381293912940129411294212943129441294512946129471294812949129501295112952129531295412955129561295712958129591296012961129621296312964129651296612967129681296912970129711297212973129741297512976129771297812979129801298112982129831298412985129861298712988129891299012991129921299312994129951299612997129981299913000130011300213003130041300513006130071300813009130101301113012130131301413015130161301713018130191302013021130221302313024130251302613027130281302913030130311303213033130341303513036130371303813039130401304113042130431304413045130461304713048130491305013051130521305313054130551305613057130581305913060130611306213063130641306513066130671306813069130701307113072130731307413075130761307713078130791308013081130821308313084130851308613087130881308913090130911309213093130941309513096130971309813099131001310113102131031310413105131061310713108131091311013111131121311313114131151311613117131181311913120131211312213123131241312513126131271312813129131301313113132131331313413135131361313713138131391314013141131421314313144131451314613147131481314913150131511315213153131541315513156131571315813159131601316113162131631316413165131661316713168131691317013171131721317313174131751317613177131781317913180131811318213183131841318513186131871318813189131901319113192131931319413195131961319713198131991320013201132021320313204132051320613207132081320913210132111321213213132141321513216132171321813219132201322113222132231322413225132261322713228132291323013231132321323313234132351323613237132381323913240132411324213243132441324513246132471324813249132501325113252132531325413255132561325713258132591326013261132621326313264132651326613267132681326913270132711327213273132741327513276132771327813279132801328113282132831328413285132861328713288132891329013291132921329313294132951329613297132981329913300133011330213303133041330513306133071330813309133101331113312133131331413315133161331713318133191332013321133221332313324133251332613327133281332913330133311333213333133341333513336133371333813339133401334113342133431334413345133461334713348133491335013351133521335313354133551335613357133581335913360133611336213363133641336513366133671336813369133701337113372133731337413375133761337713378133791338013381133821338313384133851338613387133881338913390133911339213393133941339513396133971339813399134001340113402134031340413405134061340713408134091341013411134121341313414134151341613417134181341913420134211342213423134241342513426134271342813429134301343113432134331343413435134361343713438134391344013441134421344313444134451344613447134481344913450134511345213453134541345513456134571345813459134601346113462134631346413465134661346713468134691347013471134721347313474134751347613477134781347913480134811348213483134841348513486134871348813489134901349113492134931349413495134961349713498134991350013501135021350313504135051350613507135081350913510135111351213513135141351513516135171351813519135201352113522135231352413525135261352713528135291353013531135321353313534135351353613537135381353913540135411354213543135441354513546135471354813549135501355113552135531355413555135561355713558135591356013561135621356313564135651356613567135681356913570135711357213573135741357513576135771357813579135801358113582135831358413585135861358713588135891359013591135921359313594135951359613597135981359913600136011360213603136041360513606136071360813609136101361113612136131361413615136161361713618136191362013621136221362313624136251362613627136281362913630136311363213633136341363513636136371363813639136401364113642136431364413645136461364713648136491365013651136521365313654136551365613657136581365913660136611366213663136641366513666136671366813669136701367113672136731367413675136761367713678136791368013681136821368313684136851368613687136881368913690136911369213693136941369513696136971369813699137001370113702137031370413705137061370713708137091371013711137121371313714137151371613717137181371913720137211372213723137241372513726137271372813729137301373113732137331373413735137361373713738137391374013741137421374313744137451374613747137481374913750137511375213753137541375513756137571375813759137601376113762137631376413765137661376713768137691377013771137721377313774137751377613777137781377913780137811378213783137841378513786137871378813789137901379113792137931379413795137961379713798137991380013801138021380313804138051380613807138081380913810138111381213813138141381513816138171381813819138201382113822138231382413825138261382713828138291383013831138321383313834138351383613837138381383913840138411384213843138441384513846138471384813849138501385113852138531385413855138561385713858138591386013861138621386313864138651386613867138681386913870138711387213873138741387513876138771387813879138801388113882138831388413885138861388713888138891389013891138921389313894138951389613897138981389913900139011390213903139041390513906139071390813909139101391113912139131391413915139161391713918139191392013921139221392313924139251392613927139281392913930139311393213933139341393513936139371393813939139401394113942139431394413945139461394713948139491395013951139521395313954139551395613957139581395913960139611396213963139641396513966139671396813969139701397113972139731397413975139761397713978139791398013981139821398313984139851398613987139881398913990139911399213993139941399513996139971399813999140001400114002140031400414005140061400714008140091401014011140121401314014140151401614017140181401914020140211402214023140241402514026140271402814029140301403114032140331403414035140361403714038140391404014041140421404314044140451404614047140481404914050140511405214053140541405514056140571405814059140601406114062140631406414065140661406714068140691407014071140721407314074140751407614077140781407914080140811408214083140841408514086140871408814089140901409114092140931409414095140961409714098140991410014101141021410314104141051410614107141081410914110141111411214113141141411514116141171411814119141201412114122141231412414125141261412714128141291413014131141321413314134141351413614137141381413914140141411414214143141441414514146141471414814149141501415114152141531415414155141561415714158141591416014161141621416314164141651416614167141681416914170141711417214173141741417514176141771417814179141801418114182141831418414185141861418714188141891419014191141921419314194141951419614197141981419914200142011420214203142041420514206142071420814209142101421114212142131421414215142161421714218142191422014221142221422314224142251422614227142281422914230142311423214233142341423514236142371423814239142401424114242142431424414245142461424714248142491425014251142521425314254142551425614257142581425914260142611426214263142641426514266142671426814269142701427114272142731427414275142761427714278142791428014281142821428314284142851428614287142881428914290142911429214293142941429514296142971429814299143001430114302143031430414305143061430714308143091431014311143121431314314143151431614317143181431914320143211432214323143241432514326143271432814329143301433114332143331433414335143361433714338143391434014341143421434314344143451434614347143481434914350143511435214353143541435514356143571435814359143601436114362143631436414365143661436714368143691437014371143721437314374143751437614377143781437914380143811438214383143841438514386143871438814389143901439114392143931439414395143961439714398143991440014401144021440314404144051440614407144081440914410144111441214413144141441514416144171441814419144201442114422144231442414425144261442714428144291443014431144321443314434144351443614437144381443914440144411444214443144441444514446144471444814449144501445114452144531445414455144561445714458144591446014461144621446314464144651446614467144681446914470144711447214473144741447514476144771447814479144801448114482144831448414485144861448714488144891449014491144921449314494144951449614497144981449914500145011450214503145041450514506145071450814509145101451114512145131451414515145161451714518145191452014521145221452314524145251452614527145281452914530145311453214533145341453514536145371453814539145401454114542145431454414545145461454714548145491455014551145521455314554145551455614557145581455914560145611456214563145641456514566145671456814569145701457114572145731457414575145761457714578145791458014581145821458314584145851458614587145881458914590145911459214593145941459514596145971459814599146001460114602146031460414605146061460714608146091461014611146121461314614146151461614617146181461914620146211462214623146241462514626146271462814629146301463114632146331463414635146361463714638146391464014641146421464314644146451464614647146481464914650146511465214653146541465514656146571465814659146601466114662146631466414665146661466714668146691467014671146721467314674146751467614677146781467914680146811468214683146841468514686146871468814689146901469114692146931469414695146961469714698146991470014701147021470314704147051470614707147081470914710147111471214713147141471514716147171471814719147201472114722147231472414725147261472714728147291473014731147321473314734147351473614737147381473914740147411474214743147441474514746147471474814749147501475114752147531475414755147561475714758147591476014761147621476314764147651476614767147681476914770147711477214773147741477514776147771477814779147801478114782147831478414785147861478714788147891479014791147921479314794147951479614797147981479914800148011480214803148041480514806148071480814809148101481114812148131481414815148161481714818148191482014821148221482314824148251482614827148281482914830148311483214833148341483514836148371483814839148401484114842148431484414845148461484714848148491485014851148521485314854148551485614857148581485914860148611486214863148641486514866148671486814869148701487114872148731487414875148761487714878148791488014881148821488314884148851488614887148881488914890148911489214893148941489514896148971489814899149001490114902149031490414905149061490714908149091491014911149121491314914149151491614917149181491914920149211492214923149241492514926149271492814929149301493114932149331493414935149361493714938149391494014941149421494314944149451494614947149481494914950149511495214953149541495514956149571495814959149601496114962149631496414965149661496714968149691497014971149721497314974149751497614977149781497914980149811498214983149841498514986149871498814989149901499114992149931499414995149961499714998149991500015001150021500315004150051500615007150081500915010150111501215013150141501515016150171501815019150201502115022150231502415025150261502715028150291503015031150321503315034150351503615037150381503915040150411504215043150441504515046150471504815049150501505115052150531505415055150561505715058150591506015061150621506315064150651506615067150681506915070150711507215073150741507515076150771507815079150801508115082150831508415085150861508715088150891509015091150921509315094150951509615097150981509915100151011510215103151041510515106151071510815109151101511115112151131511415115151161511715118151191512015121151221512315124151251512615127151281512915130151311513215133151341513515136151371513815139151401514115142151431514415145151461514715148151491515015151151521515315154151551515615157151581515915160151611516215163151641516515166151671516815169151701517115172151731517415175151761517715178151791518015181151821518315184151851518615187151881518915190151911519215193151941519515196151971519815199152001520115202152031520415205152061520715208152091521015211152121521315214152151521615217152181521915220152211522215223152241522515226152271522815229152301523115232152331523415235152361523715238152391524015241152421524315244152451524615247152481524915250152511525215253152541525515256152571525815259152601526115262152631526415265152661526715268152691527015271152721527315274152751527615277152781527915280152811528215283152841528515286152871528815289152901529115292152931529415295152961529715298152991530015301153021530315304153051530615307153081530915310153111531215313153141531515316153171531815319153201532115322153231532415325153261532715328153291533015331153321533315334153351533615337153381533915340153411534215343153441534515346153471534815349153501535115352153531535415355153561535715358153591536015361153621536315364153651536615367153681536915370153711537215373153741537515376153771537815379153801538115382153831538415385153861538715388153891539015391153921539315394153951539615397153981539915400154011540215403154041540515406154071540815409154101541115412154131541415415154161541715418154191542015421154221542315424154251542615427154281542915430154311543215433154341543515436154371543815439154401544115442154431544415445154461544715448154491545015451154521545315454154551545615457154581545915460154611546215463154641546515466154671546815469154701547115472154731547415475154761547715478154791548015481154821548315484154851548615487154881548915490154911549215493154941549515496154971549815499155001550115502155031550415505155061550715508155091551015511155121551315514155151551615517155181551915520155211552215523155241552515526155271552815529155301553115532155331553415535155361553715538155391554015541155421554315544155451554615547155481554915550155511555215553155541555515556155571555815559155601556115562155631556415565155661556715568155691557015571155721557315574155751557615577155781557915580155811558215583155841558515586155871558815589155901559115592155931559415595155961559715598155991560015601156021560315604156051560615607156081560915610156111561215613156141561515616156171561815619156201562115622156231562415625156261562715628156291563015631156321563315634156351563615637156381563915640156411564215643156441564515646156471564815649156501565115652156531565415655156561565715658156591566015661156621566315664156651566615667156681566915670156711567215673156741567515676156771567815679156801568115682156831568415685156861568715688156891569015691156921569315694156951569615697156981569915700157011570215703157041570515706157071570815709157101571115712157131571415715157161571715718157191572015721157221572315724157251572615727157281572915730157311573215733157341573515736157371573815739157401574115742157431574415745157461574715748157491575015751157521575315754157551575615757157581575915760157611576215763157641576515766157671576815769157701577115772157731577415775157761577715778157791578015781157821578315784157851578615787157881578915790157911579215793157941579515796157971579815799158001580115802158031580415805158061580715808158091581015811158121581315814158151581615817158181581915820158211582215823158241582515826158271582815829158301583115832158331583415835158361583715838158391584015841158421584315844158451584615847158481584915850158511585215853158541585515856158571585815859158601586115862158631586415865158661586715868158691587015871158721587315874158751587615877158781587915880158811588215883158841588515886158871588815889158901589115892158931589415895158961589715898158991590015901159021590315904159051590615907159081590915910159111591215913159141591515916159171591815919159201592115922159231592415925159261592715928159291593015931159321593315934159351593615937159381593915940159411594215943159441594515946159471594815949159501595115952159531595415955159561595715958159591596015961159621596315964159651596615967159681596915970159711597215973159741597515976159771597815979159801598115982159831598415985159861598715988159891599015991159921599315994159951599615997159981599916000160011600216003160041600516006160071600816009160101601116012160131601416015160161601716018160191602016021160221602316024160251602616027160281602916030160311603216033160341603516036160371603816039160401604116042160431604416045160461604716048160491605016051160521605316054160551605616057160581605916060160611606216063160641606516066160671606816069160701607116072160731607416075160761607716078160791608016081160821608316084160851608616087160881608916090160911609216093160941609516096160971609816099161001610116102161031610416105161061610716108161091611016111161121611316114161151611616117161181611916120161211612216123161241612516126161271612816129161301613116132161331613416135161361613716138161391614016141161421614316144161451614616147161481614916150161511615216153161541615516156161571615816159161601616116162161631616416165161661616716168161691617016171161721617316174161751617616177161781617916180161811618216183161841618516186161871618816189161901619116192161931619416195161961619716198161991620016201162021620316204162051620616207162081620916210162111621216213162141621516216162171621816219162201622116222162231622416225162261622716228162291623016231162321623316234162351623616237162381623916240162411624216243162441624516246162471624816249162501625116252162531625416255162561625716258162591626016261162621626316264162651626616267162681626916270162711627216273162741627516276162771627816279162801628116282162831628416285162861628716288162891629016291162921629316294162951629616297162981629916300163011630216303163041630516306163071630816309163101631116312163131631416315163161631716318163191632016321163221632316324163251632616327163281632916330163311633216333163341633516336163371633816339163401634116342163431634416345163461634716348163491635016351163521635316354163551635616357163581635916360163611636216363163641636516366163671636816369163701637116372163731637416375163761637716378163791638016381163821638316384163851638616387163881638916390163911639216393163941639516396163971639816399164001640116402164031640416405164061640716408164091641016411164121641316414164151641616417164181641916420164211642216423164241642516426164271642816429164301643116432164331643416435164361643716438164391644016441164421644316444164451644616447164481644916450164511645216453164541645516456164571645816459164601646116462164631646416465164661646716468164691647016471164721647316474164751647616477164781647916480164811648216483164841648516486164871648816489164901649116492164931649416495164961649716498164991650016501165021650316504165051650616507165081650916510165111651216513165141651516516165171651816519165201652116522165231652416525165261652716528165291653016531165321653316534165351653616537165381653916540165411654216543165441654516546165471654816549165501655116552165531655416555165561655716558165591656016561165621656316564165651656616567165681656916570165711657216573165741657516576165771657816579165801658116582165831658416585165861658716588165891659016591165921659316594165951659616597165981659916600166011660216603166041660516606166071660816609166101661116612166131661416615166161661716618166191662016621166221662316624166251662616627166281662916630166311663216633166341663516636166371663816639166401664116642166431664416645166461664716648166491665016651166521665316654166551665616657166581665916660166611666216663166641666516666166671666816669166701667116672166731667416675166761667716678166791668016681166821668316684166851668616687166881668916690166911669216693166941669516696166971669816699167001670116702167031670416705167061670716708167091671016711167121671316714167151671616717167181671916720167211672216723167241672516726167271672816729167301673116732167331673416735167361673716738167391674016741167421674316744167451674616747167481674916750167511675216753167541675516756167571675816759167601676116762167631676416765167661676716768167691677016771167721677316774167751677616777167781677916780167811678216783167841678516786167871678816789167901679116792167931679416795167961679716798167991680016801168021680316804168051680616807168081680916810168111681216813168141681516816168171681816819168201682116822168231682416825168261682716828168291683016831168321683316834168351683616837168381683916840168411684216843168441684516846168471684816849168501685116852168531685416855168561685716858168591686016861168621686316864168651686616867168681686916870168711687216873168741687516876168771687816879168801688116882168831688416885168861688716888168891689016891168921689316894168951689616897168981689916900169011690216903169041690516906169071690816909169101691116912169131691416915169161691716918169191692016921169221692316924169251692616927169281692916930169311693216933169341693516936169371693816939169401694116942169431694416945169461694716948169491695016951169521695316954169551695616957169581695916960169611696216963169641696516966169671696816969169701697116972169731697416975169761697716978169791698016981169821698316984169851698616987169881698916990169911699216993169941699516996169971699816999170001700117002170031700417005170061700717008170091701017011170121701317014170151701617017170181701917020170211702217023170241702517026170271702817029170301703117032170331703417035170361703717038170391704017041170421704317044170451704617047170481704917050170511705217053170541705517056170571705817059170601706117062170631706417065170661706717068170691707017071170721707317074170751707617077170781707917080170811708217083170841708517086170871708817089170901709117092170931709417095170961709717098170991710017101171021710317104171051710617107171081710917110171111711217113171141711517116171171711817119171201712117122171231712417125171261712717128171291713017131171321713317134171351713617137171381713917140171411714217143171441714517146171471714817149171501715117152171531715417155171561715717158171591716017161171621716317164171651716617167171681716917170171711717217173171741717517176171771717817179171801718117182171831718417185171861718717188171891719017191171921719317194171951719617197171981719917200172011720217203172041720517206172071720817209172101721117212172131721417215172161721717218172191722017221172221722317224172251722617227172281722917230172311723217233172341723517236172371723817239172401724117242172431724417245172461724717248172491725017251172521725317254172551725617257172581725917260172611726217263172641726517266172671726817269172701727117272172731727417275172761727717278172791728017281172821728317284172851728617287172881728917290172911729217293172941729517296172971729817299173001730117302173031730417305173061730717308173091731017311173121731317314173151731617317173181731917320173211732217323173241732517326173271732817329173301733117332173331733417335173361733717338173391734017341173421734317344173451734617347173481734917350173511735217353173541735517356173571735817359173601736117362173631736417365173661736717368173691737017371173721737317374173751737617377173781737917380173811738217383173841738517386173871738817389173901739117392173931739417395173961739717398173991740017401174021740317404174051740617407174081740917410174111741217413174141741517416174171741817419174201742117422174231742417425174261742717428174291743017431174321743317434174351743617437174381743917440174411744217443174441744517446174471744817449174501745117452174531745417455174561745717458174591746017461174621746317464174651746617467174681746917470174711747217473174741747517476174771747817479174801748117482174831748417485174861748717488174891749017491174921749317494174951749617497174981749917500175011750217503175041750517506175071750817509175101751117512175131751417515175161751717518175191752017521175221752317524175251752617527175281752917530175311753217533175341753517536175371753817539175401754117542175431754417545175461754717548175491755017551175521755317554175551755617557175581755917560175611756217563175641756517566175671756817569175701757117572175731757417575175761757717578175791758017581175821758317584175851758617587175881758917590175911759217593175941759517596175971759817599176001760117602176031760417605176061760717608176091761017611176121761317614176151761617617176181761917620176211762217623176241762517626176271762817629176301763117632176331763417635176361763717638176391764017641176421764317644176451764617647176481764917650176511765217653176541765517656176571765817659176601766117662176631766417665176661766717668176691767017671176721767317674176751767617677176781767917680176811768217683176841768517686176871768817689176901769117692176931769417695176961769717698176991770017701177021770317704177051770617707177081770917710177111771217713177141771517716177171771817719177201772117722177231772417725177261772717728177291773017731177321773317734177351773617737177381773917740177411774217743177441774517746177471774817749177501775117752177531775417755177561775717758177591776017761177621776317764177651776617767177681776917770177711777217773177741777517776177771777817779177801778117782177831778417785177861778717788177891779017791177921779317794177951779617797177981779917800178011780217803178041780517806178071780817809178101781117812178131781417815178161781717818178191782017821178221782317824178251782617827178281782917830178311783217833178341783517836178371783817839178401784117842178431784417845178461784717848178491785017851178521785317854178551785617857178581785917860178611786217863178641786517866178671786817869178701787117872178731787417875178761787717878178791788017881178821788317884178851788617887178881788917890178911789217893178941789517896178971789817899179001790117902179031790417905179061790717908179091791017911179121791317914179151791617917179181791917920179211792217923179241792517926179271792817929179301793117932179331793417935179361793717938179391794017941179421794317944179451794617947179481794917950179511795217953179541795517956179571795817959179601796117962179631796417965179661796717968179691797017971179721797317974179751797617977179781797917980179811798217983179841798517986179871798817989179901799117992179931799417995179961799717998179991800018001180021800318004180051800618007180081800918010180111801218013180141801518016180171801818019180201802118022180231802418025180261802718028180291803018031180321803318034180351803618037180381803918040180411804218043180441804518046180471804818049180501805118052180531805418055180561805718058180591806018061180621806318064180651806618067180681806918070180711807218073180741807518076180771807818079180801808118082180831808418085180861808718088180891809018091180921809318094180951809618097180981809918100181011810218103181041810518106181071810818109181101811118112181131811418115181161811718118181191812018121181221812318124181251812618127181281812918130181311813218133181341813518136181371813818139181401814118142181431814418145181461814718148181491815018151181521815318154181551815618157181581815918160181611816218163181641816518166181671816818169181701817118172181731817418175181761817718178181791818018181181821818318184181851818618187181881818918190181911819218193181941819518196181971819818199182001820118202182031820418205182061820718208182091821018211182121821318214182151821618217182181821918220182211822218223182241822518226182271822818229182301823118232182331823418235182361823718238182391824018241182421824318244182451824618247182481824918250182511825218253182541825518256182571825818259182601826118262182631826418265182661826718268182691827018271182721827318274182751827618277182781827918280182811828218283182841828518286182871828818289182901829118292182931829418295182961829718298182991830018301183021830318304183051830618307183081830918310183111831218313183141831518316183171831818319183201832118322183231832418325183261832718328183291833018331183321833318334183351833618337183381833918340183411834218343183441834518346183471834818349183501835118352183531835418355183561835718358183591836018361183621836318364183651836618367183681836918370183711837218373183741837518376183771837818379183801838118382183831838418385183861838718388183891839018391183921839318394183951839618397183981839918400184011840218403184041840518406184071840818409184101841118412184131841418415184161841718418184191842018421184221842318424184251842618427184281842918430184311843218433184341843518436184371843818439184401844118442184431844418445184461844718448184491845018451184521845318454184551845618457184581845918460184611846218463184641846518466184671846818469184701847118472184731847418475184761847718478184791848018481184821848318484184851848618487184881848918490184911849218493184941849518496184971849818499185001850118502185031850418505185061850718508185091851018511185121851318514185151851618517185181851918520185211852218523185241852518526185271852818529185301853118532185331853418535185361853718538185391854018541185421854318544185451854618547185481854918550185511855218553185541855518556185571855818559185601856118562185631856418565185661856718568185691857018571185721857318574185751857618577185781857918580185811858218583185841858518586185871858818589185901859118592185931859418595185961859718598185991860018601186021860318604186051860618607186081860918610186111861218613186141861518616186171861818619186201862118622186231862418625186261862718628186291863018631186321863318634186351863618637186381863918640186411864218643186441864518646186471864818649186501865118652186531865418655186561865718658186591866018661186621866318664186651866618667186681866918670186711867218673186741867518676186771867818679186801868118682186831868418685186861868718688186891869018691186921869318694186951869618697186981869918700187011870218703187041870518706187071870818709187101871118712187131871418715187161871718718187191872018721187221872318724187251872618727187281872918730187311873218733187341873518736187371873818739187401874118742187431874418745187461874718748187491875018751187521875318754187551875618757187581875918760187611876218763187641876518766187671876818769187701877118772187731877418775187761877718778187791878018781187821878318784187851878618787187881878918790187911879218793187941879518796187971879818799188001880118802188031880418805188061880718808188091881018811188121881318814188151881618817188181881918820188211882218823188241882518826188271882818829188301883118832188331883418835188361883718838188391884018841188421884318844188451884618847188481884918850188511885218853188541885518856188571885818859188601886118862188631886418865188661886718868188691887018871188721887318874188751887618877188781887918880188811888218883188841888518886188871888818889188901889118892188931889418895188961889718898188991890018901189021890318904189051890618907189081890918910189111891218913189141891518916189171891818919189201892118922189231892418925189261892718928189291893018931189321893318934189351893618937189381893918940189411894218943189441894518946189471894818949189501895118952189531895418955189561895718958189591896018961189621896318964189651896618967189681896918970189711897218973189741897518976189771897818979189801898118982189831898418985189861898718988189891899018991189921899318994189951899618997189981899919000190011900219003190041900519006190071900819009190101901119012190131901419015190161901719018190191902019021190221902319024190251902619027190281902919030190311903219033190341903519036190371903819039190401904119042190431904419045190461904719048190491905019051190521905319054190551905619057190581905919060190611906219063190641906519066190671906819069190701907119072190731907419075190761907719078190791908019081190821908319084190851908619087190881908919090190911909219093190941909519096190971909819099191001910119102191031910419105191061910719108191091911019111191121911319114191151911619117191181911919120191211912219123191241912519126191271912819129191301913119132191331913419135191361913719138191391914019141191421914319144191451914619147191481914919150191511915219153191541915519156191571915819159191601916119162191631916419165191661916719168191691917019171191721917319174191751917619177191781917919180191811918219183191841918519186191871918819189191901919119192191931919419195191961919719198191991920019201192021920319204192051920619207192081920919210192111921219213192141921519216192171921819219192201922119222192231922419225192261922719228192291923019231192321923319234192351923619237192381923919240192411924219243192441924519246192471924819249192501925119252192531925419255192561925719258192591926019261192621926319264192651926619267192681926919270192711927219273192741927519276192771927819279192801928119282192831928419285192861928719288192891929019291192921929319294192951929619297192981929919300193011930219303193041930519306193071930819309193101931119312193131931419315193161931719318193191932019321193221932319324193251932619327193281932919330193311933219333193341933519336193371933819339193401934119342193431934419345193461934719348193491935019351193521935319354193551935619357
  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: String,
  21. label: String,
  22. classButton: String
  23. },
  24. setup: function setup(__props, _ref) {
  25. var expose = _ref.expose;
  26. expose();
  27. var __returned__ = {
  28. Link: _inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_0__.Link
  29. };
  30. Object.defineProperty(__returned__, '__isScriptSetup', {
  31. enumerable: false,
  32. value: true
  33. });
  34. return __returned__;
  35. }
  36. });
  37. /***/ }),
  38. /***/ "./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":
  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. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  43. "use strict";
  44. __webpack_require__.r(__webpack_exports__);
  45. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  46. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  47. /* harmony export */ });
  48. /* harmony import */ var _inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @inertiajs/inertia-vue3 */ "./node_modules/@inertiajs/inertia-vue3/dist/index.js");
  49. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
  50. __name: 'AppMessage',
  51. setup: function setup(__props, _ref) {
  52. var expose = _ref.expose;
  53. expose();
  54. var onClose = function onClose() {
  55. (0,_inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_0__.usePage)().props.value.errors = {};
  56. (0,_inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_0__.usePage)().props.value.flash.success = null;
  57. (0,_inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_0__.usePage)().props.value.flash.error = null;
  58. };
  59. var __returned__ = {
  60. onClose: onClose,
  61. usePage: _inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_0__.usePage
  62. };
  63. Object.defineProperty(__returned__, '__isScriptSetup', {
  64. enumerable: false,
  65. value: true
  66. });
  67. return __returned__;
  68. }
  69. });
  70. /***/ }),
  71. /***/ "./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":
  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. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  76. "use strict";
  77. __webpack_require__.r(__webpack_exports__);
  78. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  79. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  80. /* harmony export */ });
  81. /* harmony import */ var _inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @inertiajs/inertia-vue3 */ "./node_modules/@inertiajs/inertia-vue3/dist/index.js");
  82. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
  83. __name: 'AppPagination',
  84. props: {
  85. links: Array
  86. },
  87. setup: function setup(__props, _ref) {
  88. var expose = _ref.expose;
  89. expose();
  90. var __returned__ = {
  91. Link: _inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_0__.Link
  92. };
  93. Object.defineProperty(__returned__, '__isScriptSetup', {
  94. enumerable: false,
  95. value: true
  96. });
  97. return __returned__;
  98. }
  99. });
  100. /***/ }),
  101. /***/ "./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":
  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. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  106. "use strict";
  107. __webpack_require__.r(__webpack_exports__);
  108. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  109. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  110. /* harmony export */ });
  111. /* harmony import */ var _components_AppSubSidebar_vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @/components/AppSubSidebar.vue */ "./resources/js/components/AppSubSidebar.vue");
  112. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
  113. __name: 'AppSidebar',
  114. props: {
  115. menu: Array
  116. },
  117. setup: function setup(__props, _ref) {
  118. var expose = _ref.expose;
  119. expose();
  120. var __returned__ = {
  121. AppSubSidebar: _components_AppSubSidebar_vue__WEBPACK_IMPORTED_MODULE_0__["default"]
  122. };
  123. Object.defineProperty(__returned__, '__isScriptSetup', {
  124. enumerable: false,
  125. value: true
  126. });
  127. return __returned__;
  128. }
  129. });
  130. /***/ }),
  131. /***/ "./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":
  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. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  136. "use strict";
  137. __webpack_require__.r(__webpack_exports__);
  138. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  139. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  140. /* harmony export */ });
  141. /* harmony import */ var _inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @inertiajs/inertia-vue3 */ "./node_modules/@inertiajs/inertia-vue3/dist/index.js");
  142. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
  143. __name: 'AppSubSidebar',
  144. props: {
  145. items: Array,
  146. root: {
  147. type: Boolean,
  148. "default": false
  149. }
  150. },
  151. setup: function setup(__props, _ref) {
  152. var expose = _ref.expose;
  153. expose();
  154. var __returned__ = {
  155. Link: _inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_0__.Link
  156. };
  157. Object.defineProperty(__returned__, '__isScriptSetup', {
  158. enumerable: false,
  159. value: true
  160. });
  161. return __returned__;
  162. }
  163. });
  164. /***/ }),
  165. /***/ "./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":
  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. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  170. "use strict";
  171. __webpack_require__.r(__webpack_exports__);
  172. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  173. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  174. /* harmony export */ });
  175. /* harmony import */ var _inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @inertiajs/inertia-vue3 */ "./node_modules/@inertiajs/inertia-vue3/dist/index.js");
  176. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
  177. __name: 'AppTopBar',
  178. emits: ['menu-toggle'],
  179. setup: function setup(__props, _ref) {
  180. var expose = _ref.expose;
  181. expose();
  182. var __returned__ = {
  183. Link: _inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_0__.Link
  184. };
  185. Object.defineProperty(__returned__, '__isScriptSetup', {
  186. enumerable: false,
  187. value: true
  188. });
  189. return __returned__;
  190. }
  191. });
  192. /***/ }),
  193. /***/ "./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":
  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. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  198. "use strict";
  199. __webpack_require__.r(__webpack_exports__);
  200. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  201. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  202. /* harmony export */ });
  203. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  204. /* harmony import */ var _components_AppTopBar_vue__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @/components/AppTopBar.vue */ "./resources/js/components/AppTopBar.vue");
  205. /* harmony import */ var _components_AppSidebar_vue__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @/components/AppSidebar.vue */ "./resources/js/components/AppSidebar.vue");
  206. /* harmony import */ var _components_AppFooter_vue__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @/components/AppFooter.vue */ "./resources/js/components/AppFooter.vue");
  207. /* harmony import */ var _components_AppMessage_vue__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @/components/AppMessage.vue */ "./resources/js/components/AppMessage.vue");
  208. /* harmony import */ var _utils_menu__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @/utils/menu */ "./resources/js/utils/menu.js");
  209. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
  210. __name: 'DashboardLayout',
  211. setup: function setup(__props, _ref) {
  212. var expose = _ref.expose;
  213. expose();
  214. var mobileMenuActive = (0,vue__WEBPACK_IMPORTED_MODULE_0__.ref)(false);
  215. var staticMenuInactive = (0,vue__WEBPACK_IMPORTED_MODULE_0__.ref)(false);
  216. var menuClick = (0,vue__WEBPACK_IMPORTED_MODULE_0__.ref)(false);
  217. var isDesktop = function isDesktop() {
  218. return window.innerWidth >= 992;
  219. };
  220. var containerClass = (0,vue__WEBPACK_IMPORTED_MODULE_0__.computed)(function () {
  221. return ['layout-wrapper', {
  222. 'layout-static-sidebar-inactive': staticMenuInactive.value,
  223. 'layout-mobile-sidebar-active': mobileMenuActive.value
  224. }];
  225. });
  226. var onWrapperClick = function onWrapperClick() {
  227. if (!menuClick.value) {
  228. mobileMenuActive.value = false;
  229. }
  230. menuClick.value = false;
  231. };
  232. var onMenuToggle = function onMenuToggle(event) {
  233. menuClick.value = true;
  234. if (isDesktop()) {
  235. staticMenuInactive.value = !staticMenuInactive.value;
  236. } else {
  237. mobileMenuActive.value = !mobileMenuActive.value;
  238. }
  239. event.preventDefault();
  240. };
  241. var __returned__ = {
  242. mobileMenuActive: mobileMenuActive,
  243. staticMenuInactive: staticMenuInactive,
  244. menuClick: menuClick,
  245. isDesktop: isDesktop,
  246. containerClass: containerClass,
  247. onWrapperClick: onWrapperClick,
  248. onMenuToggle: onMenuToggle,
  249. ref: vue__WEBPACK_IMPORTED_MODULE_0__.ref,
  250. computed: vue__WEBPACK_IMPORTED_MODULE_0__.computed,
  251. AppTopBar: _components_AppTopBar_vue__WEBPACK_IMPORTED_MODULE_1__["default"],
  252. AppSidebar: _components_AppSidebar_vue__WEBPACK_IMPORTED_MODULE_2__["default"],
  253. AppFooter: _components_AppFooter_vue__WEBPACK_IMPORTED_MODULE_3__["default"],
  254. AppMessage: _components_AppMessage_vue__WEBPACK_IMPORTED_MODULE_4__["default"],
  255. menu: _utils_menu__WEBPACK_IMPORTED_MODULE_5__["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-label"
  362. };
  363. function render(_ctx, _cache, $props, $setup, $data, $options) {
  364. return $props.inertiaLink ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createBlock)($setup["Link"], {
  365. key: 0,
  366. "class": "p-button p-component",
  367. as: "button",
  368. type: "button"
  369. }, {
  370. "default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  371. return [$props.icon ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)("span", {
  372. key: 0,
  373. "class": (0,vue__WEBPACK_IMPORTED_MODULE_0__.normalizeClass)(["p-button-icon p-button-icon-left", $props.icon])
  374. }, null, 2
  375. /* CLASS */
  376. )) : (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
  377. /* TEXT */
  378. )) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true)];
  379. }),
  380. _: 1
  381. /* STABLE */
  382. })) : ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)("a", {
  383. key: 1,
  384. "class": (0,vue__WEBPACK_IMPORTED_MODULE_0__.normalizeClass)([$props.classButton, "p-button p-component"])
  385. }, [$props.icon ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)("span", {
  386. key: 0,
  387. "class": (0,vue__WEBPACK_IMPORTED_MODULE_0__.normalizeClass)(["p-button-icon p-button-icon-left", $props.icon])
  388. }, null, 2
  389. /* CLASS */
  390. )) : (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_2, (0,vue__WEBPACK_IMPORTED_MODULE_0__.toDisplayString)($props.label), 1
  391. /* TEXT */
  392. )) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true)], 2
  393. /* CLASS */
  394. ));
  395. }
  396. /***/ }),
  397. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppFooter.vue?vue&type=template&id=4ab6097e&scoped=true":
  398. /*!*******************************************************************************************************************************************************************************************************************************************************************************************!*\
  399. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppFooter.vue?vue&type=template&id=4ab6097e&scoped=true ***!
  400. \*******************************************************************************************************************************************************************************************************************************************************************************************/
  401. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  402. "use strict";
  403. __webpack_require__.r(__webpack_exports__);
  404. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  405. /* harmony export */ "render": () => (/* binding */ render)
  406. /* harmony export */ });
  407. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  408. var _withScopeId = function _withScopeId(n) {
  409. return (0,vue__WEBPACK_IMPORTED_MODULE_0__.pushScopeId)("data-v-4ab6097e"), n = n(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.popScopeId)(), n;
  410. };
  411. var _hoisted_1 = {
  412. "class": "layout-footer"
  413. };
  414. var _hoisted_2 = /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createTextVNode)(" Developed by ");
  415. var _hoisted_3 = /*#__PURE__*/_withScopeId(function () {
  416. return /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("a", {
  417. href: "https://dijitalcode.com",
  418. target: "_blank",
  419. "class": "font-medium ml-2"
  420. }, "DijitalCODE", -1
  421. /* HOISTED */
  422. );
  423. });
  424. var _hoisted_4 = [_hoisted_2, _hoisted_3];
  425. function render(_ctx, _cache) {
  426. return (0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)("div", _hoisted_1, _hoisted_4);
  427. }
  428. /***/ }),
  429. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppMessage.vue?vue&type=template&id=07159051":
  430. /*!********************************************************************************************************************************************************************************************************************************************************************************!*\
  431. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.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 ***!
  432. \********************************************************************************************************************************************************************************************************************************************************************************/
  433. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  434. "use strict";
  435. __webpack_require__.r(__webpack_exports__);
  436. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  437. /* harmony export */ "render": () => (/* binding */ render)
  438. /* harmony export */ });
  439. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  440. var _hoisted_1 = {
  441. key: 0
  442. };
  443. var _hoisted_2 = {
  444. key: 1
  445. };
  446. function render(_ctx, _cache, $props, $setup, $data, $options) {
  447. var _component_Message = (0,vue__WEBPACK_IMPORTED_MODULE_0__.resolveComponent)("Message");
  448. 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, {
  449. key: 0,
  450. severity: "success",
  451. onClose: $setup.onClose
  452. }, {
  453. "default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  454. return [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createTextVNode)((0,vue__WEBPACK_IMPORTED_MODULE_0__.toDisplayString)(_ctx.$page.props.flash.success), 1
  455. /* TEXT */
  456. )];
  457. }),
  458. _: 1
  459. /* STABLE */
  460. })) : (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, {
  461. key: 1,
  462. severity: "error",
  463. onClose: $setup.onClose
  464. }, {
  465. "default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  466. return [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createTextVNode)((0,vue__WEBPACK_IMPORTED_MODULE_0__.toDisplayString)(_ctx.$page.props.flash.error), 1
  467. /* TEXT */
  468. )];
  469. }),
  470. _: 1
  471. /* STABLE */
  472. })) : (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, {
  473. key: 2,
  474. severity: "error",
  475. onClose: $setup.onClose
  476. }, {
  477. "default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  478. 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
  479. /* TEXT */
  480. ))];
  481. }),
  482. _: 1
  483. /* STABLE */
  484. })) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true)], 64
  485. /* STABLE_FRAGMENT */
  486. );
  487. }
  488. /***/ }),
  489. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.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":
  490. /*!***********************************************************************************************************************************************************************************************************************************************************************************!*\
  491. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.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 ***!
  492. \***********************************************************************************************************************************************************************************************************************************************************************************/
  493. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  494. "use strict";
  495. __webpack_require__.r(__webpack_exports__);
  496. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  497. /* harmony export */ "render": () => (/* binding */ render)
  498. /* harmony export */ });
  499. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  500. var _hoisted_1 = {
  501. key: 0,
  502. "class": "p-paginator p-component flex justify-content-start"
  503. };
  504. var _hoisted_2 = {
  505. "class": "p-paginator-pages"
  506. };
  507. var _hoisted_3 = ["innerHTML"];
  508. function render(_ctx, _cache, $props, $setup, $data, $options) {
  509. 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) {
  510. 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", {
  511. key: "link-".concat(key),
  512. "class": (0,vue__WEBPACK_IMPORTED_MODULE_0__.normalizeClass)(["p-paginator-page p-paginator-element p-link", {
  513. 'p-disabled': link
  514. }]),
  515. innerHTML: link.label
  516. }, null, 10
  517. /* CLASS, PROPS */
  518. , _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"], {
  519. key: "link-".concat(key),
  520. href: link.url,
  521. "class": (0,vue__WEBPACK_IMPORTED_MODULE_0__.normalizeClass)([{
  522. 'p-highlight': link.active
  523. }, "p-paginator-page p-paginator-element p-link"]),
  524. innerHTML: link.label
  525. }, null, 8
  526. /* PROPS */
  527. , ["href", "class", "innerHTML"])) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true)], 64
  528. /* STABLE_FRAGMENT */
  529. );
  530. }), 256
  531. /* UNKEYED_FRAGMENT */
  532. ))])])) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true);
  533. }
  534. /***/ }),
  535. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.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":
  536. /*!********************************************************************************************************************************************************************************************************************************************************************************************!*\
  537. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.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 ***!
  538. \********************************************************************************************************************************************************************************************************************************************************************************************/
  539. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  540. "use strict";
  541. __webpack_require__.r(__webpack_exports__);
  542. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  543. /* harmony export */ "render": () => (/* binding */ render)
  544. /* harmony export */ });
  545. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  546. function render(_ctx, _cache, $props, $setup, $data, $options) {
  547. 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"], {
  548. "class": "layout-menu",
  549. items: $props.menu,
  550. root: true
  551. }, null, 8
  552. /* PROPS */
  553. , ["items"])]);
  554. }
  555. /***/ }),
  556. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.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":
  557. /*!***********************************************************************************************************************************************************************************************************************************************************************************************!*\
  558. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.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 ***!
  559. \***********************************************************************************************************************************************************************************************************************************************************************************************/
  560. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  561. "use strict";
  562. __webpack_require__.r(__webpack_exports__);
  563. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  564. /* harmony export */ "render": () => (/* binding */ render)
  565. /* harmony export */ });
  566. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  567. var _withScopeId = function _withScopeId(n) {
  568. return (0,vue__WEBPACK_IMPORTED_MODULE_0__.pushScopeId)("data-v-0addd9bc"), n = n(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.popScopeId)(), n;
  569. };
  570. var _hoisted_1 = {
  571. key: 0
  572. };
  573. var _hoisted_2 = ["aria-label"];
  574. var _hoisted_3 = ["aria-label"];
  575. function render(_ctx, _cache, $props, $setup, $data, $options) {
  576. var _component_AppSubSidebar = (0,vue__WEBPACK_IMPORTED_MODULE_0__.resolveComponent)("AppSubSidebar", true);
  577. 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) {
  578. 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", {
  579. key: i,
  580. "class": (0,vue__WEBPACK_IMPORTED_MODULE_0__.normalizeClass)([{
  581. 'layout-menuitem-category': $props.root
  582. }]),
  583. role: "none"
  584. }, [$props.root ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)(vue__WEBPACK_IMPORTED_MODULE_0__.Fragment, {
  585. key: 0
  586. }, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("div", {
  587. "class": "layout-menuitem-root-text",
  588. "aria-label": item.label
  589. }, (0,vue__WEBPACK_IMPORTED_MODULE_0__.toDisplayString)(item.label), 9
  590. /* TEXT, PROPS */
  591. , _hoisted_2), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(_component_AppSubSidebar, {
  592. items: item.items
  593. }, null, 8
  594. /* PROPS */
  595. , ["items"])], 64
  596. /* STABLE_FRAGMENT */
  597. )) : ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)(vue__WEBPACK_IMPORTED_MODULE_0__.Fragment, {
  598. key: 1
  599. }, [item.to ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createBlock)($setup["Link"], {
  600. key: 0,
  601. role: "menuitem",
  602. href: item.to,
  603. "class": (0,vue__WEBPACK_IMPORTED_MODULE_0__.normalizeClass)([{
  604. 'router-link-active': _ctx.$page.component.startsWith(item.component) || _ctx.$page.url.startsWith(item.to),
  605. 'router-link-exact-active': _ctx.$page.component.startsWith(item.component) || _ctx.$page.url.startsWith(item.to)
  606. }]),
  607. "aria-label": item.label
  608. }, {
  609. "default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  610. return [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("i", {
  611. "class": (0,vue__WEBPACK_IMPORTED_MODULE_0__.normalizeClass)(item.icon)
  612. }, null, 2
  613. /* CLASS */
  614. ), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("span", null, (0,vue__WEBPACK_IMPORTED_MODULE_0__.toDisplayString)(item.label), 1
  615. /* TEXT */
  616. )];
  617. }),
  618. _: 2
  619. /* DYNAMIC */
  620. }, 1032
  621. /* PROPS, DYNAMIC_SLOTS */
  622. , ["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", {
  623. key: 1,
  624. href: "#",
  625. role: "menuitem",
  626. "aria-label": item.label
  627. }, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("i", {
  628. "class": (0,vue__WEBPACK_IMPORTED_MODULE_0__.normalizeClass)(item.icon)
  629. }, null, 2
  630. /* CLASS */
  631. ), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("span", null, (0,vue__WEBPACK_IMPORTED_MODULE_0__.toDisplayString)(item.label), 1
  632. /* TEXT */
  633. )], 8
  634. /* PROPS */
  635. , _hoisted_3)) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(_component_AppSubSidebar, {
  636. items: item.items
  637. }, null, 8
  638. /* PROPS */
  639. , ["items"])], 64
  640. /* STABLE_FRAGMENT */
  641. ))], 2
  642. /* CLASS */
  643. )) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true)], 64
  644. /* STABLE_FRAGMENT */
  645. );
  646. }), 256
  647. /* UNKEYED_FRAGMENT */
  648. ))])) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true);
  649. }
  650. /***/ }),
  651. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.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":
  652. /*!*******************************************************************************************************************************************************************************************************************************************************************************************!*\
  653. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.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 ***!
  654. \*******************************************************************************************************************************************************************************************************************************************************************************************/
  655. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  656. "use strict";
  657. __webpack_require__.r(__webpack_exports__);
  658. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  659. /* harmony export */ "render": () => (/* binding */ render)
  660. /* harmony export */ });
  661. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  662. var _withScopeId = function _withScopeId(n) {
  663. return (0,vue__WEBPACK_IMPORTED_MODULE_0__.pushScopeId)("data-v-42bf62a4"), n = n(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.popScopeId)(), n;
  664. };
  665. var _hoisted_1 = {
  666. "class": "layout-topbar"
  667. };
  668. var _hoisted_2 = /*#__PURE__*/_withScopeId(function () {
  669. return /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("img", {
  670. alt: "Brand Logo",
  671. src: "/images/logo.svg",
  672. "class": "md:mr-3"
  673. }, null, -1
  674. /* HOISTED */
  675. );
  676. });
  677. var _hoisted_3 = /*#__PURE__*/_withScopeId(function () {
  678. return /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("span", null, "Cahaya Agung", -1
  679. /* HOISTED */
  680. );
  681. });
  682. var _hoisted_4 = /*#__PURE__*/_withScopeId(function () {
  683. return /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("i", {
  684. "class": "pi pi-bars"
  685. }, null, -1
  686. /* HOISTED */
  687. );
  688. });
  689. var _hoisted_5 = [_hoisted_4];
  690. var _hoisted_6 = {
  691. "class": "p-link layout-topbar-menu-button layout-topbar-button"
  692. };
  693. var _hoisted_7 = /*#__PURE__*/_withScopeId(function () {
  694. return /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("i", {
  695. "class": "pi pi-ellipsis-v"
  696. }, null, -1
  697. /* HOISTED */
  698. );
  699. });
  700. var _hoisted_8 = [_hoisted_7];
  701. var _hoisted_9 = {
  702. "class": "layout-topbar-menu hidden lg:flex origin-top"
  703. };
  704. var _hoisted_10 = {
  705. "class": "align-self-center"
  706. };
  707. var _hoisted_11 = {
  708. "class": "hidden lg:inline"
  709. };
  710. var _hoisted_12 = /*#__PURE__*/_withScopeId(function () {
  711. return /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("i", {
  712. "class": "pi pi-user"
  713. }, null, -1
  714. /* HOISTED */
  715. );
  716. });
  717. var _hoisted_13 = /*#__PURE__*/_withScopeId(function () {
  718. return /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("span", null, "Ubah Profil", -1
  719. /* HOISTED */
  720. );
  721. });
  722. var _hoisted_14 = /*#__PURE__*/_withScopeId(function () {
  723. return /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("i", {
  724. "class": "pi pi-sign-out"
  725. }, null, -1
  726. /* HOISTED */
  727. );
  728. });
  729. var _hoisted_15 = /*#__PURE__*/_withScopeId(function () {
  730. return /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("span", null, "Keluar", -1
  731. /* HOISTED */
  732. );
  733. });
  734. function render(_ctx, _cache, $props, $setup, $data, $options) {
  735. var _directive_styleclass = (0,vue__WEBPACK_IMPORTED_MODULE_0__.resolveDirective)("styleclass");
  736. var _directive_tooltip = (0,vue__WEBPACK_IMPORTED_MODULE_0__.resolveDirective)("tooltip");
  737. 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"], {
  738. href: "/",
  739. "class": "layout-topbar-logo"
  740. }, {
  741. "default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  742. return [_hoisted_2, _hoisted_3];
  743. }),
  744. _: 1
  745. /* STABLE */
  746. }), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("button", {
  747. "class": "p-link layout-menu-button layout-topbar-button",
  748. onClick: _cache[0] || (_cache[0] = function ($event) {
  749. return _ctx.$emit('menu-toggle', $event);
  750. })
  751. }, _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, {
  752. selector: '@next',
  753. enterClass: 'hidden',
  754. enterActiveClass: 'scalein',
  755. leaveToClass: 'hidden',
  756. leaveActiveClass: 'fadeout',
  757. hideOnOutsideClick: true
  758. }]]), (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
  759. /* TEXT */
  760. )]), (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"], {
  761. href: _ctx.route('users.show', _ctx.$page.props.auth.user.id),
  762. "class": "p-link layout-topbar-button"
  763. }, {
  764. "default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  765. return [_hoisted_12, _hoisted_13];
  766. }),
  767. _: 1
  768. /* STABLE */
  769. }, 8
  770. /* PROPS */
  771. , ["href"])), [[_directive_tooltip, {
  772. value: 'Ubah Profil',
  773. "class": 'layout-topbar-menu-tooltip'
  774. }, void 0, {
  775. bottom: true
  776. }]])]), (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"], {
  777. href: _ctx.route('logout'),
  778. as: "button",
  779. method: "post",
  780. "class": "p-link layout-topbar-button"
  781. }, {
  782. "default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  783. return [_hoisted_14, _hoisted_15];
  784. }),
  785. _: 1
  786. /* STABLE */
  787. }, 8
  788. /* PROPS */
  789. , ["href"])), [[_directive_tooltip, {
  790. value: 'Keluar',
  791. "class": 'layout-topbar-menu-tooltip'
  792. }, void 0, {
  793. bottom: true
  794. }]])])])]);
  795. }
  796. /***/ }),
  797. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.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":
  798. /*!**********************************************************************************************************************************************************************************************************************************************************************************************!*\
  799. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.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 ***!
  800. \**********************************************************************************************************************************************************************************************************************************************************************************************/
  801. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  802. "use strict";
  803. __webpack_require__.r(__webpack_exports__);
  804. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  805. /* harmony export */ "render": () => (/* binding */ render)
  806. /* harmony export */ });
  807. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  808. var _withScopeId = function _withScopeId(n) {
  809. return (0,vue__WEBPACK_IMPORTED_MODULE_0__.pushScopeId)("data-v-549bf5ac"), n = n(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.popScopeId)(), n;
  810. };
  811. var _hoisted_1 = {
  812. "class": "layout-sidebar"
  813. };
  814. var _hoisted_2 = {
  815. "class": "layout-main-container"
  816. };
  817. var _hoisted_3 = {
  818. "class": "layout-main"
  819. };
  820. var _hoisted_4 = {
  821. key: 0,
  822. "class": "layout-mask p-component-overlay"
  823. };
  824. function render(_ctx, _cache, $props, $setup, $data, $options) {
  825. return (0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)("div", {
  826. "class": (0,vue__WEBPACK_IMPORTED_MODULE_0__.normalizeClass)($setup.containerClass),
  827. onClick: $setup.onWrapperClick
  828. }, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)($setup["AppTopBar"], {
  829. onMenuToggle: $setup.onMenuToggle
  830. }), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("div", _hoisted_1, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)($setup["AppSidebar"], {
  831. menu: $setup.menu[_ctx.$page.props.auth.user.role_id]
  832. }, null, 8
  833. /* PROPS */
  834. , ["menu"])]), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("div", _hoisted_2, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("div", _hoisted_3, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)($setup["AppMessage"]), (0,vue__WEBPACK_IMPORTED_MODULE_0__.renderSlot)(_ctx.$slots, "default", {}, undefined, true)]), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)($setup["AppFooter"])]), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(vue__WEBPACK_IMPORTED_MODULE_0__.Transition, {
  835. name: "layout-mask"
  836. }, {
  837. "default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  838. return [$setup.mobileMenuActive ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)("div", _hoisted_4)) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true)];
  839. }),
  840. _: 1
  841. /* STABLE */
  842. })], 2
  843. /* CLASS */
  844. );
  845. }
  846. /***/ }),
  847. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.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":
  848. /*!****************************************************************************************************************************************************************************************************************************************************************************!*\
  849. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.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 ***!
  850. \****************************************************************************************************************************************************************************************************************************************************************************/
  851. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  852. "use strict";
  853. __webpack_require__.r(__webpack_exports__);
  854. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  855. /* harmony export */ "render": () => (/* binding */ render)
  856. /* harmony export */ });
  857. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  858. var _hoisted_1 = /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("h1", null, "User", -1
  859. /* HOISTED */
  860. );
  861. var _hoisted_2 = {
  862. "class": "grid"
  863. };
  864. var _hoisted_3 = {
  865. "class": "col-12 md:col-8"
  866. };
  867. var _hoisted_4 = {
  868. "class": "flex align-items-center"
  869. };
  870. var _hoisted_5 = {
  871. "class": "col-12 md:col-4 flex flex-column md:flex-row justify-content-end"
  872. };
  873. function render(_ctx, _cache, $props, $setup, $data, $options) {
  874. var _component_ConfirmDialog = (0,vue__WEBPACK_IMPORTED_MODULE_0__.resolveComponent)("ConfirmDialog");
  875. var _component_InputText = (0,vue__WEBPACK_IMPORTED_MODULE_0__.resolveComponent)("InputText");
  876. var _component_Column = (0,vue__WEBPACK_IMPORTED_MODULE_0__.resolveComponent)("Column");
  877. var _component_Button = (0,vue__WEBPACK_IMPORTED_MODULE_0__.resolveComponent)("Button");
  878. var _component_DataTable = (0,vue__WEBPACK_IMPORTED_MODULE_0__.resolveComponent)("DataTable");
  879. var _directive_tooltip = (0,vue__WEBPACK_IMPORTED_MODULE_0__.resolveDirective)("tooltip");
  880. 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"], {
  881. title: "Daftar User"
  882. }), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)($setup["DashboardLayout"], null, {
  883. "default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  884. return [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(_component_ConfirmDialog), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(_component_DataTable, {
  885. responsiveLayout: "scroll",
  886. columnResizeMode: "expand",
  887. value: $props.users.data,
  888. rowHover: true,
  889. stripedRows: true
  890. }, {
  891. header: (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  892. 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, {
  893. "class": "w-full md:w-27rem",
  894. placeholder: "cari, contoh: tina",
  895. modelValue: $setup.search,
  896. "onUpdate:modelValue": _cache[0] || (_cache[0] = function ($event) {
  897. return $setup.search = $event;
  898. })
  899. }, null, 8
  900. /* PROPS */
  901. , ["modelValue"])])]), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("div", _hoisted_5, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)($setup["AppButtonLink"], {
  902. label: "Tambah User",
  903. icon: "pi pi-pencil",
  904. "class": "p-button-outlined",
  905. href: _ctx.route('users.create')
  906. }, null, 8
  907. /* PROPS */
  908. , ["href"])])])];
  909. }),
  910. "default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  911. 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) {
  912. return (0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createBlock)(_component_Column, {
  913. field: value.field,
  914. header: value.header,
  915. key: value.field
  916. }, null, 8
  917. /* PROPS */
  918. , ["field", "header"]);
  919. }), 128
  920. /* KEYED_FRAGMENT */
  921. )), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(_component_Column, null, {
  922. body: (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function (_ref) {
  923. var data = _ref.data;
  924. return [(0,vue__WEBPACK_IMPORTED_MODULE_0__.withDirectives)((0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)($setup["AppButtonLink"], {
  925. icon: "pi pi-pencil",
  926. "class": "p-button-icon-only p-button-rounded p-button-text",
  927. href: _ctx.route('users.edit', data.id)
  928. }, null, 8
  929. /* PROPS */
  930. , ["href"]), [[_directive_tooltip, 'Ubah User', void 0, {
  931. bottom: true
  932. }]]), 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, {
  933. key: 0,
  934. icon: "pi pi-key",
  935. "class": "p-button-icon-only p-button-rounded p-button-text",
  936. onClick: function onClick($event) {
  937. return $setup.onResetPassword(data);
  938. }
  939. }, null, 8
  940. /* PROPS */
  941. , ["onClick"])), [[_directive_tooltip, 'Reset Kata Sandi', void 0, {
  942. bottom: true
  943. }]]) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true)];
  944. }),
  945. _: 1
  946. /* STABLE */
  947. })];
  948. }),
  949. _: 1
  950. /* STABLE */
  951. }, 8
  952. /* PROPS */
  953. , ["value"]), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)($setup["AppPagination"], {
  954. links: $props.users.links
  955. }, null, 8
  956. /* PROPS */
  957. , ["links"])];
  958. }),
  959. _: 1
  960. /* STABLE */
  961. })], 64
  962. /* STABLE_FRAGMENT */
  963. );
  964. }
  965. /***/ }),
  966. /***/ "./resources/js/components/useSearchText.js":
  967. /*!**************************************************!*\
  968. !*** ./resources/js/components/useSearchText.js ***!
  969. \**************************************************/
  970. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  971. "use strict";
  972. __webpack_require__.r(__webpack_exports__);
  973. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  974. /* harmony export */ "useSearchText": () => (/* binding */ useSearchText)
  975. /* harmony export */ });
  976. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  977. function useSearchText(props) {
  978. var search = (0,vue__WEBPACK_IMPORTED_MODULE_0__.ref)(props.initialSearch);
  979. return {
  980. search: search
  981. };
  982. }
  983. /***/ }),
  984. /***/ "./resources/js/pages/Users/tableHeader.js":
  985. /*!*************************************************!*\
  986. !*** ./resources/js/pages/Users/tableHeader.js ***!
  987. \*************************************************/
  988. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  989. "use strict";
  990. __webpack_require__.r(__webpack_exports__);
  991. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  992. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  993. /* harmony export */ });
  994. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ([{
  995. field: 'name',
  996. header: 'Nama'
  997. }, {
  998. field: 'username',
  999. header: 'Nama Pengguna'
  1000. }, {
  1001. field: 'role',
  1002. header: 'Hak Akses'
  1003. }, {
  1004. field: 'status',
  1005. header: 'Status'
  1006. }]);
  1007. /***/ }),
  1008. /***/ "./resources/js/utils/menu.js":
  1009. /*!************************************!*\
  1010. !*** ./resources/js/utils/menu.js ***!
  1011. \************************************/
  1012. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  1013. "use strict";
  1014. __webpack_require__.r(__webpack_exports__);
  1015. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  1016. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  1017. /* harmony export */ });
  1018. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
  1019. // Admin
  1020. 1: [{
  1021. label: 'Home',
  1022. items: [{
  1023. label: 'Dashboard',
  1024. icon: 'pi pi-chart-bar',
  1025. to: '/dashboards',
  1026. component: 'Dashboards/Index'
  1027. }]
  1028. }, {
  1029. label: 'Laporan',
  1030. items: []
  1031. }, {
  1032. label: 'Master',
  1033. items: [{
  1034. label: 'User',
  1035. icon: 'pi pi-user',
  1036. to: '/users',
  1037. component: 'Users/Index'
  1038. }]
  1039. }],
  1040. // Supervisor
  1041. 2: [{
  1042. label: 'Home',
  1043. items: [{
  1044. label: 'Dashboard',
  1045. icon: 'pi pi-chart-bar',
  1046. to: '/dashboards',
  1047. component: 'Dashboards/Index'
  1048. }]
  1049. }, {
  1050. label: 'Master',
  1051. items: [{
  1052. label: 'Pelanggan',
  1053. icon: 'pi pi-users',
  1054. to: '/customers',
  1055. component: 'Customers/Index'
  1056. }, {
  1057. label: 'Pembelian',
  1058. icon: 'pi pi-shopping-cart',
  1059. to: '/purchases',
  1060. component: 'Purchases/Index'
  1061. }, {
  1062. label: 'Penjualan',
  1063. icon: 'pi pi-tag',
  1064. to: '/sales',
  1065. component: 'Sales/Index'
  1066. }, {
  1067. label: 'Produk',
  1068. icon: 'pi pi-th-large',
  1069. to: '/products',
  1070. component: 'Products/Index'
  1071. }]
  1072. }],
  1073. // Operator
  1074. 3: [{
  1075. label: 'Home',
  1076. items: [{
  1077. label: 'Dashboard',
  1078. icon: 'pi pi-chart-bar',
  1079. to: '/dashboards',
  1080. component: 'Dashboards/Index'
  1081. }]
  1082. }, {
  1083. label: 'Master',
  1084. items: [{
  1085. label: 'Supplier',
  1086. icon: 'pi pi-shopping-cart',
  1087. to: '/suppliers',
  1088. component: 'Suppliers/Index'
  1089. }, {
  1090. label: 'Stok Barang',
  1091. icon: 'pi pi-box',
  1092. to: '/stock-products',
  1093. component: 'StockProducts/Index'
  1094. }]
  1095. }]
  1096. });
  1097. /***/ }),
  1098. /***/ "./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppFooter.vue?vue&type=style&index=0&id=4ab6097e&lang=scss&scoped=true":
  1099. /*!***********************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  1100. !*** ./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppFooter.vue?vue&type=style&index=0&id=4ab6097e&lang=scss&scoped=true ***!
  1101. \***********************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  1102. /***/ ((module, __webpack_exports__, __webpack_require__) => {
  1103. "use strict";
  1104. __webpack_require__.r(__webpack_exports__);
  1105. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  1106. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  1107. /* harmony export */ });
  1108. /* 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");
  1109. /* 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__);
  1110. // Imports
  1111. var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_0___default()(function(i){return i[1]});
  1112. // Module
  1113. ___CSS_LOADER_EXPORT___.push([module.id, ".layout-footer[data-v-4ab6097e] {\n transition: margin-left 0.2s;\n display: flex;\n align-items: center;\n justify-content: center;\n padding-top: 1rem;\n border-top: 1px solid var(--surface-border);\n}", ""]);
  1114. // Exports
  1115. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);
  1116. /***/ }),
  1117. /***/ "./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":
  1118. /*!************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  1119. !*** ./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 ***!
  1120. \************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  1121. /***/ ((module, __webpack_exports__, __webpack_require__) => {
  1122. "use strict";
  1123. __webpack_require__.r(__webpack_exports__);
  1124. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  1125. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  1126. /* harmony export */ });
  1127. /* 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");
  1128. /* 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__);
  1129. // Imports
  1130. var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_0___default()(function(i){return i[1]});
  1131. // Module
  1132. ___CSS_LOADER_EXPORT___.push([module.id, ".layout-menu[data-v-22a4e926] {\n list-style-type: none;\n margin: 0;\n padding: 0;\n}", ""]);
  1133. // Exports
  1134. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);
  1135. /***/ }),
  1136. /***/ "./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":
  1137. /*!***************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  1138. !*** ./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 ***!
  1139. \***************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  1140. /***/ ((module, __webpack_exports__, __webpack_require__) => {
  1141. "use strict";
  1142. __webpack_require__.r(__webpack_exports__);
  1143. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  1144. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  1145. /* harmony export */ });
  1146. /* 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");
  1147. /* 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__);
  1148. // Imports
  1149. var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_0___default()(function(i){return i[1]});
  1150. // Module
  1151. ___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}", ""]);
  1152. // Exports
  1153. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);
  1154. /***/ }),
  1155. /***/ "./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":
  1156. /*!***********************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  1157. !*** ./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 ***!
  1158. \***********************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  1159. /***/ ((module, __webpack_exports__, __webpack_require__) => {
  1160. "use strict";
  1161. __webpack_require__.r(__webpack_exports__);
  1162. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  1163. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  1164. /* harmony export */ });
  1165. /* 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");
  1166. /* 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__);
  1167. // Imports
  1168. var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_0___default()(function(i){return i[1]});
  1169. // Module
  1170. ___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}", ""]);
  1171. // Exports
  1172. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);
  1173. /***/ }),
  1174. /***/ "./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":
  1175. /*!**************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  1176. !*** ./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 ***!
  1177. \**************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  1178. /***/ ((module, __webpack_exports__, __webpack_require__) => {
  1179. "use strict";
  1180. __webpack_require__.r(__webpack_exports__);
  1181. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  1182. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  1183. /* harmony export */ });
  1184. /* 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");
  1185. /* 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__);
  1186. // Imports
  1187. var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_0___default()(function(i){return i[1]});
  1188. // Module
  1189. ___CSS_LOADER_EXPORT___.push([module.id, ".layout-sidebar[data-v-549bf5ac] {\n position: fixed;\n width: 300px;\n height: calc(100vh - 9rem);\n z-index: 996;\n overflow-y: auto;\n -webkit-user-select: none;\n -moz-user-select: none;\n -ms-user-select: none;\n user-select: none;\n top: 7rem;\n left: 2rem;\n transition: transform 0.2s, left 0.2s;\n background-color: var(--surface-overlay);\n border-radius: 4px;\n padding: 1.5rem;\n box-shadow: 0px 3px 5px rgba(0, 0, 0, 0.02), 0px 0px 2px rgba(0, 0, 0, 0.05), 0px 1px 4px rgba(0, 0, 0, 0.08);\n}\n.layout-main-container[data-v-549bf5ac] {\n display: flex;\n flex-direction: column;\n min-height: 100vh;\n justify-content: space-between;\n padding: 7rem 2rem 2rem 4rem;\n transition: margin-left 0.2s;\n}\n.layout-main[data-v-549bf5ac] {\n flex: 1 1 auto;\n}\n@media (min-width: 992px) {\n.layout-wrapper .layout-main-container[data-v-549bf5ac] {\n margin-left: 300px;\n}\n.layout-wrapper.layout-static-sidebar-inactive .layout-sidebar[data-v-549bf5ac] {\n transform: translateX(-100%);\n left: 0;\n}\n.layout-wrapper.layout-static-sidebar-inactive .layout-main-container[data-v-549bf5ac] {\n margin-left: 0;\n padding-left: 2rem;\n}\n.layout-wrapper .layout-mask[data-v-549bf5ac] {\n display: none;\n}\n}\n@media (max-width: 991px) {\n.layout-wrapper .layout-main-container[data-v-549bf5ac] {\n margin-left: 0;\n padding-left: 2rem;\n}\n.layout-wrapper .layout-sidebar[data-v-549bf5ac] {\n transform: translateX(-100%);\n left: 0;\n top: 0;\n height: 100vh;\n border-top-left-radius: 0;\n border-bottom-left-radius: 0;\n}\n.layout-wrapper .layout-mask[data-v-549bf5ac] {\n z-index: 995;\n background-color: var(--maskbg);\n}\n.layout-wrapper .layout-mask.layout-mask-enter-from[data-v-549bf5ac], .layout-wrapper .layout-mask.layout-mask-leave-to[data-v-549bf5ac] {\n background-color: transparent;\n}\n.layout-wrapper.layout-mobile-sidebar-active .layout-sidebar[data-v-549bf5ac] {\n transform: translateX(0);\n}\n.layout-wrapper.layout-mobile-sidebar-active .layout-mask[data-v-549bf5ac] {\n display: block;\n}\n}", ""]);
  1190. // Exports
  1191. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);
  1192. /***/ }),
  1193. /***/ "./node_modules/lodash/lodash.js":
  1194. /*!***************************************!*\
  1195. !*** ./node_modules/lodash/lodash.js ***!
  1196. \***************************************/
  1197. /***/ (function(module, exports, __webpack_require__) {
  1198. /* module decorator */ module = __webpack_require__.nmd(module);
  1199. var __WEBPACK_AMD_DEFINE_RESULT__;/**
  1200. * @license
  1201. * Lodash <https://lodash.com/>
  1202. * Copyright OpenJS Foundation and other contributors <https://openjsf.org/>
  1203. * Released under MIT license <https://lodash.com/license>
  1204. * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
  1205. * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
  1206. */
  1207. ;(function() {
  1208. /** Used as a safe reference for `undefined` in pre-ES5 environments. */
  1209. var undefined;
  1210. /** Used as the semantic version number. */
  1211. var VERSION = '4.17.21';
  1212. /** Used as the size to enable large array optimizations. */
  1213. var LARGE_ARRAY_SIZE = 200;
  1214. /** Error message constants. */
  1215. var CORE_ERROR_TEXT = 'Unsupported core-js use. Try https://npms.io/search?q=ponyfill.',
  1216. FUNC_ERROR_TEXT = 'Expected a function',
  1217. INVALID_TEMPL_VAR_ERROR_TEXT = 'Invalid `variable` option passed into `_.template`';
  1218. /** Used to stand-in for `undefined` hash values. */
  1219. var HASH_UNDEFINED = '__lodash_hash_undefined__';
  1220. /** Used as the maximum memoize cache size. */
  1221. var MAX_MEMOIZE_SIZE = 500;
  1222. /** Used as the internal argument placeholder. */
  1223. var PLACEHOLDER = '__lodash_placeholder__';
  1224. /** Used to compose bitmasks for cloning. */
  1225. var CLONE_DEEP_FLAG = 1,
  1226. CLONE_FLAT_FLAG = 2,
  1227. CLONE_SYMBOLS_FLAG = 4;
  1228. /** Used to compose bitmasks for value comparisons. */
  1229. var COMPARE_PARTIAL_FLAG = 1,
  1230. COMPARE_UNORDERED_FLAG = 2;
  1231. /** Used to compose bitmasks for function metadata. */
  1232. var WRAP_BIND_FLAG = 1,
  1233. WRAP_BIND_KEY_FLAG = 2,
  1234. WRAP_CURRY_BOUND_FLAG = 4,
  1235. WRAP_CURRY_FLAG = 8,
  1236. WRAP_CURRY_RIGHT_FLAG = 16,
  1237. WRAP_PARTIAL_FLAG = 32,
  1238. WRAP_PARTIAL_RIGHT_FLAG = 64,
  1239. WRAP_ARY_FLAG = 128,
  1240. WRAP_REARG_FLAG = 256,
  1241. WRAP_FLIP_FLAG = 512;
  1242. /** Used as default options for `_.truncate`. */
  1243. var DEFAULT_TRUNC_LENGTH = 30,
  1244. DEFAULT_TRUNC_OMISSION = '...';
  1245. /** Used to detect hot functions by number of calls within a span of milliseconds. */
  1246. var HOT_COUNT = 800,
  1247. HOT_SPAN = 16;
  1248. /** Used to indicate the type of lazy iteratees. */
  1249. var LAZY_FILTER_FLAG = 1,
  1250. LAZY_MAP_FLAG = 2,
  1251. LAZY_WHILE_FLAG = 3;
  1252. /** Used as references for various `Number` constants. */
  1253. var INFINITY = 1 / 0,
  1254. MAX_SAFE_INTEGER = 9007199254740991,
  1255. MAX_INTEGER = 1.7976931348623157e+308,
  1256. NAN = 0 / 0;
  1257. /** Used as references for the maximum length and index of an array. */
  1258. var MAX_ARRAY_LENGTH = 4294967295,
  1259. MAX_ARRAY_INDEX = MAX_ARRAY_LENGTH - 1,
  1260. HALF_MAX_ARRAY_LENGTH = MAX_ARRAY_LENGTH >>> 1;
  1261. /** Used to associate wrap methods with their bit flags. */
  1262. var wrapFlags = [
  1263. ['ary', WRAP_ARY_FLAG],
  1264. ['bind', WRAP_BIND_FLAG],
  1265. ['bindKey', WRAP_BIND_KEY_FLAG],
  1266. ['curry', WRAP_CURRY_FLAG],
  1267. ['curryRight', WRAP_CURRY_RIGHT_FLAG],
  1268. ['flip', WRAP_FLIP_FLAG],
  1269. ['partial', WRAP_PARTIAL_FLAG],
  1270. ['partialRight', WRAP_PARTIAL_RIGHT_FLAG],
  1271. ['rearg', WRAP_REARG_FLAG]
  1272. ];
  1273. /** `Object#toString` result references. */
  1274. var argsTag = '[object Arguments]',
  1275. arrayTag = '[object Array]',
  1276. asyncTag = '[object AsyncFunction]',
  1277. boolTag = '[object Boolean]',
  1278. dateTag = '[object Date]',
  1279. domExcTag = '[object DOMException]',
  1280. errorTag = '[object Error]',
  1281. funcTag = '[object Function]',
  1282. genTag = '[object GeneratorFunction]',
  1283. mapTag = '[object Map]',
  1284. numberTag = '[object Number]',
  1285. nullTag = '[object Null]',
  1286. objectTag = '[object Object]',
  1287. promiseTag = '[object Promise]',
  1288. proxyTag = '[object Proxy]',
  1289. regexpTag = '[object RegExp]',
  1290. setTag = '[object Set]',
  1291. stringTag = '[object String]',
  1292. symbolTag = '[object Symbol]',
  1293. undefinedTag = '[object Undefined]',
  1294. weakMapTag = '[object WeakMap]',
  1295. weakSetTag = '[object WeakSet]';
  1296. var arrayBufferTag = '[object ArrayBuffer]',
  1297. dataViewTag = '[object DataView]',
  1298. float32Tag = '[object Float32Array]',
  1299. float64Tag = '[object Float64Array]',
  1300. int8Tag = '[object Int8Array]',
  1301. int16Tag = '[object Int16Array]',
  1302. int32Tag = '[object Int32Array]',
  1303. uint8Tag = '[object Uint8Array]',
  1304. uint8ClampedTag = '[object Uint8ClampedArray]',
  1305. uint16Tag = '[object Uint16Array]',
  1306. uint32Tag = '[object Uint32Array]';
  1307. /** Used to match empty string literals in compiled template source. */
  1308. var reEmptyStringLeading = /\b__p \+= '';/g,
  1309. reEmptyStringMiddle = /\b(__p \+=) '' \+/g,
  1310. reEmptyStringTrailing = /(__e\(.*?\)|\b__t\)) \+\n'';/g;
  1311. /** Used to match HTML entities and HTML characters. */
  1312. var reEscapedHtml = /&(?:amp|lt|gt|quot|#39);/g,
  1313. reUnescapedHtml = /[&<>"']/g,
  1314. reHasEscapedHtml = RegExp(reEscapedHtml.source),
  1315. reHasUnescapedHtml = RegExp(reUnescapedHtml.source);
  1316. /** Used to match template delimiters. */
  1317. var reEscape = /<%-([\s\S]+?)%>/g,
  1318. reEvaluate = /<%([\s\S]+?)%>/g,
  1319. reInterpolate = /<%=([\s\S]+?)%>/g;
  1320. /** Used to match property names within property paths. */
  1321. var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,
  1322. reIsPlainProp = /^\w*$/,
  1323. rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g;
  1324. /**
  1325. * Used to match `RegExp`
  1326. * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).
  1327. */
  1328. var reRegExpChar = /[\\^$.*+?()[\]{}|]/g,
  1329. reHasRegExpChar = RegExp(reRegExpChar.source);
  1330. /** Used to match leading whitespace. */
  1331. var reTrimStart = /^\s+/;
  1332. /** Used to match a single whitespace character. */
  1333. var reWhitespace = /\s/;
  1334. /** Used to match wrap detail comments. */
  1335. var reWrapComment = /\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,
  1336. reWrapDetails = /\{\n\/\* \[wrapped with (.+)\] \*/,
  1337. reSplitDetails = /,? & /;
  1338. /** Used to match words composed of alphanumeric characters. */
  1339. var reAsciiWord = /[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;
  1340. /**
  1341. * Used to validate the `validate` option in `_.template` variable.
  1342. *
  1343. * Forbids characters which could potentially change the meaning of the function argument definition:
  1344. * - "()," (modification of function parameters)
  1345. * - "=" (default value)
  1346. * - "[]{}" (destructuring of function parameters)
  1347. * - "/" (beginning of a comment)
  1348. * - whitespace
  1349. */
  1350. var reForbiddenIdentifierChars = /[()=,{}\[\]\/\s]/;
  1351. /** Used to match backslashes in property paths. */
  1352. var reEscapeChar = /\\(\\)?/g;
  1353. /**
  1354. * Used to match
  1355. * [ES template delimiters](http://ecma-international.org/ecma-262/7.0/#sec-template-literal-lexical-components).
  1356. */
  1357. var reEsTemplate = /\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g;
  1358. /** Used to match `RegExp` flags from their coerced string values. */
  1359. var reFlags = /\w*$/;
  1360. /** Used to detect bad signed hexadecimal string values. */
  1361. var reIsBadHex = /^[-+]0x[0-9a-f]+$/i;
  1362. /** Used to detect binary string values. */
  1363. var reIsBinary = /^0b[01]+$/i;
  1364. /** Used to detect host constructors (Safari). */
  1365. var reIsHostCtor = /^\[object .+?Constructor\]$/;
  1366. /** Used to detect octal string values. */
  1367. var reIsOctal = /^0o[0-7]+$/i;
  1368. /** Used to detect unsigned integer values. */
  1369. var reIsUint = /^(?:0|[1-9]\d*)$/;
  1370. /** Used to match Latin Unicode letters (excluding mathematical operators). */
  1371. var reLatin = /[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g;
  1372. /** Used to ensure capturing order of template delimiters. */
  1373. var reNoMatch = /($^)/;
  1374. /** Used to match unescaped characters in compiled string literals. */
  1375. var reUnescapedString = /['\n\r\u2028\u2029\\]/g;
  1376. /** Used to compose unicode character classes. */
  1377. var rsAstralRange = '\\ud800-\\udfff',
  1378. rsComboMarksRange = '\\u0300-\\u036f',
  1379. reComboHalfMarksRange = '\\ufe20-\\ufe2f',
  1380. rsComboSymbolsRange = '\\u20d0-\\u20ff',
  1381. rsComboRange = rsComboMarksRange + reComboHalfMarksRange + rsComboSymbolsRange,
  1382. rsDingbatRange = '\\u2700-\\u27bf',
  1383. rsLowerRange = 'a-z\\xdf-\\xf6\\xf8-\\xff',
  1384. rsMathOpRange = '\\xac\\xb1\\xd7\\xf7',
  1385. rsNonCharRange = '\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf',
  1386. rsPunctuationRange = '\\u2000-\\u206f',
  1387. 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',
  1388. rsUpperRange = 'A-Z\\xc0-\\xd6\\xd8-\\xde',
  1389. rsVarRange = '\\ufe0e\\ufe0f',
  1390. rsBreakRange = rsMathOpRange + rsNonCharRange + rsPunctuationRange + rsSpaceRange;
  1391. /** Used to compose unicode capture groups. */
  1392. var rsApos = "['\u2019]",
  1393. rsAstral = '[' + rsAstralRange + ']',
  1394. rsBreak = '[' + rsBreakRange + ']',
  1395. rsCombo = '[' + rsComboRange + ']',
  1396. rsDigits = '\\d+',
  1397. rsDingbat = '[' + rsDingbatRange + ']',
  1398. rsLower = '[' + rsLowerRange + ']',
  1399. rsMisc = '[^' + rsAstralRange + rsBreakRange + rsDigits + rsDingbatRange + rsLowerRange + rsUpperRange + ']',
  1400. rsFitz = '\\ud83c[\\udffb-\\udfff]',
  1401. rsModifier = '(?:' + rsCombo + '|' + rsFitz + ')',
  1402. rsNonAstral = '[^' + rsAstralRange + ']',
  1403. rsRegional = '(?:\\ud83c[\\udde6-\\uddff]){2}',
  1404. rsSurrPair = '[\\ud800-\\udbff][\\udc00-\\udfff]',
  1405. rsUpper = '[' + rsUpperRange + ']',
  1406. rsZWJ = '\\u200d';
  1407. /** Used to compose unicode regexes. */
  1408. var rsMiscLower = '(?:' + rsLower + '|' + rsMisc + ')',
  1409. rsMiscUpper = '(?:' + rsUpper + '|' + rsMisc + ')',
  1410. rsOptContrLower = '(?:' + rsApos + '(?:d|ll|m|re|s|t|ve))?',
  1411. rsOptContrUpper = '(?:' + rsApos + '(?:D|LL|M|RE|S|T|VE))?',
  1412. reOptMod = rsModifier + '?',
  1413. rsOptVar = '[' + rsVarRange + ']?',
  1414. rsOptJoin = '(?:' + rsZWJ + '(?:' + [rsNonAstral, rsRegional, rsSurrPair].join('|') + ')' + rsOptVar + reOptMod + ')*',
  1415. rsOrdLower = '\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])',
  1416. rsOrdUpper = '\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])',
  1417. rsSeq = rsOptVar + reOptMod + rsOptJoin,
  1418. rsEmoji = '(?:' + [rsDingbat, rsRegional, rsSurrPair].join('|') + ')' + rsSeq,
  1419. rsSymbol = '(?:' + [rsNonAstral + rsCombo + '?', rsCombo, rsRegional, rsSurrPair, rsAstral].join('|') + ')';
  1420. /** Used to match apostrophes. */
  1421. var reApos = RegExp(rsApos, 'g');
  1422. /**
  1423. * Used to match [combining diacritical marks](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks) and
  1424. * [combining diacritical marks for symbols](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks_for_Symbols).
  1425. */
  1426. var reComboMark = RegExp(rsCombo, 'g');
  1427. /** Used to match [string symbols](https://mathiasbynens.be/notes/javascript-unicode). */
  1428. var reUnicode = RegExp(rsFitz + '(?=' + rsFitz + ')|' + rsSymbol + rsSeq, 'g');
  1429. /** Used to match complex or compound words. */
  1430. var reUnicodeWord = RegExp([
  1431. rsUpper + '?' + rsLower + '+' + rsOptContrLower + '(?=' + [rsBreak, rsUpper, '$'].join('|') + ')',
  1432. rsMiscUpper + '+' + rsOptContrUpper + '(?=' + [rsBreak, rsUpper + rsMiscLower, '$'].join('|') + ')',
  1433. rsUpper + '?' + rsMiscLower + '+' + rsOptContrLower,
  1434. rsUpper + '+' + rsOptContrUpper,
  1435. rsOrdUpper,
  1436. rsOrdLower,
  1437. rsDigits,
  1438. rsEmoji
  1439. ].join('|'), 'g');
  1440. /** 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/). */
  1441. var reHasUnicode = RegExp('[' + rsZWJ + rsAstralRange + rsComboRange + rsVarRange + ']');
  1442. /** Used to detect strings that need a more robust regexp to match words. */
  1443. 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 ]/;
  1444. /** Used to assign default `context` object properties. */
  1445. var contextProps = [
  1446. 'Array', 'Buffer', 'DataView', 'Date', 'Error', 'Float32Array', 'Float64Array',
  1447. 'Function', 'Int8Array', 'Int16Array', 'Int32Array', 'Map', 'Math', 'Object',
  1448. 'Promise', 'RegExp', 'Set', 'String', 'Symbol', 'TypeError', 'Uint8Array',
  1449. 'Uint8ClampedArray', 'Uint16Array', 'Uint32Array', 'WeakMap',
  1450. '_', 'clearTimeout', 'isFinite', 'parseInt', 'setTimeout'
  1451. ];
  1452. /** Used to make template sourceURLs easier to identify. */
  1453. var templateCounter = -1;
  1454. /** Used to identify `toStringTag` values of typed arrays. */
  1455. var typedArrayTags = {};
  1456. typedArrayTags[float32Tag] = typedArrayTags[float64Tag] =
  1457. typedArrayTags[int8Tag] = typedArrayTags[int16Tag] =
  1458. typedArrayTags[int32Tag] = typedArrayTags[uint8Tag] =
  1459. typedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] =
  1460. typedArrayTags[uint32Tag] = true;
  1461. typedArrayTags[argsTag] = typedArrayTags[arrayTag] =
  1462. typedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] =
  1463. typedArrayTags[dataViewTag] = typedArrayTags[dateTag] =
  1464. typedArrayTags[errorTag] = typedArrayTags[funcTag] =
  1465. typedArrayTags[mapTag] = typedArrayTags[numberTag] =
  1466. typedArrayTags[objectTag] = typedArrayTags[regexpTag] =
  1467. typedArrayTags[setTag] = typedArrayTags[stringTag] =
  1468. typedArrayTags[weakMapTag] = false;
  1469. /** Used to identify `toStringTag` values supported by `_.clone`. */
  1470. var cloneableTags = {};
  1471. cloneableTags[argsTag] = cloneableTags[arrayTag] =
  1472. cloneableTags[arrayBufferTag] = cloneableTags[dataViewTag] =
  1473. cloneableTags[boolTag] = cloneableTags[dateTag] =
  1474. cloneableTags[float32Tag] = cloneableTags[float64Tag] =
  1475. cloneableTags[int8Tag] = cloneableTags[int16Tag] =
  1476. cloneableTags[int32Tag] = cloneableTags[mapTag] =
  1477. cloneableTags[numberTag] = cloneableTags[objectTag] =
  1478. cloneableTags[regexpTag] = cloneableTags[setTag] =
  1479. cloneableTags[stringTag] = cloneableTags[symbolTag] =
  1480. cloneableTags[uint8Tag] = cloneableTags[uint8ClampedTag] =
  1481. cloneableTags[uint16Tag] = cloneableTags[uint32Tag] = true;
  1482. cloneableTags[errorTag] = cloneableTags[funcTag] =
  1483. cloneableTags[weakMapTag] = false;
  1484. /** Used to map Latin Unicode letters to basic Latin letters. */
  1485. var deburredLetters = {
  1486. // Latin-1 Supplement block.
  1487. '\xc0': 'A', '\xc1': 'A', '\xc2': 'A', '\xc3': 'A', '\xc4': 'A', '\xc5': 'A',
  1488. '\xe0': 'a', '\xe1': 'a', '\xe2': 'a', '\xe3': 'a', '\xe4': 'a', '\xe5': 'a',
  1489. '\xc7': 'C', '\xe7': 'c',
  1490. '\xd0': 'D', '\xf0': 'd',
  1491. '\xc8': 'E', '\xc9': 'E', '\xca': 'E', '\xcb': 'E',
  1492. '\xe8': 'e', '\xe9': 'e', '\xea': 'e', '\xeb': 'e',
  1493. '\xcc': 'I', '\xcd': 'I', '\xce': 'I', '\xcf': 'I',
  1494. '\xec': 'i', '\xed': 'i', '\xee': 'i', '\xef': 'i',
  1495. '\xd1': 'N', '\xf1': 'n',
  1496. '\xd2': 'O', '\xd3': 'O', '\xd4': 'O', '\xd5': 'O', '\xd6': 'O', '\xd8': 'O',
  1497. '\xf2': 'o', '\xf3': 'o', '\xf4': 'o', '\xf5': 'o', '\xf6': 'o', '\xf8': 'o',
  1498. '\xd9': 'U', '\xda': 'U', '\xdb': 'U', '\xdc': 'U',
  1499. '\xf9': 'u', '\xfa': 'u', '\xfb': 'u', '\xfc': 'u',
  1500. '\xdd': 'Y', '\xfd': 'y', '\xff': 'y',
  1501. '\xc6': 'Ae', '\xe6': 'ae',
  1502. '\xde': 'Th', '\xfe': 'th',
  1503. '\xdf': 'ss',
  1504. // Latin Extended-A block.
  1505. '\u0100': 'A', '\u0102': 'A', '\u0104': 'A',
  1506. '\u0101': 'a', '\u0103': 'a', '\u0105': 'a',
  1507. '\u0106': 'C', '\u0108': 'C', '\u010a': 'C', '\u010c': 'C',
  1508. '\u0107': 'c', '\u0109': 'c', '\u010b': 'c', '\u010d': 'c',
  1509. '\u010e': 'D', '\u0110': 'D', '\u010f': 'd', '\u0111': 'd',
  1510. '\u0112': 'E', '\u0114': 'E', '\u0116': 'E', '\u0118': 'E', '\u011a': 'E',
  1511. '\u0113': 'e', '\u0115': 'e', '\u0117': 'e', '\u0119': 'e', '\u011b': 'e',
  1512. '\u011c': 'G', '\u011e': 'G', '\u0120': 'G', '\u0122': 'G',
  1513. '\u011d': 'g', '\u011f': 'g', '\u0121': 'g', '\u0123': 'g',
  1514. '\u0124': 'H', '\u0126': 'H', '\u0125': 'h', '\u0127': 'h',
  1515. '\u0128': 'I', '\u012a': 'I', '\u012c': 'I', '\u012e': 'I', '\u0130': 'I',
  1516. '\u0129': 'i', '\u012b': 'i', '\u012d': 'i', '\u012f': 'i', '\u0131': 'i',
  1517. '\u0134': 'J', '\u0135': 'j',
  1518. '\u0136': 'K', '\u0137': 'k', '\u0138': 'k',
  1519. '\u0139': 'L', '\u013b': 'L', '\u013d': 'L', '\u013f': 'L', '\u0141': 'L',
  1520. '\u013a': 'l', '\u013c': 'l', '\u013e': 'l', '\u0140': 'l', '\u0142': 'l',
  1521. '\u0143': 'N', '\u0145': 'N', '\u0147': 'N', '\u014a': 'N',
  1522. '\u0144': 'n', '\u0146': 'n', '\u0148': 'n', '\u014b': 'n',
  1523. '\u014c': 'O', '\u014e': 'O', '\u0150': 'O',
  1524. '\u014d': 'o', '\u014f': 'o', '\u0151': 'o',
  1525. '\u0154': 'R', '\u0156': 'R', '\u0158': 'R',
  1526. '\u0155': 'r', '\u0157': 'r', '\u0159': 'r',
  1527. '\u015a': 'S', '\u015c': 'S', '\u015e': 'S', '\u0160': 'S',
  1528. '\u015b': 's', '\u015d': 's', '\u015f': 's', '\u0161': 's',
  1529. '\u0162': 'T', '\u0164': 'T', '\u0166': 'T',
  1530. '\u0163': 't', '\u0165': 't', '\u0167': 't',
  1531. '\u0168': 'U', '\u016a': 'U', '\u016c': 'U', '\u016e': 'U', '\u0170': 'U', '\u0172': 'U',
  1532. '\u0169': 'u', '\u016b': 'u', '\u016d': 'u', '\u016f': 'u', '\u0171': 'u', '\u0173': 'u',
  1533. '\u0174': 'W', '\u0175': 'w',
  1534. '\u0176': 'Y', '\u0177': 'y', '\u0178': 'Y',
  1535. '\u0179': 'Z', '\u017b': 'Z', '\u017d': 'Z',
  1536. '\u017a': 'z', '\u017c': 'z', '\u017e': 'z',
  1537. '\u0132': 'IJ', '\u0133': 'ij',
  1538. '\u0152': 'Oe', '\u0153': 'oe',
  1539. '\u0149': "'n", '\u017f': 's'
  1540. };
  1541. /** Used to map characters to HTML entities. */
  1542. var htmlEscapes = {
  1543. '&': '&amp;',
  1544. '<': '&lt;',
  1545. '>': '&gt;',
  1546. '"': '&quot;',
  1547. "'": '&#39;'
  1548. };
  1549. /** Used to map HTML entities to characters. */
  1550. var htmlUnescapes = {
  1551. '&amp;': '&',
  1552. '&lt;': '<',
  1553. '&gt;': '>',
  1554. '&quot;': '"',
  1555. '&#39;': "'"
  1556. };
  1557. /** Used to escape characters for inclusion in compiled string literals. */
  1558. var stringEscapes = {
  1559. '\\': '\\',
  1560. "'": "'",
  1561. '\n': 'n',
  1562. '\r': 'r',
  1563. '\u2028': 'u2028',
  1564. '\u2029': 'u2029'
  1565. };
  1566. /** Built-in method references without a dependency on `root`. */
  1567. var freeParseFloat = parseFloat,
  1568. freeParseInt = parseInt;
  1569. /** Detect free variable `global` from Node.js. */
  1570. var freeGlobal = typeof __webpack_require__.g == 'object' && __webpack_require__.g && __webpack_require__.g.Object === Object && __webpack_require__.g;
  1571. /** Detect free variable `self`. */
  1572. var freeSelf = typeof self == 'object' && self && self.Object === Object && self;
  1573. /** Used as a reference to the global object. */
  1574. var root = freeGlobal || freeSelf || Function('return this')();
  1575. /** Detect free variable `exports`. */
  1576. var freeExports = true && exports && !exports.nodeType && exports;
  1577. /** Detect free variable `module`. */
  1578. var freeModule = freeExports && "object" == 'object' && module && !module.nodeType && module;
  1579. /** Detect the popular CommonJS extension `module.exports`. */
  1580. var moduleExports = freeModule && freeModule.exports === freeExports;
  1581. /** Detect free variable `process` from Node.js. */
  1582. var freeProcess = moduleExports && freeGlobal.process;
  1583. /** Used to access faster Node.js helpers. */
  1584. var nodeUtil = (function() {
  1585. try {
  1586. // Use `util.types` for Node.js 10+.
  1587. var types = freeModule && freeModule.require && freeModule.require('util').types;
  1588. if (types) {
  1589. return types;
  1590. }
  1591. // Legacy `process.binding('util')` for Node.js < 10.
  1592. return freeProcess && freeProcess.binding && freeProcess.binding('util');
  1593. } catch (e) {}
  1594. }());
  1595. /* Node.js helper references. */
  1596. var nodeIsArrayBuffer = nodeUtil && nodeUtil.isArrayBuffer,
  1597. nodeIsDate = nodeUtil && nodeUtil.isDate,
  1598. nodeIsMap = nodeUtil && nodeUtil.isMap,
  1599. nodeIsRegExp = nodeUtil && nodeUtil.isRegExp,
  1600. nodeIsSet = nodeUtil && nodeUtil.isSet,
  1601. nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray;
  1602. /*--------------------------------------------------------------------------*/
  1603. /**
  1604. * A faster alternative to `Function#apply`, this function invokes `func`
  1605. * with the `this` binding of `thisArg` and the arguments of `args`.
  1606. *
  1607. * @private
  1608. * @param {Function} func The function to invoke.
  1609. * @param {*} thisArg The `this` binding of `func`.
  1610. * @param {Array} args The arguments to invoke `func` with.
  1611. * @returns {*} Returns the result of `func`.
  1612. */
  1613. function apply(func, thisArg, args) {
  1614. switch (args.length) {
  1615. case 0: return func.call(thisArg);
  1616. case 1: return func.call(thisArg, args[0]);
  1617. case 2: return func.call(thisArg, args[0], args[1]);
  1618. case 3: return func.call(thisArg, args[0], args[1], args[2]);
  1619. }
  1620. return func.apply(thisArg, args);
  1621. }
  1622. /**
  1623. * A specialized version of `baseAggregator` for arrays.
  1624. *
  1625. * @private
  1626. * @param {Array} [array] The array to iterate over.
  1627. * @param {Function} setter The function to set `accumulator` values.
  1628. * @param {Function} iteratee The iteratee to transform keys.
  1629. * @param {Object} accumulator The initial aggregated object.
  1630. * @returns {Function} Returns `accumulator`.
  1631. */
  1632. function arrayAggregator(array, setter, iteratee, accumulator) {
  1633. var index = -1,
  1634. length = array == null ? 0 : array.length;
  1635. while (++index < length) {
  1636. var value = array[index];
  1637. setter(accumulator, value, iteratee(value), array);
  1638. }
  1639. return accumulator;
  1640. }
  1641. /**
  1642. * A specialized version of `_.forEach` for arrays without support for
  1643. * iteratee shorthands.
  1644. *
  1645. * @private
  1646. * @param {Array} [array] The array to iterate over.
  1647. * @param {Function} iteratee The function invoked per iteration.
  1648. * @returns {Array} Returns `array`.
  1649. */
  1650. function arrayEach(array, iteratee) {
  1651. var index = -1,
  1652. length = array == null ? 0 : array.length;
  1653. while (++index < length) {
  1654. if (iteratee(array[index], index, array) === false) {
  1655. break;
  1656. }
  1657. }
  1658. return array;
  1659. }
  1660. /**
  1661. * A specialized version of `_.forEachRight` for arrays without support for
  1662. * iteratee shorthands.
  1663. *
  1664. * @private
  1665. * @param {Array} [array] The array to iterate over.
  1666. * @param {Function} iteratee The function invoked per iteration.
  1667. * @returns {Array} Returns `array`.
  1668. */
  1669. function arrayEachRight(array, iteratee) {
  1670. var length = array == null ? 0 : array.length;
  1671. while (length--) {
  1672. if (iteratee(array[length], length, array) === false) {
  1673. break;
  1674. }
  1675. }
  1676. return array;
  1677. }
  1678. /**
  1679. * A specialized version of `_.every` for arrays without support for
  1680. * iteratee shorthands.
  1681. *
  1682. * @private
  1683. * @param {Array} [array] The array to iterate over.
  1684. * @param {Function} predicate The function invoked per iteration.
  1685. * @returns {boolean} Returns `true` if all elements pass the predicate check,
  1686. * else `false`.
  1687. */
  1688. function arrayEvery(array, predicate) {
  1689. var index = -1,
  1690. length = array == null ? 0 : array.length;
  1691. while (++index < length) {
  1692. if (!predicate(array[index], index, array)) {
  1693. return false;
  1694. }
  1695. }
  1696. return true;
  1697. }
  1698. /**
  1699. * A specialized version of `_.filter` for arrays without support for
  1700. * iteratee shorthands.
  1701. *
  1702. * @private
  1703. * @param {Array} [array] The array to iterate over.
  1704. * @param {Function} predicate The function invoked per iteration.
  1705. * @returns {Array} Returns the new filtered array.
  1706. */
  1707. function arrayFilter(array, predicate) {
  1708. var index = -1,
  1709. length = array == null ? 0 : array.length,
  1710. resIndex = 0,
  1711. result = [];
  1712. while (++index < length) {
  1713. var value = array[index];
  1714. if (predicate(value, index, array)) {
  1715. result[resIndex++] = value;
  1716. }
  1717. }
  1718. return result;
  1719. }
  1720. /**
  1721. * A specialized version of `_.includes` for arrays without support for
  1722. * specifying an index to search from.
  1723. *
  1724. * @private
  1725. * @param {Array} [array] The array to inspect.
  1726. * @param {*} target The value to search for.
  1727. * @returns {boolean} Returns `true` if `target` is found, else `false`.
  1728. */
  1729. function arrayIncludes(array, value) {
  1730. var length = array == null ? 0 : array.length;
  1731. return !!length && baseIndexOf(array, value, 0) > -1;
  1732. }
  1733. /**
  1734. * This function is like `arrayIncludes` except that it accepts a comparator.
  1735. *
  1736. * @private
  1737. * @param {Array} [array] The array to inspect.
  1738. * @param {*} target The value to search for.
  1739. * @param {Function} comparator The comparator invoked per element.
  1740. * @returns {boolean} Returns `true` if `target` is found, else `false`.
  1741. */
  1742. function arrayIncludesWith(array, value, comparator) {
  1743. var index = -1,
  1744. length = array == null ? 0 : array.length;
  1745. while (++index < length) {
  1746. if (comparator(value, array[index])) {
  1747. return true;
  1748. }
  1749. }
  1750. return false;
  1751. }
  1752. /**
  1753. * A specialized version of `_.map` for arrays without support for iteratee
  1754. * shorthands.
  1755. *
  1756. * @private
  1757. * @param {Array} [array] The array to iterate over.
  1758. * @param {Function} iteratee The function invoked per iteration.
  1759. * @returns {Array} Returns the new mapped array.
  1760. */
  1761. function arrayMap(array, iteratee) {
  1762. var index = -1,
  1763. length = array == null ? 0 : array.length,
  1764. result = Array(length);
  1765. while (++index < length) {
  1766. result[index] = iteratee(array[index], index, array);
  1767. }
  1768. return result;
  1769. }
  1770. /**
  1771. * Appends the elements of `values` to `array`.
  1772. *
  1773. * @private
  1774. * @param {Array} array The array to modify.
  1775. * @param {Array} values The values to append.
  1776. * @returns {Array} Returns `array`.
  1777. */
  1778. function arrayPush(array, values) {
  1779. var index = -1,
  1780. length = values.length,
  1781. offset = array.length;
  1782. while (++index < length) {
  1783. array[offset + index] = values[index];
  1784. }
  1785. return array;
  1786. }
  1787. /**
  1788. * A specialized version of `_.reduce` for arrays without support for
  1789. * iteratee shorthands.
  1790. *
  1791. * @private
  1792. * @param {Array} [array] The array to iterate over.
  1793. * @param {Function} iteratee The function invoked per iteration.
  1794. * @param {*} [accumulator] The initial value.
  1795. * @param {boolean} [initAccum] Specify using the first element of `array` as
  1796. * the initial value.
  1797. * @returns {*} Returns the accumulated value.
  1798. */
  1799. function arrayReduce(array, iteratee, accumulator, initAccum) {
  1800. var index = -1,
  1801. length = array == null ? 0 : array.length;
  1802. if (initAccum && length) {
  1803. accumulator = array[++index];
  1804. }
  1805. while (++index < length) {
  1806. accumulator = iteratee(accumulator, array[index], index, array);
  1807. }
  1808. return accumulator;
  1809. }
  1810. /**
  1811. * A specialized version of `_.reduceRight` for arrays without support for
  1812. * iteratee shorthands.
  1813. *
  1814. * @private
  1815. * @param {Array} [array] The array to iterate over.
  1816. * @param {Function} iteratee The function invoked per iteration.
  1817. * @param {*} [accumulator] The initial value.
  1818. * @param {boolean} [initAccum] Specify using the last element of `array` as
  1819. * the initial value.
  1820. * @returns {*} Returns the accumulated value.
  1821. */
  1822. function arrayReduceRight(array, iteratee, accumulator, initAccum) {
  1823. var length = array == null ? 0 : array.length;
  1824. if (initAccum && length) {
  1825. accumulator = array[--length];
  1826. }
  1827. while (length--) {
  1828. accumulator = iteratee(accumulator, array[length], length, array);
  1829. }
  1830. return accumulator;
  1831. }
  1832. /**
  1833. * A specialized version of `_.some` for arrays without support for iteratee
  1834. * shorthands.
  1835. *
  1836. * @private
  1837. * @param {Array} [array] The array to iterate over.
  1838. * @param {Function} predicate The function invoked per iteration.
  1839. * @returns {boolean} Returns `true` if any element passes the predicate check,
  1840. * else `false`.
  1841. */
  1842. function arraySome(array, predicate) {
  1843. var index = -1,
  1844. length = array == null ? 0 : array.length;
  1845. while (++index < length) {
  1846. if (predicate(array[index], index, array)) {
  1847. return true;
  1848. }
  1849. }
  1850. return false;
  1851. }
  1852. /**
  1853. * Gets the size of an ASCII `string`.
  1854. *
  1855. * @private
  1856. * @param {string} string The string inspect.
  1857. * @returns {number} Returns the string size.
  1858. */
  1859. var asciiSize = baseProperty('length');
  1860. /**
  1861. * Converts an ASCII `string` to an array.
  1862. *
  1863. * @private
  1864. * @param {string} string The string to convert.
  1865. * @returns {Array} Returns the converted array.
  1866. */
  1867. function asciiToArray(string) {
  1868. return string.split('');
  1869. }
  1870. /**
  1871. * Splits an ASCII `string` into an array of its words.
  1872. *
  1873. * @private
  1874. * @param {string} The string to inspect.
  1875. * @returns {Array} Returns the words of `string`.
  1876. */
  1877. function asciiWords(string) {
  1878. return string.match(reAsciiWord) || [];
  1879. }
  1880. /**
  1881. * The base implementation of methods like `_.findKey` and `_.findLastKey`,
  1882. * without support for iteratee shorthands, which iterates over `collection`
  1883. * using `eachFunc`.
  1884. *
  1885. * @private
  1886. * @param {Array|Object} collection The collection to inspect.
  1887. * @param {Function} predicate The function invoked per iteration.
  1888. * @param {Function} eachFunc The function to iterate over `collection`.
  1889. * @returns {*} Returns the found element or its key, else `undefined`.
  1890. */
  1891. function baseFindKey(collection, predicate, eachFunc) {
  1892. var result;
  1893. eachFunc(collection, function(value, key, collection) {
  1894. if (predicate(value, key, collection)) {
  1895. result = key;
  1896. return false;
  1897. }
  1898. });
  1899. return result;
  1900. }
  1901. /**
  1902. * The base implementation of `_.findIndex` and `_.findLastIndex` without
  1903. * support for iteratee shorthands.
  1904. *
  1905. * @private
  1906. * @param {Array} array The array to inspect.
  1907. * @param {Function} predicate The function invoked per iteration.
  1908. * @param {number} fromIndex The index to search from.
  1909. * @param {boolean} [fromRight] Specify iterating from right to left.
  1910. * @returns {number} Returns the index of the matched value, else `-1`.
  1911. */
  1912. function baseFindIndex(array, predicate, fromIndex, fromRight) {
  1913. var length = array.length,
  1914. index = fromIndex + (fromRight ? 1 : -1);
  1915. while ((fromRight ? index-- : ++index < length)) {
  1916. if (predicate(array[index], index, array)) {
  1917. return index;
  1918. }
  1919. }
  1920. return -1;
  1921. }
  1922. /**
  1923. * The base implementation of `_.indexOf` without `fromIndex` bounds checks.
  1924. *
  1925. * @private
  1926. * @param {Array} array The array to inspect.
  1927. * @param {*} value The value to search for.
  1928. * @param {number} fromIndex The index to search from.
  1929. * @returns {number} Returns the index of the matched value, else `-1`.
  1930. */
  1931. function baseIndexOf(array, value, fromIndex) {
  1932. return value === value
  1933. ? strictIndexOf(array, value, fromIndex)
  1934. : baseFindIndex(array, baseIsNaN, fromIndex);
  1935. }
  1936. /**
  1937. * This function is like `baseIndexOf` except that it accepts a comparator.
  1938. *
  1939. * @private
  1940. * @param {Array} array The array to inspect.
  1941. * @param {*} value The value to search for.
  1942. * @param {number} fromIndex The index to search from.
  1943. * @param {Function} comparator The comparator invoked per element.
  1944. * @returns {number} Returns the index of the matched value, else `-1`.
  1945. */
  1946. function baseIndexOfWith(array, value, fromIndex, comparator) {
  1947. var index = fromIndex - 1,
  1948. length = array.length;
  1949. while (++index < length) {
  1950. if (comparator(array[index], value)) {
  1951. return index;
  1952. }
  1953. }
  1954. return -1;
  1955. }
  1956. /**
  1957. * The base implementation of `_.isNaN` without support for number objects.
  1958. *
  1959. * @private
  1960. * @param {*} value The value to check.
  1961. * @returns {boolean} Returns `true` if `value` is `NaN`, else `false`.
  1962. */
  1963. function baseIsNaN(value) {
  1964. return value !== value;
  1965. }
  1966. /**
  1967. * The base implementation of `_.mean` and `_.meanBy` without support for
  1968. * iteratee shorthands.
  1969. *
  1970. * @private
  1971. * @param {Array} array The array to iterate over.
  1972. * @param {Function} iteratee The function invoked per iteration.
  1973. * @returns {number} Returns the mean.
  1974. */
  1975. function baseMean(array, iteratee) {
  1976. var length = array == null ? 0 : array.length;
  1977. return length ? (baseSum(array, iteratee) / length) : NAN;
  1978. }
  1979. /**
  1980. * The base implementation of `_.property` without support for deep paths.
  1981. *
  1982. * @private
  1983. * @param {string} key The key of the property to get.
  1984. * @returns {Function} Returns the new accessor function.
  1985. */
  1986. function baseProperty(key) {
  1987. return function(object) {
  1988. return object == null ? undefined : object[key];
  1989. };
  1990. }
  1991. /**
  1992. * The base implementation of `_.propertyOf` without support for deep paths.
  1993. *
  1994. * @private
  1995. * @param {Object} object The object to query.
  1996. * @returns {Function} Returns the new accessor function.
  1997. */
  1998. function basePropertyOf(object) {
  1999. return function(key) {
  2000. return object == null ? undefined : object[key];
  2001. };
  2002. }
  2003. /**
  2004. * The base implementation of `_.reduce` and `_.reduceRight`, without support
  2005. * for iteratee shorthands, which iterates over `collection` using `eachFunc`.
  2006. *
  2007. * @private
  2008. * @param {Array|Object} collection The collection to iterate over.
  2009. * @param {Function} iteratee The function invoked per iteration.
  2010. * @param {*} accumulator The initial value.
  2011. * @param {boolean} initAccum Specify using the first or last element of
  2012. * `collection` as the initial value.
  2013. * @param {Function} eachFunc The function to iterate over `collection`.
  2014. * @returns {*} Returns the accumulated value.
  2015. */
  2016. function baseReduce(collection, iteratee, accumulator, initAccum, eachFunc) {
  2017. eachFunc(collection, function(value, index, collection) {
  2018. accumulator = initAccum
  2019. ? (initAccum = false, value)
  2020. : iteratee(accumulator, value, index, collection);
  2021. });
  2022. return accumulator;
  2023. }
  2024. /**
  2025. * The base implementation of `_.sortBy` which uses `comparer` to define the
  2026. * sort order of `array` and replaces criteria objects with their corresponding
  2027. * values.
  2028. *
  2029. * @private
  2030. * @param {Array} array The array to sort.
  2031. * @param {Function} comparer The function to define sort order.
  2032. * @returns {Array} Returns `array`.
  2033. */
  2034. function baseSortBy(array, comparer) {
  2035. var length = array.length;
  2036. array.sort(comparer);
  2037. while (length--) {
  2038. array[length] = array[length].value;
  2039. }
  2040. return array;
  2041. }
  2042. /**
  2043. * The base implementation of `_.sum` and `_.sumBy` without support for
  2044. * iteratee shorthands.
  2045. *
  2046. * @private
  2047. * @param {Array} array The array to iterate over.
  2048. * @param {Function} iteratee The function invoked per iteration.
  2049. * @returns {number} Returns the sum.
  2050. */
  2051. function baseSum(array, iteratee) {
  2052. var result,
  2053. index = -1,
  2054. length = array.length;
  2055. while (++index < length) {
  2056. var current = iteratee(array[index]);
  2057. if (current !== undefined) {
  2058. result = result === undefined ? current : (result + current);
  2059. }
  2060. }
  2061. return result;
  2062. }
  2063. /**
  2064. * The base implementation of `_.times` without support for iteratee shorthands
  2065. * or max array length checks.
  2066. *
  2067. * @private
  2068. * @param {number} n The number of times to invoke `iteratee`.
  2069. * @param {Function} iteratee The function invoked per iteration.
  2070. * @returns {Array} Returns the array of results.
  2071. */
  2072. function baseTimes(n, iteratee) {
  2073. var index = -1,
  2074. result = Array(n);
  2075. while (++index < n) {
  2076. result[index] = iteratee(index);
  2077. }
  2078. return result;
  2079. }
  2080. /**
  2081. * The base implementation of `_.toPairs` and `_.toPairsIn` which creates an array
  2082. * of key-value pairs for `object` corresponding to the property names of `props`.
  2083. *
  2084. * @private
  2085. * @param {Object} object The object to query.
  2086. * @param {Array} props The property names to get values for.
  2087. * @returns {Object} Returns the key-value pairs.
  2088. */
  2089. function baseToPairs(object, props) {
  2090. return arrayMap(props, function(key) {
  2091. return [key, object[key]];
  2092. });
  2093. }
  2094. /**
  2095. * The base implementation of `_.trim`.
  2096. *
  2097. * @private
  2098. * @param {string} string The string to trim.
  2099. * @returns {string} Returns the trimmed string.
  2100. */
  2101. function baseTrim(string) {
  2102. return string
  2103. ? string.slice(0, trimmedEndIndex(string) + 1).replace(reTrimStart, '')
  2104. : string;
  2105. }
  2106. /**
  2107. * The base implementation of `_.unary` without support for storing metadata.
  2108. *
  2109. * @private
  2110. * @param {Function} func The function to cap arguments for.
  2111. * @returns {Function} Returns the new capped function.
  2112. */
  2113. function baseUnary(func) {
  2114. return function(value) {
  2115. return func(value);
  2116. };
  2117. }
  2118. /**
  2119. * The base implementation of `_.values` and `_.valuesIn` which creates an
  2120. * array of `object` property values corresponding to the property names
  2121. * of `props`.
  2122. *
  2123. * @private
  2124. * @param {Object} object The object to query.
  2125. * @param {Array} props The property names to get values for.
  2126. * @returns {Object} Returns the array of property values.
  2127. */
  2128. function baseValues(object, props) {
  2129. return arrayMap(props, function(key) {
  2130. return object[key];
  2131. });
  2132. }
  2133. /**
  2134. * Checks if a `cache` value for `key` exists.
  2135. *
  2136. * @private
  2137. * @param {Object} cache The cache to query.
  2138. * @param {string} key The key of the entry to check.
  2139. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  2140. */
  2141. function cacheHas(cache, key) {
  2142. return cache.has(key);
  2143. }
  2144. /**
  2145. * Used by `_.trim` and `_.trimStart` to get the index of the first string symbol
  2146. * that is not found in the character symbols.
  2147. *
  2148. * @private
  2149. * @param {Array} strSymbols The string symbols to inspect.
  2150. * @param {Array} chrSymbols The character symbols to find.
  2151. * @returns {number} Returns the index of the first unmatched string symbol.
  2152. */
  2153. function charsStartIndex(strSymbols, chrSymbols) {
  2154. var index = -1,
  2155. length = strSymbols.length;
  2156. while (++index < length && baseIndexOf(chrSymbols, strSymbols[index], 0) > -1) {}
  2157. return index;
  2158. }
  2159. /**
  2160. * Used by `_.trim` and `_.trimEnd` to get the index of the last string symbol
  2161. * that is not found in the character symbols.
  2162. *
  2163. * @private
  2164. * @param {Array} strSymbols The string symbols to inspect.
  2165. * @param {Array} chrSymbols The character symbols to find.
  2166. * @returns {number} Returns the index of the last unmatched string symbol.
  2167. */
  2168. function charsEndIndex(strSymbols, chrSymbols) {
  2169. var index = strSymbols.length;
  2170. while (index-- && baseIndexOf(chrSymbols, strSymbols[index], 0) > -1) {}
  2171. return index;
  2172. }
  2173. /**
  2174. * Gets the number of `placeholder` occurrences in `array`.
  2175. *
  2176. * @private
  2177. * @param {Array} array The array to inspect.
  2178. * @param {*} placeholder The placeholder to search for.
  2179. * @returns {number} Returns the placeholder count.
  2180. */
  2181. function countHolders(array, placeholder) {
  2182. var length = array.length,
  2183. result = 0;
  2184. while (length--) {
  2185. if (array[length] === placeholder) {
  2186. ++result;
  2187. }
  2188. }
  2189. return result;
  2190. }
  2191. /**
  2192. * Used by `_.deburr` to convert Latin-1 Supplement and Latin Extended-A
  2193. * letters to basic Latin letters.
  2194. *
  2195. * @private
  2196. * @param {string} letter The matched letter to deburr.
  2197. * @returns {string} Returns the deburred letter.
  2198. */
  2199. var deburrLetter = basePropertyOf(deburredLetters);
  2200. /**
  2201. * Used by `_.escape` to convert characters to HTML entities.
  2202. *
  2203. * @private
  2204. * @param {string} chr The matched character to escape.
  2205. * @returns {string} Returns the escaped character.
  2206. */
  2207. var escapeHtmlChar = basePropertyOf(htmlEscapes);
  2208. /**
  2209. * Used by `_.template` to escape characters for inclusion in compiled string literals.
  2210. *
  2211. * @private
  2212. * @param {string} chr The matched character to escape.
  2213. * @returns {string} Returns the escaped character.
  2214. */
  2215. function escapeStringChar(chr) {
  2216. return '\\' + stringEscapes[chr];
  2217. }
  2218. /**
  2219. * Gets the value at `key` of `object`.
  2220. *
  2221. * @private
  2222. * @param {Object} [object] The object to query.
  2223. * @param {string} key The key of the property to get.
  2224. * @returns {*} Returns the property value.
  2225. */
  2226. function getValue(object, key) {
  2227. return object == null ? undefined : object[key];
  2228. }
  2229. /**
  2230. * Checks if `string` contains Unicode symbols.
  2231. *
  2232. * @private
  2233. * @param {string} string The string to inspect.
  2234. * @returns {boolean} Returns `true` if a symbol is found, else `false`.
  2235. */
  2236. function hasUnicode(string) {
  2237. return reHasUnicode.test(string);
  2238. }
  2239. /**
  2240. * Checks if `string` contains a word composed of Unicode symbols.
  2241. *
  2242. * @private
  2243. * @param {string} string The string to inspect.
  2244. * @returns {boolean} Returns `true` if a word is found, else `false`.
  2245. */
  2246. function hasUnicodeWord(string) {
  2247. return reHasUnicodeWord.test(string);
  2248. }
  2249. /**
  2250. * Converts `iterator` to an array.
  2251. *
  2252. * @private
  2253. * @param {Object} iterator The iterator to convert.
  2254. * @returns {Array} Returns the converted array.
  2255. */
  2256. function iteratorToArray(iterator) {
  2257. var data,
  2258. result = [];
  2259. while (!(data = iterator.next()).done) {
  2260. result.push(data.value);
  2261. }
  2262. return result;
  2263. }
  2264. /**
  2265. * Converts `map` to its key-value pairs.
  2266. *
  2267. * @private
  2268. * @param {Object} map The map to convert.
  2269. * @returns {Array} Returns the key-value pairs.
  2270. */
  2271. function mapToArray(map) {
  2272. var index = -1,
  2273. result = Array(map.size);
  2274. map.forEach(function(value, key) {
  2275. result[++index] = [key, value];
  2276. });
  2277. return result;
  2278. }
  2279. /**
  2280. * Creates a unary function that invokes `func` with its argument transformed.
  2281. *
  2282. * @private
  2283. * @param {Function} func The function to wrap.
  2284. * @param {Function} transform The argument transform.
  2285. * @returns {Function} Returns the new function.
  2286. */
  2287. function overArg(func, transform) {
  2288. return function(arg) {
  2289. return func(transform(arg));
  2290. };
  2291. }
  2292. /**
  2293. * Replaces all `placeholder` elements in `array` with an internal placeholder
  2294. * and returns an array of their indexes.
  2295. *
  2296. * @private
  2297. * @param {Array} array The array to modify.
  2298. * @param {*} placeholder The placeholder to replace.
  2299. * @returns {Array} Returns the new array of placeholder indexes.
  2300. */
  2301. function replaceHolders(array, placeholder) {
  2302. var index = -1,
  2303. length = array.length,
  2304. resIndex = 0,
  2305. result = [];
  2306. while (++index < length) {
  2307. var value = array[index];
  2308. if (value === placeholder || value === PLACEHOLDER) {
  2309. array[index] = PLACEHOLDER;
  2310. result[resIndex++] = index;
  2311. }
  2312. }
  2313. return result;
  2314. }
  2315. /**
  2316. * Converts `set` to an array of its values.
  2317. *
  2318. * @private
  2319. * @param {Object} set The set to convert.
  2320. * @returns {Array} Returns the values.
  2321. */
  2322. function setToArray(set) {
  2323. var index = -1,
  2324. result = Array(set.size);
  2325. set.forEach(function(value) {
  2326. result[++index] = value;
  2327. });
  2328. return result;
  2329. }
  2330. /**
  2331. * Converts `set` to its value-value pairs.
  2332. *
  2333. * @private
  2334. * @param {Object} set The set to convert.
  2335. * @returns {Array} Returns the value-value pairs.
  2336. */
  2337. function setToPairs(set) {
  2338. var index = -1,
  2339. result = Array(set.size);
  2340. set.forEach(function(value) {
  2341. result[++index] = [value, value];
  2342. });
  2343. return result;
  2344. }
  2345. /**
  2346. * A specialized version of `_.indexOf` which performs strict equality
  2347. * comparisons of values, i.e. `===`.
  2348. *
  2349. * @private
  2350. * @param {Array} array The array to inspect.
  2351. * @param {*} value The value to search for.
  2352. * @param {number} fromIndex The index to search from.
  2353. * @returns {number} Returns the index of the matched value, else `-1`.
  2354. */
  2355. function strictIndexOf(array, value, fromIndex) {
  2356. var index = fromIndex - 1,
  2357. length = array.length;
  2358. while (++index < length) {
  2359. if (array[index] === value) {
  2360. return index;
  2361. }
  2362. }
  2363. return -1;
  2364. }
  2365. /**
  2366. * A specialized version of `_.lastIndexOf` which performs strict equality
  2367. * comparisons of values, i.e. `===`.
  2368. *
  2369. * @private
  2370. * @param {Array} array The array to inspect.
  2371. * @param {*} value The value to search for.
  2372. * @param {number} fromIndex The index to search from.
  2373. * @returns {number} Returns the index of the matched value, else `-1`.
  2374. */
  2375. function strictLastIndexOf(array, value, fromIndex) {
  2376. var index = fromIndex + 1;
  2377. while (index--) {
  2378. if (array[index] === value) {
  2379. return index;
  2380. }
  2381. }
  2382. return index;
  2383. }
  2384. /**
  2385. * Gets the number of symbols in `string`.
  2386. *
  2387. * @private
  2388. * @param {string} string The string to inspect.
  2389. * @returns {number} Returns the string size.
  2390. */
  2391. function stringSize(string) {
  2392. return hasUnicode(string)
  2393. ? unicodeSize(string)
  2394. : asciiSize(string);
  2395. }
  2396. /**
  2397. * Converts `string` to an array.
  2398. *
  2399. * @private
  2400. * @param {string} string The string to convert.
  2401. * @returns {Array} Returns the converted array.
  2402. */
  2403. function stringToArray(string) {
  2404. return hasUnicode(string)
  2405. ? unicodeToArray(string)
  2406. : asciiToArray(string);
  2407. }
  2408. /**
  2409. * Used by `_.trim` and `_.trimEnd` to get the index of the last non-whitespace
  2410. * character of `string`.
  2411. *
  2412. * @private
  2413. * @param {string} string The string to inspect.
  2414. * @returns {number} Returns the index of the last non-whitespace character.
  2415. */
  2416. function trimmedEndIndex(string) {
  2417. var index = string.length;
  2418. while (index-- && reWhitespace.test(string.charAt(index))) {}
  2419. return index;
  2420. }
  2421. /**
  2422. * Used by `_.unescape` to convert HTML entities to characters.
  2423. *
  2424. * @private
  2425. * @param {string} chr The matched character to unescape.
  2426. * @returns {string} Returns the unescaped character.
  2427. */
  2428. var unescapeHtmlChar = basePropertyOf(htmlUnescapes);
  2429. /**
  2430. * Gets the size of a Unicode `string`.
  2431. *
  2432. * @private
  2433. * @param {string} string The string inspect.
  2434. * @returns {number} Returns the string size.
  2435. */
  2436. function unicodeSize(string) {
  2437. var result = reUnicode.lastIndex = 0;
  2438. while (reUnicode.test(string)) {
  2439. ++result;
  2440. }
  2441. return result;
  2442. }
  2443. /**
  2444. * Converts a Unicode `string` to an array.
  2445. *
  2446. * @private
  2447. * @param {string} string The string to convert.
  2448. * @returns {Array} Returns the converted array.
  2449. */
  2450. function unicodeToArray(string) {
  2451. return string.match(reUnicode) || [];
  2452. }
  2453. /**
  2454. * Splits a Unicode `string` into an array of its words.
  2455. *
  2456. * @private
  2457. * @param {string} The string to inspect.
  2458. * @returns {Array} Returns the words of `string`.
  2459. */
  2460. function unicodeWords(string) {
  2461. return string.match(reUnicodeWord) || [];
  2462. }
  2463. /*--------------------------------------------------------------------------*/
  2464. /**
  2465. * Create a new pristine `lodash` function using the `context` object.
  2466. *
  2467. * @static
  2468. * @memberOf _
  2469. * @since 1.1.0
  2470. * @category Util
  2471. * @param {Object} [context=root] The context object.
  2472. * @returns {Function} Returns a new `lodash` function.
  2473. * @example
  2474. *
  2475. * _.mixin({ 'foo': _.constant('foo') });
  2476. *
  2477. * var lodash = _.runInContext();
  2478. * lodash.mixin({ 'bar': lodash.constant('bar') });
  2479. *
  2480. * _.isFunction(_.foo);
  2481. * // => true
  2482. * _.isFunction(_.bar);
  2483. * // => false
  2484. *
  2485. * lodash.isFunction(lodash.foo);
  2486. * // => false
  2487. * lodash.isFunction(lodash.bar);
  2488. * // => true
  2489. *
  2490. * // Create a suped-up `defer` in Node.js.
  2491. * var defer = _.runInContext({ 'setTimeout': setImmediate }).defer;
  2492. */
  2493. var runInContext = (function runInContext(context) {
  2494. context = context == null ? root : _.defaults(root.Object(), context, _.pick(root, contextProps));
  2495. /** Built-in constructor references. */
  2496. var Array = context.Array,
  2497. Date = context.Date,
  2498. Error = context.Error,
  2499. Function = context.Function,
  2500. Math = context.Math,
  2501. Object = context.Object,
  2502. RegExp = context.RegExp,
  2503. String = context.String,
  2504. TypeError = context.TypeError;
  2505. /** Used for built-in method references. */
  2506. var arrayProto = Array.prototype,
  2507. funcProto = Function.prototype,
  2508. objectProto = Object.prototype;
  2509. /** Used to detect overreaching core-js shims. */
  2510. var coreJsData = context['__core-js_shared__'];
  2511. /** Used to resolve the decompiled source of functions. */
  2512. var funcToString = funcProto.toString;
  2513. /** Used to check objects for own properties. */
  2514. var hasOwnProperty = objectProto.hasOwnProperty;
  2515. /** Used to generate unique IDs. */
  2516. var idCounter = 0;
  2517. /** Used to detect methods masquerading as native. */
  2518. var maskSrcKey = (function() {
  2519. var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || '');
  2520. return uid ? ('Symbol(src)_1.' + uid) : '';
  2521. }());
  2522. /**
  2523. * Used to resolve the
  2524. * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
  2525. * of values.
  2526. */
  2527. var nativeObjectToString = objectProto.toString;
  2528. /** Used to infer the `Object` constructor. */
  2529. var objectCtorString = funcToString.call(Object);
  2530. /** Used to restore the original `_` reference in `_.noConflict`. */
  2531. var oldDash = root._;
  2532. /** Used to detect if a method is native. */
  2533. var reIsNative = RegExp('^' +
  2534. funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\$&')
  2535. .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$'
  2536. );
  2537. /** Built-in value references. */
  2538. var Buffer = moduleExports ? context.Buffer : undefined,
  2539. Symbol = context.Symbol,
  2540. Uint8Array = context.Uint8Array,
  2541. allocUnsafe = Buffer ? Buffer.allocUnsafe : undefined,
  2542. getPrototype = overArg(Object.getPrototypeOf, Object),
  2543. objectCreate = Object.create,
  2544. propertyIsEnumerable = objectProto.propertyIsEnumerable,
  2545. splice = arrayProto.splice,
  2546. spreadableSymbol = Symbol ? Symbol.isConcatSpreadable : undefined,
  2547. symIterator = Symbol ? Symbol.iterator : undefined,
  2548. symToStringTag = Symbol ? Symbol.toStringTag : undefined;
  2549. var defineProperty = (function() {
  2550. try {
  2551. var func = getNative(Object, 'defineProperty');
  2552. func({}, '', {});
  2553. return func;
  2554. } catch (e) {}
  2555. }());
  2556. /** Mocked built-ins. */
  2557. var ctxClearTimeout = context.clearTimeout !== root.clearTimeout && context.clearTimeout,
  2558. ctxNow = Date && Date.now !== root.Date.now && Date.now,
  2559. ctxSetTimeout = context.setTimeout !== root.setTimeout && context.setTimeout;
  2560. /* Built-in method references for those with the same name as other `lodash` methods. */
  2561. var nativeCeil = Math.ceil,
  2562. nativeFloor = Math.floor,
  2563. nativeGetSymbols = Object.getOwnPropertySymbols,
  2564. nativeIsBuffer = Buffer ? Buffer.isBuffer : undefined,
  2565. nativeIsFinite = context.isFinite,
  2566. nativeJoin = arrayProto.join,
  2567. nativeKeys = overArg(Object.keys, Object),
  2568. nativeMax = Math.max,
  2569. nativeMin = Math.min,
  2570. nativeNow = Date.now,
  2571. nativeParseInt = context.parseInt,
  2572. nativeRandom = Math.random,
  2573. nativeReverse = arrayProto.reverse;
  2574. /* Built-in method references that are verified to be native. */
  2575. var DataView = getNative(context, 'DataView'),
  2576. Map = getNative(context, 'Map'),
  2577. Promise = getNative(context, 'Promise'),
  2578. Set = getNative(context, 'Set'),
  2579. WeakMap = getNative(context, 'WeakMap'),
  2580. nativeCreate = getNative(Object, 'create');
  2581. /** Used to store function metadata. */
  2582. var metaMap = WeakMap && new WeakMap;
  2583. /** Used to lookup unminified function names. */
  2584. var realNames = {};
  2585. /** Used to detect maps, sets, and weakmaps. */
  2586. var dataViewCtorString = toSource(DataView),
  2587. mapCtorString = toSource(Map),
  2588. promiseCtorString = toSource(Promise),
  2589. setCtorString = toSource(Set),
  2590. weakMapCtorString = toSource(WeakMap);
  2591. /** Used to convert symbols to primitives and strings. */
  2592. var symbolProto = Symbol ? Symbol.prototype : undefined,
  2593. symbolValueOf = symbolProto ? symbolProto.valueOf : undefined,
  2594. symbolToString = symbolProto ? symbolProto.toString : undefined;
  2595. /*------------------------------------------------------------------------*/
  2596. /**
  2597. * Creates a `lodash` object which wraps `value` to enable implicit method
  2598. * chain sequences. Methods that operate on and return arrays, collections,
  2599. * and functions can be chained together. Methods that retrieve a single value
  2600. * or may return a primitive value will automatically end the chain sequence
  2601. * and return the unwrapped value. Otherwise, the value must be unwrapped
  2602. * with `_#value`.
  2603. *
  2604. * Explicit chain sequences, which must be unwrapped with `_#value`, may be
  2605. * enabled using `_.chain`.
  2606. *
  2607. * The execution of chained methods is lazy, that is, it's deferred until
  2608. * `_#value` is implicitly or explicitly called.
  2609. *
  2610. * Lazy evaluation allows several methods to support shortcut fusion.
  2611. * Shortcut fusion is an optimization to merge iteratee calls; this avoids
  2612. * the creation of intermediate arrays and can greatly reduce the number of
  2613. * iteratee executions. Sections of a chain sequence qualify for shortcut
  2614. * fusion if the section is applied to an array and iteratees accept only
  2615. * one argument. The heuristic for whether a section qualifies for shortcut
  2616. * fusion is subject to change.
  2617. *
  2618. * Chaining is supported in custom builds as long as the `_#value` method is
  2619. * directly or indirectly included in the build.
  2620. *
  2621. * In addition to lodash methods, wrappers have `Array` and `String` methods.
  2622. *
  2623. * The wrapper `Array` methods are:
  2624. * `concat`, `join`, `pop`, `push`, `shift`, `sort`, `splice`, and `unshift`
  2625. *
  2626. * The wrapper `String` methods are:
  2627. * `replace` and `split`
  2628. *
  2629. * The wrapper methods that support shortcut fusion are:
  2630. * `at`, `compact`, `drop`, `dropRight`, `dropWhile`, `filter`, `find`,
  2631. * `findLast`, `head`, `initial`, `last`, `map`, `reject`, `reverse`, `slice`,
  2632. * `tail`, `take`, `takeRight`, `takeRightWhile`, `takeWhile`, and `toArray`
  2633. *
  2634. * The chainable wrapper methods are:
  2635. * `after`, `ary`, `assign`, `assignIn`, `assignInWith`, `assignWith`, `at`,
  2636. * `before`, `bind`, `bindAll`, `bindKey`, `castArray`, `chain`, `chunk`,
  2637. * `commit`, `compact`, `concat`, `conforms`, `constant`, `countBy`, `create`,
  2638. * `curry`, `debounce`, `defaults`, `defaultsDeep`, `defer`, `delay`,
  2639. * `difference`, `differenceBy`, `differenceWith`, `drop`, `dropRight`,
  2640. * `dropRightWhile`, `dropWhile`, `extend`, `extendWith`, `fill`, `filter`,
  2641. * `flatMap`, `flatMapDeep`, `flatMapDepth`, `flatten`, `flattenDeep`,
  2642. * `flattenDepth`, `flip`, `flow`, `flowRight`, `fromPairs`, `functions`,
  2643. * `functionsIn`, `groupBy`, `initial`, `intersection`, `intersectionBy`,
  2644. * `intersectionWith`, `invert`, `invertBy`, `invokeMap`, `iteratee`, `keyBy`,
  2645. * `keys`, `keysIn`, `map`, `mapKeys`, `mapValues`, `matches`, `matchesProperty`,
  2646. * `memoize`, `merge`, `mergeWith`, `method`, `methodOf`, `mixin`, `negate`,
  2647. * `nthArg`, `omit`, `omitBy`, `once`, `orderBy`, `over`, `overArgs`,
  2648. * `overEvery`, `overSome`, `partial`, `partialRight`, `partition`, `pick`,
  2649. * `pickBy`, `plant`, `property`, `propertyOf`, `pull`, `pullAll`, `pullAllBy`,
  2650. * `pullAllWith`, `pullAt`, `push`, `range`, `rangeRight`, `rearg`, `reject`,
  2651. * `remove`, `rest`, `reverse`, `sampleSize`, `set`, `setWith`, `shuffle`,
  2652. * `slice`, `sort`, `sortBy`, `splice`, `spread`, `tail`, `take`, `takeRight`,
  2653. * `takeRightWhile`, `takeWhile`, `tap`, `throttle`, `thru`, `toArray`,
  2654. * `toPairs`, `toPairsIn`, `toPath`, `toPlainObject`, `transform`, `unary`,
  2655. * `union`, `unionBy`, `unionWith`, `uniq`, `uniqBy`, `uniqWith`, `unset`,
  2656. * `unshift`, `unzip`, `unzipWith`, `update`, `updateWith`, `values`,
  2657. * `valuesIn`, `without`, `wrap`, `xor`, `xorBy`, `xorWith`, `zip`,
  2658. * `zipObject`, `zipObjectDeep`, and `zipWith`
  2659. *
  2660. * The wrapper methods that are **not** chainable by default are:
  2661. * `add`, `attempt`, `camelCase`, `capitalize`, `ceil`, `clamp`, `clone`,
  2662. * `cloneDeep`, `cloneDeepWith`, `cloneWith`, `conformsTo`, `deburr`,
  2663. * `defaultTo`, `divide`, `each`, `eachRight`, `endsWith`, `eq`, `escape`,
  2664. * `escapeRegExp`, `every`, `find`, `findIndex`, `findKey`, `findLast`,
  2665. * `findLastIndex`, `findLastKey`, `first`, `floor`, `forEach`, `forEachRight`,
  2666. * `forIn`, `forInRight`, `forOwn`, `forOwnRight`, `get`, `gt`, `gte`, `has`,
  2667. * `hasIn`, `head`, `identity`, `includes`, `indexOf`, `inRange`, `invoke`,
  2668. * `isArguments`, `isArray`, `isArrayBuffer`, `isArrayLike`, `isArrayLikeObject`,
  2669. * `isBoolean`, `isBuffer`, `isDate`, `isElement`, `isEmpty`, `isEqual`,
  2670. * `isEqualWith`, `isError`, `isFinite`, `isFunction`, `isInteger`, `isLength`,
  2671. * `isMap`, `isMatch`, `isMatchWith`, `isNaN`, `isNative`, `isNil`, `isNull`,
  2672. * `isNumber`, `isObject`, `isObjectLike`, `isPlainObject`, `isRegExp`,
  2673. * `isSafeInteger`, `isSet`, `isString`, `isUndefined`, `isTypedArray`,
  2674. * `isWeakMap`, `isWeakSet`, `join`, `kebabCase`, `last`, `lastIndexOf`,
  2675. * `lowerCase`, `lowerFirst`, `lt`, `lte`, `max`, `maxBy`, `mean`, `meanBy`,
  2676. * `min`, `minBy`, `multiply`, `noConflict`, `noop`, `now`, `nth`, `pad`,
  2677. * `padEnd`, `padStart`, `parseInt`, `pop`, `random`, `reduce`, `reduceRight`,
  2678. * `repeat`, `result`, `round`, `runInContext`, `sample`, `shift`, `size`,
  2679. * `snakeCase`, `some`, `sortedIndex`, `sortedIndexBy`, `sortedLastIndex`,
  2680. * `sortedLastIndexBy`, `startCase`, `startsWith`, `stubArray`, `stubFalse`,
  2681. * `stubObject`, `stubString`, `stubTrue`, `subtract`, `sum`, `sumBy`,
  2682. * `template`, `times`, `toFinite`, `toInteger`, `toJSON`, `toLength`,
  2683. * `toLower`, `toNumber`, `toSafeInteger`, `toString`, `toUpper`, `trim`,
  2684. * `trimEnd`, `trimStart`, `truncate`, `unescape`, `uniqueId`, `upperCase`,
  2685. * `upperFirst`, `value`, and `words`
  2686. *
  2687. * @name _
  2688. * @constructor
  2689. * @category Seq
  2690. * @param {*} value The value to wrap in a `lodash` instance.
  2691. * @returns {Object} Returns the new `lodash` wrapper instance.
  2692. * @example
  2693. *
  2694. * function square(n) {
  2695. * return n * n;
  2696. * }
  2697. *
  2698. * var wrapped = _([1, 2, 3]);
  2699. *
  2700. * // Returns an unwrapped value.
  2701. * wrapped.reduce(_.add);
  2702. * // => 6
  2703. *
  2704. * // Returns a wrapped value.
  2705. * var squares = wrapped.map(square);
  2706. *
  2707. * _.isArray(squares);
  2708. * // => false
  2709. *
  2710. * _.isArray(squares.value());
  2711. * // => true
  2712. */
  2713. function lodash(value) {
  2714. if (isObjectLike(value) && !isArray(value) && !(value instanceof LazyWrapper)) {
  2715. if (value instanceof LodashWrapper) {
  2716. return value;
  2717. }
  2718. if (hasOwnProperty.call(value, '__wrapped__')) {
  2719. return wrapperClone(value);
  2720. }
  2721. }
  2722. return new LodashWrapper(value);
  2723. }
  2724. /**
  2725. * The base implementation of `_.create` without support for assigning
  2726. * properties to the created object.
  2727. *
  2728. * @private
  2729. * @param {Object} proto The object to inherit from.
  2730. * @returns {Object} Returns the new object.
  2731. */
  2732. var baseCreate = (function() {
  2733. function object() {}
  2734. return function(proto) {
  2735. if (!isObject(proto)) {
  2736. return {};
  2737. }
  2738. if (objectCreate) {
  2739. return objectCreate(proto);
  2740. }
  2741. object.prototype = proto;
  2742. var result = new object;
  2743. object.prototype = undefined;
  2744. return result;
  2745. };
  2746. }());
  2747. /**
  2748. * The function whose prototype chain sequence wrappers inherit from.
  2749. *
  2750. * @private
  2751. */
  2752. function baseLodash() {
  2753. // No operation performed.
  2754. }
  2755. /**
  2756. * The base constructor for creating `lodash` wrapper objects.
  2757. *
  2758. * @private
  2759. * @param {*} value The value to wrap.
  2760. * @param {boolean} [chainAll] Enable explicit method chain sequences.
  2761. */
  2762. function LodashWrapper(value, chainAll) {
  2763. this.__wrapped__ = value;
  2764. this.__actions__ = [];
  2765. this.__chain__ = !!chainAll;
  2766. this.__index__ = 0;
  2767. this.__values__ = undefined;
  2768. }
  2769. /**
  2770. * By default, the template delimiters used by lodash are like those in
  2771. * embedded Ruby (ERB) as well as ES2015 template strings. Change the
  2772. * following template settings to use alternative delimiters.
  2773. *
  2774. * @static
  2775. * @memberOf _
  2776. * @type {Object}
  2777. */
  2778. lodash.templateSettings = {
  2779. /**
  2780. * Used to detect `data` property values to be HTML-escaped.
  2781. *
  2782. * @memberOf _.templateSettings
  2783. * @type {RegExp}
  2784. */
  2785. 'escape': reEscape,
  2786. /**
  2787. * Used to detect code to be evaluated.
  2788. *
  2789. * @memberOf _.templateSettings
  2790. * @type {RegExp}
  2791. */
  2792. 'evaluate': reEvaluate,
  2793. /**
  2794. * Used to detect `data` property values to inject.
  2795. *
  2796. * @memberOf _.templateSettings
  2797. * @type {RegExp}
  2798. */
  2799. 'interpolate': reInterpolate,
  2800. /**
  2801. * Used to reference the data object in the template text.
  2802. *
  2803. * @memberOf _.templateSettings
  2804. * @type {string}
  2805. */
  2806. 'variable': '',
  2807. /**
  2808. * Used to import variables into the compiled template.
  2809. *
  2810. * @memberOf _.templateSettings
  2811. * @type {Object}
  2812. */
  2813. 'imports': {
  2814. /**
  2815. * A reference to the `lodash` function.
  2816. *
  2817. * @memberOf _.templateSettings.imports
  2818. * @type {Function}
  2819. */
  2820. '_': lodash
  2821. }
  2822. };
  2823. // Ensure wrappers are instances of `baseLodash`.
  2824. lodash.prototype = baseLodash.prototype;
  2825. lodash.prototype.constructor = lodash;
  2826. LodashWrapper.prototype = baseCreate(baseLodash.prototype);
  2827. LodashWrapper.prototype.constructor = LodashWrapper;
  2828. /*------------------------------------------------------------------------*/
  2829. /**
  2830. * Creates a lazy wrapper object which wraps `value` to enable lazy evaluation.
  2831. *
  2832. * @private
  2833. * @constructor
  2834. * @param {*} value The value to wrap.
  2835. */
  2836. function LazyWrapper(value) {
  2837. this.__wrapped__ = value;
  2838. this.__actions__ = [];
  2839. this.__dir__ = 1;
  2840. this.__filtered__ = false;
  2841. this.__iteratees__ = [];
  2842. this.__takeCount__ = MAX_ARRAY_LENGTH;
  2843. this.__views__ = [];
  2844. }
  2845. /**
  2846. * Creates a clone of the lazy wrapper object.
  2847. *
  2848. * @private
  2849. * @name clone
  2850. * @memberOf LazyWrapper
  2851. * @returns {Object} Returns the cloned `LazyWrapper` object.
  2852. */
  2853. function lazyClone() {
  2854. var result = new LazyWrapper(this.__wrapped__);
  2855. result.__actions__ = copyArray(this.__actions__);
  2856. result.__dir__ = this.__dir__;
  2857. result.__filtered__ = this.__filtered__;
  2858. result.__iteratees__ = copyArray(this.__iteratees__);
  2859. result.__takeCount__ = this.__takeCount__;
  2860. result.__views__ = copyArray(this.__views__);
  2861. return result;
  2862. }
  2863. /**
  2864. * Reverses the direction of lazy iteration.
  2865. *
  2866. * @private
  2867. * @name reverse
  2868. * @memberOf LazyWrapper
  2869. * @returns {Object} Returns the new reversed `LazyWrapper` object.
  2870. */
  2871. function lazyReverse() {
  2872. if (this.__filtered__) {
  2873. var result = new LazyWrapper(this);
  2874. result.__dir__ = -1;
  2875. result.__filtered__ = true;
  2876. } else {
  2877. result = this.clone();
  2878. result.__dir__ *= -1;
  2879. }
  2880. return result;
  2881. }
  2882. /**
  2883. * Extracts the unwrapped value from its lazy wrapper.
  2884. *
  2885. * @private
  2886. * @name value
  2887. * @memberOf LazyWrapper
  2888. * @returns {*} Returns the unwrapped value.
  2889. */
  2890. function lazyValue() {
  2891. var array = this.__wrapped__.value(),
  2892. dir = this.__dir__,
  2893. isArr = isArray(array),
  2894. isRight = dir < 0,
  2895. arrLength = isArr ? array.length : 0,
  2896. view = getView(0, arrLength, this.__views__),
  2897. start = view.start,
  2898. end = view.end,
  2899. length = end - start,
  2900. index = isRight ? end : (start - 1),
  2901. iteratees = this.__iteratees__,
  2902. iterLength = iteratees.length,
  2903. resIndex = 0,
  2904. takeCount = nativeMin(length, this.__takeCount__);
  2905. if (!isArr || (!isRight && arrLength == length && takeCount == length)) {
  2906. return baseWrapperValue(array, this.__actions__);
  2907. }
  2908. var result = [];
  2909. outer:
  2910. while (length-- && resIndex < takeCount) {
  2911. index += dir;
  2912. var iterIndex = -1,
  2913. value = array[index];
  2914. while (++iterIndex < iterLength) {
  2915. var data = iteratees[iterIndex],
  2916. iteratee = data.iteratee,
  2917. type = data.type,
  2918. computed = iteratee(value);
  2919. if (type == LAZY_MAP_FLAG) {
  2920. value = computed;
  2921. } else if (!computed) {
  2922. if (type == LAZY_FILTER_FLAG) {
  2923. continue outer;
  2924. } else {
  2925. break outer;
  2926. }
  2927. }
  2928. }
  2929. result[resIndex++] = value;
  2930. }
  2931. return result;
  2932. }
  2933. // Ensure `LazyWrapper` is an instance of `baseLodash`.
  2934. LazyWrapper.prototype = baseCreate(baseLodash.prototype);
  2935. LazyWrapper.prototype.constructor = LazyWrapper;
  2936. /*------------------------------------------------------------------------*/
  2937. /**
  2938. * Creates a hash object.
  2939. *
  2940. * @private
  2941. * @constructor
  2942. * @param {Array} [entries] The key-value pairs to cache.
  2943. */
  2944. function Hash(entries) {
  2945. var index = -1,
  2946. length = entries == null ? 0 : entries.length;
  2947. this.clear();
  2948. while (++index < length) {
  2949. var entry = entries[index];
  2950. this.set(entry[0], entry[1]);
  2951. }
  2952. }
  2953. /**
  2954. * Removes all key-value entries from the hash.
  2955. *
  2956. * @private
  2957. * @name clear
  2958. * @memberOf Hash
  2959. */
  2960. function hashClear() {
  2961. this.__data__ = nativeCreate ? nativeCreate(null) : {};
  2962. this.size = 0;
  2963. }
  2964. /**
  2965. * Removes `key` and its value from the hash.
  2966. *
  2967. * @private
  2968. * @name delete
  2969. * @memberOf Hash
  2970. * @param {Object} hash The hash to modify.
  2971. * @param {string} key The key of the value to remove.
  2972. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  2973. */
  2974. function hashDelete(key) {
  2975. var result = this.has(key) && delete this.__data__[key];
  2976. this.size -= result ? 1 : 0;
  2977. return result;
  2978. }
  2979. /**
  2980. * Gets the hash value for `key`.
  2981. *
  2982. * @private
  2983. * @name get
  2984. * @memberOf Hash
  2985. * @param {string} key The key of the value to get.
  2986. * @returns {*} Returns the entry value.
  2987. */
  2988. function hashGet(key) {
  2989. var data = this.__data__;
  2990. if (nativeCreate) {
  2991. var result = data[key];
  2992. return result === HASH_UNDEFINED ? undefined : result;
  2993. }
  2994. return hasOwnProperty.call(data, key) ? data[key] : undefined;
  2995. }
  2996. /**
  2997. * Checks if a hash value for `key` exists.
  2998. *
  2999. * @private
  3000. * @name has
  3001. * @memberOf Hash
  3002. * @param {string} key The key of the entry to check.
  3003. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  3004. */
  3005. function hashHas(key) {
  3006. var data = this.__data__;
  3007. return nativeCreate ? (data[key] !== undefined) : hasOwnProperty.call(data, key);
  3008. }
  3009. /**
  3010. * Sets the hash `key` to `value`.
  3011. *
  3012. * @private
  3013. * @name set
  3014. * @memberOf Hash
  3015. * @param {string} key The key of the value to set.
  3016. * @param {*} value The value to set.
  3017. * @returns {Object} Returns the hash instance.
  3018. */
  3019. function hashSet(key, value) {
  3020. var data = this.__data__;
  3021. this.size += this.has(key) ? 0 : 1;
  3022. data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value;
  3023. return this;
  3024. }
  3025. // Add methods to `Hash`.
  3026. Hash.prototype.clear = hashClear;
  3027. Hash.prototype['delete'] = hashDelete;
  3028. Hash.prototype.get = hashGet;
  3029. Hash.prototype.has = hashHas;
  3030. Hash.prototype.set = hashSet;
  3031. /*------------------------------------------------------------------------*/
  3032. /**
  3033. * Creates an list cache object.
  3034. *
  3035. * @private
  3036. * @constructor
  3037. * @param {Array} [entries] The key-value pairs to cache.
  3038. */
  3039. function ListCache(entries) {
  3040. var index = -1,
  3041. length = entries == null ? 0 : entries.length;
  3042. this.clear();
  3043. while (++index < length) {
  3044. var entry = entries[index];
  3045. this.set(entry[0], entry[1]);
  3046. }
  3047. }
  3048. /**
  3049. * Removes all key-value entries from the list cache.
  3050. *
  3051. * @private
  3052. * @name clear
  3053. * @memberOf ListCache
  3054. */
  3055. function listCacheClear() {
  3056. this.__data__ = [];
  3057. this.size = 0;
  3058. }
  3059. /**
  3060. * Removes `key` and its value from the list cache.
  3061. *
  3062. * @private
  3063. * @name delete
  3064. * @memberOf ListCache
  3065. * @param {string} key The key of the value to remove.
  3066. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  3067. */
  3068. function listCacheDelete(key) {
  3069. var data = this.__data__,
  3070. index = assocIndexOf(data, key);
  3071. if (index < 0) {
  3072. return false;
  3073. }
  3074. var lastIndex = data.length - 1;
  3075. if (index == lastIndex) {
  3076. data.pop();
  3077. } else {
  3078. splice.call(data, index, 1);
  3079. }
  3080. --this.size;
  3081. return true;
  3082. }
  3083. /**
  3084. * Gets the list cache value for `key`.
  3085. *
  3086. * @private
  3087. * @name get
  3088. * @memberOf ListCache
  3089. * @param {string} key The key of the value to get.
  3090. * @returns {*} Returns the entry value.
  3091. */
  3092. function listCacheGet(key) {
  3093. var data = this.__data__,
  3094. index = assocIndexOf(data, key);
  3095. return index < 0 ? undefined : data[index][1];
  3096. }
  3097. /**
  3098. * Checks if a list cache value for `key` exists.
  3099. *
  3100. * @private
  3101. * @name has
  3102. * @memberOf ListCache
  3103. * @param {string} key The key of the entry to check.
  3104. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  3105. */
  3106. function listCacheHas(key) {
  3107. return assocIndexOf(this.__data__, key) > -1;
  3108. }
  3109. /**
  3110. * Sets the list cache `key` to `value`.
  3111. *
  3112. * @private
  3113. * @name set
  3114. * @memberOf ListCache
  3115. * @param {string} key The key of the value to set.
  3116. * @param {*} value The value to set.
  3117. * @returns {Object} Returns the list cache instance.
  3118. */
  3119. function listCacheSet(key, value) {
  3120. var data = this.__data__,
  3121. index = assocIndexOf(data, key);
  3122. if (index < 0) {
  3123. ++this.size;
  3124. data.push([key, value]);
  3125. } else {
  3126. data[index][1] = value;
  3127. }
  3128. return this;
  3129. }
  3130. // Add methods to `ListCache`.
  3131. ListCache.prototype.clear = listCacheClear;
  3132. ListCache.prototype['delete'] = listCacheDelete;
  3133. ListCache.prototype.get = listCacheGet;
  3134. ListCache.prototype.has = listCacheHas;
  3135. ListCache.prototype.set = listCacheSet;
  3136. /*------------------------------------------------------------------------*/
  3137. /**
  3138. * Creates a map cache object to store key-value pairs.
  3139. *
  3140. * @private
  3141. * @constructor
  3142. * @param {Array} [entries] The key-value pairs to cache.
  3143. */
  3144. function MapCache(entries) {
  3145. var index = -1,
  3146. length = entries == null ? 0 : entries.length;
  3147. this.clear();
  3148. while (++index < length) {
  3149. var entry = entries[index];
  3150. this.set(entry[0], entry[1]);
  3151. }
  3152. }
  3153. /**
  3154. * Removes all key-value entries from the map.
  3155. *
  3156. * @private
  3157. * @name clear
  3158. * @memberOf MapCache
  3159. */
  3160. function mapCacheClear() {
  3161. this.size = 0;
  3162. this.__data__ = {
  3163. 'hash': new Hash,
  3164. 'map': new (Map || ListCache),
  3165. 'string': new Hash
  3166. };
  3167. }
  3168. /**
  3169. * Removes `key` and its value from the map.
  3170. *
  3171. * @private
  3172. * @name delete
  3173. * @memberOf MapCache
  3174. * @param {string} key The key of the value to remove.
  3175. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  3176. */
  3177. function mapCacheDelete(key) {
  3178. var result = getMapData(this, key)['delete'](key);
  3179. this.size -= result ? 1 : 0;
  3180. return result;
  3181. }
  3182. /**
  3183. * Gets the map value for `key`.
  3184. *
  3185. * @private
  3186. * @name get
  3187. * @memberOf MapCache
  3188. * @param {string} key The key of the value to get.
  3189. * @returns {*} Returns the entry value.
  3190. */
  3191. function mapCacheGet(key) {
  3192. return getMapData(this, key).get(key);
  3193. }
  3194. /**
  3195. * Checks if a map value for `key` exists.
  3196. *
  3197. * @private
  3198. * @name has
  3199. * @memberOf MapCache
  3200. * @param {string} key The key of the entry to check.
  3201. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  3202. */
  3203. function mapCacheHas(key) {
  3204. return getMapData(this, key).has(key);
  3205. }
  3206. /**
  3207. * Sets the map `key` to `value`.
  3208. *
  3209. * @private
  3210. * @name set
  3211. * @memberOf MapCache
  3212. * @param {string} key The key of the value to set.
  3213. * @param {*} value The value to set.
  3214. * @returns {Object} Returns the map cache instance.
  3215. */
  3216. function mapCacheSet(key, value) {
  3217. var data = getMapData(this, key),
  3218. size = data.size;
  3219. data.set(key, value);
  3220. this.size += data.size == size ? 0 : 1;
  3221. return this;
  3222. }
  3223. // Add methods to `MapCache`.
  3224. MapCache.prototype.clear = mapCacheClear;
  3225. MapCache.prototype['delete'] = mapCacheDelete;
  3226. MapCache.prototype.get = mapCacheGet;
  3227. MapCache.prototype.has = mapCacheHas;
  3228. MapCache.prototype.set = mapCacheSet;
  3229. /*------------------------------------------------------------------------*/
  3230. /**
  3231. *
  3232. * Creates an array cache object to store unique values.
  3233. *
  3234. * @private
  3235. * @constructor
  3236. * @param {Array} [values] The values to cache.
  3237. */
  3238. function SetCache(values) {
  3239. var index = -1,
  3240. length = values == null ? 0 : values.length;
  3241. this.__data__ = new MapCache;
  3242. while (++index < length) {
  3243. this.add(values[index]);
  3244. }
  3245. }
  3246. /**
  3247. * Adds `value` to the array cache.
  3248. *
  3249. * @private
  3250. * @name add
  3251. * @memberOf SetCache
  3252. * @alias push
  3253. * @param {*} value The value to cache.
  3254. * @returns {Object} Returns the cache instance.
  3255. */
  3256. function setCacheAdd(value) {
  3257. this.__data__.set(value, HASH_UNDEFINED);
  3258. return this;
  3259. }
  3260. /**
  3261. * Checks if `value` is in the array cache.
  3262. *
  3263. * @private
  3264. * @name has
  3265. * @memberOf SetCache
  3266. * @param {*} value The value to search for.
  3267. * @returns {number} Returns `true` if `value` is found, else `false`.
  3268. */
  3269. function setCacheHas(value) {
  3270. return this.__data__.has(value);
  3271. }
  3272. // Add methods to `SetCache`.
  3273. SetCache.prototype.add = SetCache.prototype.push = setCacheAdd;
  3274. SetCache.prototype.has = setCacheHas;
  3275. /*------------------------------------------------------------------------*/
  3276. /**
  3277. * Creates a stack cache object to store key-value pairs.
  3278. *
  3279. * @private
  3280. * @constructor
  3281. * @param {Array} [entries] The key-value pairs to cache.
  3282. */
  3283. function Stack(entries) {
  3284. var data = this.__data__ = new ListCache(entries);
  3285. this.size = data.size;
  3286. }
  3287. /**
  3288. * Removes all key-value entries from the stack.
  3289. *
  3290. * @private
  3291. * @name clear
  3292. * @memberOf Stack
  3293. */
  3294. function stackClear() {
  3295. this.__data__ = new ListCache;
  3296. this.size = 0;
  3297. }
  3298. /**
  3299. * Removes `key` and its value from the stack.
  3300. *
  3301. * @private
  3302. * @name delete
  3303. * @memberOf Stack
  3304. * @param {string} key The key of the value to remove.
  3305. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  3306. */
  3307. function stackDelete(key) {
  3308. var data = this.__data__,
  3309. result = data['delete'](key);
  3310. this.size = data.size;
  3311. return result;
  3312. }
  3313. /**
  3314. * Gets the stack value for `key`.
  3315. *
  3316. * @private
  3317. * @name get
  3318. * @memberOf Stack
  3319. * @param {string} key The key of the value to get.
  3320. * @returns {*} Returns the entry value.
  3321. */
  3322. function stackGet(key) {
  3323. return this.__data__.get(key);
  3324. }
  3325. /**
  3326. * Checks if a stack value for `key` exists.
  3327. *
  3328. * @private
  3329. * @name has
  3330. * @memberOf Stack
  3331. * @param {string} key The key of the entry to check.
  3332. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  3333. */
  3334. function stackHas(key) {
  3335. return this.__data__.has(key);
  3336. }
  3337. /**
  3338. * Sets the stack `key` to `value`.
  3339. *
  3340. * @private
  3341. * @name set
  3342. * @memberOf Stack
  3343. * @param {string} key The key of the value to set.
  3344. * @param {*} value The value to set.
  3345. * @returns {Object} Returns the stack cache instance.
  3346. */
  3347. function stackSet(key, value) {
  3348. var data = this.__data__;
  3349. if (data instanceof ListCache) {
  3350. var pairs = data.__data__;
  3351. if (!Map || (pairs.length < LARGE_ARRAY_SIZE - 1)) {
  3352. pairs.push([key, value]);
  3353. this.size = ++data.size;
  3354. return this;
  3355. }
  3356. data = this.__data__ = new MapCache(pairs);
  3357. }
  3358. data.set(key, value);
  3359. this.size = data.size;
  3360. return this;
  3361. }
  3362. // Add methods to `Stack`.
  3363. Stack.prototype.clear = stackClear;
  3364. Stack.prototype['delete'] = stackDelete;
  3365. Stack.prototype.get = stackGet;
  3366. Stack.prototype.has = stackHas;
  3367. Stack.prototype.set = stackSet;
  3368. /*------------------------------------------------------------------------*/
  3369. /**
  3370. * Creates an array of the enumerable property names of the array-like `value`.
  3371. *
  3372. * @private
  3373. * @param {*} value The value to query.
  3374. * @param {boolean} inherited Specify returning inherited property names.
  3375. * @returns {Array} Returns the array of property names.
  3376. */
  3377. function arrayLikeKeys(value, inherited) {
  3378. var isArr = isArray(value),
  3379. isArg = !isArr && isArguments(value),
  3380. isBuff = !isArr && !isArg && isBuffer(value),
  3381. isType = !isArr && !isArg && !isBuff && isTypedArray(value),
  3382. skipIndexes = isArr || isArg || isBuff || isType,
  3383. result = skipIndexes ? baseTimes(value.length, String) : [],
  3384. length = result.length;
  3385. for (var key in value) {
  3386. if ((inherited || hasOwnProperty.call(value, key)) &&
  3387. !(skipIndexes && (
  3388. // Safari 9 has enumerable `arguments.length` in strict mode.
  3389. key == 'length' ||
  3390. // Node.js 0.10 has enumerable non-index properties on buffers.
  3391. (isBuff && (key == 'offset' || key == 'parent')) ||
  3392. // PhantomJS 2 has enumerable non-index properties on typed arrays.
  3393. (isType && (key == 'buffer' || key == 'byteLength' || key == 'byteOffset')) ||
  3394. // Skip index properties.
  3395. isIndex(key, length)
  3396. ))) {
  3397. result.push(key);
  3398. }
  3399. }
  3400. return result;
  3401. }
  3402. /**
  3403. * A specialized version of `_.sample` for arrays.
  3404. *
  3405. * @private
  3406. * @param {Array} array The array to sample.
  3407. * @returns {*} Returns the random element.
  3408. */
  3409. function arraySample(array) {
  3410. var length = array.length;
  3411. return length ? array[baseRandom(0, length - 1)] : undefined;
  3412. }
  3413. /**
  3414. * A specialized version of `_.sampleSize` for arrays.
  3415. *
  3416. * @private
  3417. * @param {Array} array The array to sample.
  3418. * @param {number} n The number of elements to sample.
  3419. * @returns {Array} Returns the random elements.
  3420. */
  3421. function arraySampleSize(array, n) {
  3422. return shuffleSelf(copyArray(array), baseClamp(n, 0, array.length));
  3423. }
  3424. /**
  3425. * A specialized version of `_.shuffle` for arrays.
  3426. *
  3427. * @private
  3428. * @param {Array} array The array to shuffle.
  3429. * @returns {Array} Returns the new shuffled array.
  3430. */
  3431. function arrayShuffle(array) {
  3432. return shuffleSelf(copyArray(array));
  3433. }
  3434. /**
  3435. * This function is like `assignValue` except that it doesn't assign
  3436. * `undefined` values.
  3437. *
  3438. * @private
  3439. * @param {Object} object The object to modify.
  3440. * @param {string} key The key of the property to assign.
  3441. * @param {*} value The value to assign.
  3442. */
  3443. function assignMergeValue(object, key, value) {
  3444. if ((value !== undefined && !eq(object[key], value)) ||
  3445. (value === undefined && !(key in object))) {
  3446. baseAssignValue(object, key, value);
  3447. }
  3448. }
  3449. /**
  3450. * Assigns `value` to `key` of `object` if the existing value is not equivalent
  3451. * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  3452. * for equality comparisons.
  3453. *
  3454. * @private
  3455. * @param {Object} object The object to modify.
  3456. * @param {string} key The key of the property to assign.
  3457. * @param {*} value The value to assign.
  3458. */
  3459. function assignValue(object, key, value) {
  3460. var objValue = object[key];
  3461. if (!(hasOwnProperty.call(object, key) && eq(objValue, value)) ||
  3462. (value === undefined && !(key in object))) {
  3463. baseAssignValue(object, key, value);
  3464. }
  3465. }
  3466. /**
  3467. * Gets the index at which the `key` is found in `array` of key-value pairs.
  3468. *
  3469. * @private
  3470. * @param {Array} array The array to inspect.
  3471. * @param {*} key The key to search for.
  3472. * @returns {number} Returns the index of the matched value, else `-1`.
  3473. */
  3474. function assocIndexOf(array, key) {
  3475. var length = array.length;
  3476. while (length--) {
  3477. if (eq(array[length][0], key)) {
  3478. return length;
  3479. }
  3480. }
  3481. return -1;
  3482. }
  3483. /**
  3484. * Aggregates elements of `collection` on `accumulator` with keys transformed
  3485. * by `iteratee` and values set by `setter`.
  3486. *
  3487. * @private
  3488. * @param {Array|Object} collection The collection to iterate over.
  3489. * @param {Function} setter The function to set `accumulator` values.
  3490. * @param {Function} iteratee The iteratee to transform keys.
  3491. * @param {Object} accumulator The initial aggregated object.
  3492. * @returns {Function} Returns `accumulator`.
  3493. */
  3494. function baseAggregator(collection, setter, iteratee, accumulator) {
  3495. baseEach(collection, function(value, key, collection) {
  3496. setter(accumulator, value, iteratee(value), collection);
  3497. });
  3498. return accumulator;
  3499. }
  3500. /**
  3501. * The base implementation of `_.assign` without support for multiple sources
  3502. * or `customizer` functions.
  3503. *
  3504. * @private
  3505. * @param {Object} object The destination object.
  3506. * @param {Object} source The source object.
  3507. * @returns {Object} Returns `object`.
  3508. */
  3509. function baseAssign(object, source) {
  3510. return object && copyObject(source, keys(source), object);
  3511. }
  3512. /**
  3513. * The base implementation of `_.assignIn` without support for multiple sources
  3514. * or `customizer` functions.
  3515. *
  3516. * @private
  3517. * @param {Object} object The destination object.
  3518. * @param {Object} source The source object.
  3519. * @returns {Object} Returns `object`.
  3520. */
  3521. function baseAssignIn(object, source) {
  3522. return object && copyObject(source, keysIn(source), object);
  3523. }
  3524. /**
  3525. * The base implementation of `assignValue` and `assignMergeValue` without
  3526. * value checks.
  3527. *
  3528. * @private
  3529. * @param {Object} object The object to modify.
  3530. * @param {string} key The key of the property to assign.
  3531. * @param {*} value The value to assign.
  3532. */
  3533. function baseAssignValue(object, key, value) {
  3534. if (key == '__proto__' && defineProperty) {
  3535. defineProperty(object, key, {
  3536. 'configurable': true,
  3537. 'enumerable': true,
  3538. 'value': value,
  3539. 'writable': true
  3540. });
  3541. } else {
  3542. object[key] = value;
  3543. }
  3544. }
  3545. /**
  3546. * The base implementation of `_.at` without support for individual paths.
  3547. *
  3548. * @private
  3549. * @param {Object} object The object to iterate over.
  3550. * @param {string[]} paths The property paths to pick.
  3551. * @returns {Array} Returns the picked elements.
  3552. */
  3553. function baseAt(object, paths) {
  3554. var index = -1,
  3555. length = paths.length,
  3556. result = Array(length),
  3557. skip = object == null;
  3558. while (++index < length) {
  3559. result[index] = skip ? undefined : get(object, paths[index]);
  3560. }
  3561. return result;
  3562. }
  3563. /**
  3564. * The base implementation of `_.clamp` which doesn't coerce arguments.
  3565. *
  3566. * @private
  3567. * @param {number} number The number to clamp.
  3568. * @param {number} [lower] The lower bound.
  3569. * @param {number} upper The upper bound.
  3570. * @returns {number} Returns the clamped number.
  3571. */
  3572. function baseClamp(number, lower, upper) {
  3573. if (number === number) {
  3574. if (upper !== undefined) {
  3575. number = number <= upper ? number : upper;
  3576. }
  3577. if (lower !== undefined) {
  3578. number = number >= lower ? number : lower;
  3579. }
  3580. }
  3581. return number;
  3582. }
  3583. /**
  3584. * The base implementation of `_.clone` and `_.cloneDeep` which tracks
  3585. * traversed objects.
  3586. *
  3587. * @private
  3588. * @param {*} value The value to clone.
  3589. * @param {boolean} bitmask The bitmask flags.
  3590. * 1 - Deep clone
  3591. * 2 - Flatten inherited properties
  3592. * 4 - Clone symbols
  3593. * @param {Function} [customizer] The function to customize cloning.
  3594. * @param {string} [key] The key of `value`.
  3595. * @param {Object} [object] The parent object of `value`.
  3596. * @param {Object} [stack] Tracks traversed objects and their clone counterparts.
  3597. * @returns {*} Returns the cloned value.
  3598. */
  3599. function baseClone(value, bitmask, customizer, key, object, stack) {
  3600. var result,
  3601. isDeep = bitmask & CLONE_DEEP_FLAG,
  3602. isFlat = bitmask & CLONE_FLAT_FLAG,
  3603. isFull = bitmask & CLONE_SYMBOLS_FLAG;
  3604. if (customizer) {
  3605. result = object ? customizer(value, key, object, stack) : customizer(value);
  3606. }
  3607. if (result !== undefined) {
  3608. return result;
  3609. }
  3610. if (!isObject(value)) {
  3611. return value;
  3612. }
  3613. var isArr = isArray(value);
  3614. if (isArr) {
  3615. result = initCloneArray(value);
  3616. if (!isDeep) {
  3617. return copyArray(value, result);
  3618. }
  3619. } else {
  3620. var tag = getTag(value),
  3621. isFunc = tag == funcTag || tag == genTag;
  3622. if (isBuffer(value)) {
  3623. return cloneBuffer(value, isDeep);
  3624. }
  3625. if (tag == objectTag || tag == argsTag || (isFunc && !object)) {
  3626. result = (isFlat || isFunc) ? {} : initCloneObject(value);
  3627. if (!isDeep) {
  3628. return isFlat
  3629. ? copySymbolsIn(value, baseAssignIn(result, value))
  3630. : copySymbols(value, baseAssign(result, value));
  3631. }
  3632. } else {
  3633. if (!cloneableTags[tag]) {
  3634. return object ? value : {};
  3635. }
  3636. result = initCloneByTag(value, tag, isDeep);
  3637. }
  3638. }
  3639. // Check for circular references and return its corresponding clone.
  3640. stack || (stack = new Stack);
  3641. var stacked = stack.get(value);
  3642. if (stacked) {
  3643. return stacked;
  3644. }
  3645. stack.set(value, result);
  3646. if (isSet(value)) {
  3647. value.forEach(function(subValue) {
  3648. result.add(baseClone(subValue, bitmask, customizer, subValue, value, stack));
  3649. });
  3650. } else if (isMap(value)) {
  3651. value.forEach(function(subValue, key) {
  3652. result.set(key, baseClone(subValue, bitmask, customizer, key, value, stack));
  3653. });
  3654. }
  3655. var keysFunc = isFull
  3656. ? (isFlat ? getAllKeysIn : getAllKeys)
  3657. : (isFlat ? keysIn : keys);
  3658. var props = isArr ? undefined : keysFunc(value);
  3659. arrayEach(props || value, function(subValue, key) {
  3660. if (props) {
  3661. key = subValue;
  3662. subValue = value[key];
  3663. }
  3664. // Recursively populate clone (susceptible to call stack limits).
  3665. assignValue(result, key, baseClone(subValue, bitmask, customizer, key, value, stack));
  3666. });
  3667. return result;
  3668. }
  3669. /**
  3670. * The base implementation of `_.conforms` which doesn't clone `source`.
  3671. *
  3672. * @private
  3673. * @param {Object} source The object of property predicates to conform to.
  3674. * @returns {Function} Returns the new spec function.
  3675. */
  3676. function baseConforms(source) {
  3677. var props = keys(source);
  3678. return function(object) {
  3679. return baseConformsTo(object, source, props);
  3680. };
  3681. }
  3682. /**
  3683. * The base implementation of `_.conformsTo` which accepts `props` to check.
  3684. *
  3685. * @private
  3686. * @param {Object} object The object to inspect.
  3687. * @param {Object} source The object of property predicates to conform to.
  3688. * @returns {boolean} Returns `true` if `object` conforms, else `false`.
  3689. */
  3690. function baseConformsTo(object, source, props) {
  3691. var length = props.length;
  3692. if (object == null) {
  3693. return !length;
  3694. }
  3695. object = Object(object);
  3696. while (length--) {
  3697. var key = props[length],
  3698. predicate = source[key],
  3699. value = object[key];
  3700. if ((value === undefined && !(key in object)) || !predicate(value)) {
  3701. return false;
  3702. }
  3703. }
  3704. return true;
  3705. }
  3706. /**
  3707. * The base implementation of `_.delay` and `_.defer` which accepts `args`
  3708. * to provide to `func`.
  3709. *
  3710. * @private
  3711. * @param {Function} func The function to delay.
  3712. * @param {number} wait The number of milliseconds to delay invocation.
  3713. * @param {Array} args The arguments to provide to `func`.
  3714. * @returns {number|Object} Returns the timer id or timeout object.
  3715. */
  3716. function baseDelay(func, wait, args) {
  3717. if (typeof func != 'function') {
  3718. throw new TypeError(FUNC_ERROR_TEXT);
  3719. }
  3720. return setTimeout(function() { func.apply(undefined, args); }, wait);
  3721. }
  3722. /**
  3723. * The base implementation of methods like `_.difference` without support
  3724. * for excluding multiple arrays or iteratee shorthands.
  3725. *
  3726. * @private
  3727. * @param {Array} array The array to inspect.
  3728. * @param {Array} values The values to exclude.
  3729. * @param {Function} [iteratee] The iteratee invoked per element.
  3730. * @param {Function} [comparator] The comparator invoked per element.
  3731. * @returns {Array} Returns the new array of filtered values.
  3732. */
  3733. function baseDifference(array, values, iteratee, comparator) {
  3734. var index = -1,
  3735. includes = arrayIncludes,
  3736. isCommon = true,
  3737. length = array.length,
  3738. result = [],
  3739. valuesLength = values.length;
  3740. if (!length) {
  3741. return result;
  3742. }
  3743. if (iteratee) {
  3744. values = arrayMap(values, baseUnary(iteratee));
  3745. }
  3746. if (comparator) {
  3747. includes = arrayIncludesWith;
  3748. isCommon = false;
  3749. }
  3750. else if (values.length >= LARGE_ARRAY_SIZE) {
  3751. includes = cacheHas;
  3752. isCommon = false;
  3753. values = new SetCache(values);
  3754. }
  3755. outer:
  3756. while (++index < length) {
  3757. var value = array[index],
  3758. computed = iteratee == null ? value : iteratee(value);
  3759. value = (comparator || value !== 0) ? value : 0;
  3760. if (isCommon && computed === computed) {
  3761. var valuesIndex = valuesLength;
  3762. while (valuesIndex--) {
  3763. if (values[valuesIndex] === computed) {
  3764. continue outer;
  3765. }
  3766. }
  3767. result.push(value);
  3768. }
  3769. else if (!includes(values, computed, comparator)) {
  3770. result.push(value);
  3771. }
  3772. }
  3773. return result;
  3774. }
  3775. /**
  3776. * The base implementation of `_.forEach` without support for iteratee shorthands.
  3777. *
  3778. * @private
  3779. * @param {Array|Object} collection The collection to iterate over.
  3780. * @param {Function} iteratee The function invoked per iteration.
  3781. * @returns {Array|Object} Returns `collection`.
  3782. */
  3783. var baseEach = createBaseEach(baseForOwn);
  3784. /**
  3785. * The base implementation of `_.forEachRight` without support for iteratee shorthands.
  3786. *
  3787. * @private
  3788. * @param {Array|Object} collection The collection to iterate over.
  3789. * @param {Function} iteratee The function invoked per iteration.
  3790. * @returns {Array|Object} Returns `collection`.
  3791. */
  3792. var baseEachRight = createBaseEach(baseForOwnRight, true);
  3793. /**
  3794. * The base implementation of `_.every` without support for iteratee shorthands.
  3795. *
  3796. * @private
  3797. * @param {Array|Object} collection The collection to iterate over.
  3798. * @param {Function} predicate The function invoked per iteration.
  3799. * @returns {boolean} Returns `true` if all elements pass the predicate check,
  3800. * else `false`
  3801. */
  3802. function baseEvery(collection, predicate) {
  3803. var result = true;
  3804. baseEach(collection, function(value, index, collection) {
  3805. result = !!predicate(value, index, collection);
  3806. return result;
  3807. });
  3808. return result;
  3809. }
  3810. /**
  3811. * The base implementation of methods like `_.max` and `_.min` which accepts a
  3812. * `comparator` to determine the extremum value.
  3813. *
  3814. * @private
  3815. * @param {Array} array The array to iterate over.
  3816. * @param {Function} iteratee The iteratee invoked per iteration.
  3817. * @param {Function} comparator The comparator used to compare values.
  3818. * @returns {*} Returns the extremum value.
  3819. */
  3820. function baseExtremum(array, iteratee, comparator) {
  3821. var index = -1,
  3822. length = array.length;
  3823. while (++index < length) {
  3824. var value = array[index],
  3825. current = iteratee(value);
  3826. if (current != null && (computed === undefined
  3827. ? (current === current && !isSymbol(current))
  3828. : comparator(current, computed)
  3829. )) {
  3830. var computed = current,
  3831. result = value;
  3832. }
  3833. }
  3834. return result;
  3835. }
  3836. /**
  3837. * The base implementation of `_.fill` without an iteratee call guard.
  3838. *
  3839. * @private
  3840. * @param {Array} array The array to fill.
  3841. * @param {*} value The value to fill `array` with.
  3842. * @param {number} [start=0] The start position.
  3843. * @param {number} [end=array.length] The end position.
  3844. * @returns {Array} Returns `array`.
  3845. */
  3846. function baseFill(array, value, start, end) {
  3847. var length = array.length;
  3848. start = toInteger(start);
  3849. if (start < 0) {
  3850. start = -start > length ? 0 : (length + start);
  3851. }
  3852. end = (end === undefined || end > length) ? length : toInteger(end);
  3853. if (end < 0) {
  3854. end += length;
  3855. }
  3856. end = start > end ? 0 : toLength(end);
  3857. while (start < end) {
  3858. array[start++] = value;
  3859. }
  3860. return array;
  3861. }
  3862. /**
  3863. * The base implementation of `_.filter` without support for iteratee shorthands.
  3864. *
  3865. * @private
  3866. * @param {Array|Object} collection The collection to iterate over.
  3867. * @param {Function} predicate The function invoked per iteration.
  3868. * @returns {Array} Returns the new filtered array.
  3869. */
  3870. function baseFilter(collection, predicate) {
  3871. var result = [];
  3872. baseEach(collection, function(value, index, collection) {
  3873. if (predicate(value, index, collection)) {
  3874. result.push(value);
  3875. }
  3876. });
  3877. return result;
  3878. }
  3879. /**
  3880. * The base implementation of `_.flatten` with support for restricting flattening.
  3881. *
  3882. * @private
  3883. * @param {Array} array The array to flatten.
  3884. * @param {number} depth The maximum recursion depth.
  3885. * @param {boolean} [predicate=isFlattenable] The function invoked per iteration.
  3886. * @param {boolean} [isStrict] Restrict to values that pass `predicate` checks.
  3887. * @param {Array} [result=[]] The initial result value.
  3888. * @returns {Array} Returns the new flattened array.
  3889. */
  3890. function baseFlatten(array, depth, predicate, isStrict, result) {
  3891. var index = -1,
  3892. length = array.length;
  3893. predicate || (predicate = isFlattenable);
  3894. result || (result = []);
  3895. while (++index < length) {
  3896. var value = array[index];
  3897. if (depth > 0 && predicate(value)) {
  3898. if (depth > 1) {
  3899. // Recursively flatten arrays (susceptible to call stack limits).
  3900. baseFlatten(value, depth - 1, predicate, isStrict, result);
  3901. } else {
  3902. arrayPush(result, value);
  3903. }
  3904. } else if (!isStrict) {
  3905. result[result.length] = value;
  3906. }
  3907. }
  3908. return result;
  3909. }
  3910. /**
  3911. * The base implementation of `baseForOwn` which iterates over `object`
  3912. * properties returned by `keysFunc` and invokes `iteratee` for each property.
  3913. * Iteratee functions may exit iteration early by explicitly returning `false`.
  3914. *
  3915. * @private
  3916. * @param {Object} object The object to iterate over.
  3917. * @param {Function} iteratee The function invoked per iteration.
  3918. * @param {Function} keysFunc The function to get the keys of `object`.
  3919. * @returns {Object} Returns `object`.
  3920. */
  3921. var baseFor = createBaseFor();
  3922. /**
  3923. * This function is like `baseFor` except that it iterates over properties
  3924. * in the opposite order.
  3925. *
  3926. * @private
  3927. * @param {Object} object The object to iterate over.
  3928. * @param {Function} iteratee The function invoked per iteration.
  3929. * @param {Function} keysFunc The function to get the keys of `object`.
  3930. * @returns {Object} Returns `object`.
  3931. */
  3932. var baseForRight = createBaseFor(true);
  3933. /**
  3934. * The base implementation of `_.forOwn` without support for iteratee shorthands.
  3935. *
  3936. * @private
  3937. * @param {Object} object The object to iterate over.
  3938. * @param {Function} iteratee The function invoked per iteration.
  3939. * @returns {Object} Returns `object`.
  3940. */
  3941. function baseForOwn(object, iteratee) {
  3942. return object && baseFor(object, iteratee, keys);
  3943. }
  3944. /**
  3945. * The base implementation of `_.forOwnRight` without support for iteratee shorthands.
  3946. *
  3947. * @private
  3948. * @param {Object} object The object to iterate over.
  3949. * @param {Function} iteratee The function invoked per iteration.
  3950. * @returns {Object} Returns `object`.
  3951. */
  3952. function baseForOwnRight(object, iteratee) {
  3953. return object && baseForRight(object, iteratee, keys);
  3954. }
  3955. /**
  3956. * The base implementation of `_.functions` which creates an array of
  3957. * `object` function property names filtered from `props`.
  3958. *
  3959. * @private
  3960. * @param {Object} object The object to inspect.
  3961. * @param {Array} props The property names to filter.
  3962. * @returns {Array} Returns the function names.
  3963. */
  3964. function baseFunctions(object, props) {
  3965. return arrayFilter(props, function(key) {
  3966. return isFunction(object[key]);
  3967. });
  3968. }
  3969. /**
  3970. * The base implementation of `_.get` without support for default values.
  3971. *
  3972. * @private
  3973. * @param {Object} object The object to query.
  3974. * @param {Array|string} path The path of the property to get.
  3975. * @returns {*} Returns the resolved value.
  3976. */
  3977. function baseGet(object, path) {
  3978. path = castPath(path, object);
  3979. var index = 0,
  3980. length = path.length;
  3981. while (object != null && index < length) {
  3982. object = object[toKey(path[index++])];
  3983. }
  3984. return (index && index == length) ? object : undefined;
  3985. }
  3986. /**
  3987. * The base implementation of `getAllKeys` and `getAllKeysIn` which uses
  3988. * `keysFunc` and `symbolsFunc` to get the enumerable property names and
  3989. * symbols of `object`.
  3990. *
  3991. * @private
  3992. * @param {Object} object The object to query.
  3993. * @param {Function} keysFunc The function to get the keys of `object`.
  3994. * @param {Function} symbolsFunc The function to get the symbols of `object`.
  3995. * @returns {Array} Returns the array of property names and symbols.
  3996. */
  3997. function baseGetAllKeys(object, keysFunc, symbolsFunc) {
  3998. var result = keysFunc(object);
  3999. return isArray(object) ? result : arrayPush(result, symbolsFunc(object));
  4000. }
  4001. /**
  4002. * The base implementation of `getTag` without fallbacks for buggy environments.
  4003. *
  4004. * @private
  4005. * @param {*} value The value to query.
  4006. * @returns {string} Returns the `toStringTag`.
  4007. */
  4008. function baseGetTag(value) {
  4009. if (value == null) {
  4010. return value === undefined ? undefinedTag : nullTag;
  4011. }
  4012. return (symToStringTag && symToStringTag in Object(value))
  4013. ? getRawTag(value)
  4014. : objectToString(value);
  4015. }
  4016. /**
  4017. * The base implementation of `_.gt` which doesn't coerce arguments.
  4018. *
  4019. * @private
  4020. * @param {*} value The value to compare.
  4021. * @param {*} other The other value to compare.
  4022. * @returns {boolean} Returns `true` if `value` is greater than `other`,
  4023. * else `false`.
  4024. */
  4025. function baseGt(value, other) {
  4026. return value > other;
  4027. }
  4028. /**
  4029. * The base implementation of `_.has` without support for deep paths.
  4030. *
  4031. * @private
  4032. * @param {Object} [object] The object to query.
  4033. * @param {Array|string} key The key to check.
  4034. * @returns {boolean} Returns `true` if `key` exists, else `false`.
  4035. */
  4036. function baseHas(object, key) {
  4037. return object != null && hasOwnProperty.call(object, key);
  4038. }
  4039. /**
  4040. * The base implementation of `_.hasIn` without support for deep paths.
  4041. *
  4042. * @private
  4043. * @param {Object} [object] The object to query.
  4044. * @param {Array|string} key The key to check.
  4045. * @returns {boolean} Returns `true` if `key` exists, else `false`.
  4046. */
  4047. function baseHasIn(object, key) {
  4048. return object != null && key in Object(object);
  4049. }
  4050. /**
  4051. * The base implementation of `_.inRange` which doesn't coerce arguments.
  4052. *
  4053. * @private
  4054. * @param {number} number The number to check.
  4055. * @param {number} start The start of the range.
  4056. * @param {number} end The end of the range.
  4057. * @returns {boolean} Returns `true` if `number` is in the range, else `false`.
  4058. */
  4059. function baseInRange(number, start, end) {
  4060. return number >= nativeMin(start, end) && number < nativeMax(start, end);
  4061. }
  4062. /**
  4063. * The base implementation of methods like `_.intersection`, without support
  4064. * for iteratee shorthands, that accepts an array of arrays to inspect.
  4065. *
  4066. * @private
  4067. * @param {Array} arrays The arrays to inspect.
  4068. * @param {Function} [iteratee] The iteratee invoked per element.
  4069. * @param {Function} [comparator] The comparator invoked per element.
  4070. * @returns {Array} Returns the new array of shared values.
  4071. */
  4072. function baseIntersection(arrays, iteratee, comparator) {
  4073. var includes = comparator ? arrayIncludesWith : arrayIncludes,
  4074. length = arrays[0].length,
  4075. othLength = arrays.length,
  4076. othIndex = othLength,
  4077. caches = Array(othLength),
  4078. maxLength = Infinity,
  4079. result = [];
  4080. while (othIndex--) {
  4081. var array = arrays[othIndex];
  4082. if (othIndex && iteratee) {
  4083. array = arrayMap(array, baseUnary(iteratee));
  4084. }
  4085. maxLength = nativeMin(array.length, maxLength);
  4086. caches[othIndex] = !comparator && (iteratee || (length >= 120 && array.length >= 120))
  4087. ? new SetCache(othIndex && array)
  4088. : undefined;
  4089. }
  4090. array = arrays[0];
  4091. var index = -1,
  4092. seen = caches[0];
  4093. outer:
  4094. while (++index < length && result.length < maxLength) {
  4095. var value = array[index],
  4096. computed = iteratee ? iteratee(value) : value;
  4097. value = (comparator || value !== 0) ? value : 0;
  4098. if (!(seen
  4099. ? cacheHas(seen, computed)
  4100. : includes(result, computed, comparator)
  4101. )) {
  4102. othIndex = othLength;
  4103. while (--othIndex) {
  4104. var cache = caches[othIndex];
  4105. if (!(cache
  4106. ? cacheHas(cache, computed)
  4107. : includes(arrays[othIndex], computed, comparator))
  4108. ) {
  4109. continue outer;
  4110. }
  4111. }
  4112. if (seen) {
  4113. seen.push(computed);
  4114. }
  4115. result.push(value);
  4116. }
  4117. }
  4118. return result;
  4119. }
  4120. /**
  4121. * The base implementation of `_.invert` and `_.invertBy` which inverts
  4122. * `object` with values transformed by `iteratee` and set by `setter`.
  4123. *
  4124. * @private
  4125. * @param {Object} object The object to iterate over.
  4126. * @param {Function} setter The function to set `accumulator` values.
  4127. * @param {Function} iteratee The iteratee to transform values.
  4128. * @param {Object} accumulator The initial inverted object.
  4129. * @returns {Function} Returns `accumulator`.
  4130. */
  4131. function baseInverter(object, setter, iteratee, accumulator) {
  4132. baseForOwn(object, function(value, key, object) {
  4133. setter(accumulator, iteratee(value), key, object);
  4134. });
  4135. return accumulator;
  4136. }
  4137. /**
  4138. * The base implementation of `_.invoke` without support for individual
  4139. * method arguments.
  4140. *
  4141. * @private
  4142. * @param {Object} object The object to query.
  4143. * @param {Array|string} path The path of the method to invoke.
  4144. * @param {Array} args The arguments to invoke the method with.
  4145. * @returns {*} Returns the result of the invoked method.
  4146. */
  4147. function baseInvoke(object, path, args) {
  4148. path = castPath(path, object);
  4149. object = parent(object, path);
  4150. var func = object == null ? object : object[toKey(last(path))];
  4151. return func == null ? undefined : apply(func, object, args);
  4152. }
  4153. /**
  4154. * The base implementation of `_.isArguments`.
  4155. *
  4156. * @private
  4157. * @param {*} value The value to check.
  4158. * @returns {boolean} Returns `true` if `value` is an `arguments` object,
  4159. */
  4160. function baseIsArguments(value) {
  4161. return isObjectLike(value) && baseGetTag(value) == argsTag;
  4162. }
  4163. /**
  4164. * The base implementation of `_.isArrayBuffer` without Node.js optimizations.
  4165. *
  4166. * @private
  4167. * @param {*} value The value to check.
  4168. * @returns {boolean} Returns `true` if `value` is an array buffer, else `false`.
  4169. */
  4170. function baseIsArrayBuffer(value) {
  4171. return isObjectLike(value) && baseGetTag(value) == arrayBufferTag;
  4172. }
  4173. /**
  4174. * The base implementation of `_.isDate` without Node.js optimizations.
  4175. *
  4176. * @private
  4177. * @param {*} value The value to check.
  4178. * @returns {boolean} Returns `true` if `value` is a date object, else `false`.
  4179. */
  4180. function baseIsDate(value) {
  4181. return isObjectLike(value) && baseGetTag(value) == dateTag;
  4182. }
  4183. /**
  4184. * The base implementation of `_.isEqual` which supports partial comparisons
  4185. * and tracks traversed objects.
  4186. *
  4187. * @private
  4188. * @param {*} value The value to compare.
  4189. * @param {*} other The other value to compare.
  4190. * @param {boolean} bitmask The bitmask flags.
  4191. * 1 - Unordered comparison
  4192. * 2 - Partial comparison
  4193. * @param {Function} [customizer] The function to customize comparisons.
  4194. * @param {Object} [stack] Tracks traversed `value` and `other` objects.
  4195. * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
  4196. */
  4197. function baseIsEqual(value, other, bitmask, customizer, stack) {
  4198. if (value === other) {
  4199. return true;
  4200. }
  4201. if (value == null || other == null || (!isObjectLike(value) && !isObjectLike(other))) {
  4202. return value !== value && other !== other;
  4203. }
  4204. return baseIsEqualDeep(value, other, bitmask, customizer, baseIsEqual, stack);
  4205. }
  4206. /**
  4207. * A specialized version of `baseIsEqual` for arrays and objects which performs
  4208. * deep comparisons and tracks traversed objects enabling objects with circular
  4209. * references to be compared.
  4210. *
  4211. * @private
  4212. * @param {Object} object The object to compare.
  4213. * @param {Object} other The other object to compare.
  4214. * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
  4215. * @param {Function} customizer The function to customize comparisons.
  4216. * @param {Function} equalFunc The function to determine equivalents of values.
  4217. * @param {Object} [stack] Tracks traversed `object` and `other` objects.
  4218. * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
  4219. */
  4220. function baseIsEqualDeep(object, other, bitmask, customizer, equalFunc, stack) {
  4221. var objIsArr = isArray(object),
  4222. othIsArr = isArray(other),
  4223. objTag = objIsArr ? arrayTag : getTag(object),
  4224. othTag = othIsArr ? arrayTag : getTag(other);
  4225. objTag = objTag == argsTag ? objectTag : objTag;
  4226. othTag = othTag == argsTag ? objectTag : othTag;
  4227. var objIsObj = objTag == objectTag,
  4228. othIsObj = othTag == objectTag,
  4229. isSameTag = objTag == othTag;
  4230. if (isSameTag && isBuffer(object)) {
  4231. if (!isBuffer(other)) {
  4232. return false;
  4233. }
  4234. objIsArr = true;
  4235. objIsObj = false;
  4236. }
  4237. if (isSameTag && !objIsObj) {
  4238. stack || (stack = new Stack);
  4239. return (objIsArr || isTypedArray(object))
  4240. ? equalArrays(object, other, bitmask, customizer, equalFunc, stack)
  4241. : equalByTag(object, other, objTag, bitmask, customizer, equalFunc, stack);
  4242. }
  4243. if (!(bitmask & COMPARE_PARTIAL_FLAG)) {
  4244. var objIsWrapped = objIsObj && hasOwnProperty.call(object, '__wrapped__'),
  4245. othIsWrapped = othIsObj && hasOwnProperty.call(other, '__wrapped__');
  4246. if (objIsWrapped || othIsWrapped) {
  4247. var objUnwrapped = objIsWrapped ? object.value() : object,
  4248. othUnwrapped = othIsWrapped ? other.value() : other;
  4249. stack || (stack = new Stack);
  4250. return equalFunc(objUnwrapped, othUnwrapped, bitmask, customizer, stack);
  4251. }
  4252. }
  4253. if (!isSameTag) {
  4254. return false;
  4255. }
  4256. stack || (stack = new Stack);
  4257. return equalObjects(object, other, bitmask, customizer, equalFunc, stack);
  4258. }
  4259. /**
  4260. * The base implementation of `_.isMap` without Node.js optimizations.
  4261. *
  4262. * @private
  4263. * @param {*} value The value to check.
  4264. * @returns {boolean} Returns `true` if `value` is a map, else `false`.
  4265. */
  4266. function baseIsMap(value) {
  4267. return isObjectLike(value) && getTag(value) == mapTag;
  4268. }
  4269. /**
  4270. * The base implementation of `_.isMatch` without support for iteratee shorthands.
  4271. *
  4272. * @private
  4273. * @param {Object} object The object to inspect.
  4274. * @param {Object} source The object of property values to match.
  4275. * @param {Array} matchData The property names, values, and compare flags to match.
  4276. * @param {Function} [customizer] The function to customize comparisons.
  4277. * @returns {boolean} Returns `true` if `object` is a match, else `false`.
  4278. */
  4279. function baseIsMatch(object, source, matchData, customizer) {
  4280. var index = matchData.length,
  4281. length = index,
  4282. noCustomizer = !customizer;
  4283. if (object == null) {
  4284. return !length;
  4285. }
  4286. object = Object(object);
  4287. while (index--) {
  4288. var data = matchData[index];
  4289. if ((noCustomizer && data[2])
  4290. ? data[1] !== object[data[0]]
  4291. : !(data[0] in object)
  4292. ) {
  4293. return false;
  4294. }
  4295. }
  4296. while (++index < length) {
  4297. data = matchData[index];
  4298. var key = data[0],
  4299. objValue = object[key],
  4300. srcValue = data[1];
  4301. if (noCustomizer && data[2]) {
  4302. if (objValue === undefined && !(key in object)) {
  4303. return false;
  4304. }
  4305. } else {
  4306. var stack = new Stack;
  4307. if (customizer) {
  4308. var result = customizer(objValue, srcValue, key, object, source, stack);
  4309. }
  4310. if (!(result === undefined
  4311. ? baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG, customizer, stack)
  4312. : result
  4313. )) {
  4314. return false;
  4315. }
  4316. }
  4317. }
  4318. return true;
  4319. }
  4320. /**
  4321. * The base implementation of `_.isNative` without bad shim checks.
  4322. *
  4323. * @private
  4324. * @param {*} value The value to check.
  4325. * @returns {boolean} Returns `true` if `value` is a native function,
  4326. * else `false`.
  4327. */
  4328. function baseIsNative(value) {
  4329. if (!isObject(value) || isMasked(value)) {
  4330. return false;
  4331. }
  4332. var pattern = isFunction(value) ? reIsNative : reIsHostCtor;
  4333. return pattern.test(toSource(value));
  4334. }
  4335. /**
  4336. * The base implementation of `_.isRegExp` without Node.js optimizations.
  4337. *
  4338. * @private
  4339. * @param {*} value The value to check.
  4340. * @returns {boolean} Returns `true` if `value` is a regexp, else `false`.
  4341. */
  4342. function baseIsRegExp(value) {
  4343. return isObjectLike(value) && baseGetTag(value) == regexpTag;
  4344. }
  4345. /**
  4346. * The base implementation of `_.isSet` without Node.js optimizations.
  4347. *
  4348. * @private
  4349. * @param {*} value The value to check.
  4350. * @returns {boolean} Returns `true` if `value` is a set, else `false`.
  4351. */
  4352. function baseIsSet(value) {
  4353. return isObjectLike(value) && getTag(value) == setTag;
  4354. }
  4355. /**
  4356. * The base implementation of `_.isTypedArray` without Node.js optimizations.
  4357. *
  4358. * @private
  4359. * @param {*} value The value to check.
  4360. * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.
  4361. */
  4362. function baseIsTypedArray(value) {
  4363. return isObjectLike(value) &&
  4364. isLength(value.length) && !!typedArrayTags[baseGetTag(value)];
  4365. }
  4366. /**
  4367. * The base implementation of `_.iteratee`.
  4368. *
  4369. * @private
  4370. * @param {*} [value=_.identity] The value to convert to an iteratee.
  4371. * @returns {Function} Returns the iteratee.
  4372. */
  4373. function baseIteratee(value) {
  4374. // Don't store the `typeof` result in a variable to avoid a JIT bug in Safari 9.
  4375. // See https://bugs.webkit.org/show_bug.cgi?id=156034 for more details.
  4376. if (typeof value == 'function') {
  4377. return value;
  4378. }
  4379. if (value == null) {
  4380. return identity;
  4381. }
  4382. if (typeof value == 'object') {
  4383. return isArray(value)
  4384. ? baseMatchesProperty(value[0], value[1])
  4385. : baseMatches(value);
  4386. }
  4387. return property(value);
  4388. }
  4389. /**
  4390. * The base implementation of `_.keys` which doesn't treat sparse arrays as dense.
  4391. *
  4392. * @private
  4393. * @param {Object} object The object to query.
  4394. * @returns {Array} Returns the array of property names.
  4395. */
  4396. function baseKeys(object) {
  4397. if (!isPrototype(object)) {
  4398. return nativeKeys(object);
  4399. }
  4400. var result = [];
  4401. for (var key in Object(object)) {
  4402. if (hasOwnProperty.call(object, key) && key != 'constructor') {
  4403. result.push(key);
  4404. }
  4405. }
  4406. return result;
  4407. }
  4408. /**
  4409. * The base implementation of `_.keysIn` which doesn't treat sparse arrays as dense.
  4410. *
  4411. * @private
  4412. * @param {Object} object The object to query.
  4413. * @returns {Array} Returns the array of property names.
  4414. */
  4415. function baseKeysIn(object) {
  4416. if (!isObject(object)) {
  4417. return nativeKeysIn(object);
  4418. }
  4419. var isProto = isPrototype(object),
  4420. result = [];
  4421. for (var key in object) {
  4422. if (!(key == 'constructor' && (isProto || !hasOwnProperty.call(object, key)))) {
  4423. result.push(key);
  4424. }
  4425. }
  4426. return result;
  4427. }
  4428. /**
  4429. * The base implementation of `_.lt` which doesn't coerce arguments.
  4430. *
  4431. * @private
  4432. * @param {*} value The value to compare.
  4433. * @param {*} other The other value to compare.
  4434. * @returns {boolean} Returns `true` if `value` is less than `other`,
  4435. * else `false`.
  4436. */
  4437. function baseLt(value, other) {
  4438. return value < other;
  4439. }
  4440. /**
  4441. * The base implementation of `_.map` without support for iteratee shorthands.
  4442. *
  4443. * @private
  4444. * @param {Array|Object} collection The collection to iterate over.
  4445. * @param {Function} iteratee The function invoked per iteration.
  4446. * @returns {Array} Returns the new mapped array.
  4447. */
  4448. function baseMap(collection, iteratee) {
  4449. var index = -1,
  4450. result = isArrayLike(collection) ? Array(collection.length) : [];
  4451. baseEach(collection, function(value, key, collection) {
  4452. result[++index] = iteratee(value, key, collection);
  4453. });
  4454. return result;
  4455. }
  4456. /**
  4457. * The base implementation of `_.matches` which doesn't clone `source`.
  4458. *
  4459. * @private
  4460. * @param {Object} source The object of property values to match.
  4461. * @returns {Function} Returns the new spec function.
  4462. */
  4463. function baseMatches(source) {
  4464. var matchData = getMatchData(source);
  4465. if (matchData.length == 1 && matchData[0][2]) {
  4466. return matchesStrictComparable(matchData[0][0], matchData[0][1]);
  4467. }
  4468. return function(object) {
  4469. return object === source || baseIsMatch(object, source, matchData);
  4470. };
  4471. }
  4472. /**
  4473. * The base implementation of `_.matchesProperty` which doesn't clone `srcValue`.
  4474. *
  4475. * @private
  4476. * @param {string} path The path of the property to get.
  4477. * @param {*} srcValue The value to match.
  4478. * @returns {Function} Returns the new spec function.
  4479. */
  4480. function baseMatchesProperty(path, srcValue) {
  4481. if (isKey(path) && isStrictComparable(srcValue)) {
  4482. return matchesStrictComparable(toKey(path), srcValue);
  4483. }
  4484. return function(object) {
  4485. var objValue = get(object, path);
  4486. return (objValue === undefined && objValue === srcValue)
  4487. ? hasIn(object, path)
  4488. : baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG);
  4489. };
  4490. }
  4491. /**
  4492. * The base implementation of `_.merge` without support for multiple sources.
  4493. *
  4494. * @private
  4495. * @param {Object} object The destination object.
  4496. * @param {Object} source The source object.
  4497. * @param {number} srcIndex The index of `source`.
  4498. * @param {Function} [customizer] The function to customize merged values.
  4499. * @param {Object} [stack] Tracks traversed source values and their merged
  4500. * counterparts.
  4501. */
  4502. function baseMerge(object, source, srcIndex, customizer, stack) {
  4503. if (object === source) {
  4504. return;
  4505. }
  4506. baseFor(source, function(srcValue, key) {
  4507. stack || (stack = new Stack);
  4508. if (isObject(srcValue)) {
  4509. baseMergeDeep(object, source, key, srcIndex, baseMerge, customizer, stack);
  4510. }
  4511. else {
  4512. var newValue = customizer
  4513. ? customizer(safeGet(object, key), srcValue, (key + ''), object, source, stack)
  4514. : undefined;
  4515. if (newValue === undefined) {
  4516. newValue = srcValue;
  4517. }
  4518. assignMergeValue(object, key, newValue);
  4519. }
  4520. }, keysIn);
  4521. }
  4522. /**
  4523. * A specialized version of `baseMerge` for arrays and objects which performs
  4524. * deep merges and tracks traversed objects enabling objects with circular
  4525. * references to be merged.
  4526. *
  4527. * @private
  4528. * @param {Object} object The destination object.
  4529. * @param {Object} source The source object.
  4530. * @param {string} key The key of the value to merge.
  4531. * @param {number} srcIndex The index of `source`.
  4532. * @param {Function} mergeFunc The function to merge values.
  4533. * @param {Function} [customizer] The function to customize assigned values.
  4534. * @param {Object} [stack] Tracks traversed source values and their merged
  4535. * counterparts.
  4536. */
  4537. function baseMergeDeep(object, source, key, srcIndex, mergeFunc, customizer, stack) {
  4538. var objValue = safeGet(object, key),
  4539. srcValue = safeGet(source, key),
  4540. stacked = stack.get(srcValue);
  4541. if (stacked) {
  4542. assignMergeValue(object, key, stacked);
  4543. return;
  4544. }
  4545. var newValue = customizer
  4546. ? customizer(objValue, srcValue, (key + ''), object, source, stack)
  4547. : undefined;
  4548. var isCommon = newValue === undefined;
  4549. if (isCommon) {
  4550. var isArr = isArray(srcValue),
  4551. isBuff = !isArr && isBuffer(srcValue),
  4552. isTyped = !isArr && !isBuff && isTypedArray(srcValue);
  4553. newValue = srcValue;
  4554. if (isArr || isBuff || isTyped) {
  4555. if (isArray(objValue)) {
  4556. newValue = objValue;
  4557. }
  4558. else if (isArrayLikeObject(objValue)) {
  4559. newValue = copyArray(objValue);
  4560. }
  4561. else if (isBuff) {
  4562. isCommon = false;
  4563. newValue = cloneBuffer(srcValue, true);
  4564. }
  4565. else if (isTyped) {
  4566. isCommon = false;
  4567. newValue = cloneTypedArray(srcValue, true);
  4568. }
  4569. else {
  4570. newValue = [];
  4571. }
  4572. }
  4573. else if (isPlainObject(srcValue) || isArguments(srcValue)) {
  4574. newValue = objValue;
  4575. if (isArguments(objValue)) {
  4576. newValue = toPlainObject(objValue);
  4577. }
  4578. else if (!isObject(objValue) || isFunction(objValue)) {
  4579. newValue = initCloneObject(srcValue);
  4580. }
  4581. }
  4582. else {
  4583. isCommon = false;
  4584. }
  4585. }
  4586. if (isCommon) {
  4587. // Recursively merge objects and arrays (susceptible to call stack limits).
  4588. stack.set(srcValue, newValue);
  4589. mergeFunc(newValue, srcValue, srcIndex, customizer, stack);
  4590. stack['delete'](srcValue);
  4591. }
  4592. assignMergeValue(object, key, newValue);
  4593. }
  4594. /**
  4595. * The base implementation of `_.nth` which doesn't coerce arguments.
  4596. *
  4597. * @private
  4598. * @param {Array} array The array to query.
  4599. * @param {number} n The index of the element to return.
  4600. * @returns {*} Returns the nth element of `array`.
  4601. */
  4602. function baseNth(array, n) {
  4603. var length = array.length;
  4604. if (!length) {
  4605. return;
  4606. }
  4607. n += n < 0 ? length : 0;
  4608. return isIndex(n, length) ? array[n] : undefined;
  4609. }
  4610. /**
  4611. * The base implementation of `_.orderBy` without param guards.
  4612. *
  4613. * @private
  4614. * @param {Array|Object} collection The collection to iterate over.
  4615. * @param {Function[]|Object[]|string[]} iteratees The iteratees to sort by.
  4616. * @param {string[]} orders The sort orders of `iteratees`.
  4617. * @returns {Array} Returns the new sorted array.
  4618. */
  4619. function baseOrderBy(collection, iteratees, orders) {
  4620. if (iteratees.length) {
  4621. iteratees = arrayMap(iteratees, function(iteratee) {
  4622. if (isArray(iteratee)) {
  4623. return function(value) {
  4624. return baseGet(value, iteratee.length === 1 ? iteratee[0] : iteratee);
  4625. }
  4626. }
  4627. return iteratee;
  4628. });
  4629. } else {
  4630. iteratees = [identity];
  4631. }
  4632. var index = -1;
  4633. iteratees = arrayMap(iteratees, baseUnary(getIteratee()));
  4634. var result = baseMap(collection, function(value, key, collection) {
  4635. var criteria = arrayMap(iteratees, function(iteratee) {
  4636. return iteratee(value);
  4637. });
  4638. return { 'criteria': criteria, 'index': ++index, 'value': value };
  4639. });
  4640. return baseSortBy(result, function(object, other) {
  4641. return compareMultiple(object, other, orders);
  4642. });
  4643. }
  4644. /**
  4645. * The base implementation of `_.pick` without support for individual
  4646. * property identifiers.
  4647. *
  4648. * @private
  4649. * @param {Object} object The source object.
  4650. * @param {string[]} paths The property paths to pick.
  4651. * @returns {Object} Returns the new object.
  4652. */
  4653. function basePick(object, paths) {
  4654. return basePickBy(object, paths, function(value, path) {
  4655. return hasIn(object, path);
  4656. });
  4657. }
  4658. /**
  4659. * The base implementation of `_.pickBy` without support for iteratee shorthands.
  4660. *
  4661. * @private
  4662. * @param {Object} object The source object.
  4663. * @param {string[]} paths The property paths to pick.
  4664. * @param {Function} predicate The function invoked per property.
  4665. * @returns {Object} Returns the new object.
  4666. */
  4667. function basePickBy(object, paths, predicate) {
  4668. var index = -1,
  4669. length = paths.length,
  4670. result = {};
  4671. while (++index < length) {
  4672. var path = paths[index],
  4673. value = baseGet(object, path);
  4674. if (predicate(value, path)) {
  4675. baseSet(result, castPath(path, object), value);
  4676. }
  4677. }
  4678. return result;
  4679. }
  4680. /**
  4681. * A specialized version of `baseProperty` which supports deep paths.
  4682. *
  4683. * @private
  4684. * @param {Array|string} path The path of the property to get.
  4685. * @returns {Function} Returns the new accessor function.
  4686. */
  4687. function basePropertyDeep(path) {
  4688. return function(object) {
  4689. return baseGet(object, path);
  4690. };
  4691. }
  4692. /**
  4693. * The base implementation of `_.pullAllBy` without support for iteratee
  4694. * shorthands.
  4695. *
  4696. * @private
  4697. * @param {Array} array The array to modify.
  4698. * @param {Array} values The values to remove.
  4699. * @param {Function} [iteratee] The iteratee invoked per element.
  4700. * @param {Function} [comparator] The comparator invoked per element.
  4701. * @returns {Array} Returns `array`.
  4702. */
  4703. function basePullAll(array, values, iteratee, comparator) {
  4704. var indexOf = comparator ? baseIndexOfWith : baseIndexOf,
  4705. index = -1,
  4706. length = values.length,
  4707. seen = array;
  4708. if (array === values) {
  4709. values = copyArray(values);
  4710. }
  4711. if (iteratee) {
  4712. seen = arrayMap(array, baseUnary(iteratee));
  4713. }
  4714. while (++index < length) {
  4715. var fromIndex = 0,
  4716. value = values[index],
  4717. computed = iteratee ? iteratee(value) : value;
  4718. while ((fromIndex = indexOf(seen, computed, fromIndex, comparator)) > -1) {
  4719. if (seen !== array) {
  4720. splice.call(seen, fromIndex, 1);
  4721. }
  4722. splice.call(array, fromIndex, 1);
  4723. }
  4724. }
  4725. return array;
  4726. }
  4727. /**
  4728. * The base implementation of `_.pullAt` without support for individual
  4729. * indexes or capturing the removed elements.
  4730. *
  4731. * @private
  4732. * @param {Array} array The array to modify.
  4733. * @param {number[]} indexes The indexes of elements to remove.
  4734. * @returns {Array} Returns `array`.
  4735. */
  4736. function basePullAt(array, indexes) {
  4737. var length = array ? indexes.length : 0,
  4738. lastIndex = length - 1;
  4739. while (length--) {
  4740. var index = indexes[length];
  4741. if (length == lastIndex || index !== previous) {
  4742. var previous = index;
  4743. if (isIndex(index)) {
  4744. splice.call(array, index, 1);
  4745. } else {
  4746. baseUnset(array, index);
  4747. }
  4748. }
  4749. }
  4750. return array;
  4751. }
  4752. /**
  4753. * The base implementation of `_.random` without support for returning
  4754. * floating-point numbers.
  4755. *
  4756. * @private
  4757. * @param {number} lower The lower bound.
  4758. * @param {number} upper The upper bound.
  4759. * @returns {number} Returns the random number.
  4760. */
  4761. function baseRandom(lower, upper) {
  4762. return lower + nativeFloor(nativeRandom() * (upper - lower + 1));
  4763. }
  4764. /**
  4765. * The base implementation of `_.range` and `_.rangeRight` which doesn't
  4766. * coerce arguments.
  4767. *
  4768. * @private
  4769. * @param {number} start The start of the range.
  4770. * @param {number} end The end of the range.
  4771. * @param {number} step The value to increment or decrement by.
  4772. * @param {boolean} [fromRight] Specify iterating from right to left.
  4773. * @returns {Array} Returns the range of numbers.
  4774. */
  4775. function baseRange(start, end, step, fromRight) {
  4776. var index = -1,
  4777. length = nativeMax(nativeCeil((end - start) / (step || 1)), 0),
  4778. result = Array(length);
  4779. while (length--) {
  4780. result[fromRight ? length : ++index] = start;
  4781. start += step;
  4782. }
  4783. return result;
  4784. }
  4785. /**
  4786. * The base implementation of `_.repeat` which doesn't coerce arguments.
  4787. *
  4788. * @private
  4789. * @param {string} string The string to repeat.
  4790. * @param {number} n The number of times to repeat the string.
  4791. * @returns {string} Returns the repeated string.
  4792. */
  4793. function baseRepeat(string, n) {
  4794. var result = '';
  4795. if (!string || n < 1 || n > MAX_SAFE_INTEGER) {
  4796. return result;
  4797. }
  4798. // Leverage the exponentiation by squaring algorithm for a faster repeat.
  4799. // See https://en.wikipedia.org/wiki/Exponentiation_by_squaring for more details.
  4800. do {
  4801. if (n % 2) {
  4802. result += string;
  4803. }
  4804. n = nativeFloor(n / 2);
  4805. if (n) {
  4806. string += string;
  4807. }
  4808. } while (n);
  4809. return result;
  4810. }
  4811. /**
  4812. * The base implementation of `_.rest` which doesn't validate or coerce arguments.
  4813. *
  4814. * @private
  4815. * @param {Function} func The function to apply a rest parameter to.
  4816. * @param {number} [start=func.length-1] The start position of the rest parameter.
  4817. * @returns {Function} Returns the new function.
  4818. */
  4819. function baseRest(func, start) {
  4820. return setToString(overRest(func, start, identity), func + '');
  4821. }
  4822. /**
  4823. * The base implementation of `_.sample`.
  4824. *
  4825. * @private
  4826. * @param {Array|Object} collection The collection to sample.
  4827. * @returns {*} Returns the random element.
  4828. */
  4829. function baseSample(collection) {
  4830. return arraySample(values(collection));
  4831. }
  4832. /**
  4833. * The base implementation of `_.sampleSize` without param guards.
  4834. *
  4835. * @private
  4836. * @param {Array|Object} collection The collection to sample.
  4837. * @param {number} n The number of elements to sample.
  4838. * @returns {Array} Returns the random elements.
  4839. */
  4840. function baseSampleSize(collection, n) {
  4841. var array = values(collection);
  4842. return shuffleSelf(array, baseClamp(n, 0, array.length));
  4843. }
  4844. /**
  4845. * The base implementation of `_.set`.
  4846. *
  4847. * @private
  4848. * @param {Object} object The object to modify.
  4849. * @param {Array|string} path The path of the property to set.
  4850. * @param {*} value The value to set.
  4851. * @param {Function} [customizer] The function to customize path creation.
  4852. * @returns {Object} Returns `object`.
  4853. */
  4854. function baseSet(object, path, value, customizer) {
  4855. if (!isObject(object)) {
  4856. return object;
  4857. }
  4858. path = castPath(path, object);
  4859. var index = -1,
  4860. length = path.length,
  4861. lastIndex = length - 1,
  4862. nested = object;
  4863. while (nested != null && ++index < length) {
  4864. var key = toKey(path[index]),
  4865. newValue = value;
  4866. if (key === '__proto__' || key === 'constructor' || key === 'prototype') {
  4867. return object;
  4868. }
  4869. if (index != lastIndex) {
  4870. var objValue = nested[key];
  4871. newValue = customizer ? customizer(objValue, key, nested) : undefined;
  4872. if (newValue === undefined) {
  4873. newValue = isObject(objValue)
  4874. ? objValue
  4875. : (isIndex(path[index + 1]) ? [] : {});
  4876. }
  4877. }
  4878. assignValue(nested, key, newValue);
  4879. nested = nested[key];
  4880. }
  4881. return object;
  4882. }
  4883. /**
  4884. * The base implementation of `setData` without support for hot loop shorting.
  4885. *
  4886. * @private
  4887. * @param {Function} func The function to associate metadata with.
  4888. * @param {*} data The metadata.
  4889. * @returns {Function} Returns `func`.
  4890. */
  4891. var baseSetData = !metaMap ? identity : function(func, data) {
  4892. metaMap.set(func, data);
  4893. return func;
  4894. };
  4895. /**
  4896. * The base implementation of `setToString` without support for hot loop shorting.
  4897. *
  4898. * @private
  4899. * @param {Function} func The function to modify.
  4900. * @param {Function} string The `toString` result.
  4901. * @returns {Function} Returns `func`.
  4902. */
  4903. var baseSetToString = !defineProperty ? identity : function(func, string) {
  4904. return defineProperty(func, 'toString', {
  4905. 'configurable': true,
  4906. 'enumerable': false,
  4907. 'value': constant(string),
  4908. 'writable': true
  4909. });
  4910. };
  4911. /**
  4912. * The base implementation of `_.shuffle`.
  4913. *
  4914. * @private
  4915. * @param {Array|Object} collection The collection to shuffle.
  4916. * @returns {Array} Returns the new shuffled array.
  4917. */
  4918. function baseShuffle(collection) {
  4919. return shuffleSelf(values(collection));
  4920. }
  4921. /**
  4922. * The base implementation of `_.slice` without an iteratee call guard.
  4923. *
  4924. * @private
  4925. * @param {Array} array The array to slice.
  4926. * @param {number} [start=0] The start position.
  4927. * @param {number} [end=array.length] The end position.
  4928. * @returns {Array} Returns the slice of `array`.
  4929. */
  4930. function baseSlice(array, start, end) {
  4931. var index = -1,
  4932. length = array.length;
  4933. if (start < 0) {
  4934. start = -start > length ? 0 : (length + start);
  4935. }
  4936. end = end > length ? length : end;
  4937. if (end < 0) {
  4938. end += length;
  4939. }
  4940. length = start > end ? 0 : ((end - start) >>> 0);
  4941. start >>>= 0;
  4942. var result = Array(length);
  4943. while (++index < length) {
  4944. result[index] = array[index + start];
  4945. }
  4946. return result;
  4947. }
  4948. /**
  4949. * The base implementation of `_.some` without support for iteratee shorthands.
  4950. *
  4951. * @private
  4952. * @param {Array|Object} collection The collection to iterate over.
  4953. * @param {Function} predicate The function invoked per iteration.
  4954. * @returns {boolean} Returns `true` if any element passes the predicate check,
  4955. * else `false`.
  4956. */
  4957. function baseSome(collection, predicate) {
  4958. var result;
  4959. baseEach(collection, function(value, index, collection) {
  4960. result = predicate(value, index, collection);
  4961. return !result;
  4962. });
  4963. return !!result;
  4964. }
  4965. /**
  4966. * The base implementation of `_.sortedIndex` and `_.sortedLastIndex` which
  4967. * performs a binary search of `array` to determine the index at which `value`
  4968. * should be inserted into `array` in order to maintain its sort order.
  4969. *
  4970. * @private
  4971. * @param {Array} array The sorted array to inspect.
  4972. * @param {*} value The value to evaluate.
  4973. * @param {boolean} [retHighest] Specify returning the highest qualified index.
  4974. * @returns {number} Returns the index at which `value` should be inserted
  4975. * into `array`.
  4976. */
  4977. function baseSortedIndex(array, value, retHighest) {
  4978. var low = 0,
  4979. high = array == null ? low : array.length;
  4980. if (typeof value == 'number' && value === value && high <= HALF_MAX_ARRAY_LENGTH) {
  4981. while (low < high) {
  4982. var mid = (low + high) >>> 1,
  4983. computed = array[mid];
  4984. if (computed !== null && !isSymbol(computed) &&
  4985. (retHighest ? (computed <= value) : (computed < value))) {
  4986. low = mid + 1;
  4987. } else {
  4988. high = mid;
  4989. }
  4990. }
  4991. return high;
  4992. }
  4993. return baseSortedIndexBy(array, value, identity, retHighest);
  4994. }
  4995. /**
  4996. * The base implementation of `_.sortedIndexBy` and `_.sortedLastIndexBy`
  4997. * which invokes `iteratee` for `value` and each element of `array` to compute
  4998. * their sort ranking. The iteratee is invoked with one argument; (value).
  4999. *
  5000. * @private
  5001. * @param {Array} array The sorted array to inspect.
  5002. * @param {*} value The value to evaluate.
  5003. * @param {Function} iteratee The iteratee invoked per element.
  5004. * @param {boolean} [retHighest] Specify returning the highest qualified index.
  5005. * @returns {number} Returns the index at which `value` should be inserted
  5006. * into `array`.
  5007. */
  5008. function baseSortedIndexBy(array, value, iteratee, retHighest) {
  5009. var low = 0,
  5010. high = array == null ? 0 : array.length;
  5011. if (high === 0) {
  5012. return 0;
  5013. }
  5014. value = iteratee(value);
  5015. var valIsNaN = value !== value,
  5016. valIsNull = value === null,
  5017. valIsSymbol = isSymbol(value),
  5018. valIsUndefined = value === undefined;
  5019. while (low < high) {
  5020. var mid = nativeFloor((low + high) / 2),
  5021. computed = iteratee(array[mid]),
  5022. othIsDefined = computed !== undefined,
  5023. othIsNull = computed === null,
  5024. othIsReflexive = computed === computed,
  5025. othIsSymbol = isSymbol(computed);
  5026. if (valIsNaN) {
  5027. var setLow = retHighest || othIsReflexive;
  5028. } else if (valIsUndefined) {
  5029. setLow = othIsReflexive && (retHighest || othIsDefined);
  5030. } else if (valIsNull) {
  5031. setLow = othIsReflexive && othIsDefined && (retHighest || !othIsNull);
  5032. } else if (valIsSymbol) {
  5033. setLow = othIsReflexive && othIsDefined && !othIsNull && (retHighest || !othIsSymbol);
  5034. } else if (othIsNull || othIsSymbol) {
  5035. setLow = false;
  5036. } else {
  5037. setLow = retHighest ? (computed <= value) : (computed < value);
  5038. }
  5039. if (setLow) {
  5040. low = mid + 1;
  5041. } else {
  5042. high = mid;
  5043. }
  5044. }
  5045. return nativeMin(high, MAX_ARRAY_INDEX);
  5046. }
  5047. /**
  5048. * The base implementation of `_.sortedUniq` and `_.sortedUniqBy` without
  5049. * support for iteratee shorthands.
  5050. *
  5051. * @private
  5052. * @param {Array} array The array to inspect.
  5053. * @param {Function} [iteratee] The iteratee invoked per element.
  5054. * @returns {Array} Returns the new duplicate free array.
  5055. */
  5056. function baseSortedUniq(array, iteratee) {
  5057. var index = -1,
  5058. length = array.length,
  5059. resIndex = 0,
  5060. result = [];
  5061. while (++index < length) {
  5062. var value = array[index],
  5063. computed = iteratee ? iteratee(value) : value;
  5064. if (!index || !eq(computed, seen)) {
  5065. var seen = computed;
  5066. result[resIndex++] = value === 0 ? 0 : value;
  5067. }
  5068. }
  5069. return result;
  5070. }
  5071. /**
  5072. * The base implementation of `_.toNumber` which doesn't ensure correct
  5073. * conversions of binary, hexadecimal, or octal string values.
  5074. *
  5075. * @private
  5076. * @param {*} value The value to process.
  5077. * @returns {number} Returns the number.
  5078. */
  5079. function baseToNumber(value) {
  5080. if (typeof value == 'number') {
  5081. return value;
  5082. }
  5083. if (isSymbol(value)) {
  5084. return NAN;
  5085. }
  5086. return +value;
  5087. }
  5088. /**
  5089. * The base implementation of `_.toString` which doesn't convert nullish
  5090. * values to empty strings.
  5091. *
  5092. * @private
  5093. * @param {*} value The value to process.
  5094. * @returns {string} Returns the string.
  5095. */
  5096. function baseToString(value) {
  5097. // Exit early for strings to avoid a performance hit in some environments.
  5098. if (typeof value == 'string') {
  5099. return value;
  5100. }
  5101. if (isArray(value)) {
  5102. // Recursively convert values (susceptible to call stack limits).
  5103. return arrayMap(value, baseToString) + '';
  5104. }
  5105. if (isSymbol(value)) {
  5106. return symbolToString ? symbolToString.call(value) : '';
  5107. }
  5108. var result = (value + '');
  5109. return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;
  5110. }
  5111. /**
  5112. * The base implementation of `_.uniqBy` without support for iteratee shorthands.
  5113. *
  5114. * @private
  5115. * @param {Array} array The array to inspect.
  5116. * @param {Function} [iteratee] The iteratee invoked per element.
  5117. * @param {Function} [comparator] The comparator invoked per element.
  5118. * @returns {Array} Returns the new duplicate free array.
  5119. */
  5120. function baseUniq(array, iteratee, comparator) {
  5121. var index = -1,
  5122. includes = arrayIncludes,
  5123. length = array.length,
  5124. isCommon = true,
  5125. result = [],
  5126. seen = result;
  5127. if (comparator) {
  5128. isCommon = false;
  5129. includes = arrayIncludesWith;
  5130. }
  5131. else if (length >= LARGE_ARRAY_SIZE) {
  5132. var set = iteratee ? null : createSet(array);
  5133. if (set) {
  5134. return setToArray(set);
  5135. }
  5136. isCommon = false;
  5137. includes = cacheHas;
  5138. seen = new SetCache;
  5139. }
  5140. else {
  5141. seen = iteratee ? [] : result;
  5142. }
  5143. outer:
  5144. while (++index < length) {
  5145. var value = array[index],
  5146. computed = iteratee ? iteratee(value) : value;
  5147. value = (comparator || value !== 0) ? value : 0;
  5148. if (isCommon && computed === computed) {
  5149. var seenIndex = seen.length;
  5150. while (seenIndex--) {
  5151. if (seen[seenIndex] === computed) {
  5152. continue outer;
  5153. }
  5154. }
  5155. if (iteratee) {
  5156. seen.push(computed);
  5157. }
  5158. result.push(value);
  5159. }
  5160. else if (!includes(seen, computed, comparator)) {
  5161. if (seen !== result) {
  5162. seen.push(computed);
  5163. }
  5164. result.push(value);
  5165. }
  5166. }
  5167. return result;
  5168. }
  5169. /**
  5170. * The base implementation of `_.unset`.
  5171. *
  5172. * @private
  5173. * @param {Object} object The object to modify.
  5174. * @param {Array|string} path The property path to unset.
  5175. * @returns {boolean} Returns `true` if the property is deleted, else `false`.
  5176. */
  5177. function baseUnset(object, path) {
  5178. path = castPath(path, object);
  5179. object = parent(object, path);
  5180. return object == null || delete object[toKey(last(path))];
  5181. }
  5182. /**
  5183. * The base implementation of `_.update`.
  5184. *
  5185. * @private
  5186. * @param {Object} object The object to modify.
  5187. * @param {Array|string} path The path of the property to update.
  5188. * @param {Function} updater The function to produce the updated value.
  5189. * @param {Function} [customizer] The function to customize path creation.
  5190. * @returns {Object} Returns `object`.
  5191. */
  5192. function baseUpdate(object, path, updater, customizer) {
  5193. return baseSet(object, path, updater(baseGet(object, path)), customizer);
  5194. }
  5195. /**
  5196. * The base implementation of methods like `_.dropWhile` and `_.takeWhile`
  5197. * without support for iteratee shorthands.
  5198. *
  5199. * @private
  5200. * @param {Array} array The array to query.
  5201. * @param {Function} predicate The function invoked per iteration.
  5202. * @param {boolean} [isDrop] Specify dropping elements instead of taking them.
  5203. * @param {boolean} [fromRight] Specify iterating from right to left.
  5204. * @returns {Array} Returns the slice of `array`.
  5205. */
  5206. function baseWhile(array, predicate, isDrop, fromRight) {
  5207. var length = array.length,
  5208. index = fromRight ? length : -1;
  5209. while ((fromRight ? index-- : ++index < length) &&
  5210. predicate(array[index], index, array)) {}
  5211. return isDrop
  5212. ? baseSlice(array, (fromRight ? 0 : index), (fromRight ? index + 1 : length))
  5213. : baseSlice(array, (fromRight ? index + 1 : 0), (fromRight ? length : index));
  5214. }
  5215. /**
  5216. * The base implementation of `wrapperValue` which returns the result of
  5217. * performing a sequence of actions on the unwrapped `value`, where each
  5218. * successive action is supplied the return value of the previous.
  5219. *
  5220. * @private
  5221. * @param {*} value The unwrapped value.
  5222. * @param {Array} actions Actions to perform to resolve the unwrapped value.
  5223. * @returns {*} Returns the resolved value.
  5224. */
  5225. function baseWrapperValue(value, actions) {
  5226. var result = value;
  5227. if (result instanceof LazyWrapper) {
  5228. result = result.value();
  5229. }
  5230. return arrayReduce(actions, function(result, action) {
  5231. return action.func.apply(action.thisArg, arrayPush([result], action.args));
  5232. }, result);
  5233. }
  5234. /**
  5235. * The base implementation of methods like `_.xor`, without support for
  5236. * iteratee shorthands, that accepts an array of arrays to inspect.
  5237. *
  5238. * @private
  5239. * @param {Array} arrays The arrays to inspect.
  5240. * @param {Function} [iteratee] The iteratee invoked per element.
  5241. * @param {Function} [comparator] The comparator invoked per element.
  5242. * @returns {Array} Returns the new array of values.
  5243. */
  5244. function baseXor(arrays, iteratee, comparator) {
  5245. var length = arrays.length;
  5246. if (length < 2) {
  5247. return length ? baseUniq(arrays[0]) : [];
  5248. }
  5249. var index = -1,
  5250. result = Array(length);
  5251. while (++index < length) {
  5252. var array = arrays[index],
  5253. othIndex = -1;
  5254. while (++othIndex < length) {
  5255. if (othIndex != index) {
  5256. result[index] = baseDifference(result[index] || array, arrays[othIndex], iteratee, comparator);
  5257. }
  5258. }
  5259. }
  5260. return baseUniq(baseFlatten(result, 1), iteratee, comparator);
  5261. }
  5262. /**
  5263. * This base implementation of `_.zipObject` which assigns values using `assignFunc`.
  5264. *
  5265. * @private
  5266. * @param {Array} props The property identifiers.
  5267. * @param {Array} values The property values.
  5268. * @param {Function} assignFunc The function to assign values.
  5269. * @returns {Object} Returns the new object.
  5270. */
  5271. function baseZipObject(props, values, assignFunc) {
  5272. var index = -1,
  5273. length = props.length,
  5274. valsLength = values.length,
  5275. result = {};
  5276. while (++index < length) {
  5277. var value = index < valsLength ? values[index] : undefined;
  5278. assignFunc(result, props[index], value);
  5279. }
  5280. return result;
  5281. }
  5282. /**
  5283. * Casts `value` to an empty array if it's not an array like object.
  5284. *
  5285. * @private
  5286. * @param {*} value The value to inspect.
  5287. * @returns {Array|Object} Returns the cast array-like object.
  5288. */
  5289. function castArrayLikeObject(value) {
  5290. return isArrayLikeObject(value) ? value : [];
  5291. }
  5292. /**
  5293. * Casts `value` to `identity` if it's not a function.
  5294. *
  5295. * @private
  5296. * @param {*} value The value to inspect.
  5297. * @returns {Function} Returns cast function.
  5298. */
  5299. function castFunction(value) {
  5300. return typeof value == 'function' ? value : identity;
  5301. }
  5302. /**
  5303. * Casts `value` to a path array if it's not one.
  5304. *
  5305. * @private
  5306. * @param {*} value The value to inspect.
  5307. * @param {Object} [object] The object to query keys on.
  5308. * @returns {Array} Returns the cast property path array.
  5309. */
  5310. function castPath(value, object) {
  5311. if (isArray(value)) {
  5312. return value;
  5313. }
  5314. return isKey(value, object) ? [value] : stringToPath(toString(value));
  5315. }
  5316. /**
  5317. * A `baseRest` alias which can be replaced with `identity` by module
  5318. * replacement plugins.
  5319. *
  5320. * @private
  5321. * @type {Function}
  5322. * @param {Function} func The function to apply a rest parameter to.
  5323. * @returns {Function} Returns the new function.
  5324. */
  5325. var castRest = baseRest;
  5326. /**
  5327. * Casts `array` to a slice if it's needed.
  5328. *
  5329. * @private
  5330. * @param {Array} array The array to inspect.
  5331. * @param {number} start The start position.
  5332. * @param {number} [end=array.length] The end position.
  5333. * @returns {Array} Returns the cast slice.
  5334. */
  5335. function castSlice(array, start, end) {
  5336. var length = array.length;
  5337. end = end === undefined ? length : end;
  5338. return (!start && end >= length) ? array : baseSlice(array, start, end);
  5339. }
  5340. /**
  5341. * A simple wrapper around the global [`clearTimeout`](https://mdn.io/clearTimeout).
  5342. *
  5343. * @private
  5344. * @param {number|Object} id The timer id or timeout object of the timer to clear.
  5345. */
  5346. var clearTimeout = ctxClearTimeout || function(id) {
  5347. return root.clearTimeout(id);
  5348. };
  5349. /**
  5350. * Creates a clone of `buffer`.
  5351. *
  5352. * @private
  5353. * @param {Buffer} buffer The buffer to clone.
  5354. * @param {boolean} [isDeep] Specify a deep clone.
  5355. * @returns {Buffer} Returns the cloned buffer.
  5356. */
  5357. function cloneBuffer(buffer, isDeep) {
  5358. if (isDeep) {
  5359. return buffer.slice();
  5360. }
  5361. var length = buffer.length,
  5362. result = allocUnsafe ? allocUnsafe(length) : new buffer.constructor(length);
  5363. buffer.copy(result);
  5364. return result;
  5365. }
  5366. /**
  5367. * Creates a clone of `arrayBuffer`.
  5368. *
  5369. * @private
  5370. * @param {ArrayBuffer} arrayBuffer The array buffer to clone.
  5371. * @returns {ArrayBuffer} Returns the cloned array buffer.
  5372. */
  5373. function cloneArrayBuffer(arrayBuffer) {
  5374. var result = new arrayBuffer.constructor(arrayBuffer.byteLength);
  5375. new Uint8Array(result).set(new Uint8Array(arrayBuffer));
  5376. return result;
  5377. }
  5378. /**
  5379. * Creates a clone of `dataView`.
  5380. *
  5381. * @private
  5382. * @param {Object} dataView The data view to clone.
  5383. * @param {boolean} [isDeep] Specify a deep clone.
  5384. * @returns {Object} Returns the cloned data view.
  5385. */
  5386. function cloneDataView(dataView, isDeep) {
  5387. var buffer = isDeep ? cloneArrayBuffer(dataView.buffer) : dataView.buffer;
  5388. return new dataView.constructor(buffer, dataView.byteOffset, dataView.byteLength);
  5389. }
  5390. /**
  5391. * Creates a clone of `regexp`.
  5392. *
  5393. * @private
  5394. * @param {Object} regexp The regexp to clone.
  5395. * @returns {Object} Returns the cloned regexp.
  5396. */
  5397. function cloneRegExp(regexp) {
  5398. var result = new regexp.constructor(regexp.source, reFlags.exec(regexp));
  5399. result.lastIndex = regexp.lastIndex;
  5400. return result;
  5401. }
  5402. /**
  5403. * Creates a clone of the `symbol` object.
  5404. *
  5405. * @private
  5406. * @param {Object} symbol The symbol object to clone.
  5407. * @returns {Object} Returns the cloned symbol object.
  5408. */
  5409. function cloneSymbol(symbol) {
  5410. return symbolValueOf ? Object(symbolValueOf.call(symbol)) : {};
  5411. }
  5412. /**
  5413. * Creates a clone of `typedArray`.
  5414. *
  5415. * @private
  5416. * @param {Object} typedArray The typed array to clone.
  5417. * @param {boolean} [isDeep] Specify a deep clone.
  5418. * @returns {Object} Returns the cloned typed array.
  5419. */
  5420. function cloneTypedArray(typedArray, isDeep) {
  5421. var buffer = isDeep ? cloneArrayBuffer(typedArray.buffer) : typedArray.buffer;
  5422. return new typedArray.constructor(buffer, typedArray.byteOffset, typedArray.length);
  5423. }
  5424. /**
  5425. * Compares values to sort them in ascending order.
  5426. *
  5427. * @private
  5428. * @param {*} value The value to compare.
  5429. * @param {*} other The other value to compare.
  5430. * @returns {number} Returns the sort order indicator for `value`.
  5431. */
  5432. function compareAscending(value, other) {
  5433. if (value !== other) {
  5434. var valIsDefined = value !== undefined,
  5435. valIsNull = value === null,
  5436. valIsReflexive = value === value,
  5437. valIsSymbol = isSymbol(value);
  5438. var othIsDefined = other !== undefined,
  5439. othIsNull = other === null,
  5440. othIsReflexive = other === other,
  5441. othIsSymbol = isSymbol(other);
  5442. if ((!othIsNull && !othIsSymbol && !valIsSymbol && value > other) ||
  5443. (valIsSymbol && othIsDefined && othIsReflexive && !othIsNull && !othIsSymbol) ||
  5444. (valIsNull && othIsDefined && othIsReflexive) ||
  5445. (!valIsDefined && othIsReflexive) ||
  5446. !valIsReflexive) {
  5447. return 1;
  5448. }
  5449. if ((!valIsNull && !valIsSymbol && !othIsSymbol && value < other) ||
  5450. (othIsSymbol && valIsDefined && valIsReflexive && !valIsNull && !valIsSymbol) ||
  5451. (othIsNull && valIsDefined && valIsReflexive) ||
  5452. (!othIsDefined && valIsReflexive) ||
  5453. !othIsReflexive) {
  5454. return -1;
  5455. }
  5456. }
  5457. return 0;
  5458. }
  5459. /**
  5460. * Used by `_.orderBy` to compare multiple properties of a value to another
  5461. * and stable sort them.
  5462. *
  5463. * If `orders` is unspecified, all values are sorted in ascending order. Otherwise,
  5464. * specify an order of "desc" for descending or "asc" for ascending sort order
  5465. * of corresponding values.
  5466. *
  5467. * @private
  5468. * @param {Object} object The object to compare.
  5469. * @param {Object} other The other object to compare.
  5470. * @param {boolean[]|string[]} orders The order to sort by for each property.
  5471. * @returns {number} Returns the sort order indicator for `object`.
  5472. */
  5473. function compareMultiple(object, other, orders) {
  5474. var index = -1,
  5475. objCriteria = object.criteria,
  5476. othCriteria = other.criteria,
  5477. length = objCriteria.length,
  5478. ordersLength = orders.length;
  5479. while (++index < length) {
  5480. var result = compareAscending(objCriteria[index], othCriteria[index]);
  5481. if (result) {
  5482. if (index >= ordersLength) {
  5483. return result;
  5484. }
  5485. var order = orders[index];
  5486. return result * (order == 'desc' ? -1 : 1);
  5487. }
  5488. }
  5489. // Fixes an `Array#sort` bug in the JS engine embedded in Adobe applications
  5490. // that causes it, under certain circumstances, to provide the same value for
  5491. // `object` and `other`. See https://github.com/jashkenas/underscore/pull/1247
  5492. // for more details.
  5493. //
  5494. // This also ensures a stable sort in V8 and other engines.
  5495. // See https://bugs.chromium.org/p/v8/issues/detail?id=90 for more details.
  5496. return object.index - other.index;
  5497. }
  5498. /**
  5499. * Creates an array that is the composition of partially applied arguments,
  5500. * placeholders, and provided arguments into a single array of arguments.
  5501. *
  5502. * @private
  5503. * @param {Array} args The provided arguments.
  5504. * @param {Array} partials The arguments to prepend to those provided.
  5505. * @param {Array} holders The `partials` placeholder indexes.
  5506. * @params {boolean} [isCurried] Specify composing for a curried function.
  5507. * @returns {Array} Returns the new array of composed arguments.
  5508. */
  5509. function composeArgs(args, partials, holders, isCurried) {
  5510. var argsIndex = -1,
  5511. argsLength = args.length,
  5512. holdersLength = holders.length,
  5513. leftIndex = -1,
  5514. leftLength = partials.length,
  5515. rangeLength = nativeMax(argsLength - holdersLength, 0),
  5516. result = Array(leftLength + rangeLength),
  5517. isUncurried = !isCurried;
  5518. while (++leftIndex < leftLength) {
  5519. result[leftIndex] = partials[leftIndex];
  5520. }
  5521. while (++argsIndex < holdersLength) {
  5522. if (isUncurried || argsIndex < argsLength) {
  5523. result[holders[argsIndex]] = args[argsIndex];
  5524. }
  5525. }
  5526. while (rangeLength--) {
  5527. result[leftIndex++] = args[argsIndex++];
  5528. }
  5529. return result;
  5530. }
  5531. /**
  5532. * This function is like `composeArgs` except that the arguments composition
  5533. * is tailored for `_.partialRight`.
  5534. *
  5535. * @private
  5536. * @param {Array} args The provided arguments.
  5537. * @param {Array} partials The arguments to append to those provided.
  5538. * @param {Array} holders The `partials` placeholder indexes.
  5539. * @params {boolean} [isCurried] Specify composing for a curried function.
  5540. * @returns {Array} Returns the new array of composed arguments.
  5541. */
  5542. function composeArgsRight(args, partials, holders, isCurried) {
  5543. var argsIndex = -1,
  5544. argsLength = args.length,
  5545. holdersIndex = -1,
  5546. holdersLength = holders.length,
  5547. rightIndex = -1,
  5548. rightLength = partials.length,
  5549. rangeLength = nativeMax(argsLength - holdersLength, 0),
  5550. result = Array(rangeLength + rightLength),
  5551. isUncurried = !isCurried;
  5552. while (++argsIndex < rangeLength) {
  5553. result[argsIndex] = args[argsIndex];
  5554. }
  5555. var offset = argsIndex;
  5556. while (++rightIndex < rightLength) {
  5557. result[offset + rightIndex] = partials[rightIndex];
  5558. }
  5559. while (++holdersIndex < holdersLength) {
  5560. if (isUncurried || argsIndex < argsLength) {
  5561. result[offset + holders[holdersIndex]] = args[argsIndex++];
  5562. }
  5563. }
  5564. return result;
  5565. }
  5566. /**
  5567. * Copies the values of `source` to `array`.
  5568. *
  5569. * @private
  5570. * @param {Array} source The array to copy values from.
  5571. * @param {Array} [array=[]] The array to copy values to.
  5572. * @returns {Array} Returns `array`.
  5573. */
  5574. function copyArray(source, array) {
  5575. var index = -1,
  5576. length = source.length;
  5577. array || (array = Array(length));
  5578. while (++index < length) {
  5579. array[index] = source[index];
  5580. }
  5581. return array;
  5582. }
  5583. /**
  5584. * Copies properties of `source` to `object`.
  5585. *
  5586. * @private
  5587. * @param {Object} source The object to copy properties from.
  5588. * @param {Array} props The property identifiers to copy.
  5589. * @param {Object} [object={}] The object to copy properties to.
  5590. * @param {Function} [customizer] The function to customize copied values.
  5591. * @returns {Object} Returns `object`.
  5592. */
  5593. function copyObject(source, props, object, customizer) {
  5594. var isNew = !object;
  5595. object || (object = {});
  5596. var index = -1,
  5597. length = props.length;
  5598. while (++index < length) {
  5599. var key = props[index];
  5600. var newValue = customizer
  5601. ? customizer(object[key], source[key], key, object, source)
  5602. : undefined;
  5603. if (newValue === undefined) {
  5604. newValue = source[key];
  5605. }
  5606. if (isNew) {
  5607. baseAssignValue(object, key, newValue);
  5608. } else {
  5609. assignValue(object, key, newValue);
  5610. }
  5611. }
  5612. return object;
  5613. }
  5614. /**
  5615. * Copies own symbols of `source` to `object`.
  5616. *
  5617. * @private
  5618. * @param {Object} source The object to copy symbols from.
  5619. * @param {Object} [object={}] The object to copy symbols to.
  5620. * @returns {Object} Returns `object`.
  5621. */
  5622. function copySymbols(source, object) {
  5623. return copyObject(source, getSymbols(source), object);
  5624. }
  5625. /**
  5626. * Copies own and inherited symbols of `source` to `object`.
  5627. *
  5628. * @private
  5629. * @param {Object} source The object to copy symbols from.
  5630. * @param {Object} [object={}] The object to copy symbols to.
  5631. * @returns {Object} Returns `object`.
  5632. */
  5633. function copySymbolsIn(source, object) {
  5634. return copyObject(source, getSymbolsIn(source), object);
  5635. }
  5636. /**
  5637. * Creates a function like `_.groupBy`.
  5638. *
  5639. * @private
  5640. * @param {Function} setter The function to set accumulator values.
  5641. * @param {Function} [initializer] The accumulator object initializer.
  5642. * @returns {Function} Returns the new aggregator function.
  5643. */
  5644. function createAggregator(setter, initializer) {
  5645. return function(collection, iteratee) {
  5646. var func = isArray(collection) ? arrayAggregator : baseAggregator,
  5647. accumulator = initializer ? initializer() : {};
  5648. return func(collection, setter, getIteratee(iteratee, 2), accumulator);
  5649. };
  5650. }
  5651. /**
  5652. * Creates a function like `_.assign`.
  5653. *
  5654. * @private
  5655. * @param {Function} assigner The function to assign values.
  5656. * @returns {Function} Returns the new assigner function.
  5657. */
  5658. function createAssigner(assigner) {
  5659. return baseRest(function(object, sources) {
  5660. var index = -1,
  5661. length = sources.length,
  5662. customizer = length > 1 ? sources[length - 1] : undefined,
  5663. guard = length > 2 ? sources[2] : undefined;
  5664. customizer = (assigner.length > 3 && typeof customizer == 'function')
  5665. ? (length--, customizer)
  5666. : undefined;
  5667. if (guard && isIterateeCall(sources[0], sources[1], guard)) {
  5668. customizer = length < 3 ? undefined : customizer;
  5669. length = 1;
  5670. }
  5671. object = Object(object);
  5672. while (++index < length) {
  5673. var source = sources[index];
  5674. if (source) {
  5675. assigner(object, source, index, customizer);
  5676. }
  5677. }
  5678. return object;
  5679. });
  5680. }
  5681. /**
  5682. * Creates a `baseEach` or `baseEachRight` function.
  5683. *
  5684. * @private
  5685. * @param {Function} eachFunc The function to iterate over a collection.
  5686. * @param {boolean} [fromRight] Specify iterating from right to left.
  5687. * @returns {Function} Returns the new base function.
  5688. */
  5689. function createBaseEach(eachFunc, fromRight) {
  5690. return function(collection, iteratee) {
  5691. if (collection == null) {
  5692. return collection;
  5693. }
  5694. if (!isArrayLike(collection)) {
  5695. return eachFunc(collection, iteratee);
  5696. }
  5697. var length = collection.length,
  5698. index = fromRight ? length : -1,
  5699. iterable = Object(collection);
  5700. while ((fromRight ? index-- : ++index < length)) {
  5701. if (iteratee(iterable[index], index, iterable) === false) {
  5702. break;
  5703. }
  5704. }
  5705. return collection;
  5706. };
  5707. }
  5708. /**
  5709. * Creates a base function for methods like `_.forIn` and `_.forOwn`.
  5710. *
  5711. * @private
  5712. * @param {boolean} [fromRight] Specify iterating from right to left.
  5713. * @returns {Function} Returns the new base function.
  5714. */
  5715. function createBaseFor(fromRight) {
  5716. return function(object, iteratee, keysFunc) {
  5717. var index = -1,
  5718. iterable = Object(object),
  5719. props = keysFunc(object),
  5720. length = props.length;
  5721. while (length--) {
  5722. var key = props[fromRight ? length : ++index];
  5723. if (iteratee(iterable[key], key, iterable) === false) {
  5724. break;
  5725. }
  5726. }
  5727. return object;
  5728. };
  5729. }
  5730. /**
  5731. * Creates a function that wraps `func` to invoke it with the optional `this`
  5732. * binding of `thisArg`.
  5733. *
  5734. * @private
  5735. * @param {Function} func The function to wrap.
  5736. * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
  5737. * @param {*} [thisArg] The `this` binding of `func`.
  5738. * @returns {Function} Returns the new wrapped function.
  5739. */
  5740. function createBind(func, bitmask, thisArg) {
  5741. var isBind = bitmask & WRAP_BIND_FLAG,
  5742. Ctor = createCtor(func);
  5743. function wrapper() {
  5744. var fn = (this && this !== root && this instanceof wrapper) ? Ctor : func;
  5745. return fn.apply(isBind ? thisArg : this, arguments);
  5746. }
  5747. return wrapper;
  5748. }
  5749. /**
  5750. * Creates a function like `_.lowerFirst`.
  5751. *
  5752. * @private
  5753. * @param {string} methodName The name of the `String` case method to use.
  5754. * @returns {Function} Returns the new case function.
  5755. */
  5756. function createCaseFirst(methodName) {
  5757. return function(string) {
  5758. string = toString(string);
  5759. var strSymbols = hasUnicode(string)
  5760. ? stringToArray(string)
  5761. : undefined;
  5762. var chr = strSymbols
  5763. ? strSymbols[0]
  5764. : string.charAt(0);
  5765. var trailing = strSymbols
  5766. ? castSlice(strSymbols, 1).join('')
  5767. : string.slice(1);
  5768. return chr[methodName]() + trailing;
  5769. };
  5770. }
  5771. /**
  5772. * Creates a function like `_.camelCase`.
  5773. *
  5774. * @private
  5775. * @param {Function} callback The function to combine each word.
  5776. * @returns {Function} Returns the new compounder function.
  5777. */
  5778. function createCompounder(callback) {
  5779. return function(string) {
  5780. return arrayReduce(words(deburr(string).replace(reApos, '')), callback, '');
  5781. };
  5782. }
  5783. /**
  5784. * Creates a function that produces an instance of `Ctor` regardless of
  5785. * whether it was invoked as part of a `new` expression or by `call` or `apply`.
  5786. *
  5787. * @private
  5788. * @param {Function} Ctor The constructor to wrap.
  5789. * @returns {Function} Returns the new wrapped function.
  5790. */
  5791. function createCtor(Ctor) {
  5792. return function() {
  5793. // Use a `switch` statement to work with class constructors. See
  5794. // http://ecma-international.org/ecma-262/7.0/#sec-ecmascript-function-objects-call-thisargument-argumentslist
  5795. // for more details.
  5796. var args = arguments;
  5797. switch (args.length) {
  5798. case 0: return new Ctor;
  5799. case 1: return new Ctor(args[0]);
  5800. case 2: return new Ctor(args[0], args[1]);
  5801. case 3: return new Ctor(args[0], args[1], args[2]);
  5802. case 4: return new Ctor(args[0], args[1], args[2], args[3]);
  5803. case 5: return new Ctor(args[0], args[1], args[2], args[3], args[4]);
  5804. case 6: return new Ctor(args[0], args[1], args[2], args[3], args[4], args[5]);
  5805. case 7: return new Ctor(args[0], args[1], args[2], args[3], args[4], args[5], args[6]);
  5806. }
  5807. var thisBinding = baseCreate(Ctor.prototype),
  5808. result = Ctor.apply(thisBinding, args);
  5809. // Mimic the constructor's `return` behavior.
  5810. // See https://es5.github.io/#x13.2.2 for more details.
  5811. return isObject(result) ? result : thisBinding;
  5812. };
  5813. }
  5814. /**
  5815. * Creates a function that wraps `func` to enable currying.
  5816. *
  5817. * @private
  5818. * @param {Function} func The function to wrap.
  5819. * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
  5820. * @param {number} arity The arity of `func`.
  5821. * @returns {Function} Returns the new wrapped function.
  5822. */
  5823. function createCurry(func, bitmask, arity) {
  5824. var Ctor = createCtor(func);
  5825. function wrapper() {
  5826. var length = arguments.length,
  5827. args = Array(length),
  5828. index = length,
  5829. placeholder = getHolder(wrapper);
  5830. while (index--) {
  5831. args[index] = arguments[index];
  5832. }
  5833. var holders = (length < 3 && args[0] !== placeholder && args[length - 1] !== placeholder)
  5834. ? []
  5835. : replaceHolders(args, placeholder);
  5836. length -= holders.length;
  5837. if (length < arity) {
  5838. return createRecurry(
  5839. func, bitmask, createHybrid, wrapper.placeholder, undefined,
  5840. args, holders, undefined, undefined, arity - length);
  5841. }
  5842. var fn = (this && this !== root && this instanceof wrapper) ? Ctor : func;
  5843. return apply(fn, this, args);
  5844. }
  5845. return wrapper;
  5846. }
  5847. /**
  5848. * Creates a `_.find` or `_.findLast` function.
  5849. *
  5850. * @private
  5851. * @param {Function} findIndexFunc The function to find the collection index.
  5852. * @returns {Function} Returns the new find function.
  5853. */
  5854. function createFind(findIndexFunc) {
  5855. return function(collection, predicate, fromIndex) {
  5856. var iterable = Object(collection);
  5857. if (!isArrayLike(collection)) {
  5858. var iteratee = getIteratee(predicate, 3);
  5859. collection = keys(collection);
  5860. predicate = function(key) { return iteratee(iterable[key], key, iterable); };
  5861. }
  5862. var index = findIndexFunc(collection, predicate, fromIndex);
  5863. return index > -1 ? iterable[iteratee ? collection[index] : index] : undefined;
  5864. };
  5865. }
  5866. /**
  5867. * Creates a `_.flow` or `_.flowRight` function.
  5868. *
  5869. * @private
  5870. * @param {boolean} [fromRight] Specify iterating from right to left.
  5871. * @returns {Function} Returns the new flow function.
  5872. */
  5873. function createFlow(fromRight) {
  5874. return flatRest(function(funcs) {
  5875. var length = funcs.length,
  5876. index = length,
  5877. prereq = LodashWrapper.prototype.thru;
  5878. if (fromRight) {
  5879. funcs.reverse();
  5880. }
  5881. while (index--) {
  5882. var func = funcs[index];
  5883. if (typeof func != 'function') {
  5884. throw new TypeError(FUNC_ERROR_TEXT);
  5885. }
  5886. if (prereq && !wrapper && getFuncName(func) == 'wrapper') {
  5887. var wrapper = new LodashWrapper([], true);
  5888. }
  5889. }
  5890. index = wrapper ? index : length;
  5891. while (++index < length) {
  5892. func = funcs[index];
  5893. var funcName = getFuncName(func),
  5894. data = funcName == 'wrapper' ? getData(func) : undefined;
  5895. if (data && isLaziable(data[0]) &&
  5896. data[1] == (WRAP_ARY_FLAG | WRAP_CURRY_FLAG | WRAP_PARTIAL_FLAG | WRAP_REARG_FLAG) &&
  5897. !data[4].length && data[9] == 1
  5898. ) {
  5899. wrapper = wrapper[getFuncName(data[0])].apply(wrapper, data[3]);
  5900. } else {
  5901. wrapper = (func.length == 1 && isLaziable(func))
  5902. ? wrapper[funcName]()
  5903. : wrapper.thru(func);
  5904. }
  5905. }
  5906. return function() {
  5907. var args = arguments,
  5908. value = args[0];
  5909. if (wrapper && args.length == 1 && isArray(value)) {
  5910. return wrapper.plant(value).value();
  5911. }
  5912. var index = 0,
  5913. result = length ? funcs[index].apply(this, args) : value;
  5914. while (++index < length) {
  5915. result = funcs[index].call(this, result);
  5916. }
  5917. return result;
  5918. };
  5919. });
  5920. }
  5921. /**
  5922. * Creates a function that wraps `func` to invoke it with optional `this`
  5923. * binding of `thisArg`, partial application, and currying.
  5924. *
  5925. * @private
  5926. * @param {Function|string} func The function or method name to wrap.
  5927. * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
  5928. * @param {*} [thisArg] The `this` binding of `func`.
  5929. * @param {Array} [partials] The arguments to prepend to those provided to
  5930. * the new function.
  5931. * @param {Array} [holders] The `partials` placeholder indexes.
  5932. * @param {Array} [partialsRight] The arguments to append to those provided
  5933. * to the new function.
  5934. * @param {Array} [holdersRight] The `partialsRight` placeholder indexes.
  5935. * @param {Array} [argPos] The argument positions of the new function.
  5936. * @param {number} [ary] The arity cap of `func`.
  5937. * @param {number} [arity] The arity of `func`.
  5938. * @returns {Function} Returns the new wrapped function.
  5939. */
  5940. function createHybrid(func, bitmask, thisArg, partials, holders, partialsRight, holdersRight, argPos, ary, arity) {
  5941. var isAry = bitmask & WRAP_ARY_FLAG,
  5942. isBind = bitmask & WRAP_BIND_FLAG,
  5943. isBindKey = bitmask & WRAP_BIND_KEY_FLAG,
  5944. isCurried = bitmask & (WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG),
  5945. isFlip = bitmask & WRAP_FLIP_FLAG,
  5946. Ctor = isBindKey ? undefined : createCtor(func);
  5947. function wrapper() {
  5948. var length = arguments.length,
  5949. args = Array(length),
  5950. index = length;
  5951. while (index--) {
  5952. args[index] = arguments[index];
  5953. }
  5954. if (isCurried) {
  5955. var placeholder = getHolder(wrapper),
  5956. holdersCount = countHolders(args, placeholder);
  5957. }
  5958. if (partials) {
  5959. args = composeArgs(args, partials, holders, isCurried);
  5960. }
  5961. if (partialsRight) {
  5962. args = composeArgsRight(args, partialsRight, holdersRight, isCurried);
  5963. }
  5964. length -= holdersCount;
  5965. if (isCurried && length < arity) {
  5966. var newHolders = replaceHolders(args, placeholder);
  5967. return createRecurry(
  5968. func, bitmask, createHybrid, wrapper.placeholder, thisArg,
  5969. args, newHolders, argPos, ary, arity - length
  5970. );
  5971. }
  5972. var thisBinding = isBind ? thisArg : this,
  5973. fn = isBindKey ? thisBinding[func] : func;
  5974. length = args.length;
  5975. if (argPos) {
  5976. args = reorder(args, argPos);
  5977. } else if (isFlip && length > 1) {
  5978. args.reverse();
  5979. }
  5980. if (isAry && ary < length) {
  5981. args.length = ary;
  5982. }
  5983. if (this && this !== root && this instanceof wrapper) {
  5984. fn = Ctor || createCtor(fn);
  5985. }
  5986. return fn.apply(thisBinding, args);
  5987. }
  5988. return wrapper;
  5989. }
  5990. /**
  5991. * Creates a function like `_.invertBy`.
  5992. *
  5993. * @private
  5994. * @param {Function} setter The function to set accumulator values.
  5995. * @param {Function} toIteratee The function to resolve iteratees.
  5996. * @returns {Function} Returns the new inverter function.
  5997. */
  5998. function createInverter(setter, toIteratee) {
  5999. return function(object, iteratee) {
  6000. return baseInverter(object, setter, toIteratee(iteratee), {});
  6001. };
  6002. }
  6003. /**
  6004. * Creates a function that performs a mathematical operation on two values.
  6005. *
  6006. * @private
  6007. * @param {Function} operator The function to perform the operation.
  6008. * @param {number} [defaultValue] The value used for `undefined` arguments.
  6009. * @returns {Function} Returns the new mathematical operation function.
  6010. */
  6011. function createMathOperation(operator, defaultValue) {
  6012. return function(value, other) {
  6013. var result;
  6014. if (value === undefined && other === undefined) {
  6015. return defaultValue;
  6016. }
  6017. if (value !== undefined) {
  6018. result = value;
  6019. }
  6020. if (other !== undefined) {
  6021. if (result === undefined) {
  6022. return other;
  6023. }
  6024. if (typeof value == 'string' || typeof other == 'string') {
  6025. value = baseToString(value);
  6026. other = baseToString(other);
  6027. } else {
  6028. value = baseToNumber(value);
  6029. other = baseToNumber(other);
  6030. }
  6031. result = operator(value, other);
  6032. }
  6033. return result;
  6034. };
  6035. }
  6036. /**
  6037. * Creates a function like `_.over`.
  6038. *
  6039. * @private
  6040. * @param {Function} arrayFunc The function to iterate over iteratees.
  6041. * @returns {Function} Returns the new over function.
  6042. */
  6043. function createOver(arrayFunc) {
  6044. return flatRest(function(iteratees) {
  6045. iteratees = arrayMap(iteratees, baseUnary(getIteratee()));
  6046. return baseRest(function(args) {
  6047. var thisArg = this;
  6048. return arrayFunc(iteratees, function(iteratee) {
  6049. return apply(iteratee, thisArg, args);
  6050. });
  6051. });
  6052. });
  6053. }
  6054. /**
  6055. * Creates the padding for `string` based on `length`. The `chars` string
  6056. * is truncated if the number of characters exceeds `length`.
  6057. *
  6058. * @private
  6059. * @param {number} length The padding length.
  6060. * @param {string} [chars=' '] The string used as padding.
  6061. * @returns {string} Returns the padding for `string`.
  6062. */
  6063. function createPadding(length, chars) {
  6064. chars = chars === undefined ? ' ' : baseToString(chars);
  6065. var charsLength = chars.length;
  6066. if (charsLength < 2) {
  6067. return charsLength ? baseRepeat(chars, length) : chars;
  6068. }
  6069. var result = baseRepeat(chars, nativeCeil(length / stringSize(chars)));
  6070. return hasUnicode(chars)
  6071. ? castSlice(stringToArray(result), 0, length).join('')
  6072. : result.slice(0, length);
  6073. }
  6074. /**
  6075. * Creates a function that wraps `func` to invoke it with the `this` binding
  6076. * of `thisArg` and `partials` prepended to the arguments it receives.
  6077. *
  6078. * @private
  6079. * @param {Function} func The function to wrap.
  6080. * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
  6081. * @param {*} thisArg The `this` binding of `func`.
  6082. * @param {Array} partials The arguments to prepend to those provided to
  6083. * the new function.
  6084. * @returns {Function} Returns the new wrapped function.
  6085. */
  6086. function createPartial(func, bitmask, thisArg, partials) {
  6087. var isBind = bitmask & WRAP_BIND_FLAG,
  6088. Ctor = createCtor(func);
  6089. function wrapper() {
  6090. var argsIndex = -1,
  6091. argsLength = arguments.length,
  6092. leftIndex = -1,
  6093. leftLength = partials.length,
  6094. args = Array(leftLength + argsLength),
  6095. fn = (this && this !== root && this instanceof wrapper) ? Ctor : func;
  6096. while (++leftIndex < leftLength) {
  6097. args[leftIndex] = partials[leftIndex];
  6098. }
  6099. while (argsLength--) {
  6100. args[leftIndex++] = arguments[++argsIndex];
  6101. }
  6102. return apply(fn, isBind ? thisArg : this, args);
  6103. }
  6104. return wrapper;
  6105. }
  6106. /**
  6107. * Creates a `_.range` or `_.rangeRight` function.
  6108. *
  6109. * @private
  6110. * @param {boolean} [fromRight] Specify iterating from right to left.
  6111. * @returns {Function} Returns the new range function.
  6112. */
  6113. function createRange(fromRight) {
  6114. return function(start, end, step) {
  6115. if (step && typeof step != 'number' && isIterateeCall(start, end, step)) {
  6116. end = step = undefined;
  6117. }
  6118. // Ensure the sign of `-0` is preserved.
  6119. start = toFinite(start);
  6120. if (end === undefined) {
  6121. end = start;
  6122. start = 0;
  6123. } else {
  6124. end = toFinite(end);
  6125. }
  6126. step = step === undefined ? (start < end ? 1 : -1) : toFinite(step);
  6127. return baseRange(start, end, step, fromRight);
  6128. };
  6129. }
  6130. /**
  6131. * Creates a function that performs a relational operation on two values.
  6132. *
  6133. * @private
  6134. * @param {Function} operator The function to perform the operation.
  6135. * @returns {Function} Returns the new relational operation function.
  6136. */
  6137. function createRelationalOperation(operator) {
  6138. return function(value, other) {
  6139. if (!(typeof value == 'string' && typeof other == 'string')) {
  6140. value = toNumber(value);
  6141. other = toNumber(other);
  6142. }
  6143. return operator(value, other);
  6144. };
  6145. }
  6146. /**
  6147. * Creates a function that wraps `func` to continue currying.
  6148. *
  6149. * @private
  6150. * @param {Function} func The function to wrap.
  6151. * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
  6152. * @param {Function} wrapFunc The function to create the `func` wrapper.
  6153. * @param {*} placeholder The placeholder value.
  6154. * @param {*} [thisArg] The `this` binding of `func`.
  6155. * @param {Array} [partials] The arguments to prepend to those provided to
  6156. * the new function.
  6157. * @param {Array} [holders] The `partials` placeholder indexes.
  6158. * @param {Array} [argPos] The argument positions of the new function.
  6159. * @param {number} [ary] The arity cap of `func`.
  6160. * @param {number} [arity] The arity of `func`.
  6161. * @returns {Function} Returns the new wrapped function.
  6162. */
  6163. function createRecurry(func, bitmask, wrapFunc, placeholder, thisArg, partials, holders, argPos, ary, arity) {
  6164. var isCurry = bitmask & WRAP_CURRY_FLAG,
  6165. newHolders = isCurry ? holders : undefined,
  6166. newHoldersRight = isCurry ? undefined : holders,
  6167. newPartials = isCurry ? partials : undefined,
  6168. newPartialsRight = isCurry ? undefined : partials;
  6169. bitmask |= (isCurry ? WRAP_PARTIAL_FLAG : WRAP_PARTIAL_RIGHT_FLAG);
  6170. bitmask &= ~(isCurry ? WRAP_PARTIAL_RIGHT_FLAG : WRAP_PARTIAL_FLAG);
  6171. if (!(bitmask & WRAP_CURRY_BOUND_FLAG)) {
  6172. bitmask &= ~(WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG);
  6173. }
  6174. var newData = [
  6175. func, bitmask, thisArg, newPartials, newHolders, newPartialsRight,
  6176. newHoldersRight, argPos, ary, arity
  6177. ];
  6178. var result = wrapFunc.apply(undefined, newData);
  6179. if (isLaziable(func)) {
  6180. setData(result, newData);
  6181. }
  6182. result.placeholder = placeholder;
  6183. return setWrapToString(result, func, bitmask);
  6184. }
  6185. /**
  6186. * Creates a function like `_.round`.
  6187. *
  6188. * @private
  6189. * @param {string} methodName The name of the `Math` method to use when rounding.
  6190. * @returns {Function} Returns the new round function.
  6191. */
  6192. function createRound(methodName) {
  6193. var func = Math[methodName];
  6194. return function(number, precision) {
  6195. number = toNumber(number);
  6196. precision = precision == null ? 0 : nativeMin(toInteger(precision), 292);
  6197. if (precision && nativeIsFinite(number)) {
  6198. // Shift with exponential notation to avoid floating-point issues.
  6199. // See [MDN](https://mdn.io/round#Examples) for more details.
  6200. var pair = (toString(number) + 'e').split('e'),
  6201. value = func(pair[0] + 'e' + (+pair[1] + precision));
  6202. pair = (toString(value) + 'e').split('e');
  6203. return +(pair[0] + 'e' + (+pair[1] - precision));
  6204. }
  6205. return func(number);
  6206. };
  6207. }
  6208. /**
  6209. * Creates a set object of `values`.
  6210. *
  6211. * @private
  6212. * @param {Array} values The values to add to the set.
  6213. * @returns {Object} Returns the new set.
  6214. */
  6215. var createSet = !(Set && (1 / setToArray(new Set([,-0]))[1]) == INFINITY) ? noop : function(values) {
  6216. return new Set(values);
  6217. };
  6218. /**
  6219. * Creates a `_.toPairs` or `_.toPairsIn` function.
  6220. *
  6221. * @private
  6222. * @param {Function} keysFunc The function to get the keys of a given object.
  6223. * @returns {Function} Returns the new pairs function.
  6224. */
  6225. function createToPairs(keysFunc) {
  6226. return function(object) {
  6227. var tag = getTag(object);
  6228. if (tag == mapTag) {
  6229. return mapToArray(object);
  6230. }
  6231. if (tag == setTag) {
  6232. return setToPairs(object);
  6233. }
  6234. return baseToPairs(object, keysFunc(object));
  6235. };
  6236. }
  6237. /**
  6238. * Creates a function that either curries or invokes `func` with optional
  6239. * `this` binding and partially applied arguments.
  6240. *
  6241. * @private
  6242. * @param {Function|string} func The function or method name to wrap.
  6243. * @param {number} bitmask The bitmask flags.
  6244. * 1 - `_.bind`
  6245. * 2 - `_.bindKey`
  6246. * 4 - `_.curry` or `_.curryRight` of a bound function
  6247. * 8 - `_.curry`
  6248. * 16 - `_.curryRight`
  6249. * 32 - `_.partial`
  6250. * 64 - `_.partialRight`
  6251. * 128 - `_.rearg`
  6252. * 256 - `_.ary`
  6253. * 512 - `_.flip`
  6254. * @param {*} [thisArg] The `this` binding of `func`.
  6255. * @param {Array} [partials] The arguments to be partially applied.
  6256. * @param {Array} [holders] The `partials` placeholder indexes.
  6257. * @param {Array} [argPos] The argument positions of the new function.
  6258. * @param {number} [ary] The arity cap of `func`.
  6259. * @param {number} [arity] The arity of `func`.
  6260. * @returns {Function} Returns the new wrapped function.
  6261. */
  6262. function createWrap(func, bitmask, thisArg, partials, holders, argPos, ary, arity) {
  6263. var isBindKey = bitmask & WRAP_BIND_KEY_FLAG;
  6264. if (!isBindKey && typeof func != 'function') {
  6265. throw new TypeError(FUNC_ERROR_TEXT);
  6266. }
  6267. var length = partials ? partials.length : 0;
  6268. if (!length) {
  6269. bitmask &= ~(WRAP_PARTIAL_FLAG | WRAP_PARTIAL_RIGHT_FLAG);
  6270. partials = holders = undefined;
  6271. }
  6272. ary = ary === undefined ? ary : nativeMax(toInteger(ary), 0);
  6273. arity = arity === undefined ? arity : toInteger(arity);
  6274. length -= holders ? holders.length : 0;
  6275. if (bitmask & WRAP_PARTIAL_RIGHT_FLAG) {
  6276. var partialsRight = partials,
  6277. holdersRight = holders;
  6278. partials = holders = undefined;
  6279. }
  6280. var data = isBindKey ? undefined : getData(func);
  6281. var newData = [
  6282. func, bitmask, thisArg, partials, holders, partialsRight, holdersRight,
  6283. argPos, ary, arity
  6284. ];
  6285. if (data) {
  6286. mergeData(newData, data);
  6287. }
  6288. func = newData[0];
  6289. bitmask = newData[1];
  6290. thisArg = newData[2];
  6291. partials = newData[3];
  6292. holders = newData[4];
  6293. arity = newData[9] = newData[9] === undefined
  6294. ? (isBindKey ? 0 : func.length)
  6295. : nativeMax(newData[9] - length, 0);
  6296. if (!arity && bitmask & (WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG)) {
  6297. bitmask &= ~(WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG);
  6298. }
  6299. if (!bitmask || bitmask == WRAP_BIND_FLAG) {
  6300. var result = createBind(func, bitmask, thisArg);
  6301. } else if (bitmask == WRAP_CURRY_FLAG || bitmask == WRAP_CURRY_RIGHT_FLAG) {
  6302. result = createCurry(func, bitmask, arity);
  6303. } else if ((bitmask == WRAP_PARTIAL_FLAG || bitmask == (WRAP_BIND_FLAG | WRAP_PARTIAL_FLAG)) && !holders.length) {
  6304. result = createPartial(func, bitmask, thisArg, partials);
  6305. } else {
  6306. result = createHybrid.apply(undefined, newData);
  6307. }
  6308. var setter = data ? baseSetData : setData;
  6309. return setWrapToString(setter(result, newData), func, bitmask);
  6310. }
  6311. /**
  6312. * Used by `_.defaults` to customize its `_.assignIn` use to assign properties
  6313. * of source objects to the destination object for all destination properties
  6314. * that resolve to `undefined`.
  6315. *
  6316. * @private
  6317. * @param {*} objValue The destination value.
  6318. * @param {*} srcValue The source value.
  6319. * @param {string} key The key of the property to assign.
  6320. * @param {Object} object The parent object of `objValue`.
  6321. * @returns {*} Returns the value to assign.
  6322. */
  6323. function customDefaultsAssignIn(objValue, srcValue, key, object) {
  6324. if (objValue === undefined ||
  6325. (eq(objValue, objectProto[key]) && !hasOwnProperty.call(object, key))) {
  6326. return srcValue;
  6327. }
  6328. return objValue;
  6329. }
  6330. /**
  6331. * Used by `_.defaultsDeep` to customize its `_.merge` use to merge source
  6332. * objects into destination objects that are passed thru.
  6333. *
  6334. * @private
  6335. * @param {*} objValue The destination value.
  6336. * @param {*} srcValue The source value.
  6337. * @param {string} key The key of the property to merge.
  6338. * @param {Object} object The parent object of `objValue`.
  6339. * @param {Object} source The parent object of `srcValue`.
  6340. * @param {Object} [stack] Tracks traversed source values and their merged
  6341. * counterparts.
  6342. * @returns {*} Returns the value to assign.
  6343. */
  6344. function customDefaultsMerge(objValue, srcValue, key, object, source, stack) {
  6345. if (isObject(objValue) && isObject(srcValue)) {
  6346. // Recursively merge objects and arrays (susceptible to call stack limits).
  6347. stack.set(srcValue, objValue);
  6348. baseMerge(objValue, srcValue, undefined, customDefaultsMerge, stack);
  6349. stack['delete'](srcValue);
  6350. }
  6351. return objValue;
  6352. }
  6353. /**
  6354. * Used by `_.omit` to customize its `_.cloneDeep` use to only clone plain
  6355. * objects.
  6356. *
  6357. * @private
  6358. * @param {*} value The value to inspect.
  6359. * @param {string} key The key of the property to inspect.
  6360. * @returns {*} Returns the uncloned value or `undefined` to defer cloning to `_.cloneDeep`.
  6361. */
  6362. function customOmitClone(value) {
  6363. return isPlainObject(value) ? undefined : value;
  6364. }
  6365. /**
  6366. * A specialized version of `baseIsEqualDeep` for arrays with support for
  6367. * partial deep comparisons.
  6368. *
  6369. * @private
  6370. * @param {Array} array The array to compare.
  6371. * @param {Array} other The other array to compare.
  6372. * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
  6373. * @param {Function} customizer The function to customize comparisons.
  6374. * @param {Function} equalFunc The function to determine equivalents of values.
  6375. * @param {Object} stack Tracks traversed `array` and `other` objects.
  6376. * @returns {boolean} Returns `true` if the arrays are equivalent, else `false`.
  6377. */
  6378. function equalArrays(array, other, bitmask, customizer, equalFunc, stack) {
  6379. var isPartial = bitmask & COMPARE_PARTIAL_FLAG,
  6380. arrLength = array.length,
  6381. othLength = other.length;
  6382. if (arrLength != othLength && !(isPartial && othLength > arrLength)) {
  6383. return false;
  6384. }
  6385. // Check that cyclic values are equal.
  6386. var arrStacked = stack.get(array);
  6387. var othStacked = stack.get(other);
  6388. if (arrStacked && othStacked) {
  6389. return arrStacked == other && othStacked == array;
  6390. }
  6391. var index = -1,
  6392. result = true,
  6393. seen = (bitmask & COMPARE_UNORDERED_FLAG) ? new SetCache : undefined;
  6394. stack.set(array, other);
  6395. stack.set(other, array);
  6396. // Ignore non-index properties.
  6397. while (++index < arrLength) {
  6398. var arrValue = array[index],
  6399. othValue = other[index];
  6400. if (customizer) {
  6401. var compared = isPartial
  6402. ? customizer(othValue, arrValue, index, other, array, stack)
  6403. : customizer(arrValue, othValue, index, array, other, stack);
  6404. }
  6405. if (compared !== undefined) {
  6406. if (compared) {
  6407. continue;
  6408. }
  6409. result = false;
  6410. break;
  6411. }
  6412. // Recursively compare arrays (susceptible to call stack limits).
  6413. if (seen) {
  6414. if (!arraySome(other, function(othValue, othIndex) {
  6415. if (!cacheHas(seen, othIndex) &&
  6416. (arrValue === othValue || equalFunc(arrValue, othValue, bitmask, customizer, stack))) {
  6417. return seen.push(othIndex);
  6418. }
  6419. })) {
  6420. result = false;
  6421. break;
  6422. }
  6423. } else if (!(
  6424. arrValue === othValue ||
  6425. equalFunc(arrValue, othValue, bitmask, customizer, stack)
  6426. )) {
  6427. result = false;
  6428. break;
  6429. }
  6430. }
  6431. stack['delete'](array);
  6432. stack['delete'](other);
  6433. return result;
  6434. }
  6435. /**
  6436. * A specialized version of `baseIsEqualDeep` for comparing objects of
  6437. * the same `toStringTag`.
  6438. *
  6439. * **Note:** This function only supports comparing values with tags of
  6440. * `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`.
  6441. *
  6442. * @private
  6443. * @param {Object} object The object to compare.
  6444. * @param {Object} other The other object to compare.
  6445. * @param {string} tag The `toStringTag` of the objects to compare.
  6446. * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
  6447. * @param {Function} customizer The function to customize comparisons.
  6448. * @param {Function} equalFunc The function to determine equivalents of values.
  6449. * @param {Object} stack Tracks traversed `object` and `other` objects.
  6450. * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
  6451. */
  6452. function equalByTag(object, other, tag, bitmask, customizer, equalFunc, stack) {
  6453. switch (tag) {
  6454. case dataViewTag:
  6455. if ((object.byteLength != other.byteLength) ||
  6456. (object.byteOffset != other.byteOffset)) {
  6457. return false;
  6458. }
  6459. object = object.buffer;
  6460. other = other.buffer;
  6461. case arrayBufferTag:
  6462. if ((object.byteLength != other.byteLength) ||
  6463. !equalFunc(new Uint8Array(object), new Uint8Array(other))) {
  6464. return false;
  6465. }
  6466. return true;
  6467. case boolTag:
  6468. case dateTag:
  6469. case numberTag:
  6470. // Coerce booleans to `1` or `0` and dates to milliseconds.
  6471. // Invalid dates are coerced to `NaN`.
  6472. return eq(+object, +other);
  6473. case errorTag:
  6474. return object.name == other.name && object.message == other.message;
  6475. case regexpTag:
  6476. case stringTag:
  6477. // Coerce regexes to strings and treat strings, primitives and objects,
  6478. // as equal. See http://www.ecma-international.org/ecma-262/7.0/#sec-regexp.prototype.tostring
  6479. // for more details.
  6480. return object == (other + '');
  6481. case mapTag:
  6482. var convert = mapToArray;
  6483. case setTag:
  6484. var isPartial = bitmask & COMPARE_PARTIAL_FLAG;
  6485. convert || (convert = setToArray);
  6486. if (object.size != other.size && !isPartial) {
  6487. return false;
  6488. }
  6489. // Assume cyclic values are equal.
  6490. var stacked = stack.get(object);
  6491. if (stacked) {
  6492. return stacked == other;
  6493. }
  6494. bitmask |= COMPARE_UNORDERED_FLAG;
  6495. // Recursively compare objects (susceptible to call stack limits).
  6496. stack.set(object, other);
  6497. var result = equalArrays(convert(object), convert(other), bitmask, customizer, equalFunc, stack);
  6498. stack['delete'](object);
  6499. return result;
  6500. case symbolTag:
  6501. if (symbolValueOf) {
  6502. return symbolValueOf.call(object) == symbolValueOf.call(other);
  6503. }
  6504. }
  6505. return false;
  6506. }
  6507. /**
  6508. * A specialized version of `baseIsEqualDeep` for objects with support for
  6509. * partial deep comparisons.
  6510. *
  6511. * @private
  6512. * @param {Object} object The object to compare.
  6513. * @param {Object} other The other object to compare.
  6514. * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
  6515. * @param {Function} customizer The function to customize comparisons.
  6516. * @param {Function} equalFunc The function to determine equivalents of values.
  6517. * @param {Object} stack Tracks traversed `object` and `other` objects.
  6518. * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
  6519. */
  6520. function equalObjects(object, other, bitmask, customizer, equalFunc, stack) {
  6521. var isPartial = bitmask & COMPARE_PARTIAL_FLAG,
  6522. objProps = getAllKeys(object),
  6523. objLength = objProps.length,
  6524. othProps = getAllKeys(other),
  6525. othLength = othProps.length;
  6526. if (objLength != othLength && !isPartial) {
  6527. return false;
  6528. }
  6529. var index = objLength;
  6530. while (index--) {
  6531. var key = objProps[index];
  6532. if (!(isPartial ? key in other : hasOwnProperty.call(other, key))) {
  6533. return false;
  6534. }
  6535. }
  6536. // Check that cyclic values are equal.
  6537. var objStacked = stack.get(object);
  6538. var othStacked = stack.get(other);
  6539. if (objStacked && othStacked) {
  6540. return objStacked == other && othStacked == object;
  6541. }
  6542. var result = true;
  6543. stack.set(object, other);
  6544. stack.set(other, object);
  6545. var skipCtor = isPartial;
  6546. while (++index < objLength) {
  6547. key = objProps[index];
  6548. var objValue = object[key],
  6549. othValue = other[key];
  6550. if (customizer) {
  6551. var compared = isPartial
  6552. ? customizer(othValue, objValue, key, other, object, stack)
  6553. : customizer(objValue, othValue, key, object, other, stack);
  6554. }
  6555. // Recursively compare objects (susceptible to call stack limits).
  6556. if (!(compared === undefined
  6557. ? (objValue === othValue || equalFunc(objValue, othValue, bitmask, customizer, stack))
  6558. : compared
  6559. )) {
  6560. result = false;
  6561. break;
  6562. }
  6563. skipCtor || (skipCtor = key == 'constructor');
  6564. }
  6565. if (result && !skipCtor) {
  6566. var objCtor = object.constructor,
  6567. othCtor = other.constructor;
  6568. // Non `Object` object instances with different constructors are not equal.
  6569. if (objCtor != othCtor &&
  6570. ('constructor' in object && 'constructor' in other) &&
  6571. !(typeof objCtor == 'function' && objCtor instanceof objCtor &&
  6572. typeof othCtor == 'function' && othCtor instanceof othCtor)) {
  6573. result = false;
  6574. }
  6575. }
  6576. stack['delete'](object);
  6577. stack['delete'](other);
  6578. return result;
  6579. }
  6580. /**
  6581. * A specialized version of `baseRest` which flattens the rest array.
  6582. *
  6583. * @private
  6584. * @param {Function} func The function to apply a rest parameter to.
  6585. * @returns {Function} Returns the new function.
  6586. */
  6587. function flatRest(func) {
  6588. return setToString(overRest(func, undefined, flatten), func + '');
  6589. }
  6590. /**
  6591. * Creates an array of own enumerable property names and symbols of `object`.
  6592. *
  6593. * @private
  6594. * @param {Object} object The object to query.
  6595. * @returns {Array} Returns the array of property names and symbols.
  6596. */
  6597. function getAllKeys(object) {
  6598. return baseGetAllKeys(object, keys, getSymbols);
  6599. }
  6600. /**
  6601. * Creates an array of own and inherited enumerable property names and
  6602. * symbols of `object`.
  6603. *
  6604. * @private
  6605. * @param {Object} object The object to query.
  6606. * @returns {Array} Returns the array of property names and symbols.
  6607. */
  6608. function getAllKeysIn(object) {
  6609. return baseGetAllKeys(object, keysIn, getSymbolsIn);
  6610. }
  6611. /**
  6612. * Gets metadata for `func`.
  6613. *
  6614. * @private
  6615. * @param {Function} func The function to query.
  6616. * @returns {*} Returns the metadata for `func`.
  6617. */
  6618. var getData = !metaMap ? noop : function(func) {
  6619. return metaMap.get(func);
  6620. };
  6621. /**
  6622. * Gets the name of `func`.
  6623. *
  6624. * @private
  6625. * @param {Function} func The function to query.
  6626. * @returns {string} Returns the function name.
  6627. */
  6628. function getFuncName(func) {
  6629. var result = (func.name + ''),
  6630. array = realNames[result],
  6631. length = hasOwnProperty.call(realNames, result) ? array.length : 0;
  6632. while (length--) {
  6633. var data = array[length],
  6634. otherFunc = data.func;
  6635. if (otherFunc == null || otherFunc == func) {
  6636. return data.name;
  6637. }
  6638. }
  6639. return result;
  6640. }
  6641. /**
  6642. * Gets the argument placeholder value for `func`.
  6643. *
  6644. * @private
  6645. * @param {Function} func The function to inspect.
  6646. * @returns {*} Returns the placeholder value.
  6647. */
  6648. function getHolder(func) {
  6649. var object = hasOwnProperty.call(lodash, 'placeholder') ? lodash : func;
  6650. return object.placeholder;
  6651. }
  6652. /**
  6653. * Gets the appropriate "iteratee" function. If `_.iteratee` is customized,
  6654. * this function returns the custom method, otherwise it returns `baseIteratee`.
  6655. * If arguments are provided, the chosen function is invoked with them and
  6656. * its result is returned.
  6657. *
  6658. * @private
  6659. * @param {*} [value] The value to convert to an iteratee.
  6660. * @param {number} [arity] The arity of the created iteratee.
  6661. * @returns {Function} Returns the chosen function or its result.
  6662. */
  6663. function getIteratee() {
  6664. var result = lodash.iteratee || iteratee;
  6665. result = result === iteratee ? baseIteratee : result;
  6666. return arguments.length ? result(arguments[0], arguments[1]) : result;
  6667. }
  6668. /**
  6669. * Gets the data for `map`.
  6670. *
  6671. * @private
  6672. * @param {Object} map The map to query.
  6673. * @param {string} key The reference key.
  6674. * @returns {*} Returns the map data.
  6675. */
  6676. function getMapData(map, key) {
  6677. var data = map.__data__;
  6678. return isKeyable(key)
  6679. ? data[typeof key == 'string' ? 'string' : 'hash']
  6680. : data.map;
  6681. }
  6682. /**
  6683. * Gets the property names, values, and compare flags of `object`.
  6684. *
  6685. * @private
  6686. * @param {Object} object The object to query.
  6687. * @returns {Array} Returns the match data of `object`.
  6688. */
  6689. function getMatchData(object) {
  6690. var result = keys(object),
  6691. length = result.length;
  6692. while (length--) {
  6693. var key = result[length],
  6694. value = object[key];
  6695. result[length] = [key, value, isStrictComparable(value)];
  6696. }
  6697. return result;
  6698. }
  6699. /**
  6700. * Gets the native function at `key` of `object`.
  6701. *
  6702. * @private
  6703. * @param {Object} object The object to query.
  6704. * @param {string} key The key of the method to get.
  6705. * @returns {*} Returns the function if it's native, else `undefined`.
  6706. */
  6707. function getNative(object, key) {
  6708. var value = getValue(object, key);
  6709. return baseIsNative(value) ? value : undefined;
  6710. }
  6711. /**
  6712. * A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values.
  6713. *
  6714. * @private
  6715. * @param {*} value The value to query.
  6716. * @returns {string} Returns the raw `toStringTag`.
  6717. */
  6718. function getRawTag(value) {
  6719. var isOwn = hasOwnProperty.call(value, symToStringTag),
  6720. tag = value[symToStringTag];
  6721. try {
  6722. value[symToStringTag] = undefined;
  6723. var unmasked = true;
  6724. } catch (e) {}
  6725. var result = nativeObjectToString.call(value);
  6726. if (unmasked) {
  6727. if (isOwn) {
  6728. value[symToStringTag] = tag;
  6729. } else {
  6730. delete value[symToStringTag];
  6731. }
  6732. }
  6733. return result;
  6734. }
  6735. /**
  6736. * Creates an array of the own enumerable symbols of `object`.
  6737. *
  6738. * @private
  6739. * @param {Object} object The object to query.
  6740. * @returns {Array} Returns the array of symbols.
  6741. */
  6742. var getSymbols = !nativeGetSymbols ? stubArray : function(object) {
  6743. if (object == null) {
  6744. return [];
  6745. }
  6746. object = Object(object);
  6747. return arrayFilter(nativeGetSymbols(object), function(symbol) {
  6748. return propertyIsEnumerable.call(object, symbol);
  6749. });
  6750. };
  6751. /**
  6752. * Creates an array of the own and inherited enumerable symbols of `object`.
  6753. *
  6754. * @private
  6755. * @param {Object} object The object to query.
  6756. * @returns {Array} Returns the array of symbols.
  6757. */
  6758. var getSymbolsIn = !nativeGetSymbols ? stubArray : function(object) {
  6759. var result = [];
  6760. while (object) {
  6761. arrayPush(result, getSymbols(object));
  6762. object = getPrototype(object);
  6763. }
  6764. return result;
  6765. };
  6766. /**
  6767. * Gets the `toStringTag` of `value`.
  6768. *
  6769. * @private
  6770. * @param {*} value The value to query.
  6771. * @returns {string} Returns the `toStringTag`.
  6772. */
  6773. var getTag = baseGetTag;
  6774. // Fallback for data views, maps, sets, and weak maps in IE 11 and promises in Node.js < 6.
  6775. if ((DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag) ||
  6776. (Map && getTag(new Map) != mapTag) ||
  6777. (Promise && getTag(Promise.resolve()) != promiseTag) ||
  6778. (Set && getTag(new Set) != setTag) ||
  6779. (WeakMap && getTag(new WeakMap) != weakMapTag)) {
  6780. getTag = function(value) {
  6781. var result = baseGetTag(value),
  6782. Ctor = result == objectTag ? value.constructor : undefined,
  6783. ctorString = Ctor ? toSource(Ctor) : '';
  6784. if (ctorString) {
  6785. switch (ctorString) {
  6786. case dataViewCtorString: return dataViewTag;
  6787. case mapCtorString: return mapTag;
  6788. case promiseCtorString: return promiseTag;
  6789. case setCtorString: return setTag;
  6790. case weakMapCtorString: return weakMapTag;
  6791. }
  6792. }
  6793. return result;
  6794. };
  6795. }
  6796. /**
  6797. * Gets the view, applying any `transforms` to the `start` and `end` positions.
  6798. *
  6799. * @private
  6800. * @param {number} start The start of the view.
  6801. * @param {number} end The end of the view.
  6802. * @param {Array} transforms The transformations to apply to the view.
  6803. * @returns {Object} Returns an object containing the `start` and `end`
  6804. * positions of the view.
  6805. */
  6806. function getView(start, end, transforms) {
  6807. var index = -1,
  6808. length = transforms.length;
  6809. while (++index < length) {
  6810. var data = transforms[index],
  6811. size = data.size;
  6812. switch (data.type) {
  6813. case 'drop': start += size; break;
  6814. case 'dropRight': end -= size; break;
  6815. case 'take': end = nativeMin(end, start + size); break;
  6816. case 'takeRight': start = nativeMax(start, end - size); break;
  6817. }
  6818. }
  6819. return { 'start': start, 'end': end };
  6820. }
  6821. /**
  6822. * Extracts wrapper details from the `source` body comment.
  6823. *
  6824. * @private
  6825. * @param {string} source The source to inspect.
  6826. * @returns {Array} Returns the wrapper details.
  6827. */
  6828. function getWrapDetails(source) {
  6829. var match = source.match(reWrapDetails);
  6830. return match ? match[1].split(reSplitDetails) : [];
  6831. }
  6832. /**
  6833. * Checks if `path` exists on `object`.
  6834. *
  6835. * @private
  6836. * @param {Object} object The object to query.
  6837. * @param {Array|string} path The path to check.
  6838. * @param {Function} hasFunc The function to check properties.
  6839. * @returns {boolean} Returns `true` if `path` exists, else `false`.
  6840. */
  6841. function hasPath(object, path, hasFunc) {
  6842. path = castPath(path, object);
  6843. var index = -1,
  6844. length = path.length,
  6845. result = false;
  6846. while (++index < length) {
  6847. var key = toKey(path[index]);
  6848. if (!(result = object != null && hasFunc(object, key))) {
  6849. break;
  6850. }
  6851. object = object[key];
  6852. }
  6853. if (result || ++index != length) {
  6854. return result;
  6855. }
  6856. length = object == null ? 0 : object.length;
  6857. return !!length && isLength(length) && isIndex(key, length) &&
  6858. (isArray(object) || isArguments(object));
  6859. }
  6860. /**
  6861. * Initializes an array clone.
  6862. *
  6863. * @private
  6864. * @param {Array} array The array to clone.
  6865. * @returns {Array} Returns the initialized clone.
  6866. */
  6867. function initCloneArray(array) {
  6868. var length = array.length,
  6869. result = new array.constructor(length);
  6870. // Add properties assigned by `RegExp#exec`.
  6871. if (length && typeof array[0] == 'string' && hasOwnProperty.call(array, 'index')) {
  6872. result.index = array.index;
  6873. result.input = array.input;
  6874. }
  6875. return result;
  6876. }
  6877. /**
  6878. * Initializes an object clone.
  6879. *
  6880. * @private
  6881. * @param {Object} object The object to clone.
  6882. * @returns {Object} Returns the initialized clone.
  6883. */
  6884. function initCloneObject(object) {
  6885. return (typeof object.constructor == 'function' && !isPrototype(object))
  6886. ? baseCreate(getPrototype(object))
  6887. : {};
  6888. }
  6889. /**
  6890. * Initializes an object clone based on its `toStringTag`.
  6891. *
  6892. * **Note:** This function only supports cloning values with tags of
  6893. * `Boolean`, `Date`, `Error`, `Map`, `Number`, `RegExp`, `Set`, or `String`.
  6894. *
  6895. * @private
  6896. * @param {Object} object The object to clone.
  6897. * @param {string} tag The `toStringTag` of the object to clone.
  6898. * @param {boolean} [isDeep] Specify a deep clone.
  6899. * @returns {Object} Returns the initialized clone.
  6900. */
  6901. function initCloneByTag(object, tag, isDeep) {
  6902. var Ctor = object.constructor;
  6903. switch (tag) {
  6904. case arrayBufferTag:
  6905. return cloneArrayBuffer(object);
  6906. case boolTag:
  6907. case dateTag:
  6908. return new Ctor(+object);
  6909. case dataViewTag:
  6910. return cloneDataView(object, isDeep);
  6911. case float32Tag: case float64Tag:
  6912. case int8Tag: case int16Tag: case int32Tag:
  6913. case uint8Tag: case uint8ClampedTag: case uint16Tag: case uint32Tag:
  6914. return cloneTypedArray(object, isDeep);
  6915. case mapTag:
  6916. return new Ctor;
  6917. case numberTag:
  6918. case stringTag:
  6919. return new Ctor(object);
  6920. case regexpTag:
  6921. return cloneRegExp(object);
  6922. case setTag:
  6923. return new Ctor;
  6924. case symbolTag:
  6925. return cloneSymbol(object);
  6926. }
  6927. }
  6928. /**
  6929. * Inserts wrapper `details` in a comment at the top of the `source` body.
  6930. *
  6931. * @private
  6932. * @param {string} source The source to modify.
  6933. * @returns {Array} details The details to insert.
  6934. * @returns {string} Returns the modified source.
  6935. */
  6936. function insertWrapDetails(source, details) {
  6937. var length = details.length;
  6938. if (!length) {
  6939. return source;
  6940. }
  6941. var lastIndex = length - 1;
  6942. details[lastIndex] = (length > 1 ? '& ' : '') + details[lastIndex];
  6943. details = details.join(length > 2 ? ', ' : ' ');
  6944. return source.replace(reWrapComment, '{\n/* [wrapped with ' + details + '] */\n');
  6945. }
  6946. /**
  6947. * Checks if `value` is a flattenable `arguments` object or array.
  6948. *
  6949. * @private
  6950. * @param {*} value The value to check.
  6951. * @returns {boolean} Returns `true` if `value` is flattenable, else `false`.
  6952. */
  6953. function isFlattenable(value) {
  6954. return isArray(value) || isArguments(value) ||
  6955. !!(spreadableSymbol && value && value[spreadableSymbol]);
  6956. }
  6957. /**
  6958. * Checks if `value` is a valid array-like index.
  6959. *
  6960. * @private
  6961. * @param {*} value The value to check.
  6962. * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.
  6963. * @returns {boolean} Returns `true` if `value` is a valid index, else `false`.
  6964. */
  6965. function isIndex(value, length) {
  6966. var type = typeof value;
  6967. length = length == null ? MAX_SAFE_INTEGER : length;
  6968. return !!length &&
  6969. (type == 'number' ||
  6970. (type != 'symbol' && reIsUint.test(value))) &&
  6971. (value > -1 && value % 1 == 0 && value < length);
  6972. }
  6973. /**
  6974. * Checks if the given arguments are from an iteratee call.
  6975. *
  6976. * @private
  6977. * @param {*} value The potential iteratee value argument.
  6978. * @param {*} index The potential iteratee index or key argument.
  6979. * @param {*} object The potential iteratee object argument.
  6980. * @returns {boolean} Returns `true` if the arguments are from an iteratee call,
  6981. * else `false`.
  6982. */
  6983. function isIterateeCall(value, index, object) {
  6984. if (!isObject(object)) {
  6985. return false;
  6986. }
  6987. var type = typeof index;
  6988. if (type == 'number'
  6989. ? (isArrayLike(object) && isIndex(index, object.length))
  6990. : (type == 'string' && index in object)
  6991. ) {
  6992. return eq(object[index], value);
  6993. }
  6994. return false;
  6995. }
  6996. /**
  6997. * Checks if `value` is a property name and not a property path.
  6998. *
  6999. * @private
  7000. * @param {*} value The value to check.
  7001. * @param {Object} [object] The object to query keys on.
  7002. * @returns {boolean} Returns `true` if `value` is a property name, else `false`.
  7003. */
  7004. function isKey(value, object) {
  7005. if (isArray(value)) {
  7006. return false;
  7007. }
  7008. var type = typeof value;
  7009. if (type == 'number' || type == 'symbol' || type == 'boolean' ||
  7010. value == null || isSymbol(value)) {
  7011. return true;
  7012. }
  7013. return reIsPlainProp.test(value) || !reIsDeepProp.test(value) ||
  7014. (object != null && value in Object(object));
  7015. }
  7016. /**
  7017. * Checks if `value` is suitable for use as unique object key.
  7018. *
  7019. * @private
  7020. * @param {*} value The value to check.
  7021. * @returns {boolean} Returns `true` if `value` is suitable, else `false`.
  7022. */
  7023. function isKeyable(value) {
  7024. var type = typeof value;
  7025. return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean')
  7026. ? (value !== '__proto__')
  7027. : (value === null);
  7028. }
  7029. /**
  7030. * Checks if `func` has a lazy counterpart.
  7031. *
  7032. * @private
  7033. * @param {Function} func The function to check.
  7034. * @returns {boolean} Returns `true` if `func` has a lazy counterpart,
  7035. * else `false`.
  7036. */
  7037. function isLaziable(func) {
  7038. var funcName = getFuncName(func),
  7039. other = lodash[funcName];
  7040. if (typeof other != 'function' || !(funcName in LazyWrapper.prototype)) {
  7041. return false;
  7042. }
  7043. if (func === other) {
  7044. return true;
  7045. }
  7046. var data = getData(other);
  7047. return !!data && func === data[0];
  7048. }
  7049. /**
  7050. * Checks if `func` has its source masked.
  7051. *
  7052. * @private
  7053. * @param {Function} func The function to check.
  7054. * @returns {boolean} Returns `true` if `func` is masked, else `false`.
  7055. */
  7056. function isMasked(func) {
  7057. return !!maskSrcKey && (maskSrcKey in func);
  7058. }
  7059. /**
  7060. * Checks if `func` is capable of being masked.
  7061. *
  7062. * @private
  7063. * @param {*} value The value to check.
  7064. * @returns {boolean} Returns `true` if `func` is maskable, else `false`.
  7065. */
  7066. var isMaskable = coreJsData ? isFunction : stubFalse;
  7067. /**
  7068. * Checks if `value` is likely a prototype object.
  7069. *
  7070. * @private
  7071. * @param {*} value The value to check.
  7072. * @returns {boolean} Returns `true` if `value` is a prototype, else `false`.
  7073. */
  7074. function isPrototype(value) {
  7075. var Ctor = value && value.constructor,
  7076. proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto;
  7077. return value === proto;
  7078. }
  7079. /**
  7080. * Checks if `value` is suitable for strict equality comparisons, i.e. `===`.
  7081. *
  7082. * @private
  7083. * @param {*} value The value to check.
  7084. * @returns {boolean} Returns `true` if `value` if suitable for strict
  7085. * equality comparisons, else `false`.
  7086. */
  7087. function isStrictComparable(value) {
  7088. return value === value && !isObject(value);
  7089. }
  7090. /**
  7091. * A specialized version of `matchesProperty` for source values suitable
  7092. * for strict equality comparisons, i.e. `===`.
  7093. *
  7094. * @private
  7095. * @param {string} key The key of the property to get.
  7096. * @param {*} srcValue The value to match.
  7097. * @returns {Function} Returns the new spec function.
  7098. */
  7099. function matchesStrictComparable(key, srcValue) {
  7100. return function(object) {
  7101. if (object == null) {
  7102. return false;
  7103. }
  7104. return object[key] === srcValue &&
  7105. (srcValue !== undefined || (key in Object(object)));
  7106. };
  7107. }
  7108. /**
  7109. * A specialized version of `_.memoize` which clears the memoized function's
  7110. * cache when it exceeds `MAX_MEMOIZE_SIZE`.
  7111. *
  7112. * @private
  7113. * @param {Function} func The function to have its output memoized.
  7114. * @returns {Function} Returns the new memoized function.
  7115. */
  7116. function memoizeCapped(func) {
  7117. var result = memoize(func, function(key) {
  7118. if (cache.size === MAX_MEMOIZE_SIZE) {
  7119. cache.clear();
  7120. }
  7121. return key;
  7122. });
  7123. var cache = result.cache;
  7124. return result;
  7125. }
  7126. /**
  7127. * Merges the function metadata of `source` into `data`.
  7128. *
  7129. * Merging metadata reduces the number of wrappers used to invoke a function.
  7130. * This is possible because methods like `_.bind`, `_.curry`, and `_.partial`
  7131. * may be applied regardless of execution order. Methods like `_.ary` and
  7132. * `_.rearg` modify function arguments, making the order in which they are
  7133. * executed important, preventing the merging of metadata. However, we make
  7134. * an exception for a safe combined case where curried functions have `_.ary`
  7135. * and or `_.rearg` applied.
  7136. *
  7137. * @private
  7138. * @param {Array} data The destination metadata.
  7139. * @param {Array} source The source metadata.
  7140. * @returns {Array} Returns `data`.
  7141. */
  7142. function mergeData(data, source) {
  7143. var bitmask = data[1],
  7144. srcBitmask = source[1],
  7145. newBitmask = bitmask | srcBitmask,
  7146. isCommon = newBitmask < (WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG | WRAP_ARY_FLAG);
  7147. var isCombo =
  7148. ((srcBitmask == WRAP_ARY_FLAG) && (bitmask == WRAP_CURRY_FLAG)) ||
  7149. ((srcBitmask == WRAP_ARY_FLAG) && (bitmask == WRAP_REARG_FLAG) && (data[7].length <= source[8])) ||
  7150. ((srcBitmask == (WRAP_ARY_FLAG | WRAP_REARG_FLAG)) && (source[7].length <= source[8]) && (bitmask == WRAP_CURRY_FLAG));
  7151. // Exit early if metadata can't be merged.
  7152. if (!(isCommon || isCombo)) {
  7153. return data;
  7154. }
  7155. // Use source `thisArg` if available.
  7156. if (srcBitmask & WRAP_BIND_FLAG) {
  7157. data[2] = source[2];
  7158. // Set when currying a bound function.
  7159. newBitmask |= bitmask & WRAP_BIND_FLAG ? 0 : WRAP_CURRY_BOUND_FLAG;
  7160. }
  7161. // Compose partial arguments.
  7162. var value = source[3];
  7163. if (value) {
  7164. var partials = data[3];
  7165. data[3] = partials ? composeArgs(partials, value, source[4]) : value;
  7166. data[4] = partials ? replaceHolders(data[3], PLACEHOLDER) : source[4];
  7167. }
  7168. // Compose partial right arguments.
  7169. value = source[5];
  7170. if (value) {
  7171. partials = data[5];
  7172. data[5] = partials ? composeArgsRight(partials, value, source[6]) : value;
  7173. data[6] = partials ? replaceHolders(data[5], PLACEHOLDER) : source[6];
  7174. }
  7175. // Use source `argPos` if available.
  7176. value = source[7];
  7177. if (value) {
  7178. data[7] = value;
  7179. }
  7180. // Use source `ary` if it's smaller.
  7181. if (srcBitmask & WRAP_ARY_FLAG) {
  7182. data[8] = data[8] == null ? source[8] : nativeMin(data[8], source[8]);
  7183. }
  7184. // Use source `arity` if one is not provided.
  7185. if (data[9] == null) {
  7186. data[9] = source[9];
  7187. }
  7188. // Use source `func` and merge bitmasks.
  7189. data[0] = source[0];
  7190. data[1] = newBitmask;
  7191. return data;
  7192. }
  7193. /**
  7194. * This function is like
  7195. * [`Object.keys`](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)
  7196. * except that it includes inherited enumerable properties.
  7197. *
  7198. * @private
  7199. * @param {Object} object The object to query.
  7200. * @returns {Array} Returns the array of property names.
  7201. */
  7202. function nativeKeysIn(object) {
  7203. var result = [];
  7204. if (object != null) {
  7205. for (var key in Object(object)) {
  7206. result.push(key);
  7207. }
  7208. }
  7209. return result;
  7210. }
  7211. /**
  7212. * Converts `value` to a string using `Object.prototype.toString`.
  7213. *
  7214. * @private
  7215. * @param {*} value The value to convert.
  7216. * @returns {string} Returns the converted string.
  7217. */
  7218. function objectToString(value) {
  7219. return nativeObjectToString.call(value);
  7220. }
  7221. /**
  7222. * A specialized version of `baseRest` which transforms the rest array.
  7223. *
  7224. * @private
  7225. * @param {Function} func The function to apply a rest parameter to.
  7226. * @param {number} [start=func.length-1] The start position of the rest parameter.
  7227. * @param {Function} transform The rest array transform.
  7228. * @returns {Function} Returns the new function.
  7229. */
  7230. function overRest(func, start, transform) {
  7231. start = nativeMax(start === undefined ? (func.length - 1) : start, 0);
  7232. return function() {
  7233. var args = arguments,
  7234. index = -1,
  7235. length = nativeMax(args.length - start, 0),
  7236. array = Array(length);
  7237. while (++index < length) {
  7238. array[index] = args[start + index];
  7239. }
  7240. index = -1;
  7241. var otherArgs = Array(start + 1);
  7242. while (++index < start) {
  7243. otherArgs[index] = args[index];
  7244. }
  7245. otherArgs[start] = transform(array);
  7246. return apply(func, this, otherArgs);
  7247. };
  7248. }
  7249. /**
  7250. * Gets the parent value at `path` of `object`.
  7251. *
  7252. * @private
  7253. * @param {Object} object The object to query.
  7254. * @param {Array} path The path to get the parent value of.
  7255. * @returns {*} Returns the parent value.
  7256. */
  7257. function parent(object, path) {
  7258. return path.length < 2 ? object : baseGet(object, baseSlice(path, 0, -1));
  7259. }
  7260. /**
  7261. * Reorder `array` according to the specified indexes where the element at
  7262. * the first index is assigned as the first element, the element at
  7263. * the second index is assigned as the second element, and so on.
  7264. *
  7265. * @private
  7266. * @param {Array} array The array to reorder.
  7267. * @param {Array} indexes The arranged array indexes.
  7268. * @returns {Array} Returns `array`.
  7269. */
  7270. function reorder(array, indexes) {
  7271. var arrLength = array.length,
  7272. length = nativeMin(indexes.length, arrLength),
  7273. oldArray = copyArray(array);
  7274. while (length--) {
  7275. var index = indexes[length];
  7276. array[length] = isIndex(index, arrLength) ? oldArray[index] : undefined;
  7277. }
  7278. return array;
  7279. }
  7280. /**
  7281. * Gets the value at `key`, unless `key` is "__proto__" or "constructor".
  7282. *
  7283. * @private
  7284. * @param {Object} object The object to query.
  7285. * @param {string} key The key of the property to get.
  7286. * @returns {*} Returns the property value.
  7287. */
  7288. function safeGet(object, key) {
  7289. if (key === 'constructor' && typeof object[key] === 'function') {
  7290. return;
  7291. }
  7292. if (key == '__proto__') {
  7293. return;
  7294. }
  7295. return object[key];
  7296. }
  7297. /**
  7298. * Sets metadata for `func`.
  7299. *
  7300. * **Note:** If this function becomes hot, i.e. is invoked a lot in a short
  7301. * period of time, it will trip its breaker and transition to an identity
  7302. * function to avoid garbage collection pauses in V8. See
  7303. * [V8 issue 2070](https://bugs.chromium.org/p/v8/issues/detail?id=2070)
  7304. * for more details.
  7305. *
  7306. * @private
  7307. * @param {Function} func The function to associate metadata with.
  7308. * @param {*} data The metadata.
  7309. * @returns {Function} Returns `func`.
  7310. */
  7311. var setData = shortOut(baseSetData);
  7312. /**
  7313. * A simple wrapper around the global [`setTimeout`](https://mdn.io/setTimeout).
  7314. *
  7315. * @private
  7316. * @param {Function} func The function to delay.
  7317. * @param {number} wait The number of milliseconds to delay invocation.
  7318. * @returns {number|Object} Returns the timer id or timeout object.
  7319. */
  7320. var setTimeout = ctxSetTimeout || function(func, wait) {
  7321. return root.setTimeout(func, wait);
  7322. };
  7323. /**
  7324. * Sets the `toString` method of `func` to return `string`.
  7325. *
  7326. * @private
  7327. * @param {Function} func The function to modify.
  7328. * @param {Function} string The `toString` result.
  7329. * @returns {Function} Returns `func`.
  7330. */
  7331. var setToString = shortOut(baseSetToString);
  7332. /**
  7333. * Sets the `toString` method of `wrapper` to mimic the source of `reference`
  7334. * with wrapper details in a comment at the top of the source body.
  7335. *
  7336. * @private
  7337. * @param {Function} wrapper The function to modify.
  7338. * @param {Function} reference The reference function.
  7339. * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
  7340. * @returns {Function} Returns `wrapper`.
  7341. */
  7342. function setWrapToString(wrapper, reference, bitmask) {
  7343. var source = (reference + '');
  7344. return setToString(wrapper, insertWrapDetails(source, updateWrapDetails(getWrapDetails(source), bitmask)));
  7345. }
  7346. /**
  7347. * Creates a function that'll short out and invoke `identity` instead
  7348. * of `func` when it's called `HOT_COUNT` or more times in `HOT_SPAN`
  7349. * milliseconds.
  7350. *
  7351. * @private
  7352. * @param {Function} func The function to restrict.
  7353. * @returns {Function} Returns the new shortable function.
  7354. */
  7355. function shortOut(func) {
  7356. var count = 0,
  7357. lastCalled = 0;
  7358. return function() {
  7359. var stamp = nativeNow(),
  7360. remaining = HOT_SPAN - (stamp - lastCalled);
  7361. lastCalled = stamp;
  7362. if (remaining > 0) {
  7363. if (++count >= HOT_COUNT) {
  7364. return arguments[0];
  7365. }
  7366. } else {
  7367. count = 0;
  7368. }
  7369. return func.apply(undefined, arguments);
  7370. };
  7371. }
  7372. /**
  7373. * A specialized version of `_.shuffle` which mutates and sets the size of `array`.
  7374. *
  7375. * @private
  7376. * @param {Array} array The array to shuffle.
  7377. * @param {number} [size=array.length] The size of `array`.
  7378. * @returns {Array} Returns `array`.
  7379. */
  7380. function shuffleSelf(array, size) {
  7381. var index = -1,
  7382. length = array.length,
  7383. lastIndex = length - 1;
  7384. size = size === undefined ? length : size;
  7385. while (++index < size) {
  7386. var rand = baseRandom(index, lastIndex),
  7387. value = array[rand];
  7388. array[rand] = array[index];
  7389. array[index] = value;
  7390. }
  7391. array.length = size;
  7392. return array;
  7393. }
  7394. /**
  7395. * Converts `string` to a property path array.
  7396. *
  7397. * @private
  7398. * @param {string} string The string to convert.
  7399. * @returns {Array} Returns the property path array.
  7400. */
  7401. var stringToPath = memoizeCapped(function(string) {
  7402. var result = [];
  7403. if (string.charCodeAt(0) === 46 /* . */) {
  7404. result.push('');
  7405. }
  7406. string.replace(rePropName, function(match, number, quote, subString) {
  7407. result.push(quote ? subString.replace(reEscapeChar, '$1') : (number || match));
  7408. });
  7409. return result;
  7410. });
  7411. /**
  7412. * Converts `value` to a string key if it's not a string or symbol.
  7413. *
  7414. * @private
  7415. * @param {*} value The value to inspect.
  7416. * @returns {string|symbol} Returns the key.
  7417. */
  7418. function toKey(value) {
  7419. if (typeof value == 'string' || isSymbol(value)) {
  7420. return value;
  7421. }
  7422. var result = (value + '');
  7423. return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;
  7424. }
  7425. /**
  7426. * Converts `func` to its source code.
  7427. *
  7428. * @private
  7429. * @param {Function} func The function to convert.
  7430. * @returns {string} Returns the source code.
  7431. */
  7432. function toSource(func) {
  7433. if (func != null) {
  7434. try {
  7435. return funcToString.call(func);
  7436. } catch (e) {}
  7437. try {
  7438. return (func + '');
  7439. } catch (e) {}
  7440. }
  7441. return '';
  7442. }
  7443. /**
  7444. * Updates wrapper `details` based on `bitmask` flags.
  7445. *
  7446. * @private
  7447. * @returns {Array} details The details to modify.
  7448. * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
  7449. * @returns {Array} Returns `details`.
  7450. */
  7451. function updateWrapDetails(details, bitmask) {
  7452. arrayEach(wrapFlags, function(pair) {
  7453. var value = '_.' + pair[0];
  7454. if ((bitmask & pair[1]) && !arrayIncludes(details, value)) {
  7455. details.push(value);
  7456. }
  7457. });
  7458. return details.sort();
  7459. }
  7460. /**
  7461. * Creates a clone of `wrapper`.
  7462. *
  7463. * @private
  7464. * @param {Object} wrapper The wrapper to clone.
  7465. * @returns {Object} Returns the cloned wrapper.
  7466. */
  7467. function wrapperClone(wrapper) {
  7468. if (wrapper instanceof LazyWrapper) {
  7469. return wrapper.clone();
  7470. }
  7471. var result = new LodashWrapper(wrapper.__wrapped__, wrapper.__chain__);
  7472. result.__actions__ = copyArray(wrapper.__actions__);
  7473. result.__index__ = wrapper.__index__;
  7474. result.__values__ = wrapper.__values__;
  7475. return result;
  7476. }
  7477. /*------------------------------------------------------------------------*/
  7478. /**
  7479. * Creates an array of elements split into groups the length of `size`.
  7480. * If `array` can't be split evenly, the final chunk will be the remaining
  7481. * elements.
  7482. *
  7483. * @static
  7484. * @memberOf _
  7485. * @since 3.0.0
  7486. * @category Array
  7487. * @param {Array} array The array to process.
  7488. * @param {number} [size=1] The length of each chunk
  7489. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  7490. * @returns {Array} Returns the new array of chunks.
  7491. * @example
  7492. *
  7493. * _.chunk(['a', 'b', 'c', 'd'], 2);
  7494. * // => [['a', 'b'], ['c', 'd']]
  7495. *
  7496. * _.chunk(['a', 'b', 'c', 'd'], 3);
  7497. * // => [['a', 'b', 'c'], ['d']]
  7498. */
  7499. function chunk(array, size, guard) {
  7500. if ((guard ? isIterateeCall(array, size, guard) : size === undefined)) {
  7501. size = 1;
  7502. } else {
  7503. size = nativeMax(toInteger(size), 0);
  7504. }
  7505. var length = array == null ? 0 : array.length;
  7506. if (!length || size < 1) {
  7507. return [];
  7508. }
  7509. var index = 0,
  7510. resIndex = 0,
  7511. result = Array(nativeCeil(length / size));
  7512. while (index < length) {
  7513. result[resIndex++] = baseSlice(array, index, (index += size));
  7514. }
  7515. return result;
  7516. }
  7517. /**
  7518. * Creates an array with all falsey values removed. The values `false`, `null`,
  7519. * `0`, `""`, `undefined`, and `NaN` are falsey.
  7520. *
  7521. * @static
  7522. * @memberOf _
  7523. * @since 0.1.0
  7524. * @category Array
  7525. * @param {Array} array The array to compact.
  7526. * @returns {Array} Returns the new array of filtered values.
  7527. * @example
  7528. *
  7529. * _.compact([0, 1, false, 2, '', 3]);
  7530. * // => [1, 2, 3]
  7531. */
  7532. function compact(array) {
  7533. var index = -1,
  7534. length = array == null ? 0 : array.length,
  7535. resIndex = 0,
  7536. result = [];
  7537. while (++index < length) {
  7538. var value = array[index];
  7539. if (value) {
  7540. result[resIndex++] = value;
  7541. }
  7542. }
  7543. return result;
  7544. }
  7545. /**
  7546. * Creates a new array concatenating `array` with any additional arrays
  7547. * and/or values.
  7548. *
  7549. * @static
  7550. * @memberOf _
  7551. * @since 4.0.0
  7552. * @category Array
  7553. * @param {Array} array The array to concatenate.
  7554. * @param {...*} [values] The values to concatenate.
  7555. * @returns {Array} Returns the new concatenated array.
  7556. * @example
  7557. *
  7558. * var array = [1];
  7559. * var other = _.concat(array, 2, [3], [[4]]);
  7560. *
  7561. * console.log(other);
  7562. * // => [1, 2, 3, [4]]
  7563. *
  7564. * console.log(array);
  7565. * // => [1]
  7566. */
  7567. function concat() {
  7568. var length = arguments.length;
  7569. if (!length) {
  7570. return [];
  7571. }
  7572. var args = Array(length - 1),
  7573. array = arguments[0],
  7574. index = length;
  7575. while (index--) {
  7576. args[index - 1] = arguments[index];
  7577. }
  7578. return arrayPush(isArray(array) ? copyArray(array) : [array], baseFlatten(args, 1));
  7579. }
  7580. /**
  7581. * Creates an array of `array` values not included in the other given arrays
  7582. * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  7583. * for equality comparisons. The order and references of result values are
  7584. * determined by the first array.
  7585. *
  7586. * **Note:** Unlike `_.pullAll`, this method returns a new array.
  7587. *
  7588. * @static
  7589. * @memberOf _
  7590. * @since 0.1.0
  7591. * @category Array
  7592. * @param {Array} array The array to inspect.
  7593. * @param {...Array} [values] The values to exclude.
  7594. * @returns {Array} Returns the new array of filtered values.
  7595. * @see _.without, _.xor
  7596. * @example
  7597. *
  7598. * _.difference([2, 1], [2, 3]);
  7599. * // => [1]
  7600. */
  7601. var difference = baseRest(function(array, values) {
  7602. return isArrayLikeObject(array)
  7603. ? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true))
  7604. : [];
  7605. });
  7606. /**
  7607. * This method is like `_.difference` except that it accepts `iteratee` which
  7608. * is invoked for each element of `array` and `values` to generate the criterion
  7609. * by which they're compared. The order and references of result values are
  7610. * determined by the first array. The iteratee is invoked with one argument:
  7611. * (value).
  7612. *
  7613. * **Note:** Unlike `_.pullAllBy`, this method returns a new array.
  7614. *
  7615. * @static
  7616. * @memberOf _
  7617. * @since 4.0.0
  7618. * @category Array
  7619. * @param {Array} array The array to inspect.
  7620. * @param {...Array} [values] The values to exclude.
  7621. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  7622. * @returns {Array} Returns the new array of filtered values.
  7623. * @example
  7624. *
  7625. * _.differenceBy([2.1, 1.2], [2.3, 3.4], Math.floor);
  7626. * // => [1.2]
  7627. *
  7628. * // The `_.property` iteratee shorthand.
  7629. * _.differenceBy([{ 'x': 2 }, { 'x': 1 }], [{ 'x': 1 }], 'x');
  7630. * // => [{ 'x': 2 }]
  7631. */
  7632. var differenceBy = baseRest(function(array, values) {
  7633. var iteratee = last(values);
  7634. if (isArrayLikeObject(iteratee)) {
  7635. iteratee = undefined;
  7636. }
  7637. return isArrayLikeObject(array)
  7638. ? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true), getIteratee(iteratee, 2))
  7639. : [];
  7640. });
  7641. /**
  7642. * This method is like `_.difference` except that it accepts `comparator`
  7643. * which is invoked to compare elements of `array` to `values`. The order and
  7644. * references of result values are determined by the first array. The comparator
  7645. * is invoked with two arguments: (arrVal, othVal).
  7646. *
  7647. * **Note:** Unlike `_.pullAllWith`, this method returns a new array.
  7648. *
  7649. * @static
  7650. * @memberOf _
  7651. * @since 4.0.0
  7652. * @category Array
  7653. * @param {Array} array The array to inspect.
  7654. * @param {...Array} [values] The values to exclude.
  7655. * @param {Function} [comparator] The comparator invoked per element.
  7656. * @returns {Array} Returns the new array of filtered values.
  7657. * @example
  7658. *
  7659. * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }];
  7660. *
  7661. * _.differenceWith(objects, [{ 'x': 1, 'y': 2 }], _.isEqual);
  7662. * // => [{ 'x': 2, 'y': 1 }]
  7663. */
  7664. var differenceWith = baseRest(function(array, values) {
  7665. var comparator = last(values);
  7666. if (isArrayLikeObject(comparator)) {
  7667. comparator = undefined;
  7668. }
  7669. return isArrayLikeObject(array)
  7670. ? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true), undefined, comparator)
  7671. : [];
  7672. });
  7673. /**
  7674. * Creates a slice of `array` with `n` elements dropped from the beginning.
  7675. *
  7676. * @static
  7677. * @memberOf _
  7678. * @since 0.5.0
  7679. * @category Array
  7680. * @param {Array} array The array to query.
  7681. * @param {number} [n=1] The number of elements to drop.
  7682. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  7683. * @returns {Array} Returns the slice of `array`.
  7684. * @example
  7685. *
  7686. * _.drop([1, 2, 3]);
  7687. * // => [2, 3]
  7688. *
  7689. * _.drop([1, 2, 3], 2);
  7690. * // => [3]
  7691. *
  7692. * _.drop([1, 2, 3], 5);
  7693. * // => []
  7694. *
  7695. * _.drop([1, 2, 3], 0);
  7696. * // => [1, 2, 3]
  7697. */
  7698. function drop(array, n, guard) {
  7699. var length = array == null ? 0 : array.length;
  7700. if (!length) {
  7701. return [];
  7702. }
  7703. n = (guard || n === undefined) ? 1 : toInteger(n);
  7704. return baseSlice(array, n < 0 ? 0 : n, length);
  7705. }
  7706. /**
  7707. * Creates a slice of `array` with `n` elements dropped from the end.
  7708. *
  7709. * @static
  7710. * @memberOf _
  7711. * @since 3.0.0
  7712. * @category Array
  7713. * @param {Array} array The array to query.
  7714. * @param {number} [n=1] The number of elements to drop.
  7715. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  7716. * @returns {Array} Returns the slice of `array`.
  7717. * @example
  7718. *
  7719. * _.dropRight([1, 2, 3]);
  7720. * // => [1, 2]
  7721. *
  7722. * _.dropRight([1, 2, 3], 2);
  7723. * // => [1]
  7724. *
  7725. * _.dropRight([1, 2, 3], 5);
  7726. * // => []
  7727. *
  7728. * _.dropRight([1, 2, 3], 0);
  7729. * // => [1, 2, 3]
  7730. */
  7731. function dropRight(array, n, guard) {
  7732. var length = array == null ? 0 : array.length;
  7733. if (!length) {
  7734. return [];
  7735. }
  7736. n = (guard || n === undefined) ? 1 : toInteger(n);
  7737. n = length - n;
  7738. return baseSlice(array, 0, n < 0 ? 0 : n);
  7739. }
  7740. /**
  7741. * Creates a slice of `array` excluding elements dropped from the end.
  7742. * Elements are dropped until `predicate` returns falsey. The predicate is
  7743. * invoked with three arguments: (value, index, array).
  7744. *
  7745. * @static
  7746. * @memberOf _
  7747. * @since 3.0.0
  7748. * @category Array
  7749. * @param {Array} array The array to query.
  7750. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  7751. * @returns {Array} Returns the slice of `array`.
  7752. * @example
  7753. *
  7754. * var users = [
  7755. * { 'user': 'barney', 'active': true },
  7756. * { 'user': 'fred', 'active': false },
  7757. * { 'user': 'pebbles', 'active': false }
  7758. * ];
  7759. *
  7760. * _.dropRightWhile(users, function(o) { return !o.active; });
  7761. * // => objects for ['barney']
  7762. *
  7763. * // The `_.matches` iteratee shorthand.
  7764. * _.dropRightWhile(users, { 'user': 'pebbles', 'active': false });
  7765. * // => objects for ['barney', 'fred']
  7766. *
  7767. * // The `_.matchesProperty` iteratee shorthand.
  7768. * _.dropRightWhile(users, ['active', false]);
  7769. * // => objects for ['barney']
  7770. *
  7771. * // The `_.property` iteratee shorthand.
  7772. * _.dropRightWhile(users, 'active');
  7773. * // => objects for ['barney', 'fred', 'pebbles']
  7774. */
  7775. function dropRightWhile(array, predicate) {
  7776. return (array && array.length)
  7777. ? baseWhile(array, getIteratee(predicate, 3), true, true)
  7778. : [];
  7779. }
  7780. /**
  7781. * Creates a slice of `array` excluding elements dropped from the beginning.
  7782. * Elements are dropped until `predicate` returns falsey. The predicate is
  7783. * invoked with three arguments: (value, index, array).
  7784. *
  7785. * @static
  7786. * @memberOf _
  7787. * @since 3.0.0
  7788. * @category Array
  7789. * @param {Array} array The array to query.
  7790. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  7791. * @returns {Array} Returns the slice of `array`.
  7792. * @example
  7793. *
  7794. * var users = [
  7795. * { 'user': 'barney', 'active': false },
  7796. * { 'user': 'fred', 'active': false },
  7797. * { 'user': 'pebbles', 'active': true }
  7798. * ];
  7799. *
  7800. * _.dropWhile(users, function(o) { return !o.active; });
  7801. * // => objects for ['pebbles']
  7802. *
  7803. * // The `_.matches` iteratee shorthand.
  7804. * _.dropWhile(users, { 'user': 'barney', 'active': false });
  7805. * // => objects for ['fred', 'pebbles']
  7806. *
  7807. * // The `_.matchesProperty` iteratee shorthand.
  7808. * _.dropWhile(users, ['active', false]);
  7809. * // => objects for ['pebbles']
  7810. *
  7811. * // The `_.property` iteratee shorthand.
  7812. * _.dropWhile(users, 'active');
  7813. * // => objects for ['barney', 'fred', 'pebbles']
  7814. */
  7815. function dropWhile(array, predicate) {
  7816. return (array && array.length)
  7817. ? baseWhile(array, getIteratee(predicate, 3), true)
  7818. : [];
  7819. }
  7820. /**
  7821. * Fills elements of `array` with `value` from `start` up to, but not
  7822. * including, `end`.
  7823. *
  7824. * **Note:** This method mutates `array`.
  7825. *
  7826. * @static
  7827. * @memberOf _
  7828. * @since 3.2.0
  7829. * @category Array
  7830. * @param {Array} array The array to fill.
  7831. * @param {*} value The value to fill `array` with.
  7832. * @param {number} [start=0] The start position.
  7833. * @param {number} [end=array.length] The end position.
  7834. * @returns {Array} Returns `array`.
  7835. * @example
  7836. *
  7837. * var array = [1, 2, 3];
  7838. *
  7839. * _.fill(array, 'a');
  7840. * console.log(array);
  7841. * // => ['a', 'a', 'a']
  7842. *
  7843. * _.fill(Array(3), 2);
  7844. * // => [2, 2, 2]
  7845. *
  7846. * _.fill([4, 6, 8, 10], '*', 1, 3);
  7847. * // => [4, '*', '*', 10]
  7848. */
  7849. function fill(array, value, start, end) {
  7850. var length = array == null ? 0 : array.length;
  7851. if (!length) {
  7852. return [];
  7853. }
  7854. if (start && typeof start != 'number' && isIterateeCall(array, value, start)) {
  7855. start = 0;
  7856. end = length;
  7857. }
  7858. return baseFill(array, value, start, end);
  7859. }
  7860. /**
  7861. * This method is like `_.find` except that it returns the index of the first
  7862. * element `predicate` returns truthy for instead of the element itself.
  7863. *
  7864. * @static
  7865. * @memberOf _
  7866. * @since 1.1.0
  7867. * @category Array
  7868. * @param {Array} array The array to inspect.
  7869. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  7870. * @param {number} [fromIndex=0] The index to search from.
  7871. * @returns {number} Returns the index of the found element, else `-1`.
  7872. * @example
  7873. *
  7874. * var users = [
  7875. * { 'user': 'barney', 'active': false },
  7876. * { 'user': 'fred', 'active': false },
  7877. * { 'user': 'pebbles', 'active': true }
  7878. * ];
  7879. *
  7880. * _.findIndex(users, function(o) { return o.user == 'barney'; });
  7881. * // => 0
  7882. *
  7883. * // The `_.matches` iteratee shorthand.
  7884. * _.findIndex(users, { 'user': 'fred', 'active': false });
  7885. * // => 1
  7886. *
  7887. * // The `_.matchesProperty` iteratee shorthand.
  7888. * _.findIndex(users, ['active', false]);
  7889. * // => 0
  7890. *
  7891. * // The `_.property` iteratee shorthand.
  7892. * _.findIndex(users, 'active');
  7893. * // => 2
  7894. */
  7895. function findIndex(array, predicate, fromIndex) {
  7896. var length = array == null ? 0 : array.length;
  7897. if (!length) {
  7898. return -1;
  7899. }
  7900. var index = fromIndex == null ? 0 : toInteger(fromIndex);
  7901. if (index < 0) {
  7902. index = nativeMax(length + index, 0);
  7903. }
  7904. return baseFindIndex(array, getIteratee(predicate, 3), index);
  7905. }
  7906. /**
  7907. * This method is like `_.findIndex` except that it iterates over elements
  7908. * of `collection` from right to left.
  7909. *
  7910. * @static
  7911. * @memberOf _
  7912. * @since 2.0.0
  7913. * @category Array
  7914. * @param {Array} array The array to inspect.
  7915. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  7916. * @param {number} [fromIndex=array.length-1] The index to search from.
  7917. * @returns {number} Returns the index of the found element, else `-1`.
  7918. * @example
  7919. *
  7920. * var users = [
  7921. * { 'user': 'barney', 'active': true },
  7922. * { 'user': 'fred', 'active': false },
  7923. * { 'user': 'pebbles', 'active': false }
  7924. * ];
  7925. *
  7926. * _.findLastIndex(users, function(o) { return o.user == 'pebbles'; });
  7927. * // => 2
  7928. *
  7929. * // The `_.matches` iteratee shorthand.
  7930. * _.findLastIndex(users, { 'user': 'barney', 'active': true });
  7931. * // => 0
  7932. *
  7933. * // The `_.matchesProperty` iteratee shorthand.
  7934. * _.findLastIndex(users, ['active', false]);
  7935. * // => 2
  7936. *
  7937. * // The `_.property` iteratee shorthand.
  7938. * _.findLastIndex(users, 'active');
  7939. * // => 0
  7940. */
  7941. function findLastIndex(array, predicate, fromIndex) {
  7942. var length = array == null ? 0 : array.length;
  7943. if (!length) {
  7944. return -1;
  7945. }
  7946. var index = length - 1;
  7947. if (fromIndex !== undefined) {
  7948. index = toInteger(fromIndex);
  7949. index = fromIndex < 0
  7950. ? nativeMax(length + index, 0)
  7951. : nativeMin(index, length - 1);
  7952. }
  7953. return baseFindIndex(array, getIteratee(predicate, 3), index, true);
  7954. }
  7955. /**
  7956. * Flattens `array` a single level deep.
  7957. *
  7958. * @static
  7959. * @memberOf _
  7960. * @since 0.1.0
  7961. * @category Array
  7962. * @param {Array} array The array to flatten.
  7963. * @returns {Array} Returns the new flattened array.
  7964. * @example
  7965. *
  7966. * _.flatten([1, [2, [3, [4]], 5]]);
  7967. * // => [1, 2, [3, [4]], 5]
  7968. */
  7969. function flatten(array) {
  7970. var length = array == null ? 0 : array.length;
  7971. return length ? baseFlatten(array, 1) : [];
  7972. }
  7973. /**
  7974. * Recursively flattens `array`.
  7975. *
  7976. * @static
  7977. * @memberOf _
  7978. * @since 3.0.0
  7979. * @category Array
  7980. * @param {Array} array The array to flatten.
  7981. * @returns {Array} Returns the new flattened array.
  7982. * @example
  7983. *
  7984. * _.flattenDeep([1, [2, [3, [4]], 5]]);
  7985. * // => [1, 2, 3, 4, 5]
  7986. */
  7987. function flattenDeep(array) {
  7988. var length = array == null ? 0 : array.length;
  7989. return length ? baseFlatten(array, INFINITY) : [];
  7990. }
  7991. /**
  7992. * Recursively flatten `array` up to `depth` times.
  7993. *
  7994. * @static
  7995. * @memberOf _
  7996. * @since 4.4.0
  7997. * @category Array
  7998. * @param {Array} array The array to flatten.
  7999. * @param {number} [depth=1] The maximum recursion depth.
  8000. * @returns {Array} Returns the new flattened array.
  8001. * @example
  8002. *
  8003. * var array = [1, [2, [3, [4]], 5]];
  8004. *
  8005. * _.flattenDepth(array, 1);
  8006. * // => [1, 2, [3, [4]], 5]
  8007. *
  8008. * _.flattenDepth(array, 2);
  8009. * // => [1, 2, 3, [4], 5]
  8010. */
  8011. function flattenDepth(array, depth) {
  8012. var length = array == null ? 0 : array.length;
  8013. if (!length) {
  8014. return [];
  8015. }
  8016. depth = depth === undefined ? 1 : toInteger(depth);
  8017. return baseFlatten(array, depth);
  8018. }
  8019. /**
  8020. * The inverse of `_.toPairs`; this method returns an object composed
  8021. * from key-value `pairs`.
  8022. *
  8023. * @static
  8024. * @memberOf _
  8025. * @since 4.0.0
  8026. * @category Array
  8027. * @param {Array} pairs The key-value pairs.
  8028. * @returns {Object} Returns the new object.
  8029. * @example
  8030. *
  8031. * _.fromPairs([['a', 1], ['b', 2]]);
  8032. * // => { 'a': 1, 'b': 2 }
  8033. */
  8034. function fromPairs(pairs) {
  8035. var index = -1,
  8036. length = pairs == null ? 0 : pairs.length,
  8037. result = {};
  8038. while (++index < length) {
  8039. var pair = pairs[index];
  8040. result[pair[0]] = pair[1];
  8041. }
  8042. return result;
  8043. }
  8044. /**
  8045. * Gets the first element of `array`.
  8046. *
  8047. * @static
  8048. * @memberOf _
  8049. * @since 0.1.0
  8050. * @alias first
  8051. * @category Array
  8052. * @param {Array} array The array to query.
  8053. * @returns {*} Returns the first element of `array`.
  8054. * @example
  8055. *
  8056. * _.head([1, 2, 3]);
  8057. * // => 1
  8058. *
  8059. * _.head([]);
  8060. * // => undefined
  8061. */
  8062. function head(array) {
  8063. return (array && array.length) ? array[0] : undefined;
  8064. }
  8065. /**
  8066. * Gets the index at which the first occurrence of `value` is found in `array`
  8067. * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  8068. * for equality comparisons. If `fromIndex` is negative, it's used as the
  8069. * offset from the end of `array`.
  8070. *
  8071. * @static
  8072. * @memberOf _
  8073. * @since 0.1.0
  8074. * @category Array
  8075. * @param {Array} array The array to inspect.
  8076. * @param {*} value The value to search for.
  8077. * @param {number} [fromIndex=0] The index to search from.
  8078. * @returns {number} Returns the index of the matched value, else `-1`.
  8079. * @example
  8080. *
  8081. * _.indexOf([1, 2, 1, 2], 2);
  8082. * // => 1
  8083. *
  8084. * // Search from the `fromIndex`.
  8085. * _.indexOf([1, 2, 1, 2], 2, 2);
  8086. * // => 3
  8087. */
  8088. function indexOf(array, value, fromIndex) {
  8089. var length = array == null ? 0 : array.length;
  8090. if (!length) {
  8091. return -1;
  8092. }
  8093. var index = fromIndex == null ? 0 : toInteger(fromIndex);
  8094. if (index < 0) {
  8095. index = nativeMax(length + index, 0);
  8096. }
  8097. return baseIndexOf(array, value, index);
  8098. }
  8099. /**
  8100. * Gets all but the last element of `array`.
  8101. *
  8102. * @static
  8103. * @memberOf _
  8104. * @since 0.1.0
  8105. * @category Array
  8106. * @param {Array} array The array to query.
  8107. * @returns {Array} Returns the slice of `array`.
  8108. * @example
  8109. *
  8110. * _.initial([1, 2, 3]);
  8111. * // => [1, 2]
  8112. */
  8113. function initial(array) {
  8114. var length = array == null ? 0 : array.length;
  8115. return length ? baseSlice(array, 0, -1) : [];
  8116. }
  8117. /**
  8118. * Creates an array of unique values that are included in all given arrays
  8119. * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  8120. * for equality comparisons. The order and references of result values are
  8121. * determined by the first array.
  8122. *
  8123. * @static
  8124. * @memberOf _
  8125. * @since 0.1.0
  8126. * @category Array
  8127. * @param {...Array} [arrays] The arrays to inspect.
  8128. * @returns {Array} Returns the new array of intersecting values.
  8129. * @example
  8130. *
  8131. * _.intersection([2, 1], [2, 3]);
  8132. * // => [2]
  8133. */
  8134. var intersection = baseRest(function(arrays) {
  8135. var mapped = arrayMap(arrays, castArrayLikeObject);
  8136. return (mapped.length && mapped[0] === arrays[0])
  8137. ? baseIntersection(mapped)
  8138. : [];
  8139. });
  8140. /**
  8141. * This method is like `_.intersection` except that it accepts `iteratee`
  8142. * which is invoked for each element of each `arrays` to generate the criterion
  8143. * by which they're compared. The order and references of result values are
  8144. * determined by the first array. The iteratee is invoked with one argument:
  8145. * (value).
  8146. *
  8147. * @static
  8148. * @memberOf _
  8149. * @since 4.0.0
  8150. * @category Array
  8151. * @param {...Array} [arrays] The arrays to inspect.
  8152. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  8153. * @returns {Array} Returns the new array of intersecting values.
  8154. * @example
  8155. *
  8156. * _.intersectionBy([2.1, 1.2], [2.3, 3.4], Math.floor);
  8157. * // => [2.1]
  8158. *
  8159. * // The `_.property` iteratee shorthand.
  8160. * _.intersectionBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x');
  8161. * // => [{ 'x': 1 }]
  8162. */
  8163. var intersectionBy = baseRest(function(arrays) {
  8164. var iteratee = last(arrays),
  8165. mapped = arrayMap(arrays, castArrayLikeObject);
  8166. if (iteratee === last(mapped)) {
  8167. iteratee = undefined;
  8168. } else {
  8169. mapped.pop();
  8170. }
  8171. return (mapped.length && mapped[0] === arrays[0])
  8172. ? baseIntersection(mapped, getIteratee(iteratee, 2))
  8173. : [];
  8174. });
  8175. /**
  8176. * This method is like `_.intersection` except that it accepts `comparator`
  8177. * which is invoked to compare elements of `arrays`. The order and references
  8178. * of result values are determined by the first array. The comparator is
  8179. * invoked with two arguments: (arrVal, othVal).
  8180. *
  8181. * @static
  8182. * @memberOf _
  8183. * @since 4.0.0
  8184. * @category Array
  8185. * @param {...Array} [arrays] The arrays to inspect.
  8186. * @param {Function} [comparator] The comparator invoked per element.
  8187. * @returns {Array} Returns the new array of intersecting values.
  8188. * @example
  8189. *
  8190. * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }];
  8191. * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }];
  8192. *
  8193. * _.intersectionWith(objects, others, _.isEqual);
  8194. * // => [{ 'x': 1, 'y': 2 }]
  8195. */
  8196. var intersectionWith = baseRest(function(arrays) {
  8197. var comparator = last(arrays),
  8198. mapped = arrayMap(arrays, castArrayLikeObject);
  8199. comparator = typeof comparator == 'function' ? comparator : undefined;
  8200. if (comparator) {
  8201. mapped.pop();
  8202. }
  8203. return (mapped.length && mapped[0] === arrays[0])
  8204. ? baseIntersection(mapped, undefined, comparator)
  8205. : [];
  8206. });
  8207. /**
  8208. * Converts all elements in `array` into a string separated by `separator`.
  8209. *
  8210. * @static
  8211. * @memberOf _
  8212. * @since 4.0.0
  8213. * @category Array
  8214. * @param {Array} array The array to convert.
  8215. * @param {string} [separator=','] The element separator.
  8216. * @returns {string} Returns the joined string.
  8217. * @example
  8218. *
  8219. * _.join(['a', 'b', 'c'], '~');
  8220. * // => 'a~b~c'
  8221. */
  8222. function join(array, separator) {
  8223. return array == null ? '' : nativeJoin.call(array, separator);
  8224. }
  8225. /**
  8226. * Gets the last element of `array`.
  8227. *
  8228. * @static
  8229. * @memberOf _
  8230. * @since 0.1.0
  8231. * @category Array
  8232. * @param {Array} array The array to query.
  8233. * @returns {*} Returns the last element of `array`.
  8234. * @example
  8235. *
  8236. * _.last([1, 2, 3]);
  8237. * // => 3
  8238. */
  8239. function last(array) {
  8240. var length = array == null ? 0 : array.length;
  8241. return length ? array[length - 1] : undefined;
  8242. }
  8243. /**
  8244. * This method is like `_.indexOf` except that it iterates over elements of
  8245. * `array` from right to left.
  8246. *
  8247. * @static
  8248. * @memberOf _
  8249. * @since 0.1.0
  8250. * @category Array
  8251. * @param {Array} array The array to inspect.
  8252. * @param {*} value The value to search for.
  8253. * @param {number} [fromIndex=array.length-1] The index to search from.
  8254. * @returns {number} Returns the index of the matched value, else `-1`.
  8255. * @example
  8256. *
  8257. * _.lastIndexOf([1, 2, 1, 2], 2);
  8258. * // => 3
  8259. *
  8260. * // Search from the `fromIndex`.
  8261. * _.lastIndexOf([1, 2, 1, 2], 2, 2);
  8262. * // => 1
  8263. */
  8264. function lastIndexOf(array, value, fromIndex) {
  8265. var length = array == null ? 0 : array.length;
  8266. if (!length) {
  8267. return -1;
  8268. }
  8269. var index = length;
  8270. if (fromIndex !== undefined) {
  8271. index = toInteger(fromIndex);
  8272. index = index < 0 ? nativeMax(length + index, 0) : nativeMin(index, length - 1);
  8273. }
  8274. return value === value
  8275. ? strictLastIndexOf(array, value, index)
  8276. : baseFindIndex(array, baseIsNaN, index, true);
  8277. }
  8278. /**
  8279. * Gets the element at index `n` of `array`. If `n` is negative, the nth
  8280. * element from the end is returned.
  8281. *
  8282. * @static
  8283. * @memberOf _
  8284. * @since 4.11.0
  8285. * @category Array
  8286. * @param {Array} array The array to query.
  8287. * @param {number} [n=0] The index of the element to return.
  8288. * @returns {*} Returns the nth element of `array`.
  8289. * @example
  8290. *
  8291. * var array = ['a', 'b', 'c', 'd'];
  8292. *
  8293. * _.nth(array, 1);
  8294. * // => 'b'
  8295. *
  8296. * _.nth(array, -2);
  8297. * // => 'c';
  8298. */
  8299. function nth(array, n) {
  8300. return (array && array.length) ? baseNth(array, toInteger(n)) : undefined;
  8301. }
  8302. /**
  8303. * Removes all given values from `array` using
  8304. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  8305. * for equality comparisons.
  8306. *
  8307. * **Note:** Unlike `_.without`, this method mutates `array`. Use `_.remove`
  8308. * to remove elements from an array by predicate.
  8309. *
  8310. * @static
  8311. * @memberOf _
  8312. * @since 2.0.0
  8313. * @category Array
  8314. * @param {Array} array The array to modify.
  8315. * @param {...*} [values] The values to remove.
  8316. * @returns {Array} Returns `array`.
  8317. * @example
  8318. *
  8319. * var array = ['a', 'b', 'c', 'a', 'b', 'c'];
  8320. *
  8321. * _.pull(array, 'a', 'c');
  8322. * console.log(array);
  8323. * // => ['b', 'b']
  8324. */
  8325. var pull = baseRest(pullAll);
  8326. /**
  8327. * This method is like `_.pull` except that it accepts an array of values to remove.
  8328. *
  8329. * **Note:** Unlike `_.difference`, this method mutates `array`.
  8330. *
  8331. * @static
  8332. * @memberOf _
  8333. * @since 4.0.0
  8334. * @category Array
  8335. * @param {Array} array The array to modify.
  8336. * @param {Array} values The values to remove.
  8337. * @returns {Array} Returns `array`.
  8338. * @example
  8339. *
  8340. * var array = ['a', 'b', 'c', 'a', 'b', 'c'];
  8341. *
  8342. * _.pullAll(array, ['a', 'c']);
  8343. * console.log(array);
  8344. * // => ['b', 'b']
  8345. */
  8346. function pullAll(array, values) {
  8347. return (array && array.length && values && values.length)
  8348. ? basePullAll(array, values)
  8349. : array;
  8350. }
  8351. /**
  8352. * This method is like `_.pullAll` except that it accepts `iteratee` which is
  8353. * invoked for each element of `array` and `values` to generate the criterion
  8354. * by which they're compared. The iteratee is invoked with one argument: (value).
  8355. *
  8356. * **Note:** Unlike `_.differenceBy`, this method mutates `array`.
  8357. *
  8358. * @static
  8359. * @memberOf _
  8360. * @since 4.0.0
  8361. * @category Array
  8362. * @param {Array} array The array to modify.
  8363. * @param {Array} values The values to remove.
  8364. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  8365. * @returns {Array} Returns `array`.
  8366. * @example
  8367. *
  8368. * var array = [{ 'x': 1 }, { 'x': 2 }, { 'x': 3 }, { 'x': 1 }];
  8369. *
  8370. * _.pullAllBy(array, [{ 'x': 1 }, { 'x': 3 }], 'x');
  8371. * console.log(array);
  8372. * // => [{ 'x': 2 }]
  8373. */
  8374. function pullAllBy(array, values, iteratee) {
  8375. return (array && array.length && values && values.length)
  8376. ? basePullAll(array, values, getIteratee(iteratee, 2))
  8377. : array;
  8378. }
  8379. /**
  8380. * This method is like `_.pullAll` except that it accepts `comparator` which
  8381. * is invoked to compare elements of `array` to `values`. The comparator is
  8382. * invoked with two arguments: (arrVal, othVal).
  8383. *
  8384. * **Note:** Unlike `_.differenceWith`, this method mutates `array`.
  8385. *
  8386. * @static
  8387. * @memberOf _
  8388. * @since 4.6.0
  8389. * @category Array
  8390. * @param {Array} array The array to modify.
  8391. * @param {Array} values The values to remove.
  8392. * @param {Function} [comparator] The comparator invoked per element.
  8393. * @returns {Array} Returns `array`.
  8394. * @example
  8395. *
  8396. * var array = [{ 'x': 1, 'y': 2 }, { 'x': 3, 'y': 4 }, { 'x': 5, 'y': 6 }];
  8397. *
  8398. * _.pullAllWith(array, [{ 'x': 3, 'y': 4 }], _.isEqual);
  8399. * console.log(array);
  8400. * // => [{ 'x': 1, 'y': 2 }, { 'x': 5, 'y': 6 }]
  8401. */
  8402. function pullAllWith(array, values, comparator) {
  8403. return (array && array.length && values && values.length)
  8404. ? basePullAll(array, values, undefined, comparator)
  8405. : array;
  8406. }
  8407. /**
  8408. * Removes elements from `array` corresponding to `indexes` and returns an
  8409. * array of removed elements.
  8410. *
  8411. * **Note:** Unlike `_.at`, this method mutates `array`.
  8412. *
  8413. * @static
  8414. * @memberOf _
  8415. * @since 3.0.0
  8416. * @category Array
  8417. * @param {Array} array The array to modify.
  8418. * @param {...(number|number[])} [indexes] The indexes of elements to remove.
  8419. * @returns {Array} Returns the new array of removed elements.
  8420. * @example
  8421. *
  8422. * var array = ['a', 'b', 'c', 'd'];
  8423. * var pulled = _.pullAt(array, [1, 3]);
  8424. *
  8425. * console.log(array);
  8426. * // => ['a', 'c']
  8427. *
  8428. * console.log(pulled);
  8429. * // => ['b', 'd']
  8430. */
  8431. var pullAt = flatRest(function(array, indexes) {
  8432. var length = array == null ? 0 : array.length,
  8433. result = baseAt(array, indexes);
  8434. basePullAt(array, arrayMap(indexes, function(index) {
  8435. return isIndex(index, length) ? +index : index;
  8436. }).sort(compareAscending));
  8437. return result;
  8438. });
  8439. /**
  8440. * Removes all elements from `array` that `predicate` returns truthy for
  8441. * and returns an array of the removed elements. The predicate is invoked
  8442. * with three arguments: (value, index, array).
  8443. *
  8444. * **Note:** Unlike `_.filter`, this method mutates `array`. Use `_.pull`
  8445. * to pull elements from an array by value.
  8446. *
  8447. * @static
  8448. * @memberOf _
  8449. * @since 2.0.0
  8450. * @category Array
  8451. * @param {Array} array The array to modify.
  8452. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  8453. * @returns {Array} Returns the new array of removed elements.
  8454. * @example
  8455. *
  8456. * var array = [1, 2, 3, 4];
  8457. * var evens = _.remove(array, function(n) {
  8458. * return n % 2 == 0;
  8459. * });
  8460. *
  8461. * console.log(array);
  8462. * // => [1, 3]
  8463. *
  8464. * console.log(evens);
  8465. * // => [2, 4]
  8466. */
  8467. function remove(array, predicate) {
  8468. var result = [];
  8469. if (!(array && array.length)) {
  8470. return result;
  8471. }
  8472. var index = -1,
  8473. indexes = [],
  8474. length = array.length;
  8475. predicate = getIteratee(predicate, 3);
  8476. while (++index < length) {
  8477. var value = array[index];
  8478. if (predicate(value, index, array)) {
  8479. result.push(value);
  8480. indexes.push(index);
  8481. }
  8482. }
  8483. basePullAt(array, indexes);
  8484. return result;
  8485. }
  8486. /**
  8487. * Reverses `array` so that the first element becomes the last, the second
  8488. * element becomes the second to last, and so on.
  8489. *
  8490. * **Note:** This method mutates `array` and is based on
  8491. * [`Array#reverse`](https://mdn.io/Array/reverse).
  8492. *
  8493. * @static
  8494. * @memberOf _
  8495. * @since 4.0.0
  8496. * @category Array
  8497. * @param {Array} array The array to modify.
  8498. * @returns {Array} Returns `array`.
  8499. * @example
  8500. *
  8501. * var array = [1, 2, 3];
  8502. *
  8503. * _.reverse(array);
  8504. * // => [3, 2, 1]
  8505. *
  8506. * console.log(array);
  8507. * // => [3, 2, 1]
  8508. */
  8509. function reverse(array) {
  8510. return array == null ? array : nativeReverse.call(array);
  8511. }
  8512. /**
  8513. * Creates a slice of `array` from `start` up to, but not including, `end`.
  8514. *
  8515. * **Note:** This method is used instead of
  8516. * [`Array#slice`](https://mdn.io/Array/slice) to ensure dense arrays are
  8517. * returned.
  8518. *
  8519. * @static
  8520. * @memberOf _
  8521. * @since 3.0.0
  8522. * @category Array
  8523. * @param {Array} array The array to slice.
  8524. * @param {number} [start=0] The start position.
  8525. * @param {number} [end=array.length] The end position.
  8526. * @returns {Array} Returns the slice of `array`.
  8527. */
  8528. function slice(array, start, end) {
  8529. var length = array == null ? 0 : array.length;
  8530. if (!length) {
  8531. return [];
  8532. }
  8533. if (end && typeof end != 'number' && isIterateeCall(array, start, end)) {
  8534. start = 0;
  8535. end = length;
  8536. }
  8537. else {
  8538. start = start == null ? 0 : toInteger(start);
  8539. end = end === undefined ? length : toInteger(end);
  8540. }
  8541. return baseSlice(array, start, end);
  8542. }
  8543. /**
  8544. * Uses a binary search to determine the lowest index at which `value`
  8545. * should be inserted into `array` in order to maintain its sort order.
  8546. *
  8547. * @static
  8548. * @memberOf _
  8549. * @since 0.1.0
  8550. * @category Array
  8551. * @param {Array} array The sorted array to inspect.
  8552. * @param {*} value The value to evaluate.
  8553. * @returns {number} Returns the index at which `value` should be inserted
  8554. * into `array`.
  8555. * @example
  8556. *
  8557. * _.sortedIndex([30, 50], 40);
  8558. * // => 1
  8559. */
  8560. function sortedIndex(array, value) {
  8561. return baseSortedIndex(array, value);
  8562. }
  8563. /**
  8564. * This method is like `_.sortedIndex` except that it accepts `iteratee`
  8565. * which is invoked for `value` and each element of `array` to compute their
  8566. * sort ranking. The iteratee is invoked with one argument: (value).
  8567. *
  8568. * @static
  8569. * @memberOf _
  8570. * @since 4.0.0
  8571. * @category Array
  8572. * @param {Array} array The sorted array to inspect.
  8573. * @param {*} value The value to evaluate.
  8574. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  8575. * @returns {number} Returns the index at which `value` should be inserted
  8576. * into `array`.
  8577. * @example
  8578. *
  8579. * var objects = [{ 'x': 4 }, { 'x': 5 }];
  8580. *
  8581. * _.sortedIndexBy(objects, { 'x': 4 }, function(o) { return o.x; });
  8582. * // => 0
  8583. *
  8584. * // The `_.property` iteratee shorthand.
  8585. * _.sortedIndexBy(objects, { 'x': 4 }, 'x');
  8586. * // => 0
  8587. */
  8588. function sortedIndexBy(array, value, iteratee) {
  8589. return baseSortedIndexBy(array, value, getIteratee(iteratee, 2));
  8590. }
  8591. /**
  8592. * This method is like `_.indexOf` except that it performs a binary
  8593. * search on a sorted `array`.
  8594. *
  8595. * @static
  8596. * @memberOf _
  8597. * @since 4.0.0
  8598. * @category Array
  8599. * @param {Array} array The array to inspect.
  8600. * @param {*} value The value to search for.
  8601. * @returns {number} Returns the index of the matched value, else `-1`.
  8602. * @example
  8603. *
  8604. * _.sortedIndexOf([4, 5, 5, 5, 6], 5);
  8605. * // => 1
  8606. */
  8607. function sortedIndexOf(array, value) {
  8608. var length = array == null ? 0 : array.length;
  8609. if (length) {
  8610. var index = baseSortedIndex(array, value);
  8611. if (index < length && eq(array[index], value)) {
  8612. return index;
  8613. }
  8614. }
  8615. return -1;
  8616. }
  8617. /**
  8618. * This method is like `_.sortedIndex` except that it returns the highest
  8619. * index at which `value` should be inserted into `array` in order to
  8620. * maintain its sort order.
  8621. *
  8622. * @static
  8623. * @memberOf _
  8624. * @since 3.0.0
  8625. * @category Array
  8626. * @param {Array} array The sorted array to inspect.
  8627. * @param {*} value The value to evaluate.
  8628. * @returns {number} Returns the index at which `value` should be inserted
  8629. * into `array`.
  8630. * @example
  8631. *
  8632. * _.sortedLastIndex([4, 5, 5, 5, 6], 5);
  8633. * // => 4
  8634. */
  8635. function sortedLastIndex(array, value) {
  8636. return baseSortedIndex(array, value, true);
  8637. }
  8638. /**
  8639. * This method is like `_.sortedLastIndex` except that it accepts `iteratee`
  8640. * which is invoked for `value` and each element of `array` to compute their
  8641. * sort ranking. The iteratee is invoked with one argument: (value).
  8642. *
  8643. * @static
  8644. * @memberOf _
  8645. * @since 4.0.0
  8646. * @category Array
  8647. * @param {Array} array The sorted array to inspect.
  8648. * @param {*} value The value to evaluate.
  8649. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  8650. * @returns {number} Returns the index at which `value` should be inserted
  8651. * into `array`.
  8652. * @example
  8653. *
  8654. * var objects = [{ 'x': 4 }, { 'x': 5 }];
  8655. *
  8656. * _.sortedLastIndexBy(objects, { 'x': 4 }, function(o) { return o.x; });
  8657. * // => 1
  8658. *
  8659. * // The `_.property` iteratee shorthand.
  8660. * _.sortedLastIndexBy(objects, { 'x': 4 }, 'x');
  8661. * // => 1
  8662. */
  8663. function sortedLastIndexBy(array, value, iteratee) {
  8664. return baseSortedIndexBy(array, value, getIteratee(iteratee, 2), true);
  8665. }
  8666. /**
  8667. * This method is like `_.lastIndexOf` except that it performs a binary
  8668. * search on a sorted `array`.
  8669. *
  8670. * @static
  8671. * @memberOf _
  8672. * @since 4.0.0
  8673. * @category Array
  8674. * @param {Array} array The array to inspect.
  8675. * @param {*} value The value to search for.
  8676. * @returns {number} Returns the index of the matched value, else `-1`.
  8677. * @example
  8678. *
  8679. * _.sortedLastIndexOf([4, 5, 5, 5, 6], 5);
  8680. * // => 3
  8681. */
  8682. function sortedLastIndexOf(array, value) {
  8683. var length = array == null ? 0 : array.length;
  8684. if (length) {
  8685. var index = baseSortedIndex(array, value, true) - 1;
  8686. if (eq(array[index], value)) {
  8687. return index;
  8688. }
  8689. }
  8690. return -1;
  8691. }
  8692. /**
  8693. * This method is like `_.uniq` except that it's designed and optimized
  8694. * for sorted arrays.
  8695. *
  8696. * @static
  8697. * @memberOf _
  8698. * @since 4.0.0
  8699. * @category Array
  8700. * @param {Array} array The array to inspect.
  8701. * @returns {Array} Returns the new duplicate free array.
  8702. * @example
  8703. *
  8704. * _.sortedUniq([1, 1, 2]);
  8705. * // => [1, 2]
  8706. */
  8707. function sortedUniq(array) {
  8708. return (array && array.length)
  8709. ? baseSortedUniq(array)
  8710. : [];
  8711. }
  8712. /**
  8713. * This method is like `_.uniqBy` except that it's designed and optimized
  8714. * for sorted arrays.
  8715. *
  8716. * @static
  8717. * @memberOf _
  8718. * @since 4.0.0
  8719. * @category Array
  8720. * @param {Array} array The array to inspect.
  8721. * @param {Function} [iteratee] The iteratee invoked per element.
  8722. * @returns {Array} Returns the new duplicate free array.
  8723. * @example
  8724. *
  8725. * _.sortedUniqBy([1.1, 1.2, 2.3, 2.4], Math.floor);
  8726. * // => [1.1, 2.3]
  8727. */
  8728. function sortedUniqBy(array, iteratee) {
  8729. return (array && array.length)
  8730. ? baseSortedUniq(array, getIteratee(iteratee, 2))
  8731. : [];
  8732. }
  8733. /**
  8734. * Gets all but the first element of `array`.
  8735. *
  8736. * @static
  8737. * @memberOf _
  8738. * @since 4.0.0
  8739. * @category Array
  8740. * @param {Array} array The array to query.
  8741. * @returns {Array} Returns the slice of `array`.
  8742. * @example
  8743. *
  8744. * _.tail([1, 2, 3]);
  8745. * // => [2, 3]
  8746. */
  8747. function tail(array) {
  8748. var length = array == null ? 0 : array.length;
  8749. return length ? baseSlice(array, 1, length) : [];
  8750. }
  8751. /**
  8752. * Creates a slice of `array` with `n` elements taken from the beginning.
  8753. *
  8754. * @static
  8755. * @memberOf _
  8756. * @since 0.1.0
  8757. * @category Array
  8758. * @param {Array} array The array to query.
  8759. * @param {number} [n=1] The number of elements to take.
  8760. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  8761. * @returns {Array} Returns the slice of `array`.
  8762. * @example
  8763. *
  8764. * _.take([1, 2, 3]);
  8765. * // => [1]
  8766. *
  8767. * _.take([1, 2, 3], 2);
  8768. * // => [1, 2]
  8769. *
  8770. * _.take([1, 2, 3], 5);
  8771. * // => [1, 2, 3]
  8772. *
  8773. * _.take([1, 2, 3], 0);
  8774. * // => []
  8775. */
  8776. function take(array, n, guard) {
  8777. if (!(array && array.length)) {
  8778. return [];
  8779. }
  8780. n = (guard || n === undefined) ? 1 : toInteger(n);
  8781. return baseSlice(array, 0, n < 0 ? 0 : n);
  8782. }
  8783. /**
  8784. * Creates a slice of `array` with `n` elements taken from the end.
  8785. *
  8786. * @static
  8787. * @memberOf _
  8788. * @since 3.0.0
  8789. * @category Array
  8790. * @param {Array} array The array to query.
  8791. * @param {number} [n=1] The number of elements to take.
  8792. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  8793. * @returns {Array} Returns the slice of `array`.
  8794. * @example
  8795. *
  8796. * _.takeRight([1, 2, 3]);
  8797. * // => [3]
  8798. *
  8799. * _.takeRight([1, 2, 3], 2);
  8800. * // => [2, 3]
  8801. *
  8802. * _.takeRight([1, 2, 3], 5);
  8803. * // => [1, 2, 3]
  8804. *
  8805. * _.takeRight([1, 2, 3], 0);
  8806. * // => []
  8807. */
  8808. function takeRight(array, n, guard) {
  8809. var length = array == null ? 0 : array.length;
  8810. if (!length) {
  8811. return [];
  8812. }
  8813. n = (guard || n === undefined) ? 1 : toInteger(n);
  8814. n = length - n;
  8815. return baseSlice(array, n < 0 ? 0 : n, length);
  8816. }
  8817. /**
  8818. * Creates a slice of `array` with elements taken from the end. Elements are
  8819. * taken until `predicate` returns falsey. The predicate is invoked with
  8820. * three arguments: (value, index, array).
  8821. *
  8822. * @static
  8823. * @memberOf _
  8824. * @since 3.0.0
  8825. * @category Array
  8826. * @param {Array} array The array to query.
  8827. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  8828. * @returns {Array} Returns the slice of `array`.
  8829. * @example
  8830. *
  8831. * var users = [
  8832. * { 'user': 'barney', 'active': true },
  8833. * { 'user': 'fred', 'active': false },
  8834. * { 'user': 'pebbles', 'active': false }
  8835. * ];
  8836. *
  8837. * _.takeRightWhile(users, function(o) { return !o.active; });
  8838. * // => objects for ['fred', 'pebbles']
  8839. *
  8840. * // The `_.matches` iteratee shorthand.
  8841. * _.takeRightWhile(users, { 'user': 'pebbles', 'active': false });
  8842. * // => objects for ['pebbles']
  8843. *
  8844. * // The `_.matchesProperty` iteratee shorthand.
  8845. * _.takeRightWhile(users, ['active', false]);
  8846. * // => objects for ['fred', 'pebbles']
  8847. *
  8848. * // The `_.property` iteratee shorthand.
  8849. * _.takeRightWhile(users, 'active');
  8850. * // => []
  8851. */
  8852. function takeRightWhile(array, predicate) {
  8853. return (array && array.length)
  8854. ? baseWhile(array, getIteratee(predicate, 3), false, true)
  8855. : [];
  8856. }
  8857. /**
  8858. * Creates a slice of `array` with elements taken from the beginning. Elements
  8859. * are taken until `predicate` returns falsey. The predicate is invoked with
  8860. * three arguments: (value, index, array).
  8861. *
  8862. * @static
  8863. * @memberOf _
  8864. * @since 3.0.0
  8865. * @category Array
  8866. * @param {Array} array The array to query.
  8867. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  8868. * @returns {Array} Returns the slice of `array`.
  8869. * @example
  8870. *
  8871. * var users = [
  8872. * { 'user': 'barney', 'active': false },
  8873. * { 'user': 'fred', 'active': false },
  8874. * { 'user': 'pebbles', 'active': true }
  8875. * ];
  8876. *
  8877. * _.takeWhile(users, function(o) { return !o.active; });
  8878. * // => objects for ['barney', 'fred']
  8879. *
  8880. * // The `_.matches` iteratee shorthand.
  8881. * _.takeWhile(users, { 'user': 'barney', 'active': false });
  8882. * // => objects for ['barney']
  8883. *
  8884. * // The `_.matchesProperty` iteratee shorthand.
  8885. * _.takeWhile(users, ['active', false]);
  8886. * // => objects for ['barney', 'fred']
  8887. *
  8888. * // The `_.property` iteratee shorthand.
  8889. * _.takeWhile(users, 'active');
  8890. * // => []
  8891. */
  8892. function takeWhile(array, predicate) {
  8893. return (array && array.length)
  8894. ? baseWhile(array, getIteratee(predicate, 3))
  8895. : [];
  8896. }
  8897. /**
  8898. * Creates an array of unique values, in order, from all given arrays using
  8899. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  8900. * for equality comparisons.
  8901. *
  8902. * @static
  8903. * @memberOf _
  8904. * @since 0.1.0
  8905. * @category Array
  8906. * @param {...Array} [arrays] The arrays to inspect.
  8907. * @returns {Array} Returns the new array of combined values.
  8908. * @example
  8909. *
  8910. * _.union([2], [1, 2]);
  8911. * // => [2, 1]
  8912. */
  8913. var union = baseRest(function(arrays) {
  8914. return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true));
  8915. });
  8916. /**
  8917. * This method is like `_.union` except that it accepts `iteratee` which is
  8918. * invoked for each element of each `arrays` to generate the criterion by
  8919. * which uniqueness is computed. Result values are chosen from the first
  8920. * array in which the value occurs. The iteratee is invoked with one argument:
  8921. * (value).
  8922. *
  8923. * @static
  8924. * @memberOf _
  8925. * @since 4.0.0
  8926. * @category Array
  8927. * @param {...Array} [arrays] The arrays to inspect.
  8928. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  8929. * @returns {Array} Returns the new array of combined values.
  8930. * @example
  8931. *
  8932. * _.unionBy([2.1], [1.2, 2.3], Math.floor);
  8933. * // => [2.1, 1.2]
  8934. *
  8935. * // The `_.property` iteratee shorthand.
  8936. * _.unionBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x');
  8937. * // => [{ 'x': 1 }, { 'x': 2 }]
  8938. */
  8939. var unionBy = baseRest(function(arrays) {
  8940. var iteratee = last(arrays);
  8941. if (isArrayLikeObject(iteratee)) {
  8942. iteratee = undefined;
  8943. }
  8944. return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true), getIteratee(iteratee, 2));
  8945. });
  8946. /**
  8947. * This method is like `_.union` except that it accepts `comparator` which
  8948. * is invoked to compare elements of `arrays`. Result values are chosen from
  8949. * the first array in which the value occurs. The comparator is invoked
  8950. * with two arguments: (arrVal, othVal).
  8951. *
  8952. * @static
  8953. * @memberOf _
  8954. * @since 4.0.0
  8955. * @category Array
  8956. * @param {...Array} [arrays] The arrays to inspect.
  8957. * @param {Function} [comparator] The comparator invoked per element.
  8958. * @returns {Array} Returns the new array of combined values.
  8959. * @example
  8960. *
  8961. * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }];
  8962. * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }];
  8963. *
  8964. * _.unionWith(objects, others, _.isEqual);
  8965. * // => [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }, { 'x': 1, 'y': 1 }]
  8966. */
  8967. var unionWith = baseRest(function(arrays) {
  8968. var comparator = last(arrays);
  8969. comparator = typeof comparator == 'function' ? comparator : undefined;
  8970. return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true), undefined, comparator);
  8971. });
  8972. /**
  8973. * Creates a duplicate-free version of an array, using
  8974. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  8975. * for equality comparisons, in which only the first occurrence of each element
  8976. * is kept. The order of result values is determined by the order they occur
  8977. * in the array.
  8978. *
  8979. * @static
  8980. * @memberOf _
  8981. * @since 0.1.0
  8982. * @category Array
  8983. * @param {Array} array The array to inspect.
  8984. * @returns {Array} Returns the new duplicate free array.
  8985. * @example
  8986. *
  8987. * _.uniq([2, 1, 2]);
  8988. * // => [2, 1]
  8989. */
  8990. function uniq(array) {
  8991. return (array && array.length) ? baseUniq(array) : [];
  8992. }
  8993. /**
  8994. * This method is like `_.uniq` except that it accepts `iteratee` which is
  8995. * invoked for each element in `array` to generate the criterion by which
  8996. * uniqueness is computed. The order of result values is determined by the
  8997. * order they occur in the array. The iteratee is invoked with one argument:
  8998. * (value).
  8999. *
  9000. * @static
  9001. * @memberOf _
  9002. * @since 4.0.0
  9003. * @category Array
  9004. * @param {Array} array The array to inspect.
  9005. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  9006. * @returns {Array} Returns the new duplicate free array.
  9007. * @example
  9008. *
  9009. * _.uniqBy([2.1, 1.2, 2.3], Math.floor);
  9010. * // => [2.1, 1.2]
  9011. *
  9012. * // The `_.property` iteratee shorthand.
  9013. * _.uniqBy([{ 'x': 1 }, { 'x': 2 }, { 'x': 1 }], 'x');
  9014. * // => [{ 'x': 1 }, { 'x': 2 }]
  9015. */
  9016. function uniqBy(array, iteratee) {
  9017. return (array && array.length) ? baseUniq(array, getIteratee(iteratee, 2)) : [];
  9018. }
  9019. /**
  9020. * This method is like `_.uniq` except that it accepts `comparator` which
  9021. * is invoked to compare elements of `array`. The order of result values is
  9022. * determined by the order they occur in the array.The comparator is invoked
  9023. * with two arguments: (arrVal, othVal).
  9024. *
  9025. * @static
  9026. * @memberOf _
  9027. * @since 4.0.0
  9028. * @category Array
  9029. * @param {Array} array The array to inspect.
  9030. * @param {Function} [comparator] The comparator invoked per element.
  9031. * @returns {Array} Returns the new duplicate free array.
  9032. * @example
  9033. *
  9034. * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }, { 'x': 1, 'y': 2 }];
  9035. *
  9036. * _.uniqWith(objects, _.isEqual);
  9037. * // => [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }]
  9038. */
  9039. function uniqWith(array, comparator) {
  9040. comparator = typeof comparator == 'function' ? comparator : undefined;
  9041. return (array && array.length) ? baseUniq(array, undefined, comparator) : [];
  9042. }
  9043. /**
  9044. * This method is like `_.zip` except that it accepts an array of grouped
  9045. * elements and creates an array regrouping the elements to their pre-zip
  9046. * configuration.
  9047. *
  9048. * @static
  9049. * @memberOf _
  9050. * @since 1.2.0
  9051. * @category Array
  9052. * @param {Array} array The array of grouped elements to process.
  9053. * @returns {Array} Returns the new array of regrouped elements.
  9054. * @example
  9055. *
  9056. * var zipped = _.zip(['a', 'b'], [1, 2], [true, false]);
  9057. * // => [['a', 1, true], ['b', 2, false]]
  9058. *
  9059. * _.unzip(zipped);
  9060. * // => [['a', 'b'], [1, 2], [true, false]]
  9061. */
  9062. function unzip(array) {
  9063. if (!(array && array.length)) {
  9064. return [];
  9065. }
  9066. var length = 0;
  9067. array = arrayFilter(array, function(group) {
  9068. if (isArrayLikeObject(group)) {
  9069. length = nativeMax(group.length, length);
  9070. return true;
  9071. }
  9072. });
  9073. return baseTimes(length, function(index) {
  9074. return arrayMap(array, baseProperty(index));
  9075. });
  9076. }
  9077. /**
  9078. * This method is like `_.unzip` except that it accepts `iteratee` to specify
  9079. * how regrouped values should be combined. The iteratee is invoked with the
  9080. * elements of each group: (...group).
  9081. *
  9082. * @static
  9083. * @memberOf _
  9084. * @since 3.8.0
  9085. * @category Array
  9086. * @param {Array} array The array of grouped elements to process.
  9087. * @param {Function} [iteratee=_.identity] The function to combine
  9088. * regrouped values.
  9089. * @returns {Array} Returns the new array of regrouped elements.
  9090. * @example
  9091. *
  9092. * var zipped = _.zip([1, 2], [10, 20], [100, 200]);
  9093. * // => [[1, 10, 100], [2, 20, 200]]
  9094. *
  9095. * _.unzipWith(zipped, _.add);
  9096. * // => [3, 30, 300]
  9097. */
  9098. function unzipWith(array, iteratee) {
  9099. if (!(array && array.length)) {
  9100. return [];
  9101. }
  9102. var result = unzip(array);
  9103. if (iteratee == null) {
  9104. return result;
  9105. }
  9106. return arrayMap(result, function(group) {
  9107. return apply(iteratee, undefined, group);
  9108. });
  9109. }
  9110. /**
  9111. * Creates an array excluding all given values using
  9112. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  9113. * for equality comparisons.
  9114. *
  9115. * **Note:** Unlike `_.pull`, this method returns a new array.
  9116. *
  9117. * @static
  9118. * @memberOf _
  9119. * @since 0.1.0
  9120. * @category Array
  9121. * @param {Array} array The array to inspect.
  9122. * @param {...*} [values] The values to exclude.
  9123. * @returns {Array} Returns the new array of filtered values.
  9124. * @see _.difference, _.xor
  9125. * @example
  9126. *
  9127. * _.without([2, 1, 2, 3], 1, 2);
  9128. * // => [3]
  9129. */
  9130. var without = baseRest(function(array, values) {
  9131. return isArrayLikeObject(array)
  9132. ? baseDifference(array, values)
  9133. : [];
  9134. });
  9135. /**
  9136. * Creates an array of unique values that is the
  9137. * [symmetric difference](https://en.wikipedia.org/wiki/Symmetric_difference)
  9138. * of the given arrays. The order of result values is determined by the order
  9139. * they occur in the arrays.
  9140. *
  9141. * @static
  9142. * @memberOf _
  9143. * @since 2.4.0
  9144. * @category Array
  9145. * @param {...Array} [arrays] The arrays to inspect.
  9146. * @returns {Array} Returns the new array of filtered values.
  9147. * @see _.difference, _.without
  9148. * @example
  9149. *
  9150. * _.xor([2, 1], [2, 3]);
  9151. * // => [1, 3]
  9152. */
  9153. var xor = baseRest(function(arrays) {
  9154. return baseXor(arrayFilter(arrays, isArrayLikeObject));
  9155. });
  9156. /**
  9157. * This method is like `_.xor` except that it accepts `iteratee` which is
  9158. * invoked for each element of each `arrays` to generate the criterion by
  9159. * which by which they're compared. The order of result values is determined
  9160. * by the order they occur in the arrays. The iteratee is invoked with one
  9161. * argument: (value).
  9162. *
  9163. * @static
  9164. * @memberOf _
  9165. * @since 4.0.0
  9166. * @category Array
  9167. * @param {...Array} [arrays] The arrays to inspect.
  9168. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  9169. * @returns {Array} Returns the new array of filtered values.
  9170. * @example
  9171. *
  9172. * _.xorBy([2.1, 1.2], [2.3, 3.4], Math.floor);
  9173. * // => [1.2, 3.4]
  9174. *
  9175. * // The `_.property` iteratee shorthand.
  9176. * _.xorBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x');
  9177. * // => [{ 'x': 2 }]
  9178. */
  9179. var xorBy = baseRest(function(arrays) {
  9180. var iteratee = last(arrays);
  9181. if (isArrayLikeObject(iteratee)) {
  9182. iteratee = undefined;
  9183. }
  9184. return baseXor(arrayFilter(arrays, isArrayLikeObject), getIteratee(iteratee, 2));
  9185. });
  9186. /**
  9187. * This method is like `_.xor` except that it accepts `comparator` which is
  9188. * invoked to compare elements of `arrays`. The order of result values is
  9189. * determined by the order they occur in the arrays. The comparator is invoked
  9190. * with two arguments: (arrVal, othVal).
  9191. *
  9192. * @static
  9193. * @memberOf _
  9194. * @since 4.0.0
  9195. * @category Array
  9196. * @param {...Array} [arrays] The arrays to inspect.
  9197. * @param {Function} [comparator] The comparator invoked per element.
  9198. * @returns {Array} Returns the new array of filtered values.
  9199. * @example
  9200. *
  9201. * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }];
  9202. * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }];
  9203. *
  9204. * _.xorWith(objects, others, _.isEqual);
  9205. * // => [{ 'x': 2, 'y': 1 }, { 'x': 1, 'y': 1 }]
  9206. */
  9207. var xorWith = baseRest(function(arrays) {
  9208. var comparator = last(arrays);
  9209. comparator = typeof comparator == 'function' ? comparator : undefined;
  9210. return baseXor(arrayFilter(arrays, isArrayLikeObject), undefined, comparator);
  9211. });
  9212. /**
  9213. * Creates an array of grouped elements, the first of which contains the
  9214. * first elements of the given arrays, the second of which contains the
  9215. * second elements of the given arrays, and so on.
  9216. *
  9217. * @static
  9218. * @memberOf _
  9219. * @since 0.1.0
  9220. * @category Array
  9221. * @param {...Array} [arrays] The arrays to process.
  9222. * @returns {Array} Returns the new array of grouped elements.
  9223. * @example
  9224. *
  9225. * _.zip(['a', 'b'], [1, 2], [true, false]);
  9226. * // => [['a', 1, true], ['b', 2, false]]
  9227. */
  9228. var zip = baseRest(unzip);
  9229. /**
  9230. * This method is like `_.fromPairs` except that it accepts two arrays,
  9231. * one of property identifiers and one of corresponding values.
  9232. *
  9233. * @static
  9234. * @memberOf _
  9235. * @since 0.4.0
  9236. * @category Array
  9237. * @param {Array} [props=[]] The property identifiers.
  9238. * @param {Array} [values=[]] The property values.
  9239. * @returns {Object} Returns the new object.
  9240. * @example
  9241. *
  9242. * _.zipObject(['a', 'b'], [1, 2]);
  9243. * // => { 'a': 1, 'b': 2 }
  9244. */
  9245. function zipObject(props, values) {
  9246. return baseZipObject(props || [], values || [], assignValue);
  9247. }
  9248. /**
  9249. * This method is like `_.zipObject` except that it supports property paths.
  9250. *
  9251. * @static
  9252. * @memberOf _
  9253. * @since 4.1.0
  9254. * @category Array
  9255. * @param {Array} [props=[]] The property identifiers.
  9256. * @param {Array} [values=[]] The property values.
  9257. * @returns {Object} Returns the new object.
  9258. * @example
  9259. *
  9260. * _.zipObjectDeep(['a.b[0].c', 'a.b[1].d'], [1, 2]);
  9261. * // => { 'a': { 'b': [{ 'c': 1 }, { 'd': 2 }] } }
  9262. */
  9263. function zipObjectDeep(props, values) {
  9264. return baseZipObject(props || [], values || [], baseSet);
  9265. }
  9266. /**
  9267. * This method is like `_.zip` except that it accepts `iteratee` to specify
  9268. * how grouped values should be combined. The iteratee is invoked with the
  9269. * elements of each group: (...group).
  9270. *
  9271. * @static
  9272. * @memberOf _
  9273. * @since 3.8.0
  9274. * @category Array
  9275. * @param {...Array} [arrays] The arrays to process.
  9276. * @param {Function} [iteratee=_.identity] The function to combine
  9277. * grouped values.
  9278. * @returns {Array} Returns the new array of grouped elements.
  9279. * @example
  9280. *
  9281. * _.zipWith([1, 2], [10, 20], [100, 200], function(a, b, c) {
  9282. * return a + b + c;
  9283. * });
  9284. * // => [111, 222]
  9285. */
  9286. var zipWith = baseRest(function(arrays) {
  9287. var length = arrays.length,
  9288. iteratee = length > 1 ? arrays[length - 1] : undefined;
  9289. iteratee = typeof iteratee == 'function' ? (arrays.pop(), iteratee) : undefined;
  9290. return unzipWith(arrays, iteratee);
  9291. });
  9292. /*------------------------------------------------------------------------*/
  9293. /**
  9294. * Creates a `lodash` wrapper instance that wraps `value` with explicit method
  9295. * chain sequences enabled. The result of such sequences must be unwrapped
  9296. * with `_#value`.
  9297. *
  9298. * @static
  9299. * @memberOf _
  9300. * @since 1.3.0
  9301. * @category Seq
  9302. * @param {*} value The value to wrap.
  9303. * @returns {Object} Returns the new `lodash` wrapper instance.
  9304. * @example
  9305. *
  9306. * var users = [
  9307. * { 'user': 'barney', 'age': 36 },
  9308. * { 'user': 'fred', 'age': 40 },
  9309. * { 'user': 'pebbles', 'age': 1 }
  9310. * ];
  9311. *
  9312. * var youngest = _
  9313. * .chain(users)
  9314. * .sortBy('age')
  9315. * .map(function(o) {
  9316. * return o.user + ' is ' + o.age;
  9317. * })
  9318. * .head()
  9319. * .value();
  9320. * // => 'pebbles is 1'
  9321. */
  9322. function chain(value) {
  9323. var result = lodash(value);
  9324. result.__chain__ = true;
  9325. return result;
  9326. }
  9327. /**
  9328. * This method invokes `interceptor` and returns `value`. The interceptor
  9329. * is invoked with one argument; (value). The purpose of this method is to
  9330. * "tap into" a method chain sequence in order to modify intermediate results.
  9331. *
  9332. * @static
  9333. * @memberOf _
  9334. * @since 0.1.0
  9335. * @category Seq
  9336. * @param {*} value The value to provide to `interceptor`.
  9337. * @param {Function} interceptor The function to invoke.
  9338. * @returns {*} Returns `value`.
  9339. * @example
  9340. *
  9341. * _([1, 2, 3])
  9342. * .tap(function(array) {
  9343. * // Mutate input array.
  9344. * array.pop();
  9345. * })
  9346. * .reverse()
  9347. * .value();
  9348. * // => [2, 1]
  9349. */
  9350. function tap(value, interceptor) {
  9351. interceptor(value);
  9352. return value;
  9353. }
  9354. /**
  9355. * This method is like `_.tap` except that it returns the result of `interceptor`.
  9356. * The purpose of this method is to "pass thru" values replacing intermediate
  9357. * results in a method chain sequence.
  9358. *
  9359. * @static
  9360. * @memberOf _
  9361. * @since 3.0.0
  9362. * @category Seq
  9363. * @param {*} value The value to provide to `interceptor`.
  9364. * @param {Function} interceptor The function to invoke.
  9365. * @returns {*} Returns the result of `interceptor`.
  9366. * @example
  9367. *
  9368. * _(' abc ')
  9369. * .chain()
  9370. * .trim()
  9371. * .thru(function(value) {
  9372. * return [value];
  9373. * })
  9374. * .value();
  9375. * // => ['abc']
  9376. */
  9377. function thru(value, interceptor) {
  9378. return interceptor(value);
  9379. }
  9380. /**
  9381. * This method is the wrapper version of `_.at`.
  9382. *
  9383. * @name at
  9384. * @memberOf _
  9385. * @since 1.0.0
  9386. * @category Seq
  9387. * @param {...(string|string[])} [paths] The property paths to pick.
  9388. * @returns {Object} Returns the new `lodash` wrapper instance.
  9389. * @example
  9390. *
  9391. * var object = { 'a': [{ 'b': { 'c': 3 } }, 4] };
  9392. *
  9393. * _(object).at(['a[0].b.c', 'a[1]']).value();
  9394. * // => [3, 4]
  9395. */
  9396. var wrapperAt = flatRest(function(paths) {
  9397. var length = paths.length,
  9398. start = length ? paths[0] : 0,
  9399. value = this.__wrapped__,
  9400. interceptor = function(object) { return baseAt(object, paths); };
  9401. if (length > 1 || this.__actions__.length ||
  9402. !(value instanceof LazyWrapper) || !isIndex(start)) {
  9403. return this.thru(interceptor);
  9404. }
  9405. value = value.slice(start, +start + (length ? 1 : 0));
  9406. value.__actions__.push({
  9407. 'func': thru,
  9408. 'args': [interceptor],
  9409. 'thisArg': undefined
  9410. });
  9411. return new LodashWrapper(value, this.__chain__).thru(function(array) {
  9412. if (length && !array.length) {
  9413. array.push(undefined);
  9414. }
  9415. return array;
  9416. });
  9417. });
  9418. /**
  9419. * Creates a `lodash` wrapper instance with explicit method chain sequences enabled.
  9420. *
  9421. * @name chain
  9422. * @memberOf _
  9423. * @since 0.1.0
  9424. * @category Seq
  9425. * @returns {Object} Returns the new `lodash` wrapper instance.
  9426. * @example
  9427. *
  9428. * var users = [
  9429. * { 'user': 'barney', 'age': 36 },
  9430. * { 'user': 'fred', 'age': 40 }
  9431. * ];
  9432. *
  9433. * // A sequence without explicit chaining.
  9434. * _(users).head();
  9435. * // => { 'user': 'barney', 'age': 36 }
  9436. *
  9437. * // A sequence with explicit chaining.
  9438. * _(users)
  9439. * .chain()
  9440. * .head()
  9441. * .pick('user')
  9442. * .value();
  9443. * // => { 'user': 'barney' }
  9444. */
  9445. function wrapperChain() {
  9446. return chain(this);
  9447. }
  9448. /**
  9449. * Executes the chain sequence and returns the wrapped result.
  9450. *
  9451. * @name commit
  9452. * @memberOf _
  9453. * @since 3.2.0
  9454. * @category Seq
  9455. * @returns {Object} Returns the new `lodash` wrapper instance.
  9456. * @example
  9457. *
  9458. * var array = [1, 2];
  9459. * var wrapped = _(array).push(3);
  9460. *
  9461. * console.log(array);
  9462. * // => [1, 2]
  9463. *
  9464. * wrapped = wrapped.commit();
  9465. * console.log(array);
  9466. * // => [1, 2, 3]
  9467. *
  9468. * wrapped.last();
  9469. * // => 3
  9470. *
  9471. * console.log(array);
  9472. * // => [1, 2, 3]
  9473. */
  9474. function wrapperCommit() {
  9475. return new LodashWrapper(this.value(), this.__chain__);
  9476. }
  9477. /**
  9478. * Gets the next value on a wrapped object following the
  9479. * [iterator protocol](https://mdn.io/iteration_protocols#iterator).
  9480. *
  9481. * @name next
  9482. * @memberOf _
  9483. * @since 4.0.0
  9484. * @category Seq
  9485. * @returns {Object} Returns the next iterator value.
  9486. * @example
  9487. *
  9488. * var wrapped = _([1, 2]);
  9489. *
  9490. * wrapped.next();
  9491. * // => { 'done': false, 'value': 1 }
  9492. *
  9493. * wrapped.next();
  9494. * // => { 'done': false, 'value': 2 }
  9495. *
  9496. * wrapped.next();
  9497. * // => { 'done': true, 'value': undefined }
  9498. */
  9499. function wrapperNext() {
  9500. if (this.__values__ === undefined) {
  9501. this.__values__ = toArray(this.value());
  9502. }
  9503. var done = this.__index__ >= this.__values__.length,
  9504. value = done ? undefined : this.__values__[this.__index__++];
  9505. return { 'done': done, 'value': value };
  9506. }
  9507. /**
  9508. * Enables the wrapper to be iterable.
  9509. *
  9510. * @name Symbol.iterator
  9511. * @memberOf _
  9512. * @since 4.0.0
  9513. * @category Seq
  9514. * @returns {Object} Returns the wrapper object.
  9515. * @example
  9516. *
  9517. * var wrapped = _([1, 2]);
  9518. *
  9519. * wrapped[Symbol.iterator]() === wrapped;
  9520. * // => true
  9521. *
  9522. * Array.from(wrapped);
  9523. * // => [1, 2]
  9524. */
  9525. function wrapperToIterator() {
  9526. return this;
  9527. }
  9528. /**
  9529. * Creates a clone of the chain sequence planting `value` as the wrapped value.
  9530. *
  9531. * @name plant
  9532. * @memberOf _
  9533. * @since 3.2.0
  9534. * @category Seq
  9535. * @param {*} value The value to plant.
  9536. * @returns {Object} Returns the new `lodash` wrapper instance.
  9537. * @example
  9538. *
  9539. * function square(n) {
  9540. * return n * n;
  9541. * }
  9542. *
  9543. * var wrapped = _([1, 2]).map(square);
  9544. * var other = wrapped.plant([3, 4]);
  9545. *
  9546. * other.value();
  9547. * // => [9, 16]
  9548. *
  9549. * wrapped.value();
  9550. * // => [1, 4]
  9551. */
  9552. function wrapperPlant(value) {
  9553. var result,
  9554. parent = this;
  9555. while (parent instanceof baseLodash) {
  9556. var clone = wrapperClone(parent);
  9557. clone.__index__ = 0;
  9558. clone.__values__ = undefined;
  9559. if (result) {
  9560. previous.__wrapped__ = clone;
  9561. } else {
  9562. result = clone;
  9563. }
  9564. var previous = clone;
  9565. parent = parent.__wrapped__;
  9566. }
  9567. previous.__wrapped__ = value;
  9568. return result;
  9569. }
  9570. /**
  9571. * This method is the wrapper version of `_.reverse`.
  9572. *
  9573. * **Note:** This method mutates the wrapped array.
  9574. *
  9575. * @name reverse
  9576. * @memberOf _
  9577. * @since 0.1.0
  9578. * @category Seq
  9579. * @returns {Object} Returns the new `lodash` wrapper instance.
  9580. * @example
  9581. *
  9582. * var array = [1, 2, 3];
  9583. *
  9584. * _(array).reverse().value()
  9585. * // => [3, 2, 1]
  9586. *
  9587. * console.log(array);
  9588. * // => [3, 2, 1]
  9589. */
  9590. function wrapperReverse() {
  9591. var value = this.__wrapped__;
  9592. if (value instanceof LazyWrapper) {
  9593. var wrapped = value;
  9594. if (this.__actions__.length) {
  9595. wrapped = new LazyWrapper(this);
  9596. }
  9597. wrapped = wrapped.reverse();
  9598. wrapped.__actions__.push({
  9599. 'func': thru,
  9600. 'args': [reverse],
  9601. 'thisArg': undefined
  9602. });
  9603. return new LodashWrapper(wrapped, this.__chain__);
  9604. }
  9605. return this.thru(reverse);
  9606. }
  9607. /**
  9608. * Executes the chain sequence to resolve the unwrapped value.
  9609. *
  9610. * @name value
  9611. * @memberOf _
  9612. * @since 0.1.0
  9613. * @alias toJSON, valueOf
  9614. * @category Seq
  9615. * @returns {*} Returns the resolved unwrapped value.
  9616. * @example
  9617. *
  9618. * _([1, 2, 3]).value();
  9619. * // => [1, 2, 3]
  9620. */
  9621. function wrapperValue() {
  9622. return baseWrapperValue(this.__wrapped__, this.__actions__);
  9623. }
  9624. /*------------------------------------------------------------------------*/
  9625. /**
  9626. * Creates an object composed of keys generated from the results of running
  9627. * each element of `collection` thru `iteratee`. The corresponding value of
  9628. * each key is the number of times the key was returned by `iteratee`. The
  9629. * iteratee is invoked with one argument: (value).
  9630. *
  9631. * @static
  9632. * @memberOf _
  9633. * @since 0.5.0
  9634. * @category Collection
  9635. * @param {Array|Object} collection The collection to iterate over.
  9636. * @param {Function} [iteratee=_.identity] The iteratee to transform keys.
  9637. * @returns {Object} Returns the composed aggregate object.
  9638. * @example
  9639. *
  9640. * _.countBy([6.1, 4.2, 6.3], Math.floor);
  9641. * // => { '4': 1, '6': 2 }
  9642. *
  9643. * // The `_.property` iteratee shorthand.
  9644. * _.countBy(['one', 'two', 'three'], 'length');
  9645. * // => { '3': 2, '5': 1 }
  9646. */
  9647. var countBy = createAggregator(function(result, value, key) {
  9648. if (hasOwnProperty.call(result, key)) {
  9649. ++result[key];
  9650. } else {
  9651. baseAssignValue(result, key, 1);
  9652. }
  9653. });
  9654. /**
  9655. * Checks if `predicate` returns truthy for **all** elements of `collection`.
  9656. * Iteration is stopped once `predicate` returns falsey. The predicate is
  9657. * invoked with three arguments: (value, index|key, collection).
  9658. *
  9659. * **Note:** This method returns `true` for
  9660. * [empty collections](https://en.wikipedia.org/wiki/Empty_set) because
  9661. * [everything is true](https://en.wikipedia.org/wiki/Vacuous_truth) of
  9662. * elements of empty collections.
  9663. *
  9664. * @static
  9665. * @memberOf _
  9666. * @since 0.1.0
  9667. * @category Collection
  9668. * @param {Array|Object} collection The collection to iterate over.
  9669. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  9670. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  9671. * @returns {boolean} Returns `true` if all elements pass the predicate check,
  9672. * else `false`.
  9673. * @example
  9674. *
  9675. * _.every([true, 1, null, 'yes'], Boolean);
  9676. * // => false
  9677. *
  9678. * var users = [
  9679. * { 'user': 'barney', 'age': 36, 'active': false },
  9680. * { 'user': 'fred', 'age': 40, 'active': false }
  9681. * ];
  9682. *
  9683. * // The `_.matches` iteratee shorthand.
  9684. * _.every(users, { 'user': 'barney', 'active': false });
  9685. * // => false
  9686. *
  9687. * // The `_.matchesProperty` iteratee shorthand.
  9688. * _.every(users, ['active', false]);
  9689. * // => true
  9690. *
  9691. * // The `_.property` iteratee shorthand.
  9692. * _.every(users, 'active');
  9693. * // => false
  9694. */
  9695. function every(collection, predicate, guard) {
  9696. var func = isArray(collection) ? arrayEvery : baseEvery;
  9697. if (guard && isIterateeCall(collection, predicate, guard)) {
  9698. predicate = undefined;
  9699. }
  9700. return func(collection, getIteratee(predicate, 3));
  9701. }
  9702. /**
  9703. * Iterates over elements of `collection`, returning an array of all elements
  9704. * `predicate` returns truthy for. The predicate is invoked with three
  9705. * arguments: (value, index|key, collection).
  9706. *
  9707. * **Note:** Unlike `_.remove`, this method returns a new array.
  9708. *
  9709. * @static
  9710. * @memberOf _
  9711. * @since 0.1.0
  9712. * @category Collection
  9713. * @param {Array|Object} collection The collection to iterate over.
  9714. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  9715. * @returns {Array} Returns the new filtered array.
  9716. * @see _.reject
  9717. * @example
  9718. *
  9719. * var users = [
  9720. * { 'user': 'barney', 'age': 36, 'active': true },
  9721. * { 'user': 'fred', 'age': 40, 'active': false }
  9722. * ];
  9723. *
  9724. * _.filter(users, function(o) { return !o.active; });
  9725. * // => objects for ['fred']
  9726. *
  9727. * // The `_.matches` iteratee shorthand.
  9728. * _.filter(users, { 'age': 36, 'active': true });
  9729. * // => objects for ['barney']
  9730. *
  9731. * // The `_.matchesProperty` iteratee shorthand.
  9732. * _.filter(users, ['active', false]);
  9733. * // => objects for ['fred']
  9734. *
  9735. * // The `_.property` iteratee shorthand.
  9736. * _.filter(users, 'active');
  9737. * // => objects for ['barney']
  9738. *
  9739. * // Combining several predicates using `_.overEvery` or `_.overSome`.
  9740. * _.filter(users, _.overSome([{ 'age': 36 }, ['age', 40]]));
  9741. * // => objects for ['fred', 'barney']
  9742. */
  9743. function filter(collection, predicate) {
  9744. var func = isArray(collection) ? arrayFilter : baseFilter;
  9745. return func(collection, getIteratee(predicate, 3));
  9746. }
  9747. /**
  9748. * Iterates over elements of `collection`, returning the first element
  9749. * `predicate` returns truthy for. The predicate is invoked with three
  9750. * arguments: (value, index|key, collection).
  9751. *
  9752. * @static
  9753. * @memberOf _
  9754. * @since 0.1.0
  9755. * @category Collection
  9756. * @param {Array|Object} collection The collection to inspect.
  9757. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  9758. * @param {number} [fromIndex=0] The index to search from.
  9759. * @returns {*} Returns the matched element, else `undefined`.
  9760. * @example
  9761. *
  9762. * var users = [
  9763. * { 'user': 'barney', 'age': 36, 'active': true },
  9764. * { 'user': 'fred', 'age': 40, 'active': false },
  9765. * { 'user': 'pebbles', 'age': 1, 'active': true }
  9766. * ];
  9767. *
  9768. * _.find(users, function(o) { return o.age < 40; });
  9769. * // => object for 'barney'
  9770. *
  9771. * // The `_.matches` iteratee shorthand.
  9772. * _.find(users, { 'age': 1, 'active': true });
  9773. * // => object for 'pebbles'
  9774. *
  9775. * // The `_.matchesProperty` iteratee shorthand.
  9776. * _.find(users, ['active', false]);
  9777. * // => object for 'fred'
  9778. *
  9779. * // The `_.property` iteratee shorthand.
  9780. * _.find(users, 'active');
  9781. * // => object for 'barney'
  9782. */
  9783. var find = createFind(findIndex);
  9784. /**
  9785. * This method is like `_.find` except that it iterates over elements of
  9786. * `collection` from right to left.
  9787. *
  9788. * @static
  9789. * @memberOf _
  9790. * @since 2.0.0
  9791. * @category Collection
  9792. * @param {Array|Object} collection The collection to inspect.
  9793. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  9794. * @param {number} [fromIndex=collection.length-1] The index to search from.
  9795. * @returns {*} Returns the matched element, else `undefined`.
  9796. * @example
  9797. *
  9798. * _.findLast([1, 2, 3, 4], function(n) {
  9799. * return n % 2 == 1;
  9800. * });
  9801. * // => 3
  9802. */
  9803. var findLast = createFind(findLastIndex);
  9804. /**
  9805. * Creates a flattened array of values by running each element in `collection`
  9806. * thru `iteratee` and flattening the mapped results. The iteratee is invoked
  9807. * with three arguments: (value, index|key, collection).
  9808. *
  9809. * @static
  9810. * @memberOf _
  9811. * @since 4.0.0
  9812. * @category Collection
  9813. * @param {Array|Object} collection The collection to iterate over.
  9814. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  9815. * @returns {Array} Returns the new flattened array.
  9816. * @example
  9817. *
  9818. * function duplicate(n) {
  9819. * return [n, n];
  9820. * }
  9821. *
  9822. * _.flatMap([1, 2], duplicate);
  9823. * // => [1, 1, 2, 2]
  9824. */
  9825. function flatMap(collection, iteratee) {
  9826. return baseFlatten(map(collection, iteratee), 1);
  9827. }
  9828. /**
  9829. * This method is like `_.flatMap` except that it recursively flattens the
  9830. * mapped results.
  9831. *
  9832. * @static
  9833. * @memberOf _
  9834. * @since 4.7.0
  9835. * @category Collection
  9836. * @param {Array|Object} collection The collection to iterate over.
  9837. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  9838. * @returns {Array} Returns the new flattened array.
  9839. * @example
  9840. *
  9841. * function duplicate(n) {
  9842. * return [[[n, n]]];
  9843. * }
  9844. *
  9845. * _.flatMapDeep([1, 2], duplicate);
  9846. * // => [1, 1, 2, 2]
  9847. */
  9848. function flatMapDeep(collection, iteratee) {
  9849. return baseFlatten(map(collection, iteratee), INFINITY);
  9850. }
  9851. /**
  9852. * This method is like `_.flatMap` except that it recursively flattens the
  9853. * mapped results up to `depth` times.
  9854. *
  9855. * @static
  9856. * @memberOf _
  9857. * @since 4.7.0
  9858. * @category Collection
  9859. * @param {Array|Object} collection The collection to iterate over.
  9860. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  9861. * @param {number} [depth=1] The maximum recursion depth.
  9862. * @returns {Array} Returns the new flattened array.
  9863. * @example
  9864. *
  9865. * function duplicate(n) {
  9866. * return [[[n, n]]];
  9867. * }
  9868. *
  9869. * _.flatMapDepth([1, 2], duplicate, 2);
  9870. * // => [[1, 1], [2, 2]]
  9871. */
  9872. function flatMapDepth(collection, iteratee, depth) {
  9873. depth = depth === undefined ? 1 : toInteger(depth);
  9874. return baseFlatten(map(collection, iteratee), depth);
  9875. }
  9876. /**
  9877. * Iterates over elements of `collection` and invokes `iteratee` for each element.
  9878. * The iteratee is invoked with three arguments: (value, index|key, collection).
  9879. * Iteratee functions may exit iteration early by explicitly returning `false`.
  9880. *
  9881. * **Note:** As with other "Collections" methods, objects with a "length"
  9882. * property are iterated like arrays. To avoid this behavior use `_.forIn`
  9883. * or `_.forOwn` for object iteration.
  9884. *
  9885. * @static
  9886. * @memberOf _
  9887. * @since 0.1.0
  9888. * @alias each
  9889. * @category Collection
  9890. * @param {Array|Object} collection The collection to iterate over.
  9891. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  9892. * @returns {Array|Object} Returns `collection`.
  9893. * @see _.forEachRight
  9894. * @example
  9895. *
  9896. * _.forEach([1, 2], function(value) {
  9897. * console.log(value);
  9898. * });
  9899. * // => Logs `1` then `2`.
  9900. *
  9901. * _.forEach({ 'a': 1, 'b': 2 }, function(value, key) {
  9902. * console.log(key);
  9903. * });
  9904. * // => Logs 'a' then 'b' (iteration order is not guaranteed).
  9905. */
  9906. function forEach(collection, iteratee) {
  9907. var func = isArray(collection) ? arrayEach : baseEach;
  9908. return func(collection, getIteratee(iteratee, 3));
  9909. }
  9910. /**
  9911. * This method is like `_.forEach` except that it iterates over elements of
  9912. * `collection` from right to left.
  9913. *
  9914. * @static
  9915. * @memberOf _
  9916. * @since 2.0.0
  9917. * @alias eachRight
  9918. * @category Collection
  9919. * @param {Array|Object} collection The collection to iterate over.
  9920. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  9921. * @returns {Array|Object} Returns `collection`.
  9922. * @see _.forEach
  9923. * @example
  9924. *
  9925. * _.forEachRight([1, 2], function(value) {
  9926. * console.log(value);
  9927. * });
  9928. * // => Logs `2` then `1`.
  9929. */
  9930. function forEachRight(collection, iteratee) {
  9931. var func = isArray(collection) ? arrayEachRight : baseEachRight;
  9932. return func(collection, getIteratee(iteratee, 3));
  9933. }
  9934. /**
  9935. * Creates an object composed of keys generated from the results of running
  9936. * each element of `collection` thru `iteratee`. The order of grouped values
  9937. * is determined by the order they occur in `collection`. The corresponding
  9938. * value of each key is an array of elements responsible for generating the
  9939. * key. The iteratee is invoked with one argument: (value).
  9940. *
  9941. * @static
  9942. * @memberOf _
  9943. * @since 0.1.0
  9944. * @category Collection
  9945. * @param {Array|Object} collection The collection to iterate over.
  9946. * @param {Function} [iteratee=_.identity] The iteratee to transform keys.
  9947. * @returns {Object} Returns the composed aggregate object.
  9948. * @example
  9949. *
  9950. * _.groupBy([6.1, 4.2, 6.3], Math.floor);
  9951. * // => { '4': [4.2], '6': [6.1, 6.3] }
  9952. *
  9953. * // The `_.property` iteratee shorthand.
  9954. * _.groupBy(['one', 'two', 'three'], 'length');
  9955. * // => { '3': ['one', 'two'], '5': ['three'] }
  9956. */
  9957. var groupBy = createAggregator(function(result, value, key) {
  9958. if (hasOwnProperty.call(result, key)) {
  9959. result[key].push(value);
  9960. } else {
  9961. baseAssignValue(result, key, [value]);
  9962. }
  9963. });
  9964. /**
  9965. * Checks if `value` is in `collection`. If `collection` is a string, it's
  9966. * checked for a substring of `value`, otherwise
  9967. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  9968. * is used for equality comparisons. If `fromIndex` is negative, it's used as
  9969. * the offset from the end of `collection`.
  9970. *
  9971. * @static
  9972. * @memberOf _
  9973. * @since 0.1.0
  9974. * @category Collection
  9975. * @param {Array|Object|string} collection The collection to inspect.
  9976. * @param {*} value The value to search for.
  9977. * @param {number} [fromIndex=0] The index to search from.
  9978. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.reduce`.
  9979. * @returns {boolean} Returns `true` if `value` is found, else `false`.
  9980. * @example
  9981. *
  9982. * _.includes([1, 2, 3], 1);
  9983. * // => true
  9984. *
  9985. * _.includes([1, 2, 3], 1, 2);
  9986. * // => false
  9987. *
  9988. * _.includes({ 'a': 1, 'b': 2 }, 1);
  9989. * // => true
  9990. *
  9991. * _.includes('abcd', 'bc');
  9992. * // => true
  9993. */
  9994. function includes(collection, value, fromIndex, guard) {
  9995. collection = isArrayLike(collection) ? collection : values(collection);
  9996. fromIndex = (fromIndex && !guard) ? toInteger(fromIndex) : 0;
  9997. var length = collection.length;
  9998. if (fromIndex < 0) {
  9999. fromIndex = nativeMax(length + fromIndex, 0);
  10000. }
  10001. return isString(collection)
  10002. ? (fromIndex <= length && collection.indexOf(value, fromIndex) > -1)
  10003. : (!!length && baseIndexOf(collection, value, fromIndex) > -1);
  10004. }
  10005. /**
  10006. * Invokes the method at `path` of each element in `collection`, returning
  10007. * an array of the results of each invoked method. Any additional arguments
  10008. * are provided to each invoked method. If `path` is a function, it's invoked
  10009. * for, and `this` bound to, each element in `collection`.
  10010. *
  10011. * @static
  10012. * @memberOf _
  10013. * @since 4.0.0
  10014. * @category Collection
  10015. * @param {Array|Object} collection The collection to iterate over.
  10016. * @param {Array|Function|string} path The path of the method to invoke or
  10017. * the function invoked per iteration.
  10018. * @param {...*} [args] The arguments to invoke each method with.
  10019. * @returns {Array} Returns the array of results.
  10020. * @example
  10021. *
  10022. * _.invokeMap([[5, 1, 7], [3, 2, 1]], 'sort');
  10023. * // => [[1, 5, 7], [1, 2, 3]]
  10024. *
  10025. * _.invokeMap([123, 456], String.prototype.split, '');
  10026. * // => [['1', '2', '3'], ['4', '5', '6']]
  10027. */
  10028. var invokeMap = baseRest(function(collection, path, args) {
  10029. var index = -1,
  10030. isFunc = typeof path == 'function',
  10031. result = isArrayLike(collection) ? Array(collection.length) : [];
  10032. baseEach(collection, function(value) {
  10033. result[++index] = isFunc ? apply(path, value, args) : baseInvoke(value, path, args);
  10034. });
  10035. return result;
  10036. });
  10037. /**
  10038. * Creates an object composed of keys generated from the results of running
  10039. * each element of `collection` thru `iteratee`. The corresponding value of
  10040. * each key is the last element responsible for generating the key. The
  10041. * iteratee is invoked with one argument: (value).
  10042. *
  10043. * @static
  10044. * @memberOf _
  10045. * @since 4.0.0
  10046. * @category Collection
  10047. * @param {Array|Object} collection The collection to iterate over.
  10048. * @param {Function} [iteratee=_.identity] The iteratee to transform keys.
  10049. * @returns {Object} Returns the composed aggregate object.
  10050. * @example
  10051. *
  10052. * var array = [
  10053. * { 'dir': 'left', 'code': 97 },
  10054. * { 'dir': 'right', 'code': 100 }
  10055. * ];
  10056. *
  10057. * _.keyBy(array, function(o) {
  10058. * return String.fromCharCode(o.code);
  10059. * });
  10060. * // => { 'a': { 'dir': 'left', 'code': 97 }, 'd': { 'dir': 'right', 'code': 100 } }
  10061. *
  10062. * _.keyBy(array, 'dir');
  10063. * // => { 'left': { 'dir': 'left', 'code': 97 }, 'right': { 'dir': 'right', 'code': 100 } }
  10064. */
  10065. var keyBy = createAggregator(function(result, value, key) {
  10066. baseAssignValue(result, key, value);
  10067. });
  10068. /**
  10069. * Creates an array of values by running each element in `collection` thru
  10070. * `iteratee`. The iteratee is invoked with three arguments:
  10071. * (value, index|key, collection).
  10072. *
  10073. * Many lodash methods are guarded to work as iteratees for methods like
  10074. * `_.every`, `_.filter`, `_.map`, `_.mapValues`, `_.reject`, and `_.some`.
  10075. *
  10076. * The guarded methods are:
  10077. * `ary`, `chunk`, `curry`, `curryRight`, `drop`, `dropRight`, `every`,
  10078. * `fill`, `invert`, `parseInt`, `random`, `range`, `rangeRight`, `repeat`,
  10079. * `sampleSize`, `slice`, `some`, `sortBy`, `split`, `take`, `takeRight`,
  10080. * `template`, `trim`, `trimEnd`, `trimStart`, and `words`
  10081. *
  10082. * @static
  10083. * @memberOf _
  10084. * @since 0.1.0
  10085. * @category Collection
  10086. * @param {Array|Object} collection The collection to iterate over.
  10087. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  10088. * @returns {Array} Returns the new mapped array.
  10089. * @example
  10090. *
  10091. * function square(n) {
  10092. * return n * n;
  10093. * }
  10094. *
  10095. * _.map([4, 8], square);
  10096. * // => [16, 64]
  10097. *
  10098. * _.map({ 'a': 4, 'b': 8 }, square);
  10099. * // => [16, 64] (iteration order is not guaranteed)
  10100. *
  10101. * var users = [
  10102. * { 'user': 'barney' },
  10103. * { 'user': 'fred' }
  10104. * ];
  10105. *
  10106. * // The `_.property` iteratee shorthand.
  10107. * _.map(users, 'user');
  10108. * // => ['barney', 'fred']
  10109. */
  10110. function map(collection, iteratee) {
  10111. var func = isArray(collection) ? arrayMap : baseMap;
  10112. return func(collection, getIteratee(iteratee, 3));
  10113. }
  10114. /**
  10115. * This method is like `_.sortBy` except that it allows specifying the sort
  10116. * orders of the iteratees to sort by. If `orders` is unspecified, all values
  10117. * are sorted in ascending order. Otherwise, specify an order of "desc" for
  10118. * descending or "asc" for ascending sort order of corresponding values.
  10119. *
  10120. * @static
  10121. * @memberOf _
  10122. * @since 4.0.0
  10123. * @category Collection
  10124. * @param {Array|Object} collection The collection to iterate over.
  10125. * @param {Array[]|Function[]|Object[]|string[]} [iteratees=[_.identity]]
  10126. * The iteratees to sort by.
  10127. * @param {string[]} [orders] The sort orders of `iteratees`.
  10128. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.reduce`.
  10129. * @returns {Array} Returns the new sorted array.
  10130. * @example
  10131. *
  10132. * var users = [
  10133. * { 'user': 'fred', 'age': 48 },
  10134. * { 'user': 'barney', 'age': 34 },
  10135. * { 'user': 'fred', 'age': 40 },
  10136. * { 'user': 'barney', 'age': 36 }
  10137. * ];
  10138. *
  10139. * // Sort by `user` in ascending order and by `age` in descending order.
  10140. * _.orderBy(users, ['user', 'age'], ['asc', 'desc']);
  10141. * // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 40]]
  10142. */
  10143. function orderBy(collection, iteratees, orders, guard) {
  10144. if (collection == null) {
  10145. return [];
  10146. }
  10147. if (!isArray(iteratees)) {
  10148. iteratees = iteratees == null ? [] : [iteratees];
  10149. }
  10150. orders = guard ? undefined : orders;
  10151. if (!isArray(orders)) {
  10152. orders = orders == null ? [] : [orders];
  10153. }
  10154. return baseOrderBy(collection, iteratees, orders);
  10155. }
  10156. /**
  10157. * Creates an array of elements split into two groups, the first of which
  10158. * contains elements `predicate` returns truthy for, the second of which
  10159. * contains elements `predicate` returns falsey for. The predicate is
  10160. * invoked with one argument: (value).
  10161. *
  10162. * @static
  10163. * @memberOf _
  10164. * @since 3.0.0
  10165. * @category Collection
  10166. * @param {Array|Object} collection The collection to iterate over.
  10167. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  10168. * @returns {Array} Returns the array of grouped elements.
  10169. * @example
  10170. *
  10171. * var users = [
  10172. * { 'user': 'barney', 'age': 36, 'active': false },
  10173. * { 'user': 'fred', 'age': 40, 'active': true },
  10174. * { 'user': 'pebbles', 'age': 1, 'active': false }
  10175. * ];
  10176. *
  10177. * _.partition(users, function(o) { return o.active; });
  10178. * // => objects for [['fred'], ['barney', 'pebbles']]
  10179. *
  10180. * // The `_.matches` iteratee shorthand.
  10181. * _.partition(users, { 'age': 1, 'active': false });
  10182. * // => objects for [['pebbles'], ['barney', 'fred']]
  10183. *
  10184. * // The `_.matchesProperty` iteratee shorthand.
  10185. * _.partition(users, ['active', false]);
  10186. * // => objects for [['barney', 'pebbles'], ['fred']]
  10187. *
  10188. * // The `_.property` iteratee shorthand.
  10189. * _.partition(users, 'active');
  10190. * // => objects for [['fred'], ['barney', 'pebbles']]
  10191. */
  10192. var partition = createAggregator(function(result, value, key) {
  10193. result[key ? 0 : 1].push(value);
  10194. }, function() { return [[], []]; });
  10195. /**
  10196. * Reduces `collection` to a value which is the accumulated result of running
  10197. * each element in `collection` thru `iteratee`, where each successive
  10198. * invocation is supplied the return value of the previous. If `accumulator`
  10199. * is not given, the first element of `collection` is used as the initial
  10200. * value. The iteratee is invoked with four arguments:
  10201. * (accumulator, value, index|key, collection).
  10202. *
  10203. * Many lodash methods are guarded to work as iteratees for methods like
  10204. * `_.reduce`, `_.reduceRight`, and `_.transform`.
  10205. *
  10206. * The guarded methods are:
  10207. * `assign`, `defaults`, `defaultsDeep`, `includes`, `merge`, `orderBy`,
  10208. * and `sortBy`
  10209. *
  10210. * @static
  10211. * @memberOf _
  10212. * @since 0.1.0
  10213. * @category Collection
  10214. * @param {Array|Object} collection The collection to iterate over.
  10215. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  10216. * @param {*} [accumulator] The initial value.
  10217. * @returns {*} Returns the accumulated value.
  10218. * @see _.reduceRight
  10219. * @example
  10220. *
  10221. * _.reduce([1, 2], function(sum, n) {
  10222. * return sum + n;
  10223. * }, 0);
  10224. * // => 3
  10225. *
  10226. * _.reduce({ 'a': 1, 'b': 2, 'c': 1 }, function(result, value, key) {
  10227. * (result[value] || (result[value] = [])).push(key);
  10228. * return result;
  10229. * }, {});
  10230. * // => { '1': ['a', 'c'], '2': ['b'] } (iteration order is not guaranteed)
  10231. */
  10232. function reduce(collection, iteratee, accumulator) {
  10233. var func = isArray(collection) ? arrayReduce : baseReduce,
  10234. initAccum = arguments.length < 3;
  10235. return func(collection, getIteratee(iteratee, 4), accumulator, initAccum, baseEach);
  10236. }
  10237. /**
  10238. * This method is like `_.reduce` except that it iterates over elements of
  10239. * `collection` from right to left.
  10240. *
  10241. * @static
  10242. * @memberOf _
  10243. * @since 0.1.0
  10244. * @category Collection
  10245. * @param {Array|Object} collection The collection to iterate over.
  10246. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  10247. * @param {*} [accumulator] The initial value.
  10248. * @returns {*} Returns the accumulated value.
  10249. * @see _.reduce
  10250. * @example
  10251. *
  10252. * var array = [[0, 1], [2, 3], [4, 5]];
  10253. *
  10254. * _.reduceRight(array, function(flattened, other) {
  10255. * return flattened.concat(other);
  10256. * }, []);
  10257. * // => [4, 5, 2, 3, 0, 1]
  10258. */
  10259. function reduceRight(collection, iteratee, accumulator) {
  10260. var func = isArray(collection) ? arrayReduceRight : baseReduce,
  10261. initAccum = arguments.length < 3;
  10262. return func(collection, getIteratee(iteratee, 4), accumulator, initAccum, baseEachRight);
  10263. }
  10264. /**
  10265. * The opposite of `_.filter`; this method returns the elements of `collection`
  10266. * that `predicate` does **not** return truthy for.
  10267. *
  10268. * @static
  10269. * @memberOf _
  10270. * @since 0.1.0
  10271. * @category Collection
  10272. * @param {Array|Object} collection The collection to iterate over.
  10273. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  10274. * @returns {Array} Returns the new filtered array.
  10275. * @see _.filter
  10276. * @example
  10277. *
  10278. * var users = [
  10279. * { 'user': 'barney', 'age': 36, 'active': false },
  10280. * { 'user': 'fred', 'age': 40, 'active': true }
  10281. * ];
  10282. *
  10283. * _.reject(users, function(o) { return !o.active; });
  10284. * // => objects for ['fred']
  10285. *
  10286. * // The `_.matches` iteratee shorthand.
  10287. * _.reject(users, { 'age': 40, 'active': true });
  10288. * // => objects for ['barney']
  10289. *
  10290. * // The `_.matchesProperty` iteratee shorthand.
  10291. * _.reject(users, ['active', false]);
  10292. * // => objects for ['fred']
  10293. *
  10294. * // The `_.property` iteratee shorthand.
  10295. * _.reject(users, 'active');
  10296. * // => objects for ['barney']
  10297. */
  10298. function reject(collection, predicate) {
  10299. var func = isArray(collection) ? arrayFilter : baseFilter;
  10300. return func(collection, negate(getIteratee(predicate, 3)));
  10301. }
  10302. /**
  10303. * Gets a random element from `collection`.
  10304. *
  10305. * @static
  10306. * @memberOf _
  10307. * @since 2.0.0
  10308. * @category Collection
  10309. * @param {Array|Object} collection The collection to sample.
  10310. * @returns {*} Returns the random element.
  10311. * @example
  10312. *
  10313. * _.sample([1, 2, 3, 4]);
  10314. * // => 2
  10315. */
  10316. function sample(collection) {
  10317. var func = isArray(collection) ? arraySample : baseSample;
  10318. return func(collection);
  10319. }
  10320. /**
  10321. * Gets `n` random elements at unique keys from `collection` up to the
  10322. * size of `collection`.
  10323. *
  10324. * @static
  10325. * @memberOf _
  10326. * @since 4.0.0
  10327. * @category Collection
  10328. * @param {Array|Object} collection The collection to sample.
  10329. * @param {number} [n=1] The number of elements to sample.
  10330. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  10331. * @returns {Array} Returns the random elements.
  10332. * @example
  10333. *
  10334. * _.sampleSize([1, 2, 3], 2);
  10335. * // => [3, 1]
  10336. *
  10337. * _.sampleSize([1, 2, 3], 4);
  10338. * // => [2, 3, 1]
  10339. */
  10340. function sampleSize(collection, n, guard) {
  10341. if ((guard ? isIterateeCall(collection, n, guard) : n === undefined)) {
  10342. n = 1;
  10343. } else {
  10344. n = toInteger(n);
  10345. }
  10346. var func = isArray(collection) ? arraySampleSize : baseSampleSize;
  10347. return func(collection, n);
  10348. }
  10349. /**
  10350. * Creates an array of shuffled values, using a version of the
  10351. * [Fisher-Yates shuffle](https://en.wikipedia.org/wiki/Fisher-Yates_shuffle).
  10352. *
  10353. * @static
  10354. * @memberOf _
  10355. * @since 0.1.0
  10356. * @category Collection
  10357. * @param {Array|Object} collection The collection to shuffle.
  10358. * @returns {Array} Returns the new shuffled array.
  10359. * @example
  10360. *
  10361. * _.shuffle([1, 2, 3, 4]);
  10362. * // => [4, 1, 3, 2]
  10363. */
  10364. function shuffle(collection) {
  10365. var func = isArray(collection) ? arrayShuffle : baseShuffle;
  10366. return func(collection);
  10367. }
  10368. /**
  10369. * Gets the size of `collection` by returning its length for array-like
  10370. * values or the number of own enumerable string keyed properties for objects.
  10371. *
  10372. * @static
  10373. * @memberOf _
  10374. * @since 0.1.0
  10375. * @category Collection
  10376. * @param {Array|Object|string} collection The collection to inspect.
  10377. * @returns {number} Returns the collection size.
  10378. * @example
  10379. *
  10380. * _.size([1, 2, 3]);
  10381. * // => 3
  10382. *
  10383. * _.size({ 'a': 1, 'b': 2 });
  10384. * // => 2
  10385. *
  10386. * _.size('pebbles');
  10387. * // => 7
  10388. */
  10389. function size(collection) {
  10390. if (collection == null) {
  10391. return 0;
  10392. }
  10393. if (isArrayLike(collection)) {
  10394. return isString(collection) ? stringSize(collection) : collection.length;
  10395. }
  10396. var tag = getTag(collection);
  10397. if (tag == mapTag || tag == setTag) {
  10398. return collection.size;
  10399. }
  10400. return baseKeys(collection).length;
  10401. }
  10402. /**
  10403. * Checks if `predicate` returns truthy for **any** element of `collection`.
  10404. * Iteration is stopped once `predicate` returns truthy. The predicate is
  10405. * invoked with three arguments: (value, index|key, collection).
  10406. *
  10407. * @static
  10408. * @memberOf _
  10409. * @since 0.1.0
  10410. * @category Collection
  10411. * @param {Array|Object} collection The collection to iterate over.
  10412. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  10413. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  10414. * @returns {boolean} Returns `true` if any element passes the predicate check,
  10415. * else `false`.
  10416. * @example
  10417. *
  10418. * _.some([null, 0, 'yes', false], Boolean);
  10419. * // => true
  10420. *
  10421. * var users = [
  10422. * { 'user': 'barney', 'active': true },
  10423. * { 'user': 'fred', 'active': false }
  10424. * ];
  10425. *
  10426. * // The `_.matches` iteratee shorthand.
  10427. * _.some(users, { 'user': 'barney', 'active': false });
  10428. * // => false
  10429. *
  10430. * // The `_.matchesProperty` iteratee shorthand.
  10431. * _.some(users, ['active', false]);
  10432. * // => true
  10433. *
  10434. * // The `_.property` iteratee shorthand.
  10435. * _.some(users, 'active');
  10436. * // => true
  10437. */
  10438. function some(collection, predicate, guard) {
  10439. var func = isArray(collection) ? arraySome : baseSome;
  10440. if (guard && isIterateeCall(collection, predicate, guard)) {
  10441. predicate = undefined;
  10442. }
  10443. return func(collection, getIteratee(predicate, 3));
  10444. }
  10445. /**
  10446. * Creates an array of elements, sorted in ascending order by the results of
  10447. * running each element in a collection thru each iteratee. This method
  10448. * performs a stable sort, that is, it preserves the original sort order of
  10449. * equal elements. The iteratees are invoked with one argument: (value).
  10450. *
  10451. * @static
  10452. * @memberOf _
  10453. * @since 0.1.0
  10454. * @category Collection
  10455. * @param {Array|Object} collection The collection to iterate over.
  10456. * @param {...(Function|Function[])} [iteratees=[_.identity]]
  10457. * The iteratees to sort by.
  10458. * @returns {Array} Returns the new sorted array.
  10459. * @example
  10460. *
  10461. * var users = [
  10462. * { 'user': 'fred', 'age': 48 },
  10463. * { 'user': 'barney', 'age': 36 },
  10464. * { 'user': 'fred', 'age': 30 },
  10465. * { 'user': 'barney', 'age': 34 }
  10466. * ];
  10467. *
  10468. * _.sortBy(users, [function(o) { return o.user; }]);
  10469. * // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 30]]
  10470. *
  10471. * _.sortBy(users, ['user', 'age']);
  10472. * // => objects for [['barney', 34], ['barney', 36], ['fred', 30], ['fred', 48]]
  10473. */
  10474. var sortBy = baseRest(function(collection, iteratees) {
  10475. if (collection == null) {
  10476. return [];
  10477. }
  10478. var length = iteratees.length;
  10479. if (length > 1 && isIterateeCall(collection, iteratees[0], iteratees[1])) {
  10480. iteratees = [];
  10481. } else if (length > 2 && isIterateeCall(iteratees[0], iteratees[1], iteratees[2])) {
  10482. iteratees = [iteratees[0]];
  10483. }
  10484. return baseOrderBy(collection, baseFlatten(iteratees, 1), []);
  10485. });
  10486. /*------------------------------------------------------------------------*/
  10487. /**
  10488. * Gets the timestamp of the number of milliseconds that have elapsed since
  10489. * the Unix epoch (1 January 1970 00:00:00 UTC).
  10490. *
  10491. * @static
  10492. * @memberOf _
  10493. * @since 2.4.0
  10494. * @category Date
  10495. * @returns {number} Returns the timestamp.
  10496. * @example
  10497. *
  10498. * _.defer(function(stamp) {
  10499. * console.log(_.now() - stamp);
  10500. * }, _.now());
  10501. * // => Logs the number of milliseconds it took for the deferred invocation.
  10502. */
  10503. var now = ctxNow || function() {
  10504. return root.Date.now();
  10505. };
  10506. /*------------------------------------------------------------------------*/
  10507. /**
  10508. * The opposite of `_.before`; this method creates a function that invokes
  10509. * `func` once it's called `n` or more times.
  10510. *
  10511. * @static
  10512. * @memberOf _
  10513. * @since 0.1.0
  10514. * @category Function
  10515. * @param {number} n The number of calls before `func` is invoked.
  10516. * @param {Function} func The function to restrict.
  10517. * @returns {Function} Returns the new restricted function.
  10518. * @example
  10519. *
  10520. * var saves = ['profile', 'settings'];
  10521. *
  10522. * var done = _.after(saves.length, function() {
  10523. * console.log('done saving!');
  10524. * });
  10525. *
  10526. * _.forEach(saves, function(type) {
  10527. * asyncSave({ 'type': type, 'complete': done });
  10528. * });
  10529. * // => Logs 'done saving!' after the two async saves have completed.
  10530. */
  10531. function after(n, func) {
  10532. if (typeof func != 'function') {
  10533. throw new TypeError(FUNC_ERROR_TEXT);
  10534. }
  10535. n = toInteger(n);
  10536. return function() {
  10537. if (--n < 1) {
  10538. return func.apply(this, arguments);
  10539. }
  10540. };
  10541. }
  10542. /**
  10543. * Creates a function that invokes `func`, with up to `n` arguments,
  10544. * ignoring any additional arguments.
  10545. *
  10546. * @static
  10547. * @memberOf _
  10548. * @since 3.0.0
  10549. * @category Function
  10550. * @param {Function} func The function to cap arguments for.
  10551. * @param {number} [n=func.length] The arity cap.
  10552. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  10553. * @returns {Function} Returns the new capped function.
  10554. * @example
  10555. *
  10556. * _.map(['6', '8', '10'], _.ary(parseInt, 1));
  10557. * // => [6, 8, 10]
  10558. */
  10559. function ary(func, n, guard) {
  10560. n = guard ? undefined : n;
  10561. n = (func && n == null) ? func.length : n;
  10562. return createWrap(func, WRAP_ARY_FLAG, undefined, undefined, undefined, undefined, n);
  10563. }
  10564. /**
  10565. * Creates a function that invokes `func`, with the `this` binding and arguments
  10566. * of the created function, while it's called less than `n` times. Subsequent
  10567. * calls to the created function return the result of the last `func` invocation.
  10568. *
  10569. * @static
  10570. * @memberOf _
  10571. * @since 3.0.0
  10572. * @category Function
  10573. * @param {number} n The number of calls at which `func` is no longer invoked.
  10574. * @param {Function} func The function to restrict.
  10575. * @returns {Function} Returns the new restricted function.
  10576. * @example
  10577. *
  10578. * jQuery(element).on('click', _.before(5, addContactToList));
  10579. * // => Allows adding up to 4 contacts to the list.
  10580. */
  10581. function before(n, func) {
  10582. var result;
  10583. if (typeof func != 'function') {
  10584. throw new TypeError(FUNC_ERROR_TEXT);
  10585. }
  10586. n = toInteger(n);
  10587. return function() {
  10588. if (--n > 0) {
  10589. result = func.apply(this, arguments);
  10590. }
  10591. if (n <= 1) {
  10592. func = undefined;
  10593. }
  10594. return result;
  10595. };
  10596. }
  10597. /**
  10598. * Creates a function that invokes `func` with the `this` binding of `thisArg`
  10599. * and `partials` prepended to the arguments it receives.
  10600. *
  10601. * The `_.bind.placeholder` value, which defaults to `_` in monolithic builds,
  10602. * may be used as a placeholder for partially applied arguments.
  10603. *
  10604. * **Note:** Unlike native `Function#bind`, this method doesn't set the "length"
  10605. * property of bound functions.
  10606. *
  10607. * @static
  10608. * @memberOf _
  10609. * @since 0.1.0
  10610. * @category Function
  10611. * @param {Function} func The function to bind.
  10612. * @param {*} thisArg The `this` binding of `func`.
  10613. * @param {...*} [partials] The arguments to be partially applied.
  10614. * @returns {Function} Returns the new bound function.
  10615. * @example
  10616. *
  10617. * function greet(greeting, punctuation) {
  10618. * return greeting + ' ' + this.user + punctuation;
  10619. * }
  10620. *
  10621. * var object = { 'user': 'fred' };
  10622. *
  10623. * var bound = _.bind(greet, object, 'hi');
  10624. * bound('!');
  10625. * // => 'hi fred!'
  10626. *
  10627. * // Bound with placeholders.
  10628. * var bound = _.bind(greet, object, _, '!');
  10629. * bound('hi');
  10630. * // => 'hi fred!'
  10631. */
  10632. var bind = baseRest(function(func, thisArg, partials) {
  10633. var bitmask = WRAP_BIND_FLAG;
  10634. if (partials.length) {
  10635. var holders = replaceHolders(partials, getHolder(bind));
  10636. bitmask |= WRAP_PARTIAL_FLAG;
  10637. }
  10638. return createWrap(func, bitmask, thisArg, partials, holders);
  10639. });
  10640. /**
  10641. * Creates a function that invokes the method at `object[key]` with `partials`
  10642. * prepended to the arguments it receives.
  10643. *
  10644. * This method differs from `_.bind` by allowing bound functions to reference
  10645. * methods that may be redefined or don't yet exist. See
  10646. * [Peter Michaux's article](http://peter.michaux.ca/articles/lazy-function-definition-pattern)
  10647. * for more details.
  10648. *
  10649. * The `_.bindKey.placeholder` value, which defaults to `_` in monolithic
  10650. * builds, may be used as a placeholder for partially applied arguments.
  10651. *
  10652. * @static
  10653. * @memberOf _
  10654. * @since 0.10.0
  10655. * @category Function
  10656. * @param {Object} object The object to invoke the method on.
  10657. * @param {string} key The key of the method.
  10658. * @param {...*} [partials] The arguments to be partially applied.
  10659. * @returns {Function} Returns the new bound function.
  10660. * @example
  10661. *
  10662. * var object = {
  10663. * 'user': 'fred',
  10664. * 'greet': function(greeting, punctuation) {
  10665. * return greeting + ' ' + this.user + punctuation;
  10666. * }
  10667. * };
  10668. *
  10669. * var bound = _.bindKey(object, 'greet', 'hi');
  10670. * bound('!');
  10671. * // => 'hi fred!'
  10672. *
  10673. * object.greet = function(greeting, punctuation) {
  10674. * return greeting + 'ya ' + this.user + punctuation;
  10675. * };
  10676. *
  10677. * bound('!');
  10678. * // => 'hiya fred!'
  10679. *
  10680. * // Bound with placeholders.
  10681. * var bound = _.bindKey(object, 'greet', _, '!');
  10682. * bound('hi');
  10683. * // => 'hiya fred!'
  10684. */
  10685. var bindKey = baseRest(function(object, key, partials) {
  10686. var bitmask = WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG;
  10687. if (partials.length) {
  10688. var holders = replaceHolders(partials, getHolder(bindKey));
  10689. bitmask |= WRAP_PARTIAL_FLAG;
  10690. }
  10691. return createWrap(key, bitmask, object, partials, holders);
  10692. });
  10693. /**
  10694. * Creates a function that accepts arguments of `func` and either invokes
  10695. * `func` returning its result, if at least `arity` number of arguments have
  10696. * been provided, or returns a function that accepts the remaining `func`
  10697. * arguments, and so on. The arity of `func` may be specified if `func.length`
  10698. * is not sufficient.
  10699. *
  10700. * The `_.curry.placeholder` value, which defaults to `_` in monolithic builds,
  10701. * may be used as a placeholder for provided arguments.
  10702. *
  10703. * **Note:** This method doesn't set the "length" property of curried functions.
  10704. *
  10705. * @static
  10706. * @memberOf _
  10707. * @since 2.0.0
  10708. * @category Function
  10709. * @param {Function} func The function to curry.
  10710. * @param {number} [arity=func.length] The arity of `func`.
  10711. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  10712. * @returns {Function} Returns the new curried function.
  10713. * @example
  10714. *
  10715. * var abc = function(a, b, c) {
  10716. * return [a, b, c];
  10717. * };
  10718. *
  10719. * var curried = _.curry(abc);
  10720. *
  10721. * curried(1)(2)(3);
  10722. * // => [1, 2, 3]
  10723. *
  10724. * curried(1, 2)(3);
  10725. * // => [1, 2, 3]
  10726. *
  10727. * curried(1, 2, 3);
  10728. * // => [1, 2, 3]
  10729. *
  10730. * // Curried with placeholders.
  10731. * curried(1)(_, 3)(2);
  10732. * // => [1, 2, 3]
  10733. */
  10734. function curry(func, arity, guard) {
  10735. arity = guard ? undefined : arity;
  10736. var result = createWrap(func, WRAP_CURRY_FLAG, undefined, undefined, undefined, undefined, undefined, arity);
  10737. result.placeholder = curry.placeholder;
  10738. return result;
  10739. }
  10740. /**
  10741. * This method is like `_.curry` except that arguments are applied to `func`
  10742. * in the manner of `_.partialRight` instead of `_.partial`.
  10743. *
  10744. * The `_.curryRight.placeholder` value, which defaults to `_` in monolithic
  10745. * builds, may be used as a placeholder for provided arguments.
  10746. *
  10747. * **Note:** This method doesn't set the "length" property of curried functions.
  10748. *
  10749. * @static
  10750. * @memberOf _
  10751. * @since 3.0.0
  10752. * @category Function
  10753. * @param {Function} func The function to curry.
  10754. * @param {number} [arity=func.length] The arity of `func`.
  10755. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  10756. * @returns {Function} Returns the new curried function.
  10757. * @example
  10758. *
  10759. * var abc = function(a, b, c) {
  10760. * return [a, b, c];
  10761. * };
  10762. *
  10763. * var curried = _.curryRight(abc);
  10764. *
  10765. * curried(3)(2)(1);
  10766. * // => [1, 2, 3]
  10767. *
  10768. * curried(2, 3)(1);
  10769. * // => [1, 2, 3]
  10770. *
  10771. * curried(1, 2, 3);
  10772. * // => [1, 2, 3]
  10773. *
  10774. * // Curried with placeholders.
  10775. * curried(3)(1, _)(2);
  10776. * // => [1, 2, 3]
  10777. */
  10778. function curryRight(func, arity, guard) {
  10779. arity = guard ? undefined : arity;
  10780. var result = createWrap(func, WRAP_CURRY_RIGHT_FLAG, undefined, undefined, undefined, undefined, undefined, arity);
  10781. result.placeholder = curryRight.placeholder;
  10782. return result;
  10783. }
  10784. /**
  10785. * Creates a debounced function that delays invoking `func` until after `wait`
  10786. * milliseconds have elapsed since the last time the debounced function was
  10787. * invoked. The debounced function comes with a `cancel` method to cancel
  10788. * delayed `func` invocations and a `flush` method to immediately invoke them.
  10789. * Provide `options` to indicate whether `func` should be invoked on the
  10790. * leading and/or trailing edge of the `wait` timeout. The `func` is invoked
  10791. * with the last arguments provided to the debounced function. Subsequent
  10792. * calls to the debounced function return the result of the last `func`
  10793. * invocation.
  10794. *
  10795. * **Note:** If `leading` and `trailing` options are `true`, `func` is
  10796. * invoked on the trailing edge of the timeout only if the debounced function
  10797. * is invoked more than once during the `wait` timeout.
  10798. *
  10799. * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred
  10800. * until to the next tick, similar to `setTimeout` with a timeout of `0`.
  10801. *
  10802. * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/)
  10803. * for details over the differences between `_.debounce` and `_.throttle`.
  10804. *
  10805. * @static
  10806. * @memberOf _
  10807. * @since 0.1.0
  10808. * @category Function
  10809. * @param {Function} func The function to debounce.
  10810. * @param {number} [wait=0] The number of milliseconds to delay.
  10811. * @param {Object} [options={}] The options object.
  10812. * @param {boolean} [options.leading=false]
  10813. * Specify invoking on the leading edge of the timeout.
  10814. * @param {number} [options.maxWait]
  10815. * The maximum time `func` is allowed to be delayed before it's invoked.
  10816. * @param {boolean} [options.trailing=true]
  10817. * Specify invoking on the trailing edge of the timeout.
  10818. * @returns {Function} Returns the new debounced function.
  10819. * @example
  10820. *
  10821. * // Avoid costly calculations while the window size is in flux.
  10822. * jQuery(window).on('resize', _.debounce(calculateLayout, 150));
  10823. *
  10824. * // Invoke `sendMail` when clicked, debouncing subsequent calls.
  10825. * jQuery(element).on('click', _.debounce(sendMail, 300, {
  10826. * 'leading': true,
  10827. * 'trailing': false
  10828. * }));
  10829. *
  10830. * // Ensure `batchLog` is invoked once after 1 second of debounced calls.
  10831. * var debounced = _.debounce(batchLog, 250, { 'maxWait': 1000 });
  10832. * var source = new EventSource('/stream');
  10833. * jQuery(source).on('message', debounced);
  10834. *
  10835. * // Cancel the trailing debounced invocation.
  10836. * jQuery(window).on('popstate', debounced.cancel);
  10837. */
  10838. function debounce(func, wait, options) {
  10839. var lastArgs,
  10840. lastThis,
  10841. maxWait,
  10842. result,
  10843. timerId,
  10844. lastCallTime,
  10845. lastInvokeTime = 0,
  10846. leading = false,
  10847. maxing = false,
  10848. trailing = true;
  10849. if (typeof func != 'function') {
  10850. throw new TypeError(FUNC_ERROR_TEXT);
  10851. }
  10852. wait = toNumber(wait) || 0;
  10853. if (isObject(options)) {
  10854. leading = !!options.leading;
  10855. maxing = 'maxWait' in options;
  10856. maxWait = maxing ? nativeMax(toNumber(options.maxWait) || 0, wait) : maxWait;
  10857. trailing = 'trailing' in options ? !!options.trailing : trailing;
  10858. }
  10859. function invokeFunc(time) {
  10860. var args = lastArgs,
  10861. thisArg = lastThis;
  10862. lastArgs = lastThis = undefined;
  10863. lastInvokeTime = time;
  10864. result = func.apply(thisArg, args);
  10865. return result;
  10866. }
  10867. function leadingEdge(time) {
  10868. // Reset any `maxWait` timer.
  10869. lastInvokeTime = time;
  10870. // Start the timer for the trailing edge.
  10871. timerId = setTimeout(timerExpired, wait);
  10872. // Invoke the leading edge.
  10873. return leading ? invokeFunc(time) : result;
  10874. }
  10875. function remainingWait(time) {
  10876. var timeSinceLastCall = time - lastCallTime,
  10877. timeSinceLastInvoke = time - lastInvokeTime,
  10878. timeWaiting = wait - timeSinceLastCall;
  10879. return maxing
  10880. ? nativeMin(timeWaiting, maxWait - timeSinceLastInvoke)
  10881. : timeWaiting;
  10882. }
  10883. function shouldInvoke(time) {
  10884. var timeSinceLastCall = time - lastCallTime,
  10885. timeSinceLastInvoke = time - lastInvokeTime;
  10886. // Either this is the first call, activity has stopped and we're at the
  10887. // trailing edge, the system time has gone backwards and we're treating
  10888. // it as the trailing edge, or we've hit the `maxWait` limit.
  10889. return (lastCallTime === undefined || (timeSinceLastCall >= wait) ||
  10890. (timeSinceLastCall < 0) || (maxing && timeSinceLastInvoke >= maxWait));
  10891. }
  10892. function timerExpired() {
  10893. var time = now();
  10894. if (shouldInvoke(time)) {
  10895. return trailingEdge(time);
  10896. }
  10897. // Restart the timer.
  10898. timerId = setTimeout(timerExpired, remainingWait(time));
  10899. }
  10900. function trailingEdge(time) {
  10901. timerId = undefined;
  10902. // Only invoke if we have `lastArgs` which means `func` has been
  10903. // debounced at least once.
  10904. if (trailing && lastArgs) {
  10905. return invokeFunc(time);
  10906. }
  10907. lastArgs = lastThis = undefined;
  10908. return result;
  10909. }
  10910. function cancel() {
  10911. if (timerId !== undefined) {
  10912. clearTimeout(timerId);
  10913. }
  10914. lastInvokeTime = 0;
  10915. lastArgs = lastCallTime = lastThis = timerId = undefined;
  10916. }
  10917. function flush() {
  10918. return timerId === undefined ? result : trailingEdge(now());
  10919. }
  10920. function debounced() {
  10921. var time = now(),
  10922. isInvoking = shouldInvoke(time);
  10923. lastArgs = arguments;
  10924. lastThis = this;
  10925. lastCallTime = time;
  10926. if (isInvoking) {
  10927. if (timerId === undefined) {
  10928. return leadingEdge(lastCallTime);
  10929. }
  10930. if (maxing) {
  10931. // Handle invocations in a tight loop.
  10932. clearTimeout(timerId);
  10933. timerId = setTimeout(timerExpired, wait);
  10934. return invokeFunc(lastCallTime);
  10935. }
  10936. }
  10937. if (timerId === undefined) {
  10938. timerId = setTimeout(timerExpired, wait);
  10939. }
  10940. return result;
  10941. }
  10942. debounced.cancel = cancel;
  10943. debounced.flush = flush;
  10944. return debounced;
  10945. }
  10946. /**
  10947. * Defers invoking the `func` until the current call stack has cleared. Any
  10948. * additional arguments are provided to `func` when it's invoked.
  10949. *
  10950. * @static
  10951. * @memberOf _
  10952. * @since 0.1.0
  10953. * @category Function
  10954. * @param {Function} func The function to defer.
  10955. * @param {...*} [args] The arguments to invoke `func` with.
  10956. * @returns {number} Returns the timer id.
  10957. * @example
  10958. *
  10959. * _.defer(function(text) {
  10960. * console.log(text);
  10961. * }, 'deferred');
  10962. * // => Logs 'deferred' after one millisecond.
  10963. */
  10964. var defer = baseRest(function(func, args) {
  10965. return baseDelay(func, 1, args);
  10966. });
  10967. /**
  10968. * Invokes `func` after `wait` milliseconds. Any additional arguments are
  10969. * provided to `func` when it's invoked.
  10970. *
  10971. * @static
  10972. * @memberOf _
  10973. * @since 0.1.0
  10974. * @category Function
  10975. * @param {Function} func The function to delay.
  10976. * @param {number} wait The number of milliseconds to delay invocation.
  10977. * @param {...*} [args] The arguments to invoke `func` with.
  10978. * @returns {number} Returns the timer id.
  10979. * @example
  10980. *
  10981. * _.delay(function(text) {
  10982. * console.log(text);
  10983. * }, 1000, 'later');
  10984. * // => Logs 'later' after one second.
  10985. */
  10986. var delay = baseRest(function(func, wait, args) {
  10987. return baseDelay(func, toNumber(wait) || 0, args);
  10988. });
  10989. /**
  10990. * Creates a function that invokes `func` with arguments reversed.
  10991. *
  10992. * @static
  10993. * @memberOf _
  10994. * @since 4.0.0
  10995. * @category Function
  10996. * @param {Function} func The function to flip arguments for.
  10997. * @returns {Function} Returns the new flipped function.
  10998. * @example
  10999. *
  11000. * var flipped = _.flip(function() {
  11001. * return _.toArray(arguments);
  11002. * });
  11003. *
  11004. * flipped('a', 'b', 'c', 'd');
  11005. * // => ['d', 'c', 'b', 'a']
  11006. */
  11007. function flip(func) {
  11008. return createWrap(func, WRAP_FLIP_FLAG);
  11009. }
  11010. /**
  11011. * Creates a function that memoizes the result of `func`. If `resolver` is
  11012. * provided, it determines the cache key for storing the result based on the
  11013. * arguments provided to the memoized function. By default, the first argument
  11014. * provided to the memoized function is used as the map cache key. The `func`
  11015. * is invoked with the `this` binding of the memoized function.
  11016. *
  11017. * **Note:** The cache is exposed as the `cache` property on the memoized
  11018. * function. Its creation may be customized by replacing the `_.memoize.Cache`
  11019. * constructor with one whose instances implement the
  11020. * [`Map`](http://ecma-international.org/ecma-262/7.0/#sec-properties-of-the-map-prototype-object)
  11021. * method interface of `clear`, `delete`, `get`, `has`, and `set`.
  11022. *
  11023. * @static
  11024. * @memberOf _
  11025. * @since 0.1.0
  11026. * @category Function
  11027. * @param {Function} func The function to have its output memoized.
  11028. * @param {Function} [resolver] The function to resolve the cache key.
  11029. * @returns {Function} Returns the new memoized function.
  11030. * @example
  11031. *
  11032. * var object = { 'a': 1, 'b': 2 };
  11033. * var other = { 'c': 3, 'd': 4 };
  11034. *
  11035. * var values = _.memoize(_.values);
  11036. * values(object);
  11037. * // => [1, 2]
  11038. *
  11039. * values(other);
  11040. * // => [3, 4]
  11041. *
  11042. * object.a = 2;
  11043. * values(object);
  11044. * // => [1, 2]
  11045. *
  11046. * // Modify the result cache.
  11047. * values.cache.set(object, ['a', 'b']);
  11048. * values(object);
  11049. * // => ['a', 'b']
  11050. *
  11051. * // Replace `_.memoize.Cache`.
  11052. * _.memoize.Cache = WeakMap;
  11053. */
  11054. function memoize(func, resolver) {
  11055. if (typeof func != 'function' || (resolver != null && typeof resolver != 'function')) {
  11056. throw new TypeError(FUNC_ERROR_TEXT);
  11057. }
  11058. var memoized = function() {
  11059. var args = arguments,
  11060. key = resolver ? resolver.apply(this, args) : args[0],
  11061. cache = memoized.cache;
  11062. if (cache.has(key)) {
  11063. return cache.get(key);
  11064. }
  11065. var result = func.apply(this, args);
  11066. memoized.cache = cache.set(key, result) || cache;
  11067. return result;
  11068. };
  11069. memoized.cache = new (memoize.Cache || MapCache);
  11070. return memoized;
  11071. }
  11072. // Expose `MapCache`.
  11073. memoize.Cache = MapCache;
  11074. /**
  11075. * Creates a function that negates the result of the predicate `func`. The
  11076. * `func` predicate is invoked with the `this` binding and arguments of the
  11077. * created function.
  11078. *
  11079. * @static
  11080. * @memberOf _
  11081. * @since 3.0.0
  11082. * @category Function
  11083. * @param {Function} predicate The predicate to negate.
  11084. * @returns {Function} Returns the new negated function.
  11085. * @example
  11086. *
  11087. * function isEven(n) {
  11088. * return n % 2 == 0;
  11089. * }
  11090. *
  11091. * _.filter([1, 2, 3, 4, 5, 6], _.negate(isEven));
  11092. * // => [1, 3, 5]
  11093. */
  11094. function negate(predicate) {
  11095. if (typeof predicate != 'function') {
  11096. throw new TypeError(FUNC_ERROR_TEXT);
  11097. }
  11098. return function() {
  11099. var args = arguments;
  11100. switch (args.length) {
  11101. case 0: return !predicate.call(this);
  11102. case 1: return !predicate.call(this, args[0]);
  11103. case 2: return !predicate.call(this, args[0], args[1]);
  11104. case 3: return !predicate.call(this, args[0], args[1], args[2]);
  11105. }
  11106. return !predicate.apply(this, args);
  11107. };
  11108. }
  11109. /**
  11110. * Creates a function that is restricted to invoking `func` once. Repeat calls
  11111. * to the function return the value of the first invocation. The `func` is
  11112. * invoked with the `this` binding and arguments of the created function.
  11113. *
  11114. * @static
  11115. * @memberOf _
  11116. * @since 0.1.0
  11117. * @category Function
  11118. * @param {Function} func The function to restrict.
  11119. * @returns {Function} Returns the new restricted function.
  11120. * @example
  11121. *
  11122. * var initialize = _.once(createApplication);
  11123. * initialize();
  11124. * initialize();
  11125. * // => `createApplication` is invoked once
  11126. */
  11127. function once(func) {
  11128. return before(2, func);
  11129. }
  11130. /**
  11131. * Creates a function that invokes `func` with its arguments transformed.
  11132. *
  11133. * @static
  11134. * @since 4.0.0
  11135. * @memberOf _
  11136. * @category Function
  11137. * @param {Function} func The function to wrap.
  11138. * @param {...(Function|Function[])} [transforms=[_.identity]]
  11139. * The argument transforms.
  11140. * @returns {Function} Returns the new function.
  11141. * @example
  11142. *
  11143. * function doubled(n) {
  11144. * return n * 2;
  11145. * }
  11146. *
  11147. * function square(n) {
  11148. * return n * n;
  11149. * }
  11150. *
  11151. * var func = _.overArgs(function(x, y) {
  11152. * return [x, y];
  11153. * }, [square, doubled]);
  11154. *
  11155. * func(9, 3);
  11156. * // => [81, 6]
  11157. *
  11158. * func(10, 5);
  11159. * // => [100, 10]
  11160. */
  11161. var overArgs = castRest(function(func, transforms) {
  11162. transforms = (transforms.length == 1 && isArray(transforms[0]))
  11163. ? arrayMap(transforms[0], baseUnary(getIteratee()))
  11164. : arrayMap(baseFlatten(transforms, 1), baseUnary(getIteratee()));
  11165. var funcsLength = transforms.length;
  11166. return baseRest(function(args) {
  11167. var index = -1,
  11168. length = nativeMin(args.length, funcsLength);
  11169. while (++index < length) {
  11170. args[index] = transforms[index].call(this, args[index]);
  11171. }
  11172. return apply(func, this, args);
  11173. });
  11174. });
  11175. /**
  11176. * Creates a function that invokes `func` with `partials` prepended to the
  11177. * arguments it receives. This method is like `_.bind` except it does **not**
  11178. * alter the `this` binding.
  11179. *
  11180. * The `_.partial.placeholder` value, which defaults to `_` in monolithic
  11181. * builds, may be used as a placeholder for partially applied arguments.
  11182. *
  11183. * **Note:** This method doesn't set the "length" property of partially
  11184. * applied functions.
  11185. *
  11186. * @static
  11187. * @memberOf _
  11188. * @since 0.2.0
  11189. * @category Function
  11190. * @param {Function} func The function to partially apply arguments to.
  11191. * @param {...*} [partials] The arguments to be partially applied.
  11192. * @returns {Function} Returns the new partially applied function.
  11193. * @example
  11194. *
  11195. * function greet(greeting, name) {
  11196. * return greeting + ' ' + name;
  11197. * }
  11198. *
  11199. * var sayHelloTo = _.partial(greet, 'hello');
  11200. * sayHelloTo('fred');
  11201. * // => 'hello fred'
  11202. *
  11203. * // Partially applied with placeholders.
  11204. * var greetFred = _.partial(greet, _, 'fred');
  11205. * greetFred('hi');
  11206. * // => 'hi fred'
  11207. */
  11208. var partial = baseRest(function(func, partials) {
  11209. var holders = replaceHolders(partials, getHolder(partial));
  11210. return createWrap(func, WRAP_PARTIAL_FLAG, undefined, partials, holders);
  11211. });
  11212. /**
  11213. * This method is like `_.partial` except that partially applied arguments
  11214. * are appended to the arguments it receives.
  11215. *
  11216. * The `_.partialRight.placeholder` value, which defaults to `_` in monolithic
  11217. * builds, may be used as a placeholder for partially applied arguments.
  11218. *
  11219. * **Note:** This method doesn't set the "length" property of partially
  11220. * applied functions.
  11221. *
  11222. * @static
  11223. * @memberOf _
  11224. * @since 1.0.0
  11225. * @category Function
  11226. * @param {Function} func The function to partially apply arguments to.
  11227. * @param {...*} [partials] The arguments to be partially applied.
  11228. * @returns {Function} Returns the new partially applied function.
  11229. * @example
  11230. *
  11231. * function greet(greeting, name) {
  11232. * return greeting + ' ' + name;
  11233. * }
  11234. *
  11235. * var greetFred = _.partialRight(greet, 'fred');
  11236. * greetFred('hi');
  11237. * // => 'hi fred'
  11238. *
  11239. * // Partially applied with placeholders.
  11240. * var sayHelloTo = _.partialRight(greet, 'hello', _);
  11241. * sayHelloTo('fred');
  11242. * // => 'hello fred'
  11243. */
  11244. var partialRight = baseRest(function(func, partials) {
  11245. var holders = replaceHolders(partials, getHolder(partialRight));
  11246. return createWrap(func, WRAP_PARTIAL_RIGHT_FLAG, undefined, partials, holders);
  11247. });
  11248. /**
  11249. * Creates a function that invokes `func` with arguments arranged according
  11250. * to the specified `indexes` where the argument value at the first index is
  11251. * provided as the first argument, the argument value at the second index is
  11252. * provided as the second argument, and so on.
  11253. *
  11254. * @static
  11255. * @memberOf _
  11256. * @since 3.0.0
  11257. * @category Function
  11258. * @param {Function} func The function to rearrange arguments for.
  11259. * @param {...(number|number[])} indexes The arranged argument indexes.
  11260. * @returns {Function} Returns the new function.
  11261. * @example
  11262. *
  11263. * var rearged = _.rearg(function(a, b, c) {
  11264. * return [a, b, c];
  11265. * }, [2, 0, 1]);
  11266. *
  11267. * rearged('b', 'c', 'a')
  11268. * // => ['a', 'b', 'c']
  11269. */
  11270. var rearg = flatRest(function(func, indexes) {
  11271. return createWrap(func, WRAP_REARG_FLAG, undefined, undefined, undefined, indexes);
  11272. });
  11273. /**
  11274. * Creates a function that invokes `func` with the `this` binding of the
  11275. * created function and arguments from `start` and beyond provided as
  11276. * an array.
  11277. *
  11278. * **Note:** This method is based on the
  11279. * [rest parameter](https://mdn.io/rest_parameters).
  11280. *
  11281. * @static
  11282. * @memberOf _
  11283. * @since 4.0.0
  11284. * @category Function
  11285. * @param {Function} func The function to apply a rest parameter to.
  11286. * @param {number} [start=func.length-1] The start position of the rest parameter.
  11287. * @returns {Function} Returns the new function.
  11288. * @example
  11289. *
  11290. * var say = _.rest(function(what, names) {
  11291. * return what + ' ' + _.initial(names).join(', ') +
  11292. * (_.size(names) > 1 ? ', & ' : '') + _.last(names);
  11293. * });
  11294. *
  11295. * say('hello', 'fred', 'barney', 'pebbles');
  11296. * // => 'hello fred, barney, & pebbles'
  11297. */
  11298. function rest(func, start) {
  11299. if (typeof func != 'function') {
  11300. throw new TypeError(FUNC_ERROR_TEXT);
  11301. }
  11302. start = start === undefined ? start : toInteger(start);
  11303. return baseRest(func, start);
  11304. }
  11305. /**
  11306. * Creates a function that invokes `func` with the `this` binding of the
  11307. * create function and an array of arguments much like
  11308. * [`Function#apply`](http://www.ecma-international.org/ecma-262/7.0/#sec-function.prototype.apply).
  11309. *
  11310. * **Note:** This method is based on the
  11311. * [spread operator](https://mdn.io/spread_operator).
  11312. *
  11313. * @static
  11314. * @memberOf _
  11315. * @since 3.2.0
  11316. * @category Function
  11317. * @param {Function} func The function to spread arguments over.
  11318. * @param {number} [start=0] The start position of the spread.
  11319. * @returns {Function} Returns the new function.
  11320. * @example
  11321. *
  11322. * var say = _.spread(function(who, what) {
  11323. * return who + ' says ' + what;
  11324. * });
  11325. *
  11326. * say(['fred', 'hello']);
  11327. * // => 'fred says hello'
  11328. *
  11329. * var numbers = Promise.all([
  11330. * Promise.resolve(40),
  11331. * Promise.resolve(36)
  11332. * ]);
  11333. *
  11334. * numbers.then(_.spread(function(x, y) {
  11335. * return x + y;
  11336. * }));
  11337. * // => a Promise of 76
  11338. */
  11339. function spread(func, start) {
  11340. if (typeof func != 'function') {
  11341. throw new TypeError(FUNC_ERROR_TEXT);
  11342. }
  11343. start = start == null ? 0 : nativeMax(toInteger(start), 0);
  11344. return baseRest(function(args) {
  11345. var array = args[start],
  11346. otherArgs = castSlice(args, 0, start);
  11347. if (array) {
  11348. arrayPush(otherArgs, array);
  11349. }
  11350. return apply(func, this, otherArgs);
  11351. });
  11352. }
  11353. /**
  11354. * Creates a throttled function that only invokes `func` at most once per
  11355. * every `wait` milliseconds. The throttled function comes with a `cancel`
  11356. * method to cancel delayed `func` invocations and a `flush` method to
  11357. * immediately invoke them. Provide `options` to indicate whether `func`
  11358. * should be invoked on the leading and/or trailing edge of the `wait`
  11359. * timeout. The `func` is invoked with the last arguments provided to the
  11360. * throttled function. Subsequent calls to the throttled function return the
  11361. * result of the last `func` invocation.
  11362. *
  11363. * **Note:** If `leading` and `trailing` options are `true`, `func` is
  11364. * invoked on the trailing edge of the timeout only if the throttled function
  11365. * is invoked more than once during the `wait` timeout.
  11366. *
  11367. * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred
  11368. * until to the next tick, similar to `setTimeout` with a timeout of `0`.
  11369. *
  11370. * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/)
  11371. * for details over the differences between `_.throttle` and `_.debounce`.
  11372. *
  11373. * @static
  11374. * @memberOf _
  11375. * @since 0.1.0
  11376. * @category Function
  11377. * @param {Function} func The function to throttle.
  11378. * @param {number} [wait=0] The number of milliseconds to throttle invocations to.
  11379. * @param {Object} [options={}] The options object.
  11380. * @param {boolean} [options.leading=true]
  11381. * Specify invoking on the leading edge of the timeout.
  11382. * @param {boolean} [options.trailing=true]
  11383. * Specify invoking on the trailing edge of the timeout.
  11384. * @returns {Function} Returns the new throttled function.
  11385. * @example
  11386. *
  11387. * // Avoid excessively updating the position while scrolling.
  11388. * jQuery(window).on('scroll', _.throttle(updatePosition, 100));
  11389. *
  11390. * // Invoke `renewToken` when the click event is fired, but not more than once every 5 minutes.
  11391. * var throttled = _.throttle(renewToken, 300000, { 'trailing': false });
  11392. * jQuery(element).on('click', throttled);
  11393. *
  11394. * // Cancel the trailing throttled invocation.
  11395. * jQuery(window).on('popstate', throttled.cancel);
  11396. */
  11397. function throttle(func, wait, options) {
  11398. var leading = true,
  11399. trailing = true;
  11400. if (typeof func != 'function') {
  11401. throw new TypeError(FUNC_ERROR_TEXT);
  11402. }
  11403. if (isObject(options)) {
  11404. leading = 'leading' in options ? !!options.leading : leading;
  11405. trailing = 'trailing' in options ? !!options.trailing : trailing;
  11406. }
  11407. return debounce(func, wait, {
  11408. 'leading': leading,
  11409. 'maxWait': wait,
  11410. 'trailing': trailing
  11411. });
  11412. }
  11413. /**
  11414. * Creates a function that accepts up to one argument, ignoring any
  11415. * additional arguments.
  11416. *
  11417. * @static
  11418. * @memberOf _
  11419. * @since 4.0.0
  11420. * @category Function
  11421. * @param {Function} func The function to cap arguments for.
  11422. * @returns {Function} Returns the new capped function.
  11423. * @example
  11424. *
  11425. * _.map(['6', '8', '10'], _.unary(parseInt));
  11426. * // => [6, 8, 10]
  11427. */
  11428. function unary(func) {
  11429. return ary(func, 1);
  11430. }
  11431. /**
  11432. * Creates a function that provides `value` to `wrapper` as its first
  11433. * argument. Any additional arguments provided to the function are appended
  11434. * to those provided to the `wrapper`. The wrapper is invoked with the `this`
  11435. * binding of the created function.
  11436. *
  11437. * @static
  11438. * @memberOf _
  11439. * @since 0.1.0
  11440. * @category Function
  11441. * @param {*} value The value to wrap.
  11442. * @param {Function} [wrapper=identity] The wrapper function.
  11443. * @returns {Function} Returns the new function.
  11444. * @example
  11445. *
  11446. * var p = _.wrap(_.escape, function(func, text) {
  11447. * return '<p>' + func(text) + '</p>';
  11448. * });
  11449. *
  11450. * p('fred, barney, & pebbles');
  11451. * // => '<p>fred, barney, &amp; pebbles</p>'
  11452. */
  11453. function wrap(value, wrapper) {
  11454. return partial(castFunction(wrapper), value);
  11455. }
  11456. /*------------------------------------------------------------------------*/
  11457. /**
  11458. * Casts `value` as an array if it's not one.
  11459. *
  11460. * @static
  11461. * @memberOf _
  11462. * @since 4.4.0
  11463. * @category Lang
  11464. * @param {*} value The value to inspect.
  11465. * @returns {Array} Returns the cast array.
  11466. * @example
  11467. *
  11468. * _.castArray(1);
  11469. * // => [1]
  11470. *
  11471. * _.castArray({ 'a': 1 });
  11472. * // => [{ 'a': 1 }]
  11473. *
  11474. * _.castArray('abc');
  11475. * // => ['abc']
  11476. *
  11477. * _.castArray(null);
  11478. * // => [null]
  11479. *
  11480. * _.castArray(undefined);
  11481. * // => [undefined]
  11482. *
  11483. * _.castArray();
  11484. * // => []
  11485. *
  11486. * var array = [1, 2, 3];
  11487. * console.log(_.castArray(array) === array);
  11488. * // => true
  11489. */
  11490. function castArray() {
  11491. if (!arguments.length) {
  11492. return [];
  11493. }
  11494. var value = arguments[0];
  11495. return isArray(value) ? value : [value];
  11496. }
  11497. /**
  11498. * Creates a shallow clone of `value`.
  11499. *
  11500. * **Note:** This method is loosely based on the
  11501. * [structured clone algorithm](https://mdn.io/Structured_clone_algorithm)
  11502. * and supports cloning arrays, array buffers, booleans, date objects, maps,
  11503. * numbers, `Object` objects, regexes, sets, strings, symbols, and typed
  11504. * arrays. The own enumerable properties of `arguments` objects are cloned
  11505. * as plain objects. An empty object is returned for uncloneable values such
  11506. * as error objects, functions, DOM nodes, and WeakMaps.
  11507. *
  11508. * @static
  11509. * @memberOf _
  11510. * @since 0.1.0
  11511. * @category Lang
  11512. * @param {*} value The value to clone.
  11513. * @returns {*} Returns the cloned value.
  11514. * @see _.cloneDeep
  11515. * @example
  11516. *
  11517. * var objects = [{ 'a': 1 }, { 'b': 2 }];
  11518. *
  11519. * var shallow = _.clone(objects);
  11520. * console.log(shallow[0] === objects[0]);
  11521. * // => true
  11522. */
  11523. function clone(value) {
  11524. return baseClone(value, CLONE_SYMBOLS_FLAG);
  11525. }
  11526. /**
  11527. * This method is like `_.clone` except that it accepts `customizer` which
  11528. * is invoked to produce the cloned value. If `customizer` returns `undefined`,
  11529. * cloning is handled by the method instead. The `customizer` is invoked with
  11530. * up to four arguments; (value [, index|key, object, stack]).
  11531. *
  11532. * @static
  11533. * @memberOf _
  11534. * @since 4.0.0
  11535. * @category Lang
  11536. * @param {*} value The value to clone.
  11537. * @param {Function} [customizer] The function to customize cloning.
  11538. * @returns {*} Returns the cloned value.
  11539. * @see _.cloneDeepWith
  11540. * @example
  11541. *
  11542. * function customizer(value) {
  11543. * if (_.isElement(value)) {
  11544. * return value.cloneNode(false);
  11545. * }
  11546. * }
  11547. *
  11548. * var el = _.cloneWith(document.body, customizer);
  11549. *
  11550. * console.log(el === document.body);
  11551. * // => false
  11552. * console.log(el.nodeName);
  11553. * // => 'BODY'
  11554. * console.log(el.childNodes.length);
  11555. * // => 0
  11556. */
  11557. function cloneWith(value, customizer) {
  11558. customizer = typeof customizer == 'function' ? customizer : undefined;
  11559. return baseClone(value, CLONE_SYMBOLS_FLAG, customizer);
  11560. }
  11561. /**
  11562. * This method is like `_.clone` except that it recursively clones `value`.
  11563. *
  11564. * @static
  11565. * @memberOf _
  11566. * @since 1.0.0
  11567. * @category Lang
  11568. * @param {*} value The value to recursively clone.
  11569. * @returns {*} Returns the deep cloned value.
  11570. * @see _.clone
  11571. * @example
  11572. *
  11573. * var objects = [{ 'a': 1 }, { 'b': 2 }];
  11574. *
  11575. * var deep = _.cloneDeep(objects);
  11576. * console.log(deep[0] === objects[0]);
  11577. * // => false
  11578. */
  11579. function cloneDeep(value) {
  11580. return baseClone(value, CLONE_DEEP_FLAG | CLONE_SYMBOLS_FLAG);
  11581. }
  11582. /**
  11583. * This method is like `_.cloneWith` except that it recursively clones `value`.
  11584. *
  11585. * @static
  11586. * @memberOf _
  11587. * @since 4.0.0
  11588. * @category Lang
  11589. * @param {*} value The value to recursively clone.
  11590. * @param {Function} [customizer] The function to customize cloning.
  11591. * @returns {*} Returns the deep cloned value.
  11592. * @see _.cloneWith
  11593. * @example
  11594. *
  11595. * function customizer(value) {
  11596. * if (_.isElement(value)) {
  11597. * return value.cloneNode(true);
  11598. * }
  11599. * }
  11600. *
  11601. * var el = _.cloneDeepWith(document.body, customizer);
  11602. *
  11603. * console.log(el === document.body);
  11604. * // => false
  11605. * console.log(el.nodeName);
  11606. * // => 'BODY'
  11607. * console.log(el.childNodes.length);
  11608. * // => 20
  11609. */
  11610. function cloneDeepWith(value, customizer) {
  11611. customizer = typeof customizer == 'function' ? customizer : undefined;
  11612. return baseClone(value, CLONE_DEEP_FLAG | CLONE_SYMBOLS_FLAG, customizer);
  11613. }
  11614. /**
  11615. * Checks if `object` conforms to `source` by invoking the predicate
  11616. * properties of `source` with the corresponding property values of `object`.
  11617. *
  11618. * **Note:** This method is equivalent to `_.conforms` when `source` is
  11619. * partially applied.
  11620. *
  11621. * @static
  11622. * @memberOf _
  11623. * @since 4.14.0
  11624. * @category Lang
  11625. * @param {Object} object The object to inspect.
  11626. * @param {Object} source The object of property predicates to conform to.
  11627. * @returns {boolean} Returns `true` if `object` conforms, else `false`.
  11628. * @example
  11629. *
  11630. * var object = { 'a': 1, 'b': 2 };
  11631. *
  11632. * _.conformsTo(object, { 'b': function(n) { return n > 1; } });
  11633. * // => true
  11634. *
  11635. * _.conformsTo(object, { 'b': function(n) { return n > 2; } });
  11636. * // => false
  11637. */
  11638. function conformsTo(object, source) {
  11639. return source == null || baseConformsTo(object, source, keys(source));
  11640. }
  11641. /**
  11642. * Performs a
  11643. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  11644. * comparison between two values to determine if they are equivalent.
  11645. *
  11646. * @static
  11647. * @memberOf _
  11648. * @since 4.0.0
  11649. * @category Lang
  11650. * @param {*} value The value to compare.
  11651. * @param {*} other The other value to compare.
  11652. * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
  11653. * @example
  11654. *
  11655. * var object = { 'a': 1 };
  11656. * var other = { 'a': 1 };
  11657. *
  11658. * _.eq(object, object);
  11659. * // => true
  11660. *
  11661. * _.eq(object, other);
  11662. * // => false
  11663. *
  11664. * _.eq('a', 'a');
  11665. * // => true
  11666. *
  11667. * _.eq('a', Object('a'));
  11668. * // => false
  11669. *
  11670. * _.eq(NaN, NaN);
  11671. * // => true
  11672. */
  11673. function eq(value, other) {
  11674. return value === other || (value !== value && other !== other);
  11675. }
  11676. /**
  11677. * Checks if `value` is greater than `other`.
  11678. *
  11679. * @static
  11680. * @memberOf _
  11681. * @since 3.9.0
  11682. * @category Lang
  11683. * @param {*} value The value to compare.
  11684. * @param {*} other The other value to compare.
  11685. * @returns {boolean} Returns `true` if `value` is greater than `other`,
  11686. * else `false`.
  11687. * @see _.lt
  11688. * @example
  11689. *
  11690. * _.gt(3, 1);
  11691. * // => true
  11692. *
  11693. * _.gt(3, 3);
  11694. * // => false
  11695. *
  11696. * _.gt(1, 3);
  11697. * // => false
  11698. */
  11699. var gt = createRelationalOperation(baseGt);
  11700. /**
  11701. * Checks if `value` is greater than or equal to `other`.
  11702. *
  11703. * @static
  11704. * @memberOf _
  11705. * @since 3.9.0
  11706. * @category Lang
  11707. * @param {*} value The value to compare.
  11708. * @param {*} other The other value to compare.
  11709. * @returns {boolean} Returns `true` if `value` is greater than or equal to
  11710. * `other`, else `false`.
  11711. * @see _.lte
  11712. * @example
  11713. *
  11714. * _.gte(3, 1);
  11715. * // => true
  11716. *
  11717. * _.gte(3, 3);
  11718. * // => true
  11719. *
  11720. * _.gte(1, 3);
  11721. * // => false
  11722. */
  11723. var gte = createRelationalOperation(function(value, other) {
  11724. return value >= other;
  11725. });
  11726. /**
  11727. * Checks if `value` is likely an `arguments` object.
  11728. *
  11729. * @static
  11730. * @memberOf _
  11731. * @since 0.1.0
  11732. * @category Lang
  11733. * @param {*} value The value to check.
  11734. * @returns {boolean} Returns `true` if `value` is an `arguments` object,
  11735. * else `false`.
  11736. * @example
  11737. *
  11738. * _.isArguments(function() { return arguments; }());
  11739. * // => true
  11740. *
  11741. * _.isArguments([1, 2, 3]);
  11742. * // => false
  11743. */
  11744. var isArguments = baseIsArguments(function() { return arguments; }()) ? baseIsArguments : function(value) {
  11745. return isObjectLike(value) && hasOwnProperty.call(value, 'callee') &&
  11746. !propertyIsEnumerable.call(value, 'callee');
  11747. };
  11748. /**
  11749. * Checks if `value` is classified as an `Array` object.
  11750. *
  11751. * @static
  11752. * @memberOf _
  11753. * @since 0.1.0
  11754. * @category Lang
  11755. * @param {*} value The value to check.
  11756. * @returns {boolean} Returns `true` if `value` is an array, else `false`.
  11757. * @example
  11758. *
  11759. * _.isArray([1, 2, 3]);
  11760. * // => true
  11761. *
  11762. * _.isArray(document.body.children);
  11763. * // => false
  11764. *
  11765. * _.isArray('abc');
  11766. * // => false
  11767. *
  11768. * _.isArray(_.noop);
  11769. * // => false
  11770. */
  11771. var isArray = Array.isArray;
  11772. /**
  11773. * Checks if `value` is classified as an `ArrayBuffer` object.
  11774. *
  11775. * @static
  11776. * @memberOf _
  11777. * @since 4.3.0
  11778. * @category Lang
  11779. * @param {*} value The value to check.
  11780. * @returns {boolean} Returns `true` if `value` is an array buffer, else `false`.
  11781. * @example
  11782. *
  11783. * _.isArrayBuffer(new ArrayBuffer(2));
  11784. * // => true
  11785. *
  11786. * _.isArrayBuffer(new Array(2));
  11787. * // => false
  11788. */
  11789. var isArrayBuffer = nodeIsArrayBuffer ? baseUnary(nodeIsArrayBuffer) : baseIsArrayBuffer;
  11790. /**
  11791. * Checks if `value` is array-like. A value is considered array-like if it's
  11792. * not a function and has a `value.length` that's an integer greater than or
  11793. * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`.
  11794. *
  11795. * @static
  11796. * @memberOf _
  11797. * @since 4.0.0
  11798. * @category Lang
  11799. * @param {*} value The value to check.
  11800. * @returns {boolean} Returns `true` if `value` is array-like, else `false`.
  11801. * @example
  11802. *
  11803. * _.isArrayLike([1, 2, 3]);
  11804. * // => true
  11805. *
  11806. * _.isArrayLike(document.body.children);
  11807. * // => true
  11808. *
  11809. * _.isArrayLike('abc');
  11810. * // => true
  11811. *
  11812. * _.isArrayLike(_.noop);
  11813. * // => false
  11814. */
  11815. function isArrayLike(value) {
  11816. return value != null && isLength(value.length) && !isFunction(value);
  11817. }
  11818. /**
  11819. * This method is like `_.isArrayLike` except that it also checks if `value`
  11820. * is an object.
  11821. *
  11822. * @static
  11823. * @memberOf _
  11824. * @since 4.0.0
  11825. * @category Lang
  11826. * @param {*} value The value to check.
  11827. * @returns {boolean} Returns `true` if `value` is an array-like object,
  11828. * else `false`.
  11829. * @example
  11830. *
  11831. * _.isArrayLikeObject([1, 2, 3]);
  11832. * // => true
  11833. *
  11834. * _.isArrayLikeObject(document.body.children);
  11835. * // => true
  11836. *
  11837. * _.isArrayLikeObject('abc');
  11838. * // => false
  11839. *
  11840. * _.isArrayLikeObject(_.noop);
  11841. * // => false
  11842. */
  11843. function isArrayLikeObject(value) {
  11844. return isObjectLike(value) && isArrayLike(value);
  11845. }
  11846. /**
  11847. * Checks if `value` is classified as a boolean primitive or object.
  11848. *
  11849. * @static
  11850. * @memberOf _
  11851. * @since 0.1.0
  11852. * @category Lang
  11853. * @param {*} value The value to check.
  11854. * @returns {boolean} Returns `true` if `value` is a boolean, else `false`.
  11855. * @example
  11856. *
  11857. * _.isBoolean(false);
  11858. * // => true
  11859. *
  11860. * _.isBoolean(null);
  11861. * // => false
  11862. */
  11863. function isBoolean(value) {
  11864. return value === true || value === false ||
  11865. (isObjectLike(value) && baseGetTag(value) == boolTag);
  11866. }
  11867. /**
  11868. * Checks if `value` is a buffer.
  11869. *
  11870. * @static
  11871. * @memberOf _
  11872. * @since 4.3.0
  11873. * @category Lang
  11874. * @param {*} value The value to check.
  11875. * @returns {boolean} Returns `true` if `value` is a buffer, else `false`.
  11876. * @example
  11877. *
  11878. * _.isBuffer(new Buffer(2));
  11879. * // => true
  11880. *
  11881. * _.isBuffer(new Uint8Array(2));
  11882. * // => false
  11883. */
  11884. var isBuffer = nativeIsBuffer || stubFalse;
  11885. /**
  11886. * Checks if `value` is classified as a `Date` object.
  11887. *
  11888. * @static
  11889. * @memberOf _
  11890. * @since 0.1.0
  11891. * @category Lang
  11892. * @param {*} value The value to check.
  11893. * @returns {boolean} Returns `true` if `value` is a date object, else `false`.
  11894. * @example
  11895. *
  11896. * _.isDate(new Date);
  11897. * // => true
  11898. *
  11899. * _.isDate('Mon April 23 2012');
  11900. * // => false
  11901. */
  11902. var isDate = nodeIsDate ? baseUnary(nodeIsDate) : baseIsDate;
  11903. /**
  11904. * Checks if `value` is likely a DOM element.
  11905. *
  11906. * @static
  11907. * @memberOf _
  11908. * @since 0.1.0
  11909. * @category Lang
  11910. * @param {*} value The value to check.
  11911. * @returns {boolean} Returns `true` if `value` is a DOM element, else `false`.
  11912. * @example
  11913. *
  11914. * _.isElement(document.body);
  11915. * // => true
  11916. *
  11917. * _.isElement('<body>');
  11918. * // => false
  11919. */
  11920. function isElement(value) {
  11921. return isObjectLike(value) && value.nodeType === 1 && !isPlainObject(value);
  11922. }
  11923. /**
  11924. * Checks if `value` is an empty object, collection, map, or set.
  11925. *
  11926. * Objects are considered empty if they have no own enumerable string keyed
  11927. * properties.
  11928. *
  11929. * Array-like values such as `arguments` objects, arrays, buffers, strings, or
  11930. * jQuery-like collections are considered empty if they have a `length` of `0`.
  11931. * Similarly, maps and sets are considered empty if they have a `size` of `0`.
  11932. *
  11933. * @static
  11934. * @memberOf _
  11935. * @since 0.1.0
  11936. * @category Lang
  11937. * @param {*} value The value to check.
  11938. * @returns {boolean} Returns `true` if `value` is empty, else `false`.
  11939. * @example
  11940. *
  11941. * _.isEmpty(null);
  11942. * // => true
  11943. *
  11944. * _.isEmpty(true);
  11945. * // => true
  11946. *
  11947. * _.isEmpty(1);
  11948. * // => true
  11949. *
  11950. * _.isEmpty([1, 2, 3]);
  11951. * // => false
  11952. *
  11953. * _.isEmpty({ 'a': 1 });
  11954. * // => false
  11955. */
  11956. function isEmpty(value) {
  11957. if (value == null) {
  11958. return true;
  11959. }
  11960. if (isArrayLike(value) &&
  11961. (isArray(value) || typeof value == 'string' || typeof value.splice == 'function' ||
  11962. isBuffer(value) || isTypedArray(value) || isArguments(value))) {
  11963. return !value.length;
  11964. }
  11965. var tag = getTag(value);
  11966. if (tag == mapTag || tag == setTag) {
  11967. return !value.size;
  11968. }
  11969. if (isPrototype(value)) {
  11970. return !baseKeys(value).length;
  11971. }
  11972. for (var key in value) {
  11973. if (hasOwnProperty.call(value, key)) {
  11974. return false;
  11975. }
  11976. }
  11977. return true;
  11978. }
  11979. /**
  11980. * Performs a deep comparison between two values to determine if they are
  11981. * equivalent.
  11982. *
  11983. * **Note:** This method supports comparing arrays, array buffers, booleans,
  11984. * date objects, error objects, maps, numbers, `Object` objects, regexes,
  11985. * sets, strings, symbols, and typed arrays. `Object` objects are compared
  11986. * by their own, not inherited, enumerable properties. Functions and DOM
  11987. * nodes are compared by strict equality, i.e. `===`.
  11988. *
  11989. * @static
  11990. * @memberOf _
  11991. * @since 0.1.0
  11992. * @category Lang
  11993. * @param {*} value The value to compare.
  11994. * @param {*} other The other value to compare.
  11995. * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
  11996. * @example
  11997. *
  11998. * var object = { 'a': 1 };
  11999. * var other = { 'a': 1 };
  12000. *
  12001. * _.isEqual(object, other);
  12002. * // => true
  12003. *
  12004. * object === other;
  12005. * // => false
  12006. */
  12007. function isEqual(value, other) {
  12008. return baseIsEqual(value, other);
  12009. }
  12010. /**
  12011. * This method is like `_.isEqual` except that it accepts `customizer` which
  12012. * is invoked to compare values. If `customizer` returns `undefined`, comparisons
  12013. * are handled by the method instead. The `customizer` is invoked with up to
  12014. * six arguments: (objValue, othValue [, index|key, object, other, stack]).
  12015. *
  12016. * @static
  12017. * @memberOf _
  12018. * @since 4.0.0
  12019. * @category Lang
  12020. * @param {*} value The value to compare.
  12021. * @param {*} other The other value to compare.
  12022. * @param {Function} [customizer] The function to customize comparisons.
  12023. * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
  12024. * @example
  12025. *
  12026. * function isGreeting(value) {
  12027. * return /^h(?:i|ello)$/.test(value);
  12028. * }
  12029. *
  12030. * function customizer(objValue, othValue) {
  12031. * if (isGreeting(objValue) && isGreeting(othValue)) {
  12032. * return true;
  12033. * }
  12034. * }
  12035. *
  12036. * var array = ['hello', 'goodbye'];
  12037. * var other = ['hi', 'goodbye'];
  12038. *
  12039. * _.isEqualWith(array, other, customizer);
  12040. * // => true
  12041. */
  12042. function isEqualWith(value, other, customizer) {
  12043. customizer = typeof customizer == 'function' ? customizer : undefined;
  12044. var result = customizer ? customizer(value, other) : undefined;
  12045. return result === undefined ? baseIsEqual(value, other, undefined, customizer) : !!result;
  12046. }
  12047. /**
  12048. * Checks if `value` is an `Error`, `EvalError`, `RangeError`, `ReferenceError`,
  12049. * `SyntaxError`, `TypeError`, or `URIError` object.
  12050. *
  12051. * @static
  12052. * @memberOf _
  12053. * @since 3.0.0
  12054. * @category Lang
  12055. * @param {*} value The value to check.
  12056. * @returns {boolean} Returns `true` if `value` is an error object, else `false`.
  12057. * @example
  12058. *
  12059. * _.isError(new Error);
  12060. * // => true
  12061. *
  12062. * _.isError(Error);
  12063. * // => false
  12064. */
  12065. function isError(value) {
  12066. if (!isObjectLike(value)) {
  12067. return false;
  12068. }
  12069. var tag = baseGetTag(value);
  12070. return tag == errorTag || tag == domExcTag ||
  12071. (typeof value.message == 'string' && typeof value.name == 'string' && !isPlainObject(value));
  12072. }
  12073. /**
  12074. * Checks if `value` is a finite primitive number.
  12075. *
  12076. * **Note:** This method is based on
  12077. * [`Number.isFinite`](https://mdn.io/Number/isFinite).
  12078. *
  12079. * @static
  12080. * @memberOf _
  12081. * @since 0.1.0
  12082. * @category Lang
  12083. * @param {*} value The value to check.
  12084. * @returns {boolean} Returns `true` if `value` is a finite number, else `false`.
  12085. * @example
  12086. *
  12087. * _.isFinite(3);
  12088. * // => true
  12089. *
  12090. * _.isFinite(Number.MIN_VALUE);
  12091. * // => true
  12092. *
  12093. * _.isFinite(Infinity);
  12094. * // => false
  12095. *
  12096. * _.isFinite('3');
  12097. * // => false
  12098. */
  12099. function isFinite(value) {
  12100. return typeof value == 'number' && nativeIsFinite(value);
  12101. }
  12102. /**
  12103. * Checks if `value` is classified as a `Function` object.
  12104. *
  12105. * @static
  12106. * @memberOf _
  12107. * @since 0.1.0
  12108. * @category Lang
  12109. * @param {*} value The value to check.
  12110. * @returns {boolean} Returns `true` if `value` is a function, else `false`.
  12111. * @example
  12112. *
  12113. * _.isFunction(_);
  12114. * // => true
  12115. *
  12116. * _.isFunction(/abc/);
  12117. * // => false
  12118. */
  12119. function isFunction(value) {
  12120. if (!isObject(value)) {
  12121. return false;
  12122. }
  12123. // The use of `Object#toString` avoids issues with the `typeof` operator
  12124. // in Safari 9 which returns 'object' for typed arrays and other constructors.
  12125. var tag = baseGetTag(value);
  12126. return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag;
  12127. }
  12128. /**
  12129. * Checks if `value` is an integer.
  12130. *
  12131. * **Note:** This method is based on
  12132. * [`Number.isInteger`](https://mdn.io/Number/isInteger).
  12133. *
  12134. * @static
  12135. * @memberOf _
  12136. * @since 4.0.0
  12137. * @category Lang
  12138. * @param {*} value The value to check.
  12139. * @returns {boolean} Returns `true` if `value` is an integer, else `false`.
  12140. * @example
  12141. *
  12142. * _.isInteger(3);
  12143. * // => true
  12144. *
  12145. * _.isInteger(Number.MIN_VALUE);
  12146. * // => false
  12147. *
  12148. * _.isInteger(Infinity);
  12149. * // => false
  12150. *
  12151. * _.isInteger('3');
  12152. * // => false
  12153. */
  12154. function isInteger(value) {
  12155. return typeof value == 'number' && value == toInteger(value);
  12156. }
  12157. /**
  12158. * Checks if `value` is a valid array-like length.
  12159. *
  12160. * **Note:** This method is loosely based on
  12161. * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).
  12162. *
  12163. * @static
  12164. * @memberOf _
  12165. * @since 4.0.0
  12166. * @category Lang
  12167. * @param {*} value The value to check.
  12168. * @returns {boolean} Returns `true` if `value` is a valid length, else `false`.
  12169. * @example
  12170. *
  12171. * _.isLength(3);
  12172. * // => true
  12173. *
  12174. * _.isLength(Number.MIN_VALUE);
  12175. * // => false
  12176. *
  12177. * _.isLength(Infinity);
  12178. * // => false
  12179. *
  12180. * _.isLength('3');
  12181. * // => false
  12182. */
  12183. function isLength(value) {
  12184. return typeof value == 'number' &&
  12185. value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;
  12186. }
  12187. /**
  12188. * Checks if `value` is the
  12189. * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)
  12190. * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
  12191. *
  12192. * @static
  12193. * @memberOf _
  12194. * @since 0.1.0
  12195. * @category Lang
  12196. * @param {*} value The value to check.
  12197. * @returns {boolean} Returns `true` if `value` is an object, else `false`.
  12198. * @example
  12199. *
  12200. * _.isObject({});
  12201. * // => true
  12202. *
  12203. * _.isObject([1, 2, 3]);
  12204. * // => true
  12205. *
  12206. * _.isObject(_.noop);
  12207. * // => true
  12208. *
  12209. * _.isObject(null);
  12210. * // => false
  12211. */
  12212. function isObject(value) {
  12213. var type = typeof value;
  12214. return value != null && (type == 'object' || type == 'function');
  12215. }
  12216. /**
  12217. * Checks if `value` is object-like. A value is object-like if it's not `null`
  12218. * and has a `typeof` result of "object".
  12219. *
  12220. * @static
  12221. * @memberOf _
  12222. * @since 4.0.0
  12223. * @category Lang
  12224. * @param {*} value The value to check.
  12225. * @returns {boolean} Returns `true` if `value` is object-like, else `false`.
  12226. * @example
  12227. *
  12228. * _.isObjectLike({});
  12229. * // => true
  12230. *
  12231. * _.isObjectLike([1, 2, 3]);
  12232. * // => true
  12233. *
  12234. * _.isObjectLike(_.noop);
  12235. * // => false
  12236. *
  12237. * _.isObjectLike(null);
  12238. * // => false
  12239. */
  12240. function isObjectLike(value) {
  12241. return value != null && typeof value == 'object';
  12242. }
  12243. /**
  12244. * Checks if `value` is classified as a `Map` object.
  12245. *
  12246. * @static
  12247. * @memberOf _
  12248. * @since 4.3.0
  12249. * @category Lang
  12250. * @param {*} value The value to check.
  12251. * @returns {boolean} Returns `true` if `value` is a map, else `false`.
  12252. * @example
  12253. *
  12254. * _.isMap(new Map);
  12255. * // => true
  12256. *
  12257. * _.isMap(new WeakMap);
  12258. * // => false
  12259. */
  12260. var isMap = nodeIsMap ? baseUnary(nodeIsMap) : baseIsMap;
  12261. /**
  12262. * Performs a partial deep comparison between `object` and `source` to
  12263. * determine if `object` contains equivalent property values.
  12264. *
  12265. * **Note:** This method is equivalent to `_.matches` when `source` is
  12266. * partially applied.
  12267. *
  12268. * Partial comparisons will match empty array and empty object `source`
  12269. * values against any array or object value, respectively. See `_.isEqual`
  12270. * for a list of supported value comparisons.
  12271. *
  12272. * @static
  12273. * @memberOf _
  12274. * @since 3.0.0
  12275. * @category Lang
  12276. * @param {Object} object The object to inspect.
  12277. * @param {Object} source The object of property values to match.
  12278. * @returns {boolean} Returns `true` if `object` is a match, else `false`.
  12279. * @example
  12280. *
  12281. * var object = { 'a': 1, 'b': 2 };
  12282. *
  12283. * _.isMatch(object, { 'b': 2 });
  12284. * // => true
  12285. *
  12286. * _.isMatch(object, { 'b': 1 });
  12287. * // => false
  12288. */
  12289. function isMatch(object, source) {
  12290. return object === source || baseIsMatch(object, source, getMatchData(source));
  12291. }
  12292. /**
  12293. * This method is like `_.isMatch` except that it accepts `customizer` which
  12294. * is invoked to compare values. If `customizer` returns `undefined`, comparisons
  12295. * are handled by the method instead. The `customizer` is invoked with five
  12296. * arguments: (objValue, srcValue, index|key, object, source).
  12297. *
  12298. * @static
  12299. * @memberOf _
  12300. * @since 4.0.0
  12301. * @category Lang
  12302. * @param {Object} object The object to inspect.
  12303. * @param {Object} source The object of property values to match.
  12304. * @param {Function} [customizer] The function to customize comparisons.
  12305. * @returns {boolean} Returns `true` if `object` is a match, else `false`.
  12306. * @example
  12307. *
  12308. * function isGreeting(value) {
  12309. * return /^h(?:i|ello)$/.test(value);
  12310. * }
  12311. *
  12312. * function customizer(objValue, srcValue) {
  12313. * if (isGreeting(objValue) && isGreeting(srcValue)) {
  12314. * return true;
  12315. * }
  12316. * }
  12317. *
  12318. * var object = { 'greeting': 'hello' };
  12319. * var source = { 'greeting': 'hi' };
  12320. *
  12321. * _.isMatchWith(object, source, customizer);
  12322. * // => true
  12323. */
  12324. function isMatchWith(object, source, customizer) {
  12325. customizer = typeof customizer == 'function' ? customizer : undefined;
  12326. return baseIsMatch(object, source, getMatchData(source), customizer);
  12327. }
  12328. /**
  12329. * Checks if `value` is `NaN`.
  12330. *
  12331. * **Note:** This method is based on
  12332. * [`Number.isNaN`](https://mdn.io/Number/isNaN) and is not the same as
  12333. * global [`isNaN`](https://mdn.io/isNaN) which returns `true` for
  12334. * `undefined` and other non-number values.
  12335. *
  12336. * @static
  12337. * @memberOf _
  12338. * @since 0.1.0
  12339. * @category Lang
  12340. * @param {*} value The value to check.
  12341. * @returns {boolean} Returns `true` if `value` is `NaN`, else `false`.
  12342. * @example
  12343. *
  12344. * _.isNaN(NaN);
  12345. * // => true
  12346. *
  12347. * _.isNaN(new Number(NaN));
  12348. * // => true
  12349. *
  12350. * isNaN(undefined);
  12351. * // => true
  12352. *
  12353. * _.isNaN(undefined);
  12354. * // => false
  12355. */
  12356. function isNaN(value) {
  12357. // An `NaN` primitive is the only value that is not equal to itself.
  12358. // Perform the `toStringTag` check first to avoid errors with some
  12359. // ActiveX objects in IE.
  12360. return isNumber(value) && value != +value;
  12361. }
  12362. /**
  12363. * Checks if `value` is a pristine native function.
  12364. *
  12365. * **Note:** This method can't reliably detect native functions in the presence
  12366. * of the core-js package because core-js circumvents this kind of detection.
  12367. * Despite multiple requests, the core-js maintainer has made it clear: any
  12368. * attempt to fix the detection will be obstructed. As a result, we're left
  12369. * with little choice but to throw an error. Unfortunately, this also affects
  12370. * packages, like [babel-polyfill](https://www.npmjs.com/package/babel-polyfill),
  12371. * which rely on core-js.
  12372. *
  12373. * @static
  12374. * @memberOf _
  12375. * @since 3.0.0
  12376. * @category Lang
  12377. * @param {*} value The value to check.
  12378. * @returns {boolean} Returns `true` if `value` is a native function,
  12379. * else `false`.
  12380. * @example
  12381. *
  12382. * _.isNative(Array.prototype.push);
  12383. * // => true
  12384. *
  12385. * _.isNative(_);
  12386. * // => false
  12387. */
  12388. function isNative(value) {
  12389. if (isMaskable(value)) {
  12390. throw new Error(CORE_ERROR_TEXT);
  12391. }
  12392. return baseIsNative(value);
  12393. }
  12394. /**
  12395. * Checks if `value` is `null`.
  12396. *
  12397. * @static
  12398. * @memberOf _
  12399. * @since 0.1.0
  12400. * @category Lang
  12401. * @param {*} value The value to check.
  12402. * @returns {boolean} Returns `true` if `value` is `null`, else `false`.
  12403. * @example
  12404. *
  12405. * _.isNull(null);
  12406. * // => true
  12407. *
  12408. * _.isNull(void 0);
  12409. * // => false
  12410. */
  12411. function isNull(value) {
  12412. return value === null;
  12413. }
  12414. /**
  12415. * Checks if `value` is `null` or `undefined`.
  12416. *
  12417. * @static
  12418. * @memberOf _
  12419. * @since 4.0.0
  12420. * @category Lang
  12421. * @param {*} value The value to check.
  12422. * @returns {boolean} Returns `true` if `value` is nullish, else `false`.
  12423. * @example
  12424. *
  12425. * _.isNil(null);
  12426. * // => true
  12427. *
  12428. * _.isNil(void 0);
  12429. * // => true
  12430. *
  12431. * _.isNil(NaN);
  12432. * // => false
  12433. */
  12434. function isNil(value) {
  12435. return value == null;
  12436. }
  12437. /**
  12438. * Checks if `value` is classified as a `Number` primitive or object.
  12439. *
  12440. * **Note:** To exclude `Infinity`, `-Infinity`, and `NaN`, which are
  12441. * classified as numbers, use the `_.isFinite` method.
  12442. *
  12443. * @static
  12444. * @memberOf _
  12445. * @since 0.1.0
  12446. * @category Lang
  12447. * @param {*} value The value to check.
  12448. * @returns {boolean} Returns `true` if `value` is a number, else `false`.
  12449. * @example
  12450. *
  12451. * _.isNumber(3);
  12452. * // => true
  12453. *
  12454. * _.isNumber(Number.MIN_VALUE);
  12455. * // => true
  12456. *
  12457. * _.isNumber(Infinity);
  12458. * // => true
  12459. *
  12460. * _.isNumber('3');
  12461. * // => false
  12462. */
  12463. function isNumber(value) {
  12464. return typeof value == 'number' ||
  12465. (isObjectLike(value) && baseGetTag(value) == numberTag);
  12466. }
  12467. /**
  12468. * Checks if `value` is a plain object, that is, an object created by the
  12469. * `Object` constructor or one with a `[[Prototype]]` of `null`.
  12470. *
  12471. * @static
  12472. * @memberOf _
  12473. * @since 0.8.0
  12474. * @category Lang
  12475. * @param {*} value The value to check.
  12476. * @returns {boolean} Returns `true` if `value` is a plain object, else `false`.
  12477. * @example
  12478. *
  12479. * function Foo() {
  12480. * this.a = 1;
  12481. * }
  12482. *
  12483. * _.isPlainObject(new Foo);
  12484. * // => false
  12485. *
  12486. * _.isPlainObject([1, 2, 3]);
  12487. * // => false
  12488. *
  12489. * _.isPlainObject({ 'x': 0, 'y': 0 });
  12490. * // => true
  12491. *
  12492. * _.isPlainObject(Object.create(null));
  12493. * // => true
  12494. */
  12495. function isPlainObject(value) {
  12496. if (!isObjectLike(value) || baseGetTag(value) != objectTag) {
  12497. return false;
  12498. }
  12499. var proto = getPrototype(value);
  12500. if (proto === null) {
  12501. return true;
  12502. }
  12503. var Ctor = hasOwnProperty.call(proto, 'constructor') && proto.constructor;
  12504. return typeof Ctor == 'function' && Ctor instanceof Ctor &&
  12505. funcToString.call(Ctor) == objectCtorString;
  12506. }
  12507. /**
  12508. * Checks if `value` is classified as a `RegExp` object.
  12509. *
  12510. * @static
  12511. * @memberOf _
  12512. * @since 0.1.0
  12513. * @category Lang
  12514. * @param {*} value The value to check.
  12515. * @returns {boolean} Returns `true` if `value` is a regexp, else `false`.
  12516. * @example
  12517. *
  12518. * _.isRegExp(/abc/);
  12519. * // => true
  12520. *
  12521. * _.isRegExp('/abc/');
  12522. * // => false
  12523. */
  12524. var isRegExp = nodeIsRegExp ? baseUnary(nodeIsRegExp) : baseIsRegExp;
  12525. /**
  12526. * Checks if `value` is a safe integer. An integer is safe if it's an IEEE-754
  12527. * double precision number which isn't the result of a rounded unsafe integer.
  12528. *
  12529. * **Note:** This method is based on
  12530. * [`Number.isSafeInteger`](https://mdn.io/Number/isSafeInteger).
  12531. *
  12532. * @static
  12533. * @memberOf _
  12534. * @since 4.0.0
  12535. * @category Lang
  12536. * @param {*} value The value to check.
  12537. * @returns {boolean} Returns `true` if `value` is a safe integer, else `false`.
  12538. * @example
  12539. *
  12540. * _.isSafeInteger(3);
  12541. * // => true
  12542. *
  12543. * _.isSafeInteger(Number.MIN_VALUE);
  12544. * // => false
  12545. *
  12546. * _.isSafeInteger(Infinity);
  12547. * // => false
  12548. *
  12549. * _.isSafeInteger('3');
  12550. * // => false
  12551. */
  12552. function isSafeInteger(value) {
  12553. return isInteger(value) && value >= -MAX_SAFE_INTEGER && value <= MAX_SAFE_INTEGER;
  12554. }
  12555. /**
  12556. * Checks if `value` is classified as a `Set` object.
  12557. *
  12558. * @static
  12559. * @memberOf _
  12560. * @since 4.3.0
  12561. * @category Lang
  12562. * @param {*} value The value to check.
  12563. * @returns {boolean} Returns `true` if `value` is a set, else `false`.
  12564. * @example
  12565. *
  12566. * _.isSet(new Set);
  12567. * // => true
  12568. *
  12569. * _.isSet(new WeakSet);
  12570. * // => false
  12571. */
  12572. var isSet = nodeIsSet ? baseUnary(nodeIsSet) : baseIsSet;
  12573. /**
  12574. * Checks if `value` is classified as a `String` primitive or object.
  12575. *
  12576. * @static
  12577. * @since 0.1.0
  12578. * @memberOf _
  12579. * @category Lang
  12580. * @param {*} value The value to check.
  12581. * @returns {boolean} Returns `true` if `value` is a string, else `false`.
  12582. * @example
  12583. *
  12584. * _.isString('abc');
  12585. * // => true
  12586. *
  12587. * _.isString(1);
  12588. * // => false
  12589. */
  12590. function isString(value) {
  12591. return typeof value == 'string' ||
  12592. (!isArray(value) && isObjectLike(value) && baseGetTag(value) == stringTag);
  12593. }
  12594. /**
  12595. * Checks if `value` is classified as a `Symbol` primitive or object.
  12596. *
  12597. * @static
  12598. * @memberOf _
  12599. * @since 4.0.0
  12600. * @category Lang
  12601. * @param {*} value The value to check.
  12602. * @returns {boolean} Returns `true` if `value` is a symbol, else `false`.
  12603. * @example
  12604. *
  12605. * _.isSymbol(Symbol.iterator);
  12606. * // => true
  12607. *
  12608. * _.isSymbol('abc');
  12609. * // => false
  12610. */
  12611. function isSymbol(value) {
  12612. return typeof value == 'symbol' ||
  12613. (isObjectLike(value) && baseGetTag(value) == symbolTag);
  12614. }
  12615. /**
  12616. * Checks if `value` is classified as a typed array.
  12617. *
  12618. * @static
  12619. * @memberOf _
  12620. * @since 3.0.0
  12621. * @category Lang
  12622. * @param {*} value The value to check.
  12623. * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.
  12624. * @example
  12625. *
  12626. * _.isTypedArray(new Uint8Array);
  12627. * // => true
  12628. *
  12629. * _.isTypedArray([]);
  12630. * // => false
  12631. */
  12632. var isTypedArray = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray;
  12633. /**
  12634. * Checks if `value` is `undefined`.
  12635. *
  12636. * @static
  12637. * @since 0.1.0
  12638. * @memberOf _
  12639. * @category Lang
  12640. * @param {*} value The value to check.
  12641. * @returns {boolean} Returns `true` if `value` is `undefined`, else `false`.
  12642. * @example
  12643. *
  12644. * _.isUndefined(void 0);
  12645. * // => true
  12646. *
  12647. * _.isUndefined(null);
  12648. * // => false
  12649. */
  12650. function isUndefined(value) {
  12651. return value === undefined;
  12652. }
  12653. /**
  12654. * Checks if `value` is classified as a `WeakMap` object.
  12655. *
  12656. * @static
  12657. * @memberOf _
  12658. * @since 4.3.0
  12659. * @category Lang
  12660. * @param {*} value The value to check.
  12661. * @returns {boolean} Returns `true` if `value` is a weak map, else `false`.
  12662. * @example
  12663. *
  12664. * _.isWeakMap(new WeakMap);
  12665. * // => true
  12666. *
  12667. * _.isWeakMap(new Map);
  12668. * // => false
  12669. */
  12670. function isWeakMap(value) {
  12671. return isObjectLike(value) && getTag(value) == weakMapTag;
  12672. }
  12673. /**
  12674. * Checks if `value` is classified as a `WeakSet` object.
  12675. *
  12676. * @static
  12677. * @memberOf _
  12678. * @since 4.3.0
  12679. * @category Lang
  12680. * @param {*} value The value to check.
  12681. * @returns {boolean} Returns `true` if `value` is a weak set, else `false`.
  12682. * @example
  12683. *
  12684. * _.isWeakSet(new WeakSet);
  12685. * // => true
  12686. *
  12687. * _.isWeakSet(new Set);
  12688. * // => false
  12689. */
  12690. function isWeakSet(value) {
  12691. return isObjectLike(value) && baseGetTag(value) == weakSetTag;
  12692. }
  12693. /**
  12694. * Checks if `value` is less than `other`.
  12695. *
  12696. * @static
  12697. * @memberOf _
  12698. * @since 3.9.0
  12699. * @category Lang
  12700. * @param {*} value The value to compare.
  12701. * @param {*} other The other value to compare.
  12702. * @returns {boolean} Returns `true` if `value` is less than `other`,
  12703. * else `false`.
  12704. * @see _.gt
  12705. * @example
  12706. *
  12707. * _.lt(1, 3);
  12708. * // => true
  12709. *
  12710. * _.lt(3, 3);
  12711. * // => false
  12712. *
  12713. * _.lt(3, 1);
  12714. * // => false
  12715. */
  12716. var lt = createRelationalOperation(baseLt);
  12717. /**
  12718. * Checks if `value` is less than or equal to `other`.
  12719. *
  12720. * @static
  12721. * @memberOf _
  12722. * @since 3.9.0
  12723. * @category Lang
  12724. * @param {*} value The value to compare.
  12725. * @param {*} other The other value to compare.
  12726. * @returns {boolean} Returns `true` if `value` is less than or equal to
  12727. * `other`, else `false`.
  12728. * @see _.gte
  12729. * @example
  12730. *
  12731. * _.lte(1, 3);
  12732. * // => true
  12733. *
  12734. * _.lte(3, 3);
  12735. * // => true
  12736. *
  12737. * _.lte(3, 1);
  12738. * // => false
  12739. */
  12740. var lte = createRelationalOperation(function(value, other) {
  12741. return value <= other;
  12742. });
  12743. /**
  12744. * Converts `value` to an array.
  12745. *
  12746. * @static
  12747. * @since 0.1.0
  12748. * @memberOf _
  12749. * @category Lang
  12750. * @param {*} value The value to convert.
  12751. * @returns {Array} Returns the converted array.
  12752. * @example
  12753. *
  12754. * _.toArray({ 'a': 1, 'b': 2 });
  12755. * // => [1, 2]
  12756. *
  12757. * _.toArray('abc');
  12758. * // => ['a', 'b', 'c']
  12759. *
  12760. * _.toArray(1);
  12761. * // => []
  12762. *
  12763. * _.toArray(null);
  12764. * // => []
  12765. */
  12766. function toArray(value) {
  12767. if (!value) {
  12768. return [];
  12769. }
  12770. if (isArrayLike(value)) {
  12771. return isString(value) ? stringToArray(value) : copyArray(value);
  12772. }
  12773. if (symIterator && value[symIterator]) {
  12774. return iteratorToArray(value[symIterator]());
  12775. }
  12776. var tag = getTag(value),
  12777. func = tag == mapTag ? mapToArray : (tag == setTag ? setToArray : values);
  12778. return func(value);
  12779. }
  12780. /**
  12781. * Converts `value` to a finite number.
  12782. *
  12783. * @static
  12784. * @memberOf _
  12785. * @since 4.12.0
  12786. * @category Lang
  12787. * @param {*} value The value to convert.
  12788. * @returns {number} Returns the converted number.
  12789. * @example
  12790. *
  12791. * _.toFinite(3.2);
  12792. * // => 3.2
  12793. *
  12794. * _.toFinite(Number.MIN_VALUE);
  12795. * // => 5e-324
  12796. *
  12797. * _.toFinite(Infinity);
  12798. * // => 1.7976931348623157e+308
  12799. *
  12800. * _.toFinite('3.2');
  12801. * // => 3.2
  12802. */
  12803. function toFinite(value) {
  12804. if (!value) {
  12805. return value === 0 ? value : 0;
  12806. }
  12807. value = toNumber(value);
  12808. if (value === INFINITY || value === -INFINITY) {
  12809. var sign = (value < 0 ? -1 : 1);
  12810. return sign * MAX_INTEGER;
  12811. }
  12812. return value === value ? value : 0;
  12813. }
  12814. /**
  12815. * Converts `value` to an integer.
  12816. *
  12817. * **Note:** This method is loosely based on
  12818. * [`ToInteger`](http://www.ecma-international.org/ecma-262/7.0/#sec-tointeger).
  12819. *
  12820. * @static
  12821. * @memberOf _
  12822. * @since 4.0.0
  12823. * @category Lang
  12824. * @param {*} value The value to convert.
  12825. * @returns {number} Returns the converted integer.
  12826. * @example
  12827. *
  12828. * _.toInteger(3.2);
  12829. * // => 3
  12830. *
  12831. * _.toInteger(Number.MIN_VALUE);
  12832. * // => 0
  12833. *
  12834. * _.toInteger(Infinity);
  12835. * // => 1.7976931348623157e+308
  12836. *
  12837. * _.toInteger('3.2');
  12838. * // => 3
  12839. */
  12840. function toInteger(value) {
  12841. var result = toFinite(value),
  12842. remainder = result % 1;
  12843. return result === result ? (remainder ? result - remainder : result) : 0;
  12844. }
  12845. /**
  12846. * Converts `value` to an integer suitable for use as the length of an
  12847. * array-like object.
  12848. *
  12849. * **Note:** This method is based on
  12850. * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).
  12851. *
  12852. * @static
  12853. * @memberOf _
  12854. * @since 4.0.0
  12855. * @category Lang
  12856. * @param {*} value The value to convert.
  12857. * @returns {number} Returns the converted integer.
  12858. * @example
  12859. *
  12860. * _.toLength(3.2);
  12861. * // => 3
  12862. *
  12863. * _.toLength(Number.MIN_VALUE);
  12864. * // => 0
  12865. *
  12866. * _.toLength(Infinity);
  12867. * // => 4294967295
  12868. *
  12869. * _.toLength('3.2');
  12870. * // => 3
  12871. */
  12872. function toLength(value) {
  12873. return value ? baseClamp(toInteger(value), 0, MAX_ARRAY_LENGTH) : 0;
  12874. }
  12875. /**
  12876. * Converts `value` to a number.
  12877. *
  12878. * @static
  12879. * @memberOf _
  12880. * @since 4.0.0
  12881. * @category Lang
  12882. * @param {*} value The value to process.
  12883. * @returns {number} Returns the number.
  12884. * @example
  12885. *
  12886. * _.toNumber(3.2);
  12887. * // => 3.2
  12888. *
  12889. * _.toNumber(Number.MIN_VALUE);
  12890. * // => 5e-324
  12891. *
  12892. * _.toNumber(Infinity);
  12893. * // => Infinity
  12894. *
  12895. * _.toNumber('3.2');
  12896. * // => 3.2
  12897. */
  12898. function toNumber(value) {
  12899. if (typeof value == 'number') {
  12900. return value;
  12901. }
  12902. if (isSymbol(value)) {
  12903. return NAN;
  12904. }
  12905. if (isObject(value)) {
  12906. var other = typeof value.valueOf == 'function' ? value.valueOf() : value;
  12907. value = isObject(other) ? (other + '') : other;
  12908. }
  12909. if (typeof value != 'string') {
  12910. return value === 0 ? value : +value;
  12911. }
  12912. value = baseTrim(value);
  12913. var isBinary = reIsBinary.test(value);
  12914. return (isBinary || reIsOctal.test(value))
  12915. ? freeParseInt(value.slice(2), isBinary ? 2 : 8)
  12916. : (reIsBadHex.test(value) ? NAN : +value);
  12917. }
  12918. /**
  12919. * Converts `value` to a plain object flattening inherited enumerable string
  12920. * keyed properties of `value` to own properties of the plain object.
  12921. *
  12922. * @static
  12923. * @memberOf _
  12924. * @since 3.0.0
  12925. * @category Lang
  12926. * @param {*} value The value to convert.
  12927. * @returns {Object} Returns the converted plain object.
  12928. * @example
  12929. *
  12930. * function Foo() {
  12931. * this.b = 2;
  12932. * }
  12933. *
  12934. * Foo.prototype.c = 3;
  12935. *
  12936. * _.assign({ 'a': 1 }, new Foo);
  12937. * // => { 'a': 1, 'b': 2 }
  12938. *
  12939. * _.assign({ 'a': 1 }, _.toPlainObject(new Foo));
  12940. * // => { 'a': 1, 'b': 2, 'c': 3 }
  12941. */
  12942. function toPlainObject(value) {
  12943. return copyObject(value, keysIn(value));
  12944. }
  12945. /**
  12946. * Converts `value` to a safe integer. A safe integer can be compared and
  12947. * represented correctly.
  12948. *
  12949. * @static
  12950. * @memberOf _
  12951. * @since 4.0.0
  12952. * @category Lang
  12953. * @param {*} value The value to convert.
  12954. * @returns {number} Returns the converted integer.
  12955. * @example
  12956. *
  12957. * _.toSafeInteger(3.2);
  12958. * // => 3
  12959. *
  12960. * _.toSafeInteger(Number.MIN_VALUE);
  12961. * // => 0
  12962. *
  12963. * _.toSafeInteger(Infinity);
  12964. * // => 9007199254740991
  12965. *
  12966. * _.toSafeInteger('3.2');
  12967. * // => 3
  12968. */
  12969. function toSafeInteger(value) {
  12970. return value
  12971. ? baseClamp(toInteger(value), -MAX_SAFE_INTEGER, MAX_SAFE_INTEGER)
  12972. : (value === 0 ? value : 0);
  12973. }
  12974. /**
  12975. * Converts `value` to a string. An empty string is returned for `null`
  12976. * and `undefined` values. The sign of `-0` is preserved.
  12977. *
  12978. * @static
  12979. * @memberOf _
  12980. * @since 4.0.0
  12981. * @category Lang
  12982. * @param {*} value The value to convert.
  12983. * @returns {string} Returns the converted string.
  12984. * @example
  12985. *
  12986. * _.toString(null);
  12987. * // => ''
  12988. *
  12989. * _.toString(-0);
  12990. * // => '-0'
  12991. *
  12992. * _.toString([1, 2, 3]);
  12993. * // => '1,2,3'
  12994. */
  12995. function toString(value) {
  12996. return value == null ? '' : baseToString(value);
  12997. }
  12998. /*------------------------------------------------------------------------*/
  12999. /**
  13000. * Assigns own enumerable string keyed properties of source objects to the
  13001. * destination object. Source objects are applied from left to right.
  13002. * Subsequent sources overwrite property assignments of previous sources.
  13003. *
  13004. * **Note:** This method mutates `object` and is loosely based on
  13005. * [`Object.assign`](https://mdn.io/Object/assign).
  13006. *
  13007. * @static
  13008. * @memberOf _
  13009. * @since 0.10.0
  13010. * @category Object
  13011. * @param {Object} object The destination object.
  13012. * @param {...Object} [sources] The source objects.
  13013. * @returns {Object} Returns `object`.
  13014. * @see _.assignIn
  13015. * @example
  13016. *
  13017. * function Foo() {
  13018. * this.a = 1;
  13019. * }
  13020. *
  13021. * function Bar() {
  13022. * this.c = 3;
  13023. * }
  13024. *
  13025. * Foo.prototype.b = 2;
  13026. * Bar.prototype.d = 4;
  13027. *
  13028. * _.assign({ 'a': 0 }, new Foo, new Bar);
  13029. * // => { 'a': 1, 'c': 3 }
  13030. */
  13031. var assign = createAssigner(function(object, source) {
  13032. if (isPrototype(source) || isArrayLike(source)) {
  13033. copyObject(source, keys(source), object);
  13034. return;
  13035. }
  13036. for (var key in source) {
  13037. if (hasOwnProperty.call(source, key)) {
  13038. assignValue(object, key, source[key]);
  13039. }
  13040. }
  13041. });
  13042. /**
  13043. * This method is like `_.assign` except that it iterates over own and
  13044. * inherited source properties.
  13045. *
  13046. * **Note:** This method mutates `object`.
  13047. *
  13048. * @static
  13049. * @memberOf _
  13050. * @since 4.0.0
  13051. * @alias extend
  13052. * @category Object
  13053. * @param {Object} object The destination object.
  13054. * @param {...Object} [sources] The source objects.
  13055. * @returns {Object} Returns `object`.
  13056. * @see _.assign
  13057. * @example
  13058. *
  13059. * function Foo() {
  13060. * this.a = 1;
  13061. * }
  13062. *
  13063. * function Bar() {
  13064. * this.c = 3;
  13065. * }
  13066. *
  13067. * Foo.prototype.b = 2;
  13068. * Bar.prototype.d = 4;
  13069. *
  13070. * _.assignIn({ 'a': 0 }, new Foo, new Bar);
  13071. * // => { 'a': 1, 'b': 2, 'c': 3, 'd': 4 }
  13072. */
  13073. var assignIn = createAssigner(function(object, source) {
  13074. copyObject(source, keysIn(source), object);
  13075. });
  13076. /**
  13077. * This method is like `_.assignIn` except that it accepts `customizer`
  13078. * which is invoked to produce the assigned values. If `customizer` returns
  13079. * `undefined`, assignment is handled by the method instead. The `customizer`
  13080. * is invoked with five arguments: (objValue, srcValue, key, object, source).
  13081. *
  13082. * **Note:** This method mutates `object`.
  13083. *
  13084. * @static
  13085. * @memberOf _
  13086. * @since 4.0.0
  13087. * @alias extendWith
  13088. * @category Object
  13089. * @param {Object} object The destination object.
  13090. * @param {...Object} sources The source objects.
  13091. * @param {Function} [customizer] The function to customize assigned values.
  13092. * @returns {Object} Returns `object`.
  13093. * @see _.assignWith
  13094. * @example
  13095. *
  13096. * function customizer(objValue, srcValue) {
  13097. * return _.isUndefined(objValue) ? srcValue : objValue;
  13098. * }
  13099. *
  13100. * var defaults = _.partialRight(_.assignInWith, customizer);
  13101. *
  13102. * defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 });
  13103. * // => { 'a': 1, 'b': 2 }
  13104. */
  13105. var assignInWith = createAssigner(function(object, source, srcIndex, customizer) {
  13106. copyObject(source, keysIn(source), object, customizer);
  13107. });
  13108. /**
  13109. * This method is like `_.assign` except that it accepts `customizer`
  13110. * which is invoked to produce the assigned values. If `customizer` returns
  13111. * `undefined`, assignment is handled by the method instead. The `customizer`
  13112. * is invoked with five arguments: (objValue, srcValue, key, object, source).
  13113. *
  13114. * **Note:** This method mutates `object`.
  13115. *
  13116. * @static
  13117. * @memberOf _
  13118. * @since 4.0.0
  13119. * @category Object
  13120. * @param {Object} object The destination object.
  13121. * @param {...Object} sources The source objects.
  13122. * @param {Function} [customizer] The function to customize assigned values.
  13123. * @returns {Object} Returns `object`.
  13124. * @see _.assignInWith
  13125. * @example
  13126. *
  13127. * function customizer(objValue, srcValue) {
  13128. * return _.isUndefined(objValue) ? srcValue : objValue;
  13129. * }
  13130. *
  13131. * var defaults = _.partialRight(_.assignWith, customizer);
  13132. *
  13133. * defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 });
  13134. * // => { 'a': 1, 'b': 2 }
  13135. */
  13136. var assignWith = createAssigner(function(object, source, srcIndex, customizer) {
  13137. copyObject(source, keys(source), object, customizer);
  13138. });
  13139. /**
  13140. * Creates an array of values corresponding to `paths` of `object`.
  13141. *
  13142. * @static
  13143. * @memberOf _
  13144. * @since 1.0.0
  13145. * @category Object
  13146. * @param {Object} object The object to iterate over.
  13147. * @param {...(string|string[])} [paths] The property paths to pick.
  13148. * @returns {Array} Returns the picked values.
  13149. * @example
  13150. *
  13151. * var object = { 'a': [{ 'b': { 'c': 3 } }, 4] };
  13152. *
  13153. * _.at(object, ['a[0].b.c', 'a[1]']);
  13154. * // => [3, 4]
  13155. */
  13156. var at = flatRest(baseAt);
  13157. /**
  13158. * Creates an object that inherits from the `prototype` object. If a
  13159. * `properties` object is given, its own enumerable string keyed properties
  13160. * are assigned to the created object.
  13161. *
  13162. * @static
  13163. * @memberOf _
  13164. * @since 2.3.0
  13165. * @category Object
  13166. * @param {Object} prototype The object to inherit from.
  13167. * @param {Object} [properties] The properties to assign to the object.
  13168. * @returns {Object} Returns the new object.
  13169. * @example
  13170. *
  13171. * function Shape() {
  13172. * this.x = 0;
  13173. * this.y = 0;
  13174. * }
  13175. *
  13176. * function Circle() {
  13177. * Shape.call(this);
  13178. * }
  13179. *
  13180. * Circle.prototype = _.create(Shape.prototype, {
  13181. * 'constructor': Circle
  13182. * });
  13183. *
  13184. * var circle = new Circle;
  13185. * circle instanceof Circle;
  13186. * // => true
  13187. *
  13188. * circle instanceof Shape;
  13189. * // => true
  13190. */
  13191. function create(prototype, properties) {
  13192. var result = baseCreate(prototype);
  13193. return properties == null ? result : baseAssign(result, properties);
  13194. }
  13195. /**
  13196. * Assigns own and inherited enumerable string keyed properties of source
  13197. * objects to the destination object for all destination properties that
  13198. * resolve to `undefined`. Source objects are applied from left to right.
  13199. * Once a property is set, additional values of the same property are ignored.
  13200. *
  13201. * **Note:** This method mutates `object`.
  13202. *
  13203. * @static
  13204. * @since 0.1.0
  13205. * @memberOf _
  13206. * @category Object
  13207. * @param {Object} object The destination object.
  13208. * @param {...Object} [sources] The source objects.
  13209. * @returns {Object} Returns `object`.
  13210. * @see _.defaultsDeep
  13211. * @example
  13212. *
  13213. * _.defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 });
  13214. * // => { 'a': 1, 'b': 2 }
  13215. */
  13216. var defaults = baseRest(function(object, sources) {
  13217. object = Object(object);
  13218. var index = -1;
  13219. var length = sources.length;
  13220. var guard = length > 2 ? sources[2] : undefined;
  13221. if (guard && isIterateeCall(sources[0], sources[1], guard)) {
  13222. length = 1;
  13223. }
  13224. while (++index < length) {
  13225. var source = sources[index];
  13226. var props = keysIn(source);
  13227. var propsIndex = -1;
  13228. var propsLength = props.length;
  13229. while (++propsIndex < propsLength) {
  13230. var key = props[propsIndex];
  13231. var value = object[key];
  13232. if (value === undefined ||
  13233. (eq(value, objectProto[key]) && !hasOwnProperty.call(object, key))) {
  13234. object[key] = source[key];
  13235. }
  13236. }
  13237. }
  13238. return object;
  13239. });
  13240. /**
  13241. * This method is like `_.defaults` except that it recursively assigns
  13242. * default properties.
  13243. *
  13244. * **Note:** This method mutates `object`.
  13245. *
  13246. * @static
  13247. * @memberOf _
  13248. * @since 3.10.0
  13249. * @category Object
  13250. * @param {Object} object The destination object.
  13251. * @param {...Object} [sources] The source objects.
  13252. * @returns {Object} Returns `object`.
  13253. * @see _.defaults
  13254. * @example
  13255. *
  13256. * _.defaultsDeep({ 'a': { 'b': 2 } }, { 'a': { 'b': 1, 'c': 3 } });
  13257. * // => { 'a': { 'b': 2, 'c': 3 } }
  13258. */
  13259. var defaultsDeep = baseRest(function(args) {
  13260. args.push(undefined, customDefaultsMerge);
  13261. return apply(mergeWith, undefined, args);
  13262. });
  13263. /**
  13264. * This method is like `_.find` except that it returns the key of the first
  13265. * element `predicate` returns truthy for instead of the element itself.
  13266. *
  13267. * @static
  13268. * @memberOf _
  13269. * @since 1.1.0
  13270. * @category Object
  13271. * @param {Object} object The object to inspect.
  13272. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  13273. * @returns {string|undefined} Returns the key of the matched element,
  13274. * else `undefined`.
  13275. * @example
  13276. *
  13277. * var users = {
  13278. * 'barney': { 'age': 36, 'active': true },
  13279. * 'fred': { 'age': 40, 'active': false },
  13280. * 'pebbles': { 'age': 1, 'active': true }
  13281. * };
  13282. *
  13283. * _.findKey(users, function(o) { return o.age < 40; });
  13284. * // => 'barney' (iteration order is not guaranteed)
  13285. *
  13286. * // The `_.matches` iteratee shorthand.
  13287. * _.findKey(users, { 'age': 1, 'active': true });
  13288. * // => 'pebbles'
  13289. *
  13290. * // The `_.matchesProperty` iteratee shorthand.
  13291. * _.findKey(users, ['active', false]);
  13292. * // => 'fred'
  13293. *
  13294. * // The `_.property` iteratee shorthand.
  13295. * _.findKey(users, 'active');
  13296. * // => 'barney'
  13297. */
  13298. function findKey(object, predicate) {
  13299. return baseFindKey(object, getIteratee(predicate, 3), baseForOwn);
  13300. }
  13301. /**
  13302. * This method is like `_.findKey` except that it iterates over elements of
  13303. * a collection in the opposite order.
  13304. *
  13305. * @static
  13306. * @memberOf _
  13307. * @since 2.0.0
  13308. * @category Object
  13309. * @param {Object} object The object to inspect.
  13310. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  13311. * @returns {string|undefined} Returns the key of the matched element,
  13312. * else `undefined`.
  13313. * @example
  13314. *
  13315. * var users = {
  13316. * 'barney': { 'age': 36, 'active': true },
  13317. * 'fred': { 'age': 40, 'active': false },
  13318. * 'pebbles': { 'age': 1, 'active': true }
  13319. * };
  13320. *
  13321. * _.findLastKey(users, function(o) { return o.age < 40; });
  13322. * // => returns 'pebbles' assuming `_.findKey` returns 'barney'
  13323. *
  13324. * // The `_.matches` iteratee shorthand.
  13325. * _.findLastKey(users, { 'age': 36, 'active': true });
  13326. * // => 'barney'
  13327. *
  13328. * // The `_.matchesProperty` iteratee shorthand.
  13329. * _.findLastKey(users, ['active', false]);
  13330. * // => 'fred'
  13331. *
  13332. * // The `_.property` iteratee shorthand.
  13333. * _.findLastKey(users, 'active');
  13334. * // => 'pebbles'
  13335. */
  13336. function findLastKey(object, predicate) {
  13337. return baseFindKey(object, getIteratee(predicate, 3), baseForOwnRight);
  13338. }
  13339. /**
  13340. * Iterates over own and inherited enumerable string keyed properties of an
  13341. * object and invokes `iteratee` for each property. The iteratee is invoked
  13342. * with three arguments: (value, key, object). Iteratee functions may exit
  13343. * iteration early by explicitly returning `false`.
  13344. *
  13345. * @static
  13346. * @memberOf _
  13347. * @since 0.3.0
  13348. * @category Object
  13349. * @param {Object} object The object to iterate over.
  13350. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  13351. * @returns {Object} Returns `object`.
  13352. * @see _.forInRight
  13353. * @example
  13354. *
  13355. * function Foo() {
  13356. * this.a = 1;
  13357. * this.b = 2;
  13358. * }
  13359. *
  13360. * Foo.prototype.c = 3;
  13361. *
  13362. * _.forIn(new Foo, function(value, key) {
  13363. * console.log(key);
  13364. * });
  13365. * // => Logs 'a', 'b', then 'c' (iteration order is not guaranteed).
  13366. */
  13367. function forIn(object, iteratee) {
  13368. return object == null
  13369. ? object
  13370. : baseFor(object, getIteratee(iteratee, 3), keysIn);
  13371. }
  13372. /**
  13373. * This method is like `_.forIn` except that it iterates over properties of
  13374. * `object` in the opposite order.
  13375. *
  13376. * @static
  13377. * @memberOf _
  13378. * @since 2.0.0
  13379. * @category Object
  13380. * @param {Object} object The object to iterate over.
  13381. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  13382. * @returns {Object} Returns `object`.
  13383. * @see _.forIn
  13384. * @example
  13385. *
  13386. * function Foo() {
  13387. * this.a = 1;
  13388. * this.b = 2;
  13389. * }
  13390. *
  13391. * Foo.prototype.c = 3;
  13392. *
  13393. * _.forInRight(new Foo, function(value, key) {
  13394. * console.log(key);
  13395. * });
  13396. * // => Logs 'c', 'b', then 'a' assuming `_.forIn` logs 'a', 'b', then 'c'.
  13397. */
  13398. function forInRight(object, iteratee) {
  13399. return object == null
  13400. ? object
  13401. : baseForRight(object, getIteratee(iteratee, 3), keysIn);
  13402. }
  13403. /**
  13404. * Iterates over own enumerable string keyed properties of an object and
  13405. * invokes `iteratee` for each property. The iteratee is invoked with three
  13406. * arguments: (value, key, object). Iteratee functions may exit iteration
  13407. * early by explicitly returning `false`.
  13408. *
  13409. * @static
  13410. * @memberOf _
  13411. * @since 0.3.0
  13412. * @category Object
  13413. * @param {Object} object The object to iterate over.
  13414. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  13415. * @returns {Object} Returns `object`.
  13416. * @see _.forOwnRight
  13417. * @example
  13418. *
  13419. * function Foo() {
  13420. * this.a = 1;
  13421. * this.b = 2;
  13422. * }
  13423. *
  13424. * Foo.prototype.c = 3;
  13425. *
  13426. * _.forOwn(new Foo, function(value, key) {
  13427. * console.log(key);
  13428. * });
  13429. * // => Logs 'a' then 'b' (iteration order is not guaranteed).
  13430. */
  13431. function forOwn(object, iteratee) {
  13432. return object && baseForOwn(object, getIteratee(iteratee, 3));
  13433. }
  13434. /**
  13435. * This method is like `_.forOwn` except that it iterates over properties of
  13436. * `object` in the opposite order.
  13437. *
  13438. * @static
  13439. * @memberOf _
  13440. * @since 2.0.0
  13441. * @category Object
  13442. * @param {Object} object The object to iterate over.
  13443. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  13444. * @returns {Object} Returns `object`.
  13445. * @see _.forOwn
  13446. * @example
  13447. *
  13448. * function Foo() {
  13449. * this.a = 1;
  13450. * this.b = 2;
  13451. * }
  13452. *
  13453. * Foo.prototype.c = 3;
  13454. *
  13455. * _.forOwnRight(new Foo, function(value, key) {
  13456. * console.log(key);
  13457. * });
  13458. * // => Logs 'b' then 'a' assuming `_.forOwn` logs 'a' then 'b'.
  13459. */
  13460. function forOwnRight(object, iteratee) {
  13461. return object && baseForOwnRight(object, getIteratee(iteratee, 3));
  13462. }
  13463. /**
  13464. * Creates an array of function property names from own enumerable properties
  13465. * of `object`.
  13466. *
  13467. * @static
  13468. * @since 0.1.0
  13469. * @memberOf _
  13470. * @category Object
  13471. * @param {Object} object The object to inspect.
  13472. * @returns {Array} Returns the function names.
  13473. * @see _.functionsIn
  13474. * @example
  13475. *
  13476. * function Foo() {
  13477. * this.a = _.constant('a');
  13478. * this.b = _.constant('b');
  13479. * }
  13480. *
  13481. * Foo.prototype.c = _.constant('c');
  13482. *
  13483. * _.functions(new Foo);
  13484. * // => ['a', 'b']
  13485. */
  13486. function functions(object) {
  13487. return object == null ? [] : baseFunctions(object, keys(object));
  13488. }
  13489. /**
  13490. * Creates an array of function property names from own and inherited
  13491. * enumerable properties of `object`.
  13492. *
  13493. * @static
  13494. * @memberOf _
  13495. * @since 4.0.0
  13496. * @category Object
  13497. * @param {Object} object The object to inspect.
  13498. * @returns {Array} Returns the function names.
  13499. * @see _.functions
  13500. * @example
  13501. *
  13502. * function Foo() {
  13503. * this.a = _.constant('a');
  13504. * this.b = _.constant('b');
  13505. * }
  13506. *
  13507. * Foo.prototype.c = _.constant('c');
  13508. *
  13509. * _.functionsIn(new Foo);
  13510. * // => ['a', 'b', 'c']
  13511. */
  13512. function functionsIn(object) {
  13513. return object == null ? [] : baseFunctions(object, keysIn(object));
  13514. }
  13515. /**
  13516. * Gets the value at `path` of `object`. If the resolved value is
  13517. * `undefined`, the `defaultValue` is returned in its place.
  13518. *
  13519. * @static
  13520. * @memberOf _
  13521. * @since 3.7.0
  13522. * @category Object
  13523. * @param {Object} object The object to query.
  13524. * @param {Array|string} path The path of the property to get.
  13525. * @param {*} [defaultValue] The value returned for `undefined` resolved values.
  13526. * @returns {*} Returns the resolved value.
  13527. * @example
  13528. *
  13529. * var object = { 'a': [{ 'b': { 'c': 3 } }] };
  13530. *
  13531. * _.get(object, 'a[0].b.c');
  13532. * // => 3
  13533. *
  13534. * _.get(object, ['a', '0', 'b', 'c']);
  13535. * // => 3
  13536. *
  13537. * _.get(object, 'a.b.c', 'default');
  13538. * // => 'default'
  13539. */
  13540. function get(object, path, defaultValue) {
  13541. var result = object == null ? undefined : baseGet(object, path);
  13542. return result === undefined ? defaultValue : result;
  13543. }
  13544. /**
  13545. * Checks if `path` is a direct property of `object`.
  13546. *
  13547. * @static
  13548. * @since 0.1.0
  13549. * @memberOf _
  13550. * @category Object
  13551. * @param {Object} object The object to query.
  13552. * @param {Array|string} path The path to check.
  13553. * @returns {boolean} Returns `true` if `path` exists, else `false`.
  13554. * @example
  13555. *
  13556. * var object = { 'a': { 'b': 2 } };
  13557. * var other = _.create({ 'a': _.create({ 'b': 2 }) });
  13558. *
  13559. * _.has(object, 'a');
  13560. * // => true
  13561. *
  13562. * _.has(object, 'a.b');
  13563. * // => true
  13564. *
  13565. * _.has(object, ['a', 'b']);
  13566. * // => true
  13567. *
  13568. * _.has(other, 'a');
  13569. * // => false
  13570. */
  13571. function has(object, path) {
  13572. return object != null && hasPath(object, path, baseHas);
  13573. }
  13574. /**
  13575. * Checks if `path` is a direct or inherited property of `object`.
  13576. *
  13577. * @static
  13578. * @memberOf _
  13579. * @since 4.0.0
  13580. * @category Object
  13581. * @param {Object} object The object to query.
  13582. * @param {Array|string} path The path to check.
  13583. * @returns {boolean} Returns `true` if `path` exists, else `false`.
  13584. * @example
  13585. *
  13586. * var object = _.create({ 'a': _.create({ 'b': 2 }) });
  13587. *
  13588. * _.hasIn(object, 'a');
  13589. * // => true
  13590. *
  13591. * _.hasIn(object, 'a.b');
  13592. * // => true
  13593. *
  13594. * _.hasIn(object, ['a', 'b']);
  13595. * // => true
  13596. *
  13597. * _.hasIn(object, 'b');
  13598. * // => false
  13599. */
  13600. function hasIn(object, path) {
  13601. return object != null && hasPath(object, path, baseHasIn);
  13602. }
  13603. /**
  13604. * Creates an object composed of the inverted keys and values of `object`.
  13605. * If `object` contains duplicate values, subsequent values overwrite
  13606. * property assignments of previous values.
  13607. *
  13608. * @static
  13609. * @memberOf _
  13610. * @since 0.7.0
  13611. * @category Object
  13612. * @param {Object} object The object to invert.
  13613. * @returns {Object} Returns the new inverted object.
  13614. * @example
  13615. *
  13616. * var object = { 'a': 1, 'b': 2, 'c': 1 };
  13617. *
  13618. * _.invert(object);
  13619. * // => { '1': 'c', '2': 'b' }
  13620. */
  13621. var invert = createInverter(function(result, value, key) {
  13622. if (value != null &&
  13623. typeof value.toString != 'function') {
  13624. value = nativeObjectToString.call(value);
  13625. }
  13626. result[value] = key;
  13627. }, constant(identity));
  13628. /**
  13629. * This method is like `_.invert` except that the inverted object is generated
  13630. * from the results of running each element of `object` thru `iteratee`. The
  13631. * corresponding inverted value of each inverted key is an array of keys
  13632. * responsible for generating the inverted value. The iteratee is invoked
  13633. * with one argument: (value).
  13634. *
  13635. * @static
  13636. * @memberOf _
  13637. * @since 4.1.0
  13638. * @category Object
  13639. * @param {Object} object The object to invert.
  13640. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  13641. * @returns {Object} Returns the new inverted object.
  13642. * @example
  13643. *
  13644. * var object = { 'a': 1, 'b': 2, 'c': 1 };
  13645. *
  13646. * _.invertBy(object);
  13647. * // => { '1': ['a', 'c'], '2': ['b'] }
  13648. *
  13649. * _.invertBy(object, function(value) {
  13650. * return 'group' + value;
  13651. * });
  13652. * // => { 'group1': ['a', 'c'], 'group2': ['b'] }
  13653. */
  13654. var invertBy = createInverter(function(result, value, key) {
  13655. if (value != null &&
  13656. typeof value.toString != 'function') {
  13657. value = nativeObjectToString.call(value);
  13658. }
  13659. if (hasOwnProperty.call(result, value)) {
  13660. result[value].push(key);
  13661. } else {
  13662. result[value] = [key];
  13663. }
  13664. }, getIteratee);
  13665. /**
  13666. * Invokes the method at `path` of `object`.
  13667. *
  13668. * @static
  13669. * @memberOf _
  13670. * @since 4.0.0
  13671. * @category Object
  13672. * @param {Object} object The object to query.
  13673. * @param {Array|string} path The path of the method to invoke.
  13674. * @param {...*} [args] The arguments to invoke the method with.
  13675. * @returns {*} Returns the result of the invoked method.
  13676. * @example
  13677. *
  13678. * var object = { 'a': [{ 'b': { 'c': [1, 2, 3, 4] } }] };
  13679. *
  13680. * _.invoke(object, 'a[0].b.c.slice', 1, 3);
  13681. * // => [2, 3]
  13682. */
  13683. var invoke = baseRest(baseInvoke);
  13684. /**
  13685. * Creates an array of the own enumerable property names of `object`.
  13686. *
  13687. * **Note:** Non-object values are coerced to objects. See the
  13688. * [ES spec](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)
  13689. * for more details.
  13690. *
  13691. * @static
  13692. * @since 0.1.0
  13693. * @memberOf _
  13694. * @category Object
  13695. * @param {Object} object The object to query.
  13696. * @returns {Array} Returns the array of property names.
  13697. * @example
  13698. *
  13699. * function Foo() {
  13700. * this.a = 1;
  13701. * this.b = 2;
  13702. * }
  13703. *
  13704. * Foo.prototype.c = 3;
  13705. *
  13706. * _.keys(new Foo);
  13707. * // => ['a', 'b'] (iteration order is not guaranteed)
  13708. *
  13709. * _.keys('hi');
  13710. * // => ['0', '1']
  13711. */
  13712. function keys(object) {
  13713. return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object);
  13714. }
  13715. /**
  13716. * Creates an array of the own and inherited enumerable property names of `object`.
  13717. *
  13718. * **Note:** Non-object values are coerced to objects.
  13719. *
  13720. * @static
  13721. * @memberOf _
  13722. * @since 3.0.0
  13723. * @category Object
  13724. * @param {Object} object The object to query.
  13725. * @returns {Array} Returns the array of property names.
  13726. * @example
  13727. *
  13728. * function Foo() {
  13729. * this.a = 1;
  13730. * this.b = 2;
  13731. * }
  13732. *
  13733. * Foo.prototype.c = 3;
  13734. *
  13735. * _.keysIn(new Foo);
  13736. * // => ['a', 'b', 'c'] (iteration order is not guaranteed)
  13737. */
  13738. function keysIn(object) {
  13739. return isArrayLike(object) ? arrayLikeKeys(object, true) : baseKeysIn(object);
  13740. }
  13741. /**
  13742. * The opposite of `_.mapValues`; this method creates an object with the
  13743. * same values as `object` and keys generated by running each own enumerable
  13744. * string keyed property of `object` thru `iteratee`. The iteratee is invoked
  13745. * with three arguments: (value, key, object).
  13746. *
  13747. * @static
  13748. * @memberOf _
  13749. * @since 3.8.0
  13750. * @category Object
  13751. * @param {Object} object The object to iterate over.
  13752. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  13753. * @returns {Object} Returns the new mapped object.
  13754. * @see _.mapValues
  13755. * @example
  13756. *
  13757. * _.mapKeys({ 'a': 1, 'b': 2 }, function(value, key) {
  13758. * return key + value;
  13759. * });
  13760. * // => { 'a1': 1, 'b2': 2 }
  13761. */
  13762. function mapKeys(object, iteratee) {
  13763. var result = {};
  13764. iteratee = getIteratee(iteratee, 3);
  13765. baseForOwn(object, function(value, key, object) {
  13766. baseAssignValue(result, iteratee(value, key, object), value);
  13767. });
  13768. return result;
  13769. }
  13770. /**
  13771. * Creates an object with the same keys as `object` and values generated
  13772. * by running each own enumerable string keyed property of `object` thru
  13773. * `iteratee`. The iteratee is invoked with three arguments:
  13774. * (value, key, object).
  13775. *
  13776. * @static
  13777. * @memberOf _
  13778. * @since 2.4.0
  13779. * @category Object
  13780. * @param {Object} object The object to iterate over.
  13781. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  13782. * @returns {Object} Returns the new mapped object.
  13783. * @see _.mapKeys
  13784. * @example
  13785. *
  13786. * var users = {
  13787. * 'fred': { 'user': 'fred', 'age': 40 },
  13788. * 'pebbles': { 'user': 'pebbles', 'age': 1 }
  13789. * };
  13790. *
  13791. * _.mapValues(users, function(o) { return o.age; });
  13792. * // => { 'fred': 40, 'pebbles': 1 } (iteration order is not guaranteed)
  13793. *
  13794. * // The `_.property` iteratee shorthand.
  13795. * _.mapValues(users, 'age');
  13796. * // => { 'fred': 40, 'pebbles': 1 } (iteration order is not guaranteed)
  13797. */
  13798. function mapValues(object, iteratee) {
  13799. var result = {};
  13800. iteratee = getIteratee(iteratee, 3);
  13801. baseForOwn(object, function(value, key, object) {
  13802. baseAssignValue(result, key, iteratee(value, key, object));
  13803. });
  13804. return result;
  13805. }
  13806. /**
  13807. * This method is like `_.assign` except that it recursively merges own and
  13808. * inherited enumerable string keyed properties of source objects into the
  13809. * destination object. Source properties that resolve to `undefined` are
  13810. * skipped if a destination value exists. Array and plain object properties
  13811. * are merged recursively. Other objects and value types are overridden by
  13812. * assignment. Source objects are applied from left to right. Subsequent
  13813. * sources overwrite property assignments of previous sources.
  13814. *
  13815. * **Note:** This method mutates `object`.
  13816. *
  13817. * @static
  13818. * @memberOf _
  13819. * @since 0.5.0
  13820. * @category Object
  13821. * @param {Object} object The destination object.
  13822. * @param {...Object} [sources] The source objects.
  13823. * @returns {Object} Returns `object`.
  13824. * @example
  13825. *
  13826. * var object = {
  13827. * 'a': [{ 'b': 2 }, { 'd': 4 }]
  13828. * };
  13829. *
  13830. * var other = {
  13831. * 'a': [{ 'c': 3 }, { 'e': 5 }]
  13832. * };
  13833. *
  13834. * _.merge(object, other);
  13835. * // => { 'a': [{ 'b': 2, 'c': 3 }, { 'd': 4, 'e': 5 }] }
  13836. */
  13837. var merge = createAssigner(function(object, source, srcIndex) {
  13838. baseMerge(object, source, srcIndex);
  13839. });
  13840. /**
  13841. * This method is like `_.merge` except that it accepts `customizer` which
  13842. * is invoked to produce the merged values of the destination and source
  13843. * properties. If `customizer` returns `undefined`, merging is handled by the
  13844. * method instead. The `customizer` is invoked with six arguments:
  13845. * (objValue, srcValue, key, object, source, stack).
  13846. *
  13847. * **Note:** This method mutates `object`.
  13848. *
  13849. * @static
  13850. * @memberOf _
  13851. * @since 4.0.0
  13852. * @category Object
  13853. * @param {Object} object The destination object.
  13854. * @param {...Object} sources The source objects.
  13855. * @param {Function} customizer The function to customize assigned values.
  13856. * @returns {Object} Returns `object`.
  13857. * @example
  13858. *
  13859. * function customizer(objValue, srcValue) {
  13860. * if (_.isArray(objValue)) {
  13861. * return objValue.concat(srcValue);
  13862. * }
  13863. * }
  13864. *
  13865. * var object = { 'a': [1], 'b': [2] };
  13866. * var other = { 'a': [3], 'b': [4] };
  13867. *
  13868. * _.mergeWith(object, other, customizer);
  13869. * // => { 'a': [1, 3], 'b': [2, 4] }
  13870. */
  13871. var mergeWith = createAssigner(function(object, source, srcIndex, customizer) {
  13872. baseMerge(object, source, srcIndex, customizer);
  13873. });
  13874. /**
  13875. * The opposite of `_.pick`; this method creates an object composed of the
  13876. * own and inherited enumerable property paths of `object` that are not omitted.
  13877. *
  13878. * **Note:** This method is considerably slower than `_.pick`.
  13879. *
  13880. * @static
  13881. * @since 0.1.0
  13882. * @memberOf _
  13883. * @category Object
  13884. * @param {Object} object The source object.
  13885. * @param {...(string|string[])} [paths] The property paths to omit.
  13886. * @returns {Object} Returns the new object.
  13887. * @example
  13888. *
  13889. * var object = { 'a': 1, 'b': '2', 'c': 3 };
  13890. *
  13891. * _.omit(object, ['a', 'c']);
  13892. * // => { 'b': '2' }
  13893. */
  13894. var omit = flatRest(function(object, paths) {
  13895. var result = {};
  13896. if (object == null) {
  13897. return result;
  13898. }
  13899. var isDeep = false;
  13900. paths = arrayMap(paths, function(path) {
  13901. path = castPath(path, object);
  13902. isDeep || (isDeep = path.length > 1);
  13903. return path;
  13904. });
  13905. copyObject(object, getAllKeysIn(object), result);
  13906. if (isDeep) {
  13907. result = baseClone(result, CLONE_DEEP_FLAG | CLONE_FLAT_FLAG | CLONE_SYMBOLS_FLAG, customOmitClone);
  13908. }
  13909. var length = paths.length;
  13910. while (length--) {
  13911. baseUnset(result, paths[length]);
  13912. }
  13913. return result;
  13914. });
  13915. /**
  13916. * The opposite of `_.pickBy`; this method creates an object composed of
  13917. * the own and inherited enumerable string keyed properties of `object` that
  13918. * `predicate` doesn't return truthy for. The predicate is invoked with two
  13919. * 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. * _.omitBy(object, _.isNumber);
  13933. * // => { 'b': '2' }
  13934. */
  13935. function omitBy(object, predicate) {
  13936. return pickBy(object, negate(getIteratee(predicate)));
  13937. }
  13938. /**
  13939. * Creates an object composed of the picked `object` properties.
  13940. *
  13941. * @static
  13942. * @since 0.1.0
  13943. * @memberOf _
  13944. * @category Object
  13945. * @param {Object} object The source object.
  13946. * @param {...(string|string[])} [paths] The property paths to pick.
  13947. * @returns {Object} Returns the new object.
  13948. * @example
  13949. *
  13950. * var object = { 'a': 1, 'b': '2', 'c': 3 };
  13951. *
  13952. * _.pick(object, ['a', 'c']);
  13953. * // => { 'a': 1, 'c': 3 }
  13954. */
  13955. var pick = flatRest(function(object, paths) {
  13956. return object == null ? {} : basePick(object, paths);
  13957. });
  13958. /**
  13959. * Creates an object composed of the `object` properties `predicate` returns
  13960. * truthy for. The predicate is invoked with two arguments: (value, key).
  13961. *
  13962. * @static
  13963. * @memberOf _
  13964. * @since 4.0.0
  13965. * @category Object
  13966. * @param {Object} object The source object.
  13967. * @param {Function} [predicate=_.identity] The function invoked per property.
  13968. * @returns {Object} Returns the new object.
  13969. * @example
  13970. *
  13971. * var object = { 'a': 1, 'b': '2', 'c': 3 };
  13972. *
  13973. * _.pickBy(object, _.isNumber);
  13974. * // => { 'a': 1, 'c': 3 }
  13975. */
  13976. function pickBy(object, predicate) {
  13977. if (object == null) {
  13978. return {};
  13979. }
  13980. var props = arrayMap(getAllKeysIn(object), function(prop) {
  13981. return [prop];
  13982. });
  13983. predicate = getIteratee(predicate);
  13984. return basePickBy(object, props, function(value, path) {
  13985. return predicate(value, path[0]);
  13986. });
  13987. }
  13988. /**
  13989. * This method is like `_.get` except that if the resolved value is a
  13990. * function it's invoked with the `this` binding of its parent object and
  13991. * its result is returned.
  13992. *
  13993. * @static
  13994. * @since 0.1.0
  13995. * @memberOf _
  13996. * @category Object
  13997. * @param {Object} object The object to query.
  13998. * @param {Array|string} path The path of the property to resolve.
  13999. * @param {*} [defaultValue] The value returned for `undefined` resolved values.
  14000. * @returns {*} Returns the resolved value.
  14001. * @example
  14002. *
  14003. * var object = { 'a': [{ 'b': { 'c1': 3, 'c2': _.constant(4) } }] };
  14004. *
  14005. * _.result(object, 'a[0].b.c1');
  14006. * // => 3
  14007. *
  14008. * _.result(object, 'a[0].b.c2');
  14009. * // => 4
  14010. *
  14011. * _.result(object, 'a[0].b.c3', 'default');
  14012. * // => 'default'
  14013. *
  14014. * _.result(object, 'a[0].b.c3', _.constant('default'));
  14015. * // => 'default'
  14016. */
  14017. function result(object, path, defaultValue) {
  14018. path = castPath(path, object);
  14019. var index = -1,
  14020. length = path.length;
  14021. // Ensure the loop is entered when path is empty.
  14022. if (!length) {
  14023. length = 1;
  14024. object = undefined;
  14025. }
  14026. while (++index < length) {
  14027. var value = object == null ? undefined : object[toKey(path[index])];
  14028. if (value === undefined) {
  14029. index = length;
  14030. value = defaultValue;
  14031. }
  14032. object = isFunction(value) ? value.call(object) : value;
  14033. }
  14034. return object;
  14035. }
  14036. /**
  14037. * Sets the value at `path` of `object`. If a portion of `path` doesn't exist,
  14038. * it's created. Arrays are created for missing index properties while objects
  14039. * are created for all other missing properties. Use `_.setWith` to customize
  14040. * `path` creation.
  14041. *
  14042. * **Note:** This method mutates `object`.
  14043. *
  14044. * @static
  14045. * @memberOf _
  14046. * @since 3.7.0
  14047. * @category Object
  14048. * @param {Object} object The object to modify.
  14049. * @param {Array|string} path The path of the property to set.
  14050. * @param {*} value The value to set.
  14051. * @returns {Object} Returns `object`.
  14052. * @example
  14053. *
  14054. * var object = { 'a': [{ 'b': { 'c': 3 } }] };
  14055. *
  14056. * _.set(object, 'a[0].b.c', 4);
  14057. * console.log(object.a[0].b.c);
  14058. * // => 4
  14059. *
  14060. * _.set(object, ['x', '0', 'y', 'z'], 5);
  14061. * console.log(object.x[0].y.z);
  14062. * // => 5
  14063. */
  14064. function set(object, path, value) {
  14065. return object == null ? object : baseSet(object, path, value);
  14066. }
  14067. /**
  14068. * This method is like `_.set` except that it accepts `customizer` which is
  14069. * invoked to produce the objects of `path`. If `customizer` returns `undefined`
  14070. * path creation is handled by the method instead. The `customizer` is invoked
  14071. * with three arguments: (nsValue, key, nsObject).
  14072. *
  14073. * **Note:** This method mutates `object`.
  14074. *
  14075. * @static
  14076. * @memberOf _
  14077. * @since 4.0.0
  14078. * @category Object
  14079. * @param {Object} object The object to modify.
  14080. * @param {Array|string} path The path of the property to set.
  14081. * @param {*} value The value to set.
  14082. * @param {Function} [customizer] The function to customize assigned values.
  14083. * @returns {Object} Returns `object`.
  14084. * @example
  14085. *
  14086. * var object = {};
  14087. *
  14088. * _.setWith(object, '[0][1]', 'a', Object);
  14089. * // => { '0': { '1': 'a' } }
  14090. */
  14091. function setWith(object, path, value, customizer) {
  14092. customizer = typeof customizer == 'function' ? customizer : undefined;
  14093. return object == null ? object : baseSet(object, path, value, customizer);
  14094. }
  14095. /**
  14096. * Creates an array of own enumerable string keyed-value pairs for `object`
  14097. * which can be consumed by `_.fromPairs`. If `object` is a map or set, its
  14098. * entries are returned.
  14099. *
  14100. * @static
  14101. * @memberOf _
  14102. * @since 4.0.0
  14103. * @alias entries
  14104. * @category Object
  14105. * @param {Object} object The object to query.
  14106. * @returns {Array} Returns the key-value pairs.
  14107. * @example
  14108. *
  14109. * function Foo() {
  14110. * this.a = 1;
  14111. * this.b = 2;
  14112. * }
  14113. *
  14114. * Foo.prototype.c = 3;
  14115. *
  14116. * _.toPairs(new Foo);
  14117. * // => [['a', 1], ['b', 2]] (iteration order is not guaranteed)
  14118. */
  14119. var toPairs = createToPairs(keys);
  14120. /**
  14121. * Creates an array of own and inherited enumerable string keyed-value pairs
  14122. * for `object` which can be consumed by `_.fromPairs`. If `object` is a map
  14123. * or set, its entries are returned.
  14124. *
  14125. * @static
  14126. * @memberOf _
  14127. * @since 4.0.0
  14128. * @alias entriesIn
  14129. * @category Object
  14130. * @param {Object} object The object to query.
  14131. * @returns {Array} Returns the key-value pairs.
  14132. * @example
  14133. *
  14134. * function Foo() {
  14135. * this.a = 1;
  14136. * this.b = 2;
  14137. * }
  14138. *
  14139. * Foo.prototype.c = 3;
  14140. *
  14141. * _.toPairsIn(new Foo);
  14142. * // => [['a', 1], ['b', 2], ['c', 3]] (iteration order is not guaranteed)
  14143. */
  14144. var toPairsIn = createToPairs(keysIn);
  14145. /**
  14146. * An alternative to `_.reduce`; this method transforms `object` to a new
  14147. * `accumulator` object which is the result of running each of its own
  14148. * enumerable string keyed properties thru `iteratee`, with each invocation
  14149. * potentially mutating the `accumulator` object. If `accumulator` is not
  14150. * provided, a new object with the same `[[Prototype]]` will be used. The
  14151. * iteratee is invoked with four arguments: (accumulator, value, key, object).
  14152. * Iteratee functions may exit iteration early by explicitly returning `false`.
  14153. *
  14154. * @static
  14155. * @memberOf _
  14156. * @since 1.3.0
  14157. * @category Object
  14158. * @param {Object} object The object to iterate over.
  14159. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  14160. * @param {*} [accumulator] The custom accumulator value.
  14161. * @returns {*} Returns the accumulated value.
  14162. * @example
  14163. *
  14164. * _.transform([2, 3, 4], function(result, n) {
  14165. * result.push(n *= n);
  14166. * return n % 2 == 0;
  14167. * }, []);
  14168. * // => [4, 9]
  14169. *
  14170. * _.transform({ 'a': 1, 'b': 2, 'c': 1 }, function(result, value, key) {
  14171. * (result[value] || (result[value] = [])).push(key);
  14172. * }, {});
  14173. * // => { '1': ['a', 'c'], '2': ['b'] }
  14174. */
  14175. function transform(object, iteratee, accumulator) {
  14176. var isArr = isArray(object),
  14177. isArrLike = isArr || isBuffer(object) || isTypedArray(object);
  14178. iteratee = getIteratee(iteratee, 4);
  14179. if (accumulator == null) {
  14180. var Ctor = object && object.constructor;
  14181. if (isArrLike) {
  14182. accumulator = isArr ? new Ctor : [];
  14183. }
  14184. else if (isObject(object)) {
  14185. accumulator = isFunction(Ctor) ? baseCreate(getPrototype(object)) : {};
  14186. }
  14187. else {
  14188. accumulator = {};
  14189. }
  14190. }
  14191. (isArrLike ? arrayEach : baseForOwn)(object, function(value, index, object) {
  14192. return iteratee(accumulator, value, index, object);
  14193. });
  14194. return accumulator;
  14195. }
  14196. /**
  14197. * Removes the property at `path` of `object`.
  14198. *
  14199. * **Note:** This method mutates `object`.
  14200. *
  14201. * @static
  14202. * @memberOf _
  14203. * @since 4.0.0
  14204. * @category Object
  14205. * @param {Object} object The object to modify.
  14206. * @param {Array|string} path The path of the property to unset.
  14207. * @returns {boolean} Returns `true` if the property is deleted, else `false`.
  14208. * @example
  14209. *
  14210. * var object = { 'a': [{ 'b': { 'c': 7 } }] };
  14211. * _.unset(object, 'a[0].b.c');
  14212. * // => true
  14213. *
  14214. * console.log(object);
  14215. * // => { 'a': [{ 'b': {} }] };
  14216. *
  14217. * _.unset(object, ['a', '0', 'b', 'c']);
  14218. * // => true
  14219. *
  14220. * console.log(object);
  14221. * // => { 'a': [{ 'b': {} }] };
  14222. */
  14223. function unset(object, path) {
  14224. return object == null ? true : baseUnset(object, path);
  14225. }
  14226. /**
  14227. * This method is like `_.set` except that accepts `updater` to produce the
  14228. * value to set. Use `_.updateWith` to customize `path` creation. The `updater`
  14229. * is invoked with one argument: (value).
  14230. *
  14231. * **Note:** This method mutates `object`.
  14232. *
  14233. * @static
  14234. * @memberOf _
  14235. * @since 4.6.0
  14236. * @category Object
  14237. * @param {Object} object The object to modify.
  14238. * @param {Array|string} path The path of the property to set.
  14239. * @param {Function} updater The function to produce the updated value.
  14240. * @returns {Object} Returns `object`.
  14241. * @example
  14242. *
  14243. * var object = { 'a': [{ 'b': { 'c': 3 } }] };
  14244. *
  14245. * _.update(object, 'a[0].b.c', function(n) { return n * n; });
  14246. * console.log(object.a[0].b.c);
  14247. * // => 9
  14248. *
  14249. * _.update(object, 'x[0].y.z', function(n) { return n ? n + 1 : 0; });
  14250. * console.log(object.x[0].y.z);
  14251. * // => 0
  14252. */
  14253. function update(object, path, updater) {
  14254. return object == null ? object : baseUpdate(object, path, castFunction(updater));
  14255. }
  14256. /**
  14257. * This method is like `_.update` except that it accepts `customizer` which is
  14258. * invoked to produce the objects of `path`. If `customizer` returns `undefined`
  14259. * path creation is handled by the method instead. The `customizer` is invoked
  14260. * with three arguments: (nsValue, key, nsObject).
  14261. *
  14262. * **Note:** This method mutates `object`.
  14263. *
  14264. * @static
  14265. * @memberOf _
  14266. * @since 4.6.0
  14267. * @category Object
  14268. * @param {Object} object The object to modify.
  14269. * @param {Array|string} path The path of the property to set.
  14270. * @param {Function} updater The function to produce the updated value.
  14271. * @param {Function} [customizer] The function to customize assigned values.
  14272. * @returns {Object} Returns `object`.
  14273. * @example
  14274. *
  14275. * var object = {};
  14276. *
  14277. * _.updateWith(object, '[0][1]', _.constant('a'), Object);
  14278. * // => { '0': { '1': 'a' } }
  14279. */
  14280. function updateWith(object, path, updater, customizer) {
  14281. customizer = typeof customizer == 'function' ? customizer : undefined;
  14282. return object == null ? object : baseUpdate(object, path, castFunction(updater), customizer);
  14283. }
  14284. /**
  14285. * Creates an array of the own enumerable string keyed property values of `object`.
  14286. *
  14287. * **Note:** Non-object values are coerced to objects.
  14288. *
  14289. * @static
  14290. * @since 0.1.0
  14291. * @memberOf _
  14292. * @category Object
  14293. * @param {Object} object The object to query.
  14294. * @returns {Array} Returns the array of property values.
  14295. * @example
  14296. *
  14297. * function Foo() {
  14298. * this.a = 1;
  14299. * this.b = 2;
  14300. * }
  14301. *
  14302. * Foo.prototype.c = 3;
  14303. *
  14304. * _.values(new Foo);
  14305. * // => [1, 2] (iteration order is not guaranteed)
  14306. *
  14307. * _.values('hi');
  14308. * // => ['h', 'i']
  14309. */
  14310. function values(object) {
  14311. return object == null ? [] : baseValues(object, keys(object));
  14312. }
  14313. /**
  14314. * Creates an array of the own and inherited enumerable string keyed property
  14315. * values of `object`.
  14316. *
  14317. * **Note:** Non-object values are coerced to objects.
  14318. *
  14319. * @static
  14320. * @memberOf _
  14321. * @since 3.0.0
  14322. * @category Object
  14323. * @param {Object} object The object to query.
  14324. * @returns {Array} Returns the array of property values.
  14325. * @example
  14326. *
  14327. * function Foo() {
  14328. * this.a = 1;
  14329. * this.b = 2;
  14330. * }
  14331. *
  14332. * Foo.prototype.c = 3;
  14333. *
  14334. * _.valuesIn(new Foo);
  14335. * // => [1, 2, 3] (iteration order is not guaranteed)
  14336. */
  14337. function valuesIn(object) {
  14338. return object == null ? [] : baseValues(object, keysIn(object));
  14339. }
  14340. /*------------------------------------------------------------------------*/
  14341. /**
  14342. * Clamps `number` within the inclusive `lower` and `upper` bounds.
  14343. *
  14344. * @static
  14345. * @memberOf _
  14346. * @since 4.0.0
  14347. * @category Number
  14348. * @param {number} number The number to clamp.
  14349. * @param {number} [lower] The lower bound.
  14350. * @param {number} upper The upper bound.
  14351. * @returns {number} Returns the clamped number.
  14352. * @example
  14353. *
  14354. * _.clamp(-10, -5, 5);
  14355. * // => -5
  14356. *
  14357. * _.clamp(10, -5, 5);
  14358. * // => 5
  14359. */
  14360. function clamp(number, lower, upper) {
  14361. if (upper === undefined) {
  14362. upper = lower;
  14363. lower = undefined;
  14364. }
  14365. if (upper !== undefined) {
  14366. upper = toNumber(upper);
  14367. upper = upper === upper ? upper : 0;
  14368. }
  14369. if (lower !== undefined) {
  14370. lower = toNumber(lower);
  14371. lower = lower === lower ? lower : 0;
  14372. }
  14373. return baseClamp(toNumber(number), lower, upper);
  14374. }
  14375. /**
  14376. * Checks if `n` is between `start` and up to, but not including, `end`. If
  14377. * `end` is not specified, it's set to `start` with `start` then set to `0`.
  14378. * If `start` is greater than `end` the params are swapped to support
  14379. * negative ranges.
  14380. *
  14381. * @static
  14382. * @memberOf _
  14383. * @since 3.3.0
  14384. * @category Number
  14385. * @param {number} number The number to check.
  14386. * @param {number} [start=0] The start of the range.
  14387. * @param {number} end The end of the range.
  14388. * @returns {boolean} Returns `true` if `number` is in the range, else `false`.
  14389. * @see _.range, _.rangeRight
  14390. * @example
  14391. *
  14392. * _.inRange(3, 2, 4);
  14393. * // => true
  14394. *
  14395. * _.inRange(4, 8);
  14396. * // => true
  14397. *
  14398. * _.inRange(4, 2);
  14399. * // => false
  14400. *
  14401. * _.inRange(2, 2);
  14402. * // => false
  14403. *
  14404. * _.inRange(1.2, 2);
  14405. * // => true
  14406. *
  14407. * _.inRange(5.2, 4);
  14408. * // => false
  14409. *
  14410. * _.inRange(-3, -2, -6);
  14411. * // => true
  14412. */
  14413. function inRange(number, start, end) {
  14414. start = toFinite(start);
  14415. if (end === undefined) {
  14416. end = start;
  14417. start = 0;
  14418. } else {
  14419. end = toFinite(end);
  14420. }
  14421. number = toNumber(number);
  14422. return baseInRange(number, start, end);
  14423. }
  14424. /**
  14425. * Produces a random number between the inclusive `lower` and `upper` bounds.
  14426. * If only one argument is provided a number between `0` and the given number
  14427. * is returned. If `floating` is `true`, or either `lower` or `upper` are
  14428. * floats, a floating-point number is returned instead of an integer.
  14429. *
  14430. * **Note:** JavaScript follows the IEEE-754 standard for resolving
  14431. * floating-point values which can produce unexpected results.
  14432. *
  14433. * @static
  14434. * @memberOf _
  14435. * @since 0.7.0
  14436. * @category Number
  14437. * @param {number} [lower=0] The lower bound.
  14438. * @param {number} [upper=1] The upper bound.
  14439. * @param {boolean} [floating] Specify returning a floating-point number.
  14440. * @returns {number} Returns the random number.
  14441. * @example
  14442. *
  14443. * _.random(0, 5);
  14444. * // => an integer between 0 and 5
  14445. *
  14446. * _.random(5);
  14447. * // => also an integer between 0 and 5
  14448. *
  14449. * _.random(5, true);
  14450. * // => a floating-point number between 0 and 5
  14451. *
  14452. * _.random(1.2, 5.2);
  14453. * // => a floating-point number between 1.2 and 5.2
  14454. */
  14455. function random(lower, upper, floating) {
  14456. if (floating && typeof floating != 'boolean' && isIterateeCall(lower, upper, floating)) {
  14457. upper = floating = undefined;
  14458. }
  14459. if (floating === undefined) {
  14460. if (typeof upper == 'boolean') {
  14461. floating = upper;
  14462. upper = undefined;
  14463. }
  14464. else if (typeof lower == 'boolean') {
  14465. floating = lower;
  14466. lower = undefined;
  14467. }
  14468. }
  14469. if (lower === undefined && upper === undefined) {
  14470. lower = 0;
  14471. upper = 1;
  14472. }
  14473. else {
  14474. lower = toFinite(lower);
  14475. if (upper === undefined) {
  14476. upper = lower;
  14477. lower = 0;
  14478. } else {
  14479. upper = toFinite(upper);
  14480. }
  14481. }
  14482. if (lower > upper) {
  14483. var temp = lower;
  14484. lower = upper;
  14485. upper = temp;
  14486. }
  14487. if (floating || lower % 1 || upper % 1) {
  14488. var rand = nativeRandom();
  14489. return nativeMin(lower + (rand * (upper - lower + freeParseFloat('1e-' + ((rand + '').length - 1)))), upper);
  14490. }
  14491. return baseRandom(lower, upper);
  14492. }
  14493. /*------------------------------------------------------------------------*/
  14494. /**
  14495. * Converts `string` to [camel case](https://en.wikipedia.org/wiki/CamelCase).
  14496. *
  14497. * @static
  14498. * @memberOf _
  14499. * @since 3.0.0
  14500. * @category String
  14501. * @param {string} [string=''] The string to convert.
  14502. * @returns {string} Returns the camel cased string.
  14503. * @example
  14504. *
  14505. * _.camelCase('Foo Bar');
  14506. * // => 'fooBar'
  14507. *
  14508. * _.camelCase('--foo-bar--');
  14509. * // => 'fooBar'
  14510. *
  14511. * _.camelCase('__FOO_BAR__');
  14512. * // => 'fooBar'
  14513. */
  14514. var camelCase = createCompounder(function(result, word, index) {
  14515. word = word.toLowerCase();
  14516. return result + (index ? capitalize(word) : word);
  14517. });
  14518. /**
  14519. * Converts the first character of `string` to upper case and the remaining
  14520. * to lower case.
  14521. *
  14522. * @static
  14523. * @memberOf _
  14524. * @since 3.0.0
  14525. * @category String
  14526. * @param {string} [string=''] The string to capitalize.
  14527. * @returns {string} Returns the capitalized string.
  14528. * @example
  14529. *
  14530. * _.capitalize('FRED');
  14531. * // => 'Fred'
  14532. */
  14533. function capitalize(string) {
  14534. return upperFirst(toString(string).toLowerCase());
  14535. }
  14536. /**
  14537. * Deburrs `string` by converting
  14538. * [Latin-1 Supplement](https://en.wikipedia.org/wiki/Latin-1_Supplement_(Unicode_block)#Character_table)
  14539. * and [Latin Extended-A](https://en.wikipedia.org/wiki/Latin_Extended-A)
  14540. * letters to basic Latin letters and removing
  14541. * [combining diacritical marks](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks).
  14542. *
  14543. * @static
  14544. * @memberOf _
  14545. * @since 3.0.0
  14546. * @category String
  14547. * @param {string} [string=''] The string to deburr.
  14548. * @returns {string} Returns the deburred string.
  14549. * @example
  14550. *
  14551. * _.deburr('déjà vu');
  14552. * // => 'deja vu'
  14553. */
  14554. function deburr(string) {
  14555. string = toString(string);
  14556. return string && string.replace(reLatin, deburrLetter).replace(reComboMark, '');
  14557. }
  14558. /**
  14559. * Checks if `string` ends with the given target string.
  14560. *
  14561. * @static
  14562. * @memberOf _
  14563. * @since 3.0.0
  14564. * @category String
  14565. * @param {string} [string=''] The string to inspect.
  14566. * @param {string} [target] The string to search for.
  14567. * @param {number} [position=string.length] The position to search up to.
  14568. * @returns {boolean} Returns `true` if `string` ends with `target`,
  14569. * else `false`.
  14570. * @example
  14571. *
  14572. * _.endsWith('abc', 'c');
  14573. * // => true
  14574. *
  14575. * _.endsWith('abc', 'b');
  14576. * // => false
  14577. *
  14578. * _.endsWith('abc', 'b', 2);
  14579. * // => true
  14580. */
  14581. function endsWith(string, target, position) {
  14582. string = toString(string);
  14583. target = baseToString(target);
  14584. var length = string.length;
  14585. position = position === undefined
  14586. ? length
  14587. : baseClamp(toInteger(position), 0, length);
  14588. var end = position;
  14589. position -= target.length;
  14590. return position >= 0 && string.slice(position, end) == target;
  14591. }
  14592. /**
  14593. * Converts the characters "&", "<", ">", '"', and "'" in `string` to their
  14594. * corresponding HTML entities.
  14595. *
  14596. * **Note:** No other characters are escaped. To escape additional
  14597. * characters use a third-party library like [_he_](https://mths.be/he).
  14598. *
  14599. * Though the ">" character is escaped for symmetry, characters like
  14600. * ">" and "/" don't need escaping in HTML and have no special meaning
  14601. * unless they're part of a tag or unquoted attribute value. See
  14602. * [Mathias Bynens's article](https://mathiasbynens.be/notes/ambiguous-ampersands)
  14603. * (under "semi-related fun fact") for more details.
  14604. *
  14605. * When working with HTML you should always
  14606. * [quote attribute values](http://wonko.com/post/html-escaping) to reduce
  14607. * XSS vectors.
  14608. *
  14609. * @static
  14610. * @since 0.1.0
  14611. * @memberOf _
  14612. * @category String
  14613. * @param {string} [string=''] The string to escape.
  14614. * @returns {string} Returns the escaped string.
  14615. * @example
  14616. *
  14617. * _.escape('fred, barney, & pebbles');
  14618. * // => 'fred, barney, &amp; pebbles'
  14619. */
  14620. function escape(string) {
  14621. string = toString(string);
  14622. return (string && reHasUnescapedHtml.test(string))
  14623. ? string.replace(reUnescapedHtml, escapeHtmlChar)
  14624. : string;
  14625. }
  14626. /**
  14627. * Escapes the `RegExp` special characters "^", "$", "\", ".", "*", "+",
  14628. * "?", "(", ")", "[", "]", "{", "}", and "|" in `string`.
  14629. *
  14630. * @static
  14631. * @memberOf _
  14632. * @since 3.0.0
  14633. * @category String
  14634. * @param {string} [string=''] The string to escape.
  14635. * @returns {string} Returns the escaped string.
  14636. * @example
  14637. *
  14638. * _.escapeRegExp('[lodash](https://lodash.com/)');
  14639. * // => '\[lodash\]\(https://lodash\.com/\)'
  14640. */
  14641. function escapeRegExp(string) {
  14642. string = toString(string);
  14643. return (string && reHasRegExpChar.test(string))
  14644. ? string.replace(reRegExpChar, '\\$&')
  14645. : string;
  14646. }
  14647. /**
  14648. * Converts `string` to
  14649. * [kebab case](https://en.wikipedia.org/wiki/Letter_case#Special_case_styles).
  14650. *
  14651. * @static
  14652. * @memberOf _
  14653. * @since 3.0.0
  14654. * @category String
  14655. * @param {string} [string=''] The string to convert.
  14656. * @returns {string} Returns the kebab cased string.
  14657. * @example
  14658. *
  14659. * _.kebabCase('Foo Bar');
  14660. * // => 'foo-bar'
  14661. *
  14662. * _.kebabCase('fooBar');
  14663. * // => 'foo-bar'
  14664. *
  14665. * _.kebabCase('__FOO_BAR__');
  14666. * // => 'foo-bar'
  14667. */
  14668. var kebabCase = createCompounder(function(result, word, index) {
  14669. return result + (index ? '-' : '') + word.toLowerCase();
  14670. });
  14671. /**
  14672. * Converts `string`, as space separated words, to lower case.
  14673. *
  14674. * @static
  14675. * @memberOf _
  14676. * @since 4.0.0
  14677. * @category String
  14678. * @param {string} [string=''] The string to convert.
  14679. * @returns {string} Returns the lower cased string.
  14680. * @example
  14681. *
  14682. * _.lowerCase('--Foo-Bar--');
  14683. * // => 'foo bar'
  14684. *
  14685. * _.lowerCase('fooBar');
  14686. * // => 'foo bar'
  14687. *
  14688. * _.lowerCase('__FOO_BAR__');
  14689. * // => 'foo bar'
  14690. */
  14691. var lowerCase = createCompounder(function(result, word, index) {
  14692. return result + (index ? ' ' : '') + word.toLowerCase();
  14693. });
  14694. /**
  14695. * Converts the first character of `string` to lower case.
  14696. *
  14697. * @static
  14698. * @memberOf _
  14699. * @since 4.0.0
  14700. * @category String
  14701. * @param {string} [string=''] The string to convert.
  14702. * @returns {string} Returns the converted string.
  14703. * @example
  14704. *
  14705. * _.lowerFirst('Fred');
  14706. * // => 'fred'
  14707. *
  14708. * _.lowerFirst('FRED');
  14709. * // => 'fRED'
  14710. */
  14711. var lowerFirst = createCaseFirst('toLowerCase');
  14712. /**
  14713. * Pads `string` on the left and right sides if it's shorter than `length`.
  14714. * Padding characters are truncated if they can't be evenly divided by `length`.
  14715. *
  14716. * @static
  14717. * @memberOf _
  14718. * @since 3.0.0
  14719. * @category String
  14720. * @param {string} [string=''] The string to pad.
  14721. * @param {number} [length=0] The padding length.
  14722. * @param {string} [chars=' '] The string used as padding.
  14723. * @returns {string} Returns the padded string.
  14724. * @example
  14725. *
  14726. * _.pad('abc', 8);
  14727. * // => ' abc '
  14728. *
  14729. * _.pad('abc', 8, '_-');
  14730. * // => '_-abc_-_'
  14731. *
  14732. * _.pad('abc', 3);
  14733. * // => 'abc'
  14734. */
  14735. function pad(string, length, chars) {
  14736. string = toString(string);
  14737. length = toInteger(length);
  14738. var strLength = length ? stringSize(string) : 0;
  14739. if (!length || strLength >= length) {
  14740. return string;
  14741. }
  14742. var mid = (length - strLength) / 2;
  14743. return (
  14744. createPadding(nativeFloor(mid), chars) +
  14745. string +
  14746. createPadding(nativeCeil(mid), chars)
  14747. );
  14748. }
  14749. /**
  14750. * Pads `string` on the right side if it's shorter than `length`. Padding
  14751. * characters are truncated if they exceed `length`.
  14752. *
  14753. * @static
  14754. * @memberOf _
  14755. * @since 4.0.0
  14756. * @category String
  14757. * @param {string} [string=''] The string to pad.
  14758. * @param {number} [length=0] The padding length.
  14759. * @param {string} [chars=' '] The string used as padding.
  14760. * @returns {string} Returns the padded string.
  14761. * @example
  14762. *
  14763. * _.padEnd('abc', 6);
  14764. * // => 'abc '
  14765. *
  14766. * _.padEnd('abc', 6, '_-');
  14767. * // => 'abc_-_'
  14768. *
  14769. * _.padEnd('abc', 3);
  14770. * // => 'abc'
  14771. */
  14772. function padEnd(string, length, chars) {
  14773. string = toString(string);
  14774. length = toInteger(length);
  14775. var strLength = length ? stringSize(string) : 0;
  14776. return (length && strLength < length)
  14777. ? (string + createPadding(length - strLength, chars))
  14778. : string;
  14779. }
  14780. /**
  14781. * Pads `string` on the left side if it's shorter than `length`. Padding
  14782. * characters are truncated if they exceed `length`.
  14783. *
  14784. * @static
  14785. * @memberOf _
  14786. * @since 4.0.0
  14787. * @category String
  14788. * @param {string} [string=''] The string to pad.
  14789. * @param {number} [length=0] The padding length.
  14790. * @param {string} [chars=' '] The string used as padding.
  14791. * @returns {string} Returns the padded string.
  14792. * @example
  14793. *
  14794. * _.padStart('abc', 6);
  14795. * // => ' abc'
  14796. *
  14797. * _.padStart('abc', 6, '_-');
  14798. * // => '_-_abc'
  14799. *
  14800. * _.padStart('abc', 3);
  14801. * // => 'abc'
  14802. */
  14803. function padStart(string, length, chars) {
  14804. string = toString(string);
  14805. length = toInteger(length);
  14806. var strLength = length ? stringSize(string) : 0;
  14807. return (length && strLength < length)
  14808. ? (createPadding(length - strLength, chars) + string)
  14809. : string;
  14810. }
  14811. /**
  14812. * Converts `string` to an integer of the specified radix. If `radix` is
  14813. * `undefined` or `0`, a `radix` of `10` is used unless `value` is a
  14814. * hexadecimal, in which case a `radix` of `16` is used.
  14815. *
  14816. * **Note:** This method aligns with the
  14817. * [ES5 implementation](https://es5.github.io/#x15.1.2.2) of `parseInt`.
  14818. *
  14819. * @static
  14820. * @memberOf _
  14821. * @since 1.1.0
  14822. * @category String
  14823. * @param {string} string The string to convert.
  14824. * @param {number} [radix=10] The radix to interpret `value` by.
  14825. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  14826. * @returns {number} Returns the converted integer.
  14827. * @example
  14828. *
  14829. * _.parseInt('08');
  14830. * // => 8
  14831. *
  14832. * _.map(['6', '08', '10'], _.parseInt);
  14833. * // => [6, 8, 10]
  14834. */
  14835. function parseInt(string, radix, guard) {
  14836. if (guard || radix == null) {
  14837. radix = 0;
  14838. } else if (radix) {
  14839. radix = +radix;
  14840. }
  14841. return nativeParseInt(toString(string).replace(reTrimStart, ''), radix || 0);
  14842. }
  14843. /**
  14844. * Repeats the given string `n` times.
  14845. *
  14846. * @static
  14847. * @memberOf _
  14848. * @since 3.0.0
  14849. * @category String
  14850. * @param {string} [string=''] The string to repeat.
  14851. * @param {number} [n=1] The number of times to repeat the string.
  14852. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  14853. * @returns {string} Returns the repeated string.
  14854. * @example
  14855. *
  14856. * _.repeat('*', 3);
  14857. * // => '***'
  14858. *
  14859. * _.repeat('abc', 2);
  14860. * // => 'abcabc'
  14861. *
  14862. * _.repeat('abc', 0);
  14863. * // => ''
  14864. */
  14865. function repeat(string, n, guard) {
  14866. if ((guard ? isIterateeCall(string, n, guard) : n === undefined)) {
  14867. n = 1;
  14868. } else {
  14869. n = toInteger(n);
  14870. }
  14871. return baseRepeat(toString(string), n);
  14872. }
  14873. /**
  14874. * Replaces matches for `pattern` in `string` with `replacement`.
  14875. *
  14876. * **Note:** This method is based on
  14877. * [`String#replace`](https://mdn.io/String/replace).
  14878. *
  14879. * @static
  14880. * @memberOf _
  14881. * @since 4.0.0
  14882. * @category String
  14883. * @param {string} [string=''] The string to modify.
  14884. * @param {RegExp|string} pattern The pattern to replace.
  14885. * @param {Function|string} replacement The match replacement.
  14886. * @returns {string} Returns the modified string.
  14887. * @example
  14888. *
  14889. * _.replace('Hi Fred', 'Fred', 'Barney');
  14890. * // => 'Hi Barney'
  14891. */
  14892. function replace() {
  14893. var args = arguments,
  14894. string = toString(args[0]);
  14895. return args.length < 3 ? string : string.replace(args[1], args[2]);
  14896. }
  14897. /**
  14898. * Converts `string` to
  14899. * [snake case](https://en.wikipedia.org/wiki/Snake_case).
  14900. *
  14901. * @static
  14902. * @memberOf _
  14903. * @since 3.0.0
  14904. * @category String
  14905. * @param {string} [string=''] The string to convert.
  14906. * @returns {string} Returns the snake cased string.
  14907. * @example
  14908. *
  14909. * _.snakeCase('Foo Bar');
  14910. * // => 'foo_bar'
  14911. *
  14912. * _.snakeCase('fooBar');
  14913. * // => 'foo_bar'
  14914. *
  14915. * _.snakeCase('--FOO-BAR--');
  14916. * // => 'foo_bar'
  14917. */
  14918. var snakeCase = createCompounder(function(result, word, index) {
  14919. return result + (index ? '_' : '') + word.toLowerCase();
  14920. });
  14921. /**
  14922. * Splits `string` by `separator`.
  14923. *
  14924. * **Note:** This method is based on
  14925. * [`String#split`](https://mdn.io/String/split).
  14926. *
  14927. * @static
  14928. * @memberOf _
  14929. * @since 4.0.0
  14930. * @category String
  14931. * @param {string} [string=''] The string to split.
  14932. * @param {RegExp|string} separator The separator pattern to split by.
  14933. * @param {number} [limit] The length to truncate results to.
  14934. * @returns {Array} Returns the string segments.
  14935. * @example
  14936. *
  14937. * _.split('a-b-c', '-', 2);
  14938. * // => ['a', 'b']
  14939. */
  14940. function split(string, separator, limit) {
  14941. if (limit && typeof limit != 'number' && isIterateeCall(string, separator, limit)) {
  14942. separator = limit = undefined;
  14943. }
  14944. limit = limit === undefined ? MAX_ARRAY_LENGTH : limit >>> 0;
  14945. if (!limit) {
  14946. return [];
  14947. }
  14948. string = toString(string);
  14949. if (string && (
  14950. typeof separator == 'string' ||
  14951. (separator != null && !isRegExp(separator))
  14952. )) {
  14953. separator = baseToString(separator);
  14954. if (!separator && hasUnicode(string)) {
  14955. return castSlice(stringToArray(string), 0, limit);
  14956. }
  14957. }
  14958. return string.split(separator, limit);
  14959. }
  14960. /**
  14961. * Converts `string` to
  14962. * [start case](https://en.wikipedia.org/wiki/Letter_case#Stylistic_or_specialised_usage).
  14963. *
  14964. * @static
  14965. * @memberOf _
  14966. * @since 3.1.0
  14967. * @category String
  14968. * @param {string} [string=''] The string to convert.
  14969. * @returns {string} Returns the start cased string.
  14970. * @example
  14971. *
  14972. * _.startCase('--foo-bar--');
  14973. * // => 'Foo Bar'
  14974. *
  14975. * _.startCase('fooBar');
  14976. * // => 'Foo Bar'
  14977. *
  14978. * _.startCase('__FOO_BAR__');
  14979. * // => 'FOO BAR'
  14980. */
  14981. var startCase = createCompounder(function(result, word, index) {
  14982. return result + (index ? ' ' : '') + upperFirst(word);
  14983. });
  14984. /**
  14985. * Checks if `string` starts with the given target string.
  14986. *
  14987. * @static
  14988. * @memberOf _
  14989. * @since 3.0.0
  14990. * @category String
  14991. * @param {string} [string=''] The string to inspect.
  14992. * @param {string} [target] The string to search for.
  14993. * @param {number} [position=0] The position to search from.
  14994. * @returns {boolean} Returns `true` if `string` starts with `target`,
  14995. * else `false`.
  14996. * @example
  14997. *
  14998. * _.startsWith('abc', 'a');
  14999. * // => true
  15000. *
  15001. * _.startsWith('abc', 'b');
  15002. * // => false
  15003. *
  15004. * _.startsWith('abc', 'b', 1);
  15005. * // => true
  15006. */
  15007. function startsWith(string, target, position) {
  15008. string = toString(string);
  15009. position = position == null
  15010. ? 0
  15011. : baseClamp(toInteger(position), 0, string.length);
  15012. target = baseToString(target);
  15013. return string.slice(position, position + target.length) == target;
  15014. }
  15015. /**
  15016. * Creates a compiled template function that can interpolate data properties
  15017. * in "interpolate" delimiters, HTML-escape interpolated data properties in
  15018. * "escape" delimiters, and execute JavaScript in "evaluate" delimiters. Data
  15019. * properties may be accessed as free variables in the template. If a setting
  15020. * object is given, it takes precedence over `_.templateSettings` values.
  15021. *
  15022. * **Note:** In the development build `_.template` utilizes
  15023. * [sourceURLs](http://www.html5rocks.com/en/tutorials/developertools/sourcemaps/#toc-sourceurl)
  15024. * for easier debugging.
  15025. *
  15026. * For more information on precompiling templates see
  15027. * [lodash's custom builds documentation](https://lodash.com/custom-builds).
  15028. *
  15029. * For more information on Chrome extension sandboxes see
  15030. * [Chrome's extensions documentation](https://developer.chrome.com/extensions/sandboxingEval).
  15031. *
  15032. * @static
  15033. * @since 0.1.0
  15034. * @memberOf _
  15035. * @category String
  15036. * @param {string} [string=''] The template string.
  15037. * @param {Object} [options={}] The options object.
  15038. * @param {RegExp} [options.escape=_.templateSettings.escape]
  15039. * The HTML "escape" delimiter.
  15040. * @param {RegExp} [options.evaluate=_.templateSettings.evaluate]
  15041. * The "evaluate" delimiter.
  15042. * @param {Object} [options.imports=_.templateSettings.imports]
  15043. * An object to import into the template as free variables.
  15044. * @param {RegExp} [options.interpolate=_.templateSettings.interpolate]
  15045. * The "interpolate" delimiter.
  15046. * @param {string} [options.sourceURL='lodash.templateSources[n]']
  15047. * The sourceURL of the compiled template.
  15048. * @param {string} [options.variable='obj']
  15049. * The data object variable name.
  15050. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  15051. * @returns {Function} Returns the compiled template function.
  15052. * @example
  15053. *
  15054. * // Use the "interpolate" delimiter to create a compiled template.
  15055. * var compiled = _.template('hello <%= user %>!');
  15056. * compiled({ 'user': 'fred' });
  15057. * // => 'hello fred!'
  15058. *
  15059. * // Use the HTML "escape" delimiter to escape data property values.
  15060. * var compiled = _.template('<b><%- value %></b>');
  15061. * compiled({ 'value': '<script>' });
  15062. * // => '<b>&lt;script&gt;</b>'
  15063. *
  15064. * // Use the "evaluate" delimiter to execute JavaScript and generate HTML.
  15065. * var compiled = _.template('<% _.forEach(users, function(user) { %><li><%- user %></li><% }); %>');
  15066. * compiled({ 'users': ['fred', 'barney'] });
  15067. * // => '<li>fred</li><li>barney</li>'
  15068. *
  15069. * // Use the internal `print` function in "evaluate" delimiters.
  15070. * var compiled = _.template('<% print("hello " + user); %>!');
  15071. * compiled({ 'user': 'barney' });
  15072. * // => 'hello barney!'
  15073. *
  15074. * // Use the ES template literal delimiter as an "interpolate" delimiter.
  15075. * // Disable support by replacing the "interpolate" delimiter.
  15076. * var compiled = _.template('hello ${ user }!');
  15077. * compiled({ 'user': 'pebbles' });
  15078. * // => 'hello pebbles!'
  15079. *
  15080. * // Use backslashes to treat delimiters as plain text.
  15081. * var compiled = _.template('<%= "\\<%- value %\\>" %>');
  15082. * compiled({ 'value': 'ignored' });
  15083. * // => '<%- value %>'
  15084. *
  15085. * // Use the `imports` option to import `jQuery` as `jq`.
  15086. * var text = '<% jq.each(users, function(user) { %><li><%- user %></li><% }); %>';
  15087. * var compiled = _.template(text, { 'imports': { 'jq': jQuery } });
  15088. * compiled({ 'users': ['fred', 'barney'] });
  15089. * // => '<li>fred</li><li>barney</li>'
  15090. *
  15091. * // Use the `sourceURL` option to specify a custom sourceURL for the template.
  15092. * var compiled = _.template('hello <%= user %>!', { 'sourceURL': '/basic/greeting.jst' });
  15093. * compiled(data);
  15094. * // => Find the source of "greeting.jst" under the Sources tab or Resources panel of the web inspector.
  15095. *
  15096. * // Use the `variable` option to ensure a with-statement isn't used in the compiled template.
  15097. * var compiled = _.template('hi <%= data.user %>!', { 'variable': 'data' });
  15098. * compiled.source;
  15099. * // => function(data) {
  15100. * // var __t, __p = '';
  15101. * // __p += 'hi ' + ((__t = ( data.user )) == null ? '' : __t) + '!';
  15102. * // return __p;
  15103. * // }
  15104. *
  15105. * // Use custom template delimiters.
  15106. * _.templateSettings.interpolate = /{{([\s\S]+?)}}/g;
  15107. * var compiled = _.template('hello {{ user }}!');
  15108. * compiled({ 'user': 'mustache' });
  15109. * // => 'hello mustache!'
  15110. *
  15111. * // Use the `source` property to inline compiled templates for meaningful
  15112. * // line numbers in error messages and stack traces.
  15113. * fs.writeFileSync(path.join(process.cwd(), 'jst.js'), '\
  15114. * var JST = {\
  15115. * "main": ' + _.template(mainText).source + '\
  15116. * };\
  15117. * ');
  15118. */
  15119. function template(string, options, guard) {
  15120. // Based on John Resig's `tmpl` implementation
  15121. // (http://ejohn.org/blog/javascript-micro-templating/)
  15122. // and Laura Doktorova's doT.js (https://github.com/olado/doT).
  15123. var settings = lodash.templateSettings;
  15124. if (guard && isIterateeCall(string, options, guard)) {
  15125. options = undefined;
  15126. }
  15127. string = toString(string);
  15128. options = assignInWith({}, options, settings, customDefaultsAssignIn);
  15129. var imports = assignInWith({}, options.imports, settings.imports, customDefaultsAssignIn),
  15130. importsKeys = keys(imports),
  15131. importsValues = baseValues(imports, importsKeys);
  15132. var isEscaping,
  15133. isEvaluating,
  15134. index = 0,
  15135. interpolate = options.interpolate || reNoMatch,
  15136. source = "__p += '";
  15137. // Compile the regexp to match each delimiter.
  15138. var reDelimiters = RegExp(
  15139. (options.escape || reNoMatch).source + '|' +
  15140. interpolate.source + '|' +
  15141. (interpolate === reInterpolate ? reEsTemplate : reNoMatch).source + '|' +
  15142. (options.evaluate || reNoMatch).source + '|$'
  15143. , 'g');
  15144. // Use a sourceURL for easier debugging.
  15145. // The sourceURL gets injected into the source that's eval-ed, so be careful
  15146. // to normalize all kinds of whitespace, so e.g. newlines (and unicode versions of it) can't sneak in
  15147. // and escape the comment, thus injecting code that gets evaled.
  15148. var sourceURL = '//# sourceURL=' +
  15149. (hasOwnProperty.call(options, 'sourceURL')
  15150. ? (options.sourceURL + '').replace(/\s/g, ' ')
  15151. : ('lodash.templateSources[' + (++templateCounter) + ']')
  15152. ) + '\n';
  15153. string.replace(reDelimiters, function(match, escapeValue, interpolateValue, esTemplateValue, evaluateValue, offset) {
  15154. interpolateValue || (interpolateValue = esTemplateValue);
  15155. // Escape characters that can't be included in string literals.
  15156. source += string.slice(index, offset).replace(reUnescapedString, escapeStringChar);
  15157. // Replace delimiters with snippets.
  15158. if (escapeValue) {
  15159. isEscaping = true;
  15160. source += "' +\n__e(" + escapeValue + ") +\n'";
  15161. }
  15162. if (evaluateValue) {
  15163. isEvaluating = true;
  15164. source += "';\n" + evaluateValue + ";\n__p += '";
  15165. }
  15166. if (interpolateValue) {
  15167. source += "' +\n((__t = (" + interpolateValue + ")) == null ? '' : __t) +\n'";
  15168. }
  15169. index = offset + match.length;
  15170. // The JS engine embedded in Adobe products needs `match` returned in
  15171. // order to produce the correct `offset` value.
  15172. return match;
  15173. });
  15174. source += "';\n";
  15175. // If `variable` is not specified wrap a with-statement around the generated
  15176. // code to add the data object to the top of the scope chain.
  15177. var variable = hasOwnProperty.call(options, 'variable') && options.variable;
  15178. if (!variable) {
  15179. source = 'with (obj) {\n' + source + '\n}\n';
  15180. }
  15181. // Throw an error if a forbidden character was found in `variable`, to prevent
  15182. // potential command injection attacks.
  15183. else if (reForbiddenIdentifierChars.test(variable)) {
  15184. throw new Error(INVALID_TEMPL_VAR_ERROR_TEXT);
  15185. }
  15186. // Cleanup code by stripping empty strings.
  15187. source = (isEvaluating ? source.replace(reEmptyStringLeading, '') : source)
  15188. .replace(reEmptyStringMiddle, '$1')
  15189. .replace(reEmptyStringTrailing, '$1;');
  15190. // Frame code as the function body.
  15191. source = 'function(' + (variable || 'obj') + ') {\n' +
  15192. (variable
  15193. ? ''
  15194. : 'obj || (obj = {});\n'
  15195. ) +
  15196. "var __t, __p = ''" +
  15197. (isEscaping
  15198. ? ', __e = _.escape'
  15199. : ''
  15200. ) +
  15201. (isEvaluating
  15202. ? ', __j = Array.prototype.join;\n' +
  15203. "function print() { __p += __j.call(arguments, '') }\n"
  15204. : ';\n'
  15205. ) +
  15206. source +
  15207. 'return __p\n}';
  15208. var result = attempt(function() {
  15209. return Function(importsKeys, sourceURL + 'return ' + source)
  15210. .apply(undefined, importsValues);
  15211. });
  15212. // Provide the compiled function's source by its `toString` method or
  15213. // the `source` property as a convenience for inlining compiled templates.
  15214. result.source = source;
  15215. if (isError(result)) {
  15216. throw result;
  15217. }
  15218. return result;
  15219. }
  15220. /**
  15221. * Converts `string`, as a whole, to lower case just like
  15222. * [String#toLowerCase](https://mdn.io/toLowerCase).
  15223. *
  15224. * @static
  15225. * @memberOf _
  15226. * @since 4.0.0
  15227. * @category String
  15228. * @param {string} [string=''] The string to convert.
  15229. * @returns {string} Returns the lower cased string.
  15230. * @example
  15231. *
  15232. * _.toLower('--Foo-Bar--');
  15233. * // => '--foo-bar--'
  15234. *
  15235. * _.toLower('fooBar');
  15236. * // => 'foobar'
  15237. *
  15238. * _.toLower('__FOO_BAR__');
  15239. * // => '__foo_bar__'
  15240. */
  15241. function toLower(value) {
  15242. return toString(value).toLowerCase();
  15243. }
  15244. /**
  15245. * Converts `string`, as a whole, to upper case just like
  15246. * [String#toUpperCase](https://mdn.io/toUpperCase).
  15247. *
  15248. * @static
  15249. * @memberOf _
  15250. * @since 4.0.0
  15251. * @category String
  15252. * @param {string} [string=''] The string to convert.
  15253. * @returns {string} Returns the upper cased string.
  15254. * @example
  15255. *
  15256. * _.toUpper('--foo-bar--');
  15257. * // => '--FOO-BAR--'
  15258. *
  15259. * _.toUpper('fooBar');
  15260. * // => 'FOOBAR'
  15261. *
  15262. * _.toUpper('__foo_bar__');
  15263. * // => '__FOO_BAR__'
  15264. */
  15265. function toUpper(value) {
  15266. return toString(value).toUpperCase();
  15267. }
  15268. /**
  15269. * Removes leading and trailing whitespace or specified characters from `string`.
  15270. *
  15271. * @static
  15272. * @memberOf _
  15273. * @since 3.0.0
  15274. * @category String
  15275. * @param {string} [string=''] The string to trim.
  15276. * @param {string} [chars=whitespace] The characters to trim.
  15277. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  15278. * @returns {string} Returns the trimmed string.
  15279. * @example
  15280. *
  15281. * _.trim(' abc ');
  15282. * // => 'abc'
  15283. *
  15284. * _.trim('-_-abc-_-', '_-');
  15285. * // => 'abc'
  15286. *
  15287. * _.map([' foo ', ' bar '], _.trim);
  15288. * // => ['foo', 'bar']
  15289. */
  15290. function trim(string, chars, guard) {
  15291. string = toString(string);
  15292. if (string && (guard || chars === undefined)) {
  15293. return baseTrim(string);
  15294. }
  15295. if (!string || !(chars = baseToString(chars))) {
  15296. return string;
  15297. }
  15298. var strSymbols = stringToArray(string),
  15299. chrSymbols = stringToArray(chars),
  15300. start = charsStartIndex(strSymbols, chrSymbols),
  15301. end = charsEndIndex(strSymbols, chrSymbols) + 1;
  15302. return castSlice(strSymbols, start, end).join('');
  15303. }
  15304. /**
  15305. * Removes trailing whitespace or specified characters from `string`.
  15306. *
  15307. * @static
  15308. * @memberOf _
  15309. * @since 4.0.0
  15310. * @category String
  15311. * @param {string} [string=''] The string to trim.
  15312. * @param {string} [chars=whitespace] The characters to trim.
  15313. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  15314. * @returns {string} Returns the trimmed string.
  15315. * @example
  15316. *
  15317. * _.trimEnd(' abc ');
  15318. * // => ' abc'
  15319. *
  15320. * _.trimEnd('-_-abc-_-', '_-');
  15321. * // => '-_-abc'
  15322. */
  15323. function trimEnd(string, chars, guard) {
  15324. string = toString(string);
  15325. if (string && (guard || chars === undefined)) {
  15326. return string.slice(0, trimmedEndIndex(string) + 1);
  15327. }
  15328. if (!string || !(chars = baseToString(chars))) {
  15329. return string;
  15330. }
  15331. var strSymbols = stringToArray(string),
  15332. end = charsEndIndex(strSymbols, stringToArray(chars)) + 1;
  15333. return castSlice(strSymbols, 0, end).join('');
  15334. }
  15335. /**
  15336. * Removes leading whitespace or specified characters from `string`.
  15337. *
  15338. * @static
  15339. * @memberOf _
  15340. * @since 4.0.0
  15341. * @category String
  15342. * @param {string} [string=''] The string to trim.
  15343. * @param {string} [chars=whitespace] The characters to trim.
  15344. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  15345. * @returns {string} Returns the trimmed string.
  15346. * @example
  15347. *
  15348. * _.trimStart(' abc ');
  15349. * // => 'abc '
  15350. *
  15351. * _.trimStart('-_-abc-_-', '_-');
  15352. * // => 'abc-_-'
  15353. */
  15354. function trimStart(string, chars, guard) {
  15355. string = toString(string);
  15356. if (string && (guard || chars === undefined)) {
  15357. return string.replace(reTrimStart, '');
  15358. }
  15359. if (!string || !(chars = baseToString(chars))) {
  15360. return string;
  15361. }
  15362. var strSymbols = stringToArray(string),
  15363. start = charsStartIndex(strSymbols, stringToArray(chars));
  15364. return castSlice(strSymbols, start).join('');
  15365. }
  15366. /**
  15367. * Truncates `string` if it's longer than the given maximum string length.
  15368. * The last characters of the truncated string are replaced with the omission
  15369. * string which defaults to "...".
  15370. *
  15371. * @static
  15372. * @memberOf _
  15373. * @since 4.0.0
  15374. * @category String
  15375. * @param {string} [string=''] The string to truncate.
  15376. * @param {Object} [options={}] The options object.
  15377. * @param {number} [options.length=30] The maximum string length.
  15378. * @param {string} [options.omission='...'] The string to indicate text is omitted.
  15379. * @param {RegExp|string} [options.separator] The separator pattern to truncate to.
  15380. * @returns {string} Returns the truncated string.
  15381. * @example
  15382. *
  15383. * _.truncate('hi-diddly-ho there, neighborino');
  15384. * // => 'hi-diddly-ho there, neighbo...'
  15385. *
  15386. * _.truncate('hi-diddly-ho there, neighborino', {
  15387. * 'length': 24,
  15388. * 'separator': ' '
  15389. * });
  15390. * // => 'hi-diddly-ho there,...'
  15391. *
  15392. * _.truncate('hi-diddly-ho there, neighborino', {
  15393. * 'length': 24,
  15394. * 'separator': /,? +/
  15395. * });
  15396. * // => 'hi-diddly-ho there...'
  15397. *
  15398. * _.truncate('hi-diddly-ho there, neighborino', {
  15399. * 'omission': ' [...]'
  15400. * });
  15401. * // => 'hi-diddly-ho there, neig [...]'
  15402. */
  15403. function truncate(string, options) {
  15404. var length = DEFAULT_TRUNC_LENGTH,
  15405. omission = DEFAULT_TRUNC_OMISSION;
  15406. if (isObject(options)) {
  15407. var separator = 'separator' in options ? options.separator : separator;
  15408. length = 'length' in options ? toInteger(options.length) : length;
  15409. omission = 'omission' in options ? baseToString(options.omission) : omission;
  15410. }
  15411. string = toString(string);
  15412. var strLength = string.length;
  15413. if (hasUnicode(string)) {
  15414. var strSymbols = stringToArray(string);
  15415. strLength = strSymbols.length;
  15416. }
  15417. if (length >= strLength) {
  15418. return string;
  15419. }
  15420. var end = length - stringSize(omission);
  15421. if (end < 1) {
  15422. return omission;
  15423. }
  15424. var result = strSymbols
  15425. ? castSlice(strSymbols, 0, end).join('')
  15426. : string.slice(0, end);
  15427. if (separator === undefined) {
  15428. return result + omission;
  15429. }
  15430. if (strSymbols) {
  15431. end += (result.length - end);
  15432. }
  15433. if (isRegExp(separator)) {
  15434. if (string.slice(end).search(separator)) {
  15435. var match,
  15436. substring = result;
  15437. if (!separator.global) {
  15438. separator = RegExp(separator.source, toString(reFlags.exec(separator)) + 'g');
  15439. }
  15440. separator.lastIndex = 0;
  15441. while ((match = separator.exec(substring))) {
  15442. var newEnd = match.index;
  15443. }
  15444. result = result.slice(0, newEnd === undefined ? end : newEnd);
  15445. }
  15446. } else if (string.indexOf(baseToString(separator), end) != end) {
  15447. var index = result.lastIndexOf(separator);
  15448. if (index > -1) {
  15449. result = result.slice(0, index);
  15450. }
  15451. }
  15452. return result + omission;
  15453. }
  15454. /**
  15455. * The inverse of `_.escape`; this method converts the HTML entities
  15456. * `&amp;`, `&lt;`, `&gt;`, `&quot;`, and `&#39;` in `string` to
  15457. * their corresponding characters.
  15458. *
  15459. * **Note:** No other HTML entities are unescaped. To unescape additional
  15460. * HTML entities use a third-party library like [_he_](https://mths.be/he).
  15461. *
  15462. * @static
  15463. * @memberOf _
  15464. * @since 0.6.0
  15465. * @category String
  15466. * @param {string} [string=''] The string to unescape.
  15467. * @returns {string} Returns the unescaped string.
  15468. * @example
  15469. *
  15470. * _.unescape('fred, barney, &amp; pebbles');
  15471. * // => 'fred, barney, & pebbles'
  15472. */
  15473. function unescape(string) {
  15474. string = toString(string);
  15475. return (string && reHasEscapedHtml.test(string))
  15476. ? string.replace(reEscapedHtml, unescapeHtmlChar)
  15477. : string;
  15478. }
  15479. /**
  15480. * Converts `string`, as space separated words, to upper case.
  15481. *
  15482. * @static
  15483. * @memberOf _
  15484. * @since 4.0.0
  15485. * @category String
  15486. * @param {string} [string=''] The string to convert.
  15487. * @returns {string} Returns the upper cased string.
  15488. * @example
  15489. *
  15490. * _.upperCase('--foo-bar');
  15491. * // => 'FOO BAR'
  15492. *
  15493. * _.upperCase('fooBar');
  15494. * // => 'FOO BAR'
  15495. *
  15496. * _.upperCase('__foo_bar__');
  15497. * // => 'FOO BAR'
  15498. */
  15499. var upperCase = createCompounder(function(result, word, index) {
  15500. return result + (index ? ' ' : '') + word.toUpperCase();
  15501. });
  15502. /**
  15503. * Converts the first character of `string` to upper case.
  15504. *
  15505. * @static
  15506. * @memberOf _
  15507. * @since 4.0.0
  15508. * @category String
  15509. * @param {string} [string=''] The string to convert.
  15510. * @returns {string} Returns the converted string.
  15511. * @example
  15512. *
  15513. * _.upperFirst('fred');
  15514. * // => 'Fred'
  15515. *
  15516. * _.upperFirst('FRED');
  15517. * // => 'FRED'
  15518. */
  15519. var upperFirst = createCaseFirst('toUpperCase');
  15520. /**
  15521. * Splits `string` into an array of its words.
  15522. *
  15523. * @static
  15524. * @memberOf _
  15525. * @since 3.0.0
  15526. * @category String
  15527. * @param {string} [string=''] The string to inspect.
  15528. * @param {RegExp|string} [pattern] The pattern to match words.
  15529. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  15530. * @returns {Array} Returns the words of `string`.
  15531. * @example
  15532. *
  15533. * _.words('fred, barney, & pebbles');
  15534. * // => ['fred', 'barney', 'pebbles']
  15535. *
  15536. * _.words('fred, barney, & pebbles', /[^, ]+/g);
  15537. * // => ['fred', 'barney', '&', 'pebbles']
  15538. */
  15539. function words(string, pattern, guard) {
  15540. string = toString(string);
  15541. pattern = guard ? undefined : pattern;
  15542. if (pattern === undefined) {
  15543. return hasUnicodeWord(string) ? unicodeWords(string) : asciiWords(string);
  15544. }
  15545. return string.match(pattern) || [];
  15546. }
  15547. /*------------------------------------------------------------------------*/
  15548. /**
  15549. * Attempts to invoke `func`, returning either the result or the caught error
  15550. * object. Any additional arguments are provided to `func` when it's invoked.
  15551. *
  15552. * @static
  15553. * @memberOf _
  15554. * @since 3.0.0
  15555. * @category Util
  15556. * @param {Function} func The function to attempt.
  15557. * @param {...*} [args] The arguments to invoke `func` with.
  15558. * @returns {*} Returns the `func` result or error object.
  15559. * @example
  15560. *
  15561. * // Avoid throwing errors for invalid selectors.
  15562. * var elements = _.attempt(function(selector) {
  15563. * return document.querySelectorAll(selector);
  15564. * }, '>_>');
  15565. *
  15566. * if (_.isError(elements)) {
  15567. * elements = [];
  15568. * }
  15569. */
  15570. var attempt = baseRest(function(func, args) {
  15571. try {
  15572. return apply(func, undefined, args);
  15573. } catch (e) {
  15574. return isError(e) ? e : new Error(e);
  15575. }
  15576. });
  15577. /**
  15578. * Binds methods of an object to the object itself, overwriting the existing
  15579. * method.
  15580. *
  15581. * **Note:** This method doesn't set the "length" property of bound functions.
  15582. *
  15583. * @static
  15584. * @since 0.1.0
  15585. * @memberOf _
  15586. * @category Util
  15587. * @param {Object} object The object to bind and assign the bound methods to.
  15588. * @param {...(string|string[])} methodNames The object method names to bind.
  15589. * @returns {Object} Returns `object`.
  15590. * @example
  15591. *
  15592. * var view = {
  15593. * 'label': 'docs',
  15594. * 'click': function() {
  15595. * console.log('clicked ' + this.label);
  15596. * }
  15597. * };
  15598. *
  15599. * _.bindAll(view, ['click']);
  15600. * jQuery(element).on('click', view.click);
  15601. * // => Logs 'clicked docs' when clicked.
  15602. */
  15603. var bindAll = flatRest(function(object, methodNames) {
  15604. arrayEach(methodNames, function(key) {
  15605. key = toKey(key);
  15606. baseAssignValue(object, key, bind(object[key], object));
  15607. });
  15608. return object;
  15609. });
  15610. /**
  15611. * Creates a function that iterates over `pairs` and invokes the corresponding
  15612. * function of the first predicate to return truthy. The predicate-function
  15613. * pairs are invoked with the `this` binding and arguments of the created
  15614. * function.
  15615. *
  15616. * @static
  15617. * @memberOf _
  15618. * @since 4.0.0
  15619. * @category Util
  15620. * @param {Array} pairs The predicate-function pairs.
  15621. * @returns {Function} Returns the new composite function.
  15622. * @example
  15623. *
  15624. * var func = _.cond([
  15625. * [_.matches({ 'a': 1 }), _.constant('matches A')],
  15626. * [_.conforms({ 'b': _.isNumber }), _.constant('matches B')],
  15627. * [_.stubTrue, _.constant('no match')]
  15628. * ]);
  15629. *
  15630. * func({ 'a': 1, 'b': 2 });
  15631. * // => 'matches A'
  15632. *
  15633. * func({ 'a': 0, 'b': 1 });
  15634. * // => 'matches B'
  15635. *
  15636. * func({ 'a': '1', 'b': '2' });
  15637. * // => 'no match'
  15638. */
  15639. function cond(pairs) {
  15640. var length = pairs == null ? 0 : pairs.length,
  15641. toIteratee = getIteratee();
  15642. pairs = !length ? [] : arrayMap(pairs, function(pair) {
  15643. if (typeof pair[1] != 'function') {
  15644. throw new TypeError(FUNC_ERROR_TEXT);
  15645. }
  15646. return [toIteratee(pair[0]), pair[1]];
  15647. });
  15648. return baseRest(function(args) {
  15649. var index = -1;
  15650. while (++index < length) {
  15651. var pair = pairs[index];
  15652. if (apply(pair[0], this, args)) {
  15653. return apply(pair[1], this, args);
  15654. }
  15655. }
  15656. });
  15657. }
  15658. /**
  15659. * Creates a function that invokes the predicate properties of `source` with
  15660. * the corresponding property values of a given object, returning `true` if
  15661. * all predicates return truthy, else `false`.
  15662. *
  15663. * **Note:** The created function is equivalent to `_.conformsTo` with
  15664. * `source` partially applied.
  15665. *
  15666. * @static
  15667. * @memberOf _
  15668. * @since 4.0.0
  15669. * @category Util
  15670. * @param {Object} source The object of property predicates to conform to.
  15671. * @returns {Function} Returns the new spec function.
  15672. * @example
  15673. *
  15674. * var objects = [
  15675. * { 'a': 2, 'b': 1 },
  15676. * { 'a': 1, 'b': 2 }
  15677. * ];
  15678. *
  15679. * _.filter(objects, _.conforms({ 'b': function(n) { return n > 1; } }));
  15680. * // => [{ 'a': 1, 'b': 2 }]
  15681. */
  15682. function conforms(source) {
  15683. return baseConforms(baseClone(source, CLONE_DEEP_FLAG));
  15684. }
  15685. /**
  15686. * Creates a function that returns `value`.
  15687. *
  15688. * @static
  15689. * @memberOf _
  15690. * @since 2.4.0
  15691. * @category Util
  15692. * @param {*} value The value to return from the new function.
  15693. * @returns {Function} Returns the new constant function.
  15694. * @example
  15695. *
  15696. * var objects = _.times(2, _.constant({ 'a': 1 }));
  15697. *
  15698. * console.log(objects);
  15699. * // => [{ 'a': 1 }, { 'a': 1 }]
  15700. *
  15701. * console.log(objects[0] === objects[1]);
  15702. * // => true
  15703. */
  15704. function constant(value) {
  15705. return function() {
  15706. return value;
  15707. };
  15708. }
  15709. /**
  15710. * Checks `value` to determine whether a default value should be returned in
  15711. * its place. The `defaultValue` is returned if `value` is `NaN`, `null`,
  15712. * or `undefined`.
  15713. *
  15714. * @static
  15715. * @memberOf _
  15716. * @since 4.14.0
  15717. * @category Util
  15718. * @param {*} value The value to check.
  15719. * @param {*} defaultValue The default value.
  15720. * @returns {*} Returns the resolved value.
  15721. * @example
  15722. *
  15723. * _.defaultTo(1, 10);
  15724. * // => 1
  15725. *
  15726. * _.defaultTo(undefined, 10);
  15727. * // => 10
  15728. */
  15729. function defaultTo(value, defaultValue) {
  15730. return (value == null || value !== value) ? defaultValue : value;
  15731. }
  15732. /**
  15733. * Creates a function that returns the result of invoking the given functions
  15734. * with the `this` binding of the created function, where each successive
  15735. * invocation is supplied the return value of the previous.
  15736. *
  15737. * @static
  15738. * @memberOf _
  15739. * @since 3.0.0
  15740. * @category Util
  15741. * @param {...(Function|Function[])} [funcs] The functions to invoke.
  15742. * @returns {Function} Returns the new composite function.
  15743. * @see _.flowRight
  15744. * @example
  15745. *
  15746. * function square(n) {
  15747. * return n * n;
  15748. * }
  15749. *
  15750. * var addSquare = _.flow([_.add, square]);
  15751. * addSquare(1, 2);
  15752. * // => 9
  15753. */
  15754. var flow = createFlow();
  15755. /**
  15756. * This method is like `_.flow` except that it creates a function that
  15757. * invokes the given functions from right to left.
  15758. *
  15759. * @static
  15760. * @since 3.0.0
  15761. * @memberOf _
  15762. * @category Util
  15763. * @param {...(Function|Function[])} [funcs] The functions to invoke.
  15764. * @returns {Function} Returns the new composite function.
  15765. * @see _.flow
  15766. * @example
  15767. *
  15768. * function square(n) {
  15769. * return n * n;
  15770. * }
  15771. *
  15772. * var addSquare = _.flowRight([square, _.add]);
  15773. * addSquare(1, 2);
  15774. * // => 9
  15775. */
  15776. var flowRight = createFlow(true);
  15777. /**
  15778. * This method returns the first argument it receives.
  15779. *
  15780. * @static
  15781. * @since 0.1.0
  15782. * @memberOf _
  15783. * @category Util
  15784. * @param {*} value Any value.
  15785. * @returns {*} Returns `value`.
  15786. * @example
  15787. *
  15788. * var object = { 'a': 1 };
  15789. *
  15790. * console.log(_.identity(object) === object);
  15791. * // => true
  15792. */
  15793. function identity(value) {
  15794. return value;
  15795. }
  15796. /**
  15797. * Creates a function that invokes `func` with the arguments of the created
  15798. * function. If `func` is a property name, the created function returns the
  15799. * property value for a given element. If `func` is an array or object, the
  15800. * created function returns `true` for elements that contain the equivalent
  15801. * source properties, otherwise it returns `false`.
  15802. *
  15803. * @static
  15804. * @since 4.0.0
  15805. * @memberOf _
  15806. * @category Util
  15807. * @param {*} [func=_.identity] The value to convert to a callback.
  15808. * @returns {Function} Returns the callback.
  15809. * @example
  15810. *
  15811. * var users = [
  15812. * { 'user': 'barney', 'age': 36, 'active': true },
  15813. * { 'user': 'fred', 'age': 40, 'active': false }
  15814. * ];
  15815. *
  15816. * // The `_.matches` iteratee shorthand.
  15817. * _.filter(users, _.iteratee({ 'user': 'barney', 'active': true }));
  15818. * // => [{ 'user': 'barney', 'age': 36, 'active': true }]
  15819. *
  15820. * // The `_.matchesProperty` iteratee shorthand.
  15821. * _.filter(users, _.iteratee(['user', 'fred']));
  15822. * // => [{ 'user': 'fred', 'age': 40 }]
  15823. *
  15824. * // The `_.property` iteratee shorthand.
  15825. * _.map(users, _.iteratee('user'));
  15826. * // => ['barney', 'fred']
  15827. *
  15828. * // Create custom iteratee shorthands.
  15829. * _.iteratee = _.wrap(_.iteratee, function(iteratee, func) {
  15830. * return !_.isRegExp(func) ? iteratee(func) : function(string) {
  15831. * return func.test(string);
  15832. * };
  15833. * });
  15834. *
  15835. * _.filter(['abc', 'def'], /ef/);
  15836. * // => ['def']
  15837. */
  15838. function iteratee(func) {
  15839. return baseIteratee(typeof func == 'function' ? func : baseClone(func, CLONE_DEEP_FLAG));
  15840. }
  15841. /**
  15842. * Creates a function that performs a partial deep comparison between a given
  15843. * object and `source`, returning `true` if the given object has equivalent
  15844. * property values, else `false`.
  15845. *
  15846. * **Note:** The created function is equivalent to `_.isMatch` with `source`
  15847. * partially applied.
  15848. *
  15849. * Partial comparisons will match empty array and empty object `source`
  15850. * values against any array or object value, respectively. See `_.isEqual`
  15851. * for a list of supported value comparisons.
  15852. *
  15853. * **Note:** Multiple values can be checked by combining several matchers
  15854. * using `_.overSome`
  15855. *
  15856. * @static
  15857. * @memberOf _
  15858. * @since 3.0.0
  15859. * @category Util
  15860. * @param {Object} source The object of property values to match.
  15861. * @returns {Function} Returns the new spec function.
  15862. * @example
  15863. *
  15864. * var objects = [
  15865. * { 'a': 1, 'b': 2, 'c': 3 },
  15866. * { 'a': 4, 'b': 5, 'c': 6 }
  15867. * ];
  15868. *
  15869. * _.filter(objects, _.matches({ 'a': 4, 'c': 6 }));
  15870. * // => [{ 'a': 4, 'b': 5, 'c': 6 }]
  15871. *
  15872. * // Checking for several possible values
  15873. * _.filter(objects, _.overSome([_.matches({ 'a': 1 }), _.matches({ 'a': 4 })]));
  15874. * // => [{ 'a': 1, 'b': 2, 'c': 3 }, { 'a': 4, 'b': 5, 'c': 6 }]
  15875. */
  15876. function matches(source) {
  15877. return baseMatches(baseClone(source, CLONE_DEEP_FLAG));
  15878. }
  15879. /**
  15880. * Creates a function that performs a partial deep comparison between the
  15881. * value at `path` of a given object to `srcValue`, returning `true` if the
  15882. * object value is equivalent, else `false`.
  15883. *
  15884. * **Note:** Partial comparisons will match empty array and empty object
  15885. * `srcValue` values against any array or object value, respectively. See
  15886. * `_.isEqual` for a list of supported value comparisons.
  15887. *
  15888. * **Note:** Multiple values can be checked by combining several matchers
  15889. * using `_.overSome`
  15890. *
  15891. * @static
  15892. * @memberOf _
  15893. * @since 3.2.0
  15894. * @category Util
  15895. * @param {Array|string} path The path of the property to get.
  15896. * @param {*} srcValue The value to match.
  15897. * @returns {Function} Returns the new spec function.
  15898. * @example
  15899. *
  15900. * var objects = [
  15901. * { 'a': 1, 'b': 2, 'c': 3 },
  15902. * { 'a': 4, 'b': 5, 'c': 6 }
  15903. * ];
  15904. *
  15905. * _.find(objects, _.matchesProperty('a', 4));
  15906. * // => { 'a': 4, 'b': 5, 'c': 6 }
  15907. *
  15908. * // Checking for several possible values
  15909. * _.filter(objects, _.overSome([_.matchesProperty('a', 1), _.matchesProperty('a', 4)]));
  15910. * // => [{ 'a': 1, 'b': 2, 'c': 3 }, { 'a': 4, 'b': 5, 'c': 6 }]
  15911. */
  15912. function matchesProperty(path, srcValue) {
  15913. return baseMatchesProperty(path, baseClone(srcValue, CLONE_DEEP_FLAG));
  15914. }
  15915. /**
  15916. * Creates a function that invokes the method at `path` of a given object.
  15917. * Any additional arguments are provided to the invoked method.
  15918. *
  15919. * @static
  15920. * @memberOf _
  15921. * @since 3.7.0
  15922. * @category Util
  15923. * @param {Array|string} path The path of the method to invoke.
  15924. * @param {...*} [args] The arguments to invoke the method with.
  15925. * @returns {Function} Returns the new invoker function.
  15926. * @example
  15927. *
  15928. * var objects = [
  15929. * { 'a': { 'b': _.constant(2) } },
  15930. * { 'a': { 'b': _.constant(1) } }
  15931. * ];
  15932. *
  15933. * _.map(objects, _.method('a.b'));
  15934. * // => [2, 1]
  15935. *
  15936. * _.map(objects, _.method(['a', 'b']));
  15937. * // => [2, 1]
  15938. */
  15939. var method = baseRest(function(path, args) {
  15940. return function(object) {
  15941. return baseInvoke(object, path, args);
  15942. };
  15943. });
  15944. /**
  15945. * The opposite of `_.method`; this method creates a function that invokes
  15946. * the method at a given path of `object`. Any additional arguments are
  15947. * provided to the invoked method.
  15948. *
  15949. * @static
  15950. * @memberOf _
  15951. * @since 3.7.0
  15952. * @category Util
  15953. * @param {Object} object The object to query.
  15954. * @param {...*} [args] The arguments to invoke the method with.
  15955. * @returns {Function} Returns the new invoker function.
  15956. * @example
  15957. *
  15958. * var array = _.times(3, _.constant),
  15959. * object = { 'a': array, 'b': array, 'c': array };
  15960. *
  15961. * _.map(['a[2]', 'c[0]'], _.methodOf(object));
  15962. * // => [2, 0]
  15963. *
  15964. * _.map([['a', '2'], ['c', '0']], _.methodOf(object));
  15965. * // => [2, 0]
  15966. */
  15967. var methodOf = baseRest(function(object, args) {
  15968. return function(path) {
  15969. return baseInvoke(object, path, args);
  15970. };
  15971. });
  15972. /**
  15973. * Adds all own enumerable string keyed function properties of a source
  15974. * object to the destination object. If `object` is a function, then methods
  15975. * are added to its prototype as well.
  15976. *
  15977. * **Note:** Use `_.runInContext` to create a pristine `lodash` function to
  15978. * avoid conflicts caused by modifying the original.
  15979. *
  15980. * @static
  15981. * @since 0.1.0
  15982. * @memberOf _
  15983. * @category Util
  15984. * @param {Function|Object} [object=lodash] The destination object.
  15985. * @param {Object} source The object of functions to add.
  15986. * @param {Object} [options={}] The options object.
  15987. * @param {boolean} [options.chain=true] Specify whether mixins are chainable.
  15988. * @returns {Function|Object} Returns `object`.
  15989. * @example
  15990. *
  15991. * function vowels(string) {
  15992. * return _.filter(string, function(v) {
  15993. * return /[aeiou]/i.test(v);
  15994. * });
  15995. * }
  15996. *
  15997. * _.mixin({ 'vowels': vowels });
  15998. * _.vowels('fred');
  15999. * // => ['e']
  16000. *
  16001. * _('fred').vowels().value();
  16002. * // => ['e']
  16003. *
  16004. * _.mixin({ 'vowels': vowels }, { 'chain': false });
  16005. * _('fred').vowels();
  16006. * // => ['e']
  16007. */
  16008. function mixin(object, source, options) {
  16009. var props = keys(source),
  16010. methodNames = baseFunctions(source, props);
  16011. if (options == null &&
  16012. !(isObject(source) && (methodNames.length || !props.length))) {
  16013. options = source;
  16014. source = object;
  16015. object = this;
  16016. methodNames = baseFunctions(source, keys(source));
  16017. }
  16018. var chain = !(isObject(options) && 'chain' in options) || !!options.chain,
  16019. isFunc = isFunction(object);
  16020. arrayEach(methodNames, function(methodName) {
  16021. var func = source[methodName];
  16022. object[methodName] = func;
  16023. if (isFunc) {
  16024. object.prototype[methodName] = function() {
  16025. var chainAll = this.__chain__;
  16026. if (chain || chainAll) {
  16027. var result = object(this.__wrapped__),
  16028. actions = result.__actions__ = copyArray(this.__actions__);
  16029. actions.push({ 'func': func, 'args': arguments, 'thisArg': object });
  16030. result.__chain__ = chainAll;
  16031. return result;
  16032. }
  16033. return func.apply(object, arrayPush([this.value()], arguments));
  16034. };
  16035. }
  16036. });
  16037. return object;
  16038. }
  16039. /**
  16040. * Reverts the `_` variable to its previous value and returns a reference to
  16041. * the `lodash` function.
  16042. *
  16043. * @static
  16044. * @since 0.1.0
  16045. * @memberOf _
  16046. * @category Util
  16047. * @returns {Function} Returns the `lodash` function.
  16048. * @example
  16049. *
  16050. * var lodash = _.noConflict();
  16051. */
  16052. function noConflict() {
  16053. if (root._ === this) {
  16054. root._ = oldDash;
  16055. }
  16056. return this;
  16057. }
  16058. /**
  16059. * This method returns `undefined`.
  16060. *
  16061. * @static
  16062. * @memberOf _
  16063. * @since 2.3.0
  16064. * @category Util
  16065. * @example
  16066. *
  16067. * _.times(2, _.noop);
  16068. * // => [undefined, undefined]
  16069. */
  16070. function noop() {
  16071. // No operation performed.
  16072. }
  16073. /**
  16074. * Creates a function that gets the argument at index `n`. If `n` is negative,
  16075. * the nth argument from the end is returned.
  16076. *
  16077. * @static
  16078. * @memberOf _
  16079. * @since 4.0.0
  16080. * @category Util
  16081. * @param {number} [n=0] The index of the argument to return.
  16082. * @returns {Function} Returns the new pass-thru function.
  16083. * @example
  16084. *
  16085. * var func = _.nthArg(1);
  16086. * func('a', 'b', 'c', 'd');
  16087. * // => 'b'
  16088. *
  16089. * var func = _.nthArg(-2);
  16090. * func('a', 'b', 'c', 'd');
  16091. * // => 'c'
  16092. */
  16093. function nthArg(n) {
  16094. n = toInteger(n);
  16095. return baseRest(function(args) {
  16096. return baseNth(args, n);
  16097. });
  16098. }
  16099. /**
  16100. * Creates a function that invokes `iteratees` with the arguments it receives
  16101. * and returns their results.
  16102. *
  16103. * @static
  16104. * @memberOf _
  16105. * @since 4.0.0
  16106. * @category Util
  16107. * @param {...(Function|Function[])} [iteratees=[_.identity]]
  16108. * The iteratees to invoke.
  16109. * @returns {Function} Returns the new function.
  16110. * @example
  16111. *
  16112. * var func = _.over([Math.max, Math.min]);
  16113. *
  16114. * func(1, 2, 3, 4);
  16115. * // => [4, 1]
  16116. */
  16117. var over = createOver(arrayMap);
  16118. /**
  16119. * Creates a function that checks if **all** of the `predicates` return
  16120. * truthy when invoked with the arguments it receives.
  16121. *
  16122. * Following shorthands are possible for providing predicates.
  16123. * Pass an `Object` and it will be used as an parameter for `_.matches` to create the predicate.
  16124. * Pass an `Array` of parameters for `_.matchesProperty` and the predicate will be created using them.
  16125. *
  16126. * @static
  16127. * @memberOf _
  16128. * @since 4.0.0
  16129. * @category Util
  16130. * @param {...(Function|Function[])} [predicates=[_.identity]]
  16131. * The predicates to check.
  16132. * @returns {Function} Returns the new function.
  16133. * @example
  16134. *
  16135. * var func = _.overEvery([Boolean, isFinite]);
  16136. *
  16137. * func('1');
  16138. * // => true
  16139. *
  16140. * func(null);
  16141. * // => false
  16142. *
  16143. * func(NaN);
  16144. * // => false
  16145. */
  16146. var overEvery = createOver(arrayEvery);
  16147. /**
  16148. * Creates a function that checks if **any** of the `predicates` return
  16149. * truthy when invoked with the arguments it receives.
  16150. *
  16151. * Following shorthands are possible for providing predicates.
  16152. * Pass an `Object` and it will be used as an parameter for `_.matches` to create the predicate.
  16153. * Pass an `Array` of parameters for `_.matchesProperty` and the predicate will be created using them.
  16154. *
  16155. * @static
  16156. * @memberOf _
  16157. * @since 4.0.0
  16158. * @category Util
  16159. * @param {...(Function|Function[])} [predicates=[_.identity]]
  16160. * The predicates to check.
  16161. * @returns {Function} Returns the new function.
  16162. * @example
  16163. *
  16164. * var func = _.overSome([Boolean, isFinite]);
  16165. *
  16166. * func('1');
  16167. * // => true
  16168. *
  16169. * func(null);
  16170. * // => true
  16171. *
  16172. * func(NaN);
  16173. * // => false
  16174. *
  16175. * var matchesFunc = _.overSome([{ 'a': 1 }, { 'a': 2 }])
  16176. * var matchesPropertyFunc = _.overSome([['a', 1], ['a', 2]])
  16177. */
  16178. var overSome = createOver(arraySome);
  16179. /**
  16180. * Creates a function that returns the value at `path` of a given object.
  16181. *
  16182. * @static
  16183. * @memberOf _
  16184. * @since 2.4.0
  16185. * @category Util
  16186. * @param {Array|string} path The path of the property to get.
  16187. * @returns {Function} Returns the new accessor function.
  16188. * @example
  16189. *
  16190. * var objects = [
  16191. * { 'a': { 'b': 2 } },
  16192. * { 'a': { 'b': 1 } }
  16193. * ];
  16194. *
  16195. * _.map(objects, _.property('a.b'));
  16196. * // => [2, 1]
  16197. *
  16198. * _.map(_.sortBy(objects, _.property(['a', 'b'])), 'a.b');
  16199. * // => [1, 2]
  16200. */
  16201. function property(path) {
  16202. return isKey(path) ? baseProperty(toKey(path)) : basePropertyDeep(path);
  16203. }
  16204. /**
  16205. * The opposite of `_.property`; this method creates a function that returns
  16206. * the value at a given path of `object`.
  16207. *
  16208. * @static
  16209. * @memberOf _
  16210. * @since 3.0.0
  16211. * @category Util
  16212. * @param {Object} object The object to query.
  16213. * @returns {Function} Returns the new accessor function.
  16214. * @example
  16215. *
  16216. * var array = [0, 1, 2],
  16217. * object = { 'a': array, 'b': array, 'c': array };
  16218. *
  16219. * _.map(['a[2]', 'c[0]'], _.propertyOf(object));
  16220. * // => [2, 0]
  16221. *
  16222. * _.map([['a', '2'], ['c', '0']], _.propertyOf(object));
  16223. * // => [2, 0]
  16224. */
  16225. function propertyOf(object) {
  16226. return function(path) {
  16227. return object == null ? undefined : baseGet(object, path);
  16228. };
  16229. }
  16230. /**
  16231. * Creates an array of numbers (positive and/or negative) progressing from
  16232. * `start` up to, but not including, `end`. A step of `-1` is used if a negative
  16233. * `start` is specified without an `end` or `step`. If `end` is not specified,
  16234. * it's set to `start` with `start` then set to `0`.
  16235. *
  16236. * **Note:** JavaScript follows the IEEE-754 standard for resolving
  16237. * floating-point values which can produce unexpected results.
  16238. *
  16239. * @static
  16240. * @since 0.1.0
  16241. * @memberOf _
  16242. * @category Util
  16243. * @param {number} [start=0] The start of the range.
  16244. * @param {number} end The end of the range.
  16245. * @param {number} [step=1] The value to increment or decrement by.
  16246. * @returns {Array} Returns the range of numbers.
  16247. * @see _.inRange, _.rangeRight
  16248. * @example
  16249. *
  16250. * _.range(4);
  16251. * // => [0, 1, 2, 3]
  16252. *
  16253. * _.range(-4);
  16254. * // => [0, -1, -2, -3]
  16255. *
  16256. * _.range(1, 5);
  16257. * // => [1, 2, 3, 4]
  16258. *
  16259. * _.range(0, 20, 5);
  16260. * // => [0, 5, 10, 15]
  16261. *
  16262. * _.range(0, -4, -1);
  16263. * // => [0, -1, -2, -3]
  16264. *
  16265. * _.range(1, 4, 0);
  16266. * // => [1, 1, 1]
  16267. *
  16268. * _.range(0);
  16269. * // => []
  16270. */
  16271. var range = createRange();
  16272. /**
  16273. * This method is like `_.range` except that it populates values in
  16274. * descending order.
  16275. *
  16276. * @static
  16277. * @memberOf _
  16278. * @since 4.0.0
  16279. * @category Util
  16280. * @param {number} [start=0] The start of the range.
  16281. * @param {number} end The end of the range.
  16282. * @param {number} [step=1] The value to increment or decrement by.
  16283. * @returns {Array} Returns the range of numbers.
  16284. * @see _.inRange, _.range
  16285. * @example
  16286. *
  16287. * _.rangeRight(4);
  16288. * // => [3, 2, 1, 0]
  16289. *
  16290. * _.rangeRight(-4);
  16291. * // => [-3, -2, -1, 0]
  16292. *
  16293. * _.rangeRight(1, 5);
  16294. * // => [4, 3, 2, 1]
  16295. *
  16296. * _.rangeRight(0, 20, 5);
  16297. * // => [15, 10, 5, 0]
  16298. *
  16299. * _.rangeRight(0, -4, -1);
  16300. * // => [-3, -2, -1, 0]
  16301. *
  16302. * _.rangeRight(1, 4, 0);
  16303. * // => [1, 1, 1]
  16304. *
  16305. * _.rangeRight(0);
  16306. * // => []
  16307. */
  16308. var rangeRight = createRange(true);
  16309. /**
  16310. * This method returns a new empty array.
  16311. *
  16312. * @static
  16313. * @memberOf _
  16314. * @since 4.13.0
  16315. * @category Util
  16316. * @returns {Array} Returns the new empty array.
  16317. * @example
  16318. *
  16319. * var arrays = _.times(2, _.stubArray);
  16320. *
  16321. * console.log(arrays);
  16322. * // => [[], []]
  16323. *
  16324. * console.log(arrays[0] === arrays[1]);
  16325. * // => false
  16326. */
  16327. function stubArray() {
  16328. return [];
  16329. }
  16330. /**
  16331. * This method returns `false`.
  16332. *
  16333. * @static
  16334. * @memberOf _
  16335. * @since 4.13.0
  16336. * @category Util
  16337. * @returns {boolean} Returns `false`.
  16338. * @example
  16339. *
  16340. * _.times(2, _.stubFalse);
  16341. * // => [false, false]
  16342. */
  16343. function stubFalse() {
  16344. return false;
  16345. }
  16346. /**
  16347. * This method returns a new empty object.
  16348. *
  16349. * @static
  16350. * @memberOf _
  16351. * @since 4.13.0
  16352. * @category Util
  16353. * @returns {Object} Returns the new empty object.
  16354. * @example
  16355. *
  16356. * var objects = _.times(2, _.stubObject);
  16357. *
  16358. * console.log(objects);
  16359. * // => [{}, {}]
  16360. *
  16361. * console.log(objects[0] === objects[1]);
  16362. * // => false
  16363. */
  16364. function stubObject() {
  16365. return {};
  16366. }
  16367. /**
  16368. * This method returns an empty string.
  16369. *
  16370. * @static
  16371. * @memberOf _
  16372. * @since 4.13.0
  16373. * @category Util
  16374. * @returns {string} Returns the empty string.
  16375. * @example
  16376. *
  16377. * _.times(2, _.stubString);
  16378. * // => ['', '']
  16379. */
  16380. function stubString() {
  16381. return '';
  16382. }
  16383. /**
  16384. * This method returns `true`.
  16385. *
  16386. * @static
  16387. * @memberOf _
  16388. * @since 4.13.0
  16389. * @category Util
  16390. * @returns {boolean} Returns `true`.
  16391. * @example
  16392. *
  16393. * _.times(2, _.stubTrue);
  16394. * // => [true, true]
  16395. */
  16396. function stubTrue() {
  16397. return true;
  16398. }
  16399. /**
  16400. * Invokes the iteratee `n` times, returning an array of the results of
  16401. * each invocation. The iteratee is invoked with one argument; (index).
  16402. *
  16403. * @static
  16404. * @since 0.1.0
  16405. * @memberOf _
  16406. * @category Util
  16407. * @param {number} n The number of times to invoke `iteratee`.
  16408. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  16409. * @returns {Array} Returns the array of results.
  16410. * @example
  16411. *
  16412. * _.times(3, String);
  16413. * // => ['0', '1', '2']
  16414. *
  16415. * _.times(4, _.constant(0));
  16416. * // => [0, 0, 0, 0]
  16417. */
  16418. function times(n, iteratee) {
  16419. n = toInteger(n);
  16420. if (n < 1 || n > MAX_SAFE_INTEGER) {
  16421. return [];
  16422. }
  16423. var index = MAX_ARRAY_LENGTH,
  16424. length = nativeMin(n, MAX_ARRAY_LENGTH);
  16425. iteratee = getIteratee(iteratee);
  16426. n -= MAX_ARRAY_LENGTH;
  16427. var result = baseTimes(length, iteratee);
  16428. while (++index < n) {
  16429. iteratee(index);
  16430. }
  16431. return result;
  16432. }
  16433. /**
  16434. * Converts `value` to a property path array.
  16435. *
  16436. * @static
  16437. * @memberOf _
  16438. * @since 4.0.0
  16439. * @category Util
  16440. * @param {*} value The value to convert.
  16441. * @returns {Array} Returns the new property path array.
  16442. * @example
  16443. *
  16444. * _.toPath('a.b.c');
  16445. * // => ['a', 'b', 'c']
  16446. *
  16447. * _.toPath('a[0].b.c');
  16448. * // => ['a', '0', 'b', 'c']
  16449. */
  16450. function toPath(value) {
  16451. if (isArray(value)) {
  16452. return arrayMap(value, toKey);
  16453. }
  16454. return isSymbol(value) ? [value] : copyArray(stringToPath(toString(value)));
  16455. }
  16456. /**
  16457. * Generates a unique ID. If `prefix` is given, the ID is appended to it.
  16458. *
  16459. * @static
  16460. * @since 0.1.0
  16461. * @memberOf _
  16462. * @category Util
  16463. * @param {string} [prefix=''] The value to prefix the ID with.
  16464. * @returns {string} Returns the unique ID.
  16465. * @example
  16466. *
  16467. * _.uniqueId('contact_');
  16468. * // => 'contact_104'
  16469. *
  16470. * _.uniqueId();
  16471. * // => '105'
  16472. */
  16473. function uniqueId(prefix) {
  16474. var id = ++idCounter;
  16475. return toString(prefix) + id;
  16476. }
  16477. /*------------------------------------------------------------------------*/
  16478. /**
  16479. * Adds two numbers.
  16480. *
  16481. * @static
  16482. * @memberOf _
  16483. * @since 3.4.0
  16484. * @category Math
  16485. * @param {number} augend The first number in an addition.
  16486. * @param {number} addend The second number in an addition.
  16487. * @returns {number} Returns the total.
  16488. * @example
  16489. *
  16490. * _.add(6, 4);
  16491. * // => 10
  16492. */
  16493. var add = createMathOperation(function(augend, addend) {
  16494. return augend + addend;
  16495. }, 0);
  16496. /**
  16497. * Computes `number` rounded up to `precision`.
  16498. *
  16499. * @static
  16500. * @memberOf _
  16501. * @since 3.10.0
  16502. * @category Math
  16503. * @param {number} number The number to round up.
  16504. * @param {number} [precision=0] The precision to round up to.
  16505. * @returns {number} Returns the rounded up number.
  16506. * @example
  16507. *
  16508. * _.ceil(4.006);
  16509. * // => 5
  16510. *
  16511. * _.ceil(6.004, 2);
  16512. * // => 6.01
  16513. *
  16514. * _.ceil(6040, -2);
  16515. * // => 6100
  16516. */
  16517. var ceil = createRound('ceil');
  16518. /**
  16519. * Divide two numbers.
  16520. *
  16521. * @static
  16522. * @memberOf _
  16523. * @since 4.7.0
  16524. * @category Math
  16525. * @param {number} dividend The first number in a division.
  16526. * @param {number} divisor The second number in a division.
  16527. * @returns {number} Returns the quotient.
  16528. * @example
  16529. *
  16530. * _.divide(6, 4);
  16531. * // => 1.5
  16532. */
  16533. var divide = createMathOperation(function(dividend, divisor) {
  16534. return dividend / divisor;
  16535. }, 1);
  16536. /**
  16537. * Computes `number` rounded down to `precision`.
  16538. *
  16539. * @static
  16540. * @memberOf _
  16541. * @since 3.10.0
  16542. * @category Math
  16543. * @param {number} number The number to round down.
  16544. * @param {number} [precision=0] The precision to round down to.
  16545. * @returns {number} Returns the rounded down number.
  16546. * @example
  16547. *
  16548. * _.floor(4.006);
  16549. * // => 4
  16550. *
  16551. * _.floor(0.046, 2);
  16552. * // => 0.04
  16553. *
  16554. * _.floor(4060, -2);
  16555. * // => 4000
  16556. */
  16557. var floor = createRound('floor');
  16558. /**
  16559. * Computes the maximum value of `array`. If `array` is empty or falsey,
  16560. * `undefined` is returned.
  16561. *
  16562. * @static
  16563. * @since 0.1.0
  16564. * @memberOf _
  16565. * @category Math
  16566. * @param {Array} array The array to iterate over.
  16567. * @returns {*} Returns the maximum value.
  16568. * @example
  16569. *
  16570. * _.max([4, 2, 8, 6]);
  16571. * // => 8
  16572. *
  16573. * _.max([]);
  16574. * // => undefined
  16575. */
  16576. function max(array) {
  16577. return (array && array.length)
  16578. ? baseExtremum(array, identity, baseGt)
  16579. : undefined;
  16580. }
  16581. /**
  16582. * This method is like `_.max` except that it accepts `iteratee` which is
  16583. * invoked for each element in `array` to generate the criterion by which
  16584. * the value is ranked. The iteratee is invoked with one argument: (value).
  16585. *
  16586. * @static
  16587. * @memberOf _
  16588. * @since 4.0.0
  16589. * @category Math
  16590. * @param {Array} array The array to iterate over.
  16591. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  16592. * @returns {*} Returns the maximum value.
  16593. * @example
  16594. *
  16595. * var objects = [{ 'n': 1 }, { 'n': 2 }];
  16596. *
  16597. * _.maxBy(objects, function(o) { return o.n; });
  16598. * // => { 'n': 2 }
  16599. *
  16600. * // The `_.property` iteratee shorthand.
  16601. * _.maxBy(objects, 'n');
  16602. * // => { 'n': 2 }
  16603. */
  16604. function maxBy(array, iteratee) {
  16605. return (array && array.length)
  16606. ? baseExtremum(array, getIteratee(iteratee, 2), baseGt)
  16607. : undefined;
  16608. }
  16609. /**
  16610. * Computes the mean of the values in `array`.
  16611. *
  16612. * @static
  16613. * @memberOf _
  16614. * @since 4.0.0
  16615. * @category Math
  16616. * @param {Array} array The array to iterate over.
  16617. * @returns {number} Returns the mean.
  16618. * @example
  16619. *
  16620. * _.mean([4, 2, 8, 6]);
  16621. * // => 5
  16622. */
  16623. function mean(array) {
  16624. return baseMean(array, identity);
  16625. }
  16626. /**
  16627. * This method is like `_.mean` except that it accepts `iteratee` which is
  16628. * invoked for each element in `array` to generate the value to be averaged.
  16629. * The iteratee is invoked with one argument: (value).
  16630. *
  16631. * @static
  16632. * @memberOf _
  16633. * @since 4.7.0
  16634. * @category Math
  16635. * @param {Array} array The array to iterate over.
  16636. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  16637. * @returns {number} Returns the mean.
  16638. * @example
  16639. *
  16640. * var objects = [{ 'n': 4 }, { 'n': 2 }, { 'n': 8 }, { 'n': 6 }];
  16641. *
  16642. * _.meanBy(objects, function(o) { return o.n; });
  16643. * // => 5
  16644. *
  16645. * // The `_.property` iteratee shorthand.
  16646. * _.meanBy(objects, 'n');
  16647. * // => 5
  16648. */
  16649. function meanBy(array, iteratee) {
  16650. return baseMean(array, getIteratee(iteratee, 2));
  16651. }
  16652. /**
  16653. * Computes the minimum value of `array`. If `array` is empty or falsey,
  16654. * `undefined` is returned.
  16655. *
  16656. * @static
  16657. * @since 0.1.0
  16658. * @memberOf _
  16659. * @category Math
  16660. * @param {Array} array The array to iterate over.
  16661. * @returns {*} Returns the minimum value.
  16662. * @example
  16663. *
  16664. * _.min([4, 2, 8, 6]);
  16665. * // => 2
  16666. *
  16667. * _.min([]);
  16668. * // => undefined
  16669. */
  16670. function min(array) {
  16671. return (array && array.length)
  16672. ? baseExtremum(array, identity, baseLt)
  16673. : undefined;
  16674. }
  16675. /**
  16676. * This method is like `_.min` except that it accepts `iteratee` which is
  16677. * invoked for each element in `array` to generate the criterion by which
  16678. * the value is ranked. The iteratee is invoked with one argument: (value).
  16679. *
  16680. * @static
  16681. * @memberOf _
  16682. * @since 4.0.0
  16683. * @category Math
  16684. * @param {Array} array The array to iterate over.
  16685. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  16686. * @returns {*} Returns the minimum value.
  16687. * @example
  16688. *
  16689. * var objects = [{ 'n': 1 }, { 'n': 2 }];
  16690. *
  16691. * _.minBy(objects, function(o) { return o.n; });
  16692. * // => { 'n': 1 }
  16693. *
  16694. * // The `_.property` iteratee shorthand.
  16695. * _.minBy(objects, 'n');
  16696. * // => { 'n': 1 }
  16697. */
  16698. function minBy(array, iteratee) {
  16699. return (array && array.length)
  16700. ? baseExtremum(array, getIteratee(iteratee, 2), baseLt)
  16701. : undefined;
  16702. }
  16703. /**
  16704. * Multiply two numbers.
  16705. *
  16706. * @static
  16707. * @memberOf _
  16708. * @since 4.7.0
  16709. * @category Math
  16710. * @param {number} multiplier The first number in a multiplication.
  16711. * @param {number} multiplicand The second number in a multiplication.
  16712. * @returns {number} Returns the product.
  16713. * @example
  16714. *
  16715. * _.multiply(6, 4);
  16716. * // => 24
  16717. */
  16718. var multiply = createMathOperation(function(multiplier, multiplicand) {
  16719. return multiplier * multiplicand;
  16720. }, 1);
  16721. /**
  16722. * Computes `number` rounded to `precision`.
  16723. *
  16724. * @static
  16725. * @memberOf _
  16726. * @since 3.10.0
  16727. * @category Math
  16728. * @param {number} number The number to round.
  16729. * @param {number} [precision=0] The precision to round to.
  16730. * @returns {number} Returns the rounded number.
  16731. * @example
  16732. *
  16733. * _.round(4.006);
  16734. * // => 4
  16735. *
  16736. * _.round(4.006, 2);
  16737. * // => 4.01
  16738. *
  16739. * _.round(4060, -2);
  16740. * // => 4100
  16741. */
  16742. var round = createRound('round');
  16743. /**
  16744. * Subtract two numbers.
  16745. *
  16746. * @static
  16747. * @memberOf _
  16748. * @since 4.0.0
  16749. * @category Math
  16750. * @param {number} minuend The first number in a subtraction.
  16751. * @param {number} subtrahend The second number in a subtraction.
  16752. * @returns {number} Returns the difference.
  16753. * @example
  16754. *
  16755. * _.subtract(6, 4);
  16756. * // => 2
  16757. */
  16758. var subtract = createMathOperation(function(minuend, subtrahend) {
  16759. return minuend - subtrahend;
  16760. }, 0);
  16761. /**
  16762. * Computes the sum of the values in `array`.
  16763. *
  16764. * @static
  16765. * @memberOf _
  16766. * @since 3.4.0
  16767. * @category Math
  16768. * @param {Array} array The array to iterate over.
  16769. * @returns {number} Returns the sum.
  16770. * @example
  16771. *
  16772. * _.sum([4, 2, 8, 6]);
  16773. * // => 20
  16774. */
  16775. function sum(array) {
  16776. return (array && array.length)
  16777. ? baseSum(array, identity)
  16778. : 0;
  16779. }
  16780. /**
  16781. * This method is like `_.sum` except that it accepts `iteratee` which is
  16782. * invoked for each element in `array` to generate the value to be summed.
  16783. * The iteratee is invoked with one argument: (value).
  16784. *
  16785. * @static
  16786. * @memberOf _
  16787. * @since 4.0.0
  16788. * @category Math
  16789. * @param {Array} array The array to iterate over.
  16790. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  16791. * @returns {number} Returns the sum.
  16792. * @example
  16793. *
  16794. * var objects = [{ 'n': 4 }, { 'n': 2 }, { 'n': 8 }, { 'n': 6 }];
  16795. *
  16796. * _.sumBy(objects, function(o) { return o.n; });
  16797. * // => 20
  16798. *
  16799. * // The `_.property` iteratee shorthand.
  16800. * _.sumBy(objects, 'n');
  16801. * // => 20
  16802. */
  16803. function sumBy(array, iteratee) {
  16804. return (array && array.length)
  16805. ? baseSum(array, getIteratee(iteratee, 2))
  16806. : 0;
  16807. }
  16808. /*------------------------------------------------------------------------*/
  16809. // Add methods that return wrapped values in chain sequences.
  16810. lodash.after = after;
  16811. lodash.ary = ary;
  16812. lodash.assign = assign;
  16813. lodash.assignIn = assignIn;
  16814. lodash.assignInWith = assignInWith;
  16815. lodash.assignWith = assignWith;
  16816. lodash.at = at;
  16817. lodash.before = before;
  16818. lodash.bind = bind;
  16819. lodash.bindAll = bindAll;
  16820. lodash.bindKey = bindKey;
  16821. lodash.castArray = castArray;
  16822. lodash.chain = chain;
  16823. lodash.chunk = chunk;
  16824. lodash.compact = compact;
  16825. lodash.concat = concat;
  16826. lodash.cond = cond;
  16827. lodash.conforms = conforms;
  16828. lodash.constant = constant;
  16829. lodash.countBy = countBy;
  16830. lodash.create = create;
  16831. lodash.curry = curry;
  16832. lodash.curryRight = curryRight;
  16833. lodash.debounce = debounce;
  16834. lodash.defaults = defaults;
  16835. lodash.defaultsDeep = defaultsDeep;
  16836. lodash.defer = defer;
  16837. lodash.delay = delay;
  16838. lodash.difference = difference;
  16839. lodash.differenceBy = differenceBy;
  16840. lodash.differenceWith = differenceWith;
  16841. lodash.drop = drop;
  16842. lodash.dropRight = dropRight;
  16843. lodash.dropRightWhile = dropRightWhile;
  16844. lodash.dropWhile = dropWhile;
  16845. lodash.fill = fill;
  16846. lodash.filter = filter;
  16847. lodash.flatMap = flatMap;
  16848. lodash.flatMapDeep = flatMapDeep;
  16849. lodash.flatMapDepth = flatMapDepth;
  16850. lodash.flatten = flatten;
  16851. lodash.flattenDeep = flattenDeep;
  16852. lodash.flattenDepth = flattenDepth;
  16853. lodash.flip = flip;
  16854. lodash.flow = flow;
  16855. lodash.flowRight = flowRight;
  16856. lodash.fromPairs = fromPairs;
  16857. lodash.functions = functions;
  16858. lodash.functionsIn = functionsIn;
  16859. lodash.groupBy = groupBy;
  16860. lodash.initial = initial;
  16861. lodash.intersection = intersection;
  16862. lodash.intersectionBy = intersectionBy;
  16863. lodash.intersectionWith = intersectionWith;
  16864. lodash.invert = invert;
  16865. lodash.invertBy = invertBy;
  16866. lodash.invokeMap = invokeMap;
  16867. lodash.iteratee = iteratee;
  16868. lodash.keyBy = keyBy;
  16869. lodash.keys = keys;
  16870. lodash.keysIn = keysIn;
  16871. lodash.map = map;
  16872. lodash.mapKeys = mapKeys;
  16873. lodash.mapValues = mapValues;
  16874. lodash.matches = matches;
  16875. lodash.matchesProperty = matchesProperty;
  16876. lodash.memoize = memoize;
  16877. lodash.merge = merge;
  16878. lodash.mergeWith = mergeWith;
  16879. lodash.method = method;
  16880. lodash.methodOf = methodOf;
  16881. lodash.mixin = mixin;
  16882. lodash.negate = negate;
  16883. lodash.nthArg = nthArg;
  16884. lodash.omit = omit;
  16885. lodash.omitBy = omitBy;
  16886. lodash.once = once;
  16887. lodash.orderBy = orderBy;
  16888. lodash.over = over;
  16889. lodash.overArgs = overArgs;
  16890. lodash.overEvery = overEvery;
  16891. lodash.overSome = overSome;
  16892. lodash.partial = partial;
  16893. lodash.partialRight = partialRight;
  16894. lodash.partition = partition;
  16895. lodash.pick = pick;
  16896. lodash.pickBy = pickBy;
  16897. lodash.property = property;
  16898. lodash.propertyOf = propertyOf;
  16899. lodash.pull = pull;
  16900. lodash.pullAll = pullAll;
  16901. lodash.pullAllBy = pullAllBy;
  16902. lodash.pullAllWith = pullAllWith;
  16903. lodash.pullAt = pullAt;
  16904. lodash.range = range;
  16905. lodash.rangeRight = rangeRight;
  16906. lodash.rearg = rearg;
  16907. lodash.reject = reject;
  16908. lodash.remove = remove;
  16909. lodash.rest = rest;
  16910. lodash.reverse = reverse;
  16911. lodash.sampleSize = sampleSize;
  16912. lodash.set = set;
  16913. lodash.setWith = setWith;
  16914. lodash.shuffle = shuffle;
  16915. lodash.slice = slice;
  16916. lodash.sortBy = sortBy;
  16917. lodash.sortedUniq = sortedUniq;
  16918. lodash.sortedUniqBy = sortedUniqBy;
  16919. lodash.split = split;
  16920. lodash.spread = spread;
  16921. lodash.tail = tail;
  16922. lodash.take = take;
  16923. lodash.takeRight = takeRight;
  16924. lodash.takeRightWhile = takeRightWhile;
  16925. lodash.takeWhile = takeWhile;
  16926. lodash.tap = tap;
  16927. lodash.throttle = throttle;
  16928. lodash.thru = thru;
  16929. lodash.toArray = toArray;
  16930. lodash.toPairs = toPairs;
  16931. lodash.toPairsIn = toPairsIn;
  16932. lodash.toPath = toPath;
  16933. lodash.toPlainObject = toPlainObject;
  16934. lodash.transform = transform;
  16935. lodash.unary = unary;
  16936. lodash.union = union;
  16937. lodash.unionBy = unionBy;
  16938. lodash.unionWith = unionWith;
  16939. lodash.uniq = uniq;
  16940. lodash.uniqBy = uniqBy;
  16941. lodash.uniqWith = uniqWith;
  16942. lodash.unset = unset;
  16943. lodash.unzip = unzip;
  16944. lodash.unzipWith = unzipWith;
  16945. lodash.update = update;
  16946. lodash.updateWith = updateWith;
  16947. lodash.values = values;
  16948. lodash.valuesIn = valuesIn;
  16949. lodash.without = without;
  16950. lodash.words = words;
  16951. lodash.wrap = wrap;
  16952. lodash.xor = xor;
  16953. lodash.xorBy = xorBy;
  16954. lodash.xorWith = xorWith;
  16955. lodash.zip = zip;
  16956. lodash.zipObject = zipObject;
  16957. lodash.zipObjectDeep = zipObjectDeep;
  16958. lodash.zipWith = zipWith;
  16959. // Add aliases.
  16960. lodash.entries = toPairs;
  16961. lodash.entriesIn = toPairsIn;
  16962. lodash.extend = assignIn;
  16963. lodash.extendWith = assignInWith;
  16964. // Add methods to `lodash.prototype`.
  16965. mixin(lodash, lodash);
  16966. /*------------------------------------------------------------------------*/
  16967. // Add methods that return unwrapped values in chain sequences.
  16968. lodash.add = add;
  16969. lodash.attempt = attempt;
  16970. lodash.camelCase = camelCase;
  16971. lodash.capitalize = capitalize;
  16972. lodash.ceil = ceil;
  16973. lodash.clamp = clamp;
  16974. lodash.clone = clone;
  16975. lodash.cloneDeep = cloneDeep;
  16976. lodash.cloneDeepWith = cloneDeepWith;
  16977. lodash.cloneWith = cloneWith;
  16978. lodash.conformsTo = conformsTo;
  16979. lodash.deburr = deburr;
  16980. lodash.defaultTo = defaultTo;
  16981. lodash.divide = divide;
  16982. lodash.endsWith = endsWith;
  16983. lodash.eq = eq;
  16984. lodash.escape = escape;
  16985. lodash.escapeRegExp = escapeRegExp;
  16986. lodash.every = every;
  16987. lodash.find = find;
  16988. lodash.findIndex = findIndex;
  16989. lodash.findKey = findKey;
  16990. lodash.findLast = findLast;
  16991. lodash.findLastIndex = findLastIndex;
  16992. lodash.findLastKey = findLastKey;
  16993. lodash.floor = floor;
  16994. lodash.forEach = forEach;
  16995. lodash.forEachRight = forEachRight;
  16996. lodash.forIn = forIn;
  16997. lodash.forInRight = forInRight;
  16998. lodash.forOwn = forOwn;
  16999. lodash.forOwnRight = forOwnRight;
  17000. lodash.get = get;
  17001. lodash.gt = gt;
  17002. lodash.gte = gte;
  17003. lodash.has = has;
  17004. lodash.hasIn = hasIn;
  17005. lodash.head = head;
  17006. lodash.identity = identity;
  17007. lodash.includes = includes;
  17008. lodash.indexOf = indexOf;
  17009. lodash.inRange = inRange;
  17010. lodash.invoke = invoke;
  17011. lodash.isArguments = isArguments;
  17012. lodash.isArray = isArray;
  17013. lodash.isArrayBuffer = isArrayBuffer;
  17014. lodash.isArrayLike = isArrayLike;
  17015. lodash.isArrayLikeObject = isArrayLikeObject;
  17016. lodash.isBoolean = isBoolean;
  17017. lodash.isBuffer = isBuffer;
  17018. lodash.isDate = isDate;
  17019. lodash.isElement = isElement;
  17020. lodash.isEmpty = isEmpty;
  17021. lodash.isEqual = isEqual;
  17022. lodash.isEqualWith = isEqualWith;
  17023. lodash.isError = isError;
  17024. lodash.isFinite = isFinite;
  17025. lodash.isFunction = isFunction;
  17026. lodash.isInteger = isInteger;
  17027. lodash.isLength = isLength;
  17028. lodash.isMap = isMap;
  17029. lodash.isMatch = isMatch;
  17030. lodash.isMatchWith = isMatchWith;
  17031. lodash.isNaN = isNaN;
  17032. lodash.isNative = isNative;
  17033. lodash.isNil = isNil;
  17034. lodash.isNull = isNull;
  17035. lodash.isNumber = isNumber;
  17036. lodash.isObject = isObject;
  17037. lodash.isObjectLike = isObjectLike;
  17038. lodash.isPlainObject = isPlainObject;
  17039. lodash.isRegExp = isRegExp;
  17040. lodash.isSafeInteger = isSafeInteger;
  17041. lodash.isSet = isSet;
  17042. lodash.isString = isString;
  17043. lodash.isSymbol = isSymbol;
  17044. lodash.isTypedArray = isTypedArray;
  17045. lodash.isUndefined = isUndefined;
  17046. lodash.isWeakMap = isWeakMap;
  17047. lodash.isWeakSet = isWeakSet;
  17048. lodash.join = join;
  17049. lodash.kebabCase = kebabCase;
  17050. lodash.last = last;
  17051. lodash.lastIndexOf = lastIndexOf;
  17052. lodash.lowerCase = lowerCase;
  17053. lodash.lowerFirst = lowerFirst;
  17054. lodash.lt = lt;
  17055. lodash.lte = lte;
  17056. lodash.max = max;
  17057. lodash.maxBy = maxBy;
  17058. lodash.mean = mean;
  17059. lodash.meanBy = meanBy;
  17060. lodash.min = min;
  17061. lodash.minBy = minBy;
  17062. lodash.stubArray = stubArray;
  17063. lodash.stubFalse = stubFalse;
  17064. lodash.stubObject = stubObject;
  17065. lodash.stubString = stubString;
  17066. lodash.stubTrue = stubTrue;
  17067. lodash.multiply = multiply;
  17068. lodash.nth = nth;
  17069. lodash.noConflict = noConflict;
  17070. lodash.noop = noop;
  17071. lodash.now = now;
  17072. lodash.pad = pad;
  17073. lodash.padEnd = padEnd;
  17074. lodash.padStart = padStart;
  17075. lodash.parseInt = parseInt;
  17076. lodash.random = random;
  17077. lodash.reduce = reduce;
  17078. lodash.reduceRight = reduceRight;
  17079. lodash.repeat = repeat;
  17080. lodash.replace = replace;
  17081. lodash.result = result;
  17082. lodash.round = round;
  17083. lodash.runInContext = runInContext;
  17084. lodash.sample = sample;
  17085. lodash.size = size;
  17086. lodash.snakeCase = snakeCase;
  17087. lodash.some = some;
  17088. lodash.sortedIndex = sortedIndex;
  17089. lodash.sortedIndexBy = sortedIndexBy;
  17090. lodash.sortedIndexOf = sortedIndexOf;
  17091. lodash.sortedLastIndex = sortedLastIndex;
  17092. lodash.sortedLastIndexBy = sortedLastIndexBy;
  17093. lodash.sortedLastIndexOf = sortedLastIndexOf;
  17094. lodash.startCase = startCase;
  17095. lodash.startsWith = startsWith;
  17096. lodash.subtract = subtract;
  17097. lodash.sum = sum;
  17098. lodash.sumBy = sumBy;
  17099. lodash.template = template;
  17100. lodash.times = times;
  17101. lodash.toFinite = toFinite;
  17102. lodash.toInteger = toInteger;
  17103. lodash.toLength = toLength;
  17104. lodash.toLower = toLower;
  17105. lodash.toNumber = toNumber;
  17106. lodash.toSafeInteger = toSafeInteger;
  17107. lodash.toString = toString;
  17108. lodash.toUpper = toUpper;
  17109. lodash.trim = trim;
  17110. lodash.trimEnd = trimEnd;
  17111. lodash.trimStart = trimStart;
  17112. lodash.truncate = truncate;
  17113. lodash.unescape = unescape;
  17114. lodash.uniqueId = uniqueId;
  17115. lodash.upperCase = upperCase;
  17116. lodash.upperFirst = upperFirst;
  17117. // Add aliases.
  17118. lodash.each = forEach;
  17119. lodash.eachRight = forEachRight;
  17120. lodash.first = head;
  17121. mixin(lodash, (function() {
  17122. var source = {};
  17123. baseForOwn(lodash, function(func, methodName) {
  17124. if (!hasOwnProperty.call(lodash.prototype, methodName)) {
  17125. source[methodName] = func;
  17126. }
  17127. });
  17128. return source;
  17129. }()), { 'chain': false });
  17130. /*------------------------------------------------------------------------*/
  17131. /**
  17132. * The semantic version number.
  17133. *
  17134. * @static
  17135. * @memberOf _
  17136. * @type {string}
  17137. */
  17138. lodash.VERSION = VERSION;
  17139. // Assign default placeholders.
  17140. arrayEach(['bind', 'bindKey', 'curry', 'curryRight', 'partial', 'partialRight'], function(methodName) {
  17141. lodash[methodName].placeholder = lodash;
  17142. });
  17143. // Add `LazyWrapper` methods for `_.drop` and `_.take` variants.
  17144. arrayEach(['drop', 'take'], function(methodName, index) {
  17145. LazyWrapper.prototype[methodName] = function(n) {
  17146. n = n === undefined ? 1 : nativeMax(toInteger(n), 0);
  17147. var result = (this.__filtered__ && !index)
  17148. ? new LazyWrapper(this)
  17149. : this.clone();
  17150. if (result.__filtered__) {
  17151. result.__takeCount__ = nativeMin(n, result.__takeCount__);
  17152. } else {
  17153. result.__views__.push({
  17154. 'size': nativeMin(n, MAX_ARRAY_LENGTH),
  17155. 'type': methodName + (result.__dir__ < 0 ? 'Right' : '')
  17156. });
  17157. }
  17158. return result;
  17159. };
  17160. LazyWrapper.prototype[methodName + 'Right'] = function(n) {
  17161. return this.reverse()[methodName](n).reverse();
  17162. };
  17163. });
  17164. // Add `LazyWrapper` methods that accept an `iteratee` value.
  17165. arrayEach(['filter', 'map', 'takeWhile'], function(methodName, index) {
  17166. var type = index + 1,
  17167. isFilter = type == LAZY_FILTER_FLAG || type == LAZY_WHILE_FLAG;
  17168. LazyWrapper.prototype[methodName] = function(iteratee) {
  17169. var result = this.clone();
  17170. result.__iteratees__.push({
  17171. 'iteratee': getIteratee(iteratee, 3),
  17172. 'type': type
  17173. });
  17174. result.__filtered__ = result.__filtered__ || isFilter;
  17175. return result;
  17176. };
  17177. });
  17178. // Add `LazyWrapper` methods for `_.head` and `_.last`.
  17179. arrayEach(['head', 'last'], function(methodName, index) {
  17180. var takeName = 'take' + (index ? 'Right' : '');
  17181. LazyWrapper.prototype[methodName] = function() {
  17182. return this[takeName](1).value()[0];
  17183. };
  17184. });
  17185. // Add `LazyWrapper` methods for `_.initial` and `_.tail`.
  17186. arrayEach(['initial', 'tail'], function(methodName, index) {
  17187. var dropName = 'drop' + (index ? '' : 'Right');
  17188. LazyWrapper.prototype[methodName] = function() {
  17189. return this.__filtered__ ? new LazyWrapper(this) : this[dropName](1);
  17190. };
  17191. });
  17192. LazyWrapper.prototype.compact = function() {
  17193. return this.filter(identity);
  17194. };
  17195. LazyWrapper.prototype.find = function(predicate) {
  17196. return this.filter(predicate).head();
  17197. };
  17198. LazyWrapper.prototype.findLast = function(predicate) {
  17199. return this.reverse().find(predicate);
  17200. };
  17201. LazyWrapper.prototype.invokeMap = baseRest(function(path, args) {
  17202. if (typeof path == 'function') {
  17203. return new LazyWrapper(this);
  17204. }
  17205. return this.map(function(value) {
  17206. return baseInvoke(value, path, args);
  17207. });
  17208. });
  17209. LazyWrapper.prototype.reject = function(predicate) {
  17210. return this.filter(negate(getIteratee(predicate)));
  17211. };
  17212. LazyWrapper.prototype.slice = function(start, end) {
  17213. start = toInteger(start);
  17214. var result = this;
  17215. if (result.__filtered__ && (start > 0 || end < 0)) {
  17216. return new LazyWrapper(result);
  17217. }
  17218. if (start < 0) {
  17219. result = result.takeRight(-start);
  17220. } else if (start) {
  17221. result = result.drop(start);
  17222. }
  17223. if (end !== undefined) {
  17224. end = toInteger(end);
  17225. result = end < 0 ? result.dropRight(-end) : result.take(end - start);
  17226. }
  17227. return result;
  17228. };
  17229. LazyWrapper.prototype.takeRightWhile = function(predicate) {
  17230. return this.reverse().takeWhile(predicate).reverse();
  17231. };
  17232. LazyWrapper.prototype.toArray = function() {
  17233. return this.take(MAX_ARRAY_LENGTH);
  17234. };
  17235. // Add `LazyWrapper` methods to `lodash.prototype`.
  17236. baseForOwn(LazyWrapper.prototype, function(func, methodName) {
  17237. var checkIteratee = /^(?:filter|find|map|reject)|While$/.test(methodName),
  17238. isTaker = /^(?:head|last)$/.test(methodName),
  17239. lodashFunc = lodash[isTaker ? ('take' + (methodName == 'last' ? 'Right' : '')) : methodName],
  17240. retUnwrapped = isTaker || /^find/.test(methodName);
  17241. if (!lodashFunc) {
  17242. return;
  17243. }
  17244. lodash.prototype[methodName] = function() {
  17245. var value = this.__wrapped__,
  17246. args = isTaker ? [1] : arguments,
  17247. isLazy = value instanceof LazyWrapper,
  17248. iteratee = args[0],
  17249. useLazy = isLazy || isArray(value);
  17250. var interceptor = function(value) {
  17251. var result = lodashFunc.apply(lodash, arrayPush([value], args));
  17252. return (isTaker && chainAll) ? result[0] : result;
  17253. };
  17254. if (useLazy && checkIteratee && typeof iteratee == 'function' && iteratee.length != 1) {
  17255. // Avoid lazy use if the iteratee has a "length" value other than `1`.
  17256. isLazy = useLazy = false;
  17257. }
  17258. var chainAll = this.__chain__,
  17259. isHybrid = !!this.__actions__.length,
  17260. isUnwrapped = retUnwrapped && !chainAll,
  17261. onlyLazy = isLazy && !isHybrid;
  17262. if (!retUnwrapped && useLazy) {
  17263. value = onlyLazy ? value : new LazyWrapper(this);
  17264. var result = func.apply(value, args);
  17265. result.__actions__.push({ 'func': thru, 'args': [interceptor], 'thisArg': undefined });
  17266. return new LodashWrapper(result, chainAll);
  17267. }
  17268. if (isUnwrapped && onlyLazy) {
  17269. return func.apply(this, args);
  17270. }
  17271. result = this.thru(interceptor);
  17272. return isUnwrapped ? (isTaker ? result.value()[0] : result.value()) : result;
  17273. };
  17274. });
  17275. // Add `Array` methods to `lodash.prototype`.
  17276. arrayEach(['pop', 'push', 'shift', 'sort', 'splice', 'unshift'], function(methodName) {
  17277. var func = arrayProto[methodName],
  17278. chainName = /^(?:push|sort|unshift)$/.test(methodName) ? 'tap' : 'thru',
  17279. retUnwrapped = /^(?:pop|shift)$/.test(methodName);
  17280. lodash.prototype[methodName] = function() {
  17281. var args = arguments;
  17282. if (retUnwrapped && !this.__chain__) {
  17283. var value = this.value();
  17284. return func.apply(isArray(value) ? value : [], args);
  17285. }
  17286. return this[chainName](function(value) {
  17287. return func.apply(isArray(value) ? value : [], args);
  17288. });
  17289. };
  17290. });
  17291. // Map minified method names to their real names.
  17292. baseForOwn(LazyWrapper.prototype, function(func, methodName) {
  17293. var lodashFunc = lodash[methodName];
  17294. if (lodashFunc) {
  17295. var key = lodashFunc.name + '';
  17296. if (!hasOwnProperty.call(realNames, key)) {
  17297. realNames[key] = [];
  17298. }
  17299. realNames[key].push({ 'name': methodName, 'func': lodashFunc });
  17300. }
  17301. });
  17302. realNames[createHybrid(undefined, WRAP_BIND_KEY_FLAG).name] = [{
  17303. 'name': 'wrapper',
  17304. 'func': undefined
  17305. }];
  17306. // Add methods to `LazyWrapper`.
  17307. LazyWrapper.prototype.clone = lazyClone;
  17308. LazyWrapper.prototype.reverse = lazyReverse;
  17309. LazyWrapper.prototype.value = lazyValue;
  17310. // Add chain sequence methods to the `lodash` wrapper.
  17311. lodash.prototype.at = wrapperAt;
  17312. lodash.prototype.chain = wrapperChain;
  17313. lodash.prototype.commit = wrapperCommit;
  17314. lodash.prototype.next = wrapperNext;
  17315. lodash.prototype.plant = wrapperPlant;
  17316. lodash.prototype.reverse = wrapperReverse;
  17317. lodash.prototype.toJSON = lodash.prototype.valueOf = lodash.prototype.value = wrapperValue;
  17318. // Add lazy aliases.
  17319. lodash.prototype.first = lodash.prototype.head;
  17320. if (symIterator) {
  17321. lodash.prototype[symIterator] = wrapperToIterator;
  17322. }
  17323. return lodash;
  17324. });
  17325. /*--------------------------------------------------------------------------*/
  17326. // Export lodash.
  17327. var _ = runInContext();
  17328. // Some AMD build optimizers, like r.js, check for condition patterns like:
  17329. if (true) {
  17330. // Expose Lodash on the global object to prevent errors when Lodash is
  17331. // loaded by a script tag in the presence of an AMD loader.
  17332. // See http://requirejs.org/docs/errors.html#mismatch for more details.
  17333. // Use `_.noConflict` to remove Lodash from the global object.
  17334. root._ = _;
  17335. // Define as an anonymous module so, through path mapping, it can be
  17336. // referenced as the "underscore" module.
  17337. !(__WEBPACK_AMD_DEFINE_RESULT__ = (function() {
  17338. return _;
  17339. }).call(exports, __webpack_require__, exports, module),
  17340. __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
  17341. }
  17342. // Check for `exports` after `define` in case a build optimizer adds it.
  17343. else {}
  17344. }.call(this));
  17345. /***/ }),
  17346. /***/ "./node_modules/style-loader/dist/cjs.js!./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppFooter.vue?vue&type=style&index=0&id=4ab6097e&lang=scss&scoped=true":
  17347. /*!***************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  17348. !*** ./node_modules/style-loader/dist/cjs.js!./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppFooter.vue?vue&type=style&index=0&id=4ab6097e&lang=scss&scoped=true ***!
  17349. \***************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  17350. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17351. "use strict";
  17352. __webpack_require__.r(__webpack_exports__);
  17353. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17354. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17355. /* harmony export */ });
  17356. /* 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");
  17357. /* 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__);
  17358. /* harmony import */ var _node_modules_css_loader_dist_cjs_js_clonedRuleSet_11_use_1_node_modules_vue_loader_dist_stylePostLoader_js_node_modules_postcss_loader_dist_cjs_js_clonedRuleSet_11_use_2_node_modules_sass_loader_dist_cjs_js_clonedRuleSet_11_use_3_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_AppFooter_vue_vue_type_style_index_0_id_4ab6097e_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! !!../../../node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!../../../node_modules/vue-loader/dist/stylePostLoader.js!../../../node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!../../../node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!../../../node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./AppFooter.vue?vue&type=style&index=0&id=4ab6097e&lang=scss&scoped=true */ "./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppFooter.vue?vue&type=style&index=0&id=4ab6097e&lang=scss&scoped=true");
  17359. var options = {};
  17360. options.insert = "head";
  17361. options.singleton = false;
  17362. var update = _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default()(_node_modules_css_loader_dist_cjs_js_clonedRuleSet_11_use_1_node_modules_vue_loader_dist_stylePostLoader_js_node_modules_postcss_loader_dist_cjs_js_clonedRuleSet_11_use_2_node_modules_sass_loader_dist_cjs_js_clonedRuleSet_11_use_3_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_AppFooter_vue_vue_type_style_index_0_id_4ab6097e_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_1__["default"], options);
  17363. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (_node_modules_css_loader_dist_cjs_js_clonedRuleSet_11_use_1_node_modules_vue_loader_dist_stylePostLoader_js_node_modules_postcss_loader_dist_cjs_js_clonedRuleSet_11_use_2_node_modules_sass_loader_dist_cjs_js_clonedRuleSet_11_use_3_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_AppFooter_vue_vue_type_style_index_0_id_4ab6097e_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_1__["default"].locals || {});
  17364. /***/ }),
  17365. /***/ "./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":
  17366. /*!****************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  17367. !*** ./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 ***!
  17368. \****************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  17369. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17370. "use strict";
  17371. __webpack_require__.r(__webpack_exports__);
  17372. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17373. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17374. /* harmony export */ });
  17375. /* 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");
  17376. /* 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__);
  17377. /* 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");
  17378. var options = {};
  17379. options.insert = "head";
  17380. options.singleton = false;
  17381. 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);
  17382. /* 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 || {});
  17383. /***/ }),
  17384. /***/ "./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":
  17385. /*!*******************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  17386. !*** ./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 ***!
  17387. \*******************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  17388. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17389. "use strict";
  17390. __webpack_require__.r(__webpack_exports__);
  17391. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17392. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17393. /* harmony export */ });
  17394. /* 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");
  17395. /* 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__);
  17396. /* 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");
  17397. var options = {};
  17398. options.insert = "head";
  17399. options.singleton = false;
  17400. 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);
  17401. /* 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 || {});
  17402. /***/ }),
  17403. /***/ "./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":
  17404. /*!***************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  17405. !*** ./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 ***!
  17406. \***************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  17407. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17408. "use strict";
  17409. __webpack_require__.r(__webpack_exports__);
  17410. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17411. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17412. /* harmony export */ });
  17413. /* 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");
  17414. /* 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__);
  17415. /* 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");
  17416. var options = {};
  17417. options.insert = "head";
  17418. options.singleton = false;
  17419. 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);
  17420. /* 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 || {});
  17421. /***/ }),
  17422. /***/ "./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":
  17423. /*!******************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  17424. !*** ./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 ***!
  17425. \******************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  17426. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17427. "use strict";
  17428. __webpack_require__.r(__webpack_exports__);
  17429. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17430. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17431. /* harmony export */ });
  17432. /* 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");
  17433. /* 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__);
  17434. /* 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");
  17435. var options = {};
  17436. options.insert = "head";
  17437. options.singleton = false;
  17438. 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);
  17439. /* 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 || {});
  17440. /***/ }),
  17441. /***/ "./node_modules/vue-loader/dist/exportHelper.js":
  17442. /*!******************************************************!*\
  17443. !*** ./node_modules/vue-loader/dist/exportHelper.js ***!
  17444. \******************************************************/
  17445. /***/ ((__unused_webpack_module, exports) => {
  17446. "use strict";
  17447. Object.defineProperty(exports, "__esModule", ({ value: true }));
  17448. // runtime helper for setting properties on components
  17449. // in a tree-shakable way
  17450. exports["default"] = (sfc, props) => {
  17451. const target = sfc.__vccOpts || sfc;
  17452. for (const [key, val] of props) {
  17453. target[key] = val;
  17454. }
  17455. return target;
  17456. };
  17457. /***/ }),
  17458. /***/ "./resources/js/components/AppButtonLink.vue":
  17459. /*!***************************************************!*\
  17460. !*** ./resources/js/components/AppButtonLink.vue ***!
  17461. \***************************************************/
  17462. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17463. "use strict";
  17464. __webpack_require__.r(__webpack_exports__);
  17465. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17466. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17467. /* harmony export */ });
  17468. /* 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");
  17469. /* 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");
  17470. /* 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");
  17471. ;
  17472. 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"]])
  17473. /* hot reload */
  17474. if (false) {}
  17475. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__);
  17476. /***/ }),
  17477. /***/ "./resources/js/components/AppFooter.vue":
  17478. /*!***********************************************!*\
  17479. !*** ./resources/js/components/AppFooter.vue ***!
  17480. \***********************************************/
  17481. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17482. "use strict";
  17483. __webpack_require__.r(__webpack_exports__);
  17484. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17485. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17486. /* harmony export */ });
  17487. /* harmony import */ var _AppFooter_vue_vue_type_template_id_4ab6097e_scoped_true__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./AppFooter.vue?vue&type=template&id=4ab6097e&scoped=true */ "./resources/js/components/AppFooter.vue?vue&type=template&id=4ab6097e&scoped=true");
  17488. /* harmony import */ var _AppFooter_vue_vue_type_style_index_0_id_4ab6097e_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./AppFooter.vue?vue&type=style&index=0&id=4ab6097e&lang=scss&scoped=true */ "./resources/js/components/AppFooter.vue?vue&type=style&index=0&id=4ab6097e&lang=scss&scoped=true");
  17489. /* 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");
  17490. const script = {}
  17491. ;
  17492. 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"])(script, [['render',_AppFooter_vue_vue_type_template_id_4ab6097e_scoped_true__WEBPACK_IMPORTED_MODULE_0__.render],['__scopeId',"data-v-4ab6097e"],['__file',"resources/js/components/AppFooter.vue"]])
  17493. /* hot reload */
  17494. if (false) {}
  17495. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__);
  17496. /***/ }),
  17497. /***/ "./resources/js/components/AppMessage.vue":
  17498. /*!************************************************!*\
  17499. !*** ./resources/js/components/AppMessage.vue ***!
  17500. \************************************************/
  17501. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17502. "use strict";
  17503. __webpack_require__.r(__webpack_exports__);
  17504. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17505. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17506. /* harmony export */ });
  17507. /* 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");
  17508. /* 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");
  17509. /* 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");
  17510. ;
  17511. 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"]])
  17512. /* hot reload */
  17513. if (false) {}
  17514. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__);
  17515. /***/ }),
  17516. /***/ "./resources/js/components/AppPagination.vue":
  17517. /*!***************************************************!*\
  17518. !*** ./resources/js/components/AppPagination.vue ***!
  17519. \***************************************************/
  17520. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17521. "use strict";
  17522. __webpack_require__.r(__webpack_exports__);
  17523. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17524. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17525. /* harmony export */ });
  17526. /* 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");
  17527. /* 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");
  17528. /* 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");
  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_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"]])
  17531. /* hot reload */
  17532. if (false) {}
  17533. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__);
  17534. /***/ }),
  17535. /***/ "./resources/js/components/AppSidebar.vue":
  17536. /*!************************************************!*\
  17537. !*** ./resources/js/components/AppSidebar.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 _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");
  17546. /* 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");
  17547. /* 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");
  17548. /* 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");
  17549. ;
  17550. 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"]])
  17551. /* hot reload */
  17552. if (false) {}
  17553. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__);
  17554. /***/ }),
  17555. /***/ "./resources/js/components/AppSubSidebar.vue":
  17556. /*!***************************************************!*\
  17557. !*** ./resources/js/components/AppSubSidebar.vue ***!
  17558. \***************************************************/
  17559. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17560. "use strict";
  17561. __webpack_require__.r(__webpack_exports__);
  17562. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17563. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17564. /* harmony export */ });
  17565. /* 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");
  17566. /* 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");
  17567. /* 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");
  17568. /* 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");
  17569. ;
  17570. 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"]])
  17571. /* hot reload */
  17572. if (false) {}
  17573. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__);
  17574. /***/ }),
  17575. /***/ "./resources/js/components/AppTopBar.vue":
  17576. /*!***********************************************!*\
  17577. !*** ./resources/js/components/AppTopBar.vue ***!
  17578. \***********************************************/
  17579. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17580. "use strict";
  17581. __webpack_require__.r(__webpack_exports__);
  17582. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17583. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17584. /* harmony export */ });
  17585. /* 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");
  17586. /* 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");
  17587. /* 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");
  17588. /* 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");
  17589. ;
  17590. 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"]])
  17591. /* hot reload */
  17592. if (false) {}
  17593. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__);
  17594. /***/ }),
  17595. /***/ "./resources/js/layouts/DashboardLayout.vue":
  17596. /*!**************************************************!*\
  17597. !*** ./resources/js/layouts/DashboardLayout.vue ***!
  17598. \**************************************************/
  17599. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17600. "use strict";
  17601. __webpack_require__.r(__webpack_exports__);
  17602. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17603. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17604. /* harmony export */ });
  17605. /* 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");
  17606. /* 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");
  17607. /* 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");
  17608. /* 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");
  17609. ;
  17610. 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"]])
  17611. /* hot reload */
  17612. if (false) {}
  17613. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__);
  17614. /***/ }),
  17615. /***/ "./resources/js/pages/Users/Index.vue":
  17616. /*!********************************************!*\
  17617. !*** ./resources/js/pages/Users/Index.vue ***!
  17618. \********************************************/
  17619. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17620. "use strict";
  17621. __webpack_require__.r(__webpack_exports__);
  17622. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17623. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17624. /* harmony export */ });
  17625. /* 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");
  17626. /* 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");
  17627. /* 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");
  17628. ;
  17629. 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"]])
  17630. /* hot reload */
  17631. if (false) {}
  17632. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__);
  17633. /***/ }),
  17634. /***/ "./resources/js/components/AppButtonLink.vue?vue&type=script&setup=true&lang=js":
  17635. /*!**************************************************************************************!*\
  17636. !*** ./resources/js/components/AppButtonLink.vue?vue&type=script&setup=true&lang=js ***!
  17637. \**************************************************************************************/
  17638. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17639. "use strict";
  17640. __webpack_require__.r(__webpack_exports__);
  17641. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17642. /* 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"])
  17643. /* harmony export */ });
  17644. /* 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");
  17645. /***/ }),
  17646. /***/ "./resources/js/components/AppMessage.vue?vue&type=script&setup=true&lang=js":
  17647. /*!***********************************************************************************!*\
  17648. !*** ./resources/js/components/AppMessage.vue?vue&type=script&setup=true&lang=js ***!
  17649. \***********************************************************************************/
  17650. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17651. "use strict";
  17652. __webpack_require__.r(__webpack_exports__);
  17653. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17654. /* 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"])
  17655. /* harmony export */ });
  17656. /* 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");
  17657. /***/ }),
  17658. /***/ "./resources/js/components/AppPagination.vue?vue&type=script&setup=true&lang=js":
  17659. /*!**************************************************************************************!*\
  17660. !*** ./resources/js/components/AppPagination.vue?vue&type=script&setup=true&lang=js ***!
  17661. \**************************************************************************************/
  17662. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17663. "use strict";
  17664. __webpack_require__.r(__webpack_exports__);
  17665. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17666. /* 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"])
  17667. /* harmony export */ });
  17668. /* 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");
  17669. /***/ }),
  17670. /***/ "./resources/js/components/AppSidebar.vue?vue&type=script&setup=true&lang=js":
  17671. /*!***********************************************************************************!*\
  17672. !*** ./resources/js/components/AppSidebar.vue?vue&type=script&setup=true&lang=js ***!
  17673. \***********************************************************************************/
  17674. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17675. "use strict";
  17676. __webpack_require__.r(__webpack_exports__);
  17677. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17678. /* 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"])
  17679. /* harmony export */ });
  17680. /* 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");
  17681. /***/ }),
  17682. /***/ "./resources/js/components/AppSubSidebar.vue?vue&type=script&setup=true&lang=js":
  17683. /*!**************************************************************************************!*\
  17684. !*** ./resources/js/components/AppSubSidebar.vue?vue&type=script&setup=true&lang=js ***!
  17685. \**************************************************************************************/
  17686. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17687. "use strict";
  17688. __webpack_require__.r(__webpack_exports__);
  17689. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17690. /* 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"])
  17691. /* harmony export */ });
  17692. /* 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");
  17693. /***/ }),
  17694. /***/ "./resources/js/components/AppTopBar.vue?vue&type=script&setup=true&lang=js":
  17695. /*!**********************************************************************************!*\
  17696. !*** ./resources/js/components/AppTopBar.vue?vue&type=script&setup=true&lang=js ***!
  17697. \**********************************************************************************/
  17698. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17699. "use strict";
  17700. __webpack_require__.r(__webpack_exports__);
  17701. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17702. /* 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"])
  17703. /* harmony export */ });
  17704. /* 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");
  17705. /***/ }),
  17706. /***/ "./resources/js/layouts/DashboardLayout.vue?vue&type=script&setup=true&lang=js":
  17707. /*!*************************************************************************************!*\
  17708. !*** ./resources/js/layouts/DashboardLayout.vue?vue&type=script&setup=true&lang=js ***!
  17709. \*************************************************************************************/
  17710. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17711. "use strict";
  17712. __webpack_require__.r(__webpack_exports__);
  17713. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17714. /* 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"])
  17715. /* harmony export */ });
  17716. /* 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");
  17717. /***/ }),
  17718. /***/ "./resources/js/pages/Users/Index.vue?vue&type=script&setup=true&lang=js":
  17719. /*!*******************************************************************************!*\
  17720. !*** ./resources/js/pages/Users/Index.vue?vue&type=script&setup=true&lang=js ***!
  17721. \*******************************************************************************/
  17722. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17723. "use strict";
  17724. __webpack_require__.r(__webpack_exports__);
  17725. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17726. /* 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"])
  17727. /* harmony export */ });
  17728. /* 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");
  17729. /***/ }),
  17730. /***/ "./resources/js/components/AppButtonLink.vue?vue&type=template&id=c3621f1c":
  17731. /*!*********************************************************************************!*\
  17732. !*** ./resources/js/components/AppButtonLink.vue?vue&type=template&id=c3621f1c ***!
  17733. \*********************************************************************************/
  17734. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17735. "use strict";
  17736. __webpack_require__.r(__webpack_exports__);
  17737. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17738. /* 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)
  17739. /* harmony export */ });
  17740. /* 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");
  17741. /***/ }),
  17742. /***/ "./resources/js/components/AppFooter.vue?vue&type=template&id=4ab6097e&scoped=true":
  17743. /*!*****************************************************************************************!*\
  17744. !*** ./resources/js/components/AppFooter.vue?vue&type=template&id=4ab6097e&scoped=true ***!
  17745. \*****************************************************************************************/
  17746. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17747. "use strict";
  17748. __webpack_require__.r(__webpack_exports__);
  17749. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17750. /* harmony export */ "render": () => (/* reexport safe */ _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_templateLoader_js_ruleSet_1_rules_2_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_AppFooter_vue_vue_type_template_id_4ab6097e_scoped_true__WEBPACK_IMPORTED_MODULE_0__.render)
  17751. /* harmony export */ });
  17752. /* harmony import */ var _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_templateLoader_js_ruleSet_1_rules_2_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_AppFooter_vue_vue_type_template_id_4ab6097e_scoped_true__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!../../../node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!../../../node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./AppFooter.vue?vue&type=template&id=4ab6097e&scoped=true */ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppFooter.vue?vue&type=template&id=4ab6097e&scoped=true");
  17753. /***/ }),
  17754. /***/ "./resources/js/components/AppMessage.vue?vue&type=template&id=07159051":
  17755. /*!******************************************************************************!*\
  17756. !*** ./resources/js/components/AppMessage.vue?vue&type=template&id=07159051 ***!
  17757. \******************************************************************************/
  17758. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17759. "use strict";
  17760. __webpack_require__.r(__webpack_exports__);
  17761. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17762. /* 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)
  17763. /* harmony export */ });
  17764. /* 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");
  17765. /***/ }),
  17766. /***/ "./resources/js/components/AppPagination.vue?vue&type=template&id=4da56ec0":
  17767. /*!*********************************************************************************!*\
  17768. !*** ./resources/js/components/AppPagination.vue?vue&type=template&id=4da56ec0 ***!
  17769. \*********************************************************************************/
  17770. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17771. "use strict";
  17772. __webpack_require__.r(__webpack_exports__);
  17773. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17774. /* 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)
  17775. /* harmony export */ });
  17776. /* 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");
  17777. /***/ }),
  17778. /***/ "./resources/js/components/AppSidebar.vue?vue&type=template&id=22a4e926&scoped=true":
  17779. /*!******************************************************************************************!*\
  17780. !*** ./resources/js/components/AppSidebar.vue?vue&type=template&id=22a4e926&scoped=true ***!
  17781. \******************************************************************************************/
  17782. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17783. "use strict";
  17784. __webpack_require__.r(__webpack_exports__);
  17785. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17786. /* 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)
  17787. /* harmony export */ });
  17788. /* 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");
  17789. /***/ }),
  17790. /***/ "./resources/js/components/AppSubSidebar.vue?vue&type=template&id=0addd9bc&scoped=true":
  17791. /*!*********************************************************************************************!*\
  17792. !*** ./resources/js/components/AppSubSidebar.vue?vue&type=template&id=0addd9bc&scoped=true ***!
  17793. \*********************************************************************************************/
  17794. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17795. "use strict";
  17796. __webpack_require__.r(__webpack_exports__);
  17797. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17798. /* 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)
  17799. /* harmony export */ });
  17800. /* 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");
  17801. /***/ }),
  17802. /***/ "./resources/js/components/AppTopBar.vue?vue&type=template&id=42bf62a4&scoped=true":
  17803. /*!*****************************************************************************************!*\
  17804. !*** ./resources/js/components/AppTopBar.vue?vue&type=template&id=42bf62a4&scoped=true ***!
  17805. \*****************************************************************************************/
  17806. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17807. "use strict";
  17808. __webpack_require__.r(__webpack_exports__);
  17809. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17810. /* 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)
  17811. /* harmony export */ });
  17812. /* 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");
  17813. /***/ }),
  17814. /***/ "./resources/js/layouts/DashboardLayout.vue?vue&type=template&id=549bf5ac&scoped=true":
  17815. /*!********************************************************************************************!*\
  17816. !*** ./resources/js/layouts/DashboardLayout.vue?vue&type=template&id=549bf5ac&scoped=true ***!
  17817. \********************************************************************************************/
  17818. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17819. "use strict";
  17820. __webpack_require__.r(__webpack_exports__);
  17821. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17822. /* 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)
  17823. /* harmony export */ });
  17824. /* 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");
  17825. /***/ }),
  17826. /***/ "./resources/js/pages/Users/Index.vue?vue&type=template&id=203afd1c":
  17827. /*!**************************************************************************!*\
  17828. !*** ./resources/js/pages/Users/Index.vue?vue&type=template&id=203afd1c ***!
  17829. \**************************************************************************/
  17830. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17831. "use strict";
  17832. __webpack_require__.r(__webpack_exports__);
  17833. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17834. /* 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)
  17835. /* harmony export */ });
  17836. /* 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");
  17837. /***/ }),
  17838. /***/ "./resources/js/components/AppFooter.vue?vue&type=style&index=0&id=4ab6097e&lang=scss&scoped=true":
  17839. /*!********************************************************************************************************!*\
  17840. !*** ./resources/js/components/AppFooter.vue?vue&type=style&index=0&id=4ab6097e&lang=scss&scoped=true ***!
  17841. \********************************************************************************************************/
  17842. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17843. "use strict";
  17844. __webpack_require__.r(__webpack_exports__);
  17845. /* harmony import */ var _node_modules_style_loader_dist_cjs_js_node_modules_css_loader_dist_cjs_js_clonedRuleSet_11_use_1_node_modules_vue_loader_dist_stylePostLoader_js_node_modules_postcss_loader_dist_cjs_js_clonedRuleSet_11_use_2_node_modules_sass_loader_dist_cjs_js_clonedRuleSet_11_use_3_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_AppFooter_vue_vue_type_style_index_0_id_4ab6097e_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../node_modules/style-loader/dist/cjs.js!../../../node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!../../../node_modules/vue-loader/dist/stylePostLoader.js!../../../node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!../../../node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!../../../node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./AppFooter.vue?vue&type=style&index=0&id=4ab6097e&lang=scss&scoped=true */ "./node_modules/style-loader/dist/cjs.js!./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppFooter.vue?vue&type=style&index=0&id=4ab6097e&lang=scss&scoped=true");
  17846. /***/ }),
  17847. /***/ "./resources/js/components/AppSidebar.vue?vue&type=style&index=0&id=22a4e926&lang=scss&scoped=true":
  17848. /*!*********************************************************************************************************!*\
  17849. !*** ./resources/js/components/AppSidebar.vue?vue&type=style&index=0&id=22a4e926&lang=scss&scoped=true ***!
  17850. \*********************************************************************************************************/
  17851. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17852. "use strict";
  17853. __webpack_require__.r(__webpack_exports__);
  17854. /* 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");
  17855. /***/ }),
  17856. /***/ "./resources/js/components/AppSubSidebar.vue?vue&type=style&index=0&id=0addd9bc&lang=scss&scoped=true":
  17857. /*!************************************************************************************************************!*\
  17858. !*** ./resources/js/components/AppSubSidebar.vue?vue&type=style&index=0&id=0addd9bc&lang=scss&scoped=true ***!
  17859. \************************************************************************************************************/
  17860. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17861. "use strict";
  17862. __webpack_require__.r(__webpack_exports__);
  17863. /* 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");
  17864. /***/ }),
  17865. /***/ "./resources/js/components/AppTopBar.vue?vue&type=style&index=0&id=42bf62a4&lang=scss&scoped=true":
  17866. /*!********************************************************************************************************!*\
  17867. !*** ./resources/js/components/AppTopBar.vue?vue&type=style&index=0&id=42bf62a4&lang=scss&scoped=true ***!
  17868. \********************************************************************************************************/
  17869. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17870. "use strict";
  17871. __webpack_require__.r(__webpack_exports__);
  17872. /* 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");
  17873. /***/ }),
  17874. /***/ "./resources/js/layouts/DashboardLayout.vue?vue&type=style&index=0&id=549bf5ac&lang=scss&scoped=true":
  17875. /*!***********************************************************************************************************!*\
  17876. !*** ./resources/js/layouts/DashboardLayout.vue?vue&type=style&index=0&id=549bf5ac&lang=scss&scoped=true ***!
  17877. \***********************************************************************************************************/
  17878. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17879. "use strict";
  17880. __webpack_require__.r(__webpack_exports__);
  17881. /* 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");
  17882. /***/ })
  17883. }]);