resources_js_pages_Sales_Index_vue.js 694KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316531753185319532053215322532353245325532653275328532953305331533253335334533553365337533853395340534153425343534453455346534753485349535053515352535353545355535653575358535953605361536253635364536553665367536853695370537153725373537453755376537753785379538053815382538353845385538653875388538953905391539253935394539553965397539853995400540154025403540454055406540754085409541054115412541354145415541654175418541954205421542254235424542554265427542854295430543154325433543454355436543754385439544054415442544354445445544654475448544954505451545254535454545554565457545854595460546154625463546454655466546754685469547054715472547354745475547654775478547954805481548254835484548554865487548854895490549154925493549454955496549754985499550055015502550355045505550655075508550955105511551255135514551555165517551855195520552155225523552455255526552755285529553055315532553355345535553655375538553955405541554255435544554555465547554855495550555155525553555455555556555755585559556055615562556355645565556655675568556955705571557255735574557555765577557855795580558155825583558455855586558755885589559055915592559355945595559655975598559956005601560256035604560556065607560856095610561156125613561456155616561756185619562056215622562356245625562656275628562956305631563256335634563556365637563856395640564156425643564456455646564756485649565056515652565356545655565656575658565956605661566256635664566556665667566856695670567156725673567456755676567756785679568056815682568356845685568656875688568956905691569256935694569556965697569856995700570157025703570457055706570757085709571057115712571357145715571657175718571957205721572257235724572557265727572857295730573157325733573457355736573757385739574057415742574357445745574657475748574957505751575257535754575557565757575857595760576157625763576457655766576757685769577057715772577357745775577657775778577957805781578257835784578557865787578857895790579157925793579457955796579757985799580058015802580358045805580658075808580958105811581258135814581558165817581858195820582158225823582458255826582758285829583058315832583358345835583658375838583958405841584258435844584558465847584858495850585158525853585458555856585758585859586058615862586358645865586658675868586958705871587258735874587558765877587858795880588158825883588458855886588758885889589058915892589358945895589658975898589959005901590259035904590559065907590859095910591159125913591459155916591759185919592059215922592359245925592659275928592959305931593259335934593559365937593859395940594159425943594459455946594759485949595059515952595359545955595659575958595959605961596259635964596559665967596859695970597159725973597459755976597759785979598059815982598359845985598659875988598959905991599259935994599559965997599859996000600160026003600460056006600760086009601060116012601360146015601660176018601960206021602260236024602560266027602860296030603160326033603460356036603760386039604060416042604360446045604660476048604960506051605260536054605560566057605860596060606160626063606460656066606760686069607060716072607360746075607660776078607960806081608260836084608560866087608860896090609160926093609460956096609760986099610061016102610361046105610661076108610961106111611261136114611561166117611861196120612161226123612461256126612761286129613061316132613361346135613661376138613961406141614261436144614561466147614861496150615161526153615461556156615761586159616061616162616361646165616661676168616961706171617261736174617561766177617861796180618161826183618461856186618761886189619061916192619361946195619661976198619962006201620262036204620562066207620862096210621162126213621462156216621762186219622062216222622362246225622662276228622962306231623262336234623562366237623862396240624162426243624462456246624762486249625062516252625362546255625662576258625962606261626262636264626562666267626862696270627162726273627462756276627762786279628062816282628362846285628662876288628962906291629262936294629562966297629862996300630163026303630463056306630763086309631063116312631363146315631663176318631963206321632263236324632563266327632863296330633163326333633463356336633763386339634063416342634363446345634663476348634963506351635263536354635563566357635863596360636163626363636463656366636763686369637063716372637363746375637663776378637963806381638263836384638563866387638863896390639163926393639463956396639763986399640064016402640364046405640664076408640964106411641264136414641564166417641864196420642164226423642464256426642764286429643064316432643364346435643664376438643964406441644264436444644564466447644864496450645164526453645464556456645764586459646064616462646364646465646664676468646964706471647264736474647564766477647864796480648164826483648464856486648764886489649064916492649364946495649664976498649965006501650265036504650565066507650865096510651165126513651465156516651765186519652065216522652365246525652665276528652965306531653265336534653565366537653865396540654165426543654465456546654765486549655065516552655365546555655665576558655965606561656265636564656565666567656865696570657165726573657465756576657765786579658065816582658365846585658665876588658965906591659265936594659565966597659865996600660166026603660466056606660766086609661066116612661366146615661666176618661966206621662266236624662566266627662866296630663166326633663466356636663766386639664066416642664366446645664666476648664966506651665266536654665566566657665866596660666166626663666466656666666766686669667066716672667366746675667666776678667966806681668266836684668566866687668866896690669166926693669466956696669766986699670067016702670367046705670667076708670967106711671267136714671567166717671867196720672167226723672467256726672767286729673067316732673367346735673667376738673967406741674267436744674567466747674867496750675167526753675467556756675767586759676067616762676367646765676667676768676967706771677267736774677567766777677867796780678167826783678467856786678767886789679067916792679367946795679667976798679968006801680268036804680568066807680868096810681168126813681468156816681768186819682068216822682368246825682668276828682968306831683268336834683568366837683868396840684168426843684468456846684768486849685068516852685368546855685668576858685968606861686268636864686568666867686868696870687168726873687468756876687768786879688068816882688368846885688668876888688968906891689268936894689568966897689868996900690169026903690469056906690769086909691069116912691369146915691669176918691969206921692269236924692569266927692869296930693169326933693469356936693769386939694069416942694369446945694669476948694969506951695269536954695569566957695869596960696169626963696469656966696769686969697069716972697369746975697669776978697969806981698269836984698569866987698869896990699169926993699469956996699769986999700070017002700370047005700670077008700970107011701270137014701570167017701870197020702170227023702470257026702770287029703070317032703370347035703670377038703970407041704270437044704570467047704870497050705170527053705470557056705770587059706070617062706370647065706670677068706970707071707270737074707570767077707870797080708170827083708470857086708770887089709070917092709370947095709670977098709971007101710271037104710571067107710871097110711171127113711471157116711771187119712071217122712371247125712671277128712971307131713271337134713571367137713871397140714171427143714471457146714771487149715071517152715371547155715671577158715971607161716271637164716571667167716871697170717171727173717471757176717771787179718071817182718371847185718671877188718971907191719271937194719571967197719871997200720172027203720472057206720772087209721072117212721372147215721672177218721972207221722272237224722572267227722872297230723172327233723472357236723772387239724072417242724372447245724672477248724972507251725272537254725572567257725872597260726172627263726472657266726772687269727072717272727372747275727672777278727972807281728272837284728572867287728872897290729172927293729472957296729772987299730073017302730373047305730673077308730973107311731273137314731573167317731873197320732173227323732473257326732773287329733073317332733373347335733673377338733973407341734273437344734573467347734873497350735173527353735473557356735773587359736073617362736373647365736673677368736973707371737273737374737573767377737873797380738173827383738473857386738773887389739073917392739373947395739673977398739974007401740274037404740574067407740874097410741174127413741474157416741774187419742074217422742374247425742674277428742974307431743274337434743574367437743874397440744174427443744474457446744774487449745074517452745374547455745674577458745974607461746274637464746574667467746874697470747174727473747474757476747774787479748074817482748374847485748674877488748974907491749274937494749574967497749874997500750175027503750475057506750775087509751075117512751375147515751675177518751975207521752275237524752575267527752875297530753175327533753475357536753775387539754075417542754375447545754675477548754975507551755275537554755575567557755875597560756175627563756475657566756775687569757075717572757375747575757675777578757975807581758275837584758575867587758875897590759175927593759475957596759775987599760076017602760376047605760676077608760976107611761276137614761576167617761876197620762176227623762476257626762776287629763076317632763376347635763676377638763976407641764276437644764576467647764876497650765176527653765476557656765776587659766076617662766376647665766676677668766976707671767276737674767576767677767876797680768176827683768476857686768776887689769076917692769376947695769676977698769977007701770277037704770577067707770877097710771177127713771477157716771777187719772077217722772377247725772677277728772977307731773277337734773577367737773877397740774177427743774477457746774777487749775077517752775377547755775677577758775977607761776277637764776577667767776877697770777177727773777477757776777777787779778077817782778377847785778677877788778977907791779277937794779577967797779877997800780178027803780478057806780778087809781078117812781378147815781678177818781978207821782278237824782578267827782878297830783178327833783478357836783778387839784078417842784378447845784678477848784978507851785278537854785578567857785878597860786178627863786478657866786778687869787078717872787378747875787678777878787978807881788278837884788578867887788878897890789178927893789478957896789778987899790079017902790379047905790679077908790979107911791279137914791579167917791879197920792179227923792479257926792779287929793079317932793379347935793679377938793979407941794279437944794579467947794879497950795179527953795479557956795779587959796079617962796379647965796679677968796979707971797279737974797579767977797879797980798179827983798479857986798779887989799079917992799379947995799679977998799980008001800280038004800580068007800880098010801180128013801480158016801780188019802080218022802380248025802680278028802980308031803280338034803580368037803880398040804180428043804480458046804780488049805080518052805380548055805680578058805980608061806280638064806580668067806880698070807180728073807480758076807780788079808080818082808380848085808680878088808980908091809280938094809580968097809880998100810181028103810481058106810781088109811081118112811381148115811681178118811981208121812281238124812581268127812881298130813181328133813481358136813781388139814081418142814381448145814681478148814981508151815281538154815581568157815881598160816181628163816481658166816781688169817081718172817381748175817681778178817981808181818281838184818581868187818881898190819181928193819481958196819781988199820082018202820382048205820682078208820982108211821282138214821582168217821882198220822182228223822482258226822782288229823082318232823382348235823682378238823982408241824282438244824582468247824882498250825182528253825482558256825782588259826082618262826382648265826682678268826982708271827282738274827582768277827882798280828182828283828482858286828782888289829082918292829382948295829682978298829983008301830283038304830583068307830883098310831183128313831483158316831783188319832083218322832383248325832683278328832983308331833283338334833583368337833883398340834183428343834483458346834783488349835083518352835383548355835683578358835983608361836283638364836583668367836883698370837183728373837483758376837783788379838083818382838383848385838683878388838983908391839283938394839583968397839883998400840184028403840484058406840784088409841084118412841384148415841684178418841984208421842284238424842584268427842884298430843184328433843484358436843784388439844084418442844384448445844684478448844984508451845284538454845584568457845884598460846184628463846484658466846784688469847084718472847384748475847684778478847984808481848284838484848584868487848884898490849184928493849484958496849784988499850085018502850385048505850685078508850985108511851285138514851585168517851885198520852185228523852485258526852785288529853085318532853385348535853685378538853985408541854285438544854585468547854885498550855185528553855485558556855785588559856085618562856385648565856685678568856985708571857285738574857585768577857885798580858185828583858485858586858785888589859085918592859385948595859685978598859986008601860286038604860586068607860886098610861186128613861486158616861786188619862086218622862386248625862686278628862986308631863286338634863586368637863886398640864186428643864486458646864786488649865086518652865386548655865686578658865986608661866286638664866586668667866886698670867186728673867486758676867786788679868086818682868386848685868686878688868986908691869286938694869586968697869886998700870187028703870487058706870787088709871087118712871387148715871687178718871987208721872287238724872587268727872887298730873187328733873487358736873787388739874087418742874387448745874687478748874987508751875287538754875587568757875887598760876187628763876487658766876787688769877087718772877387748775877687778778877987808781878287838784878587868787878887898790879187928793879487958796879787988799880088018802880388048805880688078808880988108811881288138814881588168817881888198820882188228823882488258826882788288829883088318832883388348835883688378838883988408841884288438844884588468847884888498850885188528853885488558856885788588859886088618862886388648865886688678868886988708871887288738874887588768877887888798880888188828883888488858886888788888889889088918892889388948895889688978898889989008901890289038904890589068907890889098910891189128913891489158916891789188919892089218922892389248925892689278928892989308931893289338934893589368937893889398940894189428943894489458946894789488949895089518952895389548955895689578958895989608961896289638964896589668967896889698970897189728973897489758976897789788979898089818982898389848985898689878988898989908991899289938994899589968997899889999000900190029003900490059006900790089009901090119012901390149015901690179018901990209021902290239024902590269027902890299030903190329033903490359036903790389039904090419042904390449045904690479048904990509051905290539054905590569057905890599060906190629063906490659066906790689069907090719072907390749075907690779078907990809081908290839084908590869087908890899090909190929093909490959096909790989099910091019102910391049105910691079108910991109111911291139114911591169117911891199120912191229123912491259126912791289129913091319132913391349135913691379138913991409141914291439144914591469147914891499150915191529153915491559156915791589159916091619162916391649165916691679168916991709171917291739174917591769177917891799180918191829183918491859186918791889189919091919192919391949195919691979198919992009201920292039204920592069207920892099210921192129213921492159216921792189219922092219222922392249225922692279228922992309231923292339234923592369237923892399240924192429243924492459246924792489249925092519252925392549255925692579258925992609261926292639264926592669267926892699270927192729273927492759276927792789279928092819282928392849285928692879288928992909291929292939294929592969297929892999300930193029303930493059306930793089309931093119312931393149315931693179318931993209321932293239324932593269327932893299330933193329333933493359336933793389339934093419342934393449345934693479348934993509351935293539354935593569357935893599360936193629363936493659366936793689369937093719372937393749375937693779378937993809381938293839384938593869387938893899390939193929393939493959396939793989399940094019402940394049405940694079408940994109411941294139414941594169417941894199420942194229423942494259426942794289429943094319432943394349435943694379438943994409441944294439444944594469447944894499450945194529453945494559456945794589459946094619462946394649465946694679468946994709471947294739474947594769477947894799480948194829483948494859486948794889489949094919492949394949495949694979498949995009501950295039504950595069507950895099510951195129513951495159516951795189519952095219522952395249525952695279528952995309531953295339534953595369537953895399540954195429543954495459546954795489549955095519552955395549555955695579558955995609561956295639564956595669567956895699570957195729573957495759576957795789579958095819582958395849585958695879588958995909591959295939594959595969597959895999600960196029603960496059606960796089609961096119612961396149615961696179618961996209621962296239624962596269627962896299630963196329633963496359636963796389639964096419642964396449645964696479648964996509651965296539654965596569657965896599660966196629663966496659666966796689669967096719672967396749675967696779678967996809681968296839684968596869687968896899690969196929693969496959696969796989699970097019702970397049705970697079708970997109711971297139714971597169717971897199720972197229723972497259726972797289729973097319732973397349735973697379738973997409741974297439744974597469747974897499750975197529753975497559756975797589759976097619762976397649765976697679768976997709771977297739774977597769777977897799780978197829783978497859786978797889789979097919792979397949795979697979798979998009801980298039804980598069807980898099810981198129813981498159816981798189819982098219822982398249825982698279828982998309831983298339834983598369837983898399840984198429843984498459846984798489849985098519852985398549855985698579858985998609861986298639864986598669867986898699870987198729873987498759876987798789879988098819882988398849885988698879888988998909891989298939894989598969897989898999900990199029903990499059906990799089909991099119912991399149915991699179918991999209921992299239924992599269927992899299930993199329933993499359936993799389939994099419942994399449945994699479948994999509951995299539954995599569957995899599960996199629963996499659966996799689969997099719972997399749975997699779978997999809981998299839984998599869987998899899990999199929993999499959996999799989999100001000110002100031000410005100061000710008100091001010011100121001310014100151001610017100181001910020100211002210023100241002510026100271002810029100301003110032100331003410035100361003710038100391004010041100421004310044100451004610047100481004910050100511005210053100541005510056100571005810059100601006110062100631006410065100661006710068100691007010071100721007310074100751007610077100781007910080100811008210083100841008510086100871008810089100901009110092100931009410095100961009710098100991010010101101021010310104101051010610107101081010910110101111011210113101141011510116101171011810119101201012110122101231012410125101261012710128101291013010131101321013310134101351013610137101381013910140101411014210143101441014510146101471014810149101501015110152101531015410155101561015710158101591016010161101621016310164101651016610167101681016910170101711017210173101741017510176101771017810179101801018110182101831018410185101861018710188101891019010191101921019310194101951019610197101981019910200102011020210203102041020510206102071020810209102101021110212102131021410215102161021710218102191022010221102221022310224102251022610227102281022910230102311023210233102341023510236102371023810239102401024110242102431024410245102461024710248102491025010251102521025310254102551025610257102581025910260102611026210263102641026510266102671026810269102701027110272102731027410275102761027710278102791028010281102821028310284102851028610287102881028910290102911029210293102941029510296102971029810299103001030110302103031030410305103061030710308103091031010311103121031310314103151031610317103181031910320103211032210323103241032510326103271032810329103301033110332103331033410335103361033710338103391034010341103421034310344103451034610347103481034910350103511035210353103541035510356103571035810359103601036110362103631036410365103661036710368103691037010371103721037310374103751037610377103781037910380103811038210383103841038510386103871038810389103901039110392103931039410395103961039710398103991040010401104021040310404104051040610407104081040910410104111041210413104141041510416104171041810419104201042110422104231042410425104261042710428104291043010431104321043310434104351043610437104381043910440104411044210443104441044510446104471044810449104501045110452104531045410455104561045710458104591046010461104621046310464104651046610467104681046910470104711047210473104741047510476104771047810479104801048110482104831048410485104861048710488104891049010491104921049310494104951049610497104981049910500105011050210503105041050510506105071050810509105101051110512105131051410515105161051710518105191052010521105221052310524105251052610527105281052910530105311053210533105341053510536105371053810539105401054110542105431054410545105461054710548105491055010551105521055310554105551055610557105581055910560105611056210563105641056510566105671056810569105701057110572105731057410575105761057710578105791058010581105821058310584105851058610587105881058910590105911059210593105941059510596105971059810599106001060110602106031060410605106061060710608106091061010611106121061310614106151061610617106181061910620106211062210623106241062510626106271062810629106301063110632106331063410635106361063710638106391064010641106421064310644106451064610647106481064910650106511065210653106541065510656106571065810659106601066110662106631066410665106661066710668106691067010671106721067310674106751067610677106781067910680106811068210683106841068510686106871068810689106901069110692106931069410695106961069710698106991070010701107021070310704107051070610707107081070910710107111071210713107141071510716107171071810719107201072110722107231072410725107261072710728107291073010731107321073310734107351073610737107381073910740107411074210743107441074510746107471074810749107501075110752107531075410755107561075710758107591076010761107621076310764107651076610767107681076910770107711077210773107741077510776107771077810779107801078110782107831078410785107861078710788107891079010791107921079310794107951079610797107981079910800108011080210803108041080510806108071080810809108101081110812108131081410815108161081710818108191082010821108221082310824108251082610827108281082910830108311083210833108341083510836108371083810839108401084110842108431084410845108461084710848108491085010851108521085310854108551085610857108581085910860108611086210863108641086510866108671086810869108701087110872108731087410875108761087710878108791088010881108821088310884108851088610887108881088910890108911089210893108941089510896108971089810899109001090110902109031090410905109061090710908109091091010911109121091310914109151091610917109181091910920109211092210923109241092510926109271092810929109301093110932109331093410935109361093710938109391094010941109421094310944109451094610947109481094910950109511095210953109541095510956109571095810959109601096110962109631096410965109661096710968109691097010971109721097310974109751097610977109781097910980109811098210983109841098510986109871098810989109901099110992109931099410995109961099710998109991100011001110021100311004110051100611007110081100911010110111101211013110141101511016110171101811019110201102111022110231102411025110261102711028110291103011031110321103311034110351103611037110381103911040110411104211043110441104511046110471104811049110501105111052110531105411055110561105711058110591106011061110621106311064110651106611067110681106911070110711107211073110741107511076110771107811079110801108111082110831108411085110861108711088110891109011091110921109311094110951109611097110981109911100111011110211103111041110511106111071110811109111101111111112111131111411115111161111711118111191112011121111221112311124111251112611127111281112911130111311113211133111341113511136111371113811139111401114111142111431114411145111461114711148111491115011151111521115311154111551115611157111581115911160111611116211163111641116511166111671116811169111701117111172111731117411175111761117711178111791118011181111821118311184111851118611187111881118911190111911119211193111941119511196111971119811199112001120111202112031120411205112061120711208112091121011211112121121311214112151121611217112181121911220112211122211223112241122511226112271122811229112301123111232112331123411235112361123711238112391124011241112421124311244112451124611247112481124911250112511125211253112541125511256112571125811259112601126111262112631126411265112661126711268112691127011271112721127311274112751127611277112781127911280112811128211283112841128511286112871128811289112901129111292112931129411295112961129711298112991130011301113021130311304113051130611307113081130911310113111131211313113141131511316113171131811319113201132111322113231132411325113261132711328113291133011331113321133311334113351133611337113381133911340113411134211343113441134511346113471134811349113501135111352113531135411355113561135711358113591136011361113621136311364113651136611367113681136911370113711137211373113741137511376113771137811379113801138111382113831138411385113861138711388113891139011391113921139311394113951139611397113981139911400114011140211403114041140511406114071140811409114101141111412114131141411415114161141711418114191142011421114221142311424114251142611427114281142911430114311143211433114341143511436114371143811439114401144111442114431144411445114461144711448114491145011451114521145311454114551145611457114581145911460114611146211463114641146511466114671146811469114701147111472114731147411475114761147711478114791148011481114821148311484114851148611487114881148911490114911149211493114941149511496114971149811499115001150111502115031150411505115061150711508115091151011511115121151311514115151151611517115181151911520115211152211523115241152511526115271152811529115301153111532115331153411535115361153711538115391154011541115421154311544115451154611547115481154911550115511155211553115541155511556115571155811559115601156111562115631156411565115661156711568115691157011571115721157311574115751157611577115781157911580115811158211583115841158511586115871158811589115901159111592115931159411595115961159711598115991160011601116021160311604116051160611607116081160911610116111161211613116141161511616116171161811619116201162111622116231162411625116261162711628116291163011631116321163311634116351163611637116381163911640116411164211643116441164511646116471164811649116501165111652116531165411655116561165711658116591166011661116621166311664116651166611667116681166911670116711167211673116741167511676116771167811679116801168111682116831168411685116861168711688116891169011691116921169311694116951169611697116981169911700117011170211703117041170511706117071170811709117101171111712117131171411715117161171711718117191172011721117221172311724117251172611727117281172911730117311173211733117341173511736117371173811739117401174111742117431174411745117461174711748117491175011751117521175311754117551175611757117581175911760117611176211763117641176511766117671176811769117701177111772117731177411775117761177711778117791178011781117821178311784117851178611787117881178911790117911179211793117941179511796117971179811799118001180111802118031180411805118061180711808118091181011811118121181311814118151181611817118181181911820118211182211823118241182511826118271182811829118301183111832118331183411835118361183711838118391184011841118421184311844118451184611847118481184911850118511185211853118541185511856118571185811859118601186111862118631186411865118661186711868118691187011871118721187311874118751187611877118781187911880118811188211883118841188511886118871188811889118901189111892118931189411895118961189711898118991190011901119021190311904119051190611907119081190911910119111191211913119141191511916119171191811919119201192111922119231192411925119261192711928119291193011931119321193311934119351193611937119381193911940119411194211943119441194511946119471194811949119501195111952119531195411955119561195711958119591196011961119621196311964119651196611967119681196911970119711197211973119741197511976119771197811979119801198111982119831198411985119861198711988119891199011991119921199311994119951199611997119981199912000120011200212003120041200512006120071200812009120101201112012120131201412015120161201712018120191202012021120221202312024120251202612027120281202912030120311203212033120341203512036120371203812039120401204112042120431204412045120461204712048120491205012051120521205312054120551205612057120581205912060120611206212063120641206512066120671206812069120701207112072120731207412075120761207712078120791208012081120821208312084120851208612087120881208912090120911209212093120941209512096120971209812099121001210112102121031210412105121061210712108121091211012111121121211312114121151211612117121181211912120121211212212123121241212512126121271212812129121301213112132121331213412135121361213712138121391214012141121421214312144121451214612147121481214912150121511215212153121541215512156121571215812159121601216112162121631216412165121661216712168121691217012171121721217312174121751217612177121781217912180121811218212183121841218512186121871218812189121901219112192121931219412195121961219712198121991220012201122021220312204122051220612207122081220912210122111221212213122141221512216122171221812219122201222112222122231222412225122261222712228122291223012231122321223312234122351223612237122381223912240122411224212243122441224512246122471224812249122501225112252122531225412255122561225712258122591226012261122621226312264122651226612267122681226912270122711227212273122741227512276122771227812279122801228112282122831228412285122861228712288122891229012291122921229312294122951229612297122981229912300123011230212303123041230512306123071230812309123101231112312123131231412315123161231712318123191232012321123221232312324123251232612327123281232912330123311233212333123341233512336123371233812339123401234112342123431234412345123461234712348123491235012351123521235312354123551235612357123581235912360123611236212363123641236512366123671236812369123701237112372123731237412375123761237712378123791238012381123821238312384123851238612387123881238912390123911239212393123941239512396123971239812399124001240112402124031240412405124061240712408124091241012411124121241312414124151241612417124181241912420124211242212423124241242512426124271242812429124301243112432124331243412435124361243712438124391244012441124421244312444124451244612447124481244912450124511245212453124541245512456124571245812459124601246112462124631246412465124661246712468124691247012471124721247312474124751247612477124781247912480124811248212483124841248512486124871248812489124901249112492124931249412495124961249712498124991250012501125021250312504125051250612507125081250912510125111251212513125141251512516125171251812519125201252112522125231252412525125261252712528125291253012531125321253312534125351253612537125381253912540125411254212543125441254512546125471254812549125501255112552125531255412555125561255712558125591256012561125621256312564125651256612567125681256912570125711257212573125741257512576125771257812579125801258112582125831258412585125861258712588125891259012591125921259312594125951259612597125981259912600126011260212603126041260512606126071260812609126101261112612126131261412615126161261712618126191262012621126221262312624126251262612627126281262912630126311263212633126341263512636126371263812639126401264112642126431264412645126461264712648126491265012651126521265312654126551265612657126581265912660126611266212663126641266512666126671266812669126701267112672126731267412675126761267712678126791268012681126821268312684126851268612687126881268912690126911269212693126941269512696126971269812699127001270112702127031270412705127061270712708127091271012711127121271312714127151271612717127181271912720127211272212723127241272512726127271272812729127301273112732127331273412735127361273712738127391274012741127421274312744127451274612747127481274912750127511275212753127541275512756127571275812759127601276112762127631276412765127661276712768127691277012771127721277312774127751277612777127781277912780127811278212783127841278512786127871278812789127901279112792127931279412795127961279712798127991280012801128021280312804128051280612807128081280912810128111281212813128141281512816128171281812819128201282112822128231282412825128261282712828128291283012831128321283312834128351283612837128381283912840128411284212843128441284512846128471284812849128501285112852128531285412855128561285712858128591286012861128621286312864128651286612867128681286912870128711287212873128741287512876128771287812879128801288112882128831288412885128861288712888128891289012891128921289312894128951289612897128981289912900129011290212903129041290512906129071290812909129101291112912129131291412915129161291712918129191292012921129221292312924129251292612927129281292912930129311293212933129341293512936129371293812939129401294112942129431294412945129461294712948129491295012951129521295312954129551295612957129581295912960129611296212963129641296512966129671296812969129701297112972129731297412975129761297712978129791298012981129821298312984129851298612987129881298912990129911299212993129941299512996129971299812999130001300113002130031300413005130061300713008130091301013011130121301313014130151301613017130181301913020130211302213023130241302513026130271302813029130301303113032130331303413035130361303713038130391304013041130421304313044130451304613047130481304913050130511305213053130541305513056130571305813059130601306113062130631306413065130661306713068130691307013071130721307313074130751307613077130781307913080130811308213083130841308513086130871308813089130901309113092130931309413095130961309713098130991310013101131021310313104131051310613107131081310913110131111311213113131141311513116131171311813119131201312113122131231312413125131261312713128131291313013131131321313313134131351313613137131381313913140131411314213143131441314513146131471314813149131501315113152131531315413155131561315713158131591316013161131621316313164131651316613167131681316913170131711317213173131741317513176131771317813179131801318113182131831318413185131861318713188131891319013191131921319313194131951319613197131981319913200132011320213203132041320513206132071320813209132101321113212132131321413215132161321713218132191322013221132221322313224132251322613227132281322913230132311323213233132341323513236132371323813239132401324113242132431324413245132461324713248132491325013251132521325313254132551325613257132581325913260132611326213263132641326513266132671326813269132701327113272132731327413275132761327713278132791328013281132821328313284132851328613287132881328913290132911329213293132941329513296132971329813299133001330113302133031330413305133061330713308133091331013311133121331313314133151331613317133181331913320133211332213323133241332513326133271332813329133301333113332133331333413335133361333713338133391334013341133421334313344133451334613347133481334913350133511335213353133541335513356133571335813359133601336113362133631336413365133661336713368133691337013371133721337313374133751337613377133781337913380133811338213383133841338513386133871338813389133901339113392133931339413395133961339713398133991340013401134021340313404134051340613407134081340913410134111341213413134141341513416134171341813419134201342113422134231342413425134261342713428134291343013431134321343313434134351343613437134381343913440134411344213443134441344513446134471344813449134501345113452134531345413455134561345713458134591346013461134621346313464134651346613467134681346913470134711347213473134741347513476134771347813479134801348113482134831348413485134861348713488134891349013491134921349313494134951349613497134981349913500135011350213503135041350513506135071350813509135101351113512135131351413515135161351713518135191352013521135221352313524135251352613527135281352913530135311353213533135341353513536135371353813539135401354113542135431354413545135461354713548135491355013551135521355313554135551355613557135581355913560135611356213563135641356513566135671356813569135701357113572135731357413575135761357713578135791358013581135821358313584135851358613587135881358913590135911359213593135941359513596135971359813599136001360113602136031360413605136061360713608136091361013611136121361313614136151361613617136181361913620136211362213623136241362513626136271362813629136301363113632136331363413635136361363713638136391364013641136421364313644136451364613647136481364913650136511365213653136541365513656136571365813659136601366113662136631366413665136661366713668136691367013671136721367313674136751367613677136781367913680136811368213683136841368513686136871368813689136901369113692136931369413695136961369713698136991370013701137021370313704137051370613707137081370913710137111371213713137141371513716137171371813719137201372113722137231372413725137261372713728137291373013731137321373313734137351373613737137381373913740137411374213743137441374513746137471374813749137501375113752137531375413755137561375713758137591376013761137621376313764137651376613767137681376913770137711377213773137741377513776137771377813779137801378113782137831378413785137861378713788137891379013791137921379313794137951379613797137981379913800138011380213803138041380513806138071380813809138101381113812138131381413815138161381713818138191382013821138221382313824138251382613827138281382913830138311383213833138341383513836138371383813839138401384113842138431384413845138461384713848138491385013851138521385313854138551385613857138581385913860138611386213863138641386513866138671386813869138701387113872138731387413875138761387713878138791388013881138821388313884138851388613887138881388913890138911389213893138941389513896138971389813899139001390113902139031390413905139061390713908139091391013911139121391313914139151391613917139181391913920139211392213923139241392513926139271392813929139301393113932139331393413935139361393713938139391394013941139421394313944139451394613947139481394913950139511395213953139541395513956139571395813959139601396113962139631396413965139661396713968139691397013971139721397313974139751397613977139781397913980139811398213983139841398513986139871398813989139901399113992139931399413995139961399713998139991400014001140021400314004140051400614007140081400914010140111401214013140141401514016140171401814019140201402114022140231402414025140261402714028140291403014031140321403314034140351403614037140381403914040140411404214043140441404514046140471404814049140501405114052140531405414055140561405714058140591406014061140621406314064140651406614067140681406914070140711407214073140741407514076140771407814079140801408114082140831408414085140861408714088140891409014091140921409314094140951409614097140981409914100141011410214103141041410514106141071410814109141101411114112141131411414115141161411714118141191412014121141221412314124141251412614127141281412914130141311413214133141341413514136141371413814139141401414114142141431414414145141461414714148141491415014151141521415314154141551415614157141581415914160141611416214163141641416514166141671416814169141701417114172141731417414175141761417714178141791418014181141821418314184141851418614187141881418914190141911419214193141941419514196141971419814199142001420114202142031420414205142061420714208142091421014211142121421314214142151421614217142181421914220142211422214223142241422514226142271422814229142301423114232142331423414235142361423714238142391424014241142421424314244142451424614247142481424914250142511425214253142541425514256142571425814259142601426114262142631426414265142661426714268142691427014271142721427314274142751427614277142781427914280142811428214283142841428514286142871428814289142901429114292142931429414295142961429714298142991430014301143021430314304143051430614307143081430914310143111431214313143141431514316143171431814319143201432114322143231432414325143261432714328143291433014331143321433314334143351433614337143381433914340143411434214343143441434514346143471434814349143501435114352143531435414355143561435714358143591436014361143621436314364143651436614367143681436914370143711437214373143741437514376143771437814379143801438114382143831438414385143861438714388143891439014391143921439314394143951439614397143981439914400144011440214403144041440514406144071440814409144101441114412144131441414415144161441714418144191442014421144221442314424144251442614427144281442914430144311443214433144341443514436144371443814439144401444114442144431444414445144461444714448144491445014451144521445314454144551445614457144581445914460144611446214463144641446514466144671446814469144701447114472144731447414475144761447714478144791448014481144821448314484144851448614487144881448914490144911449214493144941449514496144971449814499145001450114502145031450414505145061450714508145091451014511145121451314514145151451614517145181451914520145211452214523145241452514526145271452814529145301453114532145331453414535145361453714538145391454014541145421454314544145451454614547145481454914550145511455214553145541455514556145571455814559145601456114562145631456414565145661456714568145691457014571145721457314574145751457614577145781457914580145811458214583145841458514586145871458814589145901459114592145931459414595145961459714598145991460014601146021460314604146051460614607146081460914610146111461214613146141461514616146171461814619146201462114622146231462414625146261462714628146291463014631146321463314634146351463614637146381463914640146411464214643146441464514646146471464814649146501465114652146531465414655146561465714658146591466014661146621466314664146651466614667146681466914670146711467214673146741467514676146771467814679146801468114682146831468414685146861468714688146891469014691146921469314694146951469614697146981469914700147011470214703147041470514706147071470814709147101471114712147131471414715147161471714718147191472014721147221472314724147251472614727147281472914730147311473214733147341473514736147371473814739147401474114742147431474414745147461474714748147491475014751147521475314754147551475614757147581475914760147611476214763147641476514766147671476814769147701477114772147731477414775147761477714778147791478014781147821478314784147851478614787147881478914790147911479214793147941479514796147971479814799148001480114802148031480414805148061480714808148091481014811148121481314814148151481614817148181481914820148211482214823148241482514826148271482814829148301483114832148331483414835148361483714838148391484014841148421484314844148451484614847148481484914850148511485214853148541485514856148571485814859148601486114862148631486414865148661486714868148691487014871148721487314874148751487614877148781487914880148811488214883148841488514886148871488814889148901489114892148931489414895148961489714898148991490014901149021490314904149051490614907149081490914910149111491214913149141491514916149171491814919149201492114922149231492414925149261492714928149291493014931149321493314934149351493614937149381493914940149411494214943149441494514946149471494814949149501495114952149531495414955149561495714958149591496014961149621496314964149651496614967149681496914970149711497214973149741497514976149771497814979149801498114982149831498414985149861498714988149891499014991149921499314994149951499614997149981499915000150011500215003150041500515006150071500815009150101501115012150131501415015150161501715018150191502015021150221502315024150251502615027150281502915030150311503215033150341503515036150371503815039150401504115042150431504415045150461504715048150491505015051150521505315054150551505615057150581505915060150611506215063150641506515066150671506815069150701507115072150731507415075150761507715078150791508015081150821508315084150851508615087150881508915090150911509215093150941509515096150971509815099151001510115102151031510415105151061510715108151091511015111151121511315114151151511615117151181511915120151211512215123151241512515126151271512815129151301513115132151331513415135151361513715138151391514015141151421514315144151451514615147151481514915150151511515215153151541515515156151571515815159151601516115162151631516415165151661516715168151691517015171151721517315174151751517615177151781517915180151811518215183151841518515186151871518815189151901519115192151931519415195151961519715198151991520015201152021520315204152051520615207152081520915210152111521215213152141521515216152171521815219152201522115222152231522415225152261522715228152291523015231152321523315234152351523615237152381523915240152411524215243152441524515246152471524815249152501525115252152531525415255152561525715258152591526015261152621526315264152651526615267152681526915270152711527215273152741527515276152771527815279152801528115282152831528415285152861528715288152891529015291152921529315294152951529615297152981529915300153011530215303153041530515306153071530815309153101531115312153131531415315153161531715318153191532015321153221532315324153251532615327153281532915330153311533215333153341533515336153371533815339153401534115342153431534415345153461534715348153491535015351153521535315354153551535615357153581535915360153611536215363153641536515366153671536815369153701537115372153731537415375153761537715378153791538015381153821538315384153851538615387153881538915390153911539215393153941539515396153971539815399154001540115402154031540415405154061540715408154091541015411154121541315414154151541615417154181541915420154211542215423154241542515426154271542815429154301543115432154331543415435154361543715438154391544015441154421544315444154451544615447154481544915450154511545215453154541545515456154571545815459154601546115462154631546415465154661546715468154691547015471154721547315474154751547615477154781547915480154811548215483154841548515486154871548815489154901549115492154931549415495154961549715498154991550015501155021550315504155051550615507155081550915510155111551215513155141551515516155171551815519155201552115522155231552415525155261552715528155291553015531155321553315534155351553615537155381553915540155411554215543155441554515546155471554815549155501555115552155531555415555155561555715558155591556015561155621556315564155651556615567155681556915570155711557215573155741557515576155771557815579155801558115582155831558415585155861558715588155891559015591155921559315594155951559615597155981559915600156011560215603156041560515606156071560815609156101561115612156131561415615156161561715618156191562015621156221562315624156251562615627156281562915630156311563215633156341563515636156371563815639156401564115642156431564415645156461564715648156491565015651156521565315654156551565615657156581565915660156611566215663156641566515666156671566815669156701567115672156731567415675156761567715678156791568015681156821568315684156851568615687156881568915690156911569215693156941569515696156971569815699157001570115702157031570415705157061570715708157091571015711157121571315714157151571615717157181571915720157211572215723157241572515726157271572815729157301573115732157331573415735157361573715738157391574015741157421574315744157451574615747157481574915750157511575215753157541575515756157571575815759157601576115762157631576415765157661576715768157691577015771157721577315774157751577615777157781577915780157811578215783157841578515786157871578815789157901579115792157931579415795157961579715798157991580015801158021580315804158051580615807158081580915810158111581215813158141581515816158171581815819158201582115822158231582415825158261582715828158291583015831158321583315834158351583615837158381583915840158411584215843158441584515846158471584815849158501585115852158531585415855158561585715858158591586015861158621586315864158651586615867158681586915870158711587215873158741587515876158771587815879158801588115882158831588415885158861588715888158891589015891158921589315894158951589615897158981589915900159011590215903159041590515906159071590815909159101591115912159131591415915159161591715918159191592015921159221592315924159251592615927159281592915930159311593215933159341593515936159371593815939159401594115942159431594415945159461594715948159491595015951159521595315954159551595615957159581595915960159611596215963159641596515966159671596815969159701597115972159731597415975159761597715978159791598015981159821598315984159851598615987159881598915990159911599215993159941599515996159971599815999160001600116002160031600416005160061600716008160091601016011160121601316014160151601616017160181601916020160211602216023160241602516026160271602816029160301603116032160331603416035160361603716038160391604016041160421604316044160451604616047160481604916050160511605216053160541605516056160571605816059160601606116062160631606416065160661606716068160691607016071160721607316074160751607616077160781607916080160811608216083160841608516086160871608816089160901609116092160931609416095160961609716098160991610016101161021610316104161051610616107161081610916110161111611216113161141611516116161171611816119161201612116122161231612416125161261612716128161291613016131161321613316134161351613616137161381613916140161411614216143161441614516146161471614816149161501615116152161531615416155161561615716158161591616016161161621616316164161651616616167161681616916170161711617216173161741617516176161771617816179161801618116182161831618416185161861618716188161891619016191161921619316194161951619616197161981619916200162011620216203162041620516206162071620816209162101621116212162131621416215162161621716218162191622016221162221622316224162251622616227162281622916230162311623216233162341623516236162371623816239162401624116242162431624416245162461624716248162491625016251162521625316254162551625616257162581625916260162611626216263162641626516266162671626816269162701627116272162731627416275162761627716278162791628016281162821628316284162851628616287162881628916290162911629216293162941629516296162971629816299163001630116302163031630416305163061630716308163091631016311163121631316314163151631616317163181631916320163211632216323163241632516326163271632816329163301633116332163331633416335163361633716338163391634016341163421634316344163451634616347163481634916350163511635216353163541635516356163571635816359163601636116362163631636416365163661636716368163691637016371163721637316374163751637616377163781637916380163811638216383163841638516386163871638816389163901639116392163931639416395163961639716398163991640016401164021640316404164051640616407164081640916410164111641216413164141641516416164171641816419164201642116422164231642416425164261642716428164291643016431164321643316434164351643616437164381643916440164411644216443164441644516446164471644816449164501645116452164531645416455164561645716458164591646016461164621646316464164651646616467164681646916470164711647216473164741647516476164771647816479164801648116482164831648416485164861648716488164891649016491164921649316494164951649616497164981649916500165011650216503165041650516506165071650816509165101651116512165131651416515165161651716518165191652016521165221652316524165251652616527165281652916530165311653216533165341653516536165371653816539165401654116542165431654416545165461654716548165491655016551165521655316554165551655616557165581655916560165611656216563165641656516566165671656816569165701657116572165731657416575165761657716578165791658016581165821658316584165851658616587165881658916590165911659216593165941659516596165971659816599166001660116602166031660416605166061660716608166091661016611166121661316614166151661616617166181661916620166211662216623166241662516626166271662816629166301663116632166331663416635166361663716638166391664016641166421664316644166451664616647166481664916650166511665216653166541665516656166571665816659166601666116662166631666416665166661666716668166691667016671166721667316674166751667616677166781667916680166811668216683166841668516686166871668816689166901669116692166931669416695166961669716698166991670016701167021670316704167051670616707167081670916710167111671216713167141671516716167171671816719167201672116722167231672416725167261672716728167291673016731167321673316734167351673616737167381673916740167411674216743167441674516746167471674816749167501675116752167531675416755167561675716758167591676016761167621676316764167651676616767167681676916770167711677216773167741677516776167771677816779167801678116782167831678416785167861678716788167891679016791167921679316794167951679616797167981679916800168011680216803168041680516806168071680816809168101681116812168131681416815168161681716818168191682016821168221682316824168251682616827168281682916830168311683216833168341683516836168371683816839168401684116842168431684416845168461684716848168491685016851168521685316854168551685616857168581685916860168611686216863168641686516866168671686816869168701687116872168731687416875168761687716878168791688016881168821688316884168851688616887168881688916890168911689216893168941689516896168971689816899169001690116902169031690416905169061690716908169091691016911169121691316914169151691616917169181691916920169211692216923169241692516926169271692816929169301693116932169331693416935169361693716938169391694016941169421694316944169451694616947169481694916950169511695216953169541695516956169571695816959169601696116962169631696416965169661696716968169691697016971169721697316974169751697616977169781697916980169811698216983169841698516986169871698816989169901699116992169931699416995169961699716998169991700017001170021700317004170051700617007170081700917010170111701217013170141701517016170171701817019170201702117022170231702417025170261702717028170291703017031170321703317034170351703617037170381703917040170411704217043170441704517046170471704817049170501705117052170531705417055170561705717058170591706017061170621706317064170651706617067170681706917070170711707217073170741707517076170771707817079170801708117082170831708417085170861708717088170891709017091170921709317094170951709617097170981709917100171011710217103171041710517106171071710817109171101711117112171131711417115171161711717118171191712017121171221712317124171251712617127171281712917130171311713217133171341713517136171371713817139171401714117142171431714417145171461714717148171491715017151171521715317154171551715617157171581715917160171611716217163171641716517166171671716817169171701717117172171731717417175171761717717178171791718017181171821718317184171851718617187171881718917190171911719217193171941719517196171971719817199172001720117202172031720417205172061720717208172091721017211172121721317214172151721617217172181721917220172211722217223172241722517226172271722817229172301723117232172331723417235172361723717238172391724017241172421724317244172451724617247172481724917250172511725217253172541725517256172571725817259172601726117262172631726417265172661726717268172691727017271172721727317274172751727617277172781727917280172811728217283172841728517286172871728817289172901729117292172931729417295172961729717298172991730017301173021730317304173051730617307173081730917310173111731217313173141731517316173171731817319173201732117322173231732417325173261732717328173291733017331173321733317334173351733617337173381733917340173411734217343173441734517346173471734817349173501735117352173531735417355173561735717358173591736017361173621736317364173651736617367173681736917370173711737217373173741737517376173771737817379173801738117382173831738417385173861738717388173891739017391173921739317394173951739617397173981739917400174011740217403174041740517406174071740817409174101741117412174131741417415174161741717418174191742017421174221742317424174251742617427174281742917430174311743217433174341743517436174371743817439174401744117442174431744417445174461744717448174491745017451174521745317454174551745617457174581745917460174611746217463174641746517466174671746817469174701747117472174731747417475174761747717478174791748017481174821748317484174851748617487174881748917490174911749217493174941749517496174971749817499175001750117502175031750417505175061750717508175091751017511175121751317514175151751617517175181751917520175211752217523175241752517526175271752817529175301753117532175331753417535175361753717538175391754017541175421754317544175451754617547175481754917550175511755217553175541755517556175571755817559175601756117562175631756417565175661756717568175691757017571175721757317574175751757617577175781757917580175811758217583175841758517586175871758817589175901759117592175931759417595175961759717598175991760017601176021760317604176051760617607176081760917610176111761217613176141761517616176171761817619176201762117622176231762417625176261762717628176291763017631176321763317634176351763617637176381763917640176411764217643176441764517646176471764817649176501765117652176531765417655176561765717658176591766017661176621766317664176651766617667176681766917670176711767217673176741767517676176771767817679176801768117682176831768417685176861768717688176891769017691176921769317694176951769617697176981769917700177011770217703177041770517706177071770817709177101771117712177131771417715177161771717718177191772017721177221772317724177251772617727177281772917730177311773217733177341773517736177371773817739177401774117742177431774417745177461774717748177491775017751177521775317754177551775617757177581775917760177611776217763177641776517766177671776817769177701777117772177731777417775177761777717778177791778017781177821778317784177851778617787177881778917790177911779217793177941779517796177971779817799178001780117802178031780417805178061780717808178091781017811178121781317814178151781617817178181781917820178211782217823178241782517826178271782817829178301783117832178331783417835178361783717838178391784017841178421784317844178451784617847178481784917850178511785217853178541785517856178571785817859178601786117862178631786417865178661786717868178691787017871178721787317874178751787617877178781787917880178811788217883178841788517886178871788817889178901789117892178931789417895178961789717898178991790017901179021790317904179051790617907179081790917910179111791217913179141791517916179171791817919179201792117922179231792417925179261792717928179291793017931179321793317934179351793617937179381793917940179411794217943179441794517946179471794817949179501795117952179531795417955179561795717958179591796017961179621796317964179651796617967179681796917970179711797217973179741797517976179771797817979179801798117982179831798417985179861798717988179891799017991179921799317994179951799617997179981799918000180011800218003180041800518006180071800818009180101801118012180131801418015180161801718018180191802018021180221802318024180251802618027180281802918030180311803218033180341803518036180371803818039180401804118042180431804418045180461804718048180491805018051180521805318054180551805618057180581805918060180611806218063180641806518066180671806818069180701807118072180731807418075180761807718078180791808018081180821808318084180851808618087180881808918090180911809218093180941809518096180971809818099181001810118102181031810418105181061810718108181091811018111181121811318114181151811618117181181811918120181211812218123181241812518126181271812818129181301813118132181331813418135181361813718138181391814018141181421814318144181451814618147181481814918150181511815218153181541815518156181571815818159181601816118162181631816418165181661816718168181691817018171181721817318174181751817618177181781817918180181811818218183181841818518186181871818818189181901819118192181931819418195181961819718198181991820018201182021820318204182051820618207182081820918210182111821218213182141821518216182171821818219182201822118222182231822418225182261822718228182291823018231182321823318234182351823618237182381823918240182411824218243182441824518246182471824818249182501825118252182531825418255182561825718258182591826018261182621826318264182651826618267182681826918270182711827218273182741827518276182771827818279182801828118282182831828418285182861828718288182891829018291182921829318294182951829618297182981829918300183011830218303183041830518306183071830818309183101831118312183131831418315183161831718318183191832018321183221832318324183251832618327183281832918330183311833218333183341833518336183371833818339183401834118342183431834418345183461834718348183491835018351183521835318354183551835618357183581835918360183611836218363183641836518366183671836818369183701837118372183731837418375183761837718378183791838018381183821838318384183851838618387183881838918390183911839218393183941839518396183971839818399184001840118402184031840418405184061840718408184091841018411184121841318414184151841618417184181841918420184211842218423184241842518426184271842818429184301843118432184331843418435184361843718438184391844018441184421844318444184451844618447184481844918450184511845218453184541845518456184571845818459184601846118462184631846418465184661846718468184691847018471184721847318474184751847618477184781847918480184811848218483184841848518486184871848818489184901849118492184931849418495184961849718498184991850018501185021850318504185051850618507185081850918510185111851218513185141851518516185171851818519185201852118522185231852418525185261852718528185291853018531185321853318534185351853618537185381853918540185411854218543185441854518546185471854818549185501855118552185531855418555185561855718558185591856018561185621856318564185651856618567185681856918570185711857218573185741857518576185771857818579185801858118582185831858418585185861858718588185891859018591185921859318594185951859618597185981859918600186011860218603186041860518606186071860818609186101861118612186131861418615186161861718618186191862018621186221862318624186251862618627186281862918630186311863218633186341863518636186371863818639186401864118642186431864418645186461864718648186491865018651186521865318654186551865618657186581865918660186611866218663186641866518666186671866818669186701867118672186731867418675186761867718678186791868018681186821868318684186851868618687186881868918690186911869218693186941869518696186971869818699187001870118702187031870418705187061870718708187091871018711187121871318714187151871618717187181871918720187211872218723187241872518726187271872818729187301873118732187331873418735187361873718738187391874018741187421874318744187451874618747187481874918750187511875218753187541875518756187571875818759187601876118762187631876418765187661876718768187691877018771187721877318774187751877618777187781877918780187811878218783187841878518786187871878818789187901879118792187931879418795187961879718798187991880018801188021880318804188051880618807188081880918810188111881218813188141881518816188171881818819188201882118822188231882418825188261882718828188291883018831188321883318834188351883618837188381883918840188411884218843188441884518846188471884818849188501885118852188531885418855188561885718858188591886018861188621886318864188651886618867188681886918870188711887218873188741887518876188771887818879188801888118882188831888418885188861888718888188891889018891188921889318894188951889618897188981889918900189011890218903189041890518906189071890818909189101891118912189131891418915189161891718918189191892018921189221892318924189251892618927189281892918930189311893218933189341893518936189371893818939189401894118942189431894418945189461894718948189491895018951189521895318954189551895618957189581895918960189611896218963189641896518966189671896818969189701897118972189731897418975189761897718978189791898018981189821898318984189851898618987189881898918990189911899218993189941899518996189971899818999190001900119002190031900419005190061900719008190091901019011190121901319014190151901619017190181901919020190211902219023190241902519026190271902819029190301903119032190331903419035190361903719038190391904019041190421904319044190451904619047190481904919050190511905219053190541905519056190571905819059190601906119062190631906419065190661906719068190691907019071190721907319074190751907619077190781907919080190811908219083190841908519086190871908819089190901909119092190931909419095190961909719098190991910019101191021910319104191051910619107191081910919110191111911219113191141911519116191171911819119191201912119122191231912419125191261912719128191291913019131191321913319134191351913619137191381913919140191411914219143191441914519146191471914819149191501915119152191531915419155191561915719158191591916019161191621916319164191651916619167191681916919170191711917219173191741917519176191771917819179191801918119182191831918419185191861918719188191891919019191191921919319194191951919619197191981919919200192011920219203192041920519206192071920819209192101921119212192131921419215192161921719218192191922019221192221922319224192251922619227192281922919230192311923219233192341923519236192371923819239192401924119242192431924419245192461924719248192491925019251192521925319254192551925619257192581925919260192611926219263192641926519266192671926819269192701927119272192731927419275192761927719278192791928019281192821928319284192851928619287192881928919290192911929219293192941929519296192971929819299193001930119302193031930419305193061930719308193091931019311193121931319314193151931619317193181931919320193211932219323193241932519326193271932819329193301933119332193331933419335193361933719338193391934019341193421934319344193451934619347193481934919350193511935219353193541935519356193571935819359193601936119362193631936419365193661936719368193691937019371193721937319374193751937619377193781937919380193811938219383193841938519386
  1. (self["webpackChunk"] = self["webpackChunk"] || []).push([["resources_js_pages_Sales_Index_vue"],{
  2. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppButtonLink.vue?vue&type=script&setup=true&lang=js":
  3. /*!******************************************************************************************************************************************************************************************************************!*\
  4. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppButtonLink.vue?vue&type=script&setup=true&lang=js ***!
  5. \******************************************************************************************************************************************************************************************************************/
  6. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  7. "use strict";
  8. __webpack_require__.r(__webpack_exports__);
  9. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  10. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  11. /* harmony export */ });
  12. /* harmony import */ var _inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @inertiajs/inertia-vue3 */ "./node_modules/@inertiajs/inertia-vue3/dist/index.js");
  13. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
  14. __name: 'AppButtonLink',
  15. props: {
  16. inertiaLink: {
  17. type: Boolean,
  18. "default": true
  19. },
  20. icon: {
  21. type: String,
  22. required: true
  23. },
  24. label: String
  25. },
  26. setup: function setup(__props, _ref) {
  27. var expose = _ref.expose;
  28. expose();
  29. var __returned__ = {
  30. Link: _inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_0__.Link
  31. };
  32. Object.defineProperty(__returned__, '__isScriptSetup', {
  33. enumerable: false,
  34. value: true
  35. });
  36. return __returned__;
  37. }
  38. });
  39. /***/ }),
  40. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppMessage.vue?vue&type=script&setup=true&lang=js":
  41. /*!***************************************************************************************************************************************************************************************************************!*\
  42. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppMessage.vue?vue&type=script&setup=true&lang=js ***!
  43. \***************************************************************************************************************************************************************************************************************/
  44. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  45. "use strict";
  46. __webpack_require__.r(__webpack_exports__);
  47. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  48. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  49. /* harmony export */ });
  50. /* harmony import */ var _inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @inertiajs/inertia-vue3 */ "./node_modules/@inertiajs/inertia-vue3/dist/index.js");
  51. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
  52. __name: 'AppMessage',
  53. setup: function setup(__props, _ref) {
  54. var expose = _ref.expose;
  55. expose();
  56. var onClose = function onClose() {
  57. (0,_inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_0__.usePage)().props.value.errors = {};
  58. (0,_inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_0__.usePage)().props.value.flash.success = null;
  59. (0,_inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_0__.usePage)().props.value.flash.error = null;
  60. };
  61. var __returned__ = {
  62. onClose: onClose,
  63. usePage: _inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_0__.usePage
  64. };
  65. Object.defineProperty(__returned__, '__isScriptSetup', {
  66. enumerable: false,
  67. value: true
  68. });
  69. return __returned__;
  70. }
  71. });
  72. /***/ }),
  73. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppPagination.vue?vue&type=script&setup=true&lang=js":
  74. /*!******************************************************************************************************************************************************************************************************************!*\
  75. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppPagination.vue?vue&type=script&setup=true&lang=js ***!
  76. \******************************************************************************************************************************************************************************************************************/
  77. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  78. "use strict";
  79. __webpack_require__.r(__webpack_exports__);
  80. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  81. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  82. /* harmony export */ });
  83. /* harmony import */ var _inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @inertiajs/inertia-vue3 */ "./node_modules/@inertiajs/inertia-vue3/dist/index.js");
  84. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
  85. __name: 'AppPagination',
  86. props: {
  87. links: Array
  88. },
  89. setup: function setup(__props, _ref) {
  90. var expose = _ref.expose;
  91. expose();
  92. var __returned__ = {
  93. Link: _inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_0__.Link
  94. };
  95. Object.defineProperty(__returned__, '__isScriptSetup', {
  96. enumerable: false,
  97. value: true
  98. });
  99. return __returned__;
  100. }
  101. });
  102. /***/ }),
  103. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppSearch.vue?vue&type=script&setup=true&lang=js":
  104. /*!**************************************************************************************************************************************************************************************************************!*\
  105. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppSearch.vue?vue&type=script&setup=true&lang=js ***!
  106. \**************************************************************************************************************************************************************************************************************/
  107. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  108. "use strict";
  109. __webpack_require__.r(__webpack_exports__);
  110. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  111. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  112. /* harmony export */ });
  113. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  114. /* harmony import */ var _inertiajs_inertia__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @inertiajs/inertia */ "./node_modules/@inertiajs/inertia/dist/index.js");
  115. /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! lodash */ "./node_modules/lodash/lodash.js");
  116. /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_2__);
  117. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
  118. __name: 'AppSearch',
  119. props: {
  120. url: {
  121. type: String,
  122. required: true
  123. },
  124. initialSearch: {
  125. required: true
  126. }
  127. },
  128. setup: function setup(__props, _ref) {
  129. var expose = _ref.expose;
  130. expose();
  131. var props = __props;
  132. var search = (0,vue__WEBPACK_IMPORTED_MODULE_0__.ref)(props.initialSearch);
  133. (0,vue__WEBPACK_IMPORTED_MODULE_0__.watch)(search, function () {
  134. _inertiajs_inertia__WEBPACK_IMPORTED_MODULE_1__.Inertia.get(props.url, (0,lodash__WEBPACK_IMPORTED_MODULE_2__.pickBy)({
  135. search: search.value
  136. }), {
  137. preserveState: true
  138. });
  139. });
  140. var __returned__ = {
  141. props: props,
  142. search: search,
  143. ref: vue__WEBPACK_IMPORTED_MODULE_0__.ref,
  144. watch: vue__WEBPACK_IMPORTED_MODULE_0__.watch,
  145. Inertia: _inertiajs_inertia__WEBPACK_IMPORTED_MODULE_1__.Inertia,
  146. pickBy: lodash__WEBPACK_IMPORTED_MODULE_2__.pickBy
  147. };
  148. Object.defineProperty(__returned__, '__isScriptSetup', {
  149. enumerable: false,
  150. value: true
  151. });
  152. return __returned__;
  153. }
  154. });
  155. /***/ }),
  156. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/layouts/Dashboard/Components/Sidebar.vue?vue&type=script&setup=true&lang=js":
  157. /*!******************************************************************************************************************************************************************************************************************************!*\
  158. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/layouts/Dashboard/Components/Sidebar.vue?vue&type=script&setup=true&lang=js ***!
  159. \******************************************************************************************************************************************************************************************************************************/
  160. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  161. "use strict";
  162. __webpack_require__.r(__webpack_exports__);
  163. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  164. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  165. /* harmony export */ });
  166. /* harmony import */ var _SubSidebar_vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./SubSidebar.vue */ "./resources/js/layouts/Dashboard/Components/SubSidebar.vue");
  167. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
  168. __name: 'Sidebar',
  169. props: {
  170. menu: Array
  171. },
  172. setup: function setup(__props, _ref) {
  173. var expose = _ref.expose;
  174. expose();
  175. var __returned__ = {
  176. SubSidebar: _SubSidebar_vue__WEBPACK_IMPORTED_MODULE_0__["default"]
  177. };
  178. Object.defineProperty(__returned__, '__isScriptSetup', {
  179. enumerable: false,
  180. value: true
  181. });
  182. return __returned__;
  183. }
  184. });
  185. /***/ }),
  186. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/layouts/Dashboard/Components/SubSidebar.vue?vue&type=script&setup=true&lang=js":
  187. /*!*********************************************************************************************************************************************************************************************************************************!*\
  188. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/layouts/Dashboard/Components/SubSidebar.vue?vue&type=script&setup=true&lang=js ***!
  189. \*********************************************************************************************************************************************************************************************************************************/
  190. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  191. "use strict";
  192. __webpack_require__.r(__webpack_exports__);
  193. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  194. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  195. /* harmony export */ });
  196. /* harmony import */ var _inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @inertiajs/inertia-vue3 */ "./node_modules/@inertiajs/inertia-vue3/dist/index.js");
  197. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
  198. __name: 'SubSidebar',
  199. props: {
  200. items: Array,
  201. root: {
  202. type: Boolean,
  203. "default": false
  204. }
  205. },
  206. setup: function setup(__props, _ref) {
  207. var expose = _ref.expose;
  208. expose();
  209. var __returned__ = {
  210. Link: _inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_0__.Link
  211. };
  212. Object.defineProperty(__returned__, '__isScriptSetup', {
  213. enumerable: false,
  214. value: true
  215. });
  216. return __returned__;
  217. }
  218. });
  219. /***/ }),
  220. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/layouts/Dashboard/Components/TopBar.vue?vue&type=script&setup=true&lang=js":
  221. /*!*****************************************************************************************************************************************************************************************************************************!*\
  222. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/layouts/Dashboard/Components/TopBar.vue?vue&type=script&setup=true&lang=js ***!
  223. \*****************************************************************************************************************************************************************************************************************************/
  224. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  225. "use strict";
  226. __webpack_require__.r(__webpack_exports__);
  227. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  228. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  229. /* harmony export */ });
  230. /* harmony import */ var _inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @inertiajs/inertia-vue3 */ "./node_modules/@inertiajs/inertia-vue3/dist/index.js");
  231. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
  232. __name: 'TopBar',
  233. setup: function setup(__props, _ref) {
  234. var expose = _ref.expose;
  235. expose();
  236. var __returned__ = {
  237. Link: _inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_0__.Link
  238. };
  239. Object.defineProperty(__returned__, '__isScriptSetup', {
  240. enumerable: false,
  241. value: true
  242. });
  243. return __returned__;
  244. }
  245. });
  246. /***/ }),
  247. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/layouts/Dashboard/DashboardLayout.vue?vue&type=script&setup=true&lang=js":
  248. /*!***************************************************************************************************************************************************************************************************************************!*\
  249. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/layouts/Dashboard/DashboardLayout.vue?vue&type=script&setup=true&lang=js ***!
  250. \***************************************************************************************************************************************************************************************************************************/
  251. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  252. "use strict";
  253. __webpack_require__.r(__webpack_exports__);
  254. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  255. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  256. /* harmony export */ });
  257. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  258. /* harmony import */ var _inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @inertiajs/inertia-vue3 */ "./node_modules/@inertiajs/inertia-vue3/dist/index.js");
  259. /* harmony import */ var _utils_menu__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @/utils/menu */ "./resources/js/utils/menu.js");
  260. /* harmony import */ var _components_AppMessage_vue__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @/components/AppMessage.vue */ "./resources/js/components/AppMessage.vue");
  261. /* harmony import */ var _Components_TopBar_vue__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./Components/TopBar.vue */ "./resources/js/layouts/Dashboard/Components/TopBar.vue");
  262. /* harmony import */ var _Components_Sidebar_vue__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./Components/Sidebar.vue */ "./resources/js/layouts/Dashboard/Components/Sidebar.vue");
  263. /* harmony import */ var _Components_Footer_vue__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./Components/Footer.vue */ "./resources/js/layouts/Dashboard/Components/Footer.vue");
  264. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
  265. __name: 'DashboardLayout',
  266. props: {
  267. title: String
  268. },
  269. setup: function setup(__props, _ref) {
  270. var expose = _ref.expose;
  271. expose();
  272. var mobileMenuActive = (0,vue__WEBPACK_IMPORTED_MODULE_0__.ref)(false);
  273. var staticMenuInactive = (0,vue__WEBPACK_IMPORTED_MODULE_0__.ref)(false);
  274. var menuClick = (0,vue__WEBPACK_IMPORTED_MODULE_0__.ref)(false);
  275. var isDesktop = function isDesktop() {
  276. return window.innerWidth >= 992;
  277. };
  278. var containerClass = (0,vue__WEBPACK_IMPORTED_MODULE_0__.computed)(function () {
  279. return ['layout-wrapper', {
  280. 'layout-static-sidebar-inactive': staticMenuInactive.value,
  281. 'layout-mobile-sidebar-active': mobileMenuActive.value
  282. }];
  283. });
  284. var onWrapperClick = function onWrapperClick() {
  285. if (!menuClick.value) {
  286. mobileMenuActive.value = false;
  287. }
  288. menuClick.value = false;
  289. };
  290. var onMenuToggle = function onMenuToggle(event) {
  291. menuClick.value = true;
  292. if (isDesktop()) {
  293. staticMenuInactive.value = !staticMenuInactive.value;
  294. } else {
  295. mobileMenuActive.value = !mobileMenuActive.value;
  296. }
  297. event.preventDefault();
  298. };
  299. var __returned__ = {
  300. mobileMenuActive: mobileMenuActive,
  301. staticMenuInactive: staticMenuInactive,
  302. menuClick: menuClick,
  303. isDesktop: isDesktop,
  304. containerClass: containerClass,
  305. onWrapperClick: onWrapperClick,
  306. onMenuToggle: onMenuToggle,
  307. ref: vue__WEBPACK_IMPORTED_MODULE_0__.ref,
  308. computed: vue__WEBPACK_IMPORTED_MODULE_0__.computed,
  309. Head: _inertiajs_inertia_vue3__WEBPACK_IMPORTED_MODULE_1__.Head,
  310. menu: _utils_menu__WEBPACK_IMPORTED_MODULE_2__["default"],
  311. AppMessage: _components_AppMessage_vue__WEBPACK_IMPORTED_MODULE_3__["default"],
  312. TopBar: _Components_TopBar_vue__WEBPACK_IMPORTED_MODULE_4__["default"],
  313. Sidebar: _Components_Sidebar_vue__WEBPACK_IMPORTED_MODULE_5__["default"],
  314. Footer: _Components_Footer_vue__WEBPACK_IMPORTED_MODULE_6__["default"]
  315. };
  316. Object.defineProperty(__returned__, '__isScriptSetup', {
  317. enumerable: false,
  318. value: true
  319. });
  320. return __returned__;
  321. }
  322. });
  323. /***/ }),
  324. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/pages/Sales/Index.vue?vue&type=script&setup=true&lang=js":
  325. /*!***********************************************************************************************************************************************************************************************************!*\
  326. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/pages/Sales/Index.vue?vue&type=script&setup=true&lang=js ***!
  327. \***********************************************************************************************************************************************************************************************************/
  328. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  329. "use strict";
  330. __webpack_require__.r(__webpack_exports__);
  331. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  332. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  333. /* harmony export */ });
  334. /* harmony import */ var _config__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./config */ "./resources/js/pages/Sales/config.js");
  335. /* harmony import */ var _components_AppSearch_vue__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @/components/AppSearch.vue */ "./resources/js/components/AppSearch.vue");
  336. /* harmony import */ var _components_AppButtonLink_vue__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @/components/AppButtonLink.vue */ "./resources/js/components/AppButtonLink.vue");
  337. /* harmony import */ var _components_AppPagination_vue__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @/components/AppPagination.vue */ "./resources/js/components/AppPagination.vue");
  338. /* harmony import */ var _layouts_Dashboard_DashboardLayout_vue__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @/layouts/Dashboard/DashboardLayout.vue */ "./resources/js/layouts/Dashboard/DashboardLayout.vue");
  339. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
  340. __name: 'Index',
  341. props: {
  342. sales: Object,
  343. initialSearch: String
  344. },
  345. setup: function setup(__props, _ref) {
  346. var expose = _ref.expose;
  347. expose();
  348. var __returned__ = {
  349. indexTable: _config__WEBPACK_IMPORTED_MODULE_0__.indexTable,
  350. AppSearch: _components_AppSearch_vue__WEBPACK_IMPORTED_MODULE_1__["default"],
  351. AppButtonLink: _components_AppButtonLink_vue__WEBPACK_IMPORTED_MODULE_2__["default"],
  352. AppPagination: _components_AppPagination_vue__WEBPACK_IMPORTED_MODULE_3__["default"],
  353. DashboardLayout: _layouts_Dashboard_DashboardLayout_vue__WEBPACK_IMPORTED_MODULE_4__["default"]
  354. };
  355. Object.defineProperty(__returned__, '__isScriptSetup', {
  356. enumerable: false,
  357. value: true
  358. });
  359. return __returned__;
  360. }
  361. });
  362. /***/ }),
  363. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.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":
  364. /*!***********************************************************************************************************************************************************************************************************************************************************************************!*\
  365. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.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 ***!
  366. \***********************************************************************************************************************************************************************************************************************************************************************************/
  367. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  368. "use strict";
  369. __webpack_require__.r(__webpack_exports__);
  370. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  371. /* harmony export */ "render": () => (/* binding */ render)
  372. /* harmony export */ });
  373. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  374. var _hoisted_1 = {
  375. key: 1,
  376. "class": "p-button-label"
  377. };
  378. var _hoisted_2 = {
  379. key: 1,
  380. "class": "p-button p-component"
  381. };
  382. var _hoisted_3 = {
  383. key: 1,
  384. "class": "p-button-label"
  385. };
  386. function render(_ctx, _cache, $props, $setup, $data, $options) {
  387. return $props.inertiaLink ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createBlock)($setup["Link"], {
  388. key: 0,
  389. "class": "p-button p-component",
  390. as: "button",
  391. type: "button"
  392. }, {
  393. "default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  394. return [$props.icon ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)("span", {
  395. key: 0,
  396. "class": (0,vue__WEBPACK_IMPORTED_MODULE_0__.normalizeClass)(["p-button-icon p-button-icon-left", $props.icon])
  397. }, null, 2
  398. /* CLASS */
  399. )) : (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
  400. /* TEXT */
  401. )) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true)];
  402. }),
  403. _: 1
  404. /* STABLE */
  405. })) : ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)("a", _hoisted_2, [$props.icon ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)("span", {
  406. key: 0,
  407. "class": (0,vue__WEBPACK_IMPORTED_MODULE_0__.normalizeClass)(["p-button-icon p-button-icon-left", $props.icon])
  408. }, null, 2
  409. /* CLASS */
  410. )) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true), $props.label ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)("span", _hoisted_3, (0,vue__WEBPACK_IMPORTED_MODULE_0__.toDisplayString)($props.label), 1
  411. /* TEXT */
  412. )) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true)]));
  413. }
  414. /***/ }),
  415. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.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":
  416. /*!********************************************************************************************************************************************************************************************************************************************************************************!*\
  417. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.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 ***!
  418. \********************************************************************************************************************************************************************************************************************************************************************************/
  419. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  420. "use strict";
  421. __webpack_require__.r(__webpack_exports__);
  422. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  423. /* harmony export */ "render": () => (/* binding */ render)
  424. /* harmony export */ });
  425. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  426. var _hoisted_1 = {
  427. key: 0
  428. };
  429. var _hoisted_2 = {
  430. key: 1
  431. };
  432. function render(_ctx, _cache, $props, $setup, $data, $options) {
  433. var _component_Message = (0,vue__WEBPACK_IMPORTED_MODULE_0__.resolveComponent)("Message");
  434. 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, {
  435. key: 0,
  436. severity: "success",
  437. onClose: $setup.onClose
  438. }, {
  439. "default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  440. return [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createTextVNode)((0,vue__WEBPACK_IMPORTED_MODULE_0__.toDisplayString)(_ctx.$page.props.flash.success), 1
  441. /* TEXT */
  442. )];
  443. }),
  444. _: 1
  445. /* STABLE */
  446. })) : (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, {
  447. key: 1,
  448. severity: "error",
  449. onClose: $setup.onClose
  450. }, {
  451. "default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  452. return [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createTextVNode)((0,vue__WEBPACK_IMPORTED_MODULE_0__.toDisplayString)(_ctx.$page.props.flash.error), 1
  453. /* TEXT */
  454. )];
  455. }),
  456. _: 1
  457. /* STABLE */
  458. })) : (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, {
  459. key: 2,
  460. severity: "error",
  461. onClose: $setup.onClose
  462. }, {
  463. "default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  464. 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
  465. /* TEXT */
  466. ))];
  467. }),
  468. _: 1
  469. /* STABLE */
  470. })) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true)], 64
  471. /* STABLE_FRAGMENT */
  472. );
  473. }
  474. /***/ }),
  475. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.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":
  476. /*!***********************************************************************************************************************************************************************************************************************************************************************************!*\
  477. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.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 ***!
  478. \***********************************************************************************************************************************************************************************************************************************************************************************/
  479. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  480. "use strict";
  481. __webpack_require__.r(__webpack_exports__);
  482. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  483. /* harmony export */ "render": () => (/* binding */ render)
  484. /* harmony export */ });
  485. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  486. var _hoisted_1 = {
  487. key: 0,
  488. "class": "p-paginator p-component flex justify-content-start"
  489. };
  490. var _hoisted_2 = {
  491. "class": "p-paginator-pages"
  492. };
  493. var _hoisted_3 = ["innerHTML"];
  494. function render(_ctx, _cache, $props, $setup, $data, $options) {
  495. 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) {
  496. 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", {
  497. key: "link-".concat(key),
  498. "class": (0,vue__WEBPACK_IMPORTED_MODULE_0__.normalizeClass)(["p-paginator-page p-paginator-element p-link", {
  499. 'p-disabled': link
  500. }]),
  501. innerHTML: link.label
  502. }, null, 10
  503. /* CLASS, PROPS */
  504. , _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"], {
  505. key: "link-".concat(key),
  506. href: link.url,
  507. "class": (0,vue__WEBPACK_IMPORTED_MODULE_0__.normalizeClass)([{
  508. 'p-highlight': link.active
  509. }, "p-paginator-page p-paginator-element p-link"]),
  510. innerHTML: link.label
  511. }, null, 8
  512. /* PROPS */
  513. , ["href", "class", "innerHTML"])) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true)], 64
  514. /* STABLE_FRAGMENT */
  515. );
  516. }), 256
  517. /* UNKEYED_FRAGMENT */
  518. ))])])) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true);
  519. }
  520. /***/ }),
  521. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppSearch.vue?vue&type=template&id=5b9fdcce":
  522. /*!*******************************************************************************************************************************************************************************************************************************************************************************!*\
  523. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppSearch.vue?vue&type=template&id=5b9fdcce ***!
  524. \*******************************************************************************************************************************************************************************************************************************************************************************/
  525. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  526. "use strict";
  527. __webpack_require__.r(__webpack_exports__);
  528. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  529. /* harmony export */ "render": () => (/* binding */ render)
  530. /* harmony export */ });
  531. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  532. function render(_ctx, _cache, $props, $setup, $data, $options) {
  533. var _component_InputText = (0,vue__WEBPACK_IMPORTED_MODULE_0__.resolveComponent)("InputText");
  534. return (0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createBlock)(_component_InputText, {
  535. modelValue: $setup.search,
  536. "onUpdate:modelValue": _cache[0] || (_cache[0] = function ($event) {
  537. return $setup.search = $event;
  538. })
  539. }, null, 8
  540. /* PROPS */
  541. , ["modelValue"]);
  542. }
  543. /***/ }),
  544. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/layouts/Dashboard/Components/Footer.vue?vue&type=template&id=dbb3aa76":
  545. /*!**********************************************************************************************************************************************************************************************************************************************************************************************!*\
  546. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/layouts/Dashboard/Components/Footer.vue?vue&type=template&id=dbb3aa76 ***!
  547. \**********************************************************************************************************************************************************************************************************************************************************************************************/
  548. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  549. "use strict";
  550. __webpack_require__.r(__webpack_exports__);
  551. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  552. /* harmony export */ "render": () => (/* binding */ render)
  553. /* harmony export */ });
  554. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  555. var _hoisted_1 = {
  556. "class": "layout-footer"
  557. };
  558. var _hoisted_2 = /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createTextVNode)(" Developed by ");
  559. var _hoisted_3 = /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("a", {
  560. href: "https://dijitalcode.com",
  561. target: "_blank",
  562. "class": "font-medium ml-2"
  563. }, " DijitalCODE ", -1
  564. /* HOISTED */
  565. );
  566. var _hoisted_4 = [_hoisted_2, _hoisted_3];
  567. function render(_ctx, _cache) {
  568. return (0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)("footer", _hoisted_1, _hoisted_4);
  569. }
  570. /***/ }),
  571. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/layouts/Dashboard/Components/Sidebar.vue?vue&type=template&id=5b49aa22&scoped=true":
  572. /*!***********************************************************************************************************************************************************************************************************************************************************************************************************!*\
  573. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/layouts/Dashboard/Components/Sidebar.vue?vue&type=template&id=5b49aa22&scoped=true ***!
  574. \***********************************************************************************************************************************************************************************************************************************************************************************************************/
  575. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  576. "use strict";
  577. __webpack_require__.r(__webpack_exports__);
  578. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  579. /* harmony export */ "render": () => (/* binding */ render)
  580. /* harmony export */ });
  581. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  582. function render(_ctx, _cache, $props, $setup, $data, $options) {
  583. return (0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)("div", null, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)($setup["SubSidebar"], {
  584. "class": "layout-menu",
  585. items: $props.menu,
  586. root: true
  587. }, null, 8
  588. /* PROPS */
  589. , ["items"])]);
  590. }
  591. /***/ }),
  592. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/layouts/Dashboard/Components/SubSidebar.vue?vue&type=template&id=b1b23eb4&scoped=true":
  593. /*!**************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  594. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/layouts/Dashboard/Components/SubSidebar.vue?vue&type=template&id=b1b23eb4&scoped=true ***!
  595. \**************************************************************************************************************************************************************************************************************************************************************************************************************/
  596. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  597. "use strict";
  598. __webpack_require__.r(__webpack_exports__);
  599. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  600. /* harmony export */ "render": () => (/* binding */ render)
  601. /* harmony export */ });
  602. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  603. var _withScopeId = function _withScopeId(n) {
  604. return (0,vue__WEBPACK_IMPORTED_MODULE_0__.pushScopeId)("data-v-b1b23eb4"), n = n(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.popScopeId)(), n;
  605. };
  606. var _hoisted_1 = {
  607. key: 0
  608. };
  609. var _hoisted_2 = ["aria-label"];
  610. var _hoisted_3 = ["aria-label"];
  611. function render(_ctx, _cache, $props, $setup, $data, $options) {
  612. var _component_SubSidebar = (0,vue__WEBPACK_IMPORTED_MODULE_0__.resolveComponent)("SubSidebar", true);
  613. 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) {
  614. 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", {
  615. key: i,
  616. "class": (0,vue__WEBPACK_IMPORTED_MODULE_0__.normalizeClass)([{
  617. 'layout-menuitem-category': $props.root
  618. }]),
  619. role: "none"
  620. }, [$props.root ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)(vue__WEBPACK_IMPORTED_MODULE_0__.Fragment, {
  621. key: 0
  622. }, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("div", {
  623. "class": "layout-menuitem-root-text",
  624. "aria-label": item.label
  625. }, (0,vue__WEBPACK_IMPORTED_MODULE_0__.toDisplayString)(item.label), 9
  626. /* TEXT, PROPS */
  627. , _hoisted_2), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(_component_SubSidebar, {
  628. items: item.items
  629. }, null, 8
  630. /* PROPS */
  631. , ["items"])], 64
  632. /* STABLE_FRAGMENT */
  633. )) : ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)(vue__WEBPACK_IMPORTED_MODULE_0__.Fragment, {
  634. key: 1
  635. }, [item.to ? ((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createBlock)($setup["Link"], {
  636. key: 0,
  637. role: "menuitem",
  638. href: item.to,
  639. "class": (0,vue__WEBPACK_IMPORTED_MODULE_0__.normalizeClass)([{
  640. 'router-link-active': _ctx.$page.component.startsWith(item.component) || _ctx.$page.url.startsWith(item.to),
  641. 'router-link-exact-active': _ctx.$page.component.startsWith(item.component) || _ctx.$page.url.startsWith(item.to)
  642. }]),
  643. "aria-label": item.label
  644. }, {
  645. "default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  646. return [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("i", {
  647. "class": (0,vue__WEBPACK_IMPORTED_MODULE_0__.normalizeClass)(item.icon)
  648. }, null, 2
  649. /* CLASS */
  650. ), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("span", null, (0,vue__WEBPACK_IMPORTED_MODULE_0__.toDisplayString)(item.label), 1
  651. /* TEXT */
  652. )];
  653. }),
  654. _: 2
  655. /* DYNAMIC */
  656. }, 1032
  657. /* PROPS, DYNAMIC_SLOTS */
  658. , ["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", {
  659. key: 1,
  660. href: "#",
  661. role: "menuitem",
  662. "aria-label": item.label
  663. }, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("i", {
  664. "class": (0,vue__WEBPACK_IMPORTED_MODULE_0__.normalizeClass)(item.icon)
  665. }, null, 2
  666. /* CLASS */
  667. ), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("span", null, (0,vue__WEBPACK_IMPORTED_MODULE_0__.toDisplayString)(item.label), 1
  668. /* TEXT */
  669. )], 8
  670. /* PROPS */
  671. , _hoisted_3)) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(_component_SubSidebar, {
  672. items: item.items
  673. }, null, 8
  674. /* PROPS */
  675. , ["items"])], 64
  676. /* STABLE_FRAGMENT */
  677. ))], 2
  678. /* CLASS */
  679. )) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true)], 64
  680. /* STABLE_FRAGMENT */
  681. );
  682. }), 256
  683. /* UNKEYED_FRAGMENT */
  684. ))])) : (0,vue__WEBPACK_IMPORTED_MODULE_0__.createCommentVNode)("v-if", true);
  685. }
  686. /***/ }),
  687. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/layouts/Dashboard/Components/TopBar.vue?vue&type=template&id=0b7edbb0&scoped=true":
  688. /*!**********************************************************************************************************************************************************************************************************************************************************************************************************!*\
  689. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/layouts/Dashboard/Components/TopBar.vue?vue&type=template&id=0b7edbb0&scoped=true ***!
  690. \**********************************************************************************************************************************************************************************************************************************************************************************************************/
  691. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  692. "use strict";
  693. __webpack_require__.r(__webpack_exports__);
  694. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  695. /* harmony export */ "render": () => (/* binding */ render)
  696. /* harmony export */ });
  697. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  698. var _withScopeId = function _withScopeId(n) {
  699. return (0,vue__WEBPACK_IMPORTED_MODULE_0__.pushScopeId)("data-v-0b7edbb0"), n = n(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.popScopeId)(), n;
  700. };
  701. var _hoisted_1 = {
  702. "class": "layout-topbar"
  703. };
  704. var _hoisted_2 = /*#__PURE__*/_withScopeId(function () {
  705. return /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("img", {
  706. alt: "Brand Logo",
  707. src: "/images/logo.svg",
  708. "class": "md:mr-3"
  709. }, null, -1
  710. /* HOISTED */
  711. );
  712. });
  713. var _hoisted_3 = /*#__PURE__*/_withScopeId(function () {
  714. return /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("span", null, "Cahaya Agung", -1
  715. /* HOISTED */
  716. );
  717. });
  718. var _hoisted_4 = /*#__PURE__*/_withScopeId(function () {
  719. return /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("i", {
  720. "class": "pi pi-bars"
  721. }, null, -1
  722. /* HOISTED */
  723. );
  724. });
  725. var _hoisted_5 = [_hoisted_4];
  726. var _hoisted_6 = {
  727. "class": "p-link layout-topbar-menu-button layout-topbar-button"
  728. };
  729. var _hoisted_7 = /*#__PURE__*/_withScopeId(function () {
  730. return /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("i", {
  731. "class": "pi pi-ellipsis-v"
  732. }, null, -1
  733. /* HOISTED */
  734. );
  735. });
  736. var _hoisted_8 = [_hoisted_7];
  737. var _hoisted_9 = {
  738. "class": "layout-topbar-menu hidden lg:flex origin-top"
  739. };
  740. var _hoisted_10 = {
  741. "class": "align-self-center"
  742. };
  743. var _hoisted_11 = {
  744. "class": "hidden lg:inline"
  745. };
  746. var _hoisted_12 = /*#__PURE__*/_withScopeId(function () {
  747. return /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("i", {
  748. "class": "pi pi-user"
  749. }, null, -1
  750. /* HOISTED */
  751. );
  752. });
  753. var _hoisted_13 = /*#__PURE__*/_withScopeId(function () {
  754. return /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("span", null, "Ubah Profil", -1
  755. /* HOISTED */
  756. );
  757. });
  758. var _hoisted_14 = /*#__PURE__*/_withScopeId(function () {
  759. return /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("i", {
  760. "class": "pi pi-sign-out"
  761. }, null, -1
  762. /* HOISTED */
  763. );
  764. });
  765. var _hoisted_15 = /*#__PURE__*/_withScopeId(function () {
  766. return /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("span", null, "Keluar", -1
  767. /* HOISTED */
  768. );
  769. });
  770. function render(_ctx, _cache, $props, $setup, $data, $options) {
  771. var _directive_styleclass = (0,vue__WEBPACK_IMPORTED_MODULE_0__.resolveDirective)("styleclass");
  772. var _directive_tooltip = (0,vue__WEBPACK_IMPORTED_MODULE_0__.resolveDirective)("tooltip");
  773. 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"], {
  774. href: "/",
  775. "class": "layout-topbar-logo"
  776. }, {
  777. "default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  778. return [_hoisted_2, _hoisted_3];
  779. }),
  780. _: 1
  781. /* STABLE */
  782. }), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("button", {
  783. "class": "p-link layout-menu-button layout-topbar-button",
  784. onClick: _cache[0] || (_cache[0] = function ($event) {
  785. return _ctx.$emit('menu-toggle', $event);
  786. })
  787. }, _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, {
  788. selector: '@next',
  789. enterClass: 'hidden',
  790. enterActiveClass: 'scalein',
  791. leaveToClass: 'hidden',
  792. leaveActiveClass: 'fadeout',
  793. hideOnOutsideClick: true
  794. }]]), (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
  795. /* TEXT */
  796. )]), (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"], {
  797. href: _ctx.route('users.show', _ctx.$page.props.auth.user.id),
  798. "class": "p-link layout-topbar-button"
  799. }, {
  800. "default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  801. return [_hoisted_12, _hoisted_13];
  802. }),
  803. _: 1
  804. /* STABLE */
  805. }, 8
  806. /* PROPS */
  807. , ["href"])), [[_directive_tooltip, {
  808. value: 'Ubah Profil',
  809. "class": 'layout-topbar-menu-tooltip'
  810. }, void 0, {
  811. bottom: true
  812. }]])]), (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"], {
  813. href: _ctx.route('logout'),
  814. as: "button",
  815. method: "post",
  816. "class": "p-link layout-topbar-button"
  817. }, {
  818. "default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  819. return [_hoisted_14, _hoisted_15];
  820. }),
  821. _: 1
  822. /* STABLE */
  823. }, 8
  824. /* PROPS */
  825. , ["href"])), [[_directive_tooltip, {
  826. value: 'Keluar',
  827. "class": 'layout-topbar-menu-tooltip'
  828. }, void 0, {
  829. bottom: true
  830. }]])])])]);
  831. }
  832. /***/ }),
  833. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/layouts/Dashboard/DashboardLayout.vue?vue&type=template&id=1d279fe2&scoped=true":
  834. /*!********************************************************************************************************************************************************************************************************************************************************************************************************!*\
  835. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/layouts/Dashboard/DashboardLayout.vue?vue&type=template&id=1d279fe2&scoped=true ***!
  836. \********************************************************************************************************************************************************************************************************************************************************************************************************/
  837. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  838. "use strict";
  839. __webpack_require__.r(__webpack_exports__);
  840. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  841. /* harmony export */ "render": () => (/* binding */ render)
  842. /* harmony export */ });
  843. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  844. var _withScopeId = function _withScopeId(n) {
  845. return (0,vue__WEBPACK_IMPORTED_MODULE_0__.pushScopeId)("data-v-1d279fe2"), n = n(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.popScopeId)(), n;
  846. };
  847. var _hoisted_1 = {
  848. "class": "layout-sidebar"
  849. };
  850. var _hoisted_2 = {
  851. "class": "layout-main-container"
  852. };
  853. var _hoisted_3 = {
  854. "class": "layout-main"
  855. };
  856. var _hoisted_4 = {
  857. key: 0,
  858. "class": "layout-mask p-component-overlay"
  859. };
  860. function render(_ctx, _cache, $props, $setup, $data, $options) {
  861. 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"], {
  862. title: $props.title
  863. }, null, 8
  864. /* PROPS */
  865. , ["title"]), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("div", {
  866. "class": (0,vue__WEBPACK_IMPORTED_MODULE_0__.normalizeClass)($setup.containerClass),
  867. onClick: $setup.onWrapperClick
  868. }, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)($setup["TopBar"], {
  869. onMenuToggle: $setup.onMenuToggle
  870. }), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("nav", _hoisted_1, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)($setup["Sidebar"], {
  871. menu: $setup.menu[_ctx.$page.props.auth.user.role_id]
  872. }, null, 8
  873. /* PROPS */
  874. , ["menu"])]), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("div", _hoisted_2, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("main", _hoisted_3, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)($setup["AppMessage"]), (0,vue__WEBPACK_IMPORTED_MODULE_0__.renderSlot)(_ctx.$slots, "default", {}, undefined, true)]), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)($setup["Footer"])]), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(vue__WEBPACK_IMPORTED_MODULE_0__.Transition, {
  875. name: "layout-mask"
  876. }, {
  877. "default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  878. 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)];
  879. }),
  880. _: 1
  881. /* STABLE */
  882. })], 2
  883. /* CLASS */
  884. )], 64
  885. /* STABLE_FRAGMENT */
  886. );
  887. }
  888. /***/ }),
  889. /***/ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.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/Sales/Index.vue?vue&type=template&id=7c234776":
  890. /*!****************************************************************************************************************************************************************************************************************************************************************************!*\
  891. !*** ./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.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/Sales/Index.vue?vue&type=template&id=7c234776 ***!
  892. \****************************************************************************************************************************************************************************************************************************************************************************/
  893. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  894. "use strict";
  895. __webpack_require__.r(__webpack_exports__);
  896. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  897. /* harmony export */ "render": () => (/* binding */ render)
  898. /* harmony export */ });
  899. /* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.esm-bundler.js");
  900. var _hoisted_1 = /*#__PURE__*/(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("h1", null, "Penjualan", -1
  901. /* HOISTED */
  902. );
  903. var _hoisted_2 = {
  904. "class": "grid"
  905. };
  906. var _hoisted_3 = {
  907. "class": "col-12 md:col-8"
  908. };
  909. var _hoisted_4 = {
  910. "class": "flex align-items-center"
  911. };
  912. var _hoisted_5 = {
  913. "class": "col-12 md:col-4 flex flex-column md:flex-row justify-content-end"
  914. };
  915. function render(_ctx, _cache, $props, $setup, $data, $options) {
  916. var _component_Column = (0,vue__WEBPACK_IMPORTED_MODULE_0__.resolveComponent)("Column");
  917. var _component_DataTable = (0,vue__WEBPACK_IMPORTED_MODULE_0__.resolveComponent)("DataTable");
  918. var _directive_tooltip = (0,vue__WEBPACK_IMPORTED_MODULE_0__.resolveDirective)("tooltip");
  919. return (0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createBlock)($setup["DashboardLayout"], {
  920. title: "Daftar Penjualan"
  921. }, {
  922. "default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  923. return [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(_component_DataTable, {
  924. responsiveLayout: "scroll",
  925. columnResizeMode: "expand",
  926. value: $props.sales.data,
  927. rowHover: true,
  928. stripedRows: true
  929. }, {
  930. header: (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  931. return [_hoisted_1, (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("div", _hoisted_2, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("div", _hoisted_3, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("div", _hoisted_4, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)($setup["AppSearch"], {
  932. "class": "w-full md:w-27rem",
  933. placeholder: "cari, contoh: P0xx, Pending, Success",
  934. url: "/sales",
  935. "initial-search": $props.initialSearch
  936. }, null, 8
  937. /* PROPS */
  938. , ["initial-search"])])]), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementVNode)("div", _hoisted_5, [(0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)($setup["AppButtonLink"], {
  939. label: "Tambah Penjualan",
  940. icon: "pi pi-pencil",
  941. "class": "p-button-outlined",
  942. href: _ctx.route('sales.create')
  943. }, null, 8
  944. /* PROPS */
  945. , ["href"])])])];
  946. }),
  947. "default": (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function () {
  948. return [((0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(true), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createElementBlock)(vue__WEBPACK_IMPORTED_MODULE_0__.Fragment, null, (0,vue__WEBPACK_IMPORTED_MODULE_0__.renderList)($setup.indexTable, function (value) {
  949. return (0,vue__WEBPACK_IMPORTED_MODULE_0__.openBlock)(), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createBlock)(_component_Column, {
  950. field: value.field,
  951. header: value.header,
  952. key: value.field
  953. }, null, 8
  954. /* PROPS */
  955. , ["field", "header"]);
  956. }), 128
  957. /* KEYED_FRAGMENT */
  958. )), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)(_component_Column, null, {
  959. body: (0,vue__WEBPACK_IMPORTED_MODULE_0__.withCtx)(function (_ref) {
  960. var data = _ref.data;
  961. return [(0,vue__WEBPACK_IMPORTED_MODULE_0__.withDirectives)((0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)($setup["AppButtonLink"], {
  962. icon: "pi pi-pencil",
  963. "class": "p-button-icon-only p-button-rounded p-button-text",
  964. href: _ctx.route('sales.edit', data.id)
  965. }, null, 8
  966. /* PROPS */
  967. , ["href"]), [[_directive_tooltip, 'Ubah Penjualan', void 0, {
  968. bottom: true
  969. }]])];
  970. }),
  971. _: 1
  972. /* STABLE */
  973. })];
  974. }),
  975. _: 1
  976. /* STABLE */
  977. }, 8
  978. /* PROPS */
  979. , ["value"]), (0,vue__WEBPACK_IMPORTED_MODULE_0__.createVNode)($setup["AppPagination"], {
  980. links: $props.sales.links
  981. }, null, 8
  982. /* PROPS */
  983. , ["links"])];
  984. }),
  985. _: 1
  986. /* STABLE */
  987. });
  988. }
  989. /***/ }),
  990. /***/ "./resources/js/pages/Sales/config.js":
  991. /*!********************************************!*\
  992. !*** ./resources/js/pages/Sales/config.js ***!
  993. \********************************************/
  994. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  995. "use strict";
  996. __webpack_require__.r(__webpack_exports__);
  997. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  998. /* harmony export */ "dialogStyle": () => (/* binding */ dialogStyle),
  999. /* harmony export */ "indexTable": () => (/* binding */ indexTable),
  1000. /* harmony export */ "optionStatus": () => (/* binding */ optionStatus)
  1001. /* harmony export */ });
  1002. var optionStatus = [{
  1003. label: 'pending',
  1004. value: 'pending'
  1005. }, {
  1006. label: 'success',
  1007. value: 'success'
  1008. }];
  1009. var indexTable = [{
  1010. field: 'updatedAt',
  1011. header: 'Tanggal'
  1012. }, {
  1013. field: 'number',
  1014. header: 'Nomor Penjualan'
  1015. }, {
  1016. field: 'status',
  1017. header: 'Status'
  1018. }, {
  1019. field: 'price',
  1020. header: 'Harga'
  1021. }, {
  1022. field: 'qty',
  1023. header: 'Kuantitas'
  1024. }, {
  1025. field: 'ppn',
  1026. header: 'PPN'
  1027. }, {
  1028. field: 'productName',
  1029. header: 'Nama Produk'
  1030. }, {
  1031. field: 'productNumber',
  1032. header: 'Nomor Produk'
  1033. }];
  1034. var dialogStyle = {
  1035. style: {
  1036. width: '50vw'
  1037. },
  1038. breakpoints: {
  1039. '960px': '75vw',
  1040. '640px': '90vw'
  1041. },
  1042. modal: true
  1043. };
  1044. /***/ }),
  1045. /***/ "./resources/js/utils/menu.js":
  1046. /*!************************************!*\
  1047. !*** ./resources/js/utils/menu.js ***!
  1048. \************************************/
  1049. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  1050. "use strict";
  1051. __webpack_require__.r(__webpack_exports__);
  1052. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  1053. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  1054. /* harmony export */ });
  1055. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
  1056. // Admin
  1057. 1: [{
  1058. label: 'Home',
  1059. items: [{
  1060. label: 'Dashboard',
  1061. icon: 'pi pi-chart-bar',
  1062. to: '/dashboards',
  1063. component: 'Dashboards/Index'
  1064. }]
  1065. }, {
  1066. label: 'Laporan',
  1067. items: []
  1068. }, {
  1069. label: 'Master',
  1070. items: [{
  1071. label: 'User',
  1072. icon: 'pi pi-user',
  1073. to: '/users',
  1074. component: 'Users/Index'
  1075. }]
  1076. }, {
  1077. label: 'Pengaturan',
  1078. items: [{
  1079. label: 'PPN',
  1080. icon: 'pi pi-percentage',
  1081. to: '/ppn',
  1082. component: 'PPN/Index'
  1083. }]
  1084. }],
  1085. // Supervisor
  1086. 2: [{
  1087. label: 'Home',
  1088. items: [{
  1089. label: 'Dashboard',
  1090. icon: 'pi pi-chart-bar',
  1091. to: '/dashboards',
  1092. component: 'Dashboards/Index'
  1093. }]
  1094. }, {
  1095. label: 'Master',
  1096. items: [{
  1097. label: 'Pelanggan',
  1098. icon: 'pi pi-users',
  1099. to: '/customers',
  1100. component: 'Customers/Index'
  1101. }, {
  1102. label: 'Pembelian',
  1103. icon: 'pi pi-shopping-cart',
  1104. to: '/purchases',
  1105. component: 'Purchases/Index'
  1106. }, {
  1107. label: 'Penjualan',
  1108. icon: 'pi pi-tag',
  1109. to: '/sales',
  1110. component: 'Sales/Index'
  1111. }, {
  1112. label: 'Produk',
  1113. icon: 'pi pi-th-large',
  1114. to: '/products',
  1115. component: 'Products/Index'
  1116. }]
  1117. }],
  1118. // Operator
  1119. 3: [{
  1120. label: 'Home',
  1121. items: [{
  1122. label: 'Dashboard',
  1123. icon: 'pi pi-chart-bar',
  1124. to: '/dashboards',
  1125. component: 'Dashboards/Index'
  1126. }]
  1127. }, {
  1128. label: 'Master',
  1129. items: [{
  1130. label: 'Supplier',
  1131. icon: 'pi pi-shopping-cart',
  1132. to: '/suppliers',
  1133. component: 'Suppliers/Index'
  1134. }, {
  1135. label: 'Stok Barang',
  1136. icon: 'pi pi-box',
  1137. to: '/stock-products',
  1138. component: 'StockProducts/Index'
  1139. }]
  1140. }]
  1141. });
  1142. /***/ }),
  1143. /***/ "./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/layouts/Dashboard/Components/Sidebar.vue?vue&type=style&index=0&id=5b49aa22&lang=scss&scoped=true":
  1144. /*!***************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  1145. !*** ./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/layouts/Dashboard/Components/Sidebar.vue?vue&type=style&index=0&id=5b49aa22&lang=scss&scoped=true ***!
  1146. \***************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  1147. /***/ ((module, __webpack_exports__, __webpack_require__) => {
  1148. "use strict";
  1149. __webpack_require__.r(__webpack_exports__);
  1150. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  1151. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  1152. /* harmony export */ });
  1153. /* 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");
  1154. /* 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__);
  1155. // Imports
  1156. var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_0___default()(function(i){return i[1]});
  1157. // Module
  1158. ___CSS_LOADER_EXPORT___.push([module.id, ".layout-menu[data-v-5b49aa22] {\n list-style-type: none;\n margin: 0;\n padding: 0;\n}", ""]);
  1159. // Exports
  1160. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);
  1161. /***/ }),
  1162. /***/ "./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/layouts/Dashboard/Components/SubSidebar.vue?vue&type=style&index=0&id=b1b23eb4&lang=scss&scoped=true":
  1163. /*!******************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  1164. !*** ./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/layouts/Dashboard/Components/SubSidebar.vue?vue&type=style&index=0&id=b1b23eb4&lang=scss&scoped=true ***!
  1165. \******************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  1166. /***/ ((module, __webpack_exports__, __webpack_require__) => {
  1167. "use strict";
  1168. __webpack_require__.r(__webpack_exports__);
  1169. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  1170. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  1171. /* harmony export */ });
  1172. /* 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");
  1173. /* 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__);
  1174. // Imports
  1175. var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_0___default()(function(i){return i[1]});
  1176. // Module
  1177. ___CSS_LOADER_EXPORT___.push([module.id, "li.layout-menuitem-category[data-v-b1b23eb4] {\n margin-top: 0.75rem;\n}\nli.layout-menuitem-category[data-v-b1b23eb4]:first-child {\n margin-top: 0;\n}\nli .layout-menuitem-root-text[data-v-b1b23eb4] {\n text-transform: uppercase;\n color: var(--surface-900);\n font-weight: 600;\n margin-bottom: 0.5rem;\n font-size: 0.875rem;\n}\nli a[data-v-b1b23eb4] {\n cursor: pointer;\n text-decoration: none;\n display: flex;\n align-items: center;\n color: var(--text-color);\n transition: color 0.2s;\n border-radius: 12px;\n padding: 0.75rem 1rem;\n transition: background-color 0.15s;\n}\nli a span[data-v-b1b23eb4] {\n margin-left: 0.5rem;\n}\nli a .menuitem-toggle-icon[data-v-b1b23eb4] {\n margin-left: auto;\n}\nli a[data-v-b1b23eb4]:focus {\n outline: 0 none;\n outline-offset: 0;\n transition: box-shadow 0.2s;\n box-shadow: inset var(--focus-ring);\n}\nli a[data-v-b1b23eb4]:hover {\n background-color: var(--surface-hover);\n}\nli a.router-link-exact-active[data-v-b1b23eb4] {\n font-weight: 700;\n color: var(--primary-color);\n}\nli ul[data-v-b1b23eb4] {\n list-style-type: none;\n margin: 0;\n padding: 0;\n}\nli ul ul[data-v-b1b23eb4] {\n padding-left: 1rem;\n}", ""]);
  1178. // Exports
  1179. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);
  1180. /***/ }),
  1181. /***/ "./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/layouts/Dashboard/Components/TopBar.vue?vue&type=style&index=0&id=0b7edbb0&lang=scss&scoped=true":
  1182. /*!**************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  1183. !*** ./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/layouts/Dashboard/Components/TopBar.vue?vue&type=style&index=0&id=0b7edbb0&lang=scss&scoped=true ***!
  1184. \**************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  1185. /***/ ((module, __webpack_exports__, __webpack_require__) => {
  1186. "use strict";
  1187. __webpack_require__.r(__webpack_exports__);
  1188. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  1189. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  1190. /* harmony export */ });
  1191. /* 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");
  1192. /* 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__);
  1193. // Imports
  1194. var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_0___default()(function(i){return i[1]});
  1195. // Module
  1196. ___CSS_LOADER_EXPORT___.push([module.id, ".layout-topbar[data-v-0b7edbb0] {\n position: fixed;\n height: 5rem;\n z-index: 994;\n left: 0;\n top: 0;\n width: 100%;\n padding: 0 2rem;\n background-color: var(--surface-card);\n transition: left 0.2s;\n display: flex;\n align-items: center;\n box-shadow: 0px 3px 5px rgba(0, 0, 0, 0.02), 0px 0px 2px rgba(0, 0, 0, 0.05), 0px 1px 4px rgba(0, 0, 0, 0.08);\n}\n.layout-topbar .layout-topbar-logo[data-v-0b7edbb0] {\n display: flex;\n align-items: center;\n color: var(--surface-900);\n font-size: 1.5rem;\n font-weight: 500;\n width: 300px;\n border-radius: 12px;\n}\n.layout-topbar .layout-topbar-logo img[data-v-0b7edbb0] {\n height: 2.5rem;\n margin-right: 0.5rem;\n}\n.layout-topbar .layout-topbar-logo[data-v-0b7edbb0]:focus {\n outline: 0 none;\n outline-offset: 0;\n transition: box-shadow 0.2s;\n box-shadow: var(--focus-ring);\n}\n.layout-topbar .layout-topbar-button[data-v-0b7edbb0] {\n display: inline-flex;\n justify-content: center;\n align-items: center;\n position: relative;\n color: var(--text-color-secondary);\n border-radius: 50%;\n width: 3rem;\n height: 3rem;\n cursor: pointer;\n transition: background-color 0.2s;\n}\n.layout-topbar .layout-topbar-button[data-v-0b7edbb0]:hover {\n color: var(--text-color);\n background-color: var(--surface-hover);\n}\n.layout-topbar .layout-topbar-button[data-v-0b7edbb0]:focus {\n outline: 0 none;\n outline-offset: 0;\n transition: box-shadow 0.2s;\n box-shadow: var(--focus-ring);\n}\n.layout-topbar .layout-topbar-button i[data-v-0b7edbb0] {\n font-size: 1.5rem;\n}\n.layout-topbar .layout-topbar-button span[data-v-0b7edbb0] {\n font-size: 1rem;\n display: none;\n}\n.layout-topbar .layout-menu-button[data-v-0b7edbb0] {\n margin-left: 2rem;\n}\n.layout-topbar .layout-topbar-menu-button[data-v-0b7edbb0] {\n display: none;\n}\n.layout-topbar .layout-topbar-menu-button i[data-v-0b7edbb0] {\n font-size: 1.25rem;\n}\n.layout-topbar .layout-topbar-menu[data-v-0b7edbb0] {\n margin: 0 0 0 auto;\n padding: 0;\n list-style: none;\n display: flex;\n}\n.layout-topbar .layout-topbar-menu .layout-topbar-button[data-v-0b7edbb0] {\n margin-left: 1rem;\n}\n@media (max-width: 991px) {\n.layout-topbar[data-v-0b7edbb0] {\n justify-content: space-between;\n}\n.layout-topbar .layout-topbar-logo[data-v-0b7edbb0] {\n width: auto;\n order: 2;\n}\n.layout-topbar .layout-menu-button[data-v-0b7edbb0] {\n margin-left: 0;\n order: 1;\n}\n.layout-topbar .layout-topbar-menu-button[data-v-0b7edbb0] {\n display: inline-flex;\n margin-left: 0;\n order: 3;\n}\n.layout-topbar .layout-topbar-menu[data-v-0b7edbb0] {\n margin-left: 0;\n position: absolute;\n flex-direction: column;\n background-color: var(--surface-overlay);\n box-shadow: 0px 3px 5px rgba(0, 0, 0, 0.02), 0px 0px 2px rgba(0, 0, 0, 0.05), 0px 1px 4px rgba(0, 0, 0, 0.08);\n border-radius: 4px;\n padding: 1rem;\n right: 2rem;\n top: 5.5rem;\n min-width: 15rem;\n}\n.layout-topbar .layout-topbar-menu .layout-topbar-button[data-v-0b7edbb0] {\n margin-left: 0;\n display: flex;\n width: 100%;\n height: auto;\n justify-content: flex-start;\n border-radius: 12px;\n padding: 1rem;\n}\n.layout-topbar .layout-topbar-menu .layout-topbar-button i[data-v-0b7edbb0] {\n font-size: 1rem;\n margin-right: 0.5rem;\n}\n.layout-topbar .layout-topbar-menu .layout-topbar-button span[data-v-0b7edbb0] {\n font-weight: medium;\n display: block;\n}\n}", ""]);
  1197. // Exports
  1198. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);
  1199. /***/ }),
  1200. /***/ "./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/layouts/Dashboard/DashboardLayout.vue?vue&type=style&index=0&id=1d279fe2&lang=scss&scoped=true":
  1201. /*!************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  1202. !*** ./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/layouts/Dashboard/DashboardLayout.vue?vue&type=style&index=0&id=1d279fe2&lang=scss&scoped=true ***!
  1203. \************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  1204. /***/ ((module, __webpack_exports__, __webpack_require__) => {
  1205. "use strict";
  1206. __webpack_require__.r(__webpack_exports__);
  1207. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  1208. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  1209. /* harmony export */ });
  1210. /* 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");
  1211. /* 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__);
  1212. // Imports
  1213. var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_0___default()(function(i){return i[1]});
  1214. // Module
  1215. ___CSS_LOADER_EXPORT___.push([module.id, ".layout-sidebar[data-v-1d279fe2] {\n position: fixed;\n width: 300px;\n height: calc(100vh - 9rem);\n z-index: 996;\n overflow-y: auto;\n -webkit-user-select: none;\n -moz-user-select: none;\n -ms-user-select: none;\n user-select: none;\n top: 7rem;\n left: 2rem;\n transition: transform 0.2s, left 0.2s;\n background-color: var(--surface-overlay);\n border-radius: 4px;\n padding: 1.5rem;\n box-shadow: 0px 3px 5px rgba(0, 0, 0, 0.02), 0px 0px 2px rgba(0, 0, 0, 0.05), 0px 1px 4px rgba(0, 0, 0, 0.08);\n}\n.layout-main-container[data-v-1d279fe2] {\n display: flex;\n flex-direction: column;\n min-height: 100vh;\n justify-content: space-between;\n padding: 7rem 2rem 2rem 4rem;\n transition: margin-left 0.2s;\n}\n.layout-main[data-v-1d279fe2] {\n flex: 1 1 auto;\n}\n.layout-footer[data-v-1d279fe2] {\n transition: margin-left 0.2s;\n display: flex;\n align-items: center;\n justify-content: center;\n padding-top: 1rem;\n border-top: 1px solid var(--surface-border);\n}\n@media (min-width: 992px) {\n.layout-wrapper .layout-main-container[data-v-1d279fe2] {\n margin-left: 300px;\n}\n.layout-wrapper.layout-static-sidebar-inactive .layout-sidebar[data-v-1d279fe2] {\n transform: translateX(-100%);\n left: 0;\n}\n.layout-wrapper.layout-static-sidebar-inactive .layout-main-container[data-v-1d279fe2] {\n margin-left: 0;\n padding-left: 2rem;\n}\n.layout-wrapper .layout-mask[data-v-1d279fe2] {\n display: none;\n}\n}\n@media (max-width: 991px) {\n.layout-wrapper .layout-main-container[data-v-1d279fe2] {\n margin-left: 0;\n padding-left: 2rem;\n}\n.layout-wrapper .layout-sidebar[data-v-1d279fe2] {\n transform: translateX(-100%);\n left: 0;\n top: 0;\n height: 100vh;\n border-top-left-radius: 0;\n border-bottom-left-radius: 0;\n}\n.layout-wrapper .layout-mask[data-v-1d279fe2] {\n z-index: 995;\n background-color: var(--maskbg);\n}\n.layout-wrapper .layout-mask.layout-mask-enter-from[data-v-1d279fe2], .layout-wrapper .layout-mask.layout-mask-leave-to[data-v-1d279fe2] {\n background-color: transparent;\n}\n.layout-wrapper.layout-mobile-sidebar-active .layout-sidebar[data-v-1d279fe2] {\n transform: translateX(0);\n}\n.layout-wrapper.layout-mobile-sidebar-active .layout-mask[data-v-1d279fe2] {\n display: block;\n}\n}", ""]);
  1216. // Exports
  1217. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);
  1218. /***/ }),
  1219. /***/ "./node_modules/lodash/lodash.js":
  1220. /*!***************************************!*\
  1221. !*** ./node_modules/lodash/lodash.js ***!
  1222. \***************************************/
  1223. /***/ (function(module, exports, __webpack_require__) {
  1224. /* module decorator */ module = __webpack_require__.nmd(module);
  1225. var __WEBPACK_AMD_DEFINE_RESULT__;/**
  1226. * @license
  1227. * Lodash <https://lodash.com/>
  1228. * Copyright OpenJS Foundation and other contributors <https://openjsf.org/>
  1229. * Released under MIT license <https://lodash.com/license>
  1230. * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
  1231. * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
  1232. */
  1233. ;(function() {
  1234. /** Used as a safe reference for `undefined` in pre-ES5 environments. */
  1235. var undefined;
  1236. /** Used as the semantic version number. */
  1237. var VERSION = '4.17.21';
  1238. /** Used as the size to enable large array optimizations. */
  1239. var LARGE_ARRAY_SIZE = 200;
  1240. /** Error message constants. */
  1241. var CORE_ERROR_TEXT = 'Unsupported core-js use. Try https://npms.io/search?q=ponyfill.',
  1242. FUNC_ERROR_TEXT = 'Expected a function',
  1243. INVALID_TEMPL_VAR_ERROR_TEXT = 'Invalid `variable` option passed into `_.template`';
  1244. /** Used to stand-in for `undefined` hash values. */
  1245. var HASH_UNDEFINED = '__lodash_hash_undefined__';
  1246. /** Used as the maximum memoize cache size. */
  1247. var MAX_MEMOIZE_SIZE = 500;
  1248. /** Used as the internal argument placeholder. */
  1249. var PLACEHOLDER = '__lodash_placeholder__';
  1250. /** Used to compose bitmasks for cloning. */
  1251. var CLONE_DEEP_FLAG = 1,
  1252. CLONE_FLAT_FLAG = 2,
  1253. CLONE_SYMBOLS_FLAG = 4;
  1254. /** Used to compose bitmasks for value comparisons. */
  1255. var COMPARE_PARTIAL_FLAG = 1,
  1256. COMPARE_UNORDERED_FLAG = 2;
  1257. /** Used to compose bitmasks for function metadata. */
  1258. var WRAP_BIND_FLAG = 1,
  1259. WRAP_BIND_KEY_FLAG = 2,
  1260. WRAP_CURRY_BOUND_FLAG = 4,
  1261. WRAP_CURRY_FLAG = 8,
  1262. WRAP_CURRY_RIGHT_FLAG = 16,
  1263. WRAP_PARTIAL_FLAG = 32,
  1264. WRAP_PARTIAL_RIGHT_FLAG = 64,
  1265. WRAP_ARY_FLAG = 128,
  1266. WRAP_REARG_FLAG = 256,
  1267. WRAP_FLIP_FLAG = 512;
  1268. /** Used as default options for `_.truncate`. */
  1269. var DEFAULT_TRUNC_LENGTH = 30,
  1270. DEFAULT_TRUNC_OMISSION = '...';
  1271. /** Used to detect hot functions by number of calls within a span of milliseconds. */
  1272. var HOT_COUNT = 800,
  1273. HOT_SPAN = 16;
  1274. /** Used to indicate the type of lazy iteratees. */
  1275. var LAZY_FILTER_FLAG = 1,
  1276. LAZY_MAP_FLAG = 2,
  1277. LAZY_WHILE_FLAG = 3;
  1278. /** Used as references for various `Number` constants. */
  1279. var INFINITY = 1 / 0,
  1280. MAX_SAFE_INTEGER = 9007199254740991,
  1281. MAX_INTEGER = 1.7976931348623157e+308,
  1282. NAN = 0 / 0;
  1283. /** Used as references for the maximum length and index of an array. */
  1284. var MAX_ARRAY_LENGTH = 4294967295,
  1285. MAX_ARRAY_INDEX = MAX_ARRAY_LENGTH - 1,
  1286. HALF_MAX_ARRAY_LENGTH = MAX_ARRAY_LENGTH >>> 1;
  1287. /** Used to associate wrap methods with their bit flags. */
  1288. var wrapFlags = [
  1289. ['ary', WRAP_ARY_FLAG],
  1290. ['bind', WRAP_BIND_FLAG],
  1291. ['bindKey', WRAP_BIND_KEY_FLAG],
  1292. ['curry', WRAP_CURRY_FLAG],
  1293. ['curryRight', WRAP_CURRY_RIGHT_FLAG],
  1294. ['flip', WRAP_FLIP_FLAG],
  1295. ['partial', WRAP_PARTIAL_FLAG],
  1296. ['partialRight', WRAP_PARTIAL_RIGHT_FLAG],
  1297. ['rearg', WRAP_REARG_FLAG]
  1298. ];
  1299. /** `Object#toString` result references. */
  1300. var argsTag = '[object Arguments]',
  1301. arrayTag = '[object Array]',
  1302. asyncTag = '[object AsyncFunction]',
  1303. boolTag = '[object Boolean]',
  1304. dateTag = '[object Date]',
  1305. domExcTag = '[object DOMException]',
  1306. errorTag = '[object Error]',
  1307. funcTag = '[object Function]',
  1308. genTag = '[object GeneratorFunction]',
  1309. mapTag = '[object Map]',
  1310. numberTag = '[object Number]',
  1311. nullTag = '[object Null]',
  1312. objectTag = '[object Object]',
  1313. promiseTag = '[object Promise]',
  1314. proxyTag = '[object Proxy]',
  1315. regexpTag = '[object RegExp]',
  1316. setTag = '[object Set]',
  1317. stringTag = '[object String]',
  1318. symbolTag = '[object Symbol]',
  1319. undefinedTag = '[object Undefined]',
  1320. weakMapTag = '[object WeakMap]',
  1321. weakSetTag = '[object WeakSet]';
  1322. var arrayBufferTag = '[object ArrayBuffer]',
  1323. dataViewTag = '[object DataView]',
  1324. float32Tag = '[object Float32Array]',
  1325. float64Tag = '[object Float64Array]',
  1326. int8Tag = '[object Int8Array]',
  1327. int16Tag = '[object Int16Array]',
  1328. int32Tag = '[object Int32Array]',
  1329. uint8Tag = '[object Uint8Array]',
  1330. uint8ClampedTag = '[object Uint8ClampedArray]',
  1331. uint16Tag = '[object Uint16Array]',
  1332. uint32Tag = '[object Uint32Array]';
  1333. /** Used to match empty string literals in compiled template source. */
  1334. var reEmptyStringLeading = /\b__p \+= '';/g,
  1335. reEmptyStringMiddle = /\b(__p \+=) '' \+/g,
  1336. reEmptyStringTrailing = /(__e\(.*?\)|\b__t\)) \+\n'';/g;
  1337. /** Used to match HTML entities and HTML characters. */
  1338. var reEscapedHtml = /&(?:amp|lt|gt|quot|#39);/g,
  1339. reUnescapedHtml = /[&<>"']/g,
  1340. reHasEscapedHtml = RegExp(reEscapedHtml.source),
  1341. reHasUnescapedHtml = RegExp(reUnescapedHtml.source);
  1342. /** Used to match template delimiters. */
  1343. var reEscape = /<%-([\s\S]+?)%>/g,
  1344. reEvaluate = /<%([\s\S]+?)%>/g,
  1345. reInterpolate = /<%=([\s\S]+?)%>/g;
  1346. /** Used to match property names within property paths. */
  1347. var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,
  1348. reIsPlainProp = /^\w*$/,
  1349. rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g;
  1350. /**
  1351. * Used to match `RegExp`
  1352. * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).
  1353. */
  1354. var reRegExpChar = /[\\^$.*+?()[\]{}|]/g,
  1355. reHasRegExpChar = RegExp(reRegExpChar.source);
  1356. /** Used to match leading whitespace. */
  1357. var reTrimStart = /^\s+/;
  1358. /** Used to match a single whitespace character. */
  1359. var reWhitespace = /\s/;
  1360. /** Used to match wrap detail comments. */
  1361. var reWrapComment = /\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,
  1362. reWrapDetails = /\{\n\/\* \[wrapped with (.+)\] \*/,
  1363. reSplitDetails = /,? & /;
  1364. /** Used to match words composed of alphanumeric characters. */
  1365. var reAsciiWord = /[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;
  1366. /**
  1367. * Used to validate the `validate` option in `_.template` variable.
  1368. *
  1369. * Forbids characters which could potentially change the meaning of the function argument definition:
  1370. * - "()," (modification of function parameters)
  1371. * - "=" (default value)
  1372. * - "[]{}" (destructuring of function parameters)
  1373. * - "/" (beginning of a comment)
  1374. * - whitespace
  1375. */
  1376. var reForbiddenIdentifierChars = /[()=,{}\[\]\/\s]/;
  1377. /** Used to match backslashes in property paths. */
  1378. var reEscapeChar = /\\(\\)?/g;
  1379. /**
  1380. * Used to match
  1381. * [ES template delimiters](http://ecma-international.org/ecma-262/7.0/#sec-template-literal-lexical-components).
  1382. */
  1383. var reEsTemplate = /\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g;
  1384. /** Used to match `RegExp` flags from their coerced string values. */
  1385. var reFlags = /\w*$/;
  1386. /** Used to detect bad signed hexadecimal string values. */
  1387. var reIsBadHex = /^[-+]0x[0-9a-f]+$/i;
  1388. /** Used to detect binary string values. */
  1389. var reIsBinary = /^0b[01]+$/i;
  1390. /** Used to detect host constructors (Safari). */
  1391. var reIsHostCtor = /^\[object .+?Constructor\]$/;
  1392. /** Used to detect octal string values. */
  1393. var reIsOctal = /^0o[0-7]+$/i;
  1394. /** Used to detect unsigned integer values. */
  1395. var reIsUint = /^(?:0|[1-9]\d*)$/;
  1396. /** Used to match Latin Unicode letters (excluding mathematical operators). */
  1397. var reLatin = /[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g;
  1398. /** Used to ensure capturing order of template delimiters. */
  1399. var reNoMatch = /($^)/;
  1400. /** Used to match unescaped characters in compiled string literals. */
  1401. var reUnescapedString = /['\n\r\u2028\u2029\\]/g;
  1402. /** Used to compose unicode character classes. */
  1403. var rsAstralRange = '\\ud800-\\udfff',
  1404. rsComboMarksRange = '\\u0300-\\u036f',
  1405. reComboHalfMarksRange = '\\ufe20-\\ufe2f',
  1406. rsComboSymbolsRange = '\\u20d0-\\u20ff',
  1407. rsComboRange = rsComboMarksRange + reComboHalfMarksRange + rsComboSymbolsRange,
  1408. rsDingbatRange = '\\u2700-\\u27bf',
  1409. rsLowerRange = 'a-z\\xdf-\\xf6\\xf8-\\xff',
  1410. rsMathOpRange = '\\xac\\xb1\\xd7\\xf7',
  1411. rsNonCharRange = '\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf',
  1412. rsPunctuationRange = '\\u2000-\\u206f',
  1413. 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',
  1414. rsUpperRange = 'A-Z\\xc0-\\xd6\\xd8-\\xde',
  1415. rsVarRange = '\\ufe0e\\ufe0f',
  1416. rsBreakRange = rsMathOpRange + rsNonCharRange + rsPunctuationRange + rsSpaceRange;
  1417. /** Used to compose unicode capture groups. */
  1418. var rsApos = "['\u2019]",
  1419. rsAstral = '[' + rsAstralRange + ']',
  1420. rsBreak = '[' + rsBreakRange + ']',
  1421. rsCombo = '[' + rsComboRange + ']',
  1422. rsDigits = '\\d+',
  1423. rsDingbat = '[' + rsDingbatRange + ']',
  1424. rsLower = '[' + rsLowerRange + ']',
  1425. rsMisc = '[^' + rsAstralRange + rsBreakRange + rsDigits + rsDingbatRange + rsLowerRange + rsUpperRange + ']',
  1426. rsFitz = '\\ud83c[\\udffb-\\udfff]',
  1427. rsModifier = '(?:' + rsCombo + '|' + rsFitz + ')',
  1428. rsNonAstral = '[^' + rsAstralRange + ']',
  1429. rsRegional = '(?:\\ud83c[\\udde6-\\uddff]){2}',
  1430. rsSurrPair = '[\\ud800-\\udbff][\\udc00-\\udfff]',
  1431. rsUpper = '[' + rsUpperRange + ']',
  1432. rsZWJ = '\\u200d';
  1433. /** Used to compose unicode regexes. */
  1434. var rsMiscLower = '(?:' + rsLower + '|' + rsMisc + ')',
  1435. rsMiscUpper = '(?:' + rsUpper + '|' + rsMisc + ')',
  1436. rsOptContrLower = '(?:' + rsApos + '(?:d|ll|m|re|s|t|ve))?',
  1437. rsOptContrUpper = '(?:' + rsApos + '(?:D|LL|M|RE|S|T|VE))?',
  1438. reOptMod = rsModifier + '?',
  1439. rsOptVar = '[' + rsVarRange + ']?',
  1440. rsOptJoin = '(?:' + rsZWJ + '(?:' + [rsNonAstral, rsRegional, rsSurrPair].join('|') + ')' + rsOptVar + reOptMod + ')*',
  1441. rsOrdLower = '\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])',
  1442. rsOrdUpper = '\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])',
  1443. rsSeq = rsOptVar + reOptMod + rsOptJoin,
  1444. rsEmoji = '(?:' + [rsDingbat, rsRegional, rsSurrPair].join('|') + ')' + rsSeq,
  1445. rsSymbol = '(?:' + [rsNonAstral + rsCombo + '?', rsCombo, rsRegional, rsSurrPair, rsAstral].join('|') + ')';
  1446. /** Used to match apostrophes. */
  1447. var reApos = RegExp(rsApos, 'g');
  1448. /**
  1449. * Used to match [combining diacritical marks](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks) and
  1450. * [combining diacritical marks for symbols](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks_for_Symbols).
  1451. */
  1452. var reComboMark = RegExp(rsCombo, 'g');
  1453. /** Used to match [string symbols](https://mathiasbynens.be/notes/javascript-unicode). */
  1454. var reUnicode = RegExp(rsFitz + '(?=' + rsFitz + ')|' + rsSymbol + rsSeq, 'g');
  1455. /** Used to match complex or compound words. */
  1456. var reUnicodeWord = RegExp([
  1457. rsUpper + '?' + rsLower + '+' + rsOptContrLower + '(?=' + [rsBreak, rsUpper, '$'].join('|') + ')',
  1458. rsMiscUpper + '+' + rsOptContrUpper + '(?=' + [rsBreak, rsUpper + rsMiscLower, '$'].join('|') + ')',
  1459. rsUpper + '?' + rsMiscLower + '+' + rsOptContrLower,
  1460. rsUpper + '+' + rsOptContrUpper,
  1461. rsOrdUpper,
  1462. rsOrdLower,
  1463. rsDigits,
  1464. rsEmoji
  1465. ].join('|'), 'g');
  1466. /** 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/). */
  1467. var reHasUnicode = RegExp('[' + rsZWJ + rsAstralRange + rsComboRange + rsVarRange + ']');
  1468. /** Used to detect strings that need a more robust regexp to match words. */
  1469. 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 ]/;
  1470. /** Used to assign default `context` object properties. */
  1471. var contextProps = [
  1472. 'Array', 'Buffer', 'DataView', 'Date', 'Error', 'Float32Array', 'Float64Array',
  1473. 'Function', 'Int8Array', 'Int16Array', 'Int32Array', 'Map', 'Math', 'Object',
  1474. 'Promise', 'RegExp', 'Set', 'String', 'Symbol', 'TypeError', 'Uint8Array',
  1475. 'Uint8ClampedArray', 'Uint16Array', 'Uint32Array', 'WeakMap',
  1476. '_', 'clearTimeout', 'isFinite', 'parseInt', 'setTimeout'
  1477. ];
  1478. /** Used to make template sourceURLs easier to identify. */
  1479. var templateCounter = -1;
  1480. /** Used to identify `toStringTag` values of typed arrays. */
  1481. var typedArrayTags = {};
  1482. typedArrayTags[float32Tag] = typedArrayTags[float64Tag] =
  1483. typedArrayTags[int8Tag] = typedArrayTags[int16Tag] =
  1484. typedArrayTags[int32Tag] = typedArrayTags[uint8Tag] =
  1485. typedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] =
  1486. typedArrayTags[uint32Tag] = true;
  1487. typedArrayTags[argsTag] = typedArrayTags[arrayTag] =
  1488. typedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] =
  1489. typedArrayTags[dataViewTag] = typedArrayTags[dateTag] =
  1490. typedArrayTags[errorTag] = typedArrayTags[funcTag] =
  1491. typedArrayTags[mapTag] = typedArrayTags[numberTag] =
  1492. typedArrayTags[objectTag] = typedArrayTags[regexpTag] =
  1493. typedArrayTags[setTag] = typedArrayTags[stringTag] =
  1494. typedArrayTags[weakMapTag] = false;
  1495. /** Used to identify `toStringTag` values supported by `_.clone`. */
  1496. var cloneableTags = {};
  1497. cloneableTags[argsTag] = cloneableTags[arrayTag] =
  1498. cloneableTags[arrayBufferTag] = cloneableTags[dataViewTag] =
  1499. cloneableTags[boolTag] = cloneableTags[dateTag] =
  1500. cloneableTags[float32Tag] = cloneableTags[float64Tag] =
  1501. cloneableTags[int8Tag] = cloneableTags[int16Tag] =
  1502. cloneableTags[int32Tag] = cloneableTags[mapTag] =
  1503. cloneableTags[numberTag] = cloneableTags[objectTag] =
  1504. cloneableTags[regexpTag] = cloneableTags[setTag] =
  1505. cloneableTags[stringTag] = cloneableTags[symbolTag] =
  1506. cloneableTags[uint8Tag] = cloneableTags[uint8ClampedTag] =
  1507. cloneableTags[uint16Tag] = cloneableTags[uint32Tag] = true;
  1508. cloneableTags[errorTag] = cloneableTags[funcTag] =
  1509. cloneableTags[weakMapTag] = false;
  1510. /** Used to map Latin Unicode letters to basic Latin letters. */
  1511. var deburredLetters = {
  1512. // Latin-1 Supplement block.
  1513. '\xc0': 'A', '\xc1': 'A', '\xc2': 'A', '\xc3': 'A', '\xc4': 'A', '\xc5': 'A',
  1514. '\xe0': 'a', '\xe1': 'a', '\xe2': 'a', '\xe3': 'a', '\xe4': 'a', '\xe5': 'a',
  1515. '\xc7': 'C', '\xe7': 'c',
  1516. '\xd0': 'D', '\xf0': 'd',
  1517. '\xc8': 'E', '\xc9': 'E', '\xca': 'E', '\xcb': 'E',
  1518. '\xe8': 'e', '\xe9': 'e', '\xea': 'e', '\xeb': 'e',
  1519. '\xcc': 'I', '\xcd': 'I', '\xce': 'I', '\xcf': 'I',
  1520. '\xec': 'i', '\xed': 'i', '\xee': 'i', '\xef': 'i',
  1521. '\xd1': 'N', '\xf1': 'n',
  1522. '\xd2': 'O', '\xd3': 'O', '\xd4': 'O', '\xd5': 'O', '\xd6': 'O', '\xd8': 'O',
  1523. '\xf2': 'o', '\xf3': 'o', '\xf4': 'o', '\xf5': 'o', '\xf6': 'o', '\xf8': 'o',
  1524. '\xd9': 'U', '\xda': 'U', '\xdb': 'U', '\xdc': 'U',
  1525. '\xf9': 'u', '\xfa': 'u', '\xfb': 'u', '\xfc': 'u',
  1526. '\xdd': 'Y', '\xfd': 'y', '\xff': 'y',
  1527. '\xc6': 'Ae', '\xe6': 'ae',
  1528. '\xde': 'Th', '\xfe': 'th',
  1529. '\xdf': 'ss',
  1530. // Latin Extended-A block.
  1531. '\u0100': 'A', '\u0102': 'A', '\u0104': 'A',
  1532. '\u0101': 'a', '\u0103': 'a', '\u0105': 'a',
  1533. '\u0106': 'C', '\u0108': 'C', '\u010a': 'C', '\u010c': 'C',
  1534. '\u0107': 'c', '\u0109': 'c', '\u010b': 'c', '\u010d': 'c',
  1535. '\u010e': 'D', '\u0110': 'D', '\u010f': 'd', '\u0111': 'd',
  1536. '\u0112': 'E', '\u0114': 'E', '\u0116': 'E', '\u0118': 'E', '\u011a': 'E',
  1537. '\u0113': 'e', '\u0115': 'e', '\u0117': 'e', '\u0119': 'e', '\u011b': 'e',
  1538. '\u011c': 'G', '\u011e': 'G', '\u0120': 'G', '\u0122': 'G',
  1539. '\u011d': 'g', '\u011f': 'g', '\u0121': 'g', '\u0123': 'g',
  1540. '\u0124': 'H', '\u0126': 'H', '\u0125': 'h', '\u0127': 'h',
  1541. '\u0128': 'I', '\u012a': 'I', '\u012c': 'I', '\u012e': 'I', '\u0130': 'I',
  1542. '\u0129': 'i', '\u012b': 'i', '\u012d': 'i', '\u012f': 'i', '\u0131': 'i',
  1543. '\u0134': 'J', '\u0135': 'j',
  1544. '\u0136': 'K', '\u0137': 'k', '\u0138': 'k',
  1545. '\u0139': 'L', '\u013b': 'L', '\u013d': 'L', '\u013f': 'L', '\u0141': 'L',
  1546. '\u013a': 'l', '\u013c': 'l', '\u013e': 'l', '\u0140': 'l', '\u0142': 'l',
  1547. '\u0143': 'N', '\u0145': 'N', '\u0147': 'N', '\u014a': 'N',
  1548. '\u0144': 'n', '\u0146': 'n', '\u0148': 'n', '\u014b': 'n',
  1549. '\u014c': 'O', '\u014e': 'O', '\u0150': 'O',
  1550. '\u014d': 'o', '\u014f': 'o', '\u0151': 'o',
  1551. '\u0154': 'R', '\u0156': 'R', '\u0158': 'R',
  1552. '\u0155': 'r', '\u0157': 'r', '\u0159': 'r',
  1553. '\u015a': 'S', '\u015c': 'S', '\u015e': 'S', '\u0160': 'S',
  1554. '\u015b': 's', '\u015d': 's', '\u015f': 's', '\u0161': 's',
  1555. '\u0162': 'T', '\u0164': 'T', '\u0166': 'T',
  1556. '\u0163': 't', '\u0165': 't', '\u0167': 't',
  1557. '\u0168': 'U', '\u016a': 'U', '\u016c': 'U', '\u016e': 'U', '\u0170': 'U', '\u0172': 'U',
  1558. '\u0169': 'u', '\u016b': 'u', '\u016d': 'u', '\u016f': 'u', '\u0171': 'u', '\u0173': 'u',
  1559. '\u0174': 'W', '\u0175': 'w',
  1560. '\u0176': 'Y', '\u0177': 'y', '\u0178': 'Y',
  1561. '\u0179': 'Z', '\u017b': 'Z', '\u017d': 'Z',
  1562. '\u017a': 'z', '\u017c': 'z', '\u017e': 'z',
  1563. '\u0132': 'IJ', '\u0133': 'ij',
  1564. '\u0152': 'Oe', '\u0153': 'oe',
  1565. '\u0149': "'n", '\u017f': 's'
  1566. };
  1567. /** Used to map characters to HTML entities. */
  1568. var htmlEscapes = {
  1569. '&': '&amp;',
  1570. '<': '&lt;',
  1571. '>': '&gt;',
  1572. '"': '&quot;',
  1573. "'": '&#39;'
  1574. };
  1575. /** Used to map HTML entities to characters. */
  1576. var htmlUnescapes = {
  1577. '&amp;': '&',
  1578. '&lt;': '<',
  1579. '&gt;': '>',
  1580. '&quot;': '"',
  1581. '&#39;': "'"
  1582. };
  1583. /** Used to escape characters for inclusion in compiled string literals. */
  1584. var stringEscapes = {
  1585. '\\': '\\',
  1586. "'": "'",
  1587. '\n': 'n',
  1588. '\r': 'r',
  1589. '\u2028': 'u2028',
  1590. '\u2029': 'u2029'
  1591. };
  1592. /** Built-in method references without a dependency on `root`. */
  1593. var freeParseFloat = parseFloat,
  1594. freeParseInt = parseInt;
  1595. /** Detect free variable `global` from Node.js. */
  1596. var freeGlobal = typeof __webpack_require__.g == 'object' && __webpack_require__.g && __webpack_require__.g.Object === Object && __webpack_require__.g;
  1597. /** Detect free variable `self`. */
  1598. var freeSelf = typeof self == 'object' && self && self.Object === Object && self;
  1599. /** Used as a reference to the global object. */
  1600. var root = freeGlobal || freeSelf || Function('return this')();
  1601. /** Detect free variable `exports`. */
  1602. var freeExports = true && exports && !exports.nodeType && exports;
  1603. /** Detect free variable `module`. */
  1604. var freeModule = freeExports && "object" == 'object' && module && !module.nodeType && module;
  1605. /** Detect the popular CommonJS extension `module.exports`. */
  1606. var moduleExports = freeModule && freeModule.exports === freeExports;
  1607. /** Detect free variable `process` from Node.js. */
  1608. var freeProcess = moduleExports && freeGlobal.process;
  1609. /** Used to access faster Node.js helpers. */
  1610. var nodeUtil = (function() {
  1611. try {
  1612. // Use `util.types` for Node.js 10+.
  1613. var types = freeModule && freeModule.require && freeModule.require('util').types;
  1614. if (types) {
  1615. return types;
  1616. }
  1617. // Legacy `process.binding('util')` for Node.js < 10.
  1618. return freeProcess && freeProcess.binding && freeProcess.binding('util');
  1619. } catch (e) {}
  1620. }());
  1621. /* Node.js helper references. */
  1622. var nodeIsArrayBuffer = nodeUtil && nodeUtil.isArrayBuffer,
  1623. nodeIsDate = nodeUtil && nodeUtil.isDate,
  1624. nodeIsMap = nodeUtil && nodeUtil.isMap,
  1625. nodeIsRegExp = nodeUtil && nodeUtil.isRegExp,
  1626. nodeIsSet = nodeUtil && nodeUtil.isSet,
  1627. nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray;
  1628. /*--------------------------------------------------------------------------*/
  1629. /**
  1630. * A faster alternative to `Function#apply`, this function invokes `func`
  1631. * with the `this` binding of `thisArg` and the arguments of `args`.
  1632. *
  1633. * @private
  1634. * @param {Function} func The function to invoke.
  1635. * @param {*} thisArg The `this` binding of `func`.
  1636. * @param {Array} args The arguments to invoke `func` with.
  1637. * @returns {*} Returns the result of `func`.
  1638. */
  1639. function apply(func, thisArg, args) {
  1640. switch (args.length) {
  1641. case 0: return func.call(thisArg);
  1642. case 1: return func.call(thisArg, args[0]);
  1643. case 2: return func.call(thisArg, args[0], args[1]);
  1644. case 3: return func.call(thisArg, args[0], args[1], args[2]);
  1645. }
  1646. return func.apply(thisArg, args);
  1647. }
  1648. /**
  1649. * A specialized version of `baseAggregator` for arrays.
  1650. *
  1651. * @private
  1652. * @param {Array} [array] The array to iterate over.
  1653. * @param {Function} setter The function to set `accumulator` values.
  1654. * @param {Function} iteratee The iteratee to transform keys.
  1655. * @param {Object} accumulator The initial aggregated object.
  1656. * @returns {Function} Returns `accumulator`.
  1657. */
  1658. function arrayAggregator(array, setter, iteratee, accumulator) {
  1659. var index = -1,
  1660. length = array == null ? 0 : array.length;
  1661. while (++index < length) {
  1662. var value = array[index];
  1663. setter(accumulator, value, iteratee(value), array);
  1664. }
  1665. return accumulator;
  1666. }
  1667. /**
  1668. * A specialized version of `_.forEach` for arrays without support for
  1669. * iteratee shorthands.
  1670. *
  1671. * @private
  1672. * @param {Array} [array] The array to iterate over.
  1673. * @param {Function} iteratee The function invoked per iteration.
  1674. * @returns {Array} Returns `array`.
  1675. */
  1676. function arrayEach(array, iteratee) {
  1677. var index = -1,
  1678. length = array == null ? 0 : array.length;
  1679. while (++index < length) {
  1680. if (iteratee(array[index], index, array) === false) {
  1681. break;
  1682. }
  1683. }
  1684. return array;
  1685. }
  1686. /**
  1687. * A specialized version of `_.forEachRight` for arrays without support for
  1688. * iteratee shorthands.
  1689. *
  1690. * @private
  1691. * @param {Array} [array] The array to iterate over.
  1692. * @param {Function} iteratee The function invoked per iteration.
  1693. * @returns {Array} Returns `array`.
  1694. */
  1695. function arrayEachRight(array, iteratee) {
  1696. var length = array == null ? 0 : array.length;
  1697. while (length--) {
  1698. if (iteratee(array[length], length, array) === false) {
  1699. break;
  1700. }
  1701. }
  1702. return array;
  1703. }
  1704. /**
  1705. * A specialized version of `_.every` for arrays without support for
  1706. * iteratee shorthands.
  1707. *
  1708. * @private
  1709. * @param {Array} [array] The array to iterate over.
  1710. * @param {Function} predicate The function invoked per iteration.
  1711. * @returns {boolean} Returns `true` if all elements pass the predicate check,
  1712. * else `false`.
  1713. */
  1714. function arrayEvery(array, predicate) {
  1715. var index = -1,
  1716. length = array == null ? 0 : array.length;
  1717. while (++index < length) {
  1718. if (!predicate(array[index], index, array)) {
  1719. return false;
  1720. }
  1721. }
  1722. return true;
  1723. }
  1724. /**
  1725. * A specialized version of `_.filter` for arrays without support for
  1726. * iteratee shorthands.
  1727. *
  1728. * @private
  1729. * @param {Array} [array] The array to iterate over.
  1730. * @param {Function} predicate The function invoked per iteration.
  1731. * @returns {Array} Returns the new filtered array.
  1732. */
  1733. function arrayFilter(array, predicate) {
  1734. var index = -1,
  1735. length = array == null ? 0 : array.length,
  1736. resIndex = 0,
  1737. result = [];
  1738. while (++index < length) {
  1739. var value = array[index];
  1740. if (predicate(value, index, array)) {
  1741. result[resIndex++] = value;
  1742. }
  1743. }
  1744. return result;
  1745. }
  1746. /**
  1747. * A specialized version of `_.includes` for arrays without support for
  1748. * specifying an index to search from.
  1749. *
  1750. * @private
  1751. * @param {Array} [array] The array to inspect.
  1752. * @param {*} target The value to search for.
  1753. * @returns {boolean} Returns `true` if `target` is found, else `false`.
  1754. */
  1755. function arrayIncludes(array, value) {
  1756. var length = array == null ? 0 : array.length;
  1757. return !!length && baseIndexOf(array, value, 0) > -1;
  1758. }
  1759. /**
  1760. * This function is like `arrayIncludes` except that it accepts a comparator.
  1761. *
  1762. * @private
  1763. * @param {Array} [array] The array to inspect.
  1764. * @param {*} target The value to search for.
  1765. * @param {Function} comparator The comparator invoked per element.
  1766. * @returns {boolean} Returns `true` if `target` is found, else `false`.
  1767. */
  1768. function arrayIncludesWith(array, value, comparator) {
  1769. var index = -1,
  1770. length = array == null ? 0 : array.length;
  1771. while (++index < length) {
  1772. if (comparator(value, array[index])) {
  1773. return true;
  1774. }
  1775. }
  1776. return false;
  1777. }
  1778. /**
  1779. * A specialized version of `_.map` for arrays without support for iteratee
  1780. * shorthands.
  1781. *
  1782. * @private
  1783. * @param {Array} [array] The array to iterate over.
  1784. * @param {Function} iteratee The function invoked per iteration.
  1785. * @returns {Array} Returns the new mapped array.
  1786. */
  1787. function arrayMap(array, iteratee) {
  1788. var index = -1,
  1789. length = array == null ? 0 : array.length,
  1790. result = Array(length);
  1791. while (++index < length) {
  1792. result[index] = iteratee(array[index], index, array);
  1793. }
  1794. return result;
  1795. }
  1796. /**
  1797. * Appends the elements of `values` to `array`.
  1798. *
  1799. * @private
  1800. * @param {Array} array The array to modify.
  1801. * @param {Array} values The values to append.
  1802. * @returns {Array} Returns `array`.
  1803. */
  1804. function arrayPush(array, values) {
  1805. var index = -1,
  1806. length = values.length,
  1807. offset = array.length;
  1808. while (++index < length) {
  1809. array[offset + index] = values[index];
  1810. }
  1811. return array;
  1812. }
  1813. /**
  1814. * A specialized version of `_.reduce` for arrays without support for
  1815. * iteratee shorthands.
  1816. *
  1817. * @private
  1818. * @param {Array} [array] The array to iterate over.
  1819. * @param {Function} iteratee The function invoked per iteration.
  1820. * @param {*} [accumulator] The initial value.
  1821. * @param {boolean} [initAccum] Specify using the first element of `array` as
  1822. * the initial value.
  1823. * @returns {*} Returns the accumulated value.
  1824. */
  1825. function arrayReduce(array, iteratee, accumulator, initAccum) {
  1826. var index = -1,
  1827. length = array == null ? 0 : array.length;
  1828. if (initAccum && length) {
  1829. accumulator = array[++index];
  1830. }
  1831. while (++index < length) {
  1832. accumulator = iteratee(accumulator, array[index], index, array);
  1833. }
  1834. return accumulator;
  1835. }
  1836. /**
  1837. * A specialized version of `_.reduceRight` for arrays without support for
  1838. * iteratee shorthands.
  1839. *
  1840. * @private
  1841. * @param {Array} [array] The array to iterate over.
  1842. * @param {Function} iteratee The function invoked per iteration.
  1843. * @param {*} [accumulator] The initial value.
  1844. * @param {boolean} [initAccum] Specify using the last element of `array` as
  1845. * the initial value.
  1846. * @returns {*} Returns the accumulated value.
  1847. */
  1848. function arrayReduceRight(array, iteratee, accumulator, initAccum) {
  1849. var length = array == null ? 0 : array.length;
  1850. if (initAccum && length) {
  1851. accumulator = array[--length];
  1852. }
  1853. while (length--) {
  1854. accumulator = iteratee(accumulator, array[length], length, array);
  1855. }
  1856. return accumulator;
  1857. }
  1858. /**
  1859. * A specialized version of `_.some` for arrays without support for iteratee
  1860. * shorthands.
  1861. *
  1862. * @private
  1863. * @param {Array} [array] The array to iterate over.
  1864. * @param {Function} predicate The function invoked per iteration.
  1865. * @returns {boolean} Returns `true` if any element passes the predicate check,
  1866. * else `false`.
  1867. */
  1868. function arraySome(array, predicate) {
  1869. var index = -1,
  1870. length = array == null ? 0 : array.length;
  1871. while (++index < length) {
  1872. if (predicate(array[index], index, array)) {
  1873. return true;
  1874. }
  1875. }
  1876. return false;
  1877. }
  1878. /**
  1879. * Gets the size of an ASCII `string`.
  1880. *
  1881. * @private
  1882. * @param {string} string The string inspect.
  1883. * @returns {number} Returns the string size.
  1884. */
  1885. var asciiSize = baseProperty('length');
  1886. /**
  1887. * Converts an ASCII `string` to an array.
  1888. *
  1889. * @private
  1890. * @param {string} string The string to convert.
  1891. * @returns {Array} Returns the converted array.
  1892. */
  1893. function asciiToArray(string) {
  1894. return string.split('');
  1895. }
  1896. /**
  1897. * Splits an ASCII `string` into an array of its words.
  1898. *
  1899. * @private
  1900. * @param {string} The string to inspect.
  1901. * @returns {Array} Returns the words of `string`.
  1902. */
  1903. function asciiWords(string) {
  1904. return string.match(reAsciiWord) || [];
  1905. }
  1906. /**
  1907. * The base implementation of methods like `_.findKey` and `_.findLastKey`,
  1908. * without support for iteratee shorthands, which iterates over `collection`
  1909. * using `eachFunc`.
  1910. *
  1911. * @private
  1912. * @param {Array|Object} collection The collection to inspect.
  1913. * @param {Function} predicate The function invoked per iteration.
  1914. * @param {Function} eachFunc The function to iterate over `collection`.
  1915. * @returns {*} Returns the found element or its key, else `undefined`.
  1916. */
  1917. function baseFindKey(collection, predicate, eachFunc) {
  1918. var result;
  1919. eachFunc(collection, function(value, key, collection) {
  1920. if (predicate(value, key, collection)) {
  1921. result = key;
  1922. return false;
  1923. }
  1924. });
  1925. return result;
  1926. }
  1927. /**
  1928. * The base implementation of `_.findIndex` and `_.findLastIndex` without
  1929. * support for iteratee shorthands.
  1930. *
  1931. * @private
  1932. * @param {Array} array The array to inspect.
  1933. * @param {Function} predicate The function invoked per iteration.
  1934. * @param {number} fromIndex The index to search from.
  1935. * @param {boolean} [fromRight] Specify iterating from right to left.
  1936. * @returns {number} Returns the index of the matched value, else `-1`.
  1937. */
  1938. function baseFindIndex(array, predicate, fromIndex, fromRight) {
  1939. var length = array.length,
  1940. index = fromIndex + (fromRight ? 1 : -1);
  1941. while ((fromRight ? index-- : ++index < length)) {
  1942. if (predicate(array[index], index, array)) {
  1943. return index;
  1944. }
  1945. }
  1946. return -1;
  1947. }
  1948. /**
  1949. * The base implementation of `_.indexOf` without `fromIndex` bounds checks.
  1950. *
  1951. * @private
  1952. * @param {Array} array The array to inspect.
  1953. * @param {*} value The value to search for.
  1954. * @param {number} fromIndex The index to search from.
  1955. * @returns {number} Returns the index of the matched value, else `-1`.
  1956. */
  1957. function baseIndexOf(array, value, fromIndex) {
  1958. return value === value
  1959. ? strictIndexOf(array, value, fromIndex)
  1960. : baseFindIndex(array, baseIsNaN, fromIndex);
  1961. }
  1962. /**
  1963. * This function is like `baseIndexOf` except that it accepts a comparator.
  1964. *
  1965. * @private
  1966. * @param {Array} array The array to inspect.
  1967. * @param {*} value The value to search for.
  1968. * @param {number} fromIndex The index to search from.
  1969. * @param {Function} comparator The comparator invoked per element.
  1970. * @returns {number} Returns the index of the matched value, else `-1`.
  1971. */
  1972. function baseIndexOfWith(array, value, fromIndex, comparator) {
  1973. var index = fromIndex - 1,
  1974. length = array.length;
  1975. while (++index < length) {
  1976. if (comparator(array[index], value)) {
  1977. return index;
  1978. }
  1979. }
  1980. return -1;
  1981. }
  1982. /**
  1983. * The base implementation of `_.isNaN` without support for number objects.
  1984. *
  1985. * @private
  1986. * @param {*} value The value to check.
  1987. * @returns {boolean} Returns `true` if `value` is `NaN`, else `false`.
  1988. */
  1989. function baseIsNaN(value) {
  1990. return value !== value;
  1991. }
  1992. /**
  1993. * The base implementation of `_.mean` and `_.meanBy` without support for
  1994. * iteratee shorthands.
  1995. *
  1996. * @private
  1997. * @param {Array} array The array to iterate over.
  1998. * @param {Function} iteratee The function invoked per iteration.
  1999. * @returns {number} Returns the mean.
  2000. */
  2001. function baseMean(array, iteratee) {
  2002. var length = array == null ? 0 : array.length;
  2003. return length ? (baseSum(array, iteratee) / length) : NAN;
  2004. }
  2005. /**
  2006. * The base implementation of `_.property` without support for deep paths.
  2007. *
  2008. * @private
  2009. * @param {string} key The key of the property to get.
  2010. * @returns {Function} Returns the new accessor function.
  2011. */
  2012. function baseProperty(key) {
  2013. return function(object) {
  2014. return object == null ? undefined : object[key];
  2015. };
  2016. }
  2017. /**
  2018. * The base implementation of `_.propertyOf` without support for deep paths.
  2019. *
  2020. * @private
  2021. * @param {Object} object The object to query.
  2022. * @returns {Function} Returns the new accessor function.
  2023. */
  2024. function basePropertyOf(object) {
  2025. return function(key) {
  2026. return object == null ? undefined : object[key];
  2027. };
  2028. }
  2029. /**
  2030. * The base implementation of `_.reduce` and `_.reduceRight`, without support
  2031. * for iteratee shorthands, which iterates over `collection` using `eachFunc`.
  2032. *
  2033. * @private
  2034. * @param {Array|Object} collection The collection to iterate over.
  2035. * @param {Function} iteratee The function invoked per iteration.
  2036. * @param {*} accumulator The initial value.
  2037. * @param {boolean} initAccum Specify using the first or last element of
  2038. * `collection` as the initial value.
  2039. * @param {Function} eachFunc The function to iterate over `collection`.
  2040. * @returns {*} Returns the accumulated value.
  2041. */
  2042. function baseReduce(collection, iteratee, accumulator, initAccum, eachFunc) {
  2043. eachFunc(collection, function(value, index, collection) {
  2044. accumulator = initAccum
  2045. ? (initAccum = false, value)
  2046. : iteratee(accumulator, value, index, collection);
  2047. });
  2048. return accumulator;
  2049. }
  2050. /**
  2051. * The base implementation of `_.sortBy` which uses `comparer` to define the
  2052. * sort order of `array` and replaces criteria objects with their corresponding
  2053. * values.
  2054. *
  2055. * @private
  2056. * @param {Array} array The array to sort.
  2057. * @param {Function} comparer The function to define sort order.
  2058. * @returns {Array} Returns `array`.
  2059. */
  2060. function baseSortBy(array, comparer) {
  2061. var length = array.length;
  2062. array.sort(comparer);
  2063. while (length--) {
  2064. array[length] = array[length].value;
  2065. }
  2066. return array;
  2067. }
  2068. /**
  2069. * The base implementation of `_.sum` and `_.sumBy` without support for
  2070. * iteratee shorthands.
  2071. *
  2072. * @private
  2073. * @param {Array} array The array to iterate over.
  2074. * @param {Function} iteratee The function invoked per iteration.
  2075. * @returns {number} Returns the sum.
  2076. */
  2077. function baseSum(array, iteratee) {
  2078. var result,
  2079. index = -1,
  2080. length = array.length;
  2081. while (++index < length) {
  2082. var current = iteratee(array[index]);
  2083. if (current !== undefined) {
  2084. result = result === undefined ? current : (result + current);
  2085. }
  2086. }
  2087. return result;
  2088. }
  2089. /**
  2090. * The base implementation of `_.times` without support for iteratee shorthands
  2091. * or max array length checks.
  2092. *
  2093. * @private
  2094. * @param {number} n The number of times to invoke `iteratee`.
  2095. * @param {Function} iteratee The function invoked per iteration.
  2096. * @returns {Array} Returns the array of results.
  2097. */
  2098. function baseTimes(n, iteratee) {
  2099. var index = -1,
  2100. result = Array(n);
  2101. while (++index < n) {
  2102. result[index] = iteratee(index);
  2103. }
  2104. return result;
  2105. }
  2106. /**
  2107. * The base implementation of `_.toPairs` and `_.toPairsIn` which creates an array
  2108. * of key-value pairs for `object` corresponding to the property names of `props`.
  2109. *
  2110. * @private
  2111. * @param {Object} object The object to query.
  2112. * @param {Array} props The property names to get values for.
  2113. * @returns {Object} Returns the key-value pairs.
  2114. */
  2115. function baseToPairs(object, props) {
  2116. return arrayMap(props, function(key) {
  2117. return [key, object[key]];
  2118. });
  2119. }
  2120. /**
  2121. * The base implementation of `_.trim`.
  2122. *
  2123. * @private
  2124. * @param {string} string The string to trim.
  2125. * @returns {string} Returns the trimmed string.
  2126. */
  2127. function baseTrim(string) {
  2128. return string
  2129. ? string.slice(0, trimmedEndIndex(string) + 1).replace(reTrimStart, '')
  2130. : string;
  2131. }
  2132. /**
  2133. * The base implementation of `_.unary` without support for storing metadata.
  2134. *
  2135. * @private
  2136. * @param {Function} func The function to cap arguments for.
  2137. * @returns {Function} Returns the new capped function.
  2138. */
  2139. function baseUnary(func) {
  2140. return function(value) {
  2141. return func(value);
  2142. };
  2143. }
  2144. /**
  2145. * The base implementation of `_.values` and `_.valuesIn` which creates an
  2146. * array of `object` property values corresponding to the property names
  2147. * of `props`.
  2148. *
  2149. * @private
  2150. * @param {Object} object The object to query.
  2151. * @param {Array} props The property names to get values for.
  2152. * @returns {Object} Returns the array of property values.
  2153. */
  2154. function baseValues(object, props) {
  2155. return arrayMap(props, function(key) {
  2156. return object[key];
  2157. });
  2158. }
  2159. /**
  2160. * Checks if a `cache` value for `key` exists.
  2161. *
  2162. * @private
  2163. * @param {Object} cache The cache to query.
  2164. * @param {string} key The key of the entry to check.
  2165. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  2166. */
  2167. function cacheHas(cache, key) {
  2168. return cache.has(key);
  2169. }
  2170. /**
  2171. * Used by `_.trim` and `_.trimStart` to get the index of the first string symbol
  2172. * that is not found in the character symbols.
  2173. *
  2174. * @private
  2175. * @param {Array} strSymbols The string symbols to inspect.
  2176. * @param {Array} chrSymbols The character symbols to find.
  2177. * @returns {number} Returns the index of the first unmatched string symbol.
  2178. */
  2179. function charsStartIndex(strSymbols, chrSymbols) {
  2180. var index = -1,
  2181. length = strSymbols.length;
  2182. while (++index < length && baseIndexOf(chrSymbols, strSymbols[index], 0) > -1) {}
  2183. return index;
  2184. }
  2185. /**
  2186. * Used by `_.trim` and `_.trimEnd` to get the index of the last string symbol
  2187. * that is not found in the character symbols.
  2188. *
  2189. * @private
  2190. * @param {Array} strSymbols The string symbols to inspect.
  2191. * @param {Array} chrSymbols The character symbols to find.
  2192. * @returns {number} Returns the index of the last unmatched string symbol.
  2193. */
  2194. function charsEndIndex(strSymbols, chrSymbols) {
  2195. var index = strSymbols.length;
  2196. while (index-- && baseIndexOf(chrSymbols, strSymbols[index], 0) > -1) {}
  2197. return index;
  2198. }
  2199. /**
  2200. * Gets the number of `placeholder` occurrences in `array`.
  2201. *
  2202. * @private
  2203. * @param {Array} array The array to inspect.
  2204. * @param {*} placeholder The placeholder to search for.
  2205. * @returns {number} Returns the placeholder count.
  2206. */
  2207. function countHolders(array, placeholder) {
  2208. var length = array.length,
  2209. result = 0;
  2210. while (length--) {
  2211. if (array[length] === placeholder) {
  2212. ++result;
  2213. }
  2214. }
  2215. return result;
  2216. }
  2217. /**
  2218. * Used by `_.deburr` to convert Latin-1 Supplement and Latin Extended-A
  2219. * letters to basic Latin letters.
  2220. *
  2221. * @private
  2222. * @param {string} letter The matched letter to deburr.
  2223. * @returns {string} Returns the deburred letter.
  2224. */
  2225. var deburrLetter = basePropertyOf(deburredLetters);
  2226. /**
  2227. * Used by `_.escape` to convert characters to HTML entities.
  2228. *
  2229. * @private
  2230. * @param {string} chr The matched character to escape.
  2231. * @returns {string} Returns the escaped character.
  2232. */
  2233. var escapeHtmlChar = basePropertyOf(htmlEscapes);
  2234. /**
  2235. * Used by `_.template` to escape characters for inclusion in compiled string literals.
  2236. *
  2237. * @private
  2238. * @param {string} chr The matched character to escape.
  2239. * @returns {string} Returns the escaped character.
  2240. */
  2241. function escapeStringChar(chr) {
  2242. return '\\' + stringEscapes[chr];
  2243. }
  2244. /**
  2245. * Gets the value at `key` of `object`.
  2246. *
  2247. * @private
  2248. * @param {Object} [object] The object to query.
  2249. * @param {string} key The key of the property to get.
  2250. * @returns {*} Returns the property value.
  2251. */
  2252. function getValue(object, key) {
  2253. return object == null ? undefined : object[key];
  2254. }
  2255. /**
  2256. * Checks if `string` contains Unicode symbols.
  2257. *
  2258. * @private
  2259. * @param {string} string The string to inspect.
  2260. * @returns {boolean} Returns `true` if a symbol is found, else `false`.
  2261. */
  2262. function hasUnicode(string) {
  2263. return reHasUnicode.test(string);
  2264. }
  2265. /**
  2266. * Checks if `string` contains a word composed of Unicode symbols.
  2267. *
  2268. * @private
  2269. * @param {string} string The string to inspect.
  2270. * @returns {boolean} Returns `true` if a word is found, else `false`.
  2271. */
  2272. function hasUnicodeWord(string) {
  2273. return reHasUnicodeWord.test(string);
  2274. }
  2275. /**
  2276. * Converts `iterator` to an array.
  2277. *
  2278. * @private
  2279. * @param {Object} iterator The iterator to convert.
  2280. * @returns {Array} Returns the converted array.
  2281. */
  2282. function iteratorToArray(iterator) {
  2283. var data,
  2284. result = [];
  2285. while (!(data = iterator.next()).done) {
  2286. result.push(data.value);
  2287. }
  2288. return result;
  2289. }
  2290. /**
  2291. * Converts `map` to its key-value pairs.
  2292. *
  2293. * @private
  2294. * @param {Object} map The map to convert.
  2295. * @returns {Array} Returns the key-value pairs.
  2296. */
  2297. function mapToArray(map) {
  2298. var index = -1,
  2299. result = Array(map.size);
  2300. map.forEach(function(value, key) {
  2301. result[++index] = [key, value];
  2302. });
  2303. return result;
  2304. }
  2305. /**
  2306. * Creates a unary function that invokes `func` with its argument transformed.
  2307. *
  2308. * @private
  2309. * @param {Function} func The function to wrap.
  2310. * @param {Function} transform The argument transform.
  2311. * @returns {Function} Returns the new function.
  2312. */
  2313. function overArg(func, transform) {
  2314. return function(arg) {
  2315. return func(transform(arg));
  2316. };
  2317. }
  2318. /**
  2319. * Replaces all `placeholder` elements in `array` with an internal placeholder
  2320. * and returns an array of their indexes.
  2321. *
  2322. * @private
  2323. * @param {Array} array The array to modify.
  2324. * @param {*} placeholder The placeholder to replace.
  2325. * @returns {Array} Returns the new array of placeholder indexes.
  2326. */
  2327. function replaceHolders(array, placeholder) {
  2328. var index = -1,
  2329. length = array.length,
  2330. resIndex = 0,
  2331. result = [];
  2332. while (++index < length) {
  2333. var value = array[index];
  2334. if (value === placeholder || value === PLACEHOLDER) {
  2335. array[index] = PLACEHOLDER;
  2336. result[resIndex++] = index;
  2337. }
  2338. }
  2339. return result;
  2340. }
  2341. /**
  2342. * Converts `set` to an array of its values.
  2343. *
  2344. * @private
  2345. * @param {Object} set The set to convert.
  2346. * @returns {Array} Returns the values.
  2347. */
  2348. function setToArray(set) {
  2349. var index = -1,
  2350. result = Array(set.size);
  2351. set.forEach(function(value) {
  2352. result[++index] = value;
  2353. });
  2354. return result;
  2355. }
  2356. /**
  2357. * Converts `set` to its value-value pairs.
  2358. *
  2359. * @private
  2360. * @param {Object} set The set to convert.
  2361. * @returns {Array} Returns the value-value pairs.
  2362. */
  2363. function setToPairs(set) {
  2364. var index = -1,
  2365. result = Array(set.size);
  2366. set.forEach(function(value) {
  2367. result[++index] = [value, value];
  2368. });
  2369. return result;
  2370. }
  2371. /**
  2372. * A specialized version of `_.indexOf` which performs strict equality
  2373. * comparisons of values, i.e. `===`.
  2374. *
  2375. * @private
  2376. * @param {Array} array The array to inspect.
  2377. * @param {*} value The value to search for.
  2378. * @param {number} fromIndex The index to search from.
  2379. * @returns {number} Returns the index of the matched value, else `-1`.
  2380. */
  2381. function strictIndexOf(array, value, fromIndex) {
  2382. var index = fromIndex - 1,
  2383. length = array.length;
  2384. while (++index < length) {
  2385. if (array[index] === value) {
  2386. return index;
  2387. }
  2388. }
  2389. return -1;
  2390. }
  2391. /**
  2392. * A specialized version of `_.lastIndexOf` which performs strict equality
  2393. * comparisons of values, i.e. `===`.
  2394. *
  2395. * @private
  2396. * @param {Array} array The array to inspect.
  2397. * @param {*} value The value to search for.
  2398. * @param {number} fromIndex The index to search from.
  2399. * @returns {number} Returns the index of the matched value, else `-1`.
  2400. */
  2401. function strictLastIndexOf(array, value, fromIndex) {
  2402. var index = fromIndex + 1;
  2403. while (index--) {
  2404. if (array[index] === value) {
  2405. return index;
  2406. }
  2407. }
  2408. return index;
  2409. }
  2410. /**
  2411. * Gets the number of symbols in `string`.
  2412. *
  2413. * @private
  2414. * @param {string} string The string to inspect.
  2415. * @returns {number} Returns the string size.
  2416. */
  2417. function stringSize(string) {
  2418. return hasUnicode(string)
  2419. ? unicodeSize(string)
  2420. : asciiSize(string);
  2421. }
  2422. /**
  2423. * Converts `string` to an array.
  2424. *
  2425. * @private
  2426. * @param {string} string The string to convert.
  2427. * @returns {Array} Returns the converted array.
  2428. */
  2429. function stringToArray(string) {
  2430. return hasUnicode(string)
  2431. ? unicodeToArray(string)
  2432. : asciiToArray(string);
  2433. }
  2434. /**
  2435. * Used by `_.trim` and `_.trimEnd` to get the index of the last non-whitespace
  2436. * character of `string`.
  2437. *
  2438. * @private
  2439. * @param {string} string The string to inspect.
  2440. * @returns {number} Returns the index of the last non-whitespace character.
  2441. */
  2442. function trimmedEndIndex(string) {
  2443. var index = string.length;
  2444. while (index-- && reWhitespace.test(string.charAt(index))) {}
  2445. return index;
  2446. }
  2447. /**
  2448. * Used by `_.unescape` to convert HTML entities to characters.
  2449. *
  2450. * @private
  2451. * @param {string} chr The matched character to unescape.
  2452. * @returns {string} Returns the unescaped character.
  2453. */
  2454. var unescapeHtmlChar = basePropertyOf(htmlUnescapes);
  2455. /**
  2456. * Gets the size of a Unicode `string`.
  2457. *
  2458. * @private
  2459. * @param {string} string The string inspect.
  2460. * @returns {number} Returns the string size.
  2461. */
  2462. function unicodeSize(string) {
  2463. var result = reUnicode.lastIndex = 0;
  2464. while (reUnicode.test(string)) {
  2465. ++result;
  2466. }
  2467. return result;
  2468. }
  2469. /**
  2470. * Converts a Unicode `string` to an array.
  2471. *
  2472. * @private
  2473. * @param {string} string The string to convert.
  2474. * @returns {Array} Returns the converted array.
  2475. */
  2476. function unicodeToArray(string) {
  2477. return string.match(reUnicode) || [];
  2478. }
  2479. /**
  2480. * Splits a Unicode `string` into an array of its words.
  2481. *
  2482. * @private
  2483. * @param {string} The string to inspect.
  2484. * @returns {Array} Returns the words of `string`.
  2485. */
  2486. function unicodeWords(string) {
  2487. return string.match(reUnicodeWord) || [];
  2488. }
  2489. /*--------------------------------------------------------------------------*/
  2490. /**
  2491. * Create a new pristine `lodash` function using the `context` object.
  2492. *
  2493. * @static
  2494. * @memberOf _
  2495. * @since 1.1.0
  2496. * @category Util
  2497. * @param {Object} [context=root] The context object.
  2498. * @returns {Function} Returns a new `lodash` function.
  2499. * @example
  2500. *
  2501. * _.mixin({ 'foo': _.constant('foo') });
  2502. *
  2503. * var lodash = _.runInContext();
  2504. * lodash.mixin({ 'bar': lodash.constant('bar') });
  2505. *
  2506. * _.isFunction(_.foo);
  2507. * // => true
  2508. * _.isFunction(_.bar);
  2509. * // => false
  2510. *
  2511. * lodash.isFunction(lodash.foo);
  2512. * // => false
  2513. * lodash.isFunction(lodash.bar);
  2514. * // => true
  2515. *
  2516. * // Create a suped-up `defer` in Node.js.
  2517. * var defer = _.runInContext({ 'setTimeout': setImmediate }).defer;
  2518. */
  2519. var runInContext = (function runInContext(context) {
  2520. context = context == null ? root : _.defaults(root.Object(), context, _.pick(root, contextProps));
  2521. /** Built-in constructor references. */
  2522. var Array = context.Array,
  2523. Date = context.Date,
  2524. Error = context.Error,
  2525. Function = context.Function,
  2526. Math = context.Math,
  2527. Object = context.Object,
  2528. RegExp = context.RegExp,
  2529. String = context.String,
  2530. TypeError = context.TypeError;
  2531. /** Used for built-in method references. */
  2532. var arrayProto = Array.prototype,
  2533. funcProto = Function.prototype,
  2534. objectProto = Object.prototype;
  2535. /** Used to detect overreaching core-js shims. */
  2536. var coreJsData = context['__core-js_shared__'];
  2537. /** Used to resolve the decompiled source of functions. */
  2538. var funcToString = funcProto.toString;
  2539. /** Used to check objects for own properties. */
  2540. var hasOwnProperty = objectProto.hasOwnProperty;
  2541. /** Used to generate unique IDs. */
  2542. var idCounter = 0;
  2543. /** Used to detect methods masquerading as native. */
  2544. var maskSrcKey = (function() {
  2545. var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || '');
  2546. return uid ? ('Symbol(src)_1.' + uid) : '';
  2547. }());
  2548. /**
  2549. * Used to resolve the
  2550. * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
  2551. * of values.
  2552. */
  2553. var nativeObjectToString = objectProto.toString;
  2554. /** Used to infer the `Object` constructor. */
  2555. var objectCtorString = funcToString.call(Object);
  2556. /** Used to restore the original `_` reference in `_.noConflict`. */
  2557. var oldDash = root._;
  2558. /** Used to detect if a method is native. */
  2559. var reIsNative = RegExp('^' +
  2560. funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\$&')
  2561. .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$'
  2562. );
  2563. /** Built-in value references. */
  2564. var Buffer = moduleExports ? context.Buffer : undefined,
  2565. Symbol = context.Symbol,
  2566. Uint8Array = context.Uint8Array,
  2567. allocUnsafe = Buffer ? Buffer.allocUnsafe : undefined,
  2568. getPrototype = overArg(Object.getPrototypeOf, Object),
  2569. objectCreate = Object.create,
  2570. propertyIsEnumerable = objectProto.propertyIsEnumerable,
  2571. splice = arrayProto.splice,
  2572. spreadableSymbol = Symbol ? Symbol.isConcatSpreadable : undefined,
  2573. symIterator = Symbol ? Symbol.iterator : undefined,
  2574. symToStringTag = Symbol ? Symbol.toStringTag : undefined;
  2575. var defineProperty = (function() {
  2576. try {
  2577. var func = getNative(Object, 'defineProperty');
  2578. func({}, '', {});
  2579. return func;
  2580. } catch (e) {}
  2581. }());
  2582. /** Mocked built-ins. */
  2583. var ctxClearTimeout = context.clearTimeout !== root.clearTimeout && context.clearTimeout,
  2584. ctxNow = Date && Date.now !== root.Date.now && Date.now,
  2585. ctxSetTimeout = context.setTimeout !== root.setTimeout && context.setTimeout;
  2586. /* Built-in method references for those with the same name as other `lodash` methods. */
  2587. var nativeCeil = Math.ceil,
  2588. nativeFloor = Math.floor,
  2589. nativeGetSymbols = Object.getOwnPropertySymbols,
  2590. nativeIsBuffer = Buffer ? Buffer.isBuffer : undefined,
  2591. nativeIsFinite = context.isFinite,
  2592. nativeJoin = arrayProto.join,
  2593. nativeKeys = overArg(Object.keys, Object),
  2594. nativeMax = Math.max,
  2595. nativeMin = Math.min,
  2596. nativeNow = Date.now,
  2597. nativeParseInt = context.parseInt,
  2598. nativeRandom = Math.random,
  2599. nativeReverse = arrayProto.reverse;
  2600. /* Built-in method references that are verified to be native. */
  2601. var DataView = getNative(context, 'DataView'),
  2602. Map = getNative(context, 'Map'),
  2603. Promise = getNative(context, 'Promise'),
  2604. Set = getNative(context, 'Set'),
  2605. WeakMap = getNative(context, 'WeakMap'),
  2606. nativeCreate = getNative(Object, 'create');
  2607. /** Used to store function metadata. */
  2608. var metaMap = WeakMap && new WeakMap;
  2609. /** Used to lookup unminified function names. */
  2610. var realNames = {};
  2611. /** Used to detect maps, sets, and weakmaps. */
  2612. var dataViewCtorString = toSource(DataView),
  2613. mapCtorString = toSource(Map),
  2614. promiseCtorString = toSource(Promise),
  2615. setCtorString = toSource(Set),
  2616. weakMapCtorString = toSource(WeakMap);
  2617. /** Used to convert symbols to primitives and strings. */
  2618. var symbolProto = Symbol ? Symbol.prototype : undefined,
  2619. symbolValueOf = symbolProto ? symbolProto.valueOf : undefined,
  2620. symbolToString = symbolProto ? symbolProto.toString : undefined;
  2621. /*------------------------------------------------------------------------*/
  2622. /**
  2623. * Creates a `lodash` object which wraps `value` to enable implicit method
  2624. * chain sequences. Methods that operate on and return arrays, collections,
  2625. * and functions can be chained together. Methods that retrieve a single value
  2626. * or may return a primitive value will automatically end the chain sequence
  2627. * and return the unwrapped value. Otherwise, the value must be unwrapped
  2628. * with `_#value`.
  2629. *
  2630. * Explicit chain sequences, which must be unwrapped with `_#value`, may be
  2631. * enabled using `_.chain`.
  2632. *
  2633. * The execution of chained methods is lazy, that is, it's deferred until
  2634. * `_#value` is implicitly or explicitly called.
  2635. *
  2636. * Lazy evaluation allows several methods to support shortcut fusion.
  2637. * Shortcut fusion is an optimization to merge iteratee calls; this avoids
  2638. * the creation of intermediate arrays and can greatly reduce the number of
  2639. * iteratee executions. Sections of a chain sequence qualify for shortcut
  2640. * fusion if the section is applied to an array and iteratees accept only
  2641. * one argument. The heuristic for whether a section qualifies for shortcut
  2642. * fusion is subject to change.
  2643. *
  2644. * Chaining is supported in custom builds as long as the `_#value` method is
  2645. * directly or indirectly included in the build.
  2646. *
  2647. * In addition to lodash methods, wrappers have `Array` and `String` methods.
  2648. *
  2649. * The wrapper `Array` methods are:
  2650. * `concat`, `join`, `pop`, `push`, `shift`, `sort`, `splice`, and `unshift`
  2651. *
  2652. * The wrapper `String` methods are:
  2653. * `replace` and `split`
  2654. *
  2655. * The wrapper methods that support shortcut fusion are:
  2656. * `at`, `compact`, `drop`, `dropRight`, `dropWhile`, `filter`, `find`,
  2657. * `findLast`, `head`, `initial`, `last`, `map`, `reject`, `reverse`, `slice`,
  2658. * `tail`, `take`, `takeRight`, `takeRightWhile`, `takeWhile`, and `toArray`
  2659. *
  2660. * The chainable wrapper methods are:
  2661. * `after`, `ary`, `assign`, `assignIn`, `assignInWith`, `assignWith`, `at`,
  2662. * `before`, `bind`, `bindAll`, `bindKey`, `castArray`, `chain`, `chunk`,
  2663. * `commit`, `compact`, `concat`, `conforms`, `constant`, `countBy`, `create`,
  2664. * `curry`, `debounce`, `defaults`, `defaultsDeep`, `defer`, `delay`,
  2665. * `difference`, `differenceBy`, `differenceWith`, `drop`, `dropRight`,
  2666. * `dropRightWhile`, `dropWhile`, `extend`, `extendWith`, `fill`, `filter`,
  2667. * `flatMap`, `flatMapDeep`, `flatMapDepth`, `flatten`, `flattenDeep`,
  2668. * `flattenDepth`, `flip`, `flow`, `flowRight`, `fromPairs`, `functions`,
  2669. * `functionsIn`, `groupBy`, `initial`, `intersection`, `intersectionBy`,
  2670. * `intersectionWith`, `invert`, `invertBy`, `invokeMap`, `iteratee`, `keyBy`,
  2671. * `keys`, `keysIn`, `map`, `mapKeys`, `mapValues`, `matches`, `matchesProperty`,
  2672. * `memoize`, `merge`, `mergeWith`, `method`, `methodOf`, `mixin`, `negate`,
  2673. * `nthArg`, `omit`, `omitBy`, `once`, `orderBy`, `over`, `overArgs`,
  2674. * `overEvery`, `overSome`, `partial`, `partialRight`, `partition`, `pick`,
  2675. * `pickBy`, `plant`, `property`, `propertyOf`, `pull`, `pullAll`, `pullAllBy`,
  2676. * `pullAllWith`, `pullAt`, `push`, `range`, `rangeRight`, `rearg`, `reject`,
  2677. * `remove`, `rest`, `reverse`, `sampleSize`, `set`, `setWith`, `shuffle`,
  2678. * `slice`, `sort`, `sortBy`, `splice`, `spread`, `tail`, `take`, `takeRight`,
  2679. * `takeRightWhile`, `takeWhile`, `tap`, `throttle`, `thru`, `toArray`,
  2680. * `toPairs`, `toPairsIn`, `toPath`, `toPlainObject`, `transform`, `unary`,
  2681. * `union`, `unionBy`, `unionWith`, `uniq`, `uniqBy`, `uniqWith`, `unset`,
  2682. * `unshift`, `unzip`, `unzipWith`, `update`, `updateWith`, `values`,
  2683. * `valuesIn`, `without`, `wrap`, `xor`, `xorBy`, `xorWith`, `zip`,
  2684. * `zipObject`, `zipObjectDeep`, and `zipWith`
  2685. *
  2686. * The wrapper methods that are **not** chainable by default are:
  2687. * `add`, `attempt`, `camelCase`, `capitalize`, `ceil`, `clamp`, `clone`,
  2688. * `cloneDeep`, `cloneDeepWith`, `cloneWith`, `conformsTo`, `deburr`,
  2689. * `defaultTo`, `divide`, `each`, `eachRight`, `endsWith`, `eq`, `escape`,
  2690. * `escapeRegExp`, `every`, `find`, `findIndex`, `findKey`, `findLast`,
  2691. * `findLastIndex`, `findLastKey`, `first`, `floor`, `forEach`, `forEachRight`,
  2692. * `forIn`, `forInRight`, `forOwn`, `forOwnRight`, `get`, `gt`, `gte`, `has`,
  2693. * `hasIn`, `head`, `identity`, `includes`, `indexOf`, `inRange`, `invoke`,
  2694. * `isArguments`, `isArray`, `isArrayBuffer`, `isArrayLike`, `isArrayLikeObject`,
  2695. * `isBoolean`, `isBuffer`, `isDate`, `isElement`, `isEmpty`, `isEqual`,
  2696. * `isEqualWith`, `isError`, `isFinite`, `isFunction`, `isInteger`, `isLength`,
  2697. * `isMap`, `isMatch`, `isMatchWith`, `isNaN`, `isNative`, `isNil`, `isNull`,
  2698. * `isNumber`, `isObject`, `isObjectLike`, `isPlainObject`, `isRegExp`,
  2699. * `isSafeInteger`, `isSet`, `isString`, `isUndefined`, `isTypedArray`,
  2700. * `isWeakMap`, `isWeakSet`, `join`, `kebabCase`, `last`, `lastIndexOf`,
  2701. * `lowerCase`, `lowerFirst`, `lt`, `lte`, `max`, `maxBy`, `mean`, `meanBy`,
  2702. * `min`, `minBy`, `multiply`, `noConflict`, `noop`, `now`, `nth`, `pad`,
  2703. * `padEnd`, `padStart`, `parseInt`, `pop`, `random`, `reduce`, `reduceRight`,
  2704. * `repeat`, `result`, `round`, `runInContext`, `sample`, `shift`, `size`,
  2705. * `snakeCase`, `some`, `sortedIndex`, `sortedIndexBy`, `sortedLastIndex`,
  2706. * `sortedLastIndexBy`, `startCase`, `startsWith`, `stubArray`, `stubFalse`,
  2707. * `stubObject`, `stubString`, `stubTrue`, `subtract`, `sum`, `sumBy`,
  2708. * `template`, `times`, `toFinite`, `toInteger`, `toJSON`, `toLength`,
  2709. * `toLower`, `toNumber`, `toSafeInteger`, `toString`, `toUpper`, `trim`,
  2710. * `trimEnd`, `trimStart`, `truncate`, `unescape`, `uniqueId`, `upperCase`,
  2711. * `upperFirst`, `value`, and `words`
  2712. *
  2713. * @name _
  2714. * @constructor
  2715. * @category Seq
  2716. * @param {*} value The value to wrap in a `lodash` instance.
  2717. * @returns {Object} Returns the new `lodash` wrapper instance.
  2718. * @example
  2719. *
  2720. * function square(n) {
  2721. * return n * n;
  2722. * }
  2723. *
  2724. * var wrapped = _([1, 2, 3]);
  2725. *
  2726. * // Returns an unwrapped value.
  2727. * wrapped.reduce(_.add);
  2728. * // => 6
  2729. *
  2730. * // Returns a wrapped value.
  2731. * var squares = wrapped.map(square);
  2732. *
  2733. * _.isArray(squares);
  2734. * // => false
  2735. *
  2736. * _.isArray(squares.value());
  2737. * // => true
  2738. */
  2739. function lodash(value) {
  2740. if (isObjectLike(value) && !isArray(value) && !(value instanceof LazyWrapper)) {
  2741. if (value instanceof LodashWrapper) {
  2742. return value;
  2743. }
  2744. if (hasOwnProperty.call(value, '__wrapped__')) {
  2745. return wrapperClone(value);
  2746. }
  2747. }
  2748. return new LodashWrapper(value);
  2749. }
  2750. /**
  2751. * The base implementation of `_.create` without support for assigning
  2752. * properties to the created object.
  2753. *
  2754. * @private
  2755. * @param {Object} proto The object to inherit from.
  2756. * @returns {Object} Returns the new object.
  2757. */
  2758. var baseCreate = (function() {
  2759. function object() {}
  2760. return function(proto) {
  2761. if (!isObject(proto)) {
  2762. return {};
  2763. }
  2764. if (objectCreate) {
  2765. return objectCreate(proto);
  2766. }
  2767. object.prototype = proto;
  2768. var result = new object;
  2769. object.prototype = undefined;
  2770. return result;
  2771. };
  2772. }());
  2773. /**
  2774. * The function whose prototype chain sequence wrappers inherit from.
  2775. *
  2776. * @private
  2777. */
  2778. function baseLodash() {
  2779. // No operation performed.
  2780. }
  2781. /**
  2782. * The base constructor for creating `lodash` wrapper objects.
  2783. *
  2784. * @private
  2785. * @param {*} value The value to wrap.
  2786. * @param {boolean} [chainAll] Enable explicit method chain sequences.
  2787. */
  2788. function LodashWrapper(value, chainAll) {
  2789. this.__wrapped__ = value;
  2790. this.__actions__ = [];
  2791. this.__chain__ = !!chainAll;
  2792. this.__index__ = 0;
  2793. this.__values__ = undefined;
  2794. }
  2795. /**
  2796. * By default, the template delimiters used by lodash are like those in
  2797. * embedded Ruby (ERB) as well as ES2015 template strings. Change the
  2798. * following template settings to use alternative delimiters.
  2799. *
  2800. * @static
  2801. * @memberOf _
  2802. * @type {Object}
  2803. */
  2804. lodash.templateSettings = {
  2805. /**
  2806. * Used to detect `data` property values to be HTML-escaped.
  2807. *
  2808. * @memberOf _.templateSettings
  2809. * @type {RegExp}
  2810. */
  2811. 'escape': reEscape,
  2812. /**
  2813. * Used to detect code to be evaluated.
  2814. *
  2815. * @memberOf _.templateSettings
  2816. * @type {RegExp}
  2817. */
  2818. 'evaluate': reEvaluate,
  2819. /**
  2820. * Used to detect `data` property values to inject.
  2821. *
  2822. * @memberOf _.templateSettings
  2823. * @type {RegExp}
  2824. */
  2825. 'interpolate': reInterpolate,
  2826. /**
  2827. * Used to reference the data object in the template text.
  2828. *
  2829. * @memberOf _.templateSettings
  2830. * @type {string}
  2831. */
  2832. 'variable': '',
  2833. /**
  2834. * Used to import variables into the compiled template.
  2835. *
  2836. * @memberOf _.templateSettings
  2837. * @type {Object}
  2838. */
  2839. 'imports': {
  2840. /**
  2841. * A reference to the `lodash` function.
  2842. *
  2843. * @memberOf _.templateSettings.imports
  2844. * @type {Function}
  2845. */
  2846. '_': lodash
  2847. }
  2848. };
  2849. // Ensure wrappers are instances of `baseLodash`.
  2850. lodash.prototype = baseLodash.prototype;
  2851. lodash.prototype.constructor = lodash;
  2852. LodashWrapper.prototype = baseCreate(baseLodash.prototype);
  2853. LodashWrapper.prototype.constructor = LodashWrapper;
  2854. /*------------------------------------------------------------------------*/
  2855. /**
  2856. * Creates a lazy wrapper object which wraps `value` to enable lazy evaluation.
  2857. *
  2858. * @private
  2859. * @constructor
  2860. * @param {*} value The value to wrap.
  2861. */
  2862. function LazyWrapper(value) {
  2863. this.__wrapped__ = value;
  2864. this.__actions__ = [];
  2865. this.__dir__ = 1;
  2866. this.__filtered__ = false;
  2867. this.__iteratees__ = [];
  2868. this.__takeCount__ = MAX_ARRAY_LENGTH;
  2869. this.__views__ = [];
  2870. }
  2871. /**
  2872. * Creates a clone of the lazy wrapper object.
  2873. *
  2874. * @private
  2875. * @name clone
  2876. * @memberOf LazyWrapper
  2877. * @returns {Object} Returns the cloned `LazyWrapper` object.
  2878. */
  2879. function lazyClone() {
  2880. var result = new LazyWrapper(this.__wrapped__);
  2881. result.__actions__ = copyArray(this.__actions__);
  2882. result.__dir__ = this.__dir__;
  2883. result.__filtered__ = this.__filtered__;
  2884. result.__iteratees__ = copyArray(this.__iteratees__);
  2885. result.__takeCount__ = this.__takeCount__;
  2886. result.__views__ = copyArray(this.__views__);
  2887. return result;
  2888. }
  2889. /**
  2890. * Reverses the direction of lazy iteration.
  2891. *
  2892. * @private
  2893. * @name reverse
  2894. * @memberOf LazyWrapper
  2895. * @returns {Object} Returns the new reversed `LazyWrapper` object.
  2896. */
  2897. function lazyReverse() {
  2898. if (this.__filtered__) {
  2899. var result = new LazyWrapper(this);
  2900. result.__dir__ = -1;
  2901. result.__filtered__ = true;
  2902. } else {
  2903. result = this.clone();
  2904. result.__dir__ *= -1;
  2905. }
  2906. return result;
  2907. }
  2908. /**
  2909. * Extracts the unwrapped value from its lazy wrapper.
  2910. *
  2911. * @private
  2912. * @name value
  2913. * @memberOf LazyWrapper
  2914. * @returns {*} Returns the unwrapped value.
  2915. */
  2916. function lazyValue() {
  2917. var array = this.__wrapped__.value(),
  2918. dir = this.__dir__,
  2919. isArr = isArray(array),
  2920. isRight = dir < 0,
  2921. arrLength = isArr ? array.length : 0,
  2922. view = getView(0, arrLength, this.__views__),
  2923. start = view.start,
  2924. end = view.end,
  2925. length = end - start,
  2926. index = isRight ? end : (start - 1),
  2927. iteratees = this.__iteratees__,
  2928. iterLength = iteratees.length,
  2929. resIndex = 0,
  2930. takeCount = nativeMin(length, this.__takeCount__);
  2931. if (!isArr || (!isRight && arrLength == length && takeCount == length)) {
  2932. return baseWrapperValue(array, this.__actions__);
  2933. }
  2934. var result = [];
  2935. outer:
  2936. while (length-- && resIndex < takeCount) {
  2937. index += dir;
  2938. var iterIndex = -1,
  2939. value = array[index];
  2940. while (++iterIndex < iterLength) {
  2941. var data = iteratees[iterIndex],
  2942. iteratee = data.iteratee,
  2943. type = data.type,
  2944. computed = iteratee(value);
  2945. if (type == LAZY_MAP_FLAG) {
  2946. value = computed;
  2947. } else if (!computed) {
  2948. if (type == LAZY_FILTER_FLAG) {
  2949. continue outer;
  2950. } else {
  2951. break outer;
  2952. }
  2953. }
  2954. }
  2955. result[resIndex++] = value;
  2956. }
  2957. return result;
  2958. }
  2959. // Ensure `LazyWrapper` is an instance of `baseLodash`.
  2960. LazyWrapper.prototype = baseCreate(baseLodash.prototype);
  2961. LazyWrapper.prototype.constructor = LazyWrapper;
  2962. /*------------------------------------------------------------------------*/
  2963. /**
  2964. * Creates a hash object.
  2965. *
  2966. * @private
  2967. * @constructor
  2968. * @param {Array} [entries] The key-value pairs to cache.
  2969. */
  2970. function Hash(entries) {
  2971. var index = -1,
  2972. length = entries == null ? 0 : entries.length;
  2973. this.clear();
  2974. while (++index < length) {
  2975. var entry = entries[index];
  2976. this.set(entry[0], entry[1]);
  2977. }
  2978. }
  2979. /**
  2980. * Removes all key-value entries from the hash.
  2981. *
  2982. * @private
  2983. * @name clear
  2984. * @memberOf Hash
  2985. */
  2986. function hashClear() {
  2987. this.__data__ = nativeCreate ? nativeCreate(null) : {};
  2988. this.size = 0;
  2989. }
  2990. /**
  2991. * Removes `key` and its value from the hash.
  2992. *
  2993. * @private
  2994. * @name delete
  2995. * @memberOf Hash
  2996. * @param {Object} hash The hash to modify.
  2997. * @param {string} key The key of the value to remove.
  2998. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  2999. */
  3000. function hashDelete(key) {
  3001. var result = this.has(key) && delete this.__data__[key];
  3002. this.size -= result ? 1 : 0;
  3003. return result;
  3004. }
  3005. /**
  3006. * Gets the hash value for `key`.
  3007. *
  3008. * @private
  3009. * @name get
  3010. * @memberOf Hash
  3011. * @param {string} key The key of the value to get.
  3012. * @returns {*} Returns the entry value.
  3013. */
  3014. function hashGet(key) {
  3015. var data = this.__data__;
  3016. if (nativeCreate) {
  3017. var result = data[key];
  3018. return result === HASH_UNDEFINED ? undefined : result;
  3019. }
  3020. return hasOwnProperty.call(data, key) ? data[key] : undefined;
  3021. }
  3022. /**
  3023. * Checks if a hash value for `key` exists.
  3024. *
  3025. * @private
  3026. * @name has
  3027. * @memberOf Hash
  3028. * @param {string} key The key of the entry to check.
  3029. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  3030. */
  3031. function hashHas(key) {
  3032. var data = this.__data__;
  3033. return nativeCreate ? (data[key] !== undefined) : hasOwnProperty.call(data, key);
  3034. }
  3035. /**
  3036. * Sets the hash `key` to `value`.
  3037. *
  3038. * @private
  3039. * @name set
  3040. * @memberOf Hash
  3041. * @param {string} key The key of the value to set.
  3042. * @param {*} value The value to set.
  3043. * @returns {Object} Returns the hash instance.
  3044. */
  3045. function hashSet(key, value) {
  3046. var data = this.__data__;
  3047. this.size += this.has(key) ? 0 : 1;
  3048. data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value;
  3049. return this;
  3050. }
  3051. // Add methods to `Hash`.
  3052. Hash.prototype.clear = hashClear;
  3053. Hash.prototype['delete'] = hashDelete;
  3054. Hash.prototype.get = hashGet;
  3055. Hash.prototype.has = hashHas;
  3056. Hash.prototype.set = hashSet;
  3057. /*------------------------------------------------------------------------*/
  3058. /**
  3059. * Creates an list cache object.
  3060. *
  3061. * @private
  3062. * @constructor
  3063. * @param {Array} [entries] The key-value pairs to cache.
  3064. */
  3065. function ListCache(entries) {
  3066. var index = -1,
  3067. length = entries == null ? 0 : entries.length;
  3068. this.clear();
  3069. while (++index < length) {
  3070. var entry = entries[index];
  3071. this.set(entry[0], entry[1]);
  3072. }
  3073. }
  3074. /**
  3075. * Removes all key-value entries from the list cache.
  3076. *
  3077. * @private
  3078. * @name clear
  3079. * @memberOf ListCache
  3080. */
  3081. function listCacheClear() {
  3082. this.__data__ = [];
  3083. this.size = 0;
  3084. }
  3085. /**
  3086. * Removes `key` and its value from the list cache.
  3087. *
  3088. * @private
  3089. * @name delete
  3090. * @memberOf ListCache
  3091. * @param {string} key The key of the value to remove.
  3092. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  3093. */
  3094. function listCacheDelete(key) {
  3095. var data = this.__data__,
  3096. index = assocIndexOf(data, key);
  3097. if (index < 0) {
  3098. return false;
  3099. }
  3100. var lastIndex = data.length - 1;
  3101. if (index == lastIndex) {
  3102. data.pop();
  3103. } else {
  3104. splice.call(data, index, 1);
  3105. }
  3106. --this.size;
  3107. return true;
  3108. }
  3109. /**
  3110. * Gets the list cache value for `key`.
  3111. *
  3112. * @private
  3113. * @name get
  3114. * @memberOf ListCache
  3115. * @param {string} key The key of the value to get.
  3116. * @returns {*} Returns the entry value.
  3117. */
  3118. function listCacheGet(key) {
  3119. var data = this.__data__,
  3120. index = assocIndexOf(data, key);
  3121. return index < 0 ? undefined : data[index][1];
  3122. }
  3123. /**
  3124. * Checks if a list cache value for `key` exists.
  3125. *
  3126. * @private
  3127. * @name has
  3128. * @memberOf ListCache
  3129. * @param {string} key The key of the entry to check.
  3130. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  3131. */
  3132. function listCacheHas(key) {
  3133. return assocIndexOf(this.__data__, key) > -1;
  3134. }
  3135. /**
  3136. * Sets the list cache `key` to `value`.
  3137. *
  3138. * @private
  3139. * @name set
  3140. * @memberOf ListCache
  3141. * @param {string} key The key of the value to set.
  3142. * @param {*} value The value to set.
  3143. * @returns {Object} Returns the list cache instance.
  3144. */
  3145. function listCacheSet(key, value) {
  3146. var data = this.__data__,
  3147. index = assocIndexOf(data, key);
  3148. if (index < 0) {
  3149. ++this.size;
  3150. data.push([key, value]);
  3151. } else {
  3152. data[index][1] = value;
  3153. }
  3154. return this;
  3155. }
  3156. // Add methods to `ListCache`.
  3157. ListCache.prototype.clear = listCacheClear;
  3158. ListCache.prototype['delete'] = listCacheDelete;
  3159. ListCache.prototype.get = listCacheGet;
  3160. ListCache.prototype.has = listCacheHas;
  3161. ListCache.prototype.set = listCacheSet;
  3162. /*------------------------------------------------------------------------*/
  3163. /**
  3164. * Creates a map cache object to store key-value pairs.
  3165. *
  3166. * @private
  3167. * @constructor
  3168. * @param {Array} [entries] The key-value pairs to cache.
  3169. */
  3170. function MapCache(entries) {
  3171. var index = -1,
  3172. length = entries == null ? 0 : entries.length;
  3173. this.clear();
  3174. while (++index < length) {
  3175. var entry = entries[index];
  3176. this.set(entry[0], entry[1]);
  3177. }
  3178. }
  3179. /**
  3180. * Removes all key-value entries from the map.
  3181. *
  3182. * @private
  3183. * @name clear
  3184. * @memberOf MapCache
  3185. */
  3186. function mapCacheClear() {
  3187. this.size = 0;
  3188. this.__data__ = {
  3189. 'hash': new Hash,
  3190. 'map': new (Map || ListCache),
  3191. 'string': new Hash
  3192. };
  3193. }
  3194. /**
  3195. * Removes `key` and its value from the map.
  3196. *
  3197. * @private
  3198. * @name delete
  3199. * @memberOf MapCache
  3200. * @param {string} key The key of the value to remove.
  3201. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  3202. */
  3203. function mapCacheDelete(key) {
  3204. var result = getMapData(this, key)['delete'](key);
  3205. this.size -= result ? 1 : 0;
  3206. return result;
  3207. }
  3208. /**
  3209. * Gets the map value for `key`.
  3210. *
  3211. * @private
  3212. * @name get
  3213. * @memberOf MapCache
  3214. * @param {string} key The key of the value to get.
  3215. * @returns {*} Returns the entry value.
  3216. */
  3217. function mapCacheGet(key) {
  3218. return getMapData(this, key).get(key);
  3219. }
  3220. /**
  3221. * Checks if a map value for `key` exists.
  3222. *
  3223. * @private
  3224. * @name has
  3225. * @memberOf MapCache
  3226. * @param {string} key The key of the entry to check.
  3227. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  3228. */
  3229. function mapCacheHas(key) {
  3230. return getMapData(this, key).has(key);
  3231. }
  3232. /**
  3233. * Sets the map `key` to `value`.
  3234. *
  3235. * @private
  3236. * @name set
  3237. * @memberOf MapCache
  3238. * @param {string} key The key of the value to set.
  3239. * @param {*} value The value to set.
  3240. * @returns {Object} Returns the map cache instance.
  3241. */
  3242. function mapCacheSet(key, value) {
  3243. var data = getMapData(this, key),
  3244. size = data.size;
  3245. data.set(key, value);
  3246. this.size += data.size == size ? 0 : 1;
  3247. return this;
  3248. }
  3249. // Add methods to `MapCache`.
  3250. MapCache.prototype.clear = mapCacheClear;
  3251. MapCache.prototype['delete'] = mapCacheDelete;
  3252. MapCache.prototype.get = mapCacheGet;
  3253. MapCache.prototype.has = mapCacheHas;
  3254. MapCache.prototype.set = mapCacheSet;
  3255. /*------------------------------------------------------------------------*/
  3256. /**
  3257. *
  3258. * Creates an array cache object to store unique values.
  3259. *
  3260. * @private
  3261. * @constructor
  3262. * @param {Array} [values] The values to cache.
  3263. */
  3264. function SetCache(values) {
  3265. var index = -1,
  3266. length = values == null ? 0 : values.length;
  3267. this.__data__ = new MapCache;
  3268. while (++index < length) {
  3269. this.add(values[index]);
  3270. }
  3271. }
  3272. /**
  3273. * Adds `value` to the array cache.
  3274. *
  3275. * @private
  3276. * @name add
  3277. * @memberOf SetCache
  3278. * @alias push
  3279. * @param {*} value The value to cache.
  3280. * @returns {Object} Returns the cache instance.
  3281. */
  3282. function setCacheAdd(value) {
  3283. this.__data__.set(value, HASH_UNDEFINED);
  3284. return this;
  3285. }
  3286. /**
  3287. * Checks if `value` is in the array cache.
  3288. *
  3289. * @private
  3290. * @name has
  3291. * @memberOf SetCache
  3292. * @param {*} value The value to search for.
  3293. * @returns {number} Returns `true` if `value` is found, else `false`.
  3294. */
  3295. function setCacheHas(value) {
  3296. return this.__data__.has(value);
  3297. }
  3298. // Add methods to `SetCache`.
  3299. SetCache.prototype.add = SetCache.prototype.push = setCacheAdd;
  3300. SetCache.prototype.has = setCacheHas;
  3301. /*------------------------------------------------------------------------*/
  3302. /**
  3303. * Creates a stack cache object to store key-value pairs.
  3304. *
  3305. * @private
  3306. * @constructor
  3307. * @param {Array} [entries] The key-value pairs to cache.
  3308. */
  3309. function Stack(entries) {
  3310. var data = this.__data__ = new ListCache(entries);
  3311. this.size = data.size;
  3312. }
  3313. /**
  3314. * Removes all key-value entries from the stack.
  3315. *
  3316. * @private
  3317. * @name clear
  3318. * @memberOf Stack
  3319. */
  3320. function stackClear() {
  3321. this.__data__ = new ListCache;
  3322. this.size = 0;
  3323. }
  3324. /**
  3325. * Removes `key` and its value from the stack.
  3326. *
  3327. * @private
  3328. * @name delete
  3329. * @memberOf Stack
  3330. * @param {string} key The key of the value to remove.
  3331. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  3332. */
  3333. function stackDelete(key) {
  3334. var data = this.__data__,
  3335. result = data['delete'](key);
  3336. this.size = data.size;
  3337. return result;
  3338. }
  3339. /**
  3340. * Gets the stack value for `key`.
  3341. *
  3342. * @private
  3343. * @name get
  3344. * @memberOf Stack
  3345. * @param {string} key The key of the value to get.
  3346. * @returns {*} Returns the entry value.
  3347. */
  3348. function stackGet(key) {
  3349. return this.__data__.get(key);
  3350. }
  3351. /**
  3352. * Checks if a stack value for `key` exists.
  3353. *
  3354. * @private
  3355. * @name has
  3356. * @memberOf Stack
  3357. * @param {string} key The key of the entry to check.
  3358. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  3359. */
  3360. function stackHas(key) {
  3361. return this.__data__.has(key);
  3362. }
  3363. /**
  3364. * Sets the stack `key` to `value`.
  3365. *
  3366. * @private
  3367. * @name set
  3368. * @memberOf Stack
  3369. * @param {string} key The key of the value to set.
  3370. * @param {*} value The value to set.
  3371. * @returns {Object} Returns the stack cache instance.
  3372. */
  3373. function stackSet(key, value) {
  3374. var data = this.__data__;
  3375. if (data instanceof ListCache) {
  3376. var pairs = data.__data__;
  3377. if (!Map || (pairs.length < LARGE_ARRAY_SIZE - 1)) {
  3378. pairs.push([key, value]);
  3379. this.size = ++data.size;
  3380. return this;
  3381. }
  3382. data = this.__data__ = new MapCache(pairs);
  3383. }
  3384. data.set(key, value);
  3385. this.size = data.size;
  3386. return this;
  3387. }
  3388. // Add methods to `Stack`.
  3389. Stack.prototype.clear = stackClear;
  3390. Stack.prototype['delete'] = stackDelete;
  3391. Stack.prototype.get = stackGet;
  3392. Stack.prototype.has = stackHas;
  3393. Stack.prototype.set = stackSet;
  3394. /*------------------------------------------------------------------------*/
  3395. /**
  3396. * Creates an array of the enumerable property names of the array-like `value`.
  3397. *
  3398. * @private
  3399. * @param {*} value The value to query.
  3400. * @param {boolean} inherited Specify returning inherited property names.
  3401. * @returns {Array} Returns the array of property names.
  3402. */
  3403. function arrayLikeKeys(value, inherited) {
  3404. var isArr = isArray(value),
  3405. isArg = !isArr && isArguments(value),
  3406. isBuff = !isArr && !isArg && isBuffer(value),
  3407. isType = !isArr && !isArg && !isBuff && isTypedArray(value),
  3408. skipIndexes = isArr || isArg || isBuff || isType,
  3409. result = skipIndexes ? baseTimes(value.length, String) : [],
  3410. length = result.length;
  3411. for (var key in value) {
  3412. if ((inherited || hasOwnProperty.call(value, key)) &&
  3413. !(skipIndexes && (
  3414. // Safari 9 has enumerable `arguments.length` in strict mode.
  3415. key == 'length' ||
  3416. // Node.js 0.10 has enumerable non-index properties on buffers.
  3417. (isBuff && (key == 'offset' || key == 'parent')) ||
  3418. // PhantomJS 2 has enumerable non-index properties on typed arrays.
  3419. (isType && (key == 'buffer' || key == 'byteLength' || key == 'byteOffset')) ||
  3420. // Skip index properties.
  3421. isIndex(key, length)
  3422. ))) {
  3423. result.push(key);
  3424. }
  3425. }
  3426. return result;
  3427. }
  3428. /**
  3429. * A specialized version of `_.sample` for arrays.
  3430. *
  3431. * @private
  3432. * @param {Array} array The array to sample.
  3433. * @returns {*} Returns the random element.
  3434. */
  3435. function arraySample(array) {
  3436. var length = array.length;
  3437. return length ? array[baseRandom(0, length - 1)] : undefined;
  3438. }
  3439. /**
  3440. * A specialized version of `_.sampleSize` for arrays.
  3441. *
  3442. * @private
  3443. * @param {Array} array The array to sample.
  3444. * @param {number} n The number of elements to sample.
  3445. * @returns {Array} Returns the random elements.
  3446. */
  3447. function arraySampleSize(array, n) {
  3448. return shuffleSelf(copyArray(array), baseClamp(n, 0, array.length));
  3449. }
  3450. /**
  3451. * A specialized version of `_.shuffle` for arrays.
  3452. *
  3453. * @private
  3454. * @param {Array} array The array to shuffle.
  3455. * @returns {Array} Returns the new shuffled array.
  3456. */
  3457. function arrayShuffle(array) {
  3458. return shuffleSelf(copyArray(array));
  3459. }
  3460. /**
  3461. * This function is like `assignValue` except that it doesn't assign
  3462. * `undefined` values.
  3463. *
  3464. * @private
  3465. * @param {Object} object The object to modify.
  3466. * @param {string} key The key of the property to assign.
  3467. * @param {*} value The value to assign.
  3468. */
  3469. function assignMergeValue(object, key, value) {
  3470. if ((value !== undefined && !eq(object[key], value)) ||
  3471. (value === undefined && !(key in object))) {
  3472. baseAssignValue(object, key, value);
  3473. }
  3474. }
  3475. /**
  3476. * Assigns `value` to `key` of `object` if the existing value is not equivalent
  3477. * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  3478. * for equality comparisons.
  3479. *
  3480. * @private
  3481. * @param {Object} object The object to modify.
  3482. * @param {string} key The key of the property to assign.
  3483. * @param {*} value The value to assign.
  3484. */
  3485. function assignValue(object, key, value) {
  3486. var objValue = object[key];
  3487. if (!(hasOwnProperty.call(object, key) && eq(objValue, value)) ||
  3488. (value === undefined && !(key in object))) {
  3489. baseAssignValue(object, key, value);
  3490. }
  3491. }
  3492. /**
  3493. * Gets the index at which the `key` is found in `array` of key-value pairs.
  3494. *
  3495. * @private
  3496. * @param {Array} array The array to inspect.
  3497. * @param {*} key The key to search for.
  3498. * @returns {number} Returns the index of the matched value, else `-1`.
  3499. */
  3500. function assocIndexOf(array, key) {
  3501. var length = array.length;
  3502. while (length--) {
  3503. if (eq(array[length][0], key)) {
  3504. return length;
  3505. }
  3506. }
  3507. return -1;
  3508. }
  3509. /**
  3510. * Aggregates elements of `collection` on `accumulator` with keys transformed
  3511. * by `iteratee` and values set by `setter`.
  3512. *
  3513. * @private
  3514. * @param {Array|Object} collection The collection to iterate over.
  3515. * @param {Function} setter The function to set `accumulator` values.
  3516. * @param {Function} iteratee The iteratee to transform keys.
  3517. * @param {Object} accumulator The initial aggregated object.
  3518. * @returns {Function} Returns `accumulator`.
  3519. */
  3520. function baseAggregator(collection, setter, iteratee, accumulator) {
  3521. baseEach(collection, function(value, key, collection) {
  3522. setter(accumulator, value, iteratee(value), collection);
  3523. });
  3524. return accumulator;
  3525. }
  3526. /**
  3527. * The base implementation of `_.assign` without support for multiple sources
  3528. * or `customizer` functions.
  3529. *
  3530. * @private
  3531. * @param {Object} object The destination object.
  3532. * @param {Object} source The source object.
  3533. * @returns {Object} Returns `object`.
  3534. */
  3535. function baseAssign(object, source) {
  3536. return object && copyObject(source, keys(source), object);
  3537. }
  3538. /**
  3539. * The base implementation of `_.assignIn` without support for multiple sources
  3540. * or `customizer` functions.
  3541. *
  3542. * @private
  3543. * @param {Object} object The destination object.
  3544. * @param {Object} source The source object.
  3545. * @returns {Object} Returns `object`.
  3546. */
  3547. function baseAssignIn(object, source) {
  3548. return object && copyObject(source, keysIn(source), object);
  3549. }
  3550. /**
  3551. * The base implementation of `assignValue` and `assignMergeValue` without
  3552. * value checks.
  3553. *
  3554. * @private
  3555. * @param {Object} object The object to modify.
  3556. * @param {string} key The key of the property to assign.
  3557. * @param {*} value The value to assign.
  3558. */
  3559. function baseAssignValue(object, key, value) {
  3560. if (key == '__proto__' && defineProperty) {
  3561. defineProperty(object, key, {
  3562. 'configurable': true,
  3563. 'enumerable': true,
  3564. 'value': value,
  3565. 'writable': true
  3566. });
  3567. } else {
  3568. object[key] = value;
  3569. }
  3570. }
  3571. /**
  3572. * The base implementation of `_.at` without support for individual paths.
  3573. *
  3574. * @private
  3575. * @param {Object} object The object to iterate over.
  3576. * @param {string[]} paths The property paths to pick.
  3577. * @returns {Array} Returns the picked elements.
  3578. */
  3579. function baseAt(object, paths) {
  3580. var index = -1,
  3581. length = paths.length,
  3582. result = Array(length),
  3583. skip = object == null;
  3584. while (++index < length) {
  3585. result[index] = skip ? undefined : get(object, paths[index]);
  3586. }
  3587. return result;
  3588. }
  3589. /**
  3590. * The base implementation of `_.clamp` which doesn't coerce arguments.
  3591. *
  3592. * @private
  3593. * @param {number} number The number to clamp.
  3594. * @param {number} [lower] The lower bound.
  3595. * @param {number} upper The upper bound.
  3596. * @returns {number} Returns the clamped number.
  3597. */
  3598. function baseClamp(number, lower, upper) {
  3599. if (number === number) {
  3600. if (upper !== undefined) {
  3601. number = number <= upper ? number : upper;
  3602. }
  3603. if (lower !== undefined) {
  3604. number = number >= lower ? number : lower;
  3605. }
  3606. }
  3607. return number;
  3608. }
  3609. /**
  3610. * The base implementation of `_.clone` and `_.cloneDeep` which tracks
  3611. * traversed objects.
  3612. *
  3613. * @private
  3614. * @param {*} value The value to clone.
  3615. * @param {boolean} bitmask The bitmask flags.
  3616. * 1 - Deep clone
  3617. * 2 - Flatten inherited properties
  3618. * 4 - Clone symbols
  3619. * @param {Function} [customizer] The function to customize cloning.
  3620. * @param {string} [key] The key of `value`.
  3621. * @param {Object} [object] The parent object of `value`.
  3622. * @param {Object} [stack] Tracks traversed objects and their clone counterparts.
  3623. * @returns {*} Returns the cloned value.
  3624. */
  3625. function baseClone(value, bitmask, customizer, key, object, stack) {
  3626. var result,
  3627. isDeep = bitmask & CLONE_DEEP_FLAG,
  3628. isFlat = bitmask & CLONE_FLAT_FLAG,
  3629. isFull = bitmask & CLONE_SYMBOLS_FLAG;
  3630. if (customizer) {
  3631. result = object ? customizer(value, key, object, stack) : customizer(value);
  3632. }
  3633. if (result !== undefined) {
  3634. return result;
  3635. }
  3636. if (!isObject(value)) {
  3637. return value;
  3638. }
  3639. var isArr = isArray(value);
  3640. if (isArr) {
  3641. result = initCloneArray(value);
  3642. if (!isDeep) {
  3643. return copyArray(value, result);
  3644. }
  3645. } else {
  3646. var tag = getTag(value),
  3647. isFunc = tag == funcTag || tag == genTag;
  3648. if (isBuffer(value)) {
  3649. return cloneBuffer(value, isDeep);
  3650. }
  3651. if (tag == objectTag || tag == argsTag || (isFunc && !object)) {
  3652. result = (isFlat || isFunc) ? {} : initCloneObject(value);
  3653. if (!isDeep) {
  3654. return isFlat
  3655. ? copySymbolsIn(value, baseAssignIn(result, value))
  3656. : copySymbols(value, baseAssign(result, value));
  3657. }
  3658. } else {
  3659. if (!cloneableTags[tag]) {
  3660. return object ? value : {};
  3661. }
  3662. result = initCloneByTag(value, tag, isDeep);
  3663. }
  3664. }
  3665. // Check for circular references and return its corresponding clone.
  3666. stack || (stack = new Stack);
  3667. var stacked = stack.get(value);
  3668. if (stacked) {
  3669. return stacked;
  3670. }
  3671. stack.set(value, result);
  3672. if (isSet(value)) {
  3673. value.forEach(function(subValue) {
  3674. result.add(baseClone(subValue, bitmask, customizer, subValue, value, stack));
  3675. });
  3676. } else if (isMap(value)) {
  3677. value.forEach(function(subValue, key) {
  3678. result.set(key, baseClone(subValue, bitmask, customizer, key, value, stack));
  3679. });
  3680. }
  3681. var keysFunc = isFull
  3682. ? (isFlat ? getAllKeysIn : getAllKeys)
  3683. : (isFlat ? keysIn : keys);
  3684. var props = isArr ? undefined : keysFunc(value);
  3685. arrayEach(props || value, function(subValue, key) {
  3686. if (props) {
  3687. key = subValue;
  3688. subValue = value[key];
  3689. }
  3690. // Recursively populate clone (susceptible to call stack limits).
  3691. assignValue(result, key, baseClone(subValue, bitmask, customizer, key, value, stack));
  3692. });
  3693. return result;
  3694. }
  3695. /**
  3696. * The base implementation of `_.conforms` which doesn't clone `source`.
  3697. *
  3698. * @private
  3699. * @param {Object} source The object of property predicates to conform to.
  3700. * @returns {Function} Returns the new spec function.
  3701. */
  3702. function baseConforms(source) {
  3703. var props = keys(source);
  3704. return function(object) {
  3705. return baseConformsTo(object, source, props);
  3706. };
  3707. }
  3708. /**
  3709. * The base implementation of `_.conformsTo` which accepts `props` to check.
  3710. *
  3711. * @private
  3712. * @param {Object} object The object to inspect.
  3713. * @param {Object} source The object of property predicates to conform to.
  3714. * @returns {boolean} Returns `true` if `object` conforms, else `false`.
  3715. */
  3716. function baseConformsTo(object, source, props) {
  3717. var length = props.length;
  3718. if (object == null) {
  3719. return !length;
  3720. }
  3721. object = Object(object);
  3722. while (length--) {
  3723. var key = props[length],
  3724. predicate = source[key],
  3725. value = object[key];
  3726. if ((value === undefined && !(key in object)) || !predicate(value)) {
  3727. return false;
  3728. }
  3729. }
  3730. return true;
  3731. }
  3732. /**
  3733. * The base implementation of `_.delay` and `_.defer` which accepts `args`
  3734. * to provide to `func`.
  3735. *
  3736. * @private
  3737. * @param {Function} func The function to delay.
  3738. * @param {number} wait The number of milliseconds to delay invocation.
  3739. * @param {Array} args The arguments to provide to `func`.
  3740. * @returns {number|Object} Returns the timer id or timeout object.
  3741. */
  3742. function baseDelay(func, wait, args) {
  3743. if (typeof func != 'function') {
  3744. throw new TypeError(FUNC_ERROR_TEXT);
  3745. }
  3746. return setTimeout(function() { func.apply(undefined, args); }, wait);
  3747. }
  3748. /**
  3749. * The base implementation of methods like `_.difference` without support
  3750. * for excluding multiple arrays or iteratee shorthands.
  3751. *
  3752. * @private
  3753. * @param {Array} array The array to inspect.
  3754. * @param {Array} values The values to exclude.
  3755. * @param {Function} [iteratee] The iteratee invoked per element.
  3756. * @param {Function} [comparator] The comparator invoked per element.
  3757. * @returns {Array} Returns the new array of filtered values.
  3758. */
  3759. function baseDifference(array, values, iteratee, comparator) {
  3760. var index = -1,
  3761. includes = arrayIncludes,
  3762. isCommon = true,
  3763. length = array.length,
  3764. result = [],
  3765. valuesLength = values.length;
  3766. if (!length) {
  3767. return result;
  3768. }
  3769. if (iteratee) {
  3770. values = arrayMap(values, baseUnary(iteratee));
  3771. }
  3772. if (comparator) {
  3773. includes = arrayIncludesWith;
  3774. isCommon = false;
  3775. }
  3776. else if (values.length >= LARGE_ARRAY_SIZE) {
  3777. includes = cacheHas;
  3778. isCommon = false;
  3779. values = new SetCache(values);
  3780. }
  3781. outer:
  3782. while (++index < length) {
  3783. var value = array[index],
  3784. computed = iteratee == null ? value : iteratee(value);
  3785. value = (comparator || value !== 0) ? value : 0;
  3786. if (isCommon && computed === computed) {
  3787. var valuesIndex = valuesLength;
  3788. while (valuesIndex--) {
  3789. if (values[valuesIndex] === computed) {
  3790. continue outer;
  3791. }
  3792. }
  3793. result.push(value);
  3794. }
  3795. else if (!includes(values, computed, comparator)) {
  3796. result.push(value);
  3797. }
  3798. }
  3799. return result;
  3800. }
  3801. /**
  3802. * The base implementation of `_.forEach` without support for iteratee shorthands.
  3803. *
  3804. * @private
  3805. * @param {Array|Object} collection The collection to iterate over.
  3806. * @param {Function} iteratee The function invoked per iteration.
  3807. * @returns {Array|Object} Returns `collection`.
  3808. */
  3809. var baseEach = createBaseEach(baseForOwn);
  3810. /**
  3811. * The base implementation of `_.forEachRight` without support for iteratee shorthands.
  3812. *
  3813. * @private
  3814. * @param {Array|Object} collection The collection to iterate over.
  3815. * @param {Function} iteratee The function invoked per iteration.
  3816. * @returns {Array|Object} Returns `collection`.
  3817. */
  3818. var baseEachRight = createBaseEach(baseForOwnRight, true);
  3819. /**
  3820. * The base implementation of `_.every` without support for iteratee shorthands.
  3821. *
  3822. * @private
  3823. * @param {Array|Object} collection The collection to iterate over.
  3824. * @param {Function} predicate The function invoked per iteration.
  3825. * @returns {boolean} Returns `true` if all elements pass the predicate check,
  3826. * else `false`
  3827. */
  3828. function baseEvery(collection, predicate) {
  3829. var result = true;
  3830. baseEach(collection, function(value, index, collection) {
  3831. result = !!predicate(value, index, collection);
  3832. return result;
  3833. });
  3834. return result;
  3835. }
  3836. /**
  3837. * The base implementation of methods like `_.max` and `_.min` which accepts a
  3838. * `comparator` to determine the extremum value.
  3839. *
  3840. * @private
  3841. * @param {Array} array The array to iterate over.
  3842. * @param {Function} iteratee The iteratee invoked per iteration.
  3843. * @param {Function} comparator The comparator used to compare values.
  3844. * @returns {*} Returns the extremum value.
  3845. */
  3846. function baseExtremum(array, iteratee, comparator) {
  3847. var index = -1,
  3848. length = array.length;
  3849. while (++index < length) {
  3850. var value = array[index],
  3851. current = iteratee(value);
  3852. if (current != null && (computed === undefined
  3853. ? (current === current && !isSymbol(current))
  3854. : comparator(current, computed)
  3855. )) {
  3856. var computed = current,
  3857. result = value;
  3858. }
  3859. }
  3860. return result;
  3861. }
  3862. /**
  3863. * The base implementation of `_.fill` without an iteratee call guard.
  3864. *
  3865. * @private
  3866. * @param {Array} array The array to fill.
  3867. * @param {*} value The value to fill `array` with.
  3868. * @param {number} [start=0] The start position.
  3869. * @param {number} [end=array.length] The end position.
  3870. * @returns {Array} Returns `array`.
  3871. */
  3872. function baseFill(array, value, start, end) {
  3873. var length = array.length;
  3874. start = toInteger(start);
  3875. if (start < 0) {
  3876. start = -start > length ? 0 : (length + start);
  3877. }
  3878. end = (end === undefined || end > length) ? length : toInteger(end);
  3879. if (end < 0) {
  3880. end += length;
  3881. }
  3882. end = start > end ? 0 : toLength(end);
  3883. while (start < end) {
  3884. array[start++] = value;
  3885. }
  3886. return array;
  3887. }
  3888. /**
  3889. * The base implementation of `_.filter` without support for iteratee shorthands.
  3890. *
  3891. * @private
  3892. * @param {Array|Object} collection The collection to iterate over.
  3893. * @param {Function} predicate The function invoked per iteration.
  3894. * @returns {Array} Returns the new filtered array.
  3895. */
  3896. function baseFilter(collection, predicate) {
  3897. var result = [];
  3898. baseEach(collection, function(value, index, collection) {
  3899. if (predicate(value, index, collection)) {
  3900. result.push(value);
  3901. }
  3902. });
  3903. return result;
  3904. }
  3905. /**
  3906. * The base implementation of `_.flatten` with support for restricting flattening.
  3907. *
  3908. * @private
  3909. * @param {Array} array The array to flatten.
  3910. * @param {number} depth The maximum recursion depth.
  3911. * @param {boolean} [predicate=isFlattenable] The function invoked per iteration.
  3912. * @param {boolean} [isStrict] Restrict to values that pass `predicate` checks.
  3913. * @param {Array} [result=[]] The initial result value.
  3914. * @returns {Array} Returns the new flattened array.
  3915. */
  3916. function baseFlatten(array, depth, predicate, isStrict, result) {
  3917. var index = -1,
  3918. length = array.length;
  3919. predicate || (predicate = isFlattenable);
  3920. result || (result = []);
  3921. while (++index < length) {
  3922. var value = array[index];
  3923. if (depth > 0 && predicate(value)) {
  3924. if (depth > 1) {
  3925. // Recursively flatten arrays (susceptible to call stack limits).
  3926. baseFlatten(value, depth - 1, predicate, isStrict, result);
  3927. } else {
  3928. arrayPush(result, value);
  3929. }
  3930. } else if (!isStrict) {
  3931. result[result.length] = value;
  3932. }
  3933. }
  3934. return result;
  3935. }
  3936. /**
  3937. * The base implementation of `baseForOwn` which iterates over `object`
  3938. * properties returned by `keysFunc` and invokes `iteratee` for each property.
  3939. * Iteratee functions may exit iteration early by explicitly returning `false`.
  3940. *
  3941. * @private
  3942. * @param {Object} object The object to iterate over.
  3943. * @param {Function} iteratee The function invoked per iteration.
  3944. * @param {Function} keysFunc The function to get the keys of `object`.
  3945. * @returns {Object} Returns `object`.
  3946. */
  3947. var baseFor = createBaseFor();
  3948. /**
  3949. * This function is like `baseFor` except that it iterates over properties
  3950. * in the opposite order.
  3951. *
  3952. * @private
  3953. * @param {Object} object The object to iterate over.
  3954. * @param {Function} iteratee The function invoked per iteration.
  3955. * @param {Function} keysFunc The function to get the keys of `object`.
  3956. * @returns {Object} Returns `object`.
  3957. */
  3958. var baseForRight = createBaseFor(true);
  3959. /**
  3960. * The base implementation of `_.forOwn` without support for iteratee shorthands.
  3961. *
  3962. * @private
  3963. * @param {Object} object The object to iterate over.
  3964. * @param {Function} iteratee The function invoked per iteration.
  3965. * @returns {Object} Returns `object`.
  3966. */
  3967. function baseForOwn(object, iteratee) {
  3968. return object && baseFor(object, iteratee, keys);
  3969. }
  3970. /**
  3971. * The base implementation of `_.forOwnRight` without support for iteratee shorthands.
  3972. *
  3973. * @private
  3974. * @param {Object} object The object to iterate over.
  3975. * @param {Function} iteratee The function invoked per iteration.
  3976. * @returns {Object} Returns `object`.
  3977. */
  3978. function baseForOwnRight(object, iteratee) {
  3979. return object && baseForRight(object, iteratee, keys);
  3980. }
  3981. /**
  3982. * The base implementation of `_.functions` which creates an array of
  3983. * `object` function property names filtered from `props`.
  3984. *
  3985. * @private
  3986. * @param {Object} object The object to inspect.
  3987. * @param {Array} props The property names to filter.
  3988. * @returns {Array} Returns the function names.
  3989. */
  3990. function baseFunctions(object, props) {
  3991. return arrayFilter(props, function(key) {
  3992. return isFunction(object[key]);
  3993. });
  3994. }
  3995. /**
  3996. * The base implementation of `_.get` without support for default values.
  3997. *
  3998. * @private
  3999. * @param {Object} object The object to query.
  4000. * @param {Array|string} path The path of the property to get.
  4001. * @returns {*} Returns the resolved value.
  4002. */
  4003. function baseGet(object, path) {
  4004. path = castPath(path, object);
  4005. var index = 0,
  4006. length = path.length;
  4007. while (object != null && index < length) {
  4008. object = object[toKey(path[index++])];
  4009. }
  4010. return (index && index == length) ? object : undefined;
  4011. }
  4012. /**
  4013. * The base implementation of `getAllKeys` and `getAllKeysIn` which uses
  4014. * `keysFunc` and `symbolsFunc` to get the enumerable property names and
  4015. * symbols of `object`.
  4016. *
  4017. * @private
  4018. * @param {Object} object The object to query.
  4019. * @param {Function} keysFunc The function to get the keys of `object`.
  4020. * @param {Function} symbolsFunc The function to get the symbols of `object`.
  4021. * @returns {Array} Returns the array of property names and symbols.
  4022. */
  4023. function baseGetAllKeys(object, keysFunc, symbolsFunc) {
  4024. var result = keysFunc(object);
  4025. return isArray(object) ? result : arrayPush(result, symbolsFunc(object));
  4026. }
  4027. /**
  4028. * The base implementation of `getTag` without fallbacks for buggy environments.
  4029. *
  4030. * @private
  4031. * @param {*} value The value to query.
  4032. * @returns {string} Returns the `toStringTag`.
  4033. */
  4034. function baseGetTag(value) {
  4035. if (value == null) {
  4036. return value === undefined ? undefinedTag : nullTag;
  4037. }
  4038. return (symToStringTag && symToStringTag in Object(value))
  4039. ? getRawTag(value)
  4040. : objectToString(value);
  4041. }
  4042. /**
  4043. * The base implementation of `_.gt` which doesn't coerce arguments.
  4044. *
  4045. * @private
  4046. * @param {*} value The value to compare.
  4047. * @param {*} other The other value to compare.
  4048. * @returns {boolean} Returns `true` if `value` is greater than `other`,
  4049. * else `false`.
  4050. */
  4051. function baseGt(value, other) {
  4052. return value > other;
  4053. }
  4054. /**
  4055. * The base implementation of `_.has` without support for deep paths.
  4056. *
  4057. * @private
  4058. * @param {Object} [object] The object to query.
  4059. * @param {Array|string} key The key to check.
  4060. * @returns {boolean} Returns `true` if `key` exists, else `false`.
  4061. */
  4062. function baseHas(object, key) {
  4063. return object != null && hasOwnProperty.call(object, key);
  4064. }
  4065. /**
  4066. * The base implementation of `_.hasIn` without support for deep paths.
  4067. *
  4068. * @private
  4069. * @param {Object} [object] The object to query.
  4070. * @param {Array|string} key The key to check.
  4071. * @returns {boolean} Returns `true` if `key` exists, else `false`.
  4072. */
  4073. function baseHasIn(object, key) {
  4074. return object != null && key in Object(object);
  4075. }
  4076. /**
  4077. * The base implementation of `_.inRange` which doesn't coerce arguments.
  4078. *
  4079. * @private
  4080. * @param {number} number The number to check.
  4081. * @param {number} start The start of the range.
  4082. * @param {number} end The end of the range.
  4083. * @returns {boolean} Returns `true` if `number` is in the range, else `false`.
  4084. */
  4085. function baseInRange(number, start, end) {
  4086. return number >= nativeMin(start, end) && number < nativeMax(start, end);
  4087. }
  4088. /**
  4089. * The base implementation of methods like `_.intersection`, without support
  4090. * for iteratee shorthands, that accepts an array of arrays to inspect.
  4091. *
  4092. * @private
  4093. * @param {Array} arrays The arrays to inspect.
  4094. * @param {Function} [iteratee] The iteratee invoked per element.
  4095. * @param {Function} [comparator] The comparator invoked per element.
  4096. * @returns {Array} Returns the new array of shared values.
  4097. */
  4098. function baseIntersection(arrays, iteratee, comparator) {
  4099. var includes = comparator ? arrayIncludesWith : arrayIncludes,
  4100. length = arrays[0].length,
  4101. othLength = arrays.length,
  4102. othIndex = othLength,
  4103. caches = Array(othLength),
  4104. maxLength = Infinity,
  4105. result = [];
  4106. while (othIndex--) {
  4107. var array = arrays[othIndex];
  4108. if (othIndex && iteratee) {
  4109. array = arrayMap(array, baseUnary(iteratee));
  4110. }
  4111. maxLength = nativeMin(array.length, maxLength);
  4112. caches[othIndex] = !comparator && (iteratee || (length >= 120 && array.length >= 120))
  4113. ? new SetCache(othIndex && array)
  4114. : undefined;
  4115. }
  4116. array = arrays[0];
  4117. var index = -1,
  4118. seen = caches[0];
  4119. outer:
  4120. while (++index < length && result.length < maxLength) {
  4121. var value = array[index],
  4122. computed = iteratee ? iteratee(value) : value;
  4123. value = (comparator || value !== 0) ? value : 0;
  4124. if (!(seen
  4125. ? cacheHas(seen, computed)
  4126. : includes(result, computed, comparator)
  4127. )) {
  4128. othIndex = othLength;
  4129. while (--othIndex) {
  4130. var cache = caches[othIndex];
  4131. if (!(cache
  4132. ? cacheHas(cache, computed)
  4133. : includes(arrays[othIndex], computed, comparator))
  4134. ) {
  4135. continue outer;
  4136. }
  4137. }
  4138. if (seen) {
  4139. seen.push(computed);
  4140. }
  4141. result.push(value);
  4142. }
  4143. }
  4144. return result;
  4145. }
  4146. /**
  4147. * The base implementation of `_.invert` and `_.invertBy` which inverts
  4148. * `object` with values transformed by `iteratee` and set by `setter`.
  4149. *
  4150. * @private
  4151. * @param {Object} object The object to iterate over.
  4152. * @param {Function} setter The function to set `accumulator` values.
  4153. * @param {Function} iteratee The iteratee to transform values.
  4154. * @param {Object} accumulator The initial inverted object.
  4155. * @returns {Function} Returns `accumulator`.
  4156. */
  4157. function baseInverter(object, setter, iteratee, accumulator) {
  4158. baseForOwn(object, function(value, key, object) {
  4159. setter(accumulator, iteratee(value), key, object);
  4160. });
  4161. return accumulator;
  4162. }
  4163. /**
  4164. * The base implementation of `_.invoke` without support for individual
  4165. * method arguments.
  4166. *
  4167. * @private
  4168. * @param {Object} object The object to query.
  4169. * @param {Array|string} path The path of the method to invoke.
  4170. * @param {Array} args The arguments to invoke the method with.
  4171. * @returns {*} Returns the result of the invoked method.
  4172. */
  4173. function baseInvoke(object, path, args) {
  4174. path = castPath(path, object);
  4175. object = parent(object, path);
  4176. var func = object == null ? object : object[toKey(last(path))];
  4177. return func == null ? undefined : apply(func, object, args);
  4178. }
  4179. /**
  4180. * The base implementation of `_.isArguments`.
  4181. *
  4182. * @private
  4183. * @param {*} value The value to check.
  4184. * @returns {boolean} Returns `true` if `value` is an `arguments` object,
  4185. */
  4186. function baseIsArguments(value) {
  4187. return isObjectLike(value) && baseGetTag(value) == argsTag;
  4188. }
  4189. /**
  4190. * The base implementation of `_.isArrayBuffer` without Node.js optimizations.
  4191. *
  4192. * @private
  4193. * @param {*} value The value to check.
  4194. * @returns {boolean} Returns `true` if `value` is an array buffer, else `false`.
  4195. */
  4196. function baseIsArrayBuffer(value) {
  4197. return isObjectLike(value) && baseGetTag(value) == arrayBufferTag;
  4198. }
  4199. /**
  4200. * The base implementation of `_.isDate` without Node.js optimizations.
  4201. *
  4202. * @private
  4203. * @param {*} value The value to check.
  4204. * @returns {boolean} Returns `true` if `value` is a date object, else `false`.
  4205. */
  4206. function baseIsDate(value) {
  4207. return isObjectLike(value) && baseGetTag(value) == dateTag;
  4208. }
  4209. /**
  4210. * The base implementation of `_.isEqual` which supports partial comparisons
  4211. * and tracks traversed objects.
  4212. *
  4213. * @private
  4214. * @param {*} value The value to compare.
  4215. * @param {*} other The other value to compare.
  4216. * @param {boolean} bitmask The bitmask flags.
  4217. * 1 - Unordered comparison
  4218. * 2 - Partial comparison
  4219. * @param {Function} [customizer] The function to customize comparisons.
  4220. * @param {Object} [stack] Tracks traversed `value` and `other` objects.
  4221. * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
  4222. */
  4223. function baseIsEqual(value, other, bitmask, customizer, stack) {
  4224. if (value === other) {
  4225. return true;
  4226. }
  4227. if (value == null || other == null || (!isObjectLike(value) && !isObjectLike(other))) {
  4228. return value !== value && other !== other;
  4229. }
  4230. return baseIsEqualDeep(value, other, bitmask, customizer, baseIsEqual, stack);
  4231. }
  4232. /**
  4233. * A specialized version of `baseIsEqual` for arrays and objects which performs
  4234. * deep comparisons and tracks traversed objects enabling objects with circular
  4235. * references to be compared.
  4236. *
  4237. * @private
  4238. * @param {Object} object The object to compare.
  4239. * @param {Object} other The other object to compare.
  4240. * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
  4241. * @param {Function} customizer The function to customize comparisons.
  4242. * @param {Function} equalFunc The function to determine equivalents of values.
  4243. * @param {Object} [stack] Tracks traversed `object` and `other` objects.
  4244. * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
  4245. */
  4246. function baseIsEqualDeep(object, other, bitmask, customizer, equalFunc, stack) {
  4247. var objIsArr = isArray(object),
  4248. othIsArr = isArray(other),
  4249. objTag = objIsArr ? arrayTag : getTag(object),
  4250. othTag = othIsArr ? arrayTag : getTag(other);
  4251. objTag = objTag == argsTag ? objectTag : objTag;
  4252. othTag = othTag == argsTag ? objectTag : othTag;
  4253. var objIsObj = objTag == objectTag,
  4254. othIsObj = othTag == objectTag,
  4255. isSameTag = objTag == othTag;
  4256. if (isSameTag && isBuffer(object)) {
  4257. if (!isBuffer(other)) {
  4258. return false;
  4259. }
  4260. objIsArr = true;
  4261. objIsObj = false;
  4262. }
  4263. if (isSameTag && !objIsObj) {
  4264. stack || (stack = new Stack);
  4265. return (objIsArr || isTypedArray(object))
  4266. ? equalArrays(object, other, bitmask, customizer, equalFunc, stack)
  4267. : equalByTag(object, other, objTag, bitmask, customizer, equalFunc, stack);
  4268. }
  4269. if (!(bitmask & COMPARE_PARTIAL_FLAG)) {
  4270. var objIsWrapped = objIsObj && hasOwnProperty.call(object, '__wrapped__'),
  4271. othIsWrapped = othIsObj && hasOwnProperty.call(other, '__wrapped__');
  4272. if (objIsWrapped || othIsWrapped) {
  4273. var objUnwrapped = objIsWrapped ? object.value() : object,
  4274. othUnwrapped = othIsWrapped ? other.value() : other;
  4275. stack || (stack = new Stack);
  4276. return equalFunc(objUnwrapped, othUnwrapped, bitmask, customizer, stack);
  4277. }
  4278. }
  4279. if (!isSameTag) {
  4280. return false;
  4281. }
  4282. stack || (stack = new Stack);
  4283. return equalObjects(object, other, bitmask, customizer, equalFunc, stack);
  4284. }
  4285. /**
  4286. * The base implementation of `_.isMap` without Node.js optimizations.
  4287. *
  4288. * @private
  4289. * @param {*} value The value to check.
  4290. * @returns {boolean} Returns `true` if `value` is a map, else `false`.
  4291. */
  4292. function baseIsMap(value) {
  4293. return isObjectLike(value) && getTag(value) == mapTag;
  4294. }
  4295. /**
  4296. * The base implementation of `_.isMatch` without support for iteratee shorthands.
  4297. *
  4298. * @private
  4299. * @param {Object} object The object to inspect.
  4300. * @param {Object} source The object of property values to match.
  4301. * @param {Array} matchData The property names, values, and compare flags to match.
  4302. * @param {Function} [customizer] The function to customize comparisons.
  4303. * @returns {boolean} Returns `true` if `object` is a match, else `false`.
  4304. */
  4305. function baseIsMatch(object, source, matchData, customizer) {
  4306. var index = matchData.length,
  4307. length = index,
  4308. noCustomizer = !customizer;
  4309. if (object == null) {
  4310. return !length;
  4311. }
  4312. object = Object(object);
  4313. while (index--) {
  4314. var data = matchData[index];
  4315. if ((noCustomizer && data[2])
  4316. ? data[1] !== object[data[0]]
  4317. : !(data[0] in object)
  4318. ) {
  4319. return false;
  4320. }
  4321. }
  4322. while (++index < length) {
  4323. data = matchData[index];
  4324. var key = data[0],
  4325. objValue = object[key],
  4326. srcValue = data[1];
  4327. if (noCustomizer && data[2]) {
  4328. if (objValue === undefined && !(key in object)) {
  4329. return false;
  4330. }
  4331. } else {
  4332. var stack = new Stack;
  4333. if (customizer) {
  4334. var result = customizer(objValue, srcValue, key, object, source, stack);
  4335. }
  4336. if (!(result === undefined
  4337. ? baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG, customizer, stack)
  4338. : result
  4339. )) {
  4340. return false;
  4341. }
  4342. }
  4343. }
  4344. return true;
  4345. }
  4346. /**
  4347. * The base implementation of `_.isNative` without bad shim checks.
  4348. *
  4349. * @private
  4350. * @param {*} value The value to check.
  4351. * @returns {boolean} Returns `true` if `value` is a native function,
  4352. * else `false`.
  4353. */
  4354. function baseIsNative(value) {
  4355. if (!isObject(value) || isMasked(value)) {
  4356. return false;
  4357. }
  4358. var pattern = isFunction(value) ? reIsNative : reIsHostCtor;
  4359. return pattern.test(toSource(value));
  4360. }
  4361. /**
  4362. * The base implementation of `_.isRegExp` without Node.js optimizations.
  4363. *
  4364. * @private
  4365. * @param {*} value The value to check.
  4366. * @returns {boolean} Returns `true` if `value` is a regexp, else `false`.
  4367. */
  4368. function baseIsRegExp(value) {
  4369. return isObjectLike(value) && baseGetTag(value) == regexpTag;
  4370. }
  4371. /**
  4372. * The base implementation of `_.isSet` without Node.js optimizations.
  4373. *
  4374. * @private
  4375. * @param {*} value The value to check.
  4376. * @returns {boolean} Returns `true` if `value` is a set, else `false`.
  4377. */
  4378. function baseIsSet(value) {
  4379. return isObjectLike(value) && getTag(value) == setTag;
  4380. }
  4381. /**
  4382. * The base implementation of `_.isTypedArray` without Node.js optimizations.
  4383. *
  4384. * @private
  4385. * @param {*} value The value to check.
  4386. * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.
  4387. */
  4388. function baseIsTypedArray(value) {
  4389. return isObjectLike(value) &&
  4390. isLength(value.length) && !!typedArrayTags[baseGetTag(value)];
  4391. }
  4392. /**
  4393. * The base implementation of `_.iteratee`.
  4394. *
  4395. * @private
  4396. * @param {*} [value=_.identity] The value to convert to an iteratee.
  4397. * @returns {Function} Returns the iteratee.
  4398. */
  4399. function baseIteratee(value) {
  4400. // Don't store the `typeof` result in a variable to avoid a JIT bug in Safari 9.
  4401. // See https://bugs.webkit.org/show_bug.cgi?id=156034 for more details.
  4402. if (typeof value == 'function') {
  4403. return value;
  4404. }
  4405. if (value == null) {
  4406. return identity;
  4407. }
  4408. if (typeof value == 'object') {
  4409. return isArray(value)
  4410. ? baseMatchesProperty(value[0], value[1])
  4411. : baseMatches(value);
  4412. }
  4413. return property(value);
  4414. }
  4415. /**
  4416. * The base implementation of `_.keys` which doesn't treat sparse arrays as dense.
  4417. *
  4418. * @private
  4419. * @param {Object} object The object to query.
  4420. * @returns {Array} Returns the array of property names.
  4421. */
  4422. function baseKeys(object) {
  4423. if (!isPrototype(object)) {
  4424. return nativeKeys(object);
  4425. }
  4426. var result = [];
  4427. for (var key in Object(object)) {
  4428. if (hasOwnProperty.call(object, key) && key != 'constructor') {
  4429. result.push(key);
  4430. }
  4431. }
  4432. return result;
  4433. }
  4434. /**
  4435. * The base implementation of `_.keysIn` which doesn't treat sparse arrays as dense.
  4436. *
  4437. * @private
  4438. * @param {Object} object The object to query.
  4439. * @returns {Array} Returns the array of property names.
  4440. */
  4441. function baseKeysIn(object) {
  4442. if (!isObject(object)) {
  4443. return nativeKeysIn(object);
  4444. }
  4445. var isProto = isPrototype(object),
  4446. result = [];
  4447. for (var key in object) {
  4448. if (!(key == 'constructor' && (isProto || !hasOwnProperty.call(object, key)))) {
  4449. result.push(key);
  4450. }
  4451. }
  4452. return result;
  4453. }
  4454. /**
  4455. * The base implementation of `_.lt` which doesn't coerce arguments.
  4456. *
  4457. * @private
  4458. * @param {*} value The value to compare.
  4459. * @param {*} other The other value to compare.
  4460. * @returns {boolean} Returns `true` if `value` is less than `other`,
  4461. * else `false`.
  4462. */
  4463. function baseLt(value, other) {
  4464. return value < other;
  4465. }
  4466. /**
  4467. * The base implementation of `_.map` without support for iteratee shorthands.
  4468. *
  4469. * @private
  4470. * @param {Array|Object} collection The collection to iterate over.
  4471. * @param {Function} iteratee The function invoked per iteration.
  4472. * @returns {Array} Returns the new mapped array.
  4473. */
  4474. function baseMap(collection, iteratee) {
  4475. var index = -1,
  4476. result = isArrayLike(collection) ? Array(collection.length) : [];
  4477. baseEach(collection, function(value, key, collection) {
  4478. result[++index] = iteratee(value, key, collection);
  4479. });
  4480. return result;
  4481. }
  4482. /**
  4483. * The base implementation of `_.matches` which doesn't clone `source`.
  4484. *
  4485. * @private
  4486. * @param {Object} source The object of property values to match.
  4487. * @returns {Function} Returns the new spec function.
  4488. */
  4489. function baseMatches(source) {
  4490. var matchData = getMatchData(source);
  4491. if (matchData.length == 1 && matchData[0][2]) {
  4492. return matchesStrictComparable(matchData[0][0], matchData[0][1]);
  4493. }
  4494. return function(object) {
  4495. return object === source || baseIsMatch(object, source, matchData);
  4496. };
  4497. }
  4498. /**
  4499. * The base implementation of `_.matchesProperty` which doesn't clone `srcValue`.
  4500. *
  4501. * @private
  4502. * @param {string} path The path of the property to get.
  4503. * @param {*} srcValue The value to match.
  4504. * @returns {Function} Returns the new spec function.
  4505. */
  4506. function baseMatchesProperty(path, srcValue) {
  4507. if (isKey(path) && isStrictComparable(srcValue)) {
  4508. return matchesStrictComparable(toKey(path), srcValue);
  4509. }
  4510. return function(object) {
  4511. var objValue = get(object, path);
  4512. return (objValue === undefined && objValue === srcValue)
  4513. ? hasIn(object, path)
  4514. : baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG);
  4515. };
  4516. }
  4517. /**
  4518. * The base implementation of `_.merge` without support for multiple sources.
  4519. *
  4520. * @private
  4521. * @param {Object} object The destination object.
  4522. * @param {Object} source The source object.
  4523. * @param {number} srcIndex The index of `source`.
  4524. * @param {Function} [customizer] The function to customize merged values.
  4525. * @param {Object} [stack] Tracks traversed source values and their merged
  4526. * counterparts.
  4527. */
  4528. function baseMerge(object, source, srcIndex, customizer, stack) {
  4529. if (object === source) {
  4530. return;
  4531. }
  4532. baseFor(source, function(srcValue, key) {
  4533. stack || (stack = new Stack);
  4534. if (isObject(srcValue)) {
  4535. baseMergeDeep(object, source, key, srcIndex, baseMerge, customizer, stack);
  4536. }
  4537. else {
  4538. var newValue = customizer
  4539. ? customizer(safeGet(object, key), srcValue, (key + ''), object, source, stack)
  4540. : undefined;
  4541. if (newValue === undefined) {
  4542. newValue = srcValue;
  4543. }
  4544. assignMergeValue(object, key, newValue);
  4545. }
  4546. }, keysIn);
  4547. }
  4548. /**
  4549. * A specialized version of `baseMerge` for arrays and objects which performs
  4550. * deep merges and tracks traversed objects enabling objects with circular
  4551. * references to be merged.
  4552. *
  4553. * @private
  4554. * @param {Object} object The destination object.
  4555. * @param {Object} source The source object.
  4556. * @param {string} key The key of the value to merge.
  4557. * @param {number} srcIndex The index of `source`.
  4558. * @param {Function} mergeFunc The function to merge values.
  4559. * @param {Function} [customizer] The function to customize assigned values.
  4560. * @param {Object} [stack] Tracks traversed source values and their merged
  4561. * counterparts.
  4562. */
  4563. function baseMergeDeep(object, source, key, srcIndex, mergeFunc, customizer, stack) {
  4564. var objValue = safeGet(object, key),
  4565. srcValue = safeGet(source, key),
  4566. stacked = stack.get(srcValue);
  4567. if (stacked) {
  4568. assignMergeValue(object, key, stacked);
  4569. return;
  4570. }
  4571. var newValue = customizer
  4572. ? customizer(objValue, srcValue, (key + ''), object, source, stack)
  4573. : undefined;
  4574. var isCommon = newValue === undefined;
  4575. if (isCommon) {
  4576. var isArr = isArray(srcValue),
  4577. isBuff = !isArr && isBuffer(srcValue),
  4578. isTyped = !isArr && !isBuff && isTypedArray(srcValue);
  4579. newValue = srcValue;
  4580. if (isArr || isBuff || isTyped) {
  4581. if (isArray(objValue)) {
  4582. newValue = objValue;
  4583. }
  4584. else if (isArrayLikeObject(objValue)) {
  4585. newValue = copyArray(objValue);
  4586. }
  4587. else if (isBuff) {
  4588. isCommon = false;
  4589. newValue = cloneBuffer(srcValue, true);
  4590. }
  4591. else if (isTyped) {
  4592. isCommon = false;
  4593. newValue = cloneTypedArray(srcValue, true);
  4594. }
  4595. else {
  4596. newValue = [];
  4597. }
  4598. }
  4599. else if (isPlainObject(srcValue) || isArguments(srcValue)) {
  4600. newValue = objValue;
  4601. if (isArguments(objValue)) {
  4602. newValue = toPlainObject(objValue);
  4603. }
  4604. else if (!isObject(objValue) || isFunction(objValue)) {
  4605. newValue = initCloneObject(srcValue);
  4606. }
  4607. }
  4608. else {
  4609. isCommon = false;
  4610. }
  4611. }
  4612. if (isCommon) {
  4613. // Recursively merge objects and arrays (susceptible to call stack limits).
  4614. stack.set(srcValue, newValue);
  4615. mergeFunc(newValue, srcValue, srcIndex, customizer, stack);
  4616. stack['delete'](srcValue);
  4617. }
  4618. assignMergeValue(object, key, newValue);
  4619. }
  4620. /**
  4621. * The base implementation of `_.nth` which doesn't coerce arguments.
  4622. *
  4623. * @private
  4624. * @param {Array} array The array to query.
  4625. * @param {number} n The index of the element to return.
  4626. * @returns {*} Returns the nth element of `array`.
  4627. */
  4628. function baseNth(array, n) {
  4629. var length = array.length;
  4630. if (!length) {
  4631. return;
  4632. }
  4633. n += n < 0 ? length : 0;
  4634. return isIndex(n, length) ? array[n] : undefined;
  4635. }
  4636. /**
  4637. * The base implementation of `_.orderBy` without param guards.
  4638. *
  4639. * @private
  4640. * @param {Array|Object} collection The collection to iterate over.
  4641. * @param {Function[]|Object[]|string[]} iteratees The iteratees to sort by.
  4642. * @param {string[]} orders The sort orders of `iteratees`.
  4643. * @returns {Array} Returns the new sorted array.
  4644. */
  4645. function baseOrderBy(collection, iteratees, orders) {
  4646. if (iteratees.length) {
  4647. iteratees = arrayMap(iteratees, function(iteratee) {
  4648. if (isArray(iteratee)) {
  4649. return function(value) {
  4650. return baseGet(value, iteratee.length === 1 ? iteratee[0] : iteratee);
  4651. }
  4652. }
  4653. return iteratee;
  4654. });
  4655. } else {
  4656. iteratees = [identity];
  4657. }
  4658. var index = -1;
  4659. iteratees = arrayMap(iteratees, baseUnary(getIteratee()));
  4660. var result = baseMap(collection, function(value, key, collection) {
  4661. var criteria = arrayMap(iteratees, function(iteratee) {
  4662. return iteratee(value);
  4663. });
  4664. return { 'criteria': criteria, 'index': ++index, 'value': value };
  4665. });
  4666. return baseSortBy(result, function(object, other) {
  4667. return compareMultiple(object, other, orders);
  4668. });
  4669. }
  4670. /**
  4671. * The base implementation of `_.pick` without support for individual
  4672. * property identifiers.
  4673. *
  4674. * @private
  4675. * @param {Object} object The source object.
  4676. * @param {string[]} paths The property paths to pick.
  4677. * @returns {Object} Returns the new object.
  4678. */
  4679. function basePick(object, paths) {
  4680. return basePickBy(object, paths, function(value, path) {
  4681. return hasIn(object, path);
  4682. });
  4683. }
  4684. /**
  4685. * The base implementation of `_.pickBy` without support for iteratee shorthands.
  4686. *
  4687. * @private
  4688. * @param {Object} object The source object.
  4689. * @param {string[]} paths The property paths to pick.
  4690. * @param {Function} predicate The function invoked per property.
  4691. * @returns {Object} Returns the new object.
  4692. */
  4693. function basePickBy(object, paths, predicate) {
  4694. var index = -1,
  4695. length = paths.length,
  4696. result = {};
  4697. while (++index < length) {
  4698. var path = paths[index],
  4699. value = baseGet(object, path);
  4700. if (predicate(value, path)) {
  4701. baseSet(result, castPath(path, object), value);
  4702. }
  4703. }
  4704. return result;
  4705. }
  4706. /**
  4707. * A specialized version of `baseProperty` which supports deep paths.
  4708. *
  4709. * @private
  4710. * @param {Array|string} path The path of the property to get.
  4711. * @returns {Function} Returns the new accessor function.
  4712. */
  4713. function basePropertyDeep(path) {
  4714. return function(object) {
  4715. return baseGet(object, path);
  4716. };
  4717. }
  4718. /**
  4719. * The base implementation of `_.pullAllBy` without support for iteratee
  4720. * shorthands.
  4721. *
  4722. * @private
  4723. * @param {Array} array The array to modify.
  4724. * @param {Array} values The values to remove.
  4725. * @param {Function} [iteratee] The iteratee invoked per element.
  4726. * @param {Function} [comparator] The comparator invoked per element.
  4727. * @returns {Array} Returns `array`.
  4728. */
  4729. function basePullAll(array, values, iteratee, comparator) {
  4730. var indexOf = comparator ? baseIndexOfWith : baseIndexOf,
  4731. index = -1,
  4732. length = values.length,
  4733. seen = array;
  4734. if (array === values) {
  4735. values = copyArray(values);
  4736. }
  4737. if (iteratee) {
  4738. seen = arrayMap(array, baseUnary(iteratee));
  4739. }
  4740. while (++index < length) {
  4741. var fromIndex = 0,
  4742. value = values[index],
  4743. computed = iteratee ? iteratee(value) : value;
  4744. while ((fromIndex = indexOf(seen, computed, fromIndex, comparator)) > -1) {
  4745. if (seen !== array) {
  4746. splice.call(seen, fromIndex, 1);
  4747. }
  4748. splice.call(array, fromIndex, 1);
  4749. }
  4750. }
  4751. return array;
  4752. }
  4753. /**
  4754. * The base implementation of `_.pullAt` without support for individual
  4755. * indexes or capturing the removed elements.
  4756. *
  4757. * @private
  4758. * @param {Array} array The array to modify.
  4759. * @param {number[]} indexes The indexes of elements to remove.
  4760. * @returns {Array} Returns `array`.
  4761. */
  4762. function basePullAt(array, indexes) {
  4763. var length = array ? indexes.length : 0,
  4764. lastIndex = length - 1;
  4765. while (length--) {
  4766. var index = indexes[length];
  4767. if (length == lastIndex || index !== previous) {
  4768. var previous = index;
  4769. if (isIndex(index)) {
  4770. splice.call(array, index, 1);
  4771. } else {
  4772. baseUnset(array, index);
  4773. }
  4774. }
  4775. }
  4776. return array;
  4777. }
  4778. /**
  4779. * The base implementation of `_.random` without support for returning
  4780. * floating-point numbers.
  4781. *
  4782. * @private
  4783. * @param {number} lower The lower bound.
  4784. * @param {number} upper The upper bound.
  4785. * @returns {number} Returns the random number.
  4786. */
  4787. function baseRandom(lower, upper) {
  4788. return lower + nativeFloor(nativeRandom() * (upper - lower + 1));
  4789. }
  4790. /**
  4791. * The base implementation of `_.range` and `_.rangeRight` which doesn't
  4792. * coerce arguments.
  4793. *
  4794. * @private
  4795. * @param {number} start The start of the range.
  4796. * @param {number} end The end of the range.
  4797. * @param {number} step The value to increment or decrement by.
  4798. * @param {boolean} [fromRight] Specify iterating from right to left.
  4799. * @returns {Array} Returns the range of numbers.
  4800. */
  4801. function baseRange(start, end, step, fromRight) {
  4802. var index = -1,
  4803. length = nativeMax(nativeCeil((end - start) / (step || 1)), 0),
  4804. result = Array(length);
  4805. while (length--) {
  4806. result[fromRight ? length : ++index] = start;
  4807. start += step;
  4808. }
  4809. return result;
  4810. }
  4811. /**
  4812. * The base implementation of `_.repeat` which doesn't coerce arguments.
  4813. *
  4814. * @private
  4815. * @param {string} string The string to repeat.
  4816. * @param {number} n The number of times to repeat the string.
  4817. * @returns {string} Returns the repeated string.
  4818. */
  4819. function baseRepeat(string, n) {
  4820. var result = '';
  4821. if (!string || n < 1 || n > MAX_SAFE_INTEGER) {
  4822. return result;
  4823. }
  4824. // Leverage the exponentiation by squaring algorithm for a faster repeat.
  4825. // See https://en.wikipedia.org/wiki/Exponentiation_by_squaring for more details.
  4826. do {
  4827. if (n % 2) {
  4828. result += string;
  4829. }
  4830. n = nativeFloor(n / 2);
  4831. if (n) {
  4832. string += string;
  4833. }
  4834. } while (n);
  4835. return result;
  4836. }
  4837. /**
  4838. * The base implementation of `_.rest` which doesn't validate or coerce arguments.
  4839. *
  4840. * @private
  4841. * @param {Function} func The function to apply a rest parameter to.
  4842. * @param {number} [start=func.length-1] The start position of the rest parameter.
  4843. * @returns {Function} Returns the new function.
  4844. */
  4845. function baseRest(func, start) {
  4846. return setToString(overRest(func, start, identity), func + '');
  4847. }
  4848. /**
  4849. * The base implementation of `_.sample`.
  4850. *
  4851. * @private
  4852. * @param {Array|Object} collection The collection to sample.
  4853. * @returns {*} Returns the random element.
  4854. */
  4855. function baseSample(collection) {
  4856. return arraySample(values(collection));
  4857. }
  4858. /**
  4859. * The base implementation of `_.sampleSize` without param guards.
  4860. *
  4861. * @private
  4862. * @param {Array|Object} collection The collection to sample.
  4863. * @param {number} n The number of elements to sample.
  4864. * @returns {Array} Returns the random elements.
  4865. */
  4866. function baseSampleSize(collection, n) {
  4867. var array = values(collection);
  4868. return shuffleSelf(array, baseClamp(n, 0, array.length));
  4869. }
  4870. /**
  4871. * The base implementation of `_.set`.
  4872. *
  4873. * @private
  4874. * @param {Object} object The object to modify.
  4875. * @param {Array|string} path The path of the property to set.
  4876. * @param {*} value The value to set.
  4877. * @param {Function} [customizer] The function to customize path creation.
  4878. * @returns {Object} Returns `object`.
  4879. */
  4880. function baseSet(object, path, value, customizer) {
  4881. if (!isObject(object)) {
  4882. return object;
  4883. }
  4884. path = castPath(path, object);
  4885. var index = -1,
  4886. length = path.length,
  4887. lastIndex = length - 1,
  4888. nested = object;
  4889. while (nested != null && ++index < length) {
  4890. var key = toKey(path[index]),
  4891. newValue = value;
  4892. if (key === '__proto__' || key === 'constructor' || key === 'prototype') {
  4893. return object;
  4894. }
  4895. if (index != lastIndex) {
  4896. var objValue = nested[key];
  4897. newValue = customizer ? customizer(objValue, key, nested) : undefined;
  4898. if (newValue === undefined) {
  4899. newValue = isObject(objValue)
  4900. ? objValue
  4901. : (isIndex(path[index + 1]) ? [] : {});
  4902. }
  4903. }
  4904. assignValue(nested, key, newValue);
  4905. nested = nested[key];
  4906. }
  4907. return object;
  4908. }
  4909. /**
  4910. * The base implementation of `setData` without support for hot loop shorting.
  4911. *
  4912. * @private
  4913. * @param {Function} func The function to associate metadata with.
  4914. * @param {*} data The metadata.
  4915. * @returns {Function} Returns `func`.
  4916. */
  4917. var baseSetData = !metaMap ? identity : function(func, data) {
  4918. metaMap.set(func, data);
  4919. return func;
  4920. };
  4921. /**
  4922. * The base implementation of `setToString` without support for hot loop shorting.
  4923. *
  4924. * @private
  4925. * @param {Function} func The function to modify.
  4926. * @param {Function} string The `toString` result.
  4927. * @returns {Function} Returns `func`.
  4928. */
  4929. var baseSetToString = !defineProperty ? identity : function(func, string) {
  4930. return defineProperty(func, 'toString', {
  4931. 'configurable': true,
  4932. 'enumerable': false,
  4933. 'value': constant(string),
  4934. 'writable': true
  4935. });
  4936. };
  4937. /**
  4938. * The base implementation of `_.shuffle`.
  4939. *
  4940. * @private
  4941. * @param {Array|Object} collection The collection to shuffle.
  4942. * @returns {Array} Returns the new shuffled array.
  4943. */
  4944. function baseShuffle(collection) {
  4945. return shuffleSelf(values(collection));
  4946. }
  4947. /**
  4948. * The base implementation of `_.slice` without an iteratee call guard.
  4949. *
  4950. * @private
  4951. * @param {Array} array The array to slice.
  4952. * @param {number} [start=0] The start position.
  4953. * @param {number} [end=array.length] The end position.
  4954. * @returns {Array} Returns the slice of `array`.
  4955. */
  4956. function baseSlice(array, start, end) {
  4957. var index = -1,
  4958. length = array.length;
  4959. if (start < 0) {
  4960. start = -start > length ? 0 : (length + start);
  4961. }
  4962. end = end > length ? length : end;
  4963. if (end < 0) {
  4964. end += length;
  4965. }
  4966. length = start > end ? 0 : ((end - start) >>> 0);
  4967. start >>>= 0;
  4968. var result = Array(length);
  4969. while (++index < length) {
  4970. result[index] = array[index + start];
  4971. }
  4972. return result;
  4973. }
  4974. /**
  4975. * The base implementation of `_.some` without support for iteratee shorthands.
  4976. *
  4977. * @private
  4978. * @param {Array|Object} collection The collection to iterate over.
  4979. * @param {Function} predicate The function invoked per iteration.
  4980. * @returns {boolean} Returns `true` if any element passes the predicate check,
  4981. * else `false`.
  4982. */
  4983. function baseSome(collection, predicate) {
  4984. var result;
  4985. baseEach(collection, function(value, index, collection) {
  4986. result = predicate(value, index, collection);
  4987. return !result;
  4988. });
  4989. return !!result;
  4990. }
  4991. /**
  4992. * The base implementation of `_.sortedIndex` and `_.sortedLastIndex` which
  4993. * performs a binary search of `array` to determine the index at which `value`
  4994. * should be inserted into `array` in order to maintain its sort order.
  4995. *
  4996. * @private
  4997. * @param {Array} array The sorted array to inspect.
  4998. * @param {*} value The value to evaluate.
  4999. * @param {boolean} [retHighest] Specify returning the highest qualified index.
  5000. * @returns {number} Returns the index at which `value` should be inserted
  5001. * into `array`.
  5002. */
  5003. function baseSortedIndex(array, value, retHighest) {
  5004. var low = 0,
  5005. high = array == null ? low : array.length;
  5006. if (typeof value == 'number' && value === value && high <= HALF_MAX_ARRAY_LENGTH) {
  5007. while (low < high) {
  5008. var mid = (low + high) >>> 1,
  5009. computed = array[mid];
  5010. if (computed !== null && !isSymbol(computed) &&
  5011. (retHighest ? (computed <= value) : (computed < value))) {
  5012. low = mid + 1;
  5013. } else {
  5014. high = mid;
  5015. }
  5016. }
  5017. return high;
  5018. }
  5019. return baseSortedIndexBy(array, value, identity, retHighest);
  5020. }
  5021. /**
  5022. * The base implementation of `_.sortedIndexBy` and `_.sortedLastIndexBy`
  5023. * which invokes `iteratee` for `value` and each element of `array` to compute
  5024. * their sort ranking. The iteratee is invoked with one argument; (value).
  5025. *
  5026. * @private
  5027. * @param {Array} array The sorted array to inspect.
  5028. * @param {*} value The value to evaluate.
  5029. * @param {Function} iteratee The iteratee invoked per element.
  5030. * @param {boolean} [retHighest] Specify returning the highest qualified index.
  5031. * @returns {number} Returns the index at which `value` should be inserted
  5032. * into `array`.
  5033. */
  5034. function baseSortedIndexBy(array, value, iteratee, retHighest) {
  5035. var low = 0,
  5036. high = array == null ? 0 : array.length;
  5037. if (high === 0) {
  5038. return 0;
  5039. }
  5040. value = iteratee(value);
  5041. var valIsNaN = value !== value,
  5042. valIsNull = value === null,
  5043. valIsSymbol = isSymbol(value),
  5044. valIsUndefined = value === undefined;
  5045. while (low < high) {
  5046. var mid = nativeFloor((low + high) / 2),
  5047. computed = iteratee(array[mid]),
  5048. othIsDefined = computed !== undefined,
  5049. othIsNull = computed === null,
  5050. othIsReflexive = computed === computed,
  5051. othIsSymbol = isSymbol(computed);
  5052. if (valIsNaN) {
  5053. var setLow = retHighest || othIsReflexive;
  5054. } else if (valIsUndefined) {
  5055. setLow = othIsReflexive && (retHighest || othIsDefined);
  5056. } else if (valIsNull) {
  5057. setLow = othIsReflexive && othIsDefined && (retHighest || !othIsNull);
  5058. } else if (valIsSymbol) {
  5059. setLow = othIsReflexive && othIsDefined && !othIsNull && (retHighest || !othIsSymbol);
  5060. } else if (othIsNull || othIsSymbol) {
  5061. setLow = false;
  5062. } else {
  5063. setLow = retHighest ? (computed <= value) : (computed < value);
  5064. }
  5065. if (setLow) {
  5066. low = mid + 1;
  5067. } else {
  5068. high = mid;
  5069. }
  5070. }
  5071. return nativeMin(high, MAX_ARRAY_INDEX);
  5072. }
  5073. /**
  5074. * The base implementation of `_.sortedUniq` and `_.sortedUniqBy` without
  5075. * support for iteratee shorthands.
  5076. *
  5077. * @private
  5078. * @param {Array} array The array to inspect.
  5079. * @param {Function} [iteratee] The iteratee invoked per element.
  5080. * @returns {Array} Returns the new duplicate free array.
  5081. */
  5082. function baseSortedUniq(array, iteratee) {
  5083. var index = -1,
  5084. length = array.length,
  5085. resIndex = 0,
  5086. result = [];
  5087. while (++index < length) {
  5088. var value = array[index],
  5089. computed = iteratee ? iteratee(value) : value;
  5090. if (!index || !eq(computed, seen)) {
  5091. var seen = computed;
  5092. result[resIndex++] = value === 0 ? 0 : value;
  5093. }
  5094. }
  5095. return result;
  5096. }
  5097. /**
  5098. * The base implementation of `_.toNumber` which doesn't ensure correct
  5099. * conversions of binary, hexadecimal, or octal string values.
  5100. *
  5101. * @private
  5102. * @param {*} value The value to process.
  5103. * @returns {number} Returns the number.
  5104. */
  5105. function baseToNumber(value) {
  5106. if (typeof value == 'number') {
  5107. return value;
  5108. }
  5109. if (isSymbol(value)) {
  5110. return NAN;
  5111. }
  5112. return +value;
  5113. }
  5114. /**
  5115. * The base implementation of `_.toString` which doesn't convert nullish
  5116. * values to empty strings.
  5117. *
  5118. * @private
  5119. * @param {*} value The value to process.
  5120. * @returns {string} Returns the string.
  5121. */
  5122. function baseToString(value) {
  5123. // Exit early for strings to avoid a performance hit in some environments.
  5124. if (typeof value == 'string') {
  5125. return value;
  5126. }
  5127. if (isArray(value)) {
  5128. // Recursively convert values (susceptible to call stack limits).
  5129. return arrayMap(value, baseToString) + '';
  5130. }
  5131. if (isSymbol(value)) {
  5132. return symbolToString ? symbolToString.call(value) : '';
  5133. }
  5134. var result = (value + '');
  5135. return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;
  5136. }
  5137. /**
  5138. * The base implementation of `_.uniqBy` without support for iteratee shorthands.
  5139. *
  5140. * @private
  5141. * @param {Array} array The array to inspect.
  5142. * @param {Function} [iteratee] The iteratee invoked per element.
  5143. * @param {Function} [comparator] The comparator invoked per element.
  5144. * @returns {Array} Returns the new duplicate free array.
  5145. */
  5146. function baseUniq(array, iteratee, comparator) {
  5147. var index = -1,
  5148. includes = arrayIncludes,
  5149. length = array.length,
  5150. isCommon = true,
  5151. result = [],
  5152. seen = result;
  5153. if (comparator) {
  5154. isCommon = false;
  5155. includes = arrayIncludesWith;
  5156. }
  5157. else if (length >= LARGE_ARRAY_SIZE) {
  5158. var set = iteratee ? null : createSet(array);
  5159. if (set) {
  5160. return setToArray(set);
  5161. }
  5162. isCommon = false;
  5163. includes = cacheHas;
  5164. seen = new SetCache;
  5165. }
  5166. else {
  5167. seen = iteratee ? [] : result;
  5168. }
  5169. outer:
  5170. while (++index < length) {
  5171. var value = array[index],
  5172. computed = iteratee ? iteratee(value) : value;
  5173. value = (comparator || value !== 0) ? value : 0;
  5174. if (isCommon && computed === computed) {
  5175. var seenIndex = seen.length;
  5176. while (seenIndex--) {
  5177. if (seen[seenIndex] === computed) {
  5178. continue outer;
  5179. }
  5180. }
  5181. if (iteratee) {
  5182. seen.push(computed);
  5183. }
  5184. result.push(value);
  5185. }
  5186. else if (!includes(seen, computed, comparator)) {
  5187. if (seen !== result) {
  5188. seen.push(computed);
  5189. }
  5190. result.push(value);
  5191. }
  5192. }
  5193. return result;
  5194. }
  5195. /**
  5196. * The base implementation of `_.unset`.
  5197. *
  5198. * @private
  5199. * @param {Object} object The object to modify.
  5200. * @param {Array|string} path The property path to unset.
  5201. * @returns {boolean} Returns `true` if the property is deleted, else `false`.
  5202. */
  5203. function baseUnset(object, path) {
  5204. path = castPath(path, object);
  5205. object = parent(object, path);
  5206. return object == null || delete object[toKey(last(path))];
  5207. }
  5208. /**
  5209. * The base implementation of `_.update`.
  5210. *
  5211. * @private
  5212. * @param {Object} object The object to modify.
  5213. * @param {Array|string} path The path of the property to update.
  5214. * @param {Function} updater The function to produce the updated value.
  5215. * @param {Function} [customizer] The function to customize path creation.
  5216. * @returns {Object} Returns `object`.
  5217. */
  5218. function baseUpdate(object, path, updater, customizer) {
  5219. return baseSet(object, path, updater(baseGet(object, path)), customizer);
  5220. }
  5221. /**
  5222. * The base implementation of methods like `_.dropWhile` and `_.takeWhile`
  5223. * without support for iteratee shorthands.
  5224. *
  5225. * @private
  5226. * @param {Array} array The array to query.
  5227. * @param {Function} predicate The function invoked per iteration.
  5228. * @param {boolean} [isDrop] Specify dropping elements instead of taking them.
  5229. * @param {boolean} [fromRight] Specify iterating from right to left.
  5230. * @returns {Array} Returns the slice of `array`.
  5231. */
  5232. function baseWhile(array, predicate, isDrop, fromRight) {
  5233. var length = array.length,
  5234. index = fromRight ? length : -1;
  5235. while ((fromRight ? index-- : ++index < length) &&
  5236. predicate(array[index], index, array)) {}
  5237. return isDrop
  5238. ? baseSlice(array, (fromRight ? 0 : index), (fromRight ? index + 1 : length))
  5239. : baseSlice(array, (fromRight ? index + 1 : 0), (fromRight ? length : index));
  5240. }
  5241. /**
  5242. * The base implementation of `wrapperValue` which returns the result of
  5243. * performing a sequence of actions on the unwrapped `value`, where each
  5244. * successive action is supplied the return value of the previous.
  5245. *
  5246. * @private
  5247. * @param {*} value The unwrapped value.
  5248. * @param {Array} actions Actions to perform to resolve the unwrapped value.
  5249. * @returns {*} Returns the resolved value.
  5250. */
  5251. function baseWrapperValue(value, actions) {
  5252. var result = value;
  5253. if (result instanceof LazyWrapper) {
  5254. result = result.value();
  5255. }
  5256. return arrayReduce(actions, function(result, action) {
  5257. return action.func.apply(action.thisArg, arrayPush([result], action.args));
  5258. }, result);
  5259. }
  5260. /**
  5261. * The base implementation of methods like `_.xor`, without support for
  5262. * iteratee shorthands, that accepts an array of arrays to inspect.
  5263. *
  5264. * @private
  5265. * @param {Array} arrays The arrays to inspect.
  5266. * @param {Function} [iteratee] The iteratee invoked per element.
  5267. * @param {Function} [comparator] The comparator invoked per element.
  5268. * @returns {Array} Returns the new array of values.
  5269. */
  5270. function baseXor(arrays, iteratee, comparator) {
  5271. var length = arrays.length;
  5272. if (length < 2) {
  5273. return length ? baseUniq(arrays[0]) : [];
  5274. }
  5275. var index = -1,
  5276. result = Array(length);
  5277. while (++index < length) {
  5278. var array = arrays[index],
  5279. othIndex = -1;
  5280. while (++othIndex < length) {
  5281. if (othIndex != index) {
  5282. result[index] = baseDifference(result[index] || array, arrays[othIndex], iteratee, comparator);
  5283. }
  5284. }
  5285. }
  5286. return baseUniq(baseFlatten(result, 1), iteratee, comparator);
  5287. }
  5288. /**
  5289. * This base implementation of `_.zipObject` which assigns values using `assignFunc`.
  5290. *
  5291. * @private
  5292. * @param {Array} props The property identifiers.
  5293. * @param {Array} values The property values.
  5294. * @param {Function} assignFunc The function to assign values.
  5295. * @returns {Object} Returns the new object.
  5296. */
  5297. function baseZipObject(props, values, assignFunc) {
  5298. var index = -1,
  5299. length = props.length,
  5300. valsLength = values.length,
  5301. result = {};
  5302. while (++index < length) {
  5303. var value = index < valsLength ? values[index] : undefined;
  5304. assignFunc(result, props[index], value);
  5305. }
  5306. return result;
  5307. }
  5308. /**
  5309. * Casts `value` to an empty array if it's not an array like object.
  5310. *
  5311. * @private
  5312. * @param {*} value The value to inspect.
  5313. * @returns {Array|Object} Returns the cast array-like object.
  5314. */
  5315. function castArrayLikeObject(value) {
  5316. return isArrayLikeObject(value) ? value : [];
  5317. }
  5318. /**
  5319. * Casts `value` to `identity` if it's not a function.
  5320. *
  5321. * @private
  5322. * @param {*} value The value to inspect.
  5323. * @returns {Function} Returns cast function.
  5324. */
  5325. function castFunction(value) {
  5326. return typeof value == 'function' ? value : identity;
  5327. }
  5328. /**
  5329. * Casts `value` to a path array if it's not one.
  5330. *
  5331. * @private
  5332. * @param {*} value The value to inspect.
  5333. * @param {Object} [object] The object to query keys on.
  5334. * @returns {Array} Returns the cast property path array.
  5335. */
  5336. function castPath(value, object) {
  5337. if (isArray(value)) {
  5338. return value;
  5339. }
  5340. return isKey(value, object) ? [value] : stringToPath(toString(value));
  5341. }
  5342. /**
  5343. * A `baseRest` alias which can be replaced with `identity` by module
  5344. * replacement plugins.
  5345. *
  5346. * @private
  5347. * @type {Function}
  5348. * @param {Function} func The function to apply a rest parameter to.
  5349. * @returns {Function} Returns the new function.
  5350. */
  5351. var castRest = baseRest;
  5352. /**
  5353. * Casts `array` to a slice if it's needed.
  5354. *
  5355. * @private
  5356. * @param {Array} array The array to inspect.
  5357. * @param {number} start The start position.
  5358. * @param {number} [end=array.length] The end position.
  5359. * @returns {Array} Returns the cast slice.
  5360. */
  5361. function castSlice(array, start, end) {
  5362. var length = array.length;
  5363. end = end === undefined ? length : end;
  5364. return (!start && end >= length) ? array : baseSlice(array, start, end);
  5365. }
  5366. /**
  5367. * A simple wrapper around the global [`clearTimeout`](https://mdn.io/clearTimeout).
  5368. *
  5369. * @private
  5370. * @param {number|Object} id The timer id or timeout object of the timer to clear.
  5371. */
  5372. var clearTimeout = ctxClearTimeout || function(id) {
  5373. return root.clearTimeout(id);
  5374. };
  5375. /**
  5376. * Creates a clone of `buffer`.
  5377. *
  5378. * @private
  5379. * @param {Buffer} buffer The buffer to clone.
  5380. * @param {boolean} [isDeep] Specify a deep clone.
  5381. * @returns {Buffer} Returns the cloned buffer.
  5382. */
  5383. function cloneBuffer(buffer, isDeep) {
  5384. if (isDeep) {
  5385. return buffer.slice();
  5386. }
  5387. var length = buffer.length,
  5388. result = allocUnsafe ? allocUnsafe(length) : new buffer.constructor(length);
  5389. buffer.copy(result);
  5390. return result;
  5391. }
  5392. /**
  5393. * Creates a clone of `arrayBuffer`.
  5394. *
  5395. * @private
  5396. * @param {ArrayBuffer} arrayBuffer The array buffer to clone.
  5397. * @returns {ArrayBuffer} Returns the cloned array buffer.
  5398. */
  5399. function cloneArrayBuffer(arrayBuffer) {
  5400. var result = new arrayBuffer.constructor(arrayBuffer.byteLength);
  5401. new Uint8Array(result).set(new Uint8Array(arrayBuffer));
  5402. return result;
  5403. }
  5404. /**
  5405. * Creates a clone of `dataView`.
  5406. *
  5407. * @private
  5408. * @param {Object} dataView The data view to clone.
  5409. * @param {boolean} [isDeep] Specify a deep clone.
  5410. * @returns {Object} Returns the cloned data view.
  5411. */
  5412. function cloneDataView(dataView, isDeep) {
  5413. var buffer = isDeep ? cloneArrayBuffer(dataView.buffer) : dataView.buffer;
  5414. return new dataView.constructor(buffer, dataView.byteOffset, dataView.byteLength);
  5415. }
  5416. /**
  5417. * Creates a clone of `regexp`.
  5418. *
  5419. * @private
  5420. * @param {Object} regexp The regexp to clone.
  5421. * @returns {Object} Returns the cloned regexp.
  5422. */
  5423. function cloneRegExp(regexp) {
  5424. var result = new regexp.constructor(regexp.source, reFlags.exec(regexp));
  5425. result.lastIndex = regexp.lastIndex;
  5426. return result;
  5427. }
  5428. /**
  5429. * Creates a clone of the `symbol` object.
  5430. *
  5431. * @private
  5432. * @param {Object} symbol The symbol object to clone.
  5433. * @returns {Object} Returns the cloned symbol object.
  5434. */
  5435. function cloneSymbol(symbol) {
  5436. return symbolValueOf ? Object(symbolValueOf.call(symbol)) : {};
  5437. }
  5438. /**
  5439. * Creates a clone of `typedArray`.
  5440. *
  5441. * @private
  5442. * @param {Object} typedArray The typed array to clone.
  5443. * @param {boolean} [isDeep] Specify a deep clone.
  5444. * @returns {Object} Returns the cloned typed array.
  5445. */
  5446. function cloneTypedArray(typedArray, isDeep) {
  5447. var buffer = isDeep ? cloneArrayBuffer(typedArray.buffer) : typedArray.buffer;
  5448. return new typedArray.constructor(buffer, typedArray.byteOffset, typedArray.length);
  5449. }
  5450. /**
  5451. * Compares values to sort them in ascending order.
  5452. *
  5453. * @private
  5454. * @param {*} value The value to compare.
  5455. * @param {*} other The other value to compare.
  5456. * @returns {number} Returns the sort order indicator for `value`.
  5457. */
  5458. function compareAscending(value, other) {
  5459. if (value !== other) {
  5460. var valIsDefined = value !== undefined,
  5461. valIsNull = value === null,
  5462. valIsReflexive = value === value,
  5463. valIsSymbol = isSymbol(value);
  5464. var othIsDefined = other !== undefined,
  5465. othIsNull = other === null,
  5466. othIsReflexive = other === other,
  5467. othIsSymbol = isSymbol(other);
  5468. if ((!othIsNull && !othIsSymbol && !valIsSymbol && value > other) ||
  5469. (valIsSymbol && othIsDefined && othIsReflexive && !othIsNull && !othIsSymbol) ||
  5470. (valIsNull && othIsDefined && othIsReflexive) ||
  5471. (!valIsDefined && othIsReflexive) ||
  5472. !valIsReflexive) {
  5473. return 1;
  5474. }
  5475. if ((!valIsNull && !valIsSymbol && !othIsSymbol && value < other) ||
  5476. (othIsSymbol && valIsDefined && valIsReflexive && !valIsNull && !valIsSymbol) ||
  5477. (othIsNull && valIsDefined && valIsReflexive) ||
  5478. (!othIsDefined && valIsReflexive) ||
  5479. !othIsReflexive) {
  5480. return -1;
  5481. }
  5482. }
  5483. return 0;
  5484. }
  5485. /**
  5486. * Used by `_.orderBy` to compare multiple properties of a value to another
  5487. * and stable sort them.
  5488. *
  5489. * If `orders` is unspecified, all values are sorted in ascending order. Otherwise,
  5490. * specify an order of "desc" for descending or "asc" for ascending sort order
  5491. * of corresponding values.
  5492. *
  5493. * @private
  5494. * @param {Object} object The object to compare.
  5495. * @param {Object} other The other object to compare.
  5496. * @param {boolean[]|string[]} orders The order to sort by for each property.
  5497. * @returns {number} Returns the sort order indicator for `object`.
  5498. */
  5499. function compareMultiple(object, other, orders) {
  5500. var index = -1,
  5501. objCriteria = object.criteria,
  5502. othCriteria = other.criteria,
  5503. length = objCriteria.length,
  5504. ordersLength = orders.length;
  5505. while (++index < length) {
  5506. var result = compareAscending(objCriteria[index], othCriteria[index]);
  5507. if (result) {
  5508. if (index >= ordersLength) {
  5509. return result;
  5510. }
  5511. var order = orders[index];
  5512. return result * (order == 'desc' ? -1 : 1);
  5513. }
  5514. }
  5515. // Fixes an `Array#sort` bug in the JS engine embedded in Adobe applications
  5516. // that causes it, under certain circumstances, to provide the same value for
  5517. // `object` and `other`. See https://github.com/jashkenas/underscore/pull/1247
  5518. // for more details.
  5519. //
  5520. // This also ensures a stable sort in V8 and other engines.
  5521. // See https://bugs.chromium.org/p/v8/issues/detail?id=90 for more details.
  5522. return object.index - other.index;
  5523. }
  5524. /**
  5525. * Creates an array that is the composition of partially applied arguments,
  5526. * placeholders, and provided arguments into a single array of arguments.
  5527. *
  5528. * @private
  5529. * @param {Array} args The provided arguments.
  5530. * @param {Array} partials The arguments to prepend to those provided.
  5531. * @param {Array} holders The `partials` placeholder indexes.
  5532. * @params {boolean} [isCurried] Specify composing for a curried function.
  5533. * @returns {Array} Returns the new array of composed arguments.
  5534. */
  5535. function composeArgs(args, partials, holders, isCurried) {
  5536. var argsIndex = -1,
  5537. argsLength = args.length,
  5538. holdersLength = holders.length,
  5539. leftIndex = -1,
  5540. leftLength = partials.length,
  5541. rangeLength = nativeMax(argsLength - holdersLength, 0),
  5542. result = Array(leftLength + rangeLength),
  5543. isUncurried = !isCurried;
  5544. while (++leftIndex < leftLength) {
  5545. result[leftIndex] = partials[leftIndex];
  5546. }
  5547. while (++argsIndex < holdersLength) {
  5548. if (isUncurried || argsIndex < argsLength) {
  5549. result[holders[argsIndex]] = args[argsIndex];
  5550. }
  5551. }
  5552. while (rangeLength--) {
  5553. result[leftIndex++] = args[argsIndex++];
  5554. }
  5555. return result;
  5556. }
  5557. /**
  5558. * This function is like `composeArgs` except that the arguments composition
  5559. * is tailored for `_.partialRight`.
  5560. *
  5561. * @private
  5562. * @param {Array} args The provided arguments.
  5563. * @param {Array} partials The arguments to append to those provided.
  5564. * @param {Array} holders The `partials` placeholder indexes.
  5565. * @params {boolean} [isCurried] Specify composing for a curried function.
  5566. * @returns {Array} Returns the new array of composed arguments.
  5567. */
  5568. function composeArgsRight(args, partials, holders, isCurried) {
  5569. var argsIndex = -1,
  5570. argsLength = args.length,
  5571. holdersIndex = -1,
  5572. holdersLength = holders.length,
  5573. rightIndex = -1,
  5574. rightLength = partials.length,
  5575. rangeLength = nativeMax(argsLength - holdersLength, 0),
  5576. result = Array(rangeLength + rightLength),
  5577. isUncurried = !isCurried;
  5578. while (++argsIndex < rangeLength) {
  5579. result[argsIndex] = args[argsIndex];
  5580. }
  5581. var offset = argsIndex;
  5582. while (++rightIndex < rightLength) {
  5583. result[offset + rightIndex] = partials[rightIndex];
  5584. }
  5585. while (++holdersIndex < holdersLength) {
  5586. if (isUncurried || argsIndex < argsLength) {
  5587. result[offset + holders[holdersIndex]] = args[argsIndex++];
  5588. }
  5589. }
  5590. return result;
  5591. }
  5592. /**
  5593. * Copies the values of `source` to `array`.
  5594. *
  5595. * @private
  5596. * @param {Array} source The array to copy values from.
  5597. * @param {Array} [array=[]] The array to copy values to.
  5598. * @returns {Array} Returns `array`.
  5599. */
  5600. function copyArray(source, array) {
  5601. var index = -1,
  5602. length = source.length;
  5603. array || (array = Array(length));
  5604. while (++index < length) {
  5605. array[index] = source[index];
  5606. }
  5607. return array;
  5608. }
  5609. /**
  5610. * Copies properties of `source` to `object`.
  5611. *
  5612. * @private
  5613. * @param {Object} source The object to copy properties from.
  5614. * @param {Array} props The property identifiers to copy.
  5615. * @param {Object} [object={}] The object to copy properties to.
  5616. * @param {Function} [customizer] The function to customize copied values.
  5617. * @returns {Object} Returns `object`.
  5618. */
  5619. function copyObject(source, props, object, customizer) {
  5620. var isNew = !object;
  5621. object || (object = {});
  5622. var index = -1,
  5623. length = props.length;
  5624. while (++index < length) {
  5625. var key = props[index];
  5626. var newValue = customizer
  5627. ? customizer(object[key], source[key], key, object, source)
  5628. : undefined;
  5629. if (newValue === undefined) {
  5630. newValue = source[key];
  5631. }
  5632. if (isNew) {
  5633. baseAssignValue(object, key, newValue);
  5634. } else {
  5635. assignValue(object, key, newValue);
  5636. }
  5637. }
  5638. return object;
  5639. }
  5640. /**
  5641. * Copies own symbols of `source` to `object`.
  5642. *
  5643. * @private
  5644. * @param {Object} source The object to copy symbols from.
  5645. * @param {Object} [object={}] The object to copy symbols to.
  5646. * @returns {Object} Returns `object`.
  5647. */
  5648. function copySymbols(source, object) {
  5649. return copyObject(source, getSymbols(source), object);
  5650. }
  5651. /**
  5652. * Copies own and inherited symbols of `source` to `object`.
  5653. *
  5654. * @private
  5655. * @param {Object} source The object to copy symbols from.
  5656. * @param {Object} [object={}] The object to copy symbols to.
  5657. * @returns {Object} Returns `object`.
  5658. */
  5659. function copySymbolsIn(source, object) {
  5660. return copyObject(source, getSymbolsIn(source), object);
  5661. }
  5662. /**
  5663. * Creates a function like `_.groupBy`.
  5664. *
  5665. * @private
  5666. * @param {Function} setter The function to set accumulator values.
  5667. * @param {Function} [initializer] The accumulator object initializer.
  5668. * @returns {Function} Returns the new aggregator function.
  5669. */
  5670. function createAggregator(setter, initializer) {
  5671. return function(collection, iteratee) {
  5672. var func = isArray(collection) ? arrayAggregator : baseAggregator,
  5673. accumulator = initializer ? initializer() : {};
  5674. return func(collection, setter, getIteratee(iteratee, 2), accumulator);
  5675. };
  5676. }
  5677. /**
  5678. * Creates a function like `_.assign`.
  5679. *
  5680. * @private
  5681. * @param {Function} assigner The function to assign values.
  5682. * @returns {Function} Returns the new assigner function.
  5683. */
  5684. function createAssigner(assigner) {
  5685. return baseRest(function(object, sources) {
  5686. var index = -1,
  5687. length = sources.length,
  5688. customizer = length > 1 ? sources[length - 1] : undefined,
  5689. guard = length > 2 ? sources[2] : undefined;
  5690. customizer = (assigner.length > 3 && typeof customizer == 'function')
  5691. ? (length--, customizer)
  5692. : undefined;
  5693. if (guard && isIterateeCall(sources[0], sources[1], guard)) {
  5694. customizer = length < 3 ? undefined : customizer;
  5695. length = 1;
  5696. }
  5697. object = Object(object);
  5698. while (++index < length) {
  5699. var source = sources[index];
  5700. if (source) {
  5701. assigner(object, source, index, customizer);
  5702. }
  5703. }
  5704. return object;
  5705. });
  5706. }
  5707. /**
  5708. * Creates a `baseEach` or `baseEachRight` function.
  5709. *
  5710. * @private
  5711. * @param {Function} eachFunc The function to iterate over a collection.
  5712. * @param {boolean} [fromRight] Specify iterating from right to left.
  5713. * @returns {Function} Returns the new base function.
  5714. */
  5715. function createBaseEach(eachFunc, fromRight) {
  5716. return function(collection, iteratee) {
  5717. if (collection == null) {
  5718. return collection;
  5719. }
  5720. if (!isArrayLike(collection)) {
  5721. return eachFunc(collection, iteratee);
  5722. }
  5723. var length = collection.length,
  5724. index = fromRight ? length : -1,
  5725. iterable = Object(collection);
  5726. while ((fromRight ? index-- : ++index < length)) {
  5727. if (iteratee(iterable[index], index, iterable) === false) {
  5728. break;
  5729. }
  5730. }
  5731. return collection;
  5732. };
  5733. }
  5734. /**
  5735. * Creates a base function for methods like `_.forIn` and `_.forOwn`.
  5736. *
  5737. * @private
  5738. * @param {boolean} [fromRight] Specify iterating from right to left.
  5739. * @returns {Function} Returns the new base function.
  5740. */
  5741. function createBaseFor(fromRight) {
  5742. return function(object, iteratee, keysFunc) {
  5743. var index = -1,
  5744. iterable = Object(object),
  5745. props = keysFunc(object),
  5746. length = props.length;
  5747. while (length--) {
  5748. var key = props[fromRight ? length : ++index];
  5749. if (iteratee(iterable[key], key, iterable) === false) {
  5750. break;
  5751. }
  5752. }
  5753. return object;
  5754. };
  5755. }
  5756. /**
  5757. * Creates a function that wraps `func` to invoke it with the optional `this`
  5758. * binding of `thisArg`.
  5759. *
  5760. * @private
  5761. * @param {Function} func The function to wrap.
  5762. * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
  5763. * @param {*} [thisArg] The `this` binding of `func`.
  5764. * @returns {Function} Returns the new wrapped function.
  5765. */
  5766. function createBind(func, bitmask, thisArg) {
  5767. var isBind = bitmask & WRAP_BIND_FLAG,
  5768. Ctor = createCtor(func);
  5769. function wrapper() {
  5770. var fn = (this && this !== root && this instanceof wrapper) ? Ctor : func;
  5771. return fn.apply(isBind ? thisArg : this, arguments);
  5772. }
  5773. return wrapper;
  5774. }
  5775. /**
  5776. * Creates a function like `_.lowerFirst`.
  5777. *
  5778. * @private
  5779. * @param {string} methodName The name of the `String` case method to use.
  5780. * @returns {Function} Returns the new case function.
  5781. */
  5782. function createCaseFirst(methodName) {
  5783. return function(string) {
  5784. string = toString(string);
  5785. var strSymbols = hasUnicode(string)
  5786. ? stringToArray(string)
  5787. : undefined;
  5788. var chr = strSymbols
  5789. ? strSymbols[0]
  5790. : string.charAt(0);
  5791. var trailing = strSymbols
  5792. ? castSlice(strSymbols, 1).join('')
  5793. : string.slice(1);
  5794. return chr[methodName]() + trailing;
  5795. };
  5796. }
  5797. /**
  5798. * Creates a function like `_.camelCase`.
  5799. *
  5800. * @private
  5801. * @param {Function} callback The function to combine each word.
  5802. * @returns {Function} Returns the new compounder function.
  5803. */
  5804. function createCompounder(callback) {
  5805. return function(string) {
  5806. return arrayReduce(words(deburr(string).replace(reApos, '')), callback, '');
  5807. };
  5808. }
  5809. /**
  5810. * Creates a function that produces an instance of `Ctor` regardless of
  5811. * whether it was invoked as part of a `new` expression or by `call` or `apply`.
  5812. *
  5813. * @private
  5814. * @param {Function} Ctor The constructor to wrap.
  5815. * @returns {Function} Returns the new wrapped function.
  5816. */
  5817. function createCtor(Ctor) {
  5818. return function() {
  5819. // Use a `switch` statement to work with class constructors. See
  5820. // http://ecma-international.org/ecma-262/7.0/#sec-ecmascript-function-objects-call-thisargument-argumentslist
  5821. // for more details.
  5822. var args = arguments;
  5823. switch (args.length) {
  5824. case 0: return new Ctor;
  5825. case 1: return new Ctor(args[0]);
  5826. case 2: return new Ctor(args[0], args[1]);
  5827. case 3: return new Ctor(args[0], args[1], args[2]);
  5828. case 4: return new Ctor(args[0], args[1], args[2], args[3]);
  5829. case 5: return new Ctor(args[0], args[1], args[2], args[3], args[4]);
  5830. case 6: return new Ctor(args[0], args[1], args[2], args[3], args[4], args[5]);
  5831. case 7: return new Ctor(args[0], args[1], args[2], args[3], args[4], args[5], args[6]);
  5832. }
  5833. var thisBinding = baseCreate(Ctor.prototype),
  5834. result = Ctor.apply(thisBinding, args);
  5835. // Mimic the constructor's `return` behavior.
  5836. // See https://es5.github.io/#x13.2.2 for more details.
  5837. return isObject(result) ? result : thisBinding;
  5838. };
  5839. }
  5840. /**
  5841. * Creates a function that wraps `func` to enable currying.
  5842. *
  5843. * @private
  5844. * @param {Function} func The function to wrap.
  5845. * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
  5846. * @param {number} arity The arity of `func`.
  5847. * @returns {Function} Returns the new wrapped function.
  5848. */
  5849. function createCurry(func, bitmask, arity) {
  5850. var Ctor = createCtor(func);
  5851. function wrapper() {
  5852. var length = arguments.length,
  5853. args = Array(length),
  5854. index = length,
  5855. placeholder = getHolder(wrapper);
  5856. while (index--) {
  5857. args[index] = arguments[index];
  5858. }
  5859. var holders = (length < 3 && args[0] !== placeholder && args[length - 1] !== placeholder)
  5860. ? []
  5861. : replaceHolders(args, placeholder);
  5862. length -= holders.length;
  5863. if (length < arity) {
  5864. return createRecurry(
  5865. func, bitmask, createHybrid, wrapper.placeholder, undefined,
  5866. args, holders, undefined, undefined, arity - length);
  5867. }
  5868. var fn = (this && this !== root && this instanceof wrapper) ? Ctor : func;
  5869. return apply(fn, this, args);
  5870. }
  5871. return wrapper;
  5872. }
  5873. /**
  5874. * Creates a `_.find` or `_.findLast` function.
  5875. *
  5876. * @private
  5877. * @param {Function} findIndexFunc The function to find the collection index.
  5878. * @returns {Function} Returns the new find function.
  5879. */
  5880. function createFind(findIndexFunc) {
  5881. return function(collection, predicate, fromIndex) {
  5882. var iterable = Object(collection);
  5883. if (!isArrayLike(collection)) {
  5884. var iteratee = getIteratee(predicate, 3);
  5885. collection = keys(collection);
  5886. predicate = function(key) { return iteratee(iterable[key], key, iterable); };
  5887. }
  5888. var index = findIndexFunc(collection, predicate, fromIndex);
  5889. return index > -1 ? iterable[iteratee ? collection[index] : index] : undefined;
  5890. };
  5891. }
  5892. /**
  5893. * Creates a `_.flow` or `_.flowRight` function.
  5894. *
  5895. * @private
  5896. * @param {boolean} [fromRight] Specify iterating from right to left.
  5897. * @returns {Function} Returns the new flow function.
  5898. */
  5899. function createFlow(fromRight) {
  5900. return flatRest(function(funcs) {
  5901. var length = funcs.length,
  5902. index = length,
  5903. prereq = LodashWrapper.prototype.thru;
  5904. if (fromRight) {
  5905. funcs.reverse();
  5906. }
  5907. while (index--) {
  5908. var func = funcs[index];
  5909. if (typeof func != 'function') {
  5910. throw new TypeError(FUNC_ERROR_TEXT);
  5911. }
  5912. if (prereq && !wrapper && getFuncName(func) == 'wrapper') {
  5913. var wrapper = new LodashWrapper([], true);
  5914. }
  5915. }
  5916. index = wrapper ? index : length;
  5917. while (++index < length) {
  5918. func = funcs[index];
  5919. var funcName = getFuncName(func),
  5920. data = funcName == 'wrapper' ? getData(func) : undefined;
  5921. if (data && isLaziable(data[0]) &&
  5922. data[1] == (WRAP_ARY_FLAG | WRAP_CURRY_FLAG | WRAP_PARTIAL_FLAG | WRAP_REARG_FLAG) &&
  5923. !data[4].length && data[9] == 1
  5924. ) {
  5925. wrapper = wrapper[getFuncName(data[0])].apply(wrapper, data[3]);
  5926. } else {
  5927. wrapper = (func.length == 1 && isLaziable(func))
  5928. ? wrapper[funcName]()
  5929. : wrapper.thru(func);
  5930. }
  5931. }
  5932. return function() {
  5933. var args = arguments,
  5934. value = args[0];
  5935. if (wrapper && args.length == 1 && isArray(value)) {
  5936. return wrapper.plant(value).value();
  5937. }
  5938. var index = 0,
  5939. result = length ? funcs[index].apply(this, args) : value;
  5940. while (++index < length) {
  5941. result = funcs[index].call(this, result);
  5942. }
  5943. return result;
  5944. };
  5945. });
  5946. }
  5947. /**
  5948. * Creates a function that wraps `func` to invoke it with optional `this`
  5949. * binding of `thisArg`, partial application, and currying.
  5950. *
  5951. * @private
  5952. * @param {Function|string} func The function or method name to wrap.
  5953. * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
  5954. * @param {*} [thisArg] The `this` binding of `func`.
  5955. * @param {Array} [partials] The arguments to prepend to those provided to
  5956. * the new function.
  5957. * @param {Array} [holders] The `partials` placeholder indexes.
  5958. * @param {Array} [partialsRight] The arguments to append to those provided
  5959. * to the new function.
  5960. * @param {Array} [holdersRight] The `partialsRight` placeholder indexes.
  5961. * @param {Array} [argPos] The argument positions of the new function.
  5962. * @param {number} [ary] The arity cap of `func`.
  5963. * @param {number} [arity] The arity of `func`.
  5964. * @returns {Function} Returns the new wrapped function.
  5965. */
  5966. function createHybrid(func, bitmask, thisArg, partials, holders, partialsRight, holdersRight, argPos, ary, arity) {
  5967. var isAry = bitmask & WRAP_ARY_FLAG,
  5968. isBind = bitmask & WRAP_BIND_FLAG,
  5969. isBindKey = bitmask & WRAP_BIND_KEY_FLAG,
  5970. isCurried = bitmask & (WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG),
  5971. isFlip = bitmask & WRAP_FLIP_FLAG,
  5972. Ctor = isBindKey ? undefined : createCtor(func);
  5973. function wrapper() {
  5974. var length = arguments.length,
  5975. args = Array(length),
  5976. index = length;
  5977. while (index--) {
  5978. args[index] = arguments[index];
  5979. }
  5980. if (isCurried) {
  5981. var placeholder = getHolder(wrapper),
  5982. holdersCount = countHolders(args, placeholder);
  5983. }
  5984. if (partials) {
  5985. args = composeArgs(args, partials, holders, isCurried);
  5986. }
  5987. if (partialsRight) {
  5988. args = composeArgsRight(args, partialsRight, holdersRight, isCurried);
  5989. }
  5990. length -= holdersCount;
  5991. if (isCurried && length < arity) {
  5992. var newHolders = replaceHolders(args, placeholder);
  5993. return createRecurry(
  5994. func, bitmask, createHybrid, wrapper.placeholder, thisArg,
  5995. args, newHolders, argPos, ary, arity - length
  5996. );
  5997. }
  5998. var thisBinding = isBind ? thisArg : this,
  5999. fn = isBindKey ? thisBinding[func] : func;
  6000. length = args.length;
  6001. if (argPos) {
  6002. args = reorder(args, argPos);
  6003. } else if (isFlip && length > 1) {
  6004. args.reverse();
  6005. }
  6006. if (isAry && ary < length) {
  6007. args.length = ary;
  6008. }
  6009. if (this && this !== root && this instanceof wrapper) {
  6010. fn = Ctor || createCtor(fn);
  6011. }
  6012. return fn.apply(thisBinding, args);
  6013. }
  6014. return wrapper;
  6015. }
  6016. /**
  6017. * Creates a function like `_.invertBy`.
  6018. *
  6019. * @private
  6020. * @param {Function} setter The function to set accumulator values.
  6021. * @param {Function} toIteratee The function to resolve iteratees.
  6022. * @returns {Function} Returns the new inverter function.
  6023. */
  6024. function createInverter(setter, toIteratee) {
  6025. return function(object, iteratee) {
  6026. return baseInverter(object, setter, toIteratee(iteratee), {});
  6027. };
  6028. }
  6029. /**
  6030. * Creates a function that performs a mathematical operation on two values.
  6031. *
  6032. * @private
  6033. * @param {Function} operator The function to perform the operation.
  6034. * @param {number} [defaultValue] The value used for `undefined` arguments.
  6035. * @returns {Function} Returns the new mathematical operation function.
  6036. */
  6037. function createMathOperation(operator, defaultValue) {
  6038. return function(value, other) {
  6039. var result;
  6040. if (value === undefined && other === undefined) {
  6041. return defaultValue;
  6042. }
  6043. if (value !== undefined) {
  6044. result = value;
  6045. }
  6046. if (other !== undefined) {
  6047. if (result === undefined) {
  6048. return other;
  6049. }
  6050. if (typeof value == 'string' || typeof other == 'string') {
  6051. value = baseToString(value);
  6052. other = baseToString(other);
  6053. } else {
  6054. value = baseToNumber(value);
  6055. other = baseToNumber(other);
  6056. }
  6057. result = operator(value, other);
  6058. }
  6059. return result;
  6060. };
  6061. }
  6062. /**
  6063. * Creates a function like `_.over`.
  6064. *
  6065. * @private
  6066. * @param {Function} arrayFunc The function to iterate over iteratees.
  6067. * @returns {Function} Returns the new over function.
  6068. */
  6069. function createOver(arrayFunc) {
  6070. return flatRest(function(iteratees) {
  6071. iteratees = arrayMap(iteratees, baseUnary(getIteratee()));
  6072. return baseRest(function(args) {
  6073. var thisArg = this;
  6074. return arrayFunc(iteratees, function(iteratee) {
  6075. return apply(iteratee, thisArg, args);
  6076. });
  6077. });
  6078. });
  6079. }
  6080. /**
  6081. * Creates the padding for `string` based on `length`. The `chars` string
  6082. * is truncated if the number of characters exceeds `length`.
  6083. *
  6084. * @private
  6085. * @param {number} length The padding length.
  6086. * @param {string} [chars=' '] The string used as padding.
  6087. * @returns {string} Returns the padding for `string`.
  6088. */
  6089. function createPadding(length, chars) {
  6090. chars = chars === undefined ? ' ' : baseToString(chars);
  6091. var charsLength = chars.length;
  6092. if (charsLength < 2) {
  6093. return charsLength ? baseRepeat(chars, length) : chars;
  6094. }
  6095. var result = baseRepeat(chars, nativeCeil(length / stringSize(chars)));
  6096. return hasUnicode(chars)
  6097. ? castSlice(stringToArray(result), 0, length).join('')
  6098. : result.slice(0, length);
  6099. }
  6100. /**
  6101. * Creates a function that wraps `func` to invoke it with the `this` binding
  6102. * of `thisArg` and `partials` prepended to the arguments it receives.
  6103. *
  6104. * @private
  6105. * @param {Function} func The function to wrap.
  6106. * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
  6107. * @param {*} thisArg The `this` binding of `func`.
  6108. * @param {Array} partials The arguments to prepend to those provided to
  6109. * the new function.
  6110. * @returns {Function} Returns the new wrapped function.
  6111. */
  6112. function createPartial(func, bitmask, thisArg, partials) {
  6113. var isBind = bitmask & WRAP_BIND_FLAG,
  6114. Ctor = createCtor(func);
  6115. function wrapper() {
  6116. var argsIndex = -1,
  6117. argsLength = arguments.length,
  6118. leftIndex = -1,
  6119. leftLength = partials.length,
  6120. args = Array(leftLength + argsLength),
  6121. fn = (this && this !== root && this instanceof wrapper) ? Ctor : func;
  6122. while (++leftIndex < leftLength) {
  6123. args[leftIndex] = partials[leftIndex];
  6124. }
  6125. while (argsLength--) {
  6126. args[leftIndex++] = arguments[++argsIndex];
  6127. }
  6128. return apply(fn, isBind ? thisArg : this, args);
  6129. }
  6130. return wrapper;
  6131. }
  6132. /**
  6133. * Creates a `_.range` or `_.rangeRight` function.
  6134. *
  6135. * @private
  6136. * @param {boolean} [fromRight] Specify iterating from right to left.
  6137. * @returns {Function} Returns the new range function.
  6138. */
  6139. function createRange(fromRight) {
  6140. return function(start, end, step) {
  6141. if (step && typeof step != 'number' && isIterateeCall(start, end, step)) {
  6142. end = step = undefined;
  6143. }
  6144. // Ensure the sign of `-0` is preserved.
  6145. start = toFinite(start);
  6146. if (end === undefined) {
  6147. end = start;
  6148. start = 0;
  6149. } else {
  6150. end = toFinite(end);
  6151. }
  6152. step = step === undefined ? (start < end ? 1 : -1) : toFinite(step);
  6153. return baseRange(start, end, step, fromRight);
  6154. };
  6155. }
  6156. /**
  6157. * Creates a function that performs a relational operation on two values.
  6158. *
  6159. * @private
  6160. * @param {Function} operator The function to perform the operation.
  6161. * @returns {Function} Returns the new relational operation function.
  6162. */
  6163. function createRelationalOperation(operator) {
  6164. return function(value, other) {
  6165. if (!(typeof value == 'string' && typeof other == 'string')) {
  6166. value = toNumber(value);
  6167. other = toNumber(other);
  6168. }
  6169. return operator(value, other);
  6170. };
  6171. }
  6172. /**
  6173. * Creates a function that wraps `func` to continue currying.
  6174. *
  6175. * @private
  6176. * @param {Function} func The function to wrap.
  6177. * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
  6178. * @param {Function} wrapFunc The function to create the `func` wrapper.
  6179. * @param {*} placeholder The placeholder value.
  6180. * @param {*} [thisArg] The `this` binding of `func`.
  6181. * @param {Array} [partials] The arguments to prepend to those provided to
  6182. * the new function.
  6183. * @param {Array} [holders] The `partials` placeholder indexes.
  6184. * @param {Array} [argPos] The argument positions of the new function.
  6185. * @param {number} [ary] The arity cap of `func`.
  6186. * @param {number} [arity] The arity of `func`.
  6187. * @returns {Function} Returns the new wrapped function.
  6188. */
  6189. function createRecurry(func, bitmask, wrapFunc, placeholder, thisArg, partials, holders, argPos, ary, arity) {
  6190. var isCurry = bitmask & WRAP_CURRY_FLAG,
  6191. newHolders = isCurry ? holders : undefined,
  6192. newHoldersRight = isCurry ? undefined : holders,
  6193. newPartials = isCurry ? partials : undefined,
  6194. newPartialsRight = isCurry ? undefined : partials;
  6195. bitmask |= (isCurry ? WRAP_PARTIAL_FLAG : WRAP_PARTIAL_RIGHT_FLAG);
  6196. bitmask &= ~(isCurry ? WRAP_PARTIAL_RIGHT_FLAG : WRAP_PARTIAL_FLAG);
  6197. if (!(bitmask & WRAP_CURRY_BOUND_FLAG)) {
  6198. bitmask &= ~(WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG);
  6199. }
  6200. var newData = [
  6201. func, bitmask, thisArg, newPartials, newHolders, newPartialsRight,
  6202. newHoldersRight, argPos, ary, arity
  6203. ];
  6204. var result = wrapFunc.apply(undefined, newData);
  6205. if (isLaziable(func)) {
  6206. setData(result, newData);
  6207. }
  6208. result.placeholder = placeholder;
  6209. return setWrapToString(result, func, bitmask);
  6210. }
  6211. /**
  6212. * Creates a function like `_.round`.
  6213. *
  6214. * @private
  6215. * @param {string} methodName The name of the `Math` method to use when rounding.
  6216. * @returns {Function} Returns the new round function.
  6217. */
  6218. function createRound(methodName) {
  6219. var func = Math[methodName];
  6220. return function(number, precision) {
  6221. number = toNumber(number);
  6222. precision = precision == null ? 0 : nativeMin(toInteger(precision), 292);
  6223. if (precision && nativeIsFinite(number)) {
  6224. // Shift with exponential notation to avoid floating-point issues.
  6225. // See [MDN](https://mdn.io/round#Examples) for more details.
  6226. var pair = (toString(number) + 'e').split('e'),
  6227. value = func(pair[0] + 'e' + (+pair[1] + precision));
  6228. pair = (toString(value) + 'e').split('e');
  6229. return +(pair[0] + 'e' + (+pair[1] - precision));
  6230. }
  6231. return func(number);
  6232. };
  6233. }
  6234. /**
  6235. * Creates a set object of `values`.
  6236. *
  6237. * @private
  6238. * @param {Array} values The values to add to the set.
  6239. * @returns {Object} Returns the new set.
  6240. */
  6241. var createSet = !(Set && (1 / setToArray(new Set([,-0]))[1]) == INFINITY) ? noop : function(values) {
  6242. return new Set(values);
  6243. };
  6244. /**
  6245. * Creates a `_.toPairs` or `_.toPairsIn` function.
  6246. *
  6247. * @private
  6248. * @param {Function} keysFunc The function to get the keys of a given object.
  6249. * @returns {Function} Returns the new pairs function.
  6250. */
  6251. function createToPairs(keysFunc) {
  6252. return function(object) {
  6253. var tag = getTag(object);
  6254. if (tag == mapTag) {
  6255. return mapToArray(object);
  6256. }
  6257. if (tag == setTag) {
  6258. return setToPairs(object);
  6259. }
  6260. return baseToPairs(object, keysFunc(object));
  6261. };
  6262. }
  6263. /**
  6264. * Creates a function that either curries or invokes `func` with optional
  6265. * `this` binding and partially applied arguments.
  6266. *
  6267. * @private
  6268. * @param {Function|string} func The function or method name to wrap.
  6269. * @param {number} bitmask The bitmask flags.
  6270. * 1 - `_.bind`
  6271. * 2 - `_.bindKey`
  6272. * 4 - `_.curry` or `_.curryRight` of a bound function
  6273. * 8 - `_.curry`
  6274. * 16 - `_.curryRight`
  6275. * 32 - `_.partial`
  6276. * 64 - `_.partialRight`
  6277. * 128 - `_.rearg`
  6278. * 256 - `_.ary`
  6279. * 512 - `_.flip`
  6280. * @param {*} [thisArg] The `this` binding of `func`.
  6281. * @param {Array} [partials] The arguments to be partially applied.
  6282. * @param {Array} [holders] The `partials` placeholder indexes.
  6283. * @param {Array} [argPos] The argument positions of the new function.
  6284. * @param {number} [ary] The arity cap of `func`.
  6285. * @param {number} [arity] The arity of `func`.
  6286. * @returns {Function} Returns the new wrapped function.
  6287. */
  6288. function createWrap(func, bitmask, thisArg, partials, holders, argPos, ary, arity) {
  6289. var isBindKey = bitmask & WRAP_BIND_KEY_FLAG;
  6290. if (!isBindKey && typeof func != 'function') {
  6291. throw new TypeError(FUNC_ERROR_TEXT);
  6292. }
  6293. var length = partials ? partials.length : 0;
  6294. if (!length) {
  6295. bitmask &= ~(WRAP_PARTIAL_FLAG | WRAP_PARTIAL_RIGHT_FLAG);
  6296. partials = holders = undefined;
  6297. }
  6298. ary = ary === undefined ? ary : nativeMax(toInteger(ary), 0);
  6299. arity = arity === undefined ? arity : toInteger(arity);
  6300. length -= holders ? holders.length : 0;
  6301. if (bitmask & WRAP_PARTIAL_RIGHT_FLAG) {
  6302. var partialsRight = partials,
  6303. holdersRight = holders;
  6304. partials = holders = undefined;
  6305. }
  6306. var data = isBindKey ? undefined : getData(func);
  6307. var newData = [
  6308. func, bitmask, thisArg, partials, holders, partialsRight, holdersRight,
  6309. argPos, ary, arity
  6310. ];
  6311. if (data) {
  6312. mergeData(newData, data);
  6313. }
  6314. func = newData[0];
  6315. bitmask = newData[1];
  6316. thisArg = newData[2];
  6317. partials = newData[3];
  6318. holders = newData[4];
  6319. arity = newData[9] = newData[9] === undefined
  6320. ? (isBindKey ? 0 : func.length)
  6321. : nativeMax(newData[9] - length, 0);
  6322. if (!arity && bitmask & (WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG)) {
  6323. bitmask &= ~(WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG);
  6324. }
  6325. if (!bitmask || bitmask == WRAP_BIND_FLAG) {
  6326. var result = createBind(func, bitmask, thisArg);
  6327. } else if (bitmask == WRAP_CURRY_FLAG || bitmask == WRAP_CURRY_RIGHT_FLAG) {
  6328. result = createCurry(func, bitmask, arity);
  6329. } else if ((bitmask == WRAP_PARTIAL_FLAG || bitmask == (WRAP_BIND_FLAG | WRAP_PARTIAL_FLAG)) && !holders.length) {
  6330. result = createPartial(func, bitmask, thisArg, partials);
  6331. } else {
  6332. result = createHybrid.apply(undefined, newData);
  6333. }
  6334. var setter = data ? baseSetData : setData;
  6335. return setWrapToString(setter(result, newData), func, bitmask);
  6336. }
  6337. /**
  6338. * Used by `_.defaults` to customize its `_.assignIn` use to assign properties
  6339. * of source objects to the destination object for all destination properties
  6340. * that resolve to `undefined`.
  6341. *
  6342. * @private
  6343. * @param {*} objValue The destination value.
  6344. * @param {*} srcValue The source value.
  6345. * @param {string} key The key of the property to assign.
  6346. * @param {Object} object The parent object of `objValue`.
  6347. * @returns {*} Returns the value to assign.
  6348. */
  6349. function customDefaultsAssignIn(objValue, srcValue, key, object) {
  6350. if (objValue === undefined ||
  6351. (eq(objValue, objectProto[key]) && !hasOwnProperty.call(object, key))) {
  6352. return srcValue;
  6353. }
  6354. return objValue;
  6355. }
  6356. /**
  6357. * Used by `_.defaultsDeep` to customize its `_.merge` use to merge source
  6358. * objects into destination objects that are passed thru.
  6359. *
  6360. * @private
  6361. * @param {*} objValue The destination value.
  6362. * @param {*} srcValue The source value.
  6363. * @param {string} key The key of the property to merge.
  6364. * @param {Object} object The parent object of `objValue`.
  6365. * @param {Object} source The parent object of `srcValue`.
  6366. * @param {Object} [stack] Tracks traversed source values and their merged
  6367. * counterparts.
  6368. * @returns {*} Returns the value to assign.
  6369. */
  6370. function customDefaultsMerge(objValue, srcValue, key, object, source, stack) {
  6371. if (isObject(objValue) && isObject(srcValue)) {
  6372. // Recursively merge objects and arrays (susceptible to call stack limits).
  6373. stack.set(srcValue, objValue);
  6374. baseMerge(objValue, srcValue, undefined, customDefaultsMerge, stack);
  6375. stack['delete'](srcValue);
  6376. }
  6377. return objValue;
  6378. }
  6379. /**
  6380. * Used by `_.omit` to customize its `_.cloneDeep` use to only clone plain
  6381. * objects.
  6382. *
  6383. * @private
  6384. * @param {*} value The value to inspect.
  6385. * @param {string} key The key of the property to inspect.
  6386. * @returns {*} Returns the uncloned value or `undefined` to defer cloning to `_.cloneDeep`.
  6387. */
  6388. function customOmitClone(value) {
  6389. return isPlainObject(value) ? undefined : value;
  6390. }
  6391. /**
  6392. * A specialized version of `baseIsEqualDeep` for arrays with support for
  6393. * partial deep comparisons.
  6394. *
  6395. * @private
  6396. * @param {Array} array The array to compare.
  6397. * @param {Array} other The other array to compare.
  6398. * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
  6399. * @param {Function} customizer The function to customize comparisons.
  6400. * @param {Function} equalFunc The function to determine equivalents of values.
  6401. * @param {Object} stack Tracks traversed `array` and `other` objects.
  6402. * @returns {boolean} Returns `true` if the arrays are equivalent, else `false`.
  6403. */
  6404. function equalArrays(array, other, bitmask, customizer, equalFunc, stack) {
  6405. var isPartial = bitmask & COMPARE_PARTIAL_FLAG,
  6406. arrLength = array.length,
  6407. othLength = other.length;
  6408. if (arrLength != othLength && !(isPartial && othLength > arrLength)) {
  6409. return false;
  6410. }
  6411. // Check that cyclic values are equal.
  6412. var arrStacked = stack.get(array);
  6413. var othStacked = stack.get(other);
  6414. if (arrStacked && othStacked) {
  6415. return arrStacked == other && othStacked == array;
  6416. }
  6417. var index = -1,
  6418. result = true,
  6419. seen = (bitmask & COMPARE_UNORDERED_FLAG) ? new SetCache : undefined;
  6420. stack.set(array, other);
  6421. stack.set(other, array);
  6422. // Ignore non-index properties.
  6423. while (++index < arrLength) {
  6424. var arrValue = array[index],
  6425. othValue = other[index];
  6426. if (customizer) {
  6427. var compared = isPartial
  6428. ? customizer(othValue, arrValue, index, other, array, stack)
  6429. : customizer(arrValue, othValue, index, array, other, stack);
  6430. }
  6431. if (compared !== undefined) {
  6432. if (compared) {
  6433. continue;
  6434. }
  6435. result = false;
  6436. break;
  6437. }
  6438. // Recursively compare arrays (susceptible to call stack limits).
  6439. if (seen) {
  6440. if (!arraySome(other, function(othValue, othIndex) {
  6441. if (!cacheHas(seen, othIndex) &&
  6442. (arrValue === othValue || equalFunc(arrValue, othValue, bitmask, customizer, stack))) {
  6443. return seen.push(othIndex);
  6444. }
  6445. })) {
  6446. result = false;
  6447. break;
  6448. }
  6449. } else if (!(
  6450. arrValue === othValue ||
  6451. equalFunc(arrValue, othValue, bitmask, customizer, stack)
  6452. )) {
  6453. result = false;
  6454. break;
  6455. }
  6456. }
  6457. stack['delete'](array);
  6458. stack['delete'](other);
  6459. return result;
  6460. }
  6461. /**
  6462. * A specialized version of `baseIsEqualDeep` for comparing objects of
  6463. * the same `toStringTag`.
  6464. *
  6465. * **Note:** This function only supports comparing values with tags of
  6466. * `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`.
  6467. *
  6468. * @private
  6469. * @param {Object} object The object to compare.
  6470. * @param {Object} other The other object to compare.
  6471. * @param {string} tag The `toStringTag` of the objects to compare.
  6472. * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
  6473. * @param {Function} customizer The function to customize comparisons.
  6474. * @param {Function} equalFunc The function to determine equivalents of values.
  6475. * @param {Object} stack Tracks traversed `object` and `other` objects.
  6476. * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
  6477. */
  6478. function equalByTag(object, other, tag, bitmask, customizer, equalFunc, stack) {
  6479. switch (tag) {
  6480. case dataViewTag:
  6481. if ((object.byteLength != other.byteLength) ||
  6482. (object.byteOffset != other.byteOffset)) {
  6483. return false;
  6484. }
  6485. object = object.buffer;
  6486. other = other.buffer;
  6487. case arrayBufferTag:
  6488. if ((object.byteLength != other.byteLength) ||
  6489. !equalFunc(new Uint8Array(object), new Uint8Array(other))) {
  6490. return false;
  6491. }
  6492. return true;
  6493. case boolTag:
  6494. case dateTag:
  6495. case numberTag:
  6496. // Coerce booleans to `1` or `0` and dates to milliseconds.
  6497. // Invalid dates are coerced to `NaN`.
  6498. return eq(+object, +other);
  6499. case errorTag:
  6500. return object.name == other.name && object.message == other.message;
  6501. case regexpTag:
  6502. case stringTag:
  6503. // Coerce regexes to strings and treat strings, primitives and objects,
  6504. // as equal. See http://www.ecma-international.org/ecma-262/7.0/#sec-regexp.prototype.tostring
  6505. // for more details.
  6506. return object == (other + '');
  6507. case mapTag:
  6508. var convert = mapToArray;
  6509. case setTag:
  6510. var isPartial = bitmask & COMPARE_PARTIAL_FLAG;
  6511. convert || (convert = setToArray);
  6512. if (object.size != other.size && !isPartial) {
  6513. return false;
  6514. }
  6515. // Assume cyclic values are equal.
  6516. var stacked = stack.get(object);
  6517. if (stacked) {
  6518. return stacked == other;
  6519. }
  6520. bitmask |= COMPARE_UNORDERED_FLAG;
  6521. // Recursively compare objects (susceptible to call stack limits).
  6522. stack.set(object, other);
  6523. var result = equalArrays(convert(object), convert(other), bitmask, customizer, equalFunc, stack);
  6524. stack['delete'](object);
  6525. return result;
  6526. case symbolTag:
  6527. if (symbolValueOf) {
  6528. return symbolValueOf.call(object) == symbolValueOf.call(other);
  6529. }
  6530. }
  6531. return false;
  6532. }
  6533. /**
  6534. * A specialized version of `baseIsEqualDeep` for objects with support for
  6535. * partial deep comparisons.
  6536. *
  6537. * @private
  6538. * @param {Object} object The object to compare.
  6539. * @param {Object} other The other object to compare.
  6540. * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
  6541. * @param {Function} customizer The function to customize comparisons.
  6542. * @param {Function} equalFunc The function to determine equivalents of values.
  6543. * @param {Object} stack Tracks traversed `object` and `other` objects.
  6544. * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
  6545. */
  6546. function equalObjects(object, other, bitmask, customizer, equalFunc, stack) {
  6547. var isPartial = bitmask & COMPARE_PARTIAL_FLAG,
  6548. objProps = getAllKeys(object),
  6549. objLength = objProps.length,
  6550. othProps = getAllKeys(other),
  6551. othLength = othProps.length;
  6552. if (objLength != othLength && !isPartial) {
  6553. return false;
  6554. }
  6555. var index = objLength;
  6556. while (index--) {
  6557. var key = objProps[index];
  6558. if (!(isPartial ? key in other : hasOwnProperty.call(other, key))) {
  6559. return false;
  6560. }
  6561. }
  6562. // Check that cyclic values are equal.
  6563. var objStacked = stack.get(object);
  6564. var othStacked = stack.get(other);
  6565. if (objStacked && othStacked) {
  6566. return objStacked == other && othStacked == object;
  6567. }
  6568. var result = true;
  6569. stack.set(object, other);
  6570. stack.set(other, object);
  6571. var skipCtor = isPartial;
  6572. while (++index < objLength) {
  6573. key = objProps[index];
  6574. var objValue = object[key],
  6575. othValue = other[key];
  6576. if (customizer) {
  6577. var compared = isPartial
  6578. ? customizer(othValue, objValue, key, other, object, stack)
  6579. : customizer(objValue, othValue, key, object, other, stack);
  6580. }
  6581. // Recursively compare objects (susceptible to call stack limits).
  6582. if (!(compared === undefined
  6583. ? (objValue === othValue || equalFunc(objValue, othValue, bitmask, customizer, stack))
  6584. : compared
  6585. )) {
  6586. result = false;
  6587. break;
  6588. }
  6589. skipCtor || (skipCtor = key == 'constructor');
  6590. }
  6591. if (result && !skipCtor) {
  6592. var objCtor = object.constructor,
  6593. othCtor = other.constructor;
  6594. // Non `Object` object instances with different constructors are not equal.
  6595. if (objCtor != othCtor &&
  6596. ('constructor' in object && 'constructor' in other) &&
  6597. !(typeof objCtor == 'function' && objCtor instanceof objCtor &&
  6598. typeof othCtor == 'function' && othCtor instanceof othCtor)) {
  6599. result = false;
  6600. }
  6601. }
  6602. stack['delete'](object);
  6603. stack['delete'](other);
  6604. return result;
  6605. }
  6606. /**
  6607. * A specialized version of `baseRest` which flattens the rest array.
  6608. *
  6609. * @private
  6610. * @param {Function} func The function to apply a rest parameter to.
  6611. * @returns {Function} Returns the new function.
  6612. */
  6613. function flatRest(func) {
  6614. return setToString(overRest(func, undefined, flatten), func + '');
  6615. }
  6616. /**
  6617. * Creates an array of own enumerable property names and symbols of `object`.
  6618. *
  6619. * @private
  6620. * @param {Object} object The object to query.
  6621. * @returns {Array} Returns the array of property names and symbols.
  6622. */
  6623. function getAllKeys(object) {
  6624. return baseGetAllKeys(object, keys, getSymbols);
  6625. }
  6626. /**
  6627. * Creates an array of own and inherited enumerable property names and
  6628. * symbols of `object`.
  6629. *
  6630. * @private
  6631. * @param {Object} object The object to query.
  6632. * @returns {Array} Returns the array of property names and symbols.
  6633. */
  6634. function getAllKeysIn(object) {
  6635. return baseGetAllKeys(object, keysIn, getSymbolsIn);
  6636. }
  6637. /**
  6638. * Gets metadata for `func`.
  6639. *
  6640. * @private
  6641. * @param {Function} func The function to query.
  6642. * @returns {*} Returns the metadata for `func`.
  6643. */
  6644. var getData = !metaMap ? noop : function(func) {
  6645. return metaMap.get(func);
  6646. };
  6647. /**
  6648. * Gets the name of `func`.
  6649. *
  6650. * @private
  6651. * @param {Function} func The function to query.
  6652. * @returns {string} Returns the function name.
  6653. */
  6654. function getFuncName(func) {
  6655. var result = (func.name + ''),
  6656. array = realNames[result],
  6657. length = hasOwnProperty.call(realNames, result) ? array.length : 0;
  6658. while (length--) {
  6659. var data = array[length],
  6660. otherFunc = data.func;
  6661. if (otherFunc == null || otherFunc == func) {
  6662. return data.name;
  6663. }
  6664. }
  6665. return result;
  6666. }
  6667. /**
  6668. * Gets the argument placeholder value for `func`.
  6669. *
  6670. * @private
  6671. * @param {Function} func The function to inspect.
  6672. * @returns {*} Returns the placeholder value.
  6673. */
  6674. function getHolder(func) {
  6675. var object = hasOwnProperty.call(lodash, 'placeholder') ? lodash : func;
  6676. return object.placeholder;
  6677. }
  6678. /**
  6679. * Gets the appropriate "iteratee" function. If `_.iteratee` is customized,
  6680. * this function returns the custom method, otherwise it returns `baseIteratee`.
  6681. * If arguments are provided, the chosen function is invoked with them and
  6682. * its result is returned.
  6683. *
  6684. * @private
  6685. * @param {*} [value] The value to convert to an iteratee.
  6686. * @param {number} [arity] The arity of the created iteratee.
  6687. * @returns {Function} Returns the chosen function or its result.
  6688. */
  6689. function getIteratee() {
  6690. var result = lodash.iteratee || iteratee;
  6691. result = result === iteratee ? baseIteratee : result;
  6692. return arguments.length ? result(arguments[0], arguments[1]) : result;
  6693. }
  6694. /**
  6695. * Gets the data for `map`.
  6696. *
  6697. * @private
  6698. * @param {Object} map The map to query.
  6699. * @param {string} key The reference key.
  6700. * @returns {*} Returns the map data.
  6701. */
  6702. function getMapData(map, key) {
  6703. var data = map.__data__;
  6704. return isKeyable(key)
  6705. ? data[typeof key == 'string' ? 'string' : 'hash']
  6706. : data.map;
  6707. }
  6708. /**
  6709. * Gets the property names, values, and compare flags of `object`.
  6710. *
  6711. * @private
  6712. * @param {Object} object The object to query.
  6713. * @returns {Array} Returns the match data of `object`.
  6714. */
  6715. function getMatchData(object) {
  6716. var result = keys(object),
  6717. length = result.length;
  6718. while (length--) {
  6719. var key = result[length],
  6720. value = object[key];
  6721. result[length] = [key, value, isStrictComparable(value)];
  6722. }
  6723. return result;
  6724. }
  6725. /**
  6726. * Gets the native function at `key` of `object`.
  6727. *
  6728. * @private
  6729. * @param {Object} object The object to query.
  6730. * @param {string} key The key of the method to get.
  6731. * @returns {*} Returns the function if it's native, else `undefined`.
  6732. */
  6733. function getNative(object, key) {
  6734. var value = getValue(object, key);
  6735. return baseIsNative(value) ? value : undefined;
  6736. }
  6737. /**
  6738. * A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values.
  6739. *
  6740. * @private
  6741. * @param {*} value The value to query.
  6742. * @returns {string} Returns the raw `toStringTag`.
  6743. */
  6744. function getRawTag(value) {
  6745. var isOwn = hasOwnProperty.call(value, symToStringTag),
  6746. tag = value[symToStringTag];
  6747. try {
  6748. value[symToStringTag] = undefined;
  6749. var unmasked = true;
  6750. } catch (e) {}
  6751. var result = nativeObjectToString.call(value);
  6752. if (unmasked) {
  6753. if (isOwn) {
  6754. value[symToStringTag] = tag;
  6755. } else {
  6756. delete value[symToStringTag];
  6757. }
  6758. }
  6759. return result;
  6760. }
  6761. /**
  6762. * Creates an array of the own enumerable symbols of `object`.
  6763. *
  6764. * @private
  6765. * @param {Object} object The object to query.
  6766. * @returns {Array} Returns the array of symbols.
  6767. */
  6768. var getSymbols = !nativeGetSymbols ? stubArray : function(object) {
  6769. if (object == null) {
  6770. return [];
  6771. }
  6772. object = Object(object);
  6773. return arrayFilter(nativeGetSymbols(object), function(symbol) {
  6774. return propertyIsEnumerable.call(object, symbol);
  6775. });
  6776. };
  6777. /**
  6778. * Creates an array of the own and inherited enumerable symbols of `object`.
  6779. *
  6780. * @private
  6781. * @param {Object} object The object to query.
  6782. * @returns {Array} Returns the array of symbols.
  6783. */
  6784. var getSymbolsIn = !nativeGetSymbols ? stubArray : function(object) {
  6785. var result = [];
  6786. while (object) {
  6787. arrayPush(result, getSymbols(object));
  6788. object = getPrototype(object);
  6789. }
  6790. return result;
  6791. };
  6792. /**
  6793. * Gets the `toStringTag` of `value`.
  6794. *
  6795. * @private
  6796. * @param {*} value The value to query.
  6797. * @returns {string} Returns the `toStringTag`.
  6798. */
  6799. var getTag = baseGetTag;
  6800. // Fallback for data views, maps, sets, and weak maps in IE 11 and promises in Node.js < 6.
  6801. if ((DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag) ||
  6802. (Map && getTag(new Map) != mapTag) ||
  6803. (Promise && getTag(Promise.resolve()) != promiseTag) ||
  6804. (Set && getTag(new Set) != setTag) ||
  6805. (WeakMap && getTag(new WeakMap) != weakMapTag)) {
  6806. getTag = function(value) {
  6807. var result = baseGetTag(value),
  6808. Ctor = result == objectTag ? value.constructor : undefined,
  6809. ctorString = Ctor ? toSource(Ctor) : '';
  6810. if (ctorString) {
  6811. switch (ctorString) {
  6812. case dataViewCtorString: return dataViewTag;
  6813. case mapCtorString: return mapTag;
  6814. case promiseCtorString: return promiseTag;
  6815. case setCtorString: return setTag;
  6816. case weakMapCtorString: return weakMapTag;
  6817. }
  6818. }
  6819. return result;
  6820. };
  6821. }
  6822. /**
  6823. * Gets the view, applying any `transforms` to the `start` and `end` positions.
  6824. *
  6825. * @private
  6826. * @param {number} start The start of the view.
  6827. * @param {number} end The end of the view.
  6828. * @param {Array} transforms The transformations to apply to the view.
  6829. * @returns {Object} Returns an object containing the `start` and `end`
  6830. * positions of the view.
  6831. */
  6832. function getView(start, end, transforms) {
  6833. var index = -1,
  6834. length = transforms.length;
  6835. while (++index < length) {
  6836. var data = transforms[index],
  6837. size = data.size;
  6838. switch (data.type) {
  6839. case 'drop': start += size; break;
  6840. case 'dropRight': end -= size; break;
  6841. case 'take': end = nativeMin(end, start + size); break;
  6842. case 'takeRight': start = nativeMax(start, end - size); break;
  6843. }
  6844. }
  6845. return { 'start': start, 'end': end };
  6846. }
  6847. /**
  6848. * Extracts wrapper details from the `source` body comment.
  6849. *
  6850. * @private
  6851. * @param {string} source The source to inspect.
  6852. * @returns {Array} Returns the wrapper details.
  6853. */
  6854. function getWrapDetails(source) {
  6855. var match = source.match(reWrapDetails);
  6856. return match ? match[1].split(reSplitDetails) : [];
  6857. }
  6858. /**
  6859. * Checks if `path` exists on `object`.
  6860. *
  6861. * @private
  6862. * @param {Object} object The object to query.
  6863. * @param {Array|string} path The path to check.
  6864. * @param {Function} hasFunc The function to check properties.
  6865. * @returns {boolean} Returns `true` if `path` exists, else `false`.
  6866. */
  6867. function hasPath(object, path, hasFunc) {
  6868. path = castPath(path, object);
  6869. var index = -1,
  6870. length = path.length,
  6871. result = false;
  6872. while (++index < length) {
  6873. var key = toKey(path[index]);
  6874. if (!(result = object != null && hasFunc(object, key))) {
  6875. break;
  6876. }
  6877. object = object[key];
  6878. }
  6879. if (result || ++index != length) {
  6880. return result;
  6881. }
  6882. length = object == null ? 0 : object.length;
  6883. return !!length && isLength(length) && isIndex(key, length) &&
  6884. (isArray(object) || isArguments(object));
  6885. }
  6886. /**
  6887. * Initializes an array clone.
  6888. *
  6889. * @private
  6890. * @param {Array} array The array to clone.
  6891. * @returns {Array} Returns the initialized clone.
  6892. */
  6893. function initCloneArray(array) {
  6894. var length = array.length,
  6895. result = new array.constructor(length);
  6896. // Add properties assigned by `RegExp#exec`.
  6897. if (length && typeof array[0] == 'string' && hasOwnProperty.call(array, 'index')) {
  6898. result.index = array.index;
  6899. result.input = array.input;
  6900. }
  6901. return result;
  6902. }
  6903. /**
  6904. * Initializes an object clone.
  6905. *
  6906. * @private
  6907. * @param {Object} object The object to clone.
  6908. * @returns {Object} Returns the initialized clone.
  6909. */
  6910. function initCloneObject(object) {
  6911. return (typeof object.constructor == 'function' && !isPrototype(object))
  6912. ? baseCreate(getPrototype(object))
  6913. : {};
  6914. }
  6915. /**
  6916. * Initializes an object clone based on its `toStringTag`.
  6917. *
  6918. * **Note:** This function only supports cloning values with tags of
  6919. * `Boolean`, `Date`, `Error`, `Map`, `Number`, `RegExp`, `Set`, or `String`.
  6920. *
  6921. * @private
  6922. * @param {Object} object The object to clone.
  6923. * @param {string} tag The `toStringTag` of the object to clone.
  6924. * @param {boolean} [isDeep] Specify a deep clone.
  6925. * @returns {Object} Returns the initialized clone.
  6926. */
  6927. function initCloneByTag(object, tag, isDeep) {
  6928. var Ctor = object.constructor;
  6929. switch (tag) {
  6930. case arrayBufferTag:
  6931. return cloneArrayBuffer(object);
  6932. case boolTag:
  6933. case dateTag:
  6934. return new Ctor(+object);
  6935. case dataViewTag:
  6936. return cloneDataView(object, isDeep);
  6937. case float32Tag: case float64Tag:
  6938. case int8Tag: case int16Tag: case int32Tag:
  6939. case uint8Tag: case uint8ClampedTag: case uint16Tag: case uint32Tag:
  6940. return cloneTypedArray(object, isDeep);
  6941. case mapTag:
  6942. return new Ctor;
  6943. case numberTag:
  6944. case stringTag:
  6945. return new Ctor(object);
  6946. case regexpTag:
  6947. return cloneRegExp(object);
  6948. case setTag:
  6949. return new Ctor;
  6950. case symbolTag:
  6951. return cloneSymbol(object);
  6952. }
  6953. }
  6954. /**
  6955. * Inserts wrapper `details` in a comment at the top of the `source` body.
  6956. *
  6957. * @private
  6958. * @param {string} source The source to modify.
  6959. * @returns {Array} details The details to insert.
  6960. * @returns {string} Returns the modified source.
  6961. */
  6962. function insertWrapDetails(source, details) {
  6963. var length = details.length;
  6964. if (!length) {
  6965. return source;
  6966. }
  6967. var lastIndex = length - 1;
  6968. details[lastIndex] = (length > 1 ? '& ' : '') + details[lastIndex];
  6969. details = details.join(length > 2 ? ', ' : ' ');
  6970. return source.replace(reWrapComment, '{\n/* [wrapped with ' + details + '] */\n');
  6971. }
  6972. /**
  6973. * Checks if `value` is a flattenable `arguments` object or array.
  6974. *
  6975. * @private
  6976. * @param {*} value The value to check.
  6977. * @returns {boolean} Returns `true` if `value` is flattenable, else `false`.
  6978. */
  6979. function isFlattenable(value) {
  6980. return isArray(value) || isArguments(value) ||
  6981. !!(spreadableSymbol && value && value[spreadableSymbol]);
  6982. }
  6983. /**
  6984. * Checks if `value` is a valid array-like index.
  6985. *
  6986. * @private
  6987. * @param {*} value The value to check.
  6988. * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.
  6989. * @returns {boolean} Returns `true` if `value` is a valid index, else `false`.
  6990. */
  6991. function isIndex(value, length) {
  6992. var type = typeof value;
  6993. length = length == null ? MAX_SAFE_INTEGER : length;
  6994. return !!length &&
  6995. (type == 'number' ||
  6996. (type != 'symbol' && reIsUint.test(value))) &&
  6997. (value > -1 && value % 1 == 0 && value < length);
  6998. }
  6999. /**
  7000. * Checks if the given arguments are from an iteratee call.
  7001. *
  7002. * @private
  7003. * @param {*} value The potential iteratee value argument.
  7004. * @param {*} index The potential iteratee index or key argument.
  7005. * @param {*} object The potential iteratee object argument.
  7006. * @returns {boolean} Returns `true` if the arguments are from an iteratee call,
  7007. * else `false`.
  7008. */
  7009. function isIterateeCall(value, index, object) {
  7010. if (!isObject(object)) {
  7011. return false;
  7012. }
  7013. var type = typeof index;
  7014. if (type == 'number'
  7015. ? (isArrayLike(object) && isIndex(index, object.length))
  7016. : (type == 'string' && index in object)
  7017. ) {
  7018. return eq(object[index], value);
  7019. }
  7020. return false;
  7021. }
  7022. /**
  7023. * Checks if `value` is a property name and not a property path.
  7024. *
  7025. * @private
  7026. * @param {*} value The value to check.
  7027. * @param {Object} [object] The object to query keys on.
  7028. * @returns {boolean} Returns `true` if `value` is a property name, else `false`.
  7029. */
  7030. function isKey(value, object) {
  7031. if (isArray(value)) {
  7032. return false;
  7033. }
  7034. var type = typeof value;
  7035. if (type == 'number' || type == 'symbol' || type == 'boolean' ||
  7036. value == null || isSymbol(value)) {
  7037. return true;
  7038. }
  7039. return reIsPlainProp.test(value) || !reIsDeepProp.test(value) ||
  7040. (object != null && value in Object(object));
  7041. }
  7042. /**
  7043. * Checks if `value` is suitable for use as unique object key.
  7044. *
  7045. * @private
  7046. * @param {*} value The value to check.
  7047. * @returns {boolean} Returns `true` if `value` is suitable, else `false`.
  7048. */
  7049. function isKeyable(value) {
  7050. var type = typeof value;
  7051. return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean')
  7052. ? (value !== '__proto__')
  7053. : (value === null);
  7054. }
  7055. /**
  7056. * Checks if `func` has a lazy counterpart.
  7057. *
  7058. * @private
  7059. * @param {Function} func The function to check.
  7060. * @returns {boolean} Returns `true` if `func` has a lazy counterpart,
  7061. * else `false`.
  7062. */
  7063. function isLaziable(func) {
  7064. var funcName = getFuncName(func),
  7065. other = lodash[funcName];
  7066. if (typeof other != 'function' || !(funcName in LazyWrapper.prototype)) {
  7067. return false;
  7068. }
  7069. if (func === other) {
  7070. return true;
  7071. }
  7072. var data = getData(other);
  7073. return !!data && func === data[0];
  7074. }
  7075. /**
  7076. * Checks if `func` has its source masked.
  7077. *
  7078. * @private
  7079. * @param {Function} func The function to check.
  7080. * @returns {boolean} Returns `true` if `func` is masked, else `false`.
  7081. */
  7082. function isMasked(func) {
  7083. return !!maskSrcKey && (maskSrcKey in func);
  7084. }
  7085. /**
  7086. * Checks if `func` is capable of being masked.
  7087. *
  7088. * @private
  7089. * @param {*} value The value to check.
  7090. * @returns {boolean} Returns `true` if `func` is maskable, else `false`.
  7091. */
  7092. var isMaskable = coreJsData ? isFunction : stubFalse;
  7093. /**
  7094. * Checks if `value` is likely a prototype object.
  7095. *
  7096. * @private
  7097. * @param {*} value The value to check.
  7098. * @returns {boolean} Returns `true` if `value` is a prototype, else `false`.
  7099. */
  7100. function isPrototype(value) {
  7101. var Ctor = value && value.constructor,
  7102. proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto;
  7103. return value === proto;
  7104. }
  7105. /**
  7106. * Checks if `value` is suitable for strict equality comparisons, i.e. `===`.
  7107. *
  7108. * @private
  7109. * @param {*} value The value to check.
  7110. * @returns {boolean} Returns `true` if `value` if suitable for strict
  7111. * equality comparisons, else `false`.
  7112. */
  7113. function isStrictComparable(value) {
  7114. return value === value && !isObject(value);
  7115. }
  7116. /**
  7117. * A specialized version of `matchesProperty` for source values suitable
  7118. * for strict equality comparisons, i.e. `===`.
  7119. *
  7120. * @private
  7121. * @param {string} key The key of the property to get.
  7122. * @param {*} srcValue The value to match.
  7123. * @returns {Function} Returns the new spec function.
  7124. */
  7125. function matchesStrictComparable(key, srcValue) {
  7126. return function(object) {
  7127. if (object == null) {
  7128. return false;
  7129. }
  7130. return object[key] === srcValue &&
  7131. (srcValue !== undefined || (key in Object(object)));
  7132. };
  7133. }
  7134. /**
  7135. * A specialized version of `_.memoize` which clears the memoized function's
  7136. * cache when it exceeds `MAX_MEMOIZE_SIZE`.
  7137. *
  7138. * @private
  7139. * @param {Function} func The function to have its output memoized.
  7140. * @returns {Function} Returns the new memoized function.
  7141. */
  7142. function memoizeCapped(func) {
  7143. var result = memoize(func, function(key) {
  7144. if (cache.size === MAX_MEMOIZE_SIZE) {
  7145. cache.clear();
  7146. }
  7147. return key;
  7148. });
  7149. var cache = result.cache;
  7150. return result;
  7151. }
  7152. /**
  7153. * Merges the function metadata of `source` into `data`.
  7154. *
  7155. * Merging metadata reduces the number of wrappers used to invoke a function.
  7156. * This is possible because methods like `_.bind`, `_.curry`, and `_.partial`
  7157. * may be applied regardless of execution order. Methods like `_.ary` and
  7158. * `_.rearg` modify function arguments, making the order in which they are
  7159. * executed important, preventing the merging of metadata. However, we make
  7160. * an exception for a safe combined case where curried functions have `_.ary`
  7161. * and or `_.rearg` applied.
  7162. *
  7163. * @private
  7164. * @param {Array} data The destination metadata.
  7165. * @param {Array} source The source metadata.
  7166. * @returns {Array} Returns `data`.
  7167. */
  7168. function mergeData(data, source) {
  7169. var bitmask = data[1],
  7170. srcBitmask = source[1],
  7171. newBitmask = bitmask | srcBitmask,
  7172. isCommon = newBitmask < (WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG | WRAP_ARY_FLAG);
  7173. var isCombo =
  7174. ((srcBitmask == WRAP_ARY_FLAG) && (bitmask == WRAP_CURRY_FLAG)) ||
  7175. ((srcBitmask == WRAP_ARY_FLAG) && (bitmask == WRAP_REARG_FLAG) && (data[7].length <= source[8])) ||
  7176. ((srcBitmask == (WRAP_ARY_FLAG | WRAP_REARG_FLAG)) && (source[7].length <= source[8]) && (bitmask == WRAP_CURRY_FLAG));
  7177. // Exit early if metadata can't be merged.
  7178. if (!(isCommon || isCombo)) {
  7179. return data;
  7180. }
  7181. // Use source `thisArg` if available.
  7182. if (srcBitmask & WRAP_BIND_FLAG) {
  7183. data[2] = source[2];
  7184. // Set when currying a bound function.
  7185. newBitmask |= bitmask & WRAP_BIND_FLAG ? 0 : WRAP_CURRY_BOUND_FLAG;
  7186. }
  7187. // Compose partial arguments.
  7188. var value = source[3];
  7189. if (value) {
  7190. var partials = data[3];
  7191. data[3] = partials ? composeArgs(partials, value, source[4]) : value;
  7192. data[4] = partials ? replaceHolders(data[3], PLACEHOLDER) : source[4];
  7193. }
  7194. // Compose partial right arguments.
  7195. value = source[5];
  7196. if (value) {
  7197. partials = data[5];
  7198. data[5] = partials ? composeArgsRight(partials, value, source[6]) : value;
  7199. data[6] = partials ? replaceHolders(data[5], PLACEHOLDER) : source[6];
  7200. }
  7201. // Use source `argPos` if available.
  7202. value = source[7];
  7203. if (value) {
  7204. data[7] = value;
  7205. }
  7206. // Use source `ary` if it's smaller.
  7207. if (srcBitmask & WRAP_ARY_FLAG) {
  7208. data[8] = data[8] == null ? source[8] : nativeMin(data[8], source[8]);
  7209. }
  7210. // Use source `arity` if one is not provided.
  7211. if (data[9] == null) {
  7212. data[9] = source[9];
  7213. }
  7214. // Use source `func` and merge bitmasks.
  7215. data[0] = source[0];
  7216. data[1] = newBitmask;
  7217. return data;
  7218. }
  7219. /**
  7220. * This function is like
  7221. * [`Object.keys`](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)
  7222. * except that it includes inherited enumerable properties.
  7223. *
  7224. * @private
  7225. * @param {Object} object The object to query.
  7226. * @returns {Array} Returns the array of property names.
  7227. */
  7228. function nativeKeysIn(object) {
  7229. var result = [];
  7230. if (object != null) {
  7231. for (var key in Object(object)) {
  7232. result.push(key);
  7233. }
  7234. }
  7235. return result;
  7236. }
  7237. /**
  7238. * Converts `value` to a string using `Object.prototype.toString`.
  7239. *
  7240. * @private
  7241. * @param {*} value The value to convert.
  7242. * @returns {string} Returns the converted string.
  7243. */
  7244. function objectToString(value) {
  7245. return nativeObjectToString.call(value);
  7246. }
  7247. /**
  7248. * A specialized version of `baseRest` which transforms the rest array.
  7249. *
  7250. * @private
  7251. * @param {Function} func The function to apply a rest parameter to.
  7252. * @param {number} [start=func.length-1] The start position of the rest parameter.
  7253. * @param {Function} transform The rest array transform.
  7254. * @returns {Function} Returns the new function.
  7255. */
  7256. function overRest(func, start, transform) {
  7257. start = nativeMax(start === undefined ? (func.length - 1) : start, 0);
  7258. return function() {
  7259. var args = arguments,
  7260. index = -1,
  7261. length = nativeMax(args.length - start, 0),
  7262. array = Array(length);
  7263. while (++index < length) {
  7264. array[index] = args[start + index];
  7265. }
  7266. index = -1;
  7267. var otherArgs = Array(start + 1);
  7268. while (++index < start) {
  7269. otherArgs[index] = args[index];
  7270. }
  7271. otherArgs[start] = transform(array);
  7272. return apply(func, this, otherArgs);
  7273. };
  7274. }
  7275. /**
  7276. * Gets the parent value at `path` of `object`.
  7277. *
  7278. * @private
  7279. * @param {Object} object The object to query.
  7280. * @param {Array} path The path to get the parent value of.
  7281. * @returns {*} Returns the parent value.
  7282. */
  7283. function parent(object, path) {
  7284. return path.length < 2 ? object : baseGet(object, baseSlice(path, 0, -1));
  7285. }
  7286. /**
  7287. * Reorder `array` according to the specified indexes where the element at
  7288. * the first index is assigned as the first element, the element at
  7289. * the second index is assigned as the second element, and so on.
  7290. *
  7291. * @private
  7292. * @param {Array} array The array to reorder.
  7293. * @param {Array} indexes The arranged array indexes.
  7294. * @returns {Array} Returns `array`.
  7295. */
  7296. function reorder(array, indexes) {
  7297. var arrLength = array.length,
  7298. length = nativeMin(indexes.length, arrLength),
  7299. oldArray = copyArray(array);
  7300. while (length--) {
  7301. var index = indexes[length];
  7302. array[length] = isIndex(index, arrLength) ? oldArray[index] : undefined;
  7303. }
  7304. return array;
  7305. }
  7306. /**
  7307. * Gets the value at `key`, unless `key` is "__proto__" or "constructor".
  7308. *
  7309. * @private
  7310. * @param {Object} object The object to query.
  7311. * @param {string} key The key of the property to get.
  7312. * @returns {*} Returns the property value.
  7313. */
  7314. function safeGet(object, key) {
  7315. if (key === 'constructor' && typeof object[key] === 'function') {
  7316. return;
  7317. }
  7318. if (key == '__proto__') {
  7319. return;
  7320. }
  7321. return object[key];
  7322. }
  7323. /**
  7324. * Sets metadata for `func`.
  7325. *
  7326. * **Note:** If this function becomes hot, i.e. is invoked a lot in a short
  7327. * period of time, it will trip its breaker and transition to an identity
  7328. * function to avoid garbage collection pauses in V8. See
  7329. * [V8 issue 2070](https://bugs.chromium.org/p/v8/issues/detail?id=2070)
  7330. * for more details.
  7331. *
  7332. * @private
  7333. * @param {Function} func The function to associate metadata with.
  7334. * @param {*} data The metadata.
  7335. * @returns {Function} Returns `func`.
  7336. */
  7337. var setData = shortOut(baseSetData);
  7338. /**
  7339. * A simple wrapper around the global [`setTimeout`](https://mdn.io/setTimeout).
  7340. *
  7341. * @private
  7342. * @param {Function} func The function to delay.
  7343. * @param {number} wait The number of milliseconds to delay invocation.
  7344. * @returns {number|Object} Returns the timer id or timeout object.
  7345. */
  7346. var setTimeout = ctxSetTimeout || function(func, wait) {
  7347. return root.setTimeout(func, wait);
  7348. };
  7349. /**
  7350. * Sets the `toString` method of `func` to return `string`.
  7351. *
  7352. * @private
  7353. * @param {Function} func The function to modify.
  7354. * @param {Function} string The `toString` result.
  7355. * @returns {Function} Returns `func`.
  7356. */
  7357. var setToString = shortOut(baseSetToString);
  7358. /**
  7359. * Sets the `toString` method of `wrapper` to mimic the source of `reference`
  7360. * with wrapper details in a comment at the top of the source body.
  7361. *
  7362. * @private
  7363. * @param {Function} wrapper The function to modify.
  7364. * @param {Function} reference The reference function.
  7365. * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
  7366. * @returns {Function} Returns `wrapper`.
  7367. */
  7368. function setWrapToString(wrapper, reference, bitmask) {
  7369. var source = (reference + '');
  7370. return setToString(wrapper, insertWrapDetails(source, updateWrapDetails(getWrapDetails(source), bitmask)));
  7371. }
  7372. /**
  7373. * Creates a function that'll short out and invoke `identity` instead
  7374. * of `func` when it's called `HOT_COUNT` or more times in `HOT_SPAN`
  7375. * milliseconds.
  7376. *
  7377. * @private
  7378. * @param {Function} func The function to restrict.
  7379. * @returns {Function} Returns the new shortable function.
  7380. */
  7381. function shortOut(func) {
  7382. var count = 0,
  7383. lastCalled = 0;
  7384. return function() {
  7385. var stamp = nativeNow(),
  7386. remaining = HOT_SPAN - (stamp - lastCalled);
  7387. lastCalled = stamp;
  7388. if (remaining > 0) {
  7389. if (++count >= HOT_COUNT) {
  7390. return arguments[0];
  7391. }
  7392. } else {
  7393. count = 0;
  7394. }
  7395. return func.apply(undefined, arguments);
  7396. };
  7397. }
  7398. /**
  7399. * A specialized version of `_.shuffle` which mutates and sets the size of `array`.
  7400. *
  7401. * @private
  7402. * @param {Array} array The array to shuffle.
  7403. * @param {number} [size=array.length] The size of `array`.
  7404. * @returns {Array} Returns `array`.
  7405. */
  7406. function shuffleSelf(array, size) {
  7407. var index = -1,
  7408. length = array.length,
  7409. lastIndex = length - 1;
  7410. size = size === undefined ? length : size;
  7411. while (++index < size) {
  7412. var rand = baseRandom(index, lastIndex),
  7413. value = array[rand];
  7414. array[rand] = array[index];
  7415. array[index] = value;
  7416. }
  7417. array.length = size;
  7418. return array;
  7419. }
  7420. /**
  7421. * Converts `string` to a property path array.
  7422. *
  7423. * @private
  7424. * @param {string} string The string to convert.
  7425. * @returns {Array} Returns the property path array.
  7426. */
  7427. var stringToPath = memoizeCapped(function(string) {
  7428. var result = [];
  7429. if (string.charCodeAt(0) === 46 /* . */) {
  7430. result.push('');
  7431. }
  7432. string.replace(rePropName, function(match, number, quote, subString) {
  7433. result.push(quote ? subString.replace(reEscapeChar, '$1') : (number || match));
  7434. });
  7435. return result;
  7436. });
  7437. /**
  7438. * Converts `value` to a string key if it's not a string or symbol.
  7439. *
  7440. * @private
  7441. * @param {*} value The value to inspect.
  7442. * @returns {string|symbol} Returns the key.
  7443. */
  7444. function toKey(value) {
  7445. if (typeof value == 'string' || isSymbol(value)) {
  7446. return value;
  7447. }
  7448. var result = (value + '');
  7449. return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;
  7450. }
  7451. /**
  7452. * Converts `func` to its source code.
  7453. *
  7454. * @private
  7455. * @param {Function} func The function to convert.
  7456. * @returns {string} Returns the source code.
  7457. */
  7458. function toSource(func) {
  7459. if (func != null) {
  7460. try {
  7461. return funcToString.call(func);
  7462. } catch (e) {}
  7463. try {
  7464. return (func + '');
  7465. } catch (e) {}
  7466. }
  7467. return '';
  7468. }
  7469. /**
  7470. * Updates wrapper `details` based on `bitmask` flags.
  7471. *
  7472. * @private
  7473. * @returns {Array} details The details to modify.
  7474. * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
  7475. * @returns {Array} Returns `details`.
  7476. */
  7477. function updateWrapDetails(details, bitmask) {
  7478. arrayEach(wrapFlags, function(pair) {
  7479. var value = '_.' + pair[0];
  7480. if ((bitmask & pair[1]) && !arrayIncludes(details, value)) {
  7481. details.push(value);
  7482. }
  7483. });
  7484. return details.sort();
  7485. }
  7486. /**
  7487. * Creates a clone of `wrapper`.
  7488. *
  7489. * @private
  7490. * @param {Object} wrapper The wrapper to clone.
  7491. * @returns {Object} Returns the cloned wrapper.
  7492. */
  7493. function wrapperClone(wrapper) {
  7494. if (wrapper instanceof LazyWrapper) {
  7495. return wrapper.clone();
  7496. }
  7497. var result = new LodashWrapper(wrapper.__wrapped__, wrapper.__chain__);
  7498. result.__actions__ = copyArray(wrapper.__actions__);
  7499. result.__index__ = wrapper.__index__;
  7500. result.__values__ = wrapper.__values__;
  7501. return result;
  7502. }
  7503. /*------------------------------------------------------------------------*/
  7504. /**
  7505. * Creates an array of elements split into groups the length of `size`.
  7506. * If `array` can't be split evenly, the final chunk will be the remaining
  7507. * elements.
  7508. *
  7509. * @static
  7510. * @memberOf _
  7511. * @since 3.0.0
  7512. * @category Array
  7513. * @param {Array} array The array to process.
  7514. * @param {number} [size=1] The length of each chunk
  7515. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  7516. * @returns {Array} Returns the new array of chunks.
  7517. * @example
  7518. *
  7519. * _.chunk(['a', 'b', 'c', 'd'], 2);
  7520. * // => [['a', 'b'], ['c', 'd']]
  7521. *
  7522. * _.chunk(['a', 'b', 'c', 'd'], 3);
  7523. * // => [['a', 'b', 'c'], ['d']]
  7524. */
  7525. function chunk(array, size, guard) {
  7526. if ((guard ? isIterateeCall(array, size, guard) : size === undefined)) {
  7527. size = 1;
  7528. } else {
  7529. size = nativeMax(toInteger(size), 0);
  7530. }
  7531. var length = array == null ? 0 : array.length;
  7532. if (!length || size < 1) {
  7533. return [];
  7534. }
  7535. var index = 0,
  7536. resIndex = 0,
  7537. result = Array(nativeCeil(length / size));
  7538. while (index < length) {
  7539. result[resIndex++] = baseSlice(array, index, (index += size));
  7540. }
  7541. return result;
  7542. }
  7543. /**
  7544. * Creates an array with all falsey values removed. The values `false`, `null`,
  7545. * `0`, `""`, `undefined`, and `NaN` are falsey.
  7546. *
  7547. * @static
  7548. * @memberOf _
  7549. * @since 0.1.0
  7550. * @category Array
  7551. * @param {Array} array The array to compact.
  7552. * @returns {Array} Returns the new array of filtered values.
  7553. * @example
  7554. *
  7555. * _.compact([0, 1, false, 2, '', 3]);
  7556. * // => [1, 2, 3]
  7557. */
  7558. function compact(array) {
  7559. var index = -1,
  7560. length = array == null ? 0 : array.length,
  7561. resIndex = 0,
  7562. result = [];
  7563. while (++index < length) {
  7564. var value = array[index];
  7565. if (value) {
  7566. result[resIndex++] = value;
  7567. }
  7568. }
  7569. return result;
  7570. }
  7571. /**
  7572. * Creates a new array concatenating `array` with any additional arrays
  7573. * and/or values.
  7574. *
  7575. * @static
  7576. * @memberOf _
  7577. * @since 4.0.0
  7578. * @category Array
  7579. * @param {Array} array The array to concatenate.
  7580. * @param {...*} [values] The values to concatenate.
  7581. * @returns {Array} Returns the new concatenated array.
  7582. * @example
  7583. *
  7584. * var array = [1];
  7585. * var other = _.concat(array, 2, [3], [[4]]);
  7586. *
  7587. * console.log(other);
  7588. * // => [1, 2, 3, [4]]
  7589. *
  7590. * console.log(array);
  7591. * // => [1]
  7592. */
  7593. function concat() {
  7594. var length = arguments.length;
  7595. if (!length) {
  7596. return [];
  7597. }
  7598. var args = Array(length - 1),
  7599. array = arguments[0],
  7600. index = length;
  7601. while (index--) {
  7602. args[index - 1] = arguments[index];
  7603. }
  7604. return arrayPush(isArray(array) ? copyArray(array) : [array], baseFlatten(args, 1));
  7605. }
  7606. /**
  7607. * Creates an array of `array` values not included in the other given arrays
  7608. * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  7609. * for equality comparisons. The order and references of result values are
  7610. * determined by the first array.
  7611. *
  7612. * **Note:** Unlike `_.pullAll`, this method returns a new array.
  7613. *
  7614. * @static
  7615. * @memberOf _
  7616. * @since 0.1.0
  7617. * @category Array
  7618. * @param {Array} array The array to inspect.
  7619. * @param {...Array} [values] The values to exclude.
  7620. * @returns {Array} Returns the new array of filtered values.
  7621. * @see _.without, _.xor
  7622. * @example
  7623. *
  7624. * _.difference([2, 1], [2, 3]);
  7625. * // => [1]
  7626. */
  7627. var difference = baseRest(function(array, values) {
  7628. return isArrayLikeObject(array)
  7629. ? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true))
  7630. : [];
  7631. });
  7632. /**
  7633. * This method is like `_.difference` except that it accepts `iteratee` which
  7634. * is invoked for each element of `array` and `values` to generate the criterion
  7635. * by which they're compared. The order and references of result values are
  7636. * determined by the first array. The iteratee is invoked with one argument:
  7637. * (value).
  7638. *
  7639. * **Note:** Unlike `_.pullAllBy`, this method returns a new array.
  7640. *
  7641. * @static
  7642. * @memberOf _
  7643. * @since 4.0.0
  7644. * @category Array
  7645. * @param {Array} array The array to inspect.
  7646. * @param {...Array} [values] The values to exclude.
  7647. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  7648. * @returns {Array} Returns the new array of filtered values.
  7649. * @example
  7650. *
  7651. * _.differenceBy([2.1, 1.2], [2.3, 3.4], Math.floor);
  7652. * // => [1.2]
  7653. *
  7654. * // The `_.property` iteratee shorthand.
  7655. * _.differenceBy([{ 'x': 2 }, { 'x': 1 }], [{ 'x': 1 }], 'x');
  7656. * // => [{ 'x': 2 }]
  7657. */
  7658. var differenceBy = baseRest(function(array, values) {
  7659. var iteratee = last(values);
  7660. if (isArrayLikeObject(iteratee)) {
  7661. iteratee = undefined;
  7662. }
  7663. return isArrayLikeObject(array)
  7664. ? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true), getIteratee(iteratee, 2))
  7665. : [];
  7666. });
  7667. /**
  7668. * This method is like `_.difference` except that it accepts `comparator`
  7669. * which is invoked to compare elements of `array` to `values`. The order and
  7670. * references of result values are determined by the first array. The comparator
  7671. * is invoked with two arguments: (arrVal, othVal).
  7672. *
  7673. * **Note:** Unlike `_.pullAllWith`, this method returns a new array.
  7674. *
  7675. * @static
  7676. * @memberOf _
  7677. * @since 4.0.0
  7678. * @category Array
  7679. * @param {Array} array The array to inspect.
  7680. * @param {...Array} [values] The values to exclude.
  7681. * @param {Function} [comparator] The comparator invoked per element.
  7682. * @returns {Array} Returns the new array of filtered values.
  7683. * @example
  7684. *
  7685. * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }];
  7686. *
  7687. * _.differenceWith(objects, [{ 'x': 1, 'y': 2 }], _.isEqual);
  7688. * // => [{ 'x': 2, 'y': 1 }]
  7689. */
  7690. var differenceWith = baseRest(function(array, values) {
  7691. var comparator = last(values);
  7692. if (isArrayLikeObject(comparator)) {
  7693. comparator = undefined;
  7694. }
  7695. return isArrayLikeObject(array)
  7696. ? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true), undefined, comparator)
  7697. : [];
  7698. });
  7699. /**
  7700. * Creates a slice of `array` with `n` elements dropped from the beginning.
  7701. *
  7702. * @static
  7703. * @memberOf _
  7704. * @since 0.5.0
  7705. * @category Array
  7706. * @param {Array} array The array to query.
  7707. * @param {number} [n=1] The number of elements to drop.
  7708. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  7709. * @returns {Array} Returns the slice of `array`.
  7710. * @example
  7711. *
  7712. * _.drop([1, 2, 3]);
  7713. * // => [2, 3]
  7714. *
  7715. * _.drop([1, 2, 3], 2);
  7716. * // => [3]
  7717. *
  7718. * _.drop([1, 2, 3], 5);
  7719. * // => []
  7720. *
  7721. * _.drop([1, 2, 3], 0);
  7722. * // => [1, 2, 3]
  7723. */
  7724. function drop(array, n, guard) {
  7725. var length = array == null ? 0 : array.length;
  7726. if (!length) {
  7727. return [];
  7728. }
  7729. n = (guard || n === undefined) ? 1 : toInteger(n);
  7730. return baseSlice(array, n < 0 ? 0 : n, length);
  7731. }
  7732. /**
  7733. * Creates a slice of `array` with `n` elements dropped from the end.
  7734. *
  7735. * @static
  7736. * @memberOf _
  7737. * @since 3.0.0
  7738. * @category Array
  7739. * @param {Array} array The array to query.
  7740. * @param {number} [n=1] The number of elements to drop.
  7741. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  7742. * @returns {Array} Returns the slice of `array`.
  7743. * @example
  7744. *
  7745. * _.dropRight([1, 2, 3]);
  7746. * // => [1, 2]
  7747. *
  7748. * _.dropRight([1, 2, 3], 2);
  7749. * // => [1]
  7750. *
  7751. * _.dropRight([1, 2, 3], 5);
  7752. * // => []
  7753. *
  7754. * _.dropRight([1, 2, 3], 0);
  7755. * // => [1, 2, 3]
  7756. */
  7757. function dropRight(array, n, guard) {
  7758. var length = array == null ? 0 : array.length;
  7759. if (!length) {
  7760. return [];
  7761. }
  7762. n = (guard || n === undefined) ? 1 : toInteger(n);
  7763. n = length - n;
  7764. return baseSlice(array, 0, n < 0 ? 0 : n);
  7765. }
  7766. /**
  7767. * Creates a slice of `array` excluding elements dropped from the end.
  7768. * Elements are dropped until `predicate` returns falsey. The predicate is
  7769. * invoked with three arguments: (value, index, array).
  7770. *
  7771. * @static
  7772. * @memberOf _
  7773. * @since 3.0.0
  7774. * @category Array
  7775. * @param {Array} array The array to query.
  7776. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  7777. * @returns {Array} Returns the slice of `array`.
  7778. * @example
  7779. *
  7780. * var users = [
  7781. * { 'user': 'barney', 'active': true },
  7782. * { 'user': 'fred', 'active': false },
  7783. * { 'user': 'pebbles', 'active': false }
  7784. * ];
  7785. *
  7786. * _.dropRightWhile(users, function(o) { return !o.active; });
  7787. * // => objects for ['barney']
  7788. *
  7789. * // The `_.matches` iteratee shorthand.
  7790. * _.dropRightWhile(users, { 'user': 'pebbles', 'active': false });
  7791. * // => objects for ['barney', 'fred']
  7792. *
  7793. * // The `_.matchesProperty` iteratee shorthand.
  7794. * _.dropRightWhile(users, ['active', false]);
  7795. * // => objects for ['barney']
  7796. *
  7797. * // The `_.property` iteratee shorthand.
  7798. * _.dropRightWhile(users, 'active');
  7799. * // => objects for ['barney', 'fred', 'pebbles']
  7800. */
  7801. function dropRightWhile(array, predicate) {
  7802. return (array && array.length)
  7803. ? baseWhile(array, getIteratee(predicate, 3), true, true)
  7804. : [];
  7805. }
  7806. /**
  7807. * Creates a slice of `array` excluding elements dropped from the beginning.
  7808. * Elements are dropped until `predicate` returns falsey. The predicate is
  7809. * invoked with three arguments: (value, index, array).
  7810. *
  7811. * @static
  7812. * @memberOf _
  7813. * @since 3.0.0
  7814. * @category Array
  7815. * @param {Array} array The array to query.
  7816. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  7817. * @returns {Array} Returns the slice of `array`.
  7818. * @example
  7819. *
  7820. * var users = [
  7821. * { 'user': 'barney', 'active': false },
  7822. * { 'user': 'fred', 'active': false },
  7823. * { 'user': 'pebbles', 'active': true }
  7824. * ];
  7825. *
  7826. * _.dropWhile(users, function(o) { return !o.active; });
  7827. * // => objects for ['pebbles']
  7828. *
  7829. * // The `_.matches` iteratee shorthand.
  7830. * _.dropWhile(users, { 'user': 'barney', 'active': false });
  7831. * // => objects for ['fred', 'pebbles']
  7832. *
  7833. * // The `_.matchesProperty` iteratee shorthand.
  7834. * _.dropWhile(users, ['active', false]);
  7835. * // => objects for ['pebbles']
  7836. *
  7837. * // The `_.property` iteratee shorthand.
  7838. * _.dropWhile(users, 'active');
  7839. * // => objects for ['barney', 'fred', 'pebbles']
  7840. */
  7841. function dropWhile(array, predicate) {
  7842. return (array && array.length)
  7843. ? baseWhile(array, getIteratee(predicate, 3), true)
  7844. : [];
  7845. }
  7846. /**
  7847. * Fills elements of `array` with `value` from `start` up to, but not
  7848. * including, `end`.
  7849. *
  7850. * **Note:** This method mutates `array`.
  7851. *
  7852. * @static
  7853. * @memberOf _
  7854. * @since 3.2.0
  7855. * @category Array
  7856. * @param {Array} array The array to fill.
  7857. * @param {*} value The value to fill `array` with.
  7858. * @param {number} [start=0] The start position.
  7859. * @param {number} [end=array.length] The end position.
  7860. * @returns {Array} Returns `array`.
  7861. * @example
  7862. *
  7863. * var array = [1, 2, 3];
  7864. *
  7865. * _.fill(array, 'a');
  7866. * console.log(array);
  7867. * // => ['a', 'a', 'a']
  7868. *
  7869. * _.fill(Array(3), 2);
  7870. * // => [2, 2, 2]
  7871. *
  7872. * _.fill([4, 6, 8, 10], '*', 1, 3);
  7873. * // => [4, '*', '*', 10]
  7874. */
  7875. function fill(array, value, start, end) {
  7876. var length = array == null ? 0 : array.length;
  7877. if (!length) {
  7878. return [];
  7879. }
  7880. if (start && typeof start != 'number' && isIterateeCall(array, value, start)) {
  7881. start = 0;
  7882. end = length;
  7883. }
  7884. return baseFill(array, value, start, end);
  7885. }
  7886. /**
  7887. * This method is like `_.find` except that it returns the index of the first
  7888. * element `predicate` returns truthy for instead of the element itself.
  7889. *
  7890. * @static
  7891. * @memberOf _
  7892. * @since 1.1.0
  7893. * @category Array
  7894. * @param {Array} array The array to inspect.
  7895. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  7896. * @param {number} [fromIndex=0] The index to search from.
  7897. * @returns {number} Returns the index of the found element, else `-1`.
  7898. * @example
  7899. *
  7900. * var users = [
  7901. * { 'user': 'barney', 'active': false },
  7902. * { 'user': 'fred', 'active': false },
  7903. * { 'user': 'pebbles', 'active': true }
  7904. * ];
  7905. *
  7906. * _.findIndex(users, function(o) { return o.user == 'barney'; });
  7907. * // => 0
  7908. *
  7909. * // The `_.matches` iteratee shorthand.
  7910. * _.findIndex(users, { 'user': 'fred', 'active': false });
  7911. * // => 1
  7912. *
  7913. * // The `_.matchesProperty` iteratee shorthand.
  7914. * _.findIndex(users, ['active', false]);
  7915. * // => 0
  7916. *
  7917. * // The `_.property` iteratee shorthand.
  7918. * _.findIndex(users, 'active');
  7919. * // => 2
  7920. */
  7921. function findIndex(array, predicate, fromIndex) {
  7922. var length = array == null ? 0 : array.length;
  7923. if (!length) {
  7924. return -1;
  7925. }
  7926. var index = fromIndex == null ? 0 : toInteger(fromIndex);
  7927. if (index < 0) {
  7928. index = nativeMax(length + index, 0);
  7929. }
  7930. return baseFindIndex(array, getIteratee(predicate, 3), index);
  7931. }
  7932. /**
  7933. * This method is like `_.findIndex` except that it iterates over elements
  7934. * of `collection` from right to left.
  7935. *
  7936. * @static
  7937. * @memberOf _
  7938. * @since 2.0.0
  7939. * @category Array
  7940. * @param {Array} array The array to inspect.
  7941. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  7942. * @param {number} [fromIndex=array.length-1] The index to search from.
  7943. * @returns {number} Returns the index of the found element, else `-1`.
  7944. * @example
  7945. *
  7946. * var users = [
  7947. * { 'user': 'barney', 'active': true },
  7948. * { 'user': 'fred', 'active': false },
  7949. * { 'user': 'pebbles', 'active': false }
  7950. * ];
  7951. *
  7952. * _.findLastIndex(users, function(o) { return o.user == 'pebbles'; });
  7953. * // => 2
  7954. *
  7955. * // The `_.matches` iteratee shorthand.
  7956. * _.findLastIndex(users, { 'user': 'barney', 'active': true });
  7957. * // => 0
  7958. *
  7959. * // The `_.matchesProperty` iteratee shorthand.
  7960. * _.findLastIndex(users, ['active', false]);
  7961. * // => 2
  7962. *
  7963. * // The `_.property` iteratee shorthand.
  7964. * _.findLastIndex(users, 'active');
  7965. * // => 0
  7966. */
  7967. function findLastIndex(array, predicate, fromIndex) {
  7968. var length = array == null ? 0 : array.length;
  7969. if (!length) {
  7970. return -1;
  7971. }
  7972. var index = length - 1;
  7973. if (fromIndex !== undefined) {
  7974. index = toInteger(fromIndex);
  7975. index = fromIndex < 0
  7976. ? nativeMax(length + index, 0)
  7977. : nativeMin(index, length - 1);
  7978. }
  7979. return baseFindIndex(array, getIteratee(predicate, 3), index, true);
  7980. }
  7981. /**
  7982. * Flattens `array` a single level deep.
  7983. *
  7984. * @static
  7985. * @memberOf _
  7986. * @since 0.1.0
  7987. * @category Array
  7988. * @param {Array} array The array to flatten.
  7989. * @returns {Array} Returns the new flattened array.
  7990. * @example
  7991. *
  7992. * _.flatten([1, [2, [3, [4]], 5]]);
  7993. * // => [1, 2, [3, [4]], 5]
  7994. */
  7995. function flatten(array) {
  7996. var length = array == null ? 0 : array.length;
  7997. return length ? baseFlatten(array, 1) : [];
  7998. }
  7999. /**
  8000. * Recursively flattens `array`.
  8001. *
  8002. * @static
  8003. * @memberOf _
  8004. * @since 3.0.0
  8005. * @category Array
  8006. * @param {Array} array The array to flatten.
  8007. * @returns {Array} Returns the new flattened array.
  8008. * @example
  8009. *
  8010. * _.flattenDeep([1, [2, [3, [4]], 5]]);
  8011. * // => [1, 2, 3, 4, 5]
  8012. */
  8013. function flattenDeep(array) {
  8014. var length = array == null ? 0 : array.length;
  8015. return length ? baseFlatten(array, INFINITY) : [];
  8016. }
  8017. /**
  8018. * Recursively flatten `array` up to `depth` times.
  8019. *
  8020. * @static
  8021. * @memberOf _
  8022. * @since 4.4.0
  8023. * @category Array
  8024. * @param {Array} array The array to flatten.
  8025. * @param {number} [depth=1] The maximum recursion depth.
  8026. * @returns {Array} Returns the new flattened array.
  8027. * @example
  8028. *
  8029. * var array = [1, [2, [3, [4]], 5]];
  8030. *
  8031. * _.flattenDepth(array, 1);
  8032. * // => [1, 2, [3, [4]], 5]
  8033. *
  8034. * _.flattenDepth(array, 2);
  8035. * // => [1, 2, 3, [4], 5]
  8036. */
  8037. function flattenDepth(array, depth) {
  8038. var length = array == null ? 0 : array.length;
  8039. if (!length) {
  8040. return [];
  8041. }
  8042. depth = depth === undefined ? 1 : toInteger(depth);
  8043. return baseFlatten(array, depth);
  8044. }
  8045. /**
  8046. * The inverse of `_.toPairs`; this method returns an object composed
  8047. * from key-value `pairs`.
  8048. *
  8049. * @static
  8050. * @memberOf _
  8051. * @since 4.0.0
  8052. * @category Array
  8053. * @param {Array} pairs The key-value pairs.
  8054. * @returns {Object} Returns the new object.
  8055. * @example
  8056. *
  8057. * _.fromPairs([['a', 1], ['b', 2]]);
  8058. * // => { 'a': 1, 'b': 2 }
  8059. */
  8060. function fromPairs(pairs) {
  8061. var index = -1,
  8062. length = pairs == null ? 0 : pairs.length,
  8063. result = {};
  8064. while (++index < length) {
  8065. var pair = pairs[index];
  8066. result[pair[0]] = pair[1];
  8067. }
  8068. return result;
  8069. }
  8070. /**
  8071. * Gets the first element of `array`.
  8072. *
  8073. * @static
  8074. * @memberOf _
  8075. * @since 0.1.0
  8076. * @alias first
  8077. * @category Array
  8078. * @param {Array} array The array to query.
  8079. * @returns {*} Returns the first element of `array`.
  8080. * @example
  8081. *
  8082. * _.head([1, 2, 3]);
  8083. * // => 1
  8084. *
  8085. * _.head([]);
  8086. * // => undefined
  8087. */
  8088. function head(array) {
  8089. return (array && array.length) ? array[0] : undefined;
  8090. }
  8091. /**
  8092. * Gets the index at which the first occurrence of `value` is found in `array`
  8093. * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  8094. * for equality comparisons. If `fromIndex` is negative, it's used as the
  8095. * offset from the end of `array`.
  8096. *
  8097. * @static
  8098. * @memberOf _
  8099. * @since 0.1.0
  8100. * @category Array
  8101. * @param {Array} array The array to inspect.
  8102. * @param {*} value The value to search for.
  8103. * @param {number} [fromIndex=0] The index to search from.
  8104. * @returns {number} Returns the index of the matched value, else `-1`.
  8105. * @example
  8106. *
  8107. * _.indexOf([1, 2, 1, 2], 2);
  8108. * // => 1
  8109. *
  8110. * // Search from the `fromIndex`.
  8111. * _.indexOf([1, 2, 1, 2], 2, 2);
  8112. * // => 3
  8113. */
  8114. function indexOf(array, value, fromIndex) {
  8115. var length = array == null ? 0 : array.length;
  8116. if (!length) {
  8117. return -1;
  8118. }
  8119. var index = fromIndex == null ? 0 : toInteger(fromIndex);
  8120. if (index < 0) {
  8121. index = nativeMax(length + index, 0);
  8122. }
  8123. return baseIndexOf(array, value, index);
  8124. }
  8125. /**
  8126. * Gets all but the last element of `array`.
  8127. *
  8128. * @static
  8129. * @memberOf _
  8130. * @since 0.1.0
  8131. * @category Array
  8132. * @param {Array} array The array to query.
  8133. * @returns {Array} Returns the slice of `array`.
  8134. * @example
  8135. *
  8136. * _.initial([1, 2, 3]);
  8137. * // => [1, 2]
  8138. */
  8139. function initial(array) {
  8140. var length = array == null ? 0 : array.length;
  8141. return length ? baseSlice(array, 0, -1) : [];
  8142. }
  8143. /**
  8144. * Creates an array of unique values that are included in all given arrays
  8145. * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  8146. * for equality comparisons. The order and references of result values are
  8147. * determined by the first array.
  8148. *
  8149. * @static
  8150. * @memberOf _
  8151. * @since 0.1.0
  8152. * @category Array
  8153. * @param {...Array} [arrays] The arrays to inspect.
  8154. * @returns {Array} Returns the new array of intersecting values.
  8155. * @example
  8156. *
  8157. * _.intersection([2, 1], [2, 3]);
  8158. * // => [2]
  8159. */
  8160. var intersection = baseRest(function(arrays) {
  8161. var mapped = arrayMap(arrays, castArrayLikeObject);
  8162. return (mapped.length && mapped[0] === arrays[0])
  8163. ? baseIntersection(mapped)
  8164. : [];
  8165. });
  8166. /**
  8167. * This method is like `_.intersection` except that it accepts `iteratee`
  8168. * which is invoked for each element of each `arrays` to generate the criterion
  8169. * by which they're compared. The order and references of result values are
  8170. * determined by the first array. The iteratee is invoked with one argument:
  8171. * (value).
  8172. *
  8173. * @static
  8174. * @memberOf _
  8175. * @since 4.0.0
  8176. * @category Array
  8177. * @param {...Array} [arrays] The arrays to inspect.
  8178. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  8179. * @returns {Array} Returns the new array of intersecting values.
  8180. * @example
  8181. *
  8182. * _.intersectionBy([2.1, 1.2], [2.3, 3.4], Math.floor);
  8183. * // => [2.1]
  8184. *
  8185. * // The `_.property` iteratee shorthand.
  8186. * _.intersectionBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x');
  8187. * // => [{ 'x': 1 }]
  8188. */
  8189. var intersectionBy = baseRest(function(arrays) {
  8190. var iteratee = last(arrays),
  8191. mapped = arrayMap(arrays, castArrayLikeObject);
  8192. if (iteratee === last(mapped)) {
  8193. iteratee = undefined;
  8194. } else {
  8195. mapped.pop();
  8196. }
  8197. return (mapped.length && mapped[0] === arrays[0])
  8198. ? baseIntersection(mapped, getIteratee(iteratee, 2))
  8199. : [];
  8200. });
  8201. /**
  8202. * This method is like `_.intersection` except that it accepts `comparator`
  8203. * which is invoked to compare elements of `arrays`. The order and references
  8204. * of result values are determined by the first array. The comparator is
  8205. * invoked with two arguments: (arrVal, othVal).
  8206. *
  8207. * @static
  8208. * @memberOf _
  8209. * @since 4.0.0
  8210. * @category Array
  8211. * @param {...Array} [arrays] The arrays to inspect.
  8212. * @param {Function} [comparator] The comparator invoked per element.
  8213. * @returns {Array} Returns the new array of intersecting values.
  8214. * @example
  8215. *
  8216. * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }];
  8217. * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }];
  8218. *
  8219. * _.intersectionWith(objects, others, _.isEqual);
  8220. * // => [{ 'x': 1, 'y': 2 }]
  8221. */
  8222. var intersectionWith = baseRest(function(arrays) {
  8223. var comparator = last(arrays),
  8224. mapped = arrayMap(arrays, castArrayLikeObject);
  8225. comparator = typeof comparator == 'function' ? comparator : undefined;
  8226. if (comparator) {
  8227. mapped.pop();
  8228. }
  8229. return (mapped.length && mapped[0] === arrays[0])
  8230. ? baseIntersection(mapped, undefined, comparator)
  8231. : [];
  8232. });
  8233. /**
  8234. * Converts all elements in `array` into a string separated by `separator`.
  8235. *
  8236. * @static
  8237. * @memberOf _
  8238. * @since 4.0.0
  8239. * @category Array
  8240. * @param {Array} array The array to convert.
  8241. * @param {string} [separator=','] The element separator.
  8242. * @returns {string} Returns the joined string.
  8243. * @example
  8244. *
  8245. * _.join(['a', 'b', 'c'], '~');
  8246. * // => 'a~b~c'
  8247. */
  8248. function join(array, separator) {
  8249. return array == null ? '' : nativeJoin.call(array, separator);
  8250. }
  8251. /**
  8252. * Gets the last element of `array`.
  8253. *
  8254. * @static
  8255. * @memberOf _
  8256. * @since 0.1.0
  8257. * @category Array
  8258. * @param {Array} array The array to query.
  8259. * @returns {*} Returns the last element of `array`.
  8260. * @example
  8261. *
  8262. * _.last([1, 2, 3]);
  8263. * // => 3
  8264. */
  8265. function last(array) {
  8266. var length = array == null ? 0 : array.length;
  8267. return length ? array[length - 1] : undefined;
  8268. }
  8269. /**
  8270. * This method is like `_.indexOf` except that it iterates over elements of
  8271. * `array` from right to left.
  8272. *
  8273. * @static
  8274. * @memberOf _
  8275. * @since 0.1.0
  8276. * @category Array
  8277. * @param {Array} array The array to inspect.
  8278. * @param {*} value The value to search for.
  8279. * @param {number} [fromIndex=array.length-1] The index to search from.
  8280. * @returns {number} Returns the index of the matched value, else `-1`.
  8281. * @example
  8282. *
  8283. * _.lastIndexOf([1, 2, 1, 2], 2);
  8284. * // => 3
  8285. *
  8286. * // Search from the `fromIndex`.
  8287. * _.lastIndexOf([1, 2, 1, 2], 2, 2);
  8288. * // => 1
  8289. */
  8290. function lastIndexOf(array, value, fromIndex) {
  8291. var length = array == null ? 0 : array.length;
  8292. if (!length) {
  8293. return -1;
  8294. }
  8295. var index = length;
  8296. if (fromIndex !== undefined) {
  8297. index = toInteger(fromIndex);
  8298. index = index < 0 ? nativeMax(length + index, 0) : nativeMin(index, length - 1);
  8299. }
  8300. return value === value
  8301. ? strictLastIndexOf(array, value, index)
  8302. : baseFindIndex(array, baseIsNaN, index, true);
  8303. }
  8304. /**
  8305. * Gets the element at index `n` of `array`. If `n` is negative, the nth
  8306. * element from the end is returned.
  8307. *
  8308. * @static
  8309. * @memberOf _
  8310. * @since 4.11.0
  8311. * @category Array
  8312. * @param {Array} array The array to query.
  8313. * @param {number} [n=0] The index of the element to return.
  8314. * @returns {*} Returns the nth element of `array`.
  8315. * @example
  8316. *
  8317. * var array = ['a', 'b', 'c', 'd'];
  8318. *
  8319. * _.nth(array, 1);
  8320. * // => 'b'
  8321. *
  8322. * _.nth(array, -2);
  8323. * // => 'c';
  8324. */
  8325. function nth(array, n) {
  8326. return (array && array.length) ? baseNth(array, toInteger(n)) : undefined;
  8327. }
  8328. /**
  8329. * Removes all given values from `array` using
  8330. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  8331. * for equality comparisons.
  8332. *
  8333. * **Note:** Unlike `_.without`, this method mutates `array`. Use `_.remove`
  8334. * to remove elements from an array by predicate.
  8335. *
  8336. * @static
  8337. * @memberOf _
  8338. * @since 2.0.0
  8339. * @category Array
  8340. * @param {Array} array The array to modify.
  8341. * @param {...*} [values] The values to remove.
  8342. * @returns {Array} Returns `array`.
  8343. * @example
  8344. *
  8345. * var array = ['a', 'b', 'c', 'a', 'b', 'c'];
  8346. *
  8347. * _.pull(array, 'a', 'c');
  8348. * console.log(array);
  8349. * // => ['b', 'b']
  8350. */
  8351. var pull = baseRest(pullAll);
  8352. /**
  8353. * This method is like `_.pull` except that it accepts an array of values to remove.
  8354. *
  8355. * **Note:** Unlike `_.difference`, this method mutates `array`.
  8356. *
  8357. * @static
  8358. * @memberOf _
  8359. * @since 4.0.0
  8360. * @category Array
  8361. * @param {Array} array The array to modify.
  8362. * @param {Array} values The values to remove.
  8363. * @returns {Array} Returns `array`.
  8364. * @example
  8365. *
  8366. * var array = ['a', 'b', 'c', 'a', 'b', 'c'];
  8367. *
  8368. * _.pullAll(array, ['a', 'c']);
  8369. * console.log(array);
  8370. * // => ['b', 'b']
  8371. */
  8372. function pullAll(array, values) {
  8373. return (array && array.length && values && values.length)
  8374. ? basePullAll(array, values)
  8375. : array;
  8376. }
  8377. /**
  8378. * This method is like `_.pullAll` except that it accepts `iteratee` which is
  8379. * invoked for each element of `array` and `values` to generate the criterion
  8380. * by which they're compared. The iteratee is invoked with one argument: (value).
  8381. *
  8382. * **Note:** Unlike `_.differenceBy`, this method mutates `array`.
  8383. *
  8384. * @static
  8385. * @memberOf _
  8386. * @since 4.0.0
  8387. * @category Array
  8388. * @param {Array} array The array to modify.
  8389. * @param {Array} values The values to remove.
  8390. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  8391. * @returns {Array} Returns `array`.
  8392. * @example
  8393. *
  8394. * var array = [{ 'x': 1 }, { 'x': 2 }, { 'x': 3 }, { 'x': 1 }];
  8395. *
  8396. * _.pullAllBy(array, [{ 'x': 1 }, { 'x': 3 }], 'x');
  8397. * console.log(array);
  8398. * // => [{ 'x': 2 }]
  8399. */
  8400. function pullAllBy(array, values, iteratee) {
  8401. return (array && array.length && values && values.length)
  8402. ? basePullAll(array, values, getIteratee(iteratee, 2))
  8403. : array;
  8404. }
  8405. /**
  8406. * This method is like `_.pullAll` except that it accepts `comparator` which
  8407. * is invoked to compare elements of `array` to `values`. The comparator is
  8408. * invoked with two arguments: (arrVal, othVal).
  8409. *
  8410. * **Note:** Unlike `_.differenceWith`, this method mutates `array`.
  8411. *
  8412. * @static
  8413. * @memberOf _
  8414. * @since 4.6.0
  8415. * @category Array
  8416. * @param {Array} array The array to modify.
  8417. * @param {Array} values The values to remove.
  8418. * @param {Function} [comparator] The comparator invoked per element.
  8419. * @returns {Array} Returns `array`.
  8420. * @example
  8421. *
  8422. * var array = [{ 'x': 1, 'y': 2 }, { 'x': 3, 'y': 4 }, { 'x': 5, 'y': 6 }];
  8423. *
  8424. * _.pullAllWith(array, [{ 'x': 3, 'y': 4 }], _.isEqual);
  8425. * console.log(array);
  8426. * // => [{ 'x': 1, 'y': 2 }, { 'x': 5, 'y': 6 }]
  8427. */
  8428. function pullAllWith(array, values, comparator) {
  8429. return (array && array.length && values && values.length)
  8430. ? basePullAll(array, values, undefined, comparator)
  8431. : array;
  8432. }
  8433. /**
  8434. * Removes elements from `array` corresponding to `indexes` and returns an
  8435. * array of removed elements.
  8436. *
  8437. * **Note:** Unlike `_.at`, this method mutates `array`.
  8438. *
  8439. * @static
  8440. * @memberOf _
  8441. * @since 3.0.0
  8442. * @category Array
  8443. * @param {Array} array The array to modify.
  8444. * @param {...(number|number[])} [indexes] The indexes of elements to remove.
  8445. * @returns {Array} Returns the new array of removed elements.
  8446. * @example
  8447. *
  8448. * var array = ['a', 'b', 'c', 'd'];
  8449. * var pulled = _.pullAt(array, [1, 3]);
  8450. *
  8451. * console.log(array);
  8452. * // => ['a', 'c']
  8453. *
  8454. * console.log(pulled);
  8455. * // => ['b', 'd']
  8456. */
  8457. var pullAt = flatRest(function(array, indexes) {
  8458. var length = array == null ? 0 : array.length,
  8459. result = baseAt(array, indexes);
  8460. basePullAt(array, arrayMap(indexes, function(index) {
  8461. return isIndex(index, length) ? +index : index;
  8462. }).sort(compareAscending));
  8463. return result;
  8464. });
  8465. /**
  8466. * Removes all elements from `array` that `predicate` returns truthy for
  8467. * and returns an array of the removed elements. The predicate is invoked
  8468. * with three arguments: (value, index, array).
  8469. *
  8470. * **Note:** Unlike `_.filter`, this method mutates `array`. Use `_.pull`
  8471. * to pull elements from an array by value.
  8472. *
  8473. * @static
  8474. * @memberOf _
  8475. * @since 2.0.0
  8476. * @category Array
  8477. * @param {Array} array The array to modify.
  8478. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  8479. * @returns {Array} Returns the new array of removed elements.
  8480. * @example
  8481. *
  8482. * var array = [1, 2, 3, 4];
  8483. * var evens = _.remove(array, function(n) {
  8484. * return n % 2 == 0;
  8485. * });
  8486. *
  8487. * console.log(array);
  8488. * // => [1, 3]
  8489. *
  8490. * console.log(evens);
  8491. * // => [2, 4]
  8492. */
  8493. function remove(array, predicate) {
  8494. var result = [];
  8495. if (!(array && array.length)) {
  8496. return result;
  8497. }
  8498. var index = -1,
  8499. indexes = [],
  8500. length = array.length;
  8501. predicate = getIteratee(predicate, 3);
  8502. while (++index < length) {
  8503. var value = array[index];
  8504. if (predicate(value, index, array)) {
  8505. result.push(value);
  8506. indexes.push(index);
  8507. }
  8508. }
  8509. basePullAt(array, indexes);
  8510. return result;
  8511. }
  8512. /**
  8513. * Reverses `array` so that the first element becomes the last, the second
  8514. * element becomes the second to last, and so on.
  8515. *
  8516. * **Note:** This method mutates `array` and is based on
  8517. * [`Array#reverse`](https://mdn.io/Array/reverse).
  8518. *
  8519. * @static
  8520. * @memberOf _
  8521. * @since 4.0.0
  8522. * @category Array
  8523. * @param {Array} array The array to modify.
  8524. * @returns {Array} Returns `array`.
  8525. * @example
  8526. *
  8527. * var array = [1, 2, 3];
  8528. *
  8529. * _.reverse(array);
  8530. * // => [3, 2, 1]
  8531. *
  8532. * console.log(array);
  8533. * // => [3, 2, 1]
  8534. */
  8535. function reverse(array) {
  8536. return array == null ? array : nativeReverse.call(array);
  8537. }
  8538. /**
  8539. * Creates a slice of `array` from `start` up to, but not including, `end`.
  8540. *
  8541. * **Note:** This method is used instead of
  8542. * [`Array#slice`](https://mdn.io/Array/slice) to ensure dense arrays are
  8543. * returned.
  8544. *
  8545. * @static
  8546. * @memberOf _
  8547. * @since 3.0.0
  8548. * @category Array
  8549. * @param {Array} array The array to slice.
  8550. * @param {number} [start=0] The start position.
  8551. * @param {number} [end=array.length] The end position.
  8552. * @returns {Array} Returns the slice of `array`.
  8553. */
  8554. function slice(array, start, end) {
  8555. var length = array == null ? 0 : array.length;
  8556. if (!length) {
  8557. return [];
  8558. }
  8559. if (end && typeof end != 'number' && isIterateeCall(array, start, end)) {
  8560. start = 0;
  8561. end = length;
  8562. }
  8563. else {
  8564. start = start == null ? 0 : toInteger(start);
  8565. end = end === undefined ? length : toInteger(end);
  8566. }
  8567. return baseSlice(array, start, end);
  8568. }
  8569. /**
  8570. * Uses a binary search to determine the lowest index at which `value`
  8571. * should be inserted into `array` in order to maintain its sort order.
  8572. *
  8573. * @static
  8574. * @memberOf _
  8575. * @since 0.1.0
  8576. * @category Array
  8577. * @param {Array} array The sorted array to inspect.
  8578. * @param {*} value The value to evaluate.
  8579. * @returns {number} Returns the index at which `value` should be inserted
  8580. * into `array`.
  8581. * @example
  8582. *
  8583. * _.sortedIndex([30, 50], 40);
  8584. * // => 1
  8585. */
  8586. function sortedIndex(array, value) {
  8587. return baseSortedIndex(array, value);
  8588. }
  8589. /**
  8590. * This method is like `_.sortedIndex` except that it accepts `iteratee`
  8591. * which is invoked for `value` and each element of `array` to compute their
  8592. * sort ranking. The iteratee is invoked with one argument: (value).
  8593. *
  8594. * @static
  8595. * @memberOf _
  8596. * @since 4.0.0
  8597. * @category Array
  8598. * @param {Array} array The sorted array to inspect.
  8599. * @param {*} value The value to evaluate.
  8600. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  8601. * @returns {number} Returns the index at which `value` should be inserted
  8602. * into `array`.
  8603. * @example
  8604. *
  8605. * var objects = [{ 'x': 4 }, { 'x': 5 }];
  8606. *
  8607. * _.sortedIndexBy(objects, { 'x': 4 }, function(o) { return o.x; });
  8608. * // => 0
  8609. *
  8610. * // The `_.property` iteratee shorthand.
  8611. * _.sortedIndexBy(objects, { 'x': 4 }, 'x');
  8612. * // => 0
  8613. */
  8614. function sortedIndexBy(array, value, iteratee) {
  8615. return baseSortedIndexBy(array, value, getIteratee(iteratee, 2));
  8616. }
  8617. /**
  8618. * This method is like `_.indexOf` except that it performs a binary
  8619. * search on a sorted `array`.
  8620. *
  8621. * @static
  8622. * @memberOf _
  8623. * @since 4.0.0
  8624. * @category Array
  8625. * @param {Array} array The array to inspect.
  8626. * @param {*} value The value to search for.
  8627. * @returns {number} Returns the index of the matched value, else `-1`.
  8628. * @example
  8629. *
  8630. * _.sortedIndexOf([4, 5, 5, 5, 6], 5);
  8631. * // => 1
  8632. */
  8633. function sortedIndexOf(array, value) {
  8634. var length = array == null ? 0 : array.length;
  8635. if (length) {
  8636. var index = baseSortedIndex(array, value);
  8637. if (index < length && eq(array[index], value)) {
  8638. return index;
  8639. }
  8640. }
  8641. return -1;
  8642. }
  8643. /**
  8644. * This method is like `_.sortedIndex` except that it returns the highest
  8645. * index at which `value` should be inserted into `array` in order to
  8646. * maintain its sort order.
  8647. *
  8648. * @static
  8649. * @memberOf _
  8650. * @since 3.0.0
  8651. * @category Array
  8652. * @param {Array} array The sorted array to inspect.
  8653. * @param {*} value The value to evaluate.
  8654. * @returns {number} Returns the index at which `value` should be inserted
  8655. * into `array`.
  8656. * @example
  8657. *
  8658. * _.sortedLastIndex([4, 5, 5, 5, 6], 5);
  8659. * // => 4
  8660. */
  8661. function sortedLastIndex(array, value) {
  8662. return baseSortedIndex(array, value, true);
  8663. }
  8664. /**
  8665. * This method is like `_.sortedLastIndex` except that it accepts `iteratee`
  8666. * which is invoked for `value` and each element of `array` to compute their
  8667. * sort ranking. The iteratee is invoked with one argument: (value).
  8668. *
  8669. * @static
  8670. * @memberOf _
  8671. * @since 4.0.0
  8672. * @category Array
  8673. * @param {Array} array The sorted array to inspect.
  8674. * @param {*} value The value to evaluate.
  8675. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  8676. * @returns {number} Returns the index at which `value` should be inserted
  8677. * into `array`.
  8678. * @example
  8679. *
  8680. * var objects = [{ 'x': 4 }, { 'x': 5 }];
  8681. *
  8682. * _.sortedLastIndexBy(objects, { 'x': 4 }, function(o) { return o.x; });
  8683. * // => 1
  8684. *
  8685. * // The `_.property` iteratee shorthand.
  8686. * _.sortedLastIndexBy(objects, { 'x': 4 }, 'x');
  8687. * // => 1
  8688. */
  8689. function sortedLastIndexBy(array, value, iteratee) {
  8690. return baseSortedIndexBy(array, value, getIteratee(iteratee, 2), true);
  8691. }
  8692. /**
  8693. * This method is like `_.lastIndexOf` except that it performs a binary
  8694. * search on a sorted `array`.
  8695. *
  8696. * @static
  8697. * @memberOf _
  8698. * @since 4.0.0
  8699. * @category Array
  8700. * @param {Array} array The array to inspect.
  8701. * @param {*} value The value to search for.
  8702. * @returns {number} Returns the index of the matched value, else `-1`.
  8703. * @example
  8704. *
  8705. * _.sortedLastIndexOf([4, 5, 5, 5, 6], 5);
  8706. * // => 3
  8707. */
  8708. function sortedLastIndexOf(array, value) {
  8709. var length = array == null ? 0 : array.length;
  8710. if (length) {
  8711. var index = baseSortedIndex(array, value, true) - 1;
  8712. if (eq(array[index], value)) {
  8713. return index;
  8714. }
  8715. }
  8716. return -1;
  8717. }
  8718. /**
  8719. * This method is like `_.uniq` except that it's designed and optimized
  8720. * for sorted arrays.
  8721. *
  8722. * @static
  8723. * @memberOf _
  8724. * @since 4.0.0
  8725. * @category Array
  8726. * @param {Array} array The array to inspect.
  8727. * @returns {Array} Returns the new duplicate free array.
  8728. * @example
  8729. *
  8730. * _.sortedUniq([1, 1, 2]);
  8731. * // => [1, 2]
  8732. */
  8733. function sortedUniq(array) {
  8734. return (array && array.length)
  8735. ? baseSortedUniq(array)
  8736. : [];
  8737. }
  8738. /**
  8739. * This method is like `_.uniqBy` except that it's designed and optimized
  8740. * for sorted arrays.
  8741. *
  8742. * @static
  8743. * @memberOf _
  8744. * @since 4.0.0
  8745. * @category Array
  8746. * @param {Array} array The array to inspect.
  8747. * @param {Function} [iteratee] The iteratee invoked per element.
  8748. * @returns {Array} Returns the new duplicate free array.
  8749. * @example
  8750. *
  8751. * _.sortedUniqBy([1.1, 1.2, 2.3, 2.4], Math.floor);
  8752. * // => [1.1, 2.3]
  8753. */
  8754. function sortedUniqBy(array, iteratee) {
  8755. return (array && array.length)
  8756. ? baseSortedUniq(array, getIteratee(iteratee, 2))
  8757. : [];
  8758. }
  8759. /**
  8760. * Gets all but the first element of `array`.
  8761. *
  8762. * @static
  8763. * @memberOf _
  8764. * @since 4.0.0
  8765. * @category Array
  8766. * @param {Array} array The array to query.
  8767. * @returns {Array} Returns the slice of `array`.
  8768. * @example
  8769. *
  8770. * _.tail([1, 2, 3]);
  8771. * // => [2, 3]
  8772. */
  8773. function tail(array) {
  8774. var length = array == null ? 0 : array.length;
  8775. return length ? baseSlice(array, 1, length) : [];
  8776. }
  8777. /**
  8778. * Creates a slice of `array` with `n` elements taken from the beginning.
  8779. *
  8780. * @static
  8781. * @memberOf _
  8782. * @since 0.1.0
  8783. * @category Array
  8784. * @param {Array} array The array to query.
  8785. * @param {number} [n=1] The number of elements to take.
  8786. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  8787. * @returns {Array} Returns the slice of `array`.
  8788. * @example
  8789. *
  8790. * _.take([1, 2, 3]);
  8791. * // => [1]
  8792. *
  8793. * _.take([1, 2, 3], 2);
  8794. * // => [1, 2]
  8795. *
  8796. * _.take([1, 2, 3], 5);
  8797. * // => [1, 2, 3]
  8798. *
  8799. * _.take([1, 2, 3], 0);
  8800. * // => []
  8801. */
  8802. function take(array, n, guard) {
  8803. if (!(array && array.length)) {
  8804. return [];
  8805. }
  8806. n = (guard || n === undefined) ? 1 : toInteger(n);
  8807. return baseSlice(array, 0, n < 0 ? 0 : n);
  8808. }
  8809. /**
  8810. * Creates a slice of `array` with `n` elements taken from the end.
  8811. *
  8812. * @static
  8813. * @memberOf _
  8814. * @since 3.0.0
  8815. * @category Array
  8816. * @param {Array} array The array to query.
  8817. * @param {number} [n=1] The number of elements to take.
  8818. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  8819. * @returns {Array} Returns the slice of `array`.
  8820. * @example
  8821. *
  8822. * _.takeRight([1, 2, 3]);
  8823. * // => [3]
  8824. *
  8825. * _.takeRight([1, 2, 3], 2);
  8826. * // => [2, 3]
  8827. *
  8828. * _.takeRight([1, 2, 3], 5);
  8829. * // => [1, 2, 3]
  8830. *
  8831. * _.takeRight([1, 2, 3], 0);
  8832. * // => []
  8833. */
  8834. function takeRight(array, n, guard) {
  8835. var length = array == null ? 0 : array.length;
  8836. if (!length) {
  8837. return [];
  8838. }
  8839. n = (guard || n === undefined) ? 1 : toInteger(n);
  8840. n = length - n;
  8841. return baseSlice(array, n < 0 ? 0 : n, length);
  8842. }
  8843. /**
  8844. * Creates a slice of `array` with elements taken from the end. Elements are
  8845. * taken until `predicate` returns falsey. The predicate is invoked with
  8846. * three arguments: (value, index, array).
  8847. *
  8848. * @static
  8849. * @memberOf _
  8850. * @since 3.0.0
  8851. * @category Array
  8852. * @param {Array} array The array to query.
  8853. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  8854. * @returns {Array} Returns the slice of `array`.
  8855. * @example
  8856. *
  8857. * var users = [
  8858. * { 'user': 'barney', 'active': true },
  8859. * { 'user': 'fred', 'active': false },
  8860. * { 'user': 'pebbles', 'active': false }
  8861. * ];
  8862. *
  8863. * _.takeRightWhile(users, function(o) { return !o.active; });
  8864. * // => objects for ['fred', 'pebbles']
  8865. *
  8866. * // The `_.matches` iteratee shorthand.
  8867. * _.takeRightWhile(users, { 'user': 'pebbles', 'active': false });
  8868. * // => objects for ['pebbles']
  8869. *
  8870. * // The `_.matchesProperty` iteratee shorthand.
  8871. * _.takeRightWhile(users, ['active', false]);
  8872. * // => objects for ['fred', 'pebbles']
  8873. *
  8874. * // The `_.property` iteratee shorthand.
  8875. * _.takeRightWhile(users, 'active');
  8876. * // => []
  8877. */
  8878. function takeRightWhile(array, predicate) {
  8879. return (array && array.length)
  8880. ? baseWhile(array, getIteratee(predicate, 3), false, true)
  8881. : [];
  8882. }
  8883. /**
  8884. * Creates a slice of `array` with elements taken from the beginning. Elements
  8885. * are taken until `predicate` returns falsey. The predicate is invoked with
  8886. * three arguments: (value, index, array).
  8887. *
  8888. * @static
  8889. * @memberOf _
  8890. * @since 3.0.0
  8891. * @category Array
  8892. * @param {Array} array The array to query.
  8893. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  8894. * @returns {Array} Returns the slice of `array`.
  8895. * @example
  8896. *
  8897. * var users = [
  8898. * { 'user': 'barney', 'active': false },
  8899. * { 'user': 'fred', 'active': false },
  8900. * { 'user': 'pebbles', 'active': true }
  8901. * ];
  8902. *
  8903. * _.takeWhile(users, function(o) { return !o.active; });
  8904. * // => objects for ['barney', 'fred']
  8905. *
  8906. * // The `_.matches` iteratee shorthand.
  8907. * _.takeWhile(users, { 'user': 'barney', 'active': false });
  8908. * // => objects for ['barney']
  8909. *
  8910. * // The `_.matchesProperty` iteratee shorthand.
  8911. * _.takeWhile(users, ['active', false]);
  8912. * // => objects for ['barney', 'fred']
  8913. *
  8914. * // The `_.property` iteratee shorthand.
  8915. * _.takeWhile(users, 'active');
  8916. * // => []
  8917. */
  8918. function takeWhile(array, predicate) {
  8919. return (array && array.length)
  8920. ? baseWhile(array, getIteratee(predicate, 3))
  8921. : [];
  8922. }
  8923. /**
  8924. * Creates an array of unique values, in order, from all given arrays using
  8925. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  8926. * for equality comparisons.
  8927. *
  8928. * @static
  8929. * @memberOf _
  8930. * @since 0.1.0
  8931. * @category Array
  8932. * @param {...Array} [arrays] The arrays to inspect.
  8933. * @returns {Array} Returns the new array of combined values.
  8934. * @example
  8935. *
  8936. * _.union([2], [1, 2]);
  8937. * // => [2, 1]
  8938. */
  8939. var union = baseRest(function(arrays) {
  8940. return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true));
  8941. });
  8942. /**
  8943. * This method is like `_.union` except that it accepts `iteratee` which is
  8944. * invoked for each element of each `arrays` to generate the criterion by
  8945. * which uniqueness is computed. Result values are chosen from the first
  8946. * array in which the value occurs. The iteratee is invoked with one argument:
  8947. * (value).
  8948. *
  8949. * @static
  8950. * @memberOf _
  8951. * @since 4.0.0
  8952. * @category Array
  8953. * @param {...Array} [arrays] The arrays to inspect.
  8954. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  8955. * @returns {Array} Returns the new array of combined values.
  8956. * @example
  8957. *
  8958. * _.unionBy([2.1], [1.2, 2.3], Math.floor);
  8959. * // => [2.1, 1.2]
  8960. *
  8961. * // The `_.property` iteratee shorthand.
  8962. * _.unionBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x');
  8963. * // => [{ 'x': 1 }, { 'x': 2 }]
  8964. */
  8965. var unionBy = baseRest(function(arrays) {
  8966. var iteratee = last(arrays);
  8967. if (isArrayLikeObject(iteratee)) {
  8968. iteratee = undefined;
  8969. }
  8970. return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true), getIteratee(iteratee, 2));
  8971. });
  8972. /**
  8973. * This method is like `_.union` except that it accepts `comparator` which
  8974. * is invoked to compare elements of `arrays`. Result values are chosen from
  8975. * the first array in which the value occurs. The comparator is invoked
  8976. * with two arguments: (arrVal, othVal).
  8977. *
  8978. * @static
  8979. * @memberOf _
  8980. * @since 4.0.0
  8981. * @category Array
  8982. * @param {...Array} [arrays] The arrays to inspect.
  8983. * @param {Function} [comparator] The comparator invoked per element.
  8984. * @returns {Array} Returns the new array of combined values.
  8985. * @example
  8986. *
  8987. * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }];
  8988. * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }];
  8989. *
  8990. * _.unionWith(objects, others, _.isEqual);
  8991. * // => [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }, { 'x': 1, 'y': 1 }]
  8992. */
  8993. var unionWith = baseRest(function(arrays) {
  8994. var comparator = last(arrays);
  8995. comparator = typeof comparator == 'function' ? comparator : undefined;
  8996. return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true), undefined, comparator);
  8997. });
  8998. /**
  8999. * Creates a duplicate-free version of an array, using
  9000. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  9001. * for equality comparisons, in which only the first occurrence of each element
  9002. * is kept. The order of result values is determined by the order they occur
  9003. * in the array.
  9004. *
  9005. * @static
  9006. * @memberOf _
  9007. * @since 0.1.0
  9008. * @category Array
  9009. * @param {Array} array The array to inspect.
  9010. * @returns {Array} Returns the new duplicate free array.
  9011. * @example
  9012. *
  9013. * _.uniq([2, 1, 2]);
  9014. * // => [2, 1]
  9015. */
  9016. function uniq(array) {
  9017. return (array && array.length) ? baseUniq(array) : [];
  9018. }
  9019. /**
  9020. * This method is like `_.uniq` except that it accepts `iteratee` which is
  9021. * invoked for each element in `array` to generate the criterion by which
  9022. * uniqueness is computed. The order of result values is determined by the
  9023. * order they occur in the array. The iteratee is invoked with one argument:
  9024. * (value).
  9025. *
  9026. * @static
  9027. * @memberOf _
  9028. * @since 4.0.0
  9029. * @category Array
  9030. * @param {Array} array The array to inspect.
  9031. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  9032. * @returns {Array} Returns the new duplicate free array.
  9033. * @example
  9034. *
  9035. * _.uniqBy([2.1, 1.2, 2.3], Math.floor);
  9036. * // => [2.1, 1.2]
  9037. *
  9038. * // The `_.property` iteratee shorthand.
  9039. * _.uniqBy([{ 'x': 1 }, { 'x': 2 }, { 'x': 1 }], 'x');
  9040. * // => [{ 'x': 1 }, { 'x': 2 }]
  9041. */
  9042. function uniqBy(array, iteratee) {
  9043. return (array && array.length) ? baseUniq(array, getIteratee(iteratee, 2)) : [];
  9044. }
  9045. /**
  9046. * This method is like `_.uniq` except that it accepts `comparator` which
  9047. * is invoked to compare elements of `array`. The order of result values is
  9048. * determined by the order they occur in the array.The comparator is invoked
  9049. * with two arguments: (arrVal, othVal).
  9050. *
  9051. * @static
  9052. * @memberOf _
  9053. * @since 4.0.0
  9054. * @category Array
  9055. * @param {Array} array The array to inspect.
  9056. * @param {Function} [comparator] The comparator invoked per element.
  9057. * @returns {Array} Returns the new duplicate free array.
  9058. * @example
  9059. *
  9060. * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }, { 'x': 1, 'y': 2 }];
  9061. *
  9062. * _.uniqWith(objects, _.isEqual);
  9063. * // => [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }]
  9064. */
  9065. function uniqWith(array, comparator) {
  9066. comparator = typeof comparator == 'function' ? comparator : undefined;
  9067. return (array && array.length) ? baseUniq(array, undefined, comparator) : [];
  9068. }
  9069. /**
  9070. * This method is like `_.zip` except that it accepts an array of grouped
  9071. * elements and creates an array regrouping the elements to their pre-zip
  9072. * configuration.
  9073. *
  9074. * @static
  9075. * @memberOf _
  9076. * @since 1.2.0
  9077. * @category Array
  9078. * @param {Array} array The array of grouped elements to process.
  9079. * @returns {Array} Returns the new array of regrouped elements.
  9080. * @example
  9081. *
  9082. * var zipped = _.zip(['a', 'b'], [1, 2], [true, false]);
  9083. * // => [['a', 1, true], ['b', 2, false]]
  9084. *
  9085. * _.unzip(zipped);
  9086. * // => [['a', 'b'], [1, 2], [true, false]]
  9087. */
  9088. function unzip(array) {
  9089. if (!(array && array.length)) {
  9090. return [];
  9091. }
  9092. var length = 0;
  9093. array = arrayFilter(array, function(group) {
  9094. if (isArrayLikeObject(group)) {
  9095. length = nativeMax(group.length, length);
  9096. return true;
  9097. }
  9098. });
  9099. return baseTimes(length, function(index) {
  9100. return arrayMap(array, baseProperty(index));
  9101. });
  9102. }
  9103. /**
  9104. * This method is like `_.unzip` except that it accepts `iteratee` to specify
  9105. * how regrouped values should be combined. The iteratee is invoked with the
  9106. * elements of each group: (...group).
  9107. *
  9108. * @static
  9109. * @memberOf _
  9110. * @since 3.8.0
  9111. * @category Array
  9112. * @param {Array} array The array of grouped elements to process.
  9113. * @param {Function} [iteratee=_.identity] The function to combine
  9114. * regrouped values.
  9115. * @returns {Array} Returns the new array of regrouped elements.
  9116. * @example
  9117. *
  9118. * var zipped = _.zip([1, 2], [10, 20], [100, 200]);
  9119. * // => [[1, 10, 100], [2, 20, 200]]
  9120. *
  9121. * _.unzipWith(zipped, _.add);
  9122. * // => [3, 30, 300]
  9123. */
  9124. function unzipWith(array, iteratee) {
  9125. if (!(array && array.length)) {
  9126. return [];
  9127. }
  9128. var result = unzip(array);
  9129. if (iteratee == null) {
  9130. return result;
  9131. }
  9132. return arrayMap(result, function(group) {
  9133. return apply(iteratee, undefined, group);
  9134. });
  9135. }
  9136. /**
  9137. * Creates an array excluding all given values using
  9138. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  9139. * for equality comparisons.
  9140. *
  9141. * **Note:** Unlike `_.pull`, this method returns a new array.
  9142. *
  9143. * @static
  9144. * @memberOf _
  9145. * @since 0.1.0
  9146. * @category Array
  9147. * @param {Array} array The array to inspect.
  9148. * @param {...*} [values] The values to exclude.
  9149. * @returns {Array} Returns the new array of filtered values.
  9150. * @see _.difference, _.xor
  9151. * @example
  9152. *
  9153. * _.without([2, 1, 2, 3], 1, 2);
  9154. * // => [3]
  9155. */
  9156. var without = baseRest(function(array, values) {
  9157. return isArrayLikeObject(array)
  9158. ? baseDifference(array, values)
  9159. : [];
  9160. });
  9161. /**
  9162. * Creates an array of unique values that is the
  9163. * [symmetric difference](https://en.wikipedia.org/wiki/Symmetric_difference)
  9164. * of the given arrays. The order of result values is determined by the order
  9165. * they occur in the arrays.
  9166. *
  9167. * @static
  9168. * @memberOf _
  9169. * @since 2.4.0
  9170. * @category Array
  9171. * @param {...Array} [arrays] The arrays to inspect.
  9172. * @returns {Array} Returns the new array of filtered values.
  9173. * @see _.difference, _.without
  9174. * @example
  9175. *
  9176. * _.xor([2, 1], [2, 3]);
  9177. * // => [1, 3]
  9178. */
  9179. var xor = baseRest(function(arrays) {
  9180. return baseXor(arrayFilter(arrays, isArrayLikeObject));
  9181. });
  9182. /**
  9183. * This method is like `_.xor` except that it accepts `iteratee` which is
  9184. * invoked for each element of each `arrays` to generate the criterion by
  9185. * which by which they're compared. The order of result values is determined
  9186. * by the order they occur in the arrays. The iteratee is invoked with one
  9187. * argument: (value).
  9188. *
  9189. * @static
  9190. * @memberOf _
  9191. * @since 4.0.0
  9192. * @category Array
  9193. * @param {...Array} [arrays] The arrays to inspect.
  9194. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  9195. * @returns {Array} Returns the new array of filtered values.
  9196. * @example
  9197. *
  9198. * _.xorBy([2.1, 1.2], [2.3, 3.4], Math.floor);
  9199. * // => [1.2, 3.4]
  9200. *
  9201. * // The `_.property` iteratee shorthand.
  9202. * _.xorBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x');
  9203. * // => [{ 'x': 2 }]
  9204. */
  9205. var xorBy = baseRest(function(arrays) {
  9206. var iteratee = last(arrays);
  9207. if (isArrayLikeObject(iteratee)) {
  9208. iteratee = undefined;
  9209. }
  9210. return baseXor(arrayFilter(arrays, isArrayLikeObject), getIteratee(iteratee, 2));
  9211. });
  9212. /**
  9213. * This method is like `_.xor` except that it accepts `comparator` which is
  9214. * invoked to compare elements of `arrays`. The order of result values is
  9215. * determined by the order they occur in the arrays. The comparator is invoked
  9216. * with two arguments: (arrVal, othVal).
  9217. *
  9218. * @static
  9219. * @memberOf _
  9220. * @since 4.0.0
  9221. * @category Array
  9222. * @param {...Array} [arrays] The arrays to inspect.
  9223. * @param {Function} [comparator] The comparator invoked per element.
  9224. * @returns {Array} Returns the new array of filtered values.
  9225. * @example
  9226. *
  9227. * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }];
  9228. * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }];
  9229. *
  9230. * _.xorWith(objects, others, _.isEqual);
  9231. * // => [{ 'x': 2, 'y': 1 }, { 'x': 1, 'y': 1 }]
  9232. */
  9233. var xorWith = baseRest(function(arrays) {
  9234. var comparator = last(arrays);
  9235. comparator = typeof comparator == 'function' ? comparator : undefined;
  9236. return baseXor(arrayFilter(arrays, isArrayLikeObject), undefined, comparator);
  9237. });
  9238. /**
  9239. * Creates an array of grouped elements, the first of which contains the
  9240. * first elements of the given arrays, the second of which contains the
  9241. * second elements of the given arrays, and so on.
  9242. *
  9243. * @static
  9244. * @memberOf _
  9245. * @since 0.1.0
  9246. * @category Array
  9247. * @param {...Array} [arrays] The arrays to process.
  9248. * @returns {Array} Returns the new array of grouped elements.
  9249. * @example
  9250. *
  9251. * _.zip(['a', 'b'], [1, 2], [true, false]);
  9252. * // => [['a', 1, true], ['b', 2, false]]
  9253. */
  9254. var zip = baseRest(unzip);
  9255. /**
  9256. * This method is like `_.fromPairs` except that it accepts two arrays,
  9257. * one of property identifiers and one of corresponding values.
  9258. *
  9259. * @static
  9260. * @memberOf _
  9261. * @since 0.4.0
  9262. * @category Array
  9263. * @param {Array} [props=[]] The property identifiers.
  9264. * @param {Array} [values=[]] The property values.
  9265. * @returns {Object} Returns the new object.
  9266. * @example
  9267. *
  9268. * _.zipObject(['a', 'b'], [1, 2]);
  9269. * // => { 'a': 1, 'b': 2 }
  9270. */
  9271. function zipObject(props, values) {
  9272. return baseZipObject(props || [], values || [], assignValue);
  9273. }
  9274. /**
  9275. * This method is like `_.zipObject` except that it supports property paths.
  9276. *
  9277. * @static
  9278. * @memberOf _
  9279. * @since 4.1.0
  9280. * @category Array
  9281. * @param {Array} [props=[]] The property identifiers.
  9282. * @param {Array} [values=[]] The property values.
  9283. * @returns {Object} Returns the new object.
  9284. * @example
  9285. *
  9286. * _.zipObjectDeep(['a.b[0].c', 'a.b[1].d'], [1, 2]);
  9287. * // => { 'a': { 'b': [{ 'c': 1 }, { 'd': 2 }] } }
  9288. */
  9289. function zipObjectDeep(props, values) {
  9290. return baseZipObject(props || [], values || [], baseSet);
  9291. }
  9292. /**
  9293. * This method is like `_.zip` except that it accepts `iteratee` to specify
  9294. * how grouped values should be combined. The iteratee is invoked with the
  9295. * elements of each group: (...group).
  9296. *
  9297. * @static
  9298. * @memberOf _
  9299. * @since 3.8.0
  9300. * @category Array
  9301. * @param {...Array} [arrays] The arrays to process.
  9302. * @param {Function} [iteratee=_.identity] The function to combine
  9303. * grouped values.
  9304. * @returns {Array} Returns the new array of grouped elements.
  9305. * @example
  9306. *
  9307. * _.zipWith([1, 2], [10, 20], [100, 200], function(a, b, c) {
  9308. * return a + b + c;
  9309. * });
  9310. * // => [111, 222]
  9311. */
  9312. var zipWith = baseRest(function(arrays) {
  9313. var length = arrays.length,
  9314. iteratee = length > 1 ? arrays[length - 1] : undefined;
  9315. iteratee = typeof iteratee == 'function' ? (arrays.pop(), iteratee) : undefined;
  9316. return unzipWith(arrays, iteratee);
  9317. });
  9318. /*------------------------------------------------------------------------*/
  9319. /**
  9320. * Creates a `lodash` wrapper instance that wraps `value` with explicit method
  9321. * chain sequences enabled. The result of such sequences must be unwrapped
  9322. * with `_#value`.
  9323. *
  9324. * @static
  9325. * @memberOf _
  9326. * @since 1.3.0
  9327. * @category Seq
  9328. * @param {*} value The value to wrap.
  9329. * @returns {Object} Returns the new `lodash` wrapper instance.
  9330. * @example
  9331. *
  9332. * var users = [
  9333. * { 'user': 'barney', 'age': 36 },
  9334. * { 'user': 'fred', 'age': 40 },
  9335. * { 'user': 'pebbles', 'age': 1 }
  9336. * ];
  9337. *
  9338. * var youngest = _
  9339. * .chain(users)
  9340. * .sortBy('age')
  9341. * .map(function(o) {
  9342. * return o.user + ' is ' + o.age;
  9343. * })
  9344. * .head()
  9345. * .value();
  9346. * // => 'pebbles is 1'
  9347. */
  9348. function chain(value) {
  9349. var result = lodash(value);
  9350. result.__chain__ = true;
  9351. return result;
  9352. }
  9353. /**
  9354. * This method invokes `interceptor` and returns `value`. The interceptor
  9355. * is invoked with one argument; (value). The purpose of this method is to
  9356. * "tap into" a method chain sequence in order to modify intermediate results.
  9357. *
  9358. * @static
  9359. * @memberOf _
  9360. * @since 0.1.0
  9361. * @category Seq
  9362. * @param {*} value The value to provide to `interceptor`.
  9363. * @param {Function} interceptor The function to invoke.
  9364. * @returns {*} Returns `value`.
  9365. * @example
  9366. *
  9367. * _([1, 2, 3])
  9368. * .tap(function(array) {
  9369. * // Mutate input array.
  9370. * array.pop();
  9371. * })
  9372. * .reverse()
  9373. * .value();
  9374. * // => [2, 1]
  9375. */
  9376. function tap(value, interceptor) {
  9377. interceptor(value);
  9378. return value;
  9379. }
  9380. /**
  9381. * This method is like `_.tap` except that it returns the result of `interceptor`.
  9382. * The purpose of this method is to "pass thru" values replacing intermediate
  9383. * results in a method chain sequence.
  9384. *
  9385. * @static
  9386. * @memberOf _
  9387. * @since 3.0.0
  9388. * @category Seq
  9389. * @param {*} value The value to provide to `interceptor`.
  9390. * @param {Function} interceptor The function to invoke.
  9391. * @returns {*} Returns the result of `interceptor`.
  9392. * @example
  9393. *
  9394. * _(' abc ')
  9395. * .chain()
  9396. * .trim()
  9397. * .thru(function(value) {
  9398. * return [value];
  9399. * })
  9400. * .value();
  9401. * // => ['abc']
  9402. */
  9403. function thru(value, interceptor) {
  9404. return interceptor(value);
  9405. }
  9406. /**
  9407. * This method is the wrapper version of `_.at`.
  9408. *
  9409. * @name at
  9410. * @memberOf _
  9411. * @since 1.0.0
  9412. * @category Seq
  9413. * @param {...(string|string[])} [paths] The property paths to pick.
  9414. * @returns {Object} Returns the new `lodash` wrapper instance.
  9415. * @example
  9416. *
  9417. * var object = { 'a': [{ 'b': { 'c': 3 } }, 4] };
  9418. *
  9419. * _(object).at(['a[0].b.c', 'a[1]']).value();
  9420. * // => [3, 4]
  9421. */
  9422. var wrapperAt = flatRest(function(paths) {
  9423. var length = paths.length,
  9424. start = length ? paths[0] : 0,
  9425. value = this.__wrapped__,
  9426. interceptor = function(object) { return baseAt(object, paths); };
  9427. if (length > 1 || this.__actions__.length ||
  9428. !(value instanceof LazyWrapper) || !isIndex(start)) {
  9429. return this.thru(interceptor);
  9430. }
  9431. value = value.slice(start, +start + (length ? 1 : 0));
  9432. value.__actions__.push({
  9433. 'func': thru,
  9434. 'args': [interceptor],
  9435. 'thisArg': undefined
  9436. });
  9437. return new LodashWrapper(value, this.__chain__).thru(function(array) {
  9438. if (length && !array.length) {
  9439. array.push(undefined);
  9440. }
  9441. return array;
  9442. });
  9443. });
  9444. /**
  9445. * Creates a `lodash` wrapper instance with explicit method chain sequences enabled.
  9446. *
  9447. * @name chain
  9448. * @memberOf _
  9449. * @since 0.1.0
  9450. * @category Seq
  9451. * @returns {Object} Returns the new `lodash` wrapper instance.
  9452. * @example
  9453. *
  9454. * var users = [
  9455. * { 'user': 'barney', 'age': 36 },
  9456. * { 'user': 'fred', 'age': 40 }
  9457. * ];
  9458. *
  9459. * // A sequence without explicit chaining.
  9460. * _(users).head();
  9461. * // => { 'user': 'barney', 'age': 36 }
  9462. *
  9463. * // A sequence with explicit chaining.
  9464. * _(users)
  9465. * .chain()
  9466. * .head()
  9467. * .pick('user')
  9468. * .value();
  9469. * // => { 'user': 'barney' }
  9470. */
  9471. function wrapperChain() {
  9472. return chain(this);
  9473. }
  9474. /**
  9475. * Executes the chain sequence and returns the wrapped result.
  9476. *
  9477. * @name commit
  9478. * @memberOf _
  9479. * @since 3.2.0
  9480. * @category Seq
  9481. * @returns {Object} Returns the new `lodash` wrapper instance.
  9482. * @example
  9483. *
  9484. * var array = [1, 2];
  9485. * var wrapped = _(array).push(3);
  9486. *
  9487. * console.log(array);
  9488. * // => [1, 2]
  9489. *
  9490. * wrapped = wrapped.commit();
  9491. * console.log(array);
  9492. * // => [1, 2, 3]
  9493. *
  9494. * wrapped.last();
  9495. * // => 3
  9496. *
  9497. * console.log(array);
  9498. * // => [1, 2, 3]
  9499. */
  9500. function wrapperCommit() {
  9501. return new LodashWrapper(this.value(), this.__chain__);
  9502. }
  9503. /**
  9504. * Gets the next value on a wrapped object following the
  9505. * [iterator protocol](https://mdn.io/iteration_protocols#iterator).
  9506. *
  9507. * @name next
  9508. * @memberOf _
  9509. * @since 4.0.0
  9510. * @category Seq
  9511. * @returns {Object} Returns the next iterator value.
  9512. * @example
  9513. *
  9514. * var wrapped = _([1, 2]);
  9515. *
  9516. * wrapped.next();
  9517. * // => { 'done': false, 'value': 1 }
  9518. *
  9519. * wrapped.next();
  9520. * // => { 'done': false, 'value': 2 }
  9521. *
  9522. * wrapped.next();
  9523. * // => { 'done': true, 'value': undefined }
  9524. */
  9525. function wrapperNext() {
  9526. if (this.__values__ === undefined) {
  9527. this.__values__ = toArray(this.value());
  9528. }
  9529. var done = this.__index__ >= this.__values__.length,
  9530. value = done ? undefined : this.__values__[this.__index__++];
  9531. return { 'done': done, 'value': value };
  9532. }
  9533. /**
  9534. * Enables the wrapper to be iterable.
  9535. *
  9536. * @name Symbol.iterator
  9537. * @memberOf _
  9538. * @since 4.0.0
  9539. * @category Seq
  9540. * @returns {Object} Returns the wrapper object.
  9541. * @example
  9542. *
  9543. * var wrapped = _([1, 2]);
  9544. *
  9545. * wrapped[Symbol.iterator]() === wrapped;
  9546. * // => true
  9547. *
  9548. * Array.from(wrapped);
  9549. * // => [1, 2]
  9550. */
  9551. function wrapperToIterator() {
  9552. return this;
  9553. }
  9554. /**
  9555. * Creates a clone of the chain sequence planting `value` as the wrapped value.
  9556. *
  9557. * @name plant
  9558. * @memberOf _
  9559. * @since 3.2.0
  9560. * @category Seq
  9561. * @param {*} value The value to plant.
  9562. * @returns {Object} Returns the new `lodash` wrapper instance.
  9563. * @example
  9564. *
  9565. * function square(n) {
  9566. * return n * n;
  9567. * }
  9568. *
  9569. * var wrapped = _([1, 2]).map(square);
  9570. * var other = wrapped.plant([3, 4]);
  9571. *
  9572. * other.value();
  9573. * // => [9, 16]
  9574. *
  9575. * wrapped.value();
  9576. * // => [1, 4]
  9577. */
  9578. function wrapperPlant(value) {
  9579. var result,
  9580. parent = this;
  9581. while (parent instanceof baseLodash) {
  9582. var clone = wrapperClone(parent);
  9583. clone.__index__ = 0;
  9584. clone.__values__ = undefined;
  9585. if (result) {
  9586. previous.__wrapped__ = clone;
  9587. } else {
  9588. result = clone;
  9589. }
  9590. var previous = clone;
  9591. parent = parent.__wrapped__;
  9592. }
  9593. previous.__wrapped__ = value;
  9594. return result;
  9595. }
  9596. /**
  9597. * This method is the wrapper version of `_.reverse`.
  9598. *
  9599. * **Note:** This method mutates the wrapped array.
  9600. *
  9601. * @name reverse
  9602. * @memberOf _
  9603. * @since 0.1.0
  9604. * @category Seq
  9605. * @returns {Object} Returns the new `lodash` wrapper instance.
  9606. * @example
  9607. *
  9608. * var array = [1, 2, 3];
  9609. *
  9610. * _(array).reverse().value()
  9611. * // => [3, 2, 1]
  9612. *
  9613. * console.log(array);
  9614. * // => [3, 2, 1]
  9615. */
  9616. function wrapperReverse() {
  9617. var value = this.__wrapped__;
  9618. if (value instanceof LazyWrapper) {
  9619. var wrapped = value;
  9620. if (this.__actions__.length) {
  9621. wrapped = new LazyWrapper(this);
  9622. }
  9623. wrapped = wrapped.reverse();
  9624. wrapped.__actions__.push({
  9625. 'func': thru,
  9626. 'args': [reverse],
  9627. 'thisArg': undefined
  9628. });
  9629. return new LodashWrapper(wrapped, this.__chain__);
  9630. }
  9631. return this.thru(reverse);
  9632. }
  9633. /**
  9634. * Executes the chain sequence to resolve the unwrapped value.
  9635. *
  9636. * @name value
  9637. * @memberOf _
  9638. * @since 0.1.0
  9639. * @alias toJSON, valueOf
  9640. * @category Seq
  9641. * @returns {*} Returns the resolved unwrapped value.
  9642. * @example
  9643. *
  9644. * _([1, 2, 3]).value();
  9645. * // => [1, 2, 3]
  9646. */
  9647. function wrapperValue() {
  9648. return baseWrapperValue(this.__wrapped__, this.__actions__);
  9649. }
  9650. /*------------------------------------------------------------------------*/
  9651. /**
  9652. * Creates an object composed of keys generated from the results of running
  9653. * each element of `collection` thru `iteratee`. The corresponding value of
  9654. * each key is the number of times the key was returned by `iteratee`. The
  9655. * iteratee is invoked with one argument: (value).
  9656. *
  9657. * @static
  9658. * @memberOf _
  9659. * @since 0.5.0
  9660. * @category Collection
  9661. * @param {Array|Object} collection The collection to iterate over.
  9662. * @param {Function} [iteratee=_.identity] The iteratee to transform keys.
  9663. * @returns {Object} Returns the composed aggregate object.
  9664. * @example
  9665. *
  9666. * _.countBy([6.1, 4.2, 6.3], Math.floor);
  9667. * // => { '4': 1, '6': 2 }
  9668. *
  9669. * // The `_.property` iteratee shorthand.
  9670. * _.countBy(['one', 'two', 'three'], 'length');
  9671. * // => { '3': 2, '5': 1 }
  9672. */
  9673. var countBy = createAggregator(function(result, value, key) {
  9674. if (hasOwnProperty.call(result, key)) {
  9675. ++result[key];
  9676. } else {
  9677. baseAssignValue(result, key, 1);
  9678. }
  9679. });
  9680. /**
  9681. * Checks if `predicate` returns truthy for **all** elements of `collection`.
  9682. * Iteration is stopped once `predicate` returns falsey. The predicate is
  9683. * invoked with three arguments: (value, index|key, collection).
  9684. *
  9685. * **Note:** This method returns `true` for
  9686. * [empty collections](https://en.wikipedia.org/wiki/Empty_set) because
  9687. * [everything is true](https://en.wikipedia.org/wiki/Vacuous_truth) of
  9688. * elements of empty collections.
  9689. *
  9690. * @static
  9691. * @memberOf _
  9692. * @since 0.1.0
  9693. * @category Collection
  9694. * @param {Array|Object} collection The collection to iterate over.
  9695. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  9696. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  9697. * @returns {boolean} Returns `true` if all elements pass the predicate check,
  9698. * else `false`.
  9699. * @example
  9700. *
  9701. * _.every([true, 1, null, 'yes'], Boolean);
  9702. * // => false
  9703. *
  9704. * var users = [
  9705. * { 'user': 'barney', 'age': 36, 'active': false },
  9706. * { 'user': 'fred', 'age': 40, 'active': false }
  9707. * ];
  9708. *
  9709. * // The `_.matches` iteratee shorthand.
  9710. * _.every(users, { 'user': 'barney', 'active': false });
  9711. * // => false
  9712. *
  9713. * // The `_.matchesProperty` iteratee shorthand.
  9714. * _.every(users, ['active', false]);
  9715. * // => true
  9716. *
  9717. * // The `_.property` iteratee shorthand.
  9718. * _.every(users, 'active');
  9719. * // => false
  9720. */
  9721. function every(collection, predicate, guard) {
  9722. var func = isArray(collection) ? arrayEvery : baseEvery;
  9723. if (guard && isIterateeCall(collection, predicate, guard)) {
  9724. predicate = undefined;
  9725. }
  9726. return func(collection, getIteratee(predicate, 3));
  9727. }
  9728. /**
  9729. * Iterates over elements of `collection`, returning an array of all elements
  9730. * `predicate` returns truthy for. The predicate is invoked with three
  9731. * arguments: (value, index|key, collection).
  9732. *
  9733. * **Note:** Unlike `_.remove`, this method returns a new array.
  9734. *
  9735. * @static
  9736. * @memberOf _
  9737. * @since 0.1.0
  9738. * @category Collection
  9739. * @param {Array|Object} collection The collection to iterate over.
  9740. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  9741. * @returns {Array} Returns the new filtered array.
  9742. * @see _.reject
  9743. * @example
  9744. *
  9745. * var users = [
  9746. * { 'user': 'barney', 'age': 36, 'active': true },
  9747. * { 'user': 'fred', 'age': 40, 'active': false }
  9748. * ];
  9749. *
  9750. * _.filter(users, function(o) { return !o.active; });
  9751. * // => objects for ['fred']
  9752. *
  9753. * // The `_.matches` iteratee shorthand.
  9754. * _.filter(users, { 'age': 36, 'active': true });
  9755. * // => objects for ['barney']
  9756. *
  9757. * // The `_.matchesProperty` iteratee shorthand.
  9758. * _.filter(users, ['active', false]);
  9759. * // => objects for ['fred']
  9760. *
  9761. * // The `_.property` iteratee shorthand.
  9762. * _.filter(users, 'active');
  9763. * // => objects for ['barney']
  9764. *
  9765. * // Combining several predicates using `_.overEvery` or `_.overSome`.
  9766. * _.filter(users, _.overSome([{ 'age': 36 }, ['age', 40]]));
  9767. * // => objects for ['fred', 'barney']
  9768. */
  9769. function filter(collection, predicate) {
  9770. var func = isArray(collection) ? arrayFilter : baseFilter;
  9771. return func(collection, getIteratee(predicate, 3));
  9772. }
  9773. /**
  9774. * Iterates over elements of `collection`, returning the first element
  9775. * `predicate` returns truthy for. The predicate is invoked with three
  9776. * arguments: (value, index|key, collection).
  9777. *
  9778. * @static
  9779. * @memberOf _
  9780. * @since 0.1.0
  9781. * @category Collection
  9782. * @param {Array|Object} collection The collection to inspect.
  9783. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  9784. * @param {number} [fromIndex=0] The index to search from.
  9785. * @returns {*} Returns the matched element, else `undefined`.
  9786. * @example
  9787. *
  9788. * var users = [
  9789. * { 'user': 'barney', 'age': 36, 'active': true },
  9790. * { 'user': 'fred', 'age': 40, 'active': false },
  9791. * { 'user': 'pebbles', 'age': 1, 'active': true }
  9792. * ];
  9793. *
  9794. * _.find(users, function(o) { return o.age < 40; });
  9795. * // => object for 'barney'
  9796. *
  9797. * // The `_.matches` iteratee shorthand.
  9798. * _.find(users, { 'age': 1, 'active': true });
  9799. * // => object for 'pebbles'
  9800. *
  9801. * // The `_.matchesProperty` iteratee shorthand.
  9802. * _.find(users, ['active', false]);
  9803. * // => object for 'fred'
  9804. *
  9805. * // The `_.property` iteratee shorthand.
  9806. * _.find(users, 'active');
  9807. * // => object for 'barney'
  9808. */
  9809. var find = createFind(findIndex);
  9810. /**
  9811. * This method is like `_.find` except that it iterates over elements of
  9812. * `collection` from right to left.
  9813. *
  9814. * @static
  9815. * @memberOf _
  9816. * @since 2.0.0
  9817. * @category Collection
  9818. * @param {Array|Object} collection The collection to inspect.
  9819. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  9820. * @param {number} [fromIndex=collection.length-1] The index to search from.
  9821. * @returns {*} Returns the matched element, else `undefined`.
  9822. * @example
  9823. *
  9824. * _.findLast([1, 2, 3, 4], function(n) {
  9825. * return n % 2 == 1;
  9826. * });
  9827. * // => 3
  9828. */
  9829. var findLast = createFind(findLastIndex);
  9830. /**
  9831. * Creates a flattened array of values by running each element in `collection`
  9832. * thru `iteratee` and flattening the mapped results. The iteratee is invoked
  9833. * with three arguments: (value, index|key, collection).
  9834. *
  9835. * @static
  9836. * @memberOf _
  9837. * @since 4.0.0
  9838. * @category Collection
  9839. * @param {Array|Object} collection The collection to iterate over.
  9840. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  9841. * @returns {Array} Returns the new flattened array.
  9842. * @example
  9843. *
  9844. * function duplicate(n) {
  9845. * return [n, n];
  9846. * }
  9847. *
  9848. * _.flatMap([1, 2], duplicate);
  9849. * // => [1, 1, 2, 2]
  9850. */
  9851. function flatMap(collection, iteratee) {
  9852. return baseFlatten(map(collection, iteratee), 1);
  9853. }
  9854. /**
  9855. * This method is like `_.flatMap` except that it recursively flattens the
  9856. * mapped results.
  9857. *
  9858. * @static
  9859. * @memberOf _
  9860. * @since 4.7.0
  9861. * @category Collection
  9862. * @param {Array|Object} collection The collection to iterate over.
  9863. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  9864. * @returns {Array} Returns the new flattened array.
  9865. * @example
  9866. *
  9867. * function duplicate(n) {
  9868. * return [[[n, n]]];
  9869. * }
  9870. *
  9871. * _.flatMapDeep([1, 2], duplicate);
  9872. * // => [1, 1, 2, 2]
  9873. */
  9874. function flatMapDeep(collection, iteratee) {
  9875. return baseFlatten(map(collection, iteratee), INFINITY);
  9876. }
  9877. /**
  9878. * This method is like `_.flatMap` except that it recursively flattens the
  9879. * mapped results up to `depth` times.
  9880. *
  9881. * @static
  9882. * @memberOf _
  9883. * @since 4.7.0
  9884. * @category Collection
  9885. * @param {Array|Object} collection The collection to iterate over.
  9886. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  9887. * @param {number} [depth=1] The maximum recursion depth.
  9888. * @returns {Array} Returns the new flattened array.
  9889. * @example
  9890. *
  9891. * function duplicate(n) {
  9892. * return [[[n, n]]];
  9893. * }
  9894. *
  9895. * _.flatMapDepth([1, 2], duplicate, 2);
  9896. * // => [[1, 1], [2, 2]]
  9897. */
  9898. function flatMapDepth(collection, iteratee, depth) {
  9899. depth = depth === undefined ? 1 : toInteger(depth);
  9900. return baseFlatten(map(collection, iteratee), depth);
  9901. }
  9902. /**
  9903. * Iterates over elements of `collection` and invokes `iteratee` for each element.
  9904. * The iteratee is invoked with three arguments: (value, index|key, collection).
  9905. * Iteratee functions may exit iteration early by explicitly returning `false`.
  9906. *
  9907. * **Note:** As with other "Collections" methods, objects with a "length"
  9908. * property are iterated like arrays. To avoid this behavior use `_.forIn`
  9909. * or `_.forOwn` for object iteration.
  9910. *
  9911. * @static
  9912. * @memberOf _
  9913. * @since 0.1.0
  9914. * @alias each
  9915. * @category Collection
  9916. * @param {Array|Object} collection The collection to iterate over.
  9917. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  9918. * @returns {Array|Object} Returns `collection`.
  9919. * @see _.forEachRight
  9920. * @example
  9921. *
  9922. * _.forEach([1, 2], function(value) {
  9923. * console.log(value);
  9924. * });
  9925. * // => Logs `1` then `2`.
  9926. *
  9927. * _.forEach({ 'a': 1, 'b': 2 }, function(value, key) {
  9928. * console.log(key);
  9929. * });
  9930. * // => Logs 'a' then 'b' (iteration order is not guaranteed).
  9931. */
  9932. function forEach(collection, iteratee) {
  9933. var func = isArray(collection) ? arrayEach : baseEach;
  9934. return func(collection, getIteratee(iteratee, 3));
  9935. }
  9936. /**
  9937. * This method is like `_.forEach` except that it iterates over elements of
  9938. * `collection` from right to left.
  9939. *
  9940. * @static
  9941. * @memberOf _
  9942. * @since 2.0.0
  9943. * @alias eachRight
  9944. * @category Collection
  9945. * @param {Array|Object} collection The collection to iterate over.
  9946. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  9947. * @returns {Array|Object} Returns `collection`.
  9948. * @see _.forEach
  9949. * @example
  9950. *
  9951. * _.forEachRight([1, 2], function(value) {
  9952. * console.log(value);
  9953. * });
  9954. * // => Logs `2` then `1`.
  9955. */
  9956. function forEachRight(collection, iteratee) {
  9957. var func = isArray(collection) ? arrayEachRight : baseEachRight;
  9958. return func(collection, getIteratee(iteratee, 3));
  9959. }
  9960. /**
  9961. * Creates an object composed of keys generated from the results of running
  9962. * each element of `collection` thru `iteratee`. The order of grouped values
  9963. * is determined by the order they occur in `collection`. The corresponding
  9964. * value of each key is an array of elements responsible for generating the
  9965. * key. The iteratee is invoked with one argument: (value).
  9966. *
  9967. * @static
  9968. * @memberOf _
  9969. * @since 0.1.0
  9970. * @category Collection
  9971. * @param {Array|Object} collection The collection to iterate over.
  9972. * @param {Function} [iteratee=_.identity] The iteratee to transform keys.
  9973. * @returns {Object} Returns the composed aggregate object.
  9974. * @example
  9975. *
  9976. * _.groupBy([6.1, 4.2, 6.3], Math.floor);
  9977. * // => { '4': [4.2], '6': [6.1, 6.3] }
  9978. *
  9979. * // The `_.property` iteratee shorthand.
  9980. * _.groupBy(['one', 'two', 'three'], 'length');
  9981. * // => { '3': ['one', 'two'], '5': ['three'] }
  9982. */
  9983. var groupBy = createAggregator(function(result, value, key) {
  9984. if (hasOwnProperty.call(result, key)) {
  9985. result[key].push(value);
  9986. } else {
  9987. baseAssignValue(result, key, [value]);
  9988. }
  9989. });
  9990. /**
  9991. * Checks if `value` is in `collection`. If `collection` is a string, it's
  9992. * checked for a substring of `value`, otherwise
  9993. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  9994. * is used for equality comparisons. If `fromIndex` is negative, it's used as
  9995. * the offset from the end of `collection`.
  9996. *
  9997. * @static
  9998. * @memberOf _
  9999. * @since 0.1.0
  10000. * @category Collection
  10001. * @param {Array|Object|string} collection The collection to inspect.
  10002. * @param {*} value The value to search for.
  10003. * @param {number} [fromIndex=0] The index to search from.
  10004. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.reduce`.
  10005. * @returns {boolean} Returns `true` if `value` is found, else `false`.
  10006. * @example
  10007. *
  10008. * _.includes([1, 2, 3], 1);
  10009. * // => true
  10010. *
  10011. * _.includes([1, 2, 3], 1, 2);
  10012. * // => false
  10013. *
  10014. * _.includes({ 'a': 1, 'b': 2 }, 1);
  10015. * // => true
  10016. *
  10017. * _.includes('abcd', 'bc');
  10018. * // => true
  10019. */
  10020. function includes(collection, value, fromIndex, guard) {
  10021. collection = isArrayLike(collection) ? collection : values(collection);
  10022. fromIndex = (fromIndex && !guard) ? toInteger(fromIndex) : 0;
  10023. var length = collection.length;
  10024. if (fromIndex < 0) {
  10025. fromIndex = nativeMax(length + fromIndex, 0);
  10026. }
  10027. return isString(collection)
  10028. ? (fromIndex <= length && collection.indexOf(value, fromIndex) > -1)
  10029. : (!!length && baseIndexOf(collection, value, fromIndex) > -1);
  10030. }
  10031. /**
  10032. * Invokes the method at `path` of each element in `collection`, returning
  10033. * an array of the results of each invoked method. Any additional arguments
  10034. * are provided to each invoked method. If `path` is a function, it's invoked
  10035. * for, and `this` bound to, each element in `collection`.
  10036. *
  10037. * @static
  10038. * @memberOf _
  10039. * @since 4.0.0
  10040. * @category Collection
  10041. * @param {Array|Object} collection The collection to iterate over.
  10042. * @param {Array|Function|string} path The path of the method to invoke or
  10043. * the function invoked per iteration.
  10044. * @param {...*} [args] The arguments to invoke each method with.
  10045. * @returns {Array} Returns the array of results.
  10046. * @example
  10047. *
  10048. * _.invokeMap([[5, 1, 7], [3, 2, 1]], 'sort');
  10049. * // => [[1, 5, 7], [1, 2, 3]]
  10050. *
  10051. * _.invokeMap([123, 456], String.prototype.split, '');
  10052. * // => [['1', '2', '3'], ['4', '5', '6']]
  10053. */
  10054. var invokeMap = baseRest(function(collection, path, args) {
  10055. var index = -1,
  10056. isFunc = typeof path == 'function',
  10057. result = isArrayLike(collection) ? Array(collection.length) : [];
  10058. baseEach(collection, function(value) {
  10059. result[++index] = isFunc ? apply(path, value, args) : baseInvoke(value, path, args);
  10060. });
  10061. return result;
  10062. });
  10063. /**
  10064. * Creates an object composed of keys generated from the results of running
  10065. * each element of `collection` thru `iteratee`. The corresponding value of
  10066. * each key is the last element responsible for generating the key. The
  10067. * iteratee is invoked with one argument: (value).
  10068. *
  10069. * @static
  10070. * @memberOf _
  10071. * @since 4.0.0
  10072. * @category Collection
  10073. * @param {Array|Object} collection The collection to iterate over.
  10074. * @param {Function} [iteratee=_.identity] The iteratee to transform keys.
  10075. * @returns {Object} Returns the composed aggregate object.
  10076. * @example
  10077. *
  10078. * var array = [
  10079. * { 'dir': 'left', 'code': 97 },
  10080. * { 'dir': 'right', 'code': 100 }
  10081. * ];
  10082. *
  10083. * _.keyBy(array, function(o) {
  10084. * return String.fromCharCode(o.code);
  10085. * });
  10086. * // => { 'a': { 'dir': 'left', 'code': 97 }, 'd': { 'dir': 'right', 'code': 100 } }
  10087. *
  10088. * _.keyBy(array, 'dir');
  10089. * // => { 'left': { 'dir': 'left', 'code': 97 }, 'right': { 'dir': 'right', 'code': 100 } }
  10090. */
  10091. var keyBy = createAggregator(function(result, value, key) {
  10092. baseAssignValue(result, key, value);
  10093. });
  10094. /**
  10095. * Creates an array of values by running each element in `collection` thru
  10096. * `iteratee`. The iteratee is invoked with three arguments:
  10097. * (value, index|key, collection).
  10098. *
  10099. * Many lodash methods are guarded to work as iteratees for methods like
  10100. * `_.every`, `_.filter`, `_.map`, `_.mapValues`, `_.reject`, and `_.some`.
  10101. *
  10102. * The guarded methods are:
  10103. * `ary`, `chunk`, `curry`, `curryRight`, `drop`, `dropRight`, `every`,
  10104. * `fill`, `invert`, `parseInt`, `random`, `range`, `rangeRight`, `repeat`,
  10105. * `sampleSize`, `slice`, `some`, `sortBy`, `split`, `take`, `takeRight`,
  10106. * `template`, `trim`, `trimEnd`, `trimStart`, and `words`
  10107. *
  10108. * @static
  10109. * @memberOf _
  10110. * @since 0.1.0
  10111. * @category Collection
  10112. * @param {Array|Object} collection The collection to iterate over.
  10113. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  10114. * @returns {Array} Returns the new mapped array.
  10115. * @example
  10116. *
  10117. * function square(n) {
  10118. * return n * n;
  10119. * }
  10120. *
  10121. * _.map([4, 8], square);
  10122. * // => [16, 64]
  10123. *
  10124. * _.map({ 'a': 4, 'b': 8 }, square);
  10125. * // => [16, 64] (iteration order is not guaranteed)
  10126. *
  10127. * var users = [
  10128. * { 'user': 'barney' },
  10129. * { 'user': 'fred' }
  10130. * ];
  10131. *
  10132. * // The `_.property` iteratee shorthand.
  10133. * _.map(users, 'user');
  10134. * // => ['barney', 'fred']
  10135. */
  10136. function map(collection, iteratee) {
  10137. var func = isArray(collection) ? arrayMap : baseMap;
  10138. return func(collection, getIteratee(iteratee, 3));
  10139. }
  10140. /**
  10141. * This method is like `_.sortBy` except that it allows specifying the sort
  10142. * orders of the iteratees to sort by. If `orders` is unspecified, all values
  10143. * are sorted in ascending order. Otherwise, specify an order of "desc" for
  10144. * descending or "asc" for ascending sort order of corresponding values.
  10145. *
  10146. * @static
  10147. * @memberOf _
  10148. * @since 4.0.0
  10149. * @category Collection
  10150. * @param {Array|Object} collection The collection to iterate over.
  10151. * @param {Array[]|Function[]|Object[]|string[]} [iteratees=[_.identity]]
  10152. * The iteratees to sort by.
  10153. * @param {string[]} [orders] The sort orders of `iteratees`.
  10154. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.reduce`.
  10155. * @returns {Array} Returns the new sorted array.
  10156. * @example
  10157. *
  10158. * var users = [
  10159. * { 'user': 'fred', 'age': 48 },
  10160. * { 'user': 'barney', 'age': 34 },
  10161. * { 'user': 'fred', 'age': 40 },
  10162. * { 'user': 'barney', 'age': 36 }
  10163. * ];
  10164. *
  10165. * // Sort by `user` in ascending order and by `age` in descending order.
  10166. * _.orderBy(users, ['user', 'age'], ['asc', 'desc']);
  10167. * // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 40]]
  10168. */
  10169. function orderBy(collection, iteratees, orders, guard) {
  10170. if (collection == null) {
  10171. return [];
  10172. }
  10173. if (!isArray(iteratees)) {
  10174. iteratees = iteratees == null ? [] : [iteratees];
  10175. }
  10176. orders = guard ? undefined : orders;
  10177. if (!isArray(orders)) {
  10178. orders = orders == null ? [] : [orders];
  10179. }
  10180. return baseOrderBy(collection, iteratees, orders);
  10181. }
  10182. /**
  10183. * Creates an array of elements split into two groups, the first of which
  10184. * contains elements `predicate` returns truthy for, the second of which
  10185. * contains elements `predicate` returns falsey for. The predicate is
  10186. * invoked with one argument: (value).
  10187. *
  10188. * @static
  10189. * @memberOf _
  10190. * @since 3.0.0
  10191. * @category Collection
  10192. * @param {Array|Object} collection The collection to iterate over.
  10193. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  10194. * @returns {Array} Returns the array of grouped elements.
  10195. * @example
  10196. *
  10197. * var users = [
  10198. * { 'user': 'barney', 'age': 36, 'active': false },
  10199. * { 'user': 'fred', 'age': 40, 'active': true },
  10200. * { 'user': 'pebbles', 'age': 1, 'active': false }
  10201. * ];
  10202. *
  10203. * _.partition(users, function(o) { return o.active; });
  10204. * // => objects for [['fred'], ['barney', 'pebbles']]
  10205. *
  10206. * // The `_.matches` iteratee shorthand.
  10207. * _.partition(users, { 'age': 1, 'active': false });
  10208. * // => objects for [['pebbles'], ['barney', 'fred']]
  10209. *
  10210. * // The `_.matchesProperty` iteratee shorthand.
  10211. * _.partition(users, ['active', false]);
  10212. * // => objects for [['barney', 'pebbles'], ['fred']]
  10213. *
  10214. * // The `_.property` iteratee shorthand.
  10215. * _.partition(users, 'active');
  10216. * // => objects for [['fred'], ['barney', 'pebbles']]
  10217. */
  10218. var partition = createAggregator(function(result, value, key) {
  10219. result[key ? 0 : 1].push(value);
  10220. }, function() { return [[], []]; });
  10221. /**
  10222. * Reduces `collection` to a value which is the accumulated result of running
  10223. * each element in `collection` thru `iteratee`, where each successive
  10224. * invocation is supplied the return value of the previous. If `accumulator`
  10225. * is not given, the first element of `collection` is used as the initial
  10226. * value. The iteratee is invoked with four arguments:
  10227. * (accumulator, value, index|key, collection).
  10228. *
  10229. * Many lodash methods are guarded to work as iteratees for methods like
  10230. * `_.reduce`, `_.reduceRight`, and `_.transform`.
  10231. *
  10232. * The guarded methods are:
  10233. * `assign`, `defaults`, `defaultsDeep`, `includes`, `merge`, `orderBy`,
  10234. * and `sortBy`
  10235. *
  10236. * @static
  10237. * @memberOf _
  10238. * @since 0.1.0
  10239. * @category Collection
  10240. * @param {Array|Object} collection The collection to iterate over.
  10241. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  10242. * @param {*} [accumulator] The initial value.
  10243. * @returns {*} Returns the accumulated value.
  10244. * @see _.reduceRight
  10245. * @example
  10246. *
  10247. * _.reduce([1, 2], function(sum, n) {
  10248. * return sum + n;
  10249. * }, 0);
  10250. * // => 3
  10251. *
  10252. * _.reduce({ 'a': 1, 'b': 2, 'c': 1 }, function(result, value, key) {
  10253. * (result[value] || (result[value] = [])).push(key);
  10254. * return result;
  10255. * }, {});
  10256. * // => { '1': ['a', 'c'], '2': ['b'] } (iteration order is not guaranteed)
  10257. */
  10258. function reduce(collection, iteratee, accumulator) {
  10259. var func = isArray(collection) ? arrayReduce : baseReduce,
  10260. initAccum = arguments.length < 3;
  10261. return func(collection, getIteratee(iteratee, 4), accumulator, initAccum, baseEach);
  10262. }
  10263. /**
  10264. * This method is like `_.reduce` except that it iterates over elements of
  10265. * `collection` from right to left.
  10266. *
  10267. * @static
  10268. * @memberOf _
  10269. * @since 0.1.0
  10270. * @category Collection
  10271. * @param {Array|Object} collection The collection to iterate over.
  10272. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  10273. * @param {*} [accumulator] The initial value.
  10274. * @returns {*} Returns the accumulated value.
  10275. * @see _.reduce
  10276. * @example
  10277. *
  10278. * var array = [[0, 1], [2, 3], [4, 5]];
  10279. *
  10280. * _.reduceRight(array, function(flattened, other) {
  10281. * return flattened.concat(other);
  10282. * }, []);
  10283. * // => [4, 5, 2, 3, 0, 1]
  10284. */
  10285. function reduceRight(collection, iteratee, accumulator) {
  10286. var func = isArray(collection) ? arrayReduceRight : baseReduce,
  10287. initAccum = arguments.length < 3;
  10288. return func(collection, getIteratee(iteratee, 4), accumulator, initAccum, baseEachRight);
  10289. }
  10290. /**
  10291. * The opposite of `_.filter`; this method returns the elements of `collection`
  10292. * that `predicate` does **not** return truthy for.
  10293. *
  10294. * @static
  10295. * @memberOf _
  10296. * @since 0.1.0
  10297. * @category Collection
  10298. * @param {Array|Object} collection The collection to iterate over.
  10299. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  10300. * @returns {Array} Returns the new filtered array.
  10301. * @see _.filter
  10302. * @example
  10303. *
  10304. * var users = [
  10305. * { 'user': 'barney', 'age': 36, 'active': false },
  10306. * { 'user': 'fred', 'age': 40, 'active': true }
  10307. * ];
  10308. *
  10309. * _.reject(users, function(o) { return !o.active; });
  10310. * // => objects for ['fred']
  10311. *
  10312. * // The `_.matches` iteratee shorthand.
  10313. * _.reject(users, { 'age': 40, 'active': true });
  10314. * // => objects for ['barney']
  10315. *
  10316. * // The `_.matchesProperty` iteratee shorthand.
  10317. * _.reject(users, ['active', false]);
  10318. * // => objects for ['fred']
  10319. *
  10320. * // The `_.property` iteratee shorthand.
  10321. * _.reject(users, 'active');
  10322. * // => objects for ['barney']
  10323. */
  10324. function reject(collection, predicate) {
  10325. var func = isArray(collection) ? arrayFilter : baseFilter;
  10326. return func(collection, negate(getIteratee(predicate, 3)));
  10327. }
  10328. /**
  10329. * Gets a random element from `collection`.
  10330. *
  10331. * @static
  10332. * @memberOf _
  10333. * @since 2.0.0
  10334. * @category Collection
  10335. * @param {Array|Object} collection The collection to sample.
  10336. * @returns {*} Returns the random element.
  10337. * @example
  10338. *
  10339. * _.sample([1, 2, 3, 4]);
  10340. * // => 2
  10341. */
  10342. function sample(collection) {
  10343. var func = isArray(collection) ? arraySample : baseSample;
  10344. return func(collection);
  10345. }
  10346. /**
  10347. * Gets `n` random elements at unique keys from `collection` up to the
  10348. * size of `collection`.
  10349. *
  10350. * @static
  10351. * @memberOf _
  10352. * @since 4.0.0
  10353. * @category Collection
  10354. * @param {Array|Object} collection The collection to sample.
  10355. * @param {number} [n=1] The number of elements to sample.
  10356. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  10357. * @returns {Array} Returns the random elements.
  10358. * @example
  10359. *
  10360. * _.sampleSize([1, 2, 3], 2);
  10361. * // => [3, 1]
  10362. *
  10363. * _.sampleSize([1, 2, 3], 4);
  10364. * // => [2, 3, 1]
  10365. */
  10366. function sampleSize(collection, n, guard) {
  10367. if ((guard ? isIterateeCall(collection, n, guard) : n === undefined)) {
  10368. n = 1;
  10369. } else {
  10370. n = toInteger(n);
  10371. }
  10372. var func = isArray(collection) ? arraySampleSize : baseSampleSize;
  10373. return func(collection, n);
  10374. }
  10375. /**
  10376. * Creates an array of shuffled values, using a version of the
  10377. * [Fisher-Yates shuffle](https://en.wikipedia.org/wiki/Fisher-Yates_shuffle).
  10378. *
  10379. * @static
  10380. * @memberOf _
  10381. * @since 0.1.0
  10382. * @category Collection
  10383. * @param {Array|Object} collection The collection to shuffle.
  10384. * @returns {Array} Returns the new shuffled array.
  10385. * @example
  10386. *
  10387. * _.shuffle([1, 2, 3, 4]);
  10388. * // => [4, 1, 3, 2]
  10389. */
  10390. function shuffle(collection) {
  10391. var func = isArray(collection) ? arrayShuffle : baseShuffle;
  10392. return func(collection);
  10393. }
  10394. /**
  10395. * Gets the size of `collection` by returning its length for array-like
  10396. * values or the number of own enumerable string keyed properties for objects.
  10397. *
  10398. * @static
  10399. * @memberOf _
  10400. * @since 0.1.0
  10401. * @category Collection
  10402. * @param {Array|Object|string} collection The collection to inspect.
  10403. * @returns {number} Returns the collection size.
  10404. * @example
  10405. *
  10406. * _.size([1, 2, 3]);
  10407. * // => 3
  10408. *
  10409. * _.size({ 'a': 1, 'b': 2 });
  10410. * // => 2
  10411. *
  10412. * _.size('pebbles');
  10413. * // => 7
  10414. */
  10415. function size(collection) {
  10416. if (collection == null) {
  10417. return 0;
  10418. }
  10419. if (isArrayLike(collection)) {
  10420. return isString(collection) ? stringSize(collection) : collection.length;
  10421. }
  10422. var tag = getTag(collection);
  10423. if (tag == mapTag || tag == setTag) {
  10424. return collection.size;
  10425. }
  10426. return baseKeys(collection).length;
  10427. }
  10428. /**
  10429. * Checks if `predicate` returns truthy for **any** element of `collection`.
  10430. * Iteration is stopped once `predicate` returns truthy. The predicate is
  10431. * invoked with three arguments: (value, index|key, collection).
  10432. *
  10433. * @static
  10434. * @memberOf _
  10435. * @since 0.1.0
  10436. * @category Collection
  10437. * @param {Array|Object} collection The collection to iterate over.
  10438. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  10439. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  10440. * @returns {boolean} Returns `true` if any element passes the predicate check,
  10441. * else `false`.
  10442. * @example
  10443. *
  10444. * _.some([null, 0, 'yes', false], Boolean);
  10445. * // => true
  10446. *
  10447. * var users = [
  10448. * { 'user': 'barney', 'active': true },
  10449. * { 'user': 'fred', 'active': false }
  10450. * ];
  10451. *
  10452. * // The `_.matches` iteratee shorthand.
  10453. * _.some(users, { 'user': 'barney', 'active': false });
  10454. * // => false
  10455. *
  10456. * // The `_.matchesProperty` iteratee shorthand.
  10457. * _.some(users, ['active', false]);
  10458. * // => true
  10459. *
  10460. * // The `_.property` iteratee shorthand.
  10461. * _.some(users, 'active');
  10462. * // => true
  10463. */
  10464. function some(collection, predicate, guard) {
  10465. var func = isArray(collection) ? arraySome : baseSome;
  10466. if (guard && isIterateeCall(collection, predicate, guard)) {
  10467. predicate = undefined;
  10468. }
  10469. return func(collection, getIteratee(predicate, 3));
  10470. }
  10471. /**
  10472. * Creates an array of elements, sorted in ascending order by the results of
  10473. * running each element in a collection thru each iteratee. This method
  10474. * performs a stable sort, that is, it preserves the original sort order of
  10475. * equal elements. The iteratees are invoked with one argument: (value).
  10476. *
  10477. * @static
  10478. * @memberOf _
  10479. * @since 0.1.0
  10480. * @category Collection
  10481. * @param {Array|Object} collection The collection to iterate over.
  10482. * @param {...(Function|Function[])} [iteratees=[_.identity]]
  10483. * The iteratees to sort by.
  10484. * @returns {Array} Returns the new sorted array.
  10485. * @example
  10486. *
  10487. * var users = [
  10488. * { 'user': 'fred', 'age': 48 },
  10489. * { 'user': 'barney', 'age': 36 },
  10490. * { 'user': 'fred', 'age': 30 },
  10491. * { 'user': 'barney', 'age': 34 }
  10492. * ];
  10493. *
  10494. * _.sortBy(users, [function(o) { return o.user; }]);
  10495. * // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 30]]
  10496. *
  10497. * _.sortBy(users, ['user', 'age']);
  10498. * // => objects for [['barney', 34], ['barney', 36], ['fred', 30], ['fred', 48]]
  10499. */
  10500. var sortBy = baseRest(function(collection, iteratees) {
  10501. if (collection == null) {
  10502. return [];
  10503. }
  10504. var length = iteratees.length;
  10505. if (length > 1 && isIterateeCall(collection, iteratees[0], iteratees[1])) {
  10506. iteratees = [];
  10507. } else if (length > 2 && isIterateeCall(iteratees[0], iteratees[1], iteratees[2])) {
  10508. iteratees = [iteratees[0]];
  10509. }
  10510. return baseOrderBy(collection, baseFlatten(iteratees, 1), []);
  10511. });
  10512. /*------------------------------------------------------------------------*/
  10513. /**
  10514. * Gets the timestamp of the number of milliseconds that have elapsed since
  10515. * the Unix epoch (1 January 1970 00:00:00 UTC).
  10516. *
  10517. * @static
  10518. * @memberOf _
  10519. * @since 2.4.0
  10520. * @category Date
  10521. * @returns {number} Returns the timestamp.
  10522. * @example
  10523. *
  10524. * _.defer(function(stamp) {
  10525. * console.log(_.now() - stamp);
  10526. * }, _.now());
  10527. * // => Logs the number of milliseconds it took for the deferred invocation.
  10528. */
  10529. var now = ctxNow || function() {
  10530. return root.Date.now();
  10531. };
  10532. /*------------------------------------------------------------------------*/
  10533. /**
  10534. * The opposite of `_.before`; this method creates a function that invokes
  10535. * `func` once it's called `n` or more times.
  10536. *
  10537. * @static
  10538. * @memberOf _
  10539. * @since 0.1.0
  10540. * @category Function
  10541. * @param {number} n The number of calls before `func` is invoked.
  10542. * @param {Function} func The function to restrict.
  10543. * @returns {Function} Returns the new restricted function.
  10544. * @example
  10545. *
  10546. * var saves = ['profile', 'settings'];
  10547. *
  10548. * var done = _.after(saves.length, function() {
  10549. * console.log('done saving!');
  10550. * });
  10551. *
  10552. * _.forEach(saves, function(type) {
  10553. * asyncSave({ 'type': type, 'complete': done });
  10554. * });
  10555. * // => Logs 'done saving!' after the two async saves have completed.
  10556. */
  10557. function after(n, func) {
  10558. if (typeof func != 'function') {
  10559. throw new TypeError(FUNC_ERROR_TEXT);
  10560. }
  10561. n = toInteger(n);
  10562. return function() {
  10563. if (--n < 1) {
  10564. return func.apply(this, arguments);
  10565. }
  10566. };
  10567. }
  10568. /**
  10569. * Creates a function that invokes `func`, with up to `n` arguments,
  10570. * ignoring any additional arguments.
  10571. *
  10572. * @static
  10573. * @memberOf _
  10574. * @since 3.0.0
  10575. * @category Function
  10576. * @param {Function} func The function to cap arguments for.
  10577. * @param {number} [n=func.length] The arity cap.
  10578. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  10579. * @returns {Function} Returns the new capped function.
  10580. * @example
  10581. *
  10582. * _.map(['6', '8', '10'], _.ary(parseInt, 1));
  10583. * // => [6, 8, 10]
  10584. */
  10585. function ary(func, n, guard) {
  10586. n = guard ? undefined : n;
  10587. n = (func && n == null) ? func.length : n;
  10588. return createWrap(func, WRAP_ARY_FLAG, undefined, undefined, undefined, undefined, n);
  10589. }
  10590. /**
  10591. * Creates a function that invokes `func`, with the `this` binding and arguments
  10592. * of the created function, while it's called less than `n` times. Subsequent
  10593. * calls to the created function return the result of the last `func` invocation.
  10594. *
  10595. * @static
  10596. * @memberOf _
  10597. * @since 3.0.0
  10598. * @category Function
  10599. * @param {number} n The number of calls at which `func` is no longer invoked.
  10600. * @param {Function} func The function to restrict.
  10601. * @returns {Function} Returns the new restricted function.
  10602. * @example
  10603. *
  10604. * jQuery(element).on('click', _.before(5, addContactToList));
  10605. * // => Allows adding up to 4 contacts to the list.
  10606. */
  10607. function before(n, func) {
  10608. var result;
  10609. if (typeof func != 'function') {
  10610. throw new TypeError(FUNC_ERROR_TEXT);
  10611. }
  10612. n = toInteger(n);
  10613. return function() {
  10614. if (--n > 0) {
  10615. result = func.apply(this, arguments);
  10616. }
  10617. if (n <= 1) {
  10618. func = undefined;
  10619. }
  10620. return result;
  10621. };
  10622. }
  10623. /**
  10624. * Creates a function that invokes `func` with the `this` binding of `thisArg`
  10625. * and `partials` prepended to the arguments it receives.
  10626. *
  10627. * The `_.bind.placeholder` value, which defaults to `_` in monolithic builds,
  10628. * may be used as a placeholder for partially applied arguments.
  10629. *
  10630. * **Note:** Unlike native `Function#bind`, this method doesn't set the "length"
  10631. * property of bound functions.
  10632. *
  10633. * @static
  10634. * @memberOf _
  10635. * @since 0.1.0
  10636. * @category Function
  10637. * @param {Function} func The function to bind.
  10638. * @param {*} thisArg The `this` binding of `func`.
  10639. * @param {...*} [partials] The arguments to be partially applied.
  10640. * @returns {Function} Returns the new bound function.
  10641. * @example
  10642. *
  10643. * function greet(greeting, punctuation) {
  10644. * return greeting + ' ' + this.user + punctuation;
  10645. * }
  10646. *
  10647. * var object = { 'user': 'fred' };
  10648. *
  10649. * var bound = _.bind(greet, object, 'hi');
  10650. * bound('!');
  10651. * // => 'hi fred!'
  10652. *
  10653. * // Bound with placeholders.
  10654. * var bound = _.bind(greet, object, _, '!');
  10655. * bound('hi');
  10656. * // => 'hi fred!'
  10657. */
  10658. var bind = baseRest(function(func, thisArg, partials) {
  10659. var bitmask = WRAP_BIND_FLAG;
  10660. if (partials.length) {
  10661. var holders = replaceHolders(partials, getHolder(bind));
  10662. bitmask |= WRAP_PARTIAL_FLAG;
  10663. }
  10664. return createWrap(func, bitmask, thisArg, partials, holders);
  10665. });
  10666. /**
  10667. * Creates a function that invokes the method at `object[key]` with `partials`
  10668. * prepended to the arguments it receives.
  10669. *
  10670. * This method differs from `_.bind` by allowing bound functions to reference
  10671. * methods that may be redefined or don't yet exist. See
  10672. * [Peter Michaux's article](http://peter.michaux.ca/articles/lazy-function-definition-pattern)
  10673. * for more details.
  10674. *
  10675. * The `_.bindKey.placeholder` value, which defaults to `_` in monolithic
  10676. * builds, may be used as a placeholder for partially applied arguments.
  10677. *
  10678. * @static
  10679. * @memberOf _
  10680. * @since 0.10.0
  10681. * @category Function
  10682. * @param {Object} object The object to invoke the method on.
  10683. * @param {string} key The key of the method.
  10684. * @param {...*} [partials] The arguments to be partially applied.
  10685. * @returns {Function} Returns the new bound function.
  10686. * @example
  10687. *
  10688. * var object = {
  10689. * 'user': 'fred',
  10690. * 'greet': function(greeting, punctuation) {
  10691. * return greeting + ' ' + this.user + punctuation;
  10692. * }
  10693. * };
  10694. *
  10695. * var bound = _.bindKey(object, 'greet', 'hi');
  10696. * bound('!');
  10697. * // => 'hi fred!'
  10698. *
  10699. * object.greet = function(greeting, punctuation) {
  10700. * return greeting + 'ya ' + this.user + punctuation;
  10701. * };
  10702. *
  10703. * bound('!');
  10704. * // => 'hiya fred!'
  10705. *
  10706. * // Bound with placeholders.
  10707. * var bound = _.bindKey(object, 'greet', _, '!');
  10708. * bound('hi');
  10709. * // => 'hiya fred!'
  10710. */
  10711. var bindKey = baseRest(function(object, key, partials) {
  10712. var bitmask = WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG;
  10713. if (partials.length) {
  10714. var holders = replaceHolders(partials, getHolder(bindKey));
  10715. bitmask |= WRAP_PARTIAL_FLAG;
  10716. }
  10717. return createWrap(key, bitmask, object, partials, holders);
  10718. });
  10719. /**
  10720. * Creates a function that accepts arguments of `func` and either invokes
  10721. * `func` returning its result, if at least `arity` number of arguments have
  10722. * been provided, or returns a function that accepts the remaining `func`
  10723. * arguments, and so on. The arity of `func` may be specified if `func.length`
  10724. * is not sufficient.
  10725. *
  10726. * The `_.curry.placeholder` value, which defaults to `_` in monolithic builds,
  10727. * may be used as a placeholder for provided arguments.
  10728. *
  10729. * **Note:** This method doesn't set the "length" property of curried functions.
  10730. *
  10731. * @static
  10732. * @memberOf _
  10733. * @since 2.0.0
  10734. * @category Function
  10735. * @param {Function} func The function to curry.
  10736. * @param {number} [arity=func.length] The arity of `func`.
  10737. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  10738. * @returns {Function} Returns the new curried function.
  10739. * @example
  10740. *
  10741. * var abc = function(a, b, c) {
  10742. * return [a, b, c];
  10743. * };
  10744. *
  10745. * var curried = _.curry(abc);
  10746. *
  10747. * curried(1)(2)(3);
  10748. * // => [1, 2, 3]
  10749. *
  10750. * curried(1, 2)(3);
  10751. * // => [1, 2, 3]
  10752. *
  10753. * curried(1, 2, 3);
  10754. * // => [1, 2, 3]
  10755. *
  10756. * // Curried with placeholders.
  10757. * curried(1)(_, 3)(2);
  10758. * // => [1, 2, 3]
  10759. */
  10760. function curry(func, arity, guard) {
  10761. arity = guard ? undefined : arity;
  10762. var result = createWrap(func, WRAP_CURRY_FLAG, undefined, undefined, undefined, undefined, undefined, arity);
  10763. result.placeholder = curry.placeholder;
  10764. return result;
  10765. }
  10766. /**
  10767. * This method is like `_.curry` except that arguments are applied to `func`
  10768. * in the manner of `_.partialRight` instead of `_.partial`.
  10769. *
  10770. * The `_.curryRight.placeholder` value, which defaults to `_` in monolithic
  10771. * builds, may be used as a placeholder for provided arguments.
  10772. *
  10773. * **Note:** This method doesn't set the "length" property of curried functions.
  10774. *
  10775. * @static
  10776. * @memberOf _
  10777. * @since 3.0.0
  10778. * @category Function
  10779. * @param {Function} func The function to curry.
  10780. * @param {number} [arity=func.length] The arity of `func`.
  10781. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  10782. * @returns {Function} Returns the new curried function.
  10783. * @example
  10784. *
  10785. * var abc = function(a, b, c) {
  10786. * return [a, b, c];
  10787. * };
  10788. *
  10789. * var curried = _.curryRight(abc);
  10790. *
  10791. * curried(3)(2)(1);
  10792. * // => [1, 2, 3]
  10793. *
  10794. * curried(2, 3)(1);
  10795. * // => [1, 2, 3]
  10796. *
  10797. * curried(1, 2, 3);
  10798. * // => [1, 2, 3]
  10799. *
  10800. * // Curried with placeholders.
  10801. * curried(3)(1, _)(2);
  10802. * // => [1, 2, 3]
  10803. */
  10804. function curryRight(func, arity, guard) {
  10805. arity = guard ? undefined : arity;
  10806. var result = createWrap(func, WRAP_CURRY_RIGHT_FLAG, undefined, undefined, undefined, undefined, undefined, arity);
  10807. result.placeholder = curryRight.placeholder;
  10808. return result;
  10809. }
  10810. /**
  10811. * Creates a debounced function that delays invoking `func` until after `wait`
  10812. * milliseconds have elapsed since the last time the debounced function was
  10813. * invoked. The debounced function comes with a `cancel` method to cancel
  10814. * delayed `func` invocations and a `flush` method to immediately invoke them.
  10815. * Provide `options` to indicate whether `func` should be invoked on the
  10816. * leading and/or trailing edge of the `wait` timeout. The `func` is invoked
  10817. * with the last arguments provided to the debounced function. Subsequent
  10818. * calls to the debounced function return the result of the last `func`
  10819. * invocation.
  10820. *
  10821. * **Note:** If `leading` and `trailing` options are `true`, `func` is
  10822. * invoked on the trailing edge of the timeout only if the debounced function
  10823. * is invoked more than once during the `wait` timeout.
  10824. *
  10825. * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred
  10826. * until to the next tick, similar to `setTimeout` with a timeout of `0`.
  10827. *
  10828. * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/)
  10829. * for details over the differences between `_.debounce` and `_.throttle`.
  10830. *
  10831. * @static
  10832. * @memberOf _
  10833. * @since 0.1.0
  10834. * @category Function
  10835. * @param {Function} func The function to debounce.
  10836. * @param {number} [wait=0] The number of milliseconds to delay.
  10837. * @param {Object} [options={}] The options object.
  10838. * @param {boolean} [options.leading=false]
  10839. * Specify invoking on the leading edge of the timeout.
  10840. * @param {number} [options.maxWait]
  10841. * The maximum time `func` is allowed to be delayed before it's invoked.
  10842. * @param {boolean} [options.trailing=true]
  10843. * Specify invoking on the trailing edge of the timeout.
  10844. * @returns {Function} Returns the new debounced function.
  10845. * @example
  10846. *
  10847. * // Avoid costly calculations while the window size is in flux.
  10848. * jQuery(window).on('resize', _.debounce(calculateLayout, 150));
  10849. *
  10850. * // Invoke `sendMail` when clicked, debouncing subsequent calls.
  10851. * jQuery(element).on('click', _.debounce(sendMail, 300, {
  10852. * 'leading': true,
  10853. * 'trailing': false
  10854. * }));
  10855. *
  10856. * // Ensure `batchLog` is invoked once after 1 second of debounced calls.
  10857. * var debounced = _.debounce(batchLog, 250, { 'maxWait': 1000 });
  10858. * var source = new EventSource('/stream');
  10859. * jQuery(source).on('message', debounced);
  10860. *
  10861. * // Cancel the trailing debounced invocation.
  10862. * jQuery(window).on('popstate', debounced.cancel);
  10863. */
  10864. function debounce(func, wait, options) {
  10865. var lastArgs,
  10866. lastThis,
  10867. maxWait,
  10868. result,
  10869. timerId,
  10870. lastCallTime,
  10871. lastInvokeTime = 0,
  10872. leading = false,
  10873. maxing = false,
  10874. trailing = true;
  10875. if (typeof func != 'function') {
  10876. throw new TypeError(FUNC_ERROR_TEXT);
  10877. }
  10878. wait = toNumber(wait) || 0;
  10879. if (isObject(options)) {
  10880. leading = !!options.leading;
  10881. maxing = 'maxWait' in options;
  10882. maxWait = maxing ? nativeMax(toNumber(options.maxWait) || 0, wait) : maxWait;
  10883. trailing = 'trailing' in options ? !!options.trailing : trailing;
  10884. }
  10885. function invokeFunc(time) {
  10886. var args = lastArgs,
  10887. thisArg = lastThis;
  10888. lastArgs = lastThis = undefined;
  10889. lastInvokeTime = time;
  10890. result = func.apply(thisArg, args);
  10891. return result;
  10892. }
  10893. function leadingEdge(time) {
  10894. // Reset any `maxWait` timer.
  10895. lastInvokeTime = time;
  10896. // Start the timer for the trailing edge.
  10897. timerId = setTimeout(timerExpired, wait);
  10898. // Invoke the leading edge.
  10899. return leading ? invokeFunc(time) : result;
  10900. }
  10901. function remainingWait(time) {
  10902. var timeSinceLastCall = time - lastCallTime,
  10903. timeSinceLastInvoke = time - lastInvokeTime,
  10904. timeWaiting = wait - timeSinceLastCall;
  10905. return maxing
  10906. ? nativeMin(timeWaiting, maxWait - timeSinceLastInvoke)
  10907. : timeWaiting;
  10908. }
  10909. function shouldInvoke(time) {
  10910. var timeSinceLastCall = time - lastCallTime,
  10911. timeSinceLastInvoke = time - lastInvokeTime;
  10912. // Either this is the first call, activity has stopped and we're at the
  10913. // trailing edge, the system time has gone backwards and we're treating
  10914. // it as the trailing edge, or we've hit the `maxWait` limit.
  10915. return (lastCallTime === undefined || (timeSinceLastCall >= wait) ||
  10916. (timeSinceLastCall < 0) || (maxing && timeSinceLastInvoke >= maxWait));
  10917. }
  10918. function timerExpired() {
  10919. var time = now();
  10920. if (shouldInvoke(time)) {
  10921. return trailingEdge(time);
  10922. }
  10923. // Restart the timer.
  10924. timerId = setTimeout(timerExpired, remainingWait(time));
  10925. }
  10926. function trailingEdge(time) {
  10927. timerId = undefined;
  10928. // Only invoke if we have `lastArgs` which means `func` has been
  10929. // debounced at least once.
  10930. if (trailing && lastArgs) {
  10931. return invokeFunc(time);
  10932. }
  10933. lastArgs = lastThis = undefined;
  10934. return result;
  10935. }
  10936. function cancel() {
  10937. if (timerId !== undefined) {
  10938. clearTimeout(timerId);
  10939. }
  10940. lastInvokeTime = 0;
  10941. lastArgs = lastCallTime = lastThis = timerId = undefined;
  10942. }
  10943. function flush() {
  10944. return timerId === undefined ? result : trailingEdge(now());
  10945. }
  10946. function debounced() {
  10947. var time = now(),
  10948. isInvoking = shouldInvoke(time);
  10949. lastArgs = arguments;
  10950. lastThis = this;
  10951. lastCallTime = time;
  10952. if (isInvoking) {
  10953. if (timerId === undefined) {
  10954. return leadingEdge(lastCallTime);
  10955. }
  10956. if (maxing) {
  10957. // Handle invocations in a tight loop.
  10958. clearTimeout(timerId);
  10959. timerId = setTimeout(timerExpired, wait);
  10960. return invokeFunc(lastCallTime);
  10961. }
  10962. }
  10963. if (timerId === undefined) {
  10964. timerId = setTimeout(timerExpired, wait);
  10965. }
  10966. return result;
  10967. }
  10968. debounced.cancel = cancel;
  10969. debounced.flush = flush;
  10970. return debounced;
  10971. }
  10972. /**
  10973. * Defers invoking the `func` until the current call stack has cleared. Any
  10974. * additional arguments are provided to `func` when it's invoked.
  10975. *
  10976. * @static
  10977. * @memberOf _
  10978. * @since 0.1.0
  10979. * @category Function
  10980. * @param {Function} func The function to defer.
  10981. * @param {...*} [args] The arguments to invoke `func` with.
  10982. * @returns {number} Returns the timer id.
  10983. * @example
  10984. *
  10985. * _.defer(function(text) {
  10986. * console.log(text);
  10987. * }, 'deferred');
  10988. * // => Logs 'deferred' after one millisecond.
  10989. */
  10990. var defer = baseRest(function(func, args) {
  10991. return baseDelay(func, 1, args);
  10992. });
  10993. /**
  10994. * Invokes `func` after `wait` milliseconds. Any additional arguments are
  10995. * provided to `func` when it's invoked.
  10996. *
  10997. * @static
  10998. * @memberOf _
  10999. * @since 0.1.0
  11000. * @category Function
  11001. * @param {Function} func The function to delay.
  11002. * @param {number} wait The number of milliseconds to delay invocation.
  11003. * @param {...*} [args] The arguments to invoke `func` with.
  11004. * @returns {number} Returns the timer id.
  11005. * @example
  11006. *
  11007. * _.delay(function(text) {
  11008. * console.log(text);
  11009. * }, 1000, 'later');
  11010. * // => Logs 'later' after one second.
  11011. */
  11012. var delay = baseRest(function(func, wait, args) {
  11013. return baseDelay(func, toNumber(wait) || 0, args);
  11014. });
  11015. /**
  11016. * Creates a function that invokes `func` with arguments reversed.
  11017. *
  11018. * @static
  11019. * @memberOf _
  11020. * @since 4.0.0
  11021. * @category Function
  11022. * @param {Function} func The function to flip arguments for.
  11023. * @returns {Function} Returns the new flipped function.
  11024. * @example
  11025. *
  11026. * var flipped = _.flip(function() {
  11027. * return _.toArray(arguments);
  11028. * });
  11029. *
  11030. * flipped('a', 'b', 'c', 'd');
  11031. * // => ['d', 'c', 'b', 'a']
  11032. */
  11033. function flip(func) {
  11034. return createWrap(func, WRAP_FLIP_FLAG);
  11035. }
  11036. /**
  11037. * Creates a function that memoizes the result of `func`. If `resolver` is
  11038. * provided, it determines the cache key for storing the result based on the
  11039. * arguments provided to the memoized function. By default, the first argument
  11040. * provided to the memoized function is used as the map cache key. The `func`
  11041. * is invoked with the `this` binding of the memoized function.
  11042. *
  11043. * **Note:** The cache is exposed as the `cache` property on the memoized
  11044. * function. Its creation may be customized by replacing the `_.memoize.Cache`
  11045. * constructor with one whose instances implement the
  11046. * [`Map`](http://ecma-international.org/ecma-262/7.0/#sec-properties-of-the-map-prototype-object)
  11047. * method interface of `clear`, `delete`, `get`, `has`, and `set`.
  11048. *
  11049. * @static
  11050. * @memberOf _
  11051. * @since 0.1.0
  11052. * @category Function
  11053. * @param {Function} func The function to have its output memoized.
  11054. * @param {Function} [resolver] The function to resolve the cache key.
  11055. * @returns {Function} Returns the new memoized function.
  11056. * @example
  11057. *
  11058. * var object = { 'a': 1, 'b': 2 };
  11059. * var other = { 'c': 3, 'd': 4 };
  11060. *
  11061. * var values = _.memoize(_.values);
  11062. * values(object);
  11063. * // => [1, 2]
  11064. *
  11065. * values(other);
  11066. * // => [3, 4]
  11067. *
  11068. * object.a = 2;
  11069. * values(object);
  11070. * // => [1, 2]
  11071. *
  11072. * // Modify the result cache.
  11073. * values.cache.set(object, ['a', 'b']);
  11074. * values(object);
  11075. * // => ['a', 'b']
  11076. *
  11077. * // Replace `_.memoize.Cache`.
  11078. * _.memoize.Cache = WeakMap;
  11079. */
  11080. function memoize(func, resolver) {
  11081. if (typeof func != 'function' || (resolver != null && typeof resolver != 'function')) {
  11082. throw new TypeError(FUNC_ERROR_TEXT);
  11083. }
  11084. var memoized = function() {
  11085. var args = arguments,
  11086. key = resolver ? resolver.apply(this, args) : args[0],
  11087. cache = memoized.cache;
  11088. if (cache.has(key)) {
  11089. return cache.get(key);
  11090. }
  11091. var result = func.apply(this, args);
  11092. memoized.cache = cache.set(key, result) || cache;
  11093. return result;
  11094. };
  11095. memoized.cache = new (memoize.Cache || MapCache);
  11096. return memoized;
  11097. }
  11098. // Expose `MapCache`.
  11099. memoize.Cache = MapCache;
  11100. /**
  11101. * Creates a function that negates the result of the predicate `func`. The
  11102. * `func` predicate is invoked with the `this` binding and arguments of the
  11103. * created function.
  11104. *
  11105. * @static
  11106. * @memberOf _
  11107. * @since 3.0.0
  11108. * @category Function
  11109. * @param {Function} predicate The predicate to negate.
  11110. * @returns {Function} Returns the new negated function.
  11111. * @example
  11112. *
  11113. * function isEven(n) {
  11114. * return n % 2 == 0;
  11115. * }
  11116. *
  11117. * _.filter([1, 2, 3, 4, 5, 6], _.negate(isEven));
  11118. * // => [1, 3, 5]
  11119. */
  11120. function negate(predicate) {
  11121. if (typeof predicate != 'function') {
  11122. throw new TypeError(FUNC_ERROR_TEXT);
  11123. }
  11124. return function() {
  11125. var args = arguments;
  11126. switch (args.length) {
  11127. case 0: return !predicate.call(this);
  11128. case 1: return !predicate.call(this, args[0]);
  11129. case 2: return !predicate.call(this, args[0], args[1]);
  11130. case 3: return !predicate.call(this, args[0], args[1], args[2]);
  11131. }
  11132. return !predicate.apply(this, args);
  11133. };
  11134. }
  11135. /**
  11136. * Creates a function that is restricted to invoking `func` once. Repeat calls
  11137. * to the function return the value of the first invocation. The `func` is
  11138. * invoked with the `this` binding and arguments of the created function.
  11139. *
  11140. * @static
  11141. * @memberOf _
  11142. * @since 0.1.0
  11143. * @category Function
  11144. * @param {Function} func The function to restrict.
  11145. * @returns {Function} Returns the new restricted function.
  11146. * @example
  11147. *
  11148. * var initialize = _.once(createApplication);
  11149. * initialize();
  11150. * initialize();
  11151. * // => `createApplication` is invoked once
  11152. */
  11153. function once(func) {
  11154. return before(2, func);
  11155. }
  11156. /**
  11157. * Creates a function that invokes `func` with its arguments transformed.
  11158. *
  11159. * @static
  11160. * @since 4.0.0
  11161. * @memberOf _
  11162. * @category Function
  11163. * @param {Function} func The function to wrap.
  11164. * @param {...(Function|Function[])} [transforms=[_.identity]]
  11165. * The argument transforms.
  11166. * @returns {Function} Returns the new function.
  11167. * @example
  11168. *
  11169. * function doubled(n) {
  11170. * return n * 2;
  11171. * }
  11172. *
  11173. * function square(n) {
  11174. * return n * n;
  11175. * }
  11176. *
  11177. * var func = _.overArgs(function(x, y) {
  11178. * return [x, y];
  11179. * }, [square, doubled]);
  11180. *
  11181. * func(9, 3);
  11182. * // => [81, 6]
  11183. *
  11184. * func(10, 5);
  11185. * // => [100, 10]
  11186. */
  11187. var overArgs = castRest(function(func, transforms) {
  11188. transforms = (transforms.length == 1 && isArray(transforms[0]))
  11189. ? arrayMap(transforms[0], baseUnary(getIteratee()))
  11190. : arrayMap(baseFlatten(transforms, 1), baseUnary(getIteratee()));
  11191. var funcsLength = transforms.length;
  11192. return baseRest(function(args) {
  11193. var index = -1,
  11194. length = nativeMin(args.length, funcsLength);
  11195. while (++index < length) {
  11196. args[index] = transforms[index].call(this, args[index]);
  11197. }
  11198. return apply(func, this, args);
  11199. });
  11200. });
  11201. /**
  11202. * Creates a function that invokes `func` with `partials` prepended to the
  11203. * arguments it receives. This method is like `_.bind` except it does **not**
  11204. * alter the `this` binding.
  11205. *
  11206. * The `_.partial.placeholder` value, which defaults to `_` in monolithic
  11207. * builds, may be used as a placeholder for partially applied arguments.
  11208. *
  11209. * **Note:** This method doesn't set the "length" property of partially
  11210. * applied functions.
  11211. *
  11212. * @static
  11213. * @memberOf _
  11214. * @since 0.2.0
  11215. * @category Function
  11216. * @param {Function} func The function to partially apply arguments to.
  11217. * @param {...*} [partials] The arguments to be partially applied.
  11218. * @returns {Function} Returns the new partially applied function.
  11219. * @example
  11220. *
  11221. * function greet(greeting, name) {
  11222. * return greeting + ' ' + name;
  11223. * }
  11224. *
  11225. * var sayHelloTo = _.partial(greet, 'hello');
  11226. * sayHelloTo('fred');
  11227. * // => 'hello fred'
  11228. *
  11229. * // Partially applied with placeholders.
  11230. * var greetFred = _.partial(greet, _, 'fred');
  11231. * greetFred('hi');
  11232. * // => 'hi fred'
  11233. */
  11234. var partial = baseRest(function(func, partials) {
  11235. var holders = replaceHolders(partials, getHolder(partial));
  11236. return createWrap(func, WRAP_PARTIAL_FLAG, undefined, partials, holders);
  11237. });
  11238. /**
  11239. * This method is like `_.partial` except that partially applied arguments
  11240. * are appended to the arguments it receives.
  11241. *
  11242. * The `_.partialRight.placeholder` value, which defaults to `_` in monolithic
  11243. * builds, may be used as a placeholder for partially applied arguments.
  11244. *
  11245. * **Note:** This method doesn't set the "length" property of partially
  11246. * applied functions.
  11247. *
  11248. * @static
  11249. * @memberOf _
  11250. * @since 1.0.0
  11251. * @category Function
  11252. * @param {Function} func The function to partially apply arguments to.
  11253. * @param {...*} [partials] The arguments to be partially applied.
  11254. * @returns {Function} Returns the new partially applied function.
  11255. * @example
  11256. *
  11257. * function greet(greeting, name) {
  11258. * return greeting + ' ' + name;
  11259. * }
  11260. *
  11261. * var greetFred = _.partialRight(greet, 'fred');
  11262. * greetFred('hi');
  11263. * // => 'hi fred'
  11264. *
  11265. * // Partially applied with placeholders.
  11266. * var sayHelloTo = _.partialRight(greet, 'hello', _);
  11267. * sayHelloTo('fred');
  11268. * // => 'hello fred'
  11269. */
  11270. var partialRight = baseRest(function(func, partials) {
  11271. var holders = replaceHolders(partials, getHolder(partialRight));
  11272. return createWrap(func, WRAP_PARTIAL_RIGHT_FLAG, undefined, partials, holders);
  11273. });
  11274. /**
  11275. * Creates a function that invokes `func` with arguments arranged according
  11276. * to the specified `indexes` where the argument value at the first index is
  11277. * provided as the first argument, the argument value at the second index is
  11278. * provided as the second argument, and so on.
  11279. *
  11280. * @static
  11281. * @memberOf _
  11282. * @since 3.0.0
  11283. * @category Function
  11284. * @param {Function} func The function to rearrange arguments for.
  11285. * @param {...(number|number[])} indexes The arranged argument indexes.
  11286. * @returns {Function} Returns the new function.
  11287. * @example
  11288. *
  11289. * var rearged = _.rearg(function(a, b, c) {
  11290. * return [a, b, c];
  11291. * }, [2, 0, 1]);
  11292. *
  11293. * rearged('b', 'c', 'a')
  11294. * // => ['a', 'b', 'c']
  11295. */
  11296. var rearg = flatRest(function(func, indexes) {
  11297. return createWrap(func, WRAP_REARG_FLAG, undefined, undefined, undefined, indexes);
  11298. });
  11299. /**
  11300. * Creates a function that invokes `func` with the `this` binding of the
  11301. * created function and arguments from `start` and beyond provided as
  11302. * an array.
  11303. *
  11304. * **Note:** This method is based on the
  11305. * [rest parameter](https://mdn.io/rest_parameters).
  11306. *
  11307. * @static
  11308. * @memberOf _
  11309. * @since 4.0.0
  11310. * @category Function
  11311. * @param {Function} func The function to apply a rest parameter to.
  11312. * @param {number} [start=func.length-1] The start position of the rest parameter.
  11313. * @returns {Function} Returns the new function.
  11314. * @example
  11315. *
  11316. * var say = _.rest(function(what, names) {
  11317. * return what + ' ' + _.initial(names).join(', ') +
  11318. * (_.size(names) > 1 ? ', & ' : '') + _.last(names);
  11319. * });
  11320. *
  11321. * say('hello', 'fred', 'barney', 'pebbles');
  11322. * // => 'hello fred, barney, & pebbles'
  11323. */
  11324. function rest(func, start) {
  11325. if (typeof func != 'function') {
  11326. throw new TypeError(FUNC_ERROR_TEXT);
  11327. }
  11328. start = start === undefined ? start : toInteger(start);
  11329. return baseRest(func, start);
  11330. }
  11331. /**
  11332. * Creates a function that invokes `func` with the `this` binding of the
  11333. * create function and an array of arguments much like
  11334. * [`Function#apply`](http://www.ecma-international.org/ecma-262/7.0/#sec-function.prototype.apply).
  11335. *
  11336. * **Note:** This method is based on the
  11337. * [spread operator](https://mdn.io/spread_operator).
  11338. *
  11339. * @static
  11340. * @memberOf _
  11341. * @since 3.2.0
  11342. * @category Function
  11343. * @param {Function} func The function to spread arguments over.
  11344. * @param {number} [start=0] The start position of the spread.
  11345. * @returns {Function} Returns the new function.
  11346. * @example
  11347. *
  11348. * var say = _.spread(function(who, what) {
  11349. * return who + ' says ' + what;
  11350. * });
  11351. *
  11352. * say(['fred', 'hello']);
  11353. * // => 'fred says hello'
  11354. *
  11355. * var numbers = Promise.all([
  11356. * Promise.resolve(40),
  11357. * Promise.resolve(36)
  11358. * ]);
  11359. *
  11360. * numbers.then(_.spread(function(x, y) {
  11361. * return x + y;
  11362. * }));
  11363. * // => a Promise of 76
  11364. */
  11365. function spread(func, start) {
  11366. if (typeof func != 'function') {
  11367. throw new TypeError(FUNC_ERROR_TEXT);
  11368. }
  11369. start = start == null ? 0 : nativeMax(toInteger(start), 0);
  11370. return baseRest(function(args) {
  11371. var array = args[start],
  11372. otherArgs = castSlice(args, 0, start);
  11373. if (array) {
  11374. arrayPush(otherArgs, array);
  11375. }
  11376. return apply(func, this, otherArgs);
  11377. });
  11378. }
  11379. /**
  11380. * Creates a throttled function that only invokes `func` at most once per
  11381. * every `wait` milliseconds. The throttled function comes with a `cancel`
  11382. * method to cancel delayed `func` invocations and a `flush` method to
  11383. * immediately invoke them. Provide `options` to indicate whether `func`
  11384. * should be invoked on the leading and/or trailing edge of the `wait`
  11385. * timeout. The `func` is invoked with the last arguments provided to the
  11386. * throttled function. Subsequent calls to the throttled function return the
  11387. * result of the last `func` invocation.
  11388. *
  11389. * **Note:** If `leading` and `trailing` options are `true`, `func` is
  11390. * invoked on the trailing edge of the timeout only if the throttled function
  11391. * is invoked more than once during the `wait` timeout.
  11392. *
  11393. * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred
  11394. * until to the next tick, similar to `setTimeout` with a timeout of `0`.
  11395. *
  11396. * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/)
  11397. * for details over the differences between `_.throttle` and `_.debounce`.
  11398. *
  11399. * @static
  11400. * @memberOf _
  11401. * @since 0.1.0
  11402. * @category Function
  11403. * @param {Function} func The function to throttle.
  11404. * @param {number} [wait=0] The number of milliseconds to throttle invocations to.
  11405. * @param {Object} [options={}] The options object.
  11406. * @param {boolean} [options.leading=true]
  11407. * Specify invoking on the leading edge of the timeout.
  11408. * @param {boolean} [options.trailing=true]
  11409. * Specify invoking on the trailing edge of the timeout.
  11410. * @returns {Function} Returns the new throttled function.
  11411. * @example
  11412. *
  11413. * // Avoid excessively updating the position while scrolling.
  11414. * jQuery(window).on('scroll', _.throttle(updatePosition, 100));
  11415. *
  11416. * // Invoke `renewToken` when the click event is fired, but not more than once every 5 minutes.
  11417. * var throttled = _.throttle(renewToken, 300000, { 'trailing': false });
  11418. * jQuery(element).on('click', throttled);
  11419. *
  11420. * // Cancel the trailing throttled invocation.
  11421. * jQuery(window).on('popstate', throttled.cancel);
  11422. */
  11423. function throttle(func, wait, options) {
  11424. var leading = true,
  11425. trailing = true;
  11426. if (typeof func != 'function') {
  11427. throw new TypeError(FUNC_ERROR_TEXT);
  11428. }
  11429. if (isObject(options)) {
  11430. leading = 'leading' in options ? !!options.leading : leading;
  11431. trailing = 'trailing' in options ? !!options.trailing : trailing;
  11432. }
  11433. return debounce(func, wait, {
  11434. 'leading': leading,
  11435. 'maxWait': wait,
  11436. 'trailing': trailing
  11437. });
  11438. }
  11439. /**
  11440. * Creates a function that accepts up to one argument, ignoring any
  11441. * additional arguments.
  11442. *
  11443. * @static
  11444. * @memberOf _
  11445. * @since 4.0.0
  11446. * @category Function
  11447. * @param {Function} func The function to cap arguments for.
  11448. * @returns {Function} Returns the new capped function.
  11449. * @example
  11450. *
  11451. * _.map(['6', '8', '10'], _.unary(parseInt));
  11452. * // => [6, 8, 10]
  11453. */
  11454. function unary(func) {
  11455. return ary(func, 1);
  11456. }
  11457. /**
  11458. * Creates a function that provides `value` to `wrapper` as its first
  11459. * argument. Any additional arguments provided to the function are appended
  11460. * to those provided to the `wrapper`. The wrapper is invoked with the `this`
  11461. * binding of the created function.
  11462. *
  11463. * @static
  11464. * @memberOf _
  11465. * @since 0.1.0
  11466. * @category Function
  11467. * @param {*} value The value to wrap.
  11468. * @param {Function} [wrapper=identity] The wrapper function.
  11469. * @returns {Function} Returns the new function.
  11470. * @example
  11471. *
  11472. * var p = _.wrap(_.escape, function(func, text) {
  11473. * return '<p>' + func(text) + '</p>';
  11474. * });
  11475. *
  11476. * p('fred, barney, & pebbles');
  11477. * // => '<p>fred, barney, &amp; pebbles</p>'
  11478. */
  11479. function wrap(value, wrapper) {
  11480. return partial(castFunction(wrapper), value);
  11481. }
  11482. /*------------------------------------------------------------------------*/
  11483. /**
  11484. * Casts `value` as an array if it's not one.
  11485. *
  11486. * @static
  11487. * @memberOf _
  11488. * @since 4.4.0
  11489. * @category Lang
  11490. * @param {*} value The value to inspect.
  11491. * @returns {Array} Returns the cast array.
  11492. * @example
  11493. *
  11494. * _.castArray(1);
  11495. * // => [1]
  11496. *
  11497. * _.castArray({ 'a': 1 });
  11498. * // => [{ 'a': 1 }]
  11499. *
  11500. * _.castArray('abc');
  11501. * // => ['abc']
  11502. *
  11503. * _.castArray(null);
  11504. * // => [null]
  11505. *
  11506. * _.castArray(undefined);
  11507. * // => [undefined]
  11508. *
  11509. * _.castArray();
  11510. * // => []
  11511. *
  11512. * var array = [1, 2, 3];
  11513. * console.log(_.castArray(array) === array);
  11514. * // => true
  11515. */
  11516. function castArray() {
  11517. if (!arguments.length) {
  11518. return [];
  11519. }
  11520. var value = arguments[0];
  11521. return isArray(value) ? value : [value];
  11522. }
  11523. /**
  11524. * Creates a shallow clone of `value`.
  11525. *
  11526. * **Note:** This method is loosely based on the
  11527. * [structured clone algorithm](https://mdn.io/Structured_clone_algorithm)
  11528. * and supports cloning arrays, array buffers, booleans, date objects, maps,
  11529. * numbers, `Object` objects, regexes, sets, strings, symbols, and typed
  11530. * arrays. The own enumerable properties of `arguments` objects are cloned
  11531. * as plain objects. An empty object is returned for uncloneable values such
  11532. * as error objects, functions, DOM nodes, and WeakMaps.
  11533. *
  11534. * @static
  11535. * @memberOf _
  11536. * @since 0.1.0
  11537. * @category Lang
  11538. * @param {*} value The value to clone.
  11539. * @returns {*} Returns the cloned value.
  11540. * @see _.cloneDeep
  11541. * @example
  11542. *
  11543. * var objects = [{ 'a': 1 }, { 'b': 2 }];
  11544. *
  11545. * var shallow = _.clone(objects);
  11546. * console.log(shallow[0] === objects[0]);
  11547. * // => true
  11548. */
  11549. function clone(value) {
  11550. return baseClone(value, CLONE_SYMBOLS_FLAG);
  11551. }
  11552. /**
  11553. * This method is like `_.clone` except that it accepts `customizer` which
  11554. * is invoked to produce the cloned value. If `customizer` returns `undefined`,
  11555. * cloning is handled by the method instead. The `customizer` is invoked with
  11556. * up to four arguments; (value [, index|key, object, stack]).
  11557. *
  11558. * @static
  11559. * @memberOf _
  11560. * @since 4.0.0
  11561. * @category Lang
  11562. * @param {*} value The value to clone.
  11563. * @param {Function} [customizer] The function to customize cloning.
  11564. * @returns {*} Returns the cloned value.
  11565. * @see _.cloneDeepWith
  11566. * @example
  11567. *
  11568. * function customizer(value) {
  11569. * if (_.isElement(value)) {
  11570. * return value.cloneNode(false);
  11571. * }
  11572. * }
  11573. *
  11574. * var el = _.cloneWith(document.body, customizer);
  11575. *
  11576. * console.log(el === document.body);
  11577. * // => false
  11578. * console.log(el.nodeName);
  11579. * // => 'BODY'
  11580. * console.log(el.childNodes.length);
  11581. * // => 0
  11582. */
  11583. function cloneWith(value, customizer) {
  11584. customizer = typeof customizer == 'function' ? customizer : undefined;
  11585. return baseClone(value, CLONE_SYMBOLS_FLAG, customizer);
  11586. }
  11587. /**
  11588. * This method is like `_.clone` except that it recursively clones `value`.
  11589. *
  11590. * @static
  11591. * @memberOf _
  11592. * @since 1.0.0
  11593. * @category Lang
  11594. * @param {*} value The value to recursively clone.
  11595. * @returns {*} Returns the deep cloned value.
  11596. * @see _.clone
  11597. * @example
  11598. *
  11599. * var objects = [{ 'a': 1 }, { 'b': 2 }];
  11600. *
  11601. * var deep = _.cloneDeep(objects);
  11602. * console.log(deep[0] === objects[0]);
  11603. * // => false
  11604. */
  11605. function cloneDeep(value) {
  11606. return baseClone(value, CLONE_DEEP_FLAG | CLONE_SYMBOLS_FLAG);
  11607. }
  11608. /**
  11609. * This method is like `_.cloneWith` except that it recursively clones `value`.
  11610. *
  11611. * @static
  11612. * @memberOf _
  11613. * @since 4.0.0
  11614. * @category Lang
  11615. * @param {*} value The value to recursively clone.
  11616. * @param {Function} [customizer] The function to customize cloning.
  11617. * @returns {*} Returns the deep cloned value.
  11618. * @see _.cloneWith
  11619. * @example
  11620. *
  11621. * function customizer(value) {
  11622. * if (_.isElement(value)) {
  11623. * return value.cloneNode(true);
  11624. * }
  11625. * }
  11626. *
  11627. * var el = _.cloneDeepWith(document.body, customizer);
  11628. *
  11629. * console.log(el === document.body);
  11630. * // => false
  11631. * console.log(el.nodeName);
  11632. * // => 'BODY'
  11633. * console.log(el.childNodes.length);
  11634. * // => 20
  11635. */
  11636. function cloneDeepWith(value, customizer) {
  11637. customizer = typeof customizer == 'function' ? customizer : undefined;
  11638. return baseClone(value, CLONE_DEEP_FLAG | CLONE_SYMBOLS_FLAG, customizer);
  11639. }
  11640. /**
  11641. * Checks if `object` conforms to `source` by invoking the predicate
  11642. * properties of `source` with the corresponding property values of `object`.
  11643. *
  11644. * **Note:** This method is equivalent to `_.conforms` when `source` is
  11645. * partially applied.
  11646. *
  11647. * @static
  11648. * @memberOf _
  11649. * @since 4.14.0
  11650. * @category Lang
  11651. * @param {Object} object The object to inspect.
  11652. * @param {Object} source The object of property predicates to conform to.
  11653. * @returns {boolean} Returns `true` if `object` conforms, else `false`.
  11654. * @example
  11655. *
  11656. * var object = { 'a': 1, 'b': 2 };
  11657. *
  11658. * _.conformsTo(object, { 'b': function(n) { return n > 1; } });
  11659. * // => true
  11660. *
  11661. * _.conformsTo(object, { 'b': function(n) { return n > 2; } });
  11662. * // => false
  11663. */
  11664. function conformsTo(object, source) {
  11665. return source == null || baseConformsTo(object, source, keys(source));
  11666. }
  11667. /**
  11668. * Performs a
  11669. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  11670. * comparison between two values to determine if they are equivalent.
  11671. *
  11672. * @static
  11673. * @memberOf _
  11674. * @since 4.0.0
  11675. * @category Lang
  11676. * @param {*} value The value to compare.
  11677. * @param {*} other The other value to compare.
  11678. * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
  11679. * @example
  11680. *
  11681. * var object = { 'a': 1 };
  11682. * var other = { 'a': 1 };
  11683. *
  11684. * _.eq(object, object);
  11685. * // => true
  11686. *
  11687. * _.eq(object, other);
  11688. * // => false
  11689. *
  11690. * _.eq('a', 'a');
  11691. * // => true
  11692. *
  11693. * _.eq('a', Object('a'));
  11694. * // => false
  11695. *
  11696. * _.eq(NaN, NaN);
  11697. * // => true
  11698. */
  11699. function eq(value, other) {
  11700. return value === other || (value !== value && other !== other);
  11701. }
  11702. /**
  11703. * Checks if `value` is greater than `other`.
  11704. *
  11705. * @static
  11706. * @memberOf _
  11707. * @since 3.9.0
  11708. * @category Lang
  11709. * @param {*} value The value to compare.
  11710. * @param {*} other The other value to compare.
  11711. * @returns {boolean} Returns `true` if `value` is greater than `other`,
  11712. * else `false`.
  11713. * @see _.lt
  11714. * @example
  11715. *
  11716. * _.gt(3, 1);
  11717. * // => true
  11718. *
  11719. * _.gt(3, 3);
  11720. * // => false
  11721. *
  11722. * _.gt(1, 3);
  11723. * // => false
  11724. */
  11725. var gt = createRelationalOperation(baseGt);
  11726. /**
  11727. * Checks if `value` is greater than or equal to `other`.
  11728. *
  11729. * @static
  11730. * @memberOf _
  11731. * @since 3.9.0
  11732. * @category Lang
  11733. * @param {*} value The value to compare.
  11734. * @param {*} other The other value to compare.
  11735. * @returns {boolean} Returns `true` if `value` is greater than or equal to
  11736. * `other`, else `false`.
  11737. * @see _.lte
  11738. * @example
  11739. *
  11740. * _.gte(3, 1);
  11741. * // => true
  11742. *
  11743. * _.gte(3, 3);
  11744. * // => true
  11745. *
  11746. * _.gte(1, 3);
  11747. * // => false
  11748. */
  11749. var gte = createRelationalOperation(function(value, other) {
  11750. return value >= other;
  11751. });
  11752. /**
  11753. * Checks if `value` is likely an `arguments` object.
  11754. *
  11755. * @static
  11756. * @memberOf _
  11757. * @since 0.1.0
  11758. * @category Lang
  11759. * @param {*} value The value to check.
  11760. * @returns {boolean} Returns `true` if `value` is an `arguments` object,
  11761. * else `false`.
  11762. * @example
  11763. *
  11764. * _.isArguments(function() { return arguments; }());
  11765. * // => true
  11766. *
  11767. * _.isArguments([1, 2, 3]);
  11768. * // => false
  11769. */
  11770. var isArguments = baseIsArguments(function() { return arguments; }()) ? baseIsArguments : function(value) {
  11771. return isObjectLike(value) && hasOwnProperty.call(value, 'callee') &&
  11772. !propertyIsEnumerable.call(value, 'callee');
  11773. };
  11774. /**
  11775. * Checks if `value` is classified as an `Array` object.
  11776. *
  11777. * @static
  11778. * @memberOf _
  11779. * @since 0.1.0
  11780. * @category Lang
  11781. * @param {*} value The value to check.
  11782. * @returns {boolean} Returns `true` if `value` is an array, else `false`.
  11783. * @example
  11784. *
  11785. * _.isArray([1, 2, 3]);
  11786. * // => true
  11787. *
  11788. * _.isArray(document.body.children);
  11789. * // => false
  11790. *
  11791. * _.isArray('abc');
  11792. * // => false
  11793. *
  11794. * _.isArray(_.noop);
  11795. * // => false
  11796. */
  11797. var isArray = Array.isArray;
  11798. /**
  11799. * Checks if `value` is classified as an `ArrayBuffer` object.
  11800. *
  11801. * @static
  11802. * @memberOf _
  11803. * @since 4.3.0
  11804. * @category Lang
  11805. * @param {*} value The value to check.
  11806. * @returns {boolean} Returns `true` if `value` is an array buffer, else `false`.
  11807. * @example
  11808. *
  11809. * _.isArrayBuffer(new ArrayBuffer(2));
  11810. * // => true
  11811. *
  11812. * _.isArrayBuffer(new Array(2));
  11813. * // => false
  11814. */
  11815. var isArrayBuffer = nodeIsArrayBuffer ? baseUnary(nodeIsArrayBuffer) : baseIsArrayBuffer;
  11816. /**
  11817. * Checks if `value` is array-like. A value is considered array-like if it's
  11818. * not a function and has a `value.length` that's an integer greater than or
  11819. * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`.
  11820. *
  11821. * @static
  11822. * @memberOf _
  11823. * @since 4.0.0
  11824. * @category Lang
  11825. * @param {*} value The value to check.
  11826. * @returns {boolean} Returns `true` if `value` is array-like, else `false`.
  11827. * @example
  11828. *
  11829. * _.isArrayLike([1, 2, 3]);
  11830. * // => true
  11831. *
  11832. * _.isArrayLike(document.body.children);
  11833. * // => true
  11834. *
  11835. * _.isArrayLike('abc');
  11836. * // => true
  11837. *
  11838. * _.isArrayLike(_.noop);
  11839. * // => false
  11840. */
  11841. function isArrayLike(value) {
  11842. return value != null && isLength(value.length) && !isFunction(value);
  11843. }
  11844. /**
  11845. * This method is like `_.isArrayLike` except that it also checks if `value`
  11846. * is an object.
  11847. *
  11848. * @static
  11849. * @memberOf _
  11850. * @since 4.0.0
  11851. * @category Lang
  11852. * @param {*} value The value to check.
  11853. * @returns {boolean} Returns `true` if `value` is an array-like object,
  11854. * else `false`.
  11855. * @example
  11856. *
  11857. * _.isArrayLikeObject([1, 2, 3]);
  11858. * // => true
  11859. *
  11860. * _.isArrayLikeObject(document.body.children);
  11861. * // => true
  11862. *
  11863. * _.isArrayLikeObject('abc');
  11864. * // => false
  11865. *
  11866. * _.isArrayLikeObject(_.noop);
  11867. * // => false
  11868. */
  11869. function isArrayLikeObject(value) {
  11870. return isObjectLike(value) && isArrayLike(value);
  11871. }
  11872. /**
  11873. * Checks if `value` is classified as a boolean primitive or object.
  11874. *
  11875. * @static
  11876. * @memberOf _
  11877. * @since 0.1.0
  11878. * @category Lang
  11879. * @param {*} value The value to check.
  11880. * @returns {boolean} Returns `true` if `value` is a boolean, else `false`.
  11881. * @example
  11882. *
  11883. * _.isBoolean(false);
  11884. * // => true
  11885. *
  11886. * _.isBoolean(null);
  11887. * // => false
  11888. */
  11889. function isBoolean(value) {
  11890. return value === true || value === false ||
  11891. (isObjectLike(value) && baseGetTag(value) == boolTag);
  11892. }
  11893. /**
  11894. * Checks if `value` is a buffer.
  11895. *
  11896. * @static
  11897. * @memberOf _
  11898. * @since 4.3.0
  11899. * @category Lang
  11900. * @param {*} value The value to check.
  11901. * @returns {boolean} Returns `true` if `value` is a buffer, else `false`.
  11902. * @example
  11903. *
  11904. * _.isBuffer(new Buffer(2));
  11905. * // => true
  11906. *
  11907. * _.isBuffer(new Uint8Array(2));
  11908. * // => false
  11909. */
  11910. var isBuffer = nativeIsBuffer || stubFalse;
  11911. /**
  11912. * Checks if `value` is classified as a `Date` object.
  11913. *
  11914. * @static
  11915. * @memberOf _
  11916. * @since 0.1.0
  11917. * @category Lang
  11918. * @param {*} value The value to check.
  11919. * @returns {boolean} Returns `true` if `value` is a date object, else `false`.
  11920. * @example
  11921. *
  11922. * _.isDate(new Date);
  11923. * // => true
  11924. *
  11925. * _.isDate('Mon April 23 2012');
  11926. * // => false
  11927. */
  11928. var isDate = nodeIsDate ? baseUnary(nodeIsDate) : baseIsDate;
  11929. /**
  11930. * Checks if `value` is likely a DOM element.
  11931. *
  11932. * @static
  11933. * @memberOf _
  11934. * @since 0.1.0
  11935. * @category Lang
  11936. * @param {*} value The value to check.
  11937. * @returns {boolean} Returns `true` if `value` is a DOM element, else `false`.
  11938. * @example
  11939. *
  11940. * _.isElement(document.body);
  11941. * // => true
  11942. *
  11943. * _.isElement('<body>');
  11944. * // => false
  11945. */
  11946. function isElement(value) {
  11947. return isObjectLike(value) && value.nodeType === 1 && !isPlainObject(value);
  11948. }
  11949. /**
  11950. * Checks if `value` is an empty object, collection, map, or set.
  11951. *
  11952. * Objects are considered empty if they have no own enumerable string keyed
  11953. * properties.
  11954. *
  11955. * Array-like values such as `arguments` objects, arrays, buffers, strings, or
  11956. * jQuery-like collections are considered empty if they have a `length` of `0`.
  11957. * Similarly, maps and sets are considered empty if they have a `size` of `0`.
  11958. *
  11959. * @static
  11960. * @memberOf _
  11961. * @since 0.1.0
  11962. * @category Lang
  11963. * @param {*} value The value to check.
  11964. * @returns {boolean} Returns `true` if `value` is empty, else `false`.
  11965. * @example
  11966. *
  11967. * _.isEmpty(null);
  11968. * // => true
  11969. *
  11970. * _.isEmpty(true);
  11971. * // => true
  11972. *
  11973. * _.isEmpty(1);
  11974. * // => true
  11975. *
  11976. * _.isEmpty([1, 2, 3]);
  11977. * // => false
  11978. *
  11979. * _.isEmpty({ 'a': 1 });
  11980. * // => false
  11981. */
  11982. function isEmpty(value) {
  11983. if (value == null) {
  11984. return true;
  11985. }
  11986. if (isArrayLike(value) &&
  11987. (isArray(value) || typeof value == 'string' || typeof value.splice == 'function' ||
  11988. isBuffer(value) || isTypedArray(value) || isArguments(value))) {
  11989. return !value.length;
  11990. }
  11991. var tag = getTag(value);
  11992. if (tag == mapTag || tag == setTag) {
  11993. return !value.size;
  11994. }
  11995. if (isPrototype(value)) {
  11996. return !baseKeys(value).length;
  11997. }
  11998. for (var key in value) {
  11999. if (hasOwnProperty.call(value, key)) {
  12000. return false;
  12001. }
  12002. }
  12003. return true;
  12004. }
  12005. /**
  12006. * Performs a deep comparison between two values to determine if they are
  12007. * equivalent.
  12008. *
  12009. * **Note:** This method supports comparing arrays, array buffers, booleans,
  12010. * date objects, error objects, maps, numbers, `Object` objects, regexes,
  12011. * sets, strings, symbols, and typed arrays. `Object` objects are compared
  12012. * by their own, not inherited, enumerable properties. Functions and DOM
  12013. * nodes are compared by strict equality, i.e. `===`.
  12014. *
  12015. * @static
  12016. * @memberOf _
  12017. * @since 0.1.0
  12018. * @category Lang
  12019. * @param {*} value The value to compare.
  12020. * @param {*} other The other value to compare.
  12021. * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
  12022. * @example
  12023. *
  12024. * var object = { 'a': 1 };
  12025. * var other = { 'a': 1 };
  12026. *
  12027. * _.isEqual(object, other);
  12028. * // => true
  12029. *
  12030. * object === other;
  12031. * // => false
  12032. */
  12033. function isEqual(value, other) {
  12034. return baseIsEqual(value, other);
  12035. }
  12036. /**
  12037. * This method is like `_.isEqual` except that it accepts `customizer` which
  12038. * is invoked to compare values. If `customizer` returns `undefined`, comparisons
  12039. * are handled by the method instead. The `customizer` is invoked with up to
  12040. * six arguments: (objValue, othValue [, index|key, object, other, stack]).
  12041. *
  12042. * @static
  12043. * @memberOf _
  12044. * @since 4.0.0
  12045. * @category Lang
  12046. * @param {*} value The value to compare.
  12047. * @param {*} other The other value to compare.
  12048. * @param {Function} [customizer] The function to customize comparisons.
  12049. * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
  12050. * @example
  12051. *
  12052. * function isGreeting(value) {
  12053. * return /^h(?:i|ello)$/.test(value);
  12054. * }
  12055. *
  12056. * function customizer(objValue, othValue) {
  12057. * if (isGreeting(objValue) && isGreeting(othValue)) {
  12058. * return true;
  12059. * }
  12060. * }
  12061. *
  12062. * var array = ['hello', 'goodbye'];
  12063. * var other = ['hi', 'goodbye'];
  12064. *
  12065. * _.isEqualWith(array, other, customizer);
  12066. * // => true
  12067. */
  12068. function isEqualWith(value, other, customizer) {
  12069. customizer = typeof customizer == 'function' ? customizer : undefined;
  12070. var result = customizer ? customizer(value, other) : undefined;
  12071. return result === undefined ? baseIsEqual(value, other, undefined, customizer) : !!result;
  12072. }
  12073. /**
  12074. * Checks if `value` is an `Error`, `EvalError`, `RangeError`, `ReferenceError`,
  12075. * `SyntaxError`, `TypeError`, or `URIError` object.
  12076. *
  12077. * @static
  12078. * @memberOf _
  12079. * @since 3.0.0
  12080. * @category Lang
  12081. * @param {*} value The value to check.
  12082. * @returns {boolean} Returns `true` if `value` is an error object, else `false`.
  12083. * @example
  12084. *
  12085. * _.isError(new Error);
  12086. * // => true
  12087. *
  12088. * _.isError(Error);
  12089. * // => false
  12090. */
  12091. function isError(value) {
  12092. if (!isObjectLike(value)) {
  12093. return false;
  12094. }
  12095. var tag = baseGetTag(value);
  12096. return tag == errorTag || tag == domExcTag ||
  12097. (typeof value.message == 'string' && typeof value.name == 'string' && !isPlainObject(value));
  12098. }
  12099. /**
  12100. * Checks if `value` is a finite primitive number.
  12101. *
  12102. * **Note:** This method is based on
  12103. * [`Number.isFinite`](https://mdn.io/Number/isFinite).
  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 finite number, else `false`.
  12111. * @example
  12112. *
  12113. * _.isFinite(3);
  12114. * // => true
  12115. *
  12116. * _.isFinite(Number.MIN_VALUE);
  12117. * // => true
  12118. *
  12119. * _.isFinite(Infinity);
  12120. * // => false
  12121. *
  12122. * _.isFinite('3');
  12123. * // => false
  12124. */
  12125. function isFinite(value) {
  12126. return typeof value == 'number' && nativeIsFinite(value);
  12127. }
  12128. /**
  12129. * Checks if `value` is classified as a `Function` object.
  12130. *
  12131. * @static
  12132. * @memberOf _
  12133. * @since 0.1.0
  12134. * @category Lang
  12135. * @param {*} value The value to check.
  12136. * @returns {boolean} Returns `true` if `value` is a function, else `false`.
  12137. * @example
  12138. *
  12139. * _.isFunction(_);
  12140. * // => true
  12141. *
  12142. * _.isFunction(/abc/);
  12143. * // => false
  12144. */
  12145. function isFunction(value) {
  12146. if (!isObject(value)) {
  12147. return false;
  12148. }
  12149. // The use of `Object#toString` avoids issues with the `typeof` operator
  12150. // in Safari 9 which returns 'object' for typed arrays and other constructors.
  12151. var tag = baseGetTag(value);
  12152. return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag;
  12153. }
  12154. /**
  12155. * Checks if `value` is an integer.
  12156. *
  12157. * **Note:** This method is based on
  12158. * [`Number.isInteger`](https://mdn.io/Number/isInteger).
  12159. *
  12160. * @static
  12161. * @memberOf _
  12162. * @since 4.0.0
  12163. * @category Lang
  12164. * @param {*} value The value to check.
  12165. * @returns {boolean} Returns `true` if `value` is an integer, else `false`.
  12166. * @example
  12167. *
  12168. * _.isInteger(3);
  12169. * // => true
  12170. *
  12171. * _.isInteger(Number.MIN_VALUE);
  12172. * // => false
  12173. *
  12174. * _.isInteger(Infinity);
  12175. * // => false
  12176. *
  12177. * _.isInteger('3');
  12178. * // => false
  12179. */
  12180. function isInteger(value) {
  12181. return typeof value == 'number' && value == toInteger(value);
  12182. }
  12183. /**
  12184. * Checks if `value` is a valid array-like length.
  12185. *
  12186. * **Note:** This method is loosely based on
  12187. * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).
  12188. *
  12189. * @static
  12190. * @memberOf _
  12191. * @since 4.0.0
  12192. * @category Lang
  12193. * @param {*} value The value to check.
  12194. * @returns {boolean} Returns `true` if `value` is a valid length, else `false`.
  12195. * @example
  12196. *
  12197. * _.isLength(3);
  12198. * // => true
  12199. *
  12200. * _.isLength(Number.MIN_VALUE);
  12201. * // => false
  12202. *
  12203. * _.isLength(Infinity);
  12204. * // => false
  12205. *
  12206. * _.isLength('3');
  12207. * // => false
  12208. */
  12209. function isLength(value) {
  12210. return typeof value == 'number' &&
  12211. value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;
  12212. }
  12213. /**
  12214. * Checks if `value` is the
  12215. * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)
  12216. * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
  12217. *
  12218. * @static
  12219. * @memberOf _
  12220. * @since 0.1.0
  12221. * @category Lang
  12222. * @param {*} value The value to check.
  12223. * @returns {boolean} Returns `true` if `value` is an object, else `false`.
  12224. * @example
  12225. *
  12226. * _.isObject({});
  12227. * // => true
  12228. *
  12229. * _.isObject([1, 2, 3]);
  12230. * // => true
  12231. *
  12232. * _.isObject(_.noop);
  12233. * // => true
  12234. *
  12235. * _.isObject(null);
  12236. * // => false
  12237. */
  12238. function isObject(value) {
  12239. var type = typeof value;
  12240. return value != null && (type == 'object' || type == 'function');
  12241. }
  12242. /**
  12243. * Checks if `value` is object-like. A value is object-like if it's not `null`
  12244. * and has a `typeof` result of "object".
  12245. *
  12246. * @static
  12247. * @memberOf _
  12248. * @since 4.0.0
  12249. * @category Lang
  12250. * @param {*} value The value to check.
  12251. * @returns {boolean} Returns `true` if `value` is object-like, else `false`.
  12252. * @example
  12253. *
  12254. * _.isObjectLike({});
  12255. * // => true
  12256. *
  12257. * _.isObjectLike([1, 2, 3]);
  12258. * // => true
  12259. *
  12260. * _.isObjectLike(_.noop);
  12261. * // => false
  12262. *
  12263. * _.isObjectLike(null);
  12264. * // => false
  12265. */
  12266. function isObjectLike(value) {
  12267. return value != null && typeof value == 'object';
  12268. }
  12269. /**
  12270. * Checks if `value` is classified as a `Map` object.
  12271. *
  12272. * @static
  12273. * @memberOf _
  12274. * @since 4.3.0
  12275. * @category Lang
  12276. * @param {*} value The value to check.
  12277. * @returns {boolean} Returns `true` if `value` is a map, else `false`.
  12278. * @example
  12279. *
  12280. * _.isMap(new Map);
  12281. * // => true
  12282. *
  12283. * _.isMap(new WeakMap);
  12284. * // => false
  12285. */
  12286. var isMap = nodeIsMap ? baseUnary(nodeIsMap) : baseIsMap;
  12287. /**
  12288. * Performs a partial deep comparison between `object` and `source` to
  12289. * determine if `object` contains equivalent property values.
  12290. *
  12291. * **Note:** This method is equivalent to `_.matches` when `source` is
  12292. * partially applied.
  12293. *
  12294. * Partial comparisons will match empty array and empty object `source`
  12295. * values against any array or object value, respectively. See `_.isEqual`
  12296. * for a list of supported value comparisons.
  12297. *
  12298. * @static
  12299. * @memberOf _
  12300. * @since 3.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. * @returns {boolean} Returns `true` if `object` is a match, else `false`.
  12305. * @example
  12306. *
  12307. * var object = { 'a': 1, 'b': 2 };
  12308. *
  12309. * _.isMatch(object, { 'b': 2 });
  12310. * // => true
  12311. *
  12312. * _.isMatch(object, { 'b': 1 });
  12313. * // => false
  12314. */
  12315. function isMatch(object, source) {
  12316. return object === source || baseIsMatch(object, source, getMatchData(source));
  12317. }
  12318. /**
  12319. * This method is like `_.isMatch` except that it accepts `customizer` which
  12320. * is invoked to compare values. If `customizer` returns `undefined`, comparisons
  12321. * are handled by the method instead. The `customizer` is invoked with five
  12322. * arguments: (objValue, srcValue, index|key, object, source).
  12323. *
  12324. * @static
  12325. * @memberOf _
  12326. * @since 4.0.0
  12327. * @category Lang
  12328. * @param {Object} object The object to inspect.
  12329. * @param {Object} source The object of property values to match.
  12330. * @param {Function} [customizer] The function to customize comparisons.
  12331. * @returns {boolean} Returns `true` if `object` is a match, else `false`.
  12332. * @example
  12333. *
  12334. * function isGreeting(value) {
  12335. * return /^h(?:i|ello)$/.test(value);
  12336. * }
  12337. *
  12338. * function customizer(objValue, srcValue) {
  12339. * if (isGreeting(objValue) && isGreeting(srcValue)) {
  12340. * return true;
  12341. * }
  12342. * }
  12343. *
  12344. * var object = { 'greeting': 'hello' };
  12345. * var source = { 'greeting': 'hi' };
  12346. *
  12347. * _.isMatchWith(object, source, customizer);
  12348. * // => true
  12349. */
  12350. function isMatchWith(object, source, customizer) {
  12351. customizer = typeof customizer == 'function' ? customizer : undefined;
  12352. return baseIsMatch(object, source, getMatchData(source), customizer);
  12353. }
  12354. /**
  12355. * Checks if `value` is `NaN`.
  12356. *
  12357. * **Note:** This method is based on
  12358. * [`Number.isNaN`](https://mdn.io/Number/isNaN) and is not the same as
  12359. * global [`isNaN`](https://mdn.io/isNaN) which returns `true` for
  12360. * `undefined` and other non-number values.
  12361. *
  12362. * @static
  12363. * @memberOf _
  12364. * @since 0.1.0
  12365. * @category Lang
  12366. * @param {*} value The value to check.
  12367. * @returns {boolean} Returns `true` if `value` is `NaN`, else `false`.
  12368. * @example
  12369. *
  12370. * _.isNaN(NaN);
  12371. * // => true
  12372. *
  12373. * _.isNaN(new Number(NaN));
  12374. * // => true
  12375. *
  12376. * isNaN(undefined);
  12377. * // => true
  12378. *
  12379. * _.isNaN(undefined);
  12380. * // => false
  12381. */
  12382. function isNaN(value) {
  12383. // An `NaN` primitive is the only value that is not equal to itself.
  12384. // Perform the `toStringTag` check first to avoid errors with some
  12385. // ActiveX objects in IE.
  12386. return isNumber(value) && value != +value;
  12387. }
  12388. /**
  12389. * Checks if `value` is a pristine native function.
  12390. *
  12391. * **Note:** This method can't reliably detect native functions in the presence
  12392. * of the core-js package because core-js circumvents this kind of detection.
  12393. * Despite multiple requests, the core-js maintainer has made it clear: any
  12394. * attempt to fix the detection will be obstructed. As a result, we're left
  12395. * with little choice but to throw an error. Unfortunately, this also affects
  12396. * packages, like [babel-polyfill](https://www.npmjs.com/package/babel-polyfill),
  12397. * which rely on core-js.
  12398. *
  12399. * @static
  12400. * @memberOf _
  12401. * @since 3.0.0
  12402. * @category Lang
  12403. * @param {*} value The value to check.
  12404. * @returns {boolean} Returns `true` if `value` is a native function,
  12405. * else `false`.
  12406. * @example
  12407. *
  12408. * _.isNative(Array.prototype.push);
  12409. * // => true
  12410. *
  12411. * _.isNative(_);
  12412. * // => false
  12413. */
  12414. function isNative(value) {
  12415. if (isMaskable(value)) {
  12416. throw new Error(CORE_ERROR_TEXT);
  12417. }
  12418. return baseIsNative(value);
  12419. }
  12420. /**
  12421. * Checks if `value` is `null`.
  12422. *
  12423. * @static
  12424. * @memberOf _
  12425. * @since 0.1.0
  12426. * @category Lang
  12427. * @param {*} value The value to check.
  12428. * @returns {boolean} Returns `true` if `value` is `null`, else `false`.
  12429. * @example
  12430. *
  12431. * _.isNull(null);
  12432. * // => true
  12433. *
  12434. * _.isNull(void 0);
  12435. * // => false
  12436. */
  12437. function isNull(value) {
  12438. return value === null;
  12439. }
  12440. /**
  12441. * Checks if `value` is `null` or `undefined`.
  12442. *
  12443. * @static
  12444. * @memberOf _
  12445. * @since 4.0.0
  12446. * @category Lang
  12447. * @param {*} value The value to check.
  12448. * @returns {boolean} Returns `true` if `value` is nullish, else `false`.
  12449. * @example
  12450. *
  12451. * _.isNil(null);
  12452. * // => true
  12453. *
  12454. * _.isNil(void 0);
  12455. * // => true
  12456. *
  12457. * _.isNil(NaN);
  12458. * // => false
  12459. */
  12460. function isNil(value) {
  12461. return value == null;
  12462. }
  12463. /**
  12464. * Checks if `value` is classified as a `Number` primitive or object.
  12465. *
  12466. * **Note:** To exclude `Infinity`, `-Infinity`, and `NaN`, which are
  12467. * classified as numbers, use the `_.isFinite` method.
  12468. *
  12469. * @static
  12470. * @memberOf _
  12471. * @since 0.1.0
  12472. * @category Lang
  12473. * @param {*} value The value to check.
  12474. * @returns {boolean} Returns `true` if `value` is a number, else `false`.
  12475. * @example
  12476. *
  12477. * _.isNumber(3);
  12478. * // => true
  12479. *
  12480. * _.isNumber(Number.MIN_VALUE);
  12481. * // => true
  12482. *
  12483. * _.isNumber(Infinity);
  12484. * // => true
  12485. *
  12486. * _.isNumber('3');
  12487. * // => false
  12488. */
  12489. function isNumber(value) {
  12490. return typeof value == 'number' ||
  12491. (isObjectLike(value) && baseGetTag(value) == numberTag);
  12492. }
  12493. /**
  12494. * Checks if `value` is a plain object, that is, an object created by the
  12495. * `Object` constructor or one with a `[[Prototype]]` of `null`.
  12496. *
  12497. * @static
  12498. * @memberOf _
  12499. * @since 0.8.0
  12500. * @category Lang
  12501. * @param {*} value The value to check.
  12502. * @returns {boolean} Returns `true` if `value` is a plain object, else `false`.
  12503. * @example
  12504. *
  12505. * function Foo() {
  12506. * this.a = 1;
  12507. * }
  12508. *
  12509. * _.isPlainObject(new Foo);
  12510. * // => false
  12511. *
  12512. * _.isPlainObject([1, 2, 3]);
  12513. * // => false
  12514. *
  12515. * _.isPlainObject({ 'x': 0, 'y': 0 });
  12516. * // => true
  12517. *
  12518. * _.isPlainObject(Object.create(null));
  12519. * // => true
  12520. */
  12521. function isPlainObject(value) {
  12522. if (!isObjectLike(value) || baseGetTag(value) != objectTag) {
  12523. return false;
  12524. }
  12525. var proto = getPrototype(value);
  12526. if (proto === null) {
  12527. return true;
  12528. }
  12529. var Ctor = hasOwnProperty.call(proto, 'constructor') && proto.constructor;
  12530. return typeof Ctor == 'function' && Ctor instanceof Ctor &&
  12531. funcToString.call(Ctor) == objectCtorString;
  12532. }
  12533. /**
  12534. * Checks if `value` is classified as a `RegExp` object.
  12535. *
  12536. * @static
  12537. * @memberOf _
  12538. * @since 0.1.0
  12539. * @category Lang
  12540. * @param {*} value The value to check.
  12541. * @returns {boolean} Returns `true` if `value` is a regexp, else `false`.
  12542. * @example
  12543. *
  12544. * _.isRegExp(/abc/);
  12545. * // => true
  12546. *
  12547. * _.isRegExp('/abc/');
  12548. * // => false
  12549. */
  12550. var isRegExp = nodeIsRegExp ? baseUnary(nodeIsRegExp) : baseIsRegExp;
  12551. /**
  12552. * Checks if `value` is a safe integer. An integer is safe if it's an IEEE-754
  12553. * double precision number which isn't the result of a rounded unsafe integer.
  12554. *
  12555. * **Note:** This method is based on
  12556. * [`Number.isSafeInteger`](https://mdn.io/Number/isSafeInteger).
  12557. *
  12558. * @static
  12559. * @memberOf _
  12560. * @since 4.0.0
  12561. * @category Lang
  12562. * @param {*} value The value to check.
  12563. * @returns {boolean} Returns `true` if `value` is a safe integer, else `false`.
  12564. * @example
  12565. *
  12566. * _.isSafeInteger(3);
  12567. * // => true
  12568. *
  12569. * _.isSafeInteger(Number.MIN_VALUE);
  12570. * // => false
  12571. *
  12572. * _.isSafeInteger(Infinity);
  12573. * // => false
  12574. *
  12575. * _.isSafeInteger('3');
  12576. * // => false
  12577. */
  12578. function isSafeInteger(value) {
  12579. return isInteger(value) && value >= -MAX_SAFE_INTEGER && value <= MAX_SAFE_INTEGER;
  12580. }
  12581. /**
  12582. * Checks if `value` is classified as a `Set` object.
  12583. *
  12584. * @static
  12585. * @memberOf _
  12586. * @since 4.3.0
  12587. * @category Lang
  12588. * @param {*} value The value to check.
  12589. * @returns {boolean} Returns `true` if `value` is a set, else `false`.
  12590. * @example
  12591. *
  12592. * _.isSet(new Set);
  12593. * // => true
  12594. *
  12595. * _.isSet(new WeakSet);
  12596. * // => false
  12597. */
  12598. var isSet = nodeIsSet ? baseUnary(nodeIsSet) : baseIsSet;
  12599. /**
  12600. * Checks if `value` is classified as a `String` primitive or object.
  12601. *
  12602. * @static
  12603. * @since 0.1.0
  12604. * @memberOf _
  12605. * @category Lang
  12606. * @param {*} value The value to check.
  12607. * @returns {boolean} Returns `true` if `value` is a string, else `false`.
  12608. * @example
  12609. *
  12610. * _.isString('abc');
  12611. * // => true
  12612. *
  12613. * _.isString(1);
  12614. * // => false
  12615. */
  12616. function isString(value) {
  12617. return typeof value == 'string' ||
  12618. (!isArray(value) && isObjectLike(value) && baseGetTag(value) == stringTag);
  12619. }
  12620. /**
  12621. * Checks if `value` is classified as a `Symbol` primitive or object.
  12622. *
  12623. * @static
  12624. * @memberOf _
  12625. * @since 4.0.0
  12626. * @category Lang
  12627. * @param {*} value The value to check.
  12628. * @returns {boolean} Returns `true` if `value` is a symbol, else `false`.
  12629. * @example
  12630. *
  12631. * _.isSymbol(Symbol.iterator);
  12632. * // => true
  12633. *
  12634. * _.isSymbol('abc');
  12635. * // => false
  12636. */
  12637. function isSymbol(value) {
  12638. return typeof value == 'symbol' ||
  12639. (isObjectLike(value) && baseGetTag(value) == symbolTag);
  12640. }
  12641. /**
  12642. * Checks if `value` is classified as a typed array.
  12643. *
  12644. * @static
  12645. * @memberOf _
  12646. * @since 3.0.0
  12647. * @category Lang
  12648. * @param {*} value The value to check.
  12649. * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.
  12650. * @example
  12651. *
  12652. * _.isTypedArray(new Uint8Array);
  12653. * // => true
  12654. *
  12655. * _.isTypedArray([]);
  12656. * // => false
  12657. */
  12658. var isTypedArray = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray;
  12659. /**
  12660. * Checks if `value` is `undefined`.
  12661. *
  12662. * @static
  12663. * @since 0.1.0
  12664. * @memberOf _
  12665. * @category Lang
  12666. * @param {*} value The value to check.
  12667. * @returns {boolean} Returns `true` if `value` is `undefined`, else `false`.
  12668. * @example
  12669. *
  12670. * _.isUndefined(void 0);
  12671. * // => true
  12672. *
  12673. * _.isUndefined(null);
  12674. * // => false
  12675. */
  12676. function isUndefined(value) {
  12677. return value === undefined;
  12678. }
  12679. /**
  12680. * Checks if `value` is classified as a `WeakMap` object.
  12681. *
  12682. * @static
  12683. * @memberOf _
  12684. * @since 4.3.0
  12685. * @category Lang
  12686. * @param {*} value The value to check.
  12687. * @returns {boolean} Returns `true` if `value` is a weak map, else `false`.
  12688. * @example
  12689. *
  12690. * _.isWeakMap(new WeakMap);
  12691. * // => true
  12692. *
  12693. * _.isWeakMap(new Map);
  12694. * // => false
  12695. */
  12696. function isWeakMap(value) {
  12697. return isObjectLike(value) && getTag(value) == weakMapTag;
  12698. }
  12699. /**
  12700. * Checks if `value` is classified as a `WeakSet` object.
  12701. *
  12702. * @static
  12703. * @memberOf _
  12704. * @since 4.3.0
  12705. * @category Lang
  12706. * @param {*} value The value to check.
  12707. * @returns {boolean} Returns `true` if `value` is a weak set, else `false`.
  12708. * @example
  12709. *
  12710. * _.isWeakSet(new WeakSet);
  12711. * // => true
  12712. *
  12713. * _.isWeakSet(new Set);
  12714. * // => false
  12715. */
  12716. function isWeakSet(value) {
  12717. return isObjectLike(value) && baseGetTag(value) == weakSetTag;
  12718. }
  12719. /**
  12720. * Checks if `value` is less than `other`.
  12721. *
  12722. * @static
  12723. * @memberOf _
  12724. * @since 3.9.0
  12725. * @category Lang
  12726. * @param {*} value The value to compare.
  12727. * @param {*} other The other value to compare.
  12728. * @returns {boolean} Returns `true` if `value` is less than `other`,
  12729. * else `false`.
  12730. * @see _.gt
  12731. * @example
  12732. *
  12733. * _.lt(1, 3);
  12734. * // => true
  12735. *
  12736. * _.lt(3, 3);
  12737. * // => false
  12738. *
  12739. * _.lt(3, 1);
  12740. * // => false
  12741. */
  12742. var lt = createRelationalOperation(baseLt);
  12743. /**
  12744. * Checks if `value` is less than or equal to `other`.
  12745. *
  12746. * @static
  12747. * @memberOf _
  12748. * @since 3.9.0
  12749. * @category Lang
  12750. * @param {*} value The value to compare.
  12751. * @param {*} other The other value to compare.
  12752. * @returns {boolean} Returns `true` if `value` is less than or equal to
  12753. * `other`, else `false`.
  12754. * @see _.gte
  12755. * @example
  12756. *
  12757. * _.lte(1, 3);
  12758. * // => true
  12759. *
  12760. * _.lte(3, 3);
  12761. * // => true
  12762. *
  12763. * _.lte(3, 1);
  12764. * // => false
  12765. */
  12766. var lte = createRelationalOperation(function(value, other) {
  12767. return value <= other;
  12768. });
  12769. /**
  12770. * Converts `value` to an array.
  12771. *
  12772. * @static
  12773. * @since 0.1.0
  12774. * @memberOf _
  12775. * @category Lang
  12776. * @param {*} value The value to convert.
  12777. * @returns {Array} Returns the converted array.
  12778. * @example
  12779. *
  12780. * _.toArray({ 'a': 1, 'b': 2 });
  12781. * // => [1, 2]
  12782. *
  12783. * _.toArray('abc');
  12784. * // => ['a', 'b', 'c']
  12785. *
  12786. * _.toArray(1);
  12787. * // => []
  12788. *
  12789. * _.toArray(null);
  12790. * // => []
  12791. */
  12792. function toArray(value) {
  12793. if (!value) {
  12794. return [];
  12795. }
  12796. if (isArrayLike(value)) {
  12797. return isString(value) ? stringToArray(value) : copyArray(value);
  12798. }
  12799. if (symIterator && value[symIterator]) {
  12800. return iteratorToArray(value[symIterator]());
  12801. }
  12802. var tag = getTag(value),
  12803. func = tag == mapTag ? mapToArray : (tag == setTag ? setToArray : values);
  12804. return func(value);
  12805. }
  12806. /**
  12807. * Converts `value` to a finite number.
  12808. *
  12809. * @static
  12810. * @memberOf _
  12811. * @since 4.12.0
  12812. * @category Lang
  12813. * @param {*} value The value to convert.
  12814. * @returns {number} Returns the converted number.
  12815. * @example
  12816. *
  12817. * _.toFinite(3.2);
  12818. * // => 3.2
  12819. *
  12820. * _.toFinite(Number.MIN_VALUE);
  12821. * // => 5e-324
  12822. *
  12823. * _.toFinite(Infinity);
  12824. * // => 1.7976931348623157e+308
  12825. *
  12826. * _.toFinite('3.2');
  12827. * // => 3.2
  12828. */
  12829. function toFinite(value) {
  12830. if (!value) {
  12831. return value === 0 ? value : 0;
  12832. }
  12833. value = toNumber(value);
  12834. if (value === INFINITY || value === -INFINITY) {
  12835. var sign = (value < 0 ? -1 : 1);
  12836. return sign * MAX_INTEGER;
  12837. }
  12838. return value === value ? value : 0;
  12839. }
  12840. /**
  12841. * Converts `value` to an integer.
  12842. *
  12843. * **Note:** This method is loosely based on
  12844. * [`ToInteger`](http://www.ecma-international.org/ecma-262/7.0/#sec-tointeger).
  12845. *
  12846. * @static
  12847. * @memberOf _
  12848. * @since 4.0.0
  12849. * @category Lang
  12850. * @param {*} value The value to convert.
  12851. * @returns {number} Returns the converted integer.
  12852. * @example
  12853. *
  12854. * _.toInteger(3.2);
  12855. * // => 3
  12856. *
  12857. * _.toInteger(Number.MIN_VALUE);
  12858. * // => 0
  12859. *
  12860. * _.toInteger(Infinity);
  12861. * // => 1.7976931348623157e+308
  12862. *
  12863. * _.toInteger('3.2');
  12864. * // => 3
  12865. */
  12866. function toInteger(value) {
  12867. var result = toFinite(value),
  12868. remainder = result % 1;
  12869. return result === result ? (remainder ? result - remainder : result) : 0;
  12870. }
  12871. /**
  12872. * Converts `value` to an integer suitable for use as the length of an
  12873. * array-like object.
  12874. *
  12875. * **Note:** This method is based on
  12876. * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).
  12877. *
  12878. * @static
  12879. * @memberOf _
  12880. * @since 4.0.0
  12881. * @category Lang
  12882. * @param {*} value The value to convert.
  12883. * @returns {number} Returns the converted integer.
  12884. * @example
  12885. *
  12886. * _.toLength(3.2);
  12887. * // => 3
  12888. *
  12889. * _.toLength(Number.MIN_VALUE);
  12890. * // => 0
  12891. *
  12892. * _.toLength(Infinity);
  12893. * // => 4294967295
  12894. *
  12895. * _.toLength('3.2');
  12896. * // => 3
  12897. */
  12898. function toLength(value) {
  12899. return value ? baseClamp(toInteger(value), 0, MAX_ARRAY_LENGTH) : 0;
  12900. }
  12901. /**
  12902. * Converts `value` to a number.
  12903. *
  12904. * @static
  12905. * @memberOf _
  12906. * @since 4.0.0
  12907. * @category Lang
  12908. * @param {*} value The value to process.
  12909. * @returns {number} Returns the number.
  12910. * @example
  12911. *
  12912. * _.toNumber(3.2);
  12913. * // => 3.2
  12914. *
  12915. * _.toNumber(Number.MIN_VALUE);
  12916. * // => 5e-324
  12917. *
  12918. * _.toNumber(Infinity);
  12919. * // => Infinity
  12920. *
  12921. * _.toNumber('3.2');
  12922. * // => 3.2
  12923. */
  12924. function toNumber(value) {
  12925. if (typeof value == 'number') {
  12926. return value;
  12927. }
  12928. if (isSymbol(value)) {
  12929. return NAN;
  12930. }
  12931. if (isObject(value)) {
  12932. var other = typeof value.valueOf == 'function' ? value.valueOf() : value;
  12933. value = isObject(other) ? (other + '') : other;
  12934. }
  12935. if (typeof value != 'string') {
  12936. return value === 0 ? value : +value;
  12937. }
  12938. value = baseTrim(value);
  12939. var isBinary = reIsBinary.test(value);
  12940. return (isBinary || reIsOctal.test(value))
  12941. ? freeParseInt(value.slice(2), isBinary ? 2 : 8)
  12942. : (reIsBadHex.test(value) ? NAN : +value);
  12943. }
  12944. /**
  12945. * Converts `value` to a plain object flattening inherited enumerable string
  12946. * keyed properties of `value` to own properties of the plain object.
  12947. *
  12948. * @static
  12949. * @memberOf _
  12950. * @since 3.0.0
  12951. * @category Lang
  12952. * @param {*} value The value to convert.
  12953. * @returns {Object} Returns the converted plain object.
  12954. * @example
  12955. *
  12956. * function Foo() {
  12957. * this.b = 2;
  12958. * }
  12959. *
  12960. * Foo.prototype.c = 3;
  12961. *
  12962. * _.assign({ 'a': 1 }, new Foo);
  12963. * // => { 'a': 1, 'b': 2 }
  12964. *
  12965. * _.assign({ 'a': 1 }, _.toPlainObject(new Foo));
  12966. * // => { 'a': 1, 'b': 2, 'c': 3 }
  12967. */
  12968. function toPlainObject(value) {
  12969. return copyObject(value, keysIn(value));
  12970. }
  12971. /**
  12972. * Converts `value` to a safe integer. A safe integer can be compared and
  12973. * represented correctly.
  12974. *
  12975. * @static
  12976. * @memberOf _
  12977. * @since 4.0.0
  12978. * @category Lang
  12979. * @param {*} value The value to convert.
  12980. * @returns {number} Returns the converted integer.
  12981. * @example
  12982. *
  12983. * _.toSafeInteger(3.2);
  12984. * // => 3
  12985. *
  12986. * _.toSafeInteger(Number.MIN_VALUE);
  12987. * // => 0
  12988. *
  12989. * _.toSafeInteger(Infinity);
  12990. * // => 9007199254740991
  12991. *
  12992. * _.toSafeInteger('3.2');
  12993. * // => 3
  12994. */
  12995. function toSafeInteger(value) {
  12996. return value
  12997. ? baseClamp(toInteger(value), -MAX_SAFE_INTEGER, MAX_SAFE_INTEGER)
  12998. : (value === 0 ? value : 0);
  12999. }
  13000. /**
  13001. * Converts `value` to a string. An empty string is returned for `null`
  13002. * and `undefined` values. The sign of `-0` is preserved.
  13003. *
  13004. * @static
  13005. * @memberOf _
  13006. * @since 4.0.0
  13007. * @category Lang
  13008. * @param {*} value The value to convert.
  13009. * @returns {string} Returns the converted string.
  13010. * @example
  13011. *
  13012. * _.toString(null);
  13013. * // => ''
  13014. *
  13015. * _.toString(-0);
  13016. * // => '-0'
  13017. *
  13018. * _.toString([1, 2, 3]);
  13019. * // => '1,2,3'
  13020. */
  13021. function toString(value) {
  13022. return value == null ? '' : baseToString(value);
  13023. }
  13024. /*------------------------------------------------------------------------*/
  13025. /**
  13026. * Assigns own enumerable string keyed properties of source objects to the
  13027. * destination object. Source objects are applied from left to right.
  13028. * Subsequent sources overwrite property assignments of previous sources.
  13029. *
  13030. * **Note:** This method mutates `object` and is loosely based on
  13031. * [`Object.assign`](https://mdn.io/Object/assign).
  13032. *
  13033. * @static
  13034. * @memberOf _
  13035. * @since 0.10.0
  13036. * @category Object
  13037. * @param {Object} object The destination object.
  13038. * @param {...Object} [sources] The source objects.
  13039. * @returns {Object} Returns `object`.
  13040. * @see _.assignIn
  13041. * @example
  13042. *
  13043. * function Foo() {
  13044. * this.a = 1;
  13045. * }
  13046. *
  13047. * function Bar() {
  13048. * this.c = 3;
  13049. * }
  13050. *
  13051. * Foo.prototype.b = 2;
  13052. * Bar.prototype.d = 4;
  13053. *
  13054. * _.assign({ 'a': 0 }, new Foo, new Bar);
  13055. * // => { 'a': 1, 'c': 3 }
  13056. */
  13057. var assign = createAssigner(function(object, source) {
  13058. if (isPrototype(source) || isArrayLike(source)) {
  13059. copyObject(source, keys(source), object);
  13060. return;
  13061. }
  13062. for (var key in source) {
  13063. if (hasOwnProperty.call(source, key)) {
  13064. assignValue(object, key, source[key]);
  13065. }
  13066. }
  13067. });
  13068. /**
  13069. * This method is like `_.assign` except that it iterates over own and
  13070. * inherited source properties.
  13071. *
  13072. * **Note:** This method mutates `object`.
  13073. *
  13074. * @static
  13075. * @memberOf _
  13076. * @since 4.0.0
  13077. * @alias extend
  13078. * @category Object
  13079. * @param {Object} object The destination object.
  13080. * @param {...Object} [sources] The source objects.
  13081. * @returns {Object} Returns `object`.
  13082. * @see _.assign
  13083. * @example
  13084. *
  13085. * function Foo() {
  13086. * this.a = 1;
  13087. * }
  13088. *
  13089. * function Bar() {
  13090. * this.c = 3;
  13091. * }
  13092. *
  13093. * Foo.prototype.b = 2;
  13094. * Bar.prototype.d = 4;
  13095. *
  13096. * _.assignIn({ 'a': 0 }, new Foo, new Bar);
  13097. * // => { 'a': 1, 'b': 2, 'c': 3, 'd': 4 }
  13098. */
  13099. var assignIn = createAssigner(function(object, source) {
  13100. copyObject(source, keysIn(source), object);
  13101. });
  13102. /**
  13103. * This method is like `_.assignIn` except that it accepts `customizer`
  13104. * which is invoked to produce the assigned values. If `customizer` returns
  13105. * `undefined`, assignment is handled by the method instead. The `customizer`
  13106. * is invoked with five arguments: (objValue, srcValue, key, object, source).
  13107. *
  13108. * **Note:** This method mutates `object`.
  13109. *
  13110. * @static
  13111. * @memberOf _
  13112. * @since 4.0.0
  13113. * @alias extendWith
  13114. * @category Object
  13115. * @param {Object} object The destination object.
  13116. * @param {...Object} sources The source objects.
  13117. * @param {Function} [customizer] The function to customize assigned values.
  13118. * @returns {Object} Returns `object`.
  13119. * @see _.assignWith
  13120. * @example
  13121. *
  13122. * function customizer(objValue, srcValue) {
  13123. * return _.isUndefined(objValue) ? srcValue : objValue;
  13124. * }
  13125. *
  13126. * var defaults = _.partialRight(_.assignInWith, customizer);
  13127. *
  13128. * defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 });
  13129. * // => { 'a': 1, 'b': 2 }
  13130. */
  13131. var assignInWith = createAssigner(function(object, source, srcIndex, customizer) {
  13132. copyObject(source, keysIn(source), object, customizer);
  13133. });
  13134. /**
  13135. * This method is like `_.assign` except that it accepts `customizer`
  13136. * which is invoked to produce the assigned values. If `customizer` returns
  13137. * `undefined`, assignment is handled by the method instead. The `customizer`
  13138. * is invoked with five arguments: (objValue, srcValue, key, object, source).
  13139. *
  13140. * **Note:** This method mutates `object`.
  13141. *
  13142. * @static
  13143. * @memberOf _
  13144. * @since 4.0.0
  13145. * @category Object
  13146. * @param {Object} object The destination object.
  13147. * @param {...Object} sources The source objects.
  13148. * @param {Function} [customizer] The function to customize assigned values.
  13149. * @returns {Object} Returns `object`.
  13150. * @see _.assignInWith
  13151. * @example
  13152. *
  13153. * function customizer(objValue, srcValue) {
  13154. * return _.isUndefined(objValue) ? srcValue : objValue;
  13155. * }
  13156. *
  13157. * var defaults = _.partialRight(_.assignWith, customizer);
  13158. *
  13159. * defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 });
  13160. * // => { 'a': 1, 'b': 2 }
  13161. */
  13162. var assignWith = createAssigner(function(object, source, srcIndex, customizer) {
  13163. copyObject(source, keys(source), object, customizer);
  13164. });
  13165. /**
  13166. * Creates an array of values corresponding to `paths` of `object`.
  13167. *
  13168. * @static
  13169. * @memberOf _
  13170. * @since 1.0.0
  13171. * @category Object
  13172. * @param {Object} object The object to iterate over.
  13173. * @param {...(string|string[])} [paths] The property paths to pick.
  13174. * @returns {Array} Returns the picked values.
  13175. * @example
  13176. *
  13177. * var object = { 'a': [{ 'b': { 'c': 3 } }, 4] };
  13178. *
  13179. * _.at(object, ['a[0].b.c', 'a[1]']);
  13180. * // => [3, 4]
  13181. */
  13182. var at = flatRest(baseAt);
  13183. /**
  13184. * Creates an object that inherits from the `prototype` object. If a
  13185. * `properties` object is given, its own enumerable string keyed properties
  13186. * are assigned to the created object.
  13187. *
  13188. * @static
  13189. * @memberOf _
  13190. * @since 2.3.0
  13191. * @category Object
  13192. * @param {Object} prototype The object to inherit from.
  13193. * @param {Object} [properties] The properties to assign to the object.
  13194. * @returns {Object} Returns the new object.
  13195. * @example
  13196. *
  13197. * function Shape() {
  13198. * this.x = 0;
  13199. * this.y = 0;
  13200. * }
  13201. *
  13202. * function Circle() {
  13203. * Shape.call(this);
  13204. * }
  13205. *
  13206. * Circle.prototype = _.create(Shape.prototype, {
  13207. * 'constructor': Circle
  13208. * });
  13209. *
  13210. * var circle = new Circle;
  13211. * circle instanceof Circle;
  13212. * // => true
  13213. *
  13214. * circle instanceof Shape;
  13215. * // => true
  13216. */
  13217. function create(prototype, properties) {
  13218. var result = baseCreate(prototype);
  13219. return properties == null ? result : baseAssign(result, properties);
  13220. }
  13221. /**
  13222. * Assigns own and inherited enumerable string keyed properties of source
  13223. * objects to the destination object for all destination properties that
  13224. * resolve to `undefined`. Source objects are applied from left to right.
  13225. * Once a property is set, additional values of the same property are ignored.
  13226. *
  13227. * **Note:** This method mutates `object`.
  13228. *
  13229. * @static
  13230. * @since 0.1.0
  13231. * @memberOf _
  13232. * @category Object
  13233. * @param {Object} object The destination object.
  13234. * @param {...Object} [sources] The source objects.
  13235. * @returns {Object} Returns `object`.
  13236. * @see _.defaultsDeep
  13237. * @example
  13238. *
  13239. * _.defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 });
  13240. * // => { 'a': 1, 'b': 2 }
  13241. */
  13242. var defaults = baseRest(function(object, sources) {
  13243. object = Object(object);
  13244. var index = -1;
  13245. var length = sources.length;
  13246. var guard = length > 2 ? sources[2] : undefined;
  13247. if (guard && isIterateeCall(sources[0], sources[1], guard)) {
  13248. length = 1;
  13249. }
  13250. while (++index < length) {
  13251. var source = sources[index];
  13252. var props = keysIn(source);
  13253. var propsIndex = -1;
  13254. var propsLength = props.length;
  13255. while (++propsIndex < propsLength) {
  13256. var key = props[propsIndex];
  13257. var value = object[key];
  13258. if (value === undefined ||
  13259. (eq(value, objectProto[key]) && !hasOwnProperty.call(object, key))) {
  13260. object[key] = source[key];
  13261. }
  13262. }
  13263. }
  13264. return object;
  13265. });
  13266. /**
  13267. * This method is like `_.defaults` except that it recursively assigns
  13268. * default properties.
  13269. *
  13270. * **Note:** This method mutates `object`.
  13271. *
  13272. * @static
  13273. * @memberOf _
  13274. * @since 3.10.0
  13275. * @category Object
  13276. * @param {Object} object The destination object.
  13277. * @param {...Object} [sources] The source objects.
  13278. * @returns {Object} Returns `object`.
  13279. * @see _.defaults
  13280. * @example
  13281. *
  13282. * _.defaultsDeep({ 'a': { 'b': 2 } }, { 'a': { 'b': 1, 'c': 3 } });
  13283. * // => { 'a': { 'b': 2, 'c': 3 } }
  13284. */
  13285. var defaultsDeep = baseRest(function(args) {
  13286. args.push(undefined, customDefaultsMerge);
  13287. return apply(mergeWith, undefined, args);
  13288. });
  13289. /**
  13290. * This method is like `_.find` except that it returns the key of the first
  13291. * element `predicate` returns truthy for instead of the element itself.
  13292. *
  13293. * @static
  13294. * @memberOf _
  13295. * @since 1.1.0
  13296. * @category Object
  13297. * @param {Object} object The object to inspect.
  13298. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  13299. * @returns {string|undefined} Returns the key of the matched element,
  13300. * else `undefined`.
  13301. * @example
  13302. *
  13303. * var users = {
  13304. * 'barney': { 'age': 36, 'active': true },
  13305. * 'fred': { 'age': 40, 'active': false },
  13306. * 'pebbles': { 'age': 1, 'active': true }
  13307. * };
  13308. *
  13309. * _.findKey(users, function(o) { return o.age < 40; });
  13310. * // => 'barney' (iteration order is not guaranteed)
  13311. *
  13312. * // The `_.matches` iteratee shorthand.
  13313. * _.findKey(users, { 'age': 1, 'active': true });
  13314. * // => 'pebbles'
  13315. *
  13316. * // The `_.matchesProperty` iteratee shorthand.
  13317. * _.findKey(users, ['active', false]);
  13318. * // => 'fred'
  13319. *
  13320. * // The `_.property` iteratee shorthand.
  13321. * _.findKey(users, 'active');
  13322. * // => 'barney'
  13323. */
  13324. function findKey(object, predicate) {
  13325. return baseFindKey(object, getIteratee(predicate, 3), baseForOwn);
  13326. }
  13327. /**
  13328. * This method is like `_.findKey` except that it iterates over elements of
  13329. * a collection in the opposite order.
  13330. *
  13331. * @static
  13332. * @memberOf _
  13333. * @since 2.0.0
  13334. * @category Object
  13335. * @param {Object} object The object to inspect.
  13336. * @param {Function} [predicate=_.identity] The function invoked per iteration.
  13337. * @returns {string|undefined} Returns the key of the matched element,
  13338. * else `undefined`.
  13339. * @example
  13340. *
  13341. * var users = {
  13342. * 'barney': { 'age': 36, 'active': true },
  13343. * 'fred': { 'age': 40, 'active': false },
  13344. * 'pebbles': { 'age': 1, 'active': true }
  13345. * };
  13346. *
  13347. * _.findLastKey(users, function(o) { return o.age < 40; });
  13348. * // => returns 'pebbles' assuming `_.findKey` returns 'barney'
  13349. *
  13350. * // The `_.matches` iteratee shorthand.
  13351. * _.findLastKey(users, { 'age': 36, 'active': true });
  13352. * // => 'barney'
  13353. *
  13354. * // The `_.matchesProperty` iteratee shorthand.
  13355. * _.findLastKey(users, ['active', false]);
  13356. * // => 'fred'
  13357. *
  13358. * // The `_.property` iteratee shorthand.
  13359. * _.findLastKey(users, 'active');
  13360. * // => 'pebbles'
  13361. */
  13362. function findLastKey(object, predicate) {
  13363. return baseFindKey(object, getIteratee(predicate, 3), baseForOwnRight);
  13364. }
  13365. /**
  13366. * Iterates over own and inherited enumerable string keyed properties of an
  13367. * object and invokes `iteratee` for each property. The iteratee is invoked
  13368. * with three arguments: (value, key, object). Iteratee functions may exit
  13369. * iteration early by explicitly returning `false`.
  13370. *
  13371. * @static
  13372. * @memberOf _
  13373. * @since 0.3.0
  13374. * @category Object
  13375. * @param {Object} object The object to iterate over.
  13376. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  13377. * @returns {Object} Returns `object`.
  13378. * @see _.forInRight
  13379. * @example
  13380. *
  13381. * function Foo() {
  13382. * this.a = 1;
  13383. * this.b = 2;
  13384. * }
  13385. *
  13386. * Foo.prototype.c = 3;
  13387. *
  13388. * _.forIn(new Foo, function(value, key) {
  13389. * console.log(key);
  13390. * });
  13391. * // => Logs 'a', 'b', then 'c' (iteration order is not guaranteed).
  13392. */
  13393. function forIn(object, iteratee) {
  13394. return object == null
  13395. ? object
  13396. : baseFor(object, getIteratee(iteratee, 3), keysIn);
  13397. }
  13398. /**
  13399. * This method is like `_.forIn` except that it iterates over properties of
  13400. * `object` in the opposite order.
  13401. *
  13402. * @static
  13403. * @memberOf _
  13404. * @since 2.0.0
  13405. * @category Object
  13406. * @param {Object} object The object to iterate over.
  13407. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  13408. * @returns {Object} Returns `object`.
  13409. * @see _.forIn
  13410. * @example
  13411. *
  13412. * function Foo() {
  13413. * this.a = 1;
  13414. * this.b = 2;
  13415. * }
  13416. *
  13417. * Foo.prototype.c = 3;
  13418. *
  13419. * _.forInRight(new Foo, function(value, key) {
  13420. * console.log(key);
  13421. * });
  13422. * // => Logs 'c', 'b', then 'a' assuming `_.forIn` logs 'a', 'b', then 'c'.
  13423. */
  13424. function forInRight(object, iteratee) {
  13425. return object == null
  13426. ? object
  13427. : baseForRight(object, getIteratee(iteratee, 3), keysIn);
  13428. }
  13429. /**
  13430. * Iterates over own enumerable string keyed properties of an object and
  13431. * invokes `iteratee` for each property. The iteratee is invoked with three
  13432. * arguments: (value, key, object). Iteratee functions may exit iteration
  13433. * early by explicitly returning `false`.
  13434. *
  13435. * @static
  13436. * @memberOf _
  13437. * @since 0.3.0
  13438. * @category Object
  13439. * @param {Object} object The object to iterate over.
  13440. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  13441. * @returns {Object} Returns `object`.
  13442. * @see _.forOwnRight
  13443. * @example
  13444. *
  13445. * function Foo() {
  13446. * this.a = 1;
  13447. * this.b = 2;
  13448. * }
  13449. *
  13450. * Foo.prototype.c = 3;
  13451. *
  13452. * _.forOwn(new Foo, function(value, key) {
  13453. * console.log(key);
  13454. * });
  13455. * // => Logs 'a' then 'b' (iteration order is not guaranteed).
  13456. */
  13457. function forOwn(object, iteratee) {
  13458. return object && baseForOwn(object, getIteratee(iteratee, 3));
  13459. }
  13460. /**
  13461. * This method is like `_.forOwn` except that it iterates over properties of
  13462. * `object` in the opposite order.
  13463. *
  13464. * @static
  13465. * @memberOf _
  13466. * @since 2.0.0
  13467. * @category Object
  13468. * @param {Object} object The object to iterate over.
  13469. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  13470. * @returns {Object} Returns `object`.
  13471. * @see _.forOwn
  13472. * @example
  13473. *
  13474. * function Foo() {
  13475. * this.a = 1;
  13476. * this.b = 2;
  13477. * }
  13478. *
  13479. * Foo.prototype.c = 3;
  13480. *
  13481. * _.forOwnRight(new Foo, function(value, key) {
  13482. * console.log(key);
  13483. * });
  13484. * // => Logs 'b' then 'a' assuming `_.forOwn` logs 'a' then 'b'.
  13485. */
  13486. function forOwnRight(object, iteratee) {
  13487. return object && baseForOwnRight(object, getIteratee(iteratee, 3));
  13488. }
  13489. /**
  13490. * Creates an array of function property names from own enumerable properties
  13491. * of `object`.
  13492. *
  13493. * @static
  13494. * @since 0.1.0
  13495. * @memberOf _
  13496. * @category Object
  13497. * @param {Object} object The object to inspect.
  13498. * @returns {Array} Returns the function names.
  13499. * @see _.functionsIn
  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. * _.functions(new Foo);
  13510. * // => ['a', 'b']
  13511. */
  13512. function functions(object) {
  13513. return object == null ? [] : baseFunctions(object, keys(object));
  13514. }
  13515. /**
  13516. * Creates an array of function property names from own and inherited
  13517. * enumerable properties of `object`.
  13518. *
  13519. * @static
  13520. * @memberOf _
  13521. * @since 4.0.0
  13522. * @category Object
  13523. * @param {Object} object The object to inspect.
  13524. * @returns {Array} Returns the function names.
  13525. * @see _.functions
  13526. * @example
  13527. *
  13528. * function Foo() {
  13529. * this.a = _.constant('a');
  13530. * this.b = _.constant('b');
  13531. * }
  13532. *
  13533. * Foo.prototype.c = _.constant('c');
  13534. *
  13535. * _.functionsIn(new Foo);
  13536. * // => ['a', 'b', 'c']
  13537. */
  13538. function functionsIn(object) {
  13539. return object == null ? [] : baseFunctions(object, keysIn(object));
  13540. }
  13541. /**
  13542. * Gets the value at `path` of `object`. If the resolved value is
  13543. * `undefined`, the `defaultValue` is returned in its place.
  13544. *
  13545. * @static
  13546. * @memberOf _
  13547. * @since 3.7.0
  13548. * @category Object
  13549. * @param {Object} object The object to query.
  13550. * @param {Array|string} path The path of the property to get.
  13551. * @param {*} [defaultValue] The value returned for `undefined` resolved values.
  13552. * @returns {*} Returns the resolved value.
  13553. * @example
  13554. *
  13555. * var object = { 'a': [{ 'b': { 'c': 3 } }] };
  13556. *
  13557. * _.get(object, 'a[0].b.c');
  13558. * // => 3
  13559. *
  13560. * _.get(object, ['a', '0', 'b', 'c']);
  13561. * // => 3
  13562. *
  13563. * _.get(object, 'a.b.c', 'default');
  13564. * // => 'default'
  13565. */
  13566. function get(object, path, defaultValue) {
  13567. var result = object == null ? undefined : baseGet(object, path);
  13568. return result === undefined ? defaultValue : result;
  13569. }
  13570. /**
  13571. * Checks if `path` is a direct property of `object`.
  13572. *
  13573. * @static
  13574. * @since 0.1.0
  13575. * @memberOf _
  13576. * @category Object
  13577. * @param {Object} object The object to query.
  13578. * @param {Array|string} path The path to check.
  13579. * @returns {boolean} Returns `true` if `path` exists, else `false`.
  13580. * @example
  13581. *
  13582. * var object = { 'a': { 'b': 2 } };
  13583. * var other = _.create({ 'a': _.create({ 'b': 2 }) });
  13584. *
  13585. * _.has(object, 'a');
  13586. * // => true
  13587. *
  13588. * _.has(object, 'a.b');
  13589. * // => true
  13590. *
  13591. * _.has(object, ['a', 'b']);
  13592. * // => true
  13593. *
  13594. * _.has(other, 'a');
  13595. * // => false
  13596. */
  13597. function has(object, path) {
  13598. return object != null && hasPath(object, path, baseHas);
  13599. }
  13600. /**
  13601. * Checks if `path` is a direct or inherited property of `object`.
  13602. *
  13603. * @static
  13604. * @memberOf _
  13605. * @since 4.0.0
  13606. * @category Object
  13607. * @param {Object} object The object to query.
  13608. * @param {Array|string} path The path to check.
  13609. * @returns {boolean} Returns `true` if `path` exists, else `false`.
  13610. * @example
  13611. *
  13612. * var object = _.create({ 'a': _.create({ 'b': 2 }) });
  13613. *
  13614. * _.hasIn(object, 'a');
  13615. * // => true
  13616. *
  13617. * _.hasIn(object, 'a.b');
  13618. * // => true
  13619. *
  13620. * _.hasIn(object, ['a', 'b']);
  13621. * // => true
  13622. *
  13623. * _.hasIn(object, 'b');
  13624. * // => false
  13625. */
  13626. function hasIn(object, path) {
  13627. return object != null && hasPath(object, path, baseHasIn);
  13628. }
  13629. /**
  13630. * Creates an object composed of the inverted keys and values of `object`.
  13631. * If `object` contains duplicate values, subsequent values overwrite
  13632. * property assignments of previous values.
  13633. *
  13634. * @static
  13635. * @memberOf _
  13636. * @since 0.7.0
  13637. * @category Object
  13638. * @param {Object} object The object to invert.
  13639. * @returns {Object} Returns the new inverted object.
  13640. * @example
  13641. *
  13642. * var object = { 'a': 1, 'b': 2, 'c': 1 };
  13643. *
  13644. * _.invert(object);
  13645. * // => { '1': 'c', '2': 'b' }
  13646. */
  13647. var invert = createInverter(function(result, value, key) {
  13648. if (value != null &&
  13649. typeof value.toString != 'function') {
  13650. value = nativeObjectToString.call(value);
  13651. }
  13652. result[value] = key;
  13653. }, constant(identity));
  13654. /**
  13655. * This method is like `_.invert` except that the inverted object is generated
  13656. * from the results of running each element of `object` thru `iteratee`. The
  13657. * corresponding inverted value of each inverted key is an array of keys
  13658. * responsible for generating the inverted value. The iteratee is invoked
  13659. * with one argument: (value).
  13660. *
  13661. * @static
  13662. * @memberOf _
  13663. * @since 4.1.0
  13664. * @category Object
  13665. * @param {Object} object The object to invert.
  13666. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  13667. * @returns {Object} Returns the new inverted object.
  13668. * @example
  13669. *
  13670. * var object = { 'a': 1, 'b': 2, 'c': 1 };
  13671. *
  13672. * _.invertBy(object);
  13673. * // => { '1': ['a', 'c'], '2': ['b'] }
  13674. *
  13675. * _.invertBy(object, function(value) {
  13676. * return 'group' + value;
  13677. * });
  13678. * // => { 'group1': ['a', 'c'], 'group2': ['b'] }
  13679. */
  13680. var invertBy = createInverter(function(result, value, key) {
  13681. if (value != null &&
  13682. typeof value.toString != 'function') {
  13683. value = nativeObjectToString.call(value);
  13684. }
  13685. if (hasOwnProperty.call(result, value)) {
  13686. result[value].push(key);
  13687. } else {
  13688. result[value] = [key];
  13689. }
  13690. }, getIteratee);
  13691. /**
  13692. * Invokes the method at `path` of `object`.
  13693. *
  13694. * @static
  13695. * @memberOf _
  13696. * @since 4.0.0
  13697. * @category Object
  13698. * @param {Object} object The object to query.
  13699. * @param {Array|string} path The path of the method to invoke.
  13700. * @param {...*} [args] The arguments to invoke the method with.
  13701. * @returns {*} Returns the result of the invoked method.
  13702. * @example
  13703. *
  13704. * var object = { 'a': [{ 'b': { 'c': [1, 2, 3, 4] } }] };
  13705. *
  13706. * _.invoke(object, 'a[0].b.c.slice', 1, 3);
  13707. * // => [2, 3]
  13708. */
  13709. var invoke = baseRest(baseInvoke);
  13710. /**
  13711. * Creates an array of the own enumerable property names of `object`.
  13712. *
  13713. * **Note:** Non-object values are coerced to objects. See the
  13714. * [ES spec](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)
  13715. * for more details.
  13716. *
  13717. * @static
  13718. * @since 0.1.0
  13719. * @memberOf _
  13720. * @category Object
  13721. * @param {Object} object The object to query.
  13722. * @returns {Array} Returns the array of property names.
  13723. * @example
  13724. *
  13725. * function Foo() {
  13726. * this.a = 1;
  13727. * this.b = 2;
  13728. * }
  13729. *
  13730. * Foo.prototype.c = 3;
  13731. *
  13732. * _.keys(new Foo);
  13733. * // => ['a', 'b'] (iteration order is not guaranteed)
  13734. *
  13735. * _.keys('hi');
  13736. * // => ['0', '1']
  13737. */
  13738. function keys(object) {
  13739. return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object);
  13740. }
  13741. /**
  13742. * Creates an array of the own and inherited enumerable property names of `object`.
  13743. *
  13744. * **Note:** Non-object values are coerced to objects.
  13745. *
  13746. * @static
  13747. * @memberOf _
  13748. * @since 3.0.0
  13749. * @category Object
  13750. * @param {Object} object The object to query.
  13751. * @returns {Array} Returns the array of property names.
  13752. * @example
  13753. *
  13754. * function Foo() {
  13755. * this.a = 1;
  13756. * this.b = 2;
  13757. * }
  13758. *
  13759. * Foo.prototype.c = 3;
  13760. *
  13761. * _.keysIn(new Foo);
  13762. * // => ['a', 'b', 'c'] (iteration order is not guaranteed)
  13763. */
  13764. function keysIn(object) {
  13765. return isArrayLike(object) ? arrayLikeKeys(object, true) : baseKeysIn(object);
  13766. }
  13767. /**
  13768. * The opposite of `_.mapValues`; this method creates an object with the
  13769. * same values as `object` and keys generated by running each own enumerable
  13770. * string keyed property of `object` thru `iteratee`. The iteratee is invoked
  13771. * with three arguments: (value, key, object).
  13772. *
  13773. * @static
  13774. * @memberOf _
  13775. * @since 3.8.0
  13776. * @category Object
  13777. * @param {Object} object The object to iterate over.
  13778. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  13779. * @returns {Object} Returns the new mapped object.
  13780. * @see _.mapValues
  13781. * @example
  13782. *
  13783. * _.mapKeys({ 'a': 1, 'b': 2 }, function(value, key) {
  13784. * return key + value;
  13785. * });
  13786. * // => { 'a1': 1, 'b2': 2 }
  13787. */
  13788. function mapKeys(object, iteratee) {
  13789. var result = {};
  13790. iteratee = getIteratee(iteratee, 3);
  13791. baseForOwn(object, function(value, key, object) {
  13792. baseAssignValue(result, iteratee(value, key, object), value);
  13793. });
  13794. return result;
  13795. }
  13796. /**
  13797. * Creates an object with the same keys as `object` and values generated
  13798. * by running each own enumerable string keyed property of `object` thru
  13799. * `iteratee`. The iteratee is invoked with three arguments:
  13800. * (value, key, object).
  13801. *
  13802. * @static
  13803. * @memberOf _
  13804. * @since 2.4.0
  13805. * @category Object
  13806. * @param {Object} object The object to iterate over.
  13807. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  13808. * @returns {Object} Returns the new mapped object.
  13809. * @see _.mapKeys
  13810. * @example
  13811. *
  13812. * var users = {
  13813. * 'fred': { 'user': 'fred', 'age': 40 },
  13814. * 'pebbles': { 'user': 'pebbles', 'age': 1 }
  13815. * };
  13816. *
  13817. * _.mapValues(users, function(o) { return o.age; });
  13818. * // => { 'fred': 40, 'pebbles': 1 } (iteration order is not guaranteed)
  13819. *
  13820. * // The `_.property` iteratee shorthand.
  13821. * _.mapValues(users, 'age');
  13822. * // => { 'fred': 40, 'pebbles': 1 } (iteration order is not guaranteed)
  13823. */
  13824. function mapValues(object, iteratee) {
  13825. var result = {};
  13826. iteratee = getIteratee(iteratee, 3);
  13827. baseForOwn(object, function(value, key, object) {
  13828. baseAssignValue(result, key, iteratee(value, key, object));
  13829. });
  13830. return result;
  13831. }
  13832. /**
  13833. * This method is like `_.assign` except that it recursively merges own and
  13834. * inherited enumerable string keyed properties of source objects into the
  13835. * destination object. Source properties that resolve to `undefined` are
  13836. * skipped if a destination value exists. Array and plain object properties
  13837. * are merged recursively. Other objects and value types are overridden by
  13838. * assignment. Source objects are applied from left to right. Subsequent
  13839. * sources overwrite property assignments of previous sources.
  13840. *
  13841. * **Note:** This method mutates `object`.
  13842. *
  13843. * @static
  13844. * @memberOf _
  13845. * @since 0.5.0
  13846. * @category Object
  13847. * @param {Object} object The destination object.
  13848. * @param {...Object} [sources] The source objects.
  13849. * @returns {Object} Returns `object`.
  13850. * @example
  13851. *
  13852. * var object = {
  13853. * 'a': [{ 'b': 2 }, { 'd': 4 }]
  13854. * };
  13855. *
  13856. * var other = {
  13857. * 'a': [{ 'c': 3 }, { 'e': 5 }]
  13858. * };
  13859. *
  13860. * _.merge(object, other);
  13861. * // => { 'a': [{ 'b': 2, 'c': 3 }, { 'd': 4, 'e': 5 }] }
  13862. */
  13863. var merge = createAssigner(function(object, source, srcIndex) {
  13864. baseMerge(object, source, srcIndex);
  13865. });
  13866. /**
  13867. * This method is like `_.merge` except that it accepts `customizer` which
  13868. * is invoked to produce the merged values of the destination and source
  13869. * properties. If `customizer` returns `undefined`, merging is handled by the
  13870. * method instead. The `customizer` is invoked with six arguments:
  13871. * (objValue, srcValue, key, object, source, stack).
  13872. *
  13873. * **Note:** This method mutates `object`.
  13874. *
  13875. * @static
  13876. * @memberOf _
  13877. * @since 4.0.0
  13878. * @category Object
  13879. * @param {Object} object The destination object.
  13880. * @param {...Object} sources The source objects.
  13881. * @param {Function} customizer The function to customize assigned values.
  13882. * @returns {Object} Returns `object`.
  13883. * @example
  13884. *
  13885. * function customizer(objValue, srcValue) {
  13886. * if (_.isArray(objValue)) {
  13887. * return objValue.concat(srcValue);
  13888. * }
  13889. * }
  13890. *
  13891. * var object = { 'a': [1], 'b': [2] };
  13892. * var other = { 'a': [3], 'b': [4] };
  13893. *
  13894. * _.mergeWith(object, other, customizer);
  13895. * // => { 'a': [1, 3], 'b': [2, 4] }
  13896. */
  13897. var mergeWith = createAssigner(function(object, source, srcIndex, customizer) {
  13898. baseMerge(object, source, srcIndex, customizer);
  13899. });
  13900. /**
  13901. * The opposite of `_.pick`; this method creates an object composed of the
  13902. * own and inherited enumerable property paths of `object` that are not omitted.
  13903. *
  13904. * **Note:** This method is considerably slower than `_.pick`.
  13905. *
  13906. * @static
  13907. * @since 0.1.0
  13908. * @memberOf _
  13909. * @category Object
  13910. * @param {Object} object The source object.
  13911. * @param {...(string|string[])} [paths] The property paths to omit.
  13912. * @returns {Object} Returns the new object.
  13913. * @example
  13914. *
  13915. * var object = { 'a': 1, 'b': '2', 'c': 3 };
  13916. *
  13917. * _.omit(object, ['a', 'c']);
  13918. * // => { 'b': '2' }
  13919. */
  13920. var omit = flatRest(function(object, paths) {
  13921. var result = {};
  13922. if (object == null) {
  13923. return result;
  13924. }
  13925. var isDeep = false;
  13926. paths = arrayMap(paths, function(path) {
  13927. path = castPath(path, object);
  13928. isDeep || (isDeep = path.length > 1);
  13929. return path;
  13930. });
  13931. copyObject(object, getAllKeysIn(object), result);
  13932. if (isDeep) {
  13933. result = baseClone(result, CLONE_DEEP_FLAG | CLONE_FLAT_FLAG | CLONE_SYMBOLS_FLAG, customOmitClone);
  13934. }
  13935. var length = paths.length;
  13936. while (length--) {
  13937. baseUnset(result, paths[length]);
  13938. }
  13939. return result;
  13940. });
  13941. /**
  13942. * The opposite of `_.pickBy`; this method creates an object composed of
  13943. * the own and inherited enumerable string keyed properties of `object` that
  13944. * `predicate` doesn't return truthy for. The predicate is invoked with two
  13945. * arguments: (value, key).
  13946. *
  13947. * @static
  13948. * @memberOf _
  13949. * @since 4.0.0
  13950. * @category Object
  13951. * @param {Object} object The source object.
  13952. * @param {Function} [predicate=_.identity] The function invoked per property.
  13953. * @returns {Object} Returns the new object.
  13954. * @example
  13955. *
  13956. * var object = { 'a': 1, 'b': '2', 'c': 3 };
  13957. *
  13958. * _.omitBy(object, _.isNumber);
  13959. * // => { 'b': '2' }
  13960. */
  13961. function omitBy(object, predicate) {
  13962. return pickBy(object, negate(getIteratee(predicate)));
  13963. }
  13964. /**
  13965. * Creates an object composed of the picked `object` properties.
  13966. *
  13967. * @static
  13968. * @since 0.1.0
  13969. * @memberOf _
  13970. * @category Object
  13971. * @param {Object} object The source object.
  13972. * @param {...(string|string[])} [paths] The property paths to pick.
  13973. * @returns {Object} Returns the new object.
  13974. * @example
  13975. *
  13976. * var object = { 'a': 1, 'b': '2', 'c': 3 };
  13977. *
  13978. * _.pick(object, ['a', 'c']);
  13979. * // => { 'a': 1, 'c': 3 }
  13980. */
  13981. var pick = flatRest(function(object, paths) {
  13982. return object == null ? {} : basePick(object, paths);
  13983. });
  13984. /**
  13985. * Creates an object composed of the `object` properties `predicate` returns
  13986. * truthy for. The predicate is invoked with two arguments: (value, key).
  13987. *
  13988. * @static
  13989. * @memberOf _
  13990. * @since 4.0.0
  13991. * @category Object
  13992. * @param {Object} object The source object.
  13993. * @param {Function} [predicate=_.identity] The function invoked per property.
  13994. * @returns {Object} Returns the new object.
  13995. * @example
  13996. *
  13997. * var object = { 'a': 1, 'b': '2', 'c': 3 };
  13998. *
  13999. * _.pickBy(object, _.isNumber);
  14000. * // => { 'a': 1, 'c': 3 }
  14001. */
  14002. function pickBy(object, predicate) {
  14003. if (object == null) {
  14004. return {};
  14005. }
  14006. var props = arrayMap(getAllKeysIn(object), function(prop) {
  14007. return [prop];
  14008. });
  14009. predicate = getIteratee(predicate);
  14010. return basePickBy(object, props, function(value, path) {
  14011. return predicate(value, path[0]);
  14012. });
  14013. }
  14014. /**
  14015. * This method is like `_.get` except that if the resolved value is a
  14016. * function it's invoked with the `this` binding of its parent object and
  14017. * its result is returned.
  14018. *
  14019. * @static
  14020. * @since 0.1.0
  14021. * @memberOf _
  14022. * @category Object
  14023. * @param {Object} object The object to query.
  14024. * @param {Array|string} path The path of the property to resolve.
  14025. * @param {*} [defaultValue] The value returned for `undefined` resolved values.
  14026. * @returns {*} Returns the resolved value.
  14027. * @example
  14028. *
  14029. * var object = { 'a': [{ 'b': { 'c1': 3, 'c2': _.constant(4) } }] };
  14030. *
  14031. * _.result(object, 'a[0].b.c1');
  14032. * // => 3
  14033. *
  14034. * _.result(object, 'a[0].b.c2');
  14035. * // => 4
  14036. *
  14037. * _.result(object, 'a[0].b.c3', 'default');
  14038. * // => 'default'
  14039. *
  14040. * _.result(object, 'a[0].b.c3', _.constant('default'));
  14041. * // => 'default'
  14042. */
  14043. function result(object, path, defaultValue) {
  14044. path = castPath(path, object);
  14045. var index = -1,
  14046. length = path.length;
  14047. // Ensure the loop is entered when path is empty.
  14048. if (!length) {
  14049. length = 1;
  14050. object = undefined;
  14051. }
  14052. while (++index < length) {
  14053. var value = object == null ? undefined : object[toKey(path[index])];
  14054. if (value === undefined) {
  14055. index = length;
  14056. value = defaultValue;
  14057. }
  14058. object = isFunction(value) ? value.call(object) : value;
  14059. }
  14060. return object;
  14061. }
  14062. /**
  14063. * Sets the value at `path` of `object`. If a portion of `path` doesn't exist,
  14064. * it's created. Arrays are created for missing index properties while objects
  14065. * are created for all other missing properties. Use `_.setWith` to customize
  14066. * `path` creation.
  14067. *
  14068. * **Note:** This method mutates `object`.
  14069. *
  14070. * @static
  14071. * @memberOf _
  14072. * @since 3.7.0
  14073. * @category Object
  14074. * @param {Object} object The object to modify.
  14075. * @param {Array|string} path The path of the property to set.
  14076. * @param {*} value The value to set.
  14077. * @returns {Object} Returns `object`.
  14078. * @example
  14079. *
  14080. * var object = { 'a': [{ 'b': { 'c': 3 } }] };
  14081. *
  14082. * _.set(object, 'a[0].b.c', 4);
  14083. * console.log(object.a[0].b.c);
  14084. * // => 4
  14085. *
  14086. * _.set(object, ['x', '0', 'y', 'z'], 5);
  14087. * console.log(object.x[0].y.z);
  14088. * // => 5
  14089. */
  14090. function set(object, path, value) {
  14091. return object == null ? object : baseSet(object, path, value);
  14092. }
  14093. /**
  14094. * This method is like `_.set` except that it accepts `customizer` which is
  14095. * invoked to produce the objects of `path`. If `customizer` returns `undefined`
  14096. * path creation is handled by the method instead. The `customizer` is invoked
  14097. * with three arguments: (nsValue, key, nsObject).
  14098. *
  14099. * **Note:** This method mutates `object`.
  14100. *
  14101. * @static
  14102. * @memberOf _
  14103. * @since 4.0.0
  14104. * @category Object
  14105. * @param {Object} object The object to modify.
  14106. * @param {Array|string} path The path of the property to set.
  14107. * @param {*} value The value to set.
  14108. * @param {Function} [customizer] The function to customize assigned values.
  14109. * @returns {Object} Returns `object`.
  14110. * @example
  14111. *
  14112. * var object = {};
  14113. *
  14114. * _.setWith(object, '[0][1]', 'a', Object);
  14115. * // => { '0': { '1': 'a' } }
  14116. */
  14117. function setWith(object, path, value, customizer) {
  14118. customizer = typeof customizer == 'function' ? customizer : undefined;
  14119. return object == null ? object : baseSet(object, path, value, customizer);
  14120. }
  14121. /**
  14122. * Creates an array of own enumerable string keyed-value pairs for `object`
  14123. * which can be consumed by `_.fromPairs`. If `object` is a map or set, its
  14124. * entries are returned.
  14125. *
  14126. * @static
  14127. * @memberOf _
  14128. * @since 4.0.0
  14129. * @alias entries
  14130. * @category Object
  14131. * @param {Object} object The object to query.
  14132. * @returns {Array} Returns the key-value pairs.
  14133. * @example
  14134. *
  14135. * function Foo() {
  14136. * this.a = 1;
  14137. * this.b = 2;
  14138. * }
  14139. *
  14140. * Foo.prototype.c = 3;
  14141. *
  14142. * _.toPairs(new Foo);
  14143. * // => [['a', 1], ['b', 2]] (iteration order is not guaranteed)
  14144. */
  14145. var toPairs = createToPairs(keys);
  14146. /**
  14147. * Creates an array of own and inherited enumerable string keyed-value pairs
  14148. * for `object` which can be consumed by `_.fromPairs`. If `object` is a map
  14149. * or set, its entries are returned.
  14150. *
  14151. * @static
  14152. * @memberOf _
  14153. * @since 4.0.0
  14154. * @alias entriesIn
  14155. * @category Object
  14156. * @param {Object} object The object to query.
  14157. * @returns {Array} Returns the key-value pairs.
  14158. * @example
  14159. *
  14160. * function Foo() {
  14161. * this.a = 1;
  14162. * this.b = 2;
  14163. * }
  14164. *
  14165. * Foo.prototype.c = 3;
  14166. *
  14167. * _.toPairsIn(new Foo);
  14168. * // => [['a', 1], ['b', 2], ['c', 3]] (iteration order is not guaranteed)
  14169. */
  14170. var toPairsIn = createToPairs(keysIn);
  14171. /**
  14172. * An alternative to `_.reduce`; this method transforms `object` to a new
  14173. * `accumulator` object which is the result of running each of its own
  14174. * enumerable string keyed properties thru `iteratee`, with each invocation
  14175. * potentially mutating the `accumulator` object. If `accumulator` is not
  14176. * provided, a new object with the same `[[Prototype]]` will be used. The
  14177. * iteratee is invoked with four arguments: (accumulator, value, key, object).
  14178. * Iteratee functions may exit iteration early by explicitly returning `false`.
  14179. *
  14180. * @static
  14181. * @memberOf _
  14182. * @since 1.3.0
  14183. * @category Object
  14184. * @param {Object} object The object to iterate over.
  14185. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  14186. * @param {*} [accumulator] The custom accumulator value.
  14187. * @returns {*} Returns the accumulated value.
  14188. * @example
  14189. *
  14190. * _.transform([2, 3, 4], function(result, n) {
  14191. * result.push(n *= n);
  14192. * return n % 2 == 0;
  14193. * }, []);
  14194. * // => [4, 9]
  14195. *
  14196. * _.transform({ 'a': 1, 'b': 2, 'c': 1 }, function(result, value, key) {
  14197. * (result[value] || (result[value] = [])).push(key);
  14198. * }, {});
  14199. * // => { '1': ['a', 'c'], '2': ['b'] }
  14200. */
  14201. function transform(object, iteratee, accumulator) {
  14202. var isArr = isArray(object),
  14203. isArrLike = isArr || isBuffer(object) || isTypedArray(object);
  14204. iteratee = getIteratee(iteratee, 4);
  14205. if (accumulator == null) {
  14206. var Ctor = object && object.constructor;
  14207. if (isArrLike) {
  14208. accumulator = isArr ? new Ctor : [];
  14209. }
  14210. else if (isObject(object)) {
  14211. accumulator = isFunction(Ctor) ? baseCreate(getPrototype(object)) : {};
  14212. }
  14213. else {
  14214. accumulator = {};
  14215. }
  14216. }
  14217. (isArrLike ? arrayEach : baseForOwn)(object, function(value, index, object) {
  14218. return iteratee(accumulator, value, index, object);
  14219. });
  14220. return accumulator;
  14221. }
  14222. /**
  14223. * Removes the property at `path` of `object`.
  14224. *
  14225. * **Note:** This method mutates `object`.
  14226. *
  14227. * @static
  14228. * @memberOf _
  14229. * @since 4.0.0
  14230. * @category Object
  14231. * @param {Object} object The object to modify.
  14232. * @param {Array|string} path The path of the property to unset.
  14233. * @returns {boolean} Returns `true` if the property is deleted, else `false`.
  14234. * @example
  14235. *
  14236. * var object = { 'a': [{ 'b': { 'c': 7 } }] };
  14237. * _.unset(object, 'a[0].b.c');
  14238. * // => true
  14239. *
  14240. * console.log(object);
  14241. * // => { 'a': [{ 'b': {} }] };
  14242. *
  14243. * _.unset(object, ['a', '0', 'b', 'c']);
  14244. * // => true
  14245. *
  14246. * console.log(object);
  14247. * // => { 'a': [{ 'b': {} }] };
  14248. */
  14249. function unset(object, path) {
  14250. return object == null ? true : baseUnset(object, path);
  14251. }
  14252. /**
  14253. * This method is like `_.set` except that accepts `updater` to produce the
  14254. * value to set. Use `_.updateWith` to customize `path` creation. The `updater`
  14255. * is invoked with one argument: (value).
  14256. *
  14257. * **Note:** This method mutates `object`.
  14258. *
  14259. * @static
  14260. * @memberOf _
  14261. * @since 4.6.0
  14262. * @category Object
  14263. * @param {Object} object The object to modify.
  14264. * @param {Array|string} path The path of the property to set.
  14265. * @param {Function} updater The function to produce the updated value.
  14266. * @returns {Object} Returns `object`.
  14267. * @example
  14268. *
  14269. * var object = { 'a': [{ 'b': { 'c': 3 } }] };
  14270. *
  14271. * _.update(object, 'a[0].b.c', function(n) { return n * n; });
  14272. * console.log(object.a[0].b.c);
  14273. * // => 9
  14274. *
  14275. * _.update(object, 'x[0].y.z', function(n) { return n ? n + 1 : 0; });
  14276. * console.log(object.x[0].y.z);
  14277. * // => 0
  14278. */
  14279. function update(object, path, updater) {
  14280. return object == null ? object : baseUpdate(object, path, castFunction(updater));
  14281. }
  14282. /**
  14283. * This method is like `_.update` except that it accepts `customizer` which is
  14284. * invoked to produce the objects of `path`. If `customizer` returns `undefined`
  14285. * path creation is handled by the method instead. The `customizer` is invoked
  14286. * with three arguments: (nsValue, key, nsObject).
  14287. *
  14288. * **Note:** This method mutates `object`.
  14289. *
  14290. * @static
  14291. * @memberOf _
  14292. * @since 4.6.0
  14293. * @category Object
  14294. * @param {Object} object The object to modify.
  14295. * @param {Array|string} path The path of the property to set.
  14296. * @param {Function} updater The function to produce the updated value.
  14297. * @param {Function} [customizer] The function to customize assigned values.
  14298. * @returns {Object} Returns `object`.
  14299. * @example
  14300. *
  14301. * var object = {};
  14302. *
  14303. * _.updateWith(object, '[0][1]', _.constant('a'), Object);
  14304. * // => { '0': { '1': 'a' } }
  14305. */
  14306. function updateWith(object, path, updater, customizer) {
  14307. customizer = typeof customizer == 'function' ? customizer : undefined;
  14308. return object == null ? object : baseUpdate(object, path, castFunction(updater), customizer);
  14309. }
  14310. /**
  14311. * Creates an array of the own enumerable string keyed property values of `object`.
  14312. *
  14313. * **Note:** Non-object values are coerced to objects.
  14314. *
  14315. * @static
  14316. * @since 0.1.0
  14317. * @memberOf _
  14318. * @category Object
  14319. * @param {Object} object The object to query.
  14320. * @returns {Array} Returns the array of property values.
  14321. * @example
  14322. *
  14323. * function Foo() {
  14324. * this.a = 1;
  14325. * this.b = 2;
  14326. * }
  14327. *
  14328. * Foo.prototype.c = 3;
  14329. *
  14330. * _.values(new Foo);
  14331. * // => [1, 2] (iteration order is not guaranteed)
  14332. *
  14333. * _.values('hi');
  14334. * // => ['h', 'i']
  14335. */
  14336. function values(object) {
  14337. return object == null ? [] : baseValues(object, keys(object));
  14338. }
  14339. /**
  14340. * Creates an array of the own and inherited enumerable string keyed property
  14341. * values of `object`.
  14342. *
  14343. * **Note:** Non-object values are coerced to objects.
  14344. *
  14345. * @static
  14346. * @memberOf _
  14347. * @since 3.0.0
  14348. * @category Object
  14349. * @param {Object} object The object to query.
  14350. * @returns {Array} Returns the array of property values.
  14351. * @example
  14352. *
  14353. * function Foo() {
  14354. * this.a = 1;
  14355. * this.b = 2;
  14356. * }
  14357. *
  14358. * Foo.prototype.c = 3;
  14359. *
  14360. * _.valuesIn(new Foo);
  14361. * // => [1, 2, 3] (iteration order is not guaranteed)
  14362. */
  14363. function valuesIn(object) {
  14364. return object == null ? [] : baseValues(object, keysIn(object));
  14365. }
  14366. /*------------------------------------------------------------------------*/
  14367. /**
  14368. * Clamps `number` within the inclusive `lower` and `upper` bounds.
  14369. *
  14370. * @static
  14371. * @memberOf _
  14372. * @since 4.0.0
  14373. * @category Number
  14374. * @param {number} number The number to clamp.
  14375. * @param {number} [lower] The lower bound.
  14376. * @param {number} upper The upper bound.
  14377. * @returns {number} Returns the clamped number.
  14378. * @example
  14379. *
  14380. * _.clamp(-10, -5, 5);
  14381. * // => -5
  14382. *
  14383. * _.clamp(10, -5, 5);
  14384. * // => 5
  14385. */
  14386. function clamp(number, lower, upper) {
  14387. if (upper === undefined) {
  14388. upper = lower;
  14389. lower = undefined;
  14390. }
  14391. if (upper !== undefined) {
  14392. upper = toNumber(upper);
  14393. upper = upper === upper ? upper : 0;
  14394. }
  14395. if (lower !== undefined) {
  14396. lower = toNumber(lower);
  14397. lower = lower === lower ? lower : 0;
  14398. }
  14399. return baseClamp(toNumber(number), lower, upper);
  14400. }
  14401. /**
  14402. * Checks if `n` is between `start` and up to, but not including, `end`. If
  14403. * `end` is not specified, it's set to `start` with `start` then set to `0`.
  14404. * If `start` is greater than `end` the params are swapped to support
  14405. * negative ranges.
  14406. *
  14407. * @static
  14408. * @memberOf _
  14409. * @since 3.3.0
  14410. * @category Number
  14411. * @param {number} number The number to check.
  14412. * @param {number} [start=0] The start of the range.
  14413. * @param {number} end The end of the range.
  14414. * @returns {boolean} Returns `true` if `number` is in the range, else `false`.
  14415. * @see _.range, _.rangeRight
  14416. * @example
  14417. *
  14418. * _.inRange(3, 2, 4);
  14419. * // => true
  14420. *
  14421. * _.inRange(4, 8);
  14422. * // => true
  14423. *
  14424. * _.inRange(4, 2);
  14425. * // => false
  14426. *
  14427. * _.inRange(2, 2);
  14428. * // => false
  14429. *
  14430. * _.inRange(1.2, 2);
  14431. * // => true
  14432. *
  14433. * _.inRange(5.2, 4);
  14434. * // => false
  14435. *
  14436. * _.inRange(-3, -2, -6);
  14437. * // => true
  14438. */
  14439. function inRange(number, start, end) {
  14440. start = toFinite(start);
  14441. if (end === undefined) {
  14442. end = start;
  14443. start = 0;
  14444. } else {
  14445. end = toFinite(end);
  14446. }
  14447. number = toNumber(number);
  14448. return baseInRange(number, start, end);
  14449. }
  14450. /**
  14451. * Produces a random number between the inclusive `lower` and `upper` bounds.
  14452. * If only one argument is provided a number between `0` and the given number
  14453. * is returned. If `floating` is `true`, or either `lower` or `upper` are
  14454. * floats, a floating-point number is returned instead of an integer.
  14455. *
  14456. * **Note:** JavaScript follows the IEEE-754 standard for resolving
  14457. * floating-point values which can produce unexpected results.
  14458. *
  14459. * @static
  14460. * @memberOf _
  14461. * @since 0.7.0
  14462. * @category Number
  14463. * @param {number} [lower=0] The lower bound.
  14464. * @param {number} [upper=1] The upper bound.
  14465. * @param {boolean} [floating] Specify returning a floating-point number.
  14466. * @returns {number} Returns the random number.
  14467. * @example
  14468. *
  14469. * _.random(0, 5);
  14470. * // => an integer between 0 and 5
  14471. *
  14472. * _.random(5);
  14473. * // => also an integer between 0 and 5
  14474. *
  14475. * _.random(5, true);
  14476. * // => a floating-point number between 0 and 5
  14477. *
  14478. * _.random(1.2, 5.2);
  14479. * // => a floating-point number between 1.2 and 5.2
  14480. */
  14481. function random(lower, upper, floating) {
  14482. if (floating && typeof floating != 'boolean' && isIterateeCall(lower, upper, floating)) {
  14483. upper = floating = undefined;
  14484. }
  14485. if (floating === undefined) {
  14486. if (typeof upper == 'boolean') {
  14487. floating = upper;
  14488. upper = undefined;
  14489. }
  14490. else if (typeof lower == 'boolean') {
  14491. floating = lower;
  14492. lower = undefined;
  14493. }
  14494. }
  14495. if (lower === undefined && upper === undefined) {
  14496. lower = 0;
  14497. upper = 1;
  14498. }
  14499. else {
  14500. lower = toFinite(lower);
  14501. if (upper === undefined) {
  14502. upper = lower;
  14503. lower = 0;
  14504. } else {
  14505. upper = toFinite(upper);
  14506. }
  14507. }
  14508. if (lower > upper) {
  14509. var temp = lower;
  14510. lower = upper;
  14511. upper = temp;
  14512. }
  14513. if (floating || lower % 1 || upper % 1) {
  14514. var rand = nativeRandom();
  14515. return nativeMin(lower + (rand * (upper - lower + freeParseFloat('1e-' + ((rand + '').length - 1)))), upper);
  14516. }
  14517. return baseRandom(lower, upper);
  14518. }
  14519. /*------------------------------------------------------------------------*/
  14520. /**
  14521. * Converts `string` to [camel case](https://en.wikipedia.org/wiki/CamelCase).
  14522. *
  14523. * @static
  14524. * @memberOf _
  14525. * @since 3.0.0
  14526. * @category String
  14527. * @param {string} [string=''] The string to convert.
  14528. * @returns {string} Returns the camel cased string.
  14529. * @example
  14530. *
  14531. * _.camelCase('Foo Bar');
  14532. * // => 'fooBar'
  14533. *
  14534. * _.camelCase('--foo-bar--');
  14535. * // => 'fooBar'
  14536. *
  14537. * _.camelCase('__FOO_BAR__');
  14538. * // => 'fooBar'
  14539. */
  14540. var camelCase = createCompounder(function(result, word, index) {
  14541. word = word.toLowerCase();
  14542. return result + (index ? capitalize(word) : word);
  14543. });
  14544. /**
  14545. * Converts the first character of `string` to upper case and the remaining
  14546. * to lower case.
  14547. *
  14548. * @static
  14549. * @memberOf _
  14550. * @since 3.0.0
  14551. * @category String
  14552. * @param {string} [string=''] The string to capitalize.
  14553. * @returns {string} Returns the capitalized string.
  14554. * @example
  14555. *
  14556. * _.capitalize('FRED');
  14557. * // => 'Fred'
  14558. */
  14559. function capitalize(string) {
  14560. return upperFirst(toString(string).toLowerCase());
  14561. }
  14562. /**
  14563. * Deburrs `string` by converting
  14564. * [Latin-1 Supplement](https://en.wikipedia.org/wiki/Latin-1_Supplement_(Unicode_block)#Character_table)
  14565. * and [Latin Extended-A](https://en.wikipedia.org/wiki/Latin_Extended-A)
  14566. * letters to basic Latin letters and removing
  14567. * [combining diacritical marks](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks).
  14568. *
  14569. * @static
  14570. * @memberOf _
  14571. * @since 3.0.0
  14572. * @category String
  14573. * @param {string} [string=''] The string to deburr.
  14574. * @returns {string} Returns the deburred string.
  14575. * @example
  14576. *
  14577. * _.deburr('déjà vu');
  14578. * // => 'deja vu'
  14579. */
  14580. function deburr(string) {
  14581. string = toString(string);
  14582. return string && string.replace(reLatin, deburrLetter).replace(reComboMark, '');
  14583. }
  14584. /**
  14585. * Checks if `string` ends with the given target string.
  14586. *
  14587. * @static
  14588. * @memberOf _
  14589. * @since 3.0.0
  14590. * @category String
  14591. * @param {string} [string=''] The string to inspect.
  14592. * @param {string} [target] The string to search for.
  14593. * @param {number} [position=string.length] The position to search up to.
  14594. * @returns {boolean} Returns `true` if `string` ends with `target`,
  14595. * else `false`.
  14596. * @example
  14597. *
  14598. * _.endsWith('abc', 'c');
  14599. * // => true
  14600. *
  14601. * _.endsWith('abc', 'b');
  14602. * // => false
  14603. *
  14604. * _.endsWith('abc', 'b', 2);
  14605. * // => true
  14606. */
  14607. function endsWith(string, target, position) {
  14608. string = toString(string);
  14609. target = baseToString(target);
  14610. var length = string.length;
  14611. position = position === undefined
  14612. ? length
  14613. : baseClamp(toInteger(position), 0, length);
  14614. var end = position;
  14615. position -= target.length;
  14616. return position >= 0 && string.slice(position, end) == target;
  14617. }
  14618. /**
  14619. * Converts the characters "&", "<", ">", '"', and "'" in `string` to their
  14620. * corresponding HTML entities.
  14621. *
  14622. * **Note:** No other characters are escaped. To escape additional
  14623. * characters use a third-party library like [_he_](https://mths.be/he).
  14624. *
  14625. * Though the ">" character is escaped for symmetry, characters like
  14626. * ">" and "/" don't need escaping in HTML and have no special meaning
  14627. * unless they're part of a tag or unquoted attribute value. See
  14628. * [Mathias Bynens's article](https://mathiasbynens.be/notes/ambiguous-ampersands)
  14629. * (under "semi-related fun fact") for more details.
  14630. *
  14631. * When working with HTML you should always
  14632. * [quote attribute values](http://wonko.com/post/html-escaping) to reduce
  14633. * XSS vectors.
  14634. *
  14635. * @static
  14636. * @since 0.1.0
  14637. * @memberOf _
  14638. * @category String
  14639. * @param {string} [string=''] The string to escape.
  14640. * @returns {string} Returns the escaped string.
  14641. * @example
  14642. *
  14643. * _.escape('fred, barney, & pebbles');
  14644. * // => 'fred, barney, &amp; pebbles'
  14645. */
  14646. function escape(string) {
  14647. string = toString(string);
  14648. return (string && reHasUnescapedHtml.test(string))
  14649. ? string.replace(reUnescapedHtml, escapeHtmlChar)
  14650. : string;
  14651. }
  14652. /**
  14653. * Escapes the `RegExp` special characters "^", "$", "\", ".", "*", "+",
  14654. * "?", "(", ")", "[", "]", "{", "}", and "|" in `string`.
  14655. *
  14656. * @static
  14657. * @memberOf _
  14658. * @since 3.0.0
  14659. * @category String
  14660. * @param {string} [string=''] The string to escape.
  14661. * @returns {string} Returns the escaped string.
  14662. * @example
  14663. *
  14664. * _.escapeRegExp('[lodash](https://lodash.com/)');
  14665. * // => '\[lodash\]\(https://lodash\.com/\)'
  14666. */
  14667. function escapeRegExp(string) {
  14668. string = toString(string);
  14669. return (string && reHasRegExpChar.test(string))
  14670. ? string.replace(reRegExpChar, '\\$&')
  14671. : string;
  14672. }
  14673. /**
  14674. * Converts `string` to
  14675. * [kebab case](https://en.wikipedia.org/wiki/Letter_case#Special_case_styles).
  14676. *
  14677. * @static
  14678. * @memberOf _
  14679. * @since 3.0.0
  14680. * @category String
  14681. * @param {string} [string=''] The string to convert.
  14682. * @returns {string} Returns the kebab cased string.
  14683. * @example
  14684. *
  14685. * _.kebabCase('Foo Bar');
  14686. * // => 'foo-bar'
  14687. *
  14688. * _.kebabCase('fooBar');
  14689. * // => 'foo-bar'
  14690. *
  14691. * _.kebabCase('__FOO_BAR__');
  14692. * // => 'foo-bar'
  14693. */
  14694. var kebabCase = createCompounder(function(result, word, index) {
  14695. return result + (index ? '-' : '') + word.toLowerCase();
  14696. });
  14697. /**
  14698. * Converts `string`, as space separated words, to lower case.
  14699. *
  14700. * @static
  14701. * @memberOf _
  14702. * @since 4.0.0
  14703. * @category String
  14704. * @param {string} [string=''] The string to convert.
  14705. * @returns {string} Returns the lower cased string.
  14706. * @example
  14707. *
  14708. * _.lowerCase('--Foo-Bar--');
  14709. * // => 'foo bar'
  14710. *
  14711. * _.lowerCase('fooBar');
  14712. * // => 'foo bar'
  14713. *
  14714. * _.lowerCase('__FOO_BAR__');
  14715. * // => 'foo bar'
  14716. */
  14717. var lowerCase = createCompounder(function(result, word, index) {
  14718. return result + (index ? ' ' : '') + word.toLowerCase();
  14719. });
  14720. /**
  14721. * Converts the first character of `string` to lower case.
  14722. *
  14723. * @static
  14724. * @memberOf _
  14725. * @since 4.0.0
  14726. * @category String
  14727. * @param {string} [string=''] The string to convert.
  14728. * @returns {string} Returns the converted string.
  14729. * @example
  14730. *
  14731. * _.lowerFirst('Fred');
  14732. * // => 'fred'
  14733. *
  14734. * _.lowerFirst('FRED');
  14735. * // => 'fRED'
  14736. */
  14737. var lowerFirst = createCaseFirst('toLowerCase');
  14738. /**
  14739. * Pads `string` on the left and right sides if it's shorter than `length`.
  14740. * Padding characters are truncated if they can't be evenly divided by `length`.
  14741. *
  14742. * @static
  14743. * @memberOf _
  14744. * @since 3.0.0
  14745. * @category String
  14746. * @param {string} [string=''] The string to pad.
  14747. * @param {number} [length=0] The padding length.
  14748. * @param {string} [chars=' '] The string used as padding.
  14749. * @returns {string} Returns the padded string.
  14750. * @example
  14751. *
  14752. * _.pad('abc', 8);
  14753. * // => ' abc '
  14754. *
  14755. * _.pad('abc', 8, '_-');
  14756. * // => '_-abc_-_'
  14757. *
  14758. * _.pad('abc', 3);
  14759. * // => 'abc'
  14760. */
  14761. function pad(string, length, chars) {
  14762. string = toString(string);
  14763. length = toInteger(length);
  14764. var strLength = length ? stringSize(string) : 0;
  14765. if (!length || strLength >= length) {
  14766. return string;
  14767. }
  14768. var mid = (length - strLength) / 2;
  14769. return (
  14770. createPadding(nativeFloor(mid), chars) +
  14771. string +
  14772. createPadding(nativeCeil(mid), chars)
  14773. );
  14774. }
  14775. /**
  14776. * Pads `string` on the right side if it's shorter than `length`. Padding
  14777. * characters are truncated if they exceed `length`.
  14778. *
  14779. * @static
  14780. * @memberOf _
  14781. * @since 4.0.0
  14782. * @category String
  14783. * @param {string} [string=''] The string to pad.
  14784. * @param {number} [length=0] The padding length.
  14785. * @param {string} [chars=' '] The string used as padding.
  14786. * @returns {string} Returns the padded string.
  14787. * @example
  14788. *
  14789. * _.padEnd('abc', 6);
  14790. * // => 'abc '
  14791. *
  14792. * _.padEnd('abc', 6, '_-');
  14793. * // => 'abc_-_'
  14794. *
  14795. * _.padEnd('abc', 3);
  14796. * // => 'abc'
  14797. */
  14798. function padEnd(string, length, chars) {
  14799. string = toString(string);
  14800. length = toInteger(length);
  14801. var strLength = length ? stringSize(string) : 0;
  14802. return (length && strLength < length)
  14803. ? (string + createPadding(length - strLength, chars))
  14804. : string;
  14805. }
  14806. /**
  14807. * Pads `string` on the left side if it's shorter than `length`. Padding
  14808. * characters are truncated if they exceed `length`.
  14809. *
  14810. * @static
  14811. * @memberOf _
  14812. * @since 4.0.0
  14813. * @category String
  14814. * @param {string} [string=''] The string to pad.
  14815. * @param {number} [length=0] The padding length.
  14816. * @param {string} [chars=' '] The string used as padding.
  14817. * @returns {string} Returns the padded string.
  14818. * @example
  14819. *
  14820. * _.padStart('abc', 6);
  14821. * // => ' abc'
  14822. *
  14823. * _.padStart('abc', 6, '_-');
  14824. * // => '_-_abc'
  14825. *
  14826. * _.padStart('abc', 3);
  14827. * // => 'abc'
  14828. */
  14829. function padStart(string, length, chars) {
  14830. string = toString(string);
  14831. length = toInteger(length);
  14832. var strLength = length ? stringSize(string) : 0;
  14833. return (length && strLength < length)
  14834. ? (createPadding(length - strLength, chars) + string)
  14835. : string;
  14836. }
  14837. /**
  14838. * Converts `string` to an integer of the specified radix. If `radix` is
  14839. * `undefined` or `0`, a `radix` of `10` is used unless `value` is a
  14840. * hexadecimal, in which case a `radix` of `16` is used.
  14841. *
  14842. * **Note:** This method aligns with the
  14843. * [ES5 implementation](https://es5.github.io/#x15.1.2.2) of `parseInt`.
  14844. *
  14845. * @static
  14846. * @memberOf _
  14847. * @since 1.1.0
  14848. * @category String
  14849. * @param {string} string The string to convert.
  14850. * @param {number} [radix=10] The radix to interpret `value` by.
  14851. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  14852. * @returns {number} Returns the converted integer.
  14853. * @example
  14854. *
  14855. * _.parseInt('08');
  14856. * // => 8
  14857. *
  14858. * _.map(['6', '08', '10'], _.parseInt);
  14859. * // => [6, 8, 10]
  14860. */
  14861. function parseInt(string, radix, guard) {
  14862. if (guard || radix == null) {
  14863. radix = 0;
  14864. } else if (radix) {
  14865. radix = +radix;
  14866. }
  14867. return nativeParseInt(toString(string).replace(reTrimStart, ''), radix || 0);
  14868. }
  14869. /**
  14870. * Repeats the given string `n` times.
  14871. *
  14872. * @static
  14873. * @memberOf _
  14874. * @since 3.0.0
  14875. * @category String
  14876. * @param {string} [string=''] The string to repeat.
  14877. * @param {number} [n=1] The number of times to repeat the string.
  14878. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  14879. * @returns {string} Returns the repeated string.
  14880. * @example
  14881. *
  14882. * _.repeat('*', 3);
  14883. * // => '***'
  14884. *
  14885. * _.repeat('abc', 2);
  14886. * // => 'abcabc'
  14887. *
  14888. * _.repeat('abc', 0);
  14889. * // => ''
  14890. */
  14891. function repeat(string, n, guard) {
  14892. if ((guard ? isIterateeCall(string, n, guard) : n === undefined)) {
  14893. n = 1;
  14894. } else {
  14895. n = toInteger(n);
  14896. }
  14897. return baseRepeat(toString(string), n);
  14898. }
  14899. /**
  14900. * Replaces matches for `pattern` in `string` with `replacement`.
  14901. *
  14902. * **Note:** This method is based on
  14903. * [`String#replace`](https://mdn.io/String/replace).
  14904. *
  14905. * @static
  14906. * @memberOf _
  14907. * @since 4.0.0
  14908. * @category String
  14909. * @param {string} [string=''] The string to modify.
  14910. * @param {RegExp|string} pattern The pattern to replace.
  14911. * @param {Function|string} replacement The match replacement.
  14912. * @returns {string} Returns the modified string.
  14913. * @example
  14914. *
  14915. * _.replace('Hi Fred', 'Fred', 'Barney');
  14916. * // => 'Hi Barney'
  14917. */
  14918. function replace() {
  14919. var args = arguments,
  14920. string = toString(args[0]);
  14921. return args.length < 3 ? string : string.replace(args[1], args[2]);
  14922. }
  14923. /**
  14924. * Converts `string` to
  14925. * [snake case](https://en.wikipedia.org/wiki/Snake_case).
  14926. *
  14927. * @static
  14928. * @memberOf _
  14929. * @since 3.0.0
  14930. * @category String
  14931. * @param {string} [string=''] The string to convert.
  14932. * @returns {string} Returns the snake cased string.
  14933. * @example
  14934. *
  14935. * _.snakeCase('Foo Bar');
  14936. * // => 'foo_bar'
  14937. *
  14938. * _.snakeCase('fooBar');
  14939. * // => 'foo_bar'
  14940. *
  14941. * _.snakeCase('--FOO-BAR--');
  14942. * // => 'foo_bar'
  14943. */
  14944. var snakeCase = createCompounder(function(result, word, index) {
  14945. return result + (index ? '_' : '') + word.toLowerCase();
  14946. });
  14947. /**
  14948. * Splits `string` by `separator`.
  14949. *
  14950. * **Note:** This method is based on
  14951. * [`String#split`](https://mdn.io/String/split).
  14952. *
  14953. * @static
  14954. * @memberOf _
  14955. * @since 4.0.0
  14956. * @category String
  14957. * @param {string} [string=''] The string to split.
  14958. * @param {RegExp|string} separator The separator pattern to split by.
  14959. * @param {number} [limit] The length to truncate results to.
  14960. * @returns {Array} Returns the string segments.
  14961. * @example
  14962. *
  14963. * _.split('a-b-c', '-', 2);
  14964. * // => ['a', 'b']
  14965. */
  14966. function split(string, separator, limit) {
  14967. if (limit && typeof limit != 'number' && isIterateeCall(string, separator, limit)) {
  14968. separator = limit = undefined;
  14969. }
  14970. limit = limit === undefined ? MAX_ARRAY_LENGTH : limit >>> 0;
  14971. if (!limit) {
  14972. return [];
  14973. }
  14974. string = toString(string);
  14975. if (string && (
  14976. typeof separator == 'string' ||
  14977. (separator != null && !isRegExp(separator))
  14978. )) {
  14979. separator = baseToString(separator);
  14980. if (!separator && hasUnicode(string)) {
  14981. return castSlice(stringToArray(string), 0, limit);
  14982. }
  14983. }
  14984. return string.split(separator, limit);
  14985. }
  14986. /**
  14987. * Converts `string` to
  14988. * [start case](https://en.wikipedia.org/wiki/Letter_case#Stylistic_or_specialised_usage).
  14989. *
  14990. * @static
  14991. * @memberOf _
  14992. * @since 3.1.0
  14993. * @category String
  14994. * @param {string} [string=''] The string to convert.
  14995. * @returns {string} Returns the start cased string.
  14996. * @example
  14997. *
  14998. * _.startCase('--foo-bar--');
  14999. * // => 'Foo Bar'
  15000. *
  15001. * _.startCase('fooBar');
  15002. * // => 'Foo Bar'
  15003. *
  15004. * _.startCase('__FOO_BAR__');
  15005. * // => 'FOO BAR'
  15006. */
  15007. var startCase = createCompounder(function(result, word, index) {
  15008. return result + (index ? ' ' : '') + upperFirst(word);
  15009. });
  15010. /**
  15011. * Checks if `string` starts with the given target string.
  15012. *
  15013. * @static
  15014. * @memberOf _
  15015. * @since 3.0.0
  15016. * @category String
  15017. * @param {string} [string=''] The string to inspect.
  15018. * @param {string} [target] The string to search for.
  15019. * @param {number} [position=0] The position to search from.
  15020. * @returns {boolean} Returns `true` if `string` starts with `target`,
  15021. * else `false`.
  15022. * @example
  15023. *
  15024. * _.startsWith('abc', 'a');
  15025. * // => true
  15026. *
  15027. * _.startsWith('abc', 'b');
  15028. * // => false
  15029. *
  15030. * _.startsWith('abc', 'b', 1);
  15031. * // => true
  15032. */
  15033. function startsWith(string, target, position) {
  15034. string = toString(string);
  15035. position = position == null
  15036. ? 0
  15037. : baseClamp(toInteger(position), 0, string.length);
  15038. target = baseToString(target);
  15039. return string.slice(position, position + target.length) == target;
  15040. }
  15041. /**
  15042. * Creates a compiled template function that can interpolate data properties
  15043. * in "interpolate" delimiters, HTML-escape interpolated data properties in
  15044. * "escape" delimiters, and execute JavaScript in "evaluate" delimiters. Data
  15045. * properties may be accessed as free variables in the template. If a setting
  15046. * object is given, it takes precedence over `_.templateSettings` values.
  15047. *
  15048. * **Note:** In the development build `_.template` utilizes
  15049. * [sourceURLs](http://www.html5rocks.com/en/tutorials/developertools/sourcemaps/#toc-sourceurl)
  15050. * for easier debugging.
  15051. *
  15052. * For more information on precompiling templates see
  15053. * [lodash's custom builds documentation](https://lodash.com/custom-builds).
  15054. *
  15055. * For more information on Chrome extension sandboxes see
  15056. * [Chrome's extensions documentation](https://developer.chrome.com/extensions/sandboxingEval).
  15057. *
  15058. * @static
  15059. * @since 0.1.0
  15060. * @memberOf _
  15061. * @category String
  15062. * @param {string} [string=''] The template string.
  15063. * @param {Object} [options={}] The options object.
  15064. * @param {RegExp} [options.escape=_.templateSettings.escape]
  15065. * The HTML "escape" delimiter.
  15066. * @param {RegExp} [options.evaluate=_.templateSettings.evaluate]
  15067. * The "evaluate" delimiter.
  15068. * @param {Object} [options.imports=_.templateSettings.imports]
  15069. * An object to import into the template as free variables.
  15070. * @param {RegExp} [options.interpolate=_.templateSettings.interpolate]
  15071. * The "interpolate" delimiter.
  15072. * @param {string} [options.sourceURL='lodash.templateSources[n]']
  15073. * The sourceURL of the compiled template.
  15074. * @param {string} [options.variable='obj']
  15075. * The data object variable name.
  15076. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  15077. * @returns {Function} Returns the compiled template function.
  15078. * @example
  15079. *
  15080. * // Use the "interpolate" delimiter to create a compiled template.
  15081. * var compiled = _.template('hello <%= user %>!');
  15082. * compiled({ 'user': 'fred' });
  15083. * // => 'hello fred!'
  15084. *
  15085. * // Use the HTML "escape" delimiter to escape data property values.
  15086. * var compiled = _.template('<b><%- value %></b>');
  15087. * compiled({ 'value': '<script>' });
  15088. * // => '<b>&lt;script&gt;</b>'
  15089. *
  15090. * // Use the "evaluate" delimiter to execute JavaScript and generate HTML.
  15091. * var compiled = _.template('<% _.forEach(users, function(user) { %><li><%- user %></li><% }); %>');
  15092. * compiled({ 'users': ['fred', 'barney'] });
  15093. * // => '<li>fred</li><li>barney</li>'
  15094. *
  15095. * // Use the internal `print` function in "evaluate" delimiters.
  15096. * var compiled = _.template('<% print("hello " + user); %>!');
  15097. * compiled({ 'user': 'barney' });
  15098. * // => 'hello barney!'
  15099. *
  15100. * // Use the ES template literal delimiter as an "interpolate" delimiter.
  15101. * // Disable support by replacing the "interpolate" delimiter.
  15102. * var compiled = _.template('hello ${ user }!');
  15103. * compiled({ 'user': 'pebbles' });
  15104. * // => 'hello pebbles!'
  15105. *
  15106. * // Use backslashes to treat delimiters as plain text.
  15107. * var compiled = _.template('<%= "\\<%- value %\\>" %>');
  15108. * compiled({ 'value': 'ignored' });
  15109. * // => '<%- value %>'
  15110. *
  15111. * // Use the `imports` option to import `jQuery` as `jq`.
  15112. * var text = '<% jq.each(users, function(user) { %><li><%- user %></li><% }); %>';
  15113. * var compiled = _.template(text, { 'imports': { 'jq': jQuery } });
  15114. * compiled({ 'users': ['fred', 'barney'] });
  15115. * // => '<li>fred</li><li>barney</li>'
  15116. *
  15117. * // Use the `sourceURL` option to specify a custom sourceURL for the template.
  15118. * var compiled = _.template('hello <%= user %>!', { 'sourceURL': '/basic/greeting.jst' });
  15119. * compiled(data);
  15120. * // => Find the source of "greeting.jst" under the Sources tab or Resources panel of the web inspector.
  15121. *
  15122. * // Use the `variable` option to ensure a with-statement isn't used in the compiled template.
  15123. * var compiled = _.template('hi <%= data.user %>!', { 'variable': 'data' });
  15124. * compiled.source;
  15125. * // => function(data) {
  15126. * // var __t, __p = '';
  15127. * // __p += 'hi ' + ((__t = ( data.user )) == null ? '' : __t) + '!';
  15128. * // return __p;
  15129. * // }
  15130. *
  15131. * // Use custom template delimiters.
  15132. * _.templateSettings.interpolate = /{{([\s\S]+?)}}/g;
  15133. * var compiled = _.template('hello {{ user }}!');
  15134. * compiled({ 'user': 'mustache' });
  15135. * // => 'hello mustache!'
  15136. *
  15137. * // Use the `source` property to inline compiled templates for meaningful
  15138. * // line numbers in error messages and stack traces.
  15139. * fs.writeFileSync(path.join(process.cwd(), 'jst.js'), '\
  15140. * var JST = {\
  15141. * "main": ' + _.template(mainText).source + '\
  15142. * };\
  15143. * ');
  15144. */
  15145. function template(string, options, guard) {
  15146. // Based on John Resig's `tmpl` implementation
  15147. // (http://ejohn.org/blog/javascript-micro-templating/)
  15148. // and Laura Doktorova's doT.js (https://github.com/olado/doT).
  15149. var settings = lodash.templateSettings;
  15150. if (guard && isIterateeCall(string, options, guard)) {
  15151. options = undefined;
  15152. }
  15153. string = toString(string);
  15154. options = assignInWith({}, options, settings, customDefaultsAssignIn);
  15155. var imports = assignInWith({}, options.imports, settings.imports, customDefaultsAssignIn),
  15156. importsKeys = keys(imports),
  15157. importsValues = baseValues(imports, importsKeys);
  15158. var isEscaping,
  15159. isEvaluating,
  15160. index = 0,
  15161. interpolate = options.interpolate || reNoMatch,
  15162. source = "__p += '";
  15163. // Compile the regexp to match each delimiter.
  15164. var reDelimiters = RegExp(
  15165. (options.escape || reNoMatch).source + '|' +
  15166. interpolate.source + '|' +
  15167. (interpolate === reInterpolate ? reEsTemplate : reNoMatch).source + '|' +
  15168. (options.evaluate || reNoMatch).source + '|$'
  15169. , 'g');
  15170. // Use a sourceURL for easier debugging.
  15171. // The sourceURL gets injected into the source that's eval-ed, so be careful
  15172. // to normalize all kinds of whitespace, so e.g. newlines (and unicode versions of it) can't sneak in
  15173. // and escape the comment, thus injecting code that gets evaled.
  15174. var sourceURL = '//# sourceURL=' +
  15175. (hasOwnProperty.call(options, 'sourceURL')
  15176. ? (options.sourceURL + '').replace(/\s/g, ' ')
  15177. : ('lodash.templateSources[' + (++templateCounter) + ']')
  15178. ) + '\n';
  15179. string.replace(reDelimiters, function(match, escapeValue, interpolateValue, esTemplateValue, evaluateValue, offset) {
  15180. interpolateValue || (interpolateValue = esTemplateValue);
  15181. // Escape characters that can't be included in string literals.
  15182. source += string.slice(index, offset).replace(reUnescapedString, escapeStringChar);
  15183. // Replace delimiters with snippets.
  15184. if (escapeValue) {
  15185. isEscaping = true;
  15186. source += "' +\n__e(" + escapeValue + ") +\n'";
  15187. }
  15188. if (evaluateValue) {
  15189. isEvaluating = true;
  15190. source += "';\n" + evaluateValue + ";\n__p += '";
  15191. }
  15192. if (interpolateValue) {
  15193. source += "' +\n((__t = (" + interpolateValue + ")) == null ? '' : __t) +\n'";
  15194. }
  15195. index = offset + match.length;
  15196. // The JS engine embedded in Adobe products needs `match` returned in
  15197. // order to produce the correct `offset` value.
  15198. return match;
  15199. });
  15200. source += "';\n";
  15201. // If `variable` is not specified wrap a with-statement around the generated
  15202. // code to add the data object to the top of the scope chain.
  15203. var variable = hasOwnProperty.call(options, 'variable') && options.variable;
  15204. if (!variable) {
  15205. source = 'with (obj) {\n' + source + '\n}\n';
  15206. }
  15207. // Throw an error if a forbidden character was found in `variable`, to prevent
  15208. // potential command injection attacks.
  15209. else if (reForbiddenIdentifierChars.test(variable)) {
  15210. throw new Error(INVALID_TEMPL_VAR_ERROR_TEXT);
  15211. }
  15212. // Cleanup code by stripping empty strings.
  15213. source = (isEvaluating ? source.replace(reEmptyStringLeading, '') : source)
  15214. .replace(reEmptyStringMiddle, '$1')
  15215. .replace(reEmptyStringTrailing, '$1;');
  15216. // Frame code as the function body.
  15217. source = 'function(' + (variable || 'obj') + ') {\n' +
  15218. (variable
  15219. ? ''
  15220. : 'obj || (obj = {});\n'
  15221. ) +
  15222. "var __t, __p = ''" +
  15223. (isEscaping
  15224. ? ', __e = _.escape'
  15225. : ''
  15226. ) +
  15227. (isEvaluating
  15228. ? ', __j = Array.prototype.join;\n' +
  15229. "function print() { __p += __j.call(arguments, '') }\n"
  15230. : ';\n'
  15231. ) +
  15232. source +
  15233. 'return __p\n}';
  15234. var result = attempt(function() {
  15235. return Function(importsKeys, sourceURL + 'return ' + source)
  15236. .apply(undefined, importsValues);
  15237. });
  15238. // Provide the compiled function's source by its `toString` method or
  15239. // the `source` property as a convenience for inlining compiled templates.
  15240. result.source = source;
  15241. if (isError(result)) {
  15242. throw result;
  15243. }
  15244. return result;
  15245. }
  15246. /**
  15247. * Converts `string`, as a whole, to lower case just like
  15248. * [String#toLowerCase](https://mdn.io/toLowerCase).
  15249. *
  15250. * @static
  15251. * @memberOf _
  15252. * @since 4.0.0
  15253. * @category String
  15254. * @param {string} [string=''] The string to convert.
  15255. * @returns {string} Returns the lower cased string.
  15256. * @example
  15257. *
  15258. * _.toLower('--Foo-Bar--');
  15259. * // => '--foo-bar--'
  15260. *
  15261. * _.toLower('fooBar');
  15262. * // => 'foobar'
  15263. *
  15264. * _.toLower('__FOO_BAR__');
  15265. * // => '__foo_bar__'
  15266. */
  15267. function toLower(value) {
  15268. return toString(value).toLowerCase();
  15269. }
  15270. /**
  15271. * Converts `string`, as a whole, to upper case just like
  15272. * [String#toUpperCase](https://mdn.io/toUpperCase).
  15273. *
  15274. * @static
  15275. * @memberOf _
  15276. * @since 4.0.0
  15277. * @category String
  15278. * @param {string} [string=''] The string to convert.
  15279. * @returns {string} Returns the upper cased string.
  15280. * @example
  15281. *
  15282. * _.toUpper('--foo-bar--');
  15283. * // => '--FOO-BAR--'
  15284. *
  15285. * _.toUpper('fooBar');
  15286. * // => 'FOOBAR'
  15287. *
  15288. * _.toUpper('__foo_bar__');
  15289. * // => '__FOO_BAR__'
  15290. */
  15291. function toUpper(value) {
  15292. return toString(value).toUpperCase();
  15293. }
  15294. /**
  15295. * Removes leading and trailing whitespace or specified characters from `string`.
  15296. *
  15297. * @static
  15298. * @memberOf _
  15299. * @since 3.0.0
  15300. * @category String
  15301. * @param {string} [string=''] The string to trim.
  15302. * @param {string} [chars=whitespace] The characters to trim.
  15303. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  15304. * @returns {string} Returns the trimmed string.
  15305. * @example
  15306. *
  15307. * _.trim(' abc ');
  15308. * // => 'abc'
  15309. *
  15310. * _.trim('-_-abc-_-', '_-');
  15311. * // => 'abc'
  15312. *
  15313. * _.map([' foo ', ' bar '], _.trim);
  15314. * // => ['foo', 'bar']
  15315. */
  15316. function trim(string, chars, guard) {
  15317. string = toString(string);
  15318. if (string && (guard || chars === undefined)) {
  15319. return baseTrim(string);
  15320. }
  15321. if (!string || !(chars = baseToString(chars))) {
  15322. return string;
  15323. }
  15324. var strSymbols = stringToArray(string),
  15325. chrSymbols = stringToArray(chars),
  15326. start = charsStartIndex(strSymbols, chrSymbols),
  15327. end = charsEndIndex(strSymbols, chrSymbols) + 1;
  15328. return castSlice(strSymbols, start, end).join('');
  15329. }
  15330. /**
  15331. * Removes trailing whitespace or specified characters from `string`.
  15332. *
  15333. * @static
  15334. * @memberOf _
  15335. * @since 4.0.0
  15336. * @category String
  15337. * @param {string} [string=''] The string to trim.
  15338. * @param {string} [chars=whitespace] The characters to trim.
  15339. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  15340. * @returns {string} Returns the trimmed string.
  15341. * @example
  15342. *
  15343. * _.trimEnd(' abc ');
  15344. * // => ' abc'
  15345. *
  15346. * _.trimEnd('-_-abc-_-', '_-');
  15347. * // => '-_-abc'
  15348. */
  15349. function trimEnd(string, chars, guard) {
  15350. string = toString(string);
  15351. if (string && (guard || chars === undefined)) {
  15352. return string.slice(0, trimmedEndIndex(string) + 1);
  15353. }
  15354. if (!string || !(chars = baseToString(chars))) {
  15355. return string;
  15356. }
  15357. var strSymbols = stringToArray(string),
  15358. end = charsEndIndex(strSymbols, stringToArray(chars)) + 1;
  15359. return castSlice(strSymbols, 0, end).join('');
  15360. }
  15361. /**
  15362. * Removes leading whitespace or specified characters from `string`.
  15363. *
  15364. * @static
  15365. * @memberOf _
  15366. * @since 4.0.0
  15367. * @category String
  15368. * @param {string} [string=''] The string to trim.
  15369. * @param {string} [chars=whitespace] The characters to trim.
  15370. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  15371. * @returns {string} Returns the trimmed string.
  15372. * @example
  15373. *
  15374. * _.trimStart(' abc ');
  15375. * // => 'abc '
  15376. *
  15377. * _.trimStart('-_-abc-_-', '_-');
  15378. * // => 'abc-_-'
  15379. */
  15380. function trimStart(string, chars, guard) {
  15381. string = toString(string);
  15382. if (string && (guard || chars === undefined)) {
  15383. return string.replace(reTrimStart, '');
  15384. }
  15385. if (!string || !(chars = baseToString(chars))) {
  15386. return string;
  15387. }
  15388. var strSymbols = stringToArray(string),
  15389. start = charsStartIndex(strSymbols, stringToArray(chars));
  15390. return castSlice(strSymbols, start).join('');
  15391. }
  15392. /**
  15393. * Truncates `string` if it's longer than the given maximum string length.
  15394. * The last characters of the truncated string are replaced with the omission
  15395. * string which defaults to "...".
  15396. *
  15397. * @static
  15398. * @memberOf _
  15399. * @since 4.0.0
  15400. * @category String
  15401. * @param {string} [string=''] The string to truncate.
  15402. * @param {Object} [options={}] The options object.
  15403. * @param {number} [options.length=30] The maximum string length.
  15404. * @param {string} [options.omission='...'] The string to indicate text is omitted.
  15405. * @param {RegExp|string} [options.separator] The separator pattern to truncate to.
  15406. * @returns {string} Returns the truncated string.
  15407. * @example
  15408. *
  15409. * _.truncate('hi-diddly-ho there, neighborino');
  15410. * // => 'hi-diddly-ho there, neighbo...'
  15411. *
  15412. * _.truncate('hi-diddly-ho there, neighborino', {
  15413. * 'length': 24,
  15414. * 'separator': ' '
  15415. * });
  15416. * // => 'hi-diddly-ho there,...'
  15417. *
  15418. * _.truncate('hi-diddly-ho there, neighborino', {
  15419. * 'length': 24,
  15420. * 'separator': /,? +/
  15421. * });
  15422. * // => 'hi-diddly-ho there...'
  15423. *
  15424. * _.truncate('hi-diddly-ho there, neighborino', {
  15425. * 'omission': ' [...]'
  15426. * });
  15427. * // => 'hi-diddly-ho there, neig [...]'
  15428. */
  15429. function truncate(string, options) {
  15430. var length = DEFAULT_TRUNC_LENGTH,
  15431. omission = DEFAULT_TRUNC_OMISSION;
  15432. if (isObject(options)) {
  15433. var separator = 'separator' in options ? options.separator : separator;
  15434. length = 'length' in options ? toInteger(options.length) : length;
  15435. omission = 'omission' in options ? baseToString(options.omission) : omission;
  15436. }
  15437. string = toString(string);
  15438. var strLength = string.length;
  15439. if (hasUnicode(string)) {
  15440. var strSymbols = stringToArray(string);
  15441. strLength = strSymbols.length;
  15442. }
  15443. if (length >= strLength) {
  15444. return string;
  15445. }
  15446. var end = length - stringSize(omission);
  15447. if (end < 1) {
  15448. return omission;
  15449. }
  15450. var result = strSymbols
  15451. ? castSlice(strSymbols, 0, end).join('')
  15452. : string.slice(0, end);
  15453. if (separator === undefined) {
  15454. return result + omission;
  15455. }
  15456. if (strSymbols) {
  15457. end += (result.length - end);
  15458. }
  15459. if (isRegExp(separator)) {
  15460. if (string.slice(end).search(separator)) {
  15461. var match,
  15462. substring = result;
  15463. if (!separator.global) {
  15464. separator = RegExp(separator.source, toString(reFlags.exec(separator)) + 'g');
  15465. }
  15466. separator.lastIndex = 0;
  15467. while ((match = separator.exec(substring))) {
  15468. var newEnd = match.index;
  15469. }
  15470. result = result.slice(0, newEnd === undefined ? end : newEnd);
  15471. }
  15472. } else if (string.indexOf(baseToString(separator), end) != end) {
  15473. var index = result.lastIndexOf(separator);
  15474. if (index > -1) {
  15475. result = result.slice(0, index);
  15476. }
  15477. }
  15478. return result + omission;
  15479. }
  15480. /**
  15481. * The inverse of `_.escape`; this method converts the HTML entities
  15482. * `&amp;`, `&lt;`, `&gt;`, `&quot;`, and `&#39;` in `string` to
  15483. * their corresponding characters.
  15484. *
  15485. * **Note:** No other HTML entities are unescaped. To unescape additional
  15486. * HTML entities use a third-party library like [_he_](https://mths.be/he).
  15487. *
  15488. * @static
  15489. * @memberOf _
  15490. * @since 0.6.0
  15491. * @category String
  15492. * @param {string} [string=''] The string to unescape.
  15493. * @returns {string} Returns the unescaped string.
  15494. * @example
  15495. *
  15496. * _.unescape('fred, barney, &amp; pebbles');
  15497. * // => 'fred, barney, & pebbles'
  15498. */
  15499. function unescape(string) {
  15500. string = toString(string);
  15501. return (string && reHasEscapedHtml.test(string))
  15502. ? string.replace(reEscapedHtml, unescapeHtmlChar)
  15503. : string;
  15504. }
  15505. /**
  15506. * Converts `string`, as space separated words, to upper case.
  15507. *
  15508. * @static
  15509. * @memberOf _
  15510. * @since 4.0.0
  15511. * @category String
  15512. * @param {string} [string=''] The string to convert.
  15513. * @returns {string} Returns the upper cased string.
  15514. * @example
  15515. *
  15516. * _.upperCase('--foo-bar');
  15517. * // => 'FOO BAR'
  15518. *
  15519. * _.upperCase('fooBar');
  15520. * // => 'FOO BAR'
  15521. *
  15522. * _.upperCase('__foo_bar__');
  15523. * // => 'FOO BAR'
  15524. */
  15525. var upperCase = createCompounder(function(result, word, index) {
  15526. return result + (index ? ' ' : '') + word.toUpperCase();
  15527. });
  15528. /**
  15529. * Converts the first character of `string` to upper case.
  15530. *
  15531. * @static
  15532. * @memberOf _
  15533. * @since 4.0.0
  15534. * @category String
  15535. * @param {string} [string=''] The string to convert.
  15536. * @returns {string} Returns the converted string.
  15537. * @example
  15538. *
  15539. * _.upperFirst('fred');
  15540. * // => 'Fred'
  15541. *
  15542. * _.upperFirst('FRED');
  15543. * // => 'FRED'
  15544. */
  15545. var upperFirst = createCaseFirst('toUpperCase');
  15546. /**
  15547. * Splits `string` into an array of its words.
  15548. *
  15549. * @static
  15550. * @memberOf _
  15551. * @since 3.0.0
  15552. * @category String
  15553. * @param {string} [string=''] The string to inspect.
  15554. * @param {RegExp|string} [pattern] The pattern to match words.
  15555. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
  15556. * @returns {Array} Returns the words of `string`.
  15557. * @example
  15558. *
  15559. * _.words('fred, barney, & pebbles');
  15560. * // => ['fred', 'barney', 'pebbles']
  15561. *
  15562. * _.words('fred, barney, & pebbles', /[^, ]+/g);
  15563. * // => ['fred', 'barney', '&', 'pebbles']
  15564. */
  15565. function words(string, pattern, guard) {
  15566. string = toString(string);
  15567. pattern = guard ? undefined : pattern;
  15568. if (pattern === undefined) {
  15569. return hasUnicodeWord(string) ? unicodeWords(string) : asciiWords(string);
  15570. }
  15571. return string.match(pattern) || [];
  15572. }
  15573. /*------------------------------------------------------------------------*/
  15574. /**
  15575. * Attempts to invoke `func`, returning either the result or the caught error
  15576. * object. Any additional arguments are provided to `func` when it's invoked.
  15577. *
  15578. * @static
  15579. * @memberOf _
  15580. * @since 3.0.0
  15581. * @category Util
  15582. * @param {Function} func The function to attempt.
  15583. * @param {...*} [args] The arguments to invoke `func` with.
  15584. * @returns {*} Returns the `func` result or error object.
  15585. * @example
  15586. *
  15587. * // Avoid throwing errors for invalid selectors.
  15588. * var elements = _.attempt(function(selector) {
  15589. * return document.querySelectorAll(selector);
  15590. * }, '>_>');
  15591. *
  15592. * if (_.isError(elements)) {
  15593. * elements = [];
  15594. * }
  15595. */
  15596. var attempt = baseRest(function(func, args) {
  15597. try {
  15598. return apply(func, undefined, args);
  15599. } catch (e) {
  15600. return isError(e) ? e : new Error(e);
  15601. }
  15602. });
  15603. /**
  15604. * Binds methods of an object to the object itself, overwriting the existing
  15605. * method.
  15606. *
  15607. * **Note:** This method doesn't set the "length" property of bound functions.
  15608. *
  15609. * @static
  15610. * @since 0.1.0
  15611. * @memberOf _
  15612. * @category Util
  15613. * @param {Object} object The object to bind and assign the bound methods to.
  15614. * @param {...(string|string[])} methodNames The object method names to bind.
  15615. * @returns {Object} Returns `object`.
  15616. * @example
  15617. *
  15618. * var view = {
  15619. * 'label': 'docs',
  15620. * 'click': function() {
  15621. * console.log('clicked ' + this.label);
  15622. * }
  15623. * };
  15624. *
  15625. * _.bindAll(view, ['click']);
  15626. * jQuery(element).on('click', view.click);
  15627. * // => Logs 'clicked docs' when clicked.
  15628. */
  15629. var bindAll = flatRest(function(object, methodNames) {
  15630. arrayEach(methodNames, function(key) {
  15631. key = toKey(key);
  15632. baseAssignValue(object, key, bind(object[key], object));
  15633. });
  15634. return object;
  15635. });
  15636. /**
  15637. * Creates a function that iterates over `pairs` and invokes the corresponding
  15638. * function of the first predicate to return truthy. The predicate-function
  15639. * pairs are invoked with the `this` binding and arguments of the created
  15640. * function.
  15641. *
  15642. * @static
  15643. * @memberOf _
  15644. * @since 4.0.0
  15645. * @category Util
  15646. * @param {Array} pairs The predicate-function pairs.
  15647. * @returns {Function} Returns the new composite function.
  15648. * @example
  15649. *
  15650. * var func = _.cond([
  15651. * [_.matches({ 'a': 1 }), _.constant('matches A')],
  15652. * [_.conforms({ 'b': _.isNumber }), _.constant('matches B')],
  15653. * [_.stubTrue, _.constant('no match')]
  15654. * ]);
  15655. *
  15656. * func({ 'a': 1, 'b': 2 });
  15657. * // => 'matches A'
  15658. *
  15659. * func({ 'a': 0, 'b': 1 });
  15660. * // => 'matches B'
  15661. *
  15662. * func({ 'a': '1', 'b': '2' });
  15663. * // => 'no match'
  15664. */
  15665. function cond(pairs) {
  15666. var length = pairs == null ? 0 : pairs.length,
  15667. toIteratee = getIteratee();
  15668. pairs = !length ? [] : arrayMap(pairs, function(pair) {
  15669. if (typeof pair[1] != 'function') {
  15670. throw new TypeError(FUNC_ERROR_TEXT);
  15671. }
  15672. return [toIteratee(pair[0]), pair[1]];
  15673. });
  15674. return baseRest(function(args) {
  15675. var index = -1;
  15676. while (++index < length) {
  15677. var pair = pairs[index];
  15678. if (apply(pair[0], this, args)) {
  15679. return apply(pair[1], this, args);
  15680. }
  15681. }
  15682. });
  15683. }
  15684. /**
  15685. * Creates a function that invokes the predicate properties of `source` with
  15686. * the corresponding property values of a given object, returning `true` if
  15687. * all predicates return truthy, else `false`.
  15688. *
  15689. * **Note:** The created function is equivalent to `_.conformsTo` with
  15690. * `source` partially applied.
  15691. *
  15692. * @static
  15693. * @memberOf _
  15694. * @since 4.0.0
  15695. * @category Util
  15696. * @param {Object} source The object of property predicates to conform to.
  15697. * @returns {Function} Returns the new spec function.
  15698. * @example
  15699. *
  15700. * var objects = [
  15701. * { 'a': 2, 'b': 1 },
  15702. * { 'a': 1, 'b': 2 }
  15703. * ];
  15704. *
  15705. * _.filter(objects, _.conforms({ 'b': function(n) { return n > 1; } }));
  15706. * // => [{ 'a': 1, 'b': 2 }]
  15707. */
  15708. function conforms(source) {
  15709. return baseConforms(baseClone(source, CLONE_DEEP_FLAG));
  15710. }
  15711. /**
  15712. * Creates a function that returns `value`.
  15713. *
  15714. * @static
  15715. * @memberOf _
  15716. * @since 2.4.0
  15717. * @category Util
  15718. * @param {*} value The value to return from the new function.
  15719. * @returns {Function} Returns the new constant function.
  15720. * @example
  15721. *
  15722. * var objects = _.times(2, _.constant({ 'a': 1 }));
  15723. *
  15724. * console.log(objects);
  15725. * // => [{ 'a': 1 }, { 'a': 1 }]
  15726. *
  15727. * console.log(objects[0] === objects[1]);
  15728. * // => true
  15729. */
  15730. function constant(value) {
  15731. return function() {
  15732. return value;
  15733. };
  15734. }
  15735. /**
  15736. * Checks `value` to determine whether a default value should be returned in
  15737. * its place. The `defaultValue` is returned if `value` is `NaN`, `null`,
  15738. * or `undefined`.
  15739. *
  15740. * @static
  15741. * @memberOf _
  15742. * @since 4.14.0
  15743. * @category Util
  15744. * @param {*} value The value to check.
  15745. * @param {*} defaultValue The default value.
  15746. * @returns {*} Returns the resolved value.
  15747. * @example
  15748. *
  15749. * _.defaultTo(1, 10);
  15750. * // => 1
  15751. *
  15752. * _.defaultTo(undefined, 10);
  15753. * // => 10
  15754. */
  15755. function defaultTo(value, defaultValue) {
  15756. return (value == null || value !== value) ? defaultValue : value;
  15757. }
  15758. /**
  15759. * Creates a function that returns the result of invoking the given functions
  15760. * with the `this` binding of the created function, where each successive
  15761. * invocation is supplied the return value of the previous.
  15762. *
  15763. * @static
  15764. * @memberOf _
  15765. * @since 3.0.0
  15766. * @category Util
  15767. * @param {...(Function|Function[])} [funcs] The functions to invoke.
  15768. * @returns {Function} Returns the new composite function.
  15769. * @see _.flowRight
  15770. * @example
  15771. *
  15772. * function square(n) {
  15773. * return n * n;
  15774. * }
  15775. *
  15776. * var addSquare = _.flow([_.add, square]);
  15777. * addSquare(1, 2);
  15778. * // => 9
  15779. */
  15780. var flow = createFlow();
  15781. /**
  15782. * This method is like `_.flow` except that it creates a function that
  15783. * invokes the given functions from right to left.
  15784. *
  15785. * @static
  15786. * @since 3.0.0
  15787. * @memberOf _
  15788. * @category Util
  15789. * @param {...(Function|Function[])} [funcs] The functions to invoke.
  15790. * @returns {Function} Returns the new composite function.
  15791. * @see _.flow
  15792. * @example
  15793. *
  15794. * function square(n) {
  15795. * return n * n;
  15796. * }
  15797. *
  15798. * var addSquare = _.flowRight([square, _.add]);
  15799. * addSquare(1, 2);
  15800. * // => 9
  15801. */
  15802. var flowRight = createFlow(true);
  15803. /**
  15804. * This method returns the first argument it receives.
  15805. *
  15806. * @static
  15807. * @since 0.1.0
  15808. * @memberOf _
  15809. * @category Util
  15810. * @param {*} value Any value.
  15811. * @returns {*} Returns `value`.
  15812. * @example
  15813. *
  15814. * var object = { 'a': 1 };
  15815. *
  15816. * console.log(_.identity(object) === object);
  15817. * // => true
  15818. */
  15819. function identity(value) {
  15820. return value;
  15821. }
  15822. /**
  15823. * Creates a function that invokes `func` with the arguments of the created
  15824. * function. If `func` is a property name, the created function returns the
  15825. * property value for a given element. If `func` is an array or object, the
  15826. * created function returns `true` for elements that contain the equivalent
  15827. * source properties, otherwise it returns `false`.
  15828. *
  15829. * @static
  15830. * @since 4.0.0
  15831. * @memberOf _
  15832. * @category Util
  15833. * @param {*} [func=_.identity] The value to convert to a callback.
  15834. * @returns {Function} Returns the callback.
  15835. * @example
  15836. *
  15837. * var users = [
  15838. * { 'user': 'barney', 'age': 36, 'active': true },
  15839. * { 'user': 'fred', 'age': 40, 'active': false }
  15840. * ];
  15841. *
  15842. * // The `_.matches` iteratee shorthand.
  15843. * _.filter(users, _.iteratee({ 'user': 'barney', 'active': true }));
  15844. * // => [{ 'user': 'barney', 'age': 36, 'active': true }]
  15845. *
  15846. * // The `_.matchesProperty` iteratee shorthand.
  15847. * _.filter(users, _.iteratee(['user', 'fred']));
  15848. * // => [{ 'user': 'fred', 'age': 40 }]
  15849. *
  15850. * // The `_.property` iteratee shorthand.
  15851. * _.map(users, _.iteratee('user'));
  15852. * // => ['barney', 'fred']
  15853. *
  15854. * // Create custom iteratee shorthands.
  15855. * _.iteratee = _.wrap(_.iteratee, function(iteratee, func) {
  15856. * return !_.isRegExp(func) ? iteratee(func) : function(string) {
  15857. * return func.test(string);
  15858. * };
  15859. * });
  15860. *
  15861. * _.filter(['abc', 'def'], /ef/);
  15862. * // => ['def']
  15863. */
  15864. function iteratee(func) {
  15865. return baseIteratee(typeof func == 'function' ? func : baseClone(func, CLONE_DEEP_FLAG));
  15866. }
  15867. /**
  15868. * Creates a function that performs a partial deep comparison between a given
  15869. * object and `source`, returning `true` if the given object has equivalent
  15870. * property values, else `false`.
  15871. *
  15872. * **Note:** The created function is equivalent to `_.isMatch` with `source`
  15873. * partially applied.
  15874. *
  15875. * Partial comparisons will match empty array and empty object `source`
  15876. * values against any array or object value, respectively. See `_.isEqual`
  15877. * for a list of supported value comparisons.
  15878. *
  15879. * **Note:** Multiple values can be checked by combining several matchers
  15880. * using `_.overSome`
  15881. *
  15882. * @static
  15883. * @memberOf _
  15884. * @since 3.0.0
  15885. * @category Util
  15886. * @param {Object} source The object of property values to match.
  15887. * @returns {Function} Returns the new spec function.
  15888. * @example
  15889. *
  15890. * var objects = [
  15891. * { 'a': 1, 'b': 2, 'c': 3 },
  15892. * { 'a': 4, 'b': 5, 'c': 6 }
  15893. * ];
  15894. *
  15895. * _.filter(objects, _.matches({ 'a': 4, 'c': 6 }));
  15896. * // => [{ 'a': 4, 'b': 5, 'c': 6 }]
  15897. *
  15898. * // Checking for several possible values
  15899. * _.filter(objects, _.overSome([_.matches({ 'a': 1 }), _.matches({ 'a': 4 })]));
  15900. * // => [{ 'a': 1, 'b': 2, 'c': 3 }, { 'a': 4, 'b': 5, 'c': 6 }]
  15901. */
  15902. function matches(source) {
  15903. return baseMatches(baseClone(source, CLONE_DEEP_FLAG));
  15904. }
  15905. /**
  15906. * Creates a function that performs a partial deep comparison between the
  15907. * value at `path` of a given object to `srcValue`, returning `true` if the
  15908. * object value is equivalent, else `false`.
  15909. *
  15910. * **Note:** Partial comparisons will match empty array and empty object
  15911. * `srcValue` values against any array or object value, respectively. See
  15912. * `_.isEqual` for a list of supported value comparisons.
  15913. *
  15914. * **Note:** Multiple values can be checked by combining several matchers
  15915. * using `_.overSome`
  15916. *
  15917. * @static
  15918. * @memberOf _
  15919. * @since 3.2.0
  15920. * @category Util
  15921. * @param {Array|string} path The path of the property to get.
  15922. * @param {*} srcValue The value to match.
  15923. * @returns {Function} Returns the new spec function.
  15924. * @example
  15925. *
  15926. * var objects = [
  15927. * { 'a': 1, 'b': 2, 'c': 3 },
  15928. * { 'a': 4, 'b': 5, 'c': 6 }
  15929. * ];
  15930. *
  15931. * _.find(objects, _.matchesProperty('a', 4));
  15932. * // => { 'a': 4, 'b': 5, 'c': 6 }
  15933. *
  15934. * // Checking for several possible values
  15935. * _.filter(objects, _.overSome([_.matchesProperty('a', 1), _.matchesProperty('a', 4)]));
  15936. * // => [{ 'a': 1, 'b': 2, 'c': 3 }, { 'a': 4, 'b': 5, 'c': 6 }]
  15937. */
  15938. function matchesProperty(path, srcValue) {
  15939. return baseMatchesProperty(path, baseClone(srcValue, CLONE_DEEP_FLAG));
  15940. }
  15941. /**
  15942. * Creates a function that invokes the method at `path` of a given object.
  15943. * Any additional arguments are provided to the invoked method.
  15944. *
  15945. * @static
  15946. * @memberOf _
  15947. * @since 3.7.0
  15948. * @category Util
  15949. * @param {Array|string} path The path of the method to invoke.
  15950. * @param {...*} [args] The arguments to invoke the method with.
  15951. * @returns {Function} Returns the new invoker function.
  15952. * @example
  15953. *
  15954. * var objects = [
  15955. * { 'a': { 'b': _.constant(2) } },
  15956. * { 'a': { 'b': _.constant(1) } }
  15957. * ];
  15958. *
  15959. * _.map(objects, _.method('a.b'));
  15960. * // => [2, 1]
  15961. *
  15962. * _.map(objects, _.method(['a', 'b']));
  15963. * // => [2, 1]
  15964. */
  15965. var method = baseRest(function(path, args) {
  15966. return function(object) {
  15967. return baseInvoke(object, path, args);
  15968. };
  15969. });
  15970. /**
  15971. * The opposite of `_.method`; this method creates a function that invokes
  15972. * the method at a given path of `object`. Any additional arguments are
  15973. * provided to the invoked method.
  15974. *
  15975. * @static
  15976. * @memberOf _
  15977. * @since 3.7.0
  15978. * @category Util
  15979. * @param {Object} object The object to query.
  15980. * @param {...*} [args] The arguments to invoke the method with.
  15981. * @returns {Function} Returns the new invoker function.
  15982. * @example
  15983. *
  15984. * var array = _.times(3, _.constant),
  15985. * object = { 'a': array, 'b': array, 'c': array };
  15986. *
  15987. * _.map(['a[2]', 'c[0]'], _.methodOf(object));
  15988. * // => [2, 0]
  15989. *
  15990. * _.map([['a', '2'], ['c', '0']], _.methodOf(object));
  15991. * // => [2, 0]
  15992. */
  15993. var methodOf = baseRest(function(object, args) {
  15994. return function(path) {
  15995. return baseInvoke(object, path, args);
  15996. };
  15997. });
  15998. /**
  15999. * Adds all own enumerable string keyed function properties of a source
  16000. * object to the destination object. If `object` is a function, then methods
  16001. * are added to its prototype as well.
  16002. *
  16003. * **Note:** Use `_.runInContext` to create a pristine `lodash` function to
  16004. * avoid conflicts caused by modifying the original.
  16005. *
  16006. * @static
  16007. * @since 0.1.0
  16008. * @memberOf _
  16009. * @category Util
  16010. * @param {Function|Object} [object=lodash] The destination object.
  16011. * @param {Object} source The object of functions to add.
  16012. * @param {Object} [options={}] The options object.
  16013. * @param {boolean} [options.chain=true] Specify whether mixins are chainable.
  16014. * @returns {Function|Object} Returns `object`.
  16015. * @example
  16016. *
  16017. * function vowels(string) {
  16018. * return _.filter(string, function(v) {
  16019. * return /[aeiou]/i.test(v);
  16020. * });
  16021. * }
  16022. *
  16023. * _.mixin({ 'vowels': vowels });
  16024. * _.vowels('fred');
  16025. * // => ['e']
  16026. *
  16027. * _('fred').vowels().value();
  16028. * // => ['e']
  16029. *
  16030. * _.mixin({ 'vowels': vowels }, { 'chain': false });
  16031. * _('fred').vowels();
  16032. * // => ['e']
  16033. */
  16034. function mixin(object, source, options) {
  16035. var props = keys(source),
  16036. methodNames = baseFunctions(source, props);
  16037. if (options == null &&
  16038. !(isObject(source) && (methodNames.length || !props.length))) {
  16039. options = source;
  16040. source = object;
  16041. object = this;
  16042. methodNames = baseFunctions(source, keys(source));
  16043. }
  16044. var chain = !(isObject(options) && 'chain' in options) || !!options.chain,
  16045. isFunc = isFunction(object);
  16046. arrayEach(methodNames, function(methodName) {
  16047. var func = source[methodName];
  16048. object[methodName] = func;
  16049. if (isFunc) {
  16050. object.prototype[methodName] = function() {
  16051. var chainAll = this.__chain__;
  16052. if (chain || chainAll) {
  16053. var result = object(this.__wrapped__),
  16054. actions = result.__actions__ = copyArray(this.__actions__);
  16055. actions.push({ 'func': func, 'args': arguments, 'thisArg': object });
  16056. result.__chain__ = chainAll;
  16057. return result;
  16058. }
  16059. return func.apply(object, arrayPush([this.value()], arguments));
  16060. };
  16061. }
  16062. });
  16063. return object;
  16064. }
  16065. /**
  16066. * Reverts the `_` variable to its previous value and returns a reference to
  16067. * the `lodash` function.
  16068. *
  16069. * @static
  16070. * @since 0.1.0
  16071. * @memberOf _
  16072. * @category Util
  16073. * @returns {Function} Returns the `lodash` function.
  16074. * @example
  16075. *
  16076. * var lodash = _.noConflict();
  16077. */
  16078. function noConflict() {
  16079. if (root._ === this) {
  16080. root._ = oldDash;
  16081. }
  16082. return this;
  16083. }
  16084. /**
  16085. * This method returns `undefined`.
  16086. *
  16087. * @static
  16088. * @memberOf _
  16089. * @since 2.3.0
  16090. * @category Util
  16091. * @example
  16092. *
  16093. * _.times(2, _.noop);
  16094. * // => [undefined, undefined]
  16095. */
  16096. function noop() {
  16097. // No operation performed.
  16098. }
  16099. /**
  16100. * Creates a function that gets the argument at index `n`. If `n` is negative,
  16101. * the nth argument from the end is returned.
  16102. *
  16103. * @static
  16104. * @memberOf _
  16105. * @since 4.0.0
  16106. * @category Util
  16107. * @param {number} [n=0] The index of the argument to return.
  16108. * @returns {Function} Returns the new pass-thru function.
  16109. * @example
  16110. *
  16111. * var func = _.nthArg(1);
  16112. * func('a', 'b', 'c', 'd');
  16113. * // => 'b'
  16114. *
  16115. * var func = _.nthArg(-2);
  16116. * func('a', 'b', 'c', 'd');
  16117. * // => 'c'
  16118. */
  16119. function nthArg(n) {
  16120. n = toInteger(n);
  16121. return baseRest(function(args) {
  16122. return baseNth(args, n);
  16123. });
  16124. }
  16125. /**
  16126. * Creates a function that invokes `iteratees` with the arguments it receives
  16127. * and returns their results.
  16128. *
  16129. * @static
  16130. * @memberOf _
  16131. * @since 4.0.0
  16132. * @category Util
  16133. * @param {...(Function|Function[])} [iteratees=[_.identity]]
  16134. * The iteratees to invoke.
  16135. * @returns {Function} Returns the new function.
  16136. * @example
  16137. *
  16138. * var func = _.over([Math.max, Math.min]);
  16139. *
  16140. * func(1, 2, 3, 4);
  16141. * // => [4, 1]
  16142. */
  16143. var over = createOver(arrayMap);
  16144. /**
  16145. * Creates a function that checks if **all** of the `predicates` return
  16146. * truthy when invoked with the arguments it receives.
  16147. *
  16148. * Following shorthands are possible for providing predicates.
  16149. * Pass an `Object` and it will be used as an parameter for `_.matches` to create the predicate.
  16150. * Pass an `Array` of parameters for `_.matchesProperty` and the predicate will be created using them.
  16151. *
  16152. * @static
  16153. * @memberOf _
  16154. * @since 4.0.0
  16155. * @category Util
  16156. * @param {...(Function|Function[])} [predicates=[_.identity]]
  16157. * The predicates to check.
  16158. * @returns {Function} Returns the new function.
  16159. * @example
  16160. *
  16161. * var func = _.overEvery([Boolean, isFinite]);
  16162. *
  16163. * func('1');
  16164. * // => true
  16165. *
  16166. * func(null);
  16167. * // => false
  16168. *
  16169. * func(NaN);
  16170. * // => false
  16171. */
  16172. var overEvery = createOver(arrayEvery);
  16173. /**
  16174. * Creates a function that checks if **any** of the `predicates` return
  16175. * truthy when invoked with the arguments it receives.
  16176. *
  16177. * Following shorthands are possible for providing predicates.
  16178. * Pass an `Object` and it will be used as an parameter for `_.matches` to create the predicate.
  16179. * Pass an `Array` of parameters for `_.matchesProperty` and the predicate will be created using them.
  16180. *
  16181. * @static
  16182. * @memberOf _
  16183. * @since 4.0.0
  16184. * @category Util
  16185. * @param {...(Function|Function[])} [predicates=[_.identity]]
  16186. * The predicates to check.
  16187. * @returns {Function} Returns the new function.
  16188. * @example
  16189. *
  16190. * var func = _.overSome([Boolean, isFinite]);
  16191. *
  16192. * func('1');
  16193. * // => true
  16194. *
  16195. * func(null);
  16196. * // => true
  16197. *
  16198. * func(NaN);
  16199. * // => false
  16200. *
  16201. * var matchesFunc = _.overSome([{ 'a': 1 }, { 'a': 2 }])
  16202. * var matchesPropertyFunc = _.overSome([['a', 1], ['a', 2]])
  16203. */
  16204. var overSome = createOver(arraySome);
  16205. /**
  16206. * Creates a function that returns the value at `path` of a given object.
  16207. *
  16208. * @static
  16209. * @memberOf _
  16210. * @since 2.4.0
  16211. * @category Util
  16212. * @param {Array|string} path The path of the property to get.
  16213. * @returns {Function} Returns the new accessor function.
  16214. * @example
  16215. *
  16216. * var objects = [
  16217. * { 'a': { 'b': 2 } },
  16218. * { 'a': { 'b': 1 } }
  16219. * ];
  16220. *
  16221. * _.map(objects, _.property('a.b'));
  16222. * // => [2, 1]
  16223. *
  16224. * _.map(_.sortBy(objects, _.property(['a', 'b'])), 'a.b');
  16225. * // => [1, 2]
  16226. */
  16227. function property(path) {
  16228. return isKey(path) ? baseProperty(toKey(path)) : basePropertyDeep(path);
  16229. }
  16230. /**
  16231. * The opposite of `_.property`; this method creates a function that returns
  16232. * the value at a given path of `object`.
  16233. *
  16234. * @static
  16235. * @memberOf _
  16236. * @since 3.0.0
  16237. * @category Util
  16238. * @param {Object} object The object to query.
  16239. * @returns {Function} Returns the new accessor function.
  16240. * @example
  16241. *
  16242. * var array = [0, 1, 2],
  16243. * object = { 'a': array, 'b': array, 'c': array };
  16244. *
  16245. * _.map(['a[2]', 'c[0]'], _.propertyOf(object));
  16246. * // => [2, 0]
  16247. *
  16248. * _.map([['a', '2'], ['c', '0']], _.propertyOf(object));
  16249. * // => [2, 0]
  16250. */
  16251. function propertyOf(object) {
  16252. return function(path) {
  16253. return object == null ? undefined : baseGet(object, path);
  16254. };
  16255. }
  16256. /**
  16257. * Creates an array of numbers (positive and/or negative) progressing from
  16258. * `start` up to, but not including, `end`. A step of `-1` is used if a negative
  16259. * `start` is specified without an `end` or `step`. If `end` is not specified,
  16260. * it's set to `start` with `start` then set to `0`.
  16261. *
  16262. * **Note:** JavaScript follows the IEEE-754 standard for resolving
  16263. * floating-point values which can produce unexpected results.
  16264. *
  16265. * @static
  16266. * @since 0.1.0
  16267. * @memberOf _
  16268. * @category Util
  16269. * @param {number} [start=0] The start of the range.
  16270. * @param {number} end The end of the range.
  16271. * @param {number} [step=1] The value to increment or decrement by.
  16272. * @returns {Array} Returns the range of numbers.
  16273. * @see _.inRange, _.rangeRight
  16274. * @example
  16275. *
  16276. * _.range(4);
  16277. * // => [0, 1, 2, 3]
  16278. *
  16279. * _.range(-4);
  16280. * // => [0, -1, -2, -3]
  16281. *
  16282. * _.range(1, 5);
  16283. * // => [1, 2, 3, 4]
  16284. *
  16285. * _.range(0, 20, 5);
  16286. * // => [0, 5, 10, 15]
  16287. *
  16288. * _.range(0, -4, -1);
  16289. * // => [0, -1, -2, -3]
  16290. *
  16291. * _.range(1, 4, 0);
  16292. * // => [1, 1, 1]
  16293. *
  16294. * _.range(0);
  16295. * // => []
  16296. */
  16297. var range = createRange();
  16298. /**
  16299. * This method is like `_.range` except that it populates values in
  16300. * descending order.
  16301. *
  16302. * @static
  16303. * @memberOf _
  16304. * @since 4.0.0
  16305. * @category Util
  16306. * @param {number} [start=0] The start of the range.
  16307. * @param {number} end The end of the range.
  16308. * @param {number} [step=1] The value to increment or decrement by.
  16309. * @returns {Array} Returns the range of numbers.
  16310. * @see _.inRange, _.range
  16311. * @example
  16312. *
  16313. * _.rangeRight(4);
  16314. * // => [3, 2, 1, 0]
  16315. *
  16316. * _.rangeRight(-4);
  16317. * // => [-3, -2, -1, 0]
  16318. *
  16319. * _.rangeRight(1, 5);
  16320. * // => [4, 3, 2, 1]
  16321. *
  16322. * _.rangeRight(0, 20, 5);
  16323. * // => [15, 10, 5, 0]
  16324. *
  16325. * _.rangeRight(0, -4, -1);
  16326. * // => [-3, -2, -1, 0]
  16327. *
  16328. * _.rangeRight(1, 4, 0);
  16329. * // => [1, 1, 1]
  16330. *
  16331. * _.rangeRight(0);
  16332. * // => []
  16333. */
  16334. var rangeRight = createRange(true);
  16335. /**
  16336. * This method returns a new empty array.
  16337. *
  16338. * @static
  16339. * @memberOf _
  16340. * @since 4.13.0
  16341. * @category Util
  16342. * @returns {Array} Returns the new empty array.
  16343. * @example
  16344. *
  16345. * var arrays = _.times(2, _.stubArray);
  16346. *
  16347. * console.log(arrays);
  16348. * // => [[], []]
  16349. *
  16350. * console.log(arrays[0] === arrays[1]);
  16351. * // => false
  16352. */
  16353. function stubArray() {
  16354. return [];
  16355. }
  16356. /**
  16357. * This method returns `false`.
  16358. *
  16359. * @static
  16360. * @memberOf _
  16361. * @since 4.13.0
  16362. * @category Util
  16363. * @returns {boolean} Returns `false`.
  16364. * @example
  16365. *
  16366. * _.times(2, _.stubFalse);
  16367. * // => [false, false]
  16368. */
  16369. function stubFalse() {
  16370. return false;
  16371. }
  16372. /**
  16373. * This method returns a new empty object.
  16374. *
  16375. * @static
  16376. * @memberOf _
  16377. * @since 4.13.0
  16378. * @category Util
  16379. * @returns {Object} Returns the new empty object.
  16380. * @example
  16381. *
  16382. * var objects = _.times(2, _.stubObject);
  16383. *
  16384. * console.log(objects);
  16385. * // => [{}, {}]
  16386. *
  16387. * console.log(objects[0] === objects[1]);
  16388. * // => false
  16389. */
  16390. function stubObject() {
  16391. return {};
  16392. }
  16393. /**
  16394. * This method returns an empty string.
  16395. *
  16396. * @static
  16397. * @memberOf _
  16398. * @since 4.13.0
  16399. * @category Util
  16400. * @returns {string} Returns the empty string.
  16401. * @example
  16402. *
  16403. * _.times(2, _.stubString);
  16404. * // => ['', '']
  16405. */
  16406. function stubString() {
  16407. return '';
  16408. }
  16409. /**
  16410. * This method returns `true`.
  16411. *
  16412. * @static
  16413. * @memberOf _
  16414. * @since 4.13.0
  16415. * @category Util
  16416. * @returns {boolean} Returns `true`.
  16417. * @example
  16418. *
  16419. * _.times(2, _.stubTrue);
  16420. * // => [true, true]
  16421. */
  16422. function stubTrue() {
  16423. return true;
  16424. }
  16425. /**
  16426. * Invokes the iteratee `n` times, returning an array of the results of
  16427. * each invocation. The iteratee is invoked with one argument; (index).
  16428. *
  16429. * @static
  16430. * @since 0.1.0
  16431. * @memberOf _
  16432. * @category Util
  16433. * @param {number} n The number of times to invoke `iteratee`.
  16434. * @param {Function} [iteratee=_.identity] The function invoked per iteration.
  16435. * @returns {Array} Returns the array of results.
  16436. * @example
  16437. *
  16438. * _.times(3, String);
  16439. * // => ['0', '1', '2']
  16440. *
  16441. * _.times(4, _.constant(0));
  16442. * // => [0, 0, 0, 0]
  16443. */
  16444. function times(n, iteratee) {
  16445. n = toInteger(n);
  16446. if (n < 1 || n > MAX_SAFE_INTEGER) {
  16447. return [];
  16448. }
  16449. var index = MAX_ARRAY_LENGTH,
  16450. length = nativeMin(n, MAX_ARRAY_LENGTH);
  16451. iteratee = getIteratee(iteratee);
  16452. n -= MAX_ARRAY_LENGTH;
  16453. var result = baseTimes(length, iteratee);
  16454. while (++index < n) {
  16455. iteratee(index);
  16456. }
  16457. return result;
  16458. }
  16459. /**
  16460. * Converts `value` to a property path array.
  16461. *
  16462. * @static
  16463. * @memberOf _
  16464. * @since 4.0.0
  16465. * @category Util
  16466. * @param {*} value The value to convert.
  16467. * @returns {Array} Returns the new property path array.
  16468. * @example
  16469. *
  16470. * _.toPath('a.b.c');
  16471. * // => ['a', 'b', 'c']
  16472. *
  16473. * _.toPath('a[0].b.c');
  16474. * // => ['a', '0', 'b', 'c']
  16475. */
  16476. function toPath(value) {
  16477. if (isArray(value)) {
  16478. return arrayMap(value, toKey);
  16479. }
  16480. return isSymbol(value) ? [value] : copyArray(stringToPath(toString(value)));
  16481. }
  16482. /**
  16483. * Generates a unique ID. If `prefix` is given, the ID is appended to it.
  16484. *
  16485. * @static
  16486. * @since 0.1.0
  16487. * @memberOf _
  16488. * @category Util
  16489. * @param {string} [prefix=''] The value to prefix the ID with.
  16490. * @returns {string} Returns the unique ID.
  16491. * @example
  16492. *
  16493. * _.uniqueId('contact_');
  16494. * // => 'contact_104'
  16495. *
  16496. * _.uniqueId();
  16497. * // => '105'
  16498. */
  16499. function uniqueId(prefix) {
  16500. var id = ++idCounter;
  16501. return toString(prefix) + id;
  16502. }
  16503. /*------------------------------------------------------------------------*/
  16504. /**
  16505. * Adds two numbers.
  16506. *
  16507. * @static
  16508. * @memberOf _
  16509. * @since 3.4.0
  16510. * @category Math
  16511. * @param {number} augend The first number in an addition.
  16512. * @param {number} addend The second number in an addition.
  16513. * @returns {number} Returns the total.
  16514. * @example
  16515. *
  16516. * _.add(6, 4);
  16517. * // => 10
  16518. */
  16519. var add = createMathOperation(function(augend, addend) {
  16520. return augend + addend;
  16521. }, 0);
  16522. /**
  16523. * Computes `number` rounded up to `precision`.
  16524. *
  16525. * @static
  16526. * @memberOf _
  16527. * @since 3.10.0
  16528. * @category Math
  16529. * @param {number} number The number to round up.
  16530. * @param {number} [precision=0] The precision to round up to.
  16531. * @returns {number} Returns the rounded up number.
  16532. * @example
  16533. *
  16534. * _.ceil(4.006);
  16535. * // => 5
  16536. *
  16537. * _.ceil(6.004, 2);
  16538. * // => 6.01
  16539. *
  16540. * _.ceil(6040, -2);
  16541. * // => 6100
  16542. */
  16543. var ceil = createRound('ceil');
  16544. /**
  16545. * Divide two numbers.
  16546. *
  16547. * @static
  16548. * @memberOf _
  16549. * @since 4.7.0
  16550. * @category Math
  16551. * @param {number} dividend The first number in a division.
  16552. * @param {number} divisor The second number in a division.
  16553. * @returns {number} Returns the quotient.
  16554. * @example
  16555. *
  16556. * _.divide(6, 4);
  16557. * // => 1.5
  16558. */
  16559. var divide = createMathOperation(function(dividend, divisor) {
  16560. return dividend / divisor;
  16561. }, 1);
  16562. /**
  16563. * Computes `number` rounded down to `precision`.
  16564. *
  16565. * @static
  16566. * @memberOf _
  16567. * @since 3.10.0
  16568. * @category Math
  16569. * @param {number} number The number to round down.
  16570. * @param {number} [precision=0] The precision to round down to.
  16571. * @returns {number} Returns the rounded down number.
  16572. * @example
  16573. *
  16574. * _.floor(4.006);
  16575. * // => 4
  16576. *
  16577. * _.floor(0.046, 2);
  16578. * // => 0.04
  16579. *
  16580. * _.floor(4060, -2);
  16581. * // => 4000
  16582. */
  16583. var floor = createRound('floor');
  16584. /**
  16585. * Computes the maximum value of `array`. If `array` is empty or falsey,
  16586. * `undefined` is returned.
  16587. *
  16588. * @static
  16589. * @since 0.1.0
  16590. * @memberOf _
  16591. * @category Math
  16592. * @param {Array} array The array to iterate over.
  16593. * @returns {*} Returns the maximum value.
  16594. * @example
  16595. *
  16596. * _.max([4, 2, 8, 6]);
  16597. * // => 8
  16598. *
  16599. * _.max([]);
  16600. * // => undefined
  16601. */
  16602. function max(array) {
  16603. return (array && array.length)
  16604. ? baseExtremum(array, identity, baseGt)
  16605. : undefined;
  16606. }
  16607. /**
  16608. * This method is like `_.max` except that it accepts `iteratee` which is
  16609. * invoked for each element in `array` to generate the criterion by which
  16610. * the value is ranked. The iteratee is invoked with one argument: (value).
  16611. *
  16612. * @static
  16613. * @memberOf _
  16614. * @since 4.0.0
  16615. * @category Math
  16616. * @param {Array} array The array to iterate over.
  16617. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  16618. * @returns {*} Returns the maximum value.
  16619. * @example
  16620. *
  16621. * var objects = [{ 'n': 1 }, { 'n': 2 }];
  16622. *
  16623. * _.maxBy(objects, function(o) { return o.n; });
  16624. * // => { 'n': 2 }
  16625. *
  16626. * // The `_.property` iteratee shorthand.
  16627. * _.maxBy(objects, 'n');
  16628. * // => { 'n': 2 }
  16629. */
  16630. function maxBy(array, iteratee) {
  16631. return (array && array.length)
  16632. ? baseExtremum(array, getIteratee(iteratee, 2), baseGt)
  16633. : undefined;
  16634. }
  16635. /**
  16636. * Computes the mean of the values in `array`.
  16637. *
  16638. * @static
  16639. * @memberOf _
  16640. * @since 4.0.0
  16641. * @category Math
  16642. * @param {Array} array The array to iterate over.
  16643. * @returns {number} Returns the mean.
  16644. * @example
  16645. *
  16646. * _.mean([4, 2, 8, 6]);
  16647. * // => 5
  16648. */
  16649. function mean(array) {
  16650. return baseMean(array, identity);
  16651. }
  16652. /**
  16653. * This method is like `_.mean` except that it accepts `iteratee` which is
  16654. * invoked for each element in `array` to generate the value to be averaged.
  16655. * The iteratee is invoked with one argument: (value).
  16656. *
  16657. * @static
  16658. * @memberOf _
  16659. * @since 4.7.0
  16660. * @category Math
  16661. * @param {Array} array The array to iterate over.
  16662. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  16663. * @returns {number} Returns the mean.
  16664. * @example
  16665. *
  16666. * var objects = [{ 'n': 4 }, { 'n': 2 }, { 'n': 8 }, { 'n': 6 }];
  16667. *
  16668. * _.meanBy(objects, function(o) { return o.n; });
  16669. * // => 5
  16670. *
  16671. * // The `_.property` iteratee shorthand.
  16672. * _.meanBy(objects, 'n');
  16673. * // => 5
  16674. */
  16675. function meanBy(array, iteratee) {
  16676. return baseMean(array, getIteratee(iteratee, 2));
  16677. }
  16678. /**
  16679. * Computes the minimum value of `array`. If `array` is empty or falsey,
  16680. * `undefined` is returned.
  16681. *
  16682. * @static
  16683. * @since 0.1.0
  16684. * @memberOf _
  16685. * @category Math
  16686. * @param {Array} array The array to iterate over.
  16687. * @returns {*} Returns the minimum value.
  16688. * @example
  16689. *
  16690. * _.min([4, 2, 8, 6]);
  16691. * // => 2
  16692. *
  16693. * _.min([]);
  16694. * // => undefined
  16695. */
  16696. function min(array) {
  16697. return (array && array.length)
  16698. ? baseExtremum(array, identity, baseLt)
  16699. : undefined;
  16700. }
  16701. /**
  16702. * This method is like `_.min` except that it accepts `iteratee` which is
  16703. * invoked for each element in `array` to generate the criterion by which
  16704. * the value is ranked. The iteratee is invoked with one argument: (value).
  16705. *
  16706. * @static
  16707. * @memberOf _
  16708. * @since 4.0.0
  16709. * @category Math
  16710. * @param {Array} array The array to iterate over.
  16711. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  16712. * @returns {*} Returns the minimum value.
  16713. * @example
  16714. *
  16715. * var objects = [{ 'n': 1 }, { 'n': 2 }];
  16716. *
  16717. * _.minBy(objects, function(o) { return o.n; });
  16718. * // => { 'n': 1 }
  16719. *
  16720. * // The `_.property` iteratee shorthand.
  16721. * _.minBy(objects, 'n');
  16722. * // => { 'n': 1 }
  16723. */
  16724. function minBy(array, iteratee) {
  16725. return (array && array.length)
  16726. ? baseExtremum(array, getIteratee(iteratee, 2), baseLt)
  16727. : undefined;
  16728. }
  16729. /**
  16730. * Multiply two numbers.
  16731. *
  16732. * @static
  16733. * @memberOf _
  16734. * @since 4.7.0
  16735. * @category Math
  16736. * @param {number} multiplier The first number in a multiplication.
  16737. * @param {number} multiplicand The second number in a multiplication.
  16738. * @returns {number} Returns the product.
  16739. * @example
  16740. *
  16741. * _.multiply(6, 4);
  16742. * // => 24
  16743. */
  16744. var multiply = createMathOperation(function(multiplier, multiplicand) {
  16745. return multiplier * multiplicand;
  16746. }, 1);
  16747. /**
  16748. * Computes `number` rounded to `precision`.
  16749. *
  16750. * @static
  16751. * @memberOf _
  16752. * @since 3.10.0
  16753. * @category Math
  16754. * @param {number} number The number to round.
  16755. * @param {number} [precision=0] The precision to round to.
  16756. * @returns {number} Returns the rounded number.
  16757. * @example
  16758. *
  16759. * _.round(4.006);
  16760. * // => 4
  16761. *
  16762. * _.round(4.006, 2);
  16763. * // => 4.01
  16764. *
  16765. * _.round(4060, -2);
  16766. * // => 4100
  16767. */
  16768. var round = createRound('round');
  16769. /**
  16770. * Subtract two numbers.
  16771. *
  16772. * @static
  16773. * @memberOf _
  16774. * @since 4.0.0
  16775. * @category Math
  16776. * @param {number} minuend The first number in a subtraction.
  16777. * @param {number} subtrahend The second number in a subtraction.
  16778. * @returns {number} Returns the difference.
  16779. * @example
  16780. *
  16781. * _.subtract(6, 4);
  16782. * // => 2
  16783. */
  16784. var subtract = createMathOperation(function(minuend, subtrahend) {
  16785. return minuend - subtrahend;
  16786. }, 0);
  16787. /**
  16788. * Computes the sum of the values in `array`.
  16789. *
  16790. * @static
  16791. * @memberOf _
  16792. * @since 3.4.0
  16793. * @category Math
  16794. * @param {Array} array The array to iterate over.
  16795. * @returns {number} Returns the sum.
  16796. * @example
  16797. *
  16798. * _.sum([4, 2, 8, 6]);
  16799. * // => 20
  16800. */
  16801. function sum(array) {
  16802. return (array && array.length)
  16803. ? baseSum(array, identity)
  16804. : 0;
  16805. }
  16806. /**
  16807. * This method is like `_.sum` except that it accepts `iteratee` which is
  16808. * invoked for each element in `array` to generate the value to be summed.
  16809. * The iteratee is invoked with one argument: (value).
  16810. *
  16811. * @static
  16812. * @memberOf _
  16813. * @since 4.0.0
  16814. * @category Math
  16815. * @param {Array} array The array to iterate over.
  16816. * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
  16817. * @returns {number} Returns the sum.
  16818. * @example
  16819. *
  16820. * var objects = [{ 'n': 4 }, { 'n': 2 }, { 'n': 8 }, { 'n': 6 }];
  16821. *
  16822. * _.sumBy(objects, function(o) { return o.n; });
  16823. * // => 20
  16824. *
  16825. * // The `_.property` iteratee shorthand.
  16826. * _.sumBy(objects, 'n');
  16827. * // => 20
  16828. */
  16829. function sumBy(array, iteratee) {
  16830. return (array && array.length)
  16831. ? baseSum(array, getIteratee(iteratee, 2))
  16832. : 0;
  16833. }
  16834. /*------------------------------------------------------------------------*/
  16835. // Add methods that return wrapped values in chain sequences.
  16836. lodash.after = after;
  16837. lodash.ary = ary;
  16838. lodash.assign = assign;
  16839. lodash.assignIn = assignIn;
  16840. lodash.assignInWith = assignInWith;
  16841. lodash.assignWith = assignWith;
  16842. lodash.at = at;
  16843. lodash.before = before;
  16844. lodash.bind = bind;
  16845. lodash.bindAll = bindAll;
  16846. lodash.bindKey = bindKey;
  16847. lodash.castArray = castArray;
  16848. lodash.chain = chain;
  16849. lodash.chunk = chunk;
  16850. lodash.compact = compact;
  16851. lodash.concat = concat;
  16852. lodash.cond = cond;
  16853. lodash.conforms = conforms;
  16854. lodash.constant = constant;
  16855. lodash.countBy = countBy;
  16856. lodash.create = create;
  16857. lodash.curry = curry;
  16858. lodash.curryRight = curryRight;
  16859. lodash.debounce = debounce;
  16860. lodash.defaults = defaults;
  16861. lodash.defaultsDeep = defaultsDeep;
  16862. lodash.defer = defer;
  16863. lodash.delay = delay;
  16864. lodash.difference = difference;
  16865. lodash.differenceBy = differenceBy;
  16866. lodash.differenceWith = differenceWith;
  16867. lodash.drop = drop;
  16868. lodash.dropRight = dropRight;
  16869. lodash.dropRightWhile = dropRightWhile;
  16870. lodash.dropWhile = dropWhile;
  16871. lodash.fill = fill;
  16872. lodash.filter = filter;
  16873. lodash.flatMap = flatMap;
  16874. lodash.flatMapDeep = flatMapDeep;
  16875. lodash.flatMapDepth = flatMapDepth;
  16876. lodash.flatten = flatten;
  16877. lodash.flattenDeep = flattenDeep;
  16878. lodash.flattenDepth = flattenDepth;
  16879. lodash.flip = flip;
  16880. lodash.flow = flow;
  16881. lodash.flowRight = flowRight;
  16882. lodash.fromPairs = fromPairs;
  16883. lodash.functions = functions;
  16884. lodash.functionsIn = functionsIn;
  16885. lodash.groupBy = groupBy;
  16886. lodash.initial = initial;
  16887. lodash.intersection = intersection;
  16888. lodash.intersectionBy = intersectionBy;
  16889. lodash.intersectionWith = intersectionWith;
  16890. lodash.invert = invert;
  16891. lodash.invertBy = invertBy;
  16892. lodash.invokeMap = invokeMap;
  16893. lodash.iteratee = iteratee;
  16894. lodash.keyBy = keyBy;
  16895. lodash.keys = keys;
  16896. lodash.keysIn = keysIn;
  16897. lodash.map = map;
  16898. lodash.mapKeys = mapKeys;
  16899. lodash.mapValues = mapValues;
  16900. lodash.matches = matches;
  16901. lodash.matchesProperty = matchesProperty;
  16902. lodash.memoize = memoize;
  16903. lodash.merge = merge;
  16904. lodash.mergeWith = mergeWith;
  16905. lodash.method = method;
  16906. lodash.methodOf = methodOf;
  16907. lodash.mixin = mixin;
  16908. lodash.negate = negate;
  16909. lodash.nthArg = nthArg;
  16910. lodash.omit = omit;
  16911. lodash.omitBy = omitBy;
  16912. lodash.once = once;
  16913. lodash.orderBy = orderBy;
  16914. lodash.over = over;
  16915. lodash.overArgs = overArgs;
  16916. lodash.overEvery = overEvery;
  16917. lodash.overSome = overSome;
  16918. lodash.partial = partial;
  16919. lodash.partialRight = partialRight;
  16920. lodash.partition = partition;
  16921. lodash.pick = pick;
  16922. lodash.pickBy = pickBy;
  16923. lodash.property = property;
  16924. lodash.propertyOf = propertyOf;
  16925. lodash.pull = pull;
  16926. lodash.pullAll = pullAll;
  16927. lodash.pullAllBy = pullAllBy;
  16928. lodash.pullAllWith = pullAllWith;
  16929. lodash.pullAt = pullAt;
  16930. lodash.range = range;
  16931. lodash.rangeRight = rangeRight;
  16932. lodash.rearg = rearg;
  16933. lodash.reject = reject;
  16934. lodash.remove = remove;
  16935. lodash.rest = rest;
  16936. lodash.reverse = reverse;
  16937. lodash.sampleSize = sampleSize;
  16938. lodash.set = set;
  16939. lodash.setWith = setWith;
  16940. lodash.shuffle = shuffle;
  16941. lodash.slice = slice;
  16942. lodash.sortBy = sortBy;
  16943. lodash.sortedUniq = sortedUniq;
  16944. lodash.sortedUniqBy = sortedUniqBy;
  16945. lodash.split = split;
  16946. lodash.spread = spread;
  16947. lodash.tail = tail;
  16948. lodash.take = take;
  16949. lodash.takeRight = takeRight;
  16950. lodash.takeRightWhile = takeRightWhile;
  16951. lodash.takeWhile = takeWhile;
  16952. lodash.tap = tap;
  16953. lodash.throttle = throttle;
  16954. lodash.thru = thru;
  16955. lodash.toArray = toArray;
  16956. lodash.toPairs = toPairs;
  16957. lodash.toPairsIn = toPairsIn;
  16958. lodash.toPath = toPath;
  16959. lodash.toPlainObject = toPlainObject;
  16960. lodash.transform = transform;
  16961. lodash.unary = unary;
  16962. lodash.union = union;
  16963. lodash.unionBy = unionBy;
  16964. lodash.unionWith = unionWith;
  16965. lodash.uniq = uniq;
  16966. lodash.uniqBy = uniqBy;
  16967. lodash.uniqWith = uniqWith;
  16968. lodash.unset = unset;
  16969. lodash.unzip = unzip;
  16970. lodash.unzipWith = unzipWith;
  16971. lodash.update = update;
  16972. lodash.updateWith = updateWith;
  16973. lodash.values = values;
  16974. lodash.valuesIn = valuesIn;
  16975. lodash.without = without;
  16976. lodash.words = words;
  16977. lodash.wrap = wrap;
  16978. lodash.xor = xor;
  16979. lodash.xorBy = xorBy;
  16980. lodash.xorWith = xorWith;
  16981. lodash.zip = zip;
  16982. lodash.zipObject = zipObject;
  16983. lodash.zipObjectDeep = zipObjectDeep;
  16984. lodash.zipWith = zipWith;
  16985. // Add aliases.
  16986. lodash.entries = toPairs;
  16987. lodash.entriesIn = toPairsIn;
  16988. lodash.extend = assignIn;
  16989. lodash.extendWith = assignInWith;
  16990. // Add methods to `lodash.prototype`.
  16991. mixin(lodash, lodash);
  16992. /*------------------------------------------------------------------------*/
  16993. // Add methods that return unwrapped values in chain sequences.
  16994. lodash.add = add;
  16995. lodash.attempt = attempt;
  16996. lodash.camelCase = camelCase;
  16997. lodash.capitalize = capitalize;
  16998. lodash.ceil = ceil;
  16999. lodash.clamp = clamp;
  17000. lodash.clone = clone;
  17001. lodash.cloneDeep = cloneDeep;
  17002. lodash.cloneDeepWith = cloneDeepWith;
  17003. lodash.cloneWith = cloneWith;
  17004. lodash.conformsTo = conformsTo;
  17005. lodash.deburr = deburr;
  17006. lodash.defaultTo = defaultTo;
  17007. lodash.divide = divide;
  17008. lodash.endsWith = endsWith;
  17009. lodash.eq = eq;
  17010. lodash.escape = escape;
  17011. lodash.escapeRegExp = escapeRegExp;
  17012. lodash.every = every;
  17013. lodash.find = find;
  17014. lodash.findIndex = findIndex;
  17015. lodash.findKey = findKey;
  17016. lodash.findLast = findLast;
  17017. lodash.findLastIndex = findLastIndex;
  17018. lodash.findLastKey = findLastKey;
  17019. lodash.floor = floor;
  17020. lodash.forEach = forEach;
  17021. lodash.forEachRight = forEachRight;
  17022. lodash.forIn = forIn;
  17023. lodash.forInRight = forInRight;
  17024. lodash.forOwn = forOwn;
  17025. lodash.forOwnRight = forOwnRight;
  17026. lodash.get = get;
  17027. lodash.gt = gt;
  17028. lodash.gte = gte;
  17029. lodash.has = has;
  17030. lodash.hasIn = hasIn;
  17031. lodash.head = head;
  17032. lodash.identity = identity;
  17033. lodash.includes = includes;
  17034. lodash.indexOf = indexOf;
  17035. lodash.inRange = inRange;
  17036. lodash.invoke = invoke;
  17037. lodash.isArguments = isArguments;
  17038. lodash.isArray = isArray;
  17039. lodash.isArrayBuffer = isArrayBuffer;
  17040. lodash.isArrayLike = isArrayLike;
  17041. lodash.isArrayLikeObject = isArrayLikeObject;
  17042. lodash.isBoolean = isBoolean;
  17043. lodash.isBuffer = isBuffer;
  17044. lodash.isDate = isDate;
  17045. lodash.isElement = isElement;
  17046. lodash.isEmpty = isEmpty;
  17047. lodash.isEqual = isEqual;
  17048. lodash.isEqualWith = isEqualWith;
  17049. lodash.isError = isError;
  17050. lodash.isFinite = isFinite;
  17051. lodash.isFunction = isFunction;
  17052. lodash.isInteger = isInteger;
  17053. lodash.isLength = isLength;
  17054. lodash.isMap = isMap;
  17055. lodash.isMatch = isMatch;
  17056. lodash.isMatchWith = isMatchWith;
  17057. lodash.isNaN = isNaN;
  17058. lodash.isNative = isNative;
  17059. lodash.isNil = isNil;
  17060. lodash.isNull = isNull;
  17061. lodash.isNumber = isNumber;
  17062. lodash.isObject = isObject;
  17063. lodash.isObjectLike = isObjectLike;
  17064. lodash.isPlainObject = isPlainObject;
  17065. lodash.isRegExp = isRegExp;
  17066. lodash.isSafeInteger = isSafeInteger;
  17067. lodash.isSet = isSet;
  17068. lodash.isString = isString;
  17069. lodash.isSymbol = isSymbol;
  17070. lodash.isTypedArray = isTypedArray;
  17071. lodash.isUndefined = isUndefined;
  17072. lodash.isWeakMap = isWeakMap;
  17073. lodash.isWeakSet = isWeakSet;
  17074. lodash.join = join;
  17075. lodash.kebabCase = kebabCase;
  17076. lodash.last = last;
  17077. lodash.lastIndexOf = lastIndexOf;
  17078. lodash.lowerCase = lowerCase;
  17079. lodash.lowerFirst = lowerFirst;
  17080. lodash.lt = lt;
  17081. lodash.lte = lte;
  17082. lodash.max = max;
  17083. lodash.maxBy = maxBy;
  17084. lodash.mean = mean;
  17085. lodash.meanBy = meanBy;
  17086. lodash.min = min;
  17087. lodash.minBy = minBy;
  17088. lodash.stubArray = stubArray;
  17089. lodash.stubFalse = stubFalse;
  17090. lodash.stubObject = stubObject;
  17091. lodash.stubString = stubString;
  17092. lodash.stubTrue = stubTrue;
  17093. lodash.multiply = multiply;
  17094. lodash.nth = nth;
  17095. lodash.noConflict = noConflict;
  17096. lodash.noop = noop;
  17097. lodash.now = now;
  17098. lodash.pad = pad;
  17099. lodash.padEnd = padEnd;
  17100. lodash.padStart = padStart;
  17101. lodash.parseInt = parseInt;
  17102. lodash.random = random;
  17103. lodash.reduce = reduce;
  17104. lodash.reduceRight = reduceRight;
  17105. lodash.repeat = repeat;
  17106. lodash.replace = replace;
  17107. lodash.result = result;
  17108. lodash.round = round;
  17109. lodash.runInContext = runInContext;
  17110. lodash.sample = sample;
  17111. lodash.size = size;
  17112. lodash.snakeCase = snakeCase;
  17113. lodash.some = some;
  17114. lodash.sortedIndex = sortedIndex;
  17115. lodash.sortedIndexBy = sortedIndexBy;
  17116. lodash.sortedIndexOf = sortedIndexOf;
  17117. lodash.sortedLastIndex = sortedLastIndex;
  17118. lodash.sortedLastIndexBy = sortedLastIndexBy;
  17119. lodash.sortedLastIndexOf = sortedLastIndexOf;
  17120. lodash.startCase = startCase;
  17121. lodash.startsWith = startsWith;
  17122. lodash.subtract = subtract;
  17123. lodash.sum = sum;
  17124. lodash.sumBy = sumBy;
  17125. lodash.template = template;
  17126. lodash.times = times;
  17127. lodash.toFinite = toFinite;
  17128. lodash.toInteger = toInteger;
  17129. lodash.toLength = toLength;
  17130. lodash.toLower = toLower;
  17131. lodash.toNumber = toNumber;
  17132. lodash.toSafeInteger = toSafeInteger;
  17133. lodash.toString = toString;
  17134. lodash.toUpper = toUpper;
  17135. lodash.trim = trim;
  17136. lodash.trimEnd = trimEnd;
  17137. lodash.trimStart = trimStart;
  17138. lodash.truncate = truncate;
  17139. lodash.unescape = unescape;
  17140. lodash.uniqueId = uniqueId;
  17141. lodash.upperCase = upperCase;
  17142. lodash.upperFirst = upperFirst;
  17143. // Add aliases.
  17144. lodash.each = forEach;
  17145. lodash.eachRight = forEachRight;
  17146. lodash.first = head;
  17147. mixin(lodash, (function() {
  17148. var source = {};
  17149. baseForOwn(lodash, function(func, methodName) {
  17150. if (!hasOwnProperty.call(lodash.prototype, methodName)) {
  17151. source[methodName] = func;
  17152. }
  17153. });
  17154. return source;
  17155. }()), { 'chain': false });
  17156. /*------------------------------------------------------------------------*/
  17157. /**
  17158. * The semantic version number.
  17159. *
  17160. * @static
  17161. * @memberOf _
  17162. * @type {string}
  17163. */
  17164. lodash.VERSION = VERSION;
  17165. // Assign default placeholders.
  17166. arrayEach(['bind', 'bindKey', 'curry', 'curryRight', 'partial', 'partialRight'], function(methodName) {
  17167. lodash[methodName].placeholder = lodash;
  17168. });
  17169. // Add `LazyWrapper` methods for `_.drop` and `_.take` variants.
  17170. arrayEach(['drop', 'take'], function(methodName, index) {
  17171. LazyWrapper.prototype[methodName] = function(n) {
  17172. n = n === undefined ? 1 : nativeMax(toInteger(n), 0);
  17173. var result = (this.__filtered__ && !index)
  17174. ? new LazyWrapper(this)
  17175. : this.clone();
  17176. if (result.__filtered__) {
  17177. result.__takeCount__ = nativeMin(n, result.__takeCount__);
  17178. } else {
  17179. result.__views__.push({
  17180. 'size': nativeMin(n, MAX_ARRAY_LENGTH),
  17181. 'type': methodName + (result.__dir__ < 0 ? 'Right' : '')
  17182. });
  17183. }
  17184. return result;
  17185. };
  17186. LazyWrapper.prototype[methodName + 'Right'] = function(n) {
  17187. return this.reverse()[methodName](n).reverse();
  17188. };
  17189. });
  17190. // Add `LazyWrapper` methods that accept an `iteratee` value.
  17191. arrayEach(['filter', 'map', 'takeWhile'], function(methodName, index) {
  17192. var type = index + 1,
  17193. isFilter = type == LAZY_FILTER_FLAG || type == LAZY_WHILE_FLAG;
  17194. LazyWrapper.prototype[methodName] = function(iteratee) {
  17195. var result = this.clone();
  17196. result.__iteratees__.push({
  17197. 'iteratee': getIteratee(iteratee, 3),
  17198. 'type': type
  17199. });
  17200. result.__filtered__ = result.__filtered__ || isFilter;
  17201. return result;
  17202. };
  17203. });
  17204. // Add `LazyWrapper` methods for `_.head` and `_.last`.
  17205. arrayEach(['head', 'last'], function(methodName, index) {
  17206. var takeName = 'take' + (index ? 'Right' : '');
  17207. LazyWrapper.prototype[methodName] = function() {
  17208. return this[takeName](1).value()[0];
  17209. };
  17210. });
  17211. // Add `LazyWrapper` methods for `_.initial` and `_.tail`.
  17212. arrayEach(['initial', 'tail'], function(methodName, index) {
  17213. var dropName = 'drop' + (index ? '' : 'Right');
  17214. LazyWrapper.prototype[methodName] = function() {
  17215. return this.__filtered__ ? new LazyWrapper(this) : this[dropName](1);
  17216. };
  17217. });
  17218. LazyWrapper.prototype.compact = function() {
  17219. return this.filter(identity);
  17220. };
  17221. LazyWrapper.prototype.find = function(predicate) {
  17222. return this.filter(predicate).head();
  17223. };
  17224. LazyWrapper.prototype.findLast = function(predicate) {
  17225. return this.reverse().find(predicate);
  17226. };
  17227. LazyWrapper.prototype.invokeMap = baseRest(function(path, args) {
  17228. if (typeof path == 'function') {
  17229. return new LazyWrapper(this);
  17230. }
  17231. return this.map(function(value) {
  17232. return baseInvoke(value, path, args);
  17233. });
  17234. });
  17235. LazyWrapper.prototype.reject = function(predicate) {
  17236. return this.filter(negate(getIteratee(predicate)));
  17237. };
  17238. LazyWrapper.prototype.slice = function(start, end) {
  17239. start = toInteger(start);
  17240. var result = this;
  17241. if (result.__filtered__ && (start > 0 || end < 0)) {
  17242. return new LazyWrapper(result);
  17243. }
  17244. if (start < 0) {
  17245. result = result.takeRight(-start);
  17246. } else if (start) {
  17247. result = result.drop(start);
  17248. }
  17249. if (end !== undefined) {
  17250. end = toInteger(end);
  17251. result = end < 0 ? result.dropRight(-end) : result.take(end - start);
  17252. }
  17253. return result;
  17254. };
  17255. LazyWrapper.prototype.takeRightWhile = function(predicate) {
  17256. return this.reverse().takeWhile(predicate).reverse();
  17257. };
  17258. LazyWrapper.prototype.toArray = function() {
  17259. return this.take(MAX_ARRAY_LENGTH);
  17260. };
  17261. // Add `LazyWrapper` methods to `lodash.prototype`.
  17262. baseForOwn(LazyWrapper.prototype, function(func, methodName) {
  17263. var checkIteratee = /^(?:filter|find|map|reject)|While$/.test(methodName),
  17264. isTaker = /^(?:head|last)$/.test(methodName),
  17265. lodashFunc = lodash[isTaker ? ('take' + (methodName == 'last' ? 'Right' : '')) : methodName],
  17266. retUnwrapped = isTaker || /^find/.test(methodName);
  17267. if (!lodashFunc) {
  17268. return;
  17269. }
  17270. lodash.prototype[methodName] = function() {
  17271. var value = this.__wrapped__,
  17272. args = isTaker ? [1] : arguments,
  17273. isLazy = value instanceof LazyWrapper,
  17274. iteratee = args[0],
  17275. useLazy = isLazy || isArray(value);
  17276. var interceptor = function(value) {
  17277. var result = lodashFunc.apply(lodash, arrayPush([value], args));
  17278. return (isTaker && chainAll) ? result[0] : result;
  17279. };
  17280. if (useLazy && checkIteratee && typeof iteratee == 'function' && iteratee.length != 1) {
  17281. // Avoid lazy use if the iteratee has a "length" value other than `1`.
  17282. isLazy = useLazy = false;
  17283. }
  17284. var chainAll = this.__chain__,
  17285. isHybrid = !!this.__actions__.length,
  17286. isUnwrapped = retUnwrapped && !chainAll,
  17287. onlyLazy = isLazy && !isHybrid;
  17288. if (!retUnwrapped && useLazy) {
  17289. value = onlyLazy ? value : new LazyWrapper(this);
  17290. var result = func.apply(value, args);
  17291. result.__actions__.push({ 'func': thru, 'args': [interceptor], 'thisArg': undefined });
  17292. return new LodashWrapper(result, chainAll);
  17293. }
  17294. if (isUnwrapped && onlyLazy) {
  17295. return func.apply(this, args);
  17296. }
  17297. result = this.thru(interceptor);
  17298. return isUnwrapped ? (isTaker ? result.value()[0] : result.value()) : result;
  17299. };
  17300. });
  17301. // Add `Array` methods to `lodash.prototype`.
  17302. arrayEach(['pop', 'push', 'shift', 'sort', 'splice', 'unshift'], function(methodName) {
  17303. var func = arrayProto[methodName],
  17304. chainName = /^(?:push|sort|unshift)$/.test(methodName) ? 'tap' : 'thru',
  17305. retUnwrapped = /^(?:pop|shift)$/.test(methodName);
  17306. lodash.prototype[methodName] = function() {
  17307. var args = arguments;
  17308. if (retUnwrapped && !this.__chain__) {
  17309. var value = this.value();
  17310. return func.apply(isArray(value) ? value : [], args);
  17311. }
  17312. return this[chainName](function(value) {
  17313. return func.apply(isArray(value) ? value : [], args);
  17314. });
  17315. };
  17316. });
  17317. // Map minified method names to their real names.
  17318. baseForOwn(LazyWrapper.prototype, function(func, methodName) {
  17319. var lodashFunc = lodash[methodName];
  17320. if (lodashFunc) {
  17321. var key = lodashFunc.name + '';
  17322. if (!hasOwnProperty.call(realNames, key)) {
  17323. realNames[key] = [];
  17324. }
  17325. realNames[key].push({ 'name': methodName, 'func': lodashFunc });
  17326. }
  17327. });
  17328. realNames[createHybrid(undefined, WRAP_BIND_KEY_FLAG).name] = [{
  17329. 'name': 'wrapper',
  17330. 'func': undefined
  17331. }];
  17332. // Add methods to `LazyWrapper`.
  17333. LazyWrapper.prototype.clone = lazyClone;
  17334. LazyWrapper.prototype.reverse = lazyReverse;
  17335. LazyWrapper.prototype.value = lazyValue;
  17336. // Add chain sequence methods to the `lodash` wrapper.
  17337. lodash.prototype.at = wrapperAt;
  17338. lodash.prototype.chain = wrapperChain;
  17339. lodash.prototype.commit = wrapperCommit;
  17340. lodash.prototype.next = wrapperNext;
  17341. lodash.prototype.plant = wrapperPlant;
  17342. lodash.prototype.reverse = wrapperReverse;
  17343. lodash.prototype.toJSON = lodash.prototype.valueOf = lodash.prototype.value = wrapperValue;
  17344. // Add lazy aliases.
  17345. lodash.prototype.first = lodash.prototype.head;
  17346. if (symIterator) {
  17347. lodash.prototype[symIterator] = wrapperToIterator;
  17348. }
  17349. return lodash;
  17350. });
  17351. /*--------------------------------------------------------------------------*/
  17352. // Export lodash.
  17353. var _ = runInContext();
  17354. // Some AMD build optimizers, like r.js, check for condition patterns like:
  17355. if (true) {
  17356. // Expose Lodash on the global object to prevent errors when Lodash is
  17357. // loaded by a script tag in the presence of an AMD loader.
  17358. // See http://requirejs.org/docs/errors.html#mismatch for more details.
  17359. // Use `_.noConflict` to remove Lodash from the global object.
  17360. root._ = _;
  17361. // Define as an anonymous module so, through path mapping, it can be
  17362. // referenced as the "underscore" module.
  17363. !(__WEBPACK_AMD_DEFINE_RESULT__ = (function() {
  17364. return _;
  17365. }).call(exports, __webpack_require__, exports, module),
  17366. __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
  17367. }
  17368. // Check for `exports` after `define` in case a build optimizer adds it.
  17369. else {}
  17370. }.call(this));
  17371. /***/ }),
  17372. /***/ "./node_modules/style-loader/dist/cjs.js!./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/layouts/Dashboard/Components/Sidebar.vue?vue&type=style&index=0&id=5b49aa22&lang=scss&scoped=true":
  17373. /*!*******************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  17374. !*** ./node_modules/style-loader/dist/cjs.js!./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/layouts/Dashboard/Components/Sidebar.vue?vue&type=style&index=0&id=5b49aa22&lang=scss&scoped=true ***!
  17375. \*******************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  17376. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17377. "use strict";
  17378. __webpack_require__.r(__webpack_exports__);
  17379. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17380. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17381. /* harmony export */ });
  17382. /* 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");
  17383. /* 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__);
  17384. /* harmony import */ var _node_modules_css_loader_dist_cjs_js_clonedRuleSet_11_use_1_node_modules_vue_loader_dist_stylePostLoader_js_node_modules_postcss_loader_dist_cjs_js_clonedRuleSet_11_use_2_node_modules_sass_loader_dist_cjs_js_clonedRuleSet_11_use_3_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_Sidebar_vue_vue_type_style_index_0_id_5b49aa22_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! !!../../../../../node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!../../../../../node_modules/vue-loader/dist/stylePostLoader.js!../../../../../node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!../../../../../node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!../../../../../node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./Sidebar.vue?vue&type=style&index=0&id=5b49aa22&lang=scss&scoped=true */ "./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/layouts/Dashboard/Components/Sidebar.vue?vue&type=style&index=0&id=5b49aa22&lang=scss&scoped=true");
  17385. var options = {};
  17386. options.insert = "head";
  17387. options.singleton = false;
  17388. var update = _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default()(_node_modules_css_loader_dist_cjs_js_clonedRuleSet_11_use_1_node_modules_vue_loader_dist_stylePostLoader_js_node_modules_postcss_loader_dist_cjs_js_clonedRuleSet_11_use_2_node_modules_sass_loader_dist_cjs_js_clonedRuleSet_11_use_3_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_Sidebar_vue_vue_type_style_index_0_id_5b49aa22_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_1__["default"], options);
  17389. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (_node_modules_css_loader_dist_cjs_js_clonedRuleSet_11_use_1_node_modules_vue_loader_dist_stylePostLoader_js_node_modules_postcss_loader_dist_cjs_js_clonedRuleSet_11_use_2_node_modules_sass_loader_dist_cjs_js_clonedRuleSet_11_use_3_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_Sidebar_vue_vue_type_style_index_0_id_5b49aa22_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_1__["default"].locals || {});
  17390. /***/ }),
  17391. /***/ "./node_modules/style-loader/dist/cjs.js!./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/layouts/Dashboard/Components/SubSidebar.vue?vue&type=style&index=0&id=b1b23eb4&lang=scss&scoped=true":
  17392. /*!**********************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  17393. !*** ./node_modules/style-loader/dist/cjs.js!./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/layouts/Dashboard/Components/SubSidebar.vue?vue&type=style&index=0&id=b1b23eb4&lang=scss&scoped=true ***!
  17394. \**********************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  17395. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17396. "use strict";
  17397. __webpack_require__.r(__webpack_exports__);
  17398. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17399. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17400. /* harmony export */ });
  17401. /* 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");
  17402. /* 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__);
  17403. /* harmony import */ var _node_modules_css_loader_dist_cjs_js_clonedRuleSet_11_use_1_node_modules_vue_loader_dist_stylePostLoader_js_node_modules_postcss_loader_dist_cjs_js_clonedRuleSet_11_use_2_node_modules_sass_loader_dist_cjs_js_clonedRuleSet_11_use_3_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_SubSidebar_vue_vue_type_style_index_0_id_b1b23eb4_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! !!../../../../../node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!../../../../../node_modules/vue-loader/dist/stylePostLoader.js!../../../../../node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!../../../../../node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!../../../../../node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./SubSidebar.vue?vue&type=style&index=0&id=b1b23eb4&lang=scss&scoped=true */ "./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/layouts/Dashboard/Components/SubSidebar.vue?vue&type=style&index=0&id=b1b23eb4&lang=scss&scoped=true");
  17404. var options = {};
  17405. options.insert = "head";
  17406. options.singleton = false;
  17407. var update = _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default()(_node_modules_css_loader_dist_cjs_js_clonedRuleSet_11_use_1_node_modules_vue_loader_dist_stylePostLoader_js_node_modules_postcss_loader_dist_cjs_js_clonedRuleSet_11_use_2_node_modules_sass_loader_dist_cjs_js_clonedRuleSet_11_use_3_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_SubSidebar_vue_vue_type_style_index_0_id_b1b23eb4_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_1__["default"], options);
  17408. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (_node_modules_css_loader_dist_cjs_js_clonedRuleSet_11_use_1_node_modules_vue_loader_dist_stylePostLoader_js_node_modules_postcss_loader_dist_cjs_js_clonedRuleSet_11_use_2_node_modules_sass_loader_dist_cjs_js_clonedRuleSet_11_use_3_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_SubSidebar_vue_vue_type_style_index_0_id_b1b23eb4_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_1__["default"].locals || {});
  17409. /***/ }),
  17410. /***/ "./node_modules/style-loader/dist/cjs.js!./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/layouts/Dashboard/Components/TopBar.vue?vue&type=style&index=0&id=0b7edbb0&lang=scss&scoped=true":
  17411. /*!******************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  17412. !*** ./node_modules/style-loader/dist/cjs.js!./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/layouts/Dashboard/Components/TopBar.vue?vue&type=style&index=0&id=0b7edbb0&lang=scss&scoped=true ***!
  17413. \******************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  17414. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17415. "use strict";
  17416. __webpack_require__.r(__webpack_exports__);
  17417. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17418. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17419. /* harmony export */ });
  17420. /* 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");
  17421. /* 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__);
  17422. /* harmony import */ var _node_modules_css_loader_dist_cjs_js_clonedRuleSet_11_use_1_node_modules_vue_loader_dist_stylePostLoader_js_node_modules_postcss_loader_dist_cjs_js_clonedRuleSet_11_use_2_node_modules_sass_loader_dist_cjs_js_clonedRuleSet_11_use_3_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_TopBar_vue_vue_type_style_index_0_id_0b7edbb0_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! !!../../../../../node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!../../../../../node_modules/vue-loader/dist/stylePostLoader.js!../../../../../node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!../../../../../node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!../../../../../node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./TopBar.vue?vue&type=style&index=0&id=0b7edbb0&lang=scss&scoped=true */ "./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/layouts/Dashboard/Components/TopBar.vue?vue&type=style&index=0&id=0b7edbb0&lang=scss&scoped=true");
  17423. var options = {};
  17424. options.insert = "head";
  17425. options.singleton = false;
  17426. var update = _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default()(_node_modules_css_loader_dist_cjs_js_clonedRuleSet_11_use_1_node_modules_vue_loader_dist_stylePostLoader_js_node_modules_postcss_loader_dist_cjs_js_clonedRuleSet_11_use_2_node_modules_sass_loader_dist_cjs_js_clonedRuleSet_11_use_3_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_TopBar_vue_vue_type_style_index_0_id_0b7edbb0_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_1__["default"], options);
  17427. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (_node_modules_css_loader_dist_cjs_js_clonedRuleSet_11_use_1_node_modules_vue_loader_dist_stylePostLoader_js_node_modules_postcss_loader_dist_cjs_js_clonedRuleSet_11_use_2_node_modules_sass_loader_dist_cjs_js_clonedRuleSet_11_use_3_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_TopBar_vue_vue_type_style_index_0_id_0b7edbb0_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_1__["default"].locals || {});
  17428. /***/ }),
  17429. /***/ "./node_modules/style-loader/dist/cjs.js!./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/layouts/Dashboard/DashboardLayout.vue?vue&type=style&index=0&id=1d279fe2&lang=scss&scoped=true":
  17430. /*!****************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\
  17431. !*** ./node_modules/style-loader/dist/cjs.js!./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/layouts/Dashboard/DashboardLayout.vue?vue&type=style&index=0&id=1d279fe2&lang=scss&scoped=true ***!
  17432. \****************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/
  17433. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17434. "use strict";
  17435. __webpack_require__.r(__webpack_exports__);
  17436. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17437. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17438. /* harmony export */ });
  17439. /* 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");
  17440. /* 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__);
  17441. /* harmony import */ var _node_modules_css_loader_dist_cjs_js_clonedRuleSet_11_use_1_node_modules_vue_loader_dist_stylePostLoader_js_node_modules_postcss_loader_dist_cjs_js_clonedRuleSet_11_use_2_node_modules_sass_loader_dist_cjs_js_clonedRuleSet_11_use_3_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_DashboardLayout_vue_vue_type_style_index_0_id_1d279fe2_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! !!../../../../node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!../../../../node_modules/vue-loader/dist/stylePostLoader.js!../../../../node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!../../../../node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!../../../../node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./DashboardLayout.vue?vue&type=style&index=0&id=1d279fe2&lang=scss&scoped=true */ "./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/layouts/Dashboard/DashboardLayout.vue?vue&type=style&index=0&id=1d279fe2&lang=scss&scoped=true");
  17442. var options = {};
  17443. options.insert = "head";
  17444. options.singleton = false;
  17445. var update = _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default()(_node_modules_css_loader_dist_cjs_js_clonedRuleSet_11_use_1_node_modules_vue_loader_dist_stylePostLoader_js_node_modules_postcss_loader_dist_cjs_js_clonedRuleSet_11_use_2_node_modules_sass_loader_dist_cjs_js_clonedRuleSet_11_use_3_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_DashboardLayout_vue_vue_type_style_index_0_id_1d279fe2_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_1__["default"], options);
  17446. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (_node_modules_css_loader_dist_cjs_js_clonedRuleSet_11_use_1_node_modules_vue_loader_dist_stylePostLoader_js_node_modules_postcss_loader_dist_cjs_js_clonedRuleSet_11_use_2_node_modules_sass_loader_dist_cjs_js_clonedRuleSet_11_use_3_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_DashboardLayout_vue_vue_type_style_index_0_id_1d279fe2_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_1__["default"].locals || {});
  17447. /***/ }),
  17448. /***/ "./node_modules/vue-loader/dist/exportHelper.js":
  17449. /*!******************************************************!*\
  17450. !*** ./node_modules/vue-loader/dist/exportHelper.js ***!
  17451. \******************************************************/
  17452. /***/ ((__unused_webpack_module, exports) => {
  17453. "use strict";
  17454. Object.defineProperty(exports, "__esModule", ({ value: true }));
  17455. // runtime helper for setting properties on components
  17456. // in a tree-shakable way
  17457. exports["default"] = (sfc, props) => {
  17458. const target = sfc.__vccOpts || sfc;
  17459. for (const [key, val] of props) {
  17460. target[key] = val;
  17461. }
  17462. return target;
  17463. };
  17464. /***/ }),
  17465. /***/ "./resources/js/components/AppButtonLink.vue":
  17466. /*!***************************************************!*\
  17467. !*** ./resources/js/components/AppButtonLink.vue ***!
  17468. \***************************************************/
  17469. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17470. "use strict";
  17471. __webpack_require__.r(__webpack_exports__);
  17472. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17473. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17474. /* harmony export */ });
  17475. /* 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");
  17476. /* 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");
  17477. /* 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");
  17478. ;
  17479. 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"]])
  17480. /* hot reload */
  17481. if (false) {}
  17482. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__);
  17483. /***/ }),
  17484. /***/ "./resources/js/components/AppMessage.vue":
  17485. /*!************************************************!*\
  17486. !*** ./resources/js/components/AppMessage.vue ***!
  17487. \************************************************/
  17488. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17489. "use strict";
  17490. __webpack_require__.r(__webpack_exports__);
  17491. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17492. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17493. /* harmony export */ });
  17494. /* 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");
  17495. /* 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");
  17496. /* 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");
  17497. ;
  17498. const __exports__ = /*#__PURE__*/(0,_media_dijitalcode_3ad9c6e0_4296_4a57_b136_144df49e7bb8_Projects_cahaya_agung_node_modules_vue_loader_dist_exportHelper_js__WEBPACK_IMPORTED_MODULE_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"]])
  17499. /* hot reload */
  17500. if (false) {}
  17501. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__);
  17502. /***/ }),
  17503. /***/ "./resources/js/components/AppPagination.vue":
  17504. /*!***************************************************!*\
  17505. !*** ./resources/js/components/AppPagination.vue ***!
  17506. \***************************************************/
  17507. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17508. "use strict";
  17509. __webpack_require__.r(__webpack_exports__);
  17510. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17511. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17512. /* harmony export */ });
  17513. /* harmony import */ var _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");
  17514. /* 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");
  17515. /* harmony import */ var _media_dijitalcode_3ad9c6e0_4296_4a57_b136_144df49e7bb8_Projects_cahaya_agung_node_modules_vue_loader_dist_exportHelper_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./node_modules/vue-loader/dist/exportHelper.js */ "./node_modules/vue-loader/dist/exportHelper.js");
  17516. ;
  17517. const __exports__ = /*#__PURE__*/(0,_media_dijitalcode_3ad9c6e0_4296_4a57_b136_144df49e7bb8_Projects_cahaya_agung_node_modules_vue_loader_dist_exportHelper_js__WEBPACK_IMPORTED_MODULE_2__["default"])(_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"]])
  17518. /* hot reload */
  17519. if (false) {}
  17520. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__);
  17521. /***/ }),
  17522. /***/ "./resources/js/components/AppSearch.vue":
  17523. /*!***********************************************!*\
  17524. !*** ./resources/js/components/AppSearch.vue ***!
  17525. \***********************************************/
  17526. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17527. "use strict";
  17528. __webpack_require__.r(__webpack_exports__);
  17529. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17530. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17531. /* harmony export */ });
  17532. /* harmony import */ var _AppSearch_vue_vue_type_template_id_5b9fdcce__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./AppSearch.vue?vue&type=template&id=5b9fdcce */ "./resources/js/components/AppSearch.vue?vue&type=template&id=5b9fdcce");
  17533. /* harmony import */ var _AppSearch_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./AppSearch.vue?vue&type=script&setup=true&lang=js */ "./resources/js/components/AppSearch.vue?vue&type=script&setup=true&lang=js");
  17534. /* 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");
  17535. ;
  17536. const __exports__ = /*#__PURE__*/(0,_media_dijitalcode_3ad9c6e0_4296_4a57_b136_144df49e7bb8_Projects_cahaya_agung_node_modules_vue_loader_dist_exportHelper_js__WEBPACK_IMPORTED_MODULE_2__["default"])(_AppSearch_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_1__["default"], [['render',_AppSearch_vue_vue_type_template_id_5b9fdcce__WEBPACK_IMPORTED_MODULE_0__.render],['__file',"resources/js/components/AppSearch.vue"]])
  17537. /* hot reload */
  17538. if (false) {}
  17539. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__);
  17540. /***/ }),
  17541. /***/ "./resources/js/layouts/Dashboard/Components/Footer.vue":
  17542. /*!**************************************************************!*\
  17543. !*** ./resources/js/layouts/Dashboard/Components/Footer.vue ***!
  17544. \**************************************************************/
  17545. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17546. "use strict";
  17547. __webpack_require__.r(__webpack_exports__);
  17548. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17549. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17550. /* harmony export */ });
  17551. /* harmony import */ var _Footer_vue_vue_type_template_id_dbb3aa76__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./Footer.vue?vue&type=template&id=dbb3aa76 */ "./resources/js/layouts/Dashboard/Components/Footer.vue?vue&type=template&id=dbb3aa76");
  17552. /* harmony import */ var _media_dijitalcode_3ad9c6e0_4296_4a57_b136_144df49e7bb8_Projects_cahaya_agung_node_modules_vue_loader_dist_exportHelper_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./node_modules/vue-loader/dist/exportHelper.js */ "./node_modules/vue-loader/dist/exportHelper.js");
  17553. const script = {}
  17554. ;
  17555. const __exports__ = /*#__PURE__*/(0,_media_dijitalcode_3ad9c6e0_4296_4a57_b136_144df49e7bb8_Projects_cahaya_agung_node_modules_vue_loader_dist_exportHelper_js__WEBPACK_IMPORTED_MODULE_1__["default"])(script, [['render',_Footer_vue_vue_type_template_id_dbb3aa76__WEBPACK_IMPORTED_MODULE_0__.render],['__file',"resources/js/layouts/Dashboard/Components/Footer.vue"]])
  17556. /* hot reload */
  17557. if (false) {}
  17558. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__);
  17559. /***/ }),
  17560. /***/ "./resources/js/layouts/Dashboard/Components/Sidebar.vue":
  17561. /*!***************************************************************!*\
  17562. !*** ./resources/js/layouts/Dashboard/Components/Sidebar.vue ***!
  17563. \***************************************************************/
  17564. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17565. "use strict";
  17566. __webpack_require__.r(__webpack_exports__);
  17567. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17568. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17569. /* harmony export */ });
  17570. /* harmony import */ var _Sidebar_vue_vue_type_template_id_5b49aa22_scoped_true__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./Sidebar.vue?vue&type=template&id=5b49aa22&scoped=true */ "./resources/js/layouts/Dashboard/Components/Sidebar.vue?vue&type=template&id=5b49aa22&scoped=true");
  17571. /* harmony import */ var _Sidebar_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./Sidebar.vue?vue&type=script&setup=true&lang=js */ "./resources/js/layouts/Dashboard/Components/Sidebar.vue?vue&type=script&setup=true&lang=js");
  17572. /* harmony import */ var _Sidebar_vue_vue_type_style_index_0_id_5b49aa22_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./Sidebar.vue?vue&type=style&index=0&id=5b49aa22&lang=scss&scoped=true */ "./resources/js/layouts/Dashboard/Components/Sidebar.vue?vue&type=style&index=0&id=5b49aa22&lang=scss&scoped=true");
  17573. /* 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");
  17574. ;
  17575. const __exports__ = /*#__PURE__*/(0,_media_dijitalcode_3ad9c6e0_4296_4a57_b136_144df49e7bb8_Projects_cahaya_agung_node_modules_vue_loader_dist_exportHelper_js__WEBPACK_IMPORTED_MODULE_3__["default"])(_Sidebar_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_1__["default"], [['render',_Sidebar_vue_vue_type_template_id_5b49aa22_scoped_true__WEBPACK_IMPORTED_MODULE_0__.render],['__scopeId',"data-v-5b49aa22"],['__file',"resources/js/layouts/Dashboard/Components/Sidebar.vue"]])
  17576. /* hot reload */
  17577. if (false) {}
  17578. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__);
  17579. /***/ }),
  17580. /***/ "./resources/js/layouts/Dashboard/Components/SubSidebar.vue":
  17581. /*!******************************************************************!*\
  17582. !*** ./resources/js/layouts/Dashboard/Components/SubSidebar.vue ***!
  17583. \******************************************************************/
  17584. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17585. "use strict";
  17586. __webpack_require__.r(__webpack_exports__);
  17587. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17588. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17589. /* harmony export */ });
  17590. /* harmony import */ var _SubSidebar_vue_vue_type_template_id_b1b23eb4_scoped_true__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./SubSidebar.vue?vue&type=template&id=b1b23eb4&scoped=true */ "./resources/js/layouts/Dashboard/Components/SubSidebar.vue?vue&type=template&id=b1b23eb4&scoped=true");
  17591. /* harmony import */ var _SubSidebar_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./SubSidebar.vue?vue&type=script&setup=true&lang=js */ "./resources/js/layouts/Dashboard/Components/SubSidebar.vue?vue&type=script&setup=true&lang=js");
  17592. /* harmony import */ var _SubSidebar_vue_vue_type_style_index_0_id_b1b23eb4_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./SubSidebar.vue?vue&type=style&index=0&id=b1b23eb4&lang=scss&scoped=true */ "./resources/js/layouts/Dashboard/Components/SubSidebar.vue?vue&type=style&index=0&id=b1b23eb4&lang=scss&scoped=true");
  17593. /* harmony import */ var _media_dijitalcode_3ad9c6e0_4296_4a57_b136_144df49e7bb8_Projects_cahaya_agung_node_modules_vue_loader_dist_exportHelper_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./node_modules/vue-loader/dist/exportHelper.js */ "./node_modules/vue-loader/dist/exportHelper.js");
  17594. ;
  17595. const __exports__ = /*#__PURE__*/(0,_media_dijitalcode_3ad9c6e0_4296_4a57_b136_144df49e7bb8_Projects_cahaya_agung_node_modules_vue_loader_dist_exportHelper_js__WEBPACK_IMPORTED_MODULE_3__["default"])(_SubSidebar_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_1__["default"], [['render',_SubSidebar_vue_vue_type_template_id_b1b23eb4_scoped_true__WEBPACK_IMPORTED_MODULE_0__.render],['__scopeId',"data-v-b1b23eb4"],['__file',"resources/js/layouts/Dashboard/Components/SubSidebar.vue"]])
  17596. /* hot reload */
  17597. if (false) {}
  17598. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__);
  17599. /***/ }),
  17600. /***/ "./resources/js/layouts/Dashboard/Components/TopBar.vue":
  17601. /*!**************************************************************!*\
  17602. !*** ./resources/js/layouts/Dashboard/Components/TopBar.vue ***!
  17603. \**************************************************************/
  17604. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17605. "use strict";
  17606. __webpack_require__.r(__webpack_exports__);
  17607. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17608. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17609. /* harmony export */ });
  17610. /* harmony import */ var _TopBar_vue_vue_type_template_id_0b7edbb0_scoped_true__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./TopBar.vue?vue&type=template&id=0b7edbb0&scoped=true */ "./resources/js/layouts/Dashboard/Components/TopBar.vue?vue&type=template&id=0b7edbb0&scoped=true");
  17611. /* harmony import */ var _TopBar_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./TopBar.vue?vue&type=script&setup=true&lang=js */ "./resources/js/layouts/Dashboard/Components/TopBar.vue?vue&type=script&setup=true&lang=js");
  17612. /* harmony import */ var _TopBar_vue_vue_type_style_index_0_id_0b7edbb0_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./TopBar.vue?vue&type=style&index=0&id=0b7edbb0&lang=scss&scoped=true */ "./resources/js/layouts/Dashboard/Components/TopBar.vue?vue&type=style&index=0&id=0b7edbb0&lang=scss&scoped=true");
  17613. /* harmony import */ var _media_dijitalcode_3ad9c6e0_4296_4a57_b136_144df49e7bb8_Projects_cahaya_agung_node_modules_vue_loader_dist_exportHelper_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./node_modules/vue-loader/dist/exportHelper.js */ "./node_modules/vue-loader/dist/exportHelper.js");
  17614. ;
  17615. const __exports__ = /*#__PURE__*/(0,_media_dijitalcode_3ad9c6e0_4296_4a57_b136_144df49e7bb8_Projects_cahaya_agung_node_modules_vue_loader_dist_exportHelper_js__WEBPACK_IMPORTED_MODULE_3__["default"])(_TopBar_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_1__["default"], [['render',_TopBar_vue_vue_type_template_id_0b7edbb0_scoped_true__WEBPACK_IMPORTED_MODULE_0__.render],['__scopeId',"data-v-0b7edbb0"],['__file',"resources/js/layouts/Dashboard/Components/TopBar.vue"]])
  17616. /* hot reload */
  17617. if (false) {}
  17618. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__);
  17619. /***/ }),
  17620. /***/ "./resources/js/layouts/Dashboard/DashboardLayout.vue":
  17621. /*!************************************************************!*\
  17622. !*** ./resources/js/layouts/Dashboard/DashboardLayout.vue ***!
  17623. \************************************************************/
  17624. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17625. "use strict";
  17626. __webpack_require__.r(__webpack_exports__);
  17627. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17628. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17629. /* harmony export */ });
  17630. /* harmony import */ var _DashboardLayout_vue_vue_type_template_id_1d279fe2_scoped_true__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./DashboardLayout.vue?vue&type=template&id=1d279fe2&scoped=true */ "./resources/js/layouts/Dashboard/DashboardLayout.vue?vue&type=template&id=1d279fe2&scoped=true");
  17631. /* harmony import */ var _DashboardLayout_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./DashboardLayout.vue?vue&type=script&setup=true&lang=js */ "./resources/js/layouts/Dashboard/DashboardLayout.vue?vue&type=script&setup=true&lang=js");
  17632. /* harmony import */ var _DashboardLayout_vue_vue_type_style_index_0_id_1d279fe2_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./DashboardLayout.vue?vue&type=style&index=0&id=1d279fe2&lang=scss&scoped=true */ "./resources/js/layouts/Dashboard/DashboardLayout.vue?vue&type=style&index=0&id=1d279fe2&lang=scss&scoped=true");
  17633. /* harmony import */ var _media_dijitalcode_3ad9c6e0_4296_4a57_b136_144df49e7bb8_Projects_cahaya_agung_node_modules_vue_loader_dist_exportHelper_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./node_modules/vue-loader/dist/exportHelper.js */ "./node_modules/vue-loader/dist/exportHelper.js");
  17634. ;
  17635. const __exports__ = /*#__PURE__*/(0,_media_dijitalcode_3ad9c6e0_4296_4a57_b136_144df49e7bb8_Projects_cahaya_agung_node_modules_vue_loader_dist_exportHelper_js__WEBPACK_IMPORTED_MODULE_3__["default"])(_DashboardLayout_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_1__["default"], [['render',_DashboardLayout_vue_vue_type_template_id_1d279fe2_scoped_true__WEBPACK_IMPORTED_MODULE_0__.render],['__scopeId',"data-v-1d279fe2"],['__file',"resources/js/layouts/Dashboard/DashboardLayout.vue"]])
  17636. /* hot reload */
  17637. if (false) {}
  17638. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__);
  17639. /***/ }),
  17640. /***/ "./resources/js/pages/Sales/Index.vue":
  17641. /*!********************************************!*\
  17642. !*** ./resources/js/pages/Sales/Index.vue ***!
  17643. \********************************************/
  17644. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17645. "use strict";
  17646. __webpack_require__.r(__webpack_exports__);
  17647. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17648. /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
  17649. /* harmony export */ });
  17650. /* harmony import */ var _Index_vue_vue_type_template_id_7c234776__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./Index.vue?vue&type=template&id=7c234776 */ "./resources/js/pages/Sales/Index.vue?vue&type=template&id=7c234776");
  17651. /* 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/Sales/Index.vue?vue&type=script&setup=true&lang=js");
  17652. /* 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");
  17653. ;
  17654. 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_7c234776__WEBPACK_IMPORTED_MODULE_0__.render],['__file',"resources/js/pages/Sales/Index.vue"]])
  17655. /* hot reload */
  17656. if (false) {}
  17657. /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (__exports__);
  17658. /***/ }),
  17659. /***/ "./resources/js/components/AppButtonLink.vue?vue&type=script&setup=true&lang=js":
  17660. /*!**************************************************************************************!*\
  17661. !*** ./resources/js/components/AppButtonLink.vue?vue&type=script&setup=true&lang=js ***!
  17662. \**************************************************************************************/
  17663. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17664. "use strict";
  17665. __webpack_require__.r(__webpack_exports__);
  17666. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17667. /* 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"])
  17668. /* harmony export */ });
  17669. /* 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");
  17670. /***/ }),
  17671. /***/ "./resources/js/components/AppMessage.vue?vue&type=script&setup=true&lang=js":
  17672. /*!***********************************************************************************!*\
  17673. !*** ./resources/js/components/AppMessage.vue?vue&type=script&setup=true&lang=js ***!
  17674. \***********************************************************************************/
  17675. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17676. "use strict";
  17677. __webpack_require__.r(__webpack_exports__);
  17678. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17679. /* 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"])
  17680. /* harmony export */ });
  17681. /* 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");
  17682. /***/ }),
  17683. /***/ "./resources/js/components/AppPagination.vue?vue&type=script&setup=true&lang=js":
  17684. /*!**************************************************************************************!*\
  17685. !*** ./resources/js/components/AppPagination.vue?vue&type=script&setup=true&lang=js ***!
  17686. \**************************************************************************************/
  17687. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17688. "use strict";
  17689. __webpack_require__.r(__webpack_exports__);
  17690. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17691. /* 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"])
  17692. /* harmony export */ });
  17693. /* 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");
  17694. /***/ }),
  17695. /***/ "./resources/js/components/AppSearch.vue?vue&type=script&setup=true&lang=js":
  17696. /*!**********************************************************************************!*\
  17697. !*** ./resources/js/components/AppSearch.vue?vue&type=script&setup=true&lang=js ***!
  17698. \**********************************************************************************/
  17699. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17700. "use strict";
  17701. __webpack_require__.r(__webpack_exports__);
  17702. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17703. /* harmony export */ "default": () => (/* reexport safe */ _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_AppSearch_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_0__["default"])
  17704. /* harmony export */ });
  17705. /* harmony import */ var _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_AppSearch_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!../../../node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./AppSearch.vue?vue&type=script&setup=true&lang=js */ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppSearch.vue?vue&type=script&setup=true&lang=js");
  17706. /***/ }),
  17707. /***/ "./resources/js/layouts/Dashboard/Components/Sidebar.vue?vue&type=script&setup=true&lang=js":
  17708. /*!**************************************************************************************************!*\
  17709. !*** ./resources/js/layouts/Dashboard/Components/Sidebar.vue?vue&type=script&setup=true&lang=js ***!
  17710. \**************************************************************************************************/
  17711. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17712. "use strict";
  17713. __webpack_require__.r(__webpack_exports__);
  17714. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17715. /* harmony export */ "default": () => (/* reexport safe */ _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_Sidebar_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_0__["default"])
  17716. /* harmony export */ });
  17717. /* harmony import */ var _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_Sidebar_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../../../node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!../../../../../node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./Sidebar.vue?vue&type=script&setup=true&lang=js */ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/layouts/Dashboard/Components/Sidebar.vue?vue&type=script&setup=true&lang=js");
  17718. /***/ }),
  17719. /***/ "./resources/js/layouts/Dashboard/Components/SubSidebar.vue?vue&type=script&setup=true&lang=js":
  17720. /*!*****************************************************************************************************!*\
  17721. !*** ./resources/js/layouts/Dashboard/Components/SubSidebar.vue?vue&type=script&setup=true&lang=js ***!
  17722. \*****************************************************************************************************/
  17723. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17724. "use strict";
  17725. __webpack_require__.r(__webpack_exports__);
  17726. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17727. /* harmony export */ "default": () => (/* reexport safe */ _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_SubSidebar_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_0__["default"])
  17728. /* harmony export */ });
  17729. /* harmony import */ var _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_SubSidebar_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../../../node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!../../../../../node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./SubSidebar.vue?vue&type=script&setup=true&lang=js */ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/layouts/Dashboard/Components/SubSidebar.vue?vue&type=script&setup=true&lang=js");
  17730. /***/ }),
  17731. /***/ "./resources/js/layouts/Dashboard/Components/TopBar.vue?vue&type=script&setup=true&lang=js":
  17732. /*!*************************************************************************************************!*\
  17733. !*** ./resources/js/layouts/Dashboard/Components/TopBar.vue?vue&type=script&setup=true&lang=js ***!
  17734. \*************************************************************************************************/
  17735. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17736. "use strict";
  17737. __webpack_require__.r(__webpack_exports__);
  17738. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17739. /* harmony export */ "default": () => (/* reexport safe */ _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_TopBar_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_0__["default"])
  17740. /* harmony export */ });
  17741. /* harmony import */ var _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_TopBar_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../../../node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!../../../../../node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./TopBar.vue?vue&type=script&setup=true&lang=js */ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/layouts/Dashboard/Components/TopBar.vue?vue&type=script&setup=true&lang=js");
  17742. /***/ }),
  17743. /***/ "./resources/js/layouts/Dashboard/DashboardLayout.vue?vue&type=script&setup=true&lang=js":
  17744. /*!***********************************************************************************************!*\
  17745. !*** ./resources/js/layouts/Dashboard/DashboardLayout.vue?vue&type=script&setup=true&lang=js ***!
  17746. \***********************************************************************************************/
  17747. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17748. "use strict";
  17749. __webpack_require__.r(__webpack_exports__);
  17750. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17751. /* 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"])
  17752. /* harmony export */ });
  17753. /* harmony import */ var _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_DashboardLayout_vue_vue_type_script_setup_true_lang_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../../node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!../../../../node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./DashboardLayout.vue?vue&type=script&setup=true&lang=js */ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/layouts/Dashboard/DashboardLayout.vue?vue&type=script&setup=true&lang=js");
  17754. /***/ }),
  17755. /***/ "./resources/js/pages/Sales/Index.vue?vue&type=script&setup=true&lang=js":
  17756. /*!*******************************************************************************!*\
  17757. !*** ./resources/js/pages/Sales/Index.vue?vue&type=script&setup=true&lang=js ***!
  17758. \*******************************************************************************/
  17759. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17760. "use strict";
  17761. __webpack_require__.r(__webpack_exports__);
  17762. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17763. /* 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"])
  17764. /* harmony export */ });
  17765. /* 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/Sales/Index.vue?vue&type=script&setup=true&lang=js");
  17766. /***/ }),
  17767. /***/ "./resources/js/components/AppButtonLink.vue?vue&type=template&id=c3621f1c":
  17768. /*!*********************************************************************************!*\
  17769. !*** ./resources/js/components/AppButtonLink.vue?vue&type=template&id=c3621f1c ***!
  17770. \*********************************************************************************/
  17771. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17772. "use strict";
  17773. __webpack_require__.r(__webpack_exports__);
  17774. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17775. /* 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)
  17776. /* harmony export */ });
  17777. /* 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");
  17778. /***/ }),
  17779. /***/ "./resources/js/components/AppMessage.vue?vue&type=template&id=07159051":
  17780. /*!******************************************************************************!*\
  17781. !*** ./resources/js/components/AppMessage.vue?vue&type=template&id=07159051 ***!
  17782. \******************************************************************************/
  17783. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17784. "use strict";
  17785. __webpack_require__.r(__webpack_exports__);
  17786. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17787. /* 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)
  17788. /* harmony export */ });
  17789. /* 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");
  17790. /***/ }),
  17791. /***/ "./resources/js/components/AppPagination.vue?vue&type=template&id=4da56ec0":
  17792. /*!*********************************************************************************!*\
  17793. !*** ./resources/js/components/AppPagination.vue?vue&type=template&id=4da56ec0 ***!
  17794. \*********************************************************************************/
  17795. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17796. "use strict";
  17797. __webpack_require__.r(__webpack_exports__);
  17798. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17799. /* 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)
  17800. /* harmony export */ });
  17801. /* 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");
  17802. /***/ }),
  17803. /***/ "./resources/js/components/AppSearch.vue?vue&type=template&id=5b9fdcce":
  17804. /*!*****************************************************************************!*\
  17805. !*** ./resources/js/components/AppSearch.vue?vue&type=template&id=5b9fdcce ***!
  17806. \*****************************************************************************/
  17807. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17808. "use strict";
  17809. __webpack_require__.r(__webpack_exports__);
  17810. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17811. /* harmony export */ "render": () => (/* reexport safe */ _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_templateLoader_js_ruleSet_1_rules_2_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_AppSearch_vue_vue_type_template_id_5b9fdcce__WEBPACK_IMPORTED_MODULE_0__.render)
  17812. /* harmony export */ });
  17813. /* harmony import */ var _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_templateLoader_js_ruleSet_1_rules_2_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_AppSearch_vue_vue_type_template_id_5b9fdcce__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!../../../node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!../../../node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./AppSearch.vue?vue&type=template&id=5b9fdcce */ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/components/AppSearch.vue?vue&type=template&id=5b9fdcce");
  17814. /***/ }),
  17815. /***/ "./resources/js/layouts/Dashboard/Components/Footer.vue?vue&type=template&id=dbb3aa76":
  17816. /*!********************************************************************************************!*\
  17817. !*** ./resources/js/layouts/Dashboard/Components/Footer.vue?vue&type=template&id=dbb3aa76 ***!
  17818. \********************************************************************************************/
  17819. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17820. "use strict";
  17821. __webpack_require__.r(__webpack_exports__);
  17822. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17823. /* harmony export */ "render": () => (/* reexport safe */ _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_templateLoader_js_ruleSet_1_rules_2_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_Footer_vue_vue_type_template_id_dbb3aa76__WEBPACK_IMPORTED_MODULE_0__.render)
  17824. /* harmony export */ });
  17825. /* harmony import */ var _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_templateLoader_js_ruleSet_1_rules_2_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_Footer_vue_vue_type_template_id_dbb3aa76__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../../../node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!../../../../../node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!../../../../../node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./Footer.vue?vue&type=template&id=dbb3aa76 */ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/layouts/Dashboard/Components/Footer.vue?vue&type=template&id=dbb3aa76");
  17826. /***/ }),
  17827. /***/ "./resources/js/layouts/Dashboard/Components/Sidebar.vue?vue&type=template&id=5b49aa22&scoped=true":
  17828. /*!*********************************************************************************************************!*\
  17829. !*** ./resources/js/layouts/Dashboard/Components/Sidebar.vue?vue&type=template&id=5b49aa22&scoped=true ***!
  17830. \*********************************************************************************************************/
  17831. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17832. "use strict";
  17833. __webpack_require__.r(__webpack_exports__);
  17834. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17835. /* harmony export */ "render": () => (/* reexport safe */ _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_templateLoader_js_ruleSet_1_rules_2_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_Sidebar_vue_vue_type_template_id_5b49aa22_scoped_true__WEBPACK_IMPORTED_MODULE_0__.render)
  17836. /* harmony export */ });
  17837. /* harmony import */ var _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_templateLoader_js_ruleSet_1_rules_2_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_Sidebar_vue_vue_type_template_id_5b49aa22_scoped_true__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../../../node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!../../../../../node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!../../../../../node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./Sidebar.vue?vue&type=template&id=5b49aa22&scoped=true */ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/layouts/Dashboard/Components/Sidebar.vue?vue&type=template&id=5b49aa22&scoped=true");
  17838. /***/ }),
  17839. /***/ "./resources/js/layouts/Dashboard/Components/SubSidebar.vue?vue&type=template&id=b1b23eb4&scoped=true":
  17840. /*!************************************************************************************************************!*\
  17841. !*** ./resources/js/layouts/Dashboard/Components/SubSidebar.vue?vue&type=template&id=b1b23eb4&scoped=true ***!
  17842. \************************************************************************************************************/
  17843. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17844. "use strict";
  17845. __webpack_require__.r(__webpack_exports__);
  17846. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17847. /* harmony export */ "render": () => (/* reexport safe */ _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_templateLoader_js_ruleSet_1_rules_2_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_SubSidebar_vue_vue_type_template_id_b1b23eb4_scoped_true__WEBPACK_IMPORTED_MODULE_0__.render)
  17848. /* harmony export */ });
  17849. /* harmony import */ var _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_templateLoader_js_ruleSet_1_rules_2_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_SubSidebar_vue_vue_type_template_id_b1b23eb4_scoped_true__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../../../node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!../../../../../node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!../../../../../node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./SubSidebar.vue?vue&type=template&id=b1b23eb4&scoped=true */ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/layouts/Dashboard/Components/SubSidebar.vue?vue&type=template&id=b1b23eb4&scoped=true");
  17850. /***/ }),
  17851. /***/ "./resources/js/layouts/Dashboard/Components/TopBar.vue?vue&type=template&id=0b7edbb0&scoped=true":
  17852. /*!********************************************************************************************************!*\
  17853. !*** ./resources/js/layouts/Dashboard/Components/TopBar.vue?vue&type=template&id=0b7edbb0&scoped=true ***!
  17854. \********************************************************************************************************/
  17855. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17856. "use strict";
  17857. __webpack_require__.r(__webpack_exports__);
  17858. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17859. /* harmony export */ "render": () => (/* reexport safe */ _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_templateLoader_js_ruleSet_1_rules_2_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_TopBar_vue_vue_type_template_id_0b7edbb0_scoped_true__WEBPACK_IMPORTED_MODULE_0__.render)
  17860. /* harmony export */ });
  17861. /* harmony import */ var _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_templateLoader_js_ruleSet_1_rules_2_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_TopBar_vue_vue_type_template_id_0b7edbb0_scoped_true__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../../../node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!../../../../../node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!../../../../../node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./TopBar.vue?vue&type=template&id=0b7edbb0&scoped=true */ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/layouts/Dashboard/Components/TopBar.vue?vue&type=template&id=0b7edbb0&scoped=true");
  17862. /***/ }),
  17863. /***/ "./resources/js/layouts/Dashboard/DashboardLayout.vue?vue&type=template&id=1d279fe2&scoped=true":
  17864. /*!******************************************************************************************************!*\
  17865. !*** ./resources/js/layouts/Dashboard/DashboardLayout.vue?vue&type=template&id=1d279fe2&scoped=true ***!
  17866. \******************************************************************************************************/
  17867. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17868. "use strict";
  17869. __webpack_require__.r(__webpack_exports__);
  17870. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17871. /* harmony export */ "render": () => (/* reexport safe */ _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_templateLoader_js_ruleSet_1_rules_2_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_DashboardLayout_vue_vue_type_template_id_1d279fe2_scoped_true__WEBPACK_IMPORTED_MODULE_0__.render)
  17872. /* harmony export */ });
  17873. /* harmony import */ var _node_modules_babel_loader_lib_index_js_clonedRuleSet_5_use_0_node_modules_vue_loader_dist_templateLoader_js_ruleSet_1_rules_2_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_DashboardLayout_vue_vue_type_template_id_1d279fe2_scoped_true__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../../node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!../../../../node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!../../../../node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./DashboardLayout.vue?vue&type=template&id=1d279fe2&scoped=true */ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/layouts/Dashboard/DashboardLayout.vue?vue&type=template&id=1d279fe2&scoped=true");
  17874. /***/ }),
  17875. /***/ "./resources/js/pages/Sales/Index.vue?vue&type=template&id=7c234776":
  17876. /*!**************************************************************************!*\
  17877. !*** ./resources/js/pages/Sales/Index.vue?vue&type=template&id=7c234776 ***!
  17878. \**************************************************************************/
  17879. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17880. "use strict";
  17881. __webpack_require__.r(__webpack_exports__);
  17882. /* harmony export */ __webpack_require__.d(__webpack_exports__, {
  17883. /* 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_7c234776__WEBPACK_IMPORTED_MODULE_0__.render)
  17884. /* harmony export */ });
  17885. /* 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_7c234776__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=7c234776 */ "./node_modules/babel-loader/lib/index.js??clonedRuleSet-5.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/Sales/Index.vue?vue&type=template&id=7c234776");
  17886. /***/ }),
  17887. /***/ "./resources/js/layouts/Dashboard/Components/Sidebar.vue?vue&type=style&index=0&id=5b49aa22&lang=scss&scoped=true":
  17888. /*!************************************************************************************************************************!*\
  17889. !*** ./resources/js/layouts/Dashboard/Components/Sidebar.vue?vue&type=style&index=0&id=5b49aa22&lang=scss&scoped=true ***!
  17890. \************************************************************************************************************************/
  17891. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17892. "use strict";
  17893. __webpack_require__.r(__webpack_exports__);
  17894. /* harmony import */ var _node_modules_style_loader_dist_cjs_js_node_modules_css_loader_dist_cjs_js_clonedRuleSet_11_use_1_node_modules_vue_loader_dist_stylePostLoader_js_node_modules_postcss_loader_dist_cjs_js_clonedRuleSet_11_use_2_node_modules_sass_loader_dist_cjs_js_clonedRuleSet_11_use_3_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_Sidebar_vue_vue_type_style_index_0_id_5b49aa22_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../../../node_modules/style-loader/dist/cjs.js!../../../../../node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!../../../../../node_modules/vue-loader/dist/stylePostLoader.js!../../../../../node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!../../../../../node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!../../../../../node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./Sidebar.vue?vue&type=style&index=0&id=5b49aa22&lang=scss&scoped=true */ "./node_modules/style-loader/dist/cjs.js!./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/layouts/Dashboard/Components/Sidebar.vue?vue&type=style&index=0&id=5b49aa22&lang=scss&scoped=true");
  17895. /***/ }),
  17896. /***/ "./resources/js/layouts/Dashboard/Components/SubSidebar.vue?vue&type=style&index=0&id=b1b23eb4&lang=scss&scoped=true":
  17897. /*!***************************************************************************************************************************!*\
  17898. !*** ./resources/js/layouts/Dashboard/Components/SubSidebar.vue?vue&type=style&index=0&id=b1b23eb4&lang=scss&scoped=true ***!
  17899. \***************************************************************************************************************************/
  17900. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17901. "use strict";
  17902. __webpack_require__.r(__webpack_exports__);
  17903. /* harmony import */ var _node_modules_style_loader_dist_cjs_js_node_modules_css_loader_dist_cjs_js_clonedRuleSet_11_use_1_node_modules_vue_loader_dist_stylePostLoader_js_node_modules_postcss_loader_dist_cjs_js_clonedRuleSet_11_use_2_node_modules_sass_loader_dist_cjs_js_clonedRuleSet_11_use_3_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_SubSidebar_vue_vue_type_style_index_0_id_b1b23eb4_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../../../node_modules/style-loader/dist/cjs.js!../../../../../node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!../../../../../node_modules/vue-loader/dist/stylePostLoader.js!../../../../../node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!../../../../../node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!../../../../../node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./SubSidebar.vue?vue&type=style&index=0&id=b1b23eb4&lang=scss&scoped=true */ "./node_modules/style-loader/dist/cjs.js!./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/layouts/Dashboard/Components/SubSidebar.vue?vue&type=style&index=0&id=b1b23eb4&lang=scss&scoped=true");
  17904. /***/ }),
  17905. /***/ "./resources/js/layouts/Dashboard/Components/TopBar.vue?vue&type=style&index=0&id=0b7edbb0&lang=scss&scoped=true":
  17906. /*!***********************************************************************************************************************!*\
  17907. !*** ./resources/js/layouts/Dashboard/Components/TopBar.vue?vue&type=style&index=0&id=0b7edbb0&lang=scss&scoped=true ***!
  17908. \***********************************************************************************************************************/
  17909. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17910. "use strict";
  17911. __webpack_require__.r(__webpack_exports__);
  17912. /* harmony import */ var _node_modules_style_loader_dist_cjs_js_node_modules_css_loader_dist_cjs_js_clonedRuleSet_11_use_1_node_modules_vue_loader_dist_stylePostLoader_js_node_modules_postcss_loader_dist_cjs_js_clonedRuleSet_11_use_2_node_modules_sass_loader_dist_cjs_js_clonedRuleSet_11_use_3_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_TopBar_vue_vue_type_style_index_0_id_0b7edbb0_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../../../node_modules/style-loader/dist/cjs.js!../../../../../node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!../../../../../node_modules/vue-loader/dist/stylePostLoader.js!../../../../../node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!../../../../../node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!../../../../../node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./TopBar.vue?vue&type=style&index=0&id=0b7edbb0&lang=scss&scoped=true */ "./node_modules/style-loader/dist/cjs.js!./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/layouts/Dashboard/Components/TopBar.vue?vue&type=style&index=0&id=0b7edbb0&lang=scss&scoped=true");
  17913. /***/ }),
  17914. /***/ "./resources/js/layouts/Dashboard/DashboardLayout.vue?vue&type=style&index=0&id=1d279fe2&lang=scss&scoped=true":
  17915. /*!*********************************************************************************************************************!*\
  17916. !*** ./resources/js/layouts/Dashboard/DashboardLayout.vue?vue&type=style&index=0&id=1d279fe2&lang=scss&scoped=true ***!
  17917. \*********************************************************************************************************************/
  17918. /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
  17919. "use strict";
  17920. __webpack_require__.r(__webpack_exports__);
  17921. /* harmony import */ var _node_modules_style_loader_dist_cjs_js_node_modules_css_loader_dist_cjs_js_clonedRuleSet_11_use_1_node_modules_vue_loader_dist_stylePostLoader_js_node_modules_postcss_loader_dist_cjs_js_clonedRuleSet_11_use_2_node_modules_sass_loader_dist_cjs_js_clonedRuleSet_11_use_3_node_modules_vue_loader_dist_index_js_ruleSet_0_use_0_DashboardLayout_vue_vue_type_style_index_0_id_1d279fe2_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../../node_modules/style-loader/dist/cjs.js!../../../../node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!../../../../node_modules/vue-loader/dist/stylePostLoader.js!../../../../node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!../../../../node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!../../../../node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./DashboardLayout.vue?vue&type=style&index=0&id=1d279fe2&lang=scss&scoped=true */ "./node_modules/style-loader/dist/cjs.js!./node_modules/css-loader/dist/cjs.js??clonedRuleSet-11.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-11.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-11.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./resources/js/layouts/Dashboard/DashboardLayout.vue?vue&type=style&index=0&id=1d279fe2&lang=scss&scoped=true");
  17922. /***/ })
  17923. }]);